]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 18 Apr 2015 16:40:31 +0000 (18:40 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 18 Apr 2015 16:40:31 +0000 (18:40 +0200)
sql/functions.sql
tests/features/db/import/interpolation.feature
tests/steps/db_setup.py

index a5d0f6a02c742392843b396f6db90fda4ee09a12..898cdb69530daefaee4f5faa2759e5fb24193830 100644 (file)
@@ -689,7 +689,7 @@ BEGIN
     -- one with the smallest id because the original node was created first.
     -- Ignore all nodes marked for deletion. (Might happen when the type changes.)
     select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::BIGINT
-                               and indexed_status < 100
+                               and indexed_status < 100 and housenumber is not NULL
                          order by (type = 'address'),place_id limit 1 INTO nextnode;
     IF nextnode.place_id IS NOT NULL THEN
 
index 8fb3e606531d65decaa99e59cabfd8d3d53c0e7b..195cbfdf27cff359654e5ac88776d468ccdcf8ec 100644 (file)
@@ -422,3 +422,20 @@ Feature: Import of address interpolations
           | 4            | 144.963016723312,-37.7629464422819+-0.000005
           | 8            | 144.9631440856,-37.762223694978+-0.000005
 
+    Scenario: Place with missing address information
+        Given the place nodes
+          | osm_id | class   | type   | housenumber | geometry
+          | 1      | place   | house  | 23          | 0.0001 0.0001
+          | 2      | amenity | school |             | 0.0001 0.0002
+          | 3      | place   | house  | 29          | 0.0001 0.0004
+        And the place ways
+          | osm_id | class | type   | housenumber | geometry
+          | 1      | place | houses | odd         | 0.0001 0.0001,0.0001 0.0002,0.0001 0.0004
+        And the ways
+          | id | nodes
+          | 1  | 1,2,3
+        When importing
+        Then way 1 expands to housenumbers
+          | housenumber | centroid
+          | 25          | 0.0001,0.0002
+          | 27          | 0.0001,0.0003
index 14f17756b2a54d98648995fb3f7875a35ff69a46..e1315ed95a74f65dbe9c2ab7cd994d4d3d9b24be 100644 (file)
@@ -95,6 +95,9 @@ def _format_placex_cols(cols, geomtype, force_name):
         else:
             coords = "'%s'::geometry" % coords.wkt
         cols['geometry'] = coords
+    for k in cols:
+        if not cols[k]:
+            cols[k] = None
 
 
 def _insert_place_table_nodes(places, force_name):