Commit Graph

319 Commits

Author SHA1 Message Date
Sarah Hoffmann
a44377c7b0 fix postcode-related tests 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
5b4bbab9be include GB CodePoint data into location_postcode table 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
413c69ddc9 improve calculation of postcode for interpolations 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
ce76a25101 merging back postcodes is no longer necessary 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
57dc0304b5 add search for postcode
Implements the 'postcode' operator.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
727bd73d0b fix typo 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
a2a1901b09 add postcodes as special items in word table 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
43869b9938 make sure postcode gets recomputed on update 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
9a86c0cebc use only computed postcode when getting address
Postcodes from address parts are now ignored as they have
been already taken into account when computing the postcode.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
d0cc4006d3 remove unused get_address_postcode function 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
dc2911ae72 normalize postcodes before adding to location tables 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
d59d57957c precompute postcodes
Set postcode column to the best guess for the postcode for
the place.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
4e792546e8 add postcode to location_area tables 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
79aa74b771 remove unused loaddata file
Load data is being done in the setup script.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
bdec4e6488 replace AddGeometryColumn() functions
Directly add the columns to the table definitions instead.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
71ddeb40a6 remove now useless getNearestPostcode function
Most postcodes are not in the location-area tables anymore.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
80ef6cbaab add indexing of artificial postcodes 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
15dbb6383c add new location_postcode table
Artifical postcode centroids are now saved in there.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
3e9fb0dc84 fix syntax typo 2017-08-14 22:34:53 +02:00
Sarah Hoffmann
2daa4ed813 add extensive debug messages for placex 2017-06-15 23:17:34 +02:00
Sarah Hoffmann
5e5713b90f Ignore postcodes with comma and semicolon when computing address
OSM has sometimes postcode lists for cities which should
simply be ignored.

Fixes #673.
2017-06-07 23:19:56 +02:00
Sarah Hoffmann
9785aff76c restrict linked places to place nodes
Avoids getting the wrong entry when the linked place has
double tagging.

Fixes #573.
2017-06-07 21:32:02 +02:00
Sarah Hoffmann
5a5691b5b7 force update of linker when linkee is updates
Potential name changes need to be added to the linker's
name hstore.

Fixes #170.
2017-06-06 23:46:44 +02:00
Sarah Hoffmann
623d58b67e Remove boundries when downgrading from polygon to line
Fixes #135.
2017-06-06 21:59:36 +02:00
Sarah Hoffmann
b9cc47ee67 Revert "use "char" type when refering to osm_type column"
This reverts commit 2dd7f0156a.
2017-06-05 09:07:47 +02:00
Sarah Hoffmann
e3fb706c65 add normalized version of special search terms on import
Requires the PHP bindings for libicu, so add that as a requirement.
2017-06-04 23:12:09 +02:00
Sarah Hoffmann
2dd7f0156a use "char" type when refering to osm_type column
When using an explicit cast to char(1) when refering to the
osm_type column postgres won't use the index in some cases.
Observed only on postgres 9.5 from the original Postgres
reporsitories.

Fixes #741.
2017-06-04 14:48:53 +02:00
Sarah Hoffmann
002fa35b92 when linking places compute maximum importance
The linker and the linkee might have different wikipedia
tags and thus different importances. Prefer the higher
value.

Fixes #562.
2017-05-30 23:36:59 +02:00
Sarah Hoffmann
bd4b1b2d08 switch from osmosis to pyosmium for updates
Pyosmium comes with convenient functions for finding the
right state and does not require external files for
rembering the state. Updates can now conveniently
set up by simply running ./utils/update.php --init-updates
and state is kept directly in the import_status table.

This change requires an update in the database schema.
Run the following to update:

ALTER TABLE import_status ADD COLUMN sequence_id integer;
ALTER TABLE import_status ADD COLUMN indexed boolean;
ALTER TABLE import_osmosis_log ADD COLUMN batchseq integer;
2017-05-25 16:26:09 +02:00
Sarah Hoffmann
d8ade1c527 remove another use of place.country_code 2017-04-23 22:46:54 +02:00
Sarah Hoffmann
4c7145c293 Merge branch 'tetris' of https://github.com/roques/Nominatim into roques-tetris 2017-04-20 20:56:44 +02:00
Christian von Roques
4d4b95923e use SMALLINT for ranks and partition; reorder columns for alignment 2017-04-19 02:18:44 +02:00
Sarah Hoffmann
166737fb76 also use address column for word count computation 2017-04-18 22:11:09 +02:00
Christian von Roques
b6be33cded explicitly name columns at INSERT 2017-04-18 13:36:02 +02:00
Sarah Hoffmann
1e30e578e0 Merge pull request #700 from lonvia/structured-address-info
Move address information into hstore column
2017-04-13 22:12:19 +02:00
Sarah Hoffmann
8138729aea use centroid for near feature search on rank 30
Rank 30 has some very large geometries (peninsulas, time zones,
etc.) for which a near feature search for the full geometry is
too expensive, so do the search on the centroid only.
2017-04-09 23:12:35 +02:00
Sarah Hoffmann
9bb81731f8 fix operator precedence for hstore 2017-04-09 10:06:31 +02:00
Sarah Hoffmann
050b0a2ced remove street and addr_place columns in placex
The information is onyl needed for parenting,
so no need to store it permanently.
2017-04-08 19:58:10 +02:00
Sarah Hoffmann
3bb903cf92 Remove street and addr_place from location_property_osmline
Derived columns are not needed because parent information is
always computed from scratch. So the columns are just duplicate
information.

Also get address information on nodes from address columns. The
other columns are not necessarily reliable when the node have not
been indexed yet.
2017-04-08 19:58:10 +02:00
Sarah Hoffmann
41afcaddd5 adapt more BDD tests to hstore 2017-04-08 19:58:09 +02:00
Sarah Hoffmann
8c7fa0213f fix DB bd tests for address hstore 2017-04-08 19:57:36 +02:00
Sarah Hoffmann
c8e79397f5 introduce address column for place tables
The column is a hstore containing the full OSM tag with key and
value.
2017-04-08 18:58:26 +02:00
Sarah Hoffmann
43eedfd253 abort osmline update correctly when way nodes are missing
Fixes #695.
2017-03-30 22:14:47 +02:00
ImreSamu
193cf66328 fix sql warnings
* ERROR:  sequence "seq_postcodes" does not exist
* ERROR:  table "import_polygon_error" does not exist
* ERROR:  table "import_polygon_delete" does not exist
* ERROR:  sequence "file" does not exist
2017-03-27 01:02:29 +02:00
Sarah Hoffmann
b3186d07f5 for roads add all intersecting boundaries to address list
When roads cross boundaries, both administrative entities should
be added to the address list, so that both entities can be used
for searching. Also allows in a second step to better sort out
addresses of POIs on such roads.

Fixes #121.
2017-03-18 12:17:48 +01:00
Sarah Hoffmann
c48fb88e6b move interpolaton computation into indexing step
The interpolaton computation needs information from the osm2pgsql
slim tables which may not be available when the data is inserted.

Insertion now only adds a line with basic address information to
location_property_osmline. The line is then split during the
indexing, leading to more lines (which are complete in that case)
being inserted.

Fixes #598.
2017-02-26 16:46:41 +01:00
Sarah Hoffmann
c897b96c41 don't delete names on unknown country boundaries
If a country boundary has a country_code that is unknown to
Nominatim, it would delete all names because the coalascing
with country_name would not yield any result.
2017-02-18 13:51:21 +01:00
Rémi BOURGAREL
8a2e401025 Change on get_addressdata check for matching the condition in placex_update
On placex_update we stop the indexing to the first parent if the rank_search is above 27. We should do the same check in get_adressdata, because place with a rank_address != 30 and a search_rank > 27 will have only 1 parent.
https://github.com/twain47/Nominatim/issues/534
2016-10-04 15:49:31 +02:00
Sarah Hoffmann
524bd47315 fill place and osmline independently for interpolations on update
interpolation lines may be missing in osmline when the interpolation
is broken, so we cannot conclude that a way is not in place, just
because there are no entries in location_property_osmline.
2016-05-28 18:18:18 +02:00
Sarah Hoffmann
8b91284f7f reintroduce addr:place for interpolation
It is perfectly valid that interpolated addresses refer to
something else than a street.

Also gets rid of the maximum interpolation size. As we don't
expand, arbitrary sizes are fine.
2016-05-15 14:24:43 +02:00
Sarah Hoffmann
94d795883f update comments and formatting 2016-05-15 12:37:20 +02:00
Sarah Hoffmann
28041cbbd9 remove duplicate index 2016-05-15 11:44:54 +02:00
Sarah Hoffmann
821949f087 get housenumber data for interpolations from place table
The placex table may not yet be filled when the interpolation
lines are computed.
2016-05-15 09:44:00 +02:00
markigail
190a72cab5 Fix bug in index.c and remove column admin_level from location_property_osmline. 2016-05-08 16:46:42 +02:00
Markus Gail
db719d489f index on geometry of interpolation lines, and more improvements. 2016-04-27 17:42:59 +02:00
Markus Gail
b03be15442 Merge remote-tracking branch 'origin/master' into osmline
Conflicts:
	lib/Geocode.php
	lib/PlaceLookup.php
	sql/functions.sql
	sql/tables.sql
	utils/setup.php
2016-04-25 11:01:04 +02:00
Markus Gail
7879ad44cd Remove interpolation lines from placex and save them in an extra table. 2016-04-25 09:44:01 +02:00
Sarah Hoffmann
a32f6c66b8 remove unused location_property_-partion- tables 2016-04-23 10:07:57 +02:00
Sarah Hoffmann
d01d0c13f4 Merge pull request #425 from lonvia/disable-aux-tables
make tables for external data (Tiger and aux) configurable
2016-04-12 23:00:24 +02:00
Sarah Hoffmann
a86563cfb1 make tables for external data (Tiger and aux) configurable
Introduces two new settings CONST_Use_US_Tiger_Data and
CONST_Use_Aux_Location_data, which are disabled by default.
When false the corresponding tables are ignored in queries
and updates.

Aux and tiger tables are no longer created by default. This
has to be done by the corresponding import scripts. The former
aux table creation can be found in sql/aux_tables.sql for
reference.
2016-04-07 21:47:51 +02:00
Sarah Hoffmann
009882999f clean up query logging
- remove query_log table, keeping only new_query_log
- drop unused import_npi_log table
- disable DB logging per default
- use file logging structure from osm.org
2016-04-07 20:37:27 +02:00
Sarah Hoffmann
02bd322c1d remove explicitly set postgres/postgis version
Get the version from the database where necessary or simply
probe for existence of features. Fake hstore_to_json when
necessary.

Bumps the minimum required versions fro postgres to 9.1 and
for postgis to 2.0.
2016-03-30 22:48:18 +02:00
Sarah Hoffmann
a0a5100807 remove unused files 2016-03-28 22:30:56 +02:00
Sarah Hoffmann
23fa6018a4 make sure linked places get recomputed when unlinked
When linked the place may not be in the search index,
so it must be reindexed when being unlinked. The status
change will only have an effect during the subsequent
update, so change tests to that effect.
2016-03-28 09:51:29 +02:00
Sarah Hoffmann
53eb9a5f14 fix syntax errors in tiger code and adapt format of dummy tables 2016-03-27 23:45:20 +02:00
Markus Gail
7dd0a63b68 Fix coding style. 2016-03-23 09:34:36 +01:00
Markus Gail
291fdd1894 Tested Version of new Tiger line storage format. 2016-03-21 14:14:01 +01:00
Markus Gail
46cef36184 Implement geocoding and reverse geocoding with tiger interpolation lines instead of points. 2016-03-21 14:14:01 +01:00
Markus Gail
bc449e10be change tiger housenumber format to save as lines instead of points and thus new interpolation 2016-03-21 14:07:12 +01:00
Sarah Hoffmann
9fb2bf36be streamline get_name_by_language()
patch by mdeweerd
2015-09-24 23:52:03 +02:00
Sarah Hoffmann
134553b184 ignore man_made objects in reverse search
fixes https://trac.openstreetmap.org/ticket/5339
2015-08-04 21:44:19 +02:00
Sarah Hoffmann
dd97528726 get rid of sector index, no longer used 2015-05-21 23:35:04 +02:00
Sarah Hoffmann
2f8a29ba39 merge addr:postcode from houses into search index of attached road
Makes house number searchable by postcode when the postcode is
only available in addr:postcode.
2015-05-08 19:34:33 +02:00
Sarah Hoffmann
4ba93dcb50 remove debug output 2015-05-06 21:51:35 +02:00
Sarah Hoffmann
6727c36298 places marked as linked should use the address of the link origin
fixes #269
2015-05-03 17:31:14 +02:00
Sarah Hoffmann
b82c8ceab9 ignore places without housenumber in interpolations
fixes trac ticket 5311
2015-04-18 17:47:49 +02:00
Sarah Hoffmann
4a3dc3187c clean out dead sql code 2015-03-30 23:43:27 +02:00
Sarah Hoffmann
2bcd1aa194 avoid calling add_location for non-addressing features 2015-03-25 22:25:03 +01:00
Sarah Hoffmann
86b4df1e81 only address features can be linked with placex 2015-03-23 22:04:43 +01:00
Sarah Hoffmann
6f98fa0fb3 interpolations: snap lines to points, not vice versa
Avoids the occasional rounding problem which might occur when splitting
a line anywhere but on a support point, see postgis doc for ST_Split.

Fixes #253
2015-03-08 18:25:51 +01:00
Sarah Hoffmann
1eb52879c6 replace final reference to way-node index with spatial lookup 2015-03-05 22:00:27 +01:00
Sarah Hoffmann
27ce2afbcf reorder parenting search for POI level
Push back the more expensive node-on-way parenting which is rather
rare anyways. Prefer assodicatedStreet relations and addr:* tags
instead.
2015-03-05 22:00:27 +01:00
Sarah Hoffmann
30f087b168 switch interpolation node to using the interpolation osm id 2015-03-05 22:00:27 +01:00
Sarah Hoffmann
1ce3307b7a fix typos and make interpolation tests run 2015-03-05 22:00:26 +01:00
Sarah Hoffmann
a25810d317 write interpolated house numbers complete out and avoid reindexing 2015-03-05 22:00:26 +01:00
Sarah Hoffmann
394a00f521 computation of parent of interpolations 2015-03-05 22:00:26 +01:00
Sarah Hoffmann
9e3e7bf791 switch remaining GRANTs to configurable web user
fixes #252
2015-03-05 21:55:20 +01:00
Sarah Hoffmann
c6d8e91b88 add script for recomputing word frequencies 2015-02-27 19:53:11 +01:00
Sarah Hoffmann
82e5a95f16 also drop interpolation index 2015-02-21 14:17:34 +01:00
Sarah Hoffmann
b41a5c962c drop unnecessary index 2015-02-19 08:07:04 +01:00
Sarah Hoffmann
5d87136969 reduce search area for secondary adresses when areas are involved 2015-02-09 19:35:15 +01:00
Sarah Hoffmann
0de6f37647 remove address lines with fully duplicated keywords
Mainly there to avoid having many duplicated postcode entries
in place_addressline from nodes which have tags where only
addr:postcode is recognized by Nominatim (e.g. fire hydrants).
2015-02-09 19:35:15 +01:00
Sarah Hoffmann
021702f190 tablespace definition belongs before the where clause 2015-01-20 20:45:16 +01:00
Sarah Hoffmann
138b8a2ada remove unused functions 2015-01-16 21:36:35 +01:00
Sarah Hoffmann
f156da6b63 support tablespaces and www user config in tiger import 2015-01-11 13:44:39 +01:00
Sarah Hoffmann
a855bfc6e5 be more restrictive with sql select when computing linked waterways 2014-12-30 22:55:24 +01:00
Sarah Hoffmann
c391479c58 reorganise table creation
- remove unused tables
- make apache user configurable
- introduce configurable tablespaces
2014-12-02 00:05:21 +01:00
Sarah Hoffmann
59de7c5a9b fix address interpolation for self-intersecting ways 2014-11-03 22:42:34 +01:00
Sarah Hoffmann
dd18e74079 remove all unidentified large areas from addresses 2014-10-08 23:33:46 +02:00
Sarah Hoffmann
8989776bfd remove most landuses from addresses 2014-10-08 20:47:32 +02:00