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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oracle spatial to shape file

Albin Joseph PaulSep 14 2011 — edited Oct 25 2011
hi everyone

How to convert oracle spatial data to shape file

pls share your thoughts

Comments

Luc Van Linden
Hi Paul

Take a look at the opensource libraries OGR, using ogr2ogr

http://www.gdal.org/ogr2ogr.html

http://www.gdal.org/ogr/drv_oci.html

Very flexible and efficient for data format transformation and CRS trasnsformations.

Kind regards

Luc
John O'Toole
Have a look at the excellent GeoRaptor plugin for SQLDeveloper. Among many other things, this allows you to Import and Export from/to Shape files.

Download from:
http://sourceforge.net/search/?q=georaptor

See some release notes on this page:
http://sourceforge.net/apps/mediawiki/georaptor/index.php?title=Main_Page
Pat
Have a look at Spatial Workshop from Spatial Eye, the support Query/View/Print etc for various Spatial Data incl Oracle.
It is possible to export data to various formats including: Geographic and attribute export (Excel, Shape, KML, CSV).
mmillman
I have some Java code that does this. If you are a Java programmer (or know one) and are interested email me at mark.millman@mizar.com and I'll send it to you.

Mark Millman
Ivan Bush
Hi,

I always use FME http://www.safe.com/fme/fme-technology/fme-desktop to extract data from Oracle Spatial.

It is not free but is best of breed.

You can get a free 14 day trial.

Regards

Ivan
Simon Greener
All suggestions are for the running of software products external to the database.

If you want a solution that is entirely database based so that one can schedule
exports via dbms_jobs or dbms_scheduler then try my free EXPORTER package + Java code.

EXPORTER documentation: http://www.spatialdbadvisor.com/source_code/202/shapefile-exporter-package-for-oracle-10gr2
Download: http://www.spatialdbadvisor.com/source_code_form

The EXPORTER package allows you export:

1. Shapefiles (with/without a TAB file wrapper);
2. xSV files (eg csv) with sdo_geometry as WKT/GML2 (this does not "proper" produce GML/KML export files like those of GeoRaptor with attribute encoding);
3. Excel Spreadsheets (via JXL).

Download includes GEOPROCESS package and has an installer that allows you to install the Java into your database's JVM. Source code is included for those who wish to examine, fix or improve.

GEOPROCESS documentation: http://www.spatialdbadvisor.com/source_code/223/geoprocessing-package-documentation

The export and geoprocessing code is based on the Java Topology Suite and GeoTools that do not support GML3/KML. It
does not use Oracle's sdoutil.jar which does support both of these. I may add this capability if there is enough interest.

regards
Simon
ToM2
Hi
Fastest tool is GDAL/OGRlibrary , OGR2OGR subprogram. (http://www.gdal.org/ogr_utilities.html)
This tools convert many formats list (list of formats supported by Your installation ogr2ogr --formats)

1. For full export of table with sdo_geometry to ESRI Shapefile + prj file you should use:
ogr2ogr -f "ESRI Shapefile" c:/out_shapefile_name.shp OCI:db_user/db_password@tns_name:ORACLE_TABLE_NAME -progress

2. for partially export (combination of some columns/rows/partitions) you should use ogr2ogr with sql query
ogr2ogr -f "ESRI Shapefile" c:/out_shapefile_name.shp OCI:db_user/db_password@tns_name -sql "SELECT rownum AS OGR_FID, GEOMETRY_COLUMN FROM ORACLE_TABLE_NAME" -progress

first check sql query with limited rows(for ex ... where rownum < 2)in sqldeveloper or other sql tool.
second remowe rownum.... and put them into gdal command line.

Regards,
Tomek
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 22 2011
Added on Sep 14 2011
7 comments
17,248 views