[mapserver-users] Is my understanding of MapServer function correct?

woodbri at swoodbridge.com woodbri at swoodbridge.com
Mon Aug 26 09:14:35 EDT 2002


On 25 Aug 2002 at 20:06, Eric Wong wrote:

> I am a GIS newbie and wish to know if my understanding of how MapServer
> works at a high-level is correct or not;  I know I probably have some of the
> details wrong.
> 
> If I want to develop a "enter a zip code and i will show you the nearest
> locations" application, is the following how i would go about it?  Please
> let me know if I have any facts or assumptions wrong.
> 
> 1) acquire street level maps of the area in question.  these are maps that
> can be processed with software such as ArcView/ArcInfo/ArcMap.  the files
> that MapServer could use are the .shp/.shx/.dbf files from ArcGIS.  (are x-y
> geocode information of the area encoded in these files?)

Correct. This files will be in some x-y projection format that can be 
used with mapserver.

> 2) the addresses of my locations are in a SQL database, including the x-y
> geocode locations.  these geocode locations are computed by some service
> given the address.

OK, you might want to consider PostGIS since this is supported 
directly by mapserver, but it is not required. You could use any SQL 
database and query it via a mapscript application.

> 3) MapServer configuration needs to be performed which define layers and
> relate them to the .shp files from step 1.

Yup.

> 4) when user enters their zip code, the zip code is somehow converted to an
> x-y geocode and the nearest locations within X miles are retreived from the
> SQL database in step 2.  I assume distances can be calculated between pairs
> of x-y geocodes.

Yes. You will probably want to do this as part of a mapscript 
application in Perl or PHP. You would need to get a database of 
zipcode centriod locations that would allow you to lookup the zipcode 
and convert it to an x-y location or you would need a polygon zipcode 
layer that you could do a point query on to get back a polygon and 
centriod.

> 5) with the retreived locations in step 4, a temporary .shp file is created
> (via Perl/php/mapscript?)which has the locations pinpointed.
> 
> 6) the dynamically created .shp file of step 5 is displayed over the street
> map .shp files of step 1, resulting in an image showing the locations within
> X miles of a user given zip code.  this final image can be zoomed in or out.

This would be one way, or you can dynamically annotate the points you 
get back in step 4 and skip the shapefile creation and management. It 
would depend on how many points you have to render on a given image. 
Search the list archives for "dynamic point labeling" (sic) for more 
info on this.

> Is this how I would use MapServer for this type of application?  Do I have
> most of it right?  Or am I way off?  Thanks for your help.

Looks pretty good, you might want to look at PHP mapscript if you 
haven't as it can be the glue that you build your application in.

-Steve
 http://iMapTools.com



More information about the mapserver-users mailing list