DallasMorningNews / jquery-opencage-autocomplete

Address autocomplete widget using the OpenCage geocoding API
0 stars 0 forks source link

Mapzen is going away 😑 #2

Closed achavez closed 6 years ago

achavez commented 6 years ago

We need to find a replacement and either rewrite this or roll a new plug-in.

Mapzen suggested some replacements in their migration guide:

For search and geocoding, you may want to consider these services:

Mapzen Search was backed by Pelias, an open source project. Read below for how to run this service locally.

It looks like the price on the replacements varies quite a lot so that may end up being the deciding factor.

achavez commented 6 years ago

I looked into the four options recommended by Mapzen and tried a search for "1954 Commerce St, Dallas, TX" on each:

Service Price Test results
Nominatim hosted options available, free version doesn't support autocomplete ❌ Failed (place data only)
OpenCage Data free for 2,500/day and 1/sec.; $50 for 10,000/day and 10/sec. Worked
OSMNames API free with $40/mo. tile hosting plan ❌ Failed (place data only)
Mapbox Search API $0.50 per 1,000 tile requests, but results must be displayed on a Mapbox map, which requires a $499/mo. subscription (because paywall) ? API key required

I also think we should rule out running our instance of Pelias given the substantial complexity and upkeep. Per their installation docs, we need an ElasticSearch instance and an API server. Even using existing, shared resources I think we can expect the cost to approach that of the less expensive services above.

Given all of that, and because we know that Google is cost prohibitive because of the paywall, I'd suggest OpenCage Data out of Mapzen's recommended replacements unless we want to spring for Mapbox.

johndhancock commented 6 years ago

Yeah, I agree. I'd say it'd be pretty rare we'd exceed the free tier, but I worry about on the days we do, it 402-ing out. I think we could ask Editorial to foot the bill for it, unless you think we can/would use this for other projects.

achavez commented 6 years ago

I think the concurrency is the main issue - specifically the 1 per second. With the autocomplete lookup we end up sending 1 per second, so my fear is that when we start promoting this we'll exceed that during peak times.

I do think we'll use this for other projects where we need an address lookup, FWIW.

achavez commented 6 years ago

I'll wire this up with OpenCage Data. I did also investigate SmartyStreets, which is another popular vendor. However, it seems they only do address verification and don't do forward geocoding with the verified addresses.

achavez commented 6 years ago

OK, tapping the breaks real quick. Here's a potentially better option.

It's free up to 100,000 queries/mo. and the autocomplete widget is already built and looks really slick: https://community.algolia.com/places/

I've looked at the code on Github and the docs and it looks like it can be used as a replacement not just for Mapzen, but for this entirely library, which I'm definitely in favor of. And I think the user experience will be much better. Check out, for example: https://community.algolia.com/places/

@jdhancock88, if you're cool with this I can swap out what's in voter guide and then deprecate (for now) this library. I think we can keep the code around just in case we someday have to replace Algolia again.

johndhancock commented 6 years ago

Go for it, @achavez

achavez commented 6 years ago

Closing in favor of switching to Algolia

achavez commented 6 years ago

Re-opening this because Algolia turned out to be stupid expensive ...