Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

update Geotools and Java, fix warnings #18

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .classpath

This file was deleted.

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ build


.idea/

.project
.classpath
.settings/

/web/
17 changes: 0 additions & 17 deletions .project

This file was deleted.

11 changes: 0 additions & 11 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ plugins {

group = 'com.github.wetransform-os'

sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
maven {
Expand All @@ -16,18 +19,22 @@ 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
implementation 'com.google.code.gson:gson:2.11.0' // Apache 2.0
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'
Expand Down
1 change: 1 addition & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example.csv
Binary file removed data/example.csv
Binary file not shown.
2 changes: 1 addition & 1 deletion src/json/converter/csv/builder/ColumnBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand Down
4 changes: 2 additions & 2 deletions src/json/converter/shp/ShpFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -303,7 +303,7 @@ public void readRecord(){
}
}

_groupRecord._shapes.put(new Integer(aRecordNumber), aFeature);
_groupRecord._shapes.put(Integer.valueOf(aRecordNumber), aFeature);

} else {

Expand Down
8 changes: 4 additions & 4 deletions src/json/geojson/FeatureCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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));

}

Expand Down
2 changes: 1 addition & 1 deletion src/json/geojson/objects/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/json/geojson/objects/Polygon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/json/graphic/JenksColorifierGeojson.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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;i<Colors.length; i++) {
if ((_ranges[i]<=value) && (_ranges[i+1]>value)){
Expand Down
4 changes: 2 additions & 2 deletions src/json/tools/Toolbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion src/json/topojson/api/TopojsonApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/json/topojson/topology/Topology.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public void setArcs(ArcMap iArcMap){

for (int i=0; i<aArc._points.length; i++){
arcs[na][i] = new java.lang.Object[2];
arcs[na][i][0] = new Double( aArc._points[i]._x );
arcs[na][i][1] = new Double( aArc._points[i]._y );
arcs[na][i][0] = Double.valueOf( aArc._points[i]._x );
arcs[na][i][1] = Double.valueOf( aArc._points[i]._y );
}

na++;
Expand Down Expand Up @@ -180,8 +180,8 @@ public void quantize(double iPowTen){
double scale = Math.pow(10, iPowTen);
for (java.lang.Object[][] arc:arcs){
for (java.lang.Object[] position:arc){
position[0] = new Integer((int) (((Double) position[0] - aX)*scale));
position[1] = new Integer((int) (((Double) position[1] - aY)*scale));
position[0] = Integer.valueOf((int) (((Double) position[0] - aX)*scale));
position[1] = Integer.valueOf((int) (((Double) position[1] - aY)*scale));
n++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion unittest/TilesExplosion.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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 TilesExplosion {
Expand Down
2 changes: 1 addition & 1 deletion unittest/TilesTesting.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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 TilesTesting implements DisplayListener {
Expand Down
4 changes: 2 additions & 2 deletions unittest/graphics/CensusColorifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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
}
Expand Down Expand Up @@ -98,7 +98,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;i<Colors.length; i++) {
if ((_ranges[i]<=value) && (_ranges[i+1]>value)){
Expand Down
2 changes: 1 addition & 1 deletion unittest/testAssociation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion unittest/testFillPolygon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion unittest/testTopojson.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading