:py:mod:`gnome.utilities.geometry.geo_routines` =============================================== .. py:module:: gnome.utilities.geometry.geo_routines Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.geometry.geo_routines.geo_area_of_polygon gnome.utilities.geometry.geo_routines.triangulate_poly gnome.utilities.geometry.geo_routines.poly_area_weight gnome.utilities.geometry.geo_routines.mixed_polys_to_polygon gnome.utilities.geometry.geo_routines.check_valid_polygon gnome.utilities.geometry.geo_routines.random_pt_in_tri gnome.utilities.geometry.geo_routines.load_shapefile Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.utilities.geometry.geo_routines.geod .. py:data:: geod .. py:function:: geo_area_of_polygon(poly) :param poly: :type poly: shapely or geojson MultiPolygon or Polygon :return: area of polygon in m^2 .. py:function:: triangulate_poly(poly) :param poly: shapely or geojson MultiPolygon or Polygon :return: list of shapely.Polygon (triangles) .. py:function:: poly_area_weight(polys, geo_area=False) :param polys: iterable of shapely.Polygon :param geo_area: If true, calculates using geo area (slower, more accurate) .. py:function:: mixed_polys_to_polygon(polys) :param polys: iterable containing mixed Polygon and MultiPolygon :return: iterable of shapely.Polygon .. py:function:: check_valid_polygon(poly) checks that a shapely Polygon object at least has valid values for coordinates .. py:function:: random_pt_in_tri(tri) .. py:function:: load_shapefile(filename, transform_crs=True) Use GeoPandas to load up a shapefile into a FeatureCollection :param filename: string path of a zip file :param transform_crs: attempts to read the .prj file if any and convert to EPSG:4326 :return: geojson.FeatureCollection