Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
load_map [2012/09/03 23:18] admin [Output File Formats] |
load_map [2026/08/28 03:25] (current) hermann Sync from local documentation review |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Load Map ====== | + | ====== Load Map ====== |
| ===== Description ===== | ===== Description ===== | ||
| - | This functor loads a map from a file. The filename and its path must be specified. | + | Loads a map from a file. The file format is determined automatically from the filename's extension. See [[Load Categorical Map]] for loading maps whose cells represent categories. |
| ===== Inputs ===== | ===== Inputs ===== | ||
| ^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
| - | | Filename | [[Map Filename Type|Map Filename ]] | Name and path of input map file. File format is automatically selected based on the filename extension. If path is not specified, file location is the same of model script. | | + | | Filename | [[Map Filename Type]] | Name and path of the file to load. If no path is given, the file is located relative to the model script. | |
| ===== Optional Inputs ===== | ===== Optional Inputs ===== | ||
| ^ Name ^ Type ^ Description ^ Default Value ^ | ^ Name ^ Type ^ Description ^ Default Value ^ | ||
| - | | Load As Sparse | [[Bool Type|Bool]] | If true, the map is loaded as a sparse image. Sparse images have the advantage of storing only the cells containing non-null values, but they have worse access time. | False | | + | | Null Value | [[Null Value Type]] | Additional value to treat as null, alongside the file's own null value if it has one. Useful for assigning a null value to files that do not define one. | .none | |
| - | | Define Null Value | [[Bool Type|Bool]] | This flag forces the cells with the same value of the "Null Value" parameter to be treated as a null cells. This is particularly useful for assigning a missing null value to a GeoTiff data. | False | | + | | Storage Mode | [[Enum Type]] | Hint for how the map should be handled: Default follows the memory allocation policy in the application settings; Prefer Memory suggests loading the whole map into memory; Prefer Disk suggests keeping it on disk and loading it on demand, piece by piece; Load As Sparse suggests storing only non-null cells, minimizing storage at the expense of access time. This is only a hint and may be ignored. This is an advanced port. | Default | |
| - | | Null Value | [[Int Type|Int]] | Value used to represent null cell. The "Define Null Value" flag must be set in order to define a null value. This is particularly useful for assigning a missing null value to a GeoTiff data. | 0 | | + | | Suffix Digits | [[Non Negative Integer Value Type]] | Number of digits used to render Step as a filename suffix. If Step needs more digits than this, it is used unmodified. If zero, no suffix is added. This is an advanced port. | 0 | |
| - | | Suffix Digits | [[Non Negative Int Type|Non Negative Int]] | Number of digits used to represent the image file name suffix. If the "step" input is unbound, this options is ignored. | 0 | | + | | First Window Coordinate X | [[Real Value Type]] | X coordinate of one corner of a crop window, in the map's projection units. Must lie within the file's extent. This is an advanced port. | .none | |
| - | | Step | [[Non Negative Int Type|Non Negative Int]] | Current step or model iteration. Files with the same name and numbered suffixes will be loaded sequentially according to the model step. | None | | + | | First Window Coordinate Y | [[Real Value Type]] | Y coordinate of one corner of a crop window, in the map's projection units. Must lie within the file's extent. This is an advanced port. | .none | |
| - | | Workdir | [[Workdir Type|Workdir]] | Workdir folder path. | None | | + | | Second Window Coordinate X | [[Real Value Type]] | X coordinate of the opposite corner of the crop window, in the map's projection units. Must lie within the file's extent. This is an advanced port. | .none | |
| + | | Second Window Coordinate Y | [[Real Value Type]] | Y coordinate of the opposite corner of the crop window, in the map's projection units. Must lie within the file's extent. This is an advanced port. | .none | | ||
| + | | Step | [[Non Negative Integer Value Type]] | Current step or model iteration, appended to Filename as a numeric suffix; automatically bound to the innermost compatible container. This is an advanced port. | .none | | ||
| + | | Workdir | [[Workdir Type]] | Work directory Filename is relative to; may be a folder or a Zip archive. When not bound, the directory containing the script is used. This is an advanced port. | .none | | ||
| - | ===== Output ===== | + | ===== Outputs ===== |
| ^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
| - | | Map | [[Map Type|Map]] | The map loaded by this functor. | | + | | Map | [[Map Type]] | Loaded map, or, when the crop window is defined, only the cropped window of it. | |
| ===== Group ===== | ===== Group ===== | ||
| - | [[Functor List#Input/Output | Input/Output]] | + | [[Functor List#Input / Output | Input / Output]] |
| ===== Notes ===== | ===== Notes ===== | ||
| - | ===== Notes ===== | + | When Null Value is given, any cell already equal to the file's own null value (if it defines one) is converted to Null Value, and any non-null cell that happens to equal Null Value is likewise promoted to null — so a value that meant "no data" before loading still means "no data" after, regardless of how the null definition changed. |
| - | See also [[Load Categorical Map]] for loading maps whose cells represent categories. | + | The crop window (First/Second Window Coordinate X/Y) must either be left entirely at .none, loading the map in full, or have all four coordinates defined together; a partially defined window is not accepted. |
| - | **Dinamica 1.9 and above** uses the GDAL library [[http://www.gdal.org|GDAL]] to read and write maps. More information about each GDAL file format can be found consulting the [[http://www.gdal.org/formats_list.html|GDAL format list]] in the GDAL website. | + | If Step is .none, the loaded filename has no numeric suffix. |
| - | ==== Input File Formats ==== | + | For a list of file formats that Load Map can load, the supported [[wp>Map_projection|projections]] and [[wp>Datum_(geodesy)|datums]], check the [[Supported Map Formats#map_formats_supported_for_reading|supported map formats]]. |
| - | Using GDAL, Dinamica EGO can read maps in the file formats below. | + | It is possible to load maps from [[wp>zip_(file_format)|Zip]] archives; Workdir may point directly to a Zip archive rather than a folder. See [[Useful Tips#loading_files_from_zip_files|this useful tip]] to know how to do it. |
| - | It is worth noting that only the most common file formats are listed in the Open Map dialog file filters. However, it is possible to open any of the formats below choosing "All files" in the dialog. | + | ===== Internal Name ===== |
| - | ^ Description ^ Extension ^ | + | LoadMap |
| - | | AIRSAR Polarimetric [AirSAR] | | | + | |
| - | | ASCII Gridded [XYZ] | .xyz | | + | |
| - | | Arc/Info ASCII Grid [AAIGrid] | .asc | | + | |
| - | | Arc/Info Binary Grid [AIG] | | | + | |
| - | | BIGGIF | .gif | | + | |
| - | | BSB Nautical Chart Format [BSB] | | | + | |
| - | | CEOS | | | + | |
| - | | Convair PolGASP data [CPG] | | | + | |
| - | | DRDC COASP SAR Processor Raster [COASP] | .hdr | | + | |
| - | | Daylon Leveller Heightfield [Leveller] | .ter | | + | |
| - | | ELAS DIPEx [DIPEx] | | | + | |
| - | | ELAS DIPEx [ELAS] | | | + | |
| - | | ENVI Labelled Raster [ENVI] | | | + | |
| - | | EOSAT FAST Format [FAST] | | | + | |
| - | | ERMapper [ERS] | | | + | |
| - | | ESRI Labelled [EHdr] | | | + | |
| - | | EUMETSAT Archive native [MSGN] | .nat | | + | |
| - | | EarthWatch/DigitalGlobe [TIL] | | | + | |
| - | | Envisat Image Product [ESAT] | .n1 | | + | |
| - | | Erdas 7.x [LAN] | | | + | |
| - | | Erdas Imagine Raw [EIR] | | | + | |
| - | | Erdas Imagine [HFA] | .img | | + | |
| - | | FARSITE v.4 LCP Format [LCP] | .lcp | | + | |
| - | | First Generation USGS DOQ [DOQ1] | | | + | |
| - | | Fuji BAS Scanner Image [FujiBAS] | | | + | |
| - | | GDAL Virtual [VRT] | .vrt | | + | |
| - | | GSC Geogrid [GSC] | | | + | |
| - | | GSat File Format [GFF] | .gff | | + | |
| - | | Generic Binary [GenBin] | | | + | |
| - | | Geospatial PDF [PDF] | .pdf | | + | |
| - | | Golden Software ASCII Grid [GSAG] | .grd | | + | |
| - | | Golden Software Binary Grid [GSBG] | .grd | | + | |
| - | | Golden Software Surfer 7 Binary Grid [GS7BG] | .grd | | + | |
| - | | Graphics Interchange Format [GIF] | .gif | | + | |
| - | | Grid eXchange File [GXF] | .gxf | | + | |
| - | | HF2/HFZ heightfield raster [HF2] | .hf2 | | + | |
| - | | ILWIS Raster Map [ILWIS] | .mpr/mpl | | + | |
| - | | Idrisi Raster [RST] | .rst | | + | |
| - | | Image Display and Analysis [IDA] | | | + | |
| - | | In Memory Raster [MEM] | | | + | |
| - | | JAXA PALSAR Product Reader [JAXAPALSAR] | | | + | |
| - | | JPEG JFIF [JPEG] | .jpg | | + | |
| - | | JPEG2000 [JP2OpenJPEG] | .jp2 | | + | |
| - | | Japanese DEM [JDEM] | .mem | | + | |
| - | | KMLSUPEROVERLAY | | | + | |
| - | | Magellan Topo [BLX] | .blx | | + | |
| - | | Microsoft Windows Device Independent Bitmap [BMP] | .bmp | | + | |
| - | | Military Elevation Data [DTED] | | | + | |
| - | | NADCON Datum Grid Shift [LOSLAS] | | | + | |
| - | | NASA Planetary Data System [PDS] | | | + | |
| - | | NITF | .ntf | | + | |
| - | | NLAPS Data Format [NDF] | | | + | |
| - | | NOAA Polar Orbiter Level 1b Data Set [L1B] | | | + | |
| - | | NOAA vertical datum shift [GTX] | .gtx | | + | |
| - | | NTv2 Datum Grid Shift [NTv2] | .gsb | | + | |
| - | | Netpbm [PNM] | .pnm | | + | |
| - | | New Labelled USGS DOQ [DOQ2] | | | + | |
| - | | Northwood/VerticalMapper Classified Grid Format [NWT_GRC] | .grc | | + | |
| - | | Northwood/VerticalMapper Numeric Grid Format [NWT_GRD] | .grd | | + | |
| - | | OGC Web Coverage Service [WCS] | | | + | |
| - | | OGC Web Map Service [WMS] | | | + | |
| - | | OZI OZF2/OZFX3 [OZI] | | | + | |
| - | | PCI Geomatics Database File [PCIDSK] | .pix | | + | |
| - | | PCI Labelled [PAux] | | | + | |
| - | | PCRaster | .map | | + | |
| - | | Portable Network Graphics [PNG] | .png | | + | |
| - | | PostGIS Raster [PostGISRaster] | | | + | |
| - | | R Object Data Store [R] | .rda | | + | |
| - | | RadarSat2 XML [RS2] | | | + | |
| - | | Raster Matrix Format [RMF] | .rsw | | + | |
| - | | Raster Product Format/RPF [ADRG] | .gen | | + | |
| - | | Raster Product Format/RPF [RPFTOC] | .toc | | + | |
| - | | SAGA GIS Binary format [SAGA] | .sdat | | + | |
| - | | SAR_CEOS | | | + | |
| - | | SGI Image Format [SGI] | .rgb | | + | |
| - | | SRTM HGT Format [SRTMHGT] | .hgt | | + | |
| - | | Spot DIMAP [DIMAP] | | | + | |
| - | | Standard Raster Product [SRP] | .img | | + | |
| - | | Swedish Grid RIK [RIK] | .rik | | + | |
| - | | TIFF / BigTIFF / GeoTIFF [GTiff] | .tif | | + | |
| - | | TerraSAR-X Complex SAR Data Product [COSAR] | | | + | |
| - | | TerraSAR-X Product [TSX] | | | + | |
| - | | Terragen Heightfield [Terragen] | .ter | | + | |
| - | | USGS ASCII DEM / CDED [USGSDEM] | .dem | | + | |
| - | | USGS Astrogeology ISIS cube (Version 2) [ISIS2] | | | + | |
| - | | USGS Astrogeology ISIS cube (Version 3) [ISIS3] | | | + | |
| - | | USGS SDTS DEM [SDTS] | .ddf | | + | |
| - | | VTP Binary Terrain Format [BT] | .bt | | + | |
| - | | Vexcel MFF [MFF] | .hdr | | + | |
| - | | Vexcel MFF2 [MFF2] | | | + | |
| - | | WMO GRIB1/GRIB2 [GRIB] | .grb | | + | |
| - | | X11 Pixmap [XPM] | .xpm | | + | |
| - | ==== Output File Formats ==== | + | ===== Usage examples ===== |
| - | Using GDAL, Dinamica EGO can write maps in the file formats below. File formats whose descriptions are marked with a star (*) do not define an extension. To workaround this limitation, Dinamica EGO invents the corresponding extension using the file format description. | + | See practical examples of this functor in [[lesson_4|Lesson 4: Opening and Saving maps]] |
| - | + | ||
| - | It is worth noting that only the most common file formats are listed in the Save Map dialog file filters. However, it is possible to open any of the formats below choosing "All files" in the dialog. | + | |
| - | + | ||
| - | ^ Description ^ Extension ^ | + | |
| - | | Daylon Leveller Heightfield [Leveller] | .ter | | + | |
| - | | ELAS DIPEx [ELAS]* | .elas | | + | |
| - | | ENVI Labelled Raster [ENVI]* | .envi | | + | |
| - | | ERMapper [ERS]* | .ers | | + | |
| - | | ESRI Labelled [EHdr]* | .ehdr | | + | |
| - | | Erdas Imagine [HFA] | .img | | + | |
| - | | GDAL Virtual [VRT] | .vrt | | + | |
| - | | Golden Software Binary Grid [GSBG] | .grd | | + | |
| - | | ILWIS Raster Map [ILWIS] | .mpr/mpl | | + | |
| - | | Idrisi Raster [RST] | .rst | | + | |
| - | | Image Display and Analysis [IDA]* | .ida | | + | |
| - | | In Memory Raster [MEM]* | .mem | | + | |
| - | | Microsoft Windows Device Independent Bitmap [BMP] | .bmp | | + | |
| - | | NITF | .ntf | | + | |
| - | | NOAA vertical datum shift [GTX] | .gtx | | + | |
| - | | NTv2 Datum Grid Shift [NTv2] | .gsb | | + | |
| - | | Netpbm [PNM] | .pnm | | + | |
| - | | PCI Geomatics Database File [PCIDSK] | .pix | | + | |
| - | | PCI Labelled* | .paux | | + | |
| - | | Raster Matrix Format [RMF] | .rsw | | + | |
| - | | Raster Product Format/RPF [ADRG] | .gen | | + | |
| - | | SAGA GIS Binary format [SAGA] | .sdat | | + | |
| - | | SGI Image Format [SGI] | .rgb | | + | |
| - | | TIFF / BigTIFF / GeoTIFF [GTiff] | .tif | | + | |
| - | | Terragen Heightfield [Terragen] | .ter | | + | |
| - | | VTP Binary Terrain Format [BT] | .bt | | + | |
| - | | Vexcel MFF [MFF] | .hdr | | + | |
| - | | Vexcel MFF2 [MFF2]* | .mff2 | | + | |
| - | + | ||
| - | The support to AAIGrid (.asc) in GDAL is read only. So, Dinamica EGO provides the writing capability itself. This format can read images using [[:Cell Type Type|cell types]] "Signed 32 Bit Integer" and "IEEE 754 32 Bit Real". All cell types can be written, but they are automatically converted back to one of those formats next time Dinamica reads the image again. | + | |
| - | + | ||
| - | The support to ERMapper (.ers) in GDAL ignores class names. To workaround this limitation, support to reading and writing this file format is provided by Dinamica EGO itself. | + | |
| - | + | ||
| - | ==== GDAL Limitations ==== | + | |
| - | + | ||
| - | GDAL (and some times the underlying file format) imposes limitations on the representation of projections, layer names, category names and their corresponding colors. The limitations and their corresponding workaround are listed in the table below: | + | |
| - | + | ||
| - | ^ Limitation ^ Workaround ^ | + | |
| - | | Some file formats do not support storing projections. | Use a VRT file or an auxiliary PAM XML file to keep this information. | | + | |
| - | | Several file formats do not support storing category names. | Use a VRT file or an auxiliary PAM XML file to keep this information. The ERMapper file format has the best support to category names and colors. | | + | |
| - | | Several file formats do not support storing category colors. | Use a VRT file or an auxiliary PAM XML file to keep this information. The ERMapper file format has the best support to category names and colors. | | + | |
| - | | Several file formats do not support the storage of layer names. | Use a VRT file or an auxiliary PAM XML file to keep this information. The ERMapper file format also has support to layer names. | | + | |
| - | | The categories must start from 0 and their definition must be contiguous. | Unfortunately, the only way to workaround this limitation is defining dummy categories (Dinamica does this when representing non-contiguous categories in a GDAL supported format) or using the ERMapper file format. | | + | |
| - | + | ||
| - | Because the ERMapper file format is handled by Dinamica itself, the PAM XML file can not be used with this format. | + | |
| - | ==== Dinamica Limitation ==== | + | |
| - | + | ||
| - | Dinamica only retrieves and uses category names and colors from the first layer/band when using GDAL. All the other layers/bands are supposed to use the same category names and colors. | + | |
| - | + | ||
| - | ==== Additional Notes ==== | + | |
| - | + | ||
| - | When the map projection is not found, the map projection is left undefined. This differs from previous Dinamica versions (Dinamica 1.8) that assumes a LOCAL projection in these cases. | + | |
| - | + | ||
| - | When the cell dimension is not defined, a one meter resolution [or one degree, depending on the map projection used] is assumed. | + | |
| - | + | ||
| - | It is only possible to load maps represented by 8, 16 or 32 bits per cell. Other cell types are not supported. | + | |
| - | + | ||
| - | ==== Virtual Format ==== | + | |
| - | + | ||
| - | GDAL support a virtual file format called [[http://www.gdal.org/gdal_vrttut.html|VRT]]. This format can be used to transform an image defining a different registration info, different classe names and a different color table. It can also be use to create mosaics from several different images. A example of a VRT file defined from a two unrelated image files can be found below. | + | |
| - | + | ||
| - | <file xml test.vrt> | + | |
| - | <VRTDataset rasterXSize="2512" rasterYSize="2512"> | + | |
| - | <GeoTransform>-440720.0, 60.0, 30.0, 3751320.0, 0.0, -60.0</GeoTransform> | + | |
| - | <VRTRasterBand dataType="Byte" band="teste"> | + | |
| - | <ColorInterp>Palette</ColorInterp> | + | |
| - | <ColorTable> | + | |
| - | <Entry c1="255" c2="0" c3="0" c4="255"/> | + | |
| - | <Entry c1="145" c2="78" c3="224" c4="255"/> | + | |
| - | <Entry c1="145" c2="230" c3="0" c4="255"/> | + | |
| - | <Entry c1="145" c2="145" c3="145" c4="255"/> | + | |
| - | <Entry c1="100" c2="200" c3="30" c4="255"/> | + | |
| - | <Entry c1="10" c2="20" c3="30" c4="255"/> | + | |
| - | </ColorTable> | + | |
| - | <SimpleSource> | + | |
| - | <SourceFilename relativeToVRT="teste">myband.bmp</SourceFilename> | + | |
| - | <SourceBand>1</SourceBand> | + | |
| - | <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/> | + | |
| - | <DstRect xOff="100" yOff="100" xSize="512" ySize="512"/> | + | |
| - | </SimpleSource> | + | |
| - | <CategoryNames> | + | |
| - | <Category>Missing</Category> | + | |
| - | <Category>Non-Crop</Category> | + | |
| - | <Category>Wheat</Category> | + | |
| - | <Category>Corn</Category> | + | |
| - | <Category>Soybeans</Category> | + | |
| - | </CategoryNames> | + | |
| - | </VRTRasterBand> | + | |
| - | </VRTDataset> | + | |
| - | </file> | + | |
| - | + | ||
| - | ===== Internal Name ===== | + | |
| - | + | ||
| - | LoadMap | + | |