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

Community microservice #80

Closed
bhousel opened this issue Apr 17, 2018 · 6 comments
Closed

Community microservice #80

bhousel opened this issue Apr 17, 2018 · 6 comments
Assignees

Comments

@bhousel
Copy link
Member

bhousel commented Apr 17, 2018

We could experiment putting this community index behind a simple microservice so that any requestor can ask "what are the communities around this lat/long point" and get back an answer.

I've been wanting to play around with up for a while and that might be a fun use of the technology. (It's free up until we hit 1 million requests per month).

cc @mikelmaron

@kamicut
Copy link

kamicut commented Apr 17, 2018

Ah, I'm interested in helping 👋 this could be fun. You could push all the data into Rbush or create an mbtiles (spatialite? 🤔 ) for static access if you don't want a database.

@bhousel
Copy link
Member Author

bhousel commented Apr 17, 2018

Ah, I'm interested in helping 👋 this could be fun. You could push all the data into Rbush or create an mbtiles (spatialite? 🤔 ) for static access if you don't want a database.

Cool @kamicut it would be fun to build this!

I discussed this briefly with @mourner last week and he pointed me at which-polygon - this is what I'm using on the iD side. It takes a bunch of geojsons and puts them into an rbush index for fast bbox querying, then does a point-in-polygon test on the results.

The up FAQ has some information about what it does, basically wrap the application in a Lambda function and push it to AWS, abstracting away all the scary parts. I am a total n00b at this. My understanding is that AWS Lambda will keep function's execution context around for a little while (it can "freeze" and "thaw" them) in case it gets called again - so I'm assuming that the even though building the index of geojsons is very fast, it wouldn't have to happen every time we call the service.

@kamicut
Copy link

kamicut commented Apr 17, 2018

I've used which-polygon before, it's pretty neat! The reason I suggested creating an mbtiles is the problem of persistence and rebuilding the index. I wonder if @mourner has any thoughts on serializing the index to a file.

I also like the approach of datasette with datasette publish where they rebuild an image and publish the microservice to Zeit Now which is similar to up but supports dockerfiles.

@mourner
Copy link

mourner commented Apr 19, 2018

@kamicut at this point I wouldn't worry about serializing the index — it's too cheap to calculate and the original data is too small (just 150kb uncompressed). We can reconsider when we need to scale significantly.

@kamicut kamicut self-assigned this Apr 19, 2018
@jbelien
Copy link
Contributor

jbelien commented May 9, 2018

I will also try to add this to my "tool" : https://community.osm.be/ :)

@bhousel
Copy link
Member Author

bhousel commented Aug 27, 2019

stale

@bhousel bhousel closed this as completed Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants