]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 1 Jun 2017 19:51:38 +0000 (21:51 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 1 Jun 2017 19:51:38 +0000 (21:51 +0200)
CONTRIBUTING.md
lib/lib.php
osm2pgsql
sql/functions.sql

index 276137f6d9c9b0c8ace6ac8832f42460a46b8d6d..efd5315d819c14a3a7185787df9608fb4fda2acf 100644 (file)
@@ -1,14 +1,64 @@
 # Nominatim contribution guidelines
 
-## Workflow
+## Reporting Bugs
 
-We operate the "Fork & Pull" model explained at
+Bugs can be reported at https://github.com/openstreetmap/Nominatim/issues.
+Please always open a separate issue for each problem. In particular, do
+not add your bugs to closed issues. They may looks similar to you but
+often are completely different from the maintainer's point of view.
+
+### When Reporting Bad Search Results...
+
+Please make sure to add the following information:
+
+ * the URL of the query that produces the bad result
+ * the result you are getting
+ * the expected result, preferably a link to the OSM object you want to find,
+   otherwise an address that is as precise as possible
+ To get the link to the OSM object, you can try the following:
+ * go to https://openstreetmap.org
+ * zoom to the area of the map where you expect the result and
+   zoom in as much as possible
+ * click on the question mark on the right side of the map,
+   then with the queston cursor on the map where your object is located
+ * find the object of interest in the list that appears on the left side
+ * click on the object and report the URL back that the browser shows
+
+### When Reporting Problems with your Installation...
+
+Please add the following information to your issue:
+
+ * hardware configuration: RAM size, kind of disks
+ * Operating system (also mention if you are running on a cloud server)
+ * Postgres and Postgis version
+ * Nominatim version (commit id, if you run from the github repo)
+ * (if applicable) exact command line of the command that was causing the issues
+
+
+## Workflow for Pull Requests
+
+We love to get pull reuqests from you. 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.
+Your pull requests will then be reviewed and discussed. Please be aware
+that you are responsible for your pull requests. You should be prepared
+to get change requests because as the maintainers we have to make sure
+that your contribution fits well with the rest of the code. Please make
+sure that you have time to react to these comments and amend the code or
+engage in a conversion. Do not expect that others will pick up your code,
+it will almost never happen.
+
+Please open a separate pull request for each issue you want to address.
+Don't mix multiple changes. In particular, don't mix style cleanups with
+feature pull requests. If you plan to make larger changes, please open
+an issue first or comment on the appropriate issue already existing so
+that duplicate work can be avoided.
 
 ## Coding style
 
index 7553117f7ad0da4f56674924b61f4709eab3444a..941f6a1d9bcdcba817695bc3a13e0005c7618c5c 100644 (file)
@@ -475,11 +475,14 @@ function getResultDiameter($aResult)
 
 function javascript_renderData($xVal, $iOptions = 0)
 {
-    if (defined('PHP_VERSION_ID') && PHP_VERSION_ID > 50400)
-        $iOptions |= JSON_UNESCAPED_UNICODE;
+    $iOptions |= JSON_UNESCAPED_UNICODE;
+    if (isset($_GET['pretty']) && in_array(strtolower($_GET['pretty']), array('1', 'true'))) {
+        $iOptions |= JSON_PRETTY_PRINT;
+    }
+
     $jsonout = json_encode($xVal, $iOptions);
 
-    if (! isset($_GET['json_callback'])) {
+    if (!isset($_GET['json_callback'])) {
         header("Content-Type: application/json; charset=UTF-8");
         echo $jsonout;
     } else {
index 28c6806a4b6e8287f13197700c19af789659d435..28ce89dd28c20d94a98e29f41b8e76cfc7b6b823 160000 (submodule)
--- a/osm2pgsql
+++ b/osm2pgsql
@@ -1 +1 @@
-Subproject commit 28c6806a4b6e8287f13197700c19af789659d435
+Subproject commit 28ce89dd28c20d94a98e29f41b8e76cfc7b6b823
index 691ba85e39716700e568565d620a98d3e324904f..434ab3182110e9653f1bb190e86352faa9b7f883 100644 (file)
@@ -1140,6 +1140,8 @@ DECLARE
   nameaddress_vector INTEGER[];
 
   linked_node_id BIGINT;
+  linked_importance FLOAT;
+  linked_wikipedia TEXT;
 
   result BOOLEAN;
 BEGIN
@@ -1511,6 +1513,7 @@ BEGIN
 
           -- keep a note of the node id in case we need it for wikipedia in a bit
           linked_node_id := linkedPlacex.osm_id;
+          select language||':'||title,importance from get_wikipedia_match(linkedPlacex.extratags, NEW.country_code) INTO linked_wikipedia,linked_importance;
         END LOOP;
 
       END LOOP;
@@ -1546,6 +1549,7 @@ BEGIN
 
               -- keep a note of the node id in case we need it for wikipedia in a bit
               linked_node_id := linkedPlacex.osm_id;
+              select language||':'||title,importance from get_wikipedia_match(linkedPlacex.extratags, NEW.country_code) INTO linked_wikipedia,linked_importance;
             END IF;
 
           END LOOP;
@@ -1588,6 +1592,7 @@ BEGIN
 
         -- keep a note of the node id in case we need it for wikipedia in a bit
         linked_node_id := linkedPlacex.osm_id;
+        select language||':'||title,importance from get_wikipedia_match(linkedPlacex.extratags, NEW.country_code) INTO linked_wikipedia,linked_importance;
       END LOOP;
     END IF;
 
@@ -1608,10 +1613,12 @@ BEGIN
       END IF;
     END IF;
 
-    -- Did we gain a wikipedia tag in the process? then we need to recalculate our importance
-    IF NEW.importance is null THEN
-      select language||':'||title,importance from get_wikipedia_match(NEW.extratags, NEW.country_code) INTO NEW.wikipedia,NEW.importance;
+    -- Use the maximum importance if a one could be computed from the linked object.
+    IF linked_importance is not null AND
+        (NEW.importance is null or NEW.importance < linked_importance) THEN
+        NEW.importance = linked_importance;
     END IF;
+
     -- Still null? how about looking it up by the node id
     IF NEW.importance IS NULL THEN
       select language||':'||title,importance from wikipedia_article where osm_type = 'N'::char(1) and osm_id = linked_node_id order by importance desc limit 1 INTO NEW.wikipedia,NEW.importance;