[mapserver-users] Re: mapscript querybypoint on tiled raster
mgleahy at alumni.uwaterloo.ca
Tue Jul 29 21:23:53 EDT 2008
Thanks for the reply. To clarify, I am using 5.2. I'm guessing by what
you're saying is that bugs with a new feature like this are to be
expected - I just wanted to check if it was already known to anyone else
before submitting a ticket in the trac.
Steve Lime wrote:
> Support for tile names relative to the tile index is brand new in 5.2 so in older versions
> absolute paths or paths relative to the mapfile were your only options.
>>>> On 7/29/2008 at 12:44 PM, in message <488F56FC.9070701 at alumni.uwaterloo.ca>,
> Mike Leahy <mgleahy at alumni.uwaterloo.ca> wrote:
>> Ok...I figured out the problem pretty much right after I clicked send on
>> that last message. I had generated my tile index.shp with relative
>> paths for the LOCATION field (i.e., relative to the shp file). I just
>> regenerated it with absolute path names, and it the query function works
>> So would this be a known bug of any sort, or is it just bad practice to
>> use relative filenames with MapServer?
>> Mike Leahy wrote:
>>> Hello list,
>>> I'm sure this one has come up before, but I can't seem to figure out
>>> what I need to do. I have some tiled raster layers that I've got in a
>>> mapfile that is being used for generating ka-map tiles. I'm trying to
>>> query the values on these layer using the queryByPoint function in
>>> php_mapscript. I have a generic identify function that returns results
>>> for any of my vector layers, and for non-tiled raster layers - just not
>>> for the tiled raster layers. Is it possible to query tiled raster
>>> layers? If so, can someone spot what I'm doing wrong below?
>>> The tiled-raster layers in the mapfile generally look like this:
>>> NAME "Tiled Raster"
>>> GROUP "Tiled Raster"
>>> STATUS ON
>>> TYPE RASTER
>>> TILEINDEX "/data/index.shp"
>>> TILEITEM "LOCATION"
>>> "imageformat" "AGG_JPEG"
>>> And here is the function in PHP:
>>> public function Identify($oMap,$layer,$x,$y,$cellSize)
>>> $oLayer = $oMap->getLayerByName($layer);
>>> if (in_array($oLayer->type,
>>> $oQPoint = ms_newPointObj();
>>> $aResults = array();
>>> if (@$oLayer->queryByPoint($oQPoint,MS_MULTIPLE,$oLayer->tolerance) ==
>>> $nResults = $oLayer->getNumResults();
>>> for ($i=0;$i<$nResults;$i++)
>>> $oResult = $oLayer->getResult($i);
>>> $oShape = $oLayer->getShape($oResult->tileindex,
>>> $aResults = array($oResult,$oShape);
>>> return $aResults;
>>> Thanks in advance for any help,
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
More information about the mapserver-users