gis.measure.Area

class Area(**kwargs) [source] To initialize an area object, pass in a keyword corresponding to the desired unit attribute name set with desired value. For example, the following creates an area object representing 5 square miles: >>> a = Area(sq_mi=5) __getattr__(unit_att) Returns the area value in units corresponding to the given unit attribute. For example: >>> print(a.sq_km) 12.949940551680001 classmethod unit_attname(unit_name) Returns the area unit attribut

gis.measure.A

class A Alias for Area class.

gis.geos.WKTWriter.write()

write(geom) Returns the WKT of the given geometry. Example: >>> from django.contrib.gis.geos import Point, WKTWriter >>> pnt = Point(1, 1) >>> wkt_w = WKTWriter() >>> wkt_w.write(pnt) 'POINT (1.0000000000000000 1.0000000000000000)'

gis.geos.WKTWriter.trim

trim New in Django 1.10. This property is used to enable or disable trimming of unnecessary decimals. >>> from django.contrib.gis.geos import Point, WKTWriter >>> pnt = Point(1, 1) >>> wkt_w = WKTWriter() >>> wkt_w.trim False >>> wkt_w.write(pnt) 'POINT (1.0000000000000000 1.0000000000000000)' >>> wkt_w.trim = True >>> wkt_w.write(pnt) 'POINT (1 1)'

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

gis.geos.WKTWriter.outdim

outdim See WKBWriter.outdim.

gis.geos.WKTWriter

class WKTWriter(dim=2, trim=False, precision=None) This class allows outputting the WKT representation of a geometry. See the WKBWriter.outdim, trim, and precision attributes for details about the constructor arguments. Changed in Django 1.10: The ability to pass the dim, trim, and precision arguments to the constructor was added. write(geom) Returns the WKT of the given geometry. Example: >>> from django.contrib.gis.geos import Point, WKTWriter >>> pnt = Point(1, 1)

gis.geos.WKTReader

class WKTReader Example: >>> from django.contrib.gis.geos import WKTReader >>> wkt_r = WKTReader() >>> wkt_r.read('POINT(1 1)') <Point object at 0x103a88b50>

gis.geos.WKBWriter.write_hex()

write_hex(geom) Returns WKB of the geometry in hexadecimal. Example: >>> from django.contrib.gis.geos import Point, WKBWriter >>> pnt = Point(1, 1) >>> wkb_w = WKBWriter() >>> wkb_w.write_hex(pnt) '0101000000000000000000F03F000000000000F03F'

gis.geos.WKBWriter.write()

write(geom) Returns the WKB of the given geometry as a Python buffer object. Example: >>> from django.contrib.gis.geos import Point, WKBWriter >>> pnt = Point(1, 1) >>> wkb_w = WKBWriter() >>> wkb_w.write(pnt) <read-only buffer for 0x103a898f0, size -1, offset 0 at 0x103a89930>