[gdal-dev] Internal Metadata Management

Ari Jolma ari.jolma at gmail.com
Wed Dec 15 10:30:56 EST 2010


On 12/15/2010 05:11 PM, Frank Broniewski wrote:
>
> Hello Ari,
>
> yes that is definitely helpful. But I still wonder if it might be 
> easier/quicker to use GeoJSON as a interchange format and tranform 
> from geojson to other formats than using OGRs internal structure. I 
> already have some convenience classes for creating GeoJSON structures 
> in Python. I know there is already a geojson python module [1], but 
> onfortunately it doesn't deal with projections afaik.

GDAL has support for GeoJSON too. And it seems to support projections.

http://www.gdal.org/ogr/drv_geojson.html

It all depends on what is the final destination of your data. If it's a 
database (PostGIS), which is a sensible choice, I would probably myself 
write a small ad-hoc program to create the SQL to store the data.

Ari

>
> Frank
>
> [1] http://trac.gispython.org/lab/wiki/GeoJSON
>
> Am 14.12.2010 09:40, schrieb Ari Jolma:
>> Frank,
>>
>> A FeatureDefn is typically shared by all features in a layer and you
>> need one to create a feature object. Feature class has SetField and
>> GetField methods for storing and retrieving the attributes of a feature.
>>
>> I hope this helps,
>>
>> Ari
>>
>> On 12/14/2010 09:33 AM, Frank Broniewski wrote:
>>> Hello,
>>>
>>> I have a question concerning OGR's metadata or attribute management
>>> when converting between geodata vector formats. My question is maybe
>>> only loosely related to OGR and aims at the internal management of
>>> attribute data.
>>>
>>> From what I have read and understood from the documentation, OGR uses
>>> the OGC Simple Feature Specifiaction to transform data from one format
>>> to another. While reading the OGC specs I could not find a notion on
>>> how one should deal with attribute metadata, the whole spec seems to
>>> be about vector geometries only.
>>>
>>> Why I ask this: I am a Python user using the ogr python bindings and
>>> now the need arose that I need to write a flexible geo format exchange
>>> software. I chose OGR as a base for doing the conversion. My data
>>> often comes from databases with non standard data and geoemtry
>>> formats. So I want to align with OGR's internal used Simple Feature
>>> Data format, but I don't know how/where I should put the attributes /
>>> metadata. I see that the Feature is the part I have to look at because
>>> it has the geometry and the FeatureDfn. Unfortunately this is the part
>>> I don't understand :-)
>>> I need to create a FeatureDfn for my Feature which is basically the
>>> column names and data types? Where do I put my attribute values then?
>>> I looked at the OGRFeatureDefn Class Reference, but my understanding
>>> of OGR is too low to understand how this relates to the OGRFeature.
>>>
>>> So basically I am looking for a starter tip that pushes me into the
>>> right direction. Is there some python tutorial somewhere which I
>>> missed or somebody has a code snippet for me?
>>>
>>> Or would it be easier to use internally a format like geojson and use
>>> this as a starter for converting to other formats? Can OGR always
>>> transfer the attributes of my geospatial data to other formats?
>>>
>>> I am sorry that my question is somewhat unclear, but I have some
>>> difficulties to find the right form for my question. But I hope that I
>>> could state my problem in an understandable way :-)
>>>
>>> Many thanks for any tipps
>>>
>>> Frank
>>> _______________________________________________
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list