<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Comic Sans MS";
        panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The shpext tag can re-project, format and buffer a shapes extent if that helps.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Basques, Bob (CI-StPaul) [mailto:bob.basques@ci.stpaul.mn.us]
<br>
<b>Sent:</b> Wednesday, July 12, 2017 8:37 AM<br>
<b>To:</b> Lime, Steve D (MNIT) <steve.lime@state.mn.us><br>
<b>Cc:</b> Stephen Woodbridge <woodbri@swoodbridge.com>; mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] Fwd: Zoom to something and display in one shot from MapServer CGI.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Steve (L), <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I’ll try this out and get back here with the results.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">bobb<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jul 11, 2017, at 4:55 PM, Lime, Steve D (MNIT) <<a href="mailto:steve.lime@state.mn.us">steve.lime@state.mn.us</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">You can also do pure mapserver with a query layer and a URL template. It's doing a dynamic redirect but it's a single call from your perspective. You'd have a layer like so:<br>
<br>
LAYER<br>
 NAME 'parcel_query'<br>
 TYPE QUERY<br>
 DATA 'parcels'<br>
 VALIDATION<br>
   qstring '^[0-9]{16}$' # 16-digit pin number<br>
 END<br>
 TEMPLATE 'http://{url to display service}&mapext=[shpext]'<br>
END<br>
<br>
and then a query URL like so:<br>
<br>
 <a href="http://.../cgi-bin/mapserv?map=mymap.map?mode=itemquery&qlayer=parcels&qitem=pin&qstring=202923230045">http://.../cgi-bin/mapserv?map=mymap.map?mode=itemquery&qlayer=parcels&qitem=pin&qstring=202923230045</a><br>
<br>
Assumes one feature per pin...<br>
<br>
It's not a pretty URL, if that's needed use a script as Steve suggests or something like mod_rewrite in front.<br>
<br>
Steve<br>
<br>
-----Original Message-----<br>
From: mapserver-users [<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of Stephen Woodbridge<br>
Sent: Tuesday, July 11, 2017 1:07 PM<br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: Re: [mapserver-users] Fwd: Zoom to something and display in one shot from MapServer CGI.<br>
<br>
Bobb,<br>
<br>
If you using sql you can do this in one pass, just write a trivial php <br>
script that returns an image.<br>
<br>
1. connect to db<br>
2. sql to query expanded bbox of parcel<br>
   select st_astext(st_extent(st_expand(geom, delta)))<br>
     from parcels where pin=?<br>
3. create url to mapserver based on bbox and image size<br>
5. header('Content-type: image/png');<br>
4. passthru(url);<br>
<br>
Don't make it more complicated than it needs to be. You can do the same <br>
using perl, python, script language of your choice.<br>
<br>
-Steve<br>
<br>
On 7/11/2017 12:22 PM, Basques, Bob (CI-StPaul) wrote:<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
Hi Steve,<br>
<br>
I want to send a CGI request like :  ServerName?pin=202923230045<br>
<br>
And zoom to the pin (parcel polygon) in the returned image and also <br>
add a buffer percentage.  This is for a reporting application.  I can <br>
do it with an intermediate service, but it’s been awhile since I did <br>
this, and was wondering if anything new in MapServer might help with <br>
this for a single pass approach.<br>
<br>
The zoom parameters would be hardcoded into the MapFILE in an ideal <br>
world, I can build an SQL for this for example, but I recall I <br>
couldn’t use the BBOX returned from the SQL as a BBOX for Mapserver <br>
parent call, my memory is cloudy on that capability from MapServer <br>
though, hence the question.  Now that you have me talking it through <br>
though, I think the last time I asked about this it was to inquire <br>
about possibly chaining more than one MapServer call together to get <br>
the result.  I think there were fears at the time about possible <br>
runaway processes being created . . . .<br>
<br>
bobb<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">On Jul 11, 2017, at 10:38 AM, Stephen Woodbridge <br>
<<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a> <<a href="mailto:woodbri@swoodbridge.com">mailto:woodbri@swoodbridge.com</a>>> wrote:<br>
<br>
On 7/11/2017 10:39 AM, Basques, Bob (CI-StPaul) wrote:<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">All,<br>
It’s probably because it’s Tues. but I think I’ve asked this before <br>
in the past . . .<br>
I have a DB with PIN numbers for PARCELS and I want to be able to <br>
auto-zoom(with buffer)  to a PARCEL by just sending in a PIN number <br>
via CGI.<br>
can the BBOX be pulled from the DB based on the geom in one shot? <br>
I’ve done this in the past with a Webservice that went and grabbed <br>
the BBOX separately, then assembled the url for getting the graphic <br>
back from Mapserver.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
Bobb,<br>
<br>
What are you trying to zoom? the image or the client?<br>
<br>
If it is the client then how is mapserver on the server supposed to <br>
tell the client it needs to zoom? You have to query the server to get <br>
the bbox then make the client zoom appropriately.<br>
<br>
For the image, assuming you want a static image showing the parcel, <br>
then I would write a php/python/perl script the you pass the PIN to <br>
and it does the work to figure out the extents and return the image.<br>
<br>
-Steve W<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
<a href="https://www.avast.com/antivirus">https://www.avast.com/antivirus</a><br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a> <<a href="mailto:mapserver-users@lists.osgeo.org">mailto:mapserver-users@lists.osgeo.org</a>><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
"If you're going through hell, keep going. “<br>
- Winston Churchill<br>
<br>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
"Be nice to people on your way up because you meet them on your way down."<br>
   - Jimmy Durante<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:9.0pt;font-family:"Comic Sans MS";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Comic Sans MS";color:black">"The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense."<span class="apple-converted-space"> </span><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:9.0pt;font-family:"Comic Sans MS";color:black">- Edsgar Dijkstra
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:9.0pt;font-family:"Comic Sans MS";color:black"><o:p> </o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>