<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:Arial;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>Im trying to use ogr’s mysql
driver to create a points layer that will be converted to an imagemap.<br>
Im using the following template to create the imagemap:<br>
<br>
<map id="mymap" name="mymap"><br>
[resultset layer=mypoints]<br>
[feature]<br>
<area shape="circle" coords="[shpxy precision=0 proj=image
yf=",7" xf=","]" title="[buoyName]-[lat],[lon]"
href="#" alt="[buoyName]-[lat],[lon]"><br>
[/feature]<br>
[/resultset]<br>
<map><br>
<br>
<br>
the problem is that ogr pads numeric mysql fields with a very large amount of
whitespace. Here is some of my output:<br>
<br>
<area <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>
shape="circle" <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>
coords="178,274,7" <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>
title="42055:
2@
160" <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>
href="#" <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>
alt="42055:
2@
160"<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color="#444444"
face="Times New Roman"><span style='font-size:12.0pt;color:#444444'>/><br>
<br>
the (double) numeric fields [lat] and [lon] are being left-padded with a lot of
whitespace (each field is 22 spaces long in total).<br>
running my ovf file from the command line with ogrinfo produces the same
result; a lot of unecessary left-padding.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>OGRFeature(mypoints):88<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> max(recTS) (Integer) = 1238258520<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> buoyName (String) = 41114<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> lat (Real)
=
28<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> lon (Real)
=
-80<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> MAG (Real)
=
-371<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> WDIR (Real)
=
-99<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> WSPD (Real)
=
-99<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> ADIR (Real)
=
81<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> ts (DateTime) = 2009/03/13
11:42:00<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> POINT (-80.219999999999999 27.55
0)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>Ogr’s output also shows the
20+space left-padding for the double&int fields.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>Im trying to access my imagemap using a
url in this format:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><a
href="http://localhost/cgi-bin/mapserv?map=/data/www/html/test/test.map&mode=nquery&searchmap=true">http://localhost/cgi-bin/mapserv?map=/data/www/html/test/test.map&mode=nquery&searchmap=true</a><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>I also tried embedding php code to try
to preprocess the variables:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><map id="mymap"
name="mymap"><br>
[resultset layer=mypoints]<br>
[feature]<br>
<area shape="circle" coords="[shpxy precision=0 proj=image
yf=",7" xf=","]" title="[buoyName]-<b><span
style='font-weight:bold'><?php trim([lat]):>,[</span></b>lon]"
href="#" alt="[buoyName]-[lat],[lon]"><br>
[/feature]<br>
[/resultset]<br>
<map><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'> but this obviously didn’t
work, Im assuming since cgi was processing & returning the results, so php
was never even called upon.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>Questions:<br>
How can I remove this padding? <br>
Is this padding by design, or a bug in ogrinfo?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'>Is there any other way that I can
pre-process these variables prior to sending them to the browser, (using php or
some other means) so that I can process&format them based on my needs?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color="#444444" face="Times New Roman"><span
style='font-size:12.0pt;color:#444444'><br>
Please help,<br>
Thanks,<br>
P.Romero</span></font><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p></o:p></span></font></p>
</div>
</body>
</html>