Insert ST_Geom Using Query Oracle (GIS)

359 Views Asked by At

I have a question.

I want to run an insert of geometry using the ST(Geometry) data type using a query (Oracle database).

I tried using the following query:

INSERT INTO <TABLE> (OBJECTID, "NO", NAMA_OBJEK, JENIS_OBJE, ALAMAT, SHAPE)
VALUES (
0,
0,
'example',
'example',
'example',
SDE.ST_GEOMETRY('POINT(106.89162, -6.15505)', 4328));

I encountered an error in the query with the error message: SQL Error [28595] [99999]: ORA-28595: Extproc agent: Invalid DLL Path ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12.

Query

Why am I unable to run the insert, while when I run the query with the ST_Geometry function:

SELECT SDE.ST_length(shape) AS area
FROM Table
WHERE SDE.ST_length(shape) > 1000;

there is no error occurring. Is there a mistake in my query causing the error, or is there something else?

2

There are 2 best solutions below

0
kpatenge On

Instead of SDE.ST_GEOMETRY you can simply insert a geometry using:

INSERT INTO <table_name> (OBJECTID, SHAPE)
VALUES (
0,
SDO_GEOMETRY('POINT(106.89162 -6.15505)', 4328));

The native spatial data type SDO_GEOMETRY perfectly works with your ESRI toolset.

Your query:

SELECT SDE.ST_length(shape) AS area
FROM Table
WHERE SDE.ST_length(shape) > 1000;

does not make sense for point data. Nevertheless, the syntax for area and length calculation using SDO_GEOMETRY you can find here.

0
kpatenge On

One more note: https://epsg.io/4328 is flagged as "Deprecated".