MapScript C# QueryByPoint
condit at SDSC.EDU
Tue Mar 7 01:02:34 EST 2006
Actually after further testing it looks as though this only happens with
my raster layers. My vector layers all query just fine.
Is there anything else I need to do for a raster layer (ArcInfo
Coverage) to allow queries to work? I've got the template defined in
the map file.
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Christopher Condit
Sent: Monday, March 06, 2006 1:48 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] MapScript C# QueryByPoint
I have a question about QueryByPoint in C# MapScript. I've subclassed
the layerObj and want to run QueryByPoint from this object.
getNumResults always returns 0, however. I have a template defined for
the layer - and results are returned from the mapserver CGI.
Is there some special way to run a query from inside a layerObj (or
public class elevationLayer : layerObj
public elevationLayer(mapObj map) : base(map)
name = "Elevation";
type = MS_LAYER_TYPE.MS_LAYER_RASTER;
data = @"..\elevation\elevation.adf";
public string QueryLayer(double x, double y)
string ret = null;
int res = queryByPoint(map, new pointObj(x, y, 0, 0),
mapscript.MS_SINGLE, 0.25 );
ret = "<b>Depth: </b>";
if (0 == getNumResults())
ret += "Unknown";
resultCacheMemberObj result = getResult(0);
if (null != result)
shapeObj shape = getFeature(result.shapeindex,
ret += int.Parse(shape.getValue(2)) * -1 + "
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapserver-users