[Gdal-dev] how to set OGRFeature names

Brian Hamlin maplabs at light42.com
Fri Oct 12 11:56:17 EDT 2007


Hi Christoph-

   I am looking at a file called test_ogrOshape.cpp, in the GDAL 
Autotest suite. There is a lot of feature manipulation there.

  Mateusz, whose name is on the code, is often here on the list but he 
is away right now.

   Also in the test suite is a python file called ogr_index_test.py, 
with some examples... in ogrtest.py, there is a little bit more useful 
code. I suppose I would look at a driver or two to learn, also, 
although that not as clear.

   all for now
     -Brian



On Oct 12, 2007, at 12:47 AM, Christoph Ehrler wrote:

> Good morning list,
> hi Brian
>
> Yes, I experimented with the new Google Summer of Code KML driver for 
> OGR that
> http://trac.osgeo.org/gdal/wiki/SoCKMLRead
>
> Unfortunately, we will not use it since our primary goals are
> streaming of the KML file over network connections (this means a
> strict SAX parser and code) and retrieving the <Model> information (as
> the first step).
> This data of the <Model> object will be placed in a "pseudo layer"
> with only attributes (geometry type wbkNone) that will later passed
> through an OGR-importer for OSG to the COLLADA-importer of OSG.
>
>
> My question was how to set the names of layers and features correctly
> that they can appear as in every ordinary GIS application...
> Or to formulate it in another way: How does an application based on /
> using OGR retrieves the names of layers and features?? Is there one
> common way? Are there conventions to follow?
>
> Project
>    |
>    + LayerName1
>    |     |
>    |     + FeatureName1
>    |     + FeatureName2
>    |
>    + LayerName2
>          |
>         + FeatureName3
>
>
> OK, thanks to all
> Christoph
>
>
>
>> On Oct 11, 2007, at 8:26 AM, Christoph Ehrler wrote:
>>
>>> Hi @ all,
>>>
>>> currently I'm working on an OGR driver for reading <Model> data out 
>>> of
>>> KML files
>>> using the SAX parser eXpat. I would like to map the internal KML
>>> structure to OGR by preserving the <Folder> and <Placemark> names.
>>> Simplified, folders become to layers and placemarks to features 
>>> (which
>>> represent the models).
>>>
>>> OK, the name of a layer could be set with the constructor of the
>>> OGRFeatureDefn::OGRFeatureDefn(const char *pszName).
>>>
>>> But how can I set the individual name of a feature?
>>> Are there any conventions about the name and type and index of an
>>> OGRField that stores this information???
>>>
>>>
>>> Thanks for your help
>>> Christoph
>>> _______________________________________________
>>> Gdal-dev mailing list
>>> Gdal-dev at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/gdal-dev
>>




More information about the Gdal-dev mailing list