[postgis-users] Legislative District Lookup

J.C. Quirin jcquirin at ppmns.org
Wed Sep 27 17:18:25 PDT 2006


I am trying to code up a legislative district finder for the upcoming  
elections.   My plan is to have the user enter their address, pass  
that through the free geocoder.us system, take the lat/long  
coordinates that it returns, and do an intersect query to the PostGIS  
system.    I have loaded a PostGIS db with a couple of the shape  
files from this site:
http://www.commissions.leg.state.mn.us/gis/html/download.htm
(I am currently doing my testing with the congressional district one  
-- found in con02.zip -- because I figure that should be most  
forgiving.)  I loaded that data into a table named mn_cong_2002 by  
using the command:
shp2pgsql c2002.shp mn_cong_2002 > mn_cong_2002.sql
(and then imported that sql into the db, of course)

The query I am using (hard-coded for now) is as follows:
SELECT district FROM mn_cong_2002 WHERE (the_geom && makepoint 
(-93.294325, 44.949265));

Unfortunately, it's not returning anything (despite those coordinates  
being right smack-dab in the middle of Minneapolis).

I'm a complete newbie when it comes to this stuff, so I don't assume  
at all that my queries are correct.  I have checked the coordinates  
w/ google maps, and those are correct, but I'm not sure if I'm doing  
the makepoint() correctly.

Any ideas?

Thanks in advance!



More information about the postgis-users mailing list