OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.86k stars 2.53k forks source link

ogr2ogr convert shape file to oracle spatial database #7551

Closed amwps290 closed 1 year ago

amwps290 commented 1 year ago

when i use ogr2ogr convert shape file to oracle database ,the SRID OF USER_SDO_GEOM_METADATA is not correct.

the sql is :

INSERT INTO USER_SDO_GEOM_METADATA VALUES ('BJROAD', 'ORA_GEOMETRY', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',12843486.24727394,13080040.17120964,0.001),MDSYS.SDO_DIM_ELEMENT('Y',4781532.934468937,5024640.603382006,0.001)), 1000026974)

the SRID shoule be EPSG:3857,not 1000026974.

then i use the -a_srs EPSG:3857 it not worked.

jratike80 commented 1 year ago

If I remember right the standard -a_srs does not work with Oracle but fortunately the driver has a specific SRID creation option https://gdal.org/drivers/vector/oci.html.

SRID: By default this driver will attempt to find an existing row in the MDSYS.CS_SRS table with a well known text coordinate system exactly matching the one for this dataset. If one is not found, a new row will be added to this table. The SRID creation option allows the user to force use of an existing Oracle SRID item even it if does not exactly match the WKT the driver expects.