Becoming ohsome is simple: Adding support of simple feature types to the ohsome API

It’s been a while, since  we have published the last blog post about the awesome ohsome platform, but don’t worry, there’s always something happening of course in the spatial analytics team of HeiGIT. So here we are, back on track with enlarging your imagination on what is possible when using our OpenStreetMap history analytics tool. This blog post presents a recently added feature, namely the integration of simple feature keywords in the filters of the ohsome API. It is now possible to filter directly on point1, line1, polygon1, or other1 features using these respective keywords in the types filter of the API. Let’s look at two examples to get ideas about what we can do with that new feature.

The first example uses types=polygon in combination with keys=building to retrieve all buildings from a specified region, in this case from the old town of Bergamo in Italy for the 1st of October 2019. With the help of this filter, we do not need to know which OSM types we have to use (node vs. way vs. relation), but just get all buildings that are properly mapped with a correct geometry. This means that the result consists of a combination of way and relation features. Using the simple feature filters also results in a decrease in processing time, as we can filter out more complex geometries earlier in our processing chain, which would otherwise be included longer, if you would just use types=way,relation. The following visualization shows the returned data together with an OSM base map and the used bounding box.

The second example gives us actually just the opposite. It returns the incorrectly mapped (or tagged) buildings, this time for a bounding box around Frankfurt, Germany and using the same timestamp. To receive that data we use the types=line,other filter together with keys=building. In this response you can find for example features with the tag building=no, which is explicitly defined as not being a valid tag to define a polygon (further info). Especially this approach, searching for falsely tagged or drawn features, in other words erroneous data, has not really been covered in our analyses thus far. Having this new filtering feature enables you to fire such requests on our API and search for that kind of data in any region in the world.

If you liked this post (and even more so if not), or have any other ideas/comments/etc. please drop us a message at our info(at)heigit.org email address. Don’t forget to stay ohsome!

1 for those of you that are interested on what’s happening under the hood, here’s on what this new filter is based on internally:

  • point is puntal and uses the OSM type node
  • line is lineal and uses way features that are not seen as polygons, e.g.: roundabouts having the tag highway=* are closed ways, but not interpreted as planar features, so they are included here
  • polygon is polygonal and uses way, as well as relation features that are planar (planar := features having an area) and have a corresponding tag, which tells us that this feature has an area, e.g.: building, landuse; for further info see TagInterpreter of the OSHDB or List of polygon features
  • other is a geometry-collection and uses relation, e.g.: turn restrictions

Posted

in

, ,

by