[Mapserver-users] Unique? Was: mapscript - queryByPoint help, simple Q

woodbri at swoodbridge.com woodbri at swoodbridge.com
Fri Aug 29 19:13:04 EDT 2003


Gerry,

You need to set it to some positive value and you can set the 
TOLERANCE UNITS also then you will get the item closest to the point 
if you are using MS_SINGLE and all items within the radius if you are 
use MS_MULTIPLE

I don't have my docs in front of me so I don't remember the exact 
syntax.

-Steve

On 29 Aug 2003 at 18:04, Gerry Creager N5JXS wrote:

> Steve,
> 
> Set to positive or negative values?  I know it sounds silly, but I
> tried to adjust this on one of my projects and I've apparently lost
> the correct incantation!
> 
> Thanks, Gerry
> 
> woodbri at swoodbridge.com wrote:
> > poff,
> > 
> > Do you have TOLERANCE set to a value, if it defaults to 0.0 then it
> > is going to be pretty hard to selecet a point.
> > 
> > -Steve
> > 
> > On 29 Aug 2003 at 14:08, poff wrote:
> > 
> > 
> >>Hello
> >>
> >>I know everyone is busy - and thanks a lot for your help.
> >>
> >>Only, does _no-one_ use querbypoint with php mapscript?
> >>
> >>It's a great feature if I could get it working, and definitely
> >>something to go in Wiki someday!
> >>
> >>Thanks
> >>
> >>P
> >>
> >>On Thu, Aug 28, 2003 at 11:40:42PM +0200, poff wrote:
> >>
> >>>>The problem is probably in your map file.
> >>>>TEMPLATE belongs in the LAYER not the CLASS.
> >>>
> >>>Thanks, I changed this and no change to the outcome.
> >>>
> >>>However, I added the TEMPLATE tag to all of the layers and then
> >>>suddenly, on the last layer:
> >>>
> >>>Warning: MapServer Error in msOpenSHPFile(): No (NULL) filename
> >>>provided
> >>>
> >>>This is using $mapObj->query...
> >>>
> >>>With the $uLayer->query it just says no records.
> >>>
> >>>Then when I changed $uLayer to the last one they both give the NULL
> >>>error.
> >>>
> >>>I'll go bald with all this hair pulling out!
> >>>
> >>>Thanks,
> >>>
> >>>P
> >>>
> >>>
> >>>>
> >>>>On Thu, 2003-08-28 at 19:15, poff wrote:
> >>>>
> >>>>>Hello again
> >>>>>
> >>>>>I've tried all the list suggestions with the followig code, but
> >>>>>am _still_ getting "No Records Found".
> >>>>>
> >>>>>If anyone could suggest or point out what I'm doing wrong I'd be
> >>>>>greatly indebted to them!
> >>>>>
> >>>>>Here it goes:
> >>>>>
> >>>>>...
> >>>>>$map = ms_newMapObj($mapfile);
> >>>>>
> >>>>>$uLayer = $map->getLayerByName("Points");
> >>>>>$uLayer->set("status",1);
> >>>>>
> >>>>>$image=$map->draw();
> >>>>>
> >>>>>while () {
> >>>>>
> >>>>>	$oPoint = ms_newPointObj();
> >>>>>	$oPoint->setXY($geoData['px'], $geoData['py']);
> >>>>>
> >>>>>	$line = ms_newLineObj();
> >>>>>	$line->add($oPoint);
> >>>>>
> >>>>>     	$shp=ms_newShapeObj(MS_SHAPE_POINT);
> >>>>>     	$shp->add($line);
> >>>>>     	$shp->{text}=$geoData['place_name'];
> >>>>>      	$shp->{index}=$i;
> >>>>>
> >>>>>      	$uLayer->addFeature($shp);
> >>>>>      		
> >>>>>	$oPoint->draw($map, $uLayer, $image, 0,
> >>>>>$geoData['place_name']);
> >>>>>
> >>>>>}
> >>>>>
> >>>>>$my_point = ms_newpointObj();
> >>>>>$my_point->setXY($_REQUEST["mapa_x"],$_REQUEST["mapa_y"]);
> >>>>>	
> >>>>>$map->queryByPoint($my_point, MS_SINGLE, 20);
> >>>>>
> >>>>>$uLayer->queryByPoint($my_point,MS_SINGLE,-10); // for good
> >>>>>measure ...
> >>>>>
> >>>>>And the mapfile:
> >>>>>
> >>>>>...
> >>>>>LAYER
> >>>>>	NAME "Points"
> >>>>>	STATUS ON
> >>>>>	TYPE POINT
> >>>>>	LABELCACHE FALSE
> >>>>>	CLASS
> >>>>>		NAME "User Marker"
> >>>>>		SYMBOL "marker"
> >>>>>	      	TEMPLATE "dummy"
> >>>>>		LABEL
> >>>>>			...
> >>>>>		END
> >>>>>	END
> >>>>>END
> >>>>>...
> >>>>>
> >>>>>I'm pretty stumped! I tried by $map-> and $Layer-> queryByPoint
> >>>>>to no great joy.
> >>>>>
> >>>>>Thanks in advance,
> >>>>>
> >>>>>P
> >>>>>
> >>>>>-- 
> >>>>>poff at sixbit.org
> >>>>>SDF Public Access UNIX System - http://sdf.lonestar.org
> >>>>>
> >>>>>Please do not carbon copy replies to me
> >>>>>_______________________________________________
> >>>>>Mapserver-users mailing list
> >>>>>Mapserver-users at lists.gis.umn.edu
> >>>>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >>>>>
> >>>>
> >>>>
> >>>>_______________________________________________
> >>>>Mapserver-users mailing list
> >>>>Mapserver-users at lists.gis.umn.edu
> >>>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >>>
> >>>-- 
> >>>poff at sixbit.org
> >>>SDF Public Access UNIX System - http://sdf.lonestar.org
> >>>
> >>>Please do not carbon copy replies to me
> >>>_______________________________________________
> >>>Mapserver-users mailing list
> >>>Mapserver-users at lists.gis.umn.edu
> >>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >>
> >>-- 
> >>poff at sixbit.org
> >>SDF Public Access UNIX System - http://sdf.lonestar.org
> >>
> >>Please do not carbon copy replies to me
> >>_______________________________________________
> >>Mapserver-users mailing list
> >>Mapserver-users at lists.gis.umn.edu
> >>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >>
> > 
> > 
> > 
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 
> -- 
> Gerry Creager -- gerry.creager at tamu.edu
> Network Engineering -- AATLT, Texas A&M University	
> Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.847.8578
> Page: 979.228.0173
> Office: 903A Eller Bldg, TAMU, College Station, TX 77843
> 
> 





More information about the mapserver-users mailing list