I have an Oracle database table where the geometry column contains 3D points, for example:
{3001,8311,{137.15,-15.55,-24},null,null}
{3001,8311,{130.935,-12.166,-9},null,null}
{3001,8311,{142.5846667,-9.498833333,null},null,null}
{3001,8311,{143.7314333,-9.13515,-33},null,null}
I have created a layer from this table in GeoServer, however when I try to preview the layer it doesn't work and throws these errors:
[72000][13364] ORA-13364: layer dimensionality does not match geometry dimensions
Looking in the GeoServer logs it seems that the way it filters for the BBOX in the SQL is to use the SDO_RELATE() operator with my geometry column and an SDO_GEOMETRY of the BBOX as a 2D polygon.
This causes the geometry dimension mismatch between my 3D points and the 2D BBOX.
Is there something that I'm missing in order to make this work, or does GeoServer not support using 3D points with Oracle?
2 Answers 2
It would seem it's the latter. If you can develop in Java, here is the class that you'll likely want to modify. As an alternative, you can reach out to companies that will do the work on your behalf.
-
or of course switch to a better (supported) database like PostGISIan Turton– Ian Turton2022年01月27日 08:44:05 +00:00Commented Jan 27, 2022 at 8:44
-
@IanTurton frustratingly enough, I've been tasked with moving this database from Postgres to Oracle, because... reasons :( - It used to work fine.rooby– rooby2022年01月27日 22:06:24 +00:00Commented Jan 27, 2022 at 22:06
I was actually able to get this to work with the Oracle database.
I had some issues with my spatial index, but once my table was correctly in MDSYS.USER_SDO_GEOM_METADATA
and had a valid MDSYS.SPATIAL_INDEX_V2
index with sdo_indx_dims=2
it worked.
These are the supported dimensions for queries:
Base Table (geometry1) Dimensionality |
Spatial Index Dimensionality |
Query Window (geometry2) Dimensionality |
Query Result |
---|---|---|---|
2-dimensional | 2-dimensional | 2-dimensional | Performs a two-dimensional query. |
2-dimensional | 2-dimensional | 3-dimensional | Supported if the query window has an appropriate SDO_GTYPE value less than 3008. |
2-dimensional | 3-dimensional | 2-dimensional | Not supported: 3D index not permitted on 2D data. |
2-dimensional | 3-dimensional | 3-dimensional | Not supported: 3D index not permitted on 2D data. |
3-dimensional | 2-dimensional | 2-dimensional | Ignores the third (Z) dimension in each base geometry and performs a two-dimensional query. |
3-dimensional | 2-dimensional | 3-dimensional | Supported if the query window has an appropriate SDO_GTYPE value less than 3008. |
3-dimensional | 3-dimensional | 2-dimensional | Converts the 2D query window to a 3D window with zero Z values and performs a three-dimensional query. |
3-dimensional | 3-dimensional | 3-dimensional | Performs a three-dimensional query. |
That table and more info can be found in the Oracle docs under Indexing and Querying Spatial Data