[Fixed]-Django django.contrib.gis.db MultiPolygonField extract points

1👍

Ok, this is so stupid. There is no good documentation?!

I found the solution in someones post from 2009 http://www.paolocorti.net/2009/04/01/a-day-with-geodjango/ . It is like:

class LocationPolygon(models.Model):
    mpoly = models.MultiPolygonField(srid=4326, null=False, blank=False)
    objects = models.GeoManager()

    def get_tooltip_title(self):
        return str(self.mpoly.coords)

0👍

Though geodjango MultiPolygon isn’t very well documented, mysql multipolygon is

A MultiPolygon is a MultiSurface object composed of Polygon elements.

MultiPolygon Examples

On a region map, a MultiPolygon could represent a system of lakes.

The postgis MultiPolygon is also very well documented with a few visual examples.

Basically a MultiPolygon is a collection of elements that may touch but not intersect.

👤e4c5

Leave a comment