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

Location field does not support county-level lookup in the US. #426

Closed
sratcliffe118 opened this issue Jul 2, 2020 · 14 comments
Closed
Assignees
Labels
Data UI Bug is related to Data frontend functionality Data Bug is related to data P1: Launch blocker Needs fixing before we launch, schedule some time to investigate & fix

Comments

@sratcliffe118
Copy link

sratcliffe118 commented Jul 2, 2020

Location field does not support county-level lookup for the US.
This is a standard expectation to be able to enter the county (in the US) in which a case is occurring.
“In the United States, having county level data is critical”

@attwad
Copy link
Contributor

attwad commented Jul 2, 2020

Still waiting Jared's for this, he sent an email to their mapbox contact and we're awaiting a reply.

@attwad attwad changed the title Location field does not support county-level lookup. Location field does not support county-level lookup in the US. Jul 2, 2020
@sratcliffe118 sratcliffe118 added the P1: Launch blocker Needs fixing before we launch, schedule some time to investigate & fix label Jul 2, 2020
@attwad attwad added enhancement and removed bug labels Jul 2, 2020
@JaredHawkins
Copy link

Hey all! I haven't heard back from Mapbox. I have a follow-up email set to go out this afternoon if I still haven't heard back.

@sratcliffe118
Copy link
Author

Hi Jared, any update here, this is a key blocker for our first milestone

@JaredHawkins
Copy link

They said: "Sounds like we do not currently have counties as a returnable data type in the US. If you have a counties layer then you could do a spatial join to extract that information for your current dataset." I know that Mapbox has county layer(s), and followed up asking if we can speak to an engineer on their recommended work around - but I haven't heard back yet.

@JaredHawkins
Copy link

Mapbox says:

If you are using the points returned from the geocoder AND you have a county tileset then I would recommend that you try using our Tilequery API. You can pass the lat/long coordinates to our Tilequery API to retrieve the county name.

Tilequery information

https://docs.mapbox.com/help/tutorials/create-a-timezone-finder-with-mapbox-tilequery-api/

https://docs.mapbox.com/help/tutorials/tilequery-healthy-food-finder/#add-the-tilequery-api

Hope this helps!

I've asked them if there is an existing Mapbox tileset for county (I believe there is), and am awaiting more info. They have confirmed that county is not returned for US, and I'm also waiting on some more clarity as to why that is the case.

@JaredHawkins
Copy link

OK, I just had a nice talk with Mapbox. This sums it up:

Counties are not available in our geocoder because they are tied directly to our Mapbox Boundaries product. This is a bit frustrating, I know, but it's one of our high-value products. Counties are a fairly easy geospatial file to track down. I can talk to the team about opening up access to boundaries for your map, but it might just be easier to upload your own tileset to Mapbox. I usually get my US data from the census website (tigerline files). I've attached the 2019 county shapefile from the site, as well as a file named US_County.mbtiles. I used Tippecanoe to create the mbtiles so that the counties are visible at every zoom level. The recipe for creating a Continuous polygon features (states and provinces), visible at all zoom levels.

I have the files she mentions - @sratcliffe118 who is best to take a look? Alternatively to using the Tilequery API, we could just use these shapefiles to do our own local lookup (for the US) to see what county any given point falls in. I'd imagine that would be straightforward.

@JaredHawkins
Copy link

As a follow-up, if we feel that we really need Mapbox Boundaries (https://www.mapbox.com/boundaries/), lets regroup. We can definitely ask this of Mapbox, as long as we articulate why we need this product vs a the layer approach (either via mapbox or locally).

@sratcliffe118
Copy link
Author

@allysonjp715 is this something you can look at while Tim is out, or should we park this US requirement until Tim is back and pivot to some other countries.

Note @axmb I don't see any reason not to test the bulk entry with ohio data but we will have to limit location to state and not county level

Thoughts?

@sratcliffe118 sratcliffe118 added Data UI Bug is related to Data frontend functionality P0: Critical path blocker Blocking testing or the launch critical path, drop everything to investigate & fix Data Bug is related to data P1: Launch blocker Needs fixing before we launch, schedule some time to investigate & fix and removed enhancement P1: Launch blocker Needs fixing before we launch, schedule some time to investigate & fix P0: Critical path blocker Blocking testing or the launch critical path, drop everything to investigate & fix labels Jul 8, 2020
@allysonjp715
Copy link
Contributor

Tim is the one who has been doing all the mapbox integration so he'd certainly be more familiar with it. Is 1.5 weeks too long to wait? I can take a deeper read into this tomorrow or Friday and see if I can pick it up.

@sratcliffe118
Copy link
Author

@allysonjp715 I think we are good to wait for Timothe to return, we can pivot to other geo's in the short term so we are not blocked

@dakrownie
Copy link
Contributor

@attwad Welcome back!
This is an open issue with the MapBox API. PTAL.

@attwad
Copy link
Contributor

attwad commented Jul 20, 2020

Hmm so we're in the same position as when I left, we already had identified the counties in the tileset API but optimally we wouldn't have to do two queries (or even upload our own tileset!) that's quite frustrating...
I could look into doing that tileset query as mentioned in Jared's comment from mapbox engineers, if it turns out too cumbersome we'll have to figure another way out.

@dakrownie
Copy link
Contributor

Thanks Tim! Please let me know if you need me to do anything.

@attwad
Copy link
Contributor

attwad commented Jul 29, 2020

We have to account for the fact that no geocoder will have 100% recall (and no 100% precision either), so I made the Location part of the form editable: if the mapbox geocoder fails one can enter the location manually as it was done previously in the sheets system.

Another way to do things when no results are given by the geocoder: one can also now try something in the vicinity and then fix the fields that are not exactly what they wanted them to be (name for example).

I consider this bug fixed, there is still an open question of batch geocoding in #622 when no results are found.

@attwad attwad closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data UI Bug is related to Data frontend functionality Data Bug is related to data P1: Launch blocker Needs fixing before we launch, schedule some time to investigate & fix
Projects
None yet
Development

No branches or pull requests

6 participants