Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate geotools version from 29x to 30x #3162

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ dependencies {
"io.dropwizard.metrics:metrics-logback:4.2.23",
)
geotools(
"org.geotools:gt-epsg-hsql:29.3",
"org.geotools:gt-render:29.3",
"org.geotools:gt-geojson:29.3",
"org.geotools:gt-geotiff:29.3",
"org.geotools:gt-wms:29.3",
"org.geotools.xsd:gt-xsd-gml3:29.3",
"org.geotools:gt-svg:29.3",
"org.geotools:gt-cql:29.3"
"org.geotools:gt-epsg-hsql:30.1",
"org.geotools:gt-render:30.1",
"org.geotools:gt-geojson:30.1",
"org.geotools:gt-geotiff:30.1",
"org.geotools:gt-wms:30.1",
"org.geotools.xsd:gt-xsd-gml3:30.1",
"org.geotools:gt-svg:30.1",
"org.geotools:gt-cql:30.1"
)
jasper(
"net.sf.jasperreports:jasperreports:6.20.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.io.IOException;
import java.io.InputStream;
import javax.annotation.Nonnull;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.feature.DefaultFeatureCollection;
import org.geotools.feature.simple.SimpleFeatureBuilder;
Expand All @@ -13,8 +15,6 @@
import org.locationtech.jts.util.Assert;
import org.mapfish.print.Constants;
import org.mapfish.print.parser.HasDefaultValue;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
* Represents an area on the map which is of particular interest for some reason. It consists of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.mapfish.print.attribute.map;

import java.awt.Rectangle;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.GeodeticCalculator;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.mapfish.print.FloatingPointUtil;
import org.mapfish.print.map.DistanceUnit;
import org.mapfish.print.map.Scale;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
* Represent the map bounds with a bounding box.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import static org.mapfish.print.Constants.PDF_DPI;

import java.awt.Rectangle;
import org.geotools.geometry.DirectPosition2D;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.api.referencing.operation.TransformException;
import org.geotools.geometry.Position2D;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.GeodeticCalculator;
import org.locationtech.jts.geom.Coordinate;
import org.mapfish.print.ExceptionUtils;
import org.mapfish.print.FloatingPointUtil;
import org.mapfish.print.map.DistanceUnit;
import org.mapfish.print.map.Scale;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.TransformException;

/**
* Represent Map Bounds with a center location and a scale of the map.
Expand Down Expand Up @@ -148,7 +148,7 @@ private ReferencedEnvelope computeGeodeticBBox(
double geoWidth = DistanceUnit.IN.convertTo(geoWidthInInches, ellipsoidUnit);
double geoHeight = DistanceUnit.IN.convertTo(geoHeightInInches, ellipsoidUnit);

DirectPosition2D directPosition2D = new DirectPosition2D(this.center.x, this.center.y);
Position2D directPosition2D = new Position2D(this.center.x, this.center.y);
directPosition2D.setCoordinateReferenceSystem(crs);
calc.setStartingPosition(directPosition2D);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.NoSuchAuthorityCodeException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.referencing.CRS;
import org.json.JSONException;
import org.json.JSONObject;
Expand All @@ -19,9 +22,6 @@
import org.mapfish.print.parser.MapfishParser;
import org.mapfish.print.wrapper.PArray;
import org.mapfish.print.wrapper.PObject;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nonnull;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.json.JSONArray;
import org.locationtech.jts.geom.Envelope;
import org.mapfish.print.attribute.map.OverviewMapAttribute.OverviewMapAttributeValues;
Expand All @@ -16,8 +18,6 @@
import org.mapfish.print.processor.map.CreateMapProcessor;
import org.mapfish.print.wrapper.PArray;
import org.mapfish.print.wrapper.json.PJsonArray;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
* The attributes for {@link CreateMapProcessor} (see <a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import static org.mapfish.print.Constants.PDF_DPI;

import java.awt.Rectangle;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.locationtech.jts.geom.Coordinate;
import org.mapfish.print.map.DistanceUnit;
import org.mapfish.print.map.Scale;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.mapfish.print.attribute.map;

import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.json.JSONArray;
import org.mapfish.print.config.Template;
import org.mapfish.print.parser.HasDefaultValue;
import org.mapfish.print.parser.Requires;
import org.mapfish.print.wrapper.PArray;
import org.mapfish.print.wrapper.json.PJsonArray;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
* The attributes for an overview map (see <a
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/org/mapfish/print/config/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.PostConstruct;
import org.geotools.styling.Fill;
import org.geotools.styling.Graphic;
import org.geotools.styling.Mark;
import org.geotools.styling.Stroke;
import org.geotools.styling.Style;
import org.geotools.api.style.Fill;
import org.geotools.api.style.Graphic;
import org.geotools.api.style.Mark;
import org.geotools.api.style.Stroke;
import org.geotools.api.style.Style;
import org.geotools.api.style.Symbolizer;
import org.geotools.styling.StyleBuilder;
import org.geotools.styling.Symbolizer;
import org.json.JSONException;
import org.json.JSONWriter;
import org.locationtech.jts.geom.Geometry;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/mapfish/print/config/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;
import org.geotools.styling.Style;
import org.geotools.api.style.Style;
import org.json.JSONException;
import org.json.JSONWriter;
import org.mapfish.print.attribute.Attribute;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/mapfish/print/map/DistanceUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;
import java.util.Map;
import javax.measure.Unit;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;

/** An enum for expressing distance units. Contains everything needed for conversions and others. */
public enum DistanceUnit {
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/org/mapfish/print/map/Scale.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import static org.mapfish.print.Constants.PDF_DPI;

import javax.annotation.Nonnull;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.api.referencing.operation.MathTransform;
import org.geotools.api.referencing.operation.TransformException;
import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.CRS;
import org.geotools.referencing.GeodeticCalculator;
import org.locationtech.jts.geom.Coordinate;
import org.mapfish.print.attribute.map.GenericMapAttribute;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.annotation.Nonnull;
import org.geotools.api.data.FeatureSource;
import org.geotools.api.style.Style;
import org.geotools.data.DataUtilities;
import org.geotools.data.FeatureSource;
import org.geotools.data.collection.CollectionFeatureSource;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.map.FeatureLayer;
import org.geotools.map.Layer;
import org.geotools.styling.Style;
import org.geotools.styling.visitor.RescaleStyleVisitor;
import org.mapfish.print.attribute.map.MapfishMapContext;
import org.mapfish.print.http.MfClientHttpRequestFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.util.Set;
import java.util.concurrent.ExecutorService;
import org.geotools.data.FeatureSource;
import org.geotools.styling.Style;
import org.geotools.api.data.FeatureSource;
import org.geotools.api.style.Style;
import org.locationtech.jts.geom.Geometry;
import org.mapfish.print.OptionalUtils;
import org.mapfish.print.SetsUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import org.geotools.data.DataStore;
import org.geotools.api.data.DataStore;
import org.geotools.api.style.Style;
import org.geotools.api.style.StyleVisitor;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.map.Layer;
import org.geotools.map.MapContent;
import org.geotools.renderer.lite.StreamingRenderer;
import org.geotools.styling.Style;
import org.geotools.styling.StyleVisitor;
import org.locationtech.jts.util.Assert;
import org.mapfish.print.ExceptionUtils;
import org.mapfish.print.FloatingPointUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import java.util.concurrent.ExecutorService;
import java.util.function.Function;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geotools.api.style.Style;
import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
import org.geotools.map.GridReaderLayer;
import org.geotools.map.Layer;
import org.geotools.styling.Style;
import org.mapfish.print.attribute.map.MapfishMapContext;
import org.mapfish.print.http.MfClientHttpRequestFactory;
import org.mapfish.print.map.AbstractLayerParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.mapfish.print.Constants.Style.Raster.NAME;

import org.geotools.styling.Style;
import org.geotools.api.style.Style;
import org.mapfish.print.OptionalUtils;
import org.mapfish.print.config.Template;
import org.mapfish.print.http.MfClientHttpRequestFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.concurrent.ExecutorService;
import javax.annotation.Nonnull;
import org.geotools.data.FeatureSource;
import org.geotools.api.data.FeatureSource;
import org.geotools.api.style.Style;
import org.geotools.data.collection.CollectionFeatureSource;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.styling.Style;
import org.mapfish.print.OptionalUtils;
import org.mapfish.print.attribute.map.MapfishMapContext;
import org.mapfish.print.config.Template;
Expand Down Expand Up @@ -137,7 +137,7 @@ public static class FeatureLayerParam extends AbstractLayerParams {

/**
* If no style is defined, a default style with this name will be used. Otherwise a style will
* be selected depending on the the geometry type.
* be selected depending on the geometry type.
*/
public String defaultStyle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.mapfish.print.map.geotools;

import javax.annotation.Nonnull;
import org.geotools.data.FeatureSource;
import org.geotools.api.data.FeatureSource;
import org.mapfish.print.attribute.map.MapfishMapContext;
import org.mapfish.print.http.MfClientHttpRequestFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import java.util.Set;
import javax.annotation.Nonnull;
import org.apache.commons.io.IOUtils;
import org.geotools.api.feature.simple.SimpleFeatureType;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.NoSuchAuthorityCodeException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
import org.geotools.geojson.feature.FeatureJSON;
Expand All @@ -27,10 +31,6 @@
import org.mapfish.print.URIUtils;
import org.mapfish.print.config.Template;
import org.mapfish.print.http.MfClientHttpRequestFactory;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import javax.annotation.Nonnull;
import org.geotools.data.FeatureSource;
import org.geotools.api.data.FeatureSource;
import org.geotools.data.collection.CollectionFeatureSource;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.mapfish.print.ExceptionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.emf.ecore.resource.URIHandler;
import org.geotools.data.FeatureSource;
import org.geotools.api.data.FeatureSource;
import org.geotools.data.collection.CollectionFeatureSource;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.gml2.GMLConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
package org.mapfish.print.map.geotools;

import org.geotools.api.filter.FilterFactory;
import org.geotools.api.filter.expression.Expression;
import org.geotools.api.filter.expression.Function;
import org.geotools.api.style.Fill;
import org.geotools.api.style.Graphic;
import org.geotools.api.style.RasterSymbolizer;
import org.geotools.api.style.Stroke;
import org.geotools.factory.CommonFactoryFinder;
import org.geotools.styling.AbstractStyleVisitor;
import org.geotools.styling.Fill;
import org.geotools.styling.Graphic;
import org.geotools.styling.RasterSymbolizer;
import org.geotools.styling.Stroke;
import org.mapfish.print.map.geotools.function.MultiplicationFunction;
import org.opengis.filter.FilterFactory2;
import org.opengis.filter.expression.Expression;
import org.opengis.filter.expression.Function;

/**
* Visits all elements in the style an multiplies the opacity of each element (where opacity
* applies) by the opacity factory passed in.
*/
public final class OpacitySettingStyleVisitor extends AbstractStyleVisitor {
private final Expression opacityFactor;
private final FilterFactory2 filterFactory;
private final FilterFactory filterFactory;

/**
* Constructor.
*
* @param opacityFactor a value between 0 and 1 to multiply against any existing opacity.
*/
public OpacitySettingStyleVisitor(final double opacityFactor) {
this.filterFactory = CommonFactoryFinder.getFilterFactory2();
this.filterFactory = CommonFactoryFinder.getFilterFactory();
this.opacityFactor = this.filterFactory.literal(opacityFactor);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.mapfish.print.map.geotools;

import org.geotools.styling.Style;
import org.geotools.api.style.Style;
import org.mapfish.print.http.MfClientHttpRequestFactory;

/**
Expand Down
Loading
Loading