In the p4d file, a Coordinate System (CS) is specified using two elements:
- wkt represents the WKT string of the horizontal CS
- verticalDef defines the vertical CS
Horizontal CS
The horizontal CS is defined by the WKT string. This is a standard used to define various geometry related structures, see WKT standard.
For purposes related to Pix4D, the WKT strings that are considered valid are the ones that define either of the following:
- Geographic horizontal system e.g. WGS84, in this case the WKT starts with GEOGCS
- Projected horizontal system e.g. UTM zone 32, in this case the WKT starts with PROJCS
- Arbitrary horizontal system, in this case the WKT starts with LOCAL_CS
Any other possible CS (e.g. compound or vertical) or geometric object is considered to be an invalid WKT string and will lead to errors in the project loading.
Getting WKT strings of standard CS
epsg.io hosts a database of EPSG registered coordinate systems which should cover most needs related to horizontal CS. For example, to select the Swiss coordinate system CH1903, one would search for it on the database and export in OGC WKT format to get the WKT string as expected by Pix4Dmapper:
PROJCS["CH1903 / LV03",GEOGCS["CH1903",DATUM["CH1903",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[674.4,15.1,405.3,0,0,0,0],AUTHORITY["EPSG","6149"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4149"]],PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],PARAMETER["latitude_of_center",46.95240555555556],PARAMETER["longitude_of_center",7.439583333333333],PARAMETER["azimuth",90],PARAMETER["rectified_grid_angle",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Y",EAST],AXIS["X",NORTH],AUTHORITY["EPSG","21781"]]
Defining custom WKT strings
If a custom coordinate system must be used, then this system should comply with the WKT standard. As already mentioned, Pix4Dmapper only supports WKT strings that start with GEOGCS, PROJCS and LOCAL_CS.
It is possible to check the validity of a custom WKT using Python and gdal with the following function:
from gdal import osr
import logging
def wkt_is_valid(wkt):
"""
Returns true iff the WKT string is considered valid by Pix4Dmapper
"""
srs = osr.SpatialReference(wkt)
if srs.IsVertical():
logging.error('Expected horizontal WKT, given vertical WKT')
return False
if srs.IsCompound():
logging.error('Expected horizontal WKT, given compound WKT, please extract the horizontal part and retry')
return False
if srs.IsProjected() or srs.IsGeographic() or srs.IsLocal():
return True
else:
logging.error('Invalid WKT, please check that the input WKT defines a valid coordinate system')
return False
Vertical CS
The vertical CS is specified in the verticalDef field as either:
-
Constant shift above the horizontal CS, geoidHeight must specify the shift to apply
e.g. <verticalDef model="constShift" geoidHeight="10"/> -
Geoid that can be either egm84, egm96 or egm2008
e.g. <verticalDef model="egm96"/> -
Arbitrary height
e.g. <verticalDef model="noConv"/>
Article feedback (for troubleshooting, post here)
0 comments