通过geoserver imageMosic发布多张tif数据
reference:
https://zhuanlan.zhihu.com/p/132388558
https://zhuanlan.zhihu.com/p/103674876
https://docs.geoserver.org/latest/en/user/tutorials/imagemosaic_timeseries/imagemosaic_timeseries.html
步骤
- 下载数据 https://docs.geoserver.org/latest/en/user/_downloads/5d368630a4da12c7173c0547741d9208/snowLZWdataset.zip
- 将数据解压到geoserver设置的目录,取名:snowLZWdataset,目录下包涵三张tif图和一个sld文件
- snowLZWdataset目录下创建timeregex.properties文件:
regex=[0-9]{8}
-
创建indexer.properties文件
TimeAttribute=ingestion ElevationAttribute=elevation Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date,elevation:Integer PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)
-
Create new ImageMosaic data store,指定目录,如file:/imagemosaic_time_sample/snowLZWdataset
- 自动生成文件
- sample_image.dat
- 自动生成文件
-
创建图层,并设置
-
Set coverage parameters sorting 参数
ingestion D
-
-
添加snow_style.sld并设置到layer
-
设置时间参数
- 选择维度:启用时间,选择list,自动生成,snowLZWdataset.properties和snowLZWdataset.shp(及shp其他文件)
-
使用三个时间地址
http://localhost:8980/geoserver/NCData/wms?service=WMS&version=1.1.0&request=GetMap&layers=NCData%3AsnowLZWdataset&bbox=624800.0%2C5171500.0%2C632600.0%2C5184500.0&width=460&height=768&srs=EPSG%3A32632&styles=&format=application/openlayers&time=2009-10-01
http://localhost:8980/geoserver/NCData/wms?service=WMS&version=1.1.0&request=GetMap&layers=NCData%3AsnowLZWdataset&bbox=624800.0%2C5171500.0%2C632600.0%2C5184500.0&width=460&height=768&srs=EPSG%3A32632&styles=&format=application/openlayers&time=2009-11-01
http://localhost:8980/geoserver/NCData/wms?service=WMS&version=1.1.0&request=GetMap&layers=NCData%3AsnowLZWdataset&bbox=624800.0%2C5171500.0%2C632600.0%2C5184500.0&width=460&height=768&srs=EPSG%3A32632&styles=&format=application/openlayers&time=2009-12-01