Created
July 26, 2011 21:04
-
-
Save andrewjennings/1108035 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: /projects/publicmapping/trunk/django/publicmapping/redistricting/models.py | |
=================================================================== | |
--- /projects/publicmapping/trunk/django/publicmapping/redistricting/models.py (revision 1404) | |
+++ /projects/publicmapping/trunk/django/publicmapping/redistricting/models.py (working copy) | |
@@ -413,19 +413,19 @@ | |
# Searching inside the boundary | |
if level != base_geolevel: | |
# Search by geometry | |
- q_geom = Q(geom__within=boundary) | |
+ q_geom = Q(geom__within=boundary.buffer(1)) | |
else: | |
# Search by centroid | |
- q_geom = Q(center__intersects=boundary) | |
+ q_geom = Q(center__intersects=boundary.buffer(1)) | |
results = Geounit.objects.filter(q_ids, q_geom) | |
else: | |
# Searching outside the boundary | |
if level != base_geolevel: | |
# Search by geometry | |
- q_geom = Q(geom__within=boundary) | |
+ q_geom = Q(geom__within=boundary.buffer(1)) | |
else: | |
# Search by centroid | |
- q_geom = Q(geom__within=boundary) | |
+ q_geom = Q(geom__within=boundary.buffer(1)) | |
results = Geounit.objects.filter(q_ids).exclude(q_geom) | |
if settings.DEBUG: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment