mapscript query question
Christopher Condit
condit at SDSC.EDU
Thu Jan 19 11:15:16 PST 2006
I'm using C# MapScript to build my MapFile. This is working great. Now
I want to query the MapFile programmatically - but can't seem to figure
out how to do it. Is there a tutorial that I'm not seeing?
Here's my code snippet:
layerObj queryLayer = map.getLayerByName("myLayer");
if (null != queryLayer)
{
int count = queryLayer.queryByPoint(myMap, new pointObj(-82, 25, 0, 0),
mapscript.MS_MULTIPLE, 5.0d);
if (count > 0)
{
queryLayer.open();
for (int i = 0; i < count; i++)
{
resultCacheMemberObj result = queryLayer.getResult(i);
shapeObj shape = obisLayer.getFeature(result.shapeindex,
result.tileindex);
}
queryLayer.close();
}
}
The resultCacheMemberObj never gets a value, even when query by point
returns > 0. Here's my layer definition:
LAYER
CONNECTION "user/pass"
CONNECTIONTYPE ORACLESPATIAL
DATA "SHAPE FROM (SELECT * FROM MYTABLE WHERE NAME LIKE 'S%') USING
UNIQUE ROWNUM"
DUMP TRUE
METADATA
"wfs_title" "SimpleWFSTest"
"gml_include_items" "all"
END
NAME "myLayer"
PROJECTION
"init=epsg:4326"
END
SIZEUNITS PIXELS
STATUS DEFAULT
TOLERANCEUNITS PIXELS
TRANSPARENCY 100
TYPE POINT
UNITS DD
CLASS
METADATA
END
STYLE
ANGLE 360
COLOR 255 0 0
OUTLINECOLOR 0 255 0
SIZE 8
SYMBOL "circle"
END
END
END
Thanks,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060119/6c277082/attachment.htm>
More information about the MapServer-users
mailing list