N
N
newvasyuki2021-01-29 13:36:25
Django
newvasyuki, 2021-01-29 13:36:25

How to load data into MultiPolygonField from OSM format?

There is a simple model

from django.contrib.gis.db import models

class City(models.Model):
    name = models.CharField(max_Length=255, unique=True)
    area = models.MultuPolygonField()


The area field stores the coordinates of the boundaries (territory) of the city, so that you can find the city, knowing the coordinates of a certain point through
City.objects.get(area__contains=Point(long,lat))
AND there is an osm file about the city downloaded from openstreetmap.org
?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newvasyuki, 2021-01-31
@newvasyuki

https://wiki.openstreetmap.org/wiki/OSMPythonTools

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question