How to get Geometry object by selecting shape column from oracle?
See original GitHub issueI am trying to get Geometry object directly from sql.
I use this sql:
select shape from table;
Then try to get Geometry object by these codes:
//ResultSet rs, String columnName
byte[] bytes = rs.getBytes(columnName);
ByteBuffer buffer = ByteBuffer.wrap(bytes);
OperatorImportFromESRIShape op = (OperatorImportFromESRIShape) OperatorFactoryLocal.getInstance().getOperator(Operator.Type.ImportFromESRIShape);
Geometry g = op.execute(0, Geometry.Type.Unknown, buffer);
But result is null. Please show me a way how to get Geometry object directly from sql.
Thanks Gavin Men
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to view coordinates instead of geometry object in ...
I find useful viewing geometry as WKT, which contains all coodinates - use this SQL: select sdo_util.to_wktgeometry(shape) shape_wkt, shape, ...
Read more >4 Querying Spatial Data
The following example finds the two objects from the SHAPE column in the COLA_MARKETS table that are closest to a specified point (10,7)....
Read more >How I can get TYPE of GEOMETRY? - Oracle Communities
I think you want the GET_GTYPE method, which is equivalent to getting the sdo_gtype mod 100. 1* SELECT c.mkt_id, c.shape.
Read more >2 Spatial Data Types and Metadata - Oracle Help Center
A geometry is stored as an object, in a single row, in a column of type SDO_GEOMETRY. Spatial index creation and maintenance is...
Read more >2.2 SDO_GEOMETRY Object Type
Oracle Spatial and Graph defines the object type SDO_GEOMETRY as: ... All geometries in a geometry column must have the same SDO_SRID value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@FalconIA ST_AsBinary returns wkb. Try OperatorImportFromWkb.
@stolstov Ok, i got it. ArcSDE does not store geometries ESRI Shape format, just the column called SHAPE. I will use OperatorImportFromWkb instead.
Thanks