Answer the question
In order to leave comments, you need to log in
How to query a database using Django ORM?
Good day.
Will face the problem of selecting from the database using PostgreSQL functions. Postgres has a "poly_contain_pt" function that checks whether a point is in a polygon. And there is data: polygon points.
There is a record model, of the form:
class Record:
name = models.CharField(max_length=255)
location = LocationField()
SELECT * FROM record
WHERE poly_contain_pt(
POLYGON(PATH '((56,28),(56,30),(55,31),(54,31),(54,32),(53,32),(53,33),(52,32,(52,32))'),
POINT(location[2], location[1])
);
Answer the question
In order to leave comments, you need to log in
Django + PostGIS = https://docs.djangoproject.com/en/2.2/ref/contrib/...
Crossed together wonderfully. Immediately and the corresponding fields in the models and geo-methods are available without dancing with a tambourine. Calculation of the occurrence of a point in a figure and so on - at a time. I did. So you can not fence your own. Well, if you really want to.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question