This lesson has notes and guides only.
00:00
In this video, we'll walkthrough how to use the ProcessedPointByGeometry endpoint.
So, what does this endpoint do? ProcessedPointByGeometry is a streaming version of ProcessedPointByGeometryFileExport.
00:12
So instead of downloading a file with road-matched and trip-stitched data, you'll receive a continuous stream of data packets. This is helpful when you want to feed large volumes of data directly into a model.
00:23
Now let's look at how to format a request using the Road Intelligence docs. Before we start, make sure you're authenticated. If you've done this, you'll see a green tick in the top right. If not, complete the Authenticate endpoint.
00:33
To start: Select ProcessedPointByGeometry from the left hand menu. On the Docs tab, you'll see what information the API needs from you and what you'll receive in its response.
00:43
Next, we'll switch to the Try It tab. If you've seen our ProcessedPointByGeometryFileExport video, the request is exactly the same, so we'll quickly run through it. But if you want more detail, you can check out that video.
00:56
First, you'll need to put in the WKT linestring or polygon you want data for. You can export WKTs from the Road Intelligence platform. Then use start date and end date to define the date and time range you want to extract the data for.
01:21
You can filter by specific hours of the day and days of week. If you want everything, leave them as they are.
01:28
You can also exclude specific dates, but these dates need to be added individually. If you don't want any, you can delete these.
01:37
Next, you can apply filters to only get near-misses or road roughness data. If you don't want to filter, simply delete these.
01:48
You can also limit how much data you want to receive or when we last received it. Remove these fields to get everything.
01:57
Similar to days of week, you can filter the data for specific vehicle types. If you want all types, leave all and delete everything else.
02:11
For our streaming APIs, you can adjust the throttle. This allows you to slow down or increase the stream speed. For now, we'll just leave it as is.
02:18
Now click Start to begin streaming. It may take a few seconds. You'll start to see the processed data packets streaming in. There's a packet count on the right hand side and by clicking the Stop button, you can stop the stream.
02:43
In each packet, you'll get the vehicle type - in this case, it's a bus - the timestamp, latitude and longitude of where the point has been road-matched, speed, OSM Way ID which is the unique ID for Open Street Map, the vehicle ID and trip ID, the raw latitude and longitude before it was road-matched, and transport type.
03:02
Now for some points you'll get the acceleration information. Remember Z is how a vehicle moves up and down, Y means side to side, and X is acceleration and braking. There's a road roughness index and near-miss information. If the point is a near-miss, you'll receive contextual information like latitude and longitude, timestamp, speed, and acceleration data of the near-miss. And finally, you'll get the bearing of the point. You may also get additional information, like make and model and gyroscopic information, if it is available.
03:31
Now looking at this can be overwhelming, so most users tend to stream this endpoint directly into their own models via our SDK files. So let's take a look.
03:41
When you go to our GitHub, you'll see there's a repository you can install. This is where the code to run the endpoints is kept. Make sure when you access the repository you're in the language you want to run your code in.
03:52
Similar to our API docs, you'll need to complete the Authenticate endpoint, but you only have to do this once when using our SDK files.
03:59
In our GitHub, open the Python folder and scroll down to the ProcessedPointByGeometry.
04:11
You can see that this section is structured the same as our API docs with a few additions. So when you copy this into your model, you can change these fields like we did in the API docs. Just keep in mind that when you set up a stream through our SDK files, we automatically close and reopen the stream every 20 minutes.
04:28
And that's it! In this lesson, we learned what the ProcessedPointByGeometry endpoint is, how to set up your request and start streaming.
If you're looking to view data in a more digestible format or exporting large areas and data ranges, we suggest you check out ProcessedPointByGeometryFileExport video.
We'll see you in the next lesson.
We'd love to hear what you think. Leave your details below if you'd like to be contacted.