[gdal-dev] Editing KML files using ogr_csharp.dll

Brian Case rush at winkey.org
Mon Dec 5 10:48:03 EST 2011


Chris,

Have you tried the libkml driver?

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


Brian


On Mon, 2011-12-05 at 14:50 +0000, Pouliot, Christopher (DNR) wrote:
> Hello All,
> 
>  
> 
> I have a C# application that uses OGR_CSHARP.DLL to read/write KML
> files.  I’m able to read from KML files fine.  I’m able to create a
> new KML file and write to it fine.  I am unable, however, to open a
> KML file to edit.  I’d like to be able to append a new layer (folder)
> onto an existing KML file.  I’ve tried both of the following code
> snippets:
> 
>  
> 
> //This returns NULL
> 
> OSGeo.OGR.Driver drv = Ogr.GetDriverByName(“KML”);
> 
> DataSource ds = drv.Open(“c:\\temp\\mykml.kml”, 1);
> 
>  
> 
>  
> 
> //This returns NULL
> 
> DataSource ds = Ogr.Open(“c:\\temp\\mykml.kml”, 1);
> 
>  
> 
>  
> 
> I’m able to use this code to edit File Geodatabases and Shapefiles but
> not KML.
> 
>  
> 
>  
> 
>  
> 
> Also, when creating a KML file from scratch is there a way to map the
> Name and Description fields to my existing fields so that the Name and
> Description appear in Google Earth?
> 
>  
> 
>  
> 
> Thanks,
> 
>                
> 
> Chris
> 
>  
> 
> Chris Pouliot
> GIS Application Developer
> Minnesota Department of Natural Resources
> christopher.pouliot at state.mn.us
> (651) 259-5491
> 
>  
> 
> 
> _______________________________________________
> 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