Giter VIP home page Giter VIP logo

Comments (7)

Robinlovelace avatar Robinlovelace commented on August 22, 2024

Can you provide a reproducible example when you get a chance @wangzhao0217? Good idea to start with the data that we have in the NPT project, e.g. with the following:

rnet_x = sf::read_sf("https://github.com/nptscot/networkmerge/releases/download/v0.1/OS_large_route_network_example_edingurgh.geojson")

from stplanr.

Robinlovelace avatar Robinlovelace commented on August 22, 2024

Additional point/question: do we even need network simplification in these relatively remote places with low cycling potential? Thoughts @mem48 also welcome but my thinking is 'no'.

from stplanr.

Robinlovelace avatar Robinlovelace commented on August 22, 2024

Can you try with the latest version of stplanr which you can install with remotes::install_dev("stplanr") @wangzhao0217 .

Any questions let me know.

from stplanr.

Robinlovelace avatar Robinlovelace commented on August 22, 2024

Good morning @wangzhao0217 I've made some recent updates to the package that allow you to use geo_buffer() on projected data. So you can now do the rnet_merge() on projected data, e.g. EPSG:27700. I've done some tests here: https://github.com/ropensci/stplanr/blob/master/data-raw/test_geo_buffer.md

Does that fix the issue for you?

from stplanr.

Robinlovelace avatar Robinlovelace commented on August 22, 2024

I think this can be closed now that geo_buffer() works with projected data. If there are any other issues, feel free to open @wangzhao0217, especially if you can illustrate them with reproducible example code like that shown in the link above.

from stplanr.

wangzhao0217 avatar wangzhao0217 commented on August 22, 2024

Hi Robin,
The testing is not very smooth, thus I reopened the issue:
I have created a markdown file (test geo_buffer with EPSG 27700.Rmd) and made the pr, please have a look.

if reading the sample data directly without doing st_transform, this will leave the CRS as EPSG 4326
Executing the code below will take an extremely long time to run :

rnet_x = sf::read_sf("data-raw/rnet_xp_clip.geojson")  # dim(rnet_x) 17934   2 "EPSG",4326
rnet_y = sf::read_sf("data-raw/sampled_rnet_yp.geojson") # dim(rnet_y) 1396   27 "EPSG",4326
rnet_merged = rnet_merge(rnet_x, rnet_y, dist = 20, segment_length = 10, funs = funs, max_angle_diff = 20, crs = "EPSG:27700") 

and encounter the error:
Error in igraph::as.undirected(g) :
At core/core/vector.pmt:443 : cannot reserve space for vector, Out of memory
In addition: Warning messages:
1: attribute variables are assumed to be spatially constant throughout all geometries
2: In st_cast.sf(sf::st_cast(x, "MULTILINESTRING"), "LINESTRING") :
repeating attributes for all sub-geometries for which they may not be constant

if conducting st_transform before rnet_merge, is the same takes an extremely long time to run:

rnet_x = st_transform(rnet_x, "EPSG:27700")
rnet_y = st_transform(rnet_y, "EPSG:27700")
brks = c(0, 100, 500, 1000, 5000,10000)
rnet_merged = rnet_merge(rnet_x, rnet_y, dist = 20, segment_length = 10, funs = funs, max_angle_diff = 20, crs = "EPSG:27700") 

from stplanr.

Robinlovelace avatar Robinlovelace commented on August 22, 2024

I see the issue with rnet_merge() being slow but I don't think this is a bug with geo_buffer(). Will close this one and open another issue.

from stplanr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.