[FWTools] Point in polygon

karsten vennemann karsten at terragis.net
Mon Mar 19 05:17:29 EST 2012


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: fwtools-bounces at lists.maptools.org
[mailto:fwtools-bounces at lists.maptools.org] On Behalf Of Chaitanya kumar CH
Sent: Monday, March 19, 2012 1:40 AM
To: Joe McMichael
Cc: fwtools at lists.maptools.org
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 <joemcmichael at gmail.com>
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
FWTools at lists.maptools.org
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 <http://www.pctools.com/?cclick=EmailFooterClean_51> 
======= 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20120319/100bb9e4/attachment.htm 


More information about the FWTools mailing list