Mapserver CGI or C API question

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Fri Oct 29 17:13:12 EDT 2004


> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of ANDY CANFIELD
> Sent: Friday, 29 October, 2004 17:06
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] Mapserver CGI or C API question
> 
> 
> For anyone who may know,
>     I am still working on my wireless app for using Mapserver 
> from a Nextel phone. So far so good except I'm starting to 
> run into some things I don't think the CGI was designed to 
> do. At least not per the docs. Specifically I need search 
> functionality. I want to be able to pass in a layer, an 
> attribute and a value to search for and get back the bounding 
> rectangle of all the features returned. I'm pretty sure the 
> CGI won't do that. Correct me if I'm wrong so I don't waste 
> time please. So what I'd like to do is write my own CGI that 
> does return this info. So these are my questions:
> 

This sounds like a job for a MapServer OGC:WFS GetFeature request with
filter, i.e.:

http://host/cgi-bin/mapserv?map=[mapfile]&version=1.0.0&service=WFS&requ
est=GetFeature&typename=[layername]&filter<Filter><PropertyIsEqualTo><Pr
opertyName>[field_name]</PropertyName><Literal>[attribute_value]</Litera
l></PropertyIsEqualTo></Filter>&

(fill in values in "[]" with your own).

By definition, this will returned to you all matching features encoded
as a GML (XML) document.  The opening information of this document will
provided the bounding box of all features returned.

You can have some middleware which connects to the WFS, makes the
request, then processes the info accordingly.

Hope this helps.

..Tom


> When you search a layer using mapserver's C api and it is 
> searching a shapefile and you want to search the whole 
> shapefile regardless of bounds is there any special searching 
> that goes on or is it a straight loop through all the records 
> in the shape file looking for matches in the attribute field 
> specified? IE does it load a b-tree in memory and then search 
> the tree or anything like that?
> 
> Thanks,
> Andy
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today 
> - it's FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 



More information about the mapserver-users mailing list