diff --git a/worldwind-gs-layergroup-getmapcallback/README.md b/worldwind-gs-layergroup-getmapcallback/README.md new file mode 100644 index 00000000..3bbac8bf --- /dev/null +++ b/worldwind-gs-layergroup-getmapcallback/README.md @@ -0,0 +1,9 @@ + + +# WorldWind Server Kit (WWSK) +## WorldWind LayerGroup GetMapCallback (worldwind-gs-layergroup-getmapcallback) + +This module implements a GetMapCallback that culls layers from GetMap requests +that are outside the request's bbox. + +* It resolves an "null bbox" IllegalArgumentException issue diff --git a/worldwind-gs-layergroup-getmapcallback/pom.xml b/worldwind-gs-layergroup-getmapcallback/pom.xml new file mode 100644 index 00000000..15e900c9 --- /dev/null +++ b/worldwind-gs-layergroup-getmapcallback/pom.xml @@ -0,0 +1,216 @@ + + + 4.0.0 + + gov.nasa.worldwind.server + worldwind-serverkit + 0.6.0-SNAPSHOT + + worldwind-gs-layergroup-getmapcallback + jar + + + + + WorldWind LayerGroupGetMapCallback + A GetMapCallback that improves performance and rendering of LayerGroups + https://github.com/NASAWorldWind/WorldWindServerKit + + NASA World Wind + https://worldwind.arc.nasa.gov + + + + General Public License (GPL) + http://www.gnu.org/copyleft/gpl.txt + + + + + + + + + + + + https://github.com/NASAWorldWind/WorldWindServerKit + scm:git:git://github.com/NASAWorldWind/WorldWindServerKit.git + scm:git:https://github.com/NASAWorldWind/WorldWindServerKit.git + HEAD + + + GitHub Issues + https://github.com/NASAWorldWind/WorldWindServerKit/issues + + + Travis CI + https://travis-ci.org/NASAWorldWind/WorldWindServerKit + + + + + + + + + + org.geotools + gt-api + + + org.geotools + gt-main + + + org.springframework + spring-beans + + + org.springframework + spring-core + + + org.springframework + spring-context + + + org.springframework + spring-webmvc + + + + + org.geoserver + gs-wms + + + + + + org.geoserver + gs-platform + tests + test + + + org.geoserver + gs-main + tests + test + + + org.geoserver + gs-wms + tests + test + + + org.geoserver + gs-wfs + tests + test + + + org.geoserver.extension + gs-wps-core + test + tests + + + org.geoserver.web + gs-web-core + tests + test + + + org.geoserver.web + gs-web-demo + test + + + org.geotools + gt-sample-data + test + + + org.springframework + spring-test + test + + + org.easymock + easymockclassextension + test + + + javax.servlet + javax.servlet-api + 3.0.1 + test + + + + + + + + + + + ${basedir}/src/main/java + + + applicationContext.xml + + + + + + src/test/resources + + + + + + + + release + + + release + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + + + + diff --git a/worldwind-gs-layergroup-getmapcallback/src/main/java/applicationContext.xml b/worldwind-gs-layergroup-getmapcallback/src/main/java/applicationContext.xml new file mode 100644 index 00000000..27e1c008 --- /dev/null +++ b/worldwind-gs-layergroup-getmapcallback/src/main/java/applicationContext.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/worldwind-gs-layergroup-getmapcallback/src/main/java/gov/nasa/worldwind/gs/wms/SimplifyingGetMapCallback.java b/worldwind-gs-layergroup-getmapcallback/src/main/java/gov/nasa/worldwind/gs/wms/SimplifyingGetMapCallback.java new file mode 100644 index 00000000..1f066d6f --- /dev/null +++ b/worldwind-gs-layergroup-getmapcallback/src/main/java/gov/nasa/worldwind/gs/wms/SimplifyingGetMapCallback.java @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2017 NASA WorldWind + */ + +package gov.nasa.worldwind.gs.wms; + +import com.vividsolutions.jts.geom.Envelope; +import it.geosolutions.jaiext.interpolators.InterpolationBicubic; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.media.jai.Interpolation; +import org.geoserver.ows.Dispatcher; +import org.geoserver.ows.KvpRequestReader; +import org.geoserver.wms.*; +import org.geotools.geometry.jts.ReferencedEnvelope; +import org.geotools.map.Layer; +import org.geotools.referencing.CRS; +import org.geotools.renderer.lite.RendererUtilities; +import org.geotools.styling.FeatureTypeStyle; +import org.geotools.styling.Rule; +import org.geotools.styling.Style; +import org.geotools.util.logging.Logging; +import org.opengis.referencing.FactoryException; +import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.opengis.referencing.operation.TransformException; + +/** + * This GetMapCallback is responsible for simplifying a complex a map request. + */ +public class SimplifyingGetMapCallback implements GetMapCallback { + + static final Logger logger = Logging.getLogger("org.geoserver.wms"); + + public SimplifyingGetMapCallback() { + } + + /** + * Marks the beginning of a GetMap request internal processing + * + * @param request Request to be examined and modified + * @return Modified request + */ + @Override + public GetMapRequest initRequest(GetMapRequest request) { + logger.log(Level.INFO, " ** GetMapCallback.initRequest: {0}", request.toString()); + + // + // Culling logic + // + List layers = request.getLayers(); + List