I should say that I’m assuming you’re using version 7.0, that’s where the 
filter normalization work was done so that you could execute the same filter 
(item queries are just dynamic filters) against any data source.

Oh, and your last question, your URL template can use whatever protocol you 
want. All you’re doing is seeding it with feature properties – an extent, 
centroid and/or attributes…

Steve

From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Lime, Steve D (MNIT)
Sent: Friday, July 14, 2017 11:16 AM
To: Basques, Bob (CI-StPaul) 
<bob.basq...@ci.stpaul.mn.us<mailto:bob.basq...@ci.stpaul.mn.us>>
Cc: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: Re: [mapserver-users] Zoom to something and display in one shot from 
MapServer CGI.

You don’t need to do runtime substitution with an itemquery, MapServer will 
extend the where clause automatically. You data statement just needs to look 
like:

  DATA "wkb_geometry from (select objectid, parcelid, wkb_geometry from 
cache.rc_parcel_poly) as subquery using unique objectid srid=200068"

Steve

From: Basques, Bob (CI-StPaul) [mailto:bob.basq...@ci.stpaul.mn.us]
Sent: Thursday, July 13, 2017 10:24 AM
To: Lime, Steve D (MNIT) <steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>>
Cc: Stephen Woodbridge 
<wood...@swoodbridge.com<mailto:wood...@swoodbridge.com>>; 
mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: Re: [mapserver-users] Zoom to something and display in one shot from 
MapServer CGI.

Working on this, but not quite there yet . . .

My initial request looks like:

http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?
    mode=itemquery&
    qlayer=Parcels-Map-Query&
    qitem=parcelid&qstring=162823340026&
    WIDTH=1069&HEIGHT=917

I get a “no matching records” found . . . and with DEBUG 5 on the query layer . 
. .

    CONNECTIONTYPE PostGIS
        CONNECTION “host=localhost dbname=postgres user=mapserv password=****”

        DATA "wkb_geometry from (
            select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly 
where parcelid = '%pin%' or parcelid = '%qstring%') as subquery using unique 
objectid srid=200068"

        VALIDATION
                'pin' '^[0-9]{12}$'
            'qstring' '^[0-9]{12}$'
          END

… log entries removed for brevity…

The subquery works fine from sql and returns a single record.  One thing I 
noticed, is that the POLYGON BBOX is way off to the west a few thousand feet.  
There is no default image size in the Mapfile either so I don’t know where that 
number is coming from other than shpext . . . are there other parameters that 
need to be added to the shpext call?

the TEMPLATE link looks like:

    TEMPLATE 
'http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?pin=162823340026&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=all&_OLSALT=0.7873164216111053&SRS=EPSG%3A200068&BBOX=[shpext<http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?pin=162823340026&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=all&_OLSALT=0.7873164216111053&SRS=EPSG%3A200068&BBOX=%5bshpext>
 format="$minx,$miny,$maxx,$maxy"]&WIDTH=1069&HEIGHT=917'

This will (should) return an image, should it be some sort of text return 
instead?  I’m trying to keep it WMS too . . . is this still doable??

bobb
On Jul 12, 2017, at 10:41 AM, Lime, Steve D (MNIT) 
<steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>> wrote:

The shpext tag can re-project, format and buffer a shapes extent if that helps.

From: Basques, Bob (CI-StPaul) [mailto:bob.basq...@ci.stpaul.mn.us]
Sent: Wednesday, July 12, 2017 8:37 AM
To: Lime, Steve D (MNIT) <steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>>
Cc: Stephen Woodbridge 
<wood...@swoodbridge.com<mailto:wood...@swoodbridge.com>>; 
mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: Re: [mapserver-users] Fwd: Zoom to something and display in one shot 
from MapServer CGI.

Steve (L),

That’s really close to what I was looking for.  I vaguely remembered something 
going on enhancement wise, related to URL requests inside of a MapServer 
request.

I’ll try this out and get back here with the results.

bobb




"I like nonsense; it wakes up the brain cells."
- Dr. Seuss




_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to