Skip to content

Commit

Permalink
modify Trip.jl to get devid
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfangao committed Dec 16, 2024
1 parent 9c58026 commit 6bef8c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions julia/Trip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function readtripsh5(tripfile::String)
lon = read(f["/trip/$i/lon"])
lat = read(f["/trip/$i/lat"])
tms = read(f["/trip/$i/tms"])
trip = Trip(lon, lat, tms)
devid = read(f["/trip/$i/devid"])
trip = Trip(lon, lat, tms, devid)
push!(trips, trip)
#i >= 10000 && break
end
Expand Down Expand Up @@ -199,7 +200,7 @@ function matchtrip(trip::Trip)
#js = trip2finetrip(trip, 200) |> removeredundantpoints |> trip2json
js = trip |> removeredundantpoints |> trip2json
request = Dict("format"=>"mapmatch", "request"=>js) |> JSON.json
clientside = connect("106.75.3.204", 1234)
clientside = connect("localhost", 1234)
try
message = request * "\n"
write(clientside, message)
Expand Down Expand Up @@ -257,4 +258,4 @@ function trip2detailtrips(trip::Trip)
# println(roads)
# println(route_geom)
return roads, time, frac, route, route_heading, route_geom
end
end

0 comments on commit 6bef8c3

Please sign in to comment.