I have a GeoDjango web service that allows a user to upload a las file (v1.2). I can derive the extent of the point cloud coverage from the file using
from django.contrib.gis.geos import Polygon from laspy.File import File las_file = File('some/las/file', 'r') xmin = las_file.header.min ymin = las_file.header.min xmax = las_file.header.max ymax = las_file.header.max bbox = Polygon.from_bbox((xmin, ymin, xmax, ymax))
...from this polygon's extent I would like to know its map scale in cm:m (projection is EPSG:3857) so I can use Waldo Tobler's rule of resolution (i.e. resolution/cell size = scale/(1000*2)) to create a raster of the point cloud.
What is the best approach here? I thought maybe creating a map object that is zoomed to the poly then accessing a scale property (e.g.
scale = map.scale()) would be a good method but do not know of a python API available to do this... I see that QGIS for python has a scale calculator but am not sure how to implement with my project.