question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: how to symbolize isochrones and isodistances

See original GitHub issue

As discussed in today’s meeting, symbolizing returned features will be a blocker for users during CF workflows.

Below I present the problem with currently available “out-of-the-box” methods and propose a couple of ideas for how we can overcome. The solutions will require some work to think about how we provide more suitable styling by default.

In the examples below, I am using a dataset of Whole Foods and Safeway grocery stores in the city of Denver. For each location, I’ve created walk time polygons at 5,10 and 20 minute intervals.

Default symbology

By default, the polygons draw from lowest to highest values. In this case, that means that the largest (20 minute) polygon is covering the other two polygons:

Screen Shot 2019-09-23 at 1 29 16 PM

Helper cartography

If styled with something like our color_bins_layer the default still doesn’t solve the issue and also aren’t suited for mapping these values. Screen Shot 2019-09-23 at 2 32 09 PM

Customize color bins

If using this helper, the classification method should change to Equal Intervals and the number of class breaks should reflect the number of data range values. Even with those modifications, we still can’t really “see” the result as this has been applied to the fill of the symbol and these are modifications that might not be readily apparent to the user. Also, the legend still isn’t what we would expect to see on this kind of map Screen Shot 2019-09-23 at 3 10 46 PM

Alternative ideas

  • of course the ideal scenario would be to have the polygons ordered from max to min, but since that is a limitation we have, we need to think of other ideas.

  • change the default opacity for polygons. This isn’t the best path forward because that will have implications for all polygon data that is added. If for example someone has small polygons, they would be really hard to see with such a high level of opacity.

  • Return lines. If we returned lines, we would need to create a new helper method and make sure we have a matching legend. Also, we would not be able to add any fill color to the polygons because we will once again run into the same issue of the larger polygon obscuring the smaller ones. Screen Shot 2019-09-24 at 8 10 54 AM

  • Have a precanned default style that loads with the output. Instead of modifying the opacity of all polygon features, we could think of a way to only add opacity to output isochrone/distance polygons. And in VL terms, use filter instead of opacity to have it at the layer level. But if we go back through the styling loop here, we will still run into the same problems outlined above when people begin to apply their own styling Screen Shot 2019-09-24 at 8 16 15 AM

cc @jgoizueta @cmongut @alasarr

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
Jesus89commented, Oct 29, 2019

IMO it’s easy to add this method so we can provide a simple solution to visualize isolines, which, on the other hand, is not trivial to do.

1reaction
jgoizuetacommented, Oct 2, 2019

After having added the exclusive option, overlapping is not a problem, and color ramps can be easily added, but the legends are not appropriate:

isochrones = iso.isochrones(dataset, [1200,2400,3600], mode='car', exclusive=True).data
from cartoframes.viz import Map, Layer
from cartoframes.viz.helpers import color_bins_layer
Map([color_bins_layer(isochrones, 'data_range',  method='equal', bins=3), Layer(dataset)])

Screenshot 2019-10-02 at 13 20 29

This is because our data already is in ranges, and we’re creating new equal ranges based on the top values of our ranges.

One possible solution is to use a categorical column:

isochrones.dataframe['range'] = isochrones.dataframe.apply(lambda r: '{} to {}'.format(r['lower_data_range'],r['data_range']), axis=1)
from cartoframes.viz.helpers import color_category_layer
Map([color_category_layer(isochrones, 'range', palette='purpor'), Layer(dataset)])

Screenshot 2019-10-02 at 13 23 21

Now legends and hover values are fine. But we must either always add the new text column and waste space or instruct the user how to create it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Isodistance and Isochrone Maps - GIS Lounge
Isodistance Maps. Isodistances represent the calculation of specific distance intervals from one point extending out along every possible route.
Read more >
Isochrones Map (Travel Time Map), Isodistances Map and ...
You can represent your demographics within your isoline. In the example a thematic map within an isodistance starting from the Italian ISTAT demographic...
Read more >
Which tools and methods can be used to create isochrones?
I'm looking at travel time modelling for specific sites using transport network vectors and nodes. Data currently available are the OS Master ...
Read more >
Isochrone Maps with OSMnx + Python - Geoff Boeing
Urban planners use isochrone maps to show spatial horizons (i.e., isolines) that are equal in time. Isochrones depict areas according to how ...
Read more >
An Overview of Isolines as a Service for Google Maps
Isochrones & Isodistance in Real-Time ... At a finer grain, these geospatial datasets could represent customer or patient location data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found