Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-24 Thread taibc
Thanks Chaitanya, I modified as your suggestion. But, still got the error (GEOS support not enable) when executing the program. About building GEOS, if I only add two first lines, the process will be sucessful: 1. GEOS_DIR = C:/geos-3.3.5 2. GEOS_LIB = $(GEOS_DIR)/src/geos_c_i.lib if I add

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-24 Thread Chaitanya kumar CH
Tai, Geos code is not enabled in GDAL without the third line you omitted. Check the compilation messages to identify the problem. Perform a 'clean' before you build until this problem is resolved. On Tue, Jul 24, 2012 at 12:48 PM, taibc taibc_colt...@yahoo.com wrote: Thanks Chaitanya, I

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-24 Thread taibc
Thanks chaitanya, I resolved the errors by downloading GEO-3.2.3 (arrangement of folders in geo-3.2.3 is different from geo-3.3.5), re-build geo and gdal. Kind regards, Tai -- View this message in context:

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread taibc
Thanks Chaitanya, I reported the error there. And waiting for answers. Kind regards, Tai -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4989973.html Sent from the GDAL - Dev mailing list archive at Nabble.com.

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread taibc
chaitanya_ch wrote Tai, GDAL needs GEOS to perform these geometry functions. Make sure you install that. On Sat, Jul 21, 2012 at 12:19 PM, taibc lt;taibc_coltech@gt; wrote: Hi Chaitanya, I installed GEOS succesfful, and copy file geos.dll into my project. But I still got the

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread Mateusz Loskot
On 23 July 2012 11:52, taibc taibc_colt...@yahoo.com wrote: I installed GEOS succesfful, and copy file geos.dll into my project. But I still got the error: GEOS support not enable when using the method Within Are there something wrongs ? You need to edit nmake.opt and rebuild GDAL. Check

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread taibc
Thanks Mateusz, I edited the nmake.opt by adding below lines: GEOS_DIR = C:/geos-3.3.5 GEOS_LIB = $(GEOS_DIR)/src/geos_c_i.lib GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/include/geos -DHAVE_GEOS Then, I rebuilt GDAL, but still got the error: GEOS support not enable. Kind regards, Tai

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread Chaitanya kumar CH
Tai, If your rebuild was successful with geos, the only reason for you to get the error is that the application is accessing the wrong libraries somewhere in your system. Do a clean rebuild and make sure the LD_LIBRARY_PATH and GDAL_DATA are set correctly. On Tue, Jul 24, 2012 at 7:37 AM, taibc

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread taibc
Thanks Chaitanya, I haven't set LD_LIBRARY_PATH and GDAL_DATA yet. Do you know how to set them on Visual C++ 2010 ? Kind regards, Tai From: chaitanya_ch [via OSGeo.org] ml-node+s1560n499024...@n6.nabble.com To: taibc taibc_colt...@yahoo.com Sent: Tuesday,

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-23 Thread Chaitanya kumar CH
Tai, The environment variables can be set at the command prompt temporarily using SET LD_LIBRARY_PATH=C:\path\to\gdal\libraries SET GDAL_DATA=C:\path\to\gdal\libraries\data You can set them in the project settings in VC++. I don't know how. You can also set them system wide at

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-21 Thread taibc
Hi Chaitanya, I still can't run the method Geometry::Within. And I got the error: GEOS support not enable when trying use this method. Please find the attached file for sample code. http://osgeo-org.1560.n6.nabble.com/file/n4989766/Source1.cpp Source1.cpp About spatial filter, you said that:

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-21 Thread Chaitanya kumar CH
Tai, GDAL needs GEOS to perform these geometry functions. Make sure you install that. On Sat, Jul 21, 2012 at 12:19 PM, taibc taibc_colt...@yahoo.com wrote: Hi Chaitanya, I still can't run the method Geometry::Within. And I got the error: GEOS support not enable when trying use this method.

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-21 Thread taibc
Thanks Chaitanya, I tried to install GEOS on Window. But I got below error: NMAKE fatal error U1077 return code '0x2' Detail is: algorithm\LineIntersector.cpp(671) : error C3861: 'isnan': identifier not found algorithm\LineIntersector.cpp(672) : error C3861: 'isnan': identifier not found

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-21 Thread Chaitanya kumar CH
Tai, Pease refer to http://trac.osgeo.org/geos/ On Sat, Jul 21, 2012 at 2:06 PM, taibc taibc_colt...@yahoo.com wrote: Thanks Chaitanya, I tried to install GEOS on Window. But I got below error: NMAKE fatal error U1077 return code '0x2' Detail is: algorithm\LineIntersector.cpp(671)

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-20 Thread Chaitanya kumar CH
Tai, You can use the spatial filter of the ogr layer to filter the point features to speed things up. You will still have to test if the point is within the polygon but it will be faster. Also, make sure the test is like point-Within(polygon) and not polygon-Within(point)

[gdal-dev] How to identify a point is belong to a polygon ?

2012-07-19 Thread taibc
Hi everyone, Do you know how to identify whether a point (OGRPoint) is belong to a polygon (OGRPolygon) ? (the polygon covers the point) Thanks and regards, Tai -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501.html

Re: [gdal-dev] How to identify a point is belong to a polygon ?

2012-07-19 Thread Chaitanya kumar CH
Tai, You can use OGR_G_Within() OGR_G_WIthin(point,polygon) will return true if the point is within the polygon. You can access various other geometry functions from the OGRGeometry class. http://www.gdal.org/ogr/ogr__api_8h.html#a80ba9e516ccae381ae7240cc9684eb72 On Fri, Jul 20, 2012 at 7:04