Module: safe.storage.projection
Class projection
-
class safe.storage.projection.Projection(p)[source]
Represents projections associated with layers
-
get_projection(proj4=False)[source]
Return projection
- Args:
- proj4: If True, projection will be returned in proj4 format.
If False (default) projection will be returned in WKT
format
- Note:
- To compare projections, use the __eq__ method directly on the
projection objects: E.g.
self.projection == other.projection
-
safe.storage.projection.proj4_to_dict(P)[source]
Helper to turn a proj4 string into a dictionary for ease of comparison
See issue #304
- Args:
- P: proj4 string, such as +proj=longlat +ellps=WGS84 +no_defs
- Returns
- dictionary of individual elements, e.g. {‘+proj’: ‘longlat’,
- ‘+ellps’: ‘WGS84’,
‘+no_defs’: ‘’}
This module forms part of the InaSAFE tool.