Skip to content

Commit 1b48114

Browse files
authored
1.0.0 rc1 (#15)
* removed proj4 string from proj extension * moved commons metadata fields to item * added shape and transform fields to proj extension * added collection assets extension * added tiled assets extension * added item assets extension * Added single file stac extension * updated version and link to oafeat.yaml doc * fixed asset builder method visibility * fixed bug in error response composer; updated spring boot version * updating to beta 2 * added type to catalog/collection data structures * #1008 - add collection assets * #1008 - support collection assets in CollectionMetadataAdapter * #1024 - Added support for processing and file extensions * added summaries to catalog * #967 - changed stats object fields to minimum and maximum * #990 - renamed Scientific extension to ScientificCitation * #934 - removed checksum extension * #1008 - removed collection assets extension * removed support for rsocket * removed rsocket module * bumped junit version to 4.13.2 * added conformance to landing page * implemented filter-lang and filter-crs * made filter-lang and filter-crs query params not required * remove support for 'query' parameter - use 'filter' instead * make filter-lang and filter-crs params optional for all controller methods * return proper exception message when using invalid filter-lang
1 parent 1b6a4c6 commit 1b48114

78 files changed

Lines changed: 1298 additions & 513 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Staccato is built using the latest versions of [Spring Boot](https://docs.spring
1414
and [Spring WebFlux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html). The
1515
application is reactive, utilizing the [Project Reactor](https://projectreactor.io) library.
1616

17-
Staccato is available at https://stac.boundlessgeo.io/stac and is browsable via the [stac-browser](https://github.com/radiantearth/stac-browser/) at https://boundless.stac.cloud/
17+
Staccato is available to preview at https://stac.boundlessgeo.io and is browsable via the [stac-browser](https://github.com/radiantearth/stac-browser/) at https://boundless.stac.cloud/
1818

1919
## About the STAC Spec
2020

pom.xml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
<groupId>com.planet.staccato</groupId>
77
<artifactId>staccato</artifactId>
8-
<version>0.9.0.1</version>
8+
<version>1.0.0-rc1</version>
99
<packaging>pom</packaging>
1010

1111
<parent>
1212
<groupId>org.springframework.boot</groupId>
1313
<artifactId>spring-boot-starter-parent</artifactId>
14-
<version>2.2.3.RELEASE</version>
14+
<version>2.4.4</version>
1515
<relativePath/> <!-- lookup parent from repository -->
1616
</parent>
1717

@@ -107,6 +107,14 @@
107107
</dependencies>
108108

109109
<repositories>
110+
<repository>
111+
<snapshots>
112+
<enabled>false</enabled>
113+
</snapshots>
114+
<id>central</id>
115+
<name>Maven Repository Switchboard</name>
116+
<url>https://repo.maven.apache.org/maven2/</url>
117+
</repository>
110118
<repository>
111119
<id>spring-snapshots</id>
112120
<name>Spring Snapshots</name>
@@ -123,6 +131,7 @@
123131
<enabled>false</enabled>
124132
</snapshots>
125133
</repository>
134+
<!--
126135
<repository>
127136
<id>boundless</id>
128137
<name>Boundless Maven Repository</name>
@@ -149,9 +158,43 @@
149158
<enabled>false</enabled>
150159
</snapshots>
151160
</repository>
161+
-->
162+
<repository>
163+
<id>osgeo</id>
164+
<name>OSGeo Repository</name>
165+
<url>https://repo.osgeo.org/repository/release/</url>
166+
<snapshots>
167+
<enabled>false</enabled>
168+
</snapshots>
169+
<releases>
170+
<enabled>true</enabled>
171+
</releases>
172+
</repository>
173+
<repository>
174+
<id>osgeo-snapshot</id>
175+
<name>OSGeo Snapshot Repository</name>
176+
<url>https://repo.osgeo.org/repository/snapshot/</url>
177+
<snapshots>
178+
<enabled>true</enabled>
179+
</snapshots>
180+
<releases>
181+
<enabled>false</enabled>
182+
</releases>
183+
</repository>
152184
</repositories>
153185

154186
<pluginRepositories>
187+
<pluginRepository>
188+
<releases>
189+
<updatePolicy>never</updatePolicy>
190+
</releases>
191+
<snapshots>
192+
<enabled>false</enabled>
193+
</snapshots>
194+
<id>central</id>
195+
<name>Maven Plugin Repository</name>
196+
<url>http://repo1.maven.org/maven2</url>
197+
</pluginRepository>
155198
<pluginRepository>
156199
<id>spring-snapshots</id>
157200
<name>Spring Snapshots</name>

staccato-application/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazoncorretto:11.0.2
1+
FROM amazoncorretto:11.0.7
22
MAINTAINER josh@federal.planet.com
33

44
ARG JAR_NAME

staccato-application/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>com.planet.staccato</groupId>
1414
<artifactId>staccato</artifactId>
15-
<version>0.9.0.1</version>
15+
<version>1.0.0-rc1</version>
1616
</parent>
1717

1818
<properties>
@@ -61,13 +61,13 @@
6161
<artifactId>noggit</artifactId>
6262
<version>0.7</version>
6363
</dependency>
64-
64+
<!--
6565
<dependency>
6666
<groupId>io.micrometer</groupId>
6767
<artifactId>micrometer-core</artifactId>
6868
<version>1.0.7</version>
6969
</dependency>
70-
70+
-->
7171
<!-- Test Dependencies -->
7272
<dependency>
7373
<groupId>org.springframework.boot</groupId>
@@ -91,7 +91,7 @@
9191
<dependency>
9292
<groupId>junit</groupId>
9393
<artifactId>junit</artifactId>
94-
<version>4.12</version>
94+
<version>4.13.2</version>
9595
<scope>test</scope>
9696
</dependency>
9797

staccato-application/src/main/java/com/planet/staccato/api/ApiApi.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,25 @@ public interface ApiApi {
2222
Mono<Item> getItem(@PathVariable("id") String id);
2323

2424
@GetMapping(path = "/search")
25-
Mono<ItemCollection> getItems(@Valid SearchRequest searchRequest);
25+
Mono<ItemCollection> getItems(@Valid SearchRequest searchRequest,
26+
@RequestParam(value = "filter-lang", required = false) String filterLang,
27+
@RequestParam(value = "filter-crs", required = false) String filterCrs);
2628

2729
@GetMapping(path = "/search", produces = {MediaType.TEXT_EVENT_STREAM_VALUE,
28-
MediaType.APPLICATION_STREAM_JSON_VALUE})
29-
Flux<Item> getItemsStream(@Valid SearchRequest searchRequest);
30+
MediaType.APPLICATION_NDJSON_VALUE})
31+
Flux<Item> getItemsStream(@Valid SearchRequest searchRequest,
32+
@RequestParam(value = "filter-lang", required = false) String filterLang,
33+
@RequestParam(value = "filter-crs", required = false) String filterCrs);
3034

3135
@PostMapping(value = "/search", consumes = MediaType.APPLICATION_JSON_VALUE)
3236
Mono<ItemCollection> getItemsPost(@Valid @RequestBody SearchRequest searchRequest);
3337

3438
@PostMapping(value = "/search", consumes = MediaType.APPLICATION_JSON_VALUE,
35-
produces = {MediaType.TEXT_EVENT_STREAM_VALUE, MediaType.APPLICATION_STREAM_JSON_VALUE})
39+
produces = {MediaType.TEXT_EVENT_STREAM_VALUE, MediaType.APPLICATION_NDJSON_VALUE})
3640
Flux<Item> getItemsPostStream(@Valid @RequestBody SearchRequest searchRequest);
3741

3842
@PostMapping(value = "/search", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE,
39-
MediaType.MULTIPART_FORM_DATA_VALUE}, produces = MediaType.APPLICATION_STREAM_JSON_VALUE)
43+
MediaType.MULTIPART_FORM_DATA_VALUE}, produces = MediaType.APPLICATION_NDJSON_VALUE)
4044
Mono<ItemCollection> getItemsFormPost(@Valid @ModelAttribute SearchRequest searchRequest);
4145

4246
}

staccato-application/src/main/java/com/planet/staccato/api/ApiController.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,24 @@ public Mono<Item> getItem(@PathVariable("id") String id) {
4646
}
4747

4848
@Override
49-
public Mono<ItemCollection> getItems(SearchRequest searchRequest) {
50-
searchRequest.setMethod(HttpMethod.GET.toString());
49+
public Mono<ItemCollection> getItems(SearchRequest searchRequest,
50+
@RequestParam(value = "filter-lang", required = false) String filterLang,
51+
@RequestParam(value = "filter-crs", required = false) String filterCrs) {
52+
searchRequest
53+
.method(HttpMethod.GET.toString())
54+
.filterLang(filterLang)
55+
.filterCrs(filterCrs);
5156
return service.getItemCollection(searchRequest).name("getItems");
5257
}
5358

5459
@Override
55-
public Flux<Item> getItemsStream(SearchRequest searchRequest) {
56-
searchRequest.setMethod(HttpMethod.GET.toString());
60+
public Flux<Item> getItemsStream(SearchRequest searchRequest,
61+
@RequestParam(value = "filter-lang", required = false) String filterLang,
62+
@RequestParam(value = "filter-crs", required = false) String filterCrs) {
63+
searchRequest
64+
.method(HttpMethod.GET.toString())
65+
.filterLang(filterLang)
66+
.filterCrs(filterCrs);
5767
return service.getItemsFlux(searchRequest);
5868
}
5969

staccato-application/src/main/java/com/planet/staccato/api/ParameterValidator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import javax.annotation.PostConstruct;
1414
import java.lang.reflect.Field;
1515
import java.util.ArrayList;
16+
import java.util.Arrays;
1617
import java.util.List;
1718

1819
/**
@@ -26,12 +27,15 @@
2627
public class ParameterValidator implements WebFilter {
2728

2829
private List<String> apiParameters = new ArrayList<>();
30+
private static final String[] PARAMETERS_JAVA_HATES = {"filter-lang", "filter-crs"};
2931

3032
@PostConstruct
3133
public void init() {
3234
for (Field field : SearchRequest.class.getDeclaredFields()) {
3335
apiParameters.add(field.getName().toLowerCase());
3436
}
37+
38+
apiParameters.addAll(Arrays.asList(PARAMETERS_JAVA_HATES));
3539
}
3640

3741
@Override

staccato-application/src/main/java/com/planet/staccato/catalog/CatalogRouteInitializer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public void registerCatalogEndpoints(CollectionMetadata collection) {
7979
RouterFunction<ServerResponse> route =
8080
route(GET("/stac/" + collection.getId()), (request) -> {
8181
CollectionMetadata newCollection = getNewInstance(collection);
82+
newCollection.setCatalogType(CatalogType.CATALOG);
8283
List<PropertyField> remainingProperties = subcatalogPropertiesService.getRemainingProperties(newCollection.getId(), request.path());
8384
newCollection.setExtent(aggregationService.getExtent(newCollection.getId(), null));
8485
linkGenerator.generatePropertyFieldLinks(request, newCollection, remainingProperties);
@@ -90,6 +91,7 @@ public void registerCatalogEndpoints(CollectionMetadata collection) {
9091
RouterFunction<ServerResponse> subRoute =
9192
route(GET("/stac/" + collection.getId() + "/**"), (request) -> {
9293
CollectionMetadata newCollection = getNewInstance(collection);
94+
newCollection.setCatalogType(CatalogType.CATALOG);
9395
if (request.path().toLowerCase().endsWith("/items")) {
9496
return ServerResponse.ok().body(requestHandler.handleItemsRequest(newCollection, request), ItemCollection.class);
9597
}

staccato-application/src/main/java/com/planet/staccato/catalog/LinkGenerator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
import org.springframework.stereotype.Service;
1111
import org.springframework.web.reactive.function.server.ServerRequest;
1212

13-
import java.net.*;
13+
import java.net.MalformedURLException;
14+
import java.net.URI;
15+
import java.net.URISyntaxException;
16+
import java.net.URL;
1417
import java.util.List;
1518

1619

staccato-application/src/main/java/com/planet/staccato/catalog/RequestHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public Mono<CollectionMetadata> handleSubcatalogRequest(CollectionMetadata colle
9393
FieldsExtension fields = new FieldsExtension().include(idField);
9494

9595
SearchRequest searchRequest = new SearchRequest()
96-
.query(filterBuilder.toString())
96+
.filter(filterBuilder.toString())
9797
.limit(10000)
9898
.collections(new String[]{collectionId})
9999
.fields(fields);

0 commit comments

Comments
 (0)