Table of Contents
Overview
This page describes about how to manage coordinate reference system (CRS) information within OPALS and description of python script to help some tasks.
How CRS is managed within OPALS
CRS in ODM files is stored as WKT (Well-known text) String. While OPALS deals with other data format, each file stores (maybe partial) CRS information by themselves. In case of grid datasets which are usually handled using GDAL, CRS information is stored separately in the metadata in addition to the driver supported CRS storage mechanism which are either format-supported or GDAL auxillary file. This is because some GDAL drivers (e.g. GeoTIFF) might be lossy as unrecognized items (e.g. EXTENSION) might not be stored. CRS in GDAL raster files are stored using SOURCE_CRS key in the metadata. If this CRS metadata available then this information will be used as CRS instead of CRS from GDAL.
Displaying CRS
Module Info can be used to show information from an ODM file. Additionally, displaying CRS information from ODM and grid data files (supported by GDAL) is available through Python helper script (see here ).
CRS from input files
using Module Import, CRS information is obtained using the following order :
- stored within the file or in external
.prjfile coord_ref_sysparameter
CRS in the output files
Output files generated from OPALS modules carries CRS information from its input file(s). If there are some input file that do not have CRS information stored then it is assumed that the CRS is the same as other file(s) has CRS information stored. In case where all the input files have no CRS information stored, CRS information can be manually set during modules executions via coord_ref_sys parameter. Moreover, CRS information can also be set globally in the installation-wise configuration file.
Comparing CRS
The following definitions are used when comparing CRS information.
- Empty CRS
A CRS is considered empty if it is an empty string.
- Equal CRS
- Two CRSs are considered equal if these conditions are satisfied:
- Both CRS are of the same type (the root node are
COMPD_CSandCOMPD_CS,GEOG_CSandGEOG_CS, etc.) - Both share the same parameters (for
GEOG_CS:DATUM,PRIMEM,UNIT)
- Both CRS are of the same type (the root node are
Validating CRS
Python helper scripts
a python script (_setCRS.py) is provided in the $OPALS_ROOT/packages/python directory to show or modify existing files. Another python script (_validateCRS.py) is also provided for validating CRS information given from text file containing CRS in WKT, from ODM file, or from GDAL-supported rasters.
Parameters
Remarks: optional
EPSG code representing CRS information
Remarks: optional
filename containing CRS spec in WKT format
Remarks: optional
remove all CRS contents from input file
Printing CRS information from a file
_setCRS.py script can be use to print out available CRS information from a ODM or raster file.
Above command will result in the following output
Validating CRS information from a file
To add CRS information from EPSG code, Use -e/--epsgCode parameter
To add CRS information from .prj file containing WKT string, Use -w/--wkt parameter
To add CRS information from a source file (ODM or GDAL Rasters) containing WKT string, Use -c/--copySource parameter
Validating CRS information from a file
To add CRS information from file containing WKT string, Use -w/--wkt parameter
To add CRS information from a source file (ODM or GDAL Rasters) containing WKT string, Use -i/--inFile parameter
References
-
Geographic information - Well-known text (WKT) representation of coordinate reference systems OGC 12-063r5
- Date
- 8.11.2017
