使用REST API添加RASTER图层

问题描述 投票:0回答:1

[尝试使用其余的API向GeoServer添加栅格图层,但我不断收到响应415。该消息说不支持的媒体。请有人帮帮我吗?下面是我的代码

coveragestore = 'gmes20241'
url = "http://127.0.0.1:8080/geoserver/rest/workspaces/cite/datastores/" + coveragestore  + "/external.tif"
data = "/home/ernest/Desktop/BASIS/BaSIS_DATA/area_Councils/ar/ADANSI EAST/adansi east_ea.tif"
auth = ("admin", "geoserver")

response = requests.put(url, data=data, auth=auth)
print(response)
python api geoserver
1个回答
0
投票
您需要将内容类型标头设置为Content-type: image/tiff,以便GeoServer可以知道接收的内容。
© www.soinside.com 2019 - 2024. All rights reserved.