<div>Thank you; was strange that it did take the .prj information.</div>
<div>&nbsp;</div>
<div>I&#39;d like to setup a wrapper around OGR that asks as few questions as possible.</div>
<div>&nbsp;</div>
<div>=&gt; Is there a reliable way to find out if ogr2ogr recognizes an SRS from the source format without -s_srs parameter? ogrinfo with return code?<br>&nbsp;</div>
<div>-- Stefan<br>&nbsp;</div>
<div><span class="gmail_quote">2008/1/17, Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Stefan Keller wrote:<br>&gt; I&#39;m trying to a shapefile to KML. The Shapefile driver indicates that<br>
&gt; &quot;If a .prj files (...) is present, it will be read and used to associate<br>&gt; a projection with features.&quot;. In addition, the OGR KML driver<br>&gt; documentation says &quot;All OGR KML output will be presented in EPSG:4326.&quot;.
<br>&gt;<br>&gt; Let&#39;s say the input files are myshape.shp, myshape.shx, myshape.dbf and<br>&gt; myshape.prj and I try &quot;ogr2ogr -f kml out.kml myshape.shp&quot;.<br>&gt; then the resulting coordinates are still in the source coordinate
<br>&gt; system: Why? I espected that theya re transformed to WGS84 according to<br>&gt; the documentation mentioned.<br>&gt;<br>&gt; This is what finally worked: &quot;ogr2ogr -f kml del_prairie.kml<br>&gt; del_prairie.shp -s_srs EPSG:21781 -t_srs EPSG:4326&quot;. But indicating
<br>&gt; &quot;-s_srs EPSG:21781&quot; seems to me redundant to the existing file<br>&gt; myshape.prj . Any explanations?<br><br>Stefan,<br><br>ogr2ogr does not reproject coordinates by default, even when writing<br>to formats like KML that only really support one output coordinate system
<br>properly.&nbsp;&nbsp;The -t_srs is the correct way to request reprojection.<br><br>The -s_srs EPSG:21781 option should be unnecessary if the source shapefile<br>already has a readable .prj file.<br><br>Best regards,<br>--<br>---------------------------------------+--------------------------------------
<br>I set the clouds in motion - turn up&nbsp;&nbsp; | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam
</a><br>and watch the world go round - Rush&nbsp;&nbsp;&nbsp;&nbsp;| President OSGeo, <a href="http://osgeo.org">http://osgeo.org</a><br><br></blockquote></div><br>