Shape file 导入到Oracle Spatial 数据库

论坛 期权论坛     
选择匿名的用户   2021-5-22 16:40   35   0
<p><span style="font-size:14px">最近项目涉及该内容,但是网上搜索的很多oracle的相关链接都是以前的url,现在无法访问。</span></p>
<p><span style="font-size:14px">虽然shp2sdo.exe在CSDN上也有下载,但总归是需要积分的,另外,在找资源时,又发现了以下相关内容,也在此汇总,以便有需要或有兴趣的看官一用。</span></p>
<p><span style="font-size:14px"><br> </span></p>
<p><span style="font-size:14px">ps1:  JAVA SHAPEFILE CONVERTER,也是用于将esri的shp文件转换为oracle的数据库表的工具,原文介绍如下:</span></p>
<p></p>
<pre class="blockcode"><code class="language-plain">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.</code></pre>
<a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/jsfconvert-readme-129638.pdf" rel="noopener noreferrer" target="_blank"><span style="font-size:14px">文档传送门&gt;&gt;</span></a>
<br>
<span style="font-size:14px">文中涉及的;%ORACLE_HOME%\md\jlib\sdoutl.jar;%ORACLE_HOME%\md\jlib\sdoapi.jar  是安装什么版本的oracle附带的lib,烦请有知道的看官留言,在此不胜感激!</span>
<p></p>
<p><span style="font-size:14px">ps2:Oracle Spatial 空间信息管理  这本书貌似讲的很详细,CSDN有下载,上下两部分需要10分,但也有部分章节试读的;</span></p>
<p><span style="font-size:14px"><a href="http://www1.huachu.com.cn/read/readbook.asp?bookid&#61;10109911" rel="noopener noreferrer" target="_blank">试读传送门&gt;&gt;</a></span></p>
<p><span style="font-size:14px"><br> </span></p>
<p><span style="font-size:14px">回归正题,shp2sdo.exe 目前下载方法如下:</span></p>
<p><span style="font-size:14px">1、进入Oracle的搜索页面:https://search.oracle.com/search/</span></p>
<p><span style="font-size:14px">2、搜索<span style="font-size:14px">shp2sdo,下面列出结果:</span></span></p>
<p><span style="font-size:14px"><span style="font-size:14px"><img alt="" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-cb75082150681dddd3d8bf17c0fe16a1"><br> </span></span></p>
<p><span style="font-size:14px">第一个using-shp2sdo是<a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/using-shp2sdo-134890.txt" rel="noopener noreferrer" target="_blank">使用说明</a>,内容如下:</span></p>
<p><span style="font-size:14px"></span></p>
<pre class="blockcode"><code class="language-plain">Example usage of the shape to sdo converter for Oracle9i Spatial and higher versions -

on Windows NT:

shp2sdo.exe states states -g geom -d -x (-180,180) -y (-90,90) -s 8307 -t 0.5 -v

on Sun Sparc Solaris or Linux:

shp2sdo.exe states states -g geom -d -x \(-180,180\) -y \(-90,90\) -s 8307 -t 0.5 -v

In the previous command:

states - the shapefile to convert (expects .dbf, .shp, and .shx files)

states - the name of the table to create and use in Oracle

-g  geom - geom is the name of the column to load for the geometry object

-d     - put the data in the control file generated by the tool

-x     - the bounds of the first dimension in the coordinate system

-y     - the bounds of the second dimension in the coordinate system

-s     - the SRID (spatial reference system ID)

-t     - the tolerance

-v     - verbose output


If the target database is Oracle8i, then use the -8 option on the
command line.


Type shp2sdo.exe -h for help:

shp2sdo.exe -h

shp2sdo - Shapefile(r) To Oracle Spatial Converter
Version 2.14 09-Jan-2004
Copyright 1997,2004 Oracle Corporation
For use with Oracle Spatial.

USAGE: shp2sdo [-o] &lt;shapefile&gt; &lt;tablename&gt; -g &lt;geometry column&gt;
               -i &lt;id column&gt; -n &lt;start_id&gt; -p -d
               -x (xmin,xmax) -y (ymin,ymax) -s &lt;srid&gt;
  or
       shp2sdo -r &lt;shapefile&gt; &lt;outlayer&gt; -c &lt;ordcount&gt; -n &lt;start_gid&gt; -a -d
               -x (xmin,xmax) -y (ymin,ymax)
    shapefile           - name of input shape file
                          (Do not include suffix .shp .dbf or .shx)
    tablename           - spatial table name
                          if not specified: same as input file name
  Generic options:
    -o                  - Convert to object/relational format (default)
    -r                  - Convert to the relational format
    -d                  - store data in the control file
                          if not specified: keep data in separate files
    -x                  - bounds for the X dimension
    -y                  - bounds for the Y dimension
    -v                  - verbose output
    -h or -?            - print this me
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP