gis.db.models.MakeLine

class MakeLine(geo_field)

Availability: PostGIS, SpatiaLite

Returns a LineString constructed from the point field geometries in the QuerySet. Currently, ordering the queryset has no effect.

Changed in Django 1.10:

SpatiaLite support was added.

Example:

>>> qs = City.objects.filter(name__in=('Houston', 'Dallas')).aggregate(MakeLine('poly'))
>>> print(qs['poly__makeline'])
LINESTRING (-95.3631510000000020 29.7633739999999989, -96.8016109999999941 32.7820570000000018)
doc_Django
2016-10-09 18:37:32
Comments
Leave a Comment

Please login to continue.