Julian Simioni
0e78167f17
[/place] Accept any valid layer for geonames
...
Instead of checking if the source/layer combination for geonames is
valid, always use the geoname type if the source is set to geonames,
regardless of which layer is in the gid.
This helps us better handle the case where people directly take gids
from our API responses.
Note: this functionality shouldn't be permanent and should be removed
once our new source/layer mapping system is in.
9 years ago
Julian Simioni
18de8b5699
Remove unused test examples
9 years ago
Peter Johnson
49d37eafed
one config per query
9 years ago
Julian Simioni
db895c05b7
Rename `from_address_parser` key to `from_text_parser`
9 years ago
Julian Simioni
b188a2046c
Fix mismatching name of types preference parameter
...
The parameter in clean.types being set by `helpers/text_parser.js` was
"from_address_parsing", but the code in `helper/types.js` was expecting
"from_address_parser". This commit makes both use "from_address_parser"
and adds a test.
9 years ago
Julian Simioni
59b70f7c7e
Rename helper/query_parser to helper/text_parser
9 years ago
Julian Simioni
fef92bd34b
Remove the geoname _type from all layers except venue
...
We can't distinguish between geonames of different layers due to an
ambiguity in our Elasticsearch schema that we unfortunately won't be
able to fix for a few weeks.
So, while it's technically true that there are countries, cities, etc
contained in the geonames dataset, it's still better for now to remove
geonames from these layers. We have good coverage of most coarse layers
from quattroshapes alone, so the impact isn't too bad.
9 years ago
Julian Simioni
06b44e5355
Disallow specifying both focus.point and focus.viewport
9 years ago
Julian Simioni
9dcc296a70
Add focus.viewport rect sanitizer to search
9 years ago
Julian Simioni
36925ca874
Remove bbox sanitizer functionality tests from search sanitizer tests
...
Full functionality testing for the bbox sanitizer should be in the
sanitizer/_geo_common tests. In the search sanitizer tests, only testing
the inclusion of the correct sanitizers, and the interactions between
them, really seems to make sense.
9 years ago
Julian Simioni
29a78db403
Add null island bounding box test
9 years ago
Julian Simioni
db8f98a51f
Remove completed @todo
9 years ago
Julian Simioni
b84652ba20
Refactor sanitize_coord parameter handling
...
This should help reduce duplication when passing values in, as the key
won't have to be specified twice. Also, the parameters are in the same
order as the other sanitize_* methods.
9 years ago
Stephen Hess
00d033101b
removed redundant is-ids-an-array check (already covered by _single_scalar_parameter sanitizer)
9 years ago
Julian Simioni
415029e02b
Use groups sanitiser in sanitize_rect and sanitize_point
9 years ago
Julian Simioni
aa08fb9772
Add optional and required group parameter sanitizers
9 years ago
Julian Simioni
2811569bcd
Switch to source:layer:id ids format in /place
9 years ago
Julian Simioni
d11d185429
Fix missing space in error message
9 years ago
Julian Simioni
2505e92a62
Expect an array of types from _ids sanitiser
...
This doesn't have any effect by itself but allows for the 3-part gid
sanitiser to possibly return multiple types (i.e. in the case of
osm:venue:1000)
9 years ago
Julian Simioni
fa44effdac
Add geoname type to most layers
...
The Geonames dataset includes lots of different kinds of places, so add
them to the mapping.
9 years ago
Julian Simioni
8b1037d7c8
Separate real layers and alias layers into separate objects
9 years ago
Julian Simioni
68c9661c70
Remove all mappings other than helper/type_mapping
9 years ago
Stephen Hess
56d8600218
modified warning message for brevity
9 years ago
Stephen Hess
0f6d08c0ec
set boundary.circle.radius to default if caller did not supply it
9 years ago
Stephen Hess
947797f41e
added warning if any of boundary.circle.lat/lon/radius are supplied + tests
9 years ago
Julian Simioni
ebb3f33b2d
Remove unused test file
9 years ago
Stephen Hess
e90f70ce3d
added sanitizer that verifies that all parameters are single scalar values
9 years ago
Julian Simioni
16450087ee
Use simpler, clearer error on invalid ids length
9 years ago
Julian Simioni
edaf175aa7
Provide better, more consistent, errors on invalid ids
...
All error messages for invalid id formats now use a common format that
explains the nature of the error a bit better.
9 years ago
Julian Simioni
73b289e9e5
Consider tests refactored :)
9 years ago
Julian Simioni
9d21832874
Reformat test for clarity
9 years ago
Julian Simioni
8897c71664
Remove complicated error value test
...
It's better to just specify a few cases if needed
9 years ago
Julian Simioni
18de9a6766
Replace giant switch-statement test with multiple tests
9 years ago
Julian Simioni
03387722fb
Move _ids sanitiser tests to separate file
9 years ago
Julian Simioni
5721841fb3
Clarify name and error message in ids test
9 years ago
Julian Simioni
1b6c61c92e
Leave clean.ids undefined on error
9 years ago
Julian Simioni
65b7db94d6
Fix typo
9 years ago
Julian Simioni
cd63209085
Error on multiple ids parameters instead of warning
9 years ago
Julian Simioni
c687102374
Rename /place id parameter to ids
9 years ago
Julian Simioni
8592c37bf6
Expect multiple ids to be specified as a comma-delimited string
...
Disallow the other way that Node.js allows, which is to list the id
parameter multiple times in the querystring. See #272 .
9 years ago
Julian Simioni
47701277a3
Rename test with duplicate, non descriptive name
9 years ago
Julian Simioni
2cc9107114
Add test for multiple ids
9 years ago
Julian Simioni
bd4fbfe3bd
Whitespace
9 years ago
Peter Johnson
82ab899ecc
progress commit
9 years ago
Julian Simioni
d6abe09447
Use flat clean structure in /reverse
9 years ago
Julian Simioni
97044f655b
Flatten structure of clean for /search focus.point.lat|lon
9 years ago
Julian Simioni
4260442f59
Change boundary.circle params to flat string structure
9 years ago
Julian Simioni
e5ed04858b
Test individual clean attribute intead of using deepEquals
9 years ago
Julian Simioni
1bfa2fde40
Remove empty test of invalid lats
9 years ago
Julian Simioni
a5ba251afe
Remove brittle test fixture from search sanitiser
...
Some of the tests were checking the entire clean object, when they only
cared about one tiny element. This made making changes really hard.
9 years ago