我试图使用管道工R包将一个函数包装到REST中。作为输入,函数接受一个shapefile,并在转换后以.shp格式和GeoJSON格式返回shapefile。现在,在装饰师的帮助下,我需要将其增强为web服务。
R文件:
#* Spatial Polygon Object
#* @param pathtoshpfile:character Path to Shapefile with Name
#* @param design:character one or two
#* @post /sprayermap
function(pathtoshpfile, design = c("
stackoverflow社区
我有两份日本市政府的档案。我用R为每个城市创建单独的地块。我可以用一个shapefile来完成这个任务,但是相同的语法却失败了。下面是数据的代码和URL:
library(sp)
library(maptools)
# Map A - this one works
# Please download: http://www.filefactory.com/file/z26nirxoz53/n/JPN_adm_zip
# Enter your path for readShapePoly
japanMapA = readShapePoly("JPN_a
我想创建一个交互式地图,显示一个城市的公共交通线路。我试着用R中的传单来做这件事(但我愿意接受替代方案和建议?)
数据:传输系统的数据采用GTFS格式,以文本文件(.txt)组织,我将其作为数据框架读入R中。
问题:我找不到如何指示每条多边形线的id (变量shape_id),所以图实际上会遵循每条中转线的路线。相反,它是用随机序列将点连接起来。
以下是我尝试过的,到目前为止还没有成功:
# Download GTFS data of the Victoria Regional Transit System
tf <- tempfile()
td <- tempdir()
在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
我在使用python安装模块时遇到困难。确切的错误信息是:
Could not find a version that satisfies the requirement shapefile (from versions: DistributionNotFound: No matching distribution found for shapefile
当我打字时:
pip install -vvv shapefile
我收到404状态码,上面写着:
Could not fetch URL https://pypi.python.org/simple/shapefile/: 404 Clie
我需要帮助,任何指导都是非常感谢的!
我的目标是创建一个函数,利用现有函数poly2nb()计算多边形形状文件的相邻邻居的空间移动平均值。该函数必须是灵活的,以便它可以调用工作shapefile中的任何属性。我不知道如何修复我所收到的错误:.subset2错误(x,i,确切=确切):当我试图调用函数时,在3级上没有这样的索引。我完全不知道如何解决这个问题。
我正在处理一个芝加哥邻里数据的shapefile,mulypolygon,包含以下属性:
•Community Area ID
•Community Name
•Tract Cnt
•Pop2014
•Hisp14P
•PerCInc14
我有生成shapefile的代码,但字段的数量取决于某些因素。目前,我在输入上测试它,我知道它产生了3个字段,所以有这个代码。
output = shapefile.Writer(shapefile.POINT)
for i in range(1,(input.fieldcount+1)):
fieldname = "field" + str(i)
output.field(fieldname,'C','40')
for i in range(len(output.item)):
output.point(in
您好:
我有以下几点:
带有每个国家边界的世界的形状文件
--已成功将shapefile导入PostGIS数据库
--可以通过Openlayers在浏览器中显示世界地图。
2数据(CSV)文件,其中每个记录都有
a. birth country,
b. gender,
c. lat and long of the country of birth (which matches the lat & long in the shapefile)
我正在尝试找出最好的方法来显示地图,其中每个国家(基于CSV数据)有100人或更多的人,比如红色或绿色……
所以我的问题是:
如果我用CSV数据创