kopia lustrzana https://github.com/onthegomap/planetiler
Bump geotools.version from 29.2 to 30.0 (#685)
* Bump geotools.version from 29.2 to 30.0 Bumps `geotools.version` from 29.2 to 30.0. Updates `org.geotools:gt-shapefile` from 29.2 to 30.0 Updates `org.geotools:gt-epsg-hsql` from 29.2 to 30.0 --- updated-dependencies: - dependency-name: org.geotools:gt-shapefile dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.geotools:gt-epsg-hsql dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix geotools breaking changes * fix tests --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Barry <msb5014@gmail.com>pull/687/head
rodzic
f858a462d1
commit
015f418405
|
@ -16,7 +16,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<geotools.version>29.2</geotools.version>
|
<geotools.version>30.0</geotools.version>
|
||||||
<log4j.version>2.20.0</log4j.version>
|
<log4j.version>2.20.0</log4j.version>
|
||||||
<prometheus.version>0.16.0</prometheus.version>
|
<prometheus.version>0.16.0</prometheus.version>
|
||||||
<protobuf.version>3.24.4</protobuf.version>
|
<protobuf.version>3.24.4</protobuf.version>
|
||||||
|
|
|
@ -19,12 +19,12 @@ import mil.nga.geopackage.GeoPackageManager;
|
||||||
import mil.nga.geopackage.features.user.FeatureColumns;
|
import mil.nga.geopackage.features.user.FeatureColumns;
|
||||||
import mil.nga.geopackage.features.user.FeatureDao;
|
import mil.nga.geopackage.features.user.FeatureDao;
|
||||||
import mil.nga.geopackage.geom.GeoPackageGeometryData;
|
import mil.nga.geopackage.geom.GeoPackageGeometryData;
|
||||||
|
import org.geotools.api.referencing.FactoryException;
|
||||||
|
import org.geotools.api.referencing.operation.MathTransform;
|
||||||
import org.geotools.geometry.jts.JTS;
|
import org.geotools.geometry.jts.JTS;
|
||||||
import org.geotools.geometry.jts.WKBReader;
|
import org.geotools.geometry.jts.WKBReader;
|
||||||
import org.geotools.referencing.CRS;
|
import org.geotools.referencing.CRS;
|
||||||
import org.locationtech.jts.geom.Geometry;
|
import org.locationtech.jts.geom.Geometry;
|
||||||
import org.opengis.referencing.FactoryException;
|
|
||||||
import org.opengis.referencing.operation.MathTransform;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,19 @@ import java.nio.file.Path;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import org.geotools.data.FeatureSource;
|
import org.geotools.api.data.FeatureSource;
|
||||||
|
import org.geotools.api.feature.simple.SimpleFeatureType;
|
||||||
|
import org.geotools.api.filter.Filter;
|
||||||
|
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.OperationNotFoundException;
|
||||||
|
import org.geotools.api.referencing.operation.TransformException;
|
||||||
import org.geotools.data.shapefile.ShapefileDataStore;
|
import org.geotools.data.shapefile.ShapefileDataStore;
|
||||||
import org.geotools.feature.FeatureCollection;
|
import org.geotools.feature.FeatureCollection;
|
||||||
import org.geotools.geometry.jts.JTS;
|
import org.geotools.geometry.jts.JTS;
|
||||||
import org.geotools.referencing.CRS;
|
import org.geotools.referencing.CRS;
|
||||||
import org.locationtech.jts.geom.Geometry;
|
import org.locationtech.jts.geom.Geometry;
|
||||||
import org.opengis.feature.simple.SimpleFeatureType;
|
|
||||||
import org.opengis.filter.Filter;
|
|
||||||
import org.opengis.referencing.FactoryException;
|
|
||||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
|
||||||
import org.opengis.referencing.operation.MathTransform;
|
|
||||||
import org.opengis.referencing.operation.OperationNotFoundException;
|
|
||||||
import org.opengis.referencing.operation.TransformException;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class ShapefileReader extends SimpleReader<SimpleFeature> {
|
public class ShapefileReader extends SimpleReader<SimpleFeature> {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ShapefileReader.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ShapefileReader.class);
|
||||||
|
|
||||||
private final FeatureCollection<SimpleFeatureType, org.opengis.feature.simple.SimpleFeature> inputSource;
|
private final FeatureCollection<SimpleFeatureType, org.geotools.api.feature.simple.SimpleFeature> inputSource;
|
||||||
private final String[] attributeNames;
|
private final String[] attributeNames;
|
||||||
private final ShapefileDataStore dataStore;
|
private final ShapefileDataStore dataStore;
|
||||||
private final String layer;
|
private final String layer;
|
||||||
|
@ -50,7 +50,7 @@ public class ShapefileReader extends SimpleReader<SimpleFeature> {
|
||||||
dataStore = open(input);
|
dataStore = open(input);
|
||||||
try {
|
try {
|
||||||
String typeName = dataStore.getTypeNames()[0];
|
String typeName = dataStore.getTypeNames()[0];
|
||||||
FeatureSource<SimpleFeatureType, org.opengis.feature.simple.SimpleFeature> source = dataStore
|
FeatureSource<SimpleFeatureType, org.geotools.api.feature.simple.SimpleFeature> source = dataStore
|
||||||
.getFeatureSource(typeName);
|
.getFeatureSource(typeName);
|
||||||
|
|
||||||
inputSource = source.getFeatures(Filter.INCLUDE);
|
inputSource = source.getFeatures(Filter.INCLUDE);
|
||||||
|
@ -130,7 +130,7 @@ public class ShapefileReader extends SimpleReader<SimpleFeature> {
|
||||||
long id = 0;
|
long id = 0;
|
||||||
try (var iter = inputSource.features()) {
|
try (var iter = inputSource.features()) {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
org.opengis.feature.simple.SimpleFeature feature = iter.next();
|
org.geotools.api.feature.simple.SimpleFeature feature = iter.next();
|
||||||
Geometry source = (Geometry) feature.getDefaultGeometry();
|
Geometry source = (Geometry) feature.getDefaultGeometry();
|
||||||
Geometry latLonGeometry = source;
|
Geometry latLonGeometry = source;
|
||||||
if (transformToLatLon != null) {
|
if (transformToLatLon != null) {
|
||||||
|
|
|
@ -14,10 +14,12 @@ import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.geotools.api.data.SimpleFeatureStore;
|
||||||
|
import org.geotools.api.referencing.FactoryException;
|
||||||
|
import org.geotools.api.referencing.operation.TransformException;
|
||||||
import org.geotools.data.DefaultTransaction;
|
import org.geotools.data.DefaultTransaction;
|
||||||
import org.geotools.data.shapefile.ShapefileDataStore;
|
import org.geotools.data.shapefile.ShapefileDataStore;
|
||||||
import org.geotools.data.shapefile.ShapefileDataStoreFactory;
|
import org.geotools.data.shapefile.ShapefileDataStoreFactory;
|
||||||
import org.geotools.data.simple.SimpleFeatureStore;
|
|
||||||
import org.geotools.feature.DefaultFeatureCollection;
|
import org.geotools.feature.DefaultFeatureCollection;
|
||||||
import org.geotools.feature.simple.SimpleFeatureBuilder;
|
import org.geotools.feature.simple.SimpleFeatureBuilder;
|
||||||
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
|
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
|
||||||
|
@ -29,8 +31,6 @@ import org.junit.jupiter.api.condition.OS;
|
||||||
import org.junit.jupiter.api.io.TempDir;
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
import org.locationtech.jts.geom.Geometry;
|
import org.locationtech.jts.geom.Geometry;
|
||||||
import org.locationtech.jts.geom.Point;
|
import org.locationtech.jts.geom.Point;
|
||||||
import org.opengis.referencing.FactoryException;
|
|
||||||
import org.opengis.referencing.operation.TransformException;
|
|
||||||
|
|
||||||
class ShapefileReaderTest {
|
class ShapefileReaderTest {
|
||||||
@TempDir
|
@TempDir
|
||||||
|
|
Ładowanie…
Reference in New Issue