打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
图解将shape file导入MySQL数据库中

首先下载《将shp文件导入到mysql的命令。rar》并解压。将文件名改为字符的吧,省去不必要的麻烦。(如果不能下载,email至shchen.lmars@live.cn, 标题:《求<将shp文件导入到mysql的命令。rar>》)

第二部:准备文件。

一个shp文件有多个文件组成, .dbf, .sbn, .sbx, .shp, .shx.

将shp以及shp的相关文件和DOShere文件放在同一目录下。

第三:执行生成sql的命令。

shp2MySQL shp文件名.shp 表名 数据库名 > 生成的sql文件名.sql

 

进入该文件目录, 

 

第四:修改生成的sql文件:

修改table表的字段名;

  1. ALTER TABLE 表名 ADD the_geom GEOMETRY; 

add必须为:the_geom GEOMETRY。我的情况是,生成的sql中,有

ALTER TABLE 表名 ADD ogc_geom GEOMETRY;

只需要修改字段名为 the_geom。

替换所有的,-1) );为) );  就是说去掉“,-1”。

第五:到MySQL数据库导入sql文件即可

 

我碰到的新问题:

Cygwin1.dll的处置。

在DOshere命令窗口中执行命令时,弹出错误信息:

 

计算机中丢失cygwin1l.dll。尝试重新安装该程序以解决此问题

 

解决之道,下载cygwin1l.dll (http://www.dll-files.com/dllindex/dll-files.shtml?cygwin1)

并解压到相应的目录。

Open the zip-file you downloaded from DLL-files.com.

Extract cygwin1.dll to a location on your computer. We recommend you to unzip it to the directory of the program that is requesting cygwin1.dll.

If that doesn't work, you will have to extract cygwin1.dll to your system directory. By default, this is:

  • C:\Windows\System (Windows 95/98/Me)
  • C:\WINNT\System32 (Windows NT/2000)
  • C:\Windows\System32 (Windows XP, Vista, 7)

If you use a 64-bit version of Windows, you should also place cygwin1.dll in C:\Windows\SysWOW64\

Make sure overwrite any existing files (but make a backup copy of the original file).

Reboot your computer.

If the problem still occurs, try the following:

  1. Open Windows Start menu and select "Run...".
  2. Type CMD and press Enter (or if you use Windows ME, type COMMAND)).
  3. Type regsvr32 cygwin1.dll and press Enter.

INSERT INTO signal_strength_table VALUES('0','10045','26374','1.84194519856e+005','0',GeometryFromText('MULTIPOLYGON(((3474163.683371824212372 5503441.758485510945320 ,3474163.532771822530776 5503410.121985509991646 ,3474317.550171823706478 5503441.905285511165857 ,3474163.683371824212372 5503441.758485510945320 )))',-1) );

__________________________________________________________________________________________________

i have got new version of SHP2MySQL software from K?bben (ITC, GIP) from the website of: http://home.lijbrandt.nl/bjkobben/RIMapper/

it is more convenient to import the shape file data into MySQL database.   

write to me: shchen.lmars@live.cn, if possible.


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
cygwin下编译可在windows下执行的程序
mysql出现问题:mysql系统参数如何设置解决方案(mysql 小虚竹)
mysql?的日志的启动与查看
Highlights of Cygwin Functionality
Windows下Cygwin可以使用哪些Linux命令
php5安装
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服