Commit Graph

251 Commits

Author SHA1 Message Date
Sarah Hoffmann
d732dc3bb2 update place address levels
Adds province and allotments and downgrades hamlet.
2020-01-08 23:53:03 +01:00
Sarah Hoffmann
7005c6af12 add new extratags style
This is the same as the full style but also adds all unused tags
except for a couple of internal tags to the extratags column.
2020-01-02 14:24:51 +01:00
Sarah Hoffmann
28b89daa22 remove duplicate addr:country from style 2019-12-17 20:48:27 +01:00
Francesc Hervada-Sala
3b22b9911b typo - fixes openstreetmap#1606 2019-12-17 17:24:29 +01:00
Sarah Hoffmann
15c5c8db24 add place=city_block/quarter to address hierarchy
Fixes #1516.
2019-10-14 23:49:06 +02:00
Thomas Bertels
8d3595c3e2
Remove administrative arrondissements from Belgian addresses
"administrative7" -> [14, 0]
2019-08-27 14:15:18 +02:00
marc tobias
765a932561 make US postcode data to an optional download 2019-07-24 01:13:57 +02:00
Sarah Hoffmann
b8f7b3cc8d Remove county places and Regierungsbezirke vom German addresses 2019-06-30 22:27:44 +02:00
Sarah Hoffmann
b0e6fb73c6 generally remove all country and state places from address
Gets rid of the hard-coded expection for place nodes and sets
the address rank generally via the address level config instead.
That means only administrative boundaries are now used at that
level in addresses.
2019-06-30 22:27:44 +02:00
Sarah Hoffmann
09e7f0d013 remove historic:neighbourhood from address ranks
Should not be reverse searchable.

Fixes #1379.
2019-06-10 20:12:27 +02:00
marc tobias
d4b633bfc5 replace database abstraction DB with PDO 2019-03-09 00:18:15 +01:00
Sarah Hoffmann
58e461e4c7 postcodes also need fallback 2019-01-08 23:46:18 +01:00
Sarah Hoffmann
8e2e852b89 add postcodes and interpolations to osm2pgsql style 2019-01-08 22:54:41 +01:00
Sarah Hoffmann
31bf7443a6 fix typo 2019-01-08 22:54:41 +01:00
Sarah Hoffmann
e6d18fc948 fixup admin import style and add two new ones
Remove unnamed landuses and postcode points from
importing. The latter will cause all objects with
address tags to be imported after all. Not expected
in the admin import style.
2019-01-08 22:54:41 +01:00
Sarah Hoffmann
caa8210112 Switch to configurable style for osm2pgsql
Includes the full style, which is the same as now (minus
sidwalk exclusion) and a minimal style for boundaries only.
2019-01-08 22:54:41 +01:00
Sarah Hoffmann
56839ba50f No longer install phrase configuration
Instead add it as a configurable path with the one from
the source directory as the default.

Also reinstates that settings/defaults.php is installed as
settings/settings.php.
2018-12-02 11:50:44 +01:00
Sarah Hoffmann
11c91e3b8d Remove settings/settings.php
This was only a stub to warn when something was
executed directly from utils/ in the source directory.
This is no longer possible.
2018-12-02 11:16:41 +01:00
Sarah Hoffmann
d4fa528d5c
Merge pull request #1245 from lonvia/address-levels-from-json
Make rank assignments configurable
2018-12-01 21:43:53 +01:00
Sarah Hoffmann
7611aa2f65 Move address level config into settings/ 2018-11-27 22:32:27 +01:00
marc tobias
c9a553fdb4 settings.php: when printing error, also exit with error code 2018-11-26 14:28:09 +01:00
Sarah Hoffmann
e10d11c6c7 Make rank assignments configurable
The initial search and address rank is saved in a table
that is set up from a json configuration file. Ranks may
be assigned on a country level according to class and
type of the object. Special handling that depends on the
geometry or OSM type is still hard-coded in placex insert.

The new default config file mimicks the current assignment
as close as possible. A couple of exceptions have been
removed, most notably the exception for Irish townlands.
2018-11-24 16:21:16 +01:00
Eric Stadtherr
87d78e87d2 changed nominatim.so module path to be a runtime configuration setting as opposed to a command line argument 2018-07-24 15:25:12 -06:00
Sarah Hoffmann
ae83ceab5e ignore Unicode format characters for normalization
Also adds tests.

Fixes #1007.
2018-04-10 22:48:17 +02:00
Marc Tobias Metten
f6a76ebcd5 phpcs: remove trailing whitespace from comments 2018-03-27 01:43:02 +02:00
Sarah Hoffmann
6ba87c37d6 switch default replication source to https 2018-01-04 23:27:53 +01:00
marc tobias
da4a2b7b6e UI: scrollwheel, minimap 2017-10-21 13:24:02 +02:00
Sarah Hoffmann
266153f218 remove code for dropping address terms
This code has been inactive in quite a while and is a suboptimal
solution. We need to be much more selective in what gets dropped.
2017-10-07 11:53:33 +02:00
Sarah Hoffmann
896421fe9f improve update interval computation
Don't do anything if a downloaded diff is empty after all
(may be happening when an empty diff was published upstream).

Correctly compute the waiting interval before checking for new
data. As the interval is now computed based on the date of the
newest object in the database, the configured intervals need
to be adjusted slightly to take into account the time it takes
for the server to publish a diff.
2017-06-11 09:21:24 +02:00
Sarah Hoffmann
54393addd3 disregard special phrases that do not match fully
Compare the normalized terms imported with the special
terms script with the normalized version of the query string.
Disregard them if they cannot be found. This avoids a significant
number of mismatches due to transliteration issues.

The match will only be done when a normalized word has been set
making this change backwards compatible with older databases.
2017-06-04 23:12:09 +02:00
Sarah Hoffmann
65afe13f0a update docs for osmosis to pyosmium change 2017-05-25 16:53:44 +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
b15b996cc4 remove base country grid from repo
The updated country grid is significantly larger, so expect it to
be downloaded from the nominatim.org website instead.
2017-05-12 23:02:50 +02:00
Melvyn Sopacua
66d7f1a058 Set osmosis if available 2017-02-18 17:58:11 +01:00
Sarah Hoffmann
7273b58bbe make path to wikipedia files configurable 2016-12-28 23:38:48 +01:00
Sarah Hoffmann
1982978f74 move country search term creation into setup script
Search results can become odd without the country search
terms, so make their inclusion a mandatory part of the
setup.

Also adds a new configuration variable to restrict the
languages taken into account by Nominatim.
2016-09-28 23:30:44 +02:00
Marc Tobias Metten
02550cc4dc PSR2 fixes for /settings 2016-09-14 03:50:18 +02:00
Marc Tobias Metten
832547f192 tabs-to-spaces 2016-09-04 03:19:48 +02:00
Sarah Hoffmann
496d6bf168 fail on execution of util scripts from source directory
Utils scripts must be run from the build directory to make sure
we get the right paths. Rename the settings file in source and
replace the original one with an error, so that scripts
fail with an understandable error message when run from the
source directory.
2016-07-31 22:55:38 +02:00
Sarah Hoffmann
4f75f4cb6e remove IP blocking and rate-limiting code
Closes #472.
2016-07-18 21:33:09 +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
4f9f21f661 remove state and county data for US and make postcode import optional 2016-03-30 23:21:13 +02:00
Sarah Hoffmann
527c3390f4 remove unused settings 2016-03-30 23:03:10 +02:00
Sarah Hoffmann
f9a488cd5a remove 'closed for indexing' feature
Simultanous updates are fine these days.
2016-03-30 22:53:19 +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
7090604de7 reinstate NOMINATIM_SETTINGS variable
Move sourcing of this script to settings.php so that
it is loaded before anything else.
2016-03-24 22:06:54 +01:00
Sarah Hoffmann
5ccb499a6f install executables and call settings.php explicitly
Executables (including websites) need to be installed in the
build directory, so that they can find the right settings.php.
settings now defines build and source dir.
2016-03-12 09:40:43 +01:00
Sarah Hoffmann
5d7bd37ab2 introduce InstallPath, so that stuff can be executed from build dir 2016-03-12 09:40:43 +01:00
Marc Tobias Metten
78a29b5a87 spaces-to-tabs for all *.php files 2016-02-27 00:02:20 +01:00
Marc Tobias Metten
21385f5e51 make map tile layer configurable 2016-01-27 19:42:49 +01:00
Sarah Hoffmann
c9d7015f69 make search with reverse plan default
The old behaviour with reverse planning for only selected languages
can be reinstated by setting CONST_Search_ReversePlanForAll to
false.

Fixes #293
2015-08-11 22:30:07 +02:00
Marc Tobias Metten
7c8c206818 new method /lookup.php - Reverse search by multiple osm ids 2015-06-16 21:11:21 +02:00
Simon Lopez
c1f65ba7cf allow usage behind an HTTP Proxy. Fixes twain47/Nominatim#33 2015-05-21 19:51:04 +02:00
Sarah Hoffmann
3257c04d94 make Tiger data path configurable 2015-05-08 19:48:27 +02:00
Sarah Hoffmann
07cbf1535b set software version defaults to something more recent 2015-04-19 23:49:40 +02:00
Sarah Hoffmann
7ed580f1d5 enable NameOnlySearch per default 2015-02-27 19:55:31 +01:00
Sarah Hoffmann
3db64e7913 support tablespaces for special phrase table 2014-12-28 23:10:10 +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
98b93df83d recreate place objects when admin_level changes
Also added a sanity check to ensure that accidental removal of admin_level
tags on large areas doesn't cause huge reindexing load. That can be disabled
by setting CONST_Limit_Reindexing to false.
2014-02-07 23:37:54 +01:00
Sarah Hoffmann
3470abad07 don't send blocked IPs to OSM's trac by default 2013-10-18 19:24:11 +02:00
Brian Quinion
a974d25092 fix structured and batch mode. Add constant to disable batch mode by default 2013-09-12 16:16:08 +01:00
Frederik Ramm
87519de8ab fix indentation 2013-05-16 09:11:19 +02:00
Frederik Ramm
1f2a262ee0 Add osm2pgsql flat node support via settings.php 2013-05-16 09:03:16 +02:00
Sarah Hoffmann
9cec989882 remove suggestion code, no longer works 2013-05-08 20:23:47 +02:00
Sarah Hoffmann
9e0a92a508 allow to disable default language
If CONST_Default_Language is set to false, the fallback will be to
name tags without a language suffix. Make this the default.
2013-04-12 23:12:03 +02:00
IrlJidel
3eea62363d fix typo for baseUrl when configuring configuration.txt
use osmosis --read-replication-lag to determine if there are changes before trying to process updates, useful when we are tracking hourly or daily replication updates

set CONST_Replication_Recheck_Interval to 60

skip lag check if CONST_Replication_Update_Interval > 60, for minutelies there's always new diffs to process

use tabs for indent

change sleep for non-minutely updates so that we dont drift tto much or poll excessively

unset $aReplicationLag before each exec attempt

unset $aReplicationLag inside while loop
2013-04-02 21:30:12 +01:00
IrlJidel
f2b2a71485 default to planet.openstreetmap.org/replication/minute 2013-03-22 13:23:18 +00:00
IrlJidel
7cb27dc881 make planet replication url configurable so we can use geofabrik's awesome daily country diffs 2013-03-22 12:44:21 +00:00
Brian Quinion
d002908fff reminder about dsn format in settings.php 2013-03-18 19:42:16 -04:00
Brian Quinion
fca2d00617 Basic status page for monitoring nominatim is working 2013-01-24 12:42:42 +00:00
appelflap
a54c5e3003 use Postgis Version variable 2013-01-06 19:48:30 +01:00
Brian Quinion
d1a224bad4 performance: for low frequency name terms disable use of postgresql address index. Theshold is probably about 1000 but optimal value will probably depend on hardware. 2012-12-20 17:47:57 +00:00
Brian Quinion
96d3cb61c8 add constant to define postgis version. Verify definted version constants are correct during database creation. 2012-12-18 13:09:50 +00:00
Brian Quinion
0dd10c3fff Change access control to implement more of CORS. Change so OPTIONS requests don't do an actual search/reverse request 2012-12-17 00:25:06 +00:00
Brian Quinion
274f381052 prune list of blocked items if too large, different costs for different page types 2012-12-08 21:39:24 +00:00
Brian Quinion
fa90ece530 add an option for max number of sleeping threads 2012-12-08 18:55:17 +00:00
Brian Quinion
e03ae6d7eb rate limiting using memcache 2012-12-08 17:38:10 +00:00
Brian Quinion
a276b6b53a Experimental option to dry dropping query terms as part of search plan (disabled by default) 2012-12-03 17:41:29 +00:00
Brian Quinion
9d8ee88591 make number of polygon outputs allowed a constant 2012-11-06 13:10:25 +00:00
Sarah Hoffmann
e73e67001e ignore frequent partial search terms
Adds word counts from a full planet to the word table. There is a
new configuration option CONST_Max_Word_Frequency which allows to
take into account the word count: the value that was set on import
is used to determine if a word is added to the search_name table.
The value during runtime determines if a single term should be
used for partial search or simply be ignored.
2012-09-25 00:36:34 +02:00
Sarah Hoffmann
b61259bf77 switch to distribution-supplied osmosis
Both, Debian and Ubuntu now come with a reasonably recent version
of osmosis. Make using that the default.
2012-09-23 21:44:03 +02:00
Sarah Hoffmann
a44e21de49 avoid PHP notices 2012-05-25 23:45:59 +02:00
Brian Quinion
8d221e2c82 DB Scheme changes: alter table placex add column calculated_country_code varchar(2);
function changes:
-----------------
Move to ST_PointOnSurface from ST_Centroid in various places to avoid looking up a point outside the polygon
Move to ST_Covers from ST_Contains to include points on admin boundaries
Re-order preference for get_country_code now our data is better. country_osm_grid is now the preffered source.
Fix code to calculate country code in placex_insert, rank_search test was too early
Add extra field to placex 'calculated_country_code' to improve structure of code
Move split_geometery function out of add_location into its own function
Rewrite split_geometery to be more efficient.
Change place_insert to do more updates and less delete/inserts (delete is slow)
Include wikipedia links in details.php ouput
Cleanup no longer used geometry validation (adding overhead)
Include debug statements in function.sql (--DEBUG: ) and add flag to setup.php to turn them on

setup.php:
----------
add flag --disable-token-precalc to speed up debuging
add flag --index-noanalyse to disable analysising DB at rank 4 and 26 (previously removed, but on my local DB it seems to be required)
add flag --enable-diff-updates (modifier to --create-functions) to turn on the code required for diff updates without having to modify functions.sql
add flag --enable-debug-statements (modifier to --create-functions) to turn on debug warning statements

update.php:
-----------
added flag --no-index to import osmosis changes without indexing them
extend the hack to allow import of JOSM generated osm files

country_grid.sql - reference copy of the sql used to generate the country_osm_grid table, needs cleanup
2012-05-22 16:27:42 +02:00
Brian Quinion
041b3edf89 Adds code to merge place polygon and points using:
label relation member
  admin_center, admin_centre relation member (with same name)
  exact name, search_rank and location match

Adding this requires a new column and index:
  SELECT AddGeometryColumn('placex', 'centroid', 4326, 'GEOMETRY', 2);
  CREATE INDEX idx_placex_linked_place_id ON placex USING BTREE (linked_place_id);
2012-04-01 01:40:50 +01:00
Brian Quinion
80cf5df1cd Merge branch 'master' of github.com:twain47/Nominatim 2012-03-26 23:57:24 +01:00
Brian Quinion
b99a043c78 Use GB postcode table as definitive source. resort by pressence of search word in output address and other misc very minor changes not commited from MQ servers 2012-03-22 00:34:56 +00:00
Sarah Hoffmann
248b6ec90f Black/whitelisting for special phrases
Allows to restrict the special phrases imported from the wiki.
Blacklist allows to exclude certain class/type combinations.
Whitelist allows to define an allowed subset of types for a class.
Adjust to your liking in settings/phrase_settings.php before running
the specialphrases script.
2012-03-21 00:40:35 +01:00
Sarah Hoffmann
0005dc0a0f configurable file logging
Respect CONST_Log_File setting and add two new configuration
variables CONST_Log_File_SearchLog and CONST_Log_File_ReverseLog
for the log file names.
2012-03-04 12:50:45 +01:00
Sarah Hoffmann
cc564e2f31 - remove dependency on intarray extension
- new config options for postgresql version and 
  location of osm2pgsql and osmosis binaries
- new option --no-npi for update.php that supresses writing of NPIs in
  osmosis update mode
- add more GRANTs for www-data
2012-01-21 10:21:42 +00:00
Brian Quinion
1028c2444c move partiondef config file to settings, add --create-website option to build symlinks automatically 2011-04-06 18:19:40 +00:00
Brian Quinion
b0ed31b6d4 configure tile set 2011-03-23 12:16:57 +00:00
Brian Quinion
10620c71bb lots of little bug fixes and missing files 2011-02-02 12:01:26 +00:00
Brian Quinion
31273a42bd aux properties, memory leaks, tweaks to search order 2011-01-21 10:40:44 +00:00
Brian Quinion
a6453a808d remove the road buffer code - made things slower. Plus some more tiger import code 2010-11-17 15:19:25 +00:00
Brian Quinion
7df80bbc6f tigger data import 2010-11-15 16:34:27 +00:00
Brian Quinion
57583f09e3 hstore names / refactoring 2010-10-27 14:05:42 +00:00
Brian Quinion
e6d983474b data partitioning 2010-10-26 15:22:41 +00:00
Brian Quinion
ab6a996772 nominatim refactoring 2010-10-23 23:12:37 +00:00