Re: [mapserver-users] Attribute query at geographic coordinate
On Sun, Nov 13, 2011 at 5:07 PM, Peter Weilandt 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.greenw...@gmail.com www.greenwoodmap.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Attribute query at geographic coordinate
Hi Peter You will have to write some of the server-side code for saving the results into a list, but the spatial query is called a GetFeatureInfo request, which is part of the WMS spec, which Mapserver can do well. Here is the format of a request: http:///cgi-bin/mapserve.exe?service=WMS&version=1.1.1&request=GetFeatureInfo&LAYERS=mapsheet&QUERY_LAYERS=mapsheet&INFO_FORMAT=text/plain&SRS=EPSG:27200&BBOX=2435500,5843425,2437500,5845425&WIDTH=256&HEIGHT=256&X=128&Y=128 Kind regards, Robert Sanson >>> Peter Weilandt 14/11/2011 1:07 p.m. >>> 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? This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system. This message has been scanned for Malware and Viruses by Websense Hosted Security. www.websense.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Attribute query at geographic coordinate
Hi, For me this sounds like being something for some mapscript variant http://mapserver.org/mapscript/index.html for doing the special server side queries and formatting the output. WMS GetFeatureInfo is not the most natural way to do this even it might work by doing a little bit of tweaking. WFS GetFeature with ogc:Contains filter should suit for doing the queries but formatting the output in a way you want could be difficult. The defaul format is GML. Do all your layers have a similar schema (like being measurement data from different dates) or can they all be different? And do your users need to select which layers of those 500+ to query or would the service return always info about all the available layers? -Jukka Rahkonen- Peter Weilandt 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-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Attribute query at geographic coordinate
If you didn't need to use WFS and just wanted to do MapServer queries, you could put together a template that would build you a list. Take a look at the examples on this page: http://mapserver.org/output/template_output.html The JSON example is probably the most applicable. Like others have mentioned, 500 data layers won't be efficient, so you may want to explore other data organization ideas. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Robert Sanson Sent: Sunday, November 13, 2011 6:34 PM To: mapserver-users@lists.osgeo.org; Peter Weilandt Subject: Re: [mapserver-users] Attribute query at geographic coordinate Hi Peter You will have to write some of the server-side code for saving the results into a list, but the spatial query is called a GetFeatureInfo request, which is part of the WMS spec, which Mapserver can do well. Here is the format of a request: http:///cgi-bin/mapserve.exe?service=WMS&version=1.1.1&request=GetFeatureInfo&LAYERS=mapsheet&QUERY_LAYERS=mapsheet&INFO_FORMAT=text/plain&SRS=EPSG:27200&BBOX=2435500,5843425,2437500,5845425&WIDTH=256&HEIGHT=256&X=128&Y=128 Kind regards, Robert Sanson >>> Peter Weilandt 14/11/2011 1:07 p.m. >>> 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? This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system. This message has been scanned for Malware and Viruses by Websense Hosted Security. www.websense.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Attribute query at geographic coordinate
Hi Peter I wonder if cartoDB(.com) would be a better product for you. It is similar in nature to Google Fusion Tables. It is open source and free. It seems fast you can load geodata into the system then via an API send a SQL statement including your lat and long. This will return results in several formats including json. This gives option may give you a bit more flexibility. It is still in fairly early stages of developments but seems very good so far. They offer a free trial account for a small amount of data, enough for your proof of concept. Then you can either pay for a hosted account or download the software and set up your own. This tool can also render map files based on your query. Hope that helps a bit. Matt :) Matt McClelland mob: 0411 306 650 e-mail: m...@wildwalks.com web: http://www.wildwalks.com/ Books: http://www.wildwalks.com/books Newsletter: http://www.wildwalks.com/office/newsletters/ On Mon, Nov 14, 2011 at 11:07 AM, Peter Weilandt 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-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Attribute query at geographic coordinate
In mapserver 6, you can use any ogr outputformat, including geojson, without having to setup a template. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center On 11/14/11 2:50 PM, "Fawcett, David (MPCA)" wrote: >If you didn't need to use WFS and just wanted to do MapServer queries, >you could put together a template that would build you a list. Take a >look at the examples on this page: >http://mapserver.org/output/template_output.html > >The JSON example is probably the most applicable. > >Like others have mentioned, 500 data layers won't be efficient, so you >may want to explore other data organization ideas. > >David. > > > >-Original Message- >From: mapserver-users-boun...@lists.osgeo.org >[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Robert >Sanson >Sent: Sunday, November 13, 2011 6:34 PM >To: mapserver-users@lists.osgeo.org; Peter Weilandt >Subject: Re: [mapserver-users] Attribute query at geographic coordinate > >Hi Peter > >You will have to write some of the server-side code for saving the >results into a list, but the spatial query is called a GetFeatureInfo >request, which is part of the WMS spec, which Mapserver can do well. Here >is the format of a request: > >http:///cgi-bin/mapserve.exe?service=WMS&version=1.1.1&request=G >etFeatureInfo&LAYERS=mapsheet&QUERY_LAYERS=mapsheet&INFO_FORMAT=text/plain >&SRS=EPSG:27200&BBOX=2435500,5843425,2437500,5845425&WIDTH=256&HEIGHT=256& >X=128&Y=128 > >Kind regards, > >Robert Sanson > >>>> Peter Weilandt 14/11/2011 1:07 p.m. >>> >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? > > > >This email and any attachments are confidential and intended solely for >the addressee(s). If you are not the intended recipient, please notify us >immediately and then delete this email from your system. > >This message has been scanned for Malware and Viruses by Websense Hosted >Security. >www.websense.com >___ >mapserver-users mailing list >mapserver-users@lists.osgeo.org >http://lists.osgeo.org/mailman/listinfo/mapserver-users > > >___ >mapserver-users mailing list >mapserver-users@lists.osgeo.org >http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users