Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classic TSP example to the vignette #47

Open
aoles opened this issue Apr 10, 2019 · 4 comments
Open

Add classic TSP example to the vignette #47

aoles opened this issue Apr 10, 2019 · 4 comments
Assignees
Labels
📑 documentation Enhancements to documentation

Comments

@aoles
Copy link
Member

aoles commented Apr 10, 2019

Enable ors_optimization endpoint to the vroom-based route optimization engine.

@aoles aoles added the 💡 enhancement New feature or request label Apr 10, 2019
@aoles aoles self-assigned this Apr 10, 2019
@TimMcCauley
Copy link

@aoles let us please wait for this until we have tested it throughly, thanks a lot

@aoles
Copy link
Member Author

aoles commented Apr 10, 2019

@TimMcCauley Exactly, don't you think that previewing in here would be a good real-life test? As the package is considered a "beta" product I'm positive on exposing some of the experimental features, and I'm pretty sure users won't mind either even if things break.

@aoles aoles changed the title Expose optimize endpoint Expose optimization endpoint Apr 10, 2019
@TimMcCauley
Copy link

@aoles we haven't load tested this service yet and have no idea how the box will react to load. Once this is done, we can definitely go ahead. Stay tuned ;)

@aoles
Copy link
Member Author

aoles commented May 24, 2019

As an example provide the classic TSP example.

library(openrouteservice)
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3

capitals <- data.frame(locality = c("Warsaw", "Berlin", "Rome", "Paris"),
                       country = c("Poland", "Germany", "Italy", "France"))


## query for geocoordiantes
res = apply(capitals, 1, ors_geocode, size = 1, output = "sf") 

## combine results into a single sf object
capitals_sf <- do.call(rbind, lapply(res, function(x) x[c("locality", "country")]))

## extract coordinate matrix
st_coordinates(capitals_sf)
#>          X        Y
#> 1 21.01178 52.22977
#> 2 13.40732 52.52045
#> 3 12.51133 41.89193
#> 4  2.34444 48.86000

Created on 2019-05-24 by the reprex package (v0.2.1)

@aoles aoles added this to the version 0.4 milestone May 27, 2019
@aoles aoles changed the title Expose optimization endpoint Add classic TSP example to the vignette Nov 12, 2019
@aoles aoles added 📑 documentation Enhancements to documentation and removed 💡 enhancement New feature or request labels Nov 12, 2019
@aoles aoles removed this from the version 0.4 milestone Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📑 documentation Enhancements to documentation
Projects
None yet
Development

No branches or pull requests

2 participants