The Export Page for a Data Source allows for you to filter out data and columns, allowing you to extract the data you want.
At the end of this tutorial, you’ll be able to
- Filter your data
- Export your data
- Use Stae to power a real-time dashboard
- Use the Stae API to share civic data
Traffic Incidents Data Filter Page
1. Data Filter Page
When you import your data to Stae, you can view individual columns and rows just like you would in Excel. You can access a tabular view by select a Data Source on the Data Page, and then navigate to the Export Tab at the top of the source's page.
2. Filtering Your Data
Depending on the dataset you choose, you may only have a few data points or you may be looking at a large archive. Let’s look at traffic incidents reported through Waze in Los Angeles, which has just under half a million data points. It would be impossible to get any value from all of this data when viewed all at once. That’s why filtering becomes a critical tool.
Text Field Filters
Text fields are common in most data types and are usually used for more open-ended fields like notes, names, or operators. For example, for the traffic incidents data set, the notes field contains additional information about the incident such as a street closure due to an event. You can search for a term using the following conditions: contains, contains word, starts with, or ends with.
Searching Traffic Incidents for Street Closure reasons under the notes field
Date Range Filters
If you wanted to see the weekday evening rush hour, you can use a combination of hour of day and day of week filters to find the results. Here's a list of filters you can perform on dates: exact date filtering will show all results for the selected date, before/after filtering will show all results for either before or after a selected date, between filtering will show all results between two selected date ranges, hour of day/day of week filtering will provide a time range slider to select a range of days and times.
Example of date/time filtering that shows traffic incidents that occurred during the weekdays.
If you're looking for the cause of the traffic incident, then you'll want to filter the type category. Stae will automatically create a filterable list based on what's available in the data set. To select a specific type, select the exact modifier for the type filter and you'll see a list of filter results. For datasets that have a large list of types, you can search for a term using the contains, contains word, starts with, or ends with modifiers.
A list of available types to filter for traffic incidents.
If you were interested in filtering data results for a specific location, you can use the location filter to define a geographic boundary. Select the location filter, then select the Intersects With modifier, which will bring up a minimap with drawing tools and zoom features. When you're satisfied with the shape you've drawn, select save to apply your filter.
The first icon with dotted outlines is the select tool, which allows you to select existing shapes you've drawn. The second icon is the polygon tool, which allows you to draw polygons. Once you've drawn your polygon shape on the map, select the starting point to end the shape.
The polygon shape tool
The third tool is the line tool, which is good for outlining specific roadways but only limited to a start and end point.
The line tool, useful for specifying streets, for location filtering
The final tool is the rectangle tool, which is a tool useful for making quick location queries.
The rectangle shape tool
The select tool allows you edit any existing shapes you've drawn. Click on the select tool and then mouse over any existing shapes you've drawn. When the shape turns red, click on it and you'll be able to edit the shape or delete it. The edit tool allows you to edit the vertices of any polygons or rectangles or modify the start/end points of any lines you've drawn. You can also move the shape around by selecting the move tool. The expand tool allows you to expand by typing in the amount in the meters field.
The select tool allows you to modify vertices, move shapes, expand their size, or delete shapes
3. Inquiry-based approach for filtering
CONSIDER THIS SCENARIO
Say you’re getting reports of road safety issues near LA Senior High School from the local PTA. To understand the situation, you can prepare a report in Stae that isolates traffic incidents near schools. The following example will take you through the process of creating this report.
1. Create a location filter
To get an idea of baseline incidents, we'll create a geographic boundary around Los Angeles Senior High School to identify any incidents that occurred near the school. Select the location filter and then select Intersects With to create a polygon around the high school. Make sure your shape includes the road segments around the school and then save your shape to get your results.
Location filter around LA Senior High School
2. Filter the incident reason
Since we're only concerned about accidents near the school, filter down the type list to exactly and select accidents.
3. Map the result to feed a real-time dashboard
There a number of integrations to export the data out to a dashboard including Power BI, Tableau, or to a JSON API. To view the number of examples to visualize this data, check out this Observable notebook.
4. Exporting Your Data
Once you’re satisfied with the filtered results, you can export your data to a number of machine-readable files or application integrations. We currently support integrations with the following data visualization software: Carto, Plotly, Tableau, Power BI, ESRI, Google Sheets, and Kepler. For flat files, you can choose to export to JSON, GeoJSON, and CSV/Excel. You can also export any filter result to a JSON API feed, which is useful for more larger data sets with millions of rows.
JSON API links for software developers
5. API Documentation for Developers
If you’re working with software developers, you can provide them with your filtered data view or the entire dataset by clicking on the JSON API button. For information on how to use the API, see our API Documentation.
“Cities have the capability of providing something for everybody, only because, and only when, they are created by everybody.”
Jane Jacobs, The Death and Life of Great American Cities
Have any questions or running into issues with this feature?
Reach us at: email@example.com