Point in polygon

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Point in polygon

Joe McMichael

Hello GIS folks!

I have a large number of lat/lon coordinates(120 million) that I would like to know which census block they fall into. Can FWtools be used to crosswalk points to polygons? Maybe you know of a better method?

Thanks in advance for your advice.

Joe

_______________________________________________
FWTools mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Point in polygon

Chaitanya kumar CH
Joe,

First note that FWtools for Windows is very old and not recommended.

It is easy to write a python script that cycles through the coordinates and select the census block after applying a filter. We can also cycle through the blocks and get the set of coordinates and then use the OGRGeometry::Contains method to confirm.

The problem here is that there is no straight forward way to use spatial indexes.

There may be other options, like PostGIS, depending on your exact requirements.

On Mon, Mar 19, 2012 at 4:20 AM, Joe McMichael <[hidden email]> wrote:

Hello GIS folks!

I have a large number of lat/lon coordinates(120 million) that I would like to know which census block they fall into. Can FWtools be used to crosswalk points to polygons? Maybe you know of a better method?

Thanks in advance for your advice.

Joe

_______________________________________________
FWTools mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/




--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
FWTools mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Point in polygon

Karsten Vennemann

Hi Joe,

 

If you are working on windows you can get a newer version of the tools (that are in fwtools) using the awesome osgeo4win downloader http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe

There are many ways to do this but if I where to do this I would (to avoid overhead with scripting etc) import the data (points and the census blocks) into a spatialite database ( see http://www.gaia-gis.it/gaia-sins/ ) using ogr2ogr

(or the spatialite gui tools)

 

and then using the spatilalite gui and  run a spatial intersect query that will give you your results. For example something like this:

 

select id. census blocks , id. yourpoints from censusblocks, yourpoints where censusblocks.the_geom && yourpoints.the_geom and intersects (censusblocks.the_geom, yourpoints.the_geom);

 

The same can be done with postgis almost identically but then you have a little more overhead to install the postgresql/ postgis  etc to get this done.

 

Cheers

Karsten

 

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Chaitanya kumar CH
Sent: Monday, March 19, 2012 1:40 AM
To: Joe McMichael
Cc: [hidden email]
Subject: Re: [FWTools] Point in polygon

 

Joe,

First note that FWtools for Windows is very old and not recommended.

It is easy to write a python script that cycles through the coordinates and select the census block after applying a filter. We can also cycle through the blocks and get the set of coordinates and then use the OGRGeometry::Contains method to confirm.

The problem here is that there is no straight forward way to use spatial indexes.

There may be other options, like PostGIS, depending on your exact requirements.

On Mon, Mar 19, 2012 at 4:20 AM, Joe McMichael <[hidden email]> wrote:


Hello GIS folks!

I have a large number of lat/lon coordinates(120 million) that I would like to know which census block they fall into. Can FWtools be used to crosswalk points to polygons? Maybe you know of a better method?

Thanks in advance for your advice.

Joe

_______________________________________________
FWTools mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/




--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E





=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 9.0.0.898, Virus/Spyware Database: 6.19480)
http://www.pctools.com
=======


_______________________________________________
FWTools mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/
Loading...