Forum Stats

  • 3,757,145 Users
  • 2,251,201 Discussions
  • 7,869,743 Comments

Discussions

GEO_JSON dedicated SRID

chris227
chris227 Member Posts: 3,516 Bronze Crown

Hi,

i extract some geometry from a geojson file the way shown below

select geo
from GEO_JSON
, json_table (geo_doc, '$.features[*]'
columns (
  geo sdo_geometry path '$.geometry'
))

That works and the resulting geometry is in default SRID 4327 (since it's 3D)

MDSYS.SDO_GEOMETRY(3003,4327,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003 ...

But in fact the true SRID is 4647 (ETRS89 / UTM zone N32)

So there is this zone prefix messing around.

There is some hint to it in the geojson file

 "crs" : {
   "type" : "name",
   "properties" : {
     "name" : "EPSG:4647"
   }
 },

But that seems to be ignored.

I tried to change it to  "name" : "ETRS89 / UTM zone N32" etc. but was unsuccesful.

Perhaps i didn't find the correct one.

However i figured out some workaround that seems to work

select
sdo_cs.transform(
sdo_cs.make_2d(geo, 4647)
 , 25832 ) gg
from GEO_JSON
, json_table (geo_doc, '$.features[*]'
columns (
   geo sdo_geometry path '$.geometry'
))

Since the third dimension is not used (0 always) and i need a 2D geometry anyway, sdo_cs.make_2d give the possibility to transform from srid 4327 to the "true" 4647, with the zone prefix cut off. That makes it possible to transform to the desired srid 25832 finally.

I also played around with something like

select SDO_UTIL.FROM_GEOJSON(geometry => geoc, srid => '4647') gc
from GEO_JSON
, json_table (geo_doc, '$.features[*]'
columns (
 geoc clob path '$.geometry'
))

But this was only resulting in

ORA-06553: PLS-307: too many declarations of 'FROM_GEOJSON' match this call

Any hints on what might be the way to go in the scenario?

Is there a "no-tricky" way to adress the srid in the json context?

Thanks + Regards

Chris

Answers