New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: DistanceToPointFilter #125
Comments
Should be right, provided lon and lat are two floats. You may want to take a look at the DistanceToPointFilter code to understand how it works. |
Hi, lat and lon are floats, as expected. I checked the code before asking. I'll keep trying. |
Check also the test: I tried to use this feature a while ago (more than 1 year) and I remember it worked, but since then I have not tried anymore. Since I didn't add the feature myself I can be sure the feature works correctly just as long as the test works too, assuming the test code doesn't contain an hidden flaw. Let me know what you find. |
@yamila-moreno This is just a wild guess: If you happen to run the a Spatialite database the filter won't work because Spatialite does not support Source: https://docs.djangoproject.com/en/1.10/ref/contrib/gis/db-api/#spatial-lookup-compatibility |
I have the same issue. I'm using postgis and I can't make this filter work properly. This may be related to my DB. The filter done is : queryset.filter(geometry__dwithin=('POINT(-104.590948 38.319914)', 1)) And it returns a point which is ~10 km away. I'm not sure how to debug further however. EDIT: The generated SQL is : SELECT "geodirectory_entry"."id", "geodirectory_entry"."owner_id", "geodirectory_entry"."geometry" FROM "geodirectory_entry" WHERE ("geodirectory_entry"."owner_id" = 1 AND ST_DWithin("geodirectory_entry"."geometry", ST_GeomFromEWKB('\001\001\000\000 \346\020\000\000\315\314\314\314\314,Z\300*\304#\361\362(C@'::bytea), 1.0)) |
You actually need to set
|
@Gagaro I think by default the coordinate system is WGS84 (EPSG: 4326). So the request with '1' should return all points in a circle with roughly 111 km diameter. |
Yes that was my issue. So the |
@Gagaro At least for me it works if I set Testing to look up a point at 0 lon 0 lat: In degrees 0 lon 1 lat needs distance of at least 1°. That means that Seems like everything is working as expected. |
All right, thanks the help 👍 , I'm fairly new to gis development. |
Hey people, I prefer this github issue tracker to be used as a bug-tracker. Therefore if any of you think there's a bug, please send a failing test. For questions and discussions, we have two other instruments that are very useful:
|
Hi!
I'm trying to use the DistanceToPointFilter, but I cannot get it working.
This is my code:
I've tried all the combinations with these params:
etc... Am I missing something? [The other filters are properly working]
Thanks for your help :D
The text was updated successfully, but these errors were encountered: