Nik*_*rla 10 shapefile gdal python-3.x jupyter-notebook jupyter-lab
!pip install sentinelsat
!pip install geopandas
!pip install folium
from sentinelsat import SentinelAPI
user = '****'
password = '****'
api = SentinelAPI(user, password, 'https://scihub.copernicus.eu/dhus')
import geopandas as gpd
import folium
nReserve = gpd.read_file(r"G:\New folder (2)\cardinialres.shp")
m = folium.Map([-37.971389, 145.418889], zoom_start=12)
folium.GeoJson(nReserve).add_to(m)
m
Run Code Online (Sandbox Code Playgroud)
''我用谷歌搜索,发现我需要使用SHAPE_RESTORE_SHX=YES fio info myshapefile.shp
,但不知道在 Jupiter 实验室的哪里使用。
在对 .shp 对象有更多了解后,修复此问题。解决方案是将 .shp 文件附带的所有其他相关文件放在一个文件夹中!
如果您使用河流数据集Ex。
river.shp
river.prj
river.dbf
river.shx
像这样设置 GDAL 配置,它将创建丢失的 SHX
from osgeo import gdal
import geopandas as gpd
gdal.SetConfigOption('SHAPE_RESTORE_SHX', 'YES')
in_vector = '/Users/adi/projects/cds_scrap/f6089a8c/f6089a8c.shp'
gdf = gpd.read_file(in_vector)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10706 次 |
最近记录: |