pyguymer3.geo.create_image_of_points¶
- pyguymer3.geo.create_image_of_points(pntLons, pntLats, zoom, sess, pngOut, /, *, background=(255, 255, 255), chunksize=1048576, cookies=None, debug=True, drawGreatCircles=True, drawPointBuffers=False, drawPoints=True, eps=1e-12, exiftoolPath=None, fillColor=(255, 0, 0), gifsiclePath=None, globalExtent=False, globalRatio=1.7777777777777777, headers=None, jpegtranPath=None, nAng=9, nIter=100, onlyValid=False, optipngPath=None, padDist=22224.0, prefix='.', ramLimit=1073741824, repair=False, route=None, routeFillColor=(0, 128, 0), scale=1, skipFillColor=(255, 165, 0), skips=None, thunderforestKey=None, thunderforestMap='atlas', timeout=60.0, tol=1e-10, verify=True)[source]¶
Save a PNG map of a sequence of points
This function accepts a sequence of longitudes and latitudes then saves a PNG map containing all of them drawn together in a big line.
- Parameters:
pntLons (numpy.ndarray) – the sequence of longitudes
pntLats (numpy.ndarray) – the sequence of latitudes
zoom (int) – the OpenStreetMap zoom level
sess (requests.Session) – the session for any requests calls
pngOut (str) – the name of the output PNG
background (tuple of int, optional) – the background colour of the merged tile
chunksize (int, optional) – the size of the chunks of any files which are read in (in bytes)
cookies (dict, optional) – extra cookies for any requests calls
debug (bool, optional) – print debug messages and draw the circle on the axis
drawGreatCircles (bool, optional) – whether to draw the great circles between the points
drawPointBuffers (bool, optional) – whether to draw the buffers around the points
drawPoints (bool, optional) – whether to draw the points
eps (float, optional) – the tolerance of the Vincenty formula iterations
exiftoolPath (str, optional) – the path to the “exiftool” binary (if not provided then Python will attempt to find the binary itself)
fillColor (tuple of int, optional) – the fill colour of the points
gifsiclePath (str, optional) – the path to the “gifsicle” binary (if not provided then Python will attempt to find the binary itself)
globalExtent (bool, optional) – whether to override the calculation of the extent of the points and just make the image of global extent
globalRatio (float, optional) – the ratio to make the image when it is global extent (because the Mercator projection looks silly at the poles)
headers (dict, optional) – extra headers for any requests calls
jpegtranPath (str, optional) – the path to the “jpegtran” binary (if not provided then Python will attempt to find the binary itself)
nAng (int, optional) – the number of angles around the middle location to search over
nIter (int, optional) – the maximum number of iterations (particularly the Vincenty formula)
onlyValid (bool, optional) – only return valid Polygons (checks for validity can take a while, if being called often)
optipngPath (str, optional) – the path to the “optipng” binary (if not provided then Python will attempt to find the binary itself)
padDist (float, optional) – the padding to draw around the points (in metres)
prefix (str, optional) – change the name of the output debugging CSVs
ramLimit (int, optional) – the maximum RAM usage of each “large” array (in bytes)
repair (bool, optional) – attempt to repair invalid Polygons
route (shapely.geometry.linestring.LineString, optional) – an extra line to draw on the map
routeFillColor (tuple of int, optional) – the fill colour of the extra route
scale (int, optional) – the scale of the tiles
skipFillColor (tuple of int, optional) – the fill colour of the skipped points
skips (numpy.ndarray, optional) – an array of booleans as to whether to include/exclude each individual point from calculating the image’s field-of-view (this allows the great circles from flights to be drawn but for them to not expand the image to fit in the departing airport); if not provided then all points are used
thunderforestKey (string, optional) – your personal API key for the Thunderforest service (if provided then it is assumed that you want to use the Thunderforest service)
thunderforestMap (string, optional) – the Thunderforest map style (see https://www.thunderforest.com/maps/)
timeout (float, optional) – the timeout for any requests/subprocess calls (in seconds)
tol (float, optional) – the Euclidean distance that defines two points as being the same (in degrees)
verify (bool, optional) – verify the server’s certificates for any requests calls
Notes
Copyright 2017 Thomas Guymer [1]
References