Documentos de Académico
Documentos de Profesional
Documentos de Cultura
DESCRIPTION
The Java Shapefile Converter transforms an ESRI Shapefile into an Oracle database table
for use with Oracle Spatial and Locator. The Shapefile Converter uses the Oracle Spatial
Java-based Shapefile Adapter and SampleShapefileToJGeomFeature classes to load a
Shapefile directly into a database table, with the Oracle-equivalent .dbf data types for the
attribute columns and the SDO_GEOMETRY data type for the geometry column. The
Shapefile Adapter can also be used to create your own applications and interfaces that
transform Shapefiles to SDO_GEOMETRY or JGeometry data types (see the Oracle
Spatial Java API for more information). To simply load a Shapefile into the database, use
the SampleShapefileToJGeomFeature class as illustrated below.
NOTES
The requirements for using the Shapefile Converter or Shapefile Adapter are:
• An Oracle10g or later database with Locator or Oracle Spatial
• A user/password account for the database
• The Oracle utilities and JDBC libraries (JARs):ojdbc14.jar or ojdbc5.jar, sdoutl.jar,
and sdoapi.jar
• Sun JDK version 1.4.2_04 or higher: JDK 1.5 is required for Oracle 11g
• ESRI Shapefile(s) (.shp, .shx, and .dbf files) to be converted
USAGE
> java -cp [ORACLE_HOME]/jdbc/lib/ojdbc5.jar:./sdoutl.jar:./sdoapi.jar
oracle.spatial.util.SampleShapefileToJGeomFeature -h db_host -p db_port -s db_sid -u
db_username -d db_password -t db_table -f shapefile_name [-i table_id_column_name][-
r srid][-g db_geometry_column][-x max_x,min_x][-y max_y,min_y][-o tolerance]
Linux Example:
> setenv clpath
$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/md/jlib/sdoutl.jar:$ORACLE
_HOME/md/jlib/sdoapi.jar
> java -cp $clpath oracle.spatial.util.SampleShapefileToJGeomFeature -h gis01 -p 1521 -
s orcl -u scott -d tiger -t states -f states -r 8307 -g geom
Windows Example:
> 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