资源简介
用来将shapefile格式的地图数据转化为mysql格式的工具
代码片段和文件信息
// **********************************************************
// *** BJK = quick and dirty hack to make it work for MySQL alpha 4.1
// *** Barend K鯾ben
// ** WARNING: NO TESTING DONE TO SPEAK OFF !!!
// version 0.2 - november 2003
// port from PostGIS SQL to MySQL
// version 0.3 - may 2004
// changed all coordinate output to fixed decimal places as JTS does not accept 1234e-xxx notation
// version 0.4 - July 2004
// changed primary from being called gid to ID
// fixed a bug where Add geometry statement was not endend properly with “;“
//
//**********************************************************
// released under GPL http://www.gnu.org/copyleft/gpl.html
//
//*** ORIGINAL:
/*
* $Id: shp2pgsql.cv 1.33 2003/04/01 23:02:50 jeffloun Exp $
*
* Author: Jeff Lounsbury jeffloun@refractions.net
*
* $Log: shp2pgsql.cv $
* Revision 1.33 2003/04/01 23:02:50 jeffloun
*
* Fixed a bug which dropped the last Z value of each line in 3d lines.
*
* Revision 1.32 2003/03/07 16:39:53 pramsey
* M-handling patch and some Z-recognition too.
* From strk@freek.keybit.net.
*
* Revision 1.31 2003/02/15 00:27:14 jeffloun
* added more type checking into the create table statment.
* Now uses int8 and numeric types if the columns definitions are too big
*
* Revision 1.30 2003/02/14 20:07:26 jeffloun
* changed the PIP function to loop from i=0 to 1 *
* Revision 1.29 2003/02/04 22:57:44 pramsey
* Fix memory management error array of pointers allocated insufficient space.
*
* Revision 1.28 2003/02/04 21:39:20 pramsey
* Added CVS substitution strings for logging.
*
*
* Using shapelib 1.2.8 this program reads in shape files and
* processes it‘s contents into a Insert statements which can be
* easily piped into a database frontend.
* Specifically designed to insert type ‘geometry‘ (a custom
* written PostgreSQL type) for the shape files and PostgreSQL
* standard types for all attributes of the entity.
*/
#include “shapefil.h“
#include
#include
#include
#include “getopt.h“
typedef struct {double x y z;} Point;
typedef struct Ring{
Point *list; //list of points
struct Ring *next;
int n; //number of points in list
} Ring;
int dump_format = 0; //0=insert statements 1 = dump
int Insert_attributes(DBFHandle hDBFHandle int row);
char *make_good_string(char *str);
int ring_check(SHPobject* obj char *table char *sr_id int rings
DBFHandle hDBFHandle);
char *protect_quotes_string(char *str);
int PIP( Point P Point* V int n );
char *make_good_string(char *str){
//find all the tabs and make them \s
//
// 1. find # of tabs
// 2. make new string
//
// we dont escape already escaped tabs
char *result;
char *str2;
char *start*end;
int num_tabs = 0;
(str2) = (str);
while ((str2 = strchr(str2 ‘\t‘)) )
{
if ( (str2 == str) || (str2[-1] != ‘\\‘) ) //the previous char isnt a ‘\‘
num_tabs ++;
str2++;
}
if (num_tabs == 0)
return str;
re
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-07-09 11:34 src\
文件 9544 2003-11-04 19:20 src\dbfopen.o
文件 4376 2001-10-22 20:13 src\getopt.h
文件 4701 2003-11-04 19:20 src\getopt.o
文件 285 2003-11-10 14:48 src\Makefile
文件 13192 2002-05-04 22:44 src\shapefil.h
文件 33877 2004-07-09 11:34 src\shp2mysql.c
文件 18636 2004-07-09 11:24 src\shp2mysql.o
文件 33522 2004-05-17 12:46 src\shp2mysql_0.2.c
文件 16937 2003-11-04 19:20 src\shpopen.o
文件 971618 2003-09-20 20:32 cygwin1.dll
文件 1497 2004-11-18 20:49 DOShere.lnk
文件 53855 2004-07-09 11:26 shp2mysql.exe
文件 2794 2005-03-31 19:23 shp2mysqlReadme.txt
相关资源
- mysql数据库驱动8.0.12版本
- mha4mysql-0.56-0.el6
- mysql_5.6.24_winx64
- MYSQL作业提交作业批改系统.zip
- Maven搭建Spring+Mybatis+MySql
- 成语首尾字用于成语接龙.sql
- MySQL中文手册api帮助文档
- linux_mysql5.1.66x86_64.zip
- oracle 到mysql转换工具
- 数据库原理实验指导书Mysql
- mysql 5.6 绿色精简版 5Mb
- mysql Premium 破解
- 深入浅出MySQL第二版本pdf
- 深入浅出MySQL.pdf
- 深入浅出mysql全文
- 全球国家及地区库,采集自腾讯QQ国内
- mysql操作练习的表数据
- 免费的Navicat11全系列注册机Navicat fo
- Navicat For MySql 8.0.20 简体中文版(含破
- navicat for mysql v 11.1.13破解工具
- mysql数据库5.6连接包
- Navicat for MySQL注册机 绿色版
- 旅游管理系统数据库
- 易语言MySQL注册登录源码
- 传智播客mysql的sql优化
- msvcr120.dll 32位和64位
- mysql5.7驱动.rar
- mysql innodb恢复数据工具.rar
- 易语言Mysql线程池2.0模块源码
- 数据库宾馆管理系统Mysql
评论
共有 条评论