intQuery = objLayer.queryByRect(objParentMap, tempRect)
' open the layer to get features If intQuery = 1 Then Dim intOpen As IntegerintOpen = objLayer.open()
Dim resultMem As resultCacheMemberObj = NothingresultMem = objLayer.getResult(intQuery)
tempShape = objLayer.getFeature(resultMem.shapeindex, resultMem.tileindex)
objLayer.close()
End If Return tempShape Catch ex As Exception Throw New Exception("failed to get Features from the Layer!" , ex) End Try End Functionthe intQuery value is 1, means that the query is successful, but the intOpen is always 0, seems that the layer can not be opened for getFeature function. The layer queried is a memory layer created with a function on the fly, I don't know if this is a problem for the getFeature function.
the scenario of this function in my application is:
a new layer is created on the fly with the data from the Oracle Spatial database when the first user request comes in, and this layer will be always the same through out a user session, so I am trying to get the shape objects from the layer and store them into a data table, so that I can create a new layer with these shape objects without connection with the oracle spatial database any more, and this may improve the mapserver performance, since I do not need to access the database anymore every time when a new map image is needed to be rendered.
and the shape object in the queried layer may be a point or a polygon.
BTW: the map extent unit of the map object is meter, but the queried layer has decimal degree (WGS84 layer) as map unit, but the values of the query rectangle is also in degree unit, I don't know if this will cause the getFeature problem. Just for info.
thanks for any clues to solve this problem.
