[gdal-dev] libkml driver get document name

Rashad Kanavath mohammedrashadkm at gmail.com
Thu Feb 25 00:47:01 PST 2016


Hello Even,

On Wed, Feb 24, 2016 at 5:23 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> Le mardi 23 février 2016 14:50:35, jan vaillant a écrit :
> > Hi list,
> >
> > I am reading a zipped kml with gdal's libkml driver. I am trying to
> access
> > the name tag of the document:
> >
> > <kml>
> >   <Document>
> >     <name>a_name</name>
>
> I did a quick testing It appears that the driver will report a <name> as
> the
> layer name only if it inside a <Folder> tag, but not as a direct child of
> <Document>
>

I am wondering if this could this be fixed in the upstream?

>
> > ...
> >
> > If I look at the source code I can see a way to set those options here
> for
> > writing kml
> >
> > void OGRLIBKMLDataSource::SetCommonOptions(ContainerPtr poKmlContainer,
> >                                            char** papszOptions)
> > {
> >     const char* pszName = CSLFetchNameValue(papszOptions, "NAME");
> >     if( pszName != NULL )
> >         poKmlContainer->set_name(pszName);
> > ...
> >
> > but I cant find a way to read the options. ogrLayer->GetName() returns
> the
> > file name not the <name>a_name</name> element. Any ideas?
> >
> > Thank you
> > Jan
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Regards,
   Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160225/b2f635b9/attachment.html>


More information about the gdal-dev mailing list