Daniel,<br><br>The patch seems reasonable to me. The function in the select list would also be reasonable but it would require quite more of work and probably an RFC would also be required in that case.<br><br>Best regards,<br>
<br>Tamas<br><br><br><br><div class="gmail_quote">2009/4/16 Daniel Morissette <span dir="ltr">&lt;<a href="mailto:dmorissette@mapgears.com">dmorissette@mapgears.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
No comments? I&#39;ll go ahead and commit support for the new OGR_GEOM_AREA special field to trunk tomorrow then...<br><font color="#888888">
<br>
Daniel</font><div><div></div><div class="h5"><br>
<br>
<br>
Daniel Morissette wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi GDAL Dev&#39;s,<br>
<br>
I&#39;d like to use a OGR SQL statement to filter features from a shapefile based on their area. e.g. keep only the large lakes in a water layer for instance.<br>
<br>
A simple way to allow this would be to add a new OGR_GEOM_AREA special field on OGRFeatures that calls the OGRSurface::getArea() method and would be handled similar to the OGR_GEOM_WKT and other special fields in OGRFeature::GetFieldAsString?().<br>

<br>
Another option could be to add operators on geometries in the SQL parser but that could be a bit more involved (e.g. &quot;select ST_Area(geom) from ...&quot;).<br>
<br>
I have created a ticket about this which includes a patch for the new OGR_GEOM_AREA special field:<br>
<br>
<a href="http://trac.osgeo.org/gdal/ticket/2949" target="_blank">http://trac.osgeo.org/gdal/ticket/2949</a><br>
<br>
What would you think of adding this to the SVN trunk? Or can anyone provide hints on the way to implement operators on geometries since that would clearly be a better solution but I&#39;m not clear on the best way to add this to the OGR SQL engine.<br>

<br>
Daniel<br>
</blockquote>
<br>
<br>
-- <br>
Daniel Morissette<br>
<a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">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>
</div></div></blockquote></div><br>