Skip to content

Commit

Permalink
integration of csv output format
Browse files Browse the repository at this point in the history
for all snapshot data aggregation requests via setting the parameter “format=csv”
  • Loading branch information
FabiKo117 committed Jan 11, 2019
1 parent 2849ef2 commit 3850891
Show file tree
Hide file tree
Showing 13 changed files with 608 additions and 401 deletions.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -89,6 +90,12 @@
<artifactId>geojson-jackson</artifactId>
<version>1.8</version>
</dependency>
<!-- needed for creating the csv response -->
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-epsg-hsql -->
<dependency>
<groupId>org.geotools</groupId>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Response count(@ApiParam(hidden = true) @RequestParam(defaultValue = "")
return UsersRequestExecutor.executeCount(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")));
userids, time, request.getParameter("format"), request.getParameter("showMetadata")));
}

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ public Response countGroupByType(
return UsersRequestExecutor.executeCountGroupByType(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")));
userids, time, request.getParameter("format"), request.getParameter("showMetadata")));
}

/**
Expand Down Expand Up @@ -107,12 +107,11 @@ public Response countGroupByTag(
@RequestParam(value = "groupByValues", defaultValue = "",
required = false) String[] groupByValues)
throws Exception {
return UsersRequestExecutor
.executeCountGroupByTag(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys,
values, userids, time, request.getParameter("showMetadata")),
groupByKey, groupByValues);
return UsersRequestExecutor.executeCountGroupByTag(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
groupByKey, groupByValues);
}

/**
Expand Down Expand Up @@ -145,7 +144,7 @@ public Response countGroupByKey(
return UsersRequestExecutor.executeCountGroupByKey(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
groupByKey);
}

Expand Down Expand Up @@ -175,7 +174,7 @@ public Response countDensity(
return UsersRequestExecutor.executeCount(
new RequestParameters(request.getMethod(), false, true, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")));
userids, time, request.getParameter("format"), request.getParameter("showMetadata")));
}

/**
Expand Down Expand Up @@ -203,7 +202,7 @@ public Response countDensityGroupByType(
return UsersRequestExecutor.executeCountGroupByType(
new RequestParameters(request.getMethod(), false, true, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")));
userids, time, request.getParameter("format"), request.getParameter("showMetadata")));
}

/**
Expand Down Expand Up @@ -238,11 +237,10 @@ public Response countDensityGroupByTag(
@RequestParam(value = "groupByValues", defaultValue = "",
required = false) String[] groupByValues)
throws Exception {
return UsersRequestExecutor
.executeCountGroupByTag(
new RequestParameters(request.getMethod(), false, true, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys,
values, userids, time, request.getParameter("showMetadata")),
groupByKey, groupByValues);
return UsersRequestExecutor.executeCountGroupByTag(
new RequestParameters(request.getMethod(), false, true, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
groupByKey, groupByValues);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void retrieveOSMDataRaw(
ElementsRequestExecutor.executeElements(
new RequestParameters(request.getMethod(), true, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.RAW, properties, response);
}

Expand Down Expand Up @@ -92,7 +92,7 @@ public void retrieveOSMDataBbox(
ElementsRequestExecutor.executeElements(
new RequestParameters(request.getMethod(), true, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.BBOX, properties, response);
}

Expand Down Expand Up @@ -128,7 +128,7 @@ public void retrieveOSMDataCentroid(
ElementsRequestExecutor.executeElements(
new RequestParameters(request.getMethod(), true, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.CENTROID, properties, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void retrieveOSMDataRawFullHistory(
ElementsRequestExecutor.executeElementsFullHistory(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.RAW, properties, response);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public void retrieveOSMDataBbox(
ElementsRequestExecutor.executeElementsFullHistory(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.BBOX, properties, response);
}

Expand Down Expand Up @@ -130,7 +130,7 @@ public void retrieveOSMDataCentroid(
ElementsRequestExecutor.executeElementsFullHistory(
new RequestParameters(request.getMethod(), false, false, request.getParameter("bboxes"),
request.getParameter("bcircles"), request.getParameter("bpolys"), types, keys, values,
userids, time, request.getParameter("showMetadata")),
userids, time, request.getParameter("format"), request.getParameter("showMetadata")),
ElementsGeometry.CENTROID, properties, response);
}
}
Loading

0 comments on commit 3850891

Please sign in to comment.