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.Pointis made up of ashapely.coords.CoordinateSequenceof 1tupleof a (lon,lat) pair.A
shapely.geometry.polygon.LinearRingis made up of ashapely.coords.CoordinateSequenceof Ntupleof (lon,lat) pairs.A
shapely.geometry.linestring.LineStringis made up of ashapely.coords.CoordinateSequenceof Ntupleof (lon,lat) pairs.A
shapely.geometry.polygon.Polygonis made up of ashapely.geometry.polygon.LinearRingexterior (and maybe Nshapely.geometry.polygon.LinearRinginteriors).A
shapely.geometry.multipoint.MultiPointis made up of Nshapely.geometry.point.Point.A
shapely.geometry.multilinestring.MultiLineStringis made up of Nshapely.geometry.linestring.LineString.A
shapely.geometry.multipolygon.MultiPolygonis made up of Nshapely.geometry.polygon.Polygon.
The basic call graphs for pyguymer3.geo.buffer() and
pyguymer3.geo.fillin() are:
pyguymer3.geo.buffer()calls:pyguymer3.geo.bufferSrc.buffer_CoordinateSequence()(this is the only function that actually does any buffering, as evidenced by it not calling any otherbufferSrcfunctions)pyguymer3.geo._buffer_points_crudely()pyguymer3.geo._points2polys()
pyguymer3.geo.bufferSrc.buffer_LinearRing()calls:pyguymer3.geo.bufferSrc.buffer_LineString()calls:pyguymer3.geo.bufferSrc.buffer_MultiLineString()calls:pyguymer3.geo.bufferSrc.buffer_MultiPoint()calls:pyguymer3.geo.bufferSrc.buffer_MultiPolygon()calls:pyguymer3.geo.bufferSrc.buffer_Point()calls:pyguymer3.geo.bufferSrc.buffer_Polygon()calls:
-
pyguymer3.geo.fillinSrc.fillin_CoordinateSequence()(this is the only function that actually does any filling in, as evidenced by it not calling any otherfillinSrcfunctions)pyguymer3.geo.fillinSrc.fillin_LinearRing()calls:pyguymer3.geo.fillinSrc.fillin_LineString()calls:pyguymer3.geo.fillinSrc.fillin_MultiLineString()calls:pyguymer3.geo.fillinSrc.fillin_MultiPolygon()calls:pyguymer3.geo.fillinSrc.fillin_Polygon()calls:
Copyright 2017 Thomas Guymer [1]
References
Modules
|
Add an underlay to a Cartopy axis from the Global Self-Consistent Hierarchical High-Resolution Geography dataset |
|
Add an underlay to a Cartopy axis from Natural Earth. |
|
Add OpenStreetMap map tiles as a background to a Cartopy axis. |
|
Add an annotation to a Cartopy axis. |
|
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 an image of a map as a background to a Cartopy axis. |
|
Find the area of a shape. |
|
Buffer a shape |
|
Calculate the angle between two coordinates. |
|
Calculate the distance between two coordinates. |
Calculate the location and reverse bearing from another location and a forward bearing and a distance. |
|
|
Check a shape |
|
Clean a shape |
|
Clip latitude to be between -90° (inclusive) and +90° (inclusive) |
|
Save a PNG map of a sequence of points |
|
Save a PNG map of a sequence of points |
|
Transform from Eastings/Northings to Longitudes/Latitudes |
|
Extract the LineStrings from the shape |
|
Extract the Points from the shape |
|
Extract the Polygons from the shape |
|
Fill in a shape |
|
Calculate the middle of the great circle that connects two coordinates. |
|
Find the middle of some locations |
|
Find the bearing which points towards the minimum maximum distance to some locations |
|
Calculate an arbitrary point on the great circle that connects two coordinates. |
|
Get an attribute of a Shapefile record |
|
Calculate the great circle that connects two coordinates. |
|
Transform from Longitudes/Latitudes to Eastings/Northings |
|
Transform from Longitudes/Latitudes to Mercator fractions |
|
|
|
Transform from Mercator fractions to Longitudes/Latitudes |
|
|
|
Wrap longitude to be between -180° (inclusive) and +180° (exclusive) |