A georeference corner is a North-oriented georeference that used during rasterization of vector data or as the North-oriented georeference to which raster maps can be resampled. Georeference corners stores minimum and maximum XY-coordinates, and whether these refer to the corners of the corner pixels or to the centers of the corner pixels using following expressions:
- Col = a1 X + b1
- Row = a2 Y + b2
When a coverage displayed in a map panel, ILWIS uses a georeference depending on the type of the coverage. For example, when a raster map displayed, the map panel uses the georeference of the raster map while for a feature coverage it uses an internal georeference created from the feature coverage coordinate system and its boundaries.
A georeference corner can be created via ILWIS-Python editor or can be directly created using ILWIS 4 user interface/create toolbox tab.
Using the ILWIS-Python editor to create a new georeference including a coordinate system, purely from scratch; the following inputs are required:
- Type of georeference
- EPSF code of the coordinate system used by georeference
- An envelope contains minimum and maximum x and y coordinates of uper left and lower right corners
- Grid size (x and y)
- A name for the new coordinate system
name of the output georeference= ilwis.GeoReference(type of georeference , EPSF code number of the coordinate system, x and y grid size, a name for the coordinate system)
Example below is used to create a georeference of 1800x1380 grid size with a new coordinate system called "ethnew".
georef = ilwis.GeoReference("code=georef:type=corners,csy=epsg:4326,envelope= 32.991677775048 14.900003906339 47.991678557359 3.400003306568, gridsize=1800 1380, cornerofcorners=yes, name=ethnew")
After you have created a new georeference you can assign it to a raster coverage by using "setGeoReference()" syntax. Note that the grid size of the georeference must match the grid size of the raster coverage, otherwise a new empty raster will be created with the new grid size. In tis example, assume that your raster coverage available in Python is called "raster".