]> git.openstreetmap.org Git - nominatim.git/blobdiff - sql/functions.sql
Merge pull request #1151 from mtmail/documentation-for-details-endpoint
[nominatim.git] / sql / functions.sql
index ae6c73df850de9967c22dbcc6408d4dc5ca8544a..024d1caa9857574358e4601b416c040eef8f9af7 100644 (file)
@@ -864,6 +864,10 @@ BEGIN
         SELECT * FROM get_postcode_rank(NEW.country_code, NEW.address->'postcode')
           INTO NEW.rank_search, NEW.rank_address;
 
+        IF NOT ST_GeometryType(NEW.geometry) IN ('ST_Polygon','ST_MultiPolygon') THEN
+            NEW.rank_address := 0;
+        END IF;
+
     ELSEIF NEW.class = 'place' THEN
       IF NEW.type in ('continent') THEN
         NEW.rank_search := 2;