[Gdal-dev] Question about getting fields for features in OGR

Frank Warmerdam fwarmerdam at gmail.com
Mon Apr 4 09:44:03 EDT 2005

On Apr 4, 2005 7:38 AM, Sergey Karin <nil5-ksa at yandex.ru> wrote:
> Hi, Frank. 
> I am using Postgis and OGR for reading data from it. 
> So, Postgis does not  allow to create fields of features with the name that
> consists of two or more words. Because the name of field is the name of
> table column.  But I want. So, I have created a table that contain
> corresponding names that can consists of two or more words. And I have
> developed a lot of functions that returns the names. 
> Now, I want to use OGR for reading fields of features. As I understood OGR use the name of table column as the name of field. 
> The question is: How I can get names of fields that consists of two or more
> words through OGR (using driver for postgis). 


OGR doesn't apply any apriori limitations on what can be used for
field names, other than that they ought to be unique. Well actually
OGR doesn't even enforce this as a constraint ... but it should! 

My understanding is that you want the OGR PostGIS driver to 
optionally lookup field names in a secondary PostgreSQL table so 
that you can substitute more descriptive field names that would not
be allowed as column names in PostgreSQL.  Is that right? 

> If can't, is there any plans to realize that? 

There are no plans to incorporate the capability you are 
looking for. 

You could certainly locally patch the OGR PostGIS driver
to do what you want, but I think the change will be a bit messy
and hard to maintain.  I am leery about adding this capability
into the distributed driver since it will add a bunch of complication
and be hard for me to maintain without quite a bit of extra work.

> And what about my style strings in Mapinfo driver? :) 

Umm, still stuck in the ether?  I have several tasks I need to do 
now that the MITAB release is out, including incorporating your

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list