python - Translating PostGIS query to Django QuerySet (GeoDjango) -
i trying figure out how translate postgis query geodjango uses 2 different tables, example of query need do.
select a.* county a, cd b a.state = 'virginia' , b.state = 'virginia' , b.cd114fp = '06' , st_contains(b.geom, a.geom)
this docs geodjango queries. https://docs.djangoproject.com/en/1.11/ref/contrib/gis/geoquerysets/
however, doesn't go on how more complicated query 1 above, , i'm not familiar django queryset.
geo = serialize('geojson', county.objects.filter( state="virginia" geom__intersects=cd.objects.filter(state="virginia", name="06") ))
i figured out, pretty had familiarize myself django queryset more.
Comments
Post a Comment