--- /dev/null
+# Nominatim contribution guidelines
+
+## Workflow
+
+We operate the "Fork & Pull" model explained at
+
+https://help.github.com/articles/using-pull-requests
+
+You should fork the project into your own repo, create a topic branch
+there and then make one or more pull requests back to the openstreetmap repository.
+Your pull requests will then be reviewed and discussed.
+
+## Coding style
+
+Nominatim historically hasn't followed a particular coding style but we
+are in process of consolodating the style. The following rules apply:
+
+ * Python code uses the official Python style
+ * indention
+ * SQL use 2 spaces
+ * all other use files TABs
+ * [BSD style](https://en.wikipedia.org/wiki/Indent_style#Allman_style) for braces
+ * spaces
+ * spaces before and after equal signs and operators
+ * no trailing spaces
+ * no spaces after opening and before closing bracket
+ * leave out space between a function name and bracket
+ but add one between control statement(if, while, etc.) and bracket
+
+
+This coding style must be applied to any new or changed code. You are also
+welcome to fix the coding style of existing code but please submit separate
+PRs for this.
+
+## Testing
+
+Before submitting a pull request make sure that the following tests pass:
+
+```
+ cd tests
+ NOMINATIM_DIR=<builddir> lettuce -t -Fail features/db features/osm2pgsql
+```
+
+```
+ cd test-php
+ phpunit ./
+```
<?php
@define('CONST_BasePath', '@CMAKE_SOURCE_DIR@');
@define('CONST_InstallPath', '@CMAKE_BINARY_DIR@');
+ if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_InstallPath.'/settings/local.php');
if (isset($_GET['debug']) && $_GET['debug']) @define('CONST_Debug', true);
if not members:
members = None
- cur.execute("""INSERT INTO planet_osm_rels
- (id, way_off, rel_off, parts, members, tags, pending)
- VALUES (%s, %s, %s, %s, %s, %s, false)""",
+ cur.execute("""INSERT INTO planet_osm_rels
+ (id, way_off, rel_off, parts, members, tags)
+ VALUES (%s, %s, %s, %s, %s, %s)""",
(line['id'], len(parts['n']), len(parts['n']) + len(parts['w']),
parts['n'] + parts['w'] + parts['r'], members, tags))
world.conn.commit()
tags = None
nodes = [int(x.strip()) for x in line['nodes'].split(',')]
- cur.execute("""INSERT INTO planet_osm_ways
- (id, nodes, tags, pending)
- VALUES (%s, %s, %s, false)""",
+ cur.execute("""INSERT INTO planet_osm_ways (id, nodes, tags)
+ VALUES (%s, %s, %s)""",
(line['id'], nodes, tags))
world.conn.commit()
(outp, err) = proc.communicate()
assert (proc.returncode == 0), "query.php failed with message: %s" % err
world.page = outp
- world.response_format = 'json'
+ world.response_format = 'json'
+ world.request_type = 'search'
world.returncode = 200