Skip to content

Commit 7510921

Browse files
authored
Merge pull request #278 from GIScience/update-to_oshdb-0.8-snapshot
oshdb-1.0.0-beta-1
2 parents ab524fc + 2a7d52f commit 7510921

20 files changed

+260
-139
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Changelog
33

44
## 1.7.0-SNAPSHOT (current master)
55

6+
### Breaking Changes
7+
* update OSHDB to version 1.0.0-beta-1 ([#278])
8+
* OSM type strings change to `node`, `way`, `relation`
9+
610
### New Features
711

812
* add `contributions/count[/density]/groupBy/boundary` endpoints to fetch contribution counts/densities grouped by boundary ([#217])
@@ -21,6 +25,7 @@ Changelog
2125
[#228]: https://github.com/GIScience/ohsome-api/pull/228
2226
[#230]: https://github.com/GIScience/ohsome-api/pull/230
2327
[#274]: https://github.com/GIScience/ohsome-api/pull/274
28+
[#278]: https://github.com/GIScience/ohsome-api/pull/278
2429

2530

2631
## 1.6.3

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pipeline {
1212

1313
MAVEN_GENERAL_OPTIONS = '--batch-mode --update-snapshots'
1414
// START CUSTOM ohsome API
15-
MAVEN_TEST_OPTIONS = '-Dport_get=8081 -Dport_post=8082 -Dport_data=8083 -DdbFilePathProperty="--database.db=/opt/data/heidelberg-v0.7.oshdb"'
15+
MAVEN_TEST_OPTIONS = '-Dport_get=8081 -Dport_post=8082 -Dport_data=8083 -DdbFilePathProperty="--database.db=/opt/data/heidelberg-v1.0-beta.oshdb"'
1616
// END CUSTOM ohsome API
1717
SNAPSHOT_BRANCH_REGEX = /(^master$)/
1818
RELEASE_REGEX = /^([0-9]+(\.[0-9]+)*)(-(RC|beta-|alpha-)[0-9]+)?$/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ To run the tests locally, you need the following:
143143
* -Dport.get starts data-aggregation + metadata tests using GET requests
144144
* -Dport.post starts data-aggregation tests using POST requests
145145
* -Dport.data starts data-extraction tests using GET and POST requests
146-
2. [heidelberg.oshdb](https://downloads.ohsome.org/OSHDB/v0.7/europe/germany/baden-wuerttemberg/heidelberg.oshdb.mv.db) file (or any other, which includes the data from Heidelberg)
146+
2. [heidelberg.oshdb](https://downloads.ohsome.org/OSHDB/v1.0/europe/germany/baden-wuerttemberg/heidelberg.oshdb.mv.db) file (or any other, which includes the data from Heidelberg)
147147
3. maven command: `mvn -Dport_get=8081 -Dport_post=8082 -Dport_data=8083 -DdbFilePathProperty="--database.db=<path-to-your-heidelberg.oshdb-file>" test`
148148

149149
*Note:*

docs/endpoints.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
20432043
"@changesetId" : 83099383,
20442044
"@contributionChangesetId" : 83099383,
20452045
"@osmId" : "node/323191854",
2046-
"@osmType" : "NODE",
2046+
"@osmType" : "node",
20472047
"@tagChange" : true,
20482048
"@timestamp" : "2020-04-05T13:32:50Z",
20492049
"@version" : 8,
@@ -2077,7 +2077,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
20772077
"@changesetId" : 83099383,
20782078
"@contributionChangesetId" : 83099383,
20792079
"@osmId" : "node/5400804545",
2080-
"@osmType" : "NODE",
2080+
"@osmType" : "node",
20812081
"@tagChange" : true,
20822082
"@timestamp" : "2020-04-05T13:32:50Z",
20832083
"@version" : 2,
@@ -2120,7 +2120,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
21202120
"@changesetId" : 83099383,
21212121
"@contributionChangesetId" : 83099383,
21222122
"@osmId" : "node/323191854",
2123-
"@osmType" : "NODE",
2123+
"@osmType" : "node",
21242124
"@tagChange" : true,
21252125
"@timestamp" : "2020-04-05T13:32:50Z",
21262126
"@version" : 8,
@@ -2154,7 +2154,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
21542154
"@changesetId" : 83099383,
21552155
"@contributionChangesetId" : 83099383,
21562156
"@osmId" : "node/5400804545",
2157-
"@osmType" : "NODE",
2157+
"@osmType" : "node",
21582158
"@tagChange" : true,
21592159
"@timestamp" : "2020-04-05T13:32:50Z",
21602160
"@version" : 2,
@@ -2197,7 +2197,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
21972197
"@changesetId" : 83099383,
21982198
"@contributionChangesetId" : 83099383,
21992199
"@osmId" : "node/323191854",
2200-
"@osmType" : "NODE",
2200+
"@osmType" : "node",
22012201
"@tagChange" : true,
22022202
"@timestamp" : "2020-04-05T13:32:50Z",
22032203
"@version" : 8,
@@ -2231,7 +2231,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
22312231
"@changesetId" : 83099383,
22322232
"@contributionChangesetId" : 83099383,
22332233
"@osmId" : "node/5400804545",
2234-
"@osmType" : "NODE",
2234+
"@osmType" : "node",
22352235
"@tagChange" : true,
22362236
"@timestamp" : "2020-04-05T13:32:50Z",
22372237
"@version" : 2,
@@ -2274,7 +2274,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
22742274
"@changesetId" : 83099383,
22752275
"@contributionChangesetId" : 83099383,
22762276
"@osmId" : "node/323191854",
2277-
"@osmType" : "NODE",
2277+
"@osmType" : "node",
22782278
"@tagChange" : true,
22792279
"@timestamp" : "2020-04-05T13:32:50Z",
22802280
"@version" : 8,
@@ -2308,7 +2308,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg
23082308
"@changesetId" : 83099383,
23092309
"@contributionChangesetId" : 83099383,
23102310
"@osmId" : "node/5400804545",
2311-
"@osmType" : "NODE",
2311+
"@osmType" : "node",
23122312
"@tagChange" : true,
23132313
"@timestamp" : "2020-04-05T13:32:50Z",
23142314
"@version" : 2,
@@ -2398,7 +2398,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
23982398
"@contributionChangesetId" : 85604249,
23992399
"@geometryChange" : true,
24002400
"@osmId" : "way/795435536",
2401-
"@osmType" : "WAY",
2401+
"@osmType" : "way",
24022402
"@timestamp" : "2020-05-22T10:22:53Z",
24032403
"@version" : 3,
24042404
"landuse" : "construction"
@@ -2411,7 +2411,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
24112411
"@contributionChangesetId" : 51902131,
24122412
"@deletion" : true,
24132413
"@osmId" : "way/135635599",
2414-
"@osmType" : "WAY",
2414+
"@osmType" : "way",
24152415
"@timestamp" : "2017-09-10T09:22:03Z",
24162416
"@version" : 9
24172417
}
@@ -2447,7 +2447,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
24472447
"@contributionChangesetId" : 85604249,
24482448
"@geometryChange" : true,
24492449
"@osmId" : "way/795435536",
2450-
"@osmType" : "WAY",
2450+
"@osmType" : "way",
24512451
"@timestamp" : "2020-05-22T10:22:53Z",
24522452
"@version" : 3,
24532453
"landuse" : "construction"
@@ -2460,7 +2460,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
24602460
"@contributionChangesetId" : 51902131,
24612461
"@deletion" : true,
24622462
"@osmId" : "way/135635599",
2463-
"@osmType" : "WAY",
2463+
"@osmType" : "way",
24642464
"@timestamp" : "2017-09-10T09:22:03Z",
24652465
"@version" : 9
24662466
}
@@ -2496,7 +2496,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
24962496
"@contributionChangesetId" : 85604249,
24972497
"@geometryChange" : true,
24982498
"@osmId" : "way/795435536",
2499-
"@osmType" : "WAY",
2499+
"@osmType" : "way",
25002500
"@timestamp" : "2020-05-22T10:22:53Z",
25012501
"@version" : 3,
25022502
"landuse" : "construction"
@@ -2509,7 +2509,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
25092509
"@contributionChangesetId" : 51902131,
25102510
"@deletion" : true,
25112511
"@osmId" : "way/135635599",
2512-
"@osmType" : "WAY",
2512+
"@osmType" : "way",
25132513
"@timestamp" : "2017-09-10T09:22:03Z",
25142514
"@version" : 9
25152515
}
@@ -2545,7 +2545,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
25452545
"@contributionChangesetId" : 85604249,
25462546
"@geometryChange" : true,
25472547
"@osmId" : "way/795435536",
2548-
"@osmType" : "WAY",
2548+
"@osmType" : "way",
25492549
"@timestamp" : "2020-05-22T10:22:53Z",
25502550
"@version" : 3,
25512551
"landuse" : "construction"
@@ -2558,7 +2558,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei
25582558
"@contributionChangesetId" : 51902131,
25592559
"@deletion" : true,
25602560
"@osmId" : "way/135635599",
2561-
"@osmType" : "WAY",
2561+
"@osmType" : "way",
25622562
"@timestamp" : "2017-09-10T09:22:03Z",
25632563
"@version" : 9
25642564
}

docs/response-parameters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Description of the custom response parameters that are marked with a leading ``@
4242
* ``@osmId`` - id of the OSM element, including its type (e.g. node/1)
4343
* ``@version`` - version number of the OSM element
4444
* ``@changesetId`` - id of the OSM changeset which last increased the version of this OSM element
45-
* ``@osmType`` - type of the OSM element (NODE, WAY or RELATION)
45+
* ``@osmType`` - type of the OSM element (node, way or relation)
4646

4747
**specific for /elements**
4848

pom.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@
2323
</scm>
2424

2525
<properties>
26-
<apachecommons-csv.version>1.6</apachecommons-csv.version>
27-
<apachecommons.version>3.7</apachecommons.version>
28-
<geojson-jackson.version>1.8</geojson-jackson.version>
29-
<geotools.version>20.2</geotools.version>
26+
<apachecommons-csv.version>1.9.0</apachecommons-csv.version>
27+
<apachecommons.version>3.12.0</apachecommons.version>
28+
<geojson-jackson.version>1.14</geojson-jackson.version>
29+
<geotools.version>27.0</geotools.version>
3030
<gitcommitplugin.version>2.2.6</gitcommitplugin.version>
31-
<hikaricp.version>3.4.2</hikaricp.version>
32-
<jacksondatatype.version>2.9.8</jacksondatatype.version>
31+
<hikaricp.version>5.0.1</hikaricp.version>
32+
<jacksondatatype.version>2.13.3</jacksondatatype.version>
3333
<javaxjson.version>1.1.4</javaxjson.version>
34-
<jsonpath.version>2.2.0</jsonpath.version>
35-
<jts2geojson.version>0.13.0</jts2geojson.version>
34+
<jsonpath.version>2.7.0</jsonpath.version>
35+
<jts2geojson.version>0.17.0</jts2geojson.version>
3636
<mavenjar.version>3.2.0</mavenjar.version>
37-
<opencsv.version>4.0</opencsv.version>
38-
<oshdb.version>0.7.2</oshdb.version>
37+
<opencsv.version>5.6</opencsv.version>
38+
<oshdb.version>1.0.0-beta-1</oshdb.version>
3939
<projectlombok.version>1.18.16</projectlombok.version>
4040
<sonar.sources>src/main/lombok</sonar.sources>
41-
<springboot.version>2.5.12</springboot.version>
41+
<springboot.version>2.5.14</springboot.version>
4242
<spring.version>5.3.18</spring.version>
4343
<springfox.version>2.9.2</springfox.version>
4444
</properties>
@@ -155,10 +155,14 @@
155155
<artifactId>javax.json</artifactId>
156156
<version>${javaxjson.version}</version>
157157
</dependency>
158-
<!-- https://mvnrepository.com/artifact/org.geotools/gt-geometry -->
159158
<dependency>
160159
<groupId>org.geotools</groupId>
161-
<artifactId>gt-geometry</artifactId>
160+
<artifactId>gt-opengis</artifactId>
161+
<version>${geotools.version}</version>
162+
</dependency>
163+
<dependency>
164+
<groupId>org.geotools</groupId>
165+
<artifactId>gt-main</artifactId>
162166
<version>${geotools.version}</version>
163167
</dependency>
164168
<!-- https://mvnrepository.com/artifact/org.geotools/gt-epsg-hsql -->

src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.heigit.ohsome.ohsomeapi.output.groupby.GroupByResult;
3737
import org.heigit.ohsome.ohsomeapi.output.ratio.RatioResult;
3838
import org.heigit.ohsome.ohsomeapi.utils.RequestUtils;
39+
import org.heigit.ohsome.ohsomeapi.utils.TimestampFormatter;
3940
import org.heigit.ohsome.oshdb.OSHDBTimestamp;
4041
import org.heigit.ohsome.oshdb.api.generic.OSHDBCombinedIndex;
4142
import org.heigit.ohsome.oshdb.api.mapreducer.MapAggregator;
@@ -44,7 +45,6 @@
4445
import org.heigit.ohsome.oshdb.util.function.SerializableFunction;
4546
import org.heigit.ohsome.oshdb.util.geometry.Geo;
4647
import org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot;
47-
import org.heigit.ohsome.oshdb.util.time.TimestampFormatter;
4848
import org.locationtech.jts.geom.Geometry;
4949
import org.locationtech.jts.geom.Polygonal;
5050

src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/DataExtractionTransformer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
import org.heigit.ohsome.ohsomeapi.controller.dataextraction.elements.ElementsGeometry;
1212
import org.heigit.ohsome.ohsomeapi.inputprocessing.InputProcessingUtils;
1313
import org.heigit.ohsome.ohsomeapi.inputprocessing.SimpleFeatureType;
14+
import org.heigit.ohsome.ohsomeapi.utils.TimestampFormatter;
1415
import org.heigit.ohsome.oshdb.filter.FilterExpression;
1516
import org.heigit.ohsome.oshdb.osm.OSMEntity;
1617
import org.heigit.ohsome.oshdb.util.celliterator.ContributionType;
1718
import org.heigit.ohsome.oshdb.util.mappable.OSMContribution;
1819
import org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot;
19-
import org.heigit.ohsome.oshdb.util.time.TimestampFormatter;
2020
import org.locationtech.jts.geom.Geometry;
2121
import org.wololo.geojson.Feature;
2222

src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
import org.heigit.ohsome.ohsomeapi.output.elements.ElementsResult;
4141
import org.heigit.ohsome.ohsomeapi.output.groupby.GroupByResponse;
4242
import org.heigit.ohsome.ohsomeapi.output.groupby.GroupByResult;
43+
import org.heigit.ohsome.ohsomeapi.utils.FilterUtil;
4344
import org.heigit.ohsome.ohsomeapi.utils.GroupByBoundaryGeoJsonGenerator;
45+
import org.heigit.ohsome.ohsomeapi.utils.TimestampFormatter;
4446
import org.heigit.ohsome.oshdb.OSHDBTag;
4547
import org.heigit.ohsome.oshdb.OSHDBTimestamp;
4648
import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
@@ -57,7 +59,6 @@
5759
import org.heigit.ohsome.oshdb.util.geometry.Geo;
5860
import org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot;
5961
import org.heigit.ohsome.oshdb.util.tagtranslator.TagTranslator;
60-
import org.heigit.ohsome.oshdb.util.time.TimestampFormatter;
6162
import org.locationtech.jts.geom.Geometry;
6263
import org.locationtech.jts.geom.Polygonal;
6364
import org.wololo.geojson.Feature;
@@ -485,6 +486,8 @@ public static Response aggregateGroupByKey(RequestResource requestResource,
485486
resultSet);
486487
}
487488

489+
490+
488491
/**
489492
* Performs a count|length|perimeter|area|ratio calculation.
490493
*
@@ -576,7 +579,7 @@ public static Response aggregateBasicFiltersRatio(RequestResource requestResourc
576579
} else {
577580
mapRed = inputProcessor.processParameters();
578581
}
579-
mapRed = mapRed.osmType(osmTypes);
582+
mapRed = mapRed.filter(FilterUtil.filter(osmTypes));
580583
mapRed = ExecutionUtils.snapshotFilter(mapRed, osmTypes1, osmTypes2, simpleFeatureTypes1,
581584
simpleFeatureTypes2, keysInt1, keysInt2, valuesInt1, valuesInt2);
582585
var preResult = mapRed.aggregateByTimestamp().aggregateBy(snapshot -> {
@@ -825,7 +828,7 @@ public static <P extends Geometry & Polygonal> Response aggregateBasicFiltersRat
825828
} else {
826829
mapRed = inputProcessor.processParameters();
827830
}
828-
mapRed = mapRed.osmType(osmTypes);
831+
mapRed = mapRed.filter(FilterUtil.filter(osmTypes));
829832
ArrayList<Geometry> arrGeoms = new ArrayList<>(processingData.getBoundaryList());
830833
// intentionally as check for P on Polygonal is already performed
831834
@SuppressWarnings({"unchecked"})

src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.heigit.ohsome.ohsomeapi.output.ratio.RatioResult;
6969
import org.heigit.ohsome.ohsomeapi.utils.GroupByBoundaryGeoJsonGenerator;
7070
import org.heigit.ohsome.ohsomeapi.utils.RequestUtils;
71+
import org.heigit.ohsome.ohsomeapi.utils.TimestampFormatter;
7172
import org.heigit.ohsome.oshdb.OSHDBBoundingBox;
7273
import org.heigit.ohsome.oshdb.OSHDBTag;
7374
import org.heigit.ohsome.oshdb.OSHDBTimestamp;
@@ -87,7 +88,6 @@
8788
import org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot;
8889
import org.heigit.ohsome.oshdb.util.tagtranslator.OSMTag;
8990
import org.heigit.ohsome.oshdb.util.tagtranslator.TagTranslator;
90-
import org.heigit.ohsome.oshdb.util.time.TimestampFormatter;
9191
import org.locationtech.jts.geom.Envelope;
9292
import org.locationtech.jts.geom.Geometry;
9393
import org.locationtech.jts.geom.Lineal;
@@ -135,13 +135,14 @@ public static boolean snapshotMatches(OSMEntitySnapshot snapshot, Set<OSMType> o
135135
Set<SimpleFeatureType> simpleFeatureTypes, Integer[] keysInt, Integer[] valuesInt) {
136136
boolean matchesTags = true;
137137
OSMEntity entity = snapshot.getEntity();
138+
138139
if (osmTypes.contains(entity.getType())) {
139140
for (int i = 0; i < keysInt.length; i++) {
140141
boolean matchesTag;
141142
if (i < valuesInt.length) {
142-
matchesTag = entity.hasTagValue(keysInt[i], valuesInt[i]);
143+
matchesTag = entity.getTags().hasTagValue(keysInt[i], valuesInt[i]);
143144
} else {
144-
matchesTag = entity.hasTagKey(keysInt[i]);
145+
matchesTag = entity.getTags().hasTagKey(keysInt[i]);
145146
}
146147
if (!matchesTag) {
147148
matchesTags = false;
@@ -404,7 +405,7 @@ public org.wololo.geojson.Feature createOSMFeature(OSMEntity entity, Geometry ge
404405
}
405406
if (includeOSMMetadata) {
406407
properties.put("@version", entity.getVersion());
407-
properties.put("@osmType", entity.getType());
408+
properties.put("@osmType", entity.getType().toString());
408409
properties.put("@changesetId", entity.getChangesetId());
409410
if (isContributionsEndpoint) {
410411
properties = addContributionTypes(properties, contributionTypes);

0 commit comments

Comments
 (0)