Browse files

check resulting geometry is a polygon of some type

git-svn-id: b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
  • Loading branch information...
1 parent f3d647d commit 3643c02947a95d903eaf176fc4c4ecf8079190ba twain committed Sep 9, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 gazetteer/gazetteer-functions.sql
2 gazetteer/gazetteer-functions.sql
@@ -650,7 +650,7 @@ BEGIN
FOR lon IN xmin..(xmax-1) LOOP
FOR lat IN ymin..(ymax-1) LOOP
secgeo := st_intersection(geometry, ST_SetSRID(ST_MakeBox2D(ST_Point(lon,lat),ST_Point(lon+1,lat+1)),4326));
- IF NOT ST_IsEmpty(secgeo) THEN
+ IF NOT ST_IsEmpty(secgeo) AND ST_GeometryType(secgeo) in ('ST_Polygon','ST_MultiPolygon') THEN
INSERT INTO location_area values (place_id, country_code, name, keywords,
rank_search, rank_address, ST_Centroid(geometry),
st_intersection(geometry, ST_SetSRID(ST_MakeBox2D(ST_Point(lon,lat),ST_Point(lon+1,lat+1)),4326))

0 comments on commit 3643c02

Please sign in to comment.