#9745 closed (fixed)
Add support of PostGIS's SnapToGrid function
Reported by: | norn | Owned by: | jbronn |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Keywords: | postgis | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'd like to have support of SnapToGrid function from PostGIS. I made patch and it works for me. I believe it is simple enough to be implemented in trunk.
Attachments (2)
Change History (10)
by , 16 years ago
Attachment: | snaptogrid.diff added |
---|
comment:1 by , 16 years ago
Needs tests: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
I'm +1 on having this feature in GeoDjango. However, we'll have to talk about implementation details -- I see you have this done on the geometry in-place rather than attaching a new geometry on the GeoQuerySet
(otherwise you could've just used the _geom_attribute
method to simplify the implementation). I wonder if this option should be an option for all methods, e.g., GeoModel.objects.intersection(other, in_place=True)
.
Also, I'll need tests before including it trunk, but otherwise it's a very good start. Thanks for contributing.
comment:2 by , 16 years ago
'In place' method was chosen because I have a need of chaining snaptogrid after transform().
Also I am interested in filtering out records with empty geometry field after snapping, but I have no idea how to implement it in effective way (avoiding double calculation in SQL).
I think your decision about in_place is quite useful and will allow building longer chains.
comment:4 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:5 by , 16 years ago
milestone: | → 1.1 |
---|
comment:6 by , 16 years ago
Now that values()
and defer()
work, there's really no need to do the in_place
option anymore.
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
SnapToGrid support patch against django-1.0.2-final