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"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></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 "looks like a geometry"<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 <<a href="mailto:eric.grosso.os@gmail.com">eric.grosso.os@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I was writing a small OGR based script (bash) in order to clip several<br>
> shapefiles at the same time.<br>
> Thus I used this piece of code: ogr2ogr -clipsrc polygon_selection.shp<br>
> output.shp input.shp<br>
><br>
> Using it, I had the following error: "FAILURE: Invalid geometry. Must be a<br>
> valid POLYGON or MULTIPOLYGON WKT"<br>
><br>
> I checked my polygon_selection.shp file. It was "OGC" valid. Then I checked<br>
> the documentation. Apparently it was correct.<br>
> So I finally decided to check the code and I understood why I had this<br>
> message.<br>
><br>
> If the filename of the polygon which is used to do the clipping begins with<br>
> "polygon" or "multipolygon", the code tries to convert<br>
> this argument in WKT.<br>
><br>
> Here is an code extract of ogr2ogr.cpp (same for -clipsrc and -clipdst<br>
> options):<br>
><br>
> else if (EQUALN(papszArgv[iArg+1], "POLYGON", 7) ||<br>
> EQUALN(papszArgv[iArg+1], "MULTIPOLYGON", 12))<br>
><br>
><br>
> I let you decide what to do (add this very minor problem to the<br>
> documentation or change a bit the code,<br>
> e.g. "POLYGON", 7 becomes "POLYGON(", 8 could do the trick). That's why I<br>
> didn't open any bug report or enhancement request.<br>
><br>
> First time I write on this list, so I catch the opportunity to thank all the<br>
> developers of GDAL/OGR for your wonderful work.<br>
><br>
> Cheers,<br>
> Eric<br>
><br>
</div></div>> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> <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>