[Gdal-dev] OGR: GetName function for Layer?

Frank Warmerdam warmerdam at pobox.com
Tue Oct 19 01:52:27 EDT 2004


Curt Mills wrote:
> Is this the only method of determining the name of an SDTS layer
> from within OGR?
> 
> 
>   if (layerH == OGR_DS_GetLayerByName(datasourceH, "AHPF"))
>   {
>     hypsography_layer++;    // Topo contours
>     fprintf(stderr,"Hypsography Layer (topo contours)\n");
>   }
> 
> 
> I'm using the GetNextLayer function, iterating through the layers.
> I can't seem to find a GetName function for the layer.  Am using the
> C API.

Curt,

The name is on the OGRFeatureDefn associated with the layer.

eg.

OGR_FD_GetName( OGR_L_GetLayerDefn( hLayer ) );

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