-
Notifications
You must be signed in to change notification settings - Fork 0
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
Structure admin area endpoints #61
Comments
BTW I can even imagine we don't need |
It helps to understand how the api is structured and what's the relation between the different elements. |
A big 👍 from me! @olafveerman Not sure about |
Ah, good point. Will also include that in the documentation, thanks @anandthakker |
Yeah, I also think this is a good list to start with on Phase 2. It'd be nice to have the flexibility as we flesh out these analytics pages more. |
Had a look at the current endpoints and how the data is structured. Here's a proposal for what the data could look like for the new endpoints: /admin/:id (Basic meta-data (name, id, type))
/admin/:id/boundary (Basic meta-data + Boundary)
/admin/:id/road-network (Basic meta-data + Road network)
Thoughts? Is this what you had in mind? @dereklieu You thinks it's enough to omit the properties we don't want from the response or should we change the db queries and do not return them in the first place? What kind of implications does this have? |
@danielfdsilva do you mean all the nulls for As for the json/geojson schism, I hadn't thought of it but it's a little strange now that you bring it up. I guess I wouldn't mind turning the road-network into geojson format, but since the base admin endpoint is about the metadata, I'm fine keeping that as json. |
@danielfdsilva and I'd have to check but I'm pretty sure making any changes here will break the dashboards, to some degree. So we should look into that and do the appropriate changes before we push these live. |
@dereklieu Actually I meant something different. The These changes are going to break the dashboards. Before pushing this we need to make changes to the dashboards as well. |
@danielfdsilva sorry, not sure I understand the question here. What are we looking for here? Is it that we're doing an unnecessary calculation of geometry without using it? And yes, the Yes, these changes will break the dashboards. The easiest way would be, once you're at a stage where you feel good about the refactor, push these changes up to a branch so we can figure out what's different, then modify the dashboards accordingly. |
Document with the current status / some points to consider: |
I think we can remove them, but I'll double check that tomorrow morning
The third administrative level is usually a Municipality, but can also be a City. My guess is that TYPE_3 is the Philippine term and ENGTYPE_3 is the English translation. Again, will check tomorrow.
Yes, but in principle we should always return a boundary on the boundary endpoints. Could we simplify the {
"id": 13000000000,
"name": "Region IV-B (Mimaropa)",
"properties": {
"NAME_0": "Philippines"
},
"adminAreas": [
{
"id": "13020000000",
"name": "Agusan Del Norte",
"X_COORD": 118.46191032700001,
"Y_COORD": 9.50722963322
},
{}
]
} Each adminArea doesn't need a sub-object with properties, since they will always be the same as their parent. |
Yes, valid point. We could event remove it for the parent and standardize. We'd only leave it when the response is geojson |
There is still value in storing data about the parents of the parent. The above example is not really good, since we're dealing with the highest level in the country, but on a municipality level, we'd include the names and id's of the parents. |
Gist updated with current version of the API. @olafveerman @dereklieu please check if the proposed structure works |
Looking good.
|
Ah, it probably would be useful to return the names/ids of parents even when the road network or boundary is too large to display. I'm onboard with the second point too, it's small but would make calling the api more consistent throughout the dashboards. |
@olafveerman @dereklieu |
Sorry I'm coming in so late here -- couple comments: Looks like I wonder if, semantically, it makes more sense to accept a query parameter like |
@danielfdsilva I think Olaf's first point is also what I raised, which is that we should have parent data even when the boundary is too large. However, you responded to this nicely which is that we already have an endpoint that does this. And then Anand came along with the better suggestion that yes, this does seem to be the case where a ? param seems to make sense, such as Is this feasible @danielfdsilva? |
👍 to what was said above |
Should both parameters be mutually exclusive? |
I'd say so, because since the response is a geoJSON it can only be about one thing (right?), and also because it probably grows too large. So, summarizing the new endpoints:
Yay? |
👍 |
Triggered by Derek's question in orma/openroads-analytics#52, I think there is some room for improvement on the endpoints that deal with administrative areas, especially on how we structure the routes.
Here's a proposal that aims for two things:
Single administrative areas
Get information from a single administrative area. Does not include a reference to its descendants.
/admin/:id
/admin/:id/boundary
/admin/:id/road-network
Subregions
Get data from the subregions of a given area.
/admin/:id/subregions
/admin/:id/subregions/boundary
@dereklieu @kamicut @anandthakker @danielfdsilva
Would be great to hear your thoughts. Whether you agree that there is a need to begin with, the proposed structure, etc. This could be tackled first thing in phase 2.
Let me know if you want me to illustrate it with examples from the response.
The text was updated successfully, but these errors were encountered: