lmpy.data_wrangling.occurrence.coordinate_conversion_wrangler

Module containing a coordinate converter modifier.

Module Contents

Classes

CoordinateConverterWrangler

Constructor for CoordinateConverterModifier class.

Functions

get_srs_for_epsg(epsg)

Get a osr.SpatialReference for the specified EPSG code.

class lmpy.data_wrangling.occurrence.coordinate_conversion_wrangler.CoordinateConverterWrangler(target_epsg, source_epsg=None, epsg_attribute=None, original_x_attribute=None, original_y_attribute=None, **params)[source]

Bases: lmpy.data_wrangling.occurrence.base._OccurrenceDataWrangler

Constructor for CoordinateConverterModifier class.

Parameters
  • target_epsg (int) – Target map projection specified by EPSG code.

  • source_epsg (int or None) – Source map projection specified by EPSG code.

  • epsg_attribute (str or None) – A point attribute containing EPSG code.

  • original_x_attribute (str or None) – An attribute to store the original x value.

  • original_y_attribute (str or None) – An attribute to store the original y value.

  • **params (dict) – Extra parameters to be sent to the base class.

name = CoordinateConverterWrangler[source]
version = 1.0[source]
_modify_point(self, point)[source]

Transform the point coordinates.

Parameters

point (Point) – The point object to modify.

Returns

A modified (or not) Point and boolean indicating if it was

modified.

Return type

Point and bool

_pass_condition(self, point)[source]

Pass condition for coordinate conversion.

Parameters

point (Point) – A point object to assess.

Returns

Indication if the point passes the test condition.

Return type

bool

lmpy.data_wrangling.occurrence.coordinate_conversion_wrangler.get_srs_for_epsg(epsg)[source]

Get a osr.SpatialReference for the specified EPSG code.

Parameters

epsg (int) – An EPSG code to get the SpatialReference for.

Returns

A spatial reference object for the EPSG.

Return type

SpatialReference