From 58535bdba035953c94f8013cc19e2294c7ade6ad Mon Sep 17 00:00:00 2001 From: Jared Erickson Date: Wed, 25 Oct 2023 16:43:10 -0700 Subject: [PATCH] Start working on 1.22.0 with GeoTools 30 --- pom.xml | 6 ++-- src/main/groovy/geoscript/GeoScript.groovy | 32 +++++++++---------- .../groovy/geoscript/carto/LegendItem.groovy | 14 ++++---- .../groovy/geoscript/feature/Feature.groovy | 2 +- .../groovy/geoscript/feature/Schema.groovy | 6 ++-- .../geoscript/feature/io/GmlReader.groovy | 2 +- .../feature/io/StringSchemaReader.groovy | 2 +- .../groovy/geoscript/filter/Expression.groovy | 22 ++++++------- .../geoscript/filter/Expressions.groovy | 4 +-- .../groovy/geoscript/filter/Filter.groovy | 14 ++++---- .../groovy/geoscript/filter/Function.groovy | 12 +++---- .../geoscript/filter/ProcessFunction.groovy | 2 +- .../groovy/geoscript/filter/Property.groovy | 2 +- src/main/groovy/geoscript/layer/Band.groovy | 4 +-- src/main/groovy/geoscript/layer/Cursor.groovy | 8 ++--- src/main/groovy/geoscript/layer/Format.groovy | 6 ++-- .../groovy/geoscript/layer/Graticule.groovy | 4 +-- src/main/groovy/geoscript/layer/Layer.groovy | 24 +++++++------- src/main/groovy/geoscript/layer/Raster.groovy | 14 ++++---- src/main/groovy/geoscript/layer/Writer.groovy | 4 +-- .../geoscript/layer/io/GeoJSONReader.groovy | 2 +- .../geoscript/layer/io/KmlReader.groovy | 2 +- src/main/groovy/geoscript/layer/io/Pbf.groovy | 2 +- .../groovy/geoscript/process/Process.groovy | 25 ++++++++------- .../groovy/geoscript/proj/Projection.groovy | 4 +-- .../geoscript/style/ChannelSelection.groovy | 8 ++--- .../groovy/geoscript/style/ColorMap.groovy | 14 ++++---- .../style/ContrastEnhancement.groovy | 10 +++--- src/main/groovy/geoscript/style/Fill.groovy | 8 ++--- src/main/groovy/geoscript/style/Font.groovy | 6 ++-- .../groovy/geoscript/style/Gradient.groovy | 12 +++---- src/main/groovy/geoscript/style/Halo.groovy | 6 ++-- src/main/groovy/geoscript/style/Hatch.groovy | 10 +++--- src/main/groovy/geoscript/style/Icon.groovy | 8 ++--- .../geoscript/style/ImageOutline.groovy | 6 ++-- src/main/groovy/geoscript/style/Label.groovy | 6 ++-- .../geoscript/style/RasterSymbolizer.groovy | 6 ++-- .../geoscript/style/ShadedRelief.groovy | 6 ++-- src/main/groovy/geoscript/style/Shape.groovy | 16 +++++----- src/main/groovy/geoscript/style/Stroke.groovy | 10 +++--- src/main/groovy/geoscript/style/Style.groovy | 2 +- .../groovy/geoscript/style/Symbolizer.groovy | 20 ++++++------ .../groovy/geoscript/style/Transform.groovy | 8 ++--- .../geoscript/style/io/CSSReader.groovy | 2 +- .../geoscript/style/io/SLDReader.groovy | 4 +-- .../geoscript/style/io/SLDWriter.groovy | 8 ++--- .../geoscript/style/io/YSLDReader.groovy | 6 ++-- .../geoscript/style/io/YSLDWriter.groovy | 8 ++--- .../geoscript/workspace/Database.groovy | 2 +- .../geoscript/workspace/Directory.groovy | 2 +- .../geoscript/workspace/FlatGeobuf.groovy | 4 +-- .../geoscript/workspace/GeoPackage.groovy | 2 +- .../groovy/geoscript/workspace/Geobuf.groovy | 3 +- src/main/groovy/geoscript/workspace/H2.groovy | 2 +- .../groovy/geoscript/workspace/Memory.groovy | 2 +- .../groovy/geoscript/workspace/MySQL.groovy | 2 +- .../groovy/geoscript/workspace/OGR.groovy | 2 +- .../groovy/geoscript/workspace/PostGIS.groovy | 2 +- .../geoscript/workspace/Property.groovy | 2 +- .../geoscript/workspace/SpatiaLite.groovy | 2 +- .../groovy/geoscript/workspace/Sqlite.groovy | 12 +++---- .../groovy/geoscript/workspace/WFS.groovy | 2 +- .../geoscript/workspace/Workspace.groovy | 4 +-- .../workspace/WorkspaceFactory.groovy | 4 +-- ...eotools.api.coverage.processing.Operation} | 0 ...org.geotools.api.data.DataStoreFactorySpi} | 0 .../groovy/geoscript/GeoScriptTest.groovy | 12 +++---- .../groovy/geoscript/filter/ColorTest.groovy | 12 +++---- .../geoscript/filter/ExpressionTest.groovy | 10 +++--- .../groovy/geoscript/filter/FilterTest.groovy | 4 +-- .../geoscript/filter/PropertyTest.groovy | 4 +-- .../geoscript/process/ProcessTest.groovy | 6 ++-- .../geoscript/style/ColorMapTest.groovy | 4 +-- .../geoscript/style/ImageOutlineTest.groovy | 2 +- .../groovy/geoscript/style/LabelTest.groovy | 16 +++++----- .../geoscript/style/SymbolizerTest.groovy | 20 ++++++------ .../geoscript/style/TransformTest.groovy | 8 ++--- 77 files changed, 277 insertions(+), 279 deletions(-) rename src/main/resources/META-INF/services/{org.opengis.coverage.processing.Operation => org.geotools.api.coverage.processing.Operation} (100%) rename src/main/resources/META-INF/services/{org.geotools.data.DataStoreFactorySpi => org.geotools.api.data.DataStoreFactorySpi} (100%) diff --git a/pom.xml b/pom.xml index 39aa3eec4..b1875f8a2 100755 --- a/pom.xml +++ b/pom.xml @@ -8,11 +8,11 @@ org.geoscript geoscript-groovy jar - 1.21.0 + 1.22.0-SNAPSHOT - 29.2 + 30.0 1.19.0 - 4.0.13 + 4.0.15 diff --git a/src/main/groovy/geoscript/GeoScript.groovy b/src/main/groovy/geoscript/GeoScript.groovy index 742e78e11..eed56bef8 100644 --- a/src/main/groovy/geoscript/GeoScript.groovy +++ b/src/main/groovy/geoscript/GeoScript.groovy @@ -168,12 +168,12 @@ class GeoScript { */ static Object wrap(Object obj) { // SimpleFeature -> Feature - if (obj instanceof org.opengis.feature.simple.SimpleFeature) { - return new Feature(obj as org.opengis.feature.simple.SimpleFeature) + if (obj instanceof org.geotools.api.feature.simple.SimpleFeature) { + return new Feature(obj as org.geotools.api.feature.simple.SimpleFeature) } // SimpleFeatureType -> Schema - else if (obj instanceof org.opengis.feature.simple.SimpleFeatureType) { - return new Schema(obj as org.opengis.feature.simple.SimpleFeatureType) + else if (obj instanceof org.geotools.api.feature.simple.SimpleFeatureType) { + return new Schema(obj as org.geotools.api.feature.simple.SimpleFeatureType) } // JTS Geometry -> Geometry else if (obj instanceof org.locationtech.jts.geom.Geometry) { @@ -184,40 +184,40 @@ class GeoScript { return new Bounds(obj as org.geotools.geometry.jts.ReferencedEnvelope) } // GeoTools Expression -> Expression - else if (obj instanceof org.opengis.filter.expression.Expression) { - return new Expression(obj as org.opengis.filter.expression.Expression) + else if (obj instanceof org.geotools.api.filter.expression.Expression) { + return new Expression(obj as org.geotools.api.filter.expression.Expression) } // GeoTools Filter -> Filter - else if (obj instanceof org.opengis.filter.Filter) { - return new Filter(obj as org.opengis.filter.Filter) + else if (obj instanceof org.geotools.api.filter.Filter) { + return new Filter(obj as org.geotools.api.filter.Filter) } // FeatureCollection -> Cursor else if (obj instanceof org.geotools.feature.FeatureCollection) { return new Cursor(obj as org.geotools.feature.FeatureCollection) } // FeatureSource -> Layer - else if (obj instanceof org.geotools.data.FeatureSource) { - return new Layer(obj as org.geotools.data.FeatureSource) + else if (obj instanceof org.geotools.api.data.FeatureSource) { + return new Layer(obj as org.geotools.api.data.FeatureSource) } /*// GeoTools Process -> Process else if (obj instanceof org.geotools.process.Process) { return new Process((obj as org.geotools.process.Process) }*/ // CoordinateReferenceSystem -> Projection - else if (obj instanceof org.opengis.referencing.crs.CoordinateReferenceSystem) { - return new Projection(obj as org.opengis.referencing.crs.CoordinateReferenceSystem) + else if (obj instanceof org.geotools.api.referencing.crs.CoordinateReferenceSystem) { + return new Projection(obj as org.geotools.api.referencing.crs.CoordinateReferenceSystem) } // DefaultEllipsoid -> Geodetic else if (obj instanceof org.geotools.referencing.datum.DefaultEllipsoid) { return new Geodetic(obj as org.geotools.referencing.datum.DefaultEllipsoid) } // DataStore -> Workspace - else if (obj instanceof org.geotools.data.DataStore) { - return new Workspace(obj as org.geotools.data.DataStore) + else if (obj instanceof org.geotools.api.data.DataStore) { + return new Workspace(obj as org.geotools.api.data.DataStore) } // GridCoverage -> Raster - else if (obj instanceof org.opengis.coverage.grid.GridCoverage) { - def grid = obj as org.opengis.coverage.grid.GridCoverage + else if (obj instanceof org.geotools.api.coverage.grid.GridCoverage) { + def grid = obj as org.geotools.api.coverage.grid.GridCoverage return new Raster(grid) } // GridFormat -> Format diff --git a/src/main/groovy/geoscript/carto/LegendItem.groovy b/src/main/groovy/geoscript/carto/LegendItem.groovy index 71940f023..0fdab7b3a 100644 --- a/src/main/groovy/geoscript/carto/LegendItem.groovy +++ b/src/main/groovy/geoscript/carto/LegendItem.groovy @@ -6,10 +6,10 @@ import geoscript.layer.Renderable import geoscript.style.ColorMap import geoscript.style.Style import org.geotools.filter.text.cql2.CQL -import org.geotools.styling.Rule -import org.geotools.styling.StyleFactory +import org.geotools.api.style.Rule +import org.geotools.api.style.StyleFactory import org.geotools.styling.StyleFactoryImpl -import org.opengis.filter.Filter +import org.geotools.api.filter.Filter import java.awt.Color import java.awt.Font @@ -286,7 +286,7 @@ class LegendItem extends Item { this } - private int countRules(org.opengis.style.Style style) { + private int countRules(org.geotools.api.style.Style style) { int numberOfRules = 0 style.featureTypeStyles().each { def fts -> fts.rules().each { def rule -> @@ -297,12 +297,12 @@ class LegendItem extends Item { } private static class SLDStyle implements Style { - private final org.geotools.styling.Style style + private final org.geotools.api.style.Style style private final static StyleFactory styleFactory = new StyleFactoryImpl() - SLDStyle(org.geotools.styling.Style style) { + SLDStyle(org.geotools.api.style.Style style) { this.style = style } - org.geotools.styling.Style getGtStyle() { + org.geotools.api.style.Style getGtStyle() { style } static SLDStyle fromRule(Rule rule) { diff --git a/src/main/groovy/geoscript/feature/Feature.groovy b/src/main/groovy/geoscript/feature/Feature.groovy index 2b7404b1b..396397aac 100644 --- a/src/main/groovy/geoscript/feature/Feature.groovy +++ b/src/main/groovy/geoscript/feature/Feature.groovy @@ -5,7 +5,7 @@ import geoscript.geom.Bounds import geoscript.geom.Geometry import geoscript.layer.Layer import org.geotools.feature.simple.SimpleFeatureBuilder -import org.opengis.feature.simple.SimpleFeature +import org.geotools.api.feature.simple.SimpleFeature /** * A Feature contains a set of named attributes with values. diff --git a/src/main/groovy/geoscript/feature/Schema.groovy b/src/main/groovy/geoscript/feature/Schema.groovy index 220de2a8d..0a63d200e 100644 --- a/src/main/groovy/geoscript/feature/Schema.groovy +++ b/src/main/groovy/geoscript/feature/Schema.groovy @@ -1,9 +1,9 @@ package geoscript.feature import org.geotools.feature.simple.SimpleFeatureBuilder -import org.opengis.feature.simple.SimpleFeatureType -import org.opengis.feature.type.AttributeDescriptor -import org.opengis.feature.type.GeometryDescriptor +import org.geotools.api.feature.simple.SimpleFeatureType +import org.geotools.api.feature.type.AttributeDescriptor +import org.geotools.api.feature.type.GeometryDescriptor import org.geotools.feature.NameImpl import org.geotools.feature.simple.SimpleFeatureTypeBuilder import org.geotools.data.DataUtilities diff --git a/src/main/groovy/geoscript/feature/io/GmlReader.groovy b/src/main/groovy/geoscript/feature/io/GmlReader.groovy index 22000f6b9..baae2b3dd 100644 --- a/src/main/groovy/geoscript/feature/io/GmlReader.groovy +++ b/src/main/groovy/geoscript/feature/io/GmlReader.groovy @@ -5,7 +5,7 @@ import org.geotools.xsd.Parser import org.geotools.gml2.GMLConfiguration as GML2 import org.geotools.gml3.GMLConfiguration as GML3 import org.geotools.gml3.v3_2.GMLConfiguration as GML32 -import org.opengis.feature.simple.SimpleFeature +import org.geotools.api.feature.simple.SimpleFeature /** * Read a Feature from a GML String. diff --git a/src/main/groovy/geoscript/feature/io/StringSchemaReader.groovy b/src/main/groovy/geoscript/feature/io/StringSchemaReader.groovy index 496076e81..b41be9d5e 100644 --- a/src/main/groovy/geoscript/feature/io/StringSchemaReader.groovy +++ b/src/main/groovy/geoscript/feature/io/StringSchemaReader.groovy @@ -2,7 +2,7 @@ package geoscript.feature.io import geoscript.feature.Schema import org.geotools.data.DataUtilities -import org.opengis.feature.simple.SimpleFeatureType +import org.geotools.api.feature.simple.SimpleFeatureType /** * Read a Schema from a simple String. This implementation uses GeoTools diff --git a/src/main/groovy/geoscript/filter/Expression.groovy b/src/main/groovy/geoscript/filter/Expression.groovy index 4a1135bd1..1a0289a8a 100644 --- a/src/main/groovy/geoscript/filter/Expression.groovy +++ b/src/main/groovy/geoscript/filter/Expression.groovy @@ -1,9 +1,9 @@ package geoscript.filter import geoscript.GeoScript -import org.opengis.filter.expression.Expression as GtExpression +import org.geotools.api.filter.expression.Expression as GtExpression import org.geotools.factory.CommonFactoryFinder -import org.opengis.filter.FilterFactory +import org.geotools.api.filter.FilterFactory import org.geotools.filter.text.cql2.CQL /** @@ -55,12 +55,12 @@ class Expression { * @return The value */ def getValue() { - if (expr instanceof org.opengis.filter.expression.Literal) { - return (expr as org.opengis.filter.expression.Literal).value - } else if (expr instanceof org.opengis.filter.expression.Function) { - return new Function(expr as org.opengis.filter.expression.Function) - } else if (expr instanceof org.opengis.filter.expression.PropertyName) { - return (expr as org.opengis.filter.expression.PropertyName).propertyName + if (expr instanceof org.geotools.api.filter.expression.Literal) { + return (expr as org.geotools.api.filter.expression.Literal).value + } else if (expr instanceof org.geotools.api.filter.expression.Function) { + return new Function(expr as org.geotools.api.filter.expression.Function) + } else if (expr instanceof org.geotools.api.filter.expression.PropertyName) { + return (expr as org.geotools.api.filter.expression.PropertyName).propertyName } else { return expr } @@ -90,11 +90,11 @@ class Expression { */ static Expression fromCQL(String cql) { def e = CQL.toExpression(cql) - if (e instanceof org.opengis.filter.expression.Literal) { + if (e instanceof org.geotools.api.filter.expression.Literal) { return new Expression(e) - } else if (e instanceof org.opengis.filter.expression.Function) { + } else if (e instanceof org.geotools.api.filter.expression.Function) { return new Function(e) - } else if (e instanceof org.opengis.filter.expression.PropertyName) { + } else if (e instanceof org.geotools.api.filter.expression.PropertyName) { return new Property(e) } else { return new Expression(e) diff --git a/src/main/groovy/geoscript/filter/Expressions.groovy b/src/main/groovy/geoscript/filter/Expressions.groovy index 0e381e36c..067e76b9f 100644 --- a/src/main/groovy/geoscript/filter/Expressions.groovy +++ b/src/main/groovy/geoscript/filter/Expressions.groovy @@ -1,8 +1,8 @@ package geoscript.filter import geoscript.feature.Field -import org.opengis.filter.expression.Function as GtFunction -import org.opengis.filter.expression.Expression as GtExpression +import org.geotools.api.filter.expression.Function as GtFunction +import org.geotools.api.filter.expression.Expression as GtExpression /** * The Expressions class holds static methods for creating new Expressions ({@link Expression}, {@link Color}, {@link Function}, {@link Property}). diff --git a/src/main/groovy/geoscript/filter/Filter.groovy b/src/main/groovy/geoscript/filter/Filter.groovy index e78ff23e5..fc14a60ea 100644 --- a/src/main/groovy/geoscript/filter/Filter.groovy +++ b/src/main/groovy/geoscript/filter/Filter.groovy @@ -4,7 +4,7 @@ import geoscript.geom.Bounds import geoscript.geom.Geometry import geoscript.feature.Feature import org.geotools.filter.visitor.SimplifyingFilterVisitor -import org.opengis.filter.Filter as GTFilter +import org.geotools.api.filter.Filter as GTFilter import org.geotools.filter.text.ecql.ECQL import org.geotools.xsd.Parser import org.geotools.xsd.Encoder @@ -14,7 +14,7 @@ import org.geotools.filter.v1_1.OGCConfiguration as OGCConfiguration11 import org.geotools.filter.v1_1.OGC as OGC11 import org.geotools.factory.CommonFactoryFinder import org.geotools.util.factory.GeoTools -import org.opengis.filter.FilterFactory2 +import org.geotools.api.filter.FilterFactory /** * A Filter is a predicate or constraint used to match or filter {@link geoscript.feature.Feature Feature} objects. @@ -38,11 +38,11 @@ class Filter { /** * The GeoTools FilterFactory */ - FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(GeoTools.defaultHints) + FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.defaultHints) /** * Create a new Filter wrapping a GeoTools Filter - * @param filter The org.opengis.filter.Filter + * @param filter The org.geotools.api.filter.Filter */ Filter(GTFilter filter) { this.filter = filter @@ -227,7 +227,7 @@ class Filter { * @return A Filter */ static Filter equals(String field, Object value) { - FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(GeoTools.defaultHints) + FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.defaultHints) new Filter(factory.equals(factory.property(field), factory.literal(value))) } @@ -291,7 +291,7 @@ class Filter { * @return A Filter */ static Filter id(String id) { - FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(GeoTools.defaultHints) + FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.defaultHints) new Filter(factory.id(factory.featureId(id))) } @@ -301,7 +301,7 @@ class Filter { * @return A Filter */ static Filter ids(List ids) { - FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(GeoTools.defaultHints) + FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.defaultHints) new Filter(factory.id(ids.collect{ factory.featureId(it) } as Set)) } diff --git a/src/main/groovy/geoscript/filter/Function.groovy b/src/main/groovy/geoscript/filter/Function.groovy index 91c7fb77e..2d2ade248 100644 --- a/src/main/groovy/geoscript/filter/Function.groovy +++ b/src/main/groovy/geoscript/filter/Function.groovy @@ -1,16 +1,16 @@ package geoscript.filter -import org.opengis.filter.expression.Function as GtFunction -import org.opengis.filter.expression.Expression as GtExpression +import org.geotools.api.filter.expression.Function as GtFunction +import org.geotools.api.filter.expression.Expression as GtExpression import org.geotools.factory.CommonFactoryFinder import org.geotools.util.factory.FactoryIteratorProvider import org.geotools.util.factory.GeoTools import org.geotools.filter.FunctionExpressionImpl import org.geotools.filter.FunctionFactory -import org.opengis.feature.type.Name -import org.opengis.filter.expression.Literal +import org.geotools.api.feature.type.Name +import org.geotools.api.filter.expression.Literal import org.geotools.feature.NameImpl -import org.opengis.filter.capability.FunctionName +import org.geotools.api.filter.capability.FunctionName /** * A GeoScript Function either wraps an existing GeoTools Function or an CQL String. @@ -31,7 +31,7 @@ class Function extends Expression { /** * The GeoTools CommonFactoryFinder for finding GeoTools Functions */ - private static def ff = CommonFactoryFinder.getFilterFactory2(null) + private static def ff = CommonFactoryFinder.getFilterFactory(null) /** * The GeoTools Function diff --git a/src/main/groovy/geoscript/filter/ProcessFunction.groovy b/src/main/groovy/geoscript/filter/ProcessFunction.groovy index 5bdeb6b3e..573834f94 100644 --- a/src/main/groovy/geoscript/filter/ProcessFunction.groovy +++ b/src/main/groovy/geoscript/filter/ProcessFunction.groovy @@ -23,7 +23,7 @@ class ProcessFunction extends Function { * @param process The GeoScript Process * @param functions A variable List of Functions */ - private static org.opengis.filter.expression.Function createProcessFunction(geoscript.process.Process process, Function... functions) { + private static org.geotools.api.filter.expression.Function createProcessFunction(geoscript.process.Process process, Function... functions) { def pff = new org.geotools.process.function.ProcessFunctionFactory() def names = process.name.split(":") def nm = new NameImpl(names[0], names[1]) diff --git a/src/main/groovy/geoscript/filter/Property.groovy b/src/main/groovy/geoscript/filter/Property.groovy index 00e54ffa3..3ff23389f 100644 --- a/src/main/groovy/geoscript/filter/Property.groovy +++ b/src/main/groovy/geoscript/filter/Property.groovy @@ -1,7 +1,7 @@ package geoscript.filter import geoscript.feature.Field -import org.opengis.filter.expression.PropertyName +import org.geotools.api.filter.expression.PropertyName /** * Property is an {@link Expression} that is a {@link geoscript.feature.Field Field} value diff --git a/src/main/groovy/geoscript/layer/Band.groovy b/src/main/groovy/geoscript/layer/Band.groovy index ad9f00050..7723b7153 100644 --- a/src/main/groovy/geoscript/layer/Band.groovy +++ b/src/main/groovy/geoscript/layer/Band.groovy @@ -2,10 +2,10 @@ package geoscript.layer import org.geotools.coverage.GridSampleDimension import org.geotools.coverage.TypeMap -import org.opengis.coverage.SampleDimensionType +import org.geotools.api.coverage.SampleDimensionType import javax.measure.Unit import java.awt.image.DataBuffer -import org.opengis.coverage.SampleDimension +import org.geotools.api.coverage.SampleDimension /** * A Band of Raster Data that represents a single band/channel/layer. diff --git a/src/main/groovy/geoscript/layer/Cursor.groovy b/src/main/groovy/geoscript/layer/Cursor.groovy index 841f6766f..cd662805e 100644 --- a/src/main/groovy/geoscript/layer/Cursor.groovy +++ b/src/main/groovy/geoscript/layer/Cursor.groovy @@ -5,12 +5,12 @@ import org.geotools.data.store.ReprojectingFeatureIterator import org.geotools.feature.FeatureIterator import org.geotools.feature.FeatureTypes import org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer -import org.opengis.feature.simple.SimpleFeature -import org.opengis.feature.simple.SimpleFeatureType +import org.geotools.api.feature.simple.SimpleFeature +import org.geotools.api.feature.simple.SimpleFeatureType import org.geotools.feature.FeatureCollection import org.geotools.data.store.MaxFeaturesIterator import org.geotools.data.sort.SortedFeatureIterator -import org.opengis.filter.sort.SortBy +import org.geotools.api.filter.sort.SortBy /** * A Cursor is a Iterator over a Feature objects. @@ -84,7 +84,7 @@ class Cursor implements Iterator { long max = options.max as long if (!options.containsKey("sort") && layer - && layer.workspace.format in ['Directory', 'org.geotools.data.shapefile.ShapefileDataStore', 'org.geotools.data.directory.DirectoryDataStore']) { + && layer.workspace.format in ['Directory', 'org.geotools.api.data.shapefile.ShapefileDataStore', 'org.geotools.api.data.directory.DirectoryDataStore']) { this.iter = new SortedFeatureIterator(this.iter, col.schema, [SortBy.NATURAL_ORDER] as SortBy[], Integer.MAX_VALUE) } this.iter = new MaxFeaturesIterator(this.iter, start, max) diff --git a/src/main/groovy/geoscript/layer/Format.groovy b/src/main/groovy/geoscript/layer/Format.groovy index 8bff215c1..89c24c9c8 100644 --- a/src/main/groovy/geoscript/layer/Format.groovy +++ b/src/main/groovy/geoscript/layer/Format.groovy @@ -9,9 +9,9 @@ import org.geotools.coverage.grid.io.GridFormatFinder import org.geotools.coverage.grid.io.UnknownFormat import org.geotools.util.factory.GeoTools import org.geotools.util.factory.Hints -import org.opengis.coverage.grid.GridCoverageReader -import org.opengis.parameter.GeneralParameterValue -import org.opengis.parameter.ParameterValueGroup +import org.geotools.api.coverage.grid.GridCoverageReader +import org.geotools.api.parameter.GeneralParameterValue +import org.geotools.api.parameter.ParameterValueGroup import java.awt.* import java.util.List diff --git a/src/main/groovy/geoscript/layer/Graticule.groovy b/src/main/groovy/geoscript/layer/Graticule.groovy index 70d9dd10e..c97574b1c 100644 --- a/src/main/groovy/geoscript/layer/Graticule.groovy +++ b/src/main/groovy/geoscript/layer/Graticule.groovy @@ -5,8 +5,8 @@ import geoscript.feature.Schema import geoscript.geom.Bounds import geoscript.workspace.Memory import geoscript.workspace.Workspace -import org.geotools.data.FeatureSource -import org.geotools.data.simple.SimpleFeatureSource +import org.geotools.api.data.FeatureSource +import org.geotools.api.data.SimpleFeatureSource import org.geotools.grid.GridElement import org.geotools.grid.GridFeatureBuilder import org.geotools.grid.Grids diff --git a/src/main/groovy/geoscript/layer/Layer.groovy b/src/main/groovy/geoscript/layer/Layer.groovy index 87a7231f0..0f18ce667 100644 --- a/src/main/groovy/geoscript/layer/Layer.groovy +++ b/src/main/groovy/geoscript/layer/Layer.groovy @@ -14,10 +14,10 @@ import geoscript.workspace.Memory import geoscript.filter.Filter import geoscript.style.Style import geoscript.style.Symbolizer -import org.geotools.data.FeatureSource -import org.geotools.data.Query -import org.geotools.data.Transaction -import org.geotools.data.FeatureStore +import org.geotools.api.data.FeatureSource +import org.geotools.api.data.Query +import org.geotools.api.data.Transaction +import org.geotools.api.data.FeatureStore import org.geotools.data.DefaultTransaction import org.geotools.data.transform.Definition import org.geotools.data.transform.TransformFactory @@ -27,13 +27,13 @@ import org.geotools.feature.FeatureIterator import org.geotools.map.FeatureLayer import org.geotools.process.vector.VectorToRasterProcess import org.locationtech.jts.geom.TopologyException -import org.opengis.filter.sort.SortOrder -import org.opengis.feature.simple.SimpleFeatureType -import org.opengis.feature.simple.SimpleFeature -import org.opengis.referencing.crs.CoordinateReferenceSystem -import org.opengis.feature.type.AttributeDescriptor +import org.geotools.api.filter.sort.SortOrder +import org.geotools.api.feature.simple.SimpleFeatureType +import org.geotools.api.feature.simple.SimpleFeature +import org.geotools.api.referencing.crs.CoordinateReferenceSystem +import org.geotools.api.feature.type.AttributeDescriptor import org.locationtech.jts.geom.Envelope -import org.opengis.filter.FilterFactory2 +import org.geotools.api.filter.FilterFactory import org.geotools.data.collection.ListFeatureCollection import java.awt.Dimension @@ -92,9 +92,9 @@ class Layer implements Renderable { private static int id = 0 /** - * The FilterFactory2 for creating Filters + * The FilterFactory for creating Filters */ - protected final static FilterFactory2 filterFactory = org.geotools.factory.CommonFactoryFinder.getFilterFactory2(org.geotools.util.factory.GeoTools.getDefaultHints()) + protected final static FilterFactory filterFactory = org.geotools.factory.CommonFactoryFinder.getFilterFactory(org.geotools.util.factory.GeoTools.getDefaultHints()) /** * Create a new Layer from a GeoTools FeatureSource diff --git a/src/main/groovy/geoscript/layer/Raster.groovy b/src/main/groovy/geoscript/layer/Raster.groovy index cb8270b91..d379ab325 100644 --- a/src/main/groovy/geoscript/layer/Raster.groovy +++ b/src/main/groovy/geoscript/layer/Raster.groovy @@ -16,7 +16,7 @@ import org.geotools.coverage.grid.GridGeometry2D import org.geotools.coverage.processing.CoverageProcessor import org.geotools.coverage.processing.OperationJAI import org.geotools.coverage.processing.Operations -import org.geotools.geometry.DirectPosition2D +import org.geotools.geometry.Position2D import org.geotools.map.GridCoverageLayer import org.geotools.process.raster.AffineProcess import org.geotools.process.raster.BandMergeProcess @@ -38,8 +38,8 @@ import org.jaitools.imageutils.iterator.SimpleIterator import org.jaitools.imageutils.iterator.WindowIterator import org.jaitools.numeric.Range import org.geotools.coverage.grid.GridCoverageFactory -import org.opengis.coverage.SampleDimension -import org.opengis.coverage.grid.GridCoverage +import org.geotools.api.coverage.SampleDimension +import org.geotools.api.coverage.grid.GridCoverage import javax.media.jai.Interpolation import javax.media.jai.RasterFactory @@ -370,7 +370,7 @@ class Raster implements Renderable { * @return A value */ List eval(Point point, String type = "double") { - def dp = new DirectPosition2D(coverage.coordinateReferenceSystem, point.x, point.y) + def dp = new Position2D(coverage.coordinateReferenceSystem, point.x, point.y) if (type.equalsIgnoreCase("double")) { coverage.evaluate(dp, (double[]) null) } else if (type.equalsIgnoreCase("float")) { @@ -679,7 +679,7 @@ class Raster implements Renderable { */ Point getPoint(int x, int y) { GridGeometry2D gg = coverage.gridGeometry - DirectPosition2D dp = gg.gridToWorld(new GridCoordinates2D(x,y)) + Position2D dp = gg.gridToWorld(new GridCoordinates2D(x,y)) new Point(dp.x, dp.y) } @@ -690,7 +690,7 @@ class Raster implements Renderable { */ List getPixel(Point p) { GridGeometry2D gg = coverage.gridGeometry - GridCoordinates2D gc = gg.worldToGrid(new DirectPosition2D(p.x, p.y)) + GridCoordinates2D gc = gg.worldToGrid(new Position2D(p.x, p.y)) [gc.x, gc.y] } @@ -703,7 +703,7 @@ class Raster implements Renderable { def processor = new CoverageProcessor() def params = processor.getOperation("CoverageCrop").parameters params.parameter("Source").value = coverage - params.parameter("Envelope").value = new org.geotools.geometry.GeneralEnvelope(bounds.env) + params.parameter("Envelope").value = new org.geotools.geometry.GeneralBounds(bounds.env) def newCoverage = processor.doOperation(params) new Raster(newCoverage) } diff --git a/src/main/groovy/geoscript/layer/Writer.groovy b/src/main/groovy/geoscript/layer/Writer.groovy index 65997cfff..4314c057a 100644 --- a/src/main/groovy/geoscript/layer/Writer.groovy +++ b/src/main/groovy/geoscript/layer/Writer.groovy @@ -2,8 +2,8 @@ package geoscript.layer import geoscript.feature.Feature import org.geotools.data.DefaultTransaction -import org.geotools.data.FeatureStore -import org.geotools.data.Transaction +import org.geotools.api.data.FeatureStore +import org.geotools.api.data.Transaction import org.geotools.data.collection.ListFeatureCollection /** diff --git a/src/main/groovy/geoscript/layer/io/GeoJSONReader.groovy b/src/main/groovy/geoscript/layer/io/GeoJSONReader.groovy index 32b1276b7..942b98fd0 100644 --- a/src/main/groovy/geoscript/layer/io/GeoJSONReader.groovy +++ b/src/main/groovy/geoscript/layer/io/GeoJSONReader.groovy @@ -9,7 +9,7 @@ import geoscript.workspace.Workspace import org.apache.commons.io.IOUtils import org.geotools.feature.FeatureCollection import org.geotools.geojson.feature.FeatureJSON -import org.opengis.feature.simple.SimpleFeatureType +import org.geotools.api.feature.simple.SimpleFeatureType /** * Read a {@link geoscript.layer.Layer Layer} from a GeoJSON InputStream, File, or String. diff --git a/src/main/groovy/geoscript/layer/io/KmlReader.groovy b/src/main/groovy/geoscript/layer/io/KmlReader.groovy index 4b4b98d58..46eb2b291 100644 --- a/src/main/groovy/geoscript/layer/io/KmlReader.groovy +++ b/src/main/groovy/geoscript/layer/io/KmlReader.groovy @@ -8,7 +8,7 @@ import geoscript.workspace.Workspace import geoscript.workspace.Memory import org.geotools.xsd.Parser import org.geotools.kml.KMLConfiguration -import org.opengis.feature.simple.SimpleFeature +import org.geotools.api.feature.simple.SimpleFeature /** * Read a GeoScript {@link geoscript.layer.Layer Layer} from a KML InputStream, File, or String. diff --git a/src/main/groovy/geoscript/layer/io/Pbf.groovy b/src/main/groovy/geoscript/layer/io/Pbf.groovy index 64c86f211..5ccbc2d9b 100644 --- a/src/main/groovy/geoscript/layer/io/Pbf.groovy +++ b/src/main/groovy/geoscript/layer/io/Pbf.groovy @@ -20,7 +20,7 @@ import geoscript.proj.Projection import geoscript.workspace.Memory import org.geotools.renderer.crs.ProjectionHandler import org.geotools.renderer.crs.ProjectionHandlerFinder -import org.opengis.referencing.operation.MathTransform +import org.geotools.api.referencing.operation.MathTransform import java.awt.Rectangle diff --git a/src/main/groovy/geoscript/process/Process.groovy b/src/main/groovy/geoscript/process/Process.groovy index 421caef38..526a3520c 100644 --- a/src/main/groovy/geoscript/process/Process.groovy +++ b/src/main/groovy/geoscript/process/Process.groovy @@ -4,14 +4,14 @@ import geoscript.layer.Raster import org.geotools.process.Process as GtProcess import org.geotools.process.ProcessFactory import org.geotools.feature.NameImpl -import org.opengis.util.InternationalString -import org.opengis.feature.type.Name +import org.geotools.api.util.InternationalString +import org.geotools.api.feature.type.Name import org.geotools.process.Processors import org.geotools.util.SimpleInternationalString import org.geotools.util.factory.FactoryIteratorProvider -import org.geotools.data.Parameter +import org.geotools.api.data.Parameter import java.awt.RenderingHints -import org.opengis.util.ProgressListener +import org.geotools.api.util.ProgressListener import org.geotools.util.factory.GeoTools import geoscript.layer.Layer import geoscript.geom.Bounds @@ -483,7 +483,7 @@ class Process { } else if (geoscript.layer.Cursor.isAssignableFrom(geoScriptClass)) { return org.geotools.feature.FeatureCollection } else if (Raster.isAssignableFrom(geoScriptClass)) { - return org.opengis.coverage.grid.GridCoverage + return org.geotools.api.coverage.grid.GridCoverage } else { return geoScriptClass } @@ -495,15 +495,16 @@ class Process { * @return The Class */ static Class convertGeoToolsToGeoScriptClass(Class geoToolsClass) { + println geoToolsClass if (org.locationtech.jts.geom.Geometry.isAssignableFrom(geoToolsClass)) { return geoscript.geom.Geometry } else if (org.geotools.geometry.jts.ReferencedEnvelope.isAssignableFrom(geoToolsClass)) { return geoscript.geom.Bounds - } else if (org.opengis.geometry.Envelope.isAssignableFrom(geoToolsClass)) { + } else if (org.geotools.api.geometry.Bounds.isAssignableFrom(geoToolsClass)) { return geoscript.geom.Bounds } else if (org.geotools.feature.FeatureCollection.isAssignableFrom(geoToolsClass)) { return geoscript.layer.Cursor - } else if (org.opengis.coverage.grid.GridCoverage.isAssignableFrom(geoToolsClass)) { + } else if (org.geotools.api.coverage.grid.GridCoverage.isAssignableFrom(geoToolsClass)) { return Raster } else { return geoToolsClass @@ -532,12 +533,12 @@ class Process { else if (geoscript.geom.Bounds.isAssignableFrom(target) && org.geotools.geometry.jts.ReferencedEnvelope.isInstance(source)) { return new Bounds(source as org.geotools.geometry.jts.ReferencedEnvelope) } - // org.opengis.geometry.Envelope and Bounds - else if (org.opengis.geometry.Envelope.isAssignableFrom(target) && geoscript.geom.Bounds.isInstance(source)) { + // org.geotools.api.geometry.Envelope and Bounds + else if (org.geotools.api.geometry.Bounds.isAssignableFrom(target) && geoscript.geom.Bounds.isInstance(source)) { return (source as geoscript.geom.Bounds).env } - else if (geoscript.geom.Bounds.isAssignableFrom(target) && org.opengis.geometry.Envelope.isInstance(source)) { - def env = source as org.opengis.geometry.Envelope + else if (geoscript.geom.Bounds.isAssignableFrom(target) && org.geotools.api.geometry.Bounds.isInstance(source)) { + def env = source as org.geotools.api.geometry.Bounds return new Bounds(env.getMinimum(1), env.getMinimum(0), env.getMaximum(1), env.getMaximum(0)) } // FeatureCollection and Layer @@ -555,7 +556,7 @@ class Process { return new geoscript.layer.Cursor(source as org.geotools.feature.FeatureCollection) } // GridCoverage and Raster - else if (org.opengis.coverage.grid.GridCoverage.isAssignableFrom(target) && Raster.isInstance(source)) { + else if (org.geotools.api.coverage.grid.GridCoverage.isAssignableFrom(target) && Raster.isInstance(source)) { return (source as Raster).coverage } else if (Raster.isAssignableFrom(target) && org.geotools.coverage.grid.GridCoverage2D.isInstance(source)) { diff --git a/src/main/groovy/geoscript/proj/Projection.groovy b/src/main/groovy/geoscript/proj/Projection.groovy index f2bcffa8c..8a254ffc1 100755 --- a/src/main/groovy/geoscript/proj/Projection.groovy +++ b/src/main/groovy/geoscript/proj/Projection.groovy @@ -7,8 +7,8 @@ import org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer import org.geotools.metadata.iso.citation.Citations import org.geotools.referencing.CRS import org.geotools.renderer.lite.RendererUtilities -import org.opengis.referencing.crs.CoordinateReferenceSystem -import org.opengis.referencing.operation.MathTransform +import org.geotools.api.referencing.crs.CoordinateReferenceSystem +import org.geotools.api.referencing.operation.MathTransform /** * A Projection is a cartographic projection or coordinate reference system. diff --git a/src/main/groovy/geoscript/style/ChannelSelection.groovy b/src/main/groovy/geoscript/style/ChannelSelection.groovy index d80e435f8..e08115b23 100644 --- a/src/main/groovy/geoscript/style/ChannelSelection.groovy +++ b/src/main/groovy/geoscript/style/ChannelSelection.groovy @@ -1,9 +1,9 @@ package geoscript.style -import org.geotools.styling.Rule -import org.geotools.styling.RasterSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.SelectedChannelType +import org.geotools.api.style.Rule +import org.geotools.api.style.RasterSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.SelectedChannelType /** * The ChannelSelection Symbolizer is used to style multi-spectral Rasters diff --git a/src/main/groovy/geoscript/style/ColorMap.groovy b/src/main/groovy/geoscript/style/ColorMap.groovy index ecd049d95..248a5f168 100644 --- a/src/main/groovy/geoscript/style/ColorMap.groovy +++ b/src/main/groovy/geoscript/style/ColorMap.groovy @@ -3,9 +3,9 @@ package geoscript.style import geoscript.filter.Color import geoscript.filter.Expression import geoscript.layer.Raster -import org.geotools.styling.Rule -import org.geotools.styling.RasterSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.RasterSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * A ColorMap is a Symbolizer used to style Rasters by mapping pixel values to colors. @@ -152,15 +152,15 @@ class ColorMap extends geoscript.style.RasterSymbolizer { * @param values A List of Maps * @return A GeoTool's ColorMap */ - protected org.geotools.styling.ColorMap generateColorMap(List values, String type, boolean extended) { + protected org.geotools.api.style.ColorMap generateColorMap(List values, String type, boolean extended) { def colorMap = styleFactory.createColorMap(); colorMap.extendedColors = extended if (type.equalsIgnoreCase("ramp")) { - colorMap.type = org.geotools.styling.ColorMap.TYPE_RAMP + colorMap.type = org.geotools.api.style.ColorMap.TYPE_RAMP } else if (type.equalsIgnoreCase("intervals")) { - colorMap.type = org.geotools.styling.ColorMap.TYPE_INTERVALS + colorMap.type = org.geotools.api.style.ColorMap.TYPE_INTERVALS } else if (type.equalsIgnoreCase("values")) { - colorMap.type = org.geotools.styling.ColorMap.TYPE_VALUES + colorMap.type = org.geotools.api.style.ColorMap.TYPE_VALUES } values.each {value -> def entry = styleFactory.createColorMapEntry() diff --git a/src/main/groovy/geoscript/style/ContrastEnhancement.groovy b/src/main/groovy/geoscript/style/ContrastEnhancement.groovy index 62be95c14..3c99c315f 100644 --- a/src/main/groovy/geoscript/style/ContrastEnhancement.groovy +++ b/src/main/groovy/geoscript/style/ContrastEnhancement.groovy @@ -1,12 +1,12 @@ package geoscript.style -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.ContrastEnhancement as GtContrastEnhancement +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.ContrastEnhancement as GtContrastEnhancement import geoscript.filter.Expression -import org.geotools.styling.RasterSymbolizer -import org.geotools.styling.Rule -import org.opengis.style.ContrastMethod +import org.geotools.api.style.RasterSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.ContrastMethod /** * A ContrastEnhancement is a Symbolizer used to style Rasters by modifying the contrast. diff --git a/src/main/groovy/geoscript/style/Fill.groovy b/src/main/groovy/geoscript/style/Fill.groovy index a059c4c44..1bc17923f 100644 --- a/src/main/groovy/geoscript/style/Fill.groovy +++ b/src/main/groovy/geoscript/style/Fill.groovy @@ -1,10 +1,10 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Fill as GtFill -import org.geotools.styling.Rule -import org.geotools.styling.PolygonSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Fill as GtFill +import org.geotools.api.style.Rule +import org.geotools.api.style.PolygonSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer import geoscript.filter.Color /** diff --git a/src/main/groovy/geoscript/style/Font.groovy b/src/main/groovy/geoscript/style/Font.groovy index 709d736e1..ead0df569 100644 --- a/src/main/groovy/geoscript/style/Font.groovy +++ b/src/main/groovy/geoscript/style/Font.groovy @@ -1,9 +1,9 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * A Symbolizer for a Label Font. diff --git a/src/main/groovy/geoscript/style/Gradient.groovy b/src/main/groovy/geoscript/style/Gradient.groovy index f62d430b9..4cb4d816b 100644 --- a/src/main/groovy/geoscript/style/Gradient.groovy +++ b/src/main/groovy/geoscript/style/Gradient.groovy @@ -5,8 +5,8 @@ import geoscript.filter.Filter import geoscript.filter.Color import geoscript.layer.Layer import geoscript.feature.Field -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.PointSymbolizer +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.PointSymbolizer /** * The Gradient Composite Symbolizer creates gradients between a series of values and symbolizers or from @@ -68,8 +68,8 @@ class Gradient extends Composite { */ static List createGraduatedSymbolizer(Layer layer, String field, String method, int number, def colors, String elseMode = "ignore") { - org.opengis.filter.FilterFactory2 ff = org.geotools.factory.CommonFactoryFinder.getFilterFactory2(null) - org.opengis.filter.expression.Function function = ff.function(method, ff.property(field), ff.literal(number)) + org.geotools.api.filter.FilterFactory ff = org.geotools.factory.CommonFactoryFinder.getFilterFactory(null) + org.geotools.api.filter.expression.Function function = ff.function(method, ff.property(field), ff.literal(number)) org.geotools.filter.function.Classifier classifier = (org.geotools.filter.function.Classifier) function.evaluate(layer.fs.features) int elseModeInt @@ -93,7 +93,7 @@ class Gradient extends Composite { } // Generate the FeatureTypeStyle - org.geotools.styling.FeatureTypeStyle featureTypeStyle = org.geotools.brewer.color.StyleGenerator.createFeatureTypeStyle( + org.geotools.api.style.FeatureTypeStyle featureTypeStyle = org.geotools.brewer.color.StyleGenerator.createFeatureTypeStyle( classifier, ff.property(field), colors, @@ -113,7 +113,7 @@ class Gradient extends Composite { return new Stroke(lineSym.stroke.color.value).where(new Filter(rule.filter)) } else if (geometryType.equalsIgnoreCase("point") || geometryType.equalsIgnoreCase("multipoint")) { def ptSym = sym as PointSymbolizer - def size = ptSym.graphic.size != org.opengis.filter.expression.Expression.NIL ? ptSym.graphic.size : 8 + def size = ptSym.graphic.size != org.geotools.api.filter.expression.Expression.NIL ? ptSym.graphic.size : 8 return new Shape(ptSym.graphic.graphicalSymbols()[0].fill.color.value, size, ptSym.graphic.graphicalSymbols()[0].wellKnownName.value).where(new Filter(rule.filter)) } else { null diff --git a/src/main/groovy/geoscript/style/Halo.groovy b/src/main/groovy/geoscript/style/Halo.groovy index c1784b24f..3bcce52fc 100644 --- a/src/main/groovy/geoscript/style/Halo.groovy +++ b/src/main/groovy/geoscript/style/Halo.groovy @@ -1,9 +1,9 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * A Symbolizer for label background. diff --git a/src/main/groovy/geoscript/style/Hatch.groovy b/src/main/groovy/geoscript/style/Hatch.groovy index f105c4835..6351358f7 100644 --- a/src/main/groovy/geoscript/style/Hatch.groovy +++ b/src/main/groovy/geoscript/style/Hatch.groovy @@ -1,11 +1,11 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.Graphic -import org.geotools.styling.Mark +import org.geotools.api.style.Rule +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.Graphic +import org.geotools.api.style.Mark /** * A Symbolizer that repeats a pattern. A hatch can be applied to linear and area diff --git a/src/main/groovy/geoscript/style/Icon.groovy b/src/main/groovy/geoscript/style/Icon.groovy index 41cebba14..874f1035f 100644 --- a/src/main/groovy/geoscript/style/Icon.groovy +++ b/src/main/groovy/geoscript/style/Icon.groovy @@ -1,9 +1,9 @@ package geoscript.style -import org.geotools.styling.Rule -import org.geotools.styling.PointSymbolizer -import org.geotools.styling.PolygonSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.PointSymbolizer +import org.geotools.api.style.PolygonSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer import geoscript.filter.Expression /** diff --git a/src/main/groovy/geoscript/style/ImageOutline.groovy b/src/main/groovy/geoscript/style/ImageOutline.groovy index b10d07a07..4819115bd 100644 --- a/src/main/groovy/geoscript/style/ImageOutline.groovy +++ b/src/main/groovy/geoscript/style/ImageOutline.groovy @@ -1,8 +1,8 @@ package geoscript.style -import org.geotools.styling.Rule -import org.geotools.styling.RasterSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.RasterSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * An ImageOutline Symbolizer applies a Stroke or Fill Symbolizer diff --git a/src/main/groovy/geoscript/style/Label.groovy b/src/main/groovy/geoscript/style/Label.groovy index bad2ac7b4..abc93ce20 100644 --- a/src/main/groovy/geoscript/style/Label.groovy +++ b/src/main/groovy/geoscript/style/Label.groovy @@ -3,9 +3,9 @@ package geoscript.style import geoscript.filter.Property import geoscript.filter.Expression import geoscript.filter.Function -import org.geotools.styling.Rule -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * A Symbolizer for labeling a geometry. diff --git a/src/main/groovy/geoscript/style/RasterSymbolizer.groovy b/src/main/groovy/geoscript/style/RasterSymbolizer.groovy index 02ec461af..3a7c71d1c 100644 --- a/src/main/groovy/geoscript/style/RasterSymbolizer.groovy +++ b/src/main/groovy/geoscript/style/RasterSymbolizer.groovy @@ -1,8 +1,8 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * A Raster Symbolizer is used to style Rasters. It is also a base class for all other Raster Symbolizers. @@ -123,7 +123,7 @@ class RasterSymbolizer extends Symbolizer { @Override protected void prepare(Rule rule) { super.prepare(rule) - getGeoToolsSymbolizers(rule, org.geotools.styling.RasterSymbolizer.class).each{s -> + getGeoToolsSymbolizers(rule, org.geotools.api.style.RasterSymbolizer.class).each{s -> apply(s) } } diff --git a/src/main/groovy/geoscript/style/ShadedRelief.groovy b/src/main/groovy/geoscript/style/ShadedRelief.groovy index d12491c95..8db617966 100644 --- a/src/main/groovy/geoscript/style/ShadedRelief.groovy +++ b/src/main/groovy/geoscript/style/ShadedRelief.groovy @@ -1,9 +1,9 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.RasterSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.style.Rule +import org.geotools.api.style.RasterSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer /** * Symbolize a Raster with a ShadedRelief or hill shading. diff --git a/src/main/groovy/geoscript/style/Shape.groovy b/src/main/groovy/geoscript/style/Shape.groovy index c7adfa801..e1f8a31ab 100644 --- a/src/main/groovy/geoscript/style/Shape.groovy +++ b/src/main/groovy/geoscript/style/Shape.groovy @@ -1,14 +1,14 @@ package geoscript.style import geoscript.filter.Expression -import org.geotools.styling.Rule -import org.geotools.styling.Mark -import org.geotools.styling.PointSymbolizer -import org.geotools.styling.PolygonSymbolizer -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.Graphic +import org.geotools.api.style.Rule +import org.geotools.api.style.Mark +import org.geotools.api.style.PointSymbolizer +import org.geotools.api.style.PolygonSymbolizer +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.Graphic import geoscript.filter.Color /** diff --git a/src/main/groovy/geoscript/style/Stroke.groovy b/src/main/groovy/geoscript/style/Stroke.groovy index 61c4ec360..b9f758018 100644 --- a/src/main/groovy/geoscript/style/Stroke.groovy +++ b/src/main/groovy/geoscript/style/Stroke.groovy @@ -1,11 +1,11 @@ package geoscript.style import geoscript.filter.Expression -import org.opengis.filter.expression.Expression as GtExpression -import org.geotools.styling.Rule -import org.geotools.styling.Stroke as GtStroke -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.Symbolizer as GtSymbolizer +import org.geotools.api.filter.expression.Expression as GtExpression +import org.geotools.api.style.Rule +import org.geotools.api.style.Stroke as GtStroke +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.Symbolizer as GtSymbolizer import geoscript.filter.Color /** diff --git a/src/main/groovy/geoscript/style/Style.groovy b/src/main/groovy/geoscript/style/Style.groovy index 998c79045..1d981ed38 100644 --- a/src/main/groovy/geoscript/style/Style.groovy +++ b/src/main/groovy/geoscript/style/Style.groovy @@ -1,6 +1,6 @@ package geoscript.style -import org.geotools.styling.Style as GtStyle +import org.geotools.api.style.Style as GtStyle /** * The Style interface diff --git a/src/main/groovy/geoscript/style/Symbolizer.groovy b/src/main/groovy/geoscript/style/Symbolizer.groovy index c1708c6d4..69326aeaa 100644 --- a/src/main/groovy/geoscript/style/Symbolizer.groovy +++ b/src/main/groovy/geoscript/style/Symbolizer.groovy @@ -4,20 +4,20 @@ import geoscript.feature.Field import geoscript.filter.Filter import geoscript.style.io.SLDWriter import groovy.transform.AutoClone -import org.geotools.styling.Style as GtStyle -import org.geotools.styling.Rule +import org.geotools.api.style.Style as GtStyle +import org.geotools.api.style.Rule import org.geotools.factory.CommonFactoryFinder import org.geotools.styling.StyleFactoryImpl import org.geotools.styling.StyleBuilder -import org.opengis.filter.FilterFactory -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.PointSymbolizer -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.PolygonSymbolizer -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.RasterSymbolizer +import org.geotools.api.filter.FilterFactory +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.PointSymbolizer +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.PolygonSymbolizer +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.RasterSymbolizer import geoscript.filter.Color -import org.geotools.styling.FeatureTypeStyle +import org.geotools.api.style.FeatureTypeStyle /** * A Base class for all Symbolizers. All Symbolizers can have a Filter, min and max scales, and a z-index. diff --git a/src/main/groovy/geoscript/style/Transform.groovy b/src/main/groovy/geoscript/style/Transform.groovy index d8fd999fa..472b91ebc 100644 --- a/src/main/groovy/geoscript/style/Transform.groovy +++ b/src/main/groovy/geoscript/style/Transform.groovy @@ -1,10 +1,10 @@ package geoscript.style import geoscript.filter.Function -import org.geotools.styling.Rule -import org.geotools.styling.Symbolizer as GtSymbolizer -import org.geotools.styling.TextSymbolizer -import org.geotools.styling.FeatureTypeStyle +import org.geotools.api.style.Rule +import org.geotools.api.style.Symbolizer as GtSymbolizer +import org.geotools.api.style.TextSymbolizer +import org.geotools.api.style.FeatureTypeStyle /** * A Symbolizer that wraps a geoscript.filter.Function generally diff --git a/src/main/groovy/geoscript/style/io/CSSReader.groovy b/src/main/groovy/geoscript/style/io/CSSReader.groovy index 1b235f2f5..2a84bef1c 100644 --- a/src/main/groovy/geoscript/style/io/CSSReader.groovy +++ b/src/main/groovy/geoscript/style/io/CSSReader.groovy @@ -1,7 +1,7 @@ package geoscript.style.io import geoscript.style.Style -import org.geotools.styling.Style as GtStyle +import org.geotools.api.style.Style as GtStyle import org.geotools.styling.css.CssParser import org.geotools.styling.css.CssTranslator import org.geotools.styling.css.Stylesheet diff --git a/src/main/groovy/geoscript/style/io/SLDReader.groovy b/src/main/groovy/geoscript/style/io/SLDReader.groovy index 49d09106c..77f04d251 100644 --- a/src/main/groovy/geoscript/style/io/SLDReader.groovy +++ b/src/main/groovy/geoscript/style/io/SLDReader.groovy @@ -1,8 +1,8 @@ package geoscript.style.io import geoscript.style.Style -import org.geotools.styling.Style as GtStyle -import org.geotools.styling.StyleFactory +import org.geotools.api.style.Style as GtStyle +import org.geotools.api.style.StyleFactory import org.geotools.styling.StyleFactoryImpl import org.geotools.xml.styling.SLDParser diff --git a/src/main/groovy/geoscript/style/io/SLDWriter.groovy b/src/main/groovy/geoscript/style/io/SLDWriter.groovy index ac412d24e..4b35b8569 100644 --- a/src/main/groovy/geoscript/style/io/SLDWriter.groovy +++ b/src/main/groovy/geoscript/style/io/SLDWriter.groovy @@ -2,11 +2,11 @@ package geoscript.style.io import geoscript.style.Style import org.geotools.factory.CommonFactoryFinder -import org.geotools.styling.NamedLayer +import org.geotools.api.style.NamedLayer import org.geotools.xml.styling.SLDTransformer -import org.geotools.styling.StyleFactory -import org.geotools.styling.StyledLayerDescriptor -import org.geotools.styling.UserLayer +import org.geotools.api.style.StyleFactory +import org.geotools.api.style.StyledLayerDescriptor +import org.geotools.api.style.UserLayer /** * Write a Style to an SLD document diff --git a/src/main/groovy/geoscript/style/io/YSLDReader.groovy b/src/main/groovy/geoscript/style/io/YSLDReader.groovy index c6f929396..36e558d25 100644 --- a/src/main/groovy/geoscript/style/io/YSLDReader.groovy +++ b/src/main/groovy/geoscript/style/io/YSLDReader.groovy @@ -47,11 +47,11 @@ class YSLDReader implements Reader { * A simple GeoScript Style that wraps a GeoTools Style */ private static class YsldStyle implements Style { - private final org.geotools.styling.Style style - YsldStyle(org.geotools.styling.Style style) { + private final org.geotools.api.style.Style style + YsldStyle(org.geotools.api.style.Style style) { this.style = style } - org.geotools.styling.Style getGtStyle() { + org.geotools.api.style.Style getGtStyle() { style } } diff --git a/src/main/groovy/geoscript/style/io/YSLDWriter.groovy b/src/main/groovy/geoscript/style/io/YSLDWriter.groovy index f9909742b..5be7b976e 100644 --- a/src/main/groovy/geoscript/style/io/YSLDWriter.groovy +++ b/src/main/groovy/geoscript/style/io/YSLDWriter.groovy @@ -2,9 +2,9 @@ package geoscript.style.io import geoscript.style.Style import org.geotools.factory.CommonFactoryFinder -import org.geotools.styling.StyleFactory -import org.geotools.styling.StyledLayerDescriptor -import org.geotools.styling.UserLayer +import org.geotools.api.style.StyleFactory +import org.geotools.api.style.StyledLayerDescriptor +import org.geotools.api.style.UserLayer import org.geotools.ysld.Ysld /** @@ -50,7 +50,7 @@ class YSLDWriter implements Writer { out.toString() } - private StyledLayerDescriptor getStyleLayeredDescriptor(org.geotools.styling.Style style) { + private StyledLayerDescriptor getStyleLayeredDescriptor(org.geotools.api.style.Style style) { StyleFactory sf = CommonFactoryFinder.getStyleFactory(null) UserLayer userLayer = sf.createUserLayer() userLayer.addUserStyle(style) diff --git a/src/main/groovy/geoscript/workspace/Database.groovy b/src/main/groovy/geoscript/workspace/Database.groovy index 8800f1d72..a638a25ab 100644 --- a/src/main/groovy/geoscript/workspace/Database.groovy +++ b/src/main/groovy/geoscript/workspace/Database.groovy @@ -1,7 +1,7 @@ package geoscript.workspace import groovy.sql.Sql -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.jdbc.JDBCDataStore import org.geotools.jdbc.VirtualTable import geoscript.feature.Field diff --git a/src/main/groovy/geoscript/workspace/Directory.groovy b/src/main/groovy/geoscript/workspace/Directory.groovy index 01a2d15a7..18c14fb0b 100644 --- a/src/main/groovy/geoscript/workspace/Directory.groovy +++ b/src/main/groovy/geoscript/workspace/Directory.groovy @@ -5,7 +5,7 @@ import geoscript.layer.Layer import geoscript.style.DirectoryStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.directory.DirectoryDataStore import org.geotools.data.shapefile.ShapefileDataStore import org.geotools.data.shapefile.ShapefileDataStoreFactory diff --git a/src/main/groovy/geoscript/workspace/FlatGeobuf.groovy b/src/main/groovy/geoscript/workspace/FlatGeobuf.groovy index 49431c419..e58eb24bc 100644 --- a/src/main/groovy/geoscript/workspace/FlatGeobuf.groovy +++ b/src/main/groovy/geoscript/workspace/FlatGeobuf.groovy @@ -4,9 +4,7 @@ import geoscript.layer.Layer import geoscript.style.DirectoryStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository -import geoscript.style.io.Reader -import geoscript.style.io.Readers -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.flatgeobuf.FlatGeobufDataStoreFactory import org.geotools.data.flatgeobuf.FlatGeobufDirectoryDataStore import org.geotools.util.URLs diff --git a/src/main/groovy/geoscript/workspace/GeoPackage.groovy b/src/main/groovy/geoscript/workspace/GeoPackage.groovy index 34299eac0..f6e2052ef 100644 --- a/src/main/groovy/geoscript/workspace/GeoPackage.groovy +++ b/src/main/groovy/geoscript/workspace/GeoPackage.groovy @@ -4,7 +4,7 @@ import geoscript.layer.Layer import geoscript.style.DatabaseStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.geopkg.GeoPkgDataStoreFactory import org.geotools.jdbc.JDBCDataStore diff --git a/src/main/groovy/geoscript/workspace/Geobuf.groovy b/src/main/groovy/geoscript/workspace/Geobuf.groovy index 3bae77207..3e58f1d4e 100644 --- a/src/main/groovy/geoscript/workspace/Geobuf.groovy +++ b/src/main/groovy/geoscript/workspace/Geobuf.groovy @@ -4,8 +4,7 @@ import geoscript.layer.Layer import geoscript.style.DirectoryStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository -import geoscript.style.io.Readers -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.geobuf.GeobufDirectoryDataStore import org.geotools.data.geobuf.GeobufDataStoreFactory diff --git a/src/main/groovy/geoscript/workspace/H2.groovy b/src/main/groovy/geoscript/workspace/H2.groovy index 464bd54a0..10027eef1 100644 --- a/src/main/groovy/geoscript/workspace/H2.groovy +++ b/src/main/groovy/geoscript/workspace/H2.groovy @@ -5,7 +5,7 @@ import geoscript.style.DatabaseStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository import geoscript.style.io.Readers -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.h2.H2DataStoreFactory import org.geotools.data.h2.H2JNDIDataStoreFactory import org.geotools.jdbc.JDBCDataStore diff --git a/src/main/groovy/geoscript/workspace/Memory.groovy b/src/main/groovy/geoscript/workspace/Memory.groovy index f0c9e539b..6b6216469 100644 --- a/src/main/groovy/geoscript/workspace/Memory.groovy +++ b/src/main/groovy/geoscript/workspace/Memory.groovy @@ -1,6 +1,6 @@ package geoscript.workspace -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.memory.MemoryDataStore /** diff --git a/src/main/groovy/geoscript/workspace/MySQL.groovy b/src/main/groovy/geoscript/workspace/MySQL.groovy index 1a44ee0cb..70b56ed83 100644 --- a/src/main/groovy/geoscript/workspace/MySQL.groovy +++ b/src/main/groovy/geoscript/workspace/MySQL.groovy @@ -1,6 +1,6 @@ package geoscript.workspace -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.mysql.MySQLDataStoreFactory import org.geotools.data.mysql.MySQLJNDIDataStoreFactory import org.geotools.jdbc.JDBCDataStore diff --git a/src/main/groovy/geoscript/workspace/OGR.groovy b/src/main/groovy/geoscript/workspace/OGR.groovy index 65e22ed99..02ef84bb2 100644 --- a/src/main/groovy/geoscript/workspace/OGR.groovy +++ b/src/main/groovy/geoscript/workspace/OGR.groovy @@ -3,7 +3,7 @@ package geoscript.workspace import geoscript.feature.Schema import geoscript.layer.Cursor import geoscript.layer.Layer -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.ogr.OGRDataStore import org.geotools.data.ogr.OGRDataStoreFactory import org.geotools.data.ogr.jni.JniOGRDataStoreFactory diff --git a/src/main/groovy/geoscript/workspace/PostGIS.groovy b/src/main/groovy/geoscript/workspace/PostGIS.groovy index 500497b96..dbfabf400 100644 --- a/src/main/groovy/geoscript/workspace/PostGIS.groovy +++ b/src/main/groovy/geoscript/workspace/PostGIS.groovy @@ -5,7 +5,7 @@ import geoscript.style.DatabaseStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository import geoscript.style.io.Readers -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.postgis.PostgisNGDataStoreFactory import org.geotools.data.postgis.PostgisNGJNDIDataStoreFactory import org.geotools.jdbc.JDBCDataStore diff --git a/src/main/groovy/geoscript/workspace/Property.groovy b/src/main/groovy/geoscript/workspace/Property.groovy index d3e61f8e8..08315d61a 100644 --- a/src/main/groovy/geoscript/workspace/Property.groovy +++ b/src/main/groovy/geoscript/workspace/Property.groovy @@ -5,7 +5,7 @@ import geoscript.style.DirectoryStyleRepository import geoscript.style.Style import geoscript.style.StyleRepository import geoscript.style.io.Readers -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.property.PropertyDataStore import org.geotools.data.property.PropertyDataStoreFactory diff --git a/src/main/groovy/geoscript/workspace/SpatiaLite.groovy b/src/main/groovy/geoscript/workspace/SpatiaLite.groovy index 0bd486e56..bfa50a562 100644 --- a/src/main/groovy/geoscript/workspace/SpatiaLite.groovy +++ b/src/main/groovy/geoscript/workspace/SpatiaLite.groovy @@ -3,7 +3,7 @@ package geoscript.workspace import geoscript.feature.Schema import geoscript.layer.Cursor import geoscript.layer.Layer -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.ogr.OGRDataStore /** diff --git a/src/main/groovy/geoscript/workspace/Sqlite.groovy b/src/main/groovy/geoscript/workspace/Sqlite.groovy index 705a42db1..3a00214ac 100644 --- a/src/main/groovy/geoscript/workspace/Sqlite.groovy +++ b/src/main/groovy/geoscript/workspace/Sqlite.groovy @@ -23,8 +23,8 @@ import org.locationtech.jts.io.WKTWriter import geoscript.proj.Projection import groovy.sql.Sql import org.apache.commons.dbcp.BasicDataSource -import org.geotools.data.DataAccessFactory -import org.geotools.data.DataStore +import org.geotools.api.data.DataAccessFactory +import org.geotools.api.data.DataStore import org.geotools.util.factory.Hints import org.geotools.geometry.jts.Geometries import org.geotools.jdbc.JDBCDataStore @@ -32,10 +32,10 @@ import org.geotools.jdbc.JDBCDataStoreFactory import org.geotools.jdbc.PreparedStatementSQLDialect import org.geotools.jdbc.SQLDialect import org.geotools.referencing.CRS -import org.opengis.feature.simple.SimpleFeatureType -import org.opengis.feature.type.GeometryDescriptor -import org.opengis.referencing.FactoryException -import org.opengis.referencing.crs.CoordinateReferenceSystem +import org.geotools.api.feature.simple.SimpleFeatureType +import org.geotools.api.feature.type.GeometryDescriptor +import org.geotools.api.referencing.FactoryException +import org.geotools.api.referencing.crs.CoordinateReferenceSystem import java.sql.Connection import java.sql.PreparedStatement diff --git a/src/main/groovy/geoscript/workspace/WFS.groovy b/src/main/groovy/geoscript/workspace/WFS.groovy index b99d25fcc..06fd07c23 100644 --- a/src/main/groovy/geoscript/workspace/WFS.groovy +++ b/src/main/groovy/geoscript/workspace/WFS.groovy @@ -1,6 +1,6 @@ package geoscript.workspace -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.data.wfs.WFSDataStore import org.geotools.data.wfs.WFSDataStoreFactory diff --git a/src/main/groovy/geoscript/workspace/Workspace.groovy b/src/main/groovy/geoscript/workspace/Workspace.groovy index 6327e591b..f922962ed 100644 --- a/src/main/groovy/geoscript/workspace/Workspace.groovy +++ b/src/main/groovy/geoscript/workspace/Workspace.groovy @@ -7,10 +7,10 @@ import geoscript.layer.Cursor import geoscript.layer.Layer import geoscript.style.Style import geoscript.style.Symbolizer -import org.geotools.data.DataStore +import org.geotools.api.data.DataStore import org.geotools.feature.FeatureCollection import org.geotools.data.collection.ListFeatureCollection -import org.geotools.data.DataStoreFinder +import org.geotools.api.data.DataStoreFinder import org.geotools.util.URLs /** diff --git a/src/main/groovy/geoscript/workspace/WorkspaceFactory.groovy b/src/main/groovy/geoscript/workspace/WorkspaceFactory.groovy index ab29529cb..357a3231f 100644 --- a/src/main/groovy/geoscript/workspace/WorkspaceFactory.groovy +++ b/src/main/groovy/geoscript/workspace/WorkspaceFactory.groovy @@ -1,7 +1,7 @@ package geoscript.workspace -import org.geotools.data.DataStore -import org.geotools.data.DataStoreFinder +import org.geotools.api.data.DataStore +import org.geotools.api.data.DataStoreFinder /** * A WorkspaceFactory creates Workspaces from connection parameters diff --git a/src/main/resources/META-INF/services/org.opengis.coverage.processing.Operation b/src/main/resources/META-INF/services/org.geotools.api.coverage.processing.Operation similarity index 100% rename from src/main/resources/META-INF/services/org.opengis.coverage.processing.Operation rename to src/main/resources/META-INF/services/org.geotools.api.coverage.processing.Operation diff --git a/src/main/resources/META-INF/services/org.geotools.data.DataStoreFactorySpi b/src/main/resources/META-INF/services/org.geotools.api.data.DataStoreFactorySpi similarity index 100% rename from src/main/resources/META-INF/services/org.geotools.data.DataStoreFactorySpi rename to src/main/resources/META-INF/services/org.geotools.api.data.DataStoreFactorySpi diff --git a/src/test/groovy/geoscript/GeoScriptTest.groovy b/src/test/groovy/geoscript/GeoScriptTest.groovy index 611eb3095..08ab8ba2a 100644 --- a/src/test/groovy/geoscript/GeoScriptTest.groovy +++ b/src/test/groovy/geoscript/GeoScriptTest.groovy @@ -63,15 +63,15 @@ class GeoScriptTest { @Test void unwrap() { assertTrue GeoScript.unwrap(new Point(111,-47)) instanceof org.locationtech.jts.geom.Point - assertTrue GeoScript.unwrap(new Feature([the_geom: "POINT (1 1)"],"pt")) instanceof org.opengis.feature.simple.SimpleFeature - assertTrue GeoScript.unwrap(new Schema("widgets", "geom:Point:srid=4326")) instanceof org.opengis.feature.simple.SimpleFeatureType + assertTrue GeoScript.unwrap(new Feature([the_geom: "POINT (1 1)"],"pt")) instanceof org.geotools.api.feature.simple.SimpleFeature + assertTrue GeoScript.unwrap(new Schema("widgets", "geom:Point:srid=4326")) instanceof org.geotools.api.feature.simple.SimpleFeatureType assertTrue GeoScript.unwrap(new Bounds(0,0,10,10)) instanceof org.geotools.geometry.jts.ReferencedEnvelope - assertTrue GeoScript.unwrap(new Expression(12)) instanceof org.opengis.filter.expression.Expression + assertTrue GeoScript.unwrap(new Expression(12)) instanceof org.geotools.api.filter.expression.Expression assertTrue GeoScript.unwrap(new Layer().getCursor()) instanceof org.geotools.feature.FeatureCollection - assertTrue GeoScript.unwrap(new Layer()) instanceof org.geotools.data.FeatureSource - assertTrue GeoScript.unwrap(new Projection("EPSG:4326")) instanceof org.opengis.referencing.crs.CoordinateReferenceSystem + assertTrue GeoScript.unwrap(new Layer()) instanceof org.geotools.api.data.FeatureSource + assertTrue GeoScript.unwrap(new Projection("EPSG:4326")) instanceof org.geotools.api.referencing.crs.CoordinateReferenceSystem assertTrue GeoScript.unwrap(new Geodetic("clrk66")) instanceof org.geotools.referencing.datum.DefaultEllipsoid - assertTrue GeoScript.unwrap(new Memory()) instanceof org.geotools.data.DataStore + assertTrue GeoScript.unwrap(new Memory()) instanceof org.geotools.api.data.DataStore List data = [ [0,0,0,0,0,0,0], [0,1,1,1,1,1,0], diff --git a/src/test/groovy/geoscript/filter/ColorTest.groovy b/src/test/groovy/geoscript/filter/ColorTest.groovy index edc404257..b16ba0aa2 100644 --- a/src/test/groovy/geoscript/filter/ColorTest.groovy +++ b/src/test/groovy/geoscript/filter/ColorTest.groovy @@ -23,27 +23,27 @@ class ColorTest { @Test void constructors() { Color color = new Color("black") - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#000000", color.toString() color = new Color(color) - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#000000", color.toString() color = new Color("#000000") - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#000000", color.toString() color = new Color([0,0,0]) - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#000000", color.toString() color = new Color("rgb(255,0,255)") - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#ff00ff", color.toString() color = new Color("hsl(0,1,0.5)") - assertTrue color.expr instanceof org.opengis.filter.expression.Literal + assertTrue color.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "#ff0000", color.toString() // Make sure HSL run trips diff --git a/src/test/groovy/geoscript/filter/ExpressionTest.groovy b/src/test/groovy/geoscript/filter/ExpressionTest.groovy index 891f40155..ac7cc3317 100644 --- a/src/test/groovy/geoscript/filter/ExpressionTest.groovy +++ b/src/test/groovy/geoscript/filter/ExpressionTest.groovy @@ -13,17 +13,17 @@ class ExpressionTest { // Create an Expression from a value Expression e = new Expression(12) - assertTrue e.expr instanceof org.opengis.filter.expression.Literal + assertTrue e.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "12", e.toString() // Create an Expression from another Expression e = new Expression(e) - assertTrue e.expr instanceof org.opengis.filter.expression.Literal + assertTrue e.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "12", e.toString() // Create an Expression from a GeoTools Expression e = new Expression(Expression.filterFactory.literal(12)) - assertTrue e.expr instanceof org.opengis.filter.expression.Literal + assertTrue e.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "12", e.toString() } @@ -35,11 +35,11 @@ class ExpressionTest { @Test void fromCQL() { // Literal Number Expression e = Expression.fromCQL("12") - assertTrue e.expr instanceof org.opengis.filter.expression.Literal + assertTrue e.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "12", e.toString() // Literal String e = Expression.fromCQL("'A String'") - assertTrue e.expr instanceof org.opengis.filter.expression.Literal + assertTrue e.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "A String", e.toString() // Property e = Expression.fromCQL("NAME") diff --git a/src/test/groovy/geoscript/filter/FilterTest.groovy b/src/test/groovy/geoscript/filter/FilterTest.groovy index 56b93fbd3..b151cdfb8 100644 --- a/src/test/groovy/geoscript/filter/FilterTest.groovy +++ b/src/test/groovy/geoscript/filter/FilterTest.groovy @@ -3,7 +3,7 @@ package geoscript.filter import org.geotools.factory.CommonFactoryFinder import org.geotools.util.factory.GeoTools import org.junit.jupiter.api.Test -import org.opengis.filter.FilterFactory2 +import org.geotools.api.filter.FilterFactory import static org.junit.jupiter.api.Assertions.* import geoscript.geom.* @@ -13,7 +13,7 @@ import geoscript.AssertUtil class FilterTest { - private static FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(GeoTools.defaultHints) + private static FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.defaultHints) @Test void constructors() { Filter f1 = new Filter("name='foobar'") diff --git a/src/test/groovy/geoscript/filter/PropertyTest.groovy b/src/test/groovy/geoscript/filter/PropertyTest.groovy index 143a1e95c..d98a42df9 100644 --- a/src/test/groovy/geoscript/filter/PropertyTest.groovy +++ b/src/test/groovy/geoscript/filter/PropertyTest.groovy @@ -14,12 +14,12 @@ class PropertyTest { @Test void constructors() { // Create a Property from a String Property p = new Property("NAME") - assertTrue p.expr instanceof org.opengis.filter.expression.PropertyName + assertTrue p.expr instanceof org.geotools.api.filter.expression.PropertyName assertEquals "NAME", p.toString() // Create a Property from a Field p = new Property(new Field("NAME","String")) - assertTrue p.expr instanceof org.opengis.filter.expression.PropertyName + assertTrue p.expr instanceof org.geotools.api.filter.expression.PropertyName assertEquals "NAME", p.toString() } diff --git a/src/test/groovy/geoscript/process/ProcessTest.groovy b/src/test/groovy/geoscript/process/ProcessTest.groovy index 1c4e56cea..546da914f 100644 --- a/src/test/groovy/geoscript/process/ProcessTest.groovy +++ b/src/test/groovy/geoscript/process/ProcessTest.groovy @@ -7,7 +7,7 @@ import static org.junit.jupiter.api.Assertions.* import geoscript.geom.* import geoscript.layer.* import org.geotools.process.Processors -import org.opengis.feature.type.Name +import org.geotools.api.feature.type.Name import org.geotools.feature.NameImpl import org.geotools.process.ProcessFactory @@ -185,7 +185,7 @@ class ProcessTest { assertEquals 1, paramInfo.size() assertTrue paramInfo.containsKey("features") def param = paramInfo.get("features") - assertTrue param instanceof org.geotools.data.Parameter + assertTrue param instanceof org.geotools.api.data.Parameter assertTrue org.geotools.feature.FeatureCollection.isAssignableFrom(param.type) // The ResultInfo should be GeoTools types @@ -193,7 +193,7 @@ class ProcessTest { assertEquals 1, resultInfo.size() assertTrue resultInfo.containsKey("result") param = resultInfo.get("result") - assertTrue param instanceof org.geotools.data.Parameter + assertTrue param instanceof org.geotools.api.data.Parameter assertTrue org.geotools.feature.FeatureCollection.isAssignableFrom(param.type) } diff --git a/src/test/groovy/geoscript/style/ColorMapTest.groovy b/src/test/groovy/geoscript/style/ColorMapTest.groovy index 5575cc798..0658e5f09 100644 --- a/src/test/groovy/geoscript/style/ColorMapTest.groovy +++ b/src/test/groovy/geoscript/style/ColorMapTest.groovy @@ -84,7 +84,7 @@ class ColorMapTest { def sym = Symbolizer.styleFactory.createRasterSymbolizer() colorMap.apply(sym) - sym.colorMap.type = org.geotools.styling.ColorMap.TYPE_RAMP + sym.colorMap.type = org.geotools.api.style.ColorMap.TYPE_RAMP assertEquals colorMap.values.size(), sym.colorMap.colorMapEntries.length assertEquals colorMap.values[0].color, sym.colorMap.colorMapEntries[0].color.value assertEquals colorMap.values[0].quantity, sym.colorMap.colorMapEntries[0].quantity.value @@ -99,7 +99,7 @@ class ColorMapTest { colorMap.prepare(rule) def sym = rule.symbolizers[0] - sym.colorMap.type = org.geotools.styling.ColorMap.TYPE_RAMP + sym.colorMap.type = org.geotools.api.style.ColorMap.TYPE_RAMP assertEquals colorMap.values.size(), sym.colorMap.colorMapEntries.length assertEquals colorMap.values[0].color, sym.colorMap.colorMapEntries[0].color.value assertEquals colorMap.values[0].quantity, sym.colorMap.colorMapEntries[0].quantity.value diff --git a/src/test/groovy/geoscript/style/ImageOutlineTest.groovy b/src/test/groovy/geoscript/style/ImageOutlineTest.groovy index b51b4fe9b..6d52b0751 100644 --- a/src/test/groovy/geoscript/style/ImageOutlineTest.groovy +++ b/src/test/groovy/geoscript/style/ImageOutlineTest.groovy @@ -1,6 +1,6 @@ package geoscript.style -import org.geotools.styling.PolygonSymbolizer +import org.geotools.api.style.PolygonSymbolizer import org.junit.jupiter.api.Test import static org.junit.jupiter.api.Assertions.* diff --git a/src/test/groovy/geoscript/style/LabelTest.groovy b/src/test/groovy/geoscript/style/LabelTest.groovy index 6a80437bb..0b30ccdab 100644 --- a/src/test/groovy/geoscript/style/LabelTest.groovy +++ b/src/test/groovy/geoscript/style/LabelTest.groovy @@ -31,7 +31,7 @@ class LabelTest { // Add point placement assertTrue label.point([0.75,0.25], [5,2], 0.25) instanceof Label - assertTrue label.placement instanceof org.geotools.styling.PointPlacement + assertTrue label.placement instanceof org.geotools.api.style.PointPlacement assertEquals 0.75, label.placement.anchorPoint.anchorPointX.value, 0.1 assertEquals 0.25, label.placement.anchorPoint.anchorPointY.value, 0.1 assertEquals 5, label.placement.displacement.displacementX.value, 0.1 @@ -40,7 +40,7 @@ class LabelTest { // Switch to line placement assertTrue label.linear() instanceof Label - assertTrue label.placement instanceof org.geotools.styling.LinePlacement + assertTrue label.placement instanceof org.geotools.api.style.LinePlacement assertEquals 0, label.placement.perpendicularOffset.value, 0.1 assertNull label.placement.gap assertNull label.placement.initialGap @@ -52,7 +52,7 @@ class LabelTest { // Switch back to point placement using named parameters assertTrue label.point(displace: [1,2], anchor: [1,0], rotate: 45) instanceof Label - assertTrue label.placement instanceof org.geotools.styling.PointPlacement + assertTrue label.placement instanceof org.geotools.api.style.PointPlacement assertEquals 1, label.placement.anchorPoint.anchorPointX.value, 0.1 assertEquals 0, label.placement.anchorPoint.anchorPointY.value, 0.1 assertEquals 1, label.placement.displacement.displacementX.value, 0.1 @@ -61,7 +61,7 @@ class LabelTest { // Switch to line placement using named parameters assertTrue label.linear(follow: true, repeat: 15, offset: 2) instanceof Label - assertTrue label.placement instanceof org.geotools.styling.LinePlacement + assertTrue label.placement instanceof org.geotools.api.style.LinePlacement assertEquals 2, label.placement.perpendicularOffset.value, 0.1 assertNull label.placement.gap assertNull label.placement.initialGap @@ -73,7 +73,7 @@ class LabelTest { // Switch to a more complicate line placement assertTrue label.linear(3.4, 1.2, 1, true, true, true, 1.4, 5.1) instanceof Label - assertTrue label.placement instanceof org.geotools.styling.LinePlacement + assertTrue label.placement instanceof org.geotools.api.style.LinePlacement assertEquals 3.4, label.placement.perpendicularOffset.value, 0.1 assertEquals 1.2, label.placement.gap.value, 0.1 assertEquals 1, label.placement.initialGap.value, 0.1 @@ -137,17 +137,17 @@ class LabelTest { Label label = new Label(new Property("NAME")) assertTrue label.property instanceof Property - assertTrue label.property.expr instanceof org.opengis.filter.expression.PropertyName + assertTrue label.property.expr instanceof org.geotools.api.filter.expression.PropertyName assertEquals "NAME", label.property.value label = new Label(new Expression("→")) assertTrue label.property instanceof Expression - assertTrue label.property.expr instanceof org.opengis.filter.expression.Literal + assertTrue label.property.expr instanceof org.geotools.api.filter.expression.Literal assertEquals "→", label.property.value label = new Label("NAME") assertTrue label.property instanceof Expression - assertTrue label.property.expr instanceof org.opengis.filter.expression.PropertyName + assertTrue label.property.expr instanceof org.geotools.api.filter.expression.PropertyName assertEquals "NAME", label.property.value } diff --git a/src/test/groovy/geoscript/style/SymbolizerTest.groovy b/src/test/groovy/geoscript/style/SymbolizerTest.groovy index 3786ad94d..66baa4125 100644 --- a/src/test/groovy/geoscript/style/SymbolizerTest.groovy +++ b/src/test/groovy/geoscript/style/SymbolizerTest.groovy @@ -9,13 +9,13 @@ import org.junit.jupiter.api.io.TempDir import static org.junit.jupiter.api.Assertions.* import geoscript.filter.Filter -import org.geotools.styling.Style -import org.opengis.filter.Filter as GTFilter -import org.geotools.styling.LineSymbolizer -import org.geotools.styling.PointSymbolizer +import org.geotools.api.style.Style +import org.geotools.api.filter.Filter as GTFilter +import org.geotools.api.style.LineSymbolizer +import org.geotools.api.style.PointSymbolizer import org.geotools.styling.PointSymbolizerImpl -import org.geotools.styling.PolygonSymbolizer -import org.geotools.styling.TextSymbolizer +import org.geotools.api.style.PolygonSymbolizer +import org.geotools.api.style.TextSymbolizer /** * The Symbolizer Unit Test @@ -189,7 +189,7 @@ class SymbolizerTest { assertEquals 1, style.featureTypeStyles()[0].rules()[0].symbolizers().size() PolygonSymbolizer polygonSym = style.featureTypeStyles()[0].rules()[0].symbolizers()[0] - assertTrue polygonSym instanceof org.geotools.styling.PolygonSymbolizer + assertTrue polygonSym instanceof org.geotools.api.style.PolygonSymbolizer assertEquals "#008080", polygonSym.fill.color.value assertEquals 1.0, polygonSym.fill.opacity.value, 0.01 @@ -205,7 +205,7 @@ class SymbolizerTest { assertEquals 1, style.featureTypeStyles()[0].rules()[0].symbolizers().size() polygonSym = style.featureTypeStyles()[0].rules()[0].symbolizers()[0] - assertTrue polygonSym instanceof org.geotools.styling.PolygonSymbolizer + assertTrue polygonSym instanceof org.geotools.api.style.PolygonSymbolizer assertEquals "#008080", polygonSym.fill.color.value assertEquals 1.0, polygonSym.fill.opacity.value, 0.01 @@ -226,12 +226,12 @@ class SymbolizerTest { assertEquals 2, style.featureTypeStyles()[0].rules()[0].symbolizers().size() polygonSym = style.featureTypeStyles()[0].rules()[0].symbolizers()[0] - assertTrue polygonSym instanceof org.geotools.styling.PolygonSymbolizer + assertTrue polygonSym instanceof org.geotools.api.style.PolygonSymbolizer assertEquals "#008080", polygonSym.fill.color.value assertEquals 1.0, polygonSym.fill.opacity.value, 0.01 LineSymbolizer lineSym = style.featureTypeStyles()[0].rules()[0].symbolizers()[1] - assertTrue lineSym instanceof org.geotools.styling.LineSymbolizer + assertTrue lineSym instanceof org.geotools.api.style.LineSymbolizer assertEquals "#000080", lineSym.stroke.color.value assertEquals 1.0, lineSym.stroke.width.value, 0.1 } diff --git a/src/test/groovy/geoscript/style/TransformTest.groovy b/src/test/groovy/geoscript/style/TransformTest.groovy index 347854ad0..cba7a29e6 100644 --- a/src/test/groovy/geoscript/style/TransformTest.groovy +++ b/src/test/groovy/geoscript/style/TransformTest.groovy @@ -50,12 +50,12 @@ class TransformTest { def pointSym = Symbolizer.styleFactory.createPointSymbolizer(); Transform centroidTransform = new Transform(new Function("myCentroid(the_geom)", {g -> g.centroid})) centroidTransform.apply(pointSym) - assertTrue pointSym.geometry instanceof org.opengis.filter.expression.Function + assertTrue pointSym.geometry instanceof org.geotools.api.filter.expression.Function def textSym = Symbolizer.styleFactory.createTextSymbolizer() Transform upperCaseTransform = new Transform(new Function("myUpperCase(NAME)", {str -> str.toUpperCase()})) upperCaseTransform.apply(textSym) - assertTrue textSym.label instanceof org.opengis.filter.expression.Function + assertTrue textSym.label instanceof org.geotools.api.filter.expression.Function } @Test void prepare() { @@ -68,7 +68,7 @@ class TransformTest { centroidTransform.prepare(rule) upperCaseTransform.prepare(rule) - assertTrue rule.symbolizers()[0].geometry instanceof org.opengis.filter.expression.Function - assertTrue rule.symbolizers()[1].label instanceof org.opengis.filter.expression.Function + assertTrue rule.symbolizers()[0].geometry instanceof org.geotools.api.filter.expression.Function + assertTrue rule.symbolizers()[1].label instanceof org.geotools.api.filter.expression.Function } }