]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix syntax errors in tiger code and adapt format of dummy tables
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 27 Mar 2016 21:45:20 +0000 (23:45 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 27 Mar 2016 21:45:20 +0000 (23:45 +0200)
lib/Geocode.php
sql/tables.sql

index 481be133513447b4b300200653e62e0b12ab0330..d699263e2e87f21c1069bdd0f6b8e7fd7be21794 100644 (file)
                                $sSQL .= ", null as ref";
                                if ($this->bIncludeExtraTags) $sSQL .= ", null as extra";
                                if ($this->bIncludeNameDetails) $sSQL .= ", null as names";
-                               $sSQL .= ", avg(st_x(point)) as lon, avg(st_y(point)) as lat";
-                               $sSQL .= $sImportanceSQL."-1.15 as importance ";
+                               $sSQL .= ", avg(st_x(centroid)) as lon, avg(st_y(centroid)) as lat,";
+                               $sSQL .= $sImportanceSQL."-1.15 as importance ";
                                $sSQL .= ", (select max(p.importance*(p.rank_address+2)) from place_addressline s, placex p where s.place_id = min(blub.parent_place_id) and p.place_id = s.address_place_id and s.isaddress and p.importance is not null) as addressimportance ";
                                $sSQL .= ", null as extra_place ";
                                $sSQL .= " from (select place_id";
                                //interpolate the Tiger housenumbers here
-                               $sSQL .= ", ST_LineInterpolatePoint(linegeo, (housenumber_for_place-startnumber::float)/(endnumber-startnumber)::float) as point, parent_place_id, housenumber_for_place ";
+                               $sSQL .= ", ST_LineInterpolatePoint(linegeo, (housenumber_for_place-startnumber::float)/(endnumber-startnumber)::float) as centroid, parent_place_id, housenumber_for_place ";
                                $sSQL .= "from (location_property_tiger ";
                                $sSQL .= " join (values ".$sHousenumbers.") as housenumbers(place_id, housenumber_for_place) using(place_id)) ";
                                $sSQL .= " where housenumber_for_place>=0 and 30 between $this->iMinAddressRank and $this->iMaxAddressRank) as blub"; //postgres wants an alias here
index d13eee6ec0aa26c7009ec585146b7af8dc3e6cce..0434e13af8b5494d2bb0fb86f8864e7822cbac97 100644 (file)
@@ -106,10 +106,7 @@ CREATE INDEX idx_location_property_aux_parent_place_id ON location_property_aux
 CREATE INDEX idx_location_property_aux_housenumber_parent_place_id ON location_property_aux USING BTREE (parent_place_id, housenumber);
 GRANT SELECT ON location_property_aux TO "{www-user}";
 
-CREATE TABLE location_property_tiger () INHERITS (location_property) {ts:aux-data};
-CREATE INDEX idx_location_property_tiger_place_id ON location_property_tiger USING BTREE (place_id) {ts:aux-index};
-CREATE INDEX idx_location_property_tiger_parent_place_id ON location_property_tiger USING BTREE (parent_place_id) {ts:aux-index};
-CREATE INDEX idx_location_property_tiger_housenumber_parent_place_id ON location_property_tiger USING BTREE (parent_place_id, housenumber) {ts:aux-index};
+CREATE TABLE location_property_tiger (linegeo GEOMETRY, place_id BIGINT, partition INTEGER, parent_place_id BIGINT, startnumber INTEGER, endnumber INTEGER, interpolationtype TEXT, postcode TEXT);
 GRANT SELECT ON location_property_tiger TO "{www-user}";
 
 drop table IF EXISTS search_name;