Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.M1
-
Fix Version/s: 2.3.3
-
Component/s: jdbc-oracle plugin
-
Labels:None
Description
The Oracle ALL_SDO_GEOM_METADATA contains metadata about all
the Geometry columns in all tables, but it doesn't store a specific Geometry type,
so there's no way to tell up-front the type of a given column.
Each column can contain a mix of different Geometries (Points, Polygons, etc.).
The OracleDataStore may try to determine to exact Geometry type by looking
at the Geometry stored in the first record.
This has two drawbacks, the first is about speed, the second is that a table
may be empty.
Or we can add a metadata table of our own to store such an information,
or maybe there're other ways that I don't know of...
Bye
Paolo Rizzi
we could add a method getType that essentially uses an SDO SQLQuery
- making use of the meta attribute on Geometry column SDO_GTYPE
an example would be like this:
SELECT a.shape.sdo_gtype FROM ora_test_lines a;
it returns
2002 = 2D Line
the first number indicates that this a 2 dimensional geometry
if it was a 3D Geometry it would be 3002
Here is a list of the constants that sdo_gtype references:
000 UNKNOWN_GEOMETRY
001 POINT
002 LINE or CURVE
003 POLYGON
004 COLLECTION
005 MULTIPOINT
006 MULTILINE or MULTICURVE
007 MULTIPOLYGON
Here is more reference:
http://download-uk.oracle.com/docs/html/B14255_01/sdo_objrelschema.htm#sthref208
OR we could consider using the SDOAPI, which has a method getType()
http://itis-demo.com/spatial/ade/sdointg_d12-s10r1/oracle/sdo/doc/javadoc/oracle/spatial/geometry/JGeometry.html#getType()
We need to consider switching over to SDOAPI
Marc