gis.widgets.BaseGeometryWidget.display_raw

BaseGeometryWidget.display_raw Boolean value specifying if a textarea input showing the serialized representation of the current geometry is visible, mainly for debugging purposes (default is False).

gis.widgets.BaseGeometryWidget

class BaseGeometryWidget This is an abstract base widget containing the logic needed by subclasses. You cannot directly use this widget for a geometry field. Note that the rendering of GeoDjango widgets is based on a template, identified by the template_name class attribute. OpenLayersWidget

gis.widgets.BaseGeometryWidget.supports_3d

BaseGeometryWidget.supports_3d Indicates if the widget supports edition of 3D data (default is False).

gis.measure.Distance.__getattr__()

__getattr__(unit_att) Returns the distance value in units corresponding to the given unit attribute. For example: >>> print(dist.km) 8.04672

gis.measure.D

class D Alias for Distance class.

gis.utils.mapping()

mapping(data_source, geom_name='geom', layer_key=0, multi_geom=False)

gis.utils.LayerMapping

class LayerMapping(model, data_source, mapping, layer=0, source_srs=None, encoding=None, transaction_mode='commit_on_success', transform=True, unique=True, using='default') The following are the arguments and keywords that may be used during instantiation of LayerMapping objects. Argument Description model The geographic model, not an instance. data_source The path to the OGR-supported data source file (e.g., a shapefile). Also accepts django.contrib.gis.gdal.DataSource instances. mapping A

gis.measure.Distance

class Distance(**kwargs) [source] To initialize a distance object, pass in a keyword corresponding to the desired unit attribute name set with desired value. For example, the following creates a distance object representing 5 miles: >>> dist = Distance(mi=5) __getattr__(unit_att) Returns the distance value in units corresponding to the given unit attribute. For example: >>> print(dist.km) 8.04672 classmethod unit_attname(unit_name) Returns the distance unit attr

gis.utils.LayerMapping.save()

LayerMapping.save(verbose=False, fid_range=False, step=False, progress=False, silent=False, stream=sys.stdout, strict=False) The save() method also accepts keywords. These keywords are used for controlling output logging, error handling, and for importing specific feature ranges. Save Keyword Arguments Description fid_range May be set with a slice or tuple of (begin, end) feature ID’s to map from the data source. In other words, this keyword enables the user to selectively import a subset ra

gis.geos.WKTWriter.precision

precision New in Django 1.10. This property controls the rounding precision of coordinates; if set to None rounding is disabled. >>> from django.contrib.gis.geos import Point, WKTWriter >>> pnt = Point(1.44, 1.66) >>> wkt_w = WKTWriter() >>> print(wkt_w.precision) None >>> wkt_w.write(pnt) 'POINT (1.4399999999999999 1.6599999999999999)' >>> wkt_w.precision = 0 >>> wkt_w.write(pnt) 'POINT (1 2)' >>> wkt_w.precision = 1