Commit Graph

311 Commits

Author SHA1 Message Date
Sarah Hoffmann
1b33999f10 refactor ReverseGeocode
- remove unused functions and members
- move coordinates from being members to being parameters of lookup()
2016-07-26 20:54:14 +02:00
Sarah Hoffmann
4f75f4cb6e remove IP blocking and rate-limiting code
Closes #472.
2016-07-18 21:33:09 +02:00
Sarah Hoffmann
348a3082c9 fix syntax errors and update tests
Some of the tests with bad parameters now return a HTTP 400.
2016-06-12 22:51:13 +02:00
Sarah Hoffmann
95961d098d introduce chksql function for website code and move other fail functions
The default error screen now reports the full SQL even when not
in debug mode as this message is often more helpful than our
custom error message.
2016-06-12 14:34:57 +02:00
Sarah Hoffmann
7a50d2f996 factor out link formatting function and osm type translation 2016-06-12 12:39:09 +02:00
Sarah Hoffmann
6fef943e49 update links to OSM objects
/browse/ is no longer necesary in the URL
2016-06-12 09:26:58 +02:00
Sarah Hoffmann
76b9eb8098 remove now unused bAsPoints in reverse API 2016-06-11 23:27:21 +02:00
Sarah Hoffmann
d45524cbfb introduce accessor function for URL parameter
These functions take care of type conversion and check that
the parameters contain legal values. The API now returns a
Bad Request error if the format is wrong.
2016-06-11 23:07:06 +02:00
Sarah Hoffmann
aa9fff9199 polygons.php: print total number of broken polygons 2016-06-11 00:01:24 +02:00
Sarah Hoffmann
1a47376040 remove dead code 2016-06-11 00:01:24 +02:00
Sarah Hoffmann
4e0e0c1797 replace new-style [] expression with old-style array()
Also removes some unused code.

fixes #444
2016-05-01 11:22:53 +02:00
marc tobias
9e1421fb6c UI: the result outline (geojson/polygon) now lets the map handle its clicks 2016-05-01 10:47:13 +02:00
Sarah Hoffmann
a86563cfb1 make tables for external data (Tiger and aux) configurable
Introduces two new settings CONST_Use_US_Tiger_Data and
CONST_Use_Aux_Location_data, which are disabled by default.
When false the corresponding tables are ignored in queries
and updates.

Aux and tiger tables are no longer created by default. This
has to be done by the corresponding import scripts. The former
aux table creation can be found in sql/aux_tables.sql for
reference.
2016-04-07 21:47:51 +02:00
Markus Gail
7dd0a63b68 Fix coding style. 2016-03-23 09:34:36 +01:00
Markus Gail
291fdd1894 Tested Version of new Tiger line storage format. 2016-03-21 14:14:01 +01:00
Sarah Hoffmann
6fc32d9645 Merge branch 'cmake-port' into master
Conflicts:
	CMakeLists.txt
	lib/init.php
	settings/settings.php
2016-03-16 19:45:18 +01:00
Sarah Hoffmann
50f17666fa Merge pull request #395 from mtmail/php7-support
fix for PHP7, added test setup
2016-03-13 21:38:57 +01:00
Marc Tobias Metten
22ebd1c7a9 second argument of array_merge can be empty 2016-03-13 03:01:19 +01:00
Marc Tobias Metten
df764a3f3b fix for PHP7, added test setup 2016-03-13 02:06:46 +01:00
Sarah Hoffmann
5ccb499a6f install executables and call settings.php explicitly
Executables (including websites) need to be installed in the
build directory, so that they can find the right settings.php.
settings now defines build and source dir.
2016-03-12 09:40:43 +01:00
Marc Tobias Metten
71b3aa9cca Reverse geocode include geometry - added bounding box tests 2016-03-09 19:43:03 +01:00
Marc Tobias Metten
991bd0004a Reverse geocode include geometry 2016-03-04 20:29:09 +01:00
marc tobias
8e2b5d7ce3 query the last updated timestamp only if output format is HTML 2016-03-02 01:22:19 +01:00
Marc Tobias Metten
78a29b5a87 spaces-to-tabs for all *.php files 2016-02-27 00:02:20 +01:00
Sarah Hoffmann
ebdd250fa0 also show line geometries on search page 2016-02-08 23:06:27 +01:00
Sarah Hoffmann
8b491e8544 Merge pull request #361 from mtmail/detail-page-big-table2
UI: columns nicer aligned in details table(s)
2016-02-06 12:51:47 +01:00
Sarah Hoffmann
40588482a2 Merge pull request #362 from mtmail/fix-timeout-on-detail-pages
fix timeout on detail pages related to distance calculation
2016-02-06 12:50:38 +01:00
marc tobias
a73135aebe fix timeout on detail pages related to distance calculation 2016-02-06 12:43:12 +01:00
marc tobias
634d04068d UI: columns nicer aligned in details table(s) 2016-02-06 12:39:51 +01:00
Marc Tobias Metten
21385f5e51 make map tile layer configurable 2016-01-27 19:42:49 +01:00
marc tobias
cd37227a3c user interface: zoom dropdown for debugging on reverse search page 2016-01-22 11:54:26 +00:00
marc tobias
ef1a7d9073 user interface: reverse search remembers zoom level after map click 2016-01-21 15:26:18 +00:00
marc tobias
8f0199008d user interface: enable scrollwheel zoom. Disable on touch devices 2016-01-21 14:47:55 +00:00
marc tobias
9f1d3ac272 user interface: less spacing in table, pushing more content above the fold 2016-01-21 13:47:00 +00:00
Sarah Hoffmann
248588fbf3 make headers more compact 2016-01-20 21:14:30 +01:00
Marc Tobias Metten
016815eda2 new reverse HTML page incl leaflet map 2016-01-19 16:15:32 +01:00
Marc Tobias Metten
f2a2c29815 responsive details-error page. Shared header and footer 2016-01-19 12:29:07 +01:00
Marc Tobias Metten
851af3db7f details.php now also responsive 2016-01-15 17:11:12 +01:00
marc tobias
fc961c14fa status after hackweekend London 2016-01-15 17:11:12 +01:00
marc tobias
91f3405713 status after hackweekend London 2016-01-15 17:11:12 +01:00
Sarah Hoffmann
c242386ddb use url with php prefix in more url
User may not want to set up URL rewriting for suffixes.

Fixes #241
2015-08-11 23:09:50 +02:00
Sarah Hoffmann
c9d7015f69 make search with reverse plan default
The old behaviour with reverse planning for only selected languages
can be reinstated by setting CONST_Search_ReversePlanForAll to
false.

Fixes #293
2015-08-11 22:30:07 +02:00
Sarah Hoffmann
ddb2b3cafb add namedetails and extratags to lookup call 2015-08-10 21:45:22 +02:00
Sarah Hoffmann
a1f3bfb35a implement namedetails and extratags parameter for search 2015-08-10 21:42:40 +02:00
Sarah Hoffmann
86ca377b1a add extratags and name details to PlaceLookup (reverse) 2015-08-09 15:14:59 +02:00
Sarah Hoffmann
9e5c9ca81d fix HTTP return on status when database is down 2015-08-08 17:50:29 +02:00
Marc Tobias Metten
86e946d369 method /lookup.php: incorporate better PHP variable naming and other feedback in pull request 2015-06-25 04:12:44 +02:00
Marc Tobias Metten
7c8c206818 new method /lookup.php - Reverse search by multiple osm ids 2015-06-16 21:11:21 +02:00
Oleksandr Shulgin
46e64bd933 Check for positive polygon simplification threshold
Don't run the simplification function if no threshold was given
(or in case of a negative one).  Also process the query string
parameter in case of html out format.
2015-04-29 16:13:39 +02:00
Oleksandr Shulgin
ab47773604 Add polygon simplification
New query string parameter polygon_threshold=<0.0..1> is introduced.
The float value of this parameter (defaults to 0) is passed to
ST_SimplifyPreserveTopology() on geometry we're about to output in
one (or many) requested formats such as GeoJSON, KML, etc.

This is useful when getting border polygons for whole countries, but
rendering them at large scale, when most of the high resolution details
cannot be seen anyway.  For example, the unsimplified polygon data for
Germany in GeoJSON format currently makes for about 3 MB response body.
With use of this new parameter, the application can greatly reduce the
amount of downloaded data and server response time while providing its
users with the same picture.  On a typical laptop screen resolution,
zooming out to fit the whole country borders on screen, only 1/100 amount
of details could be well enough.
2015-04-27 15:16:38 +02:00
Sarah Hoffmann
133dd2e974 make sure place exists before printing hierarchy 2015-03-29 19:03:51 +02:00
Sarah Hoffmann
753227ae25 more strict parameter checking for reverse 2015-03-17 21:06:58 +01:00
Sarah Hoffmann
02c219d40e PATH_INFO is delivered URL encoded on newer apache 2.4 2014-10-16 00:33:56 +02:00
Sarah Hoffmann
bc27cb2bd8 introduce util function to query db from command line 2014-03-03 20:02:24 +01:00
Sarah Hoffmann
be858d56ca make website work with https without browser complaints 2014-02-20 19:46:41 +01:00
Brian Quinion
2df5d391de return a 500 error on bad status 2014-01-23 16:48:20 +00:00
Brian Quinion
f56cae4291 validate postgresql module / functions 2014-01-23 16:06:43 +00:00
Brian Quinion
47fdb33adf nominatim fallback mode for structured queries 2014-01-23 14:40:37 +00:00
Sarah Hoffmann
c574c933e4 reenable reverse order queries, leave disabled for structured queries 2013-09-16 00:05:26 +02:00
Brian Quinion
a974d25092 fix structured and batch mode. Add constant to disable batch mode by default 2013-09-12 16:16:08 +01:00
Brian Quinion
a2ba8708cb add a json output format for hierarchy 2013-09-09 15:55:30 +01:00
Brian Quinion
28a5ef899e Test code for creating osm breadcrumbs and hierarchy 2013-09-09 14:09:28 +01:00
Brian Quinion
6a337f13d0 XML and JSON map 'ploygon' param to AsPoints 2013-09-06 09:47:46 +01:00
Brian Quinion
b3ed566d15 Test for polygon param correctly 2013-09-06 09:47:46 +01:00
Brian Quinion
cdd129de70 fix viewbox issues 2013-09-06 09:47:46 +01:00
Brian Quinion
eb793ae26e Fix for regressions: broken bounded search, error on country codes 2013-09-06 09:47:46 +01:00
Brian Quinion
662af78319 batch mode for json only 2013-09-06 09:47:45 +01:00
Brian Quinion
91d72617e6 Use correct value for html ploygons 2013-09-06 09:47:45 +01:00
Brian Quinion
4429121341 move more code into library 2013-09-06 09:47:45 +01:00
Sarah Hoffmann
ea761a15b6 more restrictive parsing of lat/lon
Require a decimal point in both numbers to avoid cases like
https://trac.openstreetmap.org/ticket/4884
2013-07-07 16:44:37 +02:00
Sarah Hoffmann
3ccf466e2f fix error output 2013-07-04 17:52:25 +02:00
Sarah Hoffmann
d5e9fc4a03 support for partial matching of US ZIP+4 codes 2013-06-19 22:58:46 +02:00
Brian Quinion
c5c44f9a07 missed some postcode use cases 2013-06-13 17:19:27 +01:00
Brian Quinion
464fb913a8 Allow for tiger addresses when filtering by rank 2013-06-11 17:28:30 +01:00
Brian Quinion
e26da936b3 recheck the rank limits before dropping out of the search loop - otherwise we can drop out too soon 2013-06-11 17:13:37 +01:00
Brian Quinion
aa8c6e5f13 Try alternative orderings of structured queries that include postal codes 2013-06-11 14:56:50 +01:00
Brian Quinion
5413abfb1e remove the structuredAddressElement function from search that was moved to lib.php 2013-06-07 16:23:37 +01:00
Sarah Hoffmann
9cec989882 remove suggestion code, no longer works 2013-05-08 20:23:47 +02:00
Brian Quinion
93b1089866 Only use placex that are fully indexed for reverse geocoding 2013-05-08 12:16:45 +01:00
Sarah Hoffmann
0e6cfed1a4 remove debug putput 2013-05-06 21:33:01 +02:00
Sarah Hoffmann
3ec91d267b fix missing number conversion for coordinates 2013-05-06 21:19:12 +02:00
Sarah Hoffmann
ea48296eed fix 500 on reverse via search without result
e.g. /search?q=1,1
2013-05-06 21:04:09 +02:00
Sarah Hoffmann
ddc46acd26 add support for house numbers without street 2013-04-27 00:57:18 +02:00
Sarah Hoffmann
2df0cafb24 fix inconsistency between getNearestNamendRoadFeature() and house number search 2013-04-23 21:25:56 +02:00
Sarah Hoffmann
b4c87a09a1 restrict depth of word set calculation 2013-04-20 00:18:08 +02:00
Sarah Hoffmann
fb0d219c7b harmonize formatting of frontend php 2013-04-12 22:45:24 +02:00
Sarah Hoffmann
2f88e7ceab adapt status page to new word table layout 2013-04-10 19:50:38 +02:00
Sarah Hoffmann
23d303124e remove unused columns from word and search_name_* tables
Removes 'trigram' and 'location' from word.
  Removes 'address', 'importance' and 'country_code' from search_name_*.
  Use full geometry in centroid column of search_name_*.

  Requires migration of existing tables. For more info see pull request
  https://github.com/twain47/Nominatim/pull/45
2013-04-09 22:44:05 +02:00
Sarah Hoffmann
4d2b88dd3e allow any unicode letter and spaces in special terms
Allows to search for things like [fish shop].
2013-04-07 17:53:34 +02:00
Sarah Hoffmann
a1670fa5a7 correct rank_address range for postalcodes 2013-04-03 22:29:47 +02:00
Brian Quinion
b980f8e4e1 Import class:type from linked features to the extratags files. Use place tags (in extratags) as well as rank to determine feature type. i.e. allow a admin_level=6 feature also tagged as a place=city to still be found when doing a city search. 2013-02-28 12:50:47 +00:00
Sarah Hoffmann
917d4f691c remove full-word constraint for possible main words
Reversing the address did not work most of the time because
the address normally only contains the partial version of the word only.

See also
https://help.openstreetmap.org/questions/16317/warum-werden-straen-bei-suche-nicht-gefunden
2013-02-24 22:55:43 +01:00
Sarah Hoffmann
705bcf80fb Merge branch 'address-importance' of https://github.com/lonvia/Nominatim 2013-02-13 22:10:28 +01:00
Sarah Hoffmann
463ef857c8 increase initial search radius for reverse lookups
On the osm.org instance, this saves 2 psql queries for about 87% of
reverse requests consequently increasing throughput significantly. A lower
value might make sense if an instance is used only in areas with very
high mapping density but for standard usage this one should be better
suited.
2013-02-12 19:10:36 +01:00
Brian Quinion
e891aa3041 include the type (not just class) in the dedupe 2013-02-07 18:41:17 +00:00
Brian Quinion
7a4d550c7a more debug in reverse geocoding 2013-02-07 18:41:17 +00:00
Sarah Hoffmann
364855c8a5 split query as utf8 string to avoid splitting on non-ascii characters 2013-01-31 20:52:04 +01:00
Sarah Hoffmann
13fff85415 stack importance instead of multiplying it for order 2013-01-31 20:11:40 +01:00
Sarah Hoffmann
f172d7b01e order results by importance of address parts 2013-01-31 20:10:58 +01:00
Brian Quinion
adcafde481 now data isn't so lagy show the 'real' import date 2013-01-31 15:36:51 +00:00
Brian Quinion
3852096c80 avoid dropping tokens completely just because they are expensive. Use ' ' token in preference to just dropping 2013-01-31 14:17:41 +00:00
Brian Quinion
4bc40d2c0b for structured queries assume 2 char country param values are a iso country code 2013-01-30 13:40:04 +00:00
Brian Quinion
68e4fddbc6 Change round how CONST_Max_Word_Frequency is applied. Was causing some valid combinations to be skipped (e.g. Casal De São Tomé). Change structured queries so the first search term can't end up in the address term 2013-01-30 13:40:04 +00:00
Brian Quinion
f9a7f03239 A bunch more places that should be using calculated_country_code not country_code 2013-01-24 16:17:37 +00:00
Brian Quinion
a2f1dd1c31 clean up some of the debug output 2013-01-24 16:06:56 +00:00
Brian Quinion
fca2d00617 Basic status page for monitoring nominatim is working 2013-01-24 12:42:42 +00:00
Sarah Hoffmann
1d836f6c5c update to OpenLayers 2.12 2013-01-22 21:06:29 +01:00
Brian Quinion
550523df1b For structured queries remove type list for building / street level features 2013-01-19 01:47:24 +00:00
Sarah Hoffmann
3d8d52632b respect exclude_place_ids in poi searches 2013-01-18 22:27:18 +01:00
Sarah Hoffmann
b567185966 allow country name at beginning for reverse order 2013-01-18 20:56:46 +01:00
Brian Quinion
d1a224bad4 performance: for low frequency name terms disable use of postgresql address index. Theshold is probably about 1000 but optimal value will probably depend on hardware. 2012-12-20 17:47:57 +00:00
Brian Quinion
4057b21e1f use the new centroid property of placex in queries rather than calculating using st_centroid(geometry) 2012-12-18 12:50:34 +00:00
Brian Quinion
d1f266509a Include the centre point on the details page 2012-12-17 15:28:37 +00:00
Brian Quinion
0dd10c3fff Change access control to implement more of CORS. Change so OPTIONS requests don't do an actual search/reverse request 2012-12-17 00:25:06 +00:00
Sarah Hoffmann
fa1f23edfb more isset checks for PHP variables 2012-12-12 18:49:21 +01:00
Brian Quinion
c98e59be03 included calculated importance on details. Change importance calc to prefer places with a wikipedia tag now that the code is better tested 2012-12-12 01:44:39 +00:00
Brian Quinion
0dafda7327 if doing structured query limit the types of osm place returned 2012-12-08 21:40:20 +00:00
Brian Quinion
274f381052 prune list of blocked items if too large, different costs for different page types 2012-12-08 21:39:24 +00:00
Brian Quinion
a276b6b53a Experimental option to dry dropping query terms as part of search plan (disabled by default) 2012-12-03 17:41:29 +00:00
Brian Quinion
cc24d998e4 move deletable and polygons into default website 2012-12-03 14:26:29 +00:00
Sarah Hoffmann
e66df16ecb add web view for import_polygon_delete 2012-11-29 21:44:59 +01:00
Brian Quinion
72fc234c50 Include the Last Updated timestamp in details 2012-11-18 14:58:46 +00:00
Sarah Hoffmann
4da0ed3204 don't search for country if house number was requested 2012-11-17 22:28:01 +01:00
Sarah Hoffmann
8d96e87b93 internally use higher result limits
Avoids that too few results are returned when there are duplicates
in the results due to linked places.
2012-11-17 21:16:47 +01:00
Sarah Hoffmann
e02c9b6e69 clean up details page
Make it pass as valid XHTML and move CSS into its own file.
2012-11-16 23:04:25 +01:00
Sarah Hoffmann
0c9630b24a clean up html for search form
- move CSS to its own file
- make it pass as valid XHTML
- move attribution into Mapnik layer definition
- remove Osmarender layer
2012-11-16 22:35:53 +01:00
Brian Quinion
9eb5b62382 Accidentally used the same variable name for 2 things - broken search by class&type 2012-11-15 17:27:08 +00:00
Sarah Hoffmann
cc3e4aa532 use geometry WKT for highlighting in search view
also cleans up unused code in details view
2012-11-09 22:35:45 +01:00
Sarah Hoffmann
4bb56d98a8 simplify geometry handling in details page
Hand the WKT directly to OpenLayers and let the client do the parsing,
it will be able to handle multipolygons as well as line strings.
Simplify geometries if they have too many points.

Also limit the number of child objects listed to 500.
2012-11-08 22:21:20 +01:00
Sarah Hoffmann
0e3ac756c9 extend error reporting for invalid geometries 2012-11-08 00:06:47 +01:00
Brian Quinion
2b6a163ef9 Get route param working again after recent changes (implies bounded=1) 2012-11-07 01:22:17 +00:00
Brian Quinion
a44f9c6aab Missing some exact name matches when searching for 'special' phrases 2012-11-07 00:48:20 +00:00
Brian Quinion
3c1b21d61c mising string concatenation (.) 2012-11-06 20:04:31 +00:00
Brian Quinion
e70dfa18fa move error messages to consistent 'userError' function and return 400 Bad Request 2012-11-06 13:16:19 +00:00
Brian Quinion
9d8ee88591 make number of polygon outputs allowed a constant 2012-11-06 13:10:25 +00:00
Brian Quinion
f942f7c3bf limit polygon output to one type as a time 2012-11-06 13:06:46 +00:00
Brian Quinion
753d2ac79f Add options to output polygon in various formats: polygon_geojson=1&polygon_svg=1&polygon_kml=1&polygon_text=1 They can be all used at the same time if prefered. Where format and polygon type are compatible output is as native type e.g. format=json&polygon_geojson=1 2012-11-06 00:08:01 +00:00
Brian Quinion
c0d9ba7e0c Handle multipolygon geometry a little bit (return first outer ring) 2012-11-05 22:47:42 +00:00
Brian Quinion
9fcec31000 remove accidentally committed exit command 2012-11-05 14:04:14 +00:00
Brian Quinion
a5d5a92304 include a bit of extra details for polygon errors in output on details.php page 2012-11-05 14:00:54 +00:00
Brian Quinion
f67b1c20e1 don't include linked_place_id places in the sql output (causes errors on paging / number of results returned) 2012-11-05 13:57:02 +00:00
Brian Quinion
a0e39b67d5 Allow option of structured search queries (params amenity,street,city,county,state,country) 2012-11-02 17:52:33 +00:00
Sarah Hoffmann
9d7c51a813 correct penalty for multi-word countries
Country name needs to be the final one within the wordset, not
in the final of all wordsets.
2012-10-14 16:13:22 +02:00
Sarah Hoffmann
a960cf6b71 use geometry column for special phrase queries
It has an index, centroid does not.
2012-10-09 23:57:54 +02:00
Sarah Hoffmann
7b78507ef9 lift restriction on special search term class
All too frequent classes are already filtered out on import of the
special search term tables.
2012-09-30 10:40:44 +02:00
Sarah Hoffmann
e73e67001e ignore frequent partial search terms
Adds word counts from a full planet to the word table. There is a
new configuration option CONST_Max_Word_Frequency which allows to
take into account the word count: the value that was set on import
is used to determine if a word is added to the search_name table.
The value during runtime determines if a single term should be
used for partial search or simply be ignored.
2012-09-25 00:36:34 +02:00
Brian Quinion
030873e0fb reduce effect of missing world now importance is better quality 2012-08-25 20:05:05 +01:00
Sarah Hoffmann
55d3f5a4b9 fix 500 on search for bounded and class query terms
Ignore bounded=1 if no viewbox parameter was given.

New centroid column in placex makes it necessary to name the table
when joining with classtype tables.
2012-08-25 01:09:52 +02:00
Daniele Forsi
38e40cd014 Fix more typos 2012-07-10 15:47:21 +02:00
Daniele Forsi
f082611e25 Fix typos found with codespell in comments 2012-07-10 15:31:01 +02:00