Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SDO_CS.TRANSFORM and to_geojson producing invalid json numbers

AndyHDec 16 2019 — edited Jan 29 2020

I have a Oracle spatial geometry stored using SRID OSGB (EPSG:27700) in my Oracle 12.2 database.

I want to output geoJSON and am using json_arrayagg, json_object, etc. plus an sdo_cs.transform to convert the geometry to LatLong and then outputting using sdo_util.to_geojson, something like:

sdo_util.to_geojson(sdo_cs.transform (mytable.mypolygon, 4326)) as format json

The results *look* good, but the json numbers do not include a leading zero integer when less than 0 e.g. I get .12345 instead of 0.12345. This then fails an external routine that interprets the json.

Is there a way of forcing out the "0" in order to produce valid json numbers from to_geojson (or otherwise)?

--

Andy

This post has been answered by Paul Dziemiela on Dec 17 2019
Jump to Answer
Comments
Post Details
Added on Dec 16 2019
10 comments
1,049 views