我正在尝试转换一个具有较小值的多边形shapefile。列propEmp中的值范围从0.000002到0.119419。这是我的尝试:
# Load shapefile
emp_planejado <- shapefile("./planejado/7_wgs/emp_planejado.shp")
# Load raster model
r_bioma<- raster("./_GRID/grid_caatinga_disol_64bit.tif")
# List values from tipologia field
tipologia<
我的python3脚本创建了变量geometries_list,其值是一个shapefiles列表,每个文件都是一个表示地理区域的多边形。
[<shapefile.Shape at 0x7f060abfae48>,
<shapefile.Shape at 0x7f05dcaf1cc0>,
<shapefile.Shape at 0x7f060a86b278>,
<shapefile.Shape at 0x7f05da470668>]
我想“合并”多边形。我尝试了以下代码
from functools import reduce
from s
我想使用R中的sf包将我的数据组织为一个简单的特征对象,它有几个几何列,例如多边形、它的质心和它的缓冲区,所有这些都共享相同的属性。 我很难将这样的对象保存到磁盘上。例如,如果我尝试使用st_write()将其另存为shapefile,则会得到以下结果 Error in clean_columns(as.data.frame(obj), factorsAsCharacter) :
list columns are only allowed with raw vector contents
Warning:
1: In abbreviate_shapefile_names(obj) :
在Fiona1.5.0上(我很困惑为什么不同的文件(如.dbf和.gdb)没有打印我的“!”(这是我希望在文件不是.shp的任何时候)退出前的警告。
import fiona
import sys
def process_file(self, in_file, repair_file):
with fiona.open(in_file, 'r', encoding='utf-8') as input:
# check that the file type is a shapefile
if
我正在研究古老的法国拿破仑地籍,我已经将其矢量化,现在我一直在研究地块的邻域关系。我想知道哪个多边形紧挨着哪个多边形。
我尝试了shapefile python库,但我没有成功地将我的NetworkX转换为图形。我想从多边形中提取质心,并跟踪它们之间的关系。
我可以使用line shapefile或area shapefile来表示我的地块。
这是我的python代码:
import networkx as nx
import matplotlib.pyplot as plt
G=nx.read_shp('path/to/shp') #Read shapefile as g
我想从streamstats函数delineateWatershed()创建一个sf()对象,而不需要首先保存为json的shapefile。我可以描绘多边形,然后保存为形状,最后作为shapefile导入。这使得我在一个嵌套的文件夹中留下了一个形状文件的版本,这将很快占用空间。一旦我有了我的sf()多边形,我计划将多个合并在一起,并将它们保存为单个shapefile。最后,我将拥有多边形的两个副本。如何跳过writeShapefile()然后执行st_read步骤? setwd('~/R/GIS/data/') #I need to define the working d