hsldevcom / digitransit-geocoder Goto Github PK
View Code? Open in Web Editor NEW[Deprecated for Pelias] Geocoder based on Elasticsearch
License: Other
[Deprecated for Pelias] Geocoder based on Elasticsearch
License: Other
Debian has a custom version of pip, which broke in testing: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786580
Integration tests for each API endpoint, varying capitalization of words, including non latin chars
Endpoint | Description |
---|---|
/address/<city>/<streetname> | Return all housenumbers with locations on the given street, in given city. |
/address/<city>/<streetname>/<housenumber> | Return location for given housenumber in given street and city. |
/suggest/<search term>[?city=Cityname[&city=Anothercity]] | Return all kinds of objects with given term anywhere in the name. Streetnames are returned per each city and including number of addresses in the street. All other objects include location. Every type is in a separate list with a field name in result object. Also returns streetnames with Levenshtein distance of two. Query parameter city can be specified one or more times to limit suggestions to within those cities. |
/reverse/<lat>,<lon>[?zoom=8] | Return nearest address for given WGS84 coordinates. If given zoom level is under 8, then returns municipality, not an address. |
/interpolate/<streetname>/<housenumber> | Return an estimated location for an address interpolated from road network data. |
/meta | Return metadata about the API. Currently the date when the data was last updated in "updated" field in ISO 8601 format. |
We should get from OSM:
For example Opastinsilta 6a is shared with HSL and local pub. Return both or just a centroid. Currently geocoder returns one 6a and one 6A each...
ERROR:tornado.application:Uncaught exception GET /interpolate/mannerheimintie/10 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/interpolate/mannerheimintie/10', version='HTTP/1.1', remote_ip='::1', headers={'User-Agent': 'curl/7.38.0', 'Host': 'localhost:8888', 'Accept': '/'})
Traceback (most recent call last):
File "/home/hukka/addressimport/lib/python3.4/site-packages/tornado/web.py", line 1302, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "", line 3, in raise_exc_info
File "/home/hukka/addressimport/lib/python3.4/site-packages/tornado/stack_context.py", line 314, in wrapped
ret = fn(_args, *kwargs)
File "./app.py", line 34, in on_response
self.write(self.transform_es(json.loads(response.body.decode('utf-8'))))
File "./app.py", line 164, in transform_es
fraction = (self.streetnumber - int(street["min" + self.side])) /
TypeError: int() argument must be a string or a number, not 'list'
ERROR:tornado.access:500 GET /interpolate/mannerheimintie/10 (::1) 33.33ms
ERROR:tornado.access:500 GET /reverse/60.19,24.93 (172.17.2.247) 20003.41ms
Caused by: java.lang.OutOfMemoryError: Java heap space
[2015-04-13 13:10:04,943][DEBUG][action.search.type ] [White Pilgrim] [reittiopas][4], node[lH7ZBJ4yTV2SBnoO7XGXHQ], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@29fcc13c] lastShard [true]
See #1
Either elastic-wait needs to be modified to check shard status, or app.py needs to handle 503 gracefully.
Currently only capital area services are imported
Results are ordered as described in #1
Now these return response in different format:
Unify response.
All fields in "/search/address" should be included to "/search/address/number"
Example: Virsutie 5 finds Virsutie 4-6.
If we can't get accurate address information for the whole country, we need to use the road/street data from National Land Survey with interpolation.
As a quick fix to get UI more responsive to search, reduce amount of returned results to 10 per returned type.
Now there is problem that UI basically jams when trying to parse too many results.
see #1
Imported Datasources
Searchable data
Search metadata parameters
Matching of search results
Language support
Returning results
Ordering of results
Search speed
Documentation
Requirements on UI
Start by doing some user stories about the actual usage. After this, we will decide how to proceed with geocoding.
Currently GTFS has only Finnish
Pelias demo has problems with data import, so we need a customized version to test the existing features
e.g.
Opastinsilta 1
Opastinsilta 2
Opastinsilta 3
...
Opastinsilta 10
Why such address exists?
http://matka.hsl.fi/geocoder/search/helsinki/kivikallio
Often OSM has data in only one language, and does not tell what that language is.
http://www.elastic.co/guide/en/elasticsearch/guide/current/_important_configuration_changes.html needs to be read carefully when setting up the real thing.
See #1
Document how implementations works see #1
Let's start by writing documentation to git repo readme.
Check that languages work as described in #1
Search for "sampsantie", you will see that city is "helsinki". Should be "Helsinki"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.