cmu-lib / bridgesofPittsburgh

Code and documents associated with the Bridges of Pittsburgh DH project at CMU
7 stars 2 forks source link

Leaflet-based map #73

Closed mdlincoln closed 5 years ago

mdlincoln commented 5 years ago

A sample of what we can do: https://dsharp-cmu.github.io/bridgesofPittsburgh/osmar/output_data/pgh_leaflet.html

mdlincoln commented 5 years ago

to-do:

ERSlayton commented 5 years ago

Great map! A few ideas for leaflet visualization: 1) Change colors to be not red green. (Perhaps yellow and black for Pittsburgh colors?) 2) We may consider numbering the bridges, so that there can be an underlying list of what bridges are crossed in order and to identify bridges as part of the visualization (This may need to be a next to last step). 3) we may want to add an outline of the city of Pittsburgh to this map

mdlincoln commented 5 years ago

agreed, the outline will be very useful especially when it comes to editing OSM and wondering whether to worry about ag iven bridge or not

I still need to think through how to do numbered bridge crossings, since so many get crossed multiple times...

mdlincoln commented 5 years ago

What I can do is create a shapefile of either:

  1. multilinestrings (aka polylines), one per step of the path. Because each of the multilinestrings will encompass multiple edges, and often multiple Ways, it wouldn't be possible to really give them additional attributes. But you'd get one chunk of geometry per step of the path!
  2. a table of linestrings, one per edge. These would have the full set of attributes generated from OSM and during my processing. There would also be an additional attribute step with an integer ID for grouping which linestrings were crossed in a given order. When the path goes back over an edge, there would be multiple linestrings

Let's check in @ERSlayton tomorrow about what kinds of formats might be useful - if you've more experience in Leaflet it might be great to hand off the data to you to iterate on.

mdlincoln commented 5 years ago

@ERSlayton if you look in /osmar/output/data/shapefiles I've tried to produce a few files that ought to use the ESRI Shapefile driver - please take a look when you can.

ERSlayton commented 5 years ago

@mdlincoln Looking at the file extensions, you have all the right ones there. We should be able to load them into ESRI. If we do that in the table of linestirngs format you mentioned earlier, I can join them in ESRI and I should be able to then also retain all of the information for each individual line in an all encompassing polyline.

We should then be able to upload that to leaftlet as well.

mdlincoln commented 5 years ago

neat new resource on modern R packages for spatial features, data structures, and statistical learning: https://geocompr.robinlovelace.net/

ERSlayton commented 5 years ago

Thanks for this!

mdlincoln commented 5 years ago

I'm going to close this out since it will be replaced next month by more granular tasks once we have our work plan in place.