I am new to oracle spatial. I want to load shapefile into oracle spatial. I am using oracle 11g. I have already look at the following examples and answers
http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_shapefile_converter.htm#SPATL1430
How do use the Shapefile Converter in Oracle 12c to load a Shapefile?
Where I found the following example to load a shapefile
java -classpath %ORACLE_HOME%\jdbc\lib\ojdbc5.jar;%ORACLE_HOME%\md\jlib\sdoutl.jar;%OR ACLE_HOME%\md\jlib\sdoapi.jar oracle.spatial.util.SampleShapefileToJGeomFeature - h gis01 -p 1521 -s orcl -u scott -d tiger -t states -f states -r 8307 -g geom
I have the files on the following directory
ojdbc14.jar - D:\app\user\product11円.2.0\dbhome_1\jdbc\lib
ojdbc5.jar - D:\app\user\product11円.2.0\dbhome_1\jdbc\lib
sdoutl.jar -D:\app\user\product11円.2.0\dbhome_1\jdbc\lib
sdoapi.jar - D:\app\user\product11円.2.0\dbhome_1\jdbc\lib
Java - C:\Program Files\Java\jdk1.7.0_21\bin
shapefile (bd.shp) - E:\data\bd.shp
So I used the following codes
java -classpath D:\app\user\product11円.2.0\dbhome_1\jdbc\lib\ojdbc5.jar;D:\app\user\product11円.2.0\dbhome_1\jdbc\lib\sdoutl.jar;D:\app\user\product11円.2.0\dbhome_1\jdbc\lib\sdoapi.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p 1521 -s hr -u hr -d password -t bd -f E:\data\bd -r 8307 -g geom
Would anyone help me to run this code with those directory?
3 Answers 3
The simlest tool for loading shapefile into oracle spatial database is provided by Oracle itself as Mapbuilder. You can download it from Oracle site. You need to register (free) once with Oracle.
You need to connect to your database where you want to save the shapefile and choose the Import Shapefile as option as shown below:
Then you need to browse and select the shapefile.
Select whether you want to create a new table or update an existing one (You need to have the same attribute columns for this).
You can also choose the name of geometry column.
You will have the option to import single shapefile or multiple.
The image below describes the options available while importing the shapefile:
Set the SRID and indexing as below:
You can also choose any (optional) predefined theme (styling for your shapefile) as below:
Then click Next and Finish to complete the loading.
That's it.
-
I'm following that link, it appears to go here (oracle.com/technetwork/middleware/mapviewer/downloads/…) and what I just downloaded doesn't seem to be at all what your screenshots contain, I've got a mapbuilder that runs on localhost:8080. Is there something different to download?chrismarx– chrismarx2016年12月07日 21:42:26 +00:00Commented Dec 7, 2016 at 21:42
-
You need to download mapbuilder which is a jar file (not mapviewer which runs on web server).GeoSpatialEarth.in– GeoSpatialEarth.in2016年12月08日 02:41:25 +00:00Commented Dec 8, 2016 at 2:41
-
Ah, now I see it, sorry, I didn't realize that unlike other areas of the oracle site, there are multiple program downloads in each section. Thanks!chrismarx– chrismarx2016年12月08日 15:59:44 +00:00Commented Dec 8, 2016 at 15:59
-
You can download mapviewer also. It's a good application to display rasters, vectors and run spatial queries on web page. Tutorial is also given in the same application packageGeoSpatialEarth.in– GeoSpatialEarth.in2016年12月09日 04:33:49 +00:00Commented Dec 9, 2016 at 4:33
Rather than use the Oracle tools (which if they're anything like anything Oracle I've ever seen are a completely mess), you could try using OGR2OGR - There is a GUI app for it too - http://www.ogr2gui.ca/en/screenshot.php
Hopefully that'll do what you want and be simpler as well.
-
Thank you but Its not connecting with Oracle DatabaseDevils Dream– Devils Dream2013年12月30日 06:55:24 +00:00Commented Dec 30, 2013 at 6:55
I used the "Spatial Data Manager" , another graphical tool to load shapefiles and file geodatabases in Oracle and other spatial db.
http://www.mapet.altervista.org
-
Thanks for the answer. Can you tell me what will be the instance for oracle DB connection?Devils Dream– Devils Dream2014年01月08日 10:21:47 +00:00Commented Jan 8, 2014 at 10:21
-
instance is the alias in your tnsnanes.oraLou Lou– Lou Lou2014年01月09日 13:16:36 +00:00Commented Jan 9, 2014 at 13:16