snowex_db.projection module

snowex_db.projection module#

Module for functions that handle anything regarding coordinate projections.

snowex_db.projection.add_geom(info, epsg)[source]#

Adds the WKBElement to the dictionary

Args:

info: Dictionary containing easting and northing keys epsg: integer representing the projection code

Returns:
info: Dictionary containing everything it originally did plus a geom

key with WKTElement value

snowex_db.projection.reproject_point_in_dict(info, is_northern=True, zone_number=None)[source]#

Add/ensure that northing, easting, utm_zone, latitude, longitude and epsg code are in the metadata. Default to always project the lat long (if provided) to the northing and easting.

Args:

info: Dictionary containing key northing/easting or latitude longitude is_northern: Boolean for which hemisphere this data is in zone_number: Integer for the utm zone to enforce, otherwise let utm

figure it out

Returns:
result: Dictionary containing all previous information plus a coordinates

reprojected counter part

snowex_db.projection.reproject_raster_by_epsg(input_f, output_f, epsg)[source]#

Reproject a geotiff raster from one epsg to another

Args:

input_f: Input path to a geotiff output_f: Output location of a reprojected geotiff epsg: Valid projection reference number