mapserv segfaults trying to get thequery results of a native oracle spati

Fernando Simon fsimon at UNIVALI.BR
Mon May 2 10:35:35 EDT 2005


Hi Nicol,
    You can change the data parameter for any sql that return a geometry
type.  In your case you can add "WHERE" inside the data stmt, like:
DATA "GEOMETRIE from (SELECT ID, INFOTEXT, BESCHRIFT, GEOMETRIE FROM
FLURST WHERE ID > 0) USING UNIQUE ID SRID 82027"
    Here I don't use the "select *", but you can use without problem.
    About the example, you can define your sql with where's, join's,
functions and spatial functions between the "(" and ")". The
maporaclespatial.c don't change this sql, it's mount the internal sql
using your sql as base.
    Just as hint, the column that you define as UNIQUE, ID in your case,
must be a numeric type. Only numbers, and it's need to be unique
identifiers for your table. More one hint, you can start your counter
"j" with 1 and test the if occur the same problem.
    Thanks.

------------------------------------------------------------------------
Fernando Simon
Mapserver and Oracle Spatial developer
G10 - Laboratorio de Computacao Aplicada - Brazil
http://g10.cttmar.univali.br - UNIVALI/CTTMAR
------------------------------------------------------------------------


Nicol Hermann wrote:

>Hi Fernando,
>
>thank you for your answer!
>I found a problem in my code.
>I opened the layer before i send the query. I changed this to:
>
>$status = $Layer -> queryByPoint($geometrie, MS_MULTIPLE, 100);
>$Layer->open();
>for($j = 0;$j < $Layer->getNumResults(); $j++) {
>   $oRes = $Layer->getResult($j);
>   $shpobj = $Layer->getShape($oRes->tileindex,$oRes->shapeindex);
>   $shpobj->free();
>}
>$Layer->close();
>
>Now i get a mapserver error message:
>
>Fatal error: [MapServer Error]: msOracleSpatialLayerGetShape(): Error:
>ORA-01722: Ungultige Zahl . Query statement: SELECT ID, INFOTEXT,
>BESCHRIFT, GEOMETRIE FROM (SELECT * FROM FLURST) WHERE ID = 0 .Check
>your data statement.
>
>Here is my data statement:
>DATA "GEOMETRIE from (SELECT * FROM FLURST) USING UNIQUE ID SRID 82027"
>
>The value of the variable '$oRes' are:
>
>stdClass Object
>(
>    [shapeindex] => 0
>    [tileindex] => -1
>    [classindex] => 0
>)
>
>How do i have to change the data statement to get a valid shapeindex?
>
>I'am not sure that the solution found for bug #1244 solves my problem
>with the "--enable-point-z" flag. I use the latest cvs version which
>should contain the fix, right?
>
>Many thanks for your help
>Nicol
>
>
>
>



More information about the mapserver-users mailing list