Commit Graph

768 Commits

Author SHA1 Message Date
Sarah Hoffmann
101f04bbf2 Fix address link for boundaries in details
Removes the special casing for boundaries with a place
type in get_addressdata(). Instead the place type is now
returned as an extra field, so that the caller has to
handle the situation.

This fixes the details link next to the address in the details
view, which previously would go to a place class instead of the
original boundary class.
2020-03-29 17:40:56 +02:00
marc tobias
bb569aa484 print warning if no Tiger files found 2020-03-06 17:52:46 +01:00
Sarah Hoffmann
53ca751a02 fix style 2020-03-01 22:24:32 +01:00
Sarah Hoffmann
8c444378bc better grouping 2020-02-28 22:10:35 +01:00
Sarah Hoffmann
55fdf0abda output linked place into address details 2020-02-28 22:07:06 +01:00
Sarah Hoffmann
acd8ca2ebd add testing for rank adaption while linking 2020-02-28 15:22:48 +01:00
marc tobias
7fd9d0eeef unit tests for ParameterParser::hasSetAny 2020-02-19 16:55:17 +01:00
Sarah Hoffmann
cbddfcde5b add structured search to command-line query tool 2020-02-19 11:04:07 +01:00
marc tobias
e171f90d81 documentation wording: snipped->snippet 2020-02-18 22:48:27 +01:00
Sarah Hoffmann
b9171dd10b clean up intermediate tables earlier with --drop
When --drop is given, we can remove all node geometry information
already after the import with osm2pgsql. Also drop all unnecessary
tables before creating the final indices.
2020-02-12 11:03:20 +01:00
Sarah Hoffmann
97d87895bf details: also look for interpolations when way id is given 2020-02-09 16:50:04 +01:00
Sarah Hoffmann
c36fd72f99 use detailsPermaLink function on main website as well 2020-02-09 16:05:22 +01:00
Sarah Hoffmann
57ae3d03a1 return place_id link to details when not an OSM object
Stop-gap solution to find the right object for Tiger and
interpolation objects.
2020-02-09 15:45:38 +01:00
Sarah Hoffmann
3737712044
Merge pull request #1667 from mtmail/setup-delete-invalid-indices
setup: delete invalid indices in create-search-indices step
2020-02-09 14:21:17 +01:00
Sarah Hoffmann
8531339b4e Remove hack that changes the class/type of cities
This interferes badly with the details view.

Fixes #1668.
2020-02-09 12:14:32 +01:00
marc tobias
540b12537a setup: delete invalid indices in create-search-indices step 2020-02-08 15:16:20 +01:00
marc tobias
a3728b7188 details html page: no longer use place_id in URLs 2020-02-02 01:16:31 +01:00
Sarah Hoffmann
b4e6d72fde replace nominatim C program 2020-01-24 22:06:30 +01:00
Sarah Hoffmann
879aafc916 fix indent 2020-01-24 21:16:26 +01:00
Sarah Hoffmann
3ff6eccfd7 move trigger creation later in setup 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
4ffa11a26c update report a problem page 2020-01-13 22:42:49 +01:00
Sarah Hoffmann
f5e60f8c40 update help links
All links should go to nominatim.org now. Also add links
to Help OSM and the Github repository.
2020-01-13 22:20:53 +01:00
Sarah Hoffmann
7a194789bc remove remaining sql functions into function/ directory 2020-01-08 11:45:51 +01:00
Sarah Hoffmann
827d7a9a62 move postcode table triggers to own file 2020-01-08 11:22:23 +01:00
Sarah Hoffmann
dae2761137 move placex triggers into own file 2020-01-08 11:18:42 +01:00
Sarah Hoffmann
4304c1a7bb move place triggers into own file 2020-01-07 23:55:38 +01:00
Sarah Hoffmann
c537ea18a4 move functions for interpolation table in own file 2020-01-05 16:36:46 +01:00
Sarah Hoffmann
28fa7be75a move functions for address lookup into own file 2020-01-05 16:16:21 +01:00
Sarah Hoffmann
4088e4e371 move importance/wikipedia functions into separate file 2020-01-05 15:55:39 +01:00
Sarah Hoffmann
0ef6425847 move SQL functions for normalisation in separate file 2020-01-05 15:38:20 +01:00
Sarah Hoffmann
2059e18e8b setup: factor out parameter replacement in SQL scripts
Put all into a single function and use for all SQL
templates.
2020-01-04 23:48:49 +01:00
marc tobias
7db0da40ad new script utils/check_import_finished.php 2019-12-23 15:13:18 +01:00
marc tobias
626e3238f2 details page: differentiate between spheric distance and distance in meters 2019-12-11 00:49:32 +01:00
Sarah Hoffmann
a4e514033d Merge branch 'housenumber-zero' of https://github.com/mtmail/Nominatim into mtmail-housenumber-zero 2019-12-01 20:17:27 +01:00
Sarah Hoffmann
be9f54d0a9 set default osm2pgsql to 0 when using flatnode file 2019-11-24 14:36:36 +01:00
Sarah Hoffmann
000fe3ddff remove reference to nominatim.xml OpenSearch description
The file was meant for the openstreetmap instance only.

Fixes #1554.
2019-11-20 11:53:04 +01:00
Sarah Hoffmann
12f830fbbb fix loading of data without wikipedia files
Also removes unused place_boundingbox table.
2019-11-17 23:58:43 +01:00
Sarah Hoffmann
cd3ddec746 Switch to sql.gz format for wikipedia data
The dump import is no longer needed.
2019-11-17 10:09:31 +01:00
Sarah Hoffmann
d53af96aa4 update documentation for new wikipedia data 2019-11-16 16:52:23 +01:00
Sarah Hoffmann
f42e40712e
Merge pull request #1555 from mtmail/setup-escape-shell-args
setup: escape arguments when executing shell commands (psql, createdb)
2019-11-06 22:47:00 +01:00
marc tobias
9cfd891fb9 setup: escape arguments when executing shell commands (psql, createdb) 2019-11-05 23:50:46 +01:00
Sarah Hoffmann
8ae317e002
Merge pull request #1545 from mtmail/details-index-html-page
HTML page with search form when /details.php called without params
2019-10-31 18:30:35 +01:00
marc tobias
36e99c43ce HTML page with search form when /details.php called without params 2019-10-31 17:13:43 +01:00
marc tobias
eeb26aaa6f Addresses with housenumber 0 are found 2019-10-31 13:52:10 +01:00
marc tobias
c297584726 Tiger data import: display which path is searched for files 2019-10-30 15:50:29 +01:00
Sarah Hoffmann
5930383404 Merge branch 'fix-getcol-zero' of https://github.com/eyusupov/Nominatim into eyusupov-fix-getcol-zero 2019-10-28 23:07:28 +01:00
Sarah Hoffmann
7395eb9791
Merge pull request #1532 from eyusupov/use-extradir
Use ExtraDataPath for country grid
2019-10-28 23:01:42 +01:00
Sarah Hoffmann
5292239714 demote short_name in the list of names to display
The usage of short_name in OSM has changed with time. It is no
longer suitable as a display name.

Fixes #783.
2019-10-28 22:12:21 +01:00
Eldar Yusupov
b54fca4f7e Handle zero in getCol() 2019-10-26 20:19:36 +03:00
Eldar Yusupov
96c1a0a101 Use ExtraDataPath for country grid 2019-10-23 06:19:04 +03:00
marc tobias
573fba55af SetupClass: on --drop check if table exists first 2019-09-04 13:12:11 +02:00
marc tobias
7b09e320a8 /hierarchy.php was missing namespace calling AddressDetails 2019-07-28 22:05:51 +02:00
marc tobias
765a932561 make US postcode data to an optional download 2019-07-24 01:13:57 +02:00
Sarah Hoffmann
cdc7d0fe0e remove visibility modifier from constants again
Only supported on PHP >= 7.1.
2019-07-02 23:24:49 +02:00
Sandor Nagy
6c097d24b1
Fix SQL concatenation for new query log 2019-07-02 01:19:59 +02:00
Sandor Nagy
0115b655bd
lib/log.php broke after switch to PDO DB abstraction 2019-07-02 01:19:55 +02:00
Sarah Hoffmann
38a99856c0 Rework word set computation
Switch from an recursive algorithm for computing the word sets
to an iterative one that benefits from caching intermediate
results. This considerably reduces the amount of memory needed,
so that the depth restriction can be dropped. To ensure that
the number of word sets remains manageable, only sets up to
a certain length are accepted and only a certain number of
total word sets. If word sets need to be dropped, we drop
the ones with more words per word set first.

To further reduce the number of potential word sets, the valid
tokens are looked up first and then only word sets containing
valid tokens are computed.

Fixes #1403, #1404 and #654.
2019-06-29 18:22:31 +02:00
marc tobias
ed2fb84e82 register shutdown function to handle out-of-memory errors 2019-05-21 18:41:06 +02:00
Sarah Hoffmann
c05ddb6119 increase minimum versions for PostgreSQL, Postgis and PHP
Remove checks and hacks for older versions.
2019-05-02 21:48:40 +02:00
Sarah Hoffmann
6511ec3aa8 Convert importance to float value
Fixes #1369.
2019-04-30 23:21:53 +02:00
Sarah Hoffmann
7d3b16f24c Ignore no-fatal errors during dump file restore
The owner should never be restored, the table should be owned
by the caller instead. Non-existing indexes and similar only
started to throw a warning with Postgresql 9.4 and later, so
ignore them explicitly there.
2019-04-28 22:44:42 +02:00
Sarah Hoffmann
b612b99421
Merge pull request #1321 from mtmail/interpolating-0-housenumbers
Support housenumber=0 in interpolations
2019-04-19 18:29:43 +02:00
marc tobias
0862e21a1b utils/export.php broke after switch to PDO DB abstraction 2019-04-17 22:29:50 +02:00
Sarah Hoffmann
0af48fe802 exclude all objects without address rank from reverse
This was forgotten when looking for a housenumber for
a street point.

Fixes #1319.
2019-04-16 23:13:27 +02:00
Sarah Hoffmann
a9ae2c7457 add reverse zoom level that includes minor streets
Zoom 17 now also resolves service roads and similar.

Fixes #1350.
2019-04-15 22:43:07 +02:00
Sarah Hoffmann
87c0049e75 isaddress field may be missing in details view 2019-04-14 12:03:37 +02:00
Sarah Hoffmann
e5eb7ecdc1 Merge branch 'observe-bounded-viewbox-in-postcode-search' of https://github.com/mtmail/Nominatim into mtmail-observe-bounded-viewbox-in-postcode-search 2019-04-14 11:29:28 +02:00
Sarah Hoffmann
33ff96fd83
Merge pull request #1348 from mtmail/checkmodulepresence-to-raise-exception
checkModulePresence now raises exception instead of its callers
2019-04-14 11:25:52 +02:00
marc tobias
84149f26df checkModulePresence now raises exception instead of its callers 2019-04-02 18:37:11 +02:00
marc tobias
2ab836c11c PDO library returns proper boolean. We dont need string comparison 2019-04-02 16:52:37 +02:00
marc tobias
7d9dbd62c7 Support housenumber=0 in interpolations 2019-04-02 15:13:45 +02:00
marc tobias
c9a6350894 On postcode searches observe given bounded viewbox 2019-04-02 14:49:31 +02:00
marc tobias
61386c5b4d PDOException call in catch was causing exception itself 2019-03-17 02:47:28 +01:00
marc tobias
890d415e1f Nominatim::DB support input variables, custom error messages 2019-03-10 16:56:36 +01:00
marc tobias
d4b633bfc5 replace database abstraction DB with PDO 2019-03-09 00:18:15 +01:00
Sarah Hoffmann
8f0c628310 downgrade housenumbers without numbers
Fixes #1312.
2019-02-24 14:39:14 +01:00
Sarah Hoffmann
16794a84de Change accepted features for reverse geocoding at rank 30
Always exclude line features (removes railways, tunnels,
piers, historical streets etc.) and boundaries (removes
electoral, historical boundaries etc.)

Fixes #1313.
2019-02-24 11:00:33 +01:00
marc tobias
853b536394 Remove get_addressrank_label. Move get_searchrank_label to PHP 2019-02-09 20:38:36 +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
72d19cd523 keep country_osm_grid table when dropping update tables 2019-01-08 22:44:33 +01:00
Sarah Hoffmann
7d74bf781c correctly discard partially matching duplicates
The same result may be found with different result ranks
in the same search loop when housenumber or postcode are
part of the name or address. In this case we need to keep
the result with the lower result rank.

Fixes #1264.
2019-01-03 21:49:50 +01:00
Sarah Hoffmann
411f361fcb traverse address list backwards when computing admin levels
By starting with the lowest address level, when collecting
administrative boundaries by level, there is a better chance
to actually get the boundary when the capital of the
administrative boundary is tagged with the level of the
boundary as well.

This is just a heuristics adaption to make the best out of
the imprecise admin_level definition for place nodes.

Fixes #1261.
2018-12-06 21:18:47 +01:00
Sarah Hoffmann
e080bdff0f Don't escape slashes in json output
Fixes #1256.
2018-12-04 22:28:29 +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
marc tobias
a7e26e8f59 remove Natural Earth dataset 2018-11-27 20:13:33 +01:00
Sarah Hoffmann
5e072dabc3 remove PHP parameter typing
Older PHPs don't seem to like it.
2018-11-24 19:05:13 +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
Sarah Hoffmann
f0088ca2be
Merge pull request #1237 from ckquentvp/fix-accept-language-underscore-parsing
match languages such as ja_rm (or any other with underscore) properly
2018-11-24 16:20:00 +01:00
Sarah Hoffmann
14cef94e61 fix variable name in setup --drop 2018-11-24 12:29:00 +01:00
Sarah Hoffmann
5d98c09ee9 Add reverse-only parameter to setup
Avoids creating the search_name table. Useful when only /reverse
is used or the content is directly exported to photon.

Fixes #939.
2018-11-21 19:36:21 +01:00
Sarah Hoffmann
7da5196bac setup: add convenience function for executing SQL commands 2018-11-21 12:18:13 +01:00
Sarah Hoffmann
7fd40cb0e6
Merge pull request #1238 from lonvia/simplify-version-check
Simplify parsing of postgres and postgis versions
2018-11-20 23:07:55 +01:00
Sarah Hoffmann
b6b1c23575 fix phpcs offences 2018-11-20 23:05:56 +01:00
Sarah Hoffmann
409ded385f simplify connection handling in setup script
- factor out runWithEnv
- require explicit connect() call to avoid rechecking for oDB
  (more for readability than for speed)
- clean DSNInfo of empty strings and simplify check for entries
2018-11-20 22:51:37 +01:00
Sarah Hoffmann
9cf85f90fb Simplify parsing of postgres and postgis versions
Switch to functions server_version_num and postgis_lib_version
which both only return the version string, so that no elaborate
string parsing is necessary anymore. The version string could
become especially cumbersome in pre-release versions.
2018-11-18 17:27:20 +01:00
name
2bc46b8f21 match languages such as ja_rm (or any other with underscore) properly 2018-11-17 20:20:06 +02:00
Sarah Hoffmann
85f32d6c0f Keep matches without house number
Now that we have result ranking, we can keep the street results
for housenumber searches and reuse them in the next group round
if required. Also fixes an issue where postcode and housenumber
are in the query and one of them is wrong.

Fixes #1200.
2018-11-17 00:35:38 +01:00
Sarah Hoffmann
9908c93d4c Add result ranking for missing housenumber and postcode
Fixes #988.
2018-11-17 00:00:01 +01:00
Sarah Hoffmann
388c7f706d
Merge pull request #1233 from mtmail/better-gbpostcode-setup-warning
Improved warning message when looking for optional GB postcode file
2018-11-15 23:28:04 +01:00
Sarah Hoffmann
7f0a0ce5e5 make HTML error message less technical 2018-11-15 21:19:31 +01:00
Sarah Hoffmann
2a39bc6e68 Merge branch 'set-exception-handler-by-request-format' of https://github.com/mtmail/Nominatim into mtmail-set-exception-handler-by-request-format 2018-11-15 20:57:20 +01:00
marc tobias
07c47eed54 Improved warning message when looking for optional GB postcode file 2018-11-09 10:06:17 +00:00
Sarah Hoffmann
c5109d39d0 increase limit when searching for street w/ house number
Increase the chance that the correct street is found.
2018-10-20 17:26:45 +02:00
marc tobias
e4a51e460e set exception handler by request format, not always HTML 2018-10-03 22:58:20 +02:00
Sarah Hoffmann
3afd12f977 simplify constructor of SetupFunctions
Also cleans up spacing.
2018-10-02 23:42:33 +02:00
Sarah Hoffmann
f45b3fa3f2 Merge branch 'updatePHP' of https://github.com/ThomasBarris/Nominatim into ThomasBarris-updatePHP 2018-10-02 22:46:53 +02:00
marc tobias
e2a7a795d4 fix AddressDetails->getAddressDetails, add tests 2018-09-20 02:16:01 +02:00
Sarah Hoffmann
119ffbab40 address tokens get a double search rank also as full terms
Fixes #1170.
2018-09-18 21:54:08 +02:00
ThomasBarris
e92b54b869 Merge branch 'updatePHP' of https://github.com/ThomasBarris/Nominatim into updatePHP 2018-09-18 21:29:24 +02:00
ThomasBarris
0273e128f4 change variables for class SetupClass.php instantiation 2018-09-18 21:28:05 +02:00
ThomasBarris
a948050015 typo 2018-09-18 09:17:54 +02:00
ThomasBarris
a0dbeabed1 move setupclass, move command line array, remove args from update array 2018-09-17 10:28:00 +02:00
ThomasBarris
9e35e5c2b0 move checkModilePresence to class, delete own debug echo 2018-09-08 09:26:23 +02:00
ThomasBarris
d10f63b666 format change revert, removed bogus CL options, SetupClass to a new dir 2018-09-05 22:01:03 +02:00
ThomasBarris
aa6ac5a751 more format changes for Mr. Travis 2018-08-31 22:01:53 +02:00
ThomasBarris
a3b4f80c99 small fixes on setup.php and a bring update.php to work 2018-08-31 21:31:38 +02:00
ThomasBarris
b2f3cfde0b splitted createTables and changed formatting to please Travis 2018-08-29 22:54:28 +02:00
ThomasBarris
c036480ce2 first draft of setupClass 2018-08-29 21:31:19 +02:00
Sarah Hoffmann
e8982068b6 fix quotes to make phpcs happy 2018-08-24 21:39:20 +02:00
ThomasBarris
14aca11dcd moving functions from setup.php to a lib file in lib/setup_functions.php and change a passthru in setup.php by calling the function with this new lib 2018-08-24 16:15:39 +02:00
Sarah Hoffmann
1ee636461c Mute notices from postgresql during setup
They are mostly warnings about tables that do not exists. This
is intentional and would only confuse the casual user.
2018-08-23 21:14:34 +02:00
Sarah Hoffmann
14e708f366 ignore linked country nodes for reverse geocoding
Fixes #1145.
2018-08-22 23:33:11 +02:00
Sarah Hoffmann
84cfe5db53 fix warning in keyword output of details 2018-08-22 22:35:46 +02:00
Sarah Hoffmann
26bd8304c6 fix formatting 2018-08-22 22:25:55 +02:00
marc tobias
e47646ddba in /details JSON output add check if place (type) has an icon set 2018-08-22 13:34:34 +02:00
Sarah Hoffmann
88374c2522 improve test coverage for reverse and debug output 2018-08-20 23:05:49 +02:00
Sarah Hoffmann
3fcfab9772 clean up reverse code
Removes unused variables, improves naming of internal functions
and makes structure of SQL calls a bit cleaner.
2018-08-20 23:04:33 +02:00
Sarah Hoffmann
de8888ec58 directly do country search for reverse zoom < 5
Fixes #1145.
2018-08-20 22:09:08 +02:00
Sarah Hoffmann
ff4b1758e1 reduce search radius when searching for nodes within country 2018-08-19 18:08:05 +02:00
Sarah Hoffmann
0617768ee2 Fix partial word computation
Partial word tokens have a space at the beginning of the
token not the word.
2018-08-13 21:22:45 +02:00
Sarah Hoffmann
62b60c70e6 reverse on street level should compute distance to object
The centroid of a building may be far away even when still inside
the building.

Fixes #1136.
2018-08-13 21:17:49 +02:00
Sarah Hoffmann
0394f32438 fix large viewbox computation
Fixes #1137.
2018-08-13 20:52:49 +02:00
Sarah Hoffmann
60cea6c8bf fixup use of indexes for latest reverse changes 2018-08-08 22:04:39 +02:00
Sarah Hoffmann
2e9cebf025 define types for null returns in PlaceLookup
Fixes #1127.
2018-08-05 15:47:55 +02:00
Sarah Hoffmann
646fa53b44 improve place node search when no areas found
Only look for place nodes in a certain radius according
to the rank_search of the place node.
2018-08-04 21:51:23 +02:00
Sarah Hoffmann
7f10264fb6
Merge pull request #1095 from estadtherr/remote_postgres_pr
Enable Postgres to run on a different host than the web server
2018-08-02 23:16:07 +02:00
Sarah Hoffmann
7e0fdf5928 fall back to debugInfo() for printing objects
Fixes #1122.
2018-08-02 00:06:02 +02:00
Eric Stadtherr
bfea79f1e4 address phpcs issue (strange it didn't appear in earlier runs) 2018-07-30 11:20:43 -06:00
Sarah Hoffmann
12db7a9af2
Merge pull request #1113 from mtmail/remove-empty-icon-configuration
ClassTypes: treat empty string for -icon-same as null
2018-07-23 20:37:31 +02:00
marc tobias
0981a6403d PHP code style: use long array syntax 2018-07-23 17:24:31 +02:00
marc tobias
37bd4dfd83 ClassTypes: treat empty string for -icon-same as null 2018-07-23 17:10:27 +02:00
Eric Stadtherr
b8b87716db adapt PR changes to use new variable naming convention 2018-07-21 17:09:59 -06:00
Eric Stadtherr
1108bf7d86 PR review changes 2018-07-21 12:09:47 -06:00
Eric Stadtherr
62747c934d Work on setup/update scripts, unit tests, and documentation to enable Postgres server to be optionally configured on a remote host 2018-07-21 12:09:47 -06:00
Sarah Hoffmann
5a772a5770 Don't add viewbox weight when no viewbox is given
Fixes #1068.
2018-07-20 23:29:36 +02:00
Sarah Hoffmann
3433ec306e fix operator type assignment
Fixes #1084.
2018-07-20 22:27:27 +02:00
Marc Tobias Metten
0892eab1d3 tests for Nominatim::TokenList 2018-07-19 14:19:50 +02:00
Sarah Hoffmann
d68996127d fix bad namespace for Operator class 2018-07-17 22:38:40 +02:00
Sarah Hoffmann
b17019a21c fix unit tests for class types 2018-07-12 23:59:29 +02:00
Sarah Hoffmann
be58b929f2 add tests for geocodejson and fix syntax errors 2018-07-12 22:00:18 +02:00