Closed pedro-andrade-inpe closed 5 years ago
Hi Pedro.
I've tried using the new function cppSnapPoints()
but I get an error message. I've tried to replace row 124 on the script gtfs2gps_dt_parallel.R
, which looks like this:
stops_snapped_sf <- st_snap_points(stops_sf, new_shape)
When I instead run stops_snapped_sf <- cppSnapPoints(stops_sf, new_shape)
, I get this message:
Error in cppSnapPoints(stops_sf, new_shape) : Not compatible with requested type: [type=list; target=double]. Timing stopped at: 0.01 0 0.02
Any idea on how to fix this?
Hello Rafael,
there is an example on how to use it in the tests. The function basically gets only the coordinates.
https://github.com/ipeaGIT/gtfs2gps/blob/master/tests/testthat/test_snap_points.R
If you need another interface please tell me.
Best,
Pedro
Em 01/09/2019 18:36, Rafael H M Pereira escreveu:
Hi Pedro.
I've tried using the new function |cppSnapPoints()| but I get an error message. I've tried to replace row 124 on the script |gtfs2gps_dt_parallel.R|, which looks like this:
|stops_snapped_sf <- st_snap_points(stops_sf, new_shape) |
When I instead run |stops_snapped_sf <- cppSnapPoints(stops_sf, new_shape)|, I get this message:
Error in cppSnapPoints(stops_sf, new_shape) : Not compatible with requested type: [type=list; target=double]. Timing stopped at: 0.01 0 0.02
Any idea on how to fix this?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ipeaGIT/gtfs2gps/issues/10?email_source=notifications&email_token=ACC67H5ZPKWBCFBP56BHOZDQHQYVLA5CNFSM4ISX4UX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5ULCZI#issuecomment-526954853, or mute the thread https://github.com/notifications/unsubscribe-auth/ACC67H7QFFFFFB7V3KKCFNTQHQYVLANCNFSM4ISX4UXQ.
-- Pedro R. Andrade, Dr. Earth System Science Center (CCST) National Institute for Space Research (INPE) Sao Jose dos Campos, Brazil
Excellent! thanks for the clarification! It worked !
The data from stops are not spatially ordered according to their respective shapes. The code below shows that, using (1) their rows or (2)
stop_id
do not guarantee such order. I will then just reimplementst_snap_points
in C to speedup the execution.