Using WarpLib geo functions, solve two simple (?) questions, and win the code contest!
From the information in this blog post, I imagined a little code contest for you.
A car is driving in Arizona, with a GPS datalogger… I give you the GPS track, and two questions!
Questions to solve
Given the Route 66 geoshape and the GTS from the datalogger:
- How many kilometers did this car on the Route 66?
- Its fuel consumption approximation is 8 (liters/100 km) × (speed (km/h) / 80) +1. One liter of fuel releases 2392g of CO2. How many CO2 did the car released while driving on the Route 66?
Submit your results
The first to get the correct answers will be declared the winner!
You can use WarpStudio and the Warp 10 sandbox endpoint. Here is the code snapshot.
In the dataviz tab, don’t forget to enable the map view
Sometimes, the car is not on the Route 66. But not always. Sometimes the car is really close. You will have to deal with that.
Useful WarpLib functions
mapper.geo.within will help you to keep data points that are on the road.
mapper.hspeed will help you to compute speed. Beware Americans fellows, it returns SI units. Speed is m/s, not mph or km/h.
|To see the results, it’s here.|
Discover everything about the new Multi Value syntax introduced by release 2.1 of Warp 10.
Discover how to deploy Warp 10 on edge to build your IoT platform with data compression, upstream and downstream channel, security by design.
Learn how to use Thrift and Protocol Buffers directly from within WarpScript and without the need for code generation
Electronics engineer, fond of computer science, embedded solution developer.