How to identify a point is belong to a polygon ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

How to identify a point is belong to a polygon ?

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
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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 AM, taibc <[hidden email]> wrote:
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
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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)

OGRLayer::SetSpatialFilter()
http://www.gdal.org/ogr/classOGRLayer.html#a0b4ab45cf97cbc470f0d60474d3e4169

On Fri, Jul 20, 2012 at 9:29 AM, Bui Chi Tai <[hidden email]> wrote:
Chaitanya,

I am checking my code. Maybe it is not successful because I used two different layers (of one file).

As you know, one .dgn files only has one layer, that include many features, and Texts (Point Geometry), Polygons are treated as features.
My idea is:
First, I will read each feature to identify whether this feature is a polygon. Then, I need to use a loop to read and check all features of layer to identify whether a Text (point) is belong to that polygon. But, this will affect to the first reading times, and give unexpected result.

Do you have any ideas ?

Thanks and regards,

Tai

From: Chaitanya kumar CH <[hidden email]>
To: Bui Chi Tai <[hidden email]>
Sent: Friday, July 20, 2012 10:39 AM

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

Tai,

I don't understand why it would happen. Can you provide some more details? Code, data?

On Fri, Jul 20, 2012 at 9:05 AM, Bui Chi Tai <[hidden email]> wrote:
Thanks Chaitanya,

I am trying to use this method. But, it is not successful.

For example: One file .dgn includes Text (treated as a point geometry) and Shapes (Polygon).

I used the method OGRGeometry::Within(OGRGeometry * other) to identify whether the Text is belong to the polygon. But it doesn't return an expected result (Actually, there are some texts that belong to each polygon).

Kind regards,

Tai


From: Chaitanya kumar CH <[hidden email]>
To: taibc <[hidden email]>
Cc: [hidden email]
Sent: Friday, July 20, 2012 10:11 AM
Subject: Re: [gdal-dev] How to identify a point is belong to a polygon ?

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 AM, taibc <[hidden email]> wrote:
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
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E





--
Best regards,
Chaitanya kumar CH.

<a href="tel:%2B91-9494447584" value="+919494447584" target="_blank">+91-9494447584
17.2416N 80.1426E





--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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.Source1.cpp

About spatial filter, you said that: we can use the spatial filter of the ogr layer to filter the point features. But, I think it is used to filter features that geometrically intersect the filter geometry.

For example: if I have one polygon A feature, I can use the method "SetSpatialFilter" to get other features (Point or Polygon) that geometrically intersect with A.


chaitanya_ch wrote
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)

OGRLayer::SetSpatialFilter()
http://www.gdal.org/ogr/classOGRLayer.html#a0b4ab45cf97cbc470f0d60474d3e4169

On Fri, Jul 20, 2012 at 9:29 AM, Bui Chi Tai <[hidden email]>wrote:
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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 <[hidden email]> 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.

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: we can use the spatial filter of the
ogr layer to filter the point features. But, I think it is used to filter
features that geometrically intersect the filter geometry.

For example: if I have one polygon A feature, I can use the method
"SetSpatialFilter" to get other features (Point or Polygon) that
geometrically *intersect* with A.



chaitanya_ch wrote
>
> 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)
>
> OGRLayer::SetSpatialFilter()
> http://www.gdal.org/ogr/classOGRLayer.html#a0b4ab45cf97cbc470f0d60474d3e4169
>
> On Fri, Jul 20, 2012 at 9:29 AM, Bui Chi Tai <taibc_coltech@>wrote:
>
>




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4989766.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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
algorithm\LineIntersector.cpp(680) : error C3861: 'isnan': identifier not found
algorithm\LineIntersector.cpp(681) : error C3861: 'isnan': identifier not found
algorithm\LineIntersector.cpp(736) : error C3861: 'isnan': identifier not found
algorithm\LineIntersector.cpp(737) : error C3861: 'isnan': identifier not found
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\nmake.EXE"' : return code '0x2'
Stop.

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 <[hidden email]> wrote:
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_ch
Tai,

Pease refer to http://trac.osgeo.org/geos/

On Sat, Jul 21, 2012 at 2:06 PM, taibc <[hidden email]> 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) : error C3861: 'isnan': identifier not
found
algorithm\LineIntersector.cpp(672) : error C3861: 'isnan': identifier not
found
algorithm\LineIntersector.cpp(680) : error C3861: 'isnan': identifier not
found
algorithm\LineIntersector.cpp(681) : error C3861: 'isnan': identifier not
found
algorithm\LineIntersector.cpp(736) : error C3861: 'isnan': identifier not
found
algorithm\LineIntersector.cpp(737) : error C3861: 'isnan': identifier not
found
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
10.0\VC\BI
N\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
10.0\VC\BI
N\nmake.EXE"' : return code '0x2'
Stop.


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 <taibc_coltech@> wrote:
>
>
>




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4989779.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

taibc
Thanks Chaitanya,

I reported the error there. And waiting for answers.

Kind regards,

Tai
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

taibc
In reply to this post by chaitanya_ch
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 <[hidden email]> wrote:
Hi Chaitanya,

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 ?

Thanks and regards,

Tai
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

Mateusz Loskot
On 23 July 2012 11:52, taibc <[hidden email]> 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 this thread:
http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023829.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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

From: Mateusz Loskot [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Monday, July 23, 2012 5:56 PM
Subject: Re: How to identify a point is belong to a polygon ?

On 23 July 2012 11:52, taibc <[hidden email]> 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 this thread:
http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023829.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990029.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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 <[hidden email]> wrote:
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

From: Mateusz Loskot [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Monday, July 23, 2012 5:56 PM
Subject: Re: How to identify a point is belong to a polygon ?

On 23 July 2012 11:52, taibc <[hidden email]> 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 this thread:
http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023829.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990029.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML




View this message in context: Re: How to identify a point is belong to a polygon ?

Sent from the GDAL - Dev mailing list archive at Nabble.com.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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] <[hidden email]>
To: taibc <[hidden email]>
Sent: Tuesday, July 24, 2012 10:38 AM
Subject: Re: How to identify a point is belong to a polygon ?

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 <[hidden email]> wrote:
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

From: Mateusz Loskot [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Monday, July 23, 2012 5:56 PM
Subject: Re: How to identify a point is belong to a polygon ?

On 23 July 2012 11:52, taibc <[hidden email]> 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 this thread:
http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023829.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990029.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML




View this message in context: Re: How to identify a point is belong to a polygon ?
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev


If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990248.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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 MyComputer->Settings.

On Tue, Jul 24, 2012 at 9:50 AM, taibc <[hidden email]> wrote:
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] <[hidden email]>
To: taibc <[hidden email]>
Sent: Tuesday, July 24, 2012 10:38 AM

Subject: Re: How to identify a point is belong to a polygon ?

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 <[hidden email]> wrote:
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

From: Mateusz Loskot [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Monday, July 23, 2012 5:56 PM
Subject: Re: How to identify a point is belong to a polygon ?

On 23 July 2012 11:52, taibc <[hidden email]> 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 this thread:
http://lists.osgeo.org/pipermail/gdal-dev/2010-March/023829.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990029.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML




View this message in context: Re: How to identify a point is belong to a polygon ?
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

<a href="tel:%2B91-9494447584" value="+919494447584" target="_blank">+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev


If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.n6.nabble.com/How-to-identify-a-point-is-belong-to-a-polygon-tp4989501p4990248.html
To unsubscribe from How to identify a point is belong to a polygon ?, click here.
NAML




View this message in context: Re: How to identify a point is belong to a polygon ?
Sent from the GDAL - Dev mailing list archive at Nabble.com.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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 third line, the building process will get errors
3. GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/include/geos -DHAVE_GEOS

Errors:
LINK : fatal error LNK1181: cannot open input file 'ogr\ogrsf_frmts\ogrsf_frmts.
lib'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\lib.EXE"' : return code '0x49d'
Stop.

Thanks and regards,

Tai

From: chaitanya_ch [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Tuesday, July 24, 2012 12:48 PM
Subject: Re: How to identify a point is belong to a polygon ?

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 MyComputer->Settings.


Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

chaitanya_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 <[hidden email]> wrote:
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 third line, the building process will get errors
3. GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/include/geos -DHAVE_GEOS

Errors:
LINK : fatal error LNK1181: cannot open input file 'ogr\ogrsf_frmts\ogrsf_frmts.
lib'

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\lib.EXE"' : return code '0x49d'
Stop.

Thanks and regards,

Tai

From: chaitanya_ch [via OSGeo.org] <[hidden email]>
To: taibc <[hidden email]>
Sent: Tuesday, July 24, 2012 12:48 PM

Subject: Re: How to identify a point is belong to a polygon ?

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 MyComputer->Settings.




View this message in context: Re: How to identify a point is belong to a polygon ?
Sent from the GDAL - Dev mailing list archive at Nabble.com.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to identify a point is belong to a polygon ?

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