Closed elcolie closed 3 years ago
Not really... what would it need? Custom Filter subclasses?
Yes and it receive 2 inputs at the same time. I had read the doc. It does receive only 1 input at a time
@carltongibson @elcolie Also looking into some GeoDjango functionality, specifically a PointField (or MultiPointField) with a circular radius around (each) point. It really helps when using with location based apps. I'd be willing to help, but Carlton knows much more about Django than me, so I'd like some assistance in knowing what to write before starting a draft PR.
Some pointers that we could do for the (Multi)PolygonField would be distance from, within, or on the edge. Not sure about the LineStringField.
I guess some issues with supporting GeoDjango is the extent of it all. I had a lot of confusion when programming my first geolocation-based app with Django, so clear communication would be necessary for Django-filters.
I guess another issue would be which database to allow in tests/settings.py for geolocation development. For most people, that'd be using PostGIS (we can add the geolocation database in runtests.py
by adding an arg for database name). Setting up Travis won't be a problem (although, should we test on multiple Postgres and/or Postgis versions? Not entirely supportive of SQLite geolocation extension...).
Idk, thoughts? Like how would I/we go about this? I'd much rather have the geolocation functionality in the main repo rather than in a plug-in repo so that everything is simultaneously updated.
OK... SO...
A django-filter Filter
is (at most):
?center_point=LAT:LONG
— You tell me. GeoDjango ships widgets. queryset.filter(field_name=value)
— so what does that look like if you're just doing it by hand in your view? So some examples. And then what of those are needed?
Thanks for the reply! I think I was more focused on url encoded filtering and basically neglecting forms -- the ui -- altogether. Addressing points:
?point__within=LON:LAT:RADIUS
with an additional query string for units (if using django.contrib.gis.measure.Distance
) like units=m
. Another option to not need the units query string would be to have a default, overridable setting (not sure if that's already part of GeoDjango).intersect
another (multi)polygon. In that case, the user input would be something like a LineString in which you input the vertices of the polygon. We could raise an exception if the polygon doesn't actually form (I think creating a Polygon itself would raise an exception if input was incorrect).
Polygon([(0,0), (1,2), (3,4), (0,0)])
. Weird case is multipolygon.django.contrib.gis.geos
type doesn't seem too difficult... at least based on what I've been seeing. For a polygon, input an array of values. The Point is just xy(z).request.GET
to fill out a filter query?I'm not too well versed about the Django widgets, so I'm not too well aware about their methods of mapping out the multitude of field lookups for GeoDjango (within, covers, intersects, etc.).
Do you have plan to support
postgis
? For example search that read thepoint
anddistance
at the same time