ArcSDE query attribute
Hallgren Johan E
jhhal at WMDATA.COM
Fri Feb 24 13:23:38 EST 2006
Hello again Steve
I have found one difficulties with the source code. I started to compare
the 4.6.0 with 4.8.1 and in the mapsde.c where the error arises (row
1600 in the 4.8.1).
In the 4.8.1 it lookes like:
layer->iteminfo = (SE_COLUMN_DEF *) calloc( layer->numitems,
sizeof(SE_COLUMN_DEF));
if(!layer->iteminfo) {
msSetError( MS_MEMERR,
"Error allocating SDE item information.",
"msSDELayerInitItemInfo()");
return(MS_FAILURE);
}
In the 4.6.0 it lookes like:
if(!layer->iteminfo) {
msSetError( MS_MEMERR,
"Error allocating SDE item information.",
"msSDELayerInitItemInfo()");
return(MS_FAILURE);
}
If I added the line:
layer->iteminfo = (SE_COLUMN_DEF *) calloc( layer->numitems,
sizeof(SE_COLUMN_DEF));
The error doesn't appear.
I don't if my change was correct but it solves my problem for the
moment.
What do you say, could it be the problem?
/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
http://www.wmdata.se
-----Original Message-----
From: UMN MapServer Developers List [mailto:MAPSERVER-DEV at LISTS.UMN.EDU]
On Behalf Of Steve Lime
Sent: den 21 februari 2006 21:38
To: MAPSERVER-DEV at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-DEV] ArcSDE query attribute
I think there is a general SDE/Query problem. Folks using WFS have
experienced a similiar issue.
Will try to debug ASAP...
Steve
>>> Hallgren Johan E <jhhal at WMDATA.COM> 02/21/06 8:30 AM >>>
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>
More information about the mapserver-dev
mailing list