Ticket #2271 (closed enhancement: invalid)
Add built in reprojection support to KML driver
|Reported by:||springmeyer||Owned by:||condit|
|Severity:||minor||Keywords:||ogr2ogr, kml, srs, automatic reprojection|
Currently the KML driver will accept source files in a SRS other than WGS 84 but does not handle the reprojection of the coordinates. Therefore to correctly use the KML driver a user must first reproject the data into EPSG 4326 and then convert to KML with ogr2ogr. Otherwise invalid KML with be produced by ogr2ogr along with an error warning about coordinates that do not fall within the correct bounds for WGS 84:
$ ogr2ogr -f KML test.kml lk/lk.shp # a shapefile in NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet ERROR 1: Latitude 584194.370017 is invalid. Valid range is [-90,90]. This warning will not be issued any more Warning 1: Longitude 1113244.200378 has been modified to fit into range [-180,180]. This warning will not be issued any more
It would be ideal to build in automatic reprojection support for the KML driver such that when ogr2ogr is called to create KML from data in a projection other than WGS84, this processing in done in a single step. This would match the convenience of the ST_AsKML() function in postgis that can effectively be called on any projected geometry as long as a valid srid is set.