pyguymer3.geo

A Python sub-module containing a bunch of random geo-related functions that I have written over the years.

Notes

See the following two sources of documentation from GIS software to read a bit more about buffering:

To clarify some the geometry data types:

  • A shapely.geometry.point.Point is made up of a shapely.coords.CoordinateSequence of 1 tuple of a (lon,lat) pair.

  • A shapely.geometry.polygon.LinearRing is made up of a shapely.coords.CoordinateSequence of N tuple of (lon,lat) pairs.

  • A shapely.geometry.linestring.LineString is made up of a shapely.coords.CoordinateSequence of N tuple of (lon,lat) pairs.

  • A shapely.geometry.polygon.Polygon is made up of a shapely.geometry.polygon.LinearRing exterior (and maybe N shapely.geometry.polygon.LinearRing interiors).

  • A shapely.geometry.multipoint.MultiPoint is made up of N shapely.geometry.point.Point.

  • A shapely.geometry.multilinestring.MultiLineString is made up of N shapely.geometry.linestring.LineString.

  • A shapely.geometry.multipolygon.MultiPolygon is made up of N shapely.geometry.polygon.Polygon.

The basic call graphs for pyguymer3.geo.buffer() and pyguymer3.geo.fillin() are:

Copyright 2017 Thomas Guymer [1]

References

Modules

add_GSHHG_map_underlay(ax, /, *[, ...])

Add an underlay to a Cartopy axis from the Global Self-Consistent Hierarchical High-Resolution Geography dataset

add_NE_map_underlay(ax, /, *[, background, ...])

Add an underlay to a Cartopy axis from Natural Earth.

add_OSM_map_background(ax, midLat, res, /, *)

Add OpenStreetMap map tiles as a background to a Cartopy axis.

add_annotation(ax, locLon, locLat, ...[, ...])

Add an annotation to a Cartopy axis.

add_axis(fg, /, *[, add_coastlines, ...])

Add either a global Robinson axis or an Orthographic axis centred above a point with optionally a field-of-view based on a circle around the point on the surface of the Earth

add_map_background(ax, /, *[, debug, ...])

Add an image of a map as a background to a Cartopy axis.

area(shape, /, *[, eps, level, nIter, ...])

Find the area of a shape.

buffer(shape, dist, /, *[, debug, eps, ...])

Buffer a shape

bufferSrc

calc_angle_between_two_locs(lon1_deg, ...)

Calculate the angle between two coordinates.

calc_dist_between_two_locs(lon1_deg, ...[, ...])

Calculate the distance between two coordinates.

calc_loc_from_loc_and_bearing_and_dist(...)

Calculate the location and reverse bearing from another location and a forward bearing and a distance.

check(shape, /, *[, prefix])

Check a shape

checkSrc

clean(shape, /, *[, debug, prefix, tol])

Clean a shape

cleanSrc

clipLatitude(lat, /)

Clip latitude to be between -90° (inclusive) and +90° (inclusive)

create_image_of_points(pntLons, pntLats, ...)

Save a PNG map of a sequence of points

create_map_of_points(pntLons, pntLats, ...)

Save a PNG map of a sequence of points

en2ll(shape1, /, *[, debug, prefix, tol])

Transform from Eastings/Northings to Longitudes/Latitudes

en2llSrc

extract_lines(shape, /, *[, onlyValid])

Extract the LineStrings from the shape

extract_points(shape, /, *[, onlyValid])

Extract the Points from the shape

extract_polys(shape, /, *[, onlyValid, repair])

Extract the Polygons from the shape

fillin(shape, fill, /, *[, debug, eps, ...])

Fill in a shape

fillinSrc

find_middle_of_great_circle(lon1_deg, ...)

Calculate the middle of the great circle that connects two coordinates.

find_middle_of_locs(lons, lats, /, *[, ...])

Find the middle of some locations

find_middle_of_locsSrc

find_min_max_dist_bearing(midLon, midLat, ...)

Find the bearing which points towards the minimum maximum distance to some locations

find_point_on_great_circle(frac, lon1_deg, ...)

Calculate an arbitrary point on the great circle that connects two coordinates.

getRecordAttribute(record, attribute, /, *)

Get an attribute of a Shapefile record

great_circle(lon1, lat1, lon2, lat2, /, *[, ...])

Calculate the great circle that connects two coordinates.

ll2en(shape1, /, *[, debug, prefix, tol])

Transform from Longitudes/Latitudes to Eastings/Northings

ll2enSrc

ll2mer(shape1, /, *[, debug, prefix, tol])

Transform from Longitudes/Latitudes to Mercator fractions

ll2merSrc

max_dist(lons, lats, midLon, midLat, /, *[, ...])

max_distSrc

mer2ll(shape1, /, *[, debug, prefix, tol])

Transform from Mercator fractions to Longitudes/Latitudes

mer2llSrc

min_dist(lons, lats, midLon, midLat, /, *[, ...])

min_distSrc

wrapLongitude(lon, /)

Wrap longitude to be between -180° (inclusive) and +180° (exclusive)