luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
347 stars 20 forks source link

to_spatial_smooth with summarise_attributes #181

Closed LaurentBerder closed 2 years ago

LaurentBerder commented 2 years ago

Hi,

I am working with a large amount of Open Street Map data that I use with sfnetworks. But as the data is large, and the ways of OSM are very short, I end up with a ton of edges, all with some useful attributes.

To ease the process, I need to decrease the number of edges by combining some together. So I thought the tospatial_smooth morph would be appropriate, because it would still allow me to go through the network (using st_network_paths) as long as I only agregate edges that are inbetween intersections.

The problem is that the merger destroys the useful attributes that I need to use after the simplification.

Here's a reproducible example:

edges <- structure(list(highway = c("tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "tertiary", "tertiary", 
"tertiary", "tertiary", "tertiary", "tertiary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary", "secondary", 
"secondary", "secondary", "secondary", "secondary"), speed_kph = c(60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 60.1126993540394, 60.1126993540394, 
60.1126993540394, 60.1126993540394, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476, 
61.5834382267476, 61.5834382267476, 61.5834382267476, 61.5834382267476
), geometry = structure(list(structure(c(9.3278499, 9.3277395, 
42.5770942, 42.5769196999999), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3294954, 9.32916090000002, 
42.5782704000002, 42.5782349000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.34015980000001, 9.34002430000001, 
42.5797282000002, 42.5797084000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33256240000002, 9.33256370000001, 
42.5781017000002, 42.5779555000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33190660000001, 9.33194420000001, 
42.5795968000002, 42.5796758000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32421519999998, 9.325056, 
42.5741831999962, 42.5742745999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33101880000001, 9.33084710000001, 
42.5793776000002, 42.5792354000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32400629999999, 9.32421519999998, 
42.5741986, 42.5741831999962), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32841910000001, 9.32819750000001, 
42.5781091000002, 42.5780350000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32292269999999, 9.32311710000004, 
42.5737689999998, 42.5738077000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32354710000003, 9.32377739999998, 
42.5739347, 42.5741375999962), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3322058, 9.33209989999999, 
42.5777232, 42.5777025), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33155250000001, 9.33152319999999, 42.5790023000002, 
42.5790712), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33209989999999, 9.33201110000001, 42.5777025, 
42.5777057000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32916090000002, 9.32881820000001, 42.5782349000002, 
42.5781876000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.328069, 9.32843059999999, 42.5885243000001, 
42.5885031999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33174890000001, 9.33190660000001, 42.5794115000002, 
42.5795968000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33905470000001, 9.33893679999999, 42.5802308000002, 
42.5802778999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33162779999999, 9.33155250000001, 42.5789527, 
42.5790023000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3275029, 9.3274514, 42.5765667, 42.5765563
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33209160000002, 
9.33208639999999, 42.5787040000002, 42.5787649999999), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33194420000001, 
9.33191479999999, 42.5796758000002, 42.5797367), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32684669999999, 
9.32672770000002, 42.5755555, 42.575583), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33306800000001, 9.33293560000001, 
42.5783258000002, 42.5782861000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33228590000001, 9.3324687, 
42.5861728999998, 42.5860599999997), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32819750000001, 9.32806060000001, 
42.5780350000002, 42.5779460000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33084710000001, 9.33061110000001, 
42.5792354000002, 42.5790458000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33632429999999, 9.33617390000001, 
42.5800862999998, 42.5800767000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33617390000001, 9.335997, 
42.5800767000002, 42.5800293000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3276078, 9.3275502, 42.5767060999998, 
42.5766120999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33293560000001, 9.3327275, 42.5782861000002, 
42.5782652999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3260115, 9.32609760000002, 42.5760017, 
42.5761741), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32694859999998, 9.32684669999999, 42.5754872999962, 
42.5755555), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32709489999999, 9.32706810000002, 42.575275, 
42.5753521), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3327275, 9.33263620000001, 42.5782652999999, 
42.5782360000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32191679999999, 9.32229680000004, 42.5732514999998, 
42.5734734000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.34034210000001, 9.34015980000001, 42.5797331000002, 
42.5797282000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33669160000001, 9.33650120000001, 42.5800609000002, 
42.5800649000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33925590000001, 9.33921560000002, 42.5798299000002, 
42.5800412000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33202990000002, 9.33209160000002, 42.5784907000002, 
42.5787040000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32103569999999, 9.32115600000003, 42.5734618, 
42.5734201), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33916730000001, 9.33905470000001, 42.5801163000002, 
42.5802308000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32806060000001, 9.32803759999998, 42.5779460000002, 
42.5779107999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33691690000001, 9.33669160000001, 42.5800748000002, 
42.5800609000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33139690000001, 9.33124140000001, 42.5796739000002, 
42.5795751000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33271219999999, 9.33273670000001, 42.5859069999999, 
42.5858894000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32672770000002, 9.32642820000002, 42.575583, 
42.5756344), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33413520000001, 9.33399800000002, 42.5784361000002, 
42.5784292000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33194150000002, 9.33170540000001, 42.5788878000002, 
42.5789273000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33735699999999, 9.33691690000001, 42.5801376999998, 
42.5800748000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3233854, 9.32354710000003, 42.5738506000001, 
42.5739347), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.335997, 9.33577170000001, 42.5800293000002, 
42.5799306000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3275502, 9.3275029, 42.5766120999998, 
42.5765667), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3303798, 9.33055759999999, 42.5879130000002, 
42.5878712999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3309727, 9.331101, 42.5869669000002, 42.5868301000002
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.325056, 
9.32582960000003, 42.5742745999998, 42.5743617), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33256370000001, 
9.33251370000002, 42.5779555000002, 42.5778484000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32795359999998, 
9.3279289, 42.5775055999999, 42.5773976), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3274514, 9.3271983, 42.5765563, 
42.5766256999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33461480000001, 9.33441280000002, 42.5789425000002, 
42.5785854000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.34002430000001, 9.33966620000001, 42.5797084000002, 
42.5796195000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33061110000001, 9.33026780000001, 42.5790458000002, 
42.5788404000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33921560000002, 9.33916730000001, 42.5800412000002, 
42.5801163000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3296086, 9.32973949999999, 42.5880199000002, 
42.5879482999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3271983, 9.3270083, 42.5766256999998, 
42.5766993), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33174709999999, 9.33176980000001, 42.5779286, 
42.5779831000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3318563, 9.3321033, 42.5864979000002, 
42.5863184000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3309446, 9.3309209, 42.5874631000002, 
42.5871422000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33472020000002, 9.33461480000001, 42.5791406000002, 
42.5789425000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33152319999999, 9.33152830000001, 42.5790712, 
42.5791307000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32606759999999, 9.32675840000003, 42.5744475, 
42.5748235), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33521650000001, 9.33499920000001, 42.5795850000002, 
42.5795356000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33240029999999, 9.3322058, 42.5777774999999, 
42.5777232), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33152830000001, 9.33157130000002, 42.5791307000002, 
42.5791939000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33794690000001, 9.33735699999999, 42.5802407000002, 
42.5801376999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32609760000002, 9.32651799999998, 42.5761741, 
42.5767564999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33543389999999, 9.33534340000001, 42.5796961999998, 
42.5796369000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33026780000001, 9.32994550000001, 42.5788404000002, 
42.5785718000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3279289, 9.3278499, 42.5773976, 42.5770942
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33251370000002, 
9.33240029999999, 42.5778484000002, 42.5777774999999), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33321820000001, 
9.33306800000001, 42.5783979000002, 42.5783258000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3307409, 
9.3308743, 42.5877935000002, 42.5876628000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32115600000003, 
9.32152700000002, 42.5734201, 42.5732407), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3291919, 9.3296086, 42.5882984000002, 
42.5880199000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32152700000002, 9.32168440000003, 42.5732407, 
42.5732037000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32600989999998, 9.3260115, 42.5759416999999, 
42.5760017), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33361950000001, 9.33337990000001, 42.5784710000002, 
42.5784669000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33878119999999, 9.33864430000002, 42.5803212999998, 
42.5803157000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33124140000001, 9.33101880000001, 42.5795751000002, 
42.5793776000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3325724, 9.33256240000002, 42.5781791999999, 
42.5781017000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32386940000003, 9.32400629999999, 42.5741796, 
42.5741986), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33499920000001, 9.33483820000001, 42.5795356000002, 
42.5794487000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33175770000001, 9.33174709999999, 42.5778765000002, 
42.5779286), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33650120000001, 9.33632429999999, 42.5800649000002, 
42.5800862999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32965110000001, 9.3294954, 42.5783342000002, 
42.5782704000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33182340000001, 9.33174570000001, 42.5797687000002, 
42.5797627000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32263180000002, 9.32292269999999, 42.5736103, 
42.5737689999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3277395, 9.327679, 42.5769196999999, 42.5768241
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33837349999999, 
9.33794690000001, 42.5802877999998, 42.5802407000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32168440000003, 
9.32181000000002, 42.5732037000001, 42.5732119), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32988, 
9.3303798, 42.5879259000002, 42.5879130000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33337990000001, 
9.33321820000001, 42.5784669000002, 42.5783979000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32706810000002, 
9.32702379999999, 42.5753521, 42.5754252), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32377739999998, 9.32386940000003, 
42.5741375999962, 42.5741796), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32181000000002, 9.32191679999999, 
42.5732119, 42.5732514999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33939800000002, 9.33931499999999, 
42.5796383000002, 42.5797159999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.34092020000001, 9.34065330000001, 
42.5796324000002, 42.5796985000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3321033, 9.33228590000001, 
42.5863184000002, 42.5861728999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3342278, 9.33413520000001, 
42.5784508000002, 42.5784361000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32973949999999, 9.32988, 
42.5879482999998, 42.5879259000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33577170000001, 9.33561070000001, 
42.5799306000002, 42.5798121000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33191479999999, 9.33182340000001, 
42.5797367, 42.5797687000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32702379999999, 9.32694859999998, 
42.5754252, 42.5754872999962), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33176980000001, 9.33194950000002, 
42.5779831000002, 42.5782814000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32642820000002, 9.32623389999999, 
42.5756344, 42.5757214), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3326095, 9.3326646, 42.5859792000002, 
42.5859411000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33561070000001, 9.33543389999999, 42.5798121000002, 
42.5796961999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32675840000003, 9.32699090000003, 42.5748235, 
42.575006), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg"
)), structure(c(9.32897509999999, 9.3291919, 42.5883984999998, 
42.5882984000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32605100000002, 9.32600989999998, 42.5758681, 
42.5759416999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3274068, 9.3274833, 42.5885297, 42.5885113000002
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33055759999999, 
9.3307409, 42.5878712999998, 42.5877935000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33534340000001, 
9.33521650000001, 42.5796369000002, 42.5795850000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33208639999999, 
9.33203270000001, 42.5787649999999, 42.5788463000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33170540000001, 
9.33162779999999, 42.5789273000002, 42.5789527), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33441280000002, 
9.33432710000001, 42.5785854000002, 42.5784994000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33263620000001, 
9.3325724, 42.5782360000002, 42.5781791999999), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3326646, 
9.33271219999999, 42.5859411000002, 42.5859069999999), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32229680000004, 
9.32263180000002, 42.5734734000001, 42.5736103), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3287234, 
9.32897509999999, 42.5884699000002, 42.5883984999998), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.327679, 
9.3276078, 42.5768241, 42.5767060999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32843059999999, 9.3287234, 
42.5885031999998, 42.5884699000002), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32311710000004, 9.3233854, 
42.5738077000002, 42.5738506000001), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33864430000002, 9.33837349999999, 
42.5803157000002, 42.5802877999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.3312898, 9.3318563, 42.5867144000002, 
42.5864979000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33399800000002, 9.33361950000001, 42.5784292000002, 
42.5784710000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33201110000001, 9.33175770000001, 42.5777057000002, 
42.5778765000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32651799999998, 9.32656820000002, 42.5767564999999, 
42.5768685), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3270083, 9.32656820000002, 42.5766993, 
42.5768685), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32994550000001, 9.32965110000001, 42.5785718000002, 
42.5783342000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33157130000002, 9.33174890000001, 42.5791939000002, 
42.5794115000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32803759999998, 9.32795359999998, 42.5779107999999, 
42.5775055999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32699090000003, 9.32707720000002, 42.575006, 
42.5751664), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32582960000003, 9.32606759999999, 42.5743617, 
42.5744475), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33931499999999, 9.33925590000001, 42.5797159999998, 
42.5798299000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3324687, 9.3326095, 42.5860599999997, 
42.5859792000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.331101, 9.3312898, 42.5868301000002, 42.5867144000002
), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3309209, 
9.3309727, 42.5871422000002, 42.5869669000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33893679999999, 
9.33878119999999, 42.5802778999998, 42.5803212999998), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33203270000001, 
9.33194150000002, 42.5788463000002, 42.5788878000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33483820000001, 
9.3347577, 42.5794487000002, 42.5793302000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33953229999999, 
9.33939800000002, 42.5796093999998, 42.5796383000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3347577, 
9.33472020000002, 42.5793302000002, 42.5791406000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33432710000001, 
9.3342278, 42.5784994000002, 42.5784508000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.34065330000001, 
9.34034210000001, 42.5796985000002, 42.5797331000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3274833, 
9.328069, 42.5885113000002, 42.5885243000001), .Dim = c(2L, 2L
), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32881820000001, 
9.32841910000001, 42.5781876000002, 42.5781091000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.33174570000001, 
9.33139690000001, 42.5797627000002, 42.5796739000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.3308743, 
9.3309446, 42.5876628000002, 42.5874631000002), .Dim = c(2L, 
2L), class = c("XY", "LINESTRING", "sfg")), structure(c(9.32707720000002, 
9.32709489999999, 42.5751664, 42.575275), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.33966620000001, 9.33953229999999, 
42.5796195000002, 42.5796093999998), .Dim = c(2L, 2L), class = c("XY", 
"LINESTRING", "sfg")), structure(c(9.32623389999999, 9.32605100000002, 
42.5757214, 42.5758681), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33194950000002, 9.33202990000002, 42.5782814000002, 
42.5784907000002), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33138330000002, 9.33174050000002, 42.5855201, 
42.5854661), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32973540000003, 9.32997530000001, 42.5841654000001, 
42.5845545999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32968650000003, 9.33002530000002, 42.5801663000001, 
42.5805951), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33053430000002, 9.33030420000002, 42.5818458, 
42.5820702), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32656820000002, 9.32660060000002, 42.5768685, 
42.5770575), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33020189999999, 9.33040940000003, 42.58481, 
42.5849786), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32944980000001, 9.32953150000002, 42.5829409999998, 
42.5832454), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33065080000002, 9.33063940000002, 42.5813333, 
42.5815973), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32939110000002, 9.32944980000001, 42.5826882, 
42.5829409999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32969519999999, 9.32965610000002, 42.5836069, 
42.5838709), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33216960000002, 9.33237699999999, 42.5855495, 
42.5856492), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33066710000002, 9.33084169999999, 42.5853718, 
42.5854409), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33499349999999, 9.33511479999999, 42.5870153, 
42.5871542), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32952420000002, 9.3294419, 42.5825027, 
42.5825693000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32850350000002, 9.3288619, 42.5788683, 
42.5792753999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33347340000002, 9.33367100000002, 42.5863776, 
42.5864666), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3288619, 9.32968650000003, 42.5792753999998, 
42.5801663000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3347165, 9.33476469999999, 42.5865596999998, 
42.5865998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33116339999999, 9.33127629999999, 42.5855239, 
42.5855297), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32939489999999, 9.32939110000002, 42.5826315999999, 
42.5826882), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33406599999999, 9.33414500000002, 42.5865751, 
42.5865814), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3319509, 9.33216960000002, 42.5854854999997, 
42.5855495), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32705980000002, 9.3272256, 42.5779042, 
42.5782092999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33084169999999, 9.33103100000002, 42.5854409, 
42.5854975), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3330912, 9.33347340000002, 42.5861280999997, 
42.5863776), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33058549999999, 9.33065080000002, 42.5811932, 
42.5813333), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33030420000002, 9.32952420000002, 42.5820702, 
42.5825027), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33449009999999, 9.33455300000002, 42.5865265, 
42.5865149), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32965610000002, 9.32967299999999, 42.5838709, 
42.5840165), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33054600000003, 9.33059429999999, 42.5852353000001, 
42.5853064), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33061489999999, 9.33053430000002, 42.5817091, 
42.5818458), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3280062, 9.32830720000001, 42.5786506999992, 
42.5787752999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33493210000002, 9.33499349999999, 42.5869209, 
42.5870153), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33237699999999, 9.33252510000002, 42.5856492, 
42.5857476), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33425749999999, 9.3343571, 42.5865821, 
42.5865616999997), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33511479999999, 9.33530829999997, 42.5871542, 
42.5873481), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33038780000001, 9.33058549999999, 42.5809209999998, 
42.5811932), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33476469999999, 9.33480120000002, 42.5865998, 
42.5866622), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3346465, 9.3347165, 42.5865228999997, 
42.5865596999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32666709999999, 9.32670720000002, 42.5775275999999, 
42.5775863), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3272256, 9.32730960000002, 42.5782092999998, 
42.5782954), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32662040000002, 9.32666709999999, 42.5773429, 
42.5775275999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33480120000002, 9.33493210000002, 42.5866622, 
42.5869209), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33103100000002, 9.33116339999999, 42.5854975, 
42.5855239), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33040940000003, 9.33049229999999, 42.5849786, 
42.5850973), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32997530000001, 9.33002770000002, 42.5845545999998, 
42.5846349), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32843599999999, 9.32850350000002, 42.5788262999998, 
42.5788683), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33002530000002, 9.33038780000001, 42.5805951, 
42.5809209999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3339387, 9.33406599999999, 42.5865468999998, 
42.5865751), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33049229999999, 9.33054600000003, 42.5850973, 
42.5852353000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33273670000001, 9.3330912, 42.5858894000001, 
42.5861280999997), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3343571, 9.33449009999999, 42.5865616999997, 
42.5865265), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33367100000002, 9.3339387, 42.5864666, 
42.5865468999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33063940000002, 9.33061489999999, 42.5815973, 
42.5817091), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32953150000002, 9.32961850000002, 42.5832454, 
42.583424), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg"
)), structure(c(9.33002770000002, 9.33020189999999, 42.5846349, 
42.58481), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", "sfg"
)), structure(c(9.32967299999999, 9.32973540000003, 42.5840165, 
42.5841654000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.3294419, 9.32939489999999, 42.5825693000001, 
42.5826315999999), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32660060000002, 9.32662040000002, 42.5770575, 
42.5773429), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33174050000002, 9.3319509, 42.5854661, 
42.5854854999997), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32966139999999, 9.32969519999999, 42.5834966, 
42.5836069), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32670720000002, 9.32705980000002, 42.5775863, 
42.5779042), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32830720000001, 9.32843599999999, 42.5787752999998, 
42.5788262999998), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33127629999999, 9.33138330000002, 42.5855297, 
42.5855201), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32730960000002, 9.3280062, 42.5782954, 
42.5786506999992), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33455300000002, 9.3346465, 42.5865149, 
42.5865228999997), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33059429999999, 9.33066710000002, 42.5853064, 
42.5853718), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33414500000002, 9.33425749999999, 42.5865814, 
42.5865821), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.33252510000002, 9.33273670000001, 42.5857476, 
42.5858894000001), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg")), structure(c(9.32961850000002, 9.32966139999999, 42.583424, 
42.5834966), .Dim = c(2L, 2L), class = c("XY", "LINESTRING", 
"sfg"))), class = c("sfc_LINESTRING", "sfc"), precision = 0, bbox = structure(c(xmin = 9.32103569999999, 
ymin = 42.5732037000001, xmax = 9.34092020000001, ymax = 42.5885297
), class = "bbox"), crs = structure(list(input = "EPSG:4326", 
    wkt = "GEOGCRS[\"WGS 84\",\n    DATUM[\"World Geodetic System 1984\",\n        ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n            LENGTHUNIT[\"metre\",1]]],\n    PRIMEM[\"Greenwich\",0,\n        ANGLEUNIT[\"degree\",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS[\"geodetic latitude (Lat)\",north,\n            ORDER[1],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        AXIS[\"geodetic longitude (Lon)\",east,\n            ORDER[2],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n    USAGE[\n        SCOPE[\"unknown\"],\n        AREA[\"World\"],\n        BBOX[-90,-180,90,180]],\n    ID[\"EPSG\",4326]]"), class = "crs"), n_empty = 0L)), row.names = c(NA, 
-233L), sf_column = "geometry", agr = structure(c(highway = NA_integer_, 
speed_kph = NA_integer_), .Label = c("constant", "aggregate", 
"identity"), class = "factor"), class = c("sf", "tbl_df", "tbl", 
"data.frame"))

# Print the edges:
ggplot() +
    geom_sf(data = edges %>% st_as_sf()) +
    coord_sf()

download

Now, the idea would be to merge all the edges that are bounded by intersections together, resulting in this example with 5 edges: merge_edges But if I do this with to_spatial_smooth, I lose the content of attributes speed_kph and highway:

net = as_sfnetwork(edges, directed=TRUE)
simplified = net %>% tidygraph::convert(to_spatial_smooth)
simplified
# A sfnetwork with 6 nodes and 5 edges
#
# CRS:  EPSG:4326 
#
# A rooted tree with spatially explicit edges
#
# Node Data:     6 × 2 (active)
# Geometry type: POINT
# Dimension:     XY
# Bounding box:  xmin: 9.321036 ymin: 42.57346 xmax: 9.34092 ymax: 42.58853
             geometry .tidygraph_node_index
          <POINT [°]>                 <int>
1 (9.321036 42.57346)                    67
2 (9.332737 42.58589)                    75
3  (9.34092 42.57963)                   145
4  (9.327407 42.58853)                   156
5 (9.326568 42.57687)                   162
6 (9.335308 42.58735)                   221

# Edge Data:     5 × 6
# Geometry type: LINESTRING
# Dimension:     XY
# Bounding box:  xmin: 9.321036 ymin: 42.5732 xmax: 9.34092 ymax: 42.58853
   from    to highway speed_kph                        geometry .tidygraph_edge…
  <int> <int> <chr>       <dbl>                <LINESTRING [°]> <list>          
1     3     5 <NA>           NA (9.34092 42.57963, 9.340653 42… <dbl [102]>     
2     1     5 <NA>           NA (9.321036 42.57346, 9.321156 4… <dbl [35]>      
3     4     2 <NA>           NA (9.327407 42.58853, 9.327483 4… <dbl [26]>      
# … with 2 more rows

Describe the solution you'd like Ideally, we should be able (as it is the case for some other morphs such as to_spatial_simple) to specify summarise_attributes , which indicates what kind of agregation is needed for specific attributes. In the given example, I'd use it as follows:

simplified = net %>% tidygraph::convert(to_spatial_smooth, 
                                                                  summarise_attributes=list(speed_kph="mean", 
                                                                                                            highway="mode", "ignore"))

To get the average speed_kph, and the most common value of highway

agila5 commented 2 years ago

Hi @LaurentBerder, and thanks for raising this issue. I'm looking forward to taking a shot at implementing this new feature (and also related issues https://github.com/luukvdmeer/sfnetworks/issues/124 and https://github.com/luukvdmeer/sfnetworks/issues/179, maybe via a single API), but I need to focus on other projects until the end of this year. Maybe you can get inspiration from the existing code in to_spatial_smooth.

LaurentBerder commented 2 years ago

Right, it's after I saw you #124 that I actually had the idea (I think they're complimentary). Hadn't noticed the #179, sorry for the request had already been made.

I'll take a look at the existing code and try to tweak it.

luukvdmeer commented 2 years ago

Thanks for raising this!

It is a heavily requested feature it seems, so we need to work on it! The reasons why this argument is right now present in e.g. to_spatial_simple() but not in to_spatial_smooth() is that to_spatial_simple() is just a wrapper around igraph::simplify(), which has the possibility to summarise attributes with the edge.attr.comb, see here. Hence, we just rely on igraph to take care of this. However, to_spatial_smooth is completely self-implemented because there is no igraph function doing the same (as far as I know). Therefore, we also need to find a way to implement the summarise_attributes functionality by ourselves (possibly based on how igraph is handling this?).

There are now multiple issues requesting the same feature. To keep the overview I will only leave #120 open and link to this issue from there.

LaurentBerder commented 2 years ago

Got it @luukvdmeer, thanks for the heads-up. Will be looking forward to trying it out!