Sensor Web, Geoprocessing, Security & GeoRM, Geostatistics, Semantics, 3D, Ilwis, Earth Observation

GIS data access for enviroCar

July 8th, 2014 @ 08:07 by Daniel Nuest
Posted in Citizen Science

The enviroCar Team recently built a new platform for managing transportation data in the form of “tracks”. A simple but extensible JSON encoding supports the quick prototyping approach within the architecture of the data server, Android app for data collection, and PHP-based website for visualization and social interaction. As the project matures, we encounter new requirements. One of these is to enable users to download the track data in formats that simplify data import to other tools, such as mapping software (e.g. ArcGIS) or tabular analysis software (e.g. Excel spreadsheets), so that scientists and citizens alike can derive new findings and develop new information products based on the enviroCar data.

No sooner said than done, we developed and now publicly release two new export formats, shapefile and CSV! Both download formats are available via the API. To try it out, simply take any track URL and append “.shp” or “.csv” to download the track in a specific format. Examples:

Alternatively, you can use HTTP headers in your code to request a specific format.

The process is a little bit easier for your own tracks. The “Download” menu in the single track view was extended to include the new formats.

envirocar-shp-csv-download-menu

About Shapefiles

The shapefile format, while not an open standard, is very widespread. Both open source and proprietary GIS software have good support for importing and exporting it. The name, however,  is misleading since “a shapefile” can consist of several files containing metadata, geometries, and attribute data. As a result, the enviroCar API provides shapefiles in a zipped format (see screenshot of the folder contents below).

envirocar-shp-folder

After the files are imported into any GIS software, the geospatial analysis can begin. The following screenshot shows an enviroCar track in ESRI ArcMap (click image for a larger version).

arcmap-add-shp-2

About CSV

The “character-separated values” – format stores tabular data in simple text files and is a de-facto standard. It can be read by almost any other software or you can easily write a parser in any programming language. The screen shot below (click image for larger version) shows the data imported into Microsoft Excel using the “Data” -> “From Text” function.

envirocar-table-excel

In the R environment for statistics computing and graphics, the following two lines suffice to download and import enviroCar CSV data and display a plot which contrasts selected measurement variables (click image for larger version).

track = read.csv2("https://envirocar.org/api/stable/tracks/53433169e4b09d7b34fa824a.csv")
plot(subset(track, select = c("Consumption.l.h.", "Speed.km.h.", "Rpm.u.min.")))

envirocar-measurements-plot-R

0 Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Time limit is exhausted. Please reload CAPTCHA.