<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Times New Roman, Times, serif">I do this by faking a
WMS-service, with the pixel size of the scan as map boundaries,
and using an arbitrary EPSG. It's primitive, but it works and I
use it a lot, especially for large serieses of scans.<br>
<br>
See:<br>
<br>
<a href="http://mapserver.sara.nl/atlas/georef.html">http://mapserver.sara.nl/atlas/georef.html</a><br>
<br>
Left the unreferenced scan, right the referenced maps, both
zoomable independently. With a little elementary math, you can
even align both maps (the sync buttons). You can even use it in
QGIS or any other WMS-enabled program, e.g. to set reference
points for warping or designing vector art work. Comments
appreciated.<br>
<br>
Jan<br>
<br>
(file: utils.inc)<br>
<br>
<?php<br>
function getSizeRaster($data) {<br>
//Compute size of raster file $data in array $arr <br>
return ($ar);<br>
}<br>
function createMapFromData($title,$epsg,$parms,$data) <br>
$oMap = ms_newMapObj("");<br>
$oMap->setProjection("init=epsg:$epsg");<br>
$oMap->setMetaData("wms_title",$title);<br>
$oMap->setMetaData("wms_srs","epsg:$epsg");<br>
$oMap->setMetadata("wms_contactperson","Jan Hartmann");<br>
$oMap->setMetadata("wms_contactorganization","University of
Amsterdam");<br>
$oMap->setMetadata("wms_contactelectronicmailaddress",<a class="moz-txt-link-rfc2396E" href="mailto:j.l.h.hartmann@uva.nl">"j.l.h.hartmann@uva.nl"</a>);<br>
$oMap->setMetadata("wms_enable_request","*");<br>
$pwd = <a class="moz-txt-link-rfc2396E" href="http://mapserver.sara.nl/">"http://mapserver.sara.nl/"</a> . $_SERVER["SERVER_NAME"];<br>
$pwd = $pwd . $_SERVER["PHP_SELF"];<br>
if ($parms) $pwd = $pwd . "?$parms";<br>
$oMap->setMetadata("wms_onlineresource",$pwd);<br>
$l = ms_newLayerObj($oMap);<br>
$l->set("name",$title);<br>
$l->setProjection("init=epsg:$epsg");<br>
$l->setMetadata("wms_title",$title);<br>
$l->setMetadata("wms_srs","epsg:$epsg");<br>
$l->set("status",MS_DEFAULT);<br>
$l->set("type",MS_LAYER_RASTER);<br>
$l->set("data",$data);<br>
$ar = getSizeRaster($data); <br>
$oMap->setExtent($ar[0],$ar[1],$ar[2],$ar[3]);<br>
$oMap->setMetadata("wms_extent","$ar[0] $ar[1] $ar[2]
$ar[3]");<br>
$l->setMetadata("wms_extent","$ar[0] $ar[1] $ar[2]
$ar[3]");<br>
$oMap->setSize(600,600 * (($ar[3]-$ar[1]) / ($ar[2] -
$ar[0])));<br>
return($oMap);<br>
}<br>
function dispatchMap($oMap) {<br>
$request = ms_newowsrequestobj();<br>
$request->loadparams();<br>
ms_ioinstallstdouttobuffer();<br>
$oMap->owsdispatch($request);<br>
$contenttype = ms_iostripstdoutbuffercontenttype();<br>
if ($contenttype == "text/xml") {<br>
header("Content-type: application/xml");<br>
$buffer = ms_iogetstdoutbufferstring();<br>
echo $buffer;<br>
} else {<br>
header("Content-type:$contenttype");<br>
ms_iogetStdoutBufferBytes();<br>
}<br>
ms_ioresethandlers();<br>
}<br>
?><br>
<br>
The simplest WMS-service would be a PHP-script like<br>
<br>
<?php<br>
require("utils.inc");<br>
$fn = <path to scan-file>;<br>
$oMap = createMapFromData("WMS_title",28992,"",$fn);<br>
dispatchMap($oMap);<br>
?><br>
<br>
The WMS-service would just be:<br>
<br>
mywms.php<br>
<br>
<br>
When you have a series of numbered scans in subdirectories, you
could do:<br>
<br>
<?php<br>
require("utils.inc");<br>
$base = <base directory of scans>;<br>
$subdir = $_REQUEST["subdir"];<br>
$nr = $_REQUEST["nr"];<br>
$path = "$base/$subdir/scan_$nr.tif";<br>
$oMap = createMapFromData("scan",28992,"subdir=$subdir&nr=$nr",$path);<br>
dispatchMap($oMap);<br>
?><br>
<br>
And accessl each scan as a WMS service like:<br>
<br>
mywms.php?subdir=<subdir>&nr=<nr> <br>
<br>
<br>
</font>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<div class="moz-cite-prefix"><font face="Times New Roman, Times,
serif">On 02/14/2013 05:03 PM, Weisbender, Eric wrote:<br>
</font></div>
<blockquote
cite="mid:9FE7B20682D2EE4CB9F40163E1EB4F08933471@afovsml1m.WAPA.INT"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<font face="Times New Roman, Times, serif">
</font>
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Arial Black";
panose-1:2 11 10 4 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@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]-->
<div class="WordSection1">
<p class="MsoNormal"><font face="Times New Roman, Times, serif">I
would like to use MapServer as just an unreferenced image
viewer for jpgs so I can zoom in and out on the image.
Everything I read says that images have to be
georeferenced. Any idea or even examples would be greatly
appreciated.<o:p></o:p></font></p>
<p class="MsoNormal"><font face="Times New Roman, Times, serif"><o:p> </o:p></font></p>
<p class="MsoNormal"><font face="Times New Roman, Times, serif"><span
style="font-size: 10pt;">Thanks,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman, Times, serif"><span
style="font-size: 10pt;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman, Times, serif"><span
style="font-size: 10pt; color: green;">Eric Weisbender</span><span
style="font-size: 10pt;"><o:p></o:p></span></font></p>
</div>
<font face="Times New Roman, Times, serif"><br>
</font>
<fieldset class="mimeAttachmentHeader"></fieldset>
<font face="Times New Roman, Times, serif"><br>
</font>
<pre wrap=""><font face="Times New Roman, Times, serif">_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
</font></pre>
</blockquote>
<br>
</body>
</html>