def __init__(self, w_lng=180.0, s_lat=90.0, e_lng=-180.0, n_lat=-90.0):
"""
IMPORTANT: Initialization arguments are ordered w, s, e, n in order
to accept arguments from a GEOSGeometry extent, which is a 4-tuple
consisting of (xmin, ymin, xmax, ymax). This makes it easy to
initialize bounds directly, e.g.:
>>> from django.contrib.gis.geos import Polygon
>>> polygon = Polygon(((0, 0), (0, 1), (1, 1), (1, 0), (0, 0)))
>>> bounds = Bounds(*polygon.extent)
"""
self._n_lat = n_lat
self._s_lat = s_lat
self._e_lng = e_lng
self._w_lng = w_lng
# TODO(LH): add validations for lat/lng values
评论列表
文章目录