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

specific invalid coordinate issue with osrmIsochrone #44

Closed
jiaweniscute opened this issue May 14, 2019 · 5 comments
Closed

specific invalid coordinate issue with osrmIsochrone #44

jiaweniscute opened this issue May 14, 2019 · 5 comments

Comments

@jiaweniscute
Copy link

Hi There,

Thank you for the awesome package first of all! Really helpful!

I am trying to obtain an area around this particular coordinate in London with the following code:

test <- osrmIsochrone(loc = c(0.0370781,51.48189), breaks = seq(from = 0,to=8,by=8))

I am not sure why but this is giving the following error:

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: -9.4e-05,51.407237

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: -9.4e-05,51.458735

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: -9.4e-05,51.510175

Error in UseMethod("st_as_sf") : 
  no applicable method for 'st_as_sf' applied to an object of class "NULL"

Any advice would be appreciated!

Thank you so much!

@rCarto
Copy link
Member

rCarto commented May 15, 2019

Hello
Mmm, the problem is that osrm is sending invalid coordinates to the routing server.
For this specific point (and I guess any point with coordinates too near to 0, Lat or Long... ) the longitude coordinate is transformed to its scientific notation (-9.4e-05).
A quick trick is to set the scipen option to a large value options(scipen=10).
Thank you for raising this issue, I have to fix this.

@jiaweniscute
Copy link
Author

jiaweniscute commented May 15, 2019

Hi there,

Thank you! This solved the error.

However, I ran into another problem with this set of coordinates, also in London:

test <- osrmIsochrone(loc = c(-2.4529553,52.71386), 
                           breaks = seq(from = 0,to=8,by=8))

For this, the error is:

Error in .as_Spatial(from, cast, IDs) : 
  conversion from feature type sfc_GEOMETRY to sp is not supported

This same error occurs for other few sets of coordinates that I have too.

Not sure what this means. Would appreciate your help, thank you!!

@rCarto
Copy link
Member

rCarto commented May 15, 2019

I'll check this other problem in an other issue (#45).

@rCarto rCarto closed this as completed May 15, 2019
rCarto added a commit that referenced this issue May 15, 2019
@jiaweniscute
Copy link
Author

Apologies, with the update of the package, some of the coordinates are now throwing errors.

For example:

test<- osrmIsochrone(loc = c(-0.0435358, 51.49206), 
                      breaks = seq(from = 0,to=8,by=8))

The error it is throwing:

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: 0.00190 ,51.41742

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: 0.00190 ,51.46891

The OSRM server returned an error:
Error: InvalidInput
Coordinate is invalid: 0.00190 ,51.52034

Error in UseMethod("st_as_sf") : 
  no applicable method for 'st_as_sf' applied to an object of class "NULL"

This set of coordinates used to work previously before the update.

Any idea why this might be so?

Thank you, again!

rCarto added a commit that referenced this issue Jun 14, 2019
@rCarto
Copy link
Member

rCarto commented Jun 16, 2019

Hopefully the last commit has fixed this issue. I'll have a deeper look into it in a few days...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants