• Home
  • About

GIScience News Blog

News of Heidelberg University’s GIScience Research Group.

Feed on
Posts
Comments
« GIScience for physical activity research
Successfull PhD Defence of Xuke Hu about Indoor Building Reconstruction from different Sources »

New function in the ohsome API for checking query parameters

Jul 23rd, 2020 by Fabian Kowatsch

As you may already know from the latest blog posts, new advancements are brought with the release 1.0 of the #ohsome API. One minor function involves the correctness of parameters that you can use in your queries, which was developed by our intern Rosario in the last weeks.

The new feature

Let’s say you send a request to compute the amount of residential buildings in a small area in Heidelberg on 1st of January 2015. You misspell the parameter “bboxes” and write “bbox” instead. In this case, the new feature of the ohsome API will give you a quick response back, indicating that the parameter “bbox” is unknown and it will suggest – if possible – the proper parameter to use. The response of the ohsome API will look as follows:

{
"timestamp": "2020-07-13T14:58:05.346",
"status": 400,
"message": "Unknown parameter 'bbox' for this resource. Did you mean 'bboxes'?",
"requestUrl": "https://api.ohsome.org/v1/elements/count?bbox=8.67452,49.40961,8.70392,49.41823&time=2015-01-01&filter=building=residential and type:way“
}

You could also use a parameter which is correct, but is supposed to be used for other resources. Let’s suppose you make this request. Although the ohsome API knows about the parameter “properties”, its use in this context is wrong, since “properties” doesn’t work for /elements/count (here you can find a list about which parameter works for which resource). The ohsome API will give the following message back:

“message”: “Unknown parameter ‘properties’ for this resource.”

So don’t be afraid to be wrong, the ohsome API will help you!

How it works

The new implemented feature uses a string similarity algorithm called “Fuzzy Score”: When an unfit parameter is encountered, it is compared against the list of correct parameters for the requested resource of the ohsome API. If a sequence of characters matches against a sequence of characters of a proper parameter in the list, then the algorithm will give points to this parameter. A higher final score indicates that more characters are in sequence, which implicates more similarity. Only the first two parameters with the highest score will be suggested in the response. Each of them must have at least a score of five. If the score is lower than five, you will get only an “unknown parameter” message without suggestion. We chose five because according to the behavior of the algorithm and to our set of valid parameters, a score of five is suitable as threshold to either give a suggestion (score >= 5) or don’t (score < 5). Furthermore, the algorithm is case insensitive, which means it works regardless if the parameter is written in upper or lower case letters.

Before writing the code we valuated a lot of string similarity algorithms which could have helped for our purpose. If you want to know more about it, you can start by checking this easy introduction. Also if you want to know how this feature was implemented, check the code on GitHub: StringSimilarity.java and ResourceParameters.java.

ohsome sounds like awesome

Background Info

The aim of the ohsome OpenStreetMap History Data Analytics Platform is to make OpenStreetMap’s full-history data more easily accessible for various kinds of OSM data analytics tasks, such as data quality analysis, on a global scale. The ohsome API is one of its components, providing free and easy access to some of the functionalities of the ohsome platform via HTTP requests. Some intro can be found here:

  • ohsome general architecture
  • the whole “how to become ohsome” tutorials series
  • how to make a query
  • integration of simple feature keywords in the filters of the ohsome API.
  • how spatial joins queries work in the OpenStreetMap History Database OSHDB

Tags: Big Spatial Data, heigit, intrinsic quality analysis, JAVA, ohsome, OpenStreetMap, OSM, OSM History Analytics

Posted in Services, Software

Comments are closed.

  • About

    GIScience News Blog
    News of Heidelberg University’s GIScience Research Group.
    There are 1,674 Posts and 0 Comments so far.

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Recent Posts

    • New paper on the automatic characterization of surface activities from 4D point clouds
    • OSHDB Version 1.0 Has Arrived
    • Job Opening for Postdoc / Senior Researcher on OpenStreetMap Road Quality Analysis
    • Geography Awareness Week 14.-19.11.2022
    • Open Data: Multi-platform point clouds and orthophotos of the inland dune in Sandhausen
  • Tags

    3D 3DGEO Big Spatial Data CAP4Access Citizen Science Conference crisis mapping Crowdsourcing data quality deep learning disaster DisasterMapping GeoNet.MRN GIScience heigit HOT humanitarian humanitarian mapping Humanitarian OpenStreetMap team intrinsic quality analysis landuse laser scanning Lidar machine-learning Mapathon MapSwipe MissingMaps Missing Maps ohsome ohsome example Open data openrouteservice OpenStreetMap OSM OSM History Analytics Public Health Quality quality analysis remote sensing routing social media spatial analysis Teaching VGI Workshop
  • Archives

    • December 2022
    • November 2022
    • October 2022
    • September 2022
    • August 2022
    • July 2022
    • June 2022
    • May 2022
    • April 2022
    • March 2022
    • February 2022
    • January 2022
    • December 2021
    • November 2021
    • October 2021
    • September 2021
    • August 2021
    • July 2021
    • June 2021
    • May 2021
    • April 2021
    • March 2021
    • February 2021
    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
    • October 2014
    • September 2014
    • August 2014
    • July 2014
    • June 2014
    • May 2014
    • April 2014
    • March 2014
    • February 2014
    • January 2014
    • December 2013
    • November 2013
    • October 2013
    • September 2013
    • August 2013
    • July 2013
    • June 2013
    • May 2013
    • April 2013
  •  

    July 2020
    M T W T F S S
    « Jun   Aug »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Recent Comments

    GIScience News Blog CC by-nc-sa Some Rights Reserved.

    Free WordPress Themes | Fresh WordPress Themes