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.
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
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev