-
Notifications
You must be signed in to change notification settings - Fork 1
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
Polygon map search results #338
Comments
On the Core Data Cloud side, it looks like the The Typesense index should include a |
Sounds good. So it seems like the first thing I should focus on for Monday is adding that toggle to the component on Core Data Cloud, and maybe discuss with Jamie/Ben/Rebecca on Slack to determine whether any projects would need polygons in their search results? I wonder if we should automatically use polygons for countries/regions and points for cities/addresses without making the user toggle between them. It's possible that >99% of users will expect cities to be points and countries to be polygons, making the manual toggle feel tedious. |
That sounds good to me. With more developers coming onto Core Data, I'm hoping to have us all follow a process for moving issues through development/testing. I'd like to keep high-level concepts and discussion separate from the actual dev tasks. Could you convert this issue into an epic and add issues in the
I think this is probably fine if it's simple enough to do. Depending on the type of project and the source data, I could see situations where users may only want coordinates regardless of the type of place. I think defaulting to points/polygons are you described above is fine as long as users have a may to override if necessary. |
Summary
Currently, the map search in Core Data only allows us to select points. This makes sense for cities, but not for countries or regions. Users should be able to connect a Place record with a full polygon on the map and then view that polygon on the map in core-data-places.
Plan
The behavior of the main example on the MapTiler website is almost exactly what we want to implement.
https://api.maptiler.com/geocoding/iceland.json
, which contains search results for the termiceland
. Each search item from this endpoint contains a) a point in the center of the country's capital, and b) four coordinates for a bounding box that's also not very useful. The search data does not include polygons, and as far as I can tell there's no way to get them directly from a search request.id
field from the search item to make another API request, this time a direct ID lookup:https://api.maptiler.com/geocoding/country.42.json
(country.42
is the ID). This response includes full geographical data, including all the points in a polygon of the country's borders.Steps 5-6 are the parts that Core Data doesn't do, and the ones we want to add.
Core Data Cloud and
react-components
The
MapDraw
component fromreact-components
has anonGeocodingSelection
prop that I think will allow us to handle steps 5-6 from within Core Data Cloud, without requiring changes toreact-components
. However,react-components
might require a small PR if my understanding of that prop is incorrect or if e.g. it expects the function to be synchronous.Core Data Places and Typesense
See https://pan-african-data-project.netlify.app/en/map/#/&map=4.21/28.27/-3.48
I manually drew a polygon around Algeria to see how well Core Data Places handles it. Like Derek said in our meeting, the Typesense index only includes the central point and not the polygon. But when you click on Algeria in the list, the data is fetched from Core Data and you can see the polygon.
This status quo might be okay? The search result map would look really busy with tons of polygons on it. Storing the center point of a country in the Typesense index and then fetching the full polygon from Core Data makes sense to me, so we might not need to make changes to Core Data Places or to the way that
core-data-connector
indexes places.The text was updated successfully, but these errors were encountered: