发布栅格数据
通过GeoServer发布Ganos中的栅格数据。
添加数据源
REST API
- 接口:http://host:port/geoserver/rest/workspaces/{workspace}/coveragestores
- 方法:POST
- 参数:
- workspace:已经创建好的workspace名称。
- datastore body:示例如下,其中type为固定写法,url中填写阿里云pg/polardb的连接参数(json格式)。
{ "coverageStore": { "name": "<datasource_name>", "type": "GanosRaster(PG/PolarDB)", "enabled":"true", "workspace":"<wokrspace>", "url": "{\"column\":\"<raster_colunm>\",\"database\":\"<database_name>\",\"filter\":\"<raster_filter>\",\"host\":\"<pg_host>\",\"name\":\"<public_name>\",\"password\":\"<user_password>\",\"port\":<pg_port>,\"schema\":\"<schema_name>\",\"ssl\":false,\"table\":\"<raster_table_name>\",\"userName\":\"<user_name>\",\"valid\":true}" } }
创建数据源示例
{
"coverageStore": {
"name": "srtm",
"type": "GanosRaster(PG/PolarDB)",
"enabled":"true",
"workspace":"test",
"url": "{\"column\":\"rast\",\"database\":\"test_db\",\"filter\":\"name='srtm'\",\"host\":\"pgm-xxxxxxxx.pg.rds.aliyuncs.com\",\"name\":\"srtm_image\",\"password\":\"xxxx\",\"port\":3432,\"schema\":\"public\",\"ssl\":true,\"table\":\"raster_table\",\"userName\":\"raster_user\",\"valid\":true}"
}
}
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
评论