Overview

The MapStack format is a FEWS specific way to export and import a grid timeseries in one or more files using either ESRI ASCII grid, PC-Raster or USGS BIL format files. As the ASCII grid file format can only contain a single grid dataset, for this format multiple files are stored, one per timestep and / or parameter. The MapStack format was implemented primarily for the purpose of transferring gridded data to and from external models using the General Adapter, but it is also supported by both the Import and Export module. A map stack is always represented by a main XML file which contains the relevant meta data of the exported set of grid files.

The ID of this parser is 'piMapStack' and it supports datasets in ESRI ASCII grid, PC-Raster en USGS BIL format. Specifically for ASCII grid format, multiple .asc files are used, one per time step and parameter, whereas for PC-Raster and BIL format multiple grids can be stored in a single file so only one file can be sufficient.

Configuring the Import

The reader is named piMapStack which should be configured in the general section of the import: <importType>piMapStack</importType>. The reader will automatically detect the file format and optional date/time pattern that can be configured as a MapStack is exported so no further specific configuration for these is required. The main file defining a map stack and it's metadata is an XML file, so in order make sure that the reader always starts with this file skipping the actual grid files which are in the same directory you need to specify a fileNamePattern of *.xml.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
	<import>
		<general>
			<importType>piMapStack</importType>
			<fileNamePatternFilter>*.xml</fileNamePatternFilter>
			<folder>$IMPORT_FOLDER$</folder>
			<deleteImportedFiles>false</deleteImportedFiles>
			<idMapId>MapStack</idMapId>
            <missingValue>NaN</missingValue>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>GridImportMapStackAscii</moduleInstanceId>
			<valueType>grid</valueType>
			<parameterId>H.sim</parameterId>
			<locationId>locA</locationId>
			<timeSeriesType>simulated forecasting</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
            <relativeViewPeriod unit="hour" start="0" end="2"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>

An example of the structure of the MapStack XML file is given below, this example uses the ESRI ASCII grid format to store the actual data where the filename contains a date/time stamp:

Example:

<?xml version="1.0" encoding="UTF-8"?>
<MapStacks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_mapstacks.xsd" version="1.2">
    <geoDatum>WGS 1984</geoDatum>
    <timeZone>0.0</timeZone>
    <mapStack>
        <locationId>EA_H-2001</locationId>
        <parameterId>waterlevel</parameterId>
        <timeStep unit="hour" multiplier="1"/>
        <startDate date="2003-02-28" time="22:00:00"/>
        <endDate date="2003-03-01" time="00:00:00"/>
        <file>
            <ascii file="_EA_H-2001_'yyyyMMdd_HHmm'.asc"/>
        </file>
    </mapStack>
</MapStacks>
  • No labels