本文介绍了gdal/ogr:如何真正裁剪shapefile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出了与欧洲国家相对应的SHP文件,然后...

给出与法国相对应的定义区域,例如:

West : 005° 48' W
East : 010° E
North : 051° 30' N
South : 041° N

如何仅获取与gdal相交的点/几何形状?,所以我的农作物确实是真正的农作物,仅保留必要的几何形状.强烈倾向于gdalogr或控制台解决方案.

How to get only the dots/geometries which intersects my defined area with gdal ? so my crop indeed is a real crop, which just keep the necessary geometries. Strong preference to gdal, ogr or console solutions.

推荐答案

使用GDAL的 ogr2ogr 命令在线实用程序.如果您有一个文件Europe.shp,该文件的空间参考以度为单位,则使用-clipsrc选项和十进制度来创建一个新的shapefile:

Use GDAL's ogr2ogr command-line utility. If you have a file Europe.shp which has a spatial reference with units of degrees, then use the -clipsrc option with decimal degrees to make a new shapefile:

ogr2ogr -clipsrc -5.8 41 10 51.5 France.shp Europe.shp

ogr2ogr页面上也有示例,以法国为例.

There is also an example at the ogr2ogr page with France used as an example.

这篇关于gdal/ogr:如何真正裁剪shapefile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:16