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 ...
随机推荐
- java concurrency: ThreadLocal及其实现机制
转载:http://shmilyaw-hotmail-com.iteye.com/blog/1703382 ThreadLocal概念 从字面上来理解ThreadLocal,感觉就是相当于线程本地的. ...
- Qt mac QMYSQL(动态加载插件QPluginLoader的用法)
用此段代码查出问题所在 QPluginLoader loader; loader.setFileName("/Users/danny/Qt5.3.2/5.3/clang_64/plugins ...
- Debian下Apache配置多域名访问
请见Github博客:http://wuxichen.github.io/Myblog/php/2014/10/10/DebianApacheSetting.html
- BZOJ 1607: [Usaco2008 Dec]Patting Heads 轻拍牛头
1607: [Usaco2008 Dec]Patting Heads 轻拍牛头 Description 今天是贝茜的生日,为了庆祝自己的生日,贝茜邀你来玩一个游戏. 贝茜让N(1≤N≤10 ...
- icon-font自己探索得到的经验
1. 引入的时候字体类型分为:
- Ubuntu 13.04 安装使用clang
其实很简单,就是用命令即可: apt-get install clang-3.2 clang-3.2-doc 主要说明一点,/usr/bin/c++链接原来指向g++,现在被改变了. $ ls /us ...
- Java线程(十):CAS
前言 在Java并发包中有这样一个包,java.util.concurrent.atomic,该包是对Java部分数据类型的原子封装,在原有数据类型的基础上,提供了原子性的操作方法,保证了线程安全.以 ...
- tomcat 系统服务 outofmemory
TOMCAT内存溢出outofmemory的问题: http://hi.baidu.com/mefeng47/item/3b247af74ce4e24e922af2e5 注:双击tomcat6w.ex ...
- 关于int.TryParse的使用
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- opencv kmeans 图像分割
利用kmeans算法,将彩色图像的像素点作为样本,rgb值作为样本的属性, 对图像所有的像素点进行分类,从而实现对图像中目标的分割. c++代码(openCV 2.4.11) Scalar color ...