Skip to content

Commit

Permalink
style: change objects names in responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosario Trischitta committed Feb 9, 2021
1 parent 90e6637 commit 158c660
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.heigit.bigspatialdata.oshdb.util.tagtranslator.OSMTag;
import org.heigit.bigspatialdata.oshdb.util.tagtranslator.TagTranslator;
import org.heigit.bigspatialdata.oshdb.util.time.TimestampFormatter;
import org.heigit.ohsome.filter.FilterExpression;
import org.heigit.ohsome.ohsomeapi.Application;
import org.heigit.ohsome.ohsomeapi.controller.rawdata.ElementsGeometry;
import org.heigit.ohsome.ohsomeapi.exception.DatabaseAccessException;
Expand Down Expand Up @@ -792,8 +791,8 @@ private ImmutablePair<List<String>, List<String[]>> createCsvResponseForElements
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];
for (int j = 0; j < ratioGroupByResult.getResult().length; j++) {
RatioResult ratioResult = ratioGroupByResult.getResult()[j];
if (i == 0) {
String[] row = new String[resultSet.length * 3 + 1];
row[0] = ratioResult.getTimestamp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public class RatioResponse implements Response {
@ApiModelProperty(notes = "Metadata describing the output")
private Metadata metadata;
@ApiModelProperty(notes = "ElementsResult for /ratio requests", required = true)
private RatioResult[] ratioResult;
private RatioResult[] result;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public class RatioGroupByBoundaryResponse implements Response {
private Feature[] features;
@ApiModelProperty(notes = "RatioGroupByResult array holding the respective objects "
+ "with their timestamp-value-value2-ratio values", required = true)
private RatioGroupByResult[] groupByBoundaryResult;
private RatioGroupByResult[] groupByResult;

public RatioGroupByBoundaryResponse(Attribution attribution, String apiVersion, Metadata metadata,
RatioGroupByResult[] groupByBoundaryResult) {
RatioGroupByResult[] groupByResult) {
this.attribution = attribution;
this.apiVersion = apiVersion;
this.metadata = metadata;
this.groupByBoundaryResult = groupByBoundaryResult;
this.groupByResult = groupByResult;
}

/** Static factory method returning the whole GeoJSON response. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class RatioGroupByResult extends GroupByObject {

@ApiModelProperty(notes = "RatioResult array holding timestamp, whole and part values",
required = true)
private RatioResult[] ratioResult;
private RatioResult[] result;

public RatioGroupByResult(Object groupByObject, RatioResult[] ratioResult) {
public RatioGroupByResult(Object groupByObject, RatioResult[] result) {
super(groupByObject);
this.ratioResult = ratioResult;
this.result = result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ private static Feature[] generateRatioGroupByResultGeoJson(GroupByObject[] resul
int tstampCount) {
Feature[] features;
RatioGroupByResult[] groupByResults = (RatioGroupByResult[]) results;
int resultLength = groupByResults[0].getRatioResult().length;
int resultLength = groupByResults[0].getResult().length;
int featuresLength = groupByResultsLength * resultLength;
features = new Feature[featuresLength];
for (int i = 0; i < featuresLength; i++) {
RatioResult result = groupByResults[groupByResultCount].getRatioResult()[tstampCount];
RatioResult result = groupByResults[groupByResultCount].getResult()[tstampCount];
String tstamp = result.getTimestamp();
Feature feature = fillGeojsonFeature(results, groupByResultCount, tstamp);
feature.setProperty("value", result.getValue());
Expand Down

0 comments on commit 158c660

Please sign in to comment.