Refactor data formats extensions into an input-formats parent

Move vector-formats and raster-formats to input-formats parent directory
Rename starter-data-formats to starter-input-formats for consistency
Update references in dependent modules
This commit is contained in:
Gabriel Roldan 2025-04-14 10:32:58 -03:00
parent a622497247
commit 20e1d914b0
No known key found for this signature in database
GPG Key ID: 697E8F9DF72128E1
39 changed files with 172 additions and 69 deletions

View File

@ -208,4 +208,4 @@ The filtering system uses different approaches for vector and raster formats:
- **Raster formats**: Uses a custom FilteringFactoryCreator wrapper around the standard GridFormatFinder registry to filter formats on-the-fly
For more details, refer to the README files in the respective starter modules:
- Data formats: `src/starters/data-formats/README.md`
- Input formats: `src/starters/input-formats/README.md`

View File

@ -41,7 +41,7 @@ src/extensions/
```
Where:
- `<category>` is the functional category (e.g., `security`, `vector-formats`, `output-formats`, etc.)
- `<category>` is the functional category (e.g., `security`, `input-formats`, `output-formats`, etc.)
- `<extension-name>` is the specific extension name
### 2. Configure the Module POM

View File

@ -92,8 +92,8 @@ Each microservice is its own self-contained application, including only the GeoS
| | |_ pgconfig/ ...................... PostgreSQL catalog back-end
| |
| |_ cache/ ............................... Spring Boot JCache support and auto-configurations for the Catalog
| |_ event-bus/ ........................... Integration layer for events with Spring Cloud Bus
| |_ events/ .............................. No-framework object model and runtime for catalog and config application events
| |_ event-bus/ ........................... Integration layer for events with Spring Cloud Bus
| |_ jackson-bindings/ .................... Libraries to encode and decode configuration objects as JSON
| | |_ geoserver/ ..................... Jackson bindings for GeoServer Catalog and Config object model
| | |_ geotools/ ...................... Jackson bindings for JTS Geometries and org.opengis.filter.Filter
@ -106,7 +106,10 @@ Each microservice is its own self-contained application, including only the GeoS
| |_ core/ ................................ Core extension module
| |_ css-styling/ ......................... CSS Styling extension
| |_ mapbox-styling/ ...................... MapBox Styling extension
| |_ raster-formats/ ...................... Raster formats extensions
| |_ input-formats/ ....................... Input format extensions
| | |_ raster-formats/ ................ Raster formats extensions
| | |_ vector-formats/ ................ Vector formats extensions
| |
| |_ security/ ............................ Security extensions
| | |_ auth-key/ ...................... Auth Key security extension
| | |_ gateway-shared-auth/ ........... Gateway Shared Auth security extension
@ -116,9 +119,8 @@ Each microservice is its own self-contained application, including only the GeoS
| | |_ ldap/ .......................... LDAP security extension
| |
| |_ output-formats/ ....................... Output format extensions
| | |_ vector-tiles/ ................... Vector Tiles extension
| |
| |_ vector-formats/ ....................... Vector formats extensions
| |_ vector-tiles/ ................... Vector Tiles extension
| |_ dxf/ ........................... DXF Vector format extension
|
|_ gwc ....................................... GeoWebCache modules
| |_ autoconfigure/ ....................... Auto configurations for all GWC functionalities
@ -137,7 +139,7 @@ Each microservice is its own self-contained application, including only the GeoS
|
|_ starters .................................. Spring Boot starters for GeoServer microservices
| |_ catalog-backend/ ..................... Groups all supported catalog back-ends
| |_ data-formats/ ........................ Unified starter for all vector and raster data formats
| |_ input-formats/ ....................... Unified starter for all vector and raster input data formats
| |_ event-bus/ ........................... Binds Spring Cloud Bus integration layer with a concrete event-bridge
| |_ extensions/ .......................... Common extension functionality
| |_ output-formats/ ....................... Output format extensions starter

View File

@ -157,7 +157,7 @@
</dependency>
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
</dependency>
<dependency>
<groupId>org.geoserver.cloud</groupId>

View File

@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
</dependency>
<dependency>
<groupId>org.geoserver.cloud.apps</groupId>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>org.geoserver.cloud.extensions</groupId>
<artifactId>gs-cloud-extensions</artifactId>
<version>${revision}</version>
</parent>
<artifactId>gs-cloud-extensions-input-formats</artifactId>
<packaging>pom</packaging>
<description>GeoServer input data format extensions</description>
<modules>
<module>raster-formats</module>
<module>vector-formats</module>
</modules>
</project>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geoserver.cloud.extensions</groupId>
<artifactId>gs-cloud-extensions</artifactId>
<artifactId>gs-cloud-extensions-input-formats</artifactId>
<version>${revision}</version>
</parent>
<artifactId>gs-cloud-extension-raster-formats</artifactId>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geoserver.cloud.extensions</groupId>
<artifactId>gs-cloud-extensions</artifactId>
<artifactId>gs-cloud-extensions-input-formats</artifactId>
<version>${revision}</version>
</parent>
<artifactId>gs-cloud-extension-vector-formats</artifactId>

View File

@ -14,8 +14,7 @@
<module>core</module>
<module>app-schema</module>
<module>security</module>
<module>vector-formats</module>
<module>raster-formats</module>
<module>input-formats</module>
<module>css-styling</module>
<module>mapbox-styling</module>
<module>output-formats</module>

View File

@ -732,7 +732,7 @@
<!-- GeoServer Cloud Starters -->
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
<version>${revision}</version>
</dependency>
<dependency>

View File

@ -1,48 +0,0 @@
# GeoServer Cloud Data Formats Starter
This module provides a unified starter for all supported GeoServer data formats, both vector and raster.
## Overview
The `gs-cloud-starter-data-formats` starter combines both vector and raster data format extensions into a single dependency, making it easier for applications to include all supported data formats without having to manually include separate dependencies.
## Usage
To use this starter in your GeoServer Cloud application, add the following dependency:
```xml
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
</dependency>
```
## Included Formats
This starter includes all formats from:
### Vector Formats
- Shapefile
- PostGIS
- GeoPackage
- Web Feature Server (WFS)
- Oracle
- SQL Server
- And more...
### Raster Formats
- GeoTIFF
- ArcGrid
- ImageMosaic
- ImagePyramid
- WorldImage
- GeoPackage (mosaic)
- And more...
## Configuration
Format availability can be controlled through the `geotools.data.filtering` configuration settings in `geoserver.yml`. See the documentation for specific formats for more details.
## Extension Point
This starter is designed to be a convenient way to include all standard data formats. For applications that need to be more selective about which formats to include, the individual starters `gs-cloud-starter-vector-formats` and `gs-cloud-starter-raster-formats` remain available.

View File

@ -0,0 +1,134 @@
# Input Data Formats Starter
This module provides a unified starter for all vector and raster input data format extensions in GeoServer Cloud.
## Overview
The `gs-cloud-starter-input-formats` module is a Spring Boot starter that:
- Includes dependencies for all supported vector and raster input data formats
- Integrates with GeoServer's data access architecture
- Provides a single dependency for applications to include all input format support
- Enables selective filtering of available data formats based on configuration
## Included Extensions
This starter includes the following extensions:
### Vector Data Formats
- Shapefile
- PostGIS
- GeoPackage
- Oracle (when enabled)
- SQL Server
- WFS
- FlatGeobuf
- Graticule
- Pre-generalized Features
### Raster Data Formats
- GeoTIFF
- Cloud Optimized GeoTIFF (COG)
- ImageMosaic
- ArcGrid
- WorldImage
- ImagePyramid
## Usage
Add the starter to your GeoServer Cloud application:
```xml
<dependency>
<groupId>org.geoserver.cloud.starters</groupId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
</dependency>
```
## Configuration
### Data Format Filtering
GeoServer Cloud provides the ability to filter which input formats are available in the application. This allows you to customize each deployment to only include the formats you need, improving security, reducing the attack surface, and potentially improving startup time.
#### Enable/Disable Filtering
The filtering system is controlled by a master switch:
```yaml
geotools:
data:
filtering:
# Master switch for the entire filtering system
enabled: true # Set to false to disable filtering
```
#### Vector Format Configuration
Configure which vector formats (DataAccessFactory implementations) are available:
```yaml
geotools:
data:
filtering:
vector-formats:
"[PostGIS]": true
"[Shapefile]": true
"[GeoPackage]": true
"[Oracle NG]": ${oracle.enabled:false}
"[Web Feature Server (NG)]": true
"[Microsoft SQL Server]": false
"[FlatGeobuf]": true
"[Graticule]": true
# Add more vector format entries as needed
```
#### Raster Format Configuration
Configure which raster formats (GridFormatFactorySpi implementations) are available:
```yaml
geotools:
data:
filtering:
raster-formats:
"[GeoTIFF]": true
"[ImageMosaic]": ${mosaic.enabled:true}
"[ArcGrid]": false
"[WorldImage]": true
"[ImagePyramid]": false
# Add more raster format entries as needed
```
### Format Names
The format names used in the configuration are the user-friendly display names returned by the respective factories:
- For vector formats: The name returned by `DataAccessFactory.getDisplayName()`
- For raster formats: The name returned by `AbstractGridFormat.getName()`
Since these names often contain special characters, they should be properly escaped in the YAML configuration using quotes and brackets.
### Placeholder Resolution
Both vector and raster format configurations support Spring property placeholder resolution, allowing you to create dynamic configurations using environment variables or system properties. For example:
```yaml
vector-formats:
"[Oracle NG]": ${oracle.enabled:false}
"[PostGIS]": ${postgis.enabled:true}
```
## Implementation Details
The filtering system uses different approaches for vector and raster formats:
- **Vector formats**: Directly deregisters disabled DataAccessFactory implementations using `DataAccessFinder.deregisterFactory()` and `DataStoreFinder.deregisterFactory()`
- **Raster formats**: Uses a custom FilteringFactoryCreator wrapper around the standard GridFormatFinder registry to filter formats on-the-fly
## Extension Documentation
For more detailed information about specific input format extensions:
- Vector Formats: See the [Vector Formats README](/src/extensions/input-formats/vector-formats/README.md)
- Raster Formats: See the [Raster Formats README](/src/extensions/input-formats/raster-formats/README.md)

View File

@ -6,9 +6,9 @@
<artifactId>gs-cloud-starters</artifactId>
<version>${revision}</version>
</parent>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
<packaging>jar</packaging>
<description>Unified starter for all supported vector and raster data formats</description>
<description>Unified starter for all supported vector and raster input data formats</description>
<dependencies>
<!-- Vector data formats -->
<dependency>
@ -22,4 +22,4 @@
<artifactId>gs-cloud-extension-raster-formats</artifactId>
</dependency>
</dependencies>
</project>
</project>

View File

@ -13,7 +13,7 @@
<module>spring-boot</module>
<module>spring-boot3</module>
<module>catalog-backend</module>
<module>data-formats</module>
<module>input-formats</module>
<module>spring-cloud</module>
<module>output-formats</module>
<module>extensions</module>

View File

@ -21,7 +21,7 @@
</dependency>
<dependency>
<groupId>org.geoserver.cloud</groupId>
<artifactId>gs-cloud-starter-data-formats</artifactId>
<artifactId>gs-cloud-starter-input-formats</artifactId>
</dependency>
<!-- Web MVC focused dependencies -->
<dependency>