Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement IPlacesService #6

Open
AlexBulankou opened this issue Oct 29, 2016 · 0 comments
Open

Implement IPlacesService #6

AlexBulankou opened this issue Oct 29, 2016 · 0 comments
Milestone

Comments

@AlexBulankou
Copy link
Contributor

AlexBulankou commented Oct 29, 2016

Review: https://github.com/stopbystop/sbs-app/blob/master/README.md

Implement IPlacesServices on PlacesService. Method descriptions are in interface definition file. Then start using new service in https://github.com/stopbystop/sbs-app/blob/master/src/web/Controllers/PlaceController.cs.

  • Every method should be fully covered by unit tests
  • Places service should load city entries by calling GetGeoPlacesFromEmbeddedFile in constructor and cache them in memory after that.
  • FindPlacesByPartialMatch for 10 results should return the same list of cities as this call.
  • FindPlacesByPartialMatch should use a Trie data structure that is storing the city entries by starting letters, here's a visual example from wiki article:
    img
    This way to get the results matching the input is a matter of going to the prefix from the top, then traversing the subtree and ordering the results by populating in descending order.
  • FindPlacesInArea should be using efficient data structure, so that we are partitioning cities efficiently and only look at required partitions around the center location. It should not be iterating over all results.
  • No external libraries should be used. If you would like to use one, check with @AlexBulankou first

This task has 2 parts:

  1. Implement FindPlacesInArea and GetLocationFromPlaceID
  2. Implement FindPlacesByPartialMatch
@AlexBulankou AlexBulankou changed the title Task #1: Load city data into PostgreSQL db and implement IPlacesService Implement IPlacesService Nov 14, 2016
@AlexBulankou AlexBulankou added this to the App-0.7 milestone Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant