Code Monkey home page Code Monkey logo

digitransit-geocoder's People

Contributors

hannesj avatar hukka avatar samuliheljo avatar siren avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hjtamaral

digitransit-geocoder's Issues

Geocoder API

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.

Reverse geocoding runs out of memory

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]

Geocoding API

  • Decide whether we use pelias API or ElasticSearch API
  • Search metadata parameters support (See: #1)

Documentation

Document how implementations works see #1

  • What are endpoints
  • How they should be used
  • What do endpoints return
  • How do endpoints vary

Let's start by writing documentation to git repo readme.

Usability: Reduce amount of results to 10

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.

Bug with interpolation

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

OSM import improvements

We should get from OSM:

  • addresses
  • "building characters" ("talokirjaimet")
  • Stairways
  • places

Geocoder requirement analysis

Start by doing some user stories about the actual usage. After this, we will decide how to proceed with geocoding.

Interpolate addresses from NLS data

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.

Multilingual OSM data

Often OSM has data in only one language, and does not tell what that language is.

Test Pelias locally

Pelias demo has problems with data import, so we need a customized version to test the existing features

  • Switch address numbering from US to Finnish style
  • Import all address data also in Swedish to test multilingual search

Geocoder requirements

Imported Datasources

  • Seudullinen osoiteluettelo
  • MML kunnat
  • Palvelukartta pääkaupunkiseutu
  • OSM
  • Valtakunnallinen palvelukartta
  • Liikuntapaikat (lipas-service)

Searchable data

  • Geocoding (position for given text):
    • Address
    • Stop short number
    • Stop long number
    • POI
    • District (kaupunginosa)
    • City
  • Reverse geocoding (text for given position)
    • Address

Search metadata parameters

  • Search modes
    • "Pääkaupunkiseutu tagged": Only search for tagged data for "pääkaupunkiseutu".Note: "Kaupunkiseutu" is not an area on map. It is all data that is tagged for it.
    • "All": Search in all of Finland
  • Zoom level
    • Geocoding should take zoom level as parameter. This should affect whether addresses are returned. I.e. on low zoom level only city district or city should be returned.
  • True/False whether services (e.g. libraries) should be returned. Check http://dev.hel.fi/servicemap
  • How many search results are returned per "result type" (address, poi, ...)

Matching of search results

  • Match should be full text search. E.g. "man" should match "man"
  • Match should work with typos. Consider Levenshtein algorithm.
  • Matching should work with "typos" and "suggestions"
  • Address search should recognize match without comma before city in search string e.g: "opastinsilta 6 helsinki"
  • Address search should recognize match without the name of the city e.g: "linnankoskenkatu 10" finds: "Linnankoskenkatu 10, Helsinki".

Language support

  • Support: Finnish and Swedish.
  • If UI language is in Swedish: Return results in Swedish
  • If UI language is in Any other language: Return results in Finnish

Returning results

  • No duplicates should be returned if same target is found from multiple datasources.

Ordering of results

  1. Address
  2. POI (e.g. Finlandia house, Tampere)
  3. Service (e.g. Library)
  4. Stop name
  5. Stop number
    If same street name exists in multiple times, order is according alphabetic order of city name. e.g. "koivutie 4" gives first "Koivutie 4, Kirkkonummi".

Search speed

  • Search should be as fast as possible. One second is too slow, it should be around 100 - 300ms.

Documentation

  • Document how geocoding is implemented

Requirements on UI

  • When user clicks on search box, system should immediately show:
    1. Favourites. Order these by distance from current location if possible.
    2. Previous searches

Test suite for the API

Integration tests for each API endpoint, varying capitalization of words, including non latin chars

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.