This is an old revision of the document!


PHP's gd library is missing or unable to create PNG images

Load Map

Description

This functor loads a map from a file. The filename and its path must be specified.

Inputs

Name Type Description
Filename 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.

Optional Inputs

Name Type Description Default Value
Load As Sparse 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
Define Null Value 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
Null Value 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 Int Number of digits used to represent the image file name suffix. If the “step” input is unbound, this options is ignored. 0
Step 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
Workdir Workdir Workdir folder path. None

Output

Name Type Description
Map Map The map loaded by this functor.

Group

Notes

Notes

See also Load Categorical Map for loading maps whose cells represent categories.

Dinamica 1.9 and above uses the GDAL library GDAL to read and write maps. More information about each GDAL file format can be found consulting the GDAL format list in the GDAL website.

Input File Formats

Using GDAL, Dinamica EGO can read maps in the file formats below.

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.

Description Extension
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

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.

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 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 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.

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>

Internal Name

LoadMap