Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert from 4D SDO_GEOMETRY (points) to 2D Geometry

2765018Sep 30 2014 — edited Oct 5 2014

Hi all,

I'm performing a migration from PostGIS to Oracle Spatial (The Oracle version is 11.2.0.04 and it has the Locator/Spatial capabilities).

I'm using mapfish framework with SqlAlchemy and the query type I need to satisfy is:

SELECT SDO_UTIL.TO_WKBGEOMETRY("WD_GROUNDSTATIONS"."POSITION") AS "WD_GROUNDSTATIONS_POSITION", "WD_GROUNDSTATIONS".name AS "WD_GROUNDSTATIONS_name", "WD_GROUNDSTATIONS".position AS "WD_GROUNDSTATIONS_position"

FROM "WD_GROUNDSTATIONS"

I'm getting:

ORA-13199: 4D geometries are not supported by geometry WKB/WKT generation. ORA-06512: at "MDSYS.MD", line 1723 ORA-06512: at "MDSYS.MDERR", line 17 ORA-06512: at "MDSYS.SDO_UTIL", line 2442 None None

The issue is that I can't change the default dimensions of the database tables since its being used by other systems (other company). So, I have to find a way to convert between 4D to 2D.

To do this, I'm creating a view to support this transformation:

CREATE OR REPLACE FORCE VIEW "SYSTEM"."WD_GROUNDSTATIONS" ("NAME", "POSITION") AS

  SELECT NAME, POSITION

  FROM GROUNDSTATION;

So, I have to replace the POSITION with some operations on top of it that transform POSITION into POSITION2D. I've tried using the SDO_CS operations mentioned in this thread with no luck (getting null geometries).

I'm guessing that extracting the X and Y values and then creating a new 2D SDO_GEOMETRY could be the way ? Is there any 'cleaner' way to do this ?

Thanks in advance.

Hugo

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2014
Added on Sep 30 2014
2 comments
2,124 views