[mapserver-users] query in url

Steve Lime Steve.Lime at dnr.state.mn.us
Wed Jul 2 21:27:11 EDT 2008


There are always many ways. If you don't have any spatial information in the 3rd party application then 
you have a couple of options:

  1) do an attribute query with a URL template (explained below)

  2) pass the parcel id to your MapServer application and use it to do an ajax call to lookup the spatial
extent information. This would work nicely if using OpenLayers, Ka-Map, dBox, or some other type of
client that doesn't reload the entire page. It's really just a variation of 1.

Anyway,  you'd want to do a simple attribute query first to get the spatial extents of the parcel. So, if
you had a special mapfile (parcel_lookup.map) it might look like so:

MAP
  ...

  LAYER
    NAME 'parcels'
    TYPE QUERY
    STATUS DEFAULT
    TEMPLATE 'http://wthtecnology.com/cgi-bin/mapserv?map=main_application.map&mapext=[shpext_esc]'
  END
END

The URL to do the attribute query would look like:

  http:////wthtecnology.com/cgi-bin/mapserv?map=parcel_lookup.map&qitem=id&qlayer=parcels&qstring=xxx-xx-xxxx-xxxx

The is off the top of my head but I've done it and it works nicely.

Caveats:

  1) depending on version you'll need to set a qstring filter in parcel_lookup.map to validate parcel ids with

  2) if using 5.2, it has a new feature to expand extent tags so they aren't so tight to the feature (e.g. [shpext escape=url expand=500]

The way this works is your initial call looks up the parcel and gets it's extent. Then that is used to create another call to your main application. The redirection happens automatically and is transparent to the user.

Let me know if you need more information.

Steve

>>> "Kevin Edmundson" <kevin.edmundson at wthtechnology.com> 07/02/08 11:06 AM >>>
I have a mapserver site that contains, among others, a parcel layer.  

I have a 3rd party application that manages parcel data for a customer
and I would like to...from the third party application...send a url
request to the mapserver that would cause it to open, and zoom to a
particular parcel.

If the parcel layer was named 'parcels' and the field name was
ParcelNumber in the layer, how would I construct the url request to
perform the above function...or is it even possible?

Kevin Edmundson

CIO
WTH Technology, Inc
567 W Westfield Blvd
Indianapolis, IN 46208
317.259.0105 office
317.259.1423 fax
317.501.8560 mobile

kevin.edmundson at wthtechnology.com

NOTICE: This message is from the technology firm WTH Technology, Inc.
This message is intended only for the individual or entity to which it
is directed. If you are not the addressee, or if this message has been
addressed to you in error, you are not authorized to use, read, copy or
distribute this message and any attachments, and we ask that you please
immediately delete this message and attachments (including all copies),
and notify the sender by return e-mail so that our records can be
corrected. All personal messages express views only of the sender, which
are not to be attributed to WTH Technology, Inc, and may not be
distributed or copied without this statement.



More information about the mapserver-users mailing list