[Mapserver-users] mapscript: queryByPoint() returns no results
Christoph Spoerri
spoerri at duke.edu
Thu Jan 15 08:37:43 PST 2004
Hi there,
I'm not sure what I'm doing wrong this time. I'm trying to query a polygon
layer with a point. Yet, for some reason I only receive a 'No records found
error', even if I click in the middle of the polygon!
I'm using mapserver 4.0.1 with python scripts
thanks for you help again,
Christoph
Here's the code I'm using:
lyrCoast = myMap.getLayerByName('Continents')
try:
qryPt = pointObj()
qryPt.x,qryPt.y = xStart,yStart # coords are in pixels
lyrCoast.queryByPoint(myMap.,qryPt,MS_MULTIPLE,0)
result = lyrCoast.getResult(0)
s = shapeObj(lyrCoast.type)
lyrCoast.open()
lyrCoast.getShape(s,result.tileindex,result.shapeindex)
...
Here's the layer in the map file:
LAYER
NAME "Continents"
STATUS DEFAULT
TOLERANCE 5
TOLERANCEUNITS pixels
DATA "datalib/global/world_usa_canada"
TYPE POLYGON
TRANSPARENCY 0
CLASS
COLOR 180 210 170
OUTLINECOLOR 150 190 140
END
END
More information about the MapServer-users
mailing list