[Mapserver-users] MapWidth and queryByRect...
Denis Lalonde
denlalonde at yahoo.com
Sat Oct 4 16:48:02 PDT 2003
--0-168151693-1065311282=:52216
Content-Type: text/plain; charset=us-ascii
Hello all,
I tried posting this yesterday as a Newbie, but I think it may have gotten lost in cyberspace. My appologies if the lost post suddenly re-appears.
Anyway, I have a couple of questions.
Using the map file below:
---------------------------------------------------------------------------
NAME FIRSTMAP
SIZE 468 320
STATUS ON
EXTENT -145 41 -50 83
SHAPEPATH ""
UNITS DD
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END
# Start of scalebar
#'''''''''''''''''''''''''''''''''''''
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 0 0 0
SIZE SMALL
END
SIZE 150 4
COLOR 0 0 255
BACKGROUNDCOLOR 0 0 0
OUTLINECOLOR 0 0 0
UNITS KILOMETERS
INTERVALS 2
STATUS EMBED
END
LAYER
NAME "Canada"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "canada.tab"
STATUS ON
DATA "canada"
STYLEITEM "AUTO"
End
---------------------------------------------------------------------------
I am trying to query by rectangle using the following code:
$rect = ms_newrectObj();
$rect->setextent($map->extent->minx,$map->extent->miny,$map->extent->maxx,$map->extent->maxy);
$results=$lyr->queryByRect($rect);
I get the following error:
Warning: [MapServer Error]: msQueryByRect(): No matching record(s) found
What am I missing? And how would I get a number of records count when I do eventually get it to return something?
------------------------------
Ok, and my last Newbie question:
I try to get the MapWidth of the map using the following code:
#$MapOBJ->units="KILOMETERS"; # tried changing to kilometers, but nothing...
$bottomleftpoint=ms_newpointObj();
$bottomleftpoint->setXY($extent_to_set[0],$extent_to_set[1]);
$bottomrightpoint=ms_newpointObj();
$bottomrightpoint->setXY($extent_to_set[2],$extent_to_set[1]);
$distanceToPoint=$bottomleftpoint->distanceToPoint($bottomrightpoint);
But what I get is 112 "some units" for something that should give me 6000 kms. (?)
Thanks in advance,
Denis
---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
--0-168151693-1065311282=:52216
Content-Type: text/html; charset=us-ascii
<DIV><FONT face=Verdana size=1>Hello all,</FONT></DIV>
<DIV><FONT face=Verdana size=1>I tried posting this yesterday as a Newbie, but I think it may have gotten lost in cyberspace. My appologies if the lost post suddenly re-appears.</FONT></DIV>
<DIV><FONT face=Verdana size=1></FONT> </DIV>
<DIV><FONT face=Verdana size=1>Anyway, I have a couple of questions.</FONT></DIV>
<DIV><FONT face=Verdana size=1></FONT> </DIV>
<DIV><FONT face=Verdana size=1>Using the map file below:</FONT></DIV>
<DIV><FONT face=arial size=1>---------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=arial size=1>NAME FIRSTMAP<BR>SIZE 468 320<BR>STATUS ON<BR>EXTENT -145 41 -50 83<BR>SHAPEPATH ""<BR>UNITS DD<BR></DIV></FONT>
<DIV><FONT face=arial size=1>OUTPUTFORMAT<BR> NAME png<BR> DRIVER "GD/PNG"<BR> MIMETYPE "image/png"<BR> IMAGEMODE PC256<BR> EXTENSION "png"<BR>END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=1># Start of scalebar</FONT><BR><FONT size=1>#'''''''''''''''''''''''''''''''''''''<BR>SCALEBAR<BR> IMAGECOLOR 255 255 255<BR> LABEL<BR> COLOR 0 0 0 <BR> SIZE SMALL<BR> END<BR> SIZE 150 4<BR> COLOR 0 0 255<BR> BACKGROUNDCOLOR 0 0 0<BR> OUTLINECOLOR 0 0 0<BR> UNITS KILOMETERS<BR> INTERVALS 2<BR> STATUS EMBED<BR>END</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>LAYER<BR> NAME "Canada"<BR> TYPE POLYGON<BR> CONNECTIONTYPE OGR<BR> CONNECTION "canada.tab"<BR> STATUS ON<BR> DATA "canada"<BR> STYLEITEM "AUTO"</FONT></DIV>
<DIV><FONT size=1>End</FONT></DIV>
<DIV><FONT size=1>---------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>I am trying to query by rectangle using the following code:</FONT></DIV>
<DIV><FONT size=1>$rect = ms_newrectObj();<BR>$rect->setextent($map->extent->minx,$map->extent->miny,$map->extent->maxx,$map->extent->maxy);</FONT></DIV>
<DIV><FONT size=1>$results=$lyr->queryByRect($rect);</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>I get the following error:</FONT></DIV>
<DIV><STRONG>Warning</STRONG>: [MapServer Error]: msQueryByRect(): No matching record(s) found</DIV>
<DIV> </DIV>
<DIV><FONT size=1>What am I missing? And how would I get a number of records count when I do eventually get it to return something?</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>------------------------------</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>Ok, and my last Newbie question:</FONT></DIV>
<DIV><FONT size=1>I try to get the MapWidth of the map using the following code:</FONT></DIV>
<DIV><FONT size=1>#$MapOBJ->units="KILOMETERS"; # tried changing to kilometers, but nothing...<BR>$bottomleftpoint=ms_newpointObj();<BR>$bottomleftpoint->setXY($extent_to_set[0],$extent_to_set[1]);<BR>$bottomrightpoint=ms_newpointObj();<BR>$bottomrightpoint->setXY($extent_to_set[2],$extent_to_set[1]);<BR>$distanceToPoint=$bottomleftpoint->distanceToPoint($bottomrightpoint);</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>But what I get is 112 "some units" for something that should give me 6000 kms. (?) </FONT></DIV>
<DIV><FONT size=1></FONT> </DIV>
<DIV><FONT size=1>Thanks in advance,</FONT></DIV>
<DIV><FONT size=1>Denis</FONT></DIV>
<DIV><FONT size=1></FONT> </DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://shopping.yahoo.com/?__yltc=s%3A150000443%2Cd%3A22708228%2Cslk%3Atext%2Csec%3Amail">The New Yahoo! Shopping</a> - with improved product search
--0-168151693-1065311282=:52216--
More information about the MapServer-users
mailing list