Git Product home page Git Product logo

Comments (7)

rCarto avatar rCarto commented on May 23, 2024

I am not sure I understand your issue here. There is no duration argument in osrm.
Doing :

library(sf)
library(sp)
library(cartography)
library(osrm)
iso45res10 <- osrmIsochrone(loc = c(2.7353, 46.9514), breaks = 45, res = 10)
iso45res45 <- osrmIsochrone(loc = c(2.7353, 46.9514), breaks = 45, res = 45)
osm <- getTiles(x = iso45res45)
par(mar = c(0,0,0,0))
tilesLayer(osm)
plot(iso45res10, lwd = 2, border = "red", add=T)
plot(iso45res45, lwd = 2, border = "blue", add=T)
points(x = 2.7353, y = 46.9514, pch = 20, cex = 2)

I have:

rplot

which seems correct.

from osrm.

obhakim avatar obhakim commented on May 23, 2024

this is the result of another coordination

2018-12-12_151950

from osrm.

rCarto avatar rCarto commented on May 23, 2024

Can you post a reproducible example of the problem pls?

from osrm.

obhakim avatar obhakim commented on May 23, 2024

Here is the example of the image above
example :
lat <- 43.756989
lng <- 4.079149
duration <- 45
iso <- osrmIsochrone(loc = c(lng, lat), breaks = seq(from = 0,to = duration, by = duration))
iso@polygons[[1]]@polygons[[1]]@coords[, 2:1]

2018-12-12_185704

from osrm.

rCarto avatar rCarto commented on May 23, 2024

Sorry, I still do not understand your problem...

Doing:

library(osrm)
library(sp)
library(cartography)
lat <- 43.756989
lng <- 4.079149
duration <- 45
iso <- osrmIsochrone(loc = c(lng, lat), breaks = seq(from = 0,to = duration, by = duration))
osm <- getTiles(iso)
tilesLayer(osm)
points(lng, lat, pch = 20, cex = 2)
plot(iso, add=T)

I see:
image

Which seems OK.
By the way if you want to access coordinates of the polygon, you should use

iso@polygons[[1]]@Polygons[[1]]@coords[, 2:1]

mind the capital "P" of the second Polygon slot...

from osrm.

obhakim avatar obhakim commented on May 23, 2024

Thank you for your response, i tested your code and i got one diff, how can i merge the two plots coordinations as your image example ?

2018-12-13_113109

from osrm.

rCarto avatar rCarto commented on May 23, 2024

see #34

from osrm.

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.