diff --git a/.classpath b/.classpath deleted file mode 100644 index a51ea40..0000000 --- a/.classpath +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index 3c364ce..167364b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,9 @@ build .idea/ + +.project +.classpath +.settings/ + +/web/ diff --git a/.project b/.project deleted file mode 100644 index fb0873a..0000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - topojson-java - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8000cd6..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/build.gradle b/build.gradle index 4b89b7c..b5b8b91 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,11 @@ plugins { group = 'com.github.wetransform-os' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} repositories { maven { @@ -16,6 +19,10 @@ repositories { mavenCentral() } +ext { + geotoolsVersion = '32.1' +} + dependencies { implementation 'org.lz4:lz4-java:1.8.0' // Apache 2.0 implementation 'com.github.albfernandez:javadbf:1.14.1' // LGPL 3.0 @@ -23,11 +30,11 @@ dependencies { implementation 'org.apache.commons:commons-lang3:3.17.0' // Apache 2.0 // GeoTools (LGPL 2.1) - implementation 'org.geotools:gt-main:29.6' - implementation 'org.geotools:gt-epsg-hsql:29.6' - implementation 'org.geotools:gt-opengis:29.6' -// implementation 'org.geotools:gt-geometry:24.2' - implementation 'org.geotools:gt-referencing:29.6' + implementation "org.geotools:gt-main:${geotoolsVersion}" + implementation "org.geotools:gt-epsg-hsql:${geotoolsVersion}" + implementation "org.geotools:gt-api:${geotoolsVersion}" +// implementation "org.geotools:gt-geometry:${geotoolsVersion}" + implementation "org.geotools:gt-referencing:${geotoolsVersion}" implementation 'javax.xml.bind:jaxb-api:2.3.1' implementation 'com.sun.xml.bind:jaxb-core:2.3.0.1' diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..6e618ca --- /dev/null +++ b/data/.gitignore @@ -0,0 +1 @@ +example.csv \ No newline at end of file diff --git a/data/example.csv b/data/example.csv deleted file mode 100644 index 73b557e..0000000 Binary files a/data/example.csv and /dev/null differ diff --git a/src/json/converter/csv/builder/ColumnBuilder.java b/src/json/converter/csv/builder/ColumnBuilder.java index 5a25668..65a56a4 100644 --- a/src/json/converter/csv/builder/ColumnBuilder.java +++ b/src/json/converter/csv/builder/ColumnBuilder.java @@ -35,7 +35,7 @@ public String format(String[] iRow){ String aVal = iRow[_key]; switch (_type) { - case INTEGER: return String.format(_format,new Integer(aVal.equals("")?"0":aVal)); + case INTEGER: return String.format(_format,Integer.valueOf(aVal.equals("")?"0":aVal)); case STRING: return String.format(_format,aVal); } return ""; diff --git a/src/json/converter/shp/ShpFileReader.java b/src/json/converter/shp/ShpFileReader.java index 5c5ff88..d71e8b6 100644 --- a/src/json/converter/shp/ShpFileReader.java +++ b/src/json/converter/shp/ShpFileReader.java @@ -8,7 +8,7 @@ import java.io.IOException; import java.util.regex.Pattern; -import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.geotools.api.referencing.crs.CoordinateReferenceSystem; import json.converter.csv.CSVReader; import json.converter.csv.merger.Merger; @@ -303,7 +303,7 @@ public void readRecord(){ } } - _groupRecord._shapes.put(new Integer(aRecordNumber), aFeature); + _groupRecord._shapes.put(Integer.valueOf(aRecordNumber), aFeature); } else { diff --git a/src/json/geojson/FeatureCollection.java b/src/json/geojson/FeatureCollection.java index dbe42df..e8f1fed 100644 --- a/src/json/geojson/FeatureCollection.java +++ b/src/json/geojson/FeatureCollection.java @@ -103,8 +103,8 @@ public FeatureCollection processTileElement(TileElement iTileE){ } } - aGroupRecord._meta_properties.put("x", new Integer(iTileE.x)); - aGroupRecord._meta_properties.put("y", new Integer(iTileE.y)); + aGroupRecord._meta_properties.put("x", Integer.valueOf(iTileE.x)); + aGroupRecord._meta_properties.put("y", Integer.valueOf(iTileE.y)); return aGroupRecord; @@ -253,8 +253,8 @@ public FeatureCollection[][] groupGridDivide(int iZoom/*int iN, int iM*/){ } aDividedResult[i][j] = aGroupRecord; - aGroupRecord._meta_properties.put("x", new Integer(x)); - aGroupRecord._meta_properties.put("y", new Integer(y)); + aGroupRecord._meta_properties.put("x", Integer.valueOf(x)); + aGroupRecord._meta_properties.put("y", Integer.valueOf(y)); } diff --git a/src/json/geojson/objects/Point.java b/src/json/geojson/objects/Point.java index a0c895b..2b831ad 100644 --- a/src/json/geojson/objects/Point.java +++ b/src/json/geojson/objects/Point.java @@ -5,7 +5,7 @@ import java.io.DataInputStream; import java.io.IOException; -import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.geotools.api.referencing.crs.CoordinateReferenceSystem; import json.graphic.Colorifier; import json.graphic.Display; diff --git a/src/json/geojson/objects/Polygon.java b/src/json/geojson/objects/Polygon.java index e9d979a..0bfe321 100644 --- a/src/json/geojson/objects/Polygon.java +++ b/src/json/geojson/objects/Polygon.java @@ -8,7 +8,7 @@ import java.util.Vector; import org.apache.commons.lang3.ArrayUtils; -import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.geotools.api.referencing.crs.CoordinateReferenceSystem; import json.algorithm.DouglasPeucker; import json.graphic.Colorifier; diff --git a/src/json/graphic/JenksColorifierGeojson.java b/src/json/graphic/JenksColorifierGeojson.java index 7d9327f..9b07653 100644 --- a/src/json/graphic/JenksColorifierGeojson.java +++ b/src/json/graphic/JenksColorifierGeojson.java @@ -43,7 +43,7 @@ public void init(){ if (toconvert!=null) { try { - aArrayProp.add(new Double((String) toconvert)); + aArrayProp.add(Double.valueOf((String) toconvert)); } catch (java.lang.NumberFormatException e){ // Unable to decode this string } @@ -83,7 +83,7 @@ public Color getColor(java.lang.Object properties) { try { - double value = new Double((String) aProp.get(_param)); + double value = Double.valueOf((String) aProp.get(_param)); for (int i=0;ivalue)){ diff --git a/src/json/tools/Toolbox.java b/src/json/tools/Toolbox.java index 63f6f34..418f726 100644 --- a/src/json/tools/Toolbox.java +++ b/src/json/tools/Toolbox.java @@ -13,8 +13,8 @@ import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.Point; -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; public class Toolbox { diff --git a/src/json/topojson/api/TopojsonApi.java b/src/json/topojson/api/TopojsonApi.java index 6dfa998..a6cf55c 100644 --- a/src/json/topojson/api/TopojsonApi.java +++ b/src/json/topojson/api/TopojsonApi.java @@ -13,7 +13,7 @@ import net.jpountz.lz4.LZ4Compressor; import net.jpountz.lz4.LZ4Factory; -import org.opengis.referencing.crs.CoordinateReferenceSystem; +import org.geotools.api.referencing.crs.CoordinateReferenceSystem; import json.converter.csv.merger.Merger; import json.converter.shp.ShpFileReader; diff --git a/src/json/topojson/topology/Topology.java b/src/json/topojson/topology/Topology.java index 16aca59..c0fb44e 100644 --- a/src/json/topojson/topology/Topology.java +++ b/src/json/topojson/topology/Topology.java @@ -105,8 +105,8 @@ public void setArcs(ArcMap iArcMap){ for (int i=0; ivalue)){ diff --git a/unittest/testAssociation.java b/unittest/testAssociation.java index 6f8b16b..3748b52 100644 --- a/unittest/testAssociation.java +++ b/unittest/testAssociation.java @@ -14,7 +14,7 @@ import json.topojson.api.TopojsonApi; import json.topojson.topology.Topology; import org.geotools.referencing.CRS; -import org.opengis.referencing.FactoryException; +import org.geotools.api.referencing.FactoryException; public class testAssociation { diff --git a/unittest/testFillPolygon.java b/unittest/testFillPolygon.java index a09a547..59fe303 100644 --- a/unittest/testFillPolygon.java +++ b/unittest/testFillPolygon.java @@ -11,7 +11,7 @@ import json.topojson.api.TopojsonApi; import json.topojson.topology.Topology; import org.geotools.referencing.CRS; -import org.opengis.referencing.FactoryException; +import org.geotools.api.referencing.FactoryException; public class testFillPolygon { diff --git a/unittest/testTopojson.java b/unittest/testTopojson.java index 1f88742..4d7635f 100644 --- a/unittest/testTopojson.java +++ b/unittest/testTopojson.java @@ -24,7 +24,7 @@ import org.junit.Test; import com.google.gson.Gson; -import org.opengis.referencing.FactoryException; +import org.geotools.api.referencing.FactoryException; @Ignore("Not working because reference systems cannot be resolved")