Skip to content

Commit

Permalink
release as 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Nov 17, 2020
2 parents 42a834d + 73ce61a commit 2b48305
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 189 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## current master
## 1.2.3

### Bug Fixes

* fix a regression in version 1.2.0: `groupBy` requests return the property `groupByObjectId` instead of `groupByObject` as documented.


## 1.2.2
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

The ohsome API is a generic web API for in-depth analysis of OpenStreetMap (OSM) data with a focus on it's history. It allows to get aggregated statistics about the evolution of OSM data itself and about the contributors behind the data. Furthermore, data extraction methods are provided to access the historic development of individual OSM features.

The functionalities of the ohsome API can be accessed via HTTP requests. As a basis underneath serves the [OSHDB API](https://github.com/GIScience/oshdb). The current stable version is [v1.2.2](https://github.com/GIScience/ohsome-api/releases/tag/1.2.2). Developed and maintained by [HeiGIT](https://heigit.org/).
The functionalities of the ohsome API can be accessed via HTTP requests. As a basis underneath serves the [OSHDB API](https://github.com/GIScience/oshdb). The current stable version is [v1.2.3](https://github.com/GIScience/ohsome-api/releases/tag/1.2.3). Developed and maintained by [HeiGIT](https://heigit.org/).

## Using the ohsome API

Expand Down Expand Up @@ -38,8 +38,8 @@ These instructions will get you a copy of the project up and running on your loc
2. move to your Maven project directory in a shell (e.g. Windows PowerShell)
3. enter the command `mvn -DskipTests=true package` to build the project (if you want to build it running the integrated tests too, look at the section [Testing](#testing))
4. to run the jar file enter the following (if no additional keytables file is given, you can assume that it is included):
* keytables included: `java -jar target/ohsome-api-1.2.2.jar --database.db=C:/path-to-your-data/ba-wue.oshdb`
* keytables not included: `java -jar target/ohsome-api-1.2.2.jar --database.db=C:/path-to-your-data/ba-wue.oshdb --database.keytables=C:/path-to-your-keytablesFile/keytables`
* keytables included: `java -jar target/ohsome-api-1.2.3.jar --database.db=C:/path-to-your-data/ba-wue.oshdb`
* keytables not included: `java -jar target/ohsome-api-1.2.3.jar --database.db=C:/path-to-your-data/ba-wue.oshdb --database.keytables=C:/path-to-your-keytablesFile/keytables`

Now you should have a running local API, which is ready for receiving requests under *http://localhost:8080/*.
<br>To check if it is running properly, you should be able to visit the swagger documentation under *http://localhost:8080/swagger-ui.html*.
Expand Down Expand Up @@ -97,7 +97,7 @@ Here you see an example response giving the length of residential roads for a bo
"url": "https://ohsome.org/copyrights",
"text": "© OpenStreetMap contributors"
},
"apiVersion": "1.2.2",
"apiVersion": "1.2.3",
"metadata": {
"executionTime": 858,
"description": "Total length of items in meters.",
Expand Down
78 changes: 39 additions & 39 deletions docs/endpoints.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<name>ohsome API</name>
<description>A public Web-RESTful-API for "ohsome" OpenStreetMap history data.</description>
<packaging>jar</packaging>
<version>1.2.2</version>
<version>1.2.3</version>

<properties>
<apachecommons-csv.version>1.6</apachecommons-csv.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ public class AreaController {
* @param servletResponse <code>HttpServletResponse</code> of the outgoing response
* @return {@link org.heigit.ohsome.ohsomeapi.output.dataaggregationresponse.Response Response}
* @throws Exception thrown by
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregate()
* aggregate}
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregate() aggregate}
*/
@ApiOperation(value = "Area of OSM elements", nickname = "area",
response = DefaultAggregationResponse.class)
@RequestMapping(value = "", method = {RequestMethod.GET, RequestMethod.POST},
produces = {"application/json", "text/csv"})
public Response area(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
throws Exception {
public Response area(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception
{
AggregateRequestExecutor executor =
new AggregateRequestExecutor(RequestResource.AREA, servletRequest, servletResponse, false);
return executor.aggregate();
Expand Down Expand Up @@ -78,8 +77,7 @@ public Response areaGroupByType(HttpServletRequest servletRequest,
* @param servletResponse <code>HttpServletResponse</code> of the outgoing response
* @return {@link org.heigit.ohsome.ohsomeapi.output.dataaggregationresponse.Response Response}
* @throws Exception thrown by
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregateGroupByBoundary()
* aggregateGroupByBoundary}
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregateGroupByBoundary() aggregateGroupByBoundary}
*/
@ApiOperation(
value = "Area of OSM elements grouped by the boundary (bboxes, bcircles, or bpolys)",
Expand Down Expand Up @@ -176,8 +174,7 @@ public Response areaGroupByTag(HttpServletRequest servletRequest,
* @param servletResponse <code>HttpServletResponse</code> of the outgoing response
* @return {@link org.heigit.ohsome.ohsomeapi.output.dataaggregationresponse.Response Response}
* @throws Exception thrown by
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregate()
* aggregate}
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregate() aggregate}
*/
@ApiOperation(
value = "Density of OSM elements (area of elements divided "
Expand Down Expand Up @@ -220,8 +217,7 @@ public Response areaDensityGroupByType(HttpServletRequest servletRequest,
* @param servletResponse <code>HttpServletResponse</code> of the outgoing response
* @return {@link org.heigit.ohsome.ohsomeapi.output.dataaggregationresponse.Response Response}
* @throws Exception thrown by
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregateGroupByBoundary()
* aggregateGroupByBoundary}
* {@link org.heigit.ohsome.ohsomeapi.executor.AggregateRequestExecutor#aggregateGroupByBoundary() aggregateGroupByBoundary}
*/
@ApiOperation(
value = "Density of OSM elements grouped by the boundary (bboxes, bcircles, or bpolys)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private ImmutablePair<List<String>, List<String[]>> createCsvResponseForElements
List<String[]> rows = new LinkedList<>();
for (int i = 0; i < resultSet.length; i++) {
GroupByResult groupByResult = (GroupByResult) resultSet[i];
Object groupByObject = groupByResult.getGroupByObjectId();
Object groupByObject = groupByResult.getGroupByObject();
if (groupByObject instanceof Object[]) {
Object[] groupByObjectArr = (Object[]) groupByObject;
columnNames.add(groupByObjectArr[0].toString() + "_" + groupByObjectArr[1].toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private ImmutablePair<List<String>, List<String[]>> createCsvResponseForElements
List<String[]> rows = new LinkedList<>();
for (int i = 0; i < resultSet.length; i++) {
GroupByResult groupByResult = (GroupByResult) resultSet[i];
Object groupByObject = groupByResult.getGroupByObjectId();
Object groupByObject = groupByResult.getGroupByObject();
if (groupByObject instanceof Object[]) {
Object[] groupByObjectArr = (Object[]) groupByObject;
columnNames.add(groupByObjectArr[0].toString() + "_" + groupByObjectArr[1].toString());
Expand Down Expand Up @@ -814,9 +814,9 @@ private ImmutablePair<List<String>, List<String[]>> createCsvResponseForElements
List<String[]> rows = new LinkedList<>();
for (int i = 0; i < resultSet.length; i++) {
RatioGroupByResult ratioGroupByResult = (RatioGroupByResult) resultSet[i];
columnNames.add(ratioGroupByResult.getGroupByObjectId() + "_value");
columnNames.add(ratioGroupByResult.getGroupByObjectId() + "_value2");
columnNames.add(ratioGroupByResult.getGroupByObjectId() + "_ratio");
columnNames.add(ratioGroupByResult.getGroupByObject() + "_value");
columnNames.add(ratioGroupByResult.getGroupByObject() + "_value2");
columnNames.add(ratioGroupByResult.getGroupByObject() + "_ratio");
for (int j = 0; j < ratioGroupByResult.getRatioResult().length; j++) {
RatioResult ratioResult = ratioGroupByResult.getRatioResult()[j];
if (i == 0) {
Expand Down Expand Up @@ -852,7 +852,7 @@ private ImmutablePair<List<String>, List<String[]>> createCsvResponseForUsersGro
List<String[]> rows = new LinkedList<>();
for (int i = 0; i < resultSet.length; i++) {
GroupByResult groupByResult = (GroupByResult) resultSet[i];
columnNames.add(groupByResult.getGroupByObjectId().toString());
columnNames.add(groupByResult.getGroupByObject().toString());
for (int j = 0; j < groupByResult.getResult().length; j++) {
UsersResult usersResult = (UsersResult) groupByResult.getResult()[j];
if (i == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
public abstract class GroupByObject {

@ApiModelProperty(notes = "Object on which the results are grouped on", required = true)
protected Object groupByObjectId;
protected Object groupByObject;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class RatioGroupByResult extends GroupByObject {
required = true)
private RatioResult[] ratioResult;

public RatioGroupByResult(Object groupByObjectId, RatioResult[] ratioResult) {
super(groupByObjectId);
public RatioGroupByResult(Object groupByObject, RatioResult[] ratioResult) {
super(groupByObject);
this.ratioResult = ratioResult;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static Feature[] generateGroupByResultGeoJson(GroupByObject[] results,
}
feature.setProperty("value", res.getValue());
// needed for /groupBy/boundary/groupBy/tag
if (results[groupByResultCount].getGroupByObjectId() instanceof Object[]) {
if (results[groupByResultCount].getGroupByObject() instanceof Object[]) {
feature.setGeometry(geojsonGeoms[boundaryCount]);
if ((i + 1) % nestedGroupByNextBoundaryInterval == 0) {
boundaryCount++;
Expand Down Expand Up @@ -132,7 +132,7 @@ private static Feature fillGeojsonFeature(GroupByObject[] results, int groupByRe
/** Fills a GeoJSON Feature with the groupByBoundaryId and the geometry. */
private static Feature makeGeojsonFeature(GroupByObject[] results, int groupByResultCount,
String id) {
Object groupByBoundaryId = results[groupByResultCount].getGroupByObjectId();
Object groupByBoundaryId = results[groupByResultCount].getGroupByObject();
Feature feature = new Feature();
if (groupByBoundaryId instanceof Object[]) {
Object[] groupByBoundaryIdArr = (Object[]) groupByBoundaryId;
Expand Down
Loading

0 comments on commit 2b48305

Please sign in to comment.