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:

1
2
3
>>> 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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.