ora2pgpro fully exports spatial objects from Oracle databases. There are some configuration directives that could be used to control the export.
AUTODETECT_SPATIAL_TYPEBy default, ora2pgpro is looking at indexes to see the spatial constraint type and dimensions defined under Oracle. Those constraints are passed at index creation using for example:
CREATE INDEX ... INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS('sdo_indx_dims=2, layer_gtype=point');If those Oracle constraints parameters are not set, the default is to export those columns as generic type GEOMETRY to be able to receive any spatial type.
The
AUTODETECT_SPATIAL_TYPEdirective allows to force ora2pgpro to autodetect the real spatial type and dimensions used in a spatial column otherwise a non-constrained geometry type is used. Enabling this feature will force ora2pgpro to scan a sample of 50000 column to look at the GTYPE used. You can increase or reduce the sample size by setting the value ofAUTODETECT_SPATIAL_TYPEto the desired number of line to scan. The directive is enabled by default.For example, in the case of a column named
shapeand defined with Oracle type SDO_GEOMETRY, withAUTODETECT_SPATIAL_TYPEdisabled, it will be converted as:shape geometry(GEOMETRY) or shape geometry(GEOMETRYZ, 4326)
If the directive is enabled and the column just contains a single geometry type that uses a single dimension with a two or three dimensional polygon:
shape geometry(POLYGON, 4326) or shape geometry(POLYGONZ, 4326)
CONVERT_SRIDThis directive allows you to control the automatic conversion of Oracle SRID to standard EPSG. If enabled, ora2pgpro will use the Oracle function
sdo_cs.map_oracle_srid_to_epsg()to convert all SRIDs. Enabled by default.If the
SDO_SRIDreturned by Oracle is NULL, it will be replaced by the default value 8307 converted to its EPSG value: 4326 (seeDEFAULT_SRID).If the value is more than 1, all SRIDs will be forced to this value, in this case
DEFAULT_SRIDwill not be used when Oracle returns a null value and the value will be forced toCONVERT_SRID.Note that it is also possible to set the
EPSGvalue on Oracle side whensdo_cs.map_oracle_srid_to_epsg()returns NULL if your want to force the value:system@db> UPDATE sdo_coord_ref_sys SET legacy_code=41014 WHERE srid = 27572;
DEFAULT_SRIDUse this directive to override the default EPSG SRID to be used: 4326. Can be overwritten by
CONVERT_SRID, see above.GEOMETRY_EXTRACT_TYPEThis directive can take three values:
WKT(default),WKB, andINTERNAL. When it is set toWKT, ora2pgpro will useSDO_UTIL.TO_WKTGEOMETRY()to extract the geometry data. When it is set toWKB, ora2pgpro will use the binary output usingSDO_UTIL.TO_WKBGEOMETRY(). If those two extract types are calls at Oracle side, they are slow and you can easily reach Out Of Memory when you have a lot of rows. AlsoWKBis not able to export 3D geometry and some geometries likeCURVEPOLYGON. In this case you may use theINTERNALextraction type. It will use a Pure Perl library to convert theSDO_GEOMETRYdata into aWKTrepresentation, the translation is done on ora2pgpro side. This is a work in progress, validate your exported data geometries before use. Default spatial object extraction type isINTERNAL.POSTGIS_SCHEMAUse this directive to add a specific schema to the search path to look for PostGIS functions.
ST_SRID_FUNCTIONOracle function to use to extract the SRID from
ST_Geometrymeta information. Default:ST_SRID, for example, it should be set tosde.st_sridfor ArcSDE.ST_DIMENSION_FUNCTIONOracle function to use to extract the dimension from
ST_Geometrymeta information. Default:ST_DIMENSION, for example it should be set tosde.st_dimentionfor ArcSDE.ST_GEOMETRYTYPE_FUNCTIONOracle function to use to extract the geometry type from a
ST_Geometrycolumn. Default:ST_GEOMETRYTYPE, for example it should be set tosde.st_geometrytypefor ArcSDE.ST_ASBINARY_FUNCTIONOracle function to be used to convert an
ST_Geometryvalue intoWKBformat. Default:ST_ASBINARY, for example it should be set tosde.st_asbinaryfor ArcSDE.ST_ASTEXT_FUNCTIONOracle function to be used to convert an
ST_Geometryvalue intoWKTformat. Default:ST_ASTEXT, for example it should be set tosde.st_astextfor ArcSDE.