当我使用 ogr2ogr 将 geojson 文件 (AL.geojson) 转换为 R 中的 geopackage (AL.gpkg) 时,出现如下错误:
getOption("gdalUtils_gdalPath")[[gdal_installation_id]] 中的错误:下标越界
有人可以帮忙看看吗?非常感谢您的意见!
这是我的代码
library(gdalUtils)
library(sf)
iFile <- "C:/Work/2022/AL.geojson"
out_file <- "C:/Work/2022/AL.gpkg"
valid_install <- !is.null(getOption("gdalUtils_gdalPath"))
temp <- ogr2ogr(src_datasource_name = iFile,
dst_datasource_name = out_file,
f = "GPKG")
和我的数据(AL.geojson)
{ "type":"FeatureCollection", "features": [ {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-84.959634,32.421887],[ -84.95982,32.421889],[-84.959822,32.421797],[-84.959767,32.421796],[-84.959767,32.421771],[-84.959636,32.421769],[-84.959636,32.421769],[-84.959634]]".4ties:767],34,28,7,3 release":2,"capture_dates_range":"3/26/2020-7/22/2020"}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates" :[[[[ - 84.959636,32.42095],[ - [ - 84.959715,32.42095],[ - 84.959714,32.420984],[ - 84.959816,32.420985] ]]]},"properties":{"release":2,"capture_dates_range":"3/26/2020-7/22/2020"}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-84.959998,32.235231], [-84.959877,32.235231],[-84.959877,32.235288],[-84.959998,32.235288],[-84.959998,32.235231]]]},"properties":{"release":1,"capture_dates_range":""}} , {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-84.960253,32.422248],[-84.960069,32.422245],[-84.960067,32.422321], [-84.960165,32.422323],[-84.960164,32.422364],[-84.96025,32.422365],[-84.960253,32.422248]]]},"properties":{"release":2,"capture_dates_range":"3/26 /2020-7/22/2020"}}, {"type":"Feature","geometry":{"type":"Polygon",“坐标”:[[[-84.961602,32.419206],[-84.961599,32.419354],[-84.961707,32.419355],[-84.961708,32.419291],[-84.961794,32.4961792],.6,32.4961792],[-.4],[-.4] 84.961602,32.419206]]]},"properties":{"release":1,"capture_dates_range":""}}, {"type":"Feature","geometry":{"type":"Polygon", "坐标":[[[-88.47008,31.777915],[-88.470081,31.777961],[-88.470231,31.777961],[-88.47023,31.777914],[-88.47008,31.777915]]},"属性"发布":1,"capture_dates_range":""}} ] }capture_dates_range":""}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-88.47008,31.777915],[-88.470081,31.777961], [-88.470231,31.777961],[-88.47023,31.777914],[-88.47008,31.777915]]]},"properties":{"release":1,"capture_dates_range":""}} ] }capture_dates_range":""}}, {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-88.47008,31.777915],[-88.470081,31.777961], [-88.470231,31.777961],[-88.47023,31.777914],[-88.47008,31.777915]]]},"properties":{"release":1,"capture_dates_range":""}} ] }