Frank,<div><br></div><div>Done.</div><div>URL: <a href="http://trac.osgeo.org/gdal/ticket/4590">http://trac.osgeo.org/gdal/ticket/4590</a></div><div><br></div><div>Cheers,</div><div>Eric</div><div><br><div class="gmail_quote">
On 29 March 2012 04:41, Frank Warmerdam <span dir="ltr">&lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Eric,<br>
<br>
If you could file a ticket on the issue we can make the &quot;looks like a geometry&quot;<br>
logic more bulletproof.<br>
<br>
Best regards,<br>
Frank<br>
<div><div class="h5"><br>
On Wed, Mar 28, 2012 at 7:27 PM, Eric Grosso &lt;<a href="mailto:eric.grosso.os@gmail.com">eric.grosso.os@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I was writing a small OGR based script (bash) in order to clip several<br>
&gt; shapefiles at the same time.<br>
&gt; Thus I used this piece of code: ogr2ogr -clipsrc polygon_selection.shp<br>
&gt; output.shp input.shp<br>
&gt;<br>
&gt; Using it, I had the following error: &quot;FAILURE: Invalid geometry. Must be a<br>
&gt; valid POLYGON or MULTIPOLYGON WKT&quot;<br>
&gt;<br>
&gt; I checked my polygon_selection.shp file. It was &quot;OGC&quot; valid. Then I checked<br>
&gt; the documentation. Apparently it was correct.<br>
&gt; So I finally decided to check the code and I understood why I had this<br>
&gt; message.<br>
&gt;<br>
&gt; If the filename of the polygon which is used to do the clipping begins with<br>
&gt; &quot;polygon&quot; or &quot;multipolygon&quot;, the code tries to convert<br>
&gt; this argument in WKT.<br>
&gt;<br>
&gt; Here is an code extract of ogr2ogr.cpp  (same for -clipsrc and -clipdst<br>
&gt; options):<br>
&gt;<br>
&gt; else if (EQUALN(papszArgv[iArg+1], &quot;POLYGON&quot;, 7) ||<br>
&gt; EQUALN(papszArgv[iArg+1], &quot;MULTIPOLYGON&quot;, 12))<br>
&gt;<br>
&gt;<br>
&gt; I let you decide what to do (add this very minor problem to the<br>
&gt; documentation or change a bit the code,<br>
&gt; e.g. &quot;POLYGON&quot;, 7 becomes &quot;POLYGON(&quot;, 8 could do the trick). That&#39;s why I<br>
&gt; didn&#39;t open any bug report or enhancement request.<br>
&gt;<br>
&gt; First time I write on this list, so I catch the opportunity to thank all the<br>
&gt; developers of GDAL/OGR for your wonderful work.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Eric<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; gdal-dev mailing list<br>
&gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up   | 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" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush    | Geospatial Software Developer<br>
</font></span></blockquote></div><br></div>