traffordDataLab / leaflet.reachability

Plugin for the Leaflet JavaScript library to show areas of reachability based on time or distance for different modes of travel using the openrouteservice isochrones API.
MIT License
64 stars 7 forks source link

Control for `attributes` parameter #1

Closed nilsnolde closed 5 years ago

nilsnolde commented 5 years ago

Might be of interest to include the reachability attribute to the isochrone output or alternatively add a control parameter for which attributes to get.

Also, we have a new smoothing parameter. It's not really documented yet, but it's working. Here you can see some documentation on it inline. Its range is [0.0, 1.0] and it's a float.

itsozz commented 5 years ago

Hi Nils, thanks very much for the suggestions. Regarding the first point, just checking I'm correct that this is the reachfactor attribute? If so, is there any further information available on this other than what is mentioned in the API docs that it is a score between 0 and 1? e.g. What the score is based on etc.

I'll have a look at the smoothing parameter as well, thanks for letting me know.

nilsnolde commented 5 years ago

Oops, so sorry, didn't see this one.

You're right, it's not documented.. It basically calculates the ratio of actual isochrone area over the theoretically possible area one could reach if there were no roads (i.e. as the crow flies). That assumes a certain speed and is not actually modelled like the routing, just a plain circular "isochrone/equidistant" with constant mode speed. Hope you understood what I mean.

We're rebuilding a bit of that currently, since these constant speeds were waaay too high (50 km/h for bike haha), so reachibility was ALWAYS < 0.2 or so, even in super accessible areas like central squares in cities.

itsozz commented 5 years ago

No problem at all Nils, really appreciate your feedback and input. Thanks very much for the clarification. Please could you let us know when you've finished updating this aspect?

itsozz commented 5 years ago

Hi @nilsnolde, just picking up on this one again whilst preparing the new version of the plugin to use the V2 API. I've implemented the smoothing parameter and am now looking at reachfactor. Please can you confirm that reachfactor is only returned when range_type = "time" not "distance"?

nilsnolde commented 5 years ago

Hm, shouldn't be, but you're right! I'll look into it real quick and might open an issue on our side.

itsozz commented 5 years ago

Thanks as always Nils for your fast response. Hope it's not a pain to fix!

nilsnolde commented 5 years ago

No worries:)

I actually did fix that while fixing general issues with reachfactor here. However, it's not in master yet, which confuses me a little. Let me talk to our git lord tmrw when he's back and get back to this.

itsozz commented 5 years ago

That's great, glad you've already fixed it! I'll handle it in the plugin so that if reachfactor is requested and it's not available it won't error, then when your change is present in master it will just work as expected.

Thanks again Nils!

itsozz commented 5 years ago

Release v2.0.0 implements everything discussed here so closing this now. Nils, please feel free to add further comments regarding reachfactor if neccessary. Thanks very much.