[mapserver-users] Mapserver 6: Oracle & layerObj.queryByIndex

thomas bonfort thomas.bonfort at gmail.com
Thu Aug 2 00:16:52 PDT 2012


Hi,
Issues https://github.com/mapserver/mapserver/issues/4238 and
https://github.com/mapserver/mapserver/issues/4076 seem closely
related. I'm not a query expert, but I do know that part of the code
has been quite heavily worked on for 6.2, any chance you could try
with that version and confirm if it has been fixed or not?

regards,
thomas

On Wed, Aug 1, 2012 at 4:51 PM,  <umn-ms at hydrotec.de> wrote:
>
>
> Hi
>
> I'm porting an Java-Mapscript-application from Mapserver 5.4 to Mapserver
> 6.0.
> Data is stored in Oracle-Saptial.
>
> I have a problem with layerObj.queryByIndex.
>
> To illustrate, i use a small Java-Testprogram:
> import edu.umn.gis.mapscript.layerObj;
> import edu.umn.gis.mapscript.mapObj;
> import edu.umn.gis.mapscript.shapeObj;
>
> public class QueryExtent {
>   public static void main(String argv []) {
>     mapObj map = new mapObj("java_test\\umn.map");
>     layerObj l = map.getLayerByName("Gemeinden");  // Gemeinden is
> Oracle-Spatial-Layer
>     int i = l.queryByIndex(map, 0, 2, 0);
>     System.out.println(i);
>   }
>
> }
>
> This program prints 1 - saying, that the queryByIndex-call was not
> successfull.
> Logfile: msOracleSpatialLayerGetShape(): OracleSpatial error.
> msOracleSpatialLayerGetShape record out of range
>
> By additional debugging I saw: In msOracleSpatialLayerGetShape Mapserver
> runs into the "if (resultindex >= 0)"-branch.
> In my case resultindex is an extra-ordinary big integer-number.
>
> I don't really understand ths query-layer-code in Mapserver. But I think in
> my case resultindex should by -1 and that Mapserver
> should initialize resultindex automatically.
> Therfore I changed code:
> int msQueryByIndex(mapObj *map) {
>     ...
>   resultObj record;
>   record.resultindex = -1;  // added line.
> }
>
> Is the fix correct or should I use Mapscript differently?
>
> Benedikt
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list