Input data format
alexcojocaru opened this issue · 3 comments
This is not an issue per se, but more of an ask for clarification.
The README describes the format of the input data, but I couldn't find any lib which can convert a simple GeoJSON (which is what I get from polyline.toGeoJSON()
, see below for an example) to the more detailed GeoJSON required by the heightgraph. I am mainly interested in getting the steepness information.
Thanks
{
type: "Feature",
geometry: {
coordinates: [
...
],
type: "LineString"
}
Thanks for your interest. I don't think that there is currently an automated way to convert geojson.
I think this would be a nice feature however (but I am not 100% sure how this can work without knowing too much about the actual data). If you would like to contribute such a feature, please let me know and we can work out how this should work. Otherwise I recommend to do this manually.
An example how this could be done can be found here: https://github.com/graphhopper/graphhopper/blob/186d6d17cc7ae50a089d55378f738900db575f07/web/src/main/resources/assets/js/map.js#L276
Thanks for the pointers, I will have a look at that.
I was planning on doing it outside the heightgraph library for, based on the simple info in the GeoJSON (i.e. lat, lng & alt), only the steepness can be inferred; once I can add that to the basic geojson, my plan was to pass it to the addData
function in heightgraph.
If you think it's a good idea, I could write that code in the heightgraph - so that the client does not need to concern itself with this.
If you think it's a good idea, I could write that code in the heightgraph - so that the client does not need to concern itself with this
I thought about this a bit, probably that's too specific for this repository. If you open source it, feel free to leave a link here or maybe to post the code you used so that someone else might reuse it. But I think not everyone is interested in showing the steepness of the data.
I will close this issue for now.