Skip to content

Commit

Permalink
Add Graticules extension
Browse files Browse the repository at this point in the history
  • Loading branch information
vuilleumierc committed Apr 29, 2024
1 parent 4dac461 commit afd23cb
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Only a curated list of the [vast amount](http://geoserver.org/release/stable/) o
- cog
- importer
- imagepyramid
- graticules

Advanced ACL system is available through the project [GeoServer ACL](https://github.com/geoserver/geoserver-acl) which offers the same capacities as GeoFence.

Expand Down
6 changes: 6 additions & 0 deletions src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-graticule</artifactId>
<!-- <version>${gs.community.version}</version>-->
<version>2.25.0</version>
</dependency>
<dependency>
<!--- Override old aws version without support for "IAM roles for service accounts" -->
<groupId>software.amazon.awssdk</groupId>
Expand Down
4 changes: 4 additions & 0 deletions src/starters/wms-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<groupId>org.geoserver.extension</groupId>
<artifactId>gs-vectortiles</artifactId>
</dependency>
<dependency>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-graticule</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* (c) 2024 Open Source Geospatial Foundation - all rights reserved This code is licensed under the
* GPL 2.0 license, available at the root application directory.
*/

package org.geoserver.cloud.autoconfigure.wms.extensions;

import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader;
import org.geoserver.platform.ModuleStatus;
import org.geoserver.platform.ModuleStatusImpl;
import org.geotools.data.graticule.GraticuleDataStoreFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
public class GraticuleConfiguration {

@Bean
@ConditionalOnProperty(
prefix = "geoserver.wms.graticule",
name = "enabled",
havingValue = "true",
matchIfMissing = true)
public GraticuleDataStoreFactory graticuleDataStoreFactory() {
return new GraticuleDataStoreFactory();
}

@Configuration
@ConditionalOnProperty(
prefix = "geoserver.wms.graticule",
name = "enabled",
matchIfMissing = true)
@ImportResource( //
reader = FilteringXmlBeanDefinitionReader.class, //
locations = {"jar:gs-graticule-.*!/applicationContext.xml"})
static class Enabled {}

@Configuration
@ConditionalOnProperty(
prefix = "geoserver.wms.graticule",
name = "enabled",
havingValue = "false")
static class Disabled {

@Bean
ModuleStatus graticuleDisabledModuleStatus() {
ModuleStatusImpl mod = new ModuleStatusImpl();
mod.setAvailable(true);
mod.setEnabled(false);
mod.setMessage(
"Graticule module disabled through config property geoserver.wms.graticule.enabled=false");
mod.setComponent("GeoServer Graticule");
mod.setModule("gs-graticule");
mod.setName("Graticule");
return mod;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@Import(
value = {
CssStylingConfiguration.class,
GraticuleConfiguration.class,
MapBoxStylingConfiguration.class,
VectorTilesConfiguration.class
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* css.enabled: true
* mapbox.enabled: true
* wms:
* graticule.enabled: true
* outputFormats:
* vectorTiles:
* mapbox.enabled: true
Expand Down

0 comments on commit afd23cb

Please sign in to comment.