[postgis-users] ogr2ogr and kml format

christophe triquet nethou at aliceadsl.fr
Sun Jan 11 02:33:45 PST 2009


Thanks for your answear.
Actually, the gdal version in my xubuntu hardy was too old (1.4.0).
Release 1.6.0 include support for kml 2.2. After having built gdal
1.6.0 with expat support, I'm now able to read my kml files.

2009/1/7 Frank Warmerdam <warmerdam at pobox.com>:
> christophe triquet wrote:
>>
>> Hi everybody,
>>
>> I'm trying to translate kml file into another format (postgresql or
>> shp) with ogr2ogr. I'm working with kml files generated with google
>> earth or google maps. When I use a kml file as input for ogrinfo or
>> ogr2ogr, I get an error saying :
>>
>> FAILURE:
>> Unable to open datasource `my_file.kml' with the following drivers.
>> ...
>>
>> and then the list of availables drivers displays.
>>
>> When I enter : ogrinfo --formats
>> I get : -> "KML" (read/write)
>> so it seems that this is well configured.
>>
>> I've tried to validate my kml with www.kmlvalidator.com and the result
>> is that there is differences between a file generated by google earth
>> and the ogr kml format. After correcting the errors found by
>> kmlvalidator, the validation is successfull but ogr2ogr still doesn't
>> work (with the same error message).
>>
>> Does someone have any suggestion to solve my problem ?
>
> Christophe,
>
> Unfortunately OGR does not have a way of knowing for the purposes of
> reporting if a driver is "write only".  The KML driver is write only if
> OGR is not built with support for the XML parsing library used by the
> KML driver (expat).  So I suspect you need to rebuild GDAL/OGR with
> support for the expat library (--with-expat to configure) in order to
> get this working.
>
> Even at that there are definate limitations in the KML reading.
>
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list