[gdal-dev] Bad result when writing into KML without -t_srs

Hermann Peifer peifer at gmx.eu
Fri Jun 7 05:55:05 PDT 2013


On 2013-06-07 6:33, Even Rouault wrote:
> Selon Jukka Rahkonen <jukka.rahkonen at mmmtike.fi>:
>> Herman Peifer wrote but forgot to send to the list:
>>
>> " Jukka,
>> Could you please try with -a_srs epsg:2393 instead of -s_srs epsg:2393,
>> see http://trac.osgeo.org/gdal/ticket/4496"
>>
>> This is funny, but using -a_srs:2393 in the command really leads to correct
>> result. Following command, even being all wrong with the a_srs, gives good
>> KML and it also overrides the erroneous prj file.
>>
>> ogr2ogr -f KML -a_srs epsg:2393  test6.kml test_region.shp
>
> This is also explainable by ogr2ogr and the KML driver works. -a_srs attaches a
> SRS to the feature that is passed to the output driver (overriding the SRS of
> the source feature if existing). The KML driver has a very unique behaviour in
> which it takes into account the SRS of the features that are passed to it to do
> reprojection to EPSG:4326 if needed. Said differently the KML driver has some
> sort of -s_srs -t_srs mechanism integrated into it.
>

Said even differently, and from my perspective: the KML driver's 
behaviour is counter-intuitive. However, this seems to be a feature 
rather than bug, as far as I can gather from Even's explanations.

Hermann



More information about the gdal-dev mailing list