Tai,<br><br>GDAL needs GEOS to perform these geometry functions. Make sure you install that.<br><br><div class="gmail_quote">On Sat, Jul 21, 2012 at 12:19 PM, taibc <span dir="ltr"><<a href="mailto:taibc_coltech@yahoo.com" target="_blank">taibc_coltech@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chaitanya,<br>
<br>
I still can't run the method "Geometry::Within". And I got the error: "GEOS<br>
support not enable" when trying use this method.<br>
<br>
Please find the attached file for sample code.<br>
<a href="http://osgeo-org.1560.n6.nabble.com/file/n4989766/Source1.cpp" target="_blank">http://osgeo-org.1560.n6.nabble.com/file/n4989766/Source1.cpp</a> Source1.cpp<br>
<br>
About spatial filter, you said that: we can use the spatial filter of the<br>
ogr layer to filter the point features. But, I think it is used to filter<br>
features that geometrically intersect the filter geometry.<br>
<br>
For example: if I have one polygon A feature, I can use the method<br>
"SetSpatialFilter" to get other features (Point or Polygon) that<br>
geometrically *intersect* with A.<br>
<br>
<br>
<br>
chaitanya_ch wrote<br>
<div class="im">><br>
> Tai,<br>
><br>
> You can use the spatial filter of the ogr layer to filter the point<br>
> features to speed things up. You will still have to test if the point is<br>
> within the polygon but it will be faster.<br>
><br>
> Also, make sure the test is like point->Within(polygon) and not<br>
> polygon->Within(point)<br>
><br>
> OGRLayer::SetSpatialFilter()<br>
> <a href="http://www.gdal.org/ogr/classOGRLayer.html#a0b4ab45cf97cbc470f0d60474d3e4169" target="_blank">http://www.gdal.org/ogr/classOGRLayer.html#a0b4ab45cf97cbc470f0d60474d3e4169</a><br>
><br>
</div>> On Fri, Jul 20, 2012 at 9:29 AM, Bui Chi Tai <taibc_coltech@>wrote:<br>
><br>
><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4989766.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4989766.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>