Opened 19 years ago

Closed 16 years ago

#657 closed defect (worksforme)

query on oraclespatial using OGR/OCI

Reported by: bluecarto@… Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: oracle oci
Cc:

Description (last modified by warmerdam)

I'm working with mapserver, and I need to get query results on oraclespatial layers.
Using OGR connectiontype, and the oraclespatial tablename for Data, I'm not able
to get good results to a query.
The data returned doesn't correspond to what is expected. And no shape is
highlighted.

Following are some sql statements and a mapfile to reproduce the bug.

---------Mapserver version ---------
MapServer version 4.2.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=POSTGIS
INPUT=ORACLESPATIAL INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

---------SQL statement--------------
DROP table mytable;

CREATE TABLE MYTABLE (
  GID VARCHAR(20),
  geometry MDSYS.SDO_GEOMETRY);

insert into MYTABLE (GID,GEOMETRY) values (
  '1',
  mdsys.sdo_geometry(
    '2003',
    null,
    null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array(1,1, 1,4, 4,4, 4,1, 1,1))
);

insert into MYTABLE (GID,GEOMETRY) values (
  '2',
  mdsys.sdo_geometry(
    '2003',
    null,
    null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array(6,1, 6,4, 9,4, 9,1, 6,1))
);

insert into MYTABLE (GID,GEOMETRY) values (
  '3',
  mdsys.sdo_geometry(
    '2003',
    null,
    null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array(1,6, 1,9, 9,9, 9,6, 1,6))
);

delete from user_sdo_geom_metadata where table_name like 'MYTABLE';

insert into user_sdo_geom_metadata (table_name,column_name,diminfo,srid)
values ('MYTABLE','GEOMETRY',
mdsys.SDO_DIM_ARRAY(mdsys.SDO_DIM_ELEMENT('X', 0, 10, 0.1),
mdsys.SDO_DIM_ELEMENT('Y', 0, 10, 0.1)),
NULL);

drop index q_mytable;

create index Q_MYTABLE on MYTABLE(GEOMETRY) indextype is MDSYS.spatial_index;


---------mapfile---------------
NAME DEMO
STATUS ON
SIZE 500 300
EXTENT 0 0 10 10
IMAGECOLOR 255 255 255

WEB
  IMAGEPATH "/var/www/cartoserver_DGI_flash/www-data/images/"
  IMAGEURL "cartogfx/"
END

LAYER
  NAME squares
  TYPE POLYGON
  STATUS ON
#  CONNECTIONTYPE oraclespatial
#  CONNECTION "pierre/xbe9a51h@192.168.226.149:1521/orcl"
  CONNECTION "OCI:pierre/xbe9a51h@192.168.226.149:1521/orcl"
  CONNECTIONTYPE OGR
#  DATA "select * from mytable"
  DATA "mytable"
  TEMPLATE "ttt"
  CLASS
   SIZE 10
   COLOR 255 255 255
   OUTLINECOLOR 200 200 200
  END
END

END

Change History (5)

comment:1 by warmerdam, 19 years ago

Pierre, 

I have now reproduced your setup with the data loaded into Oracle, and I 
ran the mapfile in question through shp2img.  The result seems to render OK.
Can you give me more details on how to reproduce the query aspect?

Note, I am testing with mapserver from CVS.  It would be helpful if you were
able to verify that your problem.

comment:2 by warmerdam, 19 years ago

.. that your problem also happens with the CVS version of mapserver or at
least the 4.4-beta2.

comment:3 by mloskot, 16 years ago

Keywords: oracle oci added

comment:4 by mloskot, 16 years ago

Frank,

Should I append this ticket to my Oracle queue and reassign to myself?

comment:5 by warmerdam, 16 years ago

Description: modified (diff)
Priority: highnormal
Resolution: worksforme
Status: assignedclosed

Closing for lack of followup by the reporter.

Note: See TracTickets for help on using tickets.