ArcSDE query attribute
Hallgren Johan E
jhhal at WMDATA.COM
Tue Feb 21 09:30:37 EST 2006
Hello
I have tried to query a sde-layer but it fails.
I'm using mapserver-4.8.1
And ArcSDE 9.0 clientlib (windows XP)
And ArcSDE 9.0 on a Oracle 10.1 (windows Server)
All code is written in c#/mapscript/SWIG.
Drawing the layer is no problem but when querying, it gives an error
message:
"Error allocating layer items array."
The error occur when I run the oLayerObj.open() -command
Se the code below, I have used the same approach as with shapefiles.
mapObj mo = new mapObj(mapFile.Text);
layerObj oLayerObj = mo.getLayerByName("SJ_large_sde");
oLayerObj.queryByRect(mo, oLayerObj.getExtent());
oLayerObj.queryByAttributes(mo, "KKOD", "", mapscript.MS_MULTIPLE);
resultCacheObj oResultCacheObj = oLayerObj.getResults();
oLayerObj.open(); // <-- Gives the error.
textBox1.Text = oResultCacheObj.numresults.ToString();
if (oResultCacheObj.numresults > 0)
{
int iFeatureLimit = oResultCacheObj.numresults;
int lFeat = 0;
for (lFeat = 0; lFeat < oResultCacheObj.numresults; lFeat++)
{
if (lFeat == (iFeatureLimit + 0))
break;
shapeObj oShapeObj =
oLayerObj.getFeature(lFeat,-1);
}
}
Best Regards
Johan
___________________________________
Johan Hallgren
WM-data
Pelle Bergs backe 3
Box 1938, 791 19 Falun
Tel: 023-844 65 (int: +46-2384465)
Mobil: 070-588 44 28 (int: +46-705884428)
johan.e.hallgren at wmdata.com
<BLOCKED::mailto:johan.e.hallgren at wmdata.com>
http://www.wmdata.se <BLOCKED::http://www.wmdata.se>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20060221/d507f2aa/attachment.html
More information about the mapserver-dev
mailing list