Forum Stats

  • 3,872,143 Users
  • 2,266,396 Discussions
  • 7,911,064 Comments

Discussions

Live SQL: Return SDO_GEOMETRY as GeoJSON instead of JSON

In Oracle Live SQL:

If I run a query that returns an SDO_GEOMETRY:

select  
  SDO_LRS.CONVERT_TO_LRS_GEOM(sdo_geometry('LINESTRING(1 2,3 4)')) as shape
from
  dual

It returns plain JSON:

{
"spatialdimension" : 2,
"line" : {"datapoints" : [[1,2,0],[3,4,2.82842712474619]]}
}

That plain JSON isn't terribly useful to us. We can't convert it to a SDO_GEOMETRY.

I wonder if it would make more sense if Live SQL returned the GeoJSON instead. I imagine it would look something like this:

{
"srid" : 4327,
"spatialdimension" : 2,
"line" : {"datapoints" : [[1,2,0],[3,4,2.82]]}
}

Thoughts?

Tagged:
User_1871
1 votes

Active · Last Updated