Skip to content

Commit 10da6f1

Browse files
committed
bugfix: postgis layer work with geometry columns other than 'way'
1 parent 87c8b8d commit 10da6f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kartograph/layersource/postgislayer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_features(self, filter=None, bbox=None, verbose=False, ignore_holes=False
5050
# Check for intersection with bounding box
5151
bbox_coords = (bbox[0], bbox[2], bbox[1], bbox[2], bbox[1], bbox[3], bbox[0], bbox[3], bbox[0], bbox[2])
5252
bbox_poly = 'POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))' % bbox_coords
53-
query = "(%s) AND ST_Intersects( way, ST_SetSRID(ST_GeomFromEWKT('%s'), 4326) )" % (query, bbox_poly)
53+
query = "(%s) AND ST_Intersects( %s, ST_SetSRID(ST_GeomFromEWKT('%s'), 4326) )" % (query, self.geom_col, bbox_poly)
5454

5555
# print "reading from postgis database / " + self.query
5656

0 commit comments

Comments
 (0)