<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="de1">Working on this, but not quite there yet . . .</div>
<div class="de1"> </div>
<div class="de1">My initial request looks like:</div>
<div class="de1"> </div>
<div class="de2"><a href="http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?" class="">http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?</a></div>
<div class="de1"> mode=itemquery&</div>
<div class="de1"> qlayer=Parcels-Map-Query&</div>
<div class="de1"> qitem=parcelid&qstring=162823340026&</div>
<div class="de1"> WIDTH=1069&HEIGHT=917</div>
<div class="de2"> </div>
<div class="de1">I get a “no matching records” found . . . and with DEBUG 5 on the query layer . . .</div>
<div class="de1"> </div>
<div class="de1"> CONNECTIONTYPE PostGIS</div>
<div class="de1"> CONNECTION “host=localhost dbname=postgres user=mapserv password=****”</div>
<div class="de2"> </div>
<div class="de1"> DATA "wkb_geometry from (</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '%qstring%') as subquery using unique objectid srid=200068"</div>
<div class="de1"> </div>
<div class="de1"> VALIDATION</div>
<div class="de2"> 'pin' '^[0-9]{12}$'</div>
<div class="de1"> 'qstring' '^[0-9]{12}$'</div>
<div class="de1"> END</div>
<div class="de1"> </div>
<div class="de1"> </div>
<div class="de2">[Thu Jul 13 09:30:00 2017].645602 msPostGISGetPaging called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].645665 msPostGISLayerIsOpen called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].645672 msPostGISLayerFreeItemInfo called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].645675 msPostGISLayerClose called: wkb_geometry from (</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].645680 msPostGISLayerOpen called: wkb_geometry from (</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].645686 msPostGISLayerOpen: No connection in pool, creating a fresh one.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].654626 msConnPoolRegister(Parcels-Map-Query,host=localhost dbname=postgres user=mapserv password=****,0x191b510)</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659333 msPostGISLayerOpen: Got PostGIS version 20200.</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].659343 msPostGISLayerOpen: Forcing 2D geometries: yes.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659347 msPostGISEnablePaging called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659349 msPostGISLayerIsOpen called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659354 msPostGISLayerFreeItemInfo called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659359 msPostGISLayerFreeItemInfo called.</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].659364 msPostGISLayerGetItems called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659368 msPostGISParseData called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659378 msPostGISParseData: unique_column=objectid, srid=, geom_column_name=wkb_geometry, table_name=(</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].659384 msPostGISLayerGetItems executing SQL: select * from (</div>
<div class="de2"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery where false limit 0</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666373 msPostGISLayerInitItemInfo called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666385 msPostGISLayerInitItemInfo called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666397 msPostGISLayerIsOpen called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666403 msPostGISLayerWhichShapes called.</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].666406 msPostGISParseData called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666413 msPostGISParseData: unique_column=objectid, srid=, geom_column_name=wkb_geometry, table_name=(</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666417 msPostGISBuildSQL called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666419 msPostGISBuildSQLItems called.</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].666422 msPostGISBuildSQLItems: 2 items requested.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666426 msPostGISBuildSQLFrom called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666429 msPostGISBuildSQLWhere called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666432 msPostGISBuildSQLSRID called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666435 msPostGISBuildSQLSRID: Building find_srid line.</div>
<div class="de2">[Thu Jul 13 09:30:00 2017].666438 msPostGISBuildSQLBox called.</div>
<div class="de1">[Thu Jul 13 09:30:00 2017].666459 msPostGISLayerWhichShapes query: select "objectid","parcelid",encode(ST_AsBinary(ST_Force2D("wkb_geometry"),'NDR'),'hex') as geom,"objectid" from (</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery where wkb_geometry && ST_GeomFromText('POLYGON((573387 162092,573387 162555,574211 162555,574211
162092,573387 162092))',find_srid('','cache.rc_parcel_poly','wkb_geometry')) and ("parcelid"::text = '162823340026')</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114391 msPostGISLayerWhichShapes query status: PGRES_TUPLES_OK (2)</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114407 msPostGISLayerWhichShapes got 0 records in result.</div>
<div class="de2">[Thu Jul 13 09:30:01 2017].114412 msPostGISLayerNextShape called.</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114416 msPostGISLayerFreeItemInfo called.</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114419 msPostGISLayerClose called: wkb_geometry from (</div>
<div class="de1"> select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114443 msConnPoolRelease(Parcels-Map-Query,host=localhost dbname=postgres user=mapserv password=****,0x191b510)</div>
<div class="de2">[Thu Jul 13 09:30:01 2017].114447 msConnPoolClose(host=localhost dbname=postgres user=mapserv password=****,0x191b510)</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114546 msQueryByFilter(): Search returned no results. No matching record(s) found.</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114657 freeLayer(): freeing layer at 0x18e8a40.</div>
<div class="de1">[Thu Jul 13 09:30:01 2017].114661 msPostGISLayerIsOpen called.</div>
<div class="de1"> </div>
<div class="de2">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?</div>
<div class="de1"> </div>
<div class="de1">the TEMPLATE link looks like:</div>
<div class="de1"> </div>
<div class="de1"> TEMPLATE '<a href="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" class="">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</a>
format="$minx,$miny,$maxx,$maxy"]&WIDTH=1069&HEIGHT=917'</div>
<div class="de2"> </div>
<div class="de1">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??</div>
<div class="de1"> </div>
bobb<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 12, 2017, at 10:41 AM, Lime, Steve D (MNIT) <<a href="mailto:Steve.Lime@state.mn.us" class="">Steve.Lime@state.mn.us</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; font-family: ComicSansMS; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">The shpext tag can re-project, format and buffer a shapes extent if that helps.<o:p class=""></o:p></span></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div>
<div class="">
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>Basques, Bob (CI-StPaul) [<a href="mailto:bob.basques@ci.stpaul.mn.us" class="">mailto:bob.basques@ci.stpaul.mn.us</a>]<span class="Apple-converted-space"> </span><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, July 12, 2017 8:37 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>Lime, Steve D (MNIT) <<a href="mailto:steve.lime@state.mn.us" class="">steve.lime@state.mn.us</a>><br class="">
<b class="">Cc:</b><span class="Apple-converted-space"> </span>Stephen Woodbridge <<a href="mailto:woodbri@swoodbridge.com" class="">woodbri@swoodbridge.com</a>>;
<a href="mailto:mapserver-users@lists.osgeo.org" class="">mapserver-users@lists.osgeo.org</a><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [mapserver-users] Fwd: Zoom to something and display in one shot from MapServer CGI.<o:p class=""></o:p></span></div>
</div>
</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
Steve (L),<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
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.<o:p class=""></o:p></div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
I’ll try this out and get back here with the results.<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
bobb<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<br class="">
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); font-family: 'Comic Sans MS'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255);" class=""><br class="Apple-interchange-newline">
"I like nonsense; it wakes up the brain cells."</span></div>
<div class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space: pre;"></span>- Dr.
Seuss</span><br style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255);" class="">
<br class="">
</div>
<div class=""><br class="">
</div>
</div>
<br class="Apple-interchange-newline">
</div>
<br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: 'Comic Sans MS'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<br class="Apple-interchange-newline">
</div>
<br class="">
</body>
</html>