GiD - The personal pre and post processor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

GiD_Raster create|interpolate
To create from the mesh a raster (2D grid) with a value that represents the z, and use a raster to efficiently interpolate values to other points or all points of other raster.


A raster is defined with a Tcl list of the following data:
<ncols> <nrows> <xllcenter> <yllcenter> <xcellsize> <ycellsize> <nodata_value> <values>
ncols, nrows are the number of columns and rows of values (representing values on center of cells)
xllcenter,yllcenter are the x,y coordinates of the lower-left corner
xcellsize, ycellsize are the x,y sizes of the cells, usually the same value (compulsory to be exported as ArcInfo grid ASCII)
<nodata_value> is the special value to represent that the data doesn't exists (usually -9999.0 for ArcInfo grid ASCII)
<values> is an objarray of (ncols x nrows) doubles with the scalar value to be represented, usually the z of the x,y node.


GiD_Raster create {nodes <xyz_nodes>} ?{<cellsize>}{<ncols> <nrows>}|{<ncols> <nrows> <xllcenter> <yllcenter> <xcellsize> <ycellsize> <nodata_value>}?
To create a raster from a cloud of 3D nodes
<xyz> must be an objarray of doubles with "x1 y1 z1 ... xn yn zn" values of a cloud of coordinates.
z data will be extrapolated to grid with and averaged value of the near nodes

GiD_Raster create {nodes <xyz_nodes>}
The raster will be created with automatic number of rows, columns and limits

GiD_Raster create {nodes <xyz_nodes>} {<cellsize>}
The raster will be created with the specified cell size, equal for x and y, and automatic number of columns, rows, and limits

GiD_Raster create {nodes <xyz_nodes>} {<ncols> <nrows>}
The raster will be created with the specified number of columns and rows, and automatic limits

GiD_Raster create {nodes <xyz_nodes>} {<ncols> <nrows> <xllcenter> <yllcenter> <xcellsize> <ycellsize><nodata_value>}
The raster will be created with the specified number of columns and rows, lower-left center, cell sizes and no data value.


GiD_Raster create {triangles <xyz_nodes> <elements>} ?{<cellsize>}{ncols nrows}|{ncols nrows <xllcenter> <yllcenter> <xcellsize> <ycellsize> <nodata_value>}?
To create a raster from a irregular mesh of 3D triangles
<xyz> must be an objarray of doubles with "x1 y1 z1 ... xn yn zn" values of a the node's coordinates.
<elements> must be an objarray of integers with the index (starting by 1) or the 3 nodes of each triangle. "t1_1 t1_2 t1_3 .. tn_1 tn_2 tn_3"
z data will be extrapolated to grid finding the triangle that contain the coordinate in 2D projection, or a near node.

GiD_Raster create {triangles <xyz_nodes> <elements>}
The raster will be created with automatic number of rows, columns and limits

GiD_Raster create {triangles <xyz_nodes> <elements>} {<cellsize>}
The raster will be created with the specified cell size, equal for x and y, and automatic number of columns, rows, and limits

GiD_Raster create {triangles <xyz_nodes> <elements>} {<ncols> <nrows>}
The raster will be created with the specified number of columns and rows, and automatic limits

GiD_Raster create {triangles <xyz_nodes> <elements>} {<ncols> <nrows> <xllcenter> <yllcenter> <xcellsize> <ycellsize> <nodata_value>}
The raster will be created with the specified number of columns and rows, lower-left center, cell sizes and no data value.

GiD_Raster interpolate ?-closest? <raster_interpolation> {nodes <xy_nodes>}|{raster <raster_to_interpolate_without_data>}
To use <raster_interpolation> to calculate interpolated values of a collection of 2D nodes or all grid nodes of another raster
It returns and obj_array of doubles with the interpolated value for each node
<xy_nodes> list of x y coordinates "x1 y1 ... xn yn" of the points to interpolate the value
<raster_to_interpolate_without_data> another raster (its values could be a emtpy objarray)

If -closest flag is set, then instead interpolate it get the value of the closest grid node (interesting to map non-continous integer values)

Some auxiliary Tcl procedures:
GIS::GetRasterFromTriangles { {cellsize 0.0} }
It returns a raster from the current mesh of triangles. If cellsize is not specified an automatic value is used

GIS::GetRasterFromNodes { {cellsize 0.0} }
It returns a raster from the current mesh nodes. If cellsize is not specified an automatic value is used

GIS::SubsampleRaster { raster increment show_advance_bar }
It returns a new raster subsampling the input raster jumping columns and row by increment
show_advance_bar must be 1 to show and advancing bar during the process

GIS::ImportRaster_Geometry { raster show_advance_bar }
It creates geometrical surfaces (and its lines and points) from the raster

GIS::ImportRaster_Mesh { raster show_advance_bar }
It creates mesh quadrilaterals (and its nodes) from the raster

GIS::SaveRaster_ArcInfoASCII { raster filename }
It saves the raster in the file named filename with ArcInfo grid ASCII format

GDAL::ReadRaster { filename show_advance_bar }
It return a raster with from the file named filename.
The format could be some raster geospatial data format allowed by the GDAL (Geospatial Data Abstraction Library).
Some of them are: ArcInfo, geotiff, png, jpg, and much more.

  • No labels