Loading pom.xml +11 −4 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <version>2.1.0.RELEASE</version> <relativePath /> </parent> Loading @@ -14,7 +14,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>utils</artifactId> <packaging>jar</packaging> <version>0.6.0</version> <version>0.7.0</version> <name>Utils</name> <description>Server utils library</description> Loading @@ -26,14 +26,15 @@ <java.version>1.8</java.version> <!-- REDMIC --> <redmic.models.version>0.6.0</redmic.models.version> <redmic.jts4jackson.version>0.0.1</redmic.jts4jackson.version> <redmic.models.version>0.7.0</redmic.models.version> <redmic.exceptions.version>0.6.0</redmic.exceptions.version> <redmic.sitemapgen4j.version>0.6.0</redmic.sitemapgen4j.version> <!-- OTHERS --> <language-detector.version>0.5</language-detector.version> <super-csv.version>2.4.0</super-csv.version> <geotools.version>19.0</geotools.version> <geotools.version>20.1</geotools.version> <commons-io.version>2.6</commons-io.version> <powermock.version>1.7.3</powermock.version> Loading @@ -49,6 +50,12 @@ <!-- Redmic --> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>jts4jackson</artifactId> <version>${redmic.jts4jackson.version}</version> </dependency> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>models</artifactId> Loading src/main/java/es/redmic/utils/geo/convert/GeoUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -11,12 +11,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.bedatadriven.jackson.datatype.jts.JtsModule; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import es.redmic.exception.mediastorage.MSFileNotFoundException; import es.redmic.exception.utils.ProcessErrorException; import es.redmic.jts4jackson.module.JTSModule; import es.redmic.models.es.geojson.common.dto.GeoJSONFeatureCollectionDTO; @Component Loading @@ -25,7 +25,7 @@ public class GeoUtils { FeatureJSON fjson = new FeatureJSON(); ObjectMapper jacksonMapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .registerModule(new JtsModule()); .registerModule(new JTSModule()); private final Logger LOGGER = LoggerFactory.getLogger(GeoUtils.class); Loading src/main/java/es/redmic/utils/geo/performance/Simplify.java +9 −10 Original line number Diff line number Diff line package es.redmic.utils.geo.performance; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.simplify.TopologyPreservingSimplifier; public class Simplify { Loading src/test/java/es/redmic/test/utils/geo/performance/SimplifyTest.java +17 −17 Original line number Diff line number Diff line Loading @@ -7,21 +7,20 @@ import java.io.InputStream; import org.junit.Before; import org.junit.Test; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import com.bedatadriven.jackson.datatype.jts.JtsModule; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.LineString; import es.redmic.jts4jackson.module.JTSModule; import es.redmic.models.es.geojson.common.model.Feature; import es.redmic.models.es.geojson.common.model.Properties; import es.redmic.utils.geo.performance.Simplify; public class SimplifyTest { private static final String FILENAME_LINESTRING_GEOJSON = "LineString_to_simplify.json"; Loading @@ -31,11 +30,12 @@ public class SimplifyTest { @Before public void init() throws IllegalArgumentException, IllegalAccessException, IOException { objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); objectMapper.registerModule(new JtsModule()); objectMapper.registerModule(new JTSModule()); InputStream file = getClass().getResource("/data/geo/geojson/" + FILENAME_LINESTRING_GEOJSON).openStream(); TypeReference<Feature<Properties, LineString>> typeRef = new TypeReference<Feature<Properties, LineString>>() {}; TypeReference<Feature<Properties, LineString>> typeRef = new TypeReference<Feature<Properties, LineString>>() { }; geojson = objectMapper.readValue(file, typeRef); } Loading Loading
pom.xml +11 −4 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <version>2.1.0.RELEASE</version> <relativePath /> </parent> Loading @@ -14,7 +14,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>utils</artifactId> <packaging>jar</packaging> <version>0.6.0</version> <version>0.7.0</version> <name>Utils</name> <description>Server utils library</description> Loading @@ -26,14 +26,15 @@ <java.version>1.8</java.version> <!-- REDMIC --> <redmic.models.version>0.6.0</redmic.models.version> <redmic.jts4jackson.version>0.0.1</redmic.jts4jackson.version> <redmic.models.version>0.7.0</redmic.models.version> <redmic.exceptions.version>0.6.0</redmic.exceptions.version> <redmic.sitemapgen4j.version>0.6.0</redmic.sitemapgen4j.version> <!-- OTHERS --> <language-detector.version>0.5</language-detector.version> <super-csv.version>2.4.0</super-csv.version> <geotools.version>19.0</geotools.version> <geotools.version>20.1</geotools.version> <commons-io.version>2.6</commons-io.version> <powermock.version>1.7.3</powermock.version> Loading @@ -49,6 +50,12 @@ <!-- Redmic --> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>jts4jackson</artifactId> <version>${redmic.jts4jackson.version}</version> </dependency> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>models</artifactId> Loading
src/main/java/es/redmic/utils/geo/convert/GeoUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -11,12 +11,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.bedatadriven.jackson.datatype.jts.JtsModule; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import es.redmic.exception.mediastorage.MSFileNotFoundException; import es.redmic.exception.utils.ProcessErrorException; import es.redmic.jts4jackson.module.JTSModule; import es.redmic.models.es.geojson.common.dto.GeoJSONFeatureCollectionDTO; @Component Loading @@ -25,7 +25,7 @@ public class GeoUtils { FeatureJSON fjson = new FeatureJSON(); ObjectMapper jacksonMapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .registerModule(new JtsModule()); .registerModule(new JTSModule()); private final Logger LOGGER = LoggerFactory.getLogger(GeoUtils.class); Loading
src/main/java/es/redmic/utils/geo/performance/Simplify.java +9 −10 Original line number Diff line number Diff line package es.redmic.utils.geo.performance; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.simplify.TopologyPreservingSimplifier; public class Simplify { Loading
src/test/java/es/redmic/test/utils/geo/performance/SimplifyTest.java +17 −17 Original line number Diff line number Diff line Loading @@ -7,21 +7,20 @@ import java.io.InputStream; import org.junit.Before; import org.junit.Test; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import com.bedatadriven.jackson.datatype.jts.JtsModule; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.LineString; import es.redmic.jts4jackson.module.JTSModule; import es.redmic.models.es.geojson.common.model.Feature; import es.redmic.models.es.geojson.common.model.Properties; import es.redmic.utils.geo.performance.Simplify; public class SimplifyTest { private static final String FILENAME_LINESTRING_GEOJSON = "LineString_to_simplify.json"; Loading @@ -31,11 +30,12 @@ public class SimplifyTest { @Before public void init() throws IllegalArgumentException, IllegalAccessException, IOException { objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); objectMapper.registerModule(new JtsModule()); objectMapper.registerModule(new JTSModule()); InputStream file = getClass().getResource("/data/geo/geojson/" + FILENAME_LINESTRING_GEOJSON).openStream(); TypeReference<Feature<Properties, LineString>> typeRef = new TypeReference<Feature<Properties, LineString>>() {}; TypeReference<Feature<Properties, LineString>> typeRef = new TypeReference<Feature<Properties, LineString>>() { }; geojson = objectMapper.readValue(file, typeRef); } Loading