[postgis-users] Newbie postgis application question

Kevin Murphy murphy2 at speakeasy.net
Sat Aug 3 20:37:14 PDT 2002


I have a little mapping project that I'd like some advice on.  Let me tell you 
that I know nothing about GIS and mapping except what I've learned from 
snooping around the net in my spare time in the last few days.  Basically 
what I need to know is how to convert NAD83 longitude/latitude coordinates 
via some sort of projection into coordinates that will look reasonable when 
mapped at the scale of, say several counties, or an entire state.  I can 
program in C and Perl, I have Linux, I have PostgreSQL and PostGIS 
successfully installed.  I have used Postgres before.   I have downloaded the 
census bureau's cartographic boundary files for US counties and written a 
couple Perl programs to manipulate the raw data in text format. I wrote a 
program to create maps in Postscript using the data and realized from the 
distortion that I need to transform the coordinates via a projection.

Thanks!
Kevin Murphy

P.S.  For those with time to kill, read on.

For each county in the United States, I'd like to generate a map showing the 
outline of this county and its immediate neighbors (defined either by 
adjacency or some sort of radius rule; I haven't decided).

The map needs to show just the county outlines and have the names of the 
counties in reasonable locations (postGIS's ability to compute the centroid 
would probably help with the latter).

The map ultimately should be a GIF file with accompanying image map HTML 
fragment so that a user could click on a county and visit a target URL.

Here's what I've done so far:  (I haven't used PostGIS or Postgres at all yet 
in this project.)

*) I have downloaded the census bureau's boundary files for US counties.
*) I wrote a Perl program to identify county adjacencies; based on the polygon 
data, it is able to, e.g. spit out the adjacent neighbors of any specified 
county.
*) I wrote a Perl program to create a Postscript file containing a map of 
specified counties.  I can easily convert this to GIF later, and it will be 
easy to generate the html area maps.  Unfortunately, I noticed at this point 
that my maps were subtly distorted, which made me realize that I need to 
project from longitude and latitude into x-y coordinates.
*) I have imported the boundary geometries into PostgreSQL but don't really 
know what to do with them there.

I noticed the link to Mapserver, which looks promising, but it seems to be 
overkill for what I want to do at the moment.  Of course, if I do any other 
mapping projects (and I'd like to), the time investment might pay off.  
Actually, that's why I'm looking at PostGIS instead of just looking up the 
algorithms and rolling my own solution.





More information about the postgis-users mailing list