mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-06 18:14:16 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95df39c292 | ||
|
|
aab41b78af | ||
|
|
96ecee431b | ||
|
|
64bf44eaf0 | ||
|
|
9996cc495c | ||
|
|
bce11a5fc7 | ||
|
|
cce57139cf | ||
|
|
937bead547 | ||
|
|
3fba5e7867 | ||
|
|
a27e191335 | ||
|
|
8c087e4cb8 | ||
|
|
39bab5f4a1 | ||
|
|
d004a0e3df | ||
|
|
bc0cf74ba7 | ||
|
|
e64e3b4939 | ||
|
|
6de0a854fb | ||
|
|
97ad4e4654 |
@@ -20,8 +20,9 @@ project(nominatim)
|
|||||||
|
|
||||||
set(NOMINATIM_VERSION_MAJOR 3)
|
set(NOMINATIM_VERSION_MAJOR 3)
|
||||||
set(NOMINATIM_VERSION_MINOR 0)
|
set(NOMINATIM_VERSION_MINOR 0)
|
||||||
|
set(NOMINATIM_VERSION_PATCH 1)
|
||||||
|
|
||||||
set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}")
|
set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}.${NOMINATIM_VERSION_PATCH}")
|
||||||
|
|
||||||
add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
|
add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
3.0
|
3.0.1
|
||||||
|
|
||||||
|
* fix bug in geometry building algorithm in osm2pgsql
|
||||||
|
* fix typos in build instructions
|
||||||
|
|
||||||
|
3.0.0
|
||||||
|
|
||||||
* move to cmake build system
|
* move to cmake build system
|
||||||
* various fixes to HTML output
|
* various fixes to HTML output
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ Here is a quick summary of the necessary steps.
|
|||||||
|
|
||||||
For more detailed installation instructions see [docs/Installation.md](docs/Installation.md).
|
For more detailed installation instructions see [docs/Installation.md](docs/Installation.md).
|
||||||
There are also step-by-step instructions for
|
There are also step-by-step instructions for
|
||||||
[Ubuntu 16.04](docs/install-on-ubuntu-16.md) and
|
[Ubuntu 16.04](docs/Install-on-Ubuntu-16.md) and
|
||||||
[CentOS 7.2](docs/install-on-centos-7.md).
|
[CentOS 7.2](docs/Install-on-Centos-7.md).
|
||||||
|
|
||||||
2. Get OSM data and import:
|
2. Get OSM data and import:
|
||||||
|
|
||||||
./build/utils/setup.php --osm-file <your planet file> --all
|
./build/utils/setup.php --osm-file <your planet file> --all
|
||||||
|
|
||||||
Details can be found in [docs/Import_and_update.md](docs/Import_and_update.md)
|
Details can be found in [docs/Import_and_update.md](docs/Import-and-Update.md)
|
||||||
|
|
||||||
3. Point your webserver to the ./build/website directory.
|
3. Point your webserver to the ./build/website directory.
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ License
|
|||||||
|
|
||||||
The source code is available under a GPLv2 license.
|
The source code is available under a GPLv2 license.
|
||||||
|
|
||||||
Contact and Bugreports
|
Contact and Bug reports
|
||||||
======================
|
======================
|
||||||
|
|
||||||
For questions you can join the geocoding mailinglist, see
|
For questions you can join the geocoding mailinglist, see
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ is.
|
|||||||
|
|
||||||
To repeat an import you'd need to delete the database first
|
To repeat an import you'd need to delete the database first
|
||||||
|
|
||||||
dropdb -if-exists nominatim
|
dropdb --if-exists nominatim
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ This data is available as a binary download:
|
|||||||
Combined the 2 files are around 1.5GB and add around 30GB to the install
|
Combined the 2 files are around 1.5GB and add around 30GB to the install
|
||||||
size of nominatim. They also increase the install time by an hour or so.
|
size of nominatim. They also increase the install time by an hour or so.
|
||||||
|
|
||||||
|
*NOTE:* you'll need to download the Wikipedia rankings before performing
|
||||||
|
the initial import of the data if you want the rankings applied to the
|
||||||
|
loaded data.
|
||||||
|
|
||||||
### UK postcodes
|
### UK postcodes
|
||||||
|
|
||||||
Nominatim can use postcodes from an external source to improve searches that involve a UK postcode. This data can be optionally downloaded:
|
Nominatim can use postcodes from an external source to improve searches that involve a UK postcode. This data can be optionally downloaded:
|
||||||
@@ -108,7 +112,7 @@ instance by following these steps:
|
|||||||
|
|
||||||
6. Apply the new settings:
|
6. Apply the new settings:
|
||||||
|
|
||||||
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
||||||
|
|
||||||
Be warned that the import can take a very long time, especially if you
|
Be warned that the import can take a very long time, especially if you
|
||||||
import all of the US. The entire US adds about 10GB to your database.
|
import all of the US. The entire US adds about 10GB to your database.
|
||||||
@@ -156,7 +160,7 @@ diffs for Ireland from geofabrik add the following:
|
|||||||
|
|
||||||
To set up the update process now run the following command:
|
To set up the update process now run the following command:
|
||||||
|
|
||||||
./utils/update --init-updates
|
./utils/update.php --init-updates
|
||||||
|
|
||||||
It outputs the date where updates will start. Recheck that this date is
|
It outputs the date where updates will start. Recheck that this date is
|
||||||
what you expect.
|
what you expect.
|
||||||
@@ -171,6 +175,8 @@ The following command will keep your database constantly up to date:
|
|||||||
|
|
||||||
./utils/update.php --import-osmosis-all
|
./utils/update.php --import-osmosis-all
|
||||||
|
|
||||||
|
(Note that even though the old name "import-osmosis-all" has been kept for compatibility reasons, Osmosis is not required to run this - it uses pyosmium behind the scenes.)
|
||||||
|
|
||||||
If you have imported multiple country extracts and want to keep them
|
If you have imported multiple country extracts and want to keep them
|
||||||
up-to-date, have a look at the script in
|
up-to-date, have a look at the script in
|
||||||
[issue #60](https://github.com/openstreetmap/Nominatim/issues/60).
|
[issue #60](https://github.com/openstreetmap/Nominatim/issues/60).
|
||||||
|
|||||||
Submodule osm2pgsql updated: c27acf1705...00fb2505c1
@@ -120,6 +120,21 @@ Before importing make sure to add the following to your local settings:
|
|||||||
@define('CONST_Database_DSN', 'pgsql://@/test_api_nominatim');
|
@define('CONST_Database_DSN', 'pgsql://@/test_api_nominatim');
|
||||||
@define('CONST_Wikipedia_Data_Path', CONST_BasePath.'/test/testdb');
|
@define('CONST_Wikipedia_Data_Path', CONST_BasePath.'/test/testdb');
|
||||||
|
|
||||||
|
#### Code Coverage
|
||||||
|
|
||||||
|
The API tests also support code coverage tests. You need to install
|
||||||
|
PHP_CodeCoverage. On Debian/Ubuntu run:
|
||||||
|
|
||||||
|
apt-get install php-codecoverage
|
||||||
|
|
||||||
|
The run the API tests as follows:
|
||||||
|
|
||||||
|
behave api -DPHPCOV=<coverage output dir>
|
||||||
|
|
||||||
|
To generate reports, you can use the phpcov tool:
|
||||||
|
|
||||||
|
phpcov merge --html=<report output dir> <coverage output dir>
|
||||||
|
|
||||||
### Indexing Tests (`test/bdd/db`)
|
### Indexing Tests (`test/bdd/db`)
|
||||||
|
|
||||||
These tests check the import and update of the Nominatim database. They do not
|
These tests check the import and update of the Nominatim database. They do not
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ userconfig = {
|
|||||||
'TEMPLATE_DB' : 'test_template_nominatim',
|
'TEMPLATE_DB' : 'test_template_nominatim',
|
||||||
'TEST_DB' : 'test_nominatim',
|
'TEST_DB' : 'test_nominatim',
|
||||||
'API_TEST_DB' : 'test_api_nominatim',
|
'API_TEST_DB' : 'test_api_nominatim',
|
||||||
'TEST_SETTINGS_FILE' : '/tmp/nominatim_settings.php'
|
'TEST_SETTINGS_FILE' : '/tmp/nominatim_settings.php',
|
||||||
|
'PHPCOV' : False, # set to output directory to enable code coverage
|
||||||
}
|
}
|
||||||
|
|
||||||
use_step_matcher("re")
|
use_step_matcher("re")
|
||||||
@@ -28,16 +29,25 @@ class NominatimEnvironment(object):
|
|||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
self.build_dir = os.path.abspath(config['BUILDDIR'])
|
self.build_dir = os.path.abspath(config['BUILDDIR'])
|
||||||
|
self.src_dir = os.path.abspath(os.path.join(os.path.split(__file__)[0], "../.."))
|
||||||
self.template_db = config['TEMPLATE_DB']
|
self.template_db = config['TEMPLATE_DB']
|
||||||
self.test_db = config['TEST_DB']
|
self.test_db = config['TEST_DB']
|
||||||
self.api_test_db = config['API_TEST_DB']
|
self.api_test_db = config['API_TEST_DB']
|
||||||
self.local_settings_file = config['TEST_SETTINGS_FILE']
|
self.local_settings_file = config['TEST_SETTINGS_FILE']
|
||||||
self.reuse_template = not config['REMOVE_TEMPLATE']
|
self.reuse_template = not config['REMOVE_TEMPLATE']
|
||||||
self.keep_scenario_db = config['KEEP_TEST_DB']
|
self.keep_scenario_db = config['KEEP_TEST_DB']
|
||||||
|
self.code_coverage_path = config['PHPCOV']
|
||||||
|
self.code_coverage_id = 1
|
||||||
os.environ['NOMINATIM_SETTINGS'] = self.local_settings_file
|
os.environ['NOMINATIM_SETTINGS'] = self.local_settings_file
|
||||||
|
|
||||||
self.template_db_done = False
|
self.template_db_done = False
|
||||||
|
|
||||||
|
def next_code_coverage_file(self):
|
||||||
|
fn = os.path.join(self.code_coverage_path, "%06d.cov" % self.code_coverage_id)
|
||||||
|
self.code_coverage_id += 1
|
||||||
|
|
||||||
|
return fn
|
||||||
|
|
||||||
def write_nominatim_config(self, dbname):
|
def write_nominatim_config(self, dbname):
|
||||||
f = open(self.local_settings_file, 'w')
|
f = open(self.local_settings_file, 'w')
|
||||||
f.write("<?php\n @define('CONST_Database_DSN', 'pgsql://@/%s');\n" % dbname)
|
f.write("<?php\n @define('CONST_Database_DSN', 'pgsql://@/%s');\n" % dbname)
|
||||||
|
|||||||
13
test/bdd/steps/cgi-with-coverage.php
Normal file
13
test/bdd/steps/cgi-with-coverage.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
require_once 'SebastianBergmann/CodeCoverage/autoload.php';
|
||||||
|
$covfilter = new SebastianBergmann\CodeCoverage\Filter();
|
||||||
|
$covfilter->addDirectoryToWhitelist($_SERVER['COV_PHP_DIR']);
|
||||||
|
$coverage = new SebastianBergmann\CodeCoverage\CodeCoverage(null, $covfilter);
|
||||||
|
$coverage->start($_SERVER['COV_TEST_NAME']);
|
||||||
|
|
||||||
|
include $_SERVER['COV_SCRIPT_FILENAME'];
|
||||||
|
|
||||||
|
|
||||||
|
$coverage->stop();
|
||||||
|
$writer = new \SebastianBergmann\CodeCoverage\Report\PHP;
|
||||||
|
$writer->process($coverage, $_SERVER['PHP_CODE_COVERAGE_FILE']);
|
||||||
@@ -282,7 +282,18 @@ def send_api_query(endpoint, params, fmt, context):
|
|||||||
if hasattr(context, 'http_headers'):
|
if hasattr(context, 'http_headers'):
|
||||||
env.update(context.http_headers)
|
env.update(context.http_headers)
|
||||||
|
|
||||||
cmd = ['/usr/bin/php-cgi', env['SCRIPT_FILENAME']]
|
cmd = ['/usr/bin/php-cgi', '-f']
|
||||||
|
if context.nominatim.code_coverage_path:
|
||||||
|
env['COV_SCRIPT_FILENAME'] = env['SCRIPT_FILENAME']
|
||||||
|
env['COV_PHP_DIR'] = os.path.join(context.nominatim.src_dir, "lib")
|
||||||
|
env['COV_TEST_NAME'] = '%s:%s' % (context.scenario.filename, context.scenario.line)
|
||||||
|
env['SCRIPT_FILENAME'] = \
|
||||||
|
os.path.join(os.path.split(__file__)[0], 'cgi-with-coverage.php')
|
||||||
|
cmd.append(env['SCRIPT_FILENAME'])
|
||||||
|
env['PHP_CODE_COVERAGE_FILE'] = context.nominatim.next_code_coverage_file()
|
||||||
|
else:
|
||||||
|
cmd.append(env['SCRIPT_FILENAME'])
|
||||||
|
|
||||||
for k,v in params.items():
|
for k,v in params.items():
|
||||||
cmd.append("%s=%s" % (k, v))
|
cmd.append("%s=%s" % (k, v))
|
||||||
|
|
||||||
|
|||||||
@@ -145,10 +145,10 @@ if [ "x$1" == "xyes" ]; then #DOCS:
|
|||||||
|
|
||||||
cd $USERHOME
|
cd $USERHOME
|
||||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||||
#DOCS: cd Nominatim
|
cd Nominatim
|
||||||
|
|
||||||
else #DOCS:
|
else #DOCS:
|
||||||
cd $USERHOME #DOCS:
|
cd $USERHOME/Nominatim #DOCS:
|
||||||
fi #DOCS:
|
fi #DOCS:
|
||||||
|
|
||||||
# When installing the latest source from github, you also need to
|
# When installing the latest source from github, you also need to
|
||||||
@@ -161,6 +161,7 @@ fi #DOCS:
|
|||||||
# The code must be built in a separate directory. Create this directory,
|
# The code must be built in a separate directory. Create this directory,
|
||||||
# then configure and build Nominatim in there:
|
# then configure and build Nominatim in there:
|
||||||
|
|
||||||
|
cd $USERHOME #DOCS:
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake $USERHOME/Nominatim
|
cmake $USERHOME/Nominatim
|
||||||
|
|||||||
@@ -132,10 +132,10 @@ if [ "x$1" == "xyes" ]; then #DOCS:
|
|||||||
|
|
||||||
cd $USERHOME
|
cd $USERHOME
|
||||||
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
git clone --recursive git://github.com/openstreetmap/Nominatim.git
|
||||||
#DOCS: cd Nominatim
|
cd Nominatim
|
||||||
|
|
||||||
else #DOCS:
|
else #DOCS:
|
||||||
cd $USERHOME #DOCS:
|
cd $USERHOME/Nominatim #DOCS:
|
||||||
fi #DOCS:
|
fi #DOCS:
|
||||||
|
|
||||||
# When installing the latest source from github, you also need to
|
# When installing the latest source from github, you also need to
|
||||||
@@ -148,6 +148,7 @@ fi #DOCS:
|
|||||||
# The code must be built in a separate directory. Create this directory,
|
# The code must be built in a separate directory. Create this directory,
|
||||||
# then configure and build Nominatim in there:
|
# then configure and build Nominatim in there:
|
||||||
|
|
||||||
|
cd $USERHOME #DOCS:
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake $USERHOME/Nominatim
|
cmake $USERHOME/Nominatim
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ EOFAPACHECONF
|
|||||||
sudo a2enconf nominatim
|
sudo a2enconf nominatim
|
||||||
sudo service apache2 restart
|
sudo service apache2 restart
|
||||||
|
|
||||||
wget -O data/country_osm_grid.sql.gz http://www.nominatim.org/data/country_grid.sql.gz
|
wget -O $TRAVIS_BUILD_DIR/data/country_osm_grid.sql.gz http://www.nominatim.org/data/country_grid.sql.gz
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
|||||||
Reference in New Issue
Block a user