[UMN_MAPSERVER-USERS] Creating querymap via CGI parameters

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Mon Oct 25 11:29:55 EDT 2004


> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Richard Greenwood
> Sent: Monday, 25 October, 2004 00:27
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] 
> Creating querymap via CGI parameters
> 
> 
> On Thu, 21 Oct 2004 14:05:46 -0400, Kralidis,Tom [Burlington] 
> <tom.kralidis at ec.gc.ca> wrote:
> > This doesn't work either for me.
> > 
> > Basically, I'm looking for a CGI GET style URL format, 
> which will give 
> > me a map with my query highlighted.  Almost like a OGC:WMS 
> > GetFeatureInfo, but returned as an image (n.b. only 
> text-based results 
> > are supported in MapServer WMS).
> > 
> > My inputs would be:
> > 
> > Layername
> > Bbox
> > img.x (of queried point)
> > img.y (of queried point)
> > 
> > ...which I've tried to replicate with:
> > 
> > 
> http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?map=/usr/local/wwwsites/ap
> > 
> ache/devgeo.cciw.ca/apps/mapserv/services/ecows/config.map&mode=querym
> > 
> ap&img.x=289&img.y=268&imgext=-96.49999999971898%2042.00000000017564%2
> > 
> 0-72.50000000028102%2056.99999999982436&layer=star_phosphorous&buffer=
> > 20
> > 
> > ..but get nothing.
> > 
> > Doing this via OGC:WMS GetFeatureInfo gives me results, so 
> I know data 
> > is there:
> > 
> > 
> http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?SERVICE=WMS&VERSION=1.1.1&
> > 
> REQUEST=GetFeatureInfo&SRS=EPSG%3A4326&BBOX=-96.49999999971898,42.0000
> > 
> 0000017564,-72.50000000028102,56.99999999982436&WIDTH=560&HEIGHT=350&L
> > 
> AYERS=star_phosphorous&STYLES=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRA
> > 
> NSPARENT=FALSE&QUERY_LAYERS=star_phosphorous&INFO_FORMAT=text%2Fhtml&X
> > =289&Y=268&FEATURE_COUNT=5
> > 
> > ..Tom
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Skweda O'Bomsawin [mailto:sobomsawin at kassini.com]
> > > Sent: Monday, 18 October, 2004 10:01
> > > To: Kralidis,Tom [Burlington]; MAPSERVER-USERS at LISTS.UMN.EDU
> > > Subject: RE : [UMN_MAPSERVER-USERS] Creating querymap via CGI 
> > > parameters
> > >
> > >
> > > I never be able to get Mapserver 4.0 works in querymap 
> mode (error 
> > > 500).  I finally succeeded with Mapserver 4.2.  My URL looks like 
> > > this:
> > >
> > > http://localhost/cgi-bin/mapserv_42?map=/var/www/html/demo.map
> > > &layers=poly+
> > > bkgd+lakes+roads&mapsize=791+749&imgext=-2341026.679536+-97627
> > > 9.05923496
> > > bkgd+lakes+69+3
> > 
> > 
> > > 
> 029014.36292+4108266.1303309673&mode=nquerymap&imgbox=53+221+664+721
> > >
> > > Coordinates are in Lambert (meters).  You can also cache some 
> > > variables like mode and mapsize.  You need a dummy query layer in 
> > > your mapfile (or in hidden tag).  I use an imgbox because 
> this is a 
> > > nquerymap (query with a rubberband square).
> > >
> > > Skweda O'Bomsawin
> > >
> > > -----Message d'origine-----
> > > De : UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] 
> > > De la > part de 
> Kralidis,Tom [Burlington] Envoyé : 15 octobre 2004 
> > > 20:00 À : MAPSERVER-USERS at LISTS.UMN.EDU Objet : 
> > > [UMN_MAPSERVER-USERS] Creating querymap via CGI parameters
> > >
> > > Hi,
> > >
> > > In the itasca demo, querying features displays a standard 
> querymap, 
> > > as well as cached query.
> > >
> > > Looking at the HTML, it looks like:
> > >
> > > Standard querymap: ms_tmp/DEMO10978846173120.gif
> > >
> > > Cached query: 
> > > /cgi-bin/mapserv.exe?map=c:/ms4w/apps/itasca/demo.map&queryfil
> > > e=c:/ms4w/ 
> > > tmp/ms_tmp/DEMO10978846173120.qy&layer=lakespy2&layer=dlgstln2
> > > &mode=map&
> > > size=200+200
> > >
> > > How can one replicate this behaviour (i.e. output a 
> querymap) with 
> > > CGI parameters through MapServer CGI?
> > >
> > > Thanks
> > >
> > > ..Tom
> > >
> > > =========================
> > > Tom Kralidis
> > > Systems Scientist
> > > Environment Canada
> > > Tel: +01-905-336-4409
> > > http://www.ec.gc.ca/
> 
> 
> Can't you just use a mode=query (or mode=nquery) and for the 
> qlayer, provide an html file that has an image tag like src='[img]'
> 

Do you have an exmaple of how this is done?

The problem is that the output HTML is a result of an OGC:WMS GetFeatureInfo request, and *not* a MapServer CGI request, so items like [img] won't work, at least I think they wouldn't.

> Maybe I do not understand your question, but it seems like 
> that's how i do it.
> 
> Regards,
> -- 
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> 



More information about the mapserver-users mailing list