Compare commits

...

17 Commits

Author SHA1 Message Date
Sarah Hoffmann
95df39c292 prepare for release 3.0.1 2017-08-13 22:18:08 +02:00
Sarah Hoffmann
aab41b78af Merge pull request #779 from lonvia/update-osm2pgsql
update osm2pgsql
2017-07-26 23:53:47 +02:00
Sarah Hoffmann
96ecee431b Merge pull request #776 from lonvia/vagrant-fix-country-paths
vagrant: download country data into correct directory
2017-07-26 23:44:00 +02:00
Sarah Hoffmann
64bf44eaf0 update osm2pgsql
Fixes #770.
2017-07-26 23:40:14 +02:00
Sarah Hoffmann
9996cc495c Merge pull request #778 from woodpeck/patch-1
Mention explicitly that Osmosis is not required.
2017-07-23 21:01:51 +02:00
Frederik Ramm
bce11a5fc7 Mention explicitly that Osmosis is not required. 2017-07-21 09:23:38 +02:00
Sarah Hoffmann
cce57139cf Merge pull request #775 from lonvia/code-coverage
enable code coverage computation for API BDD tests
2017-07-17 23:19:41 +02:00
Sarah Hoffmann
937bead547 vagrant: download country data into correct directory 2017-07-17 23:17:26 +02:00
Sarah Hoffmann
3fba5e7867 enable code coverage computation for API BDD tests
Fixes #505.
2017-07-17 22:59:13 +02:00
Sarah Hoffmann
a27e191335 Merge pull request #771 from rksh/patch-1
Warn about operation order with Wikipedia data
2017-07-15 10:34:43 +02:00
Andy Carra
8c087e4cb8 Warn about operation order with Wikipedia data
Give first-time users a tip about installing Wikipedia data before performing initial import.
once https://github.com/openstreetmap/Nominatim/issues/255 has been addressed, this note is no-longer important.
2017-07-14 18:52:54 -07:00
Sarah Hoffmann
39bab5f4a1 Merge pull request #768 from SrihariThalla/update-typo-fix
[Minor] [/docs] Update file name of update.php to init updates command
2017-07-07 12:51:51 +02:00
Srihari Thalla
d004a0e3df Update file name of update.php to init updates 2017-07-07 15:57:01 +05:30
mtmail
bc0cf74ba7 Merge pull request #767 from manzari/patch-1
add country_osm_grid download to development (vagrant) setup instructions
2017-07-07 01:46:04 +02:00
manzari
e64e3b4939 Update VAGRANT.md 2017-07-06 18:05:14 +02:00
Sarah Hoffmann
6de0a854fb Merge pull request #763 from SrihariThalla/update-doc-links
Update incorrect internal links to docs
2017-06-29 21:00:29 +02:00
Srihari Thalla
97ad4e4654 Update incorrect internal links to docs 2017-06-29 17:29:15 +05:30
13 changed files with 80 additions and 17 deletions

View File

@@ -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}")

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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).

View File

@@ -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

View File

@@ -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)

View 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']);

View 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))

View File

@@ -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

View File

@@ -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

View File

@@ -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