0 说明
官方文档(重要):
GeoServer ImageMosaic configurationhttps://docs.geoserver.org/2.18.x/en/user/data/raster/imagemosaic/configuration.html数据源说明:为某地区的2000-2005-2010-2013-2015-2018-2020年的时间序列地类变化栅格数据,命名格式为“landtype_yyyyMMdd”。
1 配置文件
1.1 database.properties
- 包含连接到存储镶嵌索引的数据库的所有相关信息;
- 该配置文件不是必须的;
- 若数据文件夹landtype目录内存在该配置文件,则会在相应的数据库中创建相同名称的空间表用来存储时间序列影像的索引信息;
- 若数据文件夹landtype目录内不存在该配置文件,则会自动创建同名的shp文件用来存储时间序列影像的索引信息。
Parameter | Mandatory? | Description |
SPI | Y | The DataStoreFactory used to connect to the index store |
StoreName | N | Can be used to refer to a GeoServer registered store |
| Y | Must be the string |
| Y | Machine name or IP address to connect to |
| Y | Port number to connect to, default 5432 |
| Y | The database schema to access |
| Y | The database to connect to |
| Y | User name |
| Y | Password |
1.2 indexer.properties(参数说明详见官网)
- 用于指定时间变量属性的名称、高程属性的名称和这些属性的类型。
Parameter | Mandatory? | Description |
---|---|---|
Schema | Y | A comma-separated sequence describing the mapping between attribute and data type. |
PropertyCollectors | Y | |
TimeAttribute | N | Specifies the name of the time-variant attribute. |
ElevationAttribute | N | Specifies the name of the elevation attribute. |
AuxiliaryFile | N | |
AbsolutePath | N | |
Caching | N | |
CanBeEmpty | N | |
Envelope2D | N | |
ExpandToRGB | N | |
IndexingDirectories | N | |
Name | N | |
NoData | N | |
CoverageNameCollectorSPI | N | |
Recursive | N | |
UseExistingSchema | N | |
Wildcard | N | |
WrapStore | N | |
MosaicCRS | N | |
AdditionalDomainAttributes | N |
1.3 timeregex.properties
- 指定用于从栅格文件的文件名中提取时间信息的正则表达式。
2 发布步骤
2.1 编写配置文件
将配置文件存放于landtype相应的影像文件夹内,基本配置如下图
indexer.properties:
Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date,elevation:Integer
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)
TimeAttribute=ingestion
ElevationAttribute=elevation
Caching=false
timeregex.properties:
regex=[0-9]{8}
2.2 geoserver数据发布
在geoserver中发布ImageMosaic,同时开启时间维度(略..........)。
2.3 时间序列影像数据
文件结构:
在wms的getmap的url中添加&time=2000-01-01参数即可访问相应时间的影像数据。