Commit Graph

24 Commits

Author SHA1 Message Date
Sarah Hoffmann
0417946153 make reverse API work with sqlite 2023-10-23 17:19:12 +02:00
Sarah Hoffmann
7fcbe13669 move get_addressdata() implementation to Python
The pgsql function get_addressdata() does a lookup of a lot of data
that is already available in Python.
2023-09-26 11:21:36 +02:00
Sarah Hoffmann
9848c4c56c implement NOMINATIM_SEARCH_WITHIN_COUNTRIES setting 2023-09-04 14:10:36 +02:00
Sarah Hoffmann
23eed4ff2f fix tag name for housename addresses in layer selection
Fixes #3156.
2023-08-19 15:57:33 +02:00
Sarah Hoffmann
886374d779 add lambdas for layer filters 2023-07-14 15:27:20 +02:00
Sarah Hoffmann
d42e2e391f avoid forwarding variables via SQL 2023-07-14 15:27:16 +02:00
Sarah Hoffmann
f264eaeda2 make SQL statements in reverse lambda functions
Further improves internal caching of statements by SQLAlchemy.
2023-07-14 14:39:14 +02:00
Sarah Hoffmann
d743cf308e avoid index-use on rank parameters for reverse lookups 2023-07-09 22:49:31 +02:00
Sarah Hoffmann
75139961a3 use constant expressions to select partial indexes in reverse
When expressions are generated with SQLAlchemy, any constants are
replaced with bind parameters. The bind parameters become parameters of
prepared statements. The result is that the query planner tends to
oversee that the partial indexes can be used.
2023-07-09 00:31:53 +02:00
Sarah Hoffmann
49e0d83d5d fix linting issues 2023-07-01 20:18:59 +02:00
Sarah Hoffmann
9f6f12cfeb move search to bind parameters 2023-07-01 18:03:07 +02:00
Sarah Hoffmann
6c4c9ec1f2 switch reverse() to new Geometry datatype
Also switches to using bind parameters for recurring parameters.
2023-07-01 18:03:07 +02:00
Sarah Hoffmann
4bb4db0668 introduce slim Geometry database type 2023-07-01 18:03:07 +02:00
Sarah Hoffmann
dcfb228c9a add API functions for search functions
Search is now split into three functions: for free-text search,
for structured search and for search by category. Note that the
free-text search does not have as many hidden features like
coordinate search. Use the search parameters for that.
2023-05-24 18:05:43 +02:00
Sarah Hoffmann
7f1a0ce94a fix use of subquery in reverse 2023-05-18 20:27:07 +02:00
Sarah Hoffmann
bef5cea48e switch API parameters to keyword arguments
This switches the input parameters for API calls to a generic
keyword argument catch-all which is then loaded into a dataclass
where the parameters are checked and forwarded to internal
function.

The dataclass gives more flexibility with the parameters and makes
it easier to reuse common parameters for the different API calls.
2023-05-18 17:42:23 +02:00
Sarah Hoffmann
1e2a1d9ce5 limit results for country lookup 2023-03-30 10:00:19 +02:00
Sarah Hoffmann
26ee6b6dde python reverse: add support for point geometries in interpolations 2023-03-29 17:21:33 +02:00
Sarah Hoffmann
e158017086 ignore broken data in interpolation table 2023-03-28 14:57:39 +02:00
Sarah Hoffmann
6c67a4b500 switch reverse CLI command to Python implementation 2023-03-26 18:09:33 +02:00
Sarah Hoffmann
86b43dc605 make sure PHP and Python reverse code does the same
The only allowable difference is precision of coordinates. Python uses
a precision of 7 digits where possible, which corresponds to the
precision of OSM data.

Also fixes some smaller bugs found by the BDD tests.
2023-03-26 16:21:43 +02:00
Sarah Hoffmann
55277738d4 factor out layer checks in reverse function 2023-03-24 10:08:01 +01:00
Sarah Hoffmann
2f54732500 python: implement reverse lookup function
The implementation follows for most part the PHP code but introduces an
additional layer parameter with which the kind of places to be returned
can be restricted. This replaces the hard-coded exclusion lists.
2023-03-23 22:38:37 +01:00
Sarah Hoffmann
41da298b18 add python implementation of reverse
This adds an additional layer parameter and slightly changes the
queries to do more efficient lookups for large area features.
2023-03-23 10:16:50 +01:00