OGR – Merging Multiple SHP files
So I have 25 shapefiles with data for 25 counties, and I want to merge them all into one shapefile.
Using OGR,you can merge 2 files like this:
ogr2ogr merge.shp file1.shp
ogr2ogr -update -append merged.shp file2.shp -nln merge
You create a new shapefile merged and copy the contents of file1 into the new shapefile. Then you append the contents of file2 to the newly created shapefile and name it merged.
What do you do if you don’t want to do this 25 times ?
On page 22 of this document (Using GDAL / OGR for Data Processing and Analysis) is a Python script for doing this. But I couldn’t get the Python bindings for GDAL to work. The errors were always with importing _gdal which I understand is the gdal dll and references to _gdal are created by SWIG. I don’t care about the script. I can write my own. But I would like to get GDAL(OGR) working from Python.
So after giving up on this concept temporarily, I resorted to Windows scripting, as modified from this page:
as above, use: ogr2ogr merge.shp file1.shp to create a shapefile mergecontaining the data of file1
then:
for %f in (*.shp) do (
ogr2ogr -update -append merge.shp %f -f “esri shapefile” -nln merge )
That worked.
OGR – Merging Multiple SHP files的更多相关文章
- Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ...
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ... 这个错误是因为有两个相 ...
- 导入项目时,有关[2016-04-03 20:38:02 - Dex Loader] Unable to execute dex: Multiple dex files 问题
最近我在学习androidUI设计,在网上找了一个UI菜单界面开源代码示例,按照步骤导入项目,运行的时候控制台结果报了如下错误: [2016-04-03 20:38:02 - Dex Loader] ...
- Multiple dex files define Lcom/google/zxing/BarcodeFormat
解决zxing “Could not find class 'com.goole.zxing.Result”和“Multiple dex files define”问题 时间 2014-04-24 1 ...
- 用Eclipse运行Android版APP(PhoneGap)时出现:Unable to execute dex: Multiple dex files define
这两天遇到点小问题,做个记录: 症状:运行,调试时都报:Unable to execute dex: Multiple dex files define错误,发布后的APP安装到手机后一运行,就提示: ...
- TN035: Using Multiple Resource Files and Header Files with Visual C++
TN035: Using Multiple Resource Files and Header Files with Visual C++ This note describes how the Vi ...
- Unable to execute dex: Multiple dex files define Lcom/gl
[2015-04-16 17:42:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/gl/softphon ...
- “Unable to execute dex: Multiple dex files”如何解决?
遇到报错: [2014-02-13 17:27:03 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/kkdia ...
- Multiple dex files define
Multiple dex files define 在项目中,有一个类的包名和引用的jar包中的类和包名一致
- Struts – Multiple configuration files example
Many developers like to put all Struts related stuff (action, form) into a single Struts configurati ...
随机推荐
- strcpy_s
char src[5]="abcd"; char *des=new char[str.length(src)+1]; // length()不计\0 strcpy_s(des, ...
- 关于Ubuntu远程ssh连接失败的问题
在做机器人项目的时候,用的是Ubuntu的linux,跟之前的CentOS的操作命令有一点差别,就比如防火墙的名字,在Ubuntu系统中叫什么ufw,真是有点不好接受. 为了能模拟环境,我又弄了一台电 ...
- 数据表转换成json(DatatableToJson)
#region 转换Table为JSON数据 /// <summary> /// 转换Table为JSON数据 /// </summary> /// <param nam ...
- php的迭代器
接口Iterator 主要需要实现的方法: abstract public mixed current ( void ) abstract public scalar key ( void ) abs ...
- python3.4.3如何获取文件的路径
#coding:utf-8from tkinter import *from tkinter import filedialogroot = Tk()root.filename = filedialo ...
- android应用Dialog跳转到Activity
public void back(Context context){ intent = new Intent(); intent.setClass(context, IBookActivity.cla ...
- ORA-00923: 未找到要求的 FROM 关键字
oracle处理 后台数据时, select a.oga01 发货单号,e.imaud04 箱/套from oga_file a left join ogb_file b on b.ogb01 = a ...
- java的数据类型,几个java小程序
1:求圆的面积 还好看了c++,不然直接看这课件还真是看不懂……加油吧 要从键盘读入数据可以用Scanner类的nextlnt()或者nextDouble()方法,首先创建Scanner类的一个实例, ...
- 轻量级数据sqlite的C++调用示例
原文地址:http://www.cnblogs.com/kfqcome/archive/2011/06/27/2136999.html #include "stdafx.h" #i ...
- [Swust OJ 842]--实验室和食堂(最短路,Dijkstra算法)
题目链接:http://acm.swust.edu.cn/problem/842/ Time limit(ms): 1000 Memory limit(kb): 10000 Description ...