Opened 14 years ago

Closed 14 years ago

#3462 closed defect (fixed)

MapScript resultsGetShape() method fails with a OracleSpatial layer

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: MapScript Version: svn-trunk (development)
Severity: normal Keywords:
Cc: jimk

Description

With this php script:

$map = ms_newMapObj("gmap75.map");
$l = $map->getLayerByName("popplace");
$l->queryByRect($map->extent);
$l->open();
$s = $l->resultsGetShape(0);

I'm getting this error:

[Fri May 28 09:06:12 2010].978444 msOracleSpatialLayerResultGetShape was called. Using the record = -1 of 143. (shape: 0 should equal pkey: 0)

I've also tested the similar script with Python.

Change History (2)

comment:1 by aboudreault, 14 years ago

Milestone: 6.0 release
Version: unspecifiedsvn-trunk (development)

The problem was in the oraclespatial driver code. The virtual method msOracleSpatialLayerResultGetShapeVT, which is called by msLayerResultsGetShape calls the following function:

msOracleSpatialLayerResultGetShape(layer, shape, tile, record);

but here's the definition of this function:

int msOracleSpatialLayerResultGetShape( layerObj *layer, shapeObj *shape, int record, long pkey )

So the record and tile parameters and not correctly used in that function. Since the pkey is not used at all I modified the function definition to work as it should:

int msOracleSpatialLayerResultGetShape( layerObj *layer, shapeObj *shape, int pkey, long record )

Committed in r10190. jimk, could you review and close this ticket to be sure it's ok when you get a chance?

comment:2 by aboudreault, 14 years ago

Resolution: fixed
Status: newclosed

Closing this ticket.

Note: See TracTickets for help on using tickets.