[mapserver-users] Attribute query at geographic coordinate

Richard Greenwood richard.greenwood at gmail.com
Sun Nov 13 20:10:26 EST 2011


On Sun, Nov 13, 2011 at 5:07 PM, Peter Weilandt <PeterWeilandt at shaw.ca> wrote:
> I stumbled across MapServer in my search for a tool to use in a website.  I
> want to develop a website that will use a coordinate (lat & long), which is
> easily obtained from a user on the client side by clicking on a Google map,
> and then transferring this coordinate to the server side where it will be
> used to sequentially query many (500+) shapefile polygon layers, extracting
> the values from 2 fields from each layer at this coordinate, saving these
> values in a list (Excel, textfile?), and then using this list to return
> values to the user on the client side.  This sounds simple in concept, but
> is MapServer a tool that can accomplish this and, if so, are there any
> examples showing the code to use for such a query?


MapServer certainly has the ability to do attribute queries against
multiple shapefiles. MapServer's real strength is rendering (drawing)
maps. 500 shapefiles is a lot. Just the overhead of opening 500 files
is notable and something that you would generally try to avoid in a
web application. I don't usually think of Excel or text files in a web
 context either.

I don't know if this would work in your case, but you might be better
served by a spatial database, e.g. PostGIS. You would pass your
coordinates thru a PHP (or similar) page to PostGIS which would
execute the query and return the results to PHP which would generate
HTML. With PostGIS/PostgreSQL you might be able to combine your 500
shapefiles into something more manageable.

Rich
-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the mapserver-users mailing list