From 894bfa90e569b11709cba4385084919135619590 Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 16:22:04 +0200 Subject: [PATCH 01/26] Add new functions to play with Overpass api --- docs/CHANGELOG.md | 5 + .../functions/factory/H2GISFunctions.java | 8 +- .../io/geojson/GJGeometryReader.java | 84 +++++-- .../functions/io/geojson/GeoJsonField.java | 46 ++-- .../io/geojson/GeoJsonReaderDriver.java | 17 +- .../functions/io/overpass/OverpassTool.java | 208 ++++++++++++++++++ .../io/overpass/ST_AsOverpassBbox.java | 60 +++++ .../io/overpass/ST_OverpassDownloader.java | 90 ++++++++ .../spatial/others/ST_EnvelopeAsText.java | 59 +++++ .../io/geojson/GeojsonImportExportTest.java | 98 +++++++++ .../io/overpass/OverpassFunctionsTest.java | 159 +++++++++++++ .../spatial/crs/CRSFunctionTest.java | 14 +- 12 files changed, 791 insertions(+), 57 deletions(-) create mode 100644 h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java create mode 100644 h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java create mode 100644 h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_OverpassDownloader.java create mode 100644 h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java create mode 100644 h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 560999b6cb..01a1f40866 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1 +1,6 @@ ## Changelog for v2.2.4 + +- Add ST_EnvelopeAsText function +- Add ST_AsOverpassBbox function +- Add ST_OverpassDownloader function +- Fix bug when read GeometryCollection with the ST_GeomFromGeoJSON function diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java index a46c4eef69..f2d001a427 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java @@ -40,6 +40,9 @@ import org.h2gis.functions.io.kml.ST_AsKml; import org.h2gis.functions.io.osm.OSMRead; import org.h2gis.functions.io.osm.ST_OSMDownloader; +import org.h2gis.functions.io.overpass.ST_AsOverpassBbox; +import org.h2gis.functions.spatial.others.ST_EnvelopeAsText; +import org.h2gis.functions.io.overpass.ST_OverpassDownloader; import org.h2gis.functions.io.shp.SHPRead; import org.h2gis.functions.io.shp.SHPWrite; import org.h2gis.functions.io.tsv.TSVRead; @@ -347,7 +350,10 @@ public static Function[] getBuiltInsFunctions() { new ST_CoveredBy(), new ST_CoverageUnion(), new FGBRead(), - new FGBWrite() + new FGBWrite(), + new ST_OverpassDownloader(), + new ST_EnvelopeAsText(), + new ST_AsOverpassBbox() }; } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java index c3025ec86c..6484bfcc5a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java @@ -36,7 +36,8 @@ */ public class GJGeometryReader { private final GeometryFactory GF; - + + private String geomType; public GJGeometryReader(GeometryFactory GF) { this.GF=GF; } @@ -76,6 +77,37 @@ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLExcept throw new SQLException("Unsupported geometry : " + geomType); } } + + /** + * Parses a GeoJSON geometry and returns its JTS representation. + * + * Syntax: + * + * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} + * + * @param jp + * @throws IOException + * @return Geometry + */ + private Geometry parseGeometry(JsonParser jp, String geometryType) throws IOException, SQLException { + if (geometryType.equalsIgnoreCase(GeoJsonField.POINT)) { + return parsePoint(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.MULTIPOINT)) { + return parseMultiPoint(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.LINESTRING)) { + return parseLinestring(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.MULTILINESTRING)) { + return parseMultiLinestring(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.POLYGON)) { + return parsePolygon(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.MULTIPOLYGON)) { + return parseMultiPolygon(jp); + } else if (geometryType.equalsIgnoreCase(GeoJsonField.GEOMETRYCOLLECTION)) { + return parseGeometryCollection(jp); + } else { + throw new SQLException("Unsupported geometry : " + geometryType); + } + } /** * Parses one position @@ -88,13 +120,12 @@ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLExcept * @throws IOException * @return Point */ - private Point parsePoint(JsonParser jp) throws IOException, SQLException { + public Point parsePoint(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { jp.nextToken(); // START_ARRAY [ to parse the coordinate Point point = GF.createPoint(parseCoordinate(jp)); - jp.nextToken(); return point; } else { throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'"); @@ -112,14 +143,12 @@ private Point parsePoint(JsonParser jp) throws IOException, SQLException { * @throws IOException * @return MultiPoint */ - private MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException { + public MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { jp.nextToken(); // START_ARRAY [ coordinates - MultiPoint mPoint = GF.createMultiPoint(parseCoordinates(jp)); - jp.nextToken();//END_OBJECT } geometry - return mPoint; + return GF.createMultiPoint(parseCoordinates(jp)); } else { throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'"); } @@ -135,7 +164,7 @@ private MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLExcepti * * @param jsParser */ - private LineString parseLinestring(JsonParser jp) throws IOException, SQLException { + public LineString parseLinestring(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { @@ -157,7 +186,7 @@ private LineString parseLinestring(JsonParser jp) throws IOException, SQLExcepti * @param jsParser * @return MultiLineString */ - private MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException { + public MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { @@ -200,7 +229,7 @@ private MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, * @param jp * @return Polygon */ - private Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { + public Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { @@ -243,7 +272,7 @@ private Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { * @throws SQLException * @return MultiPolygon */ - private MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLException { + public MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { @@ -295,22 +324,26 @@ private MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLExc * @throws SQLException * @return GeometryCollection */ - private GeometryCollection parseGeometryCollection(JsonParser jp) throws IOException, SQLException { + public GeometryCollection parseGeometryCollection(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME geometries - String coordinatesField = jp.getText(); - if (coordinatesField.equalsIgnoreCase(GeoJsonField.GEOMETRIES)) { + String geometriesField = jp.getText(); + if (geometriesField.equalsIgnoreCase(GeoJsonField.GEOMETRIES)) { jp.nextToken();//START array - //jp.nextToken();//START object - ArrayList geometries = new ArrayList(); + jp.nextToken();//START object + ArrayList geometries = new ArrayList<>(); while (jp.getCurrentToken() != JsonToken.END_ARRAY) { - geometries.add(parseGeometry(jp)); + jp.nextToken(); // FIELD_NAME type + jp.nextToken(); //VALUE_STRING Point + String geometryType = jp.getText(); + geometries.add(parseGeometry(jp, geometryType)); + jp.nextToken(); + } jp.nextToken();//END_OBJECT } geometry return GF.createGeometryCollection(geometries.toArray(new Geometry[0])); } else { - throw new SQLException("Malformed GeoJSON file. Expected 'geometries', found '" + coordinatesField + "'"); + throw new SQLException("Malformed GeoJSON file. Expected 'geometries', found '" + geometriesField + "'"); } - } /** @@ -323,7 +356,7 @@ private GeometryCollection parseGeometryCollection(JsonParser jp) throws IOExcep * @throws SQLException * @return Coordinate[] */ - private Coordinate[] parseCoordinates(JsonParser jp) throws IOException { + public Coordinate[] parseCoordinates(JsonParser jp) throws IOException { jp.nextToken(); // START_ARRAY [ to parse the each positions ArrayList coords = new ArrayList(); while (jp.getCurrentToken() != JsonToken.END_ARRAY) { @@ -345,7 +378,7 @@ private Coordinate[] parseCoordinates(JsonParser jp) throws IOException { * @throws IOException * @return Coordinate */ - private Coordinate parseCoordinate(JsonParser jp) throws IOException { + public Coordinate parseCoordinate(JsonParser jp) throws IOException { jp.nextToken(); double x = jp.getDoubleValue();// VALUE_NUMBER_FLOAT jp.nextToken(); // second value @@ -363,5 +396,12 @@ private Coordinate parseCoordinate(JsonParser jp) throws IOException { jp.nextToken(); return coord; } - + + /** + * + * @return + */ + public String getGeomType() { + return geomType; + } } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonField.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonField.java index e5923a5fce..620a0d8932 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonField.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonField.java @@ -26,14 +26,14 @@ * @author Hai Trung Pham */ public class GeoJsonField { - - static String NAME="name"; - static String CRS ="crs"; // 2008 - static String FEATURES="features"; - static String FEATURECOLLECTION="featurecollection"; - static String FEATURE="feature"; - static String GEOMETRY="geometry"; - static String PROPERTIES="properties"; + + public static String NAME="name"; + public static String CRS ="crs"; // 2008 + public static String FEATURES="features"; + public static String FEATURECOLLECTION="featurecollection"; + public static String FEATURE="feature"; + public static String GEOMETRY="geometry"; + public static String PROPERTIES="properties"; /** * If a Feature has a commonly used identifier, that identifier @@ -41,20 +41,20 @@ public class GeoJsonField { * "id", and the value of this member is either a JSON string or * number. */ - static String FEATURE_ID="id"; - static String POINT="point"; - static String LINESTRING="linestring"; - static String POLYGON="polygon"; - static String MULTIPOINT="multipoint"; - static String MULTILINESTRING="multilinestring"; - static String MULTIPOLYGON="multipolygon"; - static String COORDINATES="coordinates"; - static String GEOMETRYCOLLECTION="geometrycollection"; - static String GEOMETRIES="geometries"; - static String CRS_URN_EPSG="urn:ogc:def:crs:epsg::"; // 2008 - static String CRS_URN_OGC="urn:ogc:def:crs:ogc:1.3:CRS84"; // 2008 - static String LINK="link"; // 2008 - static String BBOX="bbox"; - static String TYPE="type"; + static public String FEATURE_ID="id"; + static public String POINT="point"; + static public String LINESTRING="linestring"; + static public String POLYGON="polygon"; + static public String MULTIPOINT="multipoint"; + static public String MULTILINESTRING="multilinestring"; + static public String MULTIPOLYGON="multipolygon"; + static public String COORDINATES="coordinates"; + static public String GEOMETRYCOLLECTION="geometrycollection"; + static public String GEOMETRIES="geometries"; + static public String CRS_URN_EPSG="urn:ogc:def:crs:epsg::"; // 2008 + static public String CRS_URN_OGC="urn:ogc:def:crs:ogc:1.3:CRS84"; // 2008 + static public String LINK="link"; // 2008 + static public String BBOX="bbox"; + static public String TYPE="type"; } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index 9ebc550ad0..48d5a2408e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -23,12 +23,9 @@ import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; -import org.h2.util.geometry.EWKTUtils; import org.h2.util.geometry.JTSUtils; -import org.h2.value.ValueGeometry; import org.h2gis.api.EmptyProgressVisitor; import org.h2gis.api.ProgressVisitor; -import org.h2gis.functions.spatial.convert.ST_GeomFromWKB; import org.h2gis.utilities.JDBCUtilities; import org.h2gis.utilities.TableLocation; import org.h2gis.utilities.dbtypes.DBTypes; @@ -112,7 +109,7 @@ public String read(ProgressVisitor progress, String tableReference) throws SQLEx String fileNameLower = fileName.getName().toLowerCase(); if (fileName != null && (fileNameLower.endsWith(".geojson") || fileNameLower.endsWith(".json"))) { if (!fileName.exists()) { - throw new SQLException("The file " + tableLocation + " doesn't exist "); + throw new SQLException("The file " + fileName + " doesn't exist "); } this.dbType = DBUtils.getDBType(connection); this.tableLocation = TableLocation.parse(tableReference, dbType).toString(); @@ -1016,20 +1013,20 @@ private void parseFeatures(JsonParser jp) throws IOException, SQLException { preparedStatement.clearBatch(); batchSize = 0; } - token = jp.nextToken(); //START_OBJECT new feature featureCounter++; progress.setStep((featureCounter / nbFeature) * 100); - if (batchSize > 0) { - preparedStatement.executeBatch(); - connection.commit(); - preparedStatement.clearBatch(); - } + } else { connection.setAutoCommit(true); throw new SQLException("Malformed GeoJSON file. Expected 'Feature', found '" + geomType + "'"); } } + if (batchSize > 0) { + preparedStatement.executeBatch(); + connection.commit(); + preparedStatement.clearBatch(); + } connection.setAutoCommit(true); //LOOP END_ARRAY ] log.debug(featureCounter-1 + " geojson features have been imported."); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java new file mode 100644 index 0000000000..4808ab5d8f --- /dev/null +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java @@ -0,0 +1,208 @@ +/** + * H2GIS is a library that brings spatial support to the H2 Database Engine + * http://www.h2database.com. H2GIS is developed by CNRS + * http://www.cnrs.fr/. + *

+ * This code is part of the H2GIS project. H2GIS is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * Lesser General Public License as published by the Free Software Foundation; + * version 3.0 of the License. + *

+ * H2GIS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details . + *

+ *

+ * For more information, please consult: http://www.h2gis.org/ + * or contact directly: info_at_h2gis.org + */ + +package org.h2gis.functions.io.overpass; + + +import org.apache.commons.lang3.StringUtils; +import org.h2gis.utilities.URIUtilities; + +import java.io.*; +import java.net.*; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Class to extract overpass data into a file + * @author E Bocher, CNRS + */ +public class OverpassTool { + + /** Overpass server endpoint as defined by WSDL2 definition */ + private String endPoint = "https://overpass-api.de/api/interpreter?data="; + + private String proxyHost; + private int proxyPort; + + public OverpassTool() { + } + + /** + * Prepare the connection to the overpass endpoint + * + * @param overpassQuery + * @return + * @throws Exception + */ + public HttpURLConnection prepareConnection(String overpassQuery) throws Exception { + Matcher timeoutMatcher = Pattern.compile("\\[timeout:(\\d+)\\]").matcher(overpassQuery); + int timeout; + if (timeoutMatcher.find()) { + timeout = (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(timeoutMatcher.group(1))); + } else { + timeout = (int) TimeUnit.MINUTES.toMillis(3); + } + URL queryUrl = new URL(getEndpoint() + URLEncoder.encode(overpassQuery, StandardCharsets.UTF_8)); + HttpURLConnection connection; + if (getProxyHost() != null) { + Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)); + connection = (HttpURLConnection) queryUrl.openConnection(proxy); + } else { + connection = (HttpURLConnection) queryUrl.openConnection(); + } + connection.setRequestProperty("User-Agent", "H2GIS_" + System.currentTimeMillis()); + connection.setConnectTimeout(timeout); + connection.setReadTimeout(timeout); + return connection; + } + + /** + * Download the result of the query in a file + * + * @param overpassQuery the overpass QL + * @return a stream connection + * @throws Exception if the server cannot execute the query + */ + public InputStream downloadAsStream(String overpassQuery) throws Exception { + if (overpassQuery == null || overpassQuery.isEmpty()) { + throw new IllegalArgumentException("The overpass query cannot be null or empty"); + } + HttpURLConnection connection = prepareConnection("[out:json][timeout:25];\n" + overpassQuery + "\nout geom;"); + connection.connect(); + switch (connection.getResponseCode()) { + case 400: + throw new IOException("Error : Cannot execute the Overpass query " + connection.getURL()); + case 509: + throw new IOException("Error: You have downloaded too much data. Please try again later"); + default: + return connection.getInputStream(); + } + + } + + /** + * Download the result of the query into a file + * @param overpassQuery overpass QL + * @param outputFile the path of the file to save the data + * @param deleteFile true to delete the file if exists + * @throws Exception if the server cannot execute the query + */ + public void downloadFile(String overpassQuery, String outputFile, boolean deleteFile) throws Exception { + if (overpassQuery == null || overpassQuery.isEmpty()) { + throw new IllegalArgumentException("The overpass query cannot be null or empty"); + } + String cleanQuery = StringUtils.deleteWhitespace(overpassQuery); + File file = URIUtilities.fileFromString(outputFile); + checkOutputFile(cleanQuery, file); + + if (file.exists()) { + if (deleteFile) { + file.delete(); + } else { + throw new FileNotFoundException("The following file already exists:\n" + outputFile); + } + } + HttpURLConnection connection = prepareConnection(overpassQuery); + connection.connect(); + switch (connection.getResponseCode()) { + case 400: + throw new IOException("Error : Cannot execute the Overpass query " + connection.getURL()); + case 509: + throw new IOException("Error: You have downloaded too much data. Please try again later"); + default: + try (InputStream in = connection.getInputStream(); OutputStream out = new FileOutputStream(file)) { + byte[] data = new byte[4096]; + while (true) { + int numBytes = in.read(data); + if (numBytes == -1) { + break; + } + out.write(data, 0, numBytes); + } + } + break; + } + } + + /** + * Check if the file extension is supported and the same as specified in the query + * @param overpassQuery + * @param outputFile + */ + public void checkOutputFile(String overpassQuery, File outputFile) { + if (outputFile.getName().toLowerCase().endsWith(".csv") && !StringUtils.containsIgnoreCase(overpassQuery, "out:csv")) { + throw new IllegalArgumentException("The file extension is not compatible with the one specified in the request. Please use csv"); + } else if (outputFile.getName().toLowerCase().endsWith(".json") && !StringUtils.containsIgnoreCase(overpassQuery, "out:json")) { + throw new IllegalArgumentException("The file extension is not compatible with the one specified in the request. Please use json"); + } else if (outputFile.getName().toLowerCase().endsWith(".osm") && StringUtils.containsAnyIgnoreCase(overpassQuery, "out:json", "out:csv")) { + throw new IllegalArgumentException("The file extension is not compatible with the one specified in the request"); + } + } + + /** + * Overpass endpoint + * @return endpoint + */ + public String getEndpoint() { + return endPoint; + } + + /** + * Set new endpoint + * @param endPoint endpoint + */ + public void setEndPoint(String endPoint) { + this.endPoint = endPoint; + } + + /** + * Set a port to the proxy + * @return the proxy value + */ + public int getProxyPort() { + return proxyPort; + } + + /** + * Set a port to the proxy + * @param proxyPort proxy port value + */ + public void setProxyPort(int proxyPort) { + this.proxyPort = proxyPort; + } + + /** + * Get the proxy host + * @return the proxy host + */ + public String getProxyHost() { + return proxyHost; + } + + /** + * Set a new proxy host + * @param proxyHost proxy host value + */ + public void setProxyHost(String proxyHost) { + this.proxyHost = proxyHost; + } +} diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java new file mode 100644 index 0000000000..ed5e79d095 --- /dev/null +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java @@ -0,0 +1,60 @@ +/** + * H2GIS is a library that brings spatial support to the H2 Database Engine + * http://www.h2database.com. H2GIS is developed by CNRS + * http://www.cnrs.fr/. + *

+ * This code is part of the H2GIS project. H2GIS is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * Lesser General Public License as published by the Free Software Foundation; + * version 3.0 of the License. + *

+ * H2GIS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details . + *

+ *

+ * For more information, please consult: http://www.h2gis.org/ + * or contact directly: info_at_h2gis.org + */ + +package org.h2gis.functions.io.overpass; + +import org.h2gis.api.AbstractFunction; +import org.h2gis.api.ScalarFunction; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; + +/** + * Return the string representation of the geometry envelope + * @author E. Bocher, CNRS + */ +public class ST_AsOverpassBbox extends AbstractFunction implements ScalarFunction { + + public ST_AsOverpassBbox() { + addProperty(PROP_REMARKS, "Return a string representation of the Geometry envelope conform to be overpass format :\n" + + " south, west, north, east -> minY,minX, maxY, maxX"); + } + + @Override + public String getJavaStaticMethod() { + return "execute"; + } + + /** + * Return a string representation of the Geometry envelope conform + * to be overpass format : + * south, west, north, east -> minY,minX, maxY, maxX + * + * + * @param geom input geometry + * @return text representation of the geometry + */ + public static String execute(Geometry geom) { + if (geom == null) { + return null; + } + Envelope env = geom.getEnvelopeInternal(); + return env.getMinY() + "," + env.getMinX() + "," + env.getMaxY() + "," + env.getMaxX(); + } +} diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_OverpassDownloader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_OverpassDownloader.java new file mode 100644 index 0000000000..df4ed5b7dc --- /dev/null +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_OverpassDownloader.java @@ -0,0 +1,90 @@ +/** + * H2GIS is a library that brings spatial support to the H2 Database Engine + * http://www.h2database.com. H2GIS is developed by CNRS + * http://www.cnrs.fr/. + *

+ * This code is part of the H2GIS project. H2GIS is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * Lesser General Public License as published by the Free Software Foundation; + * version 3.0 of the License. + *

+ * H2GIS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details . + *

+ *

+ * For more information, please consult: http://www.h2gis.org/ + * or contact directly: info_at_h2gis.org + */ + +package org.h2gis.functions.io.overpass; + +import org.h2gis.api.AbstractFunction; +import org.h2gis.api.ScalarFunction; + +/** + * A function to extract data from Overpass api and save it into a file + * @author E. Bocher, CNRS + */ +public class ST_OverpassDownloader extends AbstractFunction implements ScalarFunction { + + public ST_OverpassDownloader() { + addProperty(PROP_REMARKS, "Extract OSM data from Overpass api server and save the result into a file.\n" + + "\n ST_OverpassDownloader(..." + + "\n Supported arguments :" + + "\n overpass query as string, path of the file to store the result" + + "\n overpass query as string, path of the file to store the result, true to delete the file if exist" + + "\n overpass query as string, path of the file to store the result, true to delete the file if exist, network options as 'proxyhost=? proxyport=? endpoint=?"); + } + + @Override + public String getJavaStaticMethod() { + return "execute"; + } + + /** + * Extract OSM DATA + * @param overpassQuery the overpass query + * @param fileName the output file + */ + public static void execute(String overpassQuery, String fileName) throws Exception { + execute(overpassQuery, fileName, true); + } + + /** + * Extract OSM DATA + * @param overpassQuery the overpass query + * @param fileName the output file + * @param deleteFile true to delete the file if exists + */ + public static void execute(String overpassQuery, String fileName, boolean deleteFile) throws Exception { + OverpassTool overpassTool = new OverpassTool(); + overpassTool.downloadFile(overpassQuery, fileName, deleteFile); + } + + /** + * Extract OSM DATA + * @param overpassQuery the overpass query + * @param fileName the output file + * @param deleteFile true to delete the file if exists + * @param options network options as proxyhost=? proxyport=? endpoint=? + */ + public static void execute(String overpassQuery, String fileName, boolean deleteFile, String options) throws Exception { + OverpassTool overpassTool = new OverpassTool(); + if (options != null) { + String[] optionsNet = options.split("\\s+"); + for (String params : optionsNet) { + String[] keyValue = params.split("="); + if (keyValue[0].equalsIgnoreCase("proxyhost")) { + overpassTool.setProxyHost(keyValue[1]); + } else if (keyValue[0].equalsIgnoreCase("proxyport")) { + overpassTool.setProxyPort(Integer.parseInt(keyValue[1])); + } else if (keyValue[0].equalsIgnoreCase("endpoint")) { + overpassTool.setEndPoint(keyValue[1]); + } + } + } + overpassTool.downloadFile(overpassQuery, fileName, deleteFile); + } +} diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java new file mode 100644 index 0000000000..18ee04584d --- /dev/null +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java @@ -0,0 +1,59 @@ +/** + * H2GIS is a library that brings spatial support to the H2 Database Engine + * http://www.h2database.com. H2GIS is developed by CNRS + * http://www.cnrs.fr/. + *

+ * This code is part of the H2GIS project. H2GIS is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * Lesser General Public License as published by the Free Software Foundation; + * version 3.0 of the License. + *

+ * H2GIS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details . + *

+ *

+ * For more information, please consult: http://www.h2gis.org/ + * or contact directly: info_at_h2gis.org + */ + +package org.h2gis.functions.spatial.others; + +import org.h2gis.api.AbstractFunction; +import org.h2gis.api.ScalarFunction; +import org.locationtech.jts.geom.Envelope; +import org.locationtech.jts.geom.Geometry; + +/** + * Text representation of the geometry envelope + * @author E. Bocher, CNRS + */ +public class ST_EnvelopeAsText extends AbstractFunction implements ScalarFunction { + + public ST_EnvelopeAsText() { + addProperty(PROP_REMARKS, "Return a string representation of the Geometry envelope :\n" + + " west, south, east, north -> minX, minY, maxX, max"); + } + + @Override + public String getJavaStaticMethod() { + return "execute"; + } + + /** + * Return a string representation of the Geometry envelope + * west, south, east, north -> minX, minY, maxX, maxY + * + * + * @param geom input geometry + * @return a text representation of the geometry + */ + public static String execute(Geometry geom) { + if (geom == null) { + return null; + } + Envelope env = geom.getEnvelopeInternal(); + return env.getMinX() + "," + env.getMinY() + "," + env.getMaxX() + "," + env.getMaxY(); + } +} diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/io/geojson/GeojsonImportExportTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/io/geojson/GeojsonImportExportTest.java index 40fe4cbfbf..e77e6dbe8e 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/io/geojson/GeojsonImportExportTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/io/geojson/GeojsonImportExportTest.java @@ -585,6 +585,104 @@ public void testReadGeoJSON3() throws Exception { } } + @Test + public void testReadGeoJSON4() throws Exception { + try (Statement stat = connection.createStatement()) { + stat.execute("DROP TABLE IF EXISTS geojson_data; CREATE TABLE geojson_data " + + "as SELECT CONCAT('{ \"type\": \"Point\", \"coordinates\": [', X, ',0] }') as json FROM GENERATE_SERIES(0,3) ORDER BY X"); + ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON(json) from geojson_data"); + res.next(); + assertEquals("POINT (0 0)", res.getString(1)); + res.next(); + assertEquals("POINT (1 0)", res.getString(1)); + res.next(); + assertEquals("POINT (2 0)", res.getString(1)); + } + } + + @Test + public void testReadGeoJSON5() throws Exception { + try (Statement stat = connection.createStatement()) { + String collection="{\n" + + " \"type\": \"GeometryCollection\",\n" + + " \"geometries\": [\n" + + " {\n" + + " \"type\": \"Point\",\n" + + " \"coordinates\": [4.404732087, 51.22893535]\n" + + " },\n" + + " {\n" + + " \"type\": \"LineString\",\n" + + " \"coordinates\": [\n" + + " [4.404732087, 51.22893535],\n" + + " [4.403982789, 51.229262879],\n" + + " [4.403812348, 51.229155607]\n" + + " ]\n" + + " }\n"+ + " ]\n" + + "}"; + ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('"+collection+"')"); + res.next(); + assertEquals("GEOMETRYCOLLECTION (POINT (4.404732087 51.22893535), LINESTRING (4.404732087 51.22893535, 4.403982789 51.229262879, 4.403812348 51.229155607))", res.getString(1)); + } + } + + @Test + public void testReadGeoJSON6() throws Exception { + try (Statement stat = connection.createStatement()) { + String collection="{\n" + + " \"type\": \"GeometryCollection\",\n" + + " \"geometries\": [\n" + + " {\n" + + " \"type\": \"LineString\",\n" + + " \"coordinates\": [\n" + + " [4.404732087, 51.22893535],\n" + + " [4.403982789, 51.229262879],\n" + + " [4.403812348, 51.229155607]\n" + + " ]\n" + + " },\n"+ + " {\n" + + " \"type\": \"Point\",\n" + + " \"coordinates\": [4.404732087, 51.22893535]\n" + + " }"+ + " ]\n" + + "}"; + ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('"+collection+"')"); + res.next(); + assertEquals("GEOMETRYCOLLECTION (LINESTRING (4.404732087 51.22893535, 4.403982789 51.229262879, 4.403812348 51.229155607), POINT (4.404732087 51.22893535))", res.getString(1)); + } + } + + @Test + public void testReadGeoJSON7() throws Exception { + try (Statement stat = connection.createStatement()) { + String collection="{\n" + + " \"type\": \"GeometryCollection\",\n" + + " \"geometries\": [\n" + + " {\n" + + " \"type\": \"LineString\",\n" + + " \"coordinates\": [\n" + + " [-0.0147294, 53.7405502],\n" + + " [-0.0146484, 53.7406478],\n" + + " [-0.0141911, 53.7411993]\n"+ + " ]\n" + + " },"+ + " {\n" + + " \"type\": \"LineString\",\n" + + " \"coordinates\": [\n" + + " [4.404732087, 51.22893535],\n" + + " [4.403982789, 51.229262879],\n" + + " [4.403812348, 51.229155607]\n" + + " ]\n" + + " }\n"+ + " ]\n" + + "}"; + ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('"+collection+"')"); + res.next(); + assertEquals("GEOMETRYCOLLECTION (LINESTRING (-0.0147294 53.7405502, -0.0146484 53.7406478, -0.0141911 53.7411993), LINESTRING (4.404732087 51.22893535, 4.403982789 51.229262879, 4.403812348 51.229155607))", res.getString(1)); + } + } + + @Test public void testWriteReadNullGeojsonPoint() throws Exception { try (Statement stat = connection.createStatement()) { diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java new file mode 100644 index 0000000000..4cc49bd613 --- /dev/null +++ b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java @@ -0,0 +1,159 @@ +/** + * H2GIS is a library that brings spatial support to the H2 Database Engine + * http://www.h2database.com. H2GIS is developed by CNRS + * http://www.cnrs.fr/. + *

+ * This code is part of the H2GIS project. H2GIS is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * Lesser General Public License as published by the Free Software Foundation; + * version 3.0 of the License. + *

+ * H2GIS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details . + *

+ *

+ * For more information, please consult: http://www.h2gis.org/ + * or contact directly: info_at_h2gis.org + */ + +package org.h2gis.functions.io.overpass; + +import org.h2gis.functions.factory.H2GISDBFactory; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.io.CleanupMode; +import org.junit.jupiter.api.io.TempDir; + +import java.io.File; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Arrays; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author E. Bocher, CNRS + */ +public class OverpassFunctionsTest { + + @TempDir(cleanup = CleanupMode.ON_SUCCESS) + static File folder; + + private static Connection connection; + private static final String DB_NAME = "OverpassTest"; + private Statement st; + + @BeforeAll + public static void tearUp() throws Exception { + connection = H2GISDBFactory.createSpatialDataBase(folder.getAbsolutePath() + File.separator + DB_NAME); + } + + @AfterAll + public static void tearDown() throws Exception { + connection.close(); + } + + @BeforeEach + public void setUpStatement() throws Exception { + st = connection.createStatement(); + } + + @AfterEach + public void tearDownStatement() throws Exception { + st.close(); + } + + @Test + public void queryOverpass() throws Exception { + OverpassTool getOverpass = new OverpassTool(); + String overpassQuery = "[out:csv(\"name\")];\n" + + "area[name=\"Paimpol\"];\n" + + "nwr(area)[railway=station];\n" + + "out;"; + File outputFile = File.createTempFile("myoverpassfile", ".csv", folder); + getOverpass.downloadFile(overpassQuery, outputFile.getAbsolutePath(), true); + assertTrue(outputFile.exists()); + ResultSet res = st.executeQuery("SELECT * FROM CSVREAD('" + outputFile.getAbsolutePath() + "')"); + ArrayList data = new ArrayList(); + while (res.next()) { + data.add(res.getString(1)); + } + res.close(); + assertEquals(Arrays.asList("Paimpol", "Lancerf"), data); + } + + @Test + public void queryOverpass2() throws Exception { + OverpassTool getOverpass = new OverpassTool(); + String overpassQuery = "[out:csv(::id,::type,\"name\")];\n" + + "area[name=\"Paimpol\"];\n" + + "nwr(area)[railway=station];\n" + + "out;"; + File outputFile = File.createTempFile("myoverpassfile", ".csv", folder); + getOverpass.downloadFile(overpassQuery, outputFile.getAbsolutePath(), true); + assertTrue(outputFile.exists()); + ResultSet res = st.executeQuery("SELECT name FROM CSVREAD('" + outputFile.getAbsolutePath() + "', null, 'fieldSeparator=\t')"); + ArrayList data = new ArrayList(); + while (res.next()) { + data.add(res.getString(1)); + } + res.close(); + assertEquals(Arrays.asList("Paimpol", "Lancerf"), data); + } + + @Test + public void queryOverpass3() throws Exception { + OverpassTool getOverpass = new OverpassTool(); + String overpassQuery = "[out: csv(\"name\")];\n" + + "area[name=\"Paimpol\"];\n" + + "nwr(area)[railway=station];\n" + + "out;"; + File outputFile = File.createTempFile("myoverpassfile", ".json", folder); + assertThrows(Exception.class, () -> + getOverpass.downloadFile(overpassQuery, outputFile.getAbsolutePath(), true)); + } + + @Test + public void queryOverpass4() throws Exception { + OverpassTool getOverpass = new OverpassTool(); + String overpassQuery = "[out: json];\n" + + "area[name=\"Paimpol\"];\n" + + "nwr(area)[railway=station];\n" + + "out;"; + File outputFile = File.createTempFile("myoverpassfile", ".json", folder); + getOverpass.downloadFile(overpassQuery, outputFile.getAbsolutePath(), true); + assertTrue(outputFile.exists()); + } + + @Test + public void ST_Overpass1() throws Exception { + String overpassQuery = "[out: csv(\"name\")];\n" + + "area[name=\"Paimpol\"];\n" + + "nwr(area)[railway=station];\n" + + "out;"; + File outputFile = File.createTempFile("myoverpassfile", ".csv", folder); + st.execute("SELECT ST_OverpassDownloader('" + overpassQuery + "', '" + outputFile.getAbsolutePath() + "', true)"); + assertTrue(outputFile.exists()); + ResultSet res = st.executeQuery("SELECT name FROM CSVREAD('" + outputFile.getAbsolutePath() + "', null, 'fieldSeparator=\t')"); + ArrayList data = new ArrayList(); + while (res.next()) { + data.add(res.getString(1)); + } + res.close(); + assertEquals(Arrays.asList("Paimpol", "Lancerf"), data); + } + + @Test + public void ST_Overpass2() throws Exception { + st.execute("DROP TABLE IF EXISTS names;" + + "CREATE TABLE names (name VARCHAR);" + + "INSERT INTO names VALUES('Paimpol'), ('Redon');"); + st.execute("SELECT ST_OverpassDownloader(CONCAT('[out: csv(''name'')];area[name=','\"',name,'\"', ']; nwr(area)[railway=station];out;')," + + "concat('" + folder.getAbsolutePath() + File.separator + "file_', name, '.csv')) FROM names"); + assertTrue(new File(folder.getAbsolutePath() + File.separator + "file_Paimpol.csv").exists()); + assertTrue(new File(folder.getAbsolutePath() + File.separator + "file_Redon.csv").exists()); + } +} diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java index bbaf3cdf01..ccc2bd8e75 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java @@ -37,6 +37,8 @@ import org.h2gis.utilities.JDBCUtilities; import org.h2gis.utilities.GeographyUtilities; + +import static org.h2gis.unitTest.GeometryAsserts.printGeometry; import static org.junit.jupiter.api.Assertions.*; /** @@ -65,7 +67,7 @@ public void tearDownStatement() throws Exception { st.close(); } - @AfterAll + @AfterAll public static void tearDown() throws Exception { connection.close(); } @@ -303,6 +305,7 @@ public void testST_IsProjectedCRS2() throws SQLException { rs = st.executeQuery("SELECT ST_IsProjectedCRS('SRID=0;POINT(0 10)'::GEOMETRY) as result"); assertTrue(rs.next()); assertFalse( rs.getBoolean(1)); + rs.close(); } @Test @@ -315,5 +318,14 @@ public void testST_IsGeographicCRS() throws SQLException { rs = st.executeQuery("SELECT ST_IsGeographicCRS('POINT(3.68 59.04)'::GEOMETRY) as result"); assertTrue(rs.next()); assertFalse( rs.getBoolean(1)); + rs.close(); + } + + @Test + public void testMollweidCRS() throws SQLException { + Statement st = connection.createStatement(); + ResultSet rs = st.executeQuery("SELECT ST_TRANSFORM('SRID=4326;POINT(3.68 59.04)'::GEOMETRY, 54009) as result"); + printGeometry(rs.getObject(1)); + rs.close(); } } From bdd90cf23acb3a4a432b18823c0a62c4560c6737 Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 16:36:36 +0200 Subject: [PATCH 02/26] Comment test --- .../java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java index ccc2bd8e75..6112ac5a39 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/crs/CRSFunctionTest.java @@ -321,6 +321,8 @@ public void testST_IsGeographicCRS() throws SQLException { rs.close(); } + //TODO : fix CTS projection + @Disabled @Test public void testMollweidCRS() throws SQLException { Statement st = connection.createStatement(); From e3bbbec0168f0a6717604c6113aab4d0d0a33889 Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 18:06:57 +0200 Subject: [PATCH 03/26] Improve doc --- .../functions/factory/H2GISFunctions.java | 8 +++---- .../io/overpass/OverpassFunctionsTest.java | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java index f2d001a427..044b7a70a3 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java @@ -422,7 +422,7 @@ public static void registerSpatialTables(Connection connection) throws SQLExcept /** * Return a string property of the function - * @param function + * @param function h2gis function * @param propertyKey * @return */ @@ -451,7 +451,7 @@ private static boolean getBooleanProperty(Function function, String propertyKey, * @param function Function instance * @param packagePrepend For OSGi environment only, use * Bundle-SymbolicName:Bundle-Version: - * @throws java.sql.SQLException + * @throws java.sql.SQLException Throw an exception if the function cannot be registered */ public static void registerFunction(Statement st,Function function,String packagePrepend) throws SQLException { registerFunction(st,function,packagePrepend,true); @@ -464,7 +464,7 @@ public static void registerFunction(Statement st,Function function,String packag * @param function Function instance * @param packagePrepend For OSGi environment only, use Bundle-SymbolicName:Bundle-Version: * @param dropAlias Drop alias if exists before define it. - * @throws java.sql.SQLException + * @throws java.sql.SQLException Throw an exception if the function cannot be registered */ public static void registerFunction(Statement st,Function function,String packagePrepend,boolean dropAlias) throws SQLException { String functionClass = function.getClass().getName(); @@ -558,7 +558,7 @@ private static void registerH2GISFunctions(Connection connection, String package * Unregister spatial type and H2GIS functions from the current connection. * * @param connection Active H2 connection with DROP ALIAS rights - * @throws java.sql.SQLException + * @throws java.sql.SQLException Throw an exception if the function cannot be unregistered */ public static void unRegisterH2GISFunctions(Connection connection) throws SQLException { Statement st = connection.createStatement(); diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java index 4cc49bd613..11a6e9607c 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java @@ -156,4 +156,25 @@ public void ST_Overpass2() throws Exception { assertTrue(new File(folder.getAbsolutePath() + File.separator + "file_Paimpol.csv").exists()); assertTrue(new File(folder.getAbsolutePath() + File.separator + "file_Redon.csv").exists()); } + + @Disabled + @Test + public void ST_Overpass3() throws Exception { + st.execute("select ST_OverpassDownloader(CONCAT('[bbox:', ST_AsOverpassBbox(st_Expand('SRID=4326;POINT(-2.781140 47.643182)'::GEOMETRY, 0.001)), " + + "']', '[out:csv(::count, ::\"count:nodes\", ::\"count:ways\", ::\"count:relations\")][timeout:25];\n" + + "(\n" + + " node[building=yes];\n" + + " way[building=yes];\n" + + " relation[building=yes];\n" + + ");\n" + + "out count;'), '/tmp/count_building', true )"); + } + + @Test + public void ST_AsOverpassBbox1() throws Exception { + ResultSet res = st.executeQuery("select ST_AsOverpassBbox(st_Expand('SRID=4326;POINT(-2.781140 47.643182)'::GEOMETRY, 0.001))"); + res.next(); + assertEquals("47.643082,-2.7812400000000004,47.643282000000006,-2.78104", res.getString(1)); + res.close(); + } } From 83d4be2a0576468d2ccf304229dd32c57335d0bf Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 18:10:57 +0200 Subject: [PATCH 04/26] Improve doc --- .../org/h2gis/functions/io/asc/AscRead.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java index 49d47752ea..d438699b1e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java @@ -65,8 +65,8 @@ public String getJavaStaticMethod() { * * @param connection input database connection * @param fileName file to read - * @throws IOException - * @throws SQLException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); @@ -81,11 +81,11 @@ public static void readAscii(Connection connection, String fileName) throws IOEx /** * Read the ASCII file. * - * @param connection - * @param fileName - * @param option - * @throws IOException - * @throws SQLException + * @param connection input database connection + * @param fileName input file name + * @param option options to parse the file + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName, Value option) throws IOException, SQLException { int zType = 2; @@ -128,12 +128,12 @@ public static void readAscii(Connection connection, String fileName, Value optio /** * Read the ASCII file. * - * @param connection - * @param fileName - * @param tableReference - * @param option - * @throws IOException - * @throws SQLException + * @param connection database connection + * @param fileName input file name + * @param tableReference output table name + * @param option options to parse the file + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { int zType = 2; @@ -168,8 +168,8 @@ public static void readAscii(Connection connection, String fileName, String tabl * @param outputFile * @param progress * @param ascReaderDriver - * @throws IOException - * @throws SQLException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ private static void importFile(Connection connection, String tableReference, File outputFile, ProgressVisitor progress, AscReaderDriver ascReaderDriver) throws IOException, SQLException { int srid = 0; @@ -195,8 +195,8 @@ private static void importFile(Connection connection, String tableReference, Fil * 2 for size / 2) * @param extractAsPolygons If true pixels are converted to polygon. * (default false) - * @throws IOException - * @throws SQLException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName, String tableReference, Geometry envelope, int downScale, boolean extractAsPolygons) throws IOException, SQLException { AscReaderDriver ascReaderDriver = new AscReaderDriver(); @@ -222,8 +222,8 @@ public static void readAscii(Connection connection, String fileName, String tabl * 2 for size / 2) * @param extractAsPolygons If true pixels are converted to polygon. * (default false) - * @throws IOException - * @throws SQLException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName, String tableReference, Geometry envelope, int downScale, boolean extractAsPolygons, boolean deleteTable) throws IOException, SQLException { AscReaderDriver ascReaderDriver = new AscReaderDriver(); @@ -250,8 +250,8 @@ public static void readAscii(Connection connection, String fileName, String tabl * 2 for size / 2) * @param extractAsPolygons If true pixels are converted to polygon. * (default false) - * @throws IOException - * @throws SQLException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public static void readAscii(Connection connection, String fileName, String tableReference, Geometry envelope, int downScale, boolean extractAsPolygons, boolean deleteTable, String encoding, int zType) throws IOException, SQLException { AscReaderDriver ascReaderDriver = new AscReaderDriver(); From a063f039e1c89249642974521845e2a8de2e46de Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 18:19:30 +0200 Subject: [PATCH 05/26] Improve doc --- .../org/h2gis/functions/io/asc/AscRead.java | 22 +++++++++---------- .../functions/io/asc/AscReaderDriver.java | 20 ++++++++--------- .../functions/io/csv/CSVDriverFunction.java | 4 ++-- .../functions/io/fgb/FGBWriteDriver.java | 4 ++-- .../functions/io/geojson/GeoJsonRead.java | 4 ++-- .../io/geojson/GeoJsonReaderDriver.java | 8 +++---- .../functions/io/geojson/GeoJsonWrite.java | 4 ++-- .../io/geojson/GeoJsonWriteDriver.java | 10 ++++----- .../functions/io/gpx/GPXDriverFunction.java | 2 +- .../org/h2gis/functions/io/gpx/GPXRead.java | 4 ++-- .../gpx/model/AbstractGpxParserDefault.java | 2 +- .../io/gpx/model/GPXTablesFactory.java | 4 ++-- .../org/h2gis/functions/io/kml/KMLWrite.java | 7 +++--- .../functions/io/kml/KMLWriterDriver.java | 6 ++--- .../functions/io/osm/OSMDriverFunction.java | 2 +- .../org/h2gis/functions/io/osm/OSMParser.java | 4 ++-- .../org/h2gis/functions/io/osm/OSMRead.java | 20 ++++++++--------- .../functions/io/shp/SHPDriverFunction.java | 2 +- .../functions/io/tsv/TSVDriverFunction.java | 4 ++-- .../org/h2gis/functions/io/tsv/TSVRead.java | 10 ++++----- .../org/h2gis/functions/io/tsv/TSVWrite.java | 12 +++++----- .../utilities/GeometryTableUtilities.java | 12 +++++----- 22 files changed, 84 insertions(+), 83 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java index d438699b1e..b1e9eeb497 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java @@ -163,10 +163,10 @@ public static void readAscii(Connection connection, String fileName, String tabl /** * Import the file - * @param connection - * @param tableReference + * @param connection database connection + * @param tableReference output table name * @param outputFile - * @param progress + * @param progress Progress visitor following the execution. * @param ascReaderDriver * @throws IOException Throw exception is the file cannot be accessed * @throws SQLException Throw exception is the file name contains unsupported characters @@ -186,9 +186,9 @@ private static void importFile(Connection connection, String tableReference, Fil /** * Import a small subset of ASC file. * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @param envelope Extract only pixels that intersects the provided geometry * envelope, null to disable filter * @param downScale Coefficient used for exporting less cells (1 all cells, @@ -213,9 +213,9 @@ public static void readAscii(Connection connection, String fileName, String tabl /** * Import a small subset of ASC file. * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @param envelope Extract only pixels that intersects the provided geometry * envelope, null to disable filter * @param downScale Coefficient used for exporting less cells (1 all cells, @@ -242,8 +242,8 @@ public static void readAscii(Connection connection, String fileName, String tabl * Import a small subset of ASC file. * * @param connection - * @param fileName - * @param tableReference + * @param fileName input file + * @param tableReference output table name * @param envelope Extract only pixels that intersects the provided geometry * envelope, null to disable filter * @param downScale Coefficient used for exporting less cells (1 all cells, diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java index af89cf08d7..f9c6c9bfed 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java @@ -202,13 +202,13 @@ private void readHeader(Scanner scanner) throws IOException { /** * Read asc file * - * @param connection - * @param fileName - * @param progress - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param progress Progress visitor following the execution. + * @param tableReference output table name * @param srid the espg code of the input file - * @throws SQLException - * @throws IOException + * @throws IOException Throw exception is the file cannot be accessed + * @throws SQLException Throw exception is the file name contains unsupported characters */ public String[] read(Connection connection, File fileName, ProgressVisitor progress, String tableReference, int srid) throws SQLException, IOException { @@ -260,13 +260,13 @@ public String[] read(Connection connection, File fileName, ProgressVisitor progr /** * Read the ascii file from inpustream * - * @param connection + * @param connection database connection * @param inputStream - * @param progress + * @param progress Progress visitor following the execution. * @param outputTable * @param srid - * @throws UnsupportedEncodingException - * @throws SQLException + * @throws UnsupportedEncodingException Throw exception is the encoding file is not supported + * @throws SQLException Throw exception is the file name contains unsupported characters * @return output table name */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java index 8bce78a60b..122870ca9a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java @@ -142,7 +142,7 @@ else if(fileName.exists()){ * @param tableReference [[catalog.]schema.]table reference * @param fileName File path to read * @param csvOptions the CSV options ie "charset=UTF-8 fieldSeparator=| fieldDelimiter=," - * @param progress + * @param progress Progress visitor following the execution. * @throws SQLException * @throws IOException */ @@ -163,7 +163,7 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param tableReference [[catalog.]schema.]table reference * @param fileName File path to read * @param csvOptions the CSV options ie "charset=UTF-8 fieldSeparator=| fieldDelimiter=," - * @param progress + * @param progress Progress visitor following the execution. * @throws SQLException * @throws IOException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java index e128b26d02..05a2d22f30 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java @@ -102,9 +102,9 @@ public void setCreateIndex(boolean createIndex) { /** * Write the spatial table to a FlatGeobuf file * - * @param progress + * @param progress Progress visitor following the execution. * @param tableName - * @param fileName + * @param fileName input file * @param deleteFiles */ public String write(ProgressVisitor progress, String tableName, File fileName, boolean deleteFiles) throws IOException, SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java index 69bc82ec4f..5ec9305b7f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java @@ -59,7 +59,7 @@ public String getJavaStaticMethod() { /** * * @param connection - * @param fileName + * @param fileName input file * @throws IOException * @throws SQLException */ @@ -77,7 +77,7 @@ public static void importTable(Connection connection, String fileName) throws IO * Read the GeoJSON file. * * @param connection - * @param fileName + * @param fileName input file * @param option * @throws IOException * @throws SQLException diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index 48d5a2408e..785210d559 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -85,7 +85,7 @@ public class GeoJsonReaderDriver { * Driver to import a GeoJSON file into a spatial table. * * @param connection - * @param fileName + * @param fileName input file * @param encoding * @param deleteTable */ @@ -99,8 +99,8 @@ public GeoJsonReaderDriver(Connection connection, File fileName, String encoding /** * Read the GeoJSON file. * - * @param progress - * @param tableReference + * @param progress Progress visitor following the execution. + * @param tableReference output table name * @return * @throws java.sql.SQLException * @throws java.io.IOException @@ -184,7 +184,7 @@ public String read(ProgressVisitor progress, String tableReference) throws SQLEx * "features": [ ... ] } * * - * @param progress + * @param progress Progress visitor following the execution. */ private void parseGeoJson(ProgressVisitor progress) throws SQLException, IOException { this.progress = progress.subProcess(100); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java index 6ce7ce2890..48309dfe80 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java @@ -69,8 +69,8 @@ public static void exportTable(Connection connection, String fileName, String ta * Write the GeoJSON file. * * @param connection - * @param fileName - * @param tableReference + * @param fileName input file + * @param tableReference output table name * @throws IOException * @throws SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java index ad67f3a7ff..01bb8637d0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java @@ -80,7 +80,7 @@ public GeoJsonWriteDriver(Connection connection) { /** * Write a resulset to a geojson file * - * @param progress + * @param progress Progress visitor following the execution. * @param rs input resulset * @param fileName the output file * @param encoding @@ -144,7 +144,7 @@ public void write(ProgressVisitor progress, ResultSet rs, File fileName, String /** * Method to write a resulset to a geojson file * - * @param progress + * @param progress Progress visitor following the execution. * @param rs * @param fos * @param encoding @@ -234,7 +234,7 @@ private void geojsonWriter(ProgressVisitor progress, ResultSet rs, OutputStream /** * Method to write a table to a geojson file * - * @param progress + * @param progress Progress visitor following the execution. * @param tableName * @param fos * @param encoding @@ -305,9 +305,9 @@ private void geojsonWriter(ProgressVisitor progress, String tableName, OutputStr /** * Write the spatial table to GeoJSON format. * - * @param progress + * @param progress Progress visitor following the execution. * @param tableName - * @param fileName + * @param fileName input file * @param encoding * @param deleteFile * @throws SQLException diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java index 945c473240..ba18662204 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java @@ -116,7 +116,7 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param connection Active connection, do not close this connection. * @param tableReference prefix uses to store the GPX tables * @param fileName File path to read - * @param progress + * @param progress Progress visitor following the execution. * @param deleteTables true to delete the existing tables * @throws SQLException Table write error * @throws IOException File read error diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java index 5ae0f81945..9606114e8b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java @@ -113,8 +113,8 @@ public static void importTable(Connection connection, String fileName, String ta * Copy data from GPX File into a new table in specified connection. * * - * @param connection - * @param fileName + * @param connection database connection + * @param fileName input file * @throws IOException * @throws SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java index 612f857994..dc18608eab 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java @@ -134,7 +134,7 @@ public void clear() { * automatically when corresponding markup is found. * * @param tableName the table used to create all tables - * @param progress + * @param progress Progress visitor following the execution. * @return a boolean value if the parser ends successfully or not * @throws SQLException if the creation of the tables failed * @throws java.io.FileNotFoundException diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java index 2909569a15..7fbbc65c3c 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java @@ -51,7 +51,7 @@ private GPXTablesFactory() { /** * Create the waypoints table that will be used to import GPX data * - * @param connection + * @param connection database connection * @param wayPointsTableName * @return * @throws SQLException @@ -98,7 +98,7 @@ public static PreparedStatement createWayPointsTable(Connection connection, Stri /** * Create the route table that will be used to import GPX data * - * @param connection + * @param connection database connection * @param routeTableName * @return * @throws SQLException diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java index f0bfeef647..457e3f810d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java @@ -57,9 +57,10 @@ public String getJavaStaticMethod() { /** * This method is used to write a spatial table into a KML file * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference Table name or select query Note : The select query + * must be enclosed in parenthesis * @throws SQLException * @throws IOException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java index 231037f8f7..3d7453cb0b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java @@ -154,7 +154,7 @@ else if (fileName.exists()) { /** * Write the spatial table to a KML format * - * @param progress + * @param progress Progress visitor following the execution. * @throws SQLException */ private void writeKML(ProgressVisitor progress,File fileName,ResultSet rs,String geomField, String encoding) throws SQLException { @@ -179,7 +179,7 @@ private void writeKML(ProgressVisitor progress,File fileName,ResultSet rs,String /** * Write the spatial table to a KMZ format * - * @param progress + * @param progress Progress visitor following the execution. * @param fileNameWithExtension * @throws SQLException */ @@ -218,7 +218,7 @@ private void writeKMZ(ProgressVisitor progress,File fileName, String fileNameWit * Write the KML document Note the document stores only the first geometry * column in the placeMark element. The other geomtry columns are ignored. * - * @param progress + * @param progress Progress visitor following the execution. * @param outputStream * @throws SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMDriverFunction.java index f606d6b3f8..d23a8b26b9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMDriverFunction.java @@ -110,7 +110,7 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param connection Active connection, do not close this connection. * @param tableReference prefix uses to store the OSM tables * @param fileName File path to read - * @param progress + * @param progress Progress visitor following the execution. * @param deleteTables true to delete the existing tables * @throws SQLException Table write error * @throws IOException File read error diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java index 4f79c95e46..3cd0e749d6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java @@ -116,7 +116,7 @@ public OSMParser(Connection connection, File fileName, String encoding, boolean * Read the OSM file and create its corresponding tables. * * @param tableName - * @param progress + * @param progress Progress visitor following the execution. * @return * @throws SQLException */ @@ -226,7 +226,7 @@ public String[] read(String tableName, ProgressVisitor progress) throws SQLExcep /** * Check if one table already exists * - * @param connection + * @param connection database connection * @param dbType Database type. * @param requestedTable * @param osmTableName diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java index a3a805b769..85f055c9d4 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java @@ -60,9 +60,9 @@ public String getJavaStaticMethod() { /** * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @param option true to delete the existing tables or set a chartset * encoding * @throws FileNotFoundException @@ -83,8 +83,8 @@ public static void importTable(Connection connection, String fileName, String ta /** * - * @param connection - * @param fileName + * @param connection database connection + * @param fileName input file * @param option * @throws FileNotFoundException * @throws SQLException @@ -109,9 +109,9 @@ public static void importTable(Connection connection, String fileName, Value opt /** * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @param encoding * @param deleteTables * @throws FileNotFoundException @@ -125,8 +125,8 @@ public static void importTable(Connection connection, String fileName, String ta /** * - * @param connection - * @param fileName + * @param connection database connection + * @param fileName input file * @throws FileNotFoundException * @throws SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java index e4c97de407..0ed8542094 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java @@ -261,7 +261,7 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param fileName File path to read * @param forceEncoding If defined use this encoding instead of the one * defined in dbf header. - * @param progress + * @param progress Progress visitor following the execution. * @throws SQLException Table write error * @throws IOException File read error */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java index 588239d6ac..5f8fc8268b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java @@ -227,7 +227,7 @@ else if (fileName.exists()) { * @param connection Active connection, do not close this connection. * @param tableReference [[catalog.]schema.]table reference * @param fileName File path to read - * @param progress + * @param progress Progress visitor following the execution. * @param encoding * @throws SQLException * @throws IOException @@ -243,7 +243,7 @@ public String[] exportTable(Connection connection, String tableReference, File f * @param connection * @param res * @param writer - * @param progress + * @param progress Progress visitor following the execution. * @param encoding * @throws java.sql.SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java index a98a13431b..0579d4116d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java @@ -59,8 +59,8 @@ public String getJavaStaticMethod() { /** * Copy data from TSV File into a new table in specified connection. * - * @param connection - * @param fileName + * @param connection database connection + * @param fileName input file * @param option table name or true to delete it * @throws SQLException * @throws FileNotFoundException @@ -102,8 +102,8 @@ public static void importTable(Connection connection, String fileName, String ta /** * * @param connection - * @param fileName - * @param tableReference + * @param fileName input file + * @param tableReference output table name * @param encoding * @param deleteTable * @throws SQLException @@ -119,7 +119,7 @@ public static void importTable(Connection connection, String fileName, String ta * Copy data from TSV File into a new table in specified connection. * * @param connection - * @param fileName + * @param fileName input file * @throws IOException * @throws SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java index c96b1ac758..5f216ce244 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java @@ -57,9 +57,9 @@ public String getJavaStaticMethod() { /** * Export a table into a Tab-separated values file * - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @throws SQLException * @throws IOException */ @@ -93,9 +93,9 @@ public static void exportTable(Connection connection, String fileName, String ta } /** - * @param connection - * @param fileName - * @param tableReference + * @param connection database connection + * @param fileName input file + * @param tableReference output table name * @param encoding * @throws SQLException * @throws IOException diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index 7f78b77e61..80bdd2e926 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -47,7 +47,7 @@ public class GeometryTableUtilities { * Read the geometry metadata of the first geometry column * * - * @param connection + * @param connection database connection * @param geometryTable * @return Geometry MetaData * @throws java.sql.SQLException @@ -60,7 +60,7 @@ public static Tuple getFirstColumnMetaData(Connection * Read the geometry metadata of the first geometry column * * - * @param connection + * @param connection database connection * @param geometryTable * @return Geometry MetaData * @throws java.sql.SQLException @@ -141,7 +141,7 @@ public static LinkedHashMap getMetaData(ResultSet resu /** * Read all geometry metadata from a table * - * @param connection + * @param connection database connection * @param geometryTable * @return Geometry MetaData * @throws java.sql.SQLException @@ -153,7 +153,7 @@ public static LinkedHashMap getMetaData(Connection con /** * Read all geometry metadata from a table * - * @param connection + * @param connection database connection * @param geometryTable * @return Geometry MetaData * @throws java.sql.SQLException @@ -191,7 +191,7 @@ public static LinkedHashMap getMetaData(Connection con /** * Read the geometry metadata from a column name * - * @param connection + * @param connection database connection * @param geometryTable * @param geometryColumnName * @return Geometry MetaData @@ -204,7 +204,7 @@ public static GeometryMetaData getMetaData(Connection connection, String geometr /** * Read the geometry metadata from a column name * - * @param connection + * @param connection database connection * @param geometryTable * @param geometryColumnName * @return Geometry MetaData From c7da3ddecab79334c901391b3cdcb6dcaa648b6d Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 24 Oct 2024 18:23:00 +0200 Subject: [PATCH 06/26] Fix test --- .../org/h2gis/functions/io/overpass/OverpassFunctionsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java index 11a6e9607c..2b715adf2b 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/io/overpass/OverpassFunctionsTest.java @@ -174,7 +174,7 @@ public void ST_Overpass3() throws Exception { public void ST_AsOverpassBbox1() throws Exception { ResultSet res = st.executeQuery("select ST_AsOverpassBbox(st_Expand('SRID=4326;POINT(-2.781140 47.643182)'::GEOMETRY, 0.001))"); res.next(); - assertEquals("47.643082,-2.7812400000000004,47.643282000000006,-2.78104", res.getString(1)); + assertEquals("47.642182000000005,-2.78214,47.644182,-2.7801400000000003", res.getString(1)); res.close(); } } From ddb7bc7821194762376a14b11737eea6093996dc Mon Sep 17 00:00:00 2001 From: ebocher Date: Fri, 25 Oct 2024 12:33:43 +0200 Subject: [PATCH 07/26] Fix doc --- .../functions/io/csv/CSVDriverFunction.java | 4 ---- .../functions/io/dbf/DBFDriverFunction.java | 1 - .../org/h2gis/functions/io/dbf/DBFWrite.java | 4 ---- .../functions/io/dbf/internal/DBFDriver.java | 2 -- .../io/dbf/internal/DbaseFileReader.java | 1 - .../org/h2gis/functions/io/fgb/FGBRead.java | 4 ---- .../org/h2gis/functions/io/fgb/FGBWrite.java | 4 ---- .../h2gis/functions/io/fgb/FGBWriteDriver.java | 2 -- .../functions/io/fgb/fileTable/FGBDriver.java | 3 --- .../functions/io/file_table/FileEngine.java | 1 - .../functions/io/geojson/GJGeometryReader.java | 15 ++++----------- .../h2gis/functions/io/geojson/GeoJsonRead.java | 4 ---- .../io/geojson/GeoJsonReaderDriver.java | 8 -------- .../functions/io/geojson/GeoJsonWrite.java | 4 ---- .../io/geojson/GeoJsonWriteDriver.java | 5 ----- .../functions/io/gpx/GPXDriverFunction.java | 2 -- .../org/h2gis/functions/io/gpx/GPXRead.java | 2 -- .../functions/io/gpx/model/GpxPreparser.java | 1 - .../org/h2gis/functions/io/kml/KMLWrite.java | 4 ---- .../h2gis/functions/io/osm/OSMPreParser.java | 2 -- .../org/h2gis/functions/io/osm/OSMRead.java | 2 -- .../functions/io/osm/ST_OSMDownloader.java | 9 --------- .../functions/io/shp/SHPDriverFunction.java | 2 -- .../org/h2gis/functions/io/shp/SHPWrite.java | 6 ------ .../functions/io/shp/internal/SHPDriver.java | 4 ---- .../functions/io/tsv/TSVDriverFunction.java | 2 -- .../org/h2gis/functions/io/tsv/TSVRead.java | 8 -------- .../org/h2gis/functions/io/tsv/TSVWrite.java | 6 ------ .../org/h2gis/functions/io/utility/PRJUtil.java | 2 -- .../spatial/properties/ST_CoordDim.java | 1 - .../functions/spatial/properties/ST_Is3D.java | 1 - .../functions/spatial/properties/ST_SRID.java | 1 - .../java/org/h2gis/utilities/FileUtilities.java | 17 +++++++---------- 33 files changed, 11 insertions(+), 123 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java index 122870ca9a..e475bbacba 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java @@ -143,8 +143,6 @@ else if(fileName.exists()){ * @param fileName File path to read * @param csvOptions the CSV options ie "charset=UTF-8 fieldSeparator=| fieldDelimiter=," * @param progress Progress visitor following the execution. - * @throws SQLException - * @throws IOException */ @Override public String[] exportTable(Connection connection, String tableReference, File fileName, String csvOptions, ProgressVisitor progress) throws SQLException, IOException { @@ -164,8 +162,6 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param fileName File path to read * @param csvOptions the CSV options ie "charset=UTF-8 fieldSeparator=| fieldDelimiter=," * @param progress Progress visitor following the execution. - * @throws SQLException - * @throws IOException */ @Override public String[] importFile(Connection connection, String tableReference, File fileName, diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java index 233a77c898..2c9fc8aea1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java @@ -328,7 +328,6 @@ public static String getQuestionMark(int count) { * @param header DBAse file header * @param cols array columns that will be populated * @return Array of columns ex: ["id INTEGER", "len DOUBLE"] - * @throws IOException */ public static String getSQLColumnTypes(DbaseFileHeader header, DBTypes dbTypes, List cols) throws IOException { StringBuilder stringBuilder = new StringBuilder(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFWrite.java index 80df6801a7..16073421fd 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFWrite.java @@ -68,8 +68,6 @@ public static void exportTable(Connection connection, String fileName, String ta * Note : The select query must be enclosed in parenthesis * @param encoding charset encoding * @param deleteFile true to delete output file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference,String encoding, boolean deleteFile) throws IOException, SQLException { DBFDriverFunction driverFunction = new DBFDriverFunction(); @@ -83,8 +81,6 @@ public static void exportTable(Connection connection, String fileName, String ta * @param tableReference Table name or select query * Note : The select query must be enclosed in parenthesis * @param option Could be string file encoding charset or boolean value to delete the existing file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { String encoding = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java index 11b63f5f1a..ba2ed77c1d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java @@ -40,7 +40,6 @@ public class DBFDriver implements FileDriver { /** * Init file header for DBF File * @param dbfFile DBF File path - * @throws IOException */ public void initDriverFromFile(File dbfFile) throws IOException { initDriverFromFile(dbfFile, null); @@ -50,7 +49,6 @@ public void initDriverFromFile(File dbfFile) throws IOException { * Init file header for DBF File * @param dbfFile DBF File path * @param forceEncoding File encoding to use, null will use the file encoding provided in the file header - * @throws IOException */ public void initDriverFromFile(File dbfFile, String forceEncoding) throws IOException { // Read columns from files metadata diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileReader.java index 5429f5b891..422b7a8920 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileReader.java @@ -143,7 +143,6 @@ public void close() throws IOException { * @param pos Pos index in the buffer * @param length Array length to extract * @return byte array extracted from the buffer - * @throws IOException */ private byte[] getBytes(long pos, int length) throws IOException { byte[] bytes = new byte[length]; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBRead.java index f4a4f1952c..06e881fbdf 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBRead.java @@ -57,8 +57,6 @@ public String getJavaStaticMethod() { * @param fileName FlatGeobuf file name or URI * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis - * @throws IOException - * @throws SQLException */ public static void execute(Connection connection, String fileName, String tableReference, boolean deleteTable) throws SQLException, IOException { File file = URIUtilities.fileFromString(fileName); @@ -73,8 +71,6 @@ public static void execute(Connection connection, String fileName, String tableR * @param fileName FlatGeobuf file name or URI * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis - * @throws IOException - * @throws SQLException */ public static void execute(Connection connection, String fileName, String tableReference) throws IOException, SQLException { execute(connection, fileName, tableReference, false); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWrite.java index 1c9bec863a..1a02209899 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWrite.java @@ -61,8 +61,6 @@ public static void execute(Connection connection, String fileName, String tableR * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis * @param deleteFile true to delete output file - * @throws IOException - * @throws SQLException */ public static void execute(Connection connection, String fileName, String tableReference, boolean deleteFile) throws SQLException, IOException { execute(connection, fileName, tableReference, deleteFile, ""); @@ -75,8 +73,6 @@ public static void execute(Connection connection, String fileName, String tableR * @param fileName FlatGeobuf file name or URI * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis - * @throws IOException - * @throws SQLException */ public static void execute(Connection connection, String fileName, String tableReference) throws IOException, SQLException { execute(connection, fileName, tableReference, false); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java index 05a2d22f30..a3c0c6fb0d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java @@ -364,8 +364,6 @@ private String doExport(ProgressVisitor progress, ResultSet rs, String geometryC * @param srid * @param metadata * @return - * @throws SQLException - * @throws IOException */ private HeaderMeta writeHeader(FileOutputStream outputStream, String fileName, FlatBufferBuilder bufferBuilder, long rowCount, String geometryType, int srid, ResultSetMetaData metadata) throws SQLException, IOException { outputStream.write(Constants.MAGIC_BYTES); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java index ad5051818c..d98fdbd54e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java @@ -78,7 +78,6 @@ public class FGBDriver implements FileDriver { * Init file header for DBF File * * @param fgbFile DBF File path - * @throws IOException */ public void initDriverFromFile(File fgbFile) throws IOException { // Read columns from files metadata @@ -149,7 +148,6 @@ public Cursor queryIndex(Envelope queryEnvelope) throws IOException { /** * Using the Spatial index it is possible to quickly cache the file address of all features. * Using this function before doing a random access should reduce the access time. - * @throws IOException */ public void cacheFeatureAddressFromIndex() throws IOException { if(headerMeta.indexNodeSize > 0) { @@ -170,7 +168,6 @@ public void cacheFeatureAddressFromIndex() throws IOException { /** * @param featureAddress Feature address in the file relative to the first feature * @return - * @throws IOException */ public static Value[] getFieldsFromFileLocation(FileChannel fileChannel, long featureAddress, long featuresOffset, HeaderMeta headerMeta, int geometryFieldIndex) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java index 5296297565..04978ead53 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java @@ -105,7 +105,6 @@ public static String getUniqueColumnName(String base, List columns) { * @param filePath First argument, file name * @param args Additional argument, contains the file name as first argument * @return Instance of FileDriver - * @throws IOException */ protected abstract Driver createDriver(File filePath, List args) throws IOException; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java index 6484bfcc5a..238360d3d9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java @@ -49,10 +49,8 @@ public GJGeometryReader(GeometryFactory GF) { * * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} * - * @param jsParser - * @throws IOException + * @param jsParser json parser * @return Geometry - * @throws java.sql.SQLException */ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLException { jsParser.nextToken(); // START_OBJECT { @@ -86,7 +84,6 @@ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLExcept * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} * * @param jp - * @throws IOException * @return Geometry */ private Geometry parseGeometry(JsonParser jp, String geometryType) throws IOException, SQLException { @@ -117,7 +114,6 @@ private Geometry parseGeometry(JsonParser jp, String geometryType) throws IOExce * { "type": "Point", "coordinates": [100.0, 0.0] } * * @param jp - * @throws IOException * @return Point */ public Point parsePoint(JsonParser jp) throws IOException, SQLException { @@ -139,8 +135,7 @@ public Point parsePoint(JsonParser jp) throws IOException, SQLException { * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param jsParser - * @throws IOException + * @param jp json parser * @return MultiPoint */ public MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException { @@ -162,7 +157,7 @@ public MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLExceptio * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param jsParser + * @param jsParser json parser */ public LineString parseLinestring(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates @@ -183,7 +178,7 @@ public LineString parseLinestring(JsonParser jp) throws IOException, SQLExceptio * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * - * @param jsParser + * @param jsParser json parser * @return MultiLineString */ public MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException { @@ -268,8 +263,6 @@ public Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * * @param jp - * @throws IOException - * @throws SQLException * @return MultiPolygon */ public MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java index 5ec9305b7f..790f50403b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java @@ -60,8 +60,6 @@ public String getJavaStaticMethod() { * * @param connection * @param fileName input file - * @throws IOException - * @throws SQLException */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); @@ -79,8 +77,6 @@ public static void importTable(Connection connection, String fileName) throws IO * @param connection * @param fileName input file * @param option - * @throws IOException - * @throws SQLException */ public static void importTable(Connection connection, String fileName, Value option) throws IOException, SQLException { String tableReference = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index 785210d559..fe630e25d8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -202,8 +202,6 @@ private void parseGeoJson(ProgressVisitor progress) throws SQLException, IOExcep /** * Parses the all GeoJSON feature to create the PreparedStatement. * - * @throws SQLException - * @throws IOException */ private boolean parseMetadata(InputStream is) throws SQLException, IOException { try { @@ -335,8 +333,6 @@ else if(dataType.equalsIgnoreCase(GeoJsonField.GEOMETRYCOLLECTION)){ * Parses the featureCollection to collect the field properties * * @param jp - * @throws IOException - * @throws SQLException */ private void parseFeaturesMetadata(JsonParser jp) throws IOException, SQLException { // Passes all the properties until "Feature" object is found @@ -418,8 +414,6 @@ private void parseFeatureMetadata(JsonParser jp) throws IOException, SQLExceptio * Parses the geometries to return its properties * * @param jp - * @throws IOException - * @throws SQLException */ private void parseParentGeometryMetadata(JsonParser jp) throws IOException, SQLException { if (jp.nextToken() != JsonToken.VALUE_NULL) {//START_OBJECT { in case of null geometry @@ -439,7 +433,6 @@ private void parseParentGeometryMetadata(JsonParser jp) throws IOException, SQLE * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} * * @param jp - * @throws IOException */ private void parseGeometryMetadata(JsonParser jp, String geometryType) throws IOException, SQLException { if (geometryType.equalsIgnoreCase(GeoJsonField.POINT)) { @@ -476,7 +469,6 @@ private void parseGeometryMetadata(JsonParser jp, String geometryType) throws IO * { "type": "Point", "coordinates": [100.0, 0.0] } * * @param jp - * @throws IOException */ private void parsePointMetadata(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java index 48309dfe80..6d5f7de236 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java @@ -57,8 +57,6 @@ public String getJavaStaticMethod() { * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis * @param deleteFile true to delete output file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, boolean deleteFile) throws IOException, SQLException { GeoJsonDriverFunction geoJsonDriver = new GeoJsonDriverFunction(); @@ -71,8 +69,6 @@ public static void exportTable(Connection connection, String fileName, String ta * @param connection * @param fileName input file * @param tableReference output table name - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { exportTable(connection, fileName, tableReference, false); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java index 01bb8637d0..fc7b490414 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java @@ -148,8 +148,6 @@ public void write(ProgressVisitor progress, ResultSet rs, File fileName, String * @param rs * @param fos * @param encoding - * @throws SQLException - * @throws IOException */ private void geojsonWriter(ProgressVisitor progress, ResultSet rs, OutputStream fos, String encoding) throws SQLException, IOException { JsonEncoding jsonEncoding = JsonEncoding.UTF8; @@ -238,8 +236,6 @@ private void geojsonWriter(ProgressVisitor progress, ResultSet rs, OutputStream * @param tableName * @param fos * @param encoding - * @throws SQLException - * @throws IOException */ private void geojsonWriter(ProgressVisitor progress, String tableName, OutputStream fos, String encoding) throws SQLException, IOException { DBTypes dbTypes = DBUtils.getDBType(connection); @@ -575,7 +571,6 @@ private void writeGeometry(Geometry geom, JsonGenerator gen) throws IOException * * @param point * @param gen - * @throws IOException */ private void write(Point point, JsonGenerator gen) throws IOException { gen.writeStringField("type", "Point"); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java index ba18662204..4485803ea7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXDriverFunction.java @@ -118,8 +118,6 @@ public String[] importFile(Connection connection, String tableReference, File fi * @param fileName File path to read * @param progress Progress visitor following the execution. * @param deleteTables true to delete the existing tables - * @throws SQLException Table write error - * @throws IOException File read error */ @Override public String[] importFile(Connection connection, String tableReference, File fileName, boolean deleteTables,ProgressVisitor progress diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java index 9606114e8b..0321824cd7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java @@ -115,8 +115,6 @@ public static void importTable(Connection connection, String fileName, String ta * * @param connection database connection * @param fileName input file - * @throws IOException - * @throws SQLException */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java index f25dc990af..be3d9a3dc3 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java @@ -69,7 +69,6 @@ public GpxPreparser() { * * @param inputFile the file to read * @return a boolean if the parser ends successfully or not - * @throws SAXException * @throws IOException */ public boolean read(File inputFile, String encoding) throws SAXException, IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java index 457e3f810d..61d2f83a97 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java @@ -61,8 +61,6 @@ public String getJavaStaticMethod() { * @param fileName input file * @param tableReference Table name or select query Note : The select query * must be enclosed in parenthesis - * @throws SQLException - * @throws IOException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws SQLException, IOException { exportTable(connection, fileName, tableReference, null, false); @@ -82,8 +80,6 @@ public static void exportTable(Connection connection, String fileName, String ta * must be enclosed in parenthesis * @param option Could be string file encoding charset or boolean value to * delete the existing file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { String encoding = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java index 34ab90a13e..b90ad001aa 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMPreParser.java @@ -62,8 +62,6 @@ public OSMPreParser() { * * @param inputFile the file to read * @return a boolean if the parser ends successfully or not - * @throws SAXException - * @throws IOException */ public boolean read(File inputFile) throws SAXException, IOException { boolean success = false; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java index 85f055c9d4..f04aae9b6b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java @@ -115,8 +115,6 @@ public static void importTable(Connection connection, String fileName, Value opt * @param encoding * @param deleteTables * @throws FileNotFoundException - * @throws SQLException - * @throws IOException */ public static void importTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteTables) throws FileNotFoundException, SQLException, IOException { OSMDriverFunction osmdf = new OSMDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java index b07cd5a631..2493b3bfc6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java @@ -60,10 +60,6 @@ public String getJavaStaticMethod() { * @param con the database connection * @param area The geometry used to compute the area set to the OSM server * @param fileName The path to save the osm file - * @throws FileNotFoundException - * @throws IOException - * @throws java.sql.SQLException - * @throws org.cts.op.CoordinateOperationException */ public static void downloadData(Connection con, Geometry area, String fileName) throws FileNotFoundException, IOException, SQLException, CoordinateOperationException { downloadData(con,area, fileName, false); @@ -75,10 +71,6 @@ public static void downloadData(Connection con, Geometry area, String fileName) * @param area The geometry used to compute the area set to the OSM server * @param fileName The path to save the osm file * @param deleteFile True to delete the file if exists - * @throws FileNotFoundException - * @throws IOException - * @throws java.sql.SQLException - * @throws org.cts.op.CoordinateOperationException */ public static void downloadData(Connection con,Geometry area, String fileName, boolean deleteFile) throws FileNotFoundException, IOException, SQLException, CoordinateOperationException { File file = URIUtilities.fileFromString(fileName); @@ -111,7 +103,6 @@ public static void downloadData(Connection con,Geometry area, String fileName, b * * @param file * @param geometryEnvelope - * @throws IOException */ public static void downloadOSMFile(File file, Envelope geometryEnvelope) throws IOException { HttpURLConnection urlCon = (HttpURLConnection) createOsmUrl(geometryEnvelope).openConnection(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java index 0ed8542094..24fb972a30 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java @@ -144,8 +144,6 @@ public String[] exportTable(Connection connection, String tableReference, File f * @param fileName File path to write, if exists it may be replaced * @param encoding File encoding, null will use default encoding * @param progress to display the IO progress - * @throws SQLException - * @throws IOException */ @Override public String[] exportTable(Connection connection, String tableReference, File fileName, String encoding, ProgressVisitor progress) throws SQLException, IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java index f4404da3fd..1c6ebcf943 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPWrite.java @@ -60,8 +60,6 @@ public String getJavaStaticMethod() { * @param connection Active connection * @param fileName Shape file name or URI * @param tableReference Table name - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { exportTable(connection, fileName, tableReference, null, false); @@ -74,8 +72,6 @@ public static void exportTable(Connection connection, String fileName, String ta * @param tableReference Table name or select query * Note : The select query must be enclosed in parenthesis * @param option Could be string file encoding charset or boolean value to delete the existing file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { String encoding = null; @@ -98,8 +94,6 @@ public static void exportTable(Connection connection, String fileName, String ta * Note : The select query must be enclosed in parenthesis * @param encoding charset encoding * @param deleteFiles true to delete output file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteFiles) throws IOException, SQLException { SHPDriverFunction shpDriverFunction = new SHPDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java index 938866bd34..6d166a7f93 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java @@ -72,7 +72,6 @@ public void setGeometryFieldIndex(int geometryFieldIndex) { /** * Insert values in the row * @param values - * @throws IOException */ @Override public void insertRow(Object[] values) throws IOException { @@ -111,7 +110,6 @@ public int getGeometryFieldIndex() { * @param shpFile * @param shapeType * @param dbaseHeader - * @throws IOException */ public void initDriver(File shpFile, ShapeType shapeType, DbaseFileHeader dbaseHeader) throws IOException { String path = shpFile.getAbsolutePath(); @@ -130,7 +128,6 @@ public void initDriver(File shpFile, ShapeType shapeType, DbaseFileHeader dbaseH /** * Init this driver from existing files, then open theses files. * @param shpFile Shape file path. - * @throws IOException */ public void initDriverFromFile(File shpFile) throws IOException { initDriverFromFile(shpFile, null); @@ -140,7 +137,6 @@ public void initDriverFromFile(File shpFile) throws IOException { * Init this driver from existing files, then open theses files. * @param shpFile Shape file path. * @param forceEncoding If defined use this encoding instead of the one defined in dbf header. - * @throws IOException */ public void initDriverFromFile(File shpFile, String forceEncoding) throws IOException { // Read columns from files metadata this.shpFile = shpFile; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java index 5f8fc8268b..6a4a103642 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java @@ -229,8 +229,6 @@ else if (fileName.exists()) { * @param fileName File path to read * @param progress Progress visitor following the execution. * @param encoding - * @throws SQLException - * @throws IOException */ @Override public String[] exportTable(Connection connection, String tableReference, File fileName, String encoding, ProgressVisitor progress) throws SQLException, IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java index 0579d4116d..6d92c04afa 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java @@ -62,9 +62,6 @@ public String getJavaStaticMethod() { * @param connection database connection * @param fileName input file * @param option table name or true to delete it - * @throws SQLException - * @throws FileNotFoundException - * @throws IOException */ public static void importTable(Connection connection, String fileName, Value option) throws SQLException, FileNotFoundException, IOException { String tableReference = null; @@ -106,9 +103,6 @@ public static void importTable(Connection connection, String fileName, String ta * @param tableReference output table name * @param encoding * @param deleteTable - * @throws SQLException - * @throws FileNotFoundException - * @throws IOException */ public static void importTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteTable) throws SQLException, FileNotFoundException, IOException { TSVDriverFunction tsvDriver = new TSVDriverFunction(); @@ -120,8 +114,6 @@ public static void importTable(Connection connection, String fileName, String ta * * @param connection * @param fileName input file - * @throws IOException - * @throws SQLException */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java index 5f216ce244..ac97061a9a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVWrite.java @@ -60,8 +60,6 @@ public String getJavaStaticMethod() { * @param connection database connection * @param fileName input file * @param tableReference output table name - * @throws SQLException - * @throws IOException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws SQLException, IOException { exportTable(connection, fileName, tableReference, null, false); @@ -76,8 +74,6 @@ public static void exportTable(Connection connection, String fileName, String ta * must be enclosed in parenthesis * @param option Could be string file encoding charset or boolean value to * delete the existing file - * @throws IOException - * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { String encoding = null; @@ -97,8 +93,6 @@ public static void exportTable(Connection connection, String fileName, String ta * @param fileName input file * @param tableReference output table name * @param encoding - * @throws SQLException - * @throws IOException */ public static void exportTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteFile) throws SQLException, IOException { TSVDriverFunction tSVDriverFunction = new TSVDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java index 1ba95604f8..42d10831e9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java @@ -54,7 +54,6 @@ public class PRJUtil { * * @param prjFile * @return - * @throws IOException */ public static int getSRID(File prjFile) throws IOException { int srid = 0; @@ -93,7 +92,6 @@ public static int getSRID(File prjFile) throws IOException { * @param prjFile * @return * @throws SQLException - * @throws IOException */ public static int getValidSRID(Connection connection, File prjFile) throws SQLException, IOException { int srid = getSRID(prjFile); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java index af5ddf6428..3284c4c106 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CoordDim.java @@ -48,7 +48,6 @@ public String getJavaStaticMethod() { * * @param geom Geometry * @return The dimension of the coordinates of the given geometry - * @throws IOException */ public static Integer getCoordinateDimension(Geometry geom) throws IOException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java index cbbccfb81a..d069eaaec1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * Returns 1 if a geometry has a z-coordinate, otherwise 0. * @param geom * @return - * @throws IOException */ public static int is3D(Geometry geom) throws IOException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_SRID.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_SRID.java index bd6e8c10fa..d5d49cb4bb 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_SRID.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_SRID.java @@ -47,7 +47,6 @@ public String getJavaStaticMethod() { /** * @param geometry Geometry instance or null * @return SRID value or 0 if input geometry does not have one. - * @throws IOException */ public static Integer getSRID(Geometry geometry) throws IOException { if(geometry==null) { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java index 62bfe7b2df..2ede49be6d 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java @@ -52,7 +52,7 @@ public class FileUtilities { * * @param directory the directory * @return true if the directory already exists - * @throws IOException + * @throws IOException Throw an exception if the files cannot be deleted */ public static boolean deleteFiles(File directory) throws IOException { return deleteFiles(directory, false); @@ -65,7 +65,7 @@ public static boolean deleteFiles(File directory) throws IOException { * @param directory the directory * @param delete true to delete the root directory * @return true if the directory already exists - * @throws IOException + * @throws IOException Throw an exception if the files cannot be deleted */ public static boolean deleteFiles(File directory, boolean delete) throws IOException { if (directory == null) { @@ -96,7 +96,7 @@ public static boolean deleteFiles(File directory, boolean delete) throws IOExcep * @param directory the directory * @param extension file extension, txt, geojson, shapefile * @return path of the files - * @throws IOException + * @throws IOException Throw an exception if the files cannot be listed */ public static List listFiles(File directory, String extension) throws IOException { if (directory == null) { @@ -123,7 +123,7 @@ public static List listFiles(File directory, String extension) throws IO * * @param directory the directory * @return path of the files - * @throws IOException + * @throws IOException Throw an exception if the files cannot be listed */ public static List listFiles(File directory) throws IOException { if (directory == null) { @@ -146,7 +146,7 @@ public static List listFiles(File directory) throws IOException { * * @param zipFile the zipped file * @throws FileNotFoundException - * @throws IOException + * @throws IOException Throw an exception if the parent file fails */ public static void unzip(File zipFile) throws IOException { Path parentDir = zipFile.toPath().getParent(); @@ -165,7 +165,7 @@ public static void unzip(File zipFile) throws IOException { * @param zipFile the zipped file * @param directory the directory to unzi the file * @throws FileNotFoundException - * @throws IOException + * @throws IOException Throw an exception if the file directory is not accessible */ public static void unzip(File zipFile, File directory) throws IOException { if (directory == null) { @@ -228,7 +228,7 @@ else if (!zipFile.exists()){ * @param destinationDir * @param zipEntry * @return - * @throws IOException + * @throws IOException Throw an exception if the file directory is not accessible */ public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOException { File destFile = new File(destinationDir, zipEntry.getName()); @@ -246,7 +246,6 @@ public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOExce * * @param filesToZip * @param outFile - * @throws IOException */ public static void zip(File[] filesToZip, File outFile) throws IOException { if (filesToZip == null) { @@ -300,7 +299,6 @@ else if (outFile.exists()){ * Zips the specified file or folder * * @param toZip - * @throws IOException */ public static void zip(File toZip) throws IOException { Path parentDir = toZip.toPath().getParent(); @@ -318,7 +316,6 @@ public static void zip(File toZip) throws IOException { * * @param toZip * @param outFile - * @throws IOException */ public static void zip(File toZip, File outFile) throws IOException { if (toZip == null || !toZip.exists()) { From ec469d8646004c868a62fc4e37f45fed7661af88 Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 28 Oct 2024 16:21:00 +0100 Subject: [PATCH 08/26] Fix doc --- .../h2gis/functions/factory/H2GISFunctions.java | 2 +- .../h2gis/functions/io/asc/AscReaderDriver.java | 2 +- .../h2gis/functions/io/fgb/FGBWriteDriver.java | 16 ++++++++-------- .../h2gis/functions/io/file_table/H2MVTable.java | 4 ++-- .../io/geojson/GeoJsonReaderDriver.java | 6 +++--- .../functions/io/geojson/GeoJsonWriteDriver.java | 2 +- .../h2gis/functions/io/json/JsonWriteDriver.java | 2 +- .../java/org/h2gis/functions/io/osm/OSMRead.java | 5 ++--- .../java/org/h2gis/functions/io/tsv/TSVRead.java | 6 +++--- .../spatial/convert/ST_ToMultiLine.java | 4 ++-- .../spatial/edit/ST_CollectionExtract.java | 12 +++++------- .../spatial/others/ST_EnvelopeAsText.java | 2 +- .../spatial/predicates/ST_CoveredBy.java | 1 - .../functions/spatial/predicates/ST_Covers.java | 1 - .../functions/spatial/predicates/ST_Crosses.java | 1 - .../spatial/predicates/ST_Disjoint.java | 1 - .../predicates/ST_EnvelopesIntersect.java | 1 - .../functions/spatial/predicates/ST_Equals.java | 1 - .../spatial/predicates/ST_OrderingEquals.java | 7 +++---- .../spatial/predicates/ST_Overlaps.java | 1 - .../functions/spatial/predicates/ST_Relate.java | 5 ++--- .../functions/spatial/predicates/ST_Touches.java | 4 ++-- .../functions/spatial/predicates/ST_Within.java | 1 - .../h2gis/functions/spatial/split/ST_Split.java | 16 +++++++--------- .../h2gis/functions/io/shp/SHPEngineTest.java | 9 ++++----- .../h2gis/utilities/GeometryTableUtilities.java | 8 ++++---- 26 files changed, 52 insertions(+), 68 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java index 044b7a70a3..02661ea0c4 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java @@ -423,7 +423,7 @@ public static void registerSpatialTables(Connection connection) throws SQLExcept /** * Return a string property of the function * @param function h2gis function - * @param propertyKey + * @param propertyKey name of the function * @return */ private static String getStringProperty(Function function, String propertyKey) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java index f9c6c9bfed..8c1047b6d3 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java @@ -403,7 +403,7 @@ public void setZType(int zType) { /** * Set true to delete the input table if exists * - * @param deleteTable + * @param deleteTable true to delete the table */ public void setDeleteTable(boolean deleteTable) { this.deleteTable = deleteTable; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java index a3c0c6fb0d..1551cf9281 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBWriteDriver.java @@ -103,9 +103,9 @@ public void setCreateIndex(boolean createIndex) { * Write the spatial table to a FlatGeobuf file * * @param progress Progress visitor following the execution. - * @param tableName + * @param tableName table to write * @param fileName input file - * @param deleteFiles + * @param deleteFiles true to delete the output file */ public String write(ProgressVisitor progress, String tableName, File fileName, boolean deleteFiles) throws IOException, SQLException { if (tableName == null) { @@ -357,13 +357,13 @@ private String doExport(ProgressVisitor progress, ResultSet rs, String geometryC /** * Write the header * - * @param outputStream + * @param outputStream output file * @param fileName name of the file - * @param rowCount - * @param geometryType - * @param srid - * @param metadata - * @return + * @param rowCount number of rows + * @param geometryType type of geometry + * @param srid table srid + * @param metadata flatbuffer metadata + * @return flatbuffer header object */ private HeaderMeta writeHeader(FileOutputStream outputStream, String fileName, FlatBufferBuilder bufferBuilder, long rowCount, String geometryType, int srid, ResultSetMetaData metadata) throws SQLException, IOException { outputStream.write(Constants.MAGIC_BYTES); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/H2MVTable.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/H2MVTable.java index 268b8839d4..72d61fb539 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/H2MVTable.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/H2MVTable.java @@ -153,8 +153,8 @@ public Index addIndex(SessionLocal session, String indexName, int indexId, Index /** * Rebuild the index - * @param session - * @param index + * @param session database session + * @param index table index */ private void rebuild(SessionLocal session, Index index){ Index scan = getScanIndex(session); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index fe630e25d8..fc3647a377 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -84,10 +84,10 @@ public class GeoJsonReaderDriver { /** * Driver to import a GeoJSON file into a spatial table. * - * @param connection + * @param connection database connection * @param fileName input file - * @param encoding - * @param deleteTable + * @param encoding file encoding + * @param deleteTable true to delete the table */ public GeoJsonReaderDriver(Connection connection, File fileName, String encoding, boolean deleteTable) { this.connection = connection; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java index fc7b490414..60467e3a31 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java @@ -71,7 +71,7 @@ public class GeoJsonWriteDriver { /** * A simple GeoJSON driver to write a spatial table to a GeoJSON file. * - * @param connection + * @param connection database connection */ public GeoJsonWriteDriver(Connection connection) { this.connection = connection; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWriteDriver.java index 2cd533c2ef..40e7e7d704 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWriteDriver.java @@ -55,7 +55,7 @@ public class JsonWriteDriver { /** * A simple GeoJSON driver to write a spatial table to a GeoJSON file. * - * @param connection + * @param connection database connection */ public JsonWriteDriver(Connection connection) { this.connection = connection; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java index f04aae9b6b..d53786f3d7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java @@ -112,9 +112,8 @@ public static void importTable(Connection connection, String fileName, Value opt * @param connection database connection * @param fileName input file * @param tableReference output table name - * @param encoding - * @param deleteTables - * @throws FileNotFoundException + * @param encoding file encoding + * @param deleteTables true to delete the tables */ public static void importTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteTables) throws FileNotFoundException, SQLException, IOException { OSMDriverFunction osmdf = new OSMDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java index 6d92c04afa..747b7b2593 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java @@ -98,11 +98,11 @@ public static void importTable(Connection connection, String fileName, String ta /** * - * @param connection + * @param connection database connection * @param fileName input file * @param tableReference output table name - * @param encoding - * @param deleteTable + * @param encoding file encoding + * @param deleteTable true to delete the table */ public static void importTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteTable) throws SQLException, FileNotFoundException, IOException { TSVDriverFunction tsvDriver = new TSVDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiLine.java index 55fd2db408..6565a3eeeb 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiLine.java @@ -49,9 +49,9 @@ public String getJavaStaticMethod() { /** * Constructs a MultiLineString from the given geometry's coordinates. * - * @param geom Geometry + * @param geom Geometry input geometry * @return A MultiLineString constructed from the given geometry's coordinates - * @throws SQLException + * */ public static MultiLineString execute(Geometry geom) throws SQLException { if (geom != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_CollectionExtract.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_CollectionExtract.java index 987e5371e0..2cf8ee35b1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_CollectionExtract.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_CollectionExtract.java @@ -51,10 +51,9 @@ public String getJavaStaticMethod() { * EMPTY geometry will be returned. Only points, lines and polygons are * extracted. * - * @param geometry + * @param geometry input geometry * @param dimension1 one dimension to filter * @param dimension2 second dimension to filter - * @return */ public static Geometry execute(Geometry geometry, int dimension1, int dimension2) throws SQLException { if (geometry == null) { @@ -77,9 +76,8 @@ public static Geometry execute(Geometry geometry, int dimension1, int dimension2 * EMPTY geometry will be returned. Only points, lines and polygons are * extracted. * - * @param geometry - * @param dimension - * @return + * @param geometry input geometry + * @param dimension dimension to extract */ public static Geometry execute(Geometry geometry, int dimension) throws SQLException { if (geometry == null) { @@ -96,8 +94,8 @@ public static Geometry execute(Geometry geometry, int dimension) throws SQLExcep /** * Filter dimensions from a geometry - * @param geometries - * @param geometry + * @param geometries list og geometries + * @param geometry input geometry * @param dimension1 one dimension to filter * @param dimension2 second dimension to filter */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java index 18ee04584d..729b924ff1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/others/ST_EnvelopeAsText.java @@ -43,7 +43,7 @@ public String getJavaStaticMethod() { /** * Return a string representation of the Geometry envelope - * west, south, east, north -> minX, minY, maxX, maxY + * west, south, east, north : minX, minY, maxX, maxY * * * @param geom input geometry diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_CoveredBy.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_CoveredBy.java index 4618b07c1c..0cd75f05e2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_CoveredBy.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_CoveredBy.java @@ -54,7 +54,6 @@ public String getJavaStaticMethod() { * @param geomA Geometry A * @param geomB Geometry B * @return if this geomA is covered by geomB - * @throws SQLException */ public static Boolean execute(Geometry geomA, Geometry geomB) throws SQLException { if(geomA == null||geomB == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java index 74c7ac9405..3a50a78f5b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Covers.java @@ -47,7 +47,6 @@ public String getJavaStaticMethod() { * @param geomA Geometry A * @param geomB Geometry B * @return True if no point in geometry B is outside geometry A - * @throws java.sql.SQLException */ public static Boolean covers(Geometry geomA, Geometry geomB) throws SQLException { if(geomA == null||geomB == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java index 989ce4d420..0f136a7297 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java @@ -46,7 +46,6 @@ public String getJavaStaticMethod() { * @param a Geometry Geometry. * @param b Geometry instance * @return true if Geometry A crosses Geometry B - * @throws java.sql.SQLException */ public static Boolean geomCrosses(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java index a0fc669cfd..8dcd1d74aa 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * @param a Geometry Geometry. * @param b Geometry instance * @return true if the two Geometries are disjoint - * @throws java.sql.SQLException */ public static Boolean geomDisjoint(Geometry a, Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_EnvelopesIntersect.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_EnvelopesIntersect.java index abc9fdb67d..6bc50c5ce7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_EnvelopesIntersect.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_EnvelopesIntersect.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * @param testGeometry Geometry instance * @return true if the envelope of Geometry A intersects the envelope of * Geometry B - * @throws java.sql.SQLException */ public static Boolean intersects(Geometry surface,Geometry testGeometry) throws SQLException { if(surface==null && testGeometry==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java index 3da6ee9626..3492ab5d0d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java @@ -48,7 +48,6 @@ public String getJavaStaticMethod() { * @param a Geometry Geometry. * @param b Geometry instance * @return true if Geometry A is equal to Geometry B - * @throws java.sql.SQLException */ public static Boolean geomEquals(Geometry a, Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_OrderingEquals.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_OrderingEquals.java index f6f2df190e..04b6225bc4 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_OrderingEquals.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_OrderingEquals.java @@ -50,10 +50,9 @@ public String getJavaStaticMethod() { /** * Returns true if the given geometries represent the same geometry and points are in the same directional order. * - * @param valueA - * @param valueB - * @return - * @throws java.sql.SQLException + * @param valueA geometry A to compare + * @param valueB geometry B to compare + * @return true if the same order */ public static boolean orderingEquals(Value valueA, Value valueB) throws SQLException{ if(!(valueA instanceof ValueGeometry) || !(valueB instanceof ValueGeometry)) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Overlaps.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Overlaps.java index 4881defec4..cab64d332d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Overlaps.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Overlaps.java @@ -46,7 +46,6 @@ public String getJavaStaticMethod() { * @param a Surface Geometry. * @param b Geometry instance * @return true if the geometry A overlaps the geometry B - * @throws java.sql.SQLException */ public static Boolean isOverlaps(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Relate.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Relate.java index 38c94fd4b0..573a6df425 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Relate.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Relate.java @@ -52,10 +52,9 @@ public String getJavaStaticMethod() { } /** - * @param a Geometry Geometry. - * @param b Geometry instance + * @param a Geometry A. + * @param b Geometry B * @return 9-character String representation of the 2 geometries IntersectionMatrix - * @throws java.sql.SQLException */ public static String relate(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java index eb69d2d5ab..fc08bf7003 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java @@ -44,8 +44,8 @@ public String getJavaStaticMethod() { /** * Return true if the geometry A touches the geometry B - * @param a Geometry Geometry. - * @param b Geometry instance + * @param a Geometry A. + * @param b Geometry B * @return true if the geometry A touches the geometry B * @throws java.sql.SQLException */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java index f0d7f460a9..ddbc895977 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java @@ -46,7 +46,6 @@ public String getJavaStaticMethod() { * @param a Surface Geometry. * @param b Geometry instance * @return true if the geometry A is within the geometry B - * @throws java.sql.SQLException */ public static Boolean isWithin(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java index 4bbe5b33a4..ae42a6fb9e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java @@ -63,10 +63,9 @@ public String getJavaStaticMethod() { * * A default tolerance of 10E-6 is used to snap the cutter point. * - * @param geomA - * @param geomB - * @return - * @throws SQLException + * @param geomA geometry to split + * @param geomB geometry for splitting + * @return a new geometry split */ public static Geometry split(Geometry geomA, Geometry geomB) throws SQLException { if(geomA == null||geomB == null){ @@ -110,8 +109,7 @@ else if (geomA instanceof LineString) { * @param geomA the geometry to be splited * @param geomB the geometry used to split * @param tolerance a distance tolerance to snap the split geometry - * @return - * @throws java.sql.SQLException + * @return a new geometry split */ public static Geometry split(Geometry geomA, Geometry geomB, double tolerance) throws SQLException { if (geomA instanceof Polygon) { @@ -138,9 +136,9 @@ public static Geometry split(Geometry geomA, Geometry geomB, double tolerance) t /** * Split a linestring with a point The point must be on the linestring * - * @param line - * @param pointToSplit - * @return + * @param line input geometry line + * @param pointToSplit input point + * @return a new geometry split at a point location */ private static MultiLineString splitLineWithPoint(LineString line, Point pointToSplit, double tolerance) { return FACTORY.createMultiLineString(splitLineStringWithPoint(line, pointToSplit, tolerance)); diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/io/shp/SHPEngineTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/io/shp/SHPEngineTest.java index 32ed30fb51..ab05582000 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/io/shp/SHPEngineTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/io/shp/SHPEngineTest.java @@ -349,11 +349,10 @@ public void testAddIndexOnTableLink() throws SQLException { /** * Check if the column is indexed or not. * Cannot check if the index is spatial or not - * @param connection - * @param tableLocation - * @param geometryColumnName - * @return - * @throws SQLException + * @param connection database connection + * @param tableLocation input table name + * @param geometryColumnName geometry column + * @return true is the column is indexed */ private static boolean hasIndex(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException { String schema = tableLocation.getSchema(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index 80bdd2e926..f88de5c82c 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -638,8 +638,8 @@ public static boolean hasGeometryColumn(ResultSet resultSet) throws SQLException /** * Check if the table contains a geometry column * - * @param connection - * @param tableLocation + * @param connection database connection + * @param tableLocation input table name * * @return True if the ResultSet contains one geometry field * @@ -652,8 +652,8 @@ public static boolean hasGeometryColumn(Connection connection, String tableLocat /** * Check if the table contains a geometry column * - * @param connection - * @param tableLocation + * @param connection database connection + * @param tableLocation input table name * * @return True if the ResultSet contains one geometry field * From 7623dc34c7b4cf808e82da6b709c2d71f83a7431 Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 28 Oct 2024 16:42:34 +0100 Subject: [PATCH 09/26] Fix doc --- .../functions/factory/H2GISFunctions.java | 2 - .../functions/io/file_table/DummyMVTable.java | 3 +- .../functions/spatial/split/ST_Split.java | 40 +++++++++---------- .../h2gis/network/functions/GraphCreator.java | 1 - .../network/functions/GraphFunction.java | 5 +-- .../network/functions/NetworkFunctions.java | 1 - .../network/functions/ST_ShortestPath.java | 5 +-- .../functions/ST_ShortestPathLength.java | 1 - .../functions/ST_ShortestPathTree.java | 3 -- .../org/h2gis/utilities/FileUtilities.java | 12 +++--- .../org/h2gis/utilities/GeometryMetaData.java | 2 +- .../utilities/GeometryTableUtilities.java | 12 ++---- .../org/h2gis/utilities/JDBCUtilities.java | 2 - .../utilities/SpatialResultSetMetaData.java | 2 - .../org/h2gis/utilities/TableUtilities.java | 2 - .../org/h2gis/utilities/URIUtilities.java | 1 - .../utilities/jts_utils/CoordinateUtils.java | 20 +++++----- 17 files changed, 45 insertions(+), 69 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java index 02661ea0c4..6f0a0e6d2e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java @@ -424,7 +424,6 @@ public static void registerSpatialTables(Connection connection) throws SQLExcept * Return a string property of the function * @param function h2gis function * @param propertyKey name of the function - * @return */ private static String getStringProperty(Function function, String propertyKey) { Object value = function.getProperty(propertyKey); @@ -437,7 +436,6 @@ private static String getStringProperty(Function function, String propertyKey) { * @param function * @param propertyKey * @param defaultValue - * @return */ private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) { Object value = function.getProperty(propertyKey); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/DummyMVTable.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/DummyMVTable.java index 1e12dd5df3..712fd23a13 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/DummyMVTable.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/DummyMVTable.java @@ -152,8 +152,7 @@ public void checkRename() { } /** - * Create - * @return + * Create a dummy index */ private Index createIndex(){ IndexColumn indexColumn = new IndexColumn("key"); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java index ae42a6fb9e..9f337db58b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_Split.java @@ -147,10 +147,10 @@ private static MultiLineString splitLineWithPoint(LineString line, Point pointTo /** * Splits a LineString using a Point, with a distance tolerance. * - * @param line - * @param pointToSplit - * @param tolerance - * @return + * @param line input line + * @param pointToSplit point to split the line + * @param tolerance distance to snap the point on the line + * @return splited line */ private static LineString[] splitLineStringWithPoint(LineString line, Point pointToSplit, double tolerance) { Coordinate[] coords = line.getCoordinates(); @@ -194,10 +194,10 @@ private static LineString[] splitLineStringWithPoint(LineString line, Point poin /** * Splits a MultilineString using a point. * - * @param multiLineString - * @param pointToSplit - * @param tolerance - * @return + * @param multiLineString input multiline + * @param pointToSplit point to split the multiline + * @param tolerance distance to snap the point to the multiline + * @return multiline splited */ private static MultiLineString splitMultiLineStringWithPoint(MultiLineString multiLineString, Point pointToSplit, double tolerance) { ArrayList linestrings = new ArrayList(); @@ -222,9 +222,9 @@ private static MultiLineString splitMultiLineStringWithPoint(MultiLineString mul /** * Splits a Polygon with a LineString. * - * @param polygon - * @param lineString - * @return + * @param polygon input polygon + * @param lineString line to split the polygon + * @return polygon splited */ private static Collection splitPolygonizer(Polygon polygon, LineString lineString) throws SQLException { LinkedList result = new LinkedList(); @@ -252,9 +252,9 @@ private static Collection splitPolygonizer(Polygon polygon, LineString /** * Splits a Polygon using a LineString. * - * @param polygon - * @param lineString - * @return + * @param polygon input polygon + * @param lineString line to split the polygon + * @return polygon splited */ private static Geometry splitPolygonWithLine(Polygon polygon, LineString lineString) throws SQLException { Collection pols = polygonWithLineSplitter(polygon, lineString); @@ -267,9 +267,9 @@ private static Geometry splitPolygonWithLine(Polygon polygon, LineString lineStr /** * Splits a Polygon using a LineString. * - * @param polygon - * @param lineString - * @return + * @param polygon input polygon + * @param lineString line to split the polygon + * @return polygon splited */ private static Collection polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException { Collection polygons = splitPolygonizer(polygon, lineString); @@ -288,9 +288,9 @@ private static Collection polygonWithLineSplitter(Polygon polygon, Line /** * Splits a MultiPolygon using a LineString. * - * @param multiPolygon - * @param lineString - * @return + * @param multiPolygon input multiPolygon + * @param lineString line to split the polygon + * @return polygon splited */ private static Geometry splitMultiPolygonWithLine(MultiPolygon multiPolygon, LineString lineString) throws SQLException { ArrayList allPolygons = new ArrayList(); diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java index b1e69f41e8..3896db1e42 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java @@ -97,7 +97,6 @@ public GraphCreator(Connection connection, * @return The newly prepared graph, or null if the graph could not * be created * - * @throws java.sql.SQLException */ protected KeyedGraph prepareGraph() throws SQLException { LOGGER.debug("Loading graph into memory..."); diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/GraphFunction.java b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphFunction.java index f0b9b795d5..9319c17edb 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/GraphFunction.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphFunction.java @@ -42,10 +42,9 @@ public class GraphFunction extends AbstractFunction { * @param inputTable Input table name * @param orientation Orientation string * @param weight Weight column name, null for unweighted graphs - * @param vertexClass - * @param edgeClass + * @param vertexClass type of vertex + * @param edgeClass type of edge * @return Graph - * @throws java.sql.SQLException */ protected static KeyedGraph prepareGraph(Connection connection, String inputTable, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java b/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java index 82cf2f3102..9e89f605ba 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java @@ -41,7 +41,6 @@ public class NetworkFunctions { /** * @return instance of all built-ins functions - * @throws java.sql.SQLException */ public static Function[] getBuiltInsFunctions() throws SQLException { return new Function[]{ diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPath.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPath.java index 1d80faf715..e71bf43a99 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPath.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPath.java @@ -84,7 +84,6 @@ public String getJavaStaticMethod() { * @param source Source vertex id * @param destination Destination vertex id * @return Shortest path - * @throws SQLException */ public static ResultSet getShortestPath(Connection connection, String inputTable, @@ -102,7 +101,6 @@ public static ResultSet getShortestPath(Connection connection, * @param source Source vertex id * @param destination Destination vertex id * @return Shortest path - * @throws SQLException */ public static ResultSet getShortestPath(Connection connection, String inputTable, @@ -216,10 +214,9 @@ private void addPredEdges(KeyedGraph graph, VDijkstra dest, Sim * * @param connection Connection * @param tableName TableLocation - * @param firstGeometryField + * @param firstGeometryField geometry column name * @return A map of edge ids to edge geometries, or null if the input table * contains no geometry fields - * @throws SQLException */ protected static Map getEdgeGeometryMap(Connection connection, TableLocation tableName, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java index 6c6c7ae548..5f3812020a 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java @@ -104,7 +104,6 @@ public String getJavaStaticMethod() { * @param orientation Orientation string * @param arg3 Source vertex id -OR- Source-Destination table * @return Distances table - * @throws SQLException */ public static ResultSet getShortestPathLength(Connection connection, String inputTable, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathTree.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathTree.java index e2ee0434f8..693b62aafa 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathTree.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathTree.java @@ -85,7 +85,6 @@ public String getJavaStaticMethod() { * @param orientation Orientation string * @param source Source vertex id * @return Shortest path tree - * @throws SQLException */ public static ResultSet getShortestPathTree(Connection connection, String inputTable, @@ -101,7 +100,6 @@ public static ResultSet getShortestPathTree(Connection connection, * @param arg4 Source vertex id or Weight * @param arg5 Search radius or Source vertex id * @return Shortest path tree - * @throws SQLException */ public static ResultSet getShortestPathTree(Connection connection, String inputTable, @@ -137,7 +135,6 @@ public static ResultSet getShortestPathTree(Connection connection, * @param source Source vertex id * @param radius Search radius * @return Shortest path tree - * @throws SQLException */ public static ResultSet getShortestPathTree(Connection connection, String inputTable, diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java index 2ede49be6d..93a04cd27a 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java @@ -225,9 +225,9 @@ else if (!zipFile.exists()){ /** * - * @param destinationDir - * @param zipEntry - * @return + * @param destinationDir target directory + * @param zipEntry zipentry + * @return the zipentry content * @throws IOException Throw an exception if the file directory is not accessible */ public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOException { @@ -381,9 +381,9 @@ else if (outFile.exists()){ /** * Get the relative path to file, according to the path to base * - * @param base - * @param file - * @return + * @param base parent file + * @param file file to locate according the parent file + * @return path of the file */ public static String getRelativePath(File base, File file) { String absolutePath = file.getAbsolutePath(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java index c82fb5d15e..d2d675bf37 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java @@ -180,7 +180,7 @@ public void initGeometryType() { * * 2 if XZ 3 if XZZ or XYM 4 if XYZM * - * @return + * @return the dimension of the geometry */ public int getDimension() { return dimension; diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index f88de5c82c..458d183f34 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -48,9 +48,8 @@ public class GeometryTableUtilities { * * * @param connection database connection - * @param geometryTable + * @param geometryTable table name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static Tuple getFirstColumnMetaData(Connection connection, String geometryTable) throws SQLException { return getFirstColumnMetaData(connection, TableLocation.parse(geometryTable, getDBType(connection))); @@ -61,9 +60,8 @@ public static Tuple getFirstColumnMetaData(Connection * * * @param connection database connection - * @param geometryTable + * @param geometryTable table name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static Tuple getFirstColumnMetaData(Connection connection, TableLocation geometryTable) throws SQLException { DBTypes dbTypes = geometryTable.getDbTypes(); @@ -101,9 +99,8 @@ public static Tuple getFirstColumnMetaData(Connection * * Use this method only to instantiate a GeometryMetaData object * - * @param resultSet + * @param resultSet active resultset * @return Partial geometry metaData - * @throws java.sql.SQLException */ public static Tuple getFirstColumnMetaData(ResultSet resultSet) throws SQLException { ResultSetMetaData metadata = resultSet.getMetaData(); @@ -121,9 +118,8 @@ public static Tuple getFirstColumnMetaData(ResultSet r * Read the geometry metadata for a resulset * * - * @param resultSet + * @param resultSet active resultset * @return Geometry MetaData - * @throws java.sql.SQLException */ public static LinkedHashMap getMetaData(ResultSet resultSet) throws SQLException { LinkedHashMap geometryMetaDatas = new LinkedHashMap<>(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java index c90372f60e..5704b1662a 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java @@ -123,7 +123,6 @@ private static ResultSet getTablesView(Connection connection, String catalog, St * @param table a TableLocation * @param fieldName Field name * @return True if the table contains the field - * @throws SQLException */ public static boolean hasField(Connection connection, TableLocation table, String fieldName) throws SQLException { return hasField(connection, table.toString(), fieldName); @@ -136,7 +135,6 @@ public static boolean hasField(Connection connection, TableLocation table, Strin * @param tableName a table name in the form CATALOG.SCHEMA.TABLE * @param fieldName Field name * @return True if the table contains the field - * @throws SQLException */ public static boolean hasField(Connection connection, String tableName, String fieldName) throws SQLException { final Statement statement = connection.createStatement(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSetMetaData.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSetMetaData.java index 52435451bf..247d6d3aa9 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSetMetaData.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSetMetaData.java @@ -35,7 +35,6 @@ public interface SpatialResultSetMetaData extends ResultSetMetaData { * * @return {@link GeometryTypeCodes} of the provided column. * - * @throws SQLException */ int getGeometryType(int column) throws SQLException; @@ -49,7 +48,6 @@ public interface SpatialResultSetMetaData extends ResultSetMetaData { /** * @return Column index of the first geometry in this result set. * - * @throws SQLException */ int getFirstGeometryFieldIndex() throws SQLException; } diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java index 750b960461..e9a1c58e62 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableUtilities.java @@ -103,7 +103,6 @@ public static void copyFields(Connection connection, SimpleResultSet rs, TableLo * * @return True if this connection only wants the list of columns * - * @throws java.sql.SQLException */ public static boolean isColumnListConnection(Connection connection) throws SQLException { return connection.getMetaData().getURL().equals("jdbc:columnlist:connection"); @@ -117,7 +116,6 @@ public static boolean isColumnListConnection(Connection connection) throws SQLEx * * @return corresponding TableLocation * - * @throws SQLException */ public static TableLocation parseInputTable(Connection connection, String inputTable) throws SQLException { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java index 64467f1255..6cb77bac1b 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java @@ -45,7 +45,6 @@ public class URIUtilities { * * @return Key/Value pairs of query, the key is lowercase and value may be null * - * @throws java.io.UnsupportedEncodingException */ public static Map getQueryKeyValuePairs(URI uri) throws UnsupportedEncodingException { Map queryParameters = new HashMap(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java index 1fa5973a7b..443f7b8a70 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java @@ -82,10 +82,10 @@ public static double[] zMinMax(final Coordinate[] cs) { /** * Interpolates a z value (linearly) between the two coordinates. * - * @param firstCoordinate - * @param lastCoordinate - * @param toBeInterpolated - * @return + * @param firstCoordinate first coordinate + * @param lastCoordinate last coordinate + * @param toBeInterpolated coordinate to be interpolate + * @return coordinate with z interpolated */ public static double interpolate(Coordinate firstCoordinate, Coordinate lastCoordinate, Coordinate toBeInterpolated) { if (Double.isNaN(firstCoordinate.getZ())) { @@ -103,9 +103,9 @@ public static double interpolate(Coordinate firstCoordinate, Coordinate lastCoor * * The equality is done only in 2D (z values are not checked). * - * @param coords - * @param coord - * @return + * @param coords array of coordinates + * @param coord coordinate + * @return true if the array contains the coordinate */ public static boolean contains2D(Coordinate[] coords, Coordinate coord) { for (Coordinate coordinate : coords) { @@ -147,7 +147,7 @@ public static Coordinate vectorIntersection(Coordinate p1, Vector3D v1, Coordina * * @param coords the input coordinates * @param closeRing is true the first coordinate is added at the end to close the array - * @return + * @return the input coordinates without duplicates */ public static Coordinate[] removeDuplicatedCoordinates(Coordinate[] coords, boolean closeRing) { LinkedHashSet finalCoords = new LinkedHashSet(); @@ -181,7 +181,7 @@ public static Coordinate[] removeDuplicatedCoordinates(Coordinate[] coords, bool * @param tolerance to delete the coordinates * @param duplicateFirstLast false to delete the last coordinate * if there are equals - * @return + * @return the input coordinates without repeated coordinates */ public static Coordinate[] removeRepeatedCoordinates(Coordinate[] coords, double tolerance, boolean duplicateFirstLast) { ArrayList finalCoords = new ArrayList(); @@ -214,7 +214,7 @@ public static Coordinate[] removeRepeatedCoordinates(Coordinate[] coords, double * * @param value the double value * @param places the number of decimal places - * @return + * @return rounded value */ public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); From 704e8c295481799991727f981fefef8b0f775874 Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 28 Oct 2024 16:49:19 +0100 Subject: [PATCH 10/26] Fix doc --- .../gpx/model/AbstractGpxParserDefault.java | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java index dc18608eab..7434c8905f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserDefault.java @@ -122,7 +122,7 @@ public void clear() { /** * Gives copyright and license information governing use of the file. * - * @return + * @return copyright value */ abstract String getCopyright(); @@ -136,8 +136,7 @@ public void clear() { * @param tableName the table used to create all tables * @param progress Progress visitor following the execution. * @return a boolean value if the parser ends successfully or not - * @throws SQLException if the creation of the tables failed - * @throws java.io.FileNotFoundException + * @throws SQLException or FileNotFoundException if the creation of the tables failed */ public String[] read(String tableName, ProgressVisitor progress) throws SQLException, FileNotFoundException { if (FileUtilities.isFileImportable(fileName, "gpx")) { @@ -313,7 +312,7 @@ public void endElement(String uri, String localName, String qName) { /** * Gives the date when this file is created. * - * @return + * @return time value */ public String getTime() { return time; @@ -322,7 +321,7 @@ public String getTime() { /** * Gives the version number of the GPX document. * - * @return + * @return gpx version of the document */ public String getVersion() { return version; @@ -331,7 +330,7 @@ public String getVersion() { /** * Gives the name or URL of the software that created the GPX document. * - * @return + * @return gpx creator */ public String getCreator() { return creator; @@ -340,7 +339,7 @@ public String getCreator() { /** * Gives the minimum longitude given by {@code } element. * - * @return + * @return the minimum longitude */ public double getMinLon() { return minLon; @@ -349,7 +348,7 @@ public double getMinLon() { /** * Gives the maximum longitude given by {@code } element. * - * @return + * @return the maximum longitude */ public double getMaxLon() { return maxLon; @@ -358,7 +357,7 @@ public double getMaxLon() { /** * Gives the minimum latitude given by {@code } element. * - * @return + * @return the minimum latitude */ public double getMinLat() { return minLat; @@ -367,7 +366,7 @@ public double getMinLat() { /** * Gives the maximum latitude given by {@code } element. * - * @return + * @return the maximum latitude */ public double getMaxLat() { return maxLat; @@ -376,7 +375,7 @@ public double getMaxLat() { /** * Gives a description of the contents of the GPX file. * - * @return + * @return the description value */ public String getDesc() { return desc; @@ -386,7 +385,7 @@ public String getDesc() { * Gives keywords associated with the file. Search engines or databases can * use this information to classify the data. * - * @return + * @return the keywords */ public String getKeywords() { return keywords; @@ -395,7 +394,7 @@ public String getKeywords() { /** * Gives URLs associated with the location described in the file. * - * @return + * @return urls */ public String getFullLink() { return "Link : " + link + "\nText of hyperlink : " + linkText; @@ -406,16 +405,16 @@ public String getFullLink() { * gives an email address if exist. Also gives a link to Web site or other * external information about person if exist. * - * @return + * @return author */ public String getFullAuthor() { return "Author : " + authorName + "\nEmail : " + email + "\nLink : " + authorLink + "\nText : " + authorLinkText; } /** - * Set the link related to the author of the ducument. + * Set the link related to the author of the document. * - * @param authorLink + * @param authorLink the link related to the author */ public void setAuthorLink(String authorLink) { this.authorLink = authorLink; @@ -424,7 +423,7 @@ public void setAuthorLink(String authorLink) { /** * Set the description of the link related to the author. * - * @param authorLinkText + * @param authorLinkText the description of the link related to the author */ public void setAuthorLinkText(String authorLinkText) { this.authorLinkText = authorLinkText; @@ -433,7 +432,7 @@ public void setAuthorLinkText(String authorLinkText) { /** * Set the name of the author of the document. * - * @param authorName + * @param authorName the name of the author */ public void setAuthorName(String authorName) { this.authorName = authorName; @@ -442,7 +441,7 @@ public void setAuthorName(String authorName) { /** * Set the email of the author of the document. * - * @param email + * @param email the email of the author */ public void setEmail(String email) { this.email = email; @@ -451,16 +450,16 @@ public void setEmail(String email) { /** * Set the link related to the document. * - * @param link + * @param link link related to the document */ public void setLink(String link) { this.link = link; } /** - * Set the description of hte document link. + * Set the description of the document link. * - * @param linkText + * @param linkText the description of the document link */ public void setLinkText(String linkText) { this.linkText = linkText; @@ -469,7 +468,7 @@ public void setLinkText(String linkText) { /** * Gives the name of the document. * - * @return + * @return the name of the document */ public String getName() { return name; @@ -478,7 +477,7 @@ public String getName() { /** * Set the name of the document. * - * @param name + * @param name the name of the document */ public void setName(String name) { this.name = name; @@ -487,7 +486,7 @@ public void setName(String name) { /** * Gives the parser used to parse waypoint. * - * @return + * @return the wpt parse */ public AbstractGpxParserWpt getWptParser() { return wptParser; @@ -496,7 +495,7 @@ public AbstractGpxParserWpt getWptParser() { /** * Set the parser used to parse waypoint. * - * @param wptParser + * @param wptParser set the wptParser */ public void setWptParser(AbstractGpxParserWpt wptParser) { this.wptParser = wptParser; @@ -505,7 +504,7 @@ public void setWptParser(AbstractGpxParserWpt wptParser) { /** * Set the parser used to parse routes. * - * @param rteParser + * @param rteParser set the RTE parser */ public void setRteParser(AbstractGpxParserRte rteParser) { this.rteParser = rteParser; @@ -514,7 +513,7 @@ public void setRteParser(AbstractGpxParserRte rteParser) { /** * Gives the parser used to parse routes. * - * @return + * @return the Rte parser */ public AbstractGpxParserRte getRteParser() { return rteParser; @@ -523,7 +522,7 @@ public AbstractGpxParserRte getRteParser() { /** * Set the parser used to parse the track * - * @param trkParser + * @param trkParser set the trk parser */ public void setTrkParser(AbstractGpxParserTrk trkParser) { this.trkParser = trkParser; @@ -532,7 +531,7 @@ public void setTrkParser(AbstractGpxParserTrk trkParser) { /** * Givers the parser used to parse the track * - * @return + * @return the Trk parser */ public AbstractGpxParserTrk getTrkParser() { return trkParser; From 1604c84e131b11f292700b6e71bee6cda9168a52 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 11:30:33 +0100 Subject: [PATCH 11/26] Fix doc --- .../functions/osgi/H2GISOsgiDBFactory.java | 11 ++-- .../io/gpx/model/AbstractGpxParser.java | 56 +++++++++---------- .../org/h2gis/utilities/FileUtilities.java | 14 ++--- 3 files changed, 39 insertions(+), 42 deletions(-) diff --git a/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java b/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java index 8af22f230b..58e8999cbc 100644 --- a/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java +++ b/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java @@ -127,11 +127,10 @@ public static DataSource createDataSource(Properties properties, boolean initSpa /** * Create a database and return a DataSource - * @param dbName - * @param initSpatial - * @param h2Parameters - * @return - * @throws SQLException + * @param dbName database name + * @param initSpatial true to init spatial functions + * @param h2Parameters database parameters + * @return a connection */ public static DataSource createDataSource(String dbName ,boolean initSpatial, String h2Parameters) throws SQLException { // Create H2 memory DataSource @@ -156,7 +155,7 @@ public static DataSource createDataSource(String dbName ,boolean initSpatial, St * * @param dbName path to the database * @param h2_PARAMETERS Additional h2 parameters - * @return + * @return path to the database */ private static String initDBFile( String dbName, String h2_PARAMETERS ) { String dbFilePath = getDataBasePath(dbName); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParser.java index 750709c58c..52998de466 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParser.java @@ -74,7 +74,7 @@ public void characters(char[] ch, int start, int length) throws SAXException { /** * Gives the actual contentBuffer * - * @return + * @return get buffer */ public StringBuilder getContentBuffer() { return contentBuffer; @@ -83,7 +83,7 @@ public StringBuilder getContentBuffer() { /** * Set the contentBuffer. * - * @param contentBuffer + * @param contentBuffer set a buffer */ public void setContentBuffer(StringBuilder contentBuffer) { this.contentBuffer = contentBuffer; @@ -93,7 +93,7 @@ public void setContentBuffer(StringBuilder contentBuffer) { * Gives a string representing the value of the element which is being * parsed. * - * @return + * @return get the current element */ public String getCurrentElement() { return currentElement; @@ -103,7 +103,7 @@ public String getCurrentElement() { * Set the string representing the value of the element which is being * parsed. * - * @param currentElement + * @param currentElement set current element */ public void setCurrentElement(String currentElement) { this.currentElement = currentElement; @@ -112,7 +112,7 @@ public void setCurrentElement(String currentElement) { /** * Gives the point which is being parsed. * - * @return + * @return current gpx point */ public GPXPoint getCurrentPoint() { return currentPoint; @@ -121,7 +121,7 @@ public GPXPoint getCurrentPoint() { /** * Set the point which will be parsed. * - * @param currentPoint + * @param currentPoint set current gpx point */ public void setCurrentPoint(GPXPoint currentPoint) { this.currentPoint = currentPoint; @@ -129,7 +129,7 @@ public void setCurrentPoint(GPXPoint currentPoint) { /** * Gives the XMLReader used to parse the document. - * @return + * @return get {@link XMLReader} */ public XMLReader getReader() { return reader; @@ -138,7 +138,7 @@ public XMLReader getReader() { /** * Set the XMLReader used to parse the document. * - * @param reader + * @param reader set {@link XMLReader} */ public void setReader(XMLReader reader) { this.reader = reader; @@ -147,7 +147,7 @@ public void setReader(XMLReader reader) { /** * Gives the actual StringStack elementNames * - * @return + * @return the element names */ public StringStack getElementNames() { return elementNames; @@ -156,7 +156,7 @@ public StringStack getElementNames() { /** * Set the actual StringStack elementNames * - * @param elementNames + * @param elementNames set element names */ public void setElementNames(StringStack elementNames) { this.elementNames = elementNames; @@ -174,7 +174,7 @@ public boolean isSpecificElement() { /** * Set the indicator to know if we are in a specific element. * - * @param specificElement + * @param specificElement set true it's a specific element type */ public void setSpecificElement(boolean specificElement) { this.specificElement = specificElement; @@ -183,7 +183,7 @@ public void setSpecificElement(boolean specificElement) { /** * Get the PreparedStatement of the waypoints table. * - * @return + * @return the waypoints preparedstatement */ public PreparedStatement getWptPreparedStmt() { return wptPreparedStmt; @@ -192,7 +192,7 @@ public PreparedStatement getWptPreparedStmt() { /** * Set the PreparedStatement of the waypoints table. * - * @param wptPreparedStmt + * @param wptPreparedStmt set the waypoints preparedstatement */ public void setWptPreparedStmt(PreparedStatement wptPreparedStmt) { this.wptPreparedStmt = wptPreparedStmt; @@ -201,7 +201,7 @@ public void setWptPreparedStmt(PreparedStatement wptPreparedStmt) { /** * Set the PreparedStatement of the route table. * - * @param rtePreparedStmt + * @param rtePreparedStmt set the routes preparedstatement */ public void setRtePreparedStmt(PreparedStatement rtePreparedStmt) { this.rtePreparedStmt = rtePreparedStmt; @@ -210,7 +210,7 @@ public void setRtePreparedStmt(PreparedStatement rtePreparedStmt) { /** * Gives the preparedstatement used to store route data * - * @return + * @return get the routes preparedstatement */ public PreparedStatement getRtePreparedStmt() { return rtePreparedStmt; @@ -219,7 +219,7 @@ public PreparedStatement getRtePreparedStmt() { /** * Set the PreparedStatement of the route points table. * - * @param rteptPreparedStmt + * @param rteptPreparedStmt set the routes preparedstatement */ public void setRteptPreparedStmt(PreparedStatement rteptPreparedStmt) { this.rteptPreparedStmt = rteptPreparedStmt; @@ -228,7 +228,7 @@ public void setRteptPreparedStmt(PreparedStatement rteptPreparedStmt) { /** * Gives the prepared statement used to store the route points. * - * @return + * @return the routes preparedstatement */ public PreparedStatement getRteptPreparedStmt() { return rteptPreparedStmt; @@ -236,7 +236,7 @@ public PreparedStatement getRteptPreparedStmt() { /** * Gives the prepared statement used to store the track. - * @return + * @return the track preparedstatement */ public PreparedStatement getTrkPreparedStmt() { return trkPreparedStmt; @@ -244,7 +244,7 @@ public PreparedStatement getTrkPreparedStmt() { /** * Gives the prepared statement used to store the track points. - * @return + * @return the points preparedstatement */ public PreparedStatement getTrkPointsPreparedStmt() { return trkPointsPreparedStmt; @@ -252,7 +252,7 @@ public PreparedStatement getTrkPointsPreparedStmt() { /** * Gives the prepared statement used to store the track segments. - * @return + * @return the track preparedstatement */ public PreparedStatement getTrkSegmentsPreparedStmt() { return trkSegmentsPreparedStmt; @@ -260,7 +260,7 @@ public PreparedStatement getTrkSegmentsPreparedStmt() { /** * Set the prepared statement used to store the track. - * @param trkPreparedStmt + * @param trkPreparedStmt set the preparedstatement to save the tracks */ public void setTrkPreparedStmt(PreparedStatement trkPreparedStmt) { this.trkPreparedStmt = trkPreparedStmt; @@ -268,7 +268,7 @@ public void setTrkPreparedStmt(PreparedStatement trkPreparedStmt) { /** * Set the prepared statement used to store the track segments. - * @param trkSegmentsPreparedStmt + * @param trkSegmentsPreparedStmt set the preparedstatement to save the lines */ public void setTrkSegmentsPreparedStmt(PreparedStatement trkSegmentsPreparedStmt) { this.trkSegmentsPreparedStmt = trkSegmentsPreparedStmt; @@ -276,7 +276,7 @@ public void setTrkSegmentsPreparedStmt(PreparedStatement trkSegmentsPreparedStmt /** * Set the prepared statement used to store the track points. - * @param trkPointsPreparedStmt + * @param trkPointsPreparedStmt set the preparedstatement to store points */ public void setTrkPointsPreparedStmt(PreparedStatement trkPointsPreparedStmt) { this.trkPointsPreparedStmt = trkPointsPreparedStmt; @@ -285,7 +285,7 @@ public void setTrkPointsPreparedStmt(PreparedStatement trkPointsPreparedStmt) { /** * Gives the segment which is being parsed. * - * @return + * @return current gpx line */ public GPXLine getCurrentSegment() { return currentSegment; @@ -294,7 +294,7 @@ public GPXLine getCurrentSegment() { /** * Set the segment which will be parsed. * - * @param currentSegment + * @param currentSegment input GPX line */ public void setCurrentSegment(GPXLine currentSegment) { this.currentSegment = currentSegment; @@ -303,7 +303,7 @@ public void setCurrentSegment(GPXLine currentSegment) { /** * Gives a geometryFactory to construct gpx geometries * - * @return + * @return current geometry factory */ public GeometryFactory getGeometryFactory() { return geometryFactory; @@ -312,7 +312,7 @@ public GeometryFactory getGeometryFactory() { /** * Gives the line which is being parsed. * - * @return + * @return gpx line */ public GPXLine getCurrentLine() { return currentLine; @@ -321,7 +321,7 @@ public GPXLine getCurrentLine() { /** * Set the line which will be parsed. * - * @param currentLine + * @param currentLine set the line to parse */ public void setCurrentLine(GPXLine currentLine) { this.currentLine = currentLine; diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java index 93a04cd27a..e6c9461062 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java @@ -398,11 +398,9 @@ public static String getRelativePath(File base, File file) { * Check if the file is well formatted regarding an extension prefix. * Check also if the file doesn't exist. * - * @param file - * @param prefix - * @return - * @throws SQLException - * @throws java.io.FileNotFoundException + * @param file file to import + * @param prefix file extension + * @return true if the file exists */ public static boolean isFileImportable(File file, String prefix) throws SQLException, FileNotFoundException{ if (isExtensionWellFormated(file, prefix)) { @@ -418,9 +416,9 @@ public static boolean isFileImportable(File file, String prefix) throws SQLExcep /** * Check if the file has the good extension - * @param file - * @param prefix - * @return + * @param file file to import + * @param prefix file extension + * @return true if the file exists */ public static boolean isExtensionWellFormated(File file, String prefix) { String path = file.getAbsolutePath(); From 649faf1010ed8872661646a2836ec2a4393394eb Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 13:45:27 +0100 Subject: [PATCH 12/26] Fix doc --- .../functions/osgi/H2GISOsgiDBFactory.java | 6 --- .../io/gpx/model/GPXTablesFactory.java | 38 ++++++++----------- .../h2gis/functions/io/kml/KMLGeometry.java | 5 +-- .../functions/io/kml/KMLWriterDriver.java | 3 -- .../org/h2gis/functions/io/kml/ST_AsKml.java | 14 +++---- .../org/h2gis/functions/io/osm/OSMParser.java | 10 ++--- .../org/h2gis/functions/io/osm/OSMRead.java | 2 - .../functions/io/osm/OSMTablesFactory.java | 7 ++-- .../metadata/GeometryTableUtilsTest.java | 5 --- .../network/functions/NetworkFunctions.java | 1 - .../network/functions/ST_Accessibility.java | 2 - .../functions/ST_ConnectedComponents.java | 1 - .../network/functions/ST_GraphAnalysis.java | 10 ----- .../functions/ST_ShortestPathLength.java | 4 -- .../h2gis/utilities/GeographyUtilities.java | 5 +-- .../utilities/GeometryTableUtilities.java | 9 ----- .../org/h2gis/utilities/JDBCUtilities.java | 2 - .../org/h2gis/utilities/SpatialResultSet.java | 2 - .../org/h2gis/utilities/TableLocation.java | 1 - .../jts_utils/GeometryFeatureUtils.java | 2 - 20 files changed, 33 insertions(+), 96 deletions(-) diff --git a/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java b/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java index 58e8999cbc..e2b279722f 100644 --- a/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java +++ b/h2gis-functions-osgi/src/main/java/org/h2gis/functions/osgi/H2GISOsgiDBFactory.java @@ -49,7 +49,6 @@ private H2GISOsgiDBFactory() { * Open the connection to an existing database * @param dbName name of the database * @return a connection to the database - * @throws SQLException */ public static Connection openSpatialDataBase(String dbName) throws SQLException { String dbFilePath = getDataBasePath(dbName); @@ -63,8 +62,6 @@ public static Connection openSpatialDataBase(String dbName) throws SQLException * Create a spatial database * @param dbName filename * @return Connection - * @throws SQLException - * @throws ClassNotFoundException */ public static Connection createSpatialDataBase(String dbName)throws SQLException, ClassNotFoundException { return createSpatialDataBase(dbName,true); @@ -88,7 +85,6 @@ private static String getDataBasePath(String dbName) { * @param dbName DataBase name, or path URI * @param initSpatial True to enable basic spatial capabilities * @return DataSource - * @throws SQLException */ public static DataSource createDataSource(String dbName ,boolean initSpatial) throws SQLException { return createDataSource(dbName, initSpatial, H2_PARAMETERS); @@ -98,7 +94,6 @@ public static DataSource createDataSource(String dbName ,boolean initSpatial) th * Create a database, init spatial funcyion and return a DataSource * @param properties for the opening of the DataBase. * @return a DataSource - * @throws SQLException */ public static DataSource createDataSource(Properties properties) throws SQLException { return createDataSource(properties, true); @@ -109,7 +104,6 @@ public static DataSource createDataSource(Properties properties) throws SQLExcep * @param properties for the opening of the DataBase. * @param initSpatial true to load the spatial functions * @return a DataSource - * @throws SQLException */ public static DataSource createDataSource(Properties properties, boolean initSpatial) throws SQLException { // Create H2 memory DataSource diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java index 7fbbc65c3c..91d6abcfe6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java @@ -52,9 +52,8 @@ private GPXTablesFactory() { * Create the waypoints table that will be used to import GPX data * * @param connection database connection - * @param wayPointsTableName - * @return - * @throws SQLException + * @param wayPointsTableName table name + * @return PreparedStatement */ public static PreparedStatement createWayPointsTable(Connection connection, String wayPointsTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -99,9 +98,8 @@ public static PreparedStatement createWayPointsTable(Connection connection, Stri * Create the route table that will be used to import GPX data * * @param connection database connection - * @param routeTableName - * @return - * @throws SQLException + * @param routeTableName table name + * @return PreparedStatement */ public static PreparedStatement createRouteTable(Connection connection, String routeTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -133,10 +131,9 @@ public static PreparedStatement createRouteTable(Connection connection, String r /** * Createthe route points table to store the route waypoints * - * @param connection - * @param routePointsTable - * @return - * @throws SQLException + * @param connection database + * @param routePointsTable table name + * @return PreparedStatement */ public static PreparedStatement createRoutePointsTable(Connection connection, String routePointsTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -182,10 +179,9 @@ public static PreparedStatement createRoutePointsTable(Connection connection, St /** * Creat the track table * - * @param connection - * @param trackTableName - * @return - * @throws SQLException + * @param connection database + * @param trackTableName table name + * @return PreparedStatement */ public static PreparedStatement createTrackTable(Connection connection, String trackTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -217,10 +213,9 @@ public static PreparedStatement createTrackTable(Connection connection, String t /** * Create the track segments table to store the segments of a track * - * @param connection - * @param trackSegementsTableName - * @return - * @throws SQLException + * @param connection database + * @param trackSegementsTableName table name + * @return PreparedStatement */ public static PreparedStatement createTrackSegmentsTable(Connection connection, String trackSegementsTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -245,10 +240,9 @@ public static PreparedStatement createTrackSegmentsTable(Connection connection, /** * Create the track points table to store the track waypoints * - * @param connection - * @param trackPointsTableName - * @return - * @throws SQLException + * @param connection database + * @param trackPointsTableName table name + * @return PreparedStatement */ public static PreparedStatement createTrackPointsTable(Connection connection, String trackPointsTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java index c383804ca7..57dddb45cd 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java @@ -37,9 +37,8 @@ private KMLGeometry() { /** * Convert JTS geometry to a kml geometry representation. * - * @param geom - * @param sb - * @throws SQLException + * @param geom input geometry + * @param sb buffer to store the KML */ public static void toKMLGeometry(Geometry geom, StringBuilder sb) throws SQLException { toKMLGeometry(geom, ExtrudeMode.NONE, AltitudeMode.NONE, sb); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java index 3d7453cb0b..91af012a53 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java @@ -66,8 +66,6 @@ public KMLWriterDriver(Connection connection, File fileName, String encoding, bo * * @param tableName the name of table or a select query * @param progress progress monitor - * @throws SQLException - * @throws java.io.IOException */ public void write( String tableName, ProgressVisitor progress) throws SQLException, IOException { String regex = ".*(?i)\\b(select|from)\\b.*"; @@ -155,7 +153,6 @@ else if (fileName.exists()) { * Write the spatial table to a KML format * * @param progress Progress visitor following the execution. - * @throws SQLException */ private void writeKML(ProgressVisitor progress,File fileName,ResultSet rs,String geomField, String encoding) throws SQLException { FileOutputStream fos = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java index 47114a2c87..69ea53410a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java @@ -50,9 +50,8 @@ public String getJavaStaticMethod() { /** * Generate a KML geometry * - * @param geometry - * @return - * @throws SQLException + * @param geometry input geometry + * @return kml representation */ public static String toKml(Geometry geometry) throws SQLException { StringBuilder sb = new StringBuilder(); @@ -75,11 +74,10 @@ public static String toKml(Geometry geometry) throws SQLException { * * No altitude : NONE = 0; * - * @param geometry - * @param altitudeModeEnum - * @param extrude - * @return - * @throws SQLException + * @param geometry input geometry + * @param altitudeModeEnum altitude mode ground, flat + * @param extrude true to extrude + * @return kml representation */ public static String toKml(Geometry geometry, boolean extrude, int altitudeModeEnum) throws SQLException { StringBuilder sb = new StringBuilder(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java index 3cd0e749d6..7ff6d53642 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java @@ -115,10 +115,9 @@ public OSMParser(Connection connection, File fileName, String encoding, boolean /** * Read the OSM file and create its corresponding tables. * - * @param tableName + * @param tableName table name * @param progress Progress visitor following the execution. - * @return - * @throws SQLException + * @return list of table names created */ public String[] read(String tableName, ProgressVisitor progress) throws SQLException { if(fileName == null || !(fileName.getName().endsWith(".osm") || fileName.getName().endsWith("osm.gz") || fileName.getName().endsWith("osm.bz2"))) { @@ -228,9 +227,8 @@ public String[] read(String tableName, ProgressVisitor progress) throws SQLExcep * * @param connection database connection * @param dbType Database type. - * @param requestedTable - * @param osmTableName - * @throws SQLException + * @param requestedTable input table name + * @param osmTableName prefixed table name */ private void checkOSMTables(Connection connection, DBTypes dbType, TableLocation requestedTable, String osmTableName) throws SQLException { String[] omsTables = new String[]{OSMTablesFactory.NODE, OSMTablesFactory.NODE_TAG, OSMTablesFactory.WAY, OSMTablesFactory.WAY_NODE, diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java index d53786f3d7..5a0940f326 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java @@ -65,8 +65,6 @@ public String getJavaStaticMethod() { * @param tableReference output table name * @param option true to delete the existing tables or set a chartset * encoding - * @throws FileNotFoundException - * @throws SQLException */ public static void importTable(Connection connection, String fileName, String tableReference, Value option) throws SQLException, IOException { String encoding = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java index 294b037ebb..245f7bb04a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java @@ -78,10 +78,9 @@ private OSMTablesFactory() { * timestamp="2008-09-21T21:37:45Z"/> * } * - * @param connection - * @param nodeTableName - * @return - * @throws SQLException + * @param connection database + * @param nodeTableName table name + * @return PreparedStatement */ public static PreparedStatement createNodeTable(Connection connection, String nodeTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/metadata/GeometryTableUtilsTest.java b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/metadata/GeometryTableUtilsTest.java index 785769f7d3..e46df797e2 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/metadata/GeometryTableUtilsTest.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/metadata/GeometryTableUtilsTest.java @@ -392,7 +392,6 @@ public void testGetSRIDFromColumn() throws SQLException { /** * Check constraint pass * - * @throws SQLException */ @Test public void testColumnSRIDGeometryColumns3() throws SQLException { @@ -410,7 +409,6 @@ public void testColumnSRIDGeometryColumns3() throws SQLException { /** * Check constraint pass * - * @throws SQLException */ @Test public void testColumnSRIDGeometryColumns() throws SQLException { @@ -427,7 +425,6 @@ public void testColumnSRIDGeometryColumns() throws SQLException { /** * Check constraint pass * - * @throws SQLException */ @Test public void testColumnSRIDGeometryColumns2() throws SQLException { @@ -444,7 +441,6 @@ public void testColumnSRIDGeometryColumns2() throws SQLException { /** * Check constraint pass * - * @throws SQLException */ @Test public void testColumnSRIDGeometryColumns4() throws SQLException { @@ -463,7 +459,6 @@ public void testColumnSRIDGeometryColumns4() throws SQLException { /** * Check constraint pass * - * @throws SQLException */ @Test public void testColumnSRIDGeometryColumns5() throws SQLException { diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java b/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java index 9e89f605ba..9008d65d65 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/NetworkFunctions.java @@ -58,7 +58,6 @@ public static Function[] getBuiltInsFunctions() throws SQLException { * Init H2 DataBase with the network functions * * @param connection Active connection - * @throws SQLException */ public static void load(Connection connection) throws SQLException { Statement st = connection.createStatement(); diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_Accessibility.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_Accessibility.java index 9ed635cdde..9453b3ffa9 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_Accessibility.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_Accessibility.java @@ -82,7 +82,6 @@ public String getJavaStaticMethod() { * @param arg3 Destination string or destination table * @return Table with closest destination id and distance to closest * destination - * @throws SQLException */ public static ResultSet getAccessibility(Connection connection, String inputTable, @@ -99,7 +98,6 @@ public static ResultSet getAccessibility(Connection connection, * @param arg4 Destination string or destination table * @return Table with closest destination id and distance to closest * destination - * @throws SQLException */ public static ResultSet getAccessibility(Connection connection, String inputTable, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ConnectedComponents.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ConnectedComponents.java index ca8029f140..84d8ee1ab8 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ConnectedComponents.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ConnectedComponents.java @@ -86,7 +86,6 @@ public String getJavaStaticMethod() { * @param inputTable Edges table produced by ST_Graph * @param orientation Orientation string * @return True if the calculation was successful - * @throws SQLException */ public static boolean getConnectedComponents(Connection connection, String inputTable, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java index 28b0f40653..e72600ff3e 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java @@ -92,11 +92,6 @@ public String getJavaStaticMethod() { * @param inputTable Input table * @param orientation Global orientation * @return True if the calculation was successful - * @throws SQLException - * @throws NoSuchMethodException - * @throws InstantiationException - * @throws IllegalAccessException - * @throws InvocationTargetException */ public static boolean doGraphAnalysis(Connection connection, String inputTable, @@ -115,11 +110,6 @@ public static boolean doGraphAnalysis(Connection connection, * @param orientation Global orientation * @param weight Edge weight column name * @return True if the calculation was successful - * @throws SQLException - * @throws InvocationTargetException - * @throws NoSuchMethodException - * @throws InstantiationException - * @throws IllegalAccessException */ public static boolean doGraphAnalysis(Connection connection, String inputTable, diff --git a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java index 5f3812020a..bea0f51090 100644 --- a/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java +++ b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_ShortestPathLength.java @@ -144,7 +144,6 @@ public static ResultSet getShortestPathLength(Connection connection, * Source vertex id -OR- Source-Destination table -OR- * Destination table * @return Distances table - * @throws SQLException */ public static ResultSet getShortestPathLength(Connection connection, String inputTable, @@ -205,7 +204,6 @@ public static ResultSet getShortestPathLength(Connection connection, * @param arg4 Source vertex id -OR- Source table * @param arg5 Destination vertex id -OR- Destination string -OR- Destination table * @return Distances table - * @throws SQLException */ public static ResultSet getShortestPathLength(Connection connection, String inputTable, @@ -347,7 +345,6 @@ private static ResultSet manyToManySeparateTables( * @param graph Graph * @param tableName Table * @return Set of VDijkstra - * @throws SQLException */ private static Set getSet(Statement st, KeyedGraph graph, String tableName) throws SQLException { @@ -408,7 +405,6 @@ private static ResultSet oneToSeveral(Connection connection, * @param sourceDestinationTable Source-Destination table name * @param graph Graph * @return Source-Destination map - * @throws SQLException */ private static Map> prepareSourceDestinationMap( Statement st, diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java index 000f765f17..890b05f898 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java @@ -220,10 +220,9 @@ public static double getHaversineDistanceInMeters(Coordinate coordA, Coordinate * Return a SRID code from latitude and longitude coordinates * * @param connection to the database - * @param latitude - * @param longitude + * @param latitude latitude value + * @param longitude longitude value * @return a SRID code - * @throws SQLException */ public static int getSRID(Connection connection, float latitude, float longitude) throws SQLException { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index 458d183f34..a442d1df2b 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -523,7 +523,6 @@ private static GeometryMetaData createMetadataFromPostGIS(String type, int coord * * @return Prepared statement * - * @throws SQLException */ public static PreparedStatement prepareInformationSchemaStatement(Connection connection, String catalog, String schema, String table, @@ -549,7 +548,6 @@ public static PreparedStatement prepareInformationSchemaStatement(Connection con * * @return Prepared statement * - * @throws SQLException */ public static PreparedStatement prepareInformationSchemaStatement(Connection connection, String catalog, String schema, String table, @@ -598,7 +596,6 @@ public static PreparedStatement prepareInformationSchemaStatement(Connection con * * @return The name and index of first geometry field * - * @throws SQLException */ public static Tuple getFirstGeometryColumnNameAndIndex(ResultSet resultSet) throws SQLException { ResultSetMetaData meta = resultSet.getMetaData(); @@ -618,7 +615,6 @@ public static Tuple getFirstGeometryColumnNameAndIndex(ResultSe * * @return True if the ResultSet contains one geometry field * - * @throws SQLException */ public static boolean hasGeometryColumn(ResultSet resultSet) throws SQLException { ResultSetMetaData meta = resultSet.getMetaData(); @@ -639,7 +635,6 @@ public static boolean hasGeometryColumn(ResultSet resultSet) throws SQLException * * @return True if the ResultSet contains one geometry field * - * @throws SQLException */ public static boolean hasGeometryColumn(Connection connection, String tableLocation) throws SQLException { return hasGeometryColumn(connection, TableLocation.parse(tableLocation, getDBType(connection))); @@ -653,7 +648,6 @@ public static boolean hasGeometryColumn(Connection connection, String tableLocat * * @return True if the ResultSet contains one geometry field * - * @throws SQLException */ public static boolean hasGeometryColumn(Connection connection, TableLocation tableLocation) throws SQLException { Statement statement = connection.createStatement(); @@ -683,7 +677,6 @@ public static boolean hasGeometryColumn(Connection connection, TableLocation tab * @return A geometry that represents the full extend of the first geometry * column in the ResultSet * - * @throws SQLException */ public static Geometry getEnvelope(ResultSet resultSet) throws SQLException { return getEnvelope(resultSet, getFirstGeometryColumnNameAndIndex(resultSet).first()); @@ -700,7 +693,6 @@ public static Geometry getEnvelope(ResultSet resultSet) throws SQLException { * * @return The full extend of the geometry column name in the ResultSet * - * @throws SQLException */ public static Geometry getEnvelope(ResultSet resultSet, String geometryColumnName) throws SQLException { //First one @@ -850,7 +842,6 @@ public static Geometry getEstimatedExtent(Connection connection, TableLocation t * * @return The SRID of the first geometry column * - * @throws SQLException */ public static int getSRID(Connection connection,String tableName, String geometryColumnName) throws SQLException { return getSRID(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection)), geometryColumnName); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java index 5704b1662a..17067ec605 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java @@ -163,7 +163,6 @@ private static boolean hasField(ResultSetMetaData resultSetMetaData, String fiel * @param resultSetMetaData Active result set meta data. * @param fieldName Field name, ignore case * @return The field index [1-n]; -1 if the field is not found - * @throws SQLException */ public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fieldName) throws SQLException { int columnCount = resultSetMetaData.getColumnCount(); @@ -181,7 +180,6 @@ public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fiel * @param resultSetMetaData Active result set meta data. * @param columnIndex Column index * @return The column name - * @throws SQLException */ public static String getColumnName(ResultSetMetaData resultSetMetaData, Integer columnIndex) throws SQLException { int columnCount = resultSetMetaData.getColumnCount(); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSet.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSet.java index 53cd627c45..57f1a51e55 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSet.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/SpatialResultSet.java @@ -71,7 +71,6 @@ public interface SpatialResultSet extends ResultSet { * @param columnIndex Field index * @param geometry Geometry instance * - * @throws SQLException */ void updateGeometry(int columnIndex, Geometry geometry) throws SQLException; @@ -81,7 +80,6 @@ public interface SpatialResultSet extends ResultSet { * @param columnLabel Field name * @param geometry Geometry instance * - * @throws SQLException */ void updateGeometry(String columnLabel, Geometry geometry) throws SQLException; diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java index acd30d4209..be90d2f484 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java @@ -44,7 +44,6 @@ public class TableLocation { /** * @param rs result set obtained through {@link java.sql.DatabaseMetaData#getTables(String, String, String, String[])} - * @throws SQLException */ public TableLocation(ResultSet rs) throws SQLException { this(rs.getString("TABLE_CAT"),rs.getString("TABLE_SCHEM"),rs.getString("TABLE_NAME")); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java index 74a6a6fd7b..8a5265d185 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java @@ -38,7 +38,6 @@ public class GeometryFeatureUtils { * @param connection to the database * @param query the select query to execute * @return a JSON list - * @throws SQLException */ public static ArrayList toList(Connection connection, String query) throws SQLException { return toList(connection, query, maxdecimaldigits); @@ -49,7 +48,6 @@ public static ArrayList toList(Connection connection, String query) throws SQLEx * @param query the select query to execute * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places * @return a JSON list - * @throws SQLException */ public static ArrayList toList(Connection connection, String query, int maxdecimaldigits) throws SQLException { if (connection == null || query == null) { From aea71cd9d938782dca570f8ac2e292bee5d092f9 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 14:12:46 +0100 Subject: [PATCH 13/26] Fix doc --- .../org/h2gis/functions/io/osm/OSMParser.java | 7 +- .../org/h2gis/functions/io/osm/OSMRead.java | 6 +- .../h2gis/functions/io/utility/PRJUtil.java | 8 +- .../org/h2gis/utilities/FileUtilities.java | 14 +-- .../h2gis/utilities/GeographyUtilities.java | 4 +- .../org/h2gis/utilities/GeometryMetaData.java | 36 +++--- .../utilities/GeometryTableUtilities.java | 106 +++++++----------- .../main/java/org/h2gis/utilities/Tuple.java | 6 +- .../h2gis/utilities/GeographyUtilsTest.java | 2 +- .../jts_utils/VisibilityAlgorithmTest.java | 2 - 10 files changed, 73 insertions(+), 118 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java index 7ff6d53642..99ee5ba07d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java @@ -500,10 +500,9 @@ private int insertBatch(PreparedStatement st, int batchSize) throws SQLException } /** - * - * @param osmElement - * @param attributes - * @throws ParseException + * Init the commons OSM attributes + * @param osmElement {@link OSMElement} + * @param attributes {@link Attributes} */ private void setCommonsAttributes(OSMElement osmElement, Attributes attributes) throws SAXException { osmElement.setId(attributes.getValue("id")); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java index 5a0940f326..9189a3c570 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMRead.java @@ -83,9 +83,7 @@ public static void importTable(Connection connection, String fileName, String ta * * @param connection database connection * @param fileName input file - * @param option - * @throws FileNotFoundException - * @throws SQLException + * @param option file options */ public static void importTable(Connection connection, String fileName, Value option) throws SQLException, IOException { String tableReference = null; @@ -122,8 +120,6 @@ public static void importTable(Connection connection, String fileName, String ta * * @param connection database connection * @param fileName input file - * @throws FileNotFoundException - * @throws SQLException */ public static void importTable(Connection connection, String fileName) throws SQLException, IOException { final String name = URIUtilities.fileFromString(fileName).getName(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java index 42d10831e9..e64dcc17ad 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java @@ -105,9 +105,7 @@ public static int getValidSRID(Connection connection, File prjFile) throws SQLEx * Return the content of the PRJ file as a single string * * @param prjFile - * @return - * @throws FileNotFoundException - * @throws IOException + * @return prj content */ private static String readPRJFile(File prjFile) throws FileNotFoundException, IOException { try (FileInputStream fis = new FileInputStream(prjFile)) { @@ -127,8 +125,6 @@ private static String readPRJFile(File prjFile) throws FileNotFoundException, IO * @param location input table name * @param geomField geometry field name * @param fileName path of the prj file - * @throws SQLException - * @throws FileNotFoundException */ public static void writePRJ(Connection connection, TableLocation location, String geomField, File fileName) throws SQLException, FileNotFoundException { int srid = GeometryTableUtilities.getSRID(connection, location, geomField); @@ -141,8 +137,6 @@ public static void writePRJ(Connection connection, TableLocation location, Strin * @param connection database connection * @param srid srid code * @param fileName path of the prj file - * @throws SQLException - * @throws FileNotFoundException */ public static void writePRJ(Connection connection, int srid, File fileName) throws SQLException, FileNotFoundException { if (srid != 0) { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java index e6c9461062..c10ab8b204 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/FileUtilities.java @@ -145,8 +145,6 @@ public static List listFiles(File directory) throws IOException { * Unzip to a directory * * @param zipFile the zipped file - * @throws FileNotFoundException - * @throws IOException Throw an exception if the parent file fails */ public static void unzip(File zipFile) throws IOException { Path parentDir = zipFile.toPath().getParent(); @@ -164,8 +162,6 @@ public static void unzip(File zipFile) throws IOException { * * @param zipFile the zipped file * @param directory the directory to unzi the file - * @throws FileNotFoundException - * @throws IOException Throw an exception if the file directory is not accessible */ public static void unzip(File zipFile, File directory) throws IOException { if (directory == null) { @@ -244,8 +240,8 @@ public static File newFile(File destinationDir, ZipEntry zipEntry) throws IOExce /** * Zips the specified files * - * @param filesToZip - * @param outFile + * @param filesToZip input files to zip + * @param outFile output file zipped */ public static void zip(File[] filesToZip, File outFile) throws IOException { if (filesToZip == null) { @@ -298,7 +294,7 @@ else if (outFile.exists()){ /** * Zips the specified file or folder * - * @param toZip + * @param toZip file or folder to zip */ public static void zip(File toZip) throws IOException { Path parentDir = toZip.toPath().getParent(); @@ -314,8 +310,8 @@ public static void zip(File toZip) throws IOException { /** * Zips the specified file or folder * - * @param toZip - * @param outFile + * @param toZip input file or folder to zip + * @param outFile output file zipped */ public static void zip(File toZip, File outFile) throws IOException { if (toZip == null || !toZip.exists()) { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java index 890b05f898..b1a47232ec 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeographyUtilities.java @@ -200,8 +200,8 @@ public static double computeLongitudeDistance(double meters, double latitude) { * Haversine formula. See https://fr.wikipedia.org/wiki/Formule_de_haversine * This calculation is done using the approximate earth radius * - * @param coordA - * @param coordB + * @param coordA coordinate A + * @param coordB coordinate B * @return distance in meters */ public static double getHaversineDistanceInMeters(Coordinate coordA, Coordinate coordB) { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java index d2d675bf37..f443c6799d 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryMetaData.java @@ -114,7 +114,7 @@ public GeometryMetaData() { /** * Linked with the H2 ValueGeometry model * - * @param valueGeometry + * @param valueGeometry input geometry to find metadata */ private GeometryMetaData(ValueGeometry valueGeometry) { this.SRID = valueGeometry.getSRID(); @@ -190,7 +190,7 @@ public int getDimension() { * Return a string representation of the geometry type as defined in SQL/MM * specification. SQL-MM 3: 5.1.4 and OGC SFS 1.2 * - * @return + * @return the string representation of the geometry type as defined in SQL/MM */ public String getGeometryType() { return geometryType; @@ -200,7 +200,7 @@ public String getGeometryType() { * Return an integer code representation of the geometry type as defined in * SQL/MM specification. SQL-MM 3: 5.1.4 and OGC SFS 1.2 * - * @return + * @return the geometry type code */ public int getGeometryTypeCode() { return geometryTypeCode; @@ -209,7 +209,7 @@ public int getGeometryTypeCode() { /** * Return the SRID * - * @return + * @return the srid */ public int getSRID() { return SRID; @@ -218,7 +218,7 @@ public int getSRID() { /** * true if the geometry as a M dimension * - * @return + * @return true if the geometry as a M dimension */ public boolean hasM() { return hasM; @@ -227,7 +227,7 @@ public boolean hasM() { /** * true if the geometry as a Z dimension * - * @return + * @return true if the geometry as a Z dimension */ public boolean hasZ() { return hasZ; @@ -243,7 +243,7 @@ public void setSfs_geometryTypeCode(int sfs_geometryTypeCode) { /** * Get SFS type code - * @return + * @return the SFS type code */ public String getSfs_geometryType() { return sfs_geometryType; @@ -251,7 +251,7 @@ public String getSfs_geometryType() { /** * Set the dimension of the geometry - * @param dimension + * @param dimension set the dimension of the geometry */ public void setDimension(int dimension) { this.dimension = dimension; @@ -259,7 +259,7 @@ public void setDimension(int dimension) { /** * Set full geometry type with +1000 - * @param geometryTypeCode + * @param geometryTypeCode set the geometry type code */ public void setGeometryTypeCode(int geometryTypeCode) { this.geometryTypeCode = geometryTypeCode; @@ -268,7 +268,7 @@ public void setGeometryTypeCode(int geometryTypeCode) { /** * Set the geometry type name - * @param geometryType + * @param geometryType set the geometry type */ public void setGeometryType(String geometryType) { this.geometryType = geometryType; @@ -276,7 +276,7 @@ public void setGeometryType(String geometryType) { /** * Set the SRID - * @param SRID + * @param SRID set the srid */ public void setSRID(int SRID) { this.SRID = SRID; @@ -284,7 +284,7 @@ public void setSRID(int SRID) { /** * Set the SFS geometry type name - * @param sfs_geometryType + * @param sfs_geometryType set the SFS geometry type */ public void setSfs_geometryType(String sfs_geometryType) { this.sfs_geometryType = sfs_geometryType; @@ -292,14 +292,14 @@ public void setSfs_geometryType(String sfs_geometryType) { /** * True is geometry has M - * @param hasM + * @param hasM true if the geometry as a M dimension */ public void setHasM(boolean hasM) { this.hasM = hasM; } /** * True is geometry has Z - * @param hasZ + * @param hasZ true if the geometry as a Z dimension */ public void setHasZ(boolean hasZ) { this.hasZ = hasZ; @@ -308,7 +308,7 @@ public void setHasZ(boolean hasZ) { /** * Return the SQL representation of the geometry signature * - * @return + * @return SQL geometry representation */ public String getSQL() { StringBuilder sb = new StringBuilder("GEOMETRY"); @@ -360,7 +360,7 @@ public static GeometryMetaData getMetaData(byte[] bytes) { /** * Read the first bytes of Geometry. * - * @param geometry + * @param geometry input geometry * @return Geometry MetaData */ public static GeometryMetaData getMetaData(Geometry geometry) { @@ -377,7 +377,7 @@ public static GeometryMetaData getMetaData(Geometry geometry) { * POINT(0 0) * * GEOMETRY - * GEOMETRY(POINTZ) + * GEOMETRY(POINTZ) * GEOMETRY(POINTZ, 4326) * * @param geometry string representation @@ -722,7 +722,7 @@ public static GeometryMetaData createMetadataFromGeometryType(String type, int s /** * Return the SFS geometry type code - * @return + * @return the SFS geometry type code */ public int getSfs_geometryTypeCode() { return sfs_geometryTypeCode; diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index a442d1df2b..88a408526c 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -138,9 +138,8 @@ public static LinkedHashMap getMetaData(ResultSet resu * Read all geometry metadata from a table * * @param connection database connection - * @param geometryTable + * @param geometryTable geometry table name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static LinkedHashMap getMetaData(Connection connection, String geometryTable) throws SQLException { return getMetaData(connection, TableLocation.parse(geometryTable, getDBType(connection))); @@ -150,9 +149,8 @@ public static LinkedHashMap getMetaData(Connection con * Read all geometry metadata from a table * * @param connection database connection - * @param geometryTable + * @param geometryTable geometry table name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static LinkedHashMap getMetaData(Connection connection, TableLocation geometryTable) throws SQLException { DBTypes dbTypes = geometryTable.getDbTypes(); @@ -188,10 +186,9 @@ public static LinkedHashMap getMetaData(Connection con * Read the geometry metadata from a column name * * @param connection database connection - * @param geometryTable - * @param geometryColumnName + * @param geometryTable geometry table name + * @param geometryColumnName geometry column name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static GeometryMetaData getMetaData(Connection connection, String geometryTable, String geometryColumnName) throws SQLException { return getMetaData(connection, TableLocation.parse(geometryTable, getDBType(connection)), geometryColumnName); @@ -201,10 +198,9 @@ public static GeometryMetaData getMetaData(Connection connection, String geometr * Read the geometry metadata from a column name * * @param connection database connection - * @param geometryTable - * @param geometryColumnName + * @param geometryTable geometry table name + * @param geometryColumnName geometry column name * @return Geometry MetaData - * @throws java.sql.SQLException */ public static GeometryMetaData getMetaData(Connection connection, TableLocation geometryTable, String geometryColumnName) throws SQLException { GeometryMetaData geometryMetaData = null; @@ -720,13 +716,12 @@ public static Geometry getEnvelope(ResultSet resultSet, String geometryColumnNam * Compute the 'estimated' extent of the given spatial table. Use the first * geometry field In case of POSTGIS : the estimated is taken from the * geometry column's statistics. In case of H2GIS : the estimated is taken - * from the spatial index of the geometry column. If the estimated extend is + * from the spatial index of the geometry column. If the estimated extent is * null the extent is computed. * - * @param connection - * @param tableName - * @return - * @throws java.sql.SQLException + * @param connection database + * @param tableName table name + * @return the 'estimated' extent of the given spatial table. */ public static Geometry getEstimatedExtent(Connection connection, String tableName) throws SQLException { return getEstimatedExtent(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection))); @@ -736,13 +731,12 @@ public static Geometry getEstimatedExtent(Connection connection, String tableNam * Compute the 'estimated' extent of the given spatial table. Use the first * geometry field In case of POSTGIS : the estimated is taken from the * geometry column's statistics. In case of H2GIS : the estimated is taken - * from the spatial index of the geometry column. If the estimated extend is + * from the spatial index of the geometry column. If the estimated extent is * null the extent is computed. * - * @param connection - * @param tableLocation - * @return an estimated extend of the table as geometry - * @throws java.sql.SQLException + * @param connection database + * @param tableLocation table name + * @return an estimated extent of the table as geometry */ public static Geometry getEstimatedExtent(Connection connection, TableLocation tableLocation) throws SQLException { LinkedHashMap geometryFields = GeometryTableUtilities.getGeometryColumnNamesAndIndexes(connection, tableLocation); @@ -757,13 +751,12 @@ public static Geometry getEstimatedExtent(Connection connection, TableLocation t * Compute the 'estimated' extent of the given spatial table. In case of * POSTGIS : the estimated is taken from the geometry column's statistics. * In case of H2GIS : the estimated is taken from the spatial index of the - * geometry column. If the estimated extend is null the extent is computed. + * geometry column. If the estimated extent is null the extent is computed. * - * @param connection - * @param tableName - * @param geometryColumnName - * @return an estimated extend of the table as geometry - * @throws java.sql.SQLException + * @param connection database + * @param tableName table name + * @param geometryColumnName geometry column name + * @return an estimated extent of the table as geometry */ public static Geometry getEstimatedExtent(Connection connection, String tableName, String geometryColumnName) throws SQLException { return getEstimatedExtent(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection)), geometryColumnName); @@ -773,13 +766,12 @@ public static Geometry getEstimatedExtent(Connection connection, String tableNam * Compute the 'estimated' extent of the given spatial table. In case of * POSTGIS : the estimated is taken from the geometry column's statistics. * In case of H2GIS : the estimated is taken from the spatial index of the - * geometry column. If the estimated extend is null the extent is computed. + * geometry column. If the estimated extent is null the extent is computed. * - * @param connection - * @param tableLocation - * @param geometryColumnName - * @return an estimated extend of the table as geometry - * @throws java.sql.SQLException + * @param connection database + * @param tableLocation table name + * @param geometryColumnName geometry column name + * @return an estimated extent of the table as geometry */ public static Geometry getEstimatedExtent(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException { DBTypes dbTypes = tableLocation.getDbTypes(); @@ -856,7 +848,6 @@ public static int getSRID(Connection connection,String tableName, String geometr * * @return The SRID of the first geometry column * - * @throws SQLException */ public static int getSRID(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException { int srid = 0; @@ -879,7 +870,6 @@ public static int getSRID(Connection connection, TableLocation tableLocation, St * * @return The SRID of the first geometry column * - * @throws SQLException */ public static int getSRID(Connection connection, String tableName) throws SQLException { return getSRID(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection))); @@ -893,7 +883,6 @@ public static int getSRID(Connection connection, String tableName) throws SQLExc * * @return The SRID of the first geometry column * - * @throws SQLException */ public static int getSRID(Connection connection, TableLocation tableLocation) throws SQLException { int srid = 0; @@ -907,15 +896,15 @@ public static int getSRID(Connection connection, TableLocation tableLocation) th return srid; } - /* Find geometry column names and indexes of a table + /** + * Find geometry column names and indexes of a table * * @param connection Active connection - * @param tableLocation Table location + * @param tableName Table location * * @return A list of Geometry column names and indexes * - * @throws SQLException - */ + **/ public static LinkedHashMap getGeometryColumnNamesAndIndexes(Connection connection, String tableName) throws SQLException { return getGeometryColumnNamesAndIndexes(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection))); } @@ -927,7 +916,6 @@ public static LinkedHashMap getGeometryColumnNamesAndIndexes(Co * * @return A list of Geometry column names and indexes * - * @throws SQLException */ public static LinkedHashMap getGeometryColumnNamesAndIndexes(Connection connection, TableLocation tableLocation) throws SQLException { DBTypes dbTypes = tableLocation.getDbTypes(); @@ -946,7 +934,6 @@ public static LinkedHashMap getGeometryColumnNamesAndIndexes(Co * @param metadata metadata of a resulset * @return A list of Geometry column names and indexes * - * @throws SQLException */ public static LinkedHashMap getGeometryColumnNamesAndIndexes(ResultSetMetaData metadata) throws SQLException { LinkedHashMap namesWithIndexes = new LinkedHashMap<>(); @@ -967,7 +954,6 @@ public static LinkedHashMap getGeometryColumnNamesAndIndexes(Re * * @return A list of Geometry column names and indexes * - * @throws SQLException */ public static List getGeometryColumnNames(Connection connection, String tableName) throws SQLException { return getGeometryColumnNames(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection))); @@ -981,7 +967,6 @@ public static List getGeometryColumnNames(Connection connection, String * * @return A list of Geometry column names and indexes * - * @throws SQLException */ public static List getGeometryColumnNames(Connection connection, TableLocation tableLocation) throws SQLException { DBTypes dbTypes = tableLocation.getDbTypes(); @@ -1000,7 +985,6 @@ public static List getGeometryColumnNames(Connection connection, TableLo * @param metadata metadata of a resulset * @return A list of Geometry column names * - * @throws SQLException */ public static List getGeometryColumnNames(ResultSetMetaData metadata) throws SQLException { ArrayList namesWithIndexes = new ArrayList<>(); @@ -1020,7 +1004,6 @@ public static List getGeometryColumnNames(ResultSetMetaData metadata) th * @param tableName Table location * @return The first geometry column name and its index * - * @throws SQLException */ public static Tuple getFirstGeometryColumnNameAndIndex(Connection connection, String tableName) throws SQLException { return getFirstGeometryColumnNameAndIndex(connection, TableLocation.parse(tableName, DBUtils.getDBType(connection))); @@ -1033,7 +1016,6 @@ public static Tuple getFirstGeometryColumnNameAndIndex(Connecti * @param tableLocation Table location * @return The first geometry column name and its index * - * @throws SQLException */ public static Tuple getFirstGeometryColumnNameAndIndex(Connection connection, TableLocation tableLocation) throws SQLException { DBTypes dbTypes = tableLocation.getDbTypes(); @@ -1053,7 +1035,6 @@ public static Tuple getFirstGeometryColumnNameAndIndex(Connecti * @param metadata metadata of a resulset * @return The first geometry column name and its index * - * @throws SQLException */ public static Tuple getFirstGeometryColumnNameAndIndex(ResultSetMetaData metadata) throws SQLException { int columnCount = metadata.getColumnCount(); @@ -1066,13 +1047,13 @@ public static Tuple getFirstGeometryColumnNameAndIndex(ResultSe } /** + * Return a resulset of the geometry column view properties from * * @param connection Active connection - * @param catalog - * @param schema - * @param table - * @return - * @throws SQLException + * @param catalog catalog name + * @param schema schema name + * @param table table name + * @return ResultSet of the geometry column view */ public static ResultSet getGeometryColumnsView(Connection connection, String catalog, String schema, String table) throws SQLException { @@ -1084,13 +1065,12 @@ public static ResultSet getGeometryColumnsView(Connection connection, String cat /** * Return a resulset of the geometry column view properties from * - * @param connection - * @param catalog - * @param schema - * @param table - * @param geometryField - * @return - * @throws SQLException + * @param connection Active connection + * @param catalog catalog name + * @param schema schema name + * @param table table name + * @param geometryField geometry column name + * @return ResultSet of the geometry column view */ public static ResultSet getGeometryColumnsView(Connection connection, String catalog, String schema, String table, String geometryField) throws SQLException { @@ -1464,12 +1444,10 @@ public static Geometry getEnvelope(Connection connection, TableLocation location * If the SRID does not exist return null * * @param connection Active connection - * @param srid + * @param srid srid to check * * @return Array of two string that correspond to the authority name and its * SRID code - * - * @throws SQLException */ public static String[] getAuthorityAndSRID(Connection connection, int srid) throws SQLException { @@ -1521,7 +1499,6 @@ public static String[] getAuthorityAndSRID(Connection connection, String table, * @return Array of two string that correspond to the authority name and its * SRID code * - * @throws SQLException */ public static String[] getAuthorityAndSRID(Connection connection, TableLocation table, String geometryColumnName) throws SQLException { @@ -1552,7 +1529,6 @@ public static String[] getAuthorityAndSRID(Connection connection, TableLocation * @param geometryColumnName geometry column name * @param srid to force * @return true if query is well executed - * @throws SQLException */ public static boolean alterSRID(Connection connection, String table, String geometryColumnName, int srid) throws SQLException { return alterSRID(connection, TableLocation.parse(table, DBUtils.getDBType(connection)), geometryColumnName, srid); @@ -1566,7 +1542,6 @@ public static boolean alterSRID(Connection connection, String table, String geom * @param geometryColumnName geometry column name * @param srid to force * @return true if query is well executed - * @throws SQLException */ public static boolean alterSRID(Connection connection, TableLocation tableLocation, String geometryColumnName, int srid) throws SQLException { DBTypes dbTypes = tableLocation.getDbTypes(); @@ -1604,7 +1579,6 @@ public static boolean alterSRID(Connection connection, TableLocation tableLocati * @param tableLocation Table name * @param geometryColumnName geometry column name * @return true if query is well executed - * @throws SQLException */ public static boolean isSpatialIndexed(Connection connection, TableLocation tableLocation, String geometryColumnName) throws SQLException { return JDBCUtilities.isSpatialIndexed(connection,tableLocation, geometryColumnName); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/Tuple.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/Tuple.java index b14dd610e6..efe1980a7a 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/Tuple.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/Tuple.java @@ -22,8 +22,8 @@ /** * Basic tuple class * @author Erwan Bocher - * @param - * @param + * @param First tuple object + * @param Second tuple object */ public class Tuple { @@ -43,8 +43,6 @@ public T first() { public U second() { return _2; } - - @Override public String toString() { diff --git a/h2gis-utilities/src/test/java/org/h2gis/utilities/GeographyUtilsTest.java b/h2gis-utilities/src/test/java/org/h2gis/utilities/GeographyUtilsTest.java index 8fa1368265..afa8cdb600 100644 --- a/h2gis-utilities/src/test/java/org/h2gis/utilities/GeographyUtilsTest.java +++ b/h2gis-utilities/src/test/java/org/h2gis/utilities/GeographyUtilsTest.java @@ -107,7 +107,7 @@ public void haversineDistanceInMeters1() throws Exception { /** * Util to display the envelope as geometry * - * @param env + * @param env set {@link Envelope} */ public void displayAsGeometry(Envelope env) { GeometryFactory gf = new GeometryFactory(); diff --git a/h2gis-utilities/src/test/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithmTest.java b/h2gis-utilities/src/test/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithmTest.java index 72b5c672da..3e0df83849 100644 --- a/h2gis-utilities/src/test/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithmTest.java +++ b/h2gis-utilities/src/test/java/org/h2gis/utilities/jts_utils/VisibilityAlgorithmTest.java @@ -51,7 +51,6 @@ public void testIsoVistEmpty() { /** * Test with geometry crossing 0 coordinates * - * @throws ParseException */ @Test public void testIsoVistCross0() throws ParseException { @@ -72,7 +71,6 @@ public void testIsoVistCross0() throws ParseException { /** * Test with geometry with only positive values * - * @throws ParseException */ @Test public void testIsoVistNoCross() throws ParseException { From d3461f92540c3562cd384b8c56106286a92ca7b2 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 14:37:17 +0100 Subject: [PATCH 14/26] Fix doc --- .../org/h2gis/utilities/JDBCUtilities.java | 68 +++++++------------ 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java index 17067ec605..b3bbf2a2d0 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java @@ -117,7 +117,7 @@ private static ResultSet getTablesView(Connection connection, String catalog, St } /** - * Return true if table table contains field fieldName. + * Return true if the table contains the field. * * @param connection Connection * @param table a TableLocation @@ -324,7 +324,7 @@ public static int getRowCount(Connection connection, TableLocation table) throws * @param connection Active connection. * @param tableName a table name in the form CATALOG.SCHEMA.TABLE * @return Row count - * @throws SQLException If the table does not exists, or sql request fail. + * @throws SQLException If the table does not exist, or sql request fail. */ public static int getRowCount(Connection connection, String tableName) throws SQLException { Statement st = connection.createStatement(); @@ -351,7 +351,7 @@ public static int getRowCount(Connection connection, String tableName) throws SQ * @param connection Active connection not closed by this method * @param tableLocation Table reference * @return True if the provided table is temporary. - * @throws SQLException If the table does not exists. + * @throws SQLException If the table does not exist. */ public static boolean isTemporaryTable(Connection connection, TableLocation tableLocation) throws SQLException { ResultSet rs = getTablesView(connection, tableLocation.getCatalog(), tableLocation.getSchema(), tableLocation.getTable()); @@ -383,7 +383,7 @@ public static boolean isTemporaryTable(Connection connection, TableLocation tabl * @param connection Active connection not closed by this method * @param table TableLocation * @return True if the provided table is linked. - * @throws SQLException If the table does not exists. + * @throws SQLException If the table does not exist. */ public static boolean isLinkedTable(Connection connection, TableLocation table) throws SQLException { return isLinkedTable(connection, table.toString()); @@ -396,7 +396,7 @@ public static boolean isLinkedTable(Connection connection, TableLocation table) * @param connection Active connection not closed by this method * @param tableReference Table reference * @return True if the provided table is linked. - * @throws SQLException If the table does not exists. + * @throws SQLException If the table does not exist. */ public static boolean isLinkedTable(Connection connection, String tableReference) throws SQLException { String[] location = TableLocation.split(tableReference); @@ -416,9 +416,8 @@ public static boolean isLinkedTable(Connection connection, String tableReference } /** - * @param connection to the + * @param connection to the database * @return True if the provided metadata is a h2 database connection. - * @throws SQLException */ public static boolean isH2DataBase(Connection connection) throws SQLException { if (connection.getClass().getName().startsWith(H2_DRIVER_PACKAGE_NAME) @@ -435,7 +434,6 @@ public static boolean isH2DataBase(Connection connection) throws SQLException { * @return The integer primary key used for edition[1-n]; 0 if the source is * closed or if the table has no primary key or more than one column as * primary key - * @throws java.sql.SQLException */ public static int getIntegerPrimaryKey(Connection connection, TableLocation tableLocation) throws SQLException { if (!tableExists(connection, tableLocation)) { @@ -489,7 +487,6 @@ public static int getIntegerPrimaryKey(Connection connection, TableLocation tabl * @return The name and the index of an integer primary key used for * edition[1-n]; 0 if the source is closed or if the table has no primary * key or more than one column as primary key - * @throws java.sql.SQLException */ public static Tuple getIntegerPrimaryKeyNameAndIndex(Connection connection, TableLocation tableLocation) throws SQLException { if (!tableExists(connection, tableLocation)) { @@ -537,10 +534,9 @@ public static Tuple getIntegerPrimaryKeyNameAndIndex(Connection /** * Return true if the table exists. * - * @param connection Connection + * @param connection Connection to the database * @param tableLocation Table name * @return true if the table exists - * @throws java.sql.SQLException */ public static boolean tableExists(Connection connection, TableLocation tableLocation) throws SQLException { List tableNames = JDBCUtilities.getTableNames(connection, @@ -563,10 +559,9 @@ public static boolean tableExists(Connection connection, TableLocation tableLoca /** * Return true if the table exists. * - * @param connection Connection + * @param connection Connection to the database * @param tableName Table name * @return true if the table exists - * @throws java.sql.SQLException */ public static boolean tableExists(Connection connection, String tableName) throws SQLException { DBTypes dbTypes = DBUtils.getDBType(connection); @@ -583,7 +578,6 @@ public static boolean tableExists(Connection connection, String tableName) throw * @return The integer primary key used for edition[1-n]; 0 if the source is * closed or if the table has no primary key or more than one column as * primary key - * @throws java.sql.SQLException */ public static List getTableNames(Connection connection, TableLocation tableLocation, String[] types) throws SQLException { List tableList = new ArrayList<>(); @@ -617,7 +611,6 @@ public static List getTableNames(Connection connection, TableLocation ta * @return The integer primary key used for edition[1-n]; 0 if the source is * closed or if the table has no primary key or more than one column as * primary key - * @throws java.sql.SQLException */ public static List getTableNames(Connection connection, String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException { @@ -642,7 +635,6 @@ public static List getTableNames(Connection connection, String catalog, * @param table Name of the table containing the field. * @param fieldName Name of the field containing the values. * @return The list of distinct values of the field. - * @throws java.sql.SQLException */ public static List getUniqueFieldValues(Connection connection, TableLocation table, String fieldName) throws SQLException { return getUniqueFieldValues(connection, table.toString(), fieldName); @@ -656,7 +648,6 @@ public static List getUniqueFieldValues(Connection connection, TableLoca * @param tableName Name of the table containing the field. * @param fieldName Name of the field containing the values. * @return The list of distinct values of the field. - * @throws java.sql.SQLException */ public static List getUniqueFieldValues(Connection connection, String tableName, String fieldName) throws SQLException { final DBTypes dbType = getDBType(connection); @@ -682,7 +673,6 @@ public static List getUniqueFieldValues(Connection connection, String ta * * @param connection Connection * @param table Table name - * @throws java.sql.SQLException */ public static void createEmptyTable(Connection connection, TableLocation table) throws SQLException { try (Statement statement = connection.createStatement()) { @@ -695,7 +685,6 @@ public static void createEmptyTable(Connection connection, TableLocation table) * * @param connection Connection * @param tableReference Table name - * @throws java.sql.SQLException */ public static void createEmptyTable(Connection connection, String tableReference) throws SQLException { try (Statement statement = connection.createStatement()) { @@ -708,7 +697,6 @@ public static void createEmptyTable(Connection connection, String tableReference * * @param resultSetMetaData Active result set meta data. * @return An array with all column names - * @throws SQLException */ public static List getColumnNames(ResultSetMetaData resultSetMetaData) throws SQLException { List columnNames = new ArrayList<>(); @@ -799,10 +787,9 @@ public void propertyChange(PropertyChangeEvent evt) { /** * Return the type of the table using an Enum * - * @param connection - * @param location - * @return - * @throws SQLException + * @param connection to the database + * @param location table name + * @return the table type */ public static TABLE_TYPE getTableType(Connection connection, TableLocation location) throws SQLException { DBTypes dbType = location.getDbTypes(); @@ -834,11 +821,10 @@ public static TABLE_TYPE getTableType(Connection connection, TableLocation locat *

* Takes into account only data types * - * @param connection - * @param sourceTable - * @param targetTable + * @param connection database + * @param sourceTable source table name + * @param targetTable target table name * @return a create table ddl command - * @throws SQLException */ public static String createTableDDL(Connection connection, TableLocation sourceTable, TableLocation targetTable) throws SQLException { if (sourceTable == null) { @@ -922,10 +908,9 @@ public static String createTableDDL(Connection connection, TableLocation sourceT *

* Takes into account only data types * - * @param connection - * @param location + * @param connection database + * @param location table name * @return a create table ddl command - * @throws SQLException */ public static String createTableDDL(Connection connection, TableLocation location) throws SQLException { return createTableDDL(connection, location, location); @@ -936,10 +921,9 @@ public static String createTableDDL(Connection connection, TableLocation locatio *

* Takes into account only data types * - * @param outputTableName - * @param resultSet + * @param outputTableName table name + * @param resultSet input resultset * @return a create table ddl command - * @throws SQLException */ public static String createTableDDL(ResultSet resultSet, String outputTableName) throws SQLException { return createTableDDL(resultSet.getMetaData(), outputTableName); @@ -951,10 +935,9 @@ public static String createTableDDL(ResultSet resultSet, String outputTableName) *

* Takes into account only data types * - * @param outputTableName - * @param metadata + * @param outputTableName table name + * @param metadata table metadata * @return a create table ddl command - * @throws SQLException */ public static String createTableDDL(ResultSetMetaData metadata, String outputTableName) throws SQLException { if (outputTableName == null || outputTableName.isEmpty()) { @@ -1211,7 +1194,6 @@ public static void dropIndex(Connection connection, TableLocation table, String * @param connection Connection to access to the desired table. * @param table Table containing the column to get the index names. * @return a map with the index name and its column name - * @throws SQLException */ public static Map getIndexNames(Connection connection, String table) throws SQLException { return getIndexNames(connection, TableLocation.parse(table, getDBType(connection))); @@ -1223,7 +1205,6 @@ public static Map getIndexNames(Connection connection, String ta * @param connection Connection to access to the desired table. * @param table Table containing the column to get the index names. * @return a map with the index name and its column name - * @throws SQLException */ public static Map getIndexNames(Connection connection, TableLocation table) throws SQLException { if (connection == null || table == null) { @@ -1246,8 +1227,7 @@ public static Map getIndexNames(Connection connection, TableLoca * @param connection Connection to access to the desired table. * @param table Table containing the column to get the index names. * @param columnName Name of the column. - * @return - * @throws SQLException + * @return a list of the index names */ public static List getIndexNames(Connection connection, String table, String columnName) throws SQLException { return getIndexNames(connection, TableLocation.parse(table, getDBType(connection)), columnName); @@ -1259,8 +1239,7 @@ public static List getIndexNames(Connection connection, String table, St * @param connection Connection to access to the desired table. * @param table Table containing the column to get the index names. * @param columnName Name of the column. - * @return - * @throws SQLException + * @return a list of the index names */ public static List getIndexNames(Connection connection, TableLocation table, String columnName) throws SQLException { if (connection == null || table == null) { @@ -1325,8 +1304,7 @@ public static void dropIndex(Connection connection, String table) throws SQLExce * Return a list of numeric column names * * @param resultSetMetaData the metadata of the table - * @return a list - * @throws SQLException + * @return a list of the numeric column names */ public static List getNumericColumns(ResultSetMetaData resultSetMetaData) throws SQLException { List fieldNameList = new ArrayList<>(); From 480d995714d537fa8df8161afc6ea16d0be8dc31 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 14:45:23 +0100 Subject: [PATCH 15/26] Fix doc --- .../functions/io/geojson/ST_AsGeoJSON.java | 38 +++++++++---------- .../h2gis/functions/io/kml/AltitudeMode.java | 4 +- .../h2gis/functions/io/kml/KMLGeometry.java | 18 ++++----- .../org/h2gis/utilities/TableLocation.java | 2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java index 6641157dc8..928d0b82f5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java @@ -81,7 +81,7 @@ public static String toGeojson(Geometry geom, int maxdecimaldigits) { * * @param geom input geometry * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonGeometry(Geometry geom, int maxdecimaldigits, StringBuilder sb) { if (geom instanceof Point) { @@ -123,9 +123,9 @@ public static void toGeojsonGeometry(Geometry geom, int maxdecimaldigits, String * * { "type": "Point", "coordinates": [100.0, 0.0] } * - * @param point + * @param point input point * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonPoint(Point point, int maxdecimaldigits, StringBuilder sb) { Coordinate coord = point.getCoordinate(); @@ -147,9 +147,9 @@ public static void toGeojsonPoint(Point point, int maxdecimaldigits, StringBuild * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param multiPoint + * @param multiPoint input {@link MultiPoint} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonMultiPoint(MultiPoint multiPoint,int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"MultiPoint\",\"coordinates\":"); @@ -164,9 +164,9 @@ public static void toGeojsonMultiPoint(MultiPoint multiPoint,int maxdecimaldigit * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param lineString + * @param lineString input {@link MultiLineString} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonLineString(LineString lineString, int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"LineString\",\"coordinates\":"); @@ -183,9 +183,9 @@ public static void toGeojsonLineString(LineString lineString, int maxdecimaldigi * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * - * @param multiLineString + * @param multiLineString input {@link MultiLineString} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonMultiLineString(MultiLineString multiLineString,int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"MultiLineString\",\"coordinates\":["); @@ -218,9 +218,9 @@ public static void toGeojsonMultiLineString(MultiLineString multiLineString,int * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ] ] } * * - * @param polygon + * @param polygon input {@link Polygon} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonPolygon(Polygon polygon,int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"Polygon\",\"coordinates\":["); @@ -244,9 +244,9 @@ public static void toGeojsonPolygon(Polygon polygon,int maxdecimaldigits, Strin * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * - * @param multiPolygon + * @param multiPolygon input {@link MultiPolygon} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonMultiPolygon(MultiPolygon multiPolygon, int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"MultiPolygon\",\"coordinates\":["); @@ -284,9 +284,9 @@ public static void toGeojsonMultiPolygon(MultiPolygon multiPolygon, int maxdecim * "coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [ * [101.0, 0.0], [102.0, 1.0] ] } ] } * - * @param geometryCollection + * @param geometryCollection input {@link GeometryCollection} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonGeometryCollection(GeometryCollection geometryCollection,int maxdecimaldigits, StringBuilder sb) { sb.append("{\"type\":\"GeometryCollection\",\"geometries\":["); @@ -315,9 +315,9 @@ public static void toGeojsonGeometryCollection(GeometryCollection geometryCollec * * [[X1,Y1],[X2,Y2]] * - * @param coords + * @param coords input coordinates array * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonCoordinates(Coordinate[] coords, int maxdecimaldigits, StringBuilder sb) { sb.append("["); @@ -339,9 +339,9 @@ public static void toGeojsonCoordinates(Coordinate[] coords, int maxdecimaldigit * * [X,Y] or [X,Y,Z] * - * @param coord + * @param coord input {@link Coordinate} * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @param sb + * @param sb buffer to store the geojson */ public static void toGeojsonCoordinate(Coordinate coord, int maxdecimaldigits, StringBuilder sb) { sb.append("["); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java index b1f6054a5c..462dce9410 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/AltitudeMode.java @@ -67,8 +67,8 @@ private AltitudeMode() { * Generate a string value corresponding to the altitude mode. * * - * @param altitudeMode - * @param sb + * @param altitudeMode {@link AltitudeMode} + * @param sb buffer to store the kml */ public static void append(int altitudeMode, StringBuilder sb) { switch (altitudeMode) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java index 57dddb45cd..f7ea6362f0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLGeometry.java @@ -47,10 +47,10 @@ public static void toKMLGeometry(Geometry geom, StringBuilder sb) throws SQLExce /** * Convert JTS geometry to a kml geometry representation. * - * @param geometry - * @param extrude - * @param altitudeModeEnum - * @param sb + * @param geometry input geometry + * @param extrude extrude mode + * @param altitudeModeEnum altitude mode + * @param sb buffer to store the KML */ public static void toKMLGeometry(Geometry geometry, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) throws SQLException { if (geometry instanceof Point) { @@ -281,7 +281,7 @@ public static void toKMLMultiGeometry(GeometryCollection gc, ExtrudeMode extrude * {@code * ... * } - * @param coords + * @param coords coordinates array */ public static void appendKMLCoordinates(Coordinate[] coords, StringBuilder sb) { sb.append(""); @@ -305,8 +305,8 @@ public static void appendKMLCoordinates(Coordinate[] coords, StringBuilder sb) { * * 0 * - * @param extrude - * @param sb + * @param extrude {@link ExtrudeMode} + * @param sb buffer to store the KML */ private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) { if (extrude.equals(ExtrudeMode.TRUE)) { @@ -323,8 +323,8 @@ private static void appendExtrude(ExtrudeMode extrude, StringBuilder sb) { * * clampToGround * - * @param altitudeModeEnum - * @param sb + * @param altitudeModeEnum {@link AltitudeMode} + * @param sb buffer to store the KML */ private static void appendAltitudeMode(int altitudeModeEnum, StringBuilder sb) { AltitudeMode.append(altitudeModeEnum, sb); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java index be90d2f484..7ec774e812 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java @@ -429,7 +429,7 @@ public void setDefaultSchema(String defaultSchema) { /** * Return the dbtype used by tablelocation. * Default is H2 - * @return + * @return the {@link DBTypes} */ public DBTypes getDbTypes() { return dbTypes; From 390cfaade29451696a9ff91c61409f93efcf24f7 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 15:23:13 +0100 Subject: [PATCH 16/26] Fix doc --- .../org/h2gis/functions/io/dbf/DBFEngine.java | 2 - .../io/dbf/internal/DbaseFileHeader.java | 6 +- .../org/h2gis/functions/io/fgb/FGBEngine.java | 1 - .../functions/io/file_table/FileEngine.java | 1 - .../io/geojson/GeoJsonReaderDriver.java | 4 +- .../io/geojson/GeoJsonWriteDriver.java | 12 ++-- .../io/geojson/ST_GeomFromGeoJSON.java | 6 +- .../org/h2gis/functions/io/gpx/GPXRead.java | 2 - .../org/h2gis/functions/io/shp/SHPRead.java | 8 --- .../functions/io/shp/internal/IndexFile.java | 15 ++--- .../io/shp/internal/PolygonHandler.java | 5 +- .../io/shp/internal/ShapeHandler.java | 1 - .../io/shp/internal/ShapefileReader.java | 18 ++---- .../io/shp/internal/ShapefileWriter.java | 12 ++-- .../io/utility/ReadBufferManager.java | 61 +++++++------------ .../io/utility/WriteBufferManager.java | 19 ++---- .../spatial/convert/ST_GeomFromGML.java | 16 ++--- .../spatial/convert/ST_LineFromWKB.java | 4 -- 18 files changed, 59 insertions(+), 134 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java index e11e93b070..649ba2d217 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java @@ -55,7 +55,6 @@ protected void feedCreateTableData(DBFDriver driver, CreateTableData data) throw * Parse the DBF file then init the provided data structure * @param header dbf header * @param data Data to initialise - * @throws java.io.IOException */ public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException { int numFields = header.getNumFields(); @@ -71,7 +70,6 @@ public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableDa * @param header DBF File Header * @param i DBF Type identifier * @return H2 {@see Value} - * @throws java.io.IOException */ private static TypeInfo dbfTypeToH2Type(DbaseFileHeader header, int i) throws IOException { switch (header.getFieldType(i)) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java index 08565c3a08..c6389bcd1c 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DbaseFileHeader.java @@ -453,8 +453,7 @@ public int getHeaderLength() { * A readable byte channel. If you have an InputStream you need * to use, you can call java.nio.Channels.getChannel(InputStream * in). - * @throws java.io.IOException - * If errors occur while reading. + * @throws java.io.IOException If errors occur while reading. */ public void readHeader(FileChannel channel,String forceEncoding) throws IOException { if(forceEncoding != null && !forceEncoding.isEmpty()) { @@ -656,8 +655,7 @@ private byte getEncodingByte() { * A channel to write to. If you have an OutputStream you can * obtain the correct channel by using * java.nio.Channels.newChannel(OutputStream out). - * @throws java.io.IOException - * If errors occur. + * @throws java.io.IOException If errors occur. */ public void writeHeader(WritableByteChannel out) throws IOException { // take care of the annoying case where no records have been added... diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBEngine.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBEngine.java index 2e605d2609..b888357c3b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBEngine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/FGBEngine.java @@ -149,7 +149,6 @@ protected void feedCreateTableData(FGBDriver driver, CreateTableData data) throw /** * @param columnMeta * @return H2 {@see Value} - * @throws java.io.IOException * @see "https://github.com/flatgeobuf/flatgeobuf/blob/master/src/fbs/header.fbs" */ private static TypeInfo fgbTypeToH2Type(ColumnMeta columnMeta) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java index 04978ead53..63ff5485f2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/file_table/FileEngine.java @@ -113,7 +113,6 @@ public static String getUniqueColumnName(String base, List columns) { * Add columns definition of the file into the CreateTableData instance. * @param driver driver object * @param data Data to initialise - * @throws java.io.IOException */ protected abstract void feedCreateTableData(Driver driver,CreateTableData data) throws IOException; } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index fc3647a377..c30ea9c5e7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -101,9 +101,7 @@ public GeoJsonReaderDriver(Connection connection, File fileName, String encoding * * @param progress Progress visitor following the execution. * @param tableReference output table name - * @return - * @throws java.sql.SQLException - * @throws java.io.IOException + * @return table name or null */ public String read(ProgressVisitor progress, String tableReference) throws SQLException, IOException { String fileNameLower = fileName.getName().toLowerCase(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java index 60467e3a31..a0dfbf5af7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java @@ -83,10 +83,8 @@ public GeoJsonWriteDriver(Connection connection) { * @param progress Progress visitor following the execution. * @param rs input resulset * @param fileName the output file - * @param encoding - * @param deleteFile - * @throws SQLException - * @throws java.io.IOException + * @param encoding file encoding + * @param deleteFile true to delete the file if exist */ public void write(ProgressVisitor progress, ResultSet rs, File fileName, String encoding, boolean deleteFile) throws SQLException, IOException { if (FileUtilities.isExtensionWellFormated(fileName, "geojson")|| FileUtilities.isExtensionWellFormated(fileName, "json")) { @@ -304,10 +302,8 @@ private void geojsonWriter(ProgressVisitor progress, String tableName, OutputStr * @param progress Progress visitor following the execution. * @param tableName * @param fileName input file - * @param encoding - * @param deleteFile - * @throws SQLException - * @throws java.io.IOException + * @param encoding file encoding + * @param deleteFile true to delete the file if exist */ public void write(ProgressVisitor progress, String tableName, File fileName, String encoding, boolean deleteFile) throws SQLException, IOException { String regex = ".*(?i)\\b(select|from)\\b.*"; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_GeomFromGeoJSON.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_GeomFromGeoJSON.java index c600e31b86..10c47c77af 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_GeomFromGeoJSON.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_GeomFromGeoJSON.java @@ -50,10 +50,8 @@ public String getJavaStaticMethod() { /** * Convert a geojson geometry to geometry. * - * @param geojson - * @return - * @throws java.io.IOException - * @throws java.sql.SQLException + * @param geojson input geojson + * @return a {@link Geometry} */ public static Geometry geomFromGeoJSON(String geojson) throws IOException, SQLException { if (geojson == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java index 0321824cd7..acd534217e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/GPXRead.java @@ -99,8 +99,6 @@ public static void importTable(Connection connection, String fileName, String ta * @param fileName File path of the SHP file * @param encoding charset encoding * @param deleteTables true to delete the existing tables - * @throws java.io.IOException - * @throws java.sql.SQLException */ public static void importTable(Connection connection, String fileName, String tableReference, String encoding, boolean deleteTables) throws IOException, SQLException { GPXDriverFunction gpxdf = new GPXDriverFunction(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java index b581409690..4a8f6bc057 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java @@ -62,8 +62,6 @@ public String getJavaStaticMethod() { * @param tableReference [[catalog.]schema.]table reference * @param option Could be string file encoding charset or boolean value to delete the existing table * @param fileName File path of the SHP file or URI - * @throws java.io.IOException - * @throws java.sql.SQLException */ public static void importTable(Connection connection, String fileName, String tableReference, Value option) throws IOException, SQLException { String encoding =null; @@ -85,8 +83,6 @@ public static void importTable(Connection connection, String fileName, String ta * @param forceEncoding Use this encoding instead of DBF file header encoding property. * @param fileName File path of the SHP file or URI * @param deleteTables delete existing tables - * @throws java.io.IOException - * @throws java.sql.SQLException */ public static void importTable(Connection connection, String fileName, String tableReference,String forceEncoding, boolean deleteTables) throws IOException, SQLException { File file = URIUtilities.fileFromString(fileName); @@ -101,8 +97,6 @@ public static void importTable(Connection connection, String fileName, String ta * @param connection Active connection * @param fileName File path of the SHP file or URI * @param option [[catalog.]schema.]table reference - * @throws java.io.IOException - * @throws java.sql.SQLException */ public static void importTable(Connection connection, String fileName, Value option) throws IOException, SQLException { String tableReference =null; @@ -132,8 +126,6 @@ public static void importTable(Connection connection, String fileName, Value opt * * @param connection Active connection * @param fileName File path of the SHP file or URI - * @throws java.io.IOException - * @throws java.sql.SQLException */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java index dee50bc52e..3c06ccbf5f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/IndexFile.java @@ -57,8 +57,7 @@ public class IndexFile { * * @param channel * The channel to read from. - * @throws java.io.IOException - * If an error occurs. + * @throws java.io.IOException If an error occurs. */ public IndexFile(FileChannel channel) throws IOException { @@ -112,10 +111,8 @@ public int getRecordCount() { /** * Get the offset of the record (in 16-bit words). * - * @param index - * The index, from 0 to getRecordCount - 1 + * @param index The index, from 0 to getRecordCount - 1 * @return The offset in 16-bit words. - * @throws java.io.IOException */ public int getOffset(int index) throws IOException { int ret = -1; @@ -132,10 +129,8 @@ public int getOffset(int index) throws IOException { /** * Get the offset of the record (in real bytes, not 16-bit words). * - * @param index - * The index, from 0 to getRecordCount - 1 + * @param index The index, from 0 to getRecordCount - 1 * @return The offset in bytes. - * @throws java.io.IOException */ public int getOffsetInBytes(int index) throws IOException { return this.getOffset(index) * 2; @@ -144,10 +139,8 @@ public int getOffsetInBytes(int index) throws IOException { /** * Get the content length of the given record in bytes, not 16 bit words. * - * @param index - * The index, from 0 to getRecordCount - 1 + * @param index The index, from 0 to getRecordCount - 1 * @return The lengh in bytes of the record. - * @throws java.io.IOException */ public int getContentLength(int index) throws IOException { int ret = -1; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/PolygonHandler.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/PolygonHandler.java index 69b28d3b2e..1f1c3a5c75 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/PolygonHandler.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/PolygonHandler.java @@ -304,9 +304,8 @@ public static int computeOrientation(CoordinateSequence cs, int p1, int p2, } /** - * @param buffer - * @param numPoints - * @throws java.io.IOException + * @param buffer data buffer to read + * @param numPoints number of points */ private CoordinateSequence readCoordinates(final ReadBufferManager buffer, final int numPoints, final int dimensions) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeHandler.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeHandler.java index 9905127659..43ee0280d2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeHandler.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapeHandler.java @@ -53,7 +53,6 @@ public interface ShapeHandler { * @param buffer The ByteBuffer to read from. * @param type The shape type * @return A geometry object. - * @throws java.io.IOException */ Geometry read(ReadBufferManager buffer, ShapeType type) throws IOException; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java index 4c788ba471..8605a7760d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileReader.java @@ -60,10 +60,8 @@ public class ShapefileReader { * * @param channel * The ReadableByteChannel this reader will use. - * @throws java.io.IOException - * If problems arise. - * @throws ShapefileException - * If for some reason the file contains invalid records. + * @throws java.io.IOException If problems arise. + * @throws ShapefileException If for some reason the file contains invalid records. */ public ShapefileReader(FileChannel channel) throws IOException, ShapefileException { @@ -75,10 +73,8 @@ public ShapefileReader(FileChannel channel) throws IOException, /** * A short cut for reading the header from the given channel. * - * @param channel - * The channel to read from. - * @throws java.io.IOException - * If problems arise. + * @param channel The channel to read from. + * @throws java.io.IOException If problems arise. * @return A ShapefileHeader object. */ public static ShapefileHeader readHeader(ReadableByteChannel channel) throws IOException { @@ -120,8 +116,7 @@ public ShapefileHeader getHeader() { /** * Clean up any resources. Closes the channel. * - * @throws java.io.IOException - * If errors occur while closing the channel. + * @throws java.io.IOException If errors occur while closing the channel. */ public void close() throws IOException { if (channel != null && channel.isOpen()) { @@ -134,8 +129,7 @@ public void close() throws IOException { /** * Fetch the next record information. * - * @param offset - * @throws java.io.IOException + * @param offset data buffer offset to read the geometry * @return The record instance associated with this reader. */ public Geometry geomAt(int offset) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java index 2d0dbb4b3c..7e93a9a4e9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/ShapefileWriter.java @@ -71,9 +71,8 @@ public class ShapefileWriter { /** * Creates a new instance of ShapeFileWriter * - * @param shpChannel - * @param shxChannel - * @throws java.io.IOException + * @param shpChannel shp {@link FileChannel} + * @param shxChannel shx {@link FileChannel} */ public ShapefileWriter(FileChannel shpChannel, FileChannel shxChannel) throws IOException { @@ -93,7 +92,6 @@ public FileChannel getShpChannel() { * the first geometry, then when all geometries are inserted. * * @param type Shape type - * @throws java.io.IOException */ public void writeHeaders(ShapeType type) throws IOException { try { @@ -129,10 +127,9 @@ public void writeHeaders(ShapeType type) throws IOException { /** * Write a single Geometry to this shapefile. The Geometry must be - * compatable with the ShapeType assigned during the writing of the headers. + * compatible with the ShapeType assigned during the writing of the headers. * - * @param g - * @throws java.io.IOException + * @param g input {@link Geometry} */ public void writeGeometry(Geometry g) throws IOException { if (type == null) { @@ -174,7 +171,6 @@ public void writeGeometry(Geometry g) throws IOException { /** * Close the underlying Channels. * - * @throws java.io.IOException */ public void close() throws IOException { indexBuffer.flush(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java index ad9c42a9b2..ecb964d61c 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java @@ -36,8 +36,7 @@ public final class ReadBufferManager { /** * Instantiates a ReadBufferManager to read the specified channel * - * @param channel - * @throws java.io.IOException + * @param channel {@link FileChannel} */ public ReadBufferManager(FileChannel channel) throws IOException { this(channel, 1024 * 32); @@ -47,9 +46,8 @@ public ReadBufferManager(FileChannel channel) throws IOException { * Instantiates a ReadBufferManager to read the specified channel. The * specified bufferSize is the size of the channel content cached in memory * - * @param channel - * @param bufferSize - * @throws java.io.IOException + * @param channel {@link FileChannel} + * @param bufferSize buffer size */ public ReadBufferManager(FileChannel channel, int bufferSize) throws IOException { @@ -64,8 +62,8 @@ public ReadBufferManager(FileChannel channel, int bufferSize) * Moves the window if necessary to contain the desired byte and returns the * position of the byte in the window * - * @param bytePos - * @throws java.io.IOException + * @param bytePos byte position + * @param length byte length */ private int getWindowOffset(long bytePos, int length) throws IOException { long desiredMax = bytePos + length - 1; @@ -104,9 +102,8 @@ private int getWindowOffset(long bytePos, int length) throws IOException { /** * Gets the byte value at the specified position * - * @param bytePos - * @return - * @throws java.io.IOException + * @param bytePos byte position + * @return byte value */ public byte getByte(long bytePos) throws IOException { int windowOffset = getWindowOffset(bytePos, 1); @@ -116,8 +113,7 @@ public byte getByte(long bytePos) throws IOException { /** * Gets the size of the channel * - * @return - * @throws java.io.IOException + * @return channel size */ public long getLength() throws IOException { return channel.size(); @@ -135,9 +131,8 @@ public void order(ByteOrder order) { /** * Gets the int value at the specified position * - * @param bytePos - * @return - * @throws java.io.IOException + * @param bytePos byte position + * @return int value */ public int getInt(long bytePos) throws IOException { int windowOffset = getWindowOffset(bytePos, 4); @@ -147,9 +142,8 @@ public int getInt(long bytePos) throws IOException { /** * Gets the long value at the specified position * - * @param bytePos - * @return - * @throws java.io.IOException + * @param bytePos byte position + * @return long value */ public long getLong(long bytePos) throws IOException { int windowOffset = getWindowOffset(bytePos, 8); @@ -159,8 +153,7 @@ public long getLong(long bytePos) throws IOException { /** * Gets the long value at the current position * - * @return - * @throws java.io.IOException + * @return long value */ public long getLong() throws IOException { long ret = getLong(positionInFile); @@ -171,8 +164,7 @@ public long getLong() throws IOException { /** * Gets the byte value at the current position * - * @return - * @throws java.io.IOException + * @return byte value */ public byte get() throws IOException { byte ret = getByte(positionInFile); @@ -183,8 +175,7 @@ public byte get() throws IOException { /** * Gets the int value at the current position * - * @return - * @throws java.io.IOException + * @return int value */ public int getInt() throws IOException { int ret = getInt(positionInFile); @@ -196,8 +187,7 @@ public int getInt() throws IOException { * skips the specified number of bytes from the current position in the * channel * - * @param numBytes - * @throws java.io.IOException + * @param numBytes numBytes to move the buffer to a new position */ public void skip(int numBytes) throws IOException { positionInFile += numBytes; @@ -220,10 +210,9 @@ public ByteBuffer get(byte[] buffer) throws IOException { /** * Gets the byte[] value at the specified position * - * @param pos - * @param buffer - * @return - * @throws java.io.IOException + * @param pos buffer position + * @param buffer bytes + * @return ByteBuffer */ public ByteBuffer get(long pos, byte[] buffer) throws IOException { int windowOffset = getWindowOffset(pos, buffer.length); @@ -252,8 +241,7 @@ public long getPosition() { /** * Gets the double value at the specified position * - * @return - * @throws java.io.IOException + * @return double value */ public double getDouble() throws IOException { double ret = getDouble(positionInFile); @@ -264,9 +252,8 @@ public double getDouble() throws IOException { /** * Gets the double value at the specified position * - * @param bytePos - * @return - * @throws java.io.IOException + * @param bytePos buffer position + * @return double value */ public double getDouble(long bytePos) throws IOException { int windowOffset = getWindowOffset(bytePos, 8); @@ -276,8 +263,7 @@ public double getDouble(long bytePos) throws IOException { /** * If the current position is at the end of the channel * - * @return - * @throws java.io.IOException + * @return true if the current position is at the end of the channel */ public boolean isEOF() throws IOException { return (buffer.remaining() == 0) @@ -289,7 +275,6 @@ public boolean isEOF() throws IOException { * current position * * @return a number of bytes >=0 - * @throws java.io.IOException */ public long remaining() throws IOException { return channel.size() - windowStart - buffer.position(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java index 6e8c57dce4..1658164129 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/WriteBufferManager.java @@ -42,8 +42,7 @@ public final class WriteBufferManager { * Creates a new WriteBufferManager that writes to the specified file * channel * - * @param channel - * @throws java.io.IOException + * @param channel {@link FileChannel} */ public WriteBufferManager(FileChannel channel) throws IOException { this.channel = channel; @@ -53,8 +52,7 @@ public WriteBufferManager(FileChannel channel) throws IOException { /** * Puts the specified byte at the current position * - * @param b - * @throws java.io.IOException + * @param b put a short value */ public void putShort(byte b) throws IOException { prepareToAddBytes(1); @@ -68,8 +66,7 @@ public int position(){ /** * Moves the window * - * @param numBytes - * @throws java.io.IOException + * @param numBytes prepare the buffer window */ private void prepareToAddBytes(int numBytes) throws IOException { if (buffer.remaining() < numBytes) { @@ -90,8 +87,7 @@ private void prepareToAddBytes(int numBytes) throws IOException { /** * Puts the specified bytes at the current position * - * @param bs - * @throws java.io.IOException + * @param bs put short value */ public void putShort(byte[] bs) throws IOException { prepareToAddBytes(bs.length); @@ -102,7 +98,6 @@ public void putShort(byte[] bs) throws IOException { * flushes the cached contents into the channel. It is mandatory to call * this method to finish the writing of the channel * - * @throws java.io.IOException */ public void flush() throws IOException { buffer.flip(); @@ -121,8 +116,7 @@ public void order(ByteOrder order) { /** * Puts the specified int at the current position * - * @param value - * @throws java.io.IOException + * @param value put int value */ public void putInt(int value) throws IOException { prepareToAddBytes(4); @@ -132,8 +126,7 @@ public void putInt(int value) throws IOException { /** * Puts the specified double at the current position * - * @param d - * @throws java.io.IOException + * @param d put double value */ public void putDouble(double d) throws IOException { prepareToAddBytes(8); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java index 373b5287b1..42aab0844f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java @@ -51,11 +51,8 @@ public String getJavaStaticMethod() { /** * Read the GML representation * - * @param gmlFile - * @return - * @throws org.xml.sax.SAXException - * @throws java.io.IOException - * @throws javax.xml.parsers.ParserConfigurationException + * @param gmlFile read gml geometry + * @return Geometry */ public static Geometry toGeometry(String gmlFile) throws SAXException, IOException, ParserConfigurationException{ return toGeometry(gmlFile, 0); @@ -64,12 +61,9 @@ public static Geometry toGeometry(String gmlFile) throws SAXException, IOExcept /** * Read the GML representation with a specified SRID * - * @param gmlFile - * @param srid - * @return - * @throws org.xml.sax.SAXException - * @throws java.io.IOException - * @throws javax.xml.parsers.ParserConfigurationException + * @param gmlFile gml geometry + * @param srid force srid + * @return new geometry */ public static Geometry toGeometry(String gmlFile, int srid) throws SAXException, IOException, ParserConfigurationException { if (gmlFile == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_LineFromWKB.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_LineFromWKB.java index c6c629e4a7..4fbc18ff39 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_LineFromWKB.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_LineFromWKB.java @@ -50,8 +50,6 @@ public String getJavaStaticMethod() { * Convert WKT into a LinearRing * @param bytes Byte array * @return LineString instance of null if bytes null - * @throws SQLException WKB Parse error - * @throws java.io.IOException */ public static Geometry toLineString(byte[] bytes) throws SQLException, IOException { return toLineString(bytes, 0); @@ -63,8 +61,6 @@ public static Geometry toLineString(byte[] bytes) throws SQLException, IOExcepti * @param bytes Byte array * @param srid SRID * @return LineString instance of null if bytes null - * @throws SQLException WKB Parse error - * @throws java.io.IOException */ public static Geometry toLineString(byte[] bytes, int srid) throws SQLException, IOException { if (bytes == null) { From d9a5a65920f505e90af1355ef96b8d2449ef6a4f Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 15:31:51 +0100 Subject: [PATCH 17/26] Fix doc --- .../functions/io/kml/KMLWriterDriver.java | 34 ++++------ .../h2gis/functions/io/osm/OSMElement.java | 18 ++--- .../functions/io/osm/OSMTablesFactory.java | 68 ++++++++----------- .../io/overpass/ST_AsOverpassBbox.java | 2 +- 4 files changed, 54 insertions(+), 68 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java index 91af012a53..83ee1651e7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java @@ -177,8 +177,7 @@ private void writeKML(ProgressVisitor progress,File fileName,ResultSet rs,String * Write the spatial table to a KMZ format * * @param progress Progress visitor following the execution. - * @param fileNameWithExtension - * @throws SQLException + * @param fileNameWithExtension file name */ private void writeKMZ(ProgressVisitor progress,File fileName, String fileNameWithExtension, ResultSet rs,String geomField, String encoding) throws SQLException { ZipOutputStream zos = null; @@ -216,8 +215,7 @@ private void writeKMZ(ProgressVisitor progress,File fileName, String fileNameWit * column in the placeMark element. The other geomtry columns are ignored. * * @param progress Progress visitor following the execution. - * @param outputStream - * @throws SQLException + * @param outputStream {@link FileOutputStream} */ private void writeKMLDocument(ProgressVisitor progress, OutputStream outputStream, ResultSet rs, String geomField, String encoding) throws SQLException { try { @@ -278,8 +276,8 @@ private void writeKMLDocument(ProgressVisitor progress, OutputStream outputStrea * * * - * @param xmlOut - * @param metaData + * @param xmlOut {@link XMLStreamWriter} + * @param metaData {@link ResultSetMetaData} */ private void writeSchema(XMLStreamWriter xmlOut, ResultSetMetaData metaData) throws XMLStreamException, SQLException { columnCount = metaData.getColumnCount(); @@ -313,10 +311,9 @@ private void writeSchema(XMLStreamWriter xmlOut, ResultSetMetaData metaData) thr * * * - * @param xmlOut - * @param columnName - * @param columnType - * @throws XMLStreamException + * @param xmlOut {@link XMLStreamWriter} + * @param columnName column name + * @param columnType column type */ private void writeSimpleField(XMLStreamWriter xmlOut, String columnName, String columnType) throws XMLStreamException { xmlOut.writeStartElement("SimpleField"); @@ -352,9 +349,9 @@ private void writeSimpleField(XMLStreamWriter xmlOut, String columnName, String * * } * - * @param xmlOut - * @param rs - * @param geomField + * @param xmlOut {@link XMLStreamWriter} + * @param rs {@link ResultSet} + * @param geomField geometry column */ public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, String geomField) throws XMLStreamException, SQLException { xmlOut.writeStartElement("Placemark"); @@ -403,7 +400,7 @@ public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, String geomFiel * * } * - * @param xmlOut + * @param xmlOut {@link XMLStreamWriter} */ public void writeExtendedData(XMLStreamWriter xmlOut, ResultSet rs) throws XMLStreamException, SQLException { xmlOut.writeStartElement("ExtendedData"); @@ -421,7 +418,7 @@ public void writeExtendedData(XMLStreamWriter xmlOut, ResultSet rs) throws XMLSt /** * - * @param xmlOut + * @param xmlOut {@link XMLStreamWriter} */ public void writeSimpleData(XMLStreamWriter xmlOut, String columnName, String value) throws XMLStreamException { xmlOut.writeStartElement("SimpleData"); @@ -433,10 +430,9 @@ public void writeSimpleData(XMLStreamWriter xmlOut, String columnName, String va /** * Return the kml type representation from SQL data type * - * @param sqlTypeId - * @param sqlTypeName - * @return - * @throws SQLException + * @param sqlTypeId sql type code + * @param sqlTypeName sql type name + * @return kml type */ private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException { switch (sqlTypeId) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMElement.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMElement.java index b8f95ee10b..2291ac7297 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMElement.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMElement.java @@ -51,7 +51,7 @@ public OSMElement() { /** * The id of the element * - * @return + * @return id value */ public long getID() { return id; @@ -60,7 +60,7 @@ public long getID() { /** * Set an id to the element * - * @param id + * @param id set id value */ public void setId(String id) { this.id = Long.valueOf(id); @@ -69,7 +69,7 @@ public void setId(String id) { /** * The user * - * @return + * @return user value */ public String getUser() { return user; @@ -105,7 +105,7 @@ public void setName(String name) { /** * - * @return + * @return true if visible */ public boolean getVisible() { return visible; @@ -119,7 +119,7 @@ public void setVisible(String visible) { /** * - * @return + * @return GPX version */ public int getVersion() { return version; @@ -131,7 +131,7 @@ public void setVersion(String version) { /** * - * @return + * @return change set value */ public int getChangeSet() { return changeset; @@ -145,7 +145,7 @@ public void setChangeset(String changeset) { /** * - * @return + * @return time stamp */ public Timestamp getTimeStamp() { return timestamp; @@ -167,8 +167,8 @@ public void setTimestamp(String OSMtime) throws SAXException { /** * - * @param key - * @param value + * @param key key value + * @param value value * @return True if the tag should be inserted in the tag table. */ public boolean addTag(String key, String value) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java index 245f7bb04a..c443e11882 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java @@ -105,10 +105,9 @@ public static PreparedStatement createNodeTable(Connection connection, String no /** * Create a table to store the node tags. * - * @param connection - * @param nodeTagTableName - * @return - * @throws SQLException + * @param connection database + * @param nodeTagTableName table name + * @return PreparedStatement */ public static PreparedStatement createNodeTagTable(Connection connection, String nodeTagTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -128,10 +127,9 @@ public static PreparedStatement createNodeTagTable(Connection connection, String * changeset="4142606" timestamp="2010-03-16T11:47:08Z"> * } * - * @param connection - * @param wayTableName - * @return - * @throws SQLException + * @param connection database + * @param wayTableName table name + * @return PreparedStatement */ public static PreparedStatement createWayTable(Connection connection, String wayTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -146,10 +144,9 @@ public static PreparedStatement createWayTable(Connection connection, String way /** * Create a table to store the way tags. * - * @param connection - * @param wayTagTableName - * @return - * @throws SQLException + * @param connection database + * @param wayTagTableName table name + * @return PreparedStatement */ public static PreparedStatement createWayTagTable(Connection connection, String wayTagTableName) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -164,10 +161,9 @@ public static PreparedStatement createWayTagTable(Connection connection, String /** * Create a table to store the list of nodes for each way. * - * @param connection - * @param wayNodeTableName - * @return - * @throws SQLException + * @param connection database + * @param wayNodeTableName table name + * @return PreparedStatement */ public static PreparedStatement createWayNodeTable(Connection connection, String wayNodeTableName) throws SQLException{ try (Statement stmt = connection.createStatement()) { @@ -182,10 +178,9 @@ public static PreparedStatement createWayNodeTable(Connection connection, String /** * Create the relation table. * - * @param connection - * @param relationTable - * @return - * @throws SQLException + * @param connection database + * @param relationTable table name + * @return PreparedStatement */ public static PreparedStatement createRelationTable(Connection connection, String relationTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -206,10 +201,9 @@ public static PreparedStatement createRelationTable(Connection connection, Strin /** * Create the relation tags table * - * @param connection - * @param relationTagTable - * @return - * @throws SQLException + * @param connection database + * @param relationTagTable table name + * @return PreparedStatement */ public static PreparedStatement createRelationTagTable(Connection connection, String relationTagTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -224,10 +218,9 @@ public static PreparedStatement createRelationTagTable(Connection connection, St /** * Create the node members table * - * @param connection - * @param nodeMemberTable - * @return - * @throws SQLException + * @param connection database + * @param nodeMemberTable table name + * @return PreparedStatement */ public static PreparedStatement createNodeMemberTable(Connection connection, String nodeMemberTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -242,10 +235,9 @@ public static PreparedStatement createNodeMemberTable(Connection connection, Str /** * Create a table to store all way members. * - * @param connection - * @param wayMemberTable - * @return - * @throws SQLException + * @param connection database + * @param wayMemberTable table name + * @return PreparedStatement */ public static PreparedStatement createWayMemberTable(Connection connection, String wayMemberTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -260,10 +252,9 @@ public static PreparedStatement createWayMemberTable(Connection connection, Stri /** * Store all relation members * - * @param connection - * @param relationMemberTable - * @return - * @throws SQLException + * @param connection database + * @param relationMemberTable table name + * @return PreparedStatement */ public static PreparedStatement createRelationMemberTable(Connection connection, String relationMemberTable) throws SQLException { try (Statement stmt = connection.createStatement()) { @@ -279,9 +270,8 @@ public static PreparedStatement createRelationMemberTable(Connection connection, /** * Drop the existing OSM tables used to store the imported OSM data * - * @param connection - * @param tablePrefix - * @throws SQLException + * @param connection database + * @param tablePrefix table prefix */ public static void dropOSMTables(Connection connection, String tablePrefix) throws SQLException { final DBTypes dbType = DBUtils.getDBType(connection); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java index ed5e79d095..700840232a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/ST_AsOverpassBbox.java @@ -44,7 +44,7 @@ public String getJavaStaticMethod() { /** * Return a string representation of the Geometry envelope conform * to be overpass format : - * south, west, north, east -> minY,minX, maxY, maxX + * south, west, north, east : minY,minX, maxY, maxX * * * @param geom input geometry From a672b3de40c2dc30abc73a669d053e36c943dc5f Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 15:36:23 +0100 Subject: [PATCH 18/26] Fix doc --- .../java/org/h2gis/functions/io/asc/AscRead.java | 6 +++--- .../org/h2gis/functions/io/asc/AscReaderDriver.java | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java index b1e9eeb497..ea4be4a88b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscRead.java @@ -165,9 +165,9 @@ public static void readAscii(Connection connection, String fileName, String tabl * Import the file * @param connection database connection * @param tableReference output table name - * @param outputFile + * @param outputFile output file * @param progress Progress visitor following the execution. - * @param ascReaderDriver + * @param ascReaderDriver {@link AscReaderDriver} * @throws IOException Throw exception is the file cannot be accessed * @throws SQLException Throw exception is the file name contains unsupported characters */ @@ -241,7 +241,7 @@ public static void readAscii(Connection connection, String fileName, String tabl /** * Import a small subset of ASC file. * - * @param connection + * @param connection database * @param fileName input file * @param tableReference output table name * @param envelope Extract only pixels that intersects the provided geometry diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java index 8c1047b6d3..d4835ba7f8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/asc/AscReaderDriver.java @@ -261,10 +261,10 @@ public String[] read(Connection connection, File fileName, ProgressVisitor progr * Read the ascii file from inpustream * * @param connection database connection - * @param inputStream + * @param inputStream {@link InputStream} * @param progress Progress visitor following the execution. - * @param outputTable - * @param srid + * @param outputTable output table name + * @param srid output srid * @throws UnsupportedEncodingException Throw exception is the encoding file is not supported * @throws SQLException Throw exception is the file name contains unsupported characters * @return output table name @@ -394,7 +394,7 @@ private String readAsc(Connection connection, InputStream inputStream, ProgressV /** * Use to set the z conversion type 1 = integer 2 = double * - * @param zType + * @param zType value type to manage the z value */ public void setZType(int zType) { this.zType = zType; @@ -412,7 +412,7 @@ public void setDeleteTable(boolean deleteTable) { /** * Set encoding * - * @param encoding + * @param encoding file encoding */ public void setEncoding(String encoding) { this.encoding = encoding; @@ -421,7 +421,7 @@ public void setEncoding(String encoding) { /** * Set to true if nodata must be imported. Default is false * - * @param importNodata + * @param importNodata true to read to data value */ public void setImportNodata(boolean importNodata) { this.importNodata = importNodata; From fe0fc55ce05b05d308da295f4a92bab938a2f670 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 15:39:42 +0100 Subject: [PATCH 19/26] Fix doc --- .../org/h2gis/functions/io/utility/ReadBufferManager.java | 5 ++--- .../org/h2gis/functions/spatial/predicates/ST_Touches.java | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java index ecb964d61c..649ab4196f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java @@ -196,9 +196,8 @@ public void skip(int numBytes) throws IOException { /** * Gets the byte[] value at the current position * - * @param buffer - * @return - * @throws java.io.IOException + * @param buffer byte array + * @return ByteBuffer */ public ByteBuffer get(byte[] buffer) throws IOException { int windowOffset = getWindowOffset(positionInFile, buffer.length); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java index fc08bf7003..9f211f576f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java @@ -47,7 +47,6 @@ public String getJavaStaticMethod() { * @param a Geometry A. * @param b Geometry B * @return true if the geometry A touches the geometry B - * @throws java.sql.SQLException */ public static Boolean geomTouches(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { From 0b946dc3f0ec51b7fa3cf8a0721074f348b73e52 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 16:39:46 +0100 Subject: [PATCH 20/26] Fix doc --- .../functions/factory/H2GISDBFactory.java | 4 +- .../functions/io/dbf/internal/DBFDriver.java | 2 +- .../functions/io/shp/internal/SHPDriver.java | 2 +- .../h2gis/functions/io/utility/PRJUtil.java | 7 ++- .../spatial/buffer/ST_OffSetCurve.java | 4 +- .../spatial/buffer/ST_RingSideBuffer.java | 22 ++++----- .../spatial/buffer/ST_SideBuffer.java | 22 ++++----- .../convert/GeometryCoordinateDimension.java | 38 +++++++-------- .../functions/spatial/convert/ST_AsGML.java | 4 +- .../spatial/convert/ST_GoogleMapLink.java | 18 ++++---- .../spatial/convert/UpdateGeometryZ.java | 38 +++++++-------- .../spatial/create/ST_MinimumRectangle.java | 2 +- .../spatial/create/ST_RingBuffer.java | 22 ++++----- .../spatial/distance/ST_LongestLine.java | 7 ++- .../spatial/distance/ST_ProjectPoint.java | 7 ++- .../spatial/distance/ST_ShortestLine.java | 7 ++- .../spatial/earth/ST_GeometryShadow.java | 4 +- .../spatial/earth/ST_SunPosition.java | 4 +- .../h2gis/functions/spatial/earth/ST_Svf.java | 9 ++-- .../functions/spatial/earth/SunCalc.java | 30 ++++++------ .../functions/spatial/edit/ST_Normalize.java | 4 +- .../spatial/generalize/ST_Simplify.java | 6 +-- .../functions/spatial/mesh/DelaunayData.java | 2 +- .../spatial/properties/ST_3DPerimeter.java | 8 ++-- .../properties/ST_EstimatedExtent.java | 16 +++---- .../spatial/properties/ST_Explode.java | 4 +- .../spatial/properties/ST_IsValidDetail.java | 12 ++--- .../spatial/properties/ST_IsValidReason.java | 11 +++-- .../spatial/properties/ST_Perimeter.java | 8 ++-- .../spatial/split/ST_LineIntersector.java | 13 +++--- .../spatial/topography/ST_Drape.java | 46 +++++++++---------- .../functions/spatial/topology/ST_Node.java | 4 +- .../spatial/topology/ST_Polygonize.java | 4 +- .../spatial/volume/GeometryExtrude.java | 30 ++++++------ .../h2gis/functions/system/DoubleRange.java | 4 +- .../h2gis/functions/system/IntegerRange.java | 4 +- .../geometry/DummySpatialFunction.java | 6 +-- 37 files changed, 212 insertions(+), 223 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java index d03c60953f..344f046d47 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISDBFactory.java @@ -83,8 +83,8 @@ public static Connection createSpatialDataBase(String dbName)throws SQLException /** * Return the path of the file database - * @param dbName - * @return + * @param dbName database path + * @return TODO : invalid path to be moved in test */ private static String getDataBasePath(String dbName) { if(dbName.startsWith("file://")) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java index ba2ed77c1d..60b4618ca1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/internal/DBFDriver.java @@ -149,7 +149,7 @@ public Value getField(long rowId, int columnId) throws IOException { /** * Get the file reader - * @return + * @return {@link DbaseFileReader} */ public DbaseFileReader getDbaseFileReader() { return dbaseFileReader; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java index 6d166a7f93..6ed9122ef9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java @@ -280,7 +280,7 @@ public void setSRID(int srid) { /** * Get the SRID code - * @return + * @return get the SRID */ public int getSrid() { return srid; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java index e64dcc17ad..9f0e971577 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java @@ -171,10 +171,9 @@ public static void writePRJ(Connection connection, int srid, File fileName) thro * This method checks if a SRID value is valid according a list of SRID's * avalaible on spatial_ref table of the datababase. * - * @param srid - * @param connection - * @return - * @throws java.sql.SQLException + * @param srid code + * @param connection database + * @return true if the srid exists */ public static boolean isSRIDValid(int srid, Connection connection) throws SQLException { PreparedStatement ps = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java index 768c078a61..67f7a18780 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java @@ -50,7 +50,7 @@ public String getJavaStaticMethod() { * @param geometry the geometry * @param offset the distance * @param parameters the buffer parameters - * @return + * @return {@link Geometry} */ public static Geometry offsetCurve(Geometry geometry, double offset, String parameters) { if(geometry == null){ @@ -88,7 +88,7 @@ public static Geometry offsetCurve(Geometry geometry, double offset, String para * without buffer parameters * @param geometry the geometry * @param offset the distance - * @return + * @return {@link Geometry} */ public static Geometry offsetCurve(Geometry geometry, double offset) { return OffsetCurve.getCurve(geometry, offset); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java index ea4dda27c0..06f22020d8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java @@ -56,11 +56,10 @@ public String getJavaStaticMethod() { /** * Compute a ring buffer on one side of the geometry - * @param geom - * @param bufferSize - * @param numBuffer - * @return - * @throws java.sql.SQLException + * @param geom input geometry + * @param bufferSize buffer distance + * @param numBuffer number of rings + * @return Geometry */ public static Geometry ringSideBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException { return ringSideBuffer(geom, bufferSize, numBuffer, "endcap=flat"); @@ -82,13 +81,12 @@ public static Geometry ringSideBuffer(Geometry geom, double bufferDistance, /** * Compute a ring buffer on one side of the geometry - * @param geom - * @param bufferDistance - * @param numBuffer - * @param parameters - * @param doDifference - * @throws SQLException - * @return + * @param geom input geometry + * @param bufferDistance buffer distance + * @param numBuffer number of rings + * @param parameters buffer parameters + * @param doDifference true to apply a return the buffer difference + * @return Geometry */ public static Geometry ringSideBuffer(Geometry geom, double bufferDistance, int numBuffer, String parameters, boolean doDifference) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java index 2a9626642f..6b6871024a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_SideBuffer.java @@ -51,9 +51,9 @@ public String getJavaStaticMethod() { /** * Compute a single side buffer with default parameters - * @param geometry - * @param distance - * @return + * @param geometry input geometry + * @param distance buffer distance + * @return Geometry */ public static Geometry singleSideBuffer(Geometry geometry, double distance){ if(geometry==null){ @@ -66,10 +66,10 @@ public static Geometry singleSideBuffer(Geometry geometry, double distance){ * Compute a single side buffer with join and mitre parameters * Note : * The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of flat. - * @param geometry - * @param distance - * @param parameters - * @return + * @param geometry input geometry + * @param distance buffer distance + * @param parameters buffer parameters + * @return Geometry */ public static Geometry singleSideBuffer(Geometry geometry, double distance, String parameters){ if(geometry == null){ @@ -103,10 +103,10 @@ public static Geometry singleSideBuffer(Geometry geometry, double distance, Stri /** * Compute the buffer - * @param geometry - * @param distance - * @param bufferParameters - * @return + * @param geometry input geometry + * @param distance buffer distance + * @param bufferParameters buffer parameters + * @return Geometry */ private static Geometry computeSingleSideBuffer(Geometry geometry, double distance, BufferParameters bufferParameters){ bufferParameters.setSingleSided(true); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java index f437d93a11..0756e2b1d5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java @@ -37,7 +37,7 @@ public class GeometryCoordinateDimension { * @param geom the input geometry * @param dimension supported dimension is 2, 3 * if the dimension is set to 3 the z measure are set to 0 - * @return + * @return Geometry */ public static Geometry force(Geometry geom, int dimension) { Geometry g = geom; @@ -86,9 +86,9 @@ public static MultiPoint convert(MultiPoint mp, int dimension) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param dimension - * @return + * @param gc {@link GeometryCollection} + * @param dimension dimension to extract + * @return Geometry */ public static GeometryCollection convert(GeometryCollection gc, int dimension) { int nb = gc.getNumGeometries(); @@ -102,9 +102,9 @@ public static GeometryCollection convert(GeometryCollection gc, int dimension) { /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param dimension - * @return + * @param multiPolygon {@link MultiPolygon} + * @param dimension dimension to extract + * @return Geometry */ public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) { int nb = multiPolygon.getNumGeometries(); @@ -118,9 +118,9 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) { /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param dimension - * @return + * @param multiLineString {@link MultiLineString} + * @param dimension dimension to extract + * @return Geometry */ public static MultiLineString convert(MultiLineString multiLineString, int dimension) { int nb = multiLineString.getNumGeometries(); @@ -134,9 +134,9 @@ public static MultiLineString convert(MultiLineString multiLineString, int dimen /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param dimension - * @return + * @param polygon {@link Polygon} + * @param dimension dimension to extract + * @return Geometry */ public static Polygon convert(Polygon polygon, int dimension) { LinearRing shell = gf.createLinearRing(convertSequence(polygon.getExteriorRing().getCoordinateSequence(),dimension)); @@ -153,9 +153,9 @@ public static Polygon convert(Polygon polygon, int dimension) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param dimension - * @return + * @param lineString {@link LineString} + * @param dimension dimension to extract + * @return Geometry */ public static LineString convert(LineString lineString,int dimension) { return gf.createLineString(convertSequence(lineString.getCoordinateSequence(),dimension)); @@ -164,9 +164,9 @@ public static LineString convert(LineString lineString,int dimension) { /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param dimension - * @return + * @param linearRing {@link LinearRing} + * @param dimension dimension to extract + * @return LinearRing */ public static LinearRing convert(LinearRing linearRing,int dimension) { return gf.createLinearRing(convertSequence(linearRing.getCoordinateSequence(),dimension)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_AsGML.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_AsGML.java index 7a9863989f..9a38481fdb 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_AsGML.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_AsGML.java @@ -42,8 +42,8 @@ public String getJavaStaticMethod() { /** * Write the GML - * @param geom - * @return + * @param geom input geometry + * @return GML representation */ public static String toGML(Geometry geom) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java index 9583289fda..95c4137014 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GoogleMapLink.java @@ -47,8 +47,8 @@ public String getJavaStaticMethod() { /** * Generate a Google Map link URL based on the center of the bounding box of the input geometry * - * @param geom - * @return + * @param geom input geometry + * @return google url location */ public static String generateGMLink(Geometry geom) { return generateGMLink(geom, "m", 19); @@ -58,9 +58,9 @@ public static String generateGMLink(Geometry geom) { * Generate a Google Map link URL based on the center of the bounding box of the input geometry * and set the layer type * - * @param geom - * @param layerType - * @return + * @param geom input geometry + * @param layerType layer type + * @return google map url location */ public static String generateGMLink(Geometry geom, String layerType) { return generateGMLink(geom, layerType, 19); @@ -70,10 +70,10 @@ public static String generateGMLink(Geometry geom, String layerType) { * Generate a Google Map link URL based on the center of the bounding box of the input geometry. * Set the layer type and the zoom level. * - * @param geom - * @param layerType - * @param zoom - * @return + * @param geom input geometry + * @param layerType layer type + * @param zoom zoom level + * @return google map url location */ public static String generateGMLink(Geometry geom, String layerType, int zoom) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/UpdateGeometryZ.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/UpdateGeometryZ.java index fd5a845482..ab8c264fa6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/UpdateGeometryZ.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/UpdateGeometryZ.java @@ -37,7 +37,7 @@ public class UpdateGeometryZ { * dimension and change the z value * @param geom the input geometry * @param z the value to update - * @return + * @return Geometry */ public static Geometry force(Geometry geom, double z) { Geometry g = geom; @@ -63,9 +63,9 @@ public static Geometry force(Geometry geom, double z) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param z - * @return + * @param gc {@link GeometryCollection} + * @param z Z value + * @return Geometry */ public static GeometryCollection convert(GeometryCollection gc, double z) { int nb = gc.getNumGeometries(); @@ -79,9 +79,9 @@ public static GeometryCollection convert(GeometryCollection gc, double z) { /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param z - * @return + * @param multiPolygon MultiPolygon + * @param z Z value + * @return MultiPolygon */ public static MultiPolygon convert(MultiPolygon multiPolygon,double z) { int nb = multiPolygon.getNumGeometries(); @@ -95,9 +95,9 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,double z) { /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param z - * @return + * @param multiLineString {@link MultiLineString} + * @param z value + * @return MultiLineString */ public static MultiLineString convert(MultiLineString multiLineString, double z) { int nb = multiLineString.getNumGeometries(); @@ -111,9 +111,9 @@ public static MultiLineString convert(MultiLineString multiLineString, double z) /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param z - * @return + * @param polygon {@link Polygon} + * @param z value + * @return Polygon */ public static Polygon convert(Polygon polygon, double z) { LinearRing shell = gf.createLinearRing(convertSequence(polygon.getExteriorRing().getCoordinates(),z)); @@ -130,9 +130,9 @@ public static Polygon convert(Polygon polygon, double z) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param z - * @return + * @param lineString {@link LineString} + * @param z value + * @return LineString */ public static LineString convert(LineString lineString,double z) { return gf.createLineString(convertSequence(lineString.getCoordinates(),z)); @@ -141,9 +141,9 @@ public static LineString convert(LineString lineString,double z) { /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param z - * @return + * @param linearRing {@link LinearRing} + * @param z value + * @return LinearRing */ public static LinearRing convert(LinearRing linearRing,double z) { return gf.createLinearRing(convertSequence(linearRing.getCoordinates(),z)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MinimumRectangle.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MinimumRectangle.java index 942694fd9a..c11746c432 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MinimumRectangle.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MinimumRectangle.java @@ -46,7 +46,7 @@ public String getJavaStaticMethod() { /** * Gets the minimum rectangular {@link Polygon} which encloses the input geometry. * @param geometry Input geometry - * @return + * @return Geometry */ public static Geometry computeMinimumRectangle(Geometry geometry){ if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java index 18301c7a4d..1909092ecc 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java @@ -55,11 +55,10 @@ public String getJavaStaticMethod() { /** * Compute a ring buffer around a geometry - * @param geom - * @param bufferSize - * @param numBuffer - * @return - * @throws java.sql.SQLException + * @param geom input geometry + * @param bufferSize buffer size + * @param numBuffer number of rings + * @return Geometry */ public static Geometry ringBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException { return ringBuffer(geom, bufferSize, numBuffer, "endcap=round"); @@ -81,13 +80,12 @@ public static Geometry ringBuffer(Geometry geom, double bufferDistance, /** * Compute a ring buffer around a geometry - * @param geom - * @param bufferDistance - * @param numBuffer - * @param parameters - * @param doDifference - * @throws SQLException - * @return + * @param geom input geometry + * @param bufferDistance buffer size + * @param numBuffer number of rings + * @param parameters buffer parameters + * @param doDifference do the difference between the rings + * @return Geometry */ public static Geometry ringBuffer(Geometry geom, double bufferDistance, int numBuffer, String parameters, boolean doDifference) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java index 255c0ac509..2030520fb0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_LongestLine.java @@ -44,10 +44,9 @@ public String getJavaStaticMethod() { /** * Return the longest line between the points of two geometries. - * @param geomA - * @param geomB - * @return - * @throws java.sql.SQLException + * @param geomA {@link Geometry} A + * @param geomB {@link Geometry} B + * @return Geometry */ public static Geometry longestLine(Geometry geomA, Geometry geomB) throws SQLException { if(geomA ==null || geomB==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ProjectPoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ProjectPoint.java index 14052d080b..27a5141b2f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ProjectPoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ProjectPoint.java @@ -46,10 +46,9 @@ public String getJavaStaticMethod() { /** * Project a point on a linestring or multilinestring - * @param point - * @param geometry - * @return - * @throws java.sql.SQLException + * @param point {@link Point} + * @param geometry {@link Geometry} + * @return Geometry */ public static Point projectPoint(Geometry point, Geometry geometry) throws SQLException { if (point == null || geometry==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ShortestLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ShortestLine.java index d8c8d5e174..16087dfe67 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ShortestLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ShortestLine.java @@ -44,10 +44,9 @@ public String getJavaStaticMethod() { /** * Compute the shortest line between two geometries. - * @param geomA - * @param geomB - * @return - * @throws java.sql.SQLException + * @param geomA {@link Geometry} A + * @param geomB {@link Geometry} B + * @return Geometry */ public static LineString shortestLine(Geometry geomA, Geometry geomB) throws SQLException{ if (geomA == null || geomB == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java index decbe41fd3..1095d2bdb9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java @@ -65,7 +65,7 @@ public String getJavaStaticMethod() { * @param geometry input geometry * @param sunPosition as a point where x = azimuth and y=altitude * @param height of the geometry - * @return + * @return Geometry */ public static Geometry computeShadow(Geometry geometry, Geometry sunPosition, double height) { if (sunPosition != null) { @@ -86,7 +86,7 @@ public static Geometry computeShadow(Geometry geometry, Geometry sunPosition, do * @param azimuth of the sun in radians * @param altitude of the sun in radians * @param height of the geometry - * @return + * @return Geometry */ public static Geometry computeShadow(Geometry geometry, double azimuth, double altitude, double height) { return computeShadow(geometry, azimuth, altitude, height, true); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java index 19038ec252..8d78b882a5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java @@ -50,8 +50,8 @@ public String getJavaStaticMethod() { /** * Return the current sun position - * @param point - * @return + * @param point sum location + * @return Geometry */ public static Geometry sunPosition(Geometry point){ return sunPosition(point, new Timestamp(0)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java index 05ee87cceb..ca683eba89 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java @@ -72,13 +72,12 @@ public static Double computeSvf(Point pt, Geometry geoms, double distance, int r /** * The method to compute the Sky View Factor - * @param pt - * @param distance + * @param pt location to compute the svf + * @param distance distance to compute the sky sphere * @param rayCount number of rays * @param stepRayLength length of sub ray used to limit the number of geometries when requested - * @param geoms - * @return - * @throws java.sql.SQLException + * @param geoms geometry obstacles + * @return double svf value */ public static Double computeSvf(Point pt, Geometry geoms, double distance, int rayCount, int stepRayLength) throws SQLException{ Double svf = null; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java index 37058461af..72d1a2f5fe 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java @@ -115,10 +115,10 @@ private static double getSiderealTime(double J, double lw) { /** * Sun azimuth in radians (direction along the horizon, measured from north to east) * e.g. 0 is north - * @param H - * @param phi - * @param d - * @return + * @param H height + * @param phi phi + * @param d distance + * @return azimuth */ private static double getAzimuth(double H, double phi, double d) { return Math.atan2(Math.sin(H), @@ -128,10 +128,10 @@ private static double getAzimuth(double H, double phi, double d) { /** * Sun altitude above the horizon in radians. * e.g. 0 at the horizon and PI/2 at the zenith - * @param H - * @param phi - * @param d - * @return + * @param H heigth + * @param phi phi + * @param d distance + * @return altitude */ private static double getAltitude(double H, double phi, double d) { return Math.asin(Math.sin(phi) * Math.sin(d) + Math.cos(phi) @@ -147,10 +147,10 @@ private static double getAltitude(double H, double phi, double d) { * horizon and PI/2 at the zenith (straight over your head). * * - * @param date - * @param lat - * @param lng - * @return + * @param date date + * @param lat latitude + * @param lng longitude + * @return location */ public static Coordinate getPosition(Date date, double lat, double lng) { @@ -174,9 +174,9 @@ public static Coordinate getPosition(Date date, double lat, /** * Test if the point has valid latitude and longitude coordinates. - * @param latitude - * @param longitude - * @return + * @param latitude latitude + * @param longitude longitude + * @return true if the values are in the range */ public static boolean isGeographic(double latitude, double longitude) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Normalize.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Normalize.java index 85aefa532a..da143c53d1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Normalize.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Normalize.java @@ -42,8 +42,8 @@ public String getJavaStaticMethod() { /** * Converts this Geometry to normal form (canonical form). * - * @param geometry - * @return + * @param geometry Geometry + * @return Geometry */ public static Geometry normalize(Geometry geometry) { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java index c275122bd2..adde490835 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_Simplify.java @@ -44,9 +44,9 @@ public String getJavaStaticMethod() { /** * Simplify the geometry using the douglad peucker algorithm. * - * @param geometry - * @param distance - * @return + * @param geometry {@link Geometry} + * @param distance distance to simplify + * @return Geometry */ public static Geometry simplify(Geometry geometry, double distance) { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java index 8e1aea432a..2e4d50fa7a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java @@ -199,7 +199,7 @@ public MultiPolygon getTriangles() { /** * Return the 3D area of all triangles - * @return + * @return the area of the triangles in 3D */ public double get3DArea(){ if(convertedInput != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java index b20e081de6..b8589fc4a1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DPerimeter.java @@ -45,8 +45,8 @@ public String getJavaStaticMethod() { /** * Compute the 3D perimeter of a polygon or a multipolygon. - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return the 3D perimeter */ public static Double st3Dperimeter(Geometry geometry){ if(geometry==null){ @@ -60,8 +60,8 @@ public static Double st3Dperimeter(Geometry geometry){ /** * Compute the 3D perimeter - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return 3D perimeter */ private static double compute3DPerimeter(Geometry geometry) { double sum = 0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_EstimatedExtent.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_EstimatedExtent.java index 6f92e8d2f8..c037c9f700 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_EstimatedExtent.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_EstimatedExtent.java @@ -39,10 +39,9 @@ public String getJavaStaticMethod() { /** * Compute the estimated extent based on the first geometry column - * @param connection - * @param tableName - * @return - * @throws java.sql.SQLException + * @param connection database + * @param tableName table name + * @return the estimated geometry extent */ public static Geometry computeEstimatedExtent(Connection connection, String tableName) throws SQLException{ @@ -51,11 +50,10 @@ public static Geometry computeEstimatedExtent(Connection connection, /** * Compute the estimated extent based on a geometry field - * @param connection - * @param tableName - * @param geometryColumn - * @return - * @throws java.sql.SQLException + * @param connection database + * @param tableName table name + * @param geometryColumn geometry column name + * @return the estimated geometry extent */ public static Geometry computeEstimatedExtent(Connection connection, String tableName, String geometryColumn) throws SQLException{ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java index deed8c3b59..be2605729a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java @@ -309,8 +309,8 @@ private void copyfields(SimpleResultSet rs, String selectQuery) throws SQLExcept /** * Method to perform the select query with a limit clause - * @param selectQuery - * @return + * @param selectQuery input select query + * @return select + limit query */ private String limitQuery(String selectQuery) { //Remove the parentheses diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java index e0353f01a8..a1fa7b9e2d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidDetail.java @@ -54,7 +54,7 @@ public String getJavaStaticMethod() { * [0] = isvalid,[1] = reason, [2] = error location * * @param geometry - * @return + * @return array with all valid details */ public static String[] isValidDetail(Geometry geometry) { return isValidDetail(geometry, 0); @@ -69,9 +69,9 @@ public static String[] isValidDetail(Geometry geometry) { * error returns the location of this error (on the {@link Geometry} * containing the error. * - * @param geometry - * @param flag - * @return + * @param geometry {@link Geometry} + * @param flag [0] = isvalid,[1] = reason, [2] = error location + * @return array of valid details */ public static String[] isValidDetail(Geometry geometry, int flag) { if (geometry != null) { @@ -88,8 +88,8 @@ public static String[] isValidDetail(Geometry geometry, int flag) { /** * TODO : change the return of this method when H2 will support row values - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return array of valid details */ private static String[] detail(Geometry geometry, boolean flag) { String[] details = new String[3]; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java index 10a8c2be87..9b9f8d5870 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java @@ -49,8 +49,8 @@ public String getJavaStaticMethod() { * Returns text stating whether a geometry is valid. * If not, returns a reason why. * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return Returns text stating whether a geometry is valid. If not, returns a reason why */ public static String isValidReason(Geometry geometry) { return isValidReason(geometry, 0); @@ -60,9 +60,10 @@ public static String isValidReason(Geometry geometry) { * Returns text stating whether a geometry is valid. * If not, returns a reason why. * - * @param geometry - * @param flag - * @return + * @param geometry {@link Geometry} + * @param flag 1 = It will validate inverted shells and exverted holes according the ESRI SDE model. + * 0 = It will based on the OGC geometry model. + * @return valid reason */ public static String isValidReason(Geometry geometry, int flag) { if (geometry != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Perimeter.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Perimeter.java index 0e1538c93f..46dc3b5c70 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Perimeter.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Perimeter.java @@ -44,8 +44,8 @@ public String getJavaStaticMethod() { /** * Compute the perimeter of a polygon or a multipolygon. - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return perimeter */ public static Double perimeter(Geometry geometry){ if(geometry==null){ @@ -59,8 +59,8 @@ public static Double perimeter(Geometry geometry){ /** * Compute the perimeter - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return perimeter */ private static double computePerimeter(Geometry geometry) { double sum = 0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java index 2e444c4290..1e28c028a0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java @@ -57,10 +57,9 @@ public String getJavaStaticMethod() { /** * Split a lineal geometry by a another geometry - * @param inputLines - * @param clipper - * @return - * @throws java.sql.SQLException + * @param inputLines lines + * @param clipper geometry to clip the lines + * @return new clipped lines */ public static Geometry lineIntersector(Geometry inputLines, Geometry clipper) throws IllegalArgumentException, SQLException { if(inputLines == null||clipper == null){ @@ -101,9 +100,9 @@ public static Geometry lineIntersector(Geometry inputLines, Geometry clipper) th /*** * Convert the input geometries as a list of segments and mark them with a flag * to identify input and output geometries. - * @param inputLines - * @param clipper - * @return + * @param inputLines lines + * @param clipper geometry to clip + * @return array of segments */ public static ArrayList getSegments(Geometry inputLines, Geometry clipper) { ArrayList segments = new ArrayList(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java index 06d0f6463d..06bba3e235 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java @@ -123,10 +123,10 @@ public static Geometry drapePoint(Geometry pts, Geometry triangles, STRtree sTRt /** * Drape a multilinestring to a set of triangles - * @param polygons - * @param triangles - * @param sTRtree - * @return + * @param polygons {@link MultiPolygon} + * @param triangles set of triangles + * @param sTRtree {@link STRtree} + * @return polygons with z values */ public static Geometry drapeMultiPolygon(MultiPolygon polygons, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = polygons.getFactory(); @@ -142,10 +142,10 @@ public static Geometry drapeMultiPolygon(MultiPolygon polygons, Geometry triangl /** * Drape a multilinestring to a set of triangles - * @param lines - * @param triangles - * @param sTRtree - * @return + * @param lines {@link MultiLineString} + * @param triangles set of triangles + * @param sTRtree {@link STRtree} + * @return lines with z values */ public static Geometry drapeMultiLineString(MultiLineString lines, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = lines.getFactory(); @@ -162,10 +162,10 @@ public static Geometry drapeMultiLineString(MultiLineString lines, Geometry tria /** * Drape a linestring to a set of triangles - * @param line - * @param triangles - * @param sTRtree - * @return + * @param line {@link LineString} + * @param triangles set of triangles + * @param sTRtree {@link STRtree} + * @return line with z values */ public static Geometry drapeLineString(LineString line, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = line.getFactory(); @@ -178,10 +178,10 @@ public static Geometry drapeLineString(LineString line, Geometry triangles, STRt /** * Drape a polygon on a set of triangles - * @param p - * @param triangles - * @param sTRtree - * @return + * @param p {@link Polygon} + * @param triangles set of triangles + * @param sTRtree {@link STRtree} + * @return polygon with z values */ public static Polygon drapePolygon(Polygon p, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = p.getFactory(); @@ -193,10 +193,10 @@ public static Polygon drapePolygon(Polygon p, Geometry triangles, STRtree sTRtre /** * Cut the lines of the polygon with the triangles - * @param p - * @param triangleLines - * @param factory - * @return + * @param p {@link Polygon} + * @param triangleLines set of triangles + * @param factory {@link GeometryFactory} + * @return polygon with z values */ private static Polygon processPolygon(Polygon p, Geometry triangleLines, GeometryFactory factory,STRtree sTRtree) { Geometry diffExt = p.getExteriorRing().difference(triangleLines); @@ -213,9 +213,9 @@ private static Polygon processPolygon(Polygon p, Geometry triangleLines, Geometr /** * A method to merge a geometry to a set of linestring - * @param geom - * @param factory - * @return + * @param geom {@link Geometry} + * @param factory {@link GeometryFactory} + * @return merged lines */ public static Geometry lineMerge(Geometry geom, GeometryFactory factory) { LineMerger merger = new LineMerger(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java index bbeda6095f..860b51a0d0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Node.java @@ -47,8 +47,8 @@ public String getJavaStaticMethod() { /** * Nodes a geometry using a monotone chain and a spatial index - * @param geom - * @return + * @param geom {@link Geometry} + * @return geometry noded */ public static Geometry node(Geometry geom) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java index 1149df3924..ff31434a85 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Polygonize.java @@ -49,8 +49,8 @@ public String getJavaStaticMethod() { * Creates a GeometryCollection containing possible polygons formed * from the constituent linework of a set of geometries. * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return new polygons */ public static Geometry execute(Geometry geometry) { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java index 3b582e799e..f88126d1d2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java @@ -41,9 +41,9 @@ private GeometryExtrude() { /** * Extrude the polygon as a collection of geometries * The output geometryCollection contains the floor, the walls and the roof. - * @param polygon - * @param height - * @return + * @param polygon {@link Polygon} + * @param height value + * @return polygon extruded */ public static GeometryCollection extrudePolygonAsGeometry(Polygon polygon, double height){ GeometryFactory factory = polygon.getFactory(); @@ -76,9 +76,9 @@ public static GeometryCollection extrudePolygonAsGeometry(Polygon polygon, doubl /** * Extrude the linestring as a collection of geometries * The output geometryCollection contains the floor, the walls and the roof. - * @param lineString - * @param height - * @return + * @param lineString lineString + * @param height value + * @return lineString extruded */ public static GeometryCollection extrudeLineStringAsGeometry(LineString lineString, double height){ Geometry[] geometries = new Geometry[3]; @@ -142,9 +142,9 @@ public static MultiPolygon extractWalls(Polygon polygon, double height){ /** * Extract the roof of a polygon * - * @param polygon - * @param height - * @return + * @param polygon {@link Polygon} + * @param height value + * @return roof extracted */ public static Polygon extractRoof(Polygon polygon, double height) { GeometryFactory factory = polygon.getFactory(); @@ -180,8 +180,8 @@ public static MultiPolygon extractWalls(LineString lineString, double height) { /** * Reverse the LineString to be oriented clockwise. * All NaN z values are replaced by a zero value. - * @param lineString - * @return + * @param lineString {@link LineString} + * @return LineString oriented clockwise */ private static LineString getClockWise(final LineString lineString) { final Coordinate c0 = lineString.getCoordinateN(0); @@ -197,8 +197,8 @@ private static LineString getClockWise(final LineString lineString) { /** * Reverse the LineString to be oriented counter-clockwise. - * @param lineString - * @return + * @param lineString {@link LineString} + * @return LineString oriented counter-clockwise */ private static LineString getCounterClockWise(final LineString lineString) { final Coordinate c0 = lineString.getCoordinateN(0); @@ -214,8 +214,8 @@ private static LineString getCounterClockWise(final LineString lineString) { /** * Reverse the polygon to be oriented clockwise - * @param polygon - * @return + * @param polygon {@link Polygon} + * @return extract floor geometry */ private static Polygon extractFloor(final Polygon polygon) { GeometryFactory factory = polygon.getFactory(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/system/DoubleRange.java b/h2gis-functions/src/main/java/org/h2gis/functions/system/DoubleRange.java index e37af63818..e1c776aee2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/system/DoubleRange.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/system/DoubleRange.java @@ -43,7 +43,7 @@ public String getJavaStaticMethod() { * Return an array of doubles with a default step of 1. * @param begin from start * @param end to end - * @return + * @return a double array */ public static Double[] createArray(double begin, double end) { return createArray(begin, end, 1); @@ -54,7 +54,7 @@ public static Double[] createArray(double begin, double end) { * @param begin from start * @param end to end * @param step increment - * @return + * @return a double array */ public static Double[]createArray(double begin, double end, double step) { if (end < begin) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java b/h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java index 01c402a72c..09db093877 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/system/IntegerRange.java @@ -44,7 +44,7 @@ public String getJavaStaticMethod() { * Return an array of integers with a default step of 1. * @param begin from start * @param end to end - * @return + * @return array of integer */ public static Integer[] createArray(int begin, int end) { return createArray(begin, end, 1); @@ -55,7 +55,7 @@ public static Integer[] createArray(int begin, int end) { * @param begin from start * @param end to end * @param step increment - * @return + * @return array of integer */ public static Integer[] createArray(int begin, int end, int step) { if (end < begin) { diff --git a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/geometry/DummySpatialFunction.java b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/geometry/DummySpatialFunction.java index de459de391..02a70afae2 100644 --- a/h2gis-functions/src/test/java/org/h2gis/functions/spatial/geometry/DummySpatialFunction.java +++ b/h2gis-functions/src/test/java/org/h2gis/functions/spatial/geometry/DummySpatialFunction.java @@ -49,9 +49,9 @@ public static Geometry returnGeom(Geometry geom) { /** * If true all z are replaced by Double.NaN * If false only the first z - * @param geom - * @param setZtoNaN - * @return + * @param geom geometry + * @param setZtoNaN true to set the z value to nan + * @return new {@link Geometry} */ public static Geometry returnGeom(Geometry geom, boolean setZtoNaN) { UpdateZCoordinateSequenceFilter updateZCoordinateSequenceFilter = new UpdateZCoordinateSequenceFilter(Double.NaN, setZtoNaN); From 39a16d538f117c1aa24f9bedf74e59a0d4a33307 Mon Sep 17 00:00:00 2001 From: ebocher Date: Wed, 30 Oct 2024 16:56:22 +0100 Subject: [PATCH 21/26] Fix doc --- .../io/geojson/GJGeometryReader.java | 8 +--- .../io/geojson/GeoJsonReaderDriver.java | 41 +++++-------------- .../io/geojson/GeoJsonWriteDriver.java | 11 +++-- .../io/gpx/model/GPXTablesFactory.java | 5 +-- .../org/h2gis/functions/io/osm/OSMParser.java | 7 ++-- .../functions/io/shp/SHPDriverFunction.java | 5 +-- .../h2gis/functions/io/utility/IOMethods.java | 10 ----- .../h2gis/functions/io/utility/PRJUtil.java | 7 ++-- .../functions/spatial/clean/ST_MakeValid.java | 11 +++-- .../spatial/mesh/ST_ConstrainedDelaunay.java | 8 ++-- .../functions/spatial/mesh/ST_Delaunay.java | 4 +- .../functions/spatial/others/ST_Clip.java | 3 +- .../spatial/properties/ST_GeometryN.java | 1 - .../spatial/properties/ST_InteriorRingN.java | 1 - .../functions/spatial/snap/ST_Project.java | 1 - .../functions/spatial/snap/ST_SnapToSelf.java | 2 - .../topography/ST_TriangleContouring.java | 1 - .../functions/spatial/topology/ST_Graph.java | 6 --- .../org/h2gis/utilities/JDBCUtilities.java | 1 - .../h2gis/postgis_jts/ResultSetWrapper.java | 1 - 20 files changed, 38 insertions(+), 96 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java index 238360d3d9..9f56f26787 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java @@ -311,10 +311,8 @@ public MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLExce * "coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [ * [101.0, 0.0], [102.0, 1.0] ] } ]} * - * @param jp + * @param jp {@link JsonParser} * - * @throws IOException - * @throws SQLException * @return GeometryCollection */ public GeometryCollection parseGeometryCollection(JsonParser jp) throws IOException, SQLException { @@ -344,9 +342,7 @@ public GeometryCollection parseGeometryCollection(JsonParser jp) throws IOExcept * * [ [100.0, 0.0], [101.0, 1.0] ] * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} * @return Coordinate[] */ public Coordinate[] parseCoordinates(JsonParser jp) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index c30ea9c5e7..5b00764040 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -605,9 +605,7 @@ private void parsePolygonMetadata(JsonParser jp) throws IOException, SQLExceptio * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} */ private void parseMultiPolygonMetadata(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates @@ -638,10 +636,8 @@ private void parseMultiPolygonMetadata(JsonParser jp) throws IOException, SQLExc * "coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [ * [101.0, 0.0], [102.0, 1.0] ] } ] * - * @param jp + * @param jp {@link JsonParser} * - * @throws IOException - * @throws SQLException * @return GeometryCollection */ private void parseGeometryCollectionMetadata(JsonParser jp) throws IOException, SQLException { @@ -701,9 +697,7 @@ private void parseCoordinateMetadata(JsonParser jp) throws IOException { * * and check if it's wellformated * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} * @return Coordinate[] */ private void parseCoordinatesMetadata(JsonParser jp) throws IOException { @@ -850,9 +844,7 @@ private Object[] parseFeature(JsonParser jp) throws IOException, SQLException { /** * Sets the parsed geometry to the table * * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} */ private void setGeometry(JsonParser jp, Object[] values) throws IOException, SQLException { if (jp.nextToken() != JsonToken.VALUE_NULL) {//START_OBJECT { in case of null geometry @@ -960,9 +952,7 @@ private void parseProperties(JsonParser jp, Object[] values) throws IOException, /** * Parses the featureCollection * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} */ private void parseFeatures(JsonParser jp) throws IOException, SQLException { // Passes all the properties until "Feature" object is found @@ -1184,9 +1174,7 @@ private Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} * @return MultiPolygon */ private MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLException { @@ -1235,10 +1223,8 @@ private MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLExc * "coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [ * [101.0, 0.0], [102.0, 1.0] ] } ] * - * @param jp + * @param jp {@link JsonParser} * - * @throws IOException - * @throws SQLException * @return GeometryCollection */ private GeometryCollection parseGeometryCollection(JsonParser jp) throws IOException, SQLException { @@ -1268,9 +1254,7 @@ private GeometryCollection parseGeometryCollection(JsonParser jp) throws IOExcep * * [ [100.0, 0.0], [101.0, 1.0] ] * - * @param jp - * @throws IOException - * @throws SQLException + * @param jp {@link JsonParser} * @return Coordinate[] */ private CoordinateSequence parseCoordinates(JsonParser jp) throws IOException { @@ -1342,9 +1326,7 @@ private Coordinate parseCoordinate(JsonParser jp) throws IOException { /** * Parses the GeoJSON data and set the values to the table. - * - * @throws IOException - * @throws SQLException + * @param is {@link InputStream} */ private void parseData(InputStream is) throws IOException, SQLException { try { @@ -1628,9 +1610,8 @@ private String parseObject(JsonParser jp) throws IOException { /** * Return a SQL representation of the SQL type * - * @param sqlType - * @return - * @throws SQLException + * @param sqlType sql type code + * @return sql string data type */ private static String getSQLTypeName(int sqlType) throws SQLException { switch (sqlType) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java index a0dfbf5af7..cc0c79a711 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java @@ -503,8 +503,7 @@ private void writeFeature(JsonGenerator jsonGenerator, ResultSet rs, int geoFiel /** * Cache the column name and its index. * - * @param resultSetMetaData - * @throws SQLException + * @param resultSetMetaData {@link ResultSetMetaData} */ private void cacheMetadata(ResultSetMetaData resultSetMetaData) throws SQLException { cachedColumnIndex = new LinkedHashMap(); @@ -811,10 +810,10 @@ else if (rs.getObject(fieldId) instanceof Object[]) { /** * Return true is the SQL type is supported by the GeoJSON driver. * - * @param sqlTypeId - * @param sqlTypeName - * @return - * @throws SQLException + * @param columnName column name + * @param sqlTypeId sql type id + * @param sqlTypeName sql type name + * @return true if the column is supported */ public boolean isSupportedPropertyType(String columnName, int sqlTypeId, String sqlTypeName) throws SQLException { switch (sqlTypeId) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java index 91d6abcfe6..6ab27196ff 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java @@ -288,9 +288,8 @@ public static PreparedStatement createTrackPointsTable(Connection connection, St /** * Drop the existing GPX tables used to store the imported OSM GPX * - * @param connection - * @param tablePrefix - * @throws SQLException + * @param connection database + * @param tablePrefix table prefix */ public static void dropOSMTables(Connection connection, TableLocation tablePrefix) throws SQLException { final DBTypes dbType = DBUtils.getDBType(connection); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java index 99ee5ba07d..627872e778 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java @@ -247,11 +247,10 @@ private void checkOSMTables(Connection connection, DBTypes dbType, TableLocation /** * Create the OMS data model to store the content of the file * - * @param connection + * @param connection database * @param dbType Database type. - * @param requestedTable - * @param osmTableName - * @throws SQLException + * @param requestedTable table saved + * @param osmTableName osm table */ private String[] createOSMDatabaseModel(Connection connection, DBTypes dbType, TableLocation requestedTable, String osmTableName) throws SQLException { String nodeTableName = TableUtilities.caseIdentifier(requestedTable, osmTableName + OSMTablesFactory.NODE, dbType); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java index 24fb972a30..9a8c034e7b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java @@ -363,9 +363,8 @@ public String[] importFile(Connection connection, String tableReference, File fi /** * Return the shape type supported by the shapefile format * - * @param meta - * @return - * @throws SQLException + * @param meta {@link GeometryMetaData} + * @return ShapeType */ private static ShapeType getShapeTypeFromGeometryMetaData(GeometryMetaData meta) throws SQLException { ShapeType shapeType; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/IOMethods.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/IOMethods.java index 5fa90cdf9c..88333ca7f7 100755 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/IOMethods.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/IOMethods.java @@ -97,7 +97,6 @@ public IOMethods() { * @param targetTable The name of the table in the H2GIS database * @param delete True to delete the table if exists * @return the name of the linked table - * @throws java.sql.SQLException */ public static String linkedTable(Connection targetConnection, Properties properties, String sourceTable, String targetTable, boolean delete) throws SQLException { @@ -117,8 +116,6 @@ public static String linkedTable(Connection targetConnection, Properties propert * @param delete True to delete the table if exists * @param fetchSize The number of rows fetched from the linked table * @return the name of the linked table - * @throws java.sql.SQLException - * @return The absolute path of the exported files */ public static String linkedTable(Connection targetConnection, Properties properties, String sourceTable, String targetTable, boolean delete, int fetchSize) throws SQLException { @@ -137,8 +134,6 @@ public static String linkedTable(Connection targetConnection, Properties propert * @param targetTable The name of the table in the H2GIS database * @param delete True to delete the table if exists * @return the name of the linked table - * @throws java.sql.SQLException - * @return The absolute path of the exported files */ public static String linkedTable(Connection targetConnection, Map databaseProperties, String sourceTable, String targetTable, boolean delete) throws SQLException { @@ -157,7 +152,6 @@ public static String linkedTable(Connection targetConnection, Map databaseProperties, String sourceTable, String targetTable, boolean delete, int fetchSize) throws SQLException { @@ -249,7 +243,6 @@ public static String linkedTable(Connection targetConnection, Map getColumns(ValueArray valueArray){ * @param orientBySlope True if edges should be oriented by the z-value of * their first and last coordinates (decreasing) * @return true if both output tables were created - * @throws SQLException */ public static boolean createGraph(Connection connection, String inputTable, @@ -290,7 +286,6 @@ public static boolean createGraph(Connection connection, * their first and last coordinates (decreasing) * @param deleteTables True delete the existing tables * @return true if both output tables were created - * @throws SQLException */ public static boolean createGraph(Connection connection, String inputTable, @@ -330,7 +325,6 @@ public static boolean createGraph(Connection connection, * @param deleteTables True delete the existing tables * @param columns an array of columns to keep * @return true if both output tables were created - * @throws SQLException */ public static boolean createGraph(Connection connection, String inputTable, diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java index b3bbf2a2d0..4d9e19ce84 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java @@ -1365,7 +1365,6 @@ public static List getNumericColumns(Connection connection, String table * * @param resultSetMetaData the metadata of the table * @return the name of the column - * @throws SQLException */ public static String getFirstNumericColumn(ResultSetMetaData resultSetMetaData) throws SQLException { int columnCount = resultSetMetaData.getColumnCount(); diff --git a/postgis-jts/src/main/java/org/h2gis/postgis_jts/ResultSetWrapper.java b/postgis-jts/src/main/java/org/h2gis/postgis_jts/ResultSetWrapper.java index 340a03c953..0c3d298252 100644 --- a/postgis-jts/src/main/java/org/h2gis/postgis_jts/ResultSetWrapper.java +++ b/postgis-jts/src/main/java/org/h2gis/postgis_jts/ResultSetWrapper.java @@ -910,7 +910,6 @@ public static long ctidToLong(String ctid) { /** * @param value Long value of ctid * @return PGObject instance - * @throws SQLException */ public static PGobject longToTid(long value) throws SQLException { PGobject pGobject = new PGobject(); From 229567dc3041e140bdc3f34709fe9a0775838778 Mon Sep 17 00:00:00 2001 From: ebocher Date: Thu, 31 Oct 2024 08:55:22 +0100 Subject: [PATCH 22/26] Fix doc --- .../functions/io/fgb/fileTable/FGBDriver.java | 2 +- .../io/geojson/GJGeometryReader.java | 2 +- .../io/geojson/GeoJsonReaderDriver.java | 5 ++- .../functions/io/geojson/ST_AsGeoJSON.java | 6 ++-- .../functions/io/gpx/model/GpxParser.java | 2 +- .../functions/io/gpx/model/GpxPreparser.java | 2 +- .../functions/io/osm/ST_OSMDownloader.java | 4 +-- .../h2gis/functions/io/osm/WayOSMElement.java | 2 +- .../io/utility/CoordinatesUtils.java | 32 +++++++++---------- .../h2gis/functions/io/utility/PRJUtil.java | 4 +-- .../io/utility/ReadBufferManager.java | 4 +-- .../spatial/buffer/ST_RingSideBuffer.java | 11 +++---- .../functions/spatial/clean/MakeValidOp.java | 4 +-- .../convert/GeometryCoordinateDimension.java | 6 ++-- .../functions/spatial/convert/ST_Multi.java | 4 +-- .../functions/spatial/create/GridRowSet.java | 4 +-- .../spatial/create/ST_BoundingCircle.java | 4 +-- .../spatial/create/ST_GeneratePoints.java | 3 +- .../create/ST_GeneratePointsInGrid.java | 2 +- .../spatial/create/ST_RingBuffer.java | 11 +++---- .../functions/spatial/crs/ST_FindUTMSRID.java | 7 ++-- .../spatial/crs/ST_IsGeographicCRS.java | 6 ++-- .../spatial/crs/ST_IsProjectedCRS.java | 6 ++-- .../functions/spatial/crs/ST_SetSRID.java | 7 ++-- .../functions/spatial/crs/ST_Transform.java | 9 +++--- .../spatial/earth/ST_GeometryShadow.java | 2 +- .../spatial/earth/ST_SunPosition.java | 7 ++-- .../h2gis/functions/spatial/earth/ST_Svf.java | 9 +++--- .../jts_utils/GeometryFeatureUtils.java | 4 +-- 29 files changed, 81 insertions(+), 90 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java index d98fdbd54e..2f3062bb4d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/fgb/fileTable/FGBDriver.java @@ -167,7 +167,7 @@ public void cacheFeatureAddressFromIndex() throws IOException { /** * @param featureAddress Feature address in the file relative to the first feature - * @return + * @return values from the a flatgeobuffer feature */ public static Value[] getFieldsFromFileLocation(FileChannel fileChannel, long featureAddress, long featuresOffset, HeaderMeta headerMeta, int geometryFieldIndex) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java index 9f56f26787..1e81dd8b12 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java @@ -388,7 +388,7 @@ public Coordinate parseCoordinate(JsonParser jp) throws IOException { /** * - * @return + * @return GeoJSON geometry type */ public String getGeomType() { return geomType; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java index 5b00764040..eb5042c3b9 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java @@ -1277,7 +1277,6 @@ private CoordinateSequence parseCoordinates(JsonParser jp) throws IOException { * @param coordinates Number array * @param index Index to extract in array * @param defaultValue Value to return if out of bounds - * @return */ private static double getOrDefault(List coordinates, int index, double defaultValue) { return index < coordinates.size() ? coordinates.get(index) : defaultValue; @@ -1406,8 +1405,8 @@ else if(dataType.equalsIgnoreCase(GeoJsonField.GEOMETRYCOLLECTION)){ * "crs":{ "type":"name", "properties": {"name":"urn:ogc:def:crs:EPSG::4326" * } } * - * @param jp - * @return + * @param jp {@link JsonParser} + * @return SRID of the geojson file */ private int readCRS(JsonParser jp) throws IOException, SQLException { int srid = 0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java index 928d0b82f5..b1aa7e3bb0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java @@ -47,8 +47,8 @@ public String getJavaStaticMethod() { /** * Convert the geometry to a GeoJSON representation. * - * @param geom - * @return + * @param geom Geometry + * @return geojson representation */ public static String toGeojson(Geometry geom) { if(geom==null){ @@ -64,7 +64,7 @@ public static String toGeojson(Geometry geom) { * * @param geom input geometry * @param maxdecimaldigits argument may be used to reduce the maximum number of decimal places - * @return + * @return geojson representation */ public static String toGeojson(Geometry geom, int maxdecimaldigits) { if(geom==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java index 03a41cbf9d..e24c132886 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java @@ -156,7 +156,7 @@ public void clear() { /** * Gives copyright and license information governing use of the file. * - * @return + * @return copyright value */ @Override public String getCopyright() { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java index be3d9a3dc3..a67ac83f33 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxPreparser.java @@ -122,7 +122,7 @@ public void startElement(String uri, String localName, String qName, Attributes /** * Gives the version of the gpx file. * - * @return + * @return version value */ public String getVersion() { return version; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java index 2493b3bfc6..6b28a3ab54 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/ST_OSMDownloader.java @@ -135,8 +135,8 @@ public static void downloadOSMFile(File file, Envelope geometryEnvelope) throws /** * Build the OSM URL based on a given envelope * - * @param geometryEnvelope - * @return + * @param geometryEnvelope {@link Envelope} + * @return bbox Overpass url */ private static URL createOsmUrl(Envelope geometryEnvelope) { try { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/WayOSMElement.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/WayOSMElement.java index 93e2ea4367..c0b30bd0dc 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/WayOSMElement.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/WayOSMElement.java @@ -50,7 +50,7 @@ public void addRef(String ref) { /** * Return the list of nodes * - * @return + * @return list of nodes */ public List getNodesRef() { return nodesRef; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java index a2cbeb2b60..4fa8eef956 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java @@ -32,10 +32,10 @@ public final class CoordinatesUtils { /** * Interpolates a z value (linearly) between the two coordinates. * - * @param firstCoordinate - * @param lastCoordinate - * @param toBeInterpolated - * @return + * @param firstCoordinate first coordinate + * @param lastCoordinate last coordinate + * @param toBeInterpolated coordinate to interpolate + * @return z value */ public static double interpolate(Coordinate firstCoordinate, Coordinate lastCoordinate, Coordinate toBeInterpolated) { if (Double.isNaN(firstCoordinate.getZ())) { @@ -64,9 +64,9 @@ public static boolean contains(Coordinate[] coords, Coordinate coord) { * * The equality is done only in 2D (z values are not checked). * - * @param coords - * @param coord - * @return + * @param coords coordinate array + * @param coord coordinate to check + * @return true if the coordinate is found */ public static boolean contains2D(Coordinate[] coords, Coordinate coord) { for (Coordinate coordinate : coords) { @@ -82,9 +82,9 @@ public static boolean contains2D(Coordinate[] coords, Coordinate coord) { * * The equality is done in 3D (z values ARE checked). * - * @param coords - * @param coord - * @return + * @param coords coordinate array + * @param coord coordinate + * @return true if the coordinate is found */ public static boolean contains3D(Coordinate[] coords, Coordinate coord) { for (Coordinate coordinate : coords) { @@ -214,8 +214,8 @@ public static double length3D(CoordinateSequence pts) { * Returns the 3D length of the geometry * * - * @param geom - * @return + * @param geom {@link Geometry} + * @return length in 3D */ public static double length3D(Geometry geom) { double sum = 0; @@ -234,8 +234,8 @@ public static double length3D(Geometry geom) { /** * Returns the 3D perimeter of a line string. * - * @param lineString - * @return + * @param lineString {@link LineString} + * @return length in 3D */ public static double length3D(LineString lineString) { return length3D(lineString.getCoordinateSequence()); @@ -244,8 +244,8 @@ public static double length3D(LineString lineString) { /** * Returns the 3D perimeter of a polygon * - * @param polygon - * @return + * @param polygon {@link Polygon} + * @return length in 3D */ public static double length3D(Polygon polygon) { double len = 0.0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java index 8ff78a6778..0eaae5c068 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java @@ -52,8 +52,8 @@ public class PRJUtil { * - is empty * then a default srid equals to 0 is added. * - * @param prjFile - * @return + * @param prjFile prj file + * @return srid code */ public static int getSRID(File prjFile) throws IOException { int srid = 0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java index 649ab4196f..595cf135be 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/ReadBufferManager.java @@ -229,9 +229,9 @@ public void position(long position) { } /** - * Gets the positionf of this buffer in the file it's reading. + * Gets the position of this buffer in the file it's reading. * - * @return + * @return index of the position */ public long getPosition() { return positionInFile; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java index 06f22020d8..8a71f492c6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_RingSideBuffer.java @@ -67,12 +67,11 @@ public static Geometry ringSideBuffer(Geometry geom, double bufferSize, int numB /** * - * @param geom - * @param bufferDistance - * @param numBuffer - * @param parameters - * @return - * @throws java.sql.SQLException + * @param geom {@link Geometry} + * @param bufferDistance buffer distance + * @param numBuffer numberof rings + * @param parameters buffer parameters + * @return ring side geometries */ public static Geometry ringSideBuffer(Geometry geom, double bufferDistance, int numBuffer, String parameters) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java index ec153c62a5..73beb7e106 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java @@ -556,8 +556,8 @@ private Geometry getArealGeometryFromLinearRing(LinearRing ring) { /** * Return a set of segments from a linestring * - * @param lines - * @return + * @param lines collection of lines + * @return a set of segments */ private Set getSegments(Collection lines) { Set set = new HashSet<>(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java index 0756e2b1d5..7e56e6e767 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java @@ -70,9 +70,9 @@ public static Geometry force(Geometry geom, int dimension) { * Force the dimension of the MultiPoint and update correctly the coordinate * dimension * - * @param mp - * @param dimension - * @return + * @param mp {@link MultiPoint} + * @param dimension coordinate dimension + * @return geometry with reduced dimension */ public static MultiPoint convert(MultiPoint mp, int dimension) { int nb = mp.getNumGeometries(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Multi.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Multi.java index ef95d4d9de..5155b6b26d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Multi.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Multi.java @@ -45,8 +45,8 @@ public String getJavaStaticMethod() { /** * Construct a geometry collection from a geometry - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return a {@link org.locationtech.jts.geom.GeometryCollection} */ public static Geometry toCollection(Geometry geometry){ if(geometry==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java index 2d688da716..0d4f40bdf3 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java @@ -185,7 +185,7 @@ private Point getCellPoint() { /** * Return true is cell is represented as point, false as a polygon * - * @return + * @return trie if the grid is computed at center cell */ public boolean isCenterCell() { return isCenterCell; @@ -211,7 +211,7 @@ public void setIsRowColumnNumber(boolean isRowColumnNumber){ /** * Return if the delta x and y must be expressed as number of columns and rows - * @return + * @return true is the number of row and columns are fixed */ public boolean isRowColumnNumber(){ return this.isRowColumnNumber; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java index b9886671f7..b9f02df064 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_BoundingCircle.java @@ -44,8 +44,8 @@ public String getJavaStaticMethod() { /** * Computes the bounding circle * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return geometry bounding circle */ public static Geometry computeBoundingCircle(Geometry geometry) { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePoints.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePoints.java index dff1a50fea..a0164d5821 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePoints.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePoints.java @@ -54,8 +54,7 @@ public String getJavaStaticMethod() { * * @param geom input geometry as polygon or multipolygon * @param nPts number of random points - * @return - * @throws java.sql.SQLException + * @return random points */ public static Geometry generatePoints(Geometry geom, int nPts) throws SQLException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java index bd700ebda7..73c3d08048 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java @@ -95,7 +95,7 @@ public static Geometry generatePointsInGrid(Geometry geom, int cellSizeX, int ce * @param cellSizeY size of the y cell * @param useMask set to true to keep the points loacted inside the input * geometry - * @return + * @return a list of coordinates */ static List createGridPoints(Geometry geom, int cellSizeX, int cellSizeY, boolean useMask) { Envelope env = geom.getEnvelopeInternal(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java index 1909092ecc..f45184d2ea 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java @@ -66,12 +66,11 @@ public static Geometry ringBuffer(Geometry geom, double bufferSize, int numBuffe /** * - * @param geom - * @param bufferDistance - * @param numBuffer - * @param parameters - * @return - * @throws java.sql.SQLException + * @param geom {@link Geometry} + * @param bufferDistance buffer distance + * @param numBuffer number of rings + * @param parameters buffer parameters + * @return ring buffer geometry */ public static Geometry ringBuffer(Geometry geom, double bufferDistance, int numBuffer, String parameters) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_FindUTMSRID.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_FindUTMSRID.java index ef10daa53a..38194289ab 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_FindUTMSRID.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_FindUTMSRID.java @@ -45,10 +45,9 @@ public String getJavaStaticMethod() { /** * Find UTM SRID from a geometry - * @param connection - * @param geometry - * @return - * @throws java.sql.SQLException + * @param connection database + * @param geometry {@link Geometry} + * @return srid */ public static int findSRID(Connection connection, Geometry geometry) throws SQLException { if(geometry==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsGeographicCRS.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsGeographicCRS.java index daedddaeb7..2e0541f248 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsGeographicCRS.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsGeographicCRS.java @@ -54,9 +54,9 @@ public String getJavaStaticMethod() { /** * Return true if the geometry has a geographic CRS * - * @param geometry - * @return - * @throws SQLException + * @param connection database + * @param geometry {@link Geometry} + * @return true if the geometry has a geographic CRS */ public static Boolean execute(Connection connection, Geometry geometry) throws SQLException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsProjectedCRS.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsProjectedCRS.java index ef831c31b7..bd57eefdbf 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsProjectedCRS.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_IsProjectedCRS.java @@ -56,9 +56,9 @@ public String getJavaStaticMethod() { /** * Return true if the CRS is a projected one * - * @param geometry - * @return - * @throws java.sql.SQLException + * @param connection database + * @param geometry {@link Geometry} + * @return true if the CRS is a projected one */ public static Boolean execute(Connection connection, Geometry geometry) throws SQLException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java index 33f27e440d..10c4e4939b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java @@ -43,10 +43,9 @@ public String getJavaStaticMethod() { /** * Set a new SRID to the geometry - * @param geometry - * @param srid - * @return - * @throws IllegalArgumentException + * @param geometry {@link Geometry} + * @param srid srid code + * @return Geometry with an srid */ public static Geometry setSRID(Geometry geometry, Integer srid) throws IllegalArgumentException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java index b7981bcfea..40d3a60dc7 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java @@ -73,11 +73,10 @@ public String getJavaStaticMethod() { /** * Returns a new geometry transformed to the SRID referenced by the integer * parameter available in the spatial_ref_sys table - * @param connection - * @param geom - * @param codeEpsg - * @return - * @throws SQLException + * @param connection database + * @param geom Geometry + * @param codeEpsg srid code + * @return reprojected geometry */ public static Geometry ST_Transform(Connection connection, Geometry geom, Integer codeEpsg) throws SQLException, CoordinateOperationException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java index 1095d2bdb9..d3b9923039 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java @@ -100,7 +100,7 @@ public static Geometry computeShadow(Geometry geometry, double azimuth, double a * @param altitude of the sun in radians * @param height of the geometry * @param doUnion unified or not the polygon shadows - * @return + * @return geometry shadows */ public static Geometry computeShadow(Geometry geometry, double azimuth, double altitude, double height, boolean doUnion) { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java index 8d78b882a5..ef91fc4c63 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_SunPosition.java @@ -60,10 +60,9 @@ public static Geometry sunPosition(Geometry point){ /** * Return the sun position for a given date * - * @param point - * @param date - * @return - * @throws IllegalArgumentException + * @param point location of the point + * @param date date + * @return sum position as a point */ public static Geometry sunPosition(Geometry point, Timestamp date) throws IllegalArgumentException{ if(point == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java index ca683eba89..ad7fe6a84e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_Svf.java @@ -58,12 +58,11 @@ public String getJavaStaticMethod() { /** * The method to compute the Sky View Factor * - * @param pt - * @param distance + * @param pt {@link Point} + * @param distance distance * @param rayCount number of rays - * @param geoms - * @return - * @throws java.sql.SQLException + * @param geoms mask geometries + * @return svf value */ public static Double computeSvf(Point pt, Geometry geoms, double distance, int rayCount) throws SQLException { return computeSvf(pt, geoms, distance, rayCount, RAY_STEP_LENGTH); diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java index 8a5265d185..e134417eb7 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/GeometryFeatureUtils.java @@ -110,7 +110,7 @@ public static ArrayList toList(ResultSet resultSet, int maxdecima * Convert the resulSet values to JSON list * @param resultSet values * @param columns column names - * @return + * @return a map with columns and values */ public static LinkedHashMap getProperties(ResultSet resultSet, Collection columns) throws Exception { LinkedHashMap properties = new LinkedHashMap(); @@ -123,7 +123,7 @@ public static LinkedHashMap getProperties(ResultSet resultSet, Collection Date: Mon, 4 Nov 2024 08:13:35 +0100 Subject: [PATCH 23/26] Fix doc --- .../functions/factory/H2GISFunctions.java | 6 +-- .../functions/spatial/convert/ST_Force2D.java | 4 +- .../functions/spatial/convert/ST_Force3D.java | 42 ++++++++-------- .../spatial/convert/ST_Force3DM.java | 49 ++++++++++--------- .../functions/spatial/convert/ST_Force4D.java | 4 +- .../spatial/edit/ST_ForcePolygonCCW.java | 9 ++-- .../spatial/predicates/ST_Crosses.java | 4 +- .../spatial/predicates/ST_DWithin.java | 2 +- .../spatial/predicates/ST_Disjoint.java | 4 +- .../spatial/predicates/ST_Equals.java | 4 +- .../spatial/predicates/ST_Touches.java | 2 +- .../spatial/predicates/ST_Within.java | 4 +- 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java index 6f0a0e6d2e..30f1840a1e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java @@ -433,9 +433,9 @@ private static String getStringProperty(Function function, String propertyKey) { /** * Return a boolean property of the function * - * @param function - * @param propertyKey - * @param defaultValue + * @param function H2GIS function + * @param propertyKey alias + * @param defaultValue default value */ private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) { Object value = function.getProperty(propertyKey); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java index 960afab15b..f3d576de99 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force2D.java @@ -44,8 +44,8 @@ public String getJavaStaticMethod() { /** * Converts a XYZ geometry to XY. * - * @param geom - * @return + * @param geom {@link Geometry} + * @return Geometry in 2D */ public static Geometry force2D(Geometry geom) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java index fcd5ba8d52..3d18c2ab6b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java @@ -48,8 +48,8 @@ public String getJavaStaticMethod() { * Converts a XY geometry to XYZ. If a geometry has no Z component, then a 0 * Z coordinate is tacked on. * - * @param geom - * @return + * @param geom {@link Geometry} + * @return 3D {@link Geometry} */ public static Geometry force3D(Geometry geom) { if (geom == null) { @@ -61,9 +61,9 @@ public static Geometry force3D(Geometry geom) { * Converts a XY geometry to XYZ. If a geometry has no Z component, then a 0 * Z coordinate is tacked on. * - * @param geom - * @param zValue - * @return + * @param geom {@link Geometry} + * @param zValue z value + * @return Z {@link Geometry} */ public static Geometry force3D(Geometry geom, double zValue) { if (geom == null) { @@ -77,7 +77,7 @@ public static Geometry force3D(Geometry geom, double zValue) { * dimension * @param geom the input geometry * @param zValue to update - * @return + * @return Z {@link Geometry} */ public static Geometry force(Geometry geom, double zValue) { Geometry g = geom; @@ -110,9 +110,9 @@ public static Geometry force(Geometry geom, double zValue) { * Force the dimension of the MultiPoint and update correctly the coordinate * dimension * - * @param mp - * @param zValue - * @return + * @param mp {@link MultiPoint} + * @param zValue Z value + * @return Z {@link Geometry} */ public static MultiPoint convert(MultiPoint mp, double zValue) { int nb = mp.getNumGeometries(); @@ -126,9 +126,9 @@ public static MultiPoint convert(MultiPoint mp, double zValue) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param zValue - * @return + * @param gc {@link GeometryCollection} + * @param zValue Z value + * @return Z {@link GeometryCollection} */ public static GeometryCollection convert(GeometryCollection gc, double zValue) { int nb = gc.getNumGeometries(); @@ -142,9 +142,9 @@ public static GeometryCollection convert(GeometryCollection gc, double zValue) { /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param zValue - * @return + * @param multiPolygon {@link MultiPolygon} + * @param zValue z value + * @return Z {@link MultiPolygon} */ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue) { int nb = multiPolygon.getNumGeometries(); @@ -158,9 +158,9 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue) { /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param zValue - * @return + * @param multiLineString {@link MultiLineString} + * @param zValue Z value + * @return Z {@link MultiLineString} */ public static MultiLineString convert(MultiLineString multiLineString, double zValue) { int nb = multiLineString.getNumGeometries(); @@ -174,9 +174,9 @@ public static MultiLineString convert(MultiLineString multiLineString, double zV /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param zValue - * @return + * @param polygon {@link Polygon} + * @param zValue Z value + * @return Z {@link Polygon} */ public static Polygon convert(Polygon polygon, double zValue) { LinearRing shell = gf.createLinearRing(convertSequence(polygon.getExteriorRing().getCoordinateSequence(),zValue)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java index 9af873cd43..e4fb688008 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java @@ -49,8 +49,8 @@ public String getJavaStaticMethod() { /** * Converts a XY, XYZ geometry to XYM. * - * @param geom - * @return + * @param geom {@link Geometry} + * @return Geometry */ public static Geometry force3DM(Geometry geom) { if (geom == null) { @@ -62,9 +62,9 @@ public static Geometry force3DM(Geometry geom) { /** * Converts a XY, XYZ geometry to XYM. * - * @param geom - * @param mValue - * @return + * @param geom {@link Geometry} + * @param mValue m value + * @return M Geometry */ public static Geometry force3DM(Geometry geom, double mValue) { if (geom == null) { @@ -78,7 +78,8 @@ public static Geometry force3DM(Geometry geom, double mValue) { * Force the dimension of the geometry and update correctly the coordinate * dimension * @param geom the input geometry - * @return + * @param mValue m value + * @return M Geometry */ public static Geometry forceXYM(Geometry geom, double mValue) { int dimension =2; @@ -117,9 +118,9 @@ public static Geometry forceXYM(Geometry geom, double mValue) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param mValue - * @return + * @param gc {@link GeometryCollection} + * @param mValue m value + * @return GeometryCollection */ public static GeometryCollection convert(GeometryCollection gc, double mValue) { int nb = gc.getNumGeometries(); @@ -133,9 +134,9 @@ public static GeometryCollection convert(GeometryCollection gc, double mValue) { /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param mValue - * @return + * @param multiPolygon {@link MultiPolygon} + * @param mValue m value + * @return M {@link MultiPolygon} */ public static MultiPolygon convert(MultiPolygon multiPolygon,double mValue) { int nb = multiPolygon.getNumGeometries(); @@ -149,9 +150,9 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,double mValue) { /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param mValue - * @return + * @param multiLineString {@link MultiLineString} + * @param mValue m value + * @return M {@link MultiLineString} */ public static MultiLineString convert(MultiLineString multiLineString, double mValue) { int nb = multiLineString.getNumGeometries(); @@ -165,9 +166,9 @@ public static MultiLineString convert(MultiLineString multiLineString, double mV /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param mValue - * @return + * @param polygon {@link Polygon} + * @param mValue M value + * @return M {@link Polygon} */ public static Polygon convert(Polygon polygon, double mValue) { CoordinateSequence cs = polygon.getExteriorRing().getCoordinateSequence(); @@ -188,9 +189,9 @@ public static Polygon convert(Polygon polygon, double mValue) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param mValue - * @return + * @param lineString {@link LineString} + * @param mValue M value + * @return M {@link LineString} */ public static LineString convert(LineString lineString,double mValue) { return gf.createLineString(convertSequence(lineString.getCoordinateSequence(),mValue)); @@ -199,9 +200,9 @@ public static LineString convert(LineString lineString,double mValue) { /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param mValue - * @return + * @param linearRing {@link LinearRing} + * @param mValue M value + * @return M {@link LinearRing} */ public static LinearRing convert(LinearRing linearRing,double mValue) { return gf.createLinearRing(convertSequence(linearRing.getCoordinateSequence(),mValue)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java index 58a9dec86b..5d1d130043 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java @@ -50,8 +50,8 @@ public String getJavaStaticMethod() { * Converts a geometry to XYZM. * If a geometry has no Z or M measure, then a 0 is tacked on. * - * @param geom - * @return + * @param geom {@link Geometry} + * @return Geometry */ public static Geometry force4D(Geometry geom) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCCW.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCCW.java index 8552ba8a8f..06f95e97bc 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCCW.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCCW.java @@ -49,8 +49,8 @@ public String getJavaStaticMethod() { * Forces (Multi)Polygons to use a counter-clockwise orientation for their exterior ring, * and a clockwise orientation for their interior rings. * Non-polygonal geometries are returned unchanged - * @param geom - * @return + * @param geom Geometry + * @return Geometry */ public static Geometry execute(Geometry geom) throws SQLException { if (geom != null) { @@ -65,9 +65,8 @@ public static Geometry execute(Geometry geom) throws SQLException { * Forces (Multi)Polygons to use a counter-clockwise orientation for their exterior ring, * and a clockwise orientation for their interior rings. * Non-polygonal geometries are returned unchanged - * @param geometry - * @param geometries - * @return + * @param geometry {@link Geometry} + * @param geometries list of {@link Geometry} */ private static void forcePolygonCCW(final Geometry geometry, final List geometries) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java index 0f136a7297..ba4091cf77 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Crosses.java @@ -43,8 +43,8 @@ public String getJavaStaticMethod() { } /** - * @param a Geometry Geometry. - * @param b Geometry instance + * @param a Geometry A + * @param b Geometry B * @return true if Geometry A crosses Geometry B */ public static Boolean geomCrosses(Geometry a,Geometry b) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java index 2d2e7a48c9..5f96555c2f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java @@ -48,7 +48,7 @@ public String getJavaStaticMethod() { * @param geomA Geometry A * @param geomB Geometry B * @param distance Distance - * @return True if if the geometries are within the specified distance of one another + * @return True if the geometries are within the specified distance of one another */ public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) throws SQLException { if(geomA == null||geomB == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java index 8dcd1d74aa..4a57e4286a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Disjoint.java @@ -46,8 +46,8 @@ public String getJavaStaticMethod() { /** * Return true if the two Geometries are disjoint * - * @param a Geometry Geometry. - * @param b Geometry instance + * @param a Geometry A. + * @param b Geometry B * @return true if the two Geometries are disjoint */ public static Boolean geomDisjoint(Geometry a, Geometry b) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java index 3492ab5d0d..794d305bf2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java @@ -45,8 +45,8 @@ public String getJavaStaticMethod() { /** * Return true if Geometry A is equal to Geometry B * - * @param a Geometry Geometry. - * @param b Geometry instance + * @param a Geometry A + * @param b Geometry B * @return true if Geometry A is equal to Geometry B */ public static Boolean geomEquals(Geometry a, Geometry b) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java index 9f211f576f..51255417ca 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Touches.java @@ -44,7 +44,7 @@ public String getJavaStaticMethod() { /** * Return true if the geometry A touches the geometry B - * @param a Geometry A. + * @param a Geometry A * @param b Geometry B * @return true if the geometry A touches the geometry B */ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java index ddbc895977..9255825c6a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Within.java @@ -43,8 +43,8 @@ public String getJavaStaticMethod() { } /** - * @param a Surface Geometry. - * @param b Geometry instance + * @param a {@link Geometry} A + * @param b {@link Geometry} B * @return true if the geometry A is within the geometry B */ public static Boolean isWithin(Geometry a,Geometry b) throws SQLException { From de794728a0ee8e12b230d7b96fbe2856ad33c721 Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 4 Nov 2024 12:57:15 +0100 Subject: [PATCH 24/26] Fix doc --- .../functions/io/overpass/OverpassTool.java | 5 +- .../functions/spatial/convert/ST_Force3D.java | 12 ++-- .../spatial/convert/ST_Force3DM.java | 5 +- .../functions/spatial/convert/ST_Force4D.java | 64 ++++++++++--------- .../spatial/convert/ST_GeomFromWKB.java | 6 +- .../spatial/convert/ST_OSMMapLink.java | 4 +- .../spatial/create/ST_MakePolygon.java | 15 ++--- .../spatial/create/ST_RingBuffer.java | 35 +++++----- .../spatial/distance/MaxDistanceOp.java | 8 +-- .../spatial/distance/ST_MaxDistance.java | 7 +- .../spatial/earth/ST_GeometryShadow.java | 14 ++-- .../functions/spatial/edit/EditUtilities.java | 9 ++- .../functions/spatial/edit/ST_AddPoint.java | 43 ++++++------- .../h2gis/functions/spatial/edit/ST_AddZ.java | 7 +- .../spatial/edit/ST_ForcePolygonCW.java | 4 +- .../spatial/edit/ST_InsertPoint.java | 55 ++++++++-------- .../h2gis/functions/system/JTSVersion.java | 2 +- 17 files changed, 139 insertions(+), 156 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java index 4808ab5d8f..4d725a6275 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/overpass/OverpassTool.java @@ -49,9 +49,8 @@ public OverpassTool() { /** * Prepare the connection to the overpass endpoint * - * @param overpassQuery - * @return - * @throws Exception + * @param overpassQuery overpass query + * @return HttpURLConnection */ public HttpURLConnection prepareConnection(String overpassQuery) throws Exception { Matcher timeoutMatcher = Pattern.compile("\\[timeout:(\\d+)\\]").matcher(overpassQuery); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java index 3d18c2ab6b..81e7ff9589 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3D.java @@ -193,9 +193,9 @@ public static Polygon convert(Polygon polygon, double zValue) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param zValue - * @return + * @param lineString {@link LineString} + * @param zValue z value + * @return LineString */ public static LineString convert(LineString lineString,double zValue) { return gf.createLineString(convertSequence(lineString.getCoordinateSequence(),zValue)); @@ -204,9 +204,9 @@ public static LineString convert(LineString lineString,double zValue) { /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param zValue - * @return + * @param linearRing linearRing + * @param zValue z value + * @return LinearRing */ public static LinearRing convert(LinearRing linearRing,double zValue) { return gf.createLinearRing(convertSequence(linearRing.getCoordinateSequence(),zValue)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java index e4fb688008..bc62583162 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force3DM.java @@ -216,10 +216,7 @@ public static LinearRing convert(LinearRing linearRing,double mValue) { * @return a new CoordinateArraySequence */ private static CoordinateArraySequence convertSequence(CoordinateSequence cs, double mValue) { - boolean hasM=false; - if(cs.getMeasures()==1){ - hasM =true; - } + boolean hasM= cs.getMeasures() == 1; CoordinateXYM[] coordsXYM = new CoordinateXYM[cs.size()]; for (int i = 0; i < cs.size(); i++) { Coordinate coordTmp = cs.getCoordinate(i); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java index 5d1d130043..57ab894c4f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Force4D.java @@ -64,8 +64,10 @@ public static Geometry force4D(Geometry geom) { * Converts a geometry to XYZM. * If a geometry has no Z or M measure, then a 0 is tacked on. * - * @param geom - * @return + * @param geom {@link Geometry} + * @param zValue z value + * @param mValue m value + * @return Geometry */ public static Geometry force4D(Geometry geom, double zValue, double mValue) { if (geom == null) { @@ -81,7 +83,7 @@ public static Geometry force4D(Geometry geom, double zValue, double mValue) { * @param geom the input geometry * @param zValue to update * @param mValue to update - * @return + * @return Geometry */ public static Geometry force(Geometry geom, double zValue, double mValue) { Geometry g = geom; @@ -114,10 +116,10 @@ public static Geometry force(Geometry geom, double zValue, double mValue) { * Force the dimension of the MultiPoint and update correctly the coordinate * dimension * - * @param mp - * @param zValue - * @param mValue - * @return + * @param mp {@link MultiPoint} + * @param zValue z value + * @param mValue m value + * @return MultiPoint */ public static MultiPoint convert(MultiPoint mp, double zValue,double mValue) { int nb = mp.getNumGeometries(); @@ -131,10 +133,10 @@ public static MultiPoint convert(MultiPoint mp, double zValue,double mValue) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param zValue - * @param mValue - * @return + * @param gc {@link GeometryCollection} + * @param zValue z value + * @param mValue m value + * @return GeometryCollection */ public static GeometryCollection convert(GeometryCollection gc, double zValue,double mValue) { int nb = gc.getNumGeometries(); @@ -148,10 +150,10 @@ public static GeometryCollection convert(GeometryCollection gc, double zValue,do /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param zValue - * @param mValue - * @return + * @param multiPolygon {@link MultiPolygon} + * @param zValue z value + * @param mValue m value + * @return MultiPolygon */ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue,double mValue) { int nb = multiPolygon.getNumGeometries(); @@ -165,10 +167,10 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue,doubl /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param zValue - * @param mValue - * @return + * @param multiLineString {@link MultiLineString} + * @param zValue z value + * @param mValue m value + * @return MultiLineString */ public static MultiLineString convert(MultiLineString multiLineString, double zValue,double mValue) { int nb = multiLineString.getNumGeometries(); @@ -182,10 +184,10 @@ public static MultiLineString convert(MultiLineString multiLineString, double zV /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param zValue - * @param mValue - * @return + * @param polygon {@link Polygon} + * @param zValue z value + * @param mValue m value + * @return Polygon */ public static Polygon convert(Polygon polygon, double zValue,double mValue) { LinearRing shell = gf.createLinearRing(convertSequence(polygon.getExteriorRing().getCoordinateSequence(),zValue,mValue)); @@ -202,10 +204,10 @@ public static Polygon convert(Polygon polygon, double zValue,double mValue) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param zValue - * @param mValue - * @return + * @param lineString {@link LineString} + * @param zValue z value + * @param mValue m value + * @return LineString */ public static LineString convert(LineString lineString,double zValue,double mValue) { return gf.createLineString(convertSequence(lineString.getCoordinateSequence(),zValue,mValue)); @@ -214,10 +216,10 @@ public static LineString convert(LineString lineString,double zValue,double mVal /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param zValue - * @param mValue - * @return + * @param linearRing {@link LinearRing} + * @param zValue z value + * @param mValue m value + * @return LinearRing */ public static LinearRing convert(LinearRing linearRing,double zValue,double mValue) { return gf.createLinearRing(convertSequence(linearRing.getCoordinateSequence(),zValue,mValue)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromWKB.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromWKB.java index 229b3dde82..876ab9baed 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromWKB.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromWKB.java @@ -48,8 +48,7 @@ public String getJavaStaticMethod() { * Convert a WKB representation to a geometry * @param bytes the input WKB object * @param srid the input SRID - * @return - * @throws SQLException + * @return Geometry */ public static Geometry toGeometry(byte[] bytes, int srid) throws SQLException{ if(bytes==null) { @@ -68,8 +67,7 @@ public static Geometry toGeometry(byte[] bytes, int srid) throws SQLException{ /** * Convert a WKB representation to a geometry without specify a SRID. * @param bytes - * @return - * @throws SQLException + * @return Geometry */ public static Geometry toGeometry(byte[] bytes) throws SQLException{ return toGeometry(bytes, 0); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java index 97dc636a9b..832534943f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_OSMMapLink.java @@ -47,7 +47,7 @@ public String getJavaStaticMethod() { * Create the OSM map link based on the bounding box of the geometry. * * @param geom the input geometry. - * @return + * @return OSM link */ public static String generateLink(Geometry geom) { return generateLink(geom, false); @@ -58,7 +58,7 @@ public static String generateLink(Geometry geom) { * * @param geom the input geometry. * @param withMarker true to place a marker on the center of the BBox. - * @return + * @return osm link */ public static String generateLink(Geometry geom, boolean withMarker) { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java index 8c6cb1e6ae..99c3ab540a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java @@ -46,8 +46,8 @@ public String getJavaStaticMethod() { /** * Creates a Polygon formed by the given shell. * - * @param shell - * @return + * @param shell Geometry + * @return Polygon */ public static Polygon makePolygon(Geometry shell) throws IllegalArgumentException { if(shell == null) { @@ -60,9 +60,9 @@ public static Polygon makePolygon(Geometry shell) throws IllegalArgumentExceptio /** * Creates a Polygon formed by the given shell and holes. * - * @param shell - * @param holes - * @return + * @param shell {@link Geometry} + * @param holes {@link Geometry} + * @return Polygon */ public static Polygon makePolygon(Geometry shell, Geometry holes) throws IllegalArgumentException { if (shell == null) { @@ -84,9 +84,8 @@ public static Polygon makePolygon(Geometry shell, Geometry holes) throws Illegal /** * Check if a geometry is a linestring and if its closed. * - * @param geometry - * @return - * @throws IllegalArgumentException + * @param geometry {@link Geometry} + * @return LinearRing */ private static LinearRing checkLineString(Geometry geometry) throws IllegalArgumentException { if (geometry instanceof LinearRing) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java index f45184d2ea..941877ecca 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_RingBuffer.java @@ -143,13 +143,12 @@ public static Geometry ringBuffer(Geometry geom, double bufferDistance, /** * Compute a ring buffer with a positive offset * - * @param geom - * @param bufferDistance - * @param numBuffer - * @param bufferParameters - * @param doDifference - * @return - * @throws SQLException + * @param geom {@link Geometry} + * @param bufferDistance buffer distance + * @param numBuffer number of rings + * @param bufferParameters buffer parameters + * @param doDifference true to build the difference + * @return Geometry */ public static Geometry computePositiveRingBuffer(Geometry geom, double bufferDistance, int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException { @@ -176,13 +175,12 @@ public static Geometry computePositiveRingBuffer(Geometry geom, double bufferDis /** * Compute a ring buffer with a negative offset * - * @param geom - * @param bufferDistance - * @param numBuffer - * @param bufferParameters - * @param doDifference - * @return - * @throws SQLException + * @param geom {@link Geometry} + * @param bufferDistance buffer distance + * @param numBuffer number of rings + * @param bufferParameters buffer parameters + * @param doDifference true to build the difference + * @return Geometry */ public static Geometry computeNegativeRingBuffer(Geometry geom, double bufferDistance, int numBuffer, BufferParameters bufferParameters, boolean doDifference) throws SQLException { @@ -213,11 +211,10 @@ public static Geometry computeNegativeRingBuffer(Geometry geom, double bufferDis /** * Calculate the ring buffer * - * @param geom - * @param bufferSize - * @param bufferParameters - * @return - * @throws SQLException + * @param geom {@link Geometry} + * @param bufferSize buffer size + * @param bufferParameters buffer parameters + * @return Geometry */ public static Geometry runBuffer(final Geometry geom, final double bufferSize, final BufferParameters bufferParameters) throws SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java index e18294d18c..a72c2ac43b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/MaxDistanceOp.java @@ -59,7 +59,7 @@ private void computeMaxDistance() { /** * Return the max distance * - * @return + * @return distance */ public Double getDistance() { if (geomA == null || geomB == null) { @@ -81,7 +81,7 @@ public Double getDistance() { /** * Return the two coordinates to build the max distance line * - * @return + * @return Coordinate array */ public Coordinate[] getCoordinatesDistance() { if (geomA == null || geomB == null) { @@ -148,7 +148,7 @@ private void updateDistance(Coordinate coord) { /** * Return the maximum distance * - * @return + * @return distance */ public double getDistance() { return distance; @@ -158,7 +158,7 @@ public double getDistance() { * Return the maximum distance as two coordinates. * Usefull to draw it as a line * - * @return + * @return Coordinate array */ public Coordinate[] getCoordinatesDistance() { if (startCoord == null || endCoord == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_MaxDistance.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_MaxDistance.java index fe4523d60f..08e5d5f382 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_MaxDistance.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_MaxDistance.java @@ -46,10 +46,9 @@ public String getJavaStaticMethod() { /** * Return the maximum distance * - * @param geomA - * @param geomB - * @return - * @throws java.sql.SQLException + * @param geomA {@link Geometry} A + * @param geomB {@link Geometry} B + * @return max distance */ public static Double maxDistance(Geometry geomA, Geometry geomB) throws SQLException { if(geomA ==null || geomB==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java index d3b9923039..6cbb959deb 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java @@ -128,7 +128,7 @@ public static Geometry computeShadow(Geometry geometry, double azimuth, double a * @param lineString the input linestring * @param shadowOffset computed according the sun position and the height of * the geometry - * @return + * @return Geometry */ private static Geometry shadowLine(LineString lineString, double[] shadowOffset, GeometryFactory factory, boolean doUnion) { Coordinate[] coords = lineString.getCoordinates(); @@ -152,7 +152,7 @@ private static Geometry shadowLine(LineString lineString, double[] shadowOffset, * @param polygon the input polygon * @param shadowOffset computed according the sun position and the height of * the geometry - * @return + * @return Geometry */ private static Geometry shadowPolygon(Polygon polygon, double[] shadowOffset, GeometryFactory factory, boolean doUnion) { Coordinate[] shellCoords = polygon.getExteriorRing().getCoordinates(); @@ -186,7 +186,7 @@ private static Geometry shadowPolygon(Polygon polygon, double[] shadowOffset, Ge * @param point the input point * @param shadowOffset computed according the sun position and the height of * the geometry - * @return + * @return Geometry */ private static Geometry shadowPoint(Point point, double[] shadowOffset, GeometryFactory factory) { Coordinate startCoord = point.getCoordinate(); @@ -205,7 +205,7 @@ private static Geometry shadowPoint(Point point, double[] shadowOffset, Geometry * @param azimuth in radians from north. * @param altitude in radians from east. * @param height of the geometry - * @return + * @return the shadow offset in X and Y directions */ public static double[] shadowOffset(double azimuth, double altitude, double height) { double spread = 1 / Math.tan(altitude); @@ -215,9 +215,9 @@ public static double[] shadowOffset(double azimuth, double altitude, double heig /** * Move the input coordinate according X and Y offset * - * @param inputCoordinate - * @param shadowOffset - * @return + * @param inputCoordinate Coordinate + * @param shadowOffset X and Y shadow offset + * @return moved coordinate */ private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) { return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1], 0); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java index 5e339b62c7..21a4dcf1c8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java @@ -36,10 +36,10 @@ public class EditUtilities { * Gets the coordinate of a Geometry that is the nearest of a given Point, * with a distance tolerance. * - * @param g - * @param p - * @param tolerance - * @return + * @param g {@link Geometry} + * @param p {@link Point} + * @param tolerance tolerance + * @return GeometryLocation */ public static GeometryLocation getVertexToSnap(Geometry g, Point p, double tolerance) { DistanceOp distanceOp = new DistanceOp(g, p); @@ -48,6 +48,5 @@ public static GeometryLocation getVertexToSnap(Geometry g, Point p, double toler return snapedPoint; } return null; - } } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java index 09ea2600f2..57059d67c3 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java @@ -48,10 +48,9 @@ public String getJavaStaticMethod() { * Returns a new geometry based on an existing one, with a specific point as * a new vertex. A default distance 10E-6 is used to snap the input point. * - * @param geometry - * @param point - * @return - * @throws SQLException + * @param geometry {@link Geometry} + * @param point {@link Point} + * @return Geometry with the new point */ public static Geometry addPoint(Geometry geometry, Point point) throws SQLException { if(geometry == null || point == null){ @@ -117,11 +116,11 @@ public static Geometry addPoint(Geometry geometry, Point point, int position) th /** * Adds a Point into a MultiPoint geometry. * - * @param g - * @param vertexPoint - * @param position - * @param factory - * @return + * @param g {@link MultiPoint} + * @param vertexPoint {@link Point} + * @param position vertex position + * @param factory {@link GeometryFactory} + * @return Geometry with the new vertex */ private static Geometry insertVertexInMultipoint(MultiPoint g, Point vertexPoint, int position, GeometryFactory factory) throws SQLException { ArrayList geoms = new ArrayList(); @@ -145,11 +144,10 @@ private static Geometry insertVertexInMultipoint(MultiPoint g, Point vertexPoint /** * Inserts a vertex into a LineString with a given tolerance. * - * @param lineString - * @param vertexPoint - * @param factory - * @return - * @throws SQLException + * @param lineString {@link LineString} + * @param vertexPoint {@link Point} + * @param factory {@link GeometryFactory} + * @return Geometry with the new vertex */ private static LineString insertVertexInLineString(LineString lineString, Point vertexPoint, GeometryFactory factory) throws SQLException { CoordinateSequence coordSeq = lineString.getCoordinateSequence(); @@ -159,11 +157,10 @@ private static LineString insertVertexInLineString(LineString lineString, Point /** * Inserts a vertex into a LineString with a given tolerance. * - * @param lineString - * @param vertexPoint - * @param factory - * @return - * @throws SQLException + * @param lineString {@link LineString} + * @param vertexPoint {@link Point} + * @param factory {@link GeometryFactory} + * @return Geometry with the new vertex */ private static LineString insertVertexInLineString(LineString lineString, Point vertexPoint, int position, GeometryFactory factory) throws SQLException { return factory.createLineString(addCoordinate(lineString.getCoordinateSequence(), vertexPoint.getCoordinate(),position )); @@ -171,10 +168,10 @@ private static LineString insertVertexInLineString(LineString lineString, Point /** * Expand the coordinates array and add a coordinate at the given position * - * @param coorseq - * @param position - * @param point - * @return + * @param coorseq {@link CoordinateSequence} + * @param position vertex position + * @param point {@link Point} + * @return Coordinate array */ public static Coordinate[] addCoordinate(CoordinateSequence coorseq, Coordinate point, int position) { if(position<=coorseq.size() ){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddZ.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddZ.java index 86f9b916ef..75a2032ede 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddZ.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddZ.java @@ -50,10 +50,9 @@ public String getJavaStaticMethod() { * Add a z with to the existing value (do the sum). NaN values are not * updated. * - * @param geometry - * @param z - * @return - * @throws java.sql.SQLException + * @param geometry {@link Geometry} + * @param z z value + * @return Geometry */ public static Geometry addZ(Geometry geometry, double z) throws SQLException { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCW.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCW.java index e08bf810b6..7c9828ec3e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCW.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ForcePolygonCW.java @@ -48,8 +48,8 @@ public String getJavaStaticMethod() { * Forces (Multi)Polygons to use a clockwise orientation for their exterior ring, and a counter-clockwise orientation * for their interior rings. * Non-polygonal geometries are returned unchanged. - * @param geom - * @return + * @param geom {@link Geometry} + * @return Geometry */ public static Geometry execute(Geometry geom) throws SQLException { if (geom != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_InsertPoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_InsertPoint.java index 006e25ab16..a813cbfbd6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_InsertPoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_InsertPoint.java @@ -53,10 +53,9 @@ public String getJavaStaticMethod() { * Returns a new geometry based on an existing one, with a specific point as * a new vertex. A default distance 10E-6 is used to snap the input point. * - * @param geometry - * @param point - * @return - * @throws SQLException + * @param geometry {@link Geometry} + * @param point {@link Point} + * @return Geometry with the new point */ public static Geometry insertPoint(Geometry geometry, Point point) throws SQLException { return insertPoint(geometry, point, PRECISION); @@ -140,10 +139,10 @@ else if (geometry instanceof MultiPoint) { /** * Adds a Point into a MultiPoint geometry. * - * @param g - * @param vertexPoint - * @param factory - * @return + * @param g {@link Geometry} + * @param vertexPoint {@link Point} + * @param factory {@link GeometryFactory} + * @return geometry */ private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint, GeometryFactory factory) { ArrayList geoms = new ArrayList(); @@ -158,12 +157,11 @@ private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint, /** * Inserts a vertex into a LineString with a given tolerance. * - * @param lineString - * @param vertexPoint - * @param tolerance - * @param factory - * @return - * @throws SQLException + * @param lineString {@link LineString} + * @param vertexPoint {@link Point} + * @param tolerance tolerance + * @param factory {@link GeometryFactory} + * @return LineString with the new {@link Point} */ private static LineString insertVertexInLineString(LineString lineString, Point vertexPoint, double tolerance, GeometryFactory factory) throws SQLException { @@ -189,12 +187,11 @@ private static LineString insertVertexInLineString(LineString lineString, Point /** * Adds a vertex into a Polygon with a given tolerance. * - * @param polygon - * @param vertexPoint - * @param tolerance - * @param factory - * @return - * @throws SQLException + * @param polygon {@link Polygon} + * @param vertexPoint {@link Point} + * @param tolerance tolerance + * @param factory {@link GeometryFactory} + * @return Polygon with the new {@link Point} */ private static Polygon insertVertexInPolygon(Polygon polygon, Point vertexPoint, double tolerance, GeometryFactory factory) throws SQLException { @@ -241,10 +238,10 @@ private static Polygon insertVertexInPolygon(Polygon polygon, /** * Return minimum distance between a geometry and a point. * - * @param geometry - * @param vertexPoint - * @param tolerance - * @return + * @param geometry {@link Geometry} + * @param vertexPoint {@link Point} + * @param tolerance tolerance + * @return distance to snap the {@link Point} */ private static double computeDistance(Geometry geometry, Point vertexPoint, double tolerance) { DistanceOp distanceOp = new DistanceOp(geometry, vertexPoint, tolerance); @@ -254,11 +251,11 @@ private static double computeDistance(Geometry geometry, Point vertexPoint, doub /** * Adds a vertex into a LinearRing with a given tolerance. * - * @param lineString - * @param vertexPoint - * @param tolerance - * @param factory - * @return + * @param lineString {@link LineString} + * @param vertexPoint {@link Point} + * @param tolerance tolerance + * @param factory {@link GeometryFactory} + * @return linearRing with the new {@link Point} */ private static LinearRing insertVertexInLinearRing(LineString lineString, Point vertexPoint, double tolerance, GeometryFactory factory) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/system/JTSVersion.java b/h2gis-functions/src/main/java/org/h2gis/functions/system/JTSVersion.java index 812a823a28..36ab136619 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/system/JTSVersion.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/system/JTSVersion.java @@ -42,7 +42,7 @@ public String getJavaStaticMethod() { /** * Return the JTS version * - * @return + * @return JTS version */ public static String getjtsVersion() { org.locationtech.jts.JTSVersion jtsVersion = org.locationtech.jts.JTSVersion.CURRENT_VERSION; From 76944d0f265be02137a33ea3bb1e50ee42eed911 Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 4 Nov 2024 15:30:05 +0100 Subject: [PATCH 25/26] Fix doc --- .../spatial/edit/ST_Interpolate3DLine.java | 12 ++--- .../functions/spatial/edit/ST_MultiplyZ.java | 7 ++- .../edit/ST_RemoveDuplicatedCoordinates.java | 36 +++++++------- .../spatial/edit/ST_RemoveHoles.java | 8 ++-- .../spatial/edit/ST_RemovePoints.java | 7 ++- .../spatial/edit/ST_RemoveRepeatedPoints.java | 47 ++++++++----------- .../spatial/edit/ST_Reverse3DLine.java | 18 +++---- .../functions/spatial/edit/ST_UpdateZ.java | 44 ++++++++--------- .../edit/ST_ZUpdateLineExtremities.java | 18 +++---- .../generalize/ST_PrecisionReducer.java | 7 ++- .../ST_SimplifyPreserveTopology.java | 6 +-- .../spatial/generalize/ST_SnapToGrid.java | 7 ++- .../functions/spatial/mesh/DelaunayData.java | 4 +- .../spatial/properties/ST_3DArea.java | 8 ++-- .../spatial/properties/ST_Explode.java | 8 ++-- .../functions/spatial/properties/ST_Is3D.java | 4 +- .../spatial/properties/ST_IsValidReason.java | 4 +- .../functions/spatial/split/ST_SubDivide.java | 14 +++--- .../spatial/topography/ST_Drape.java | 22 ++++----- .../topography/ST_TriangleDirection.java | 5 +- .../spatial/topography/TINFeatureFactory.java | 7 ++- .../spatial/trigonometry/ST_Azimuth.java | 6 +-- .../spatial/volume/GeometryExtrude.java | 20 ++++---- .../h2gis/functions/system/H2GISversion.java | 2 +- 24 files changed, 153 insertions(+), 168 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java index 6f63b23925..dcdda69bd8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Interpolate3DLine.java @@ -44,8 +44,8 @@ public String getJavaStaticMethod() { /** * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return Geometry */ public static Geometry interpolateLine(Geometry geometry) { if(geometry == null){ @@ -63,8 +63,8 @@ public static Geometry interpolateLine(Geometry geometry) { * Interpolate a linestring according the start and the end coordinates z * value. If the start or the end z is NaN return the input linestring * - * @param lineString - * @return + * @param lineString {@link LineString} + * @return LineString */ private static LineString linearZInterpolation(LineString lineString) { double startz = lineString.getStartPoint().getCoordinate().z; @@ -81,8 +81,8 @@ private static LineString linearZInterpolation(LineString lineString) { /** * Interpolate each linestring of the multilinestring. * - * @param multiLineString - * @return + * @param multiLineString {@link MultiLineString } + * @return MultiLineString */ private static MultiLineString linearZInterpolation(MultiLineString multiLineString) { int nbGeom = multiLineString.getNumGeometries(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_MultiplyZ.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_MultiplyZ.java index d75840f915..cc47635513 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_MultiplyZ.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_MultiplyZ.java @@ -48,10 +48,9 @@ public String getJavaStaticMethod() { * Multiply the z values of the geometry by another double value. NaN values * are not updated. * - * @param geometry - * @param z - * @return - * @throws java.sql.SQLException + * @param geometry {@link Geometry} + * @param z z value + * @return Z {@link Geometry} */ public static Geometry multiplyZ(Geometry geometry, double z) throws SQLException { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java index fdf9d9e935..077dcdeef5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveDuplicatedCoordinates.java @@ -31,8 +31,8 @@ public String getJavaStaticMethod() { /** * Returns a version of the given geometry with duplicated coordinates removed. * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return Geometry without duplicated coordinates */ public static Geometry removeDuplicatedCoordinates(Geometry geometry) { return removeCoordinates(geometry); @@ -41,8 +41,8 @@ public static Geometry removeDuplicatedCoordinates(Geometry geometry) { /** * Removes duplicated coordinates within a geometry. * - * @param geom - * @return + * @param geom {@link Geometry} + * @return Geometry without duplicated coordinates */ public static Geometry removeCoordinates(Geometry geom) { if(geom ==null){ @@ -72,8 +72,8 @@ else if (geom instanceof MultiPoint) { /** * Removes duplicated coordinates within a MultiPoint. * - * @param g - * @return + * @param g {@link MultiPoint} + * @return MultiPoint without duplicated points */ public static MultiPoint removeCoordinates(MultiPoint g) { Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(),false); @@ -83,8 +83,8 @@ public static MultiPoint removeCoordinates(MultiPoint g) { /** * Removes duplicated coordinates within a LineString. * - * @param g - * @return + * @param g {@link LineString} + * @return LineString without duplicated coordinates */ public static LineString removeCoordinates(LineString g) { Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(), false); @@ -94,8 +94,8 @@ public static LineString removeCoordinates(LineString g) { /** * Removes duplicated coordinates within a linearRing. * - * @param g - * @return + * @param g {@link LinearRing} + * @return LinearRing without duplicated coordinates */ public static LinearRing removeCoordinates(LinearRing g) { Coordinate[] coords = CoordinateUtils.removeDuplicatedCoordinates(g.getCoordinates(),false); @@ -105,8 +105,8 @@ public static LinearRing removeCoordinates(LinearRing g) { /** * Removes duplicated coordinates in a MultiLineString. * - * @param g - * @return + * @param g {@link MultiLineString} + * @return MultiLineString without duplicated coordinates */ public static MultiLineString removeCoordinates(MultiLineString g) { ArrayList lines = new ArrayList(); @@ -121,8 +121,8 @@ public static MultiLineString removeCoordinates(MultiLineString g) { /** * Removes duplicated coordinates within a Polygon. * - * @param poly - * @return + * @param poly {@link Polygon} + * @return Polygon without duplicated coordinates */ public static Polygon removeCoordinates(Polygon poly) { GeometryFactory factory =poly.getFactory(); @@ -139,8 +139,8 @@ public static Polygon removeCoordinates(Polygon poly) { /** * Removes duplicated coordinates within a MultiPolygon. * - * @param g - * @return + * @param g {@link MultiPolygon} + * @return MultiPolygon without duplicated coordinates */ public static MultiPolygon removeCoordinates(MultiPolygon g) { ArrayList polys = new ArrayList(); @@ -155,8 +155,8 @@ public static MultiPolygon removeCoordinates(MultiPolygon g) { /** * Removes duplicated coordinates within a GeometryCollection * - * @param g - * @return + * @param g {@link GeometryCollection} + * @return GeometryCollection without duplicated coordinates */ public static GeometryCollection removeCoordinates(GeometryCollection g) { ArrayList geoms = new ArrayList(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java index 1c52f9f3d4..6608670c10 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveHoles.java @@ -78,8 +78,8 @@ public static Geometry removeHoles(Geometry geometry) { /** * Create a new multiPolygon without hole. * - * @param multiPolygon - * @return + * @param multiPolygon {@link MultiPolygon} + * @return Geometry without holes */ public static MultiPolygon removeHolesMultiPolygon(MultiPolygon multiPolygon) { int num = multiPolygon.getNumGeometries(); @@ -93,8 +93,8 @@ public static MultiPolygon removeHolesMultiPolygon(MultiPolygon multiPolygon) { /** * Create a new polygon without hole. * - * @param polygon - * @return + * @param polygon {@link Polygon} + * @return Geometry without holes */ public static Polygon removeHolesPolygon(Polygon polygon) { return new Polygon((LinearRing) polygon.getExteriorRing(), null, polygon.getFactory()); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java index e90a145566..af4515baf5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java @@ -46,10 +46,9 @@ public String getJavaStaticMethod() { /** * Remove all vertices that are located within a polygon * - * @param geometry - * @param polygon - * @return - * @throws SQLException + * @param geometry {@link Geometry} + * @param polygon {@link Polygon} + * @return Geometry */ public static Geometry removePoint(Geometry geometry, Polygon polygon) throws SQLException { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java index fea87eb2e0..1ebcd79fcd 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java @@ -47,9 +47,8 @@ public String getJavaStaticMethod() { /** * Returns a version of the given geometry with duplicated points removed. * - * @param geometry - * @return - * @throws java.sql.SQLException + * @param geometry {@link Geometry} + * @return Geometry without repeated points */ public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLException, SQLException { return removeDuplicateCoordinates(geometry, 0); @@ -58,10 +57,9 @@ public static Geometry removeRepeatedPoints(Geometry geometry) throws SQLExcepti /** * Returns a version of the given geometry with duplicated points removed. * - * @param geometry - * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @param geometry {@link Geometry} + * @param tolerance distance to delete the coordinates + * @return Geometry without repeated points */ public static Geometry removeRepeatedPoints(Geometry geometry, double tolerance) throws SQLException { return removeDuplicateCoordinates(geometry, tolerance); @@ -70,10 +68,9 @@ public static Geometry removeRepeatedPoints(Geometry geometry, double tolerance) /** * Removes duplicated points within a geometry. * - * @param geom - * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @param geom {@link Geometry} + * @param tolerance distance to delete the coordinates + * @return Geometry without repeated points */ public static Geometry removeDuplicateCoordinates(Geometry geom, double tolerance) throws SQLException { if (geom == null) { @@ -103,10 +100,9 @@ public static Geometry removeDuplicateCoordinates(Geometry geom, double toleranc /** * Removes duplicated coordinates within a LineString. * - * @param linestring - * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @param linestring {@link LineString} + * @param tolerance distance to delete the coordinates + * @return Geometry without repeated points */ public static LineString removeDuplicateCoordinates(LineString linestring, double tolerance) throws SQLException { Coordinate[] coords = CoordinateUtils.removeRepeatedCoordinates(linestring.getCoordinates(), tolerance, false); @@ -119,9 +115,9 @@ public static LineString removeDuplicateCoordinates(LineString linestring, doubl /** * Removes duplicated coordinates within a linearRing. * - * @param linearRing + * @param linearRing {@link LinearRing} * @param tolerance to delete the coordinates - * @return + * @return Geometry without repeated points */ public static LinearRing removeDuplicateCoordinates(LinearRing linearRing, double tolerance) { Coordinate[] coords = CoordinateUtils.removeRepeatedCoordinates(linearRing.getCoordinates(), tolerance, true); @@ -131,9 +127,9 @@ public static LinearRing removeDuplicateCoordinates(LinearRing linearRing, doubl /** * Removes duplicated coordinates in a MultiLineString. * - * @param multiLineString + * @param multiLineString {@link MultiLineString} * @param tolerance to delete the coordinates - * @return + * @return Geometry without repeated points */ public static MultiLineString removeDuplicateCoordinates(MultiLineString multiLineString, double tolerance) throws SQLException { ArrayList lines = new ArrayList(); @@ -150,8 +146,7 @@ public static MultiLineString removeDuplicateCoordinates(MultiLineString multiLi * * @param polygon the input polygon * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @return Geometry without repeated points */ public static Polygon removeDuplicateCoordinates(Polygon polygon, double tolerance) throws SQLException { GeometryFactory factory = polygon.getFactory(); @@ -171,10 +166,9 @@ public static Polygon removeDuplicateCoordinates(Polygon polygon, double toleran /** * Removes duplicated coordinates within a MultiPolygon. * - * @param multiPolygon + * @param multiPolygon {@link MultiPolygon} * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @return Geometry without repeated points */ public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, double tolerance) throws SQLException { ArrayList polys = new ArrayList(); @@ -189,10 +183,9 @@ public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, /** * Removes duplicated coordinates within a GeometryCollection * - * @param geometryCollection + * @param geometryCollection {@link GeometryCollection} * @param tolerance to delete the coordinates - * @return - * @throws java.sql.SQLException + * @return Geometry without repeated points */ public static GeometryCollection removeDuplicateCoordinates(GeometryCollection geometryCollection, double tolerance) throws SQLException { ArrayList geoms = new ArrayList<>(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java index c6966ff413..5bff0300d1 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java @@ -47,8 +47,8 @@ public String getJavaStaticMethod() { * Returns a 1 dimension geometry with vertex order reversed using the ascending * value. * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return Geometry */ public static Geometry reverse3DLine(Geometry geometry) { return reverse3DLine(geometry, "asc"); @@ -59,9 +59,9 @@ public static Geometry reverse3DLine(Geometry geometry) { * ascending (asc) or descending (desc) * * - * @param geometry - * @param order - * @return + * @param geometry {@link Geometry} + * @param order asc to reverse in ascending , desc to reverse in descending + * @return Geometry */ public static Geometry reverse3DLine(Geometry geometry, String order) { if(geometry == null){ @@ -79,9 +79,9 @@ public static Geometry reverse3DLine(Geometry geometry, String order) { * Reverses a LineString according to the z value. The z of the first point * must be lower than the z of the end point. * - * @param lineString + * @param lineString {@link LineString} * @param order asc to reverse in ascending , desc to reverse in descending - * @return + * @return LineString */ private static LineString reverse3D(LineString lineString, String order) { CoordinateSequence seq = lineString.getCoordinateSequence(); @@ -109,9 +109,9 @@ private static LineString reverse3D(LineString lineString, String order) { * point must be lower than the z end point if desc : the z first point must * be greater than the z end point * - * @param multiLineString + * @param multiLineString {@link MultiLineString} * @param order asc to reverse in ascending , desc to reverse in descending - * @return + * @return MultiLineString */ public static MultiLineString reverse3D(MultiLineString multiLineString, String order) { int num = multiLineString.getNumGeometries(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java index c32459b6e4..b2ac16586f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_UpdateZ.java @@ -66,7 +66,7 @@ public static Geometry updateZ(Geometry geometry, double z) { * dimension * @param geom the input geometry * @param zValue to update - * @return + * @return Geometry */ public static Geometry force(Geometry geom, double zValue) { Geometry g = geom; @@ -99,9 +99,9 @@ public static Geometry force(Geometry geom, double zValue) { * Force the dimension of the MultiPoint and update correctly the coordinate * dimension * - * @param mp - * @param zValue - * @return + * @param mp {@link MultiPoint} + * @param zValue z value + * @return Geometry */ public static MultiPoint convert(MultiPoint mp, double zValue) { int nb = mp.getNumGeometries(); @@ -115,9 +115,9 @@ public static MultiPoint convert(MultiPoint mp, double zValue) { /** * Force the dimension of the GeometryCollection and update correctly the coordinate * dimension - * @param gc - * @param zValue - * @return + * @param gc {@link GeometryCollection} + * @param zValue z value + * @return GeometryCollection */ public static GeometryCollection convert(GeometryCollection gc, double zValue) { int nb = gc.getNumGeometries(); @@ -131,9 +131,9 @@ public static GeometryCollection convert(GeometryCollection gc, double zValue) { /** * Force the dimension of the MultiPolygon and update correctly the coordinate * dimension - * @param multiPolygon - * @param zValue - * @return + * @param multiPolygon {@link MultiPolygon} + * @param zValue z value + * @return MultiPolygon */ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue) { int nb = multiPolygon.getNumGeometries(); @@ -147,9 +147,9 @@ public static MultiPolygon convert(MultiPolygon multiPolygon,double zValue) { /** * Force the dimension of the MultiLineString and update correctly the coordinate * dimension - * @param multiLineString - * @param zValue - * @return + * @param multiLineString MultiLineString + * @param zValue z value + * @return MultiLineString */ public static MultiLineString convert(MultiLineString multiLineString, double zValue) { int nb = multiLineString.getNumGeometries(); @@ -163,9 +163,9 @@ public static MultiLineString convert(MultiLineString multiLineString, double zV /** * Force the dimension of the Polygon and update correctly the coordinate * dimension - * @param polygon - * @param zValue - * @return + * @param polygon {@link Polygon} + * @param zValue z value + * @return Polygon */ public static Polygon convert(Polygon polygon, double zValue) { LinearRing shell = gf.createLinearRing(convertSequence(polygon.getExteriorRing().getCoordinateSequence(),zValue)); @@ -182,9 +182,9 @@ public static Polygon convert(Polygon polygon, double zValue) { /** * Force the dimension of the LineString and update correctly the coordinate * dimension - * @param lineString - * @param zValue - * @return + * @param lineString {@link LineString} + * @param zValue z value + * @return LineString */ public static LineString convert(LineString lineString,double zValue) { return gf.createLineString(convertSequence(lineString.getCoordinateSequence(),zValue)); @@ -193,9 +193,9 @@ public static LineString convert(LineString lineString,double zValue) { /** * Force the dimension of the LinearRing and update correctly the coordinate * dimension - * @param linearRing - * @param zValue - * @return + * @param linearRing {@link LinearRing} + * @param zValue z value + * @return LinearRing */ public static LinearRing convert(LinearRing linearRing,double zValue) { return gf.createLinearRing(convertSequence(linearRing.getCoordinateSequence(),zValue)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java index 9ba1f87c49..bee8faf01d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java @@ -50,11 +50,11 @@ public static Geometry updateZExtremities(Geometry geometry, double startZ, doub * Update the start and end Z values. If the interpolate is true the * vertices are interpolated according the start and end z values. * - * @param geometry - * @param startZ - * @param endZ - * @param interpolate - * @return + * @param geometry {@link Geometry} + * @param startZ start z + * @param endZ end z + * @param interpolate true to interpolate the intermediate values + * @return Z {@link Geometry} */ public static Geometry updateZExtremities(Geometry geometry, double startZ, double endZ, boolean interpolate) { if(geometry == null){ @@ -79,12 +79,12 @@ public static Geometry updateZExtremities(Geometry geometry, double startZ, doub * Updates all z values by a new value using the specified first and the * last coordinates. * - * @param geom - * @param startZ - * @param endZ + * @param lineString {@link LineString} + * @param startZ start z + * @param endZ end z * @param interpolate is true the z value of the vertices are interpolate * according the length of the line. - * @return + * @return Z {@link Geometry} */ private static Geometry force3DStartEnd(LineString lineString, final double startZ, final double endZ, final boolean interpolate) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java index 3b32b98fc9..36742920ce 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_PrecisionReducer.java @@ -46,10 +46,9 @@ public String getJavaStaticMethod() { * Reduce the geometry precision. Decimal_Place is the number of decimals to * keep. * - * @param geometry - * @param nbDec - * @return - * @throws SQLException + * @param geometry {@link Geometry} + * @param nbDec decimal places + * @return Geometry */ public static Geometry precisionReducer(Geometry geometry, int nbDec) throws SQLException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SimplifyPreserveTopology.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SimplifyPreserveTopology.java index 1c67751127..aeda1ada6c 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SimplifyPreserveTopology.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SimplifyPreserveTopology.java @@ -44,9 +44,9 @@ public String getJavaStaticMethod() { * having the same dimension and number of components as the input, and with * the components having the same topological relationship. * - * @param geometry - * @param distance - * @return + * @param geometry {@link Geometry} + * @param distance distance + * @return Geometry */ public static Geometry simplyPreserve(Geometry geometry, double distance) { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SnapToGrid.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SnapToGrid.java index 312972ea2e..c16eb388fb 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SnapToGrid.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/generalize/ST_SnapToGrid.java @@ -45,10 +45,9 @@ public String getJavaStaticMethod() { /** * Reduce the geometry precision. cell_size is resolution of grid to snap the points * - * @param geometry - * @param cell_size - * @return - * @throws SQLException + * @param geometry Geometry + * @param cell_size snapping grid tolerance + * @return Geometry */ public static Geometry execute(Geometry geometry, float cell_size) throws SQLException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java index 2e4d50fa7a..5239a25cec 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java @@ -217,8 +217,8 @@ public double get3DArea(){ /** * Computes the 3D area of a triangle. * - * @param triangle - * @return + * @param triangle {@link DelaunayTriangle} + * @return triangle area */ private double computeTriangleArea3D(DelaunayTriangle triangle) { TriangulationPoint[] points = triangle.points; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java index c127dad6f0..9e35a4ad7a 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java @@ -46,8 +46,8 @@ public String getJavaStaticMethod() { * Compute the 3D area of a polygon a geometrycollection that contains * polygons * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return 3D area */ public static Double st3darea(Geometry geometry) { if (geometry == null) { @@ -66,8 +66,8 @@ public static Double st3darea(Geometry geometry) { /** * Compute the 3D area of a polygon * - * @param geometry - * @return + * @param geometry {@link Polygon} + * @return 3D area */ private static Double compute3DArea(Polygon geometry) { DelaunayData delaunayData = new DelaunayData(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java index be2605729a..5cb989e491 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java @@ -81,11 +81,10 @@ public static ResultSet explode(Connection connection, String tableName) throws /** * Explode Geometry Collection into multiple geometries - * @param connection + * @param connection database * @param tableName the name of the input table * @param fieldName the name of geometry field. If null the first geometry column is used. - * @return - * @throws java.sql.SQLException + * @return ResultSet */ public static ResultSet explode(Connection connection, String tableName, String fieldName) throws SQLException { ExplodeResultSet rowSource = new ExplodeResultSet(connection, @@ -224,8 +223,7 @@ public void reset() throws SQLException { /** * Return the exploded geometries as multiple rows - * @return - * @throws SQLException + * @return ResultSet */ public ResultSet getResultSet() throws SQLException { SimpleResultSet rs = new SimpleResultSet(this); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java index d069eaaec1..7d4d2b3ac5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Is3D.java @@ -47,8 +47,8 @@ public String getJavaStaticMethod() { /** * Returns 1 if a geometry has a z-coordinate, otherwise 0. - * @param geom - * @return + * @param geom {@link Geometry} + * @return 1 if it's a 3D geom, 0 otherwise */ public static int is3D(Geometry geom) throws IOException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java index 9b9f8d5870..57b2632d82 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_IsValidReason.java @@ -80,8 +80,8 @@ public static String isValidReason(Geometry geometry, int flag) { /** * - * @param geometry - * @return + * @param geometry {@link Geometry} + * @return give the valid reason */ private static String validReason(Geometry geometry, boolean flag) { IsValidOp validOP = new IsValidOp(geometry); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_SubDivide.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_SubDivide.java index e9b101ca64..129e6a1057 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_SubDivide.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_SubDivide.java @@ -22,17 +22,17 @@ public String getJavaStaticMethod() { /** * Divide the geometry into quadrants * - * @param geom - * @return + * @param geom {@link Geometry} + * @return geometry */ public static Geometry divide(Geometry geom) { return divideOnePass(geom); } /** - * @param geom - * @param maxvertices - * @return + * @param geom {@link Geometry} + * @param maxvertices max number of vertices + * @return Geometry */ public static Geometry divide(Geometry geom, int maxvertices) { Geometry res = FACTORY.buildGeometry(subdivide_recursive(geom, maxvertices)); @@ -46,7 +46,7 @@ public static Geometry divide(Geometry geom, int maxvertices) { * * @param geom input geometry * @param maxvertices number of vertices in the final geometry - * @return + * @return geometry */ public static List subdivide_recursive(Geometry geom, int maxvertices) { if(geom ==null){ @@ -108,7 +108,7 @@ else if(envelope.getWidth()==0){ * Divide the geometry in quadrants * * @param geom input geometry - * @return + * @return geometry */ private static Geometry divideOnePass(Geometry geom) { if(geom ==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java index 06bba3e235..62607dffc6 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_Drape.java @@ -93,10 +93,10 @@ else if (geomToDrape instanceof Polygon) { /** * Drape a multipoint geometry to a set of triangles - * @param pts - * @param triangles - * @param sTRtree - * @return + * @param pts {@link Geometry} + * @param triangles {@link Geometry} + * @param sTRtree {@link STRtree} + * @return Geometry */ public static Geometry drapePoints(Geometry pts, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = pts.getFactory(); @@ -110,10 +110,10 @@ public static Geometry drapePoints(Geometry pts, Geometry triangles, STRtree sTR /** * Drape a point geometry to a set of triangles - * @param pts - * @param triangles - * @param sTRtree - * @return + * @param pts {@link Geometry} + * @param triangles {@link Geometry} + * @param sTRtree {@link STRtree} + * @return Geometry */ public static Geometry drapePoint(Geometry pts, Geometry triangles, STRtree sTRtree) { GeometryFactory factory = pts.getFactory(); @@ -226,9 +226,9 @@ public static Geometry lineMerge(Geometry geom, GeometryFactory factory) { /** * Update the coordinates and compute the z values - * @param cs - * @param indexedTriangles - * @return + * @param cs {@link CoordinateSequence} + * @param indexedTriangles {@link STRtree} + * @return CoordinateArraySequence */ private static CoordinateArraySequence updateCoordinates(CoordinateSequence cs, STRtree indexedTriangles) { int updateDim = cs.getDimension(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java index 0678917fb4..7deb324270 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java @@ -48,9 +48,8 @@ public String getJavaStaticMethod() { /** * Compute the main slope direction - * @param geometry - * @return - * @throws IllegalArgumentException + * @param geometry {@link Geometry} + * @return LineString */ public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException { if(geometry == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java index f63750685e..d457070e81 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/TINFeatureFactory.java @@ -41,10 +41,9 @@ private TINFeatureFactory() { /** * A factory to create a DTriangle from a Geometry * - * @param geom - * @return - * @throws IllegalArgumentException - * If there are not exactly 3 coordinates in geom. + * @param geom {@link Geometry} + * @return Triangle + * @throws IllegalArgumentException If there are not exactly 3 coordinates in geom. */ public static Triangle createTriangle(Geometry geom) throws IllegalArgumentException { Coordinate[] coordinates = geom.getCoordinates(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/trigonometry/ST_Azimuth.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/trigonometry/ST_Azimuth.java index d7c486410d..86b5cf3f0e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/trigonometry/ST_Azimuth.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/trigonometry/ST_Azimuth.java @@ -46,9 +46,9 @@ public String getJavaStaticMethod() { /** * This code compute the angle in radian as postgis does. * @author : Jose Martinez-Llario from JASPA. JAva SPAtial for SQL - * @param pointA - * @param pointB - * @return + * @param pointA {@link Geometry} A + * @param pointB {@link Geometry} B + * @return azimuth */ public static Double azimuth(Geometry pointA, Geometry pointB){ if(pointA == null||pointB == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java index f88126d1d2..b22845d725 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java @@ -99,9 +99,9 @@ public static GeometryCollection extrudeLineStringAsGeometry(LineString lineStri /** * Extract the linestring "roof". * - * @param lineString - * @param height - * @return + * @param lineString {@link LineString} + * @param height value + * @return Roof geometry */ public static Geometry extractRoof(LineString lineString, double height) { LineString result = (LineString)lineString.copy(); @@ -162,9 +162,9 @@ public static Polygon extractRoof(Polygon polygon, double height) { /** * Extrude the LineString as a set of walls. - * @param lineString - * @param height - * @return + * @param lineString {@link LineString} + * @param height value + * @return Walls geometry */ public static MultiPolygon extractWalls(LineString lineString, double height) { GeometryFactory factory = lineString.getFactory(); @@ -234,10 +234,10 @@ private static Polygon extractFloor(final Polygon polygon) { * Create a polygon corresponding to the wall. * * - * @param beginPoint - * @param endPoint - * @param height - * @return + * @param beginPoint start {@link Coordinate} + * @param endPoint end {@link Coordinate} + * @param height value + * @return Extruded {@link Polygon} */ private static Polygon extrudeEdge(final Coordinate beginPoint, Coordinate endPoint, final double height, GeometryFactory factory) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java b/h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java index 6d9efa3eed..63fd841219 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/system/H2GISversion.java @@ -49,7 +49,7 @@ public String getJavaStaticMethod() { * Return the H2GIS version available in the version txt file Otherwise * return unknown * - * @return + * @return H2GIS version */ public static String geth2gisVersion() { try (InputStream fs = H2GISFunctions.class.getResourceAsStream("/org/h2gis/functions/system/version.txt")) { From e13bfb215aff84d68e8b1531bbf2d55b7ed10c4f Mon Sep 17 00:00:00 2001 From: ebocher Date: Mon, 4 Nov 2024 15:42:47 +0100 Subject: [PATCH 26/26] Fix doc --- .../io/geojson/GJGeometryReader.java | 20 +++++++++---------- .../functions/io/geojson/GeoJsonRead.java | 6 ++---- .../functions/io/geojson/GeoJsonWrite.java | 3 +-- .../io/gpx/model/AbstractGpxParserRte.java | 4 ++-- .../functions/io/gpx/model/GpxParser.java | 1 - .../functions/io/shp/SHPDriverFunction.java | 1 - .../functions/io/tsv/TSVDriverFunction.java | 4 +--- .../org/h2gis/functions/io/tsv/TSVRead.java | 3 +-- .../spatial/convert/ST_GeomFromText.java | 1 - .../functions/spatial/convert/ST_Holes.java | 1 - .../spatial/convert/ST_ToMultiSegments.java | 1 - .../functions/spatial/create/GridRowSet.java | 7 ++----- .../functions/spatial/create/ST_Extrude.java | 2 -- .../create/ST_GeneratePointsInGrid.java | 1 - .../functions/spatial/create/ST_MakeGrid.java | 8 ++------ .../spatial/create/ST_MakeGridPoints.java | 4 +--- .../functions/spatial/create/ST_MakeLine.java | 2 -- .../spatial/create/ST_MakePoint.java | 4 +--- .../spatial/crs/SpatialRefRegistry.java | 3 +-- .../distance/ST_ClosestCoordinate.java | 1 - .../spatial/distance/ST_ClosestPoint.java | 1 - .../distance/ST_FurthestCoordinate.java | 1 - .../ST_LineInterpolatePoint.java | 1 - .../linear_referencing/ST_LineSubstring.java | 1 - .../spatial/operators/ST_Intersection.java | 2 -- .../spatial/operators/ST_SymDifference.java | 2 -- .../functions/spatial/operators/ST_Union.java | 1 - .../spatial/properties/ST_Distance.java | 1 - .../spatial/properties/ST_Explode.java | 4 +--- .../h2gis/functions/spatial/snap/ST_Snap.java | 1 - .../utilities/GeometryTableUtilities.java | 1 - 31 files changed, 25 insertions(+), 68 deletions(-) diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java index 1e81dd8b12..f84bd39f9d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java @@ -49,7 +49,7 @@ public GJGeometryReader(GeometryFactory GF) { * * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} * - * @param jsParser json parser + * @param jsParser {@link JsonParser} * @return Geometry */ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLException { @@ -83,7 +83,8 @@ public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLExcept * * "geometry":{"type": "Point", "coordinates": [102.0,0.5]} * - * @param jp + * @param jp {@link JsonParser} + * @param geometryType geometry type * @return Geometry */ private Geometry parseGeometry(JsonParser jp, String geometryType) throws IOException, SQLException { @@ -113,7 +114,7 @@ private Geometry parseGeometry(JsonParser jp, String geometryType) throws IOExce * * { "type": "Point", "coordinates": [100.0, 0.0] } * - * @param jp + * @param jp {@link JsonParser} * @return Point */ public Point parsePoint(JsonParser jp) throws IOException, SQLException { @@ -135,7 +136,7 @@ public Point parsePoint(JsonParser jp) throws IOException, SQLException { * * { "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param jp json parser + * @param jp {@link JsonParser} * @return MultiPoint */ public MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException { @@ -157,7 +158,7 @@ public MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLExceptio * * { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } * - * @param jsParser json parser + * @param jp {@link JsonParser} */ public LineString parseLinestring(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates @@ -178,7 +179,7 @@ public LineString parseLinestring(JsonParser jp) throws IOException, SQLExceptio * { "type": "MultiLineString", "coordinates": [ [ [100.0, 0.0], [101.0, * 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] } * - * @param jsParser json parser + * @param jp {@link JsonParser} * @return MultiLineString */ public MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, SQLException { @@ -221,7 +222,7 @@ public MultiLineString parseMultiLinestring(JsonParser jp) throws IOException, S * * * - * @param jp + * @param jp {@link JsonParser} * @return Polygon */ public Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { @@ -262,7 +263,7 @@ public Polygon parsePolygon(JsonParser jp) throws IOException, SQLException { * [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.8, 0.2], * [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]] ] } * - * @param jp + * @param jp {@link JsonParser} * @return MultiPolygon */ public MultiPolygon parseMultiPolygon(JsonParser jp) throws IOException, SQLException { @@ -363,8 +364,7 @@ public Coordinate[] parseCoordinates(JsonParser jp) throws IOException { * * 100.0, 0.0] * - * @param jp - * @throws IOException + * @param jp {@link JsonParser} * @return Coordinate */ public Coordinate parseCoordinate(JsonParser jp) throws IOException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java index 790f50403b..796fdff27e 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonRead.java @@ -58,8 +58,7 @@ public String getJavaStaticMethod() { /** * - * @param connection - * @param fileName input file + * @param connection database * @param fileName input file */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); @@ -74,8 +73,7 @@ public static void importTable(Connection connection, String fileName) throws IO /** * Read the GeoJSON file. * - * @param connection - * @param fileName input file + * @param connection database * @param fileName input file * @param option */ public static void importTable(Connection connection, String fileName, Value option) throws IOException, SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java index 6d5f7de236..00d50e5619 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWrite.java @@ -66,8 +66,7 @@ public static void exportTable(Connection connection, String fileName, String ta /** * Write the GeoJSON file. * - * @param connection - * @param fileName input file + * @param connection database * @param fileName input file * @param tableReference output table name */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java index c3ad7d42ff..48a8ee8cb5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java @@ -175,7 +175,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc /** * Set the parent of this specific parser. * - * @param parent + * @param parent {@link AbstractGpxParserDefault} */ public void setParent(AbstractGpxParserDefault parent) { this.parent = parent; @@ -194,7 +194,7 @@ public boolean isPoint() { * Set the list corresponding to the points' coordinates of the actual * route. * - * @param rteList + * @param rteList list of coordinates */ public void setRteList(List rteList) { this.rteList = rteList; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java index e24c132886..18d956e8d8 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParser.java @@ -70,7 +70,6 @@ public GpxParser(Connection connection, File fileName, String encoding, boolean * @param qName qName of the local element (with prefix) * @param attributes Attributes of the local element (contained in the * markup) - * @throws SAXException */ @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java index 9a8c034e7b..7112513222 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java @@ -156,7 +156,6 @@ public String[] exportTable(Connection connection, String tableReference, File f * @param fileName File path to write, if exists it may be replaced * @param progress to display the IO progress * @param encoding File encoding, null will use default encoding - * @throws java.sql.SQLException */ private String[] doExport(Connection connection, Integer spatialFieldIndex, ResultSet rs, int recordCount, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException { int srid = 0; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java index 6a4a103642..8cf7e26624 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java @@ -238,12 +238,10 @@ public String[] exportTable(Connection connection, String tableReference, File f /** * Export a resultset to a TSV file * - * @param connection - * @param res + * @param connection database * @param res * @param writer * @param progress Progress visitor following the execution. * @param encoding - * @throws java.sql.SQLException */ public void exportFromResultSet(Connection connection, ResultSet res, Writer writer, String encoding, ProgressVisitor progress) throws SQLException { Csv csv = new Csv(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java index 747b7b2593..c7165ca937 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVRead.java @@ -112,8 +112,7 @@ public static void importTable(Connection connection, String fileName, String ta /** * Copy data from TSV File into a new table in specified connection. * - * @param connection - * @param fileName input file + * @param connection database * @param fileName input file */ public static void importTable(Connection connection, String fileName) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java index 6667ffff05..29fa4bda57 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromText.java @@ -52,7 +52,6 @@ public String getJavaStaticMethod() { * Convert well known text parameter into a Geometry * @param wkt Well known text * @return Geometry instance or null if parameter is null - * @throws java.sql.SQLException */ public static Geometry toGeometry(String wkt) throws SQLException { if(wkt == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java index c1755e2b06..3f82099e14 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_Holes.java @@ -53,7 +53,6 @@ public String getJavaStaticMethod() { * * @param geom Geometry * @return The geometry's holes - * @throws SQLException */ public static GeometryCollection execute(Geometry geom) throws SQLException { if (geom != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java index 769055271e..59ca0e0e6f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_ToMultiSegments.java @@ -53,7 +53,6 @@ public String getJavaStaticMethod() { * * @param geom Geometry * @return A MultiLineString of the geometry's distinct segments - * @throws SQLException */ public static MultiLineString createSegments(Geometry geom) throws SQLException { if (geom != null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java index 0d4f40bdf3..350d812e9b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/GridRowSet.java @@ -60,8 +60,7 @@ public class GridRowSet implements SimpleRowSource { /** * The grid will be computed according a table stored in the database * - * @param connection - * @param deltaX + * @param connection database * @param deltaX * @param deltaY * @param tableName */ @@ -76,8 +75,7 @@ public GridRowSet(Connection connection, double deltaX, double deltaY, String ta /** * The grid will be computed according the envelope of a geometry * - * @param connection - * @param deltaX + * @param connection database * @param deltaX * @param deltaY * @param geometry */ @@ -281,7 +279,6 @@ private void initParameters() throws SQLException { * Give the regular grid * * @return ResultSet - * @throws SQLException */ public ResultSet getResultSet() throws SQLException { SimpleResultSet srs = new SimpleResultSet(this); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Extrude.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Extrude.java index 6f3088b3dd..cb9bd724fd 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Extrude.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_Extrude.java @@ -59,7 +59,6 @@ public String getJavaStaticMethod() { * @param geometry Input geometry * @param height Desired height * @return Collection (floor, walls, ceiling) - * @throws SQLException */ public static GeometryCollection extrudeGeometry(Geometry geometry, double height) throws SQLException { if(geometry == null){ @@ -83,7 +82,6 @@ public static GeometryCollection extrudeGeometry(Geometry geometry, double heigh * @param height Desired height * @param flag 1 (walls), 2 (roof) * @return Walls or roof - * @throws SQLException */ public static Geometry extrudeGeometry(Geometry geometry, double height, int flag) throws SQLException { if (geometry == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java index 73c3d08048..64d214358f 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_GeneratePointsInGrid.java @@ -67,7 +67,6 @@ public static Geometry generatePointsInGrid(Geometry geom, int cellSizeX, int ce * @param useMask set to true to keep the points loacted inside the input * geometry * @return a regular distribution of points as multipoint - * @throws java.sql.SQLException */ public static Geometry generatePointsInGrid(Geometry geom, int cellSizeX, int cellSizeY, boolean useMask) throws SQLException { if (geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGrid.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGrid.java index 52258f53e9..bd15231f66 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGrid.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGrid.java @@ -59,12 +59,10 @@ public String getJavaStaticMethod() { * Create a regular grid using the first input argument to compute the full * extent. * - * @param connection - * @param value could be the name of a table or a geometry. + * @param connection database * @param value could be the name of a table or a geometry. * @param deltaX the X cell size * @param deltaY the Y cell size * @return a resultset that contains all cells as a set of polygons - * @throws SQLException */ public static ResultSet createGrid(Connection connection, Value value, double deltaX, double deltaY) throws SQLException { if(value == null){ @@ -86,12 +84,10 @@ public static ResultSet createGrid(Connection connection, Value value, double de * Create a regular grid using the first input argument to compute the full * extent. * - * @param connection - * @param value could be the name of a table or a geometry. + * @param connection database * @param value could be the name of a table or a geometry. * @param deltaX the X cell size * @param deltaY the Y cell size * @return a resultset that contains all cells as a set of polygons - * @throws SQLException */ public static ResultSet createGrid(Connection connection, Value value, double deltaX, double deltaY, boolean isColumnsRowsMeasure) throws SQLException { if(value == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java index 3b30d37cbc..1de1cf90ae 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeGridPoints.java @@ -55,12 +55,10 @@ public String getJavaStaticMethod() { * Create a regular grid of points using the first input value to compute * the full extent. * - * @param connection - * @param value could be the name of a table or a geometry. + * @param connection database * @param value could be the name of a table or a geometry. * @param deltaX the X cell size * @param deltaY the Y cell size * @return a resultset that contains all cells as a set of polygons - * @throws SQLException */ public static ResultSet createGridPoints(Connection connection, Value value, double deltaX, double deltaY) throws SQLException { if(value == null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java index d6f5c6f95c..02e36cea49 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java @@ -52,7 +52,6 @@ public String getJavaStaticMethod() { * @param pointA The first POINT or MULTIPOINT * @param optionalPoints Optional POINTs or MULTIPOINTs * @return The LINESTRING constructed from the given POINTs or MULTIPOINTs - * @throws SQLException */ public static LineString createLine(Geometry pointA, Geometry... optionalPoints) throws SQLException { if( pointA == null || optionalPoints.length > 0 && optionalPoints[0] == null) { @@ -77,7 +76,6 @@ public static LineString createLine(Geometry pointA, Geometry... optionalPoints) * @param points Points * @return The LINESTRING constructed from the given collection of POINTs * and/or MULTIPOINTs - * @throws SQLException */ public static LineString createLine(GeometryCollection points) throws SQLException { if(points == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePoint.java index 620736dfad..0c5170aa47 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePoint.java @@ -50,8 +50,7 @@ public String getJavaStaticMethod() { * * @param x X-coordinate * @param y Y-coordinate - * @return The POINT constructed from the given coordinatesk - * @throws java.sql.SQLException + * @return The POINT constructed from the given coordinates */ public static Point createPoint(double x, double y) throws SQLException { return createPoint(x, y, Coordinate.NULL_ORDINATE); @@ -64,7 +63,6 @@ public static Point createPoint(double x, double y) throws SQLException { * @param y Y-coordinate * @param z Z-coordinate * @return The POINT constructed from the given coordinates - * @throws SQLException */ public static Point createPoint(double x, double y, double z) throws SQLException { return GF.createPoint(new Coordinate(x, y, z)); diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java index fbbcd024ff..2db73d99d0 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/SpatialRefRegistry.java @@ -125,8 +125,7 @@ public Set getSupportedCodes() throws RegistryException { /** * Set the database connection * - * @param connection - */ + * @param connection database */ public void setConnection(Connection connection) { this.connection = connection; } diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestCoordinate.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestCoordinate.java index 8204cdf13a..5346a99cfa 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestCoordinate.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestCoordinate.java @@ -61,7 +61,6 @@ public String getJavaStaticMethod() { * @param geom Geometry * @return The closest coordinate(s) contained in the given geometry starting from * the given point, using the 2D distance - * @throws java.sql.SQLException */ public static Geometry getFurthestCoordinate(Point point, Geometry geom) throws SQLException { if (point == null || geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java index 28153ca213..2a2af049e5 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_ClosestPoint.java @@ -52,7 +52,6 @@ public String getJavaStaticMethod() { * @param geomA Geometry A * @param geomB Geometry B * @return The 2D point on geometry A that is closest to geometry B - * @throws java.sql.SQLException */ public static Point closestPoint(Geometry geomA, Geometry geomB) throws SQLException { if (geomA == null || geomB == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java index ebb7df3ad6..c24c68e351 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java @@ -61,7 +61,6 @@ public String getJavaStaticMethod() { * @param geom Geometry * @return The furthest coordinate(s) contained in the given geometry starting from * the given point, using the 2D distance - * @throws java.sql.SQLException */ public static Geometry getFurthestCoordinate(Point point, Geometry geom) throws SQLException { if (point == null || geom == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineInterpolatePoint.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineInterpolatePoint.java index afb94fc29c..6fb44f0976 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineInterpolatePoint.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineInterpolatePoint.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * @param geometry the input lines * @param start the start fraction between 0 and 1 * @return single or multiparts lines - * @throws SQLException */ public static Geometry execute(Geometry geometry, double start) throws SQLException { if(geometry==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineSubstring.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineSubstring.java index bc47bf8e6f..416c8307d2 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineSubstring.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/linear_referencing/ST_LineSubstring.java @@ -51,7 +51,6 @@ public String getJavaStaticMethod() { * @param start the start fraction between 0 and 1 * @param end the end fraction between 0 and 1 * @return single or multiparts lines - * @throws SQLException */ public static Geometry execute(Geometry geometry, double start, double end) throws SQLException { if(geometry==null){ diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Intersection.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Intersection.java index 5dafefc8a1..cde249e73b 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Intersection.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Intersection.java @@ -52,7 +52,6 @@ public String getJavaStaticMethod() { * @param b Geometry instance * * @return the intersection between two geometries - * @throws java.sql.SQLException */ public static Geometry intersection(Geometry a, Geometry b) throws SQLException { if (a == null || b == null) { @@ -71,7 +70,6 @@ public static Geometry intersection(Geometry a, Geometry b) throws SQLException * @param gridSize size of a grid to snap the input geometries * * @return the intersection between two geometries - * @throws java.sql.SQLException */ public static Geometry intersection(Geometry a, Geometry b, double gridSize) throws SQLException { if (a == null || b == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_SymDifference.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_SymDifference.java index a037d5a45a..d9405d7f54 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_SymDifference.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_SymDifference.java @@ -50,7 +50,6 @@ public String getJavaStaticMethod() { * @param a Geometry instance. * @param b Geometry instance * @return the symmetric difference between two geometries - * @throws java.sql.SQLException */ public static Geometry symDifference(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { @@ -68,7 +67,6 @@ public static Geometry symDifference(Geometry a,Geometry b) throws SQLException * @param b Geometry instance * @param gridSize size of a grid to snap the input geometries * @return the symmetric difference between two geometries - * @throws java.sql.SQLException */ public static Geometry symDifference(Geometry a,Geometry b, double gridSize) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Union.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Union.java index 76952dbcaa..0608b55d0d 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Union.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/operators/ST_Union.java @@ -50,7 +50,6 @@ public String getJavaStaticMethod() { * @param a Geometry instance. * @param b Geometry instance * @return union of Geometries a and b - * @throws java.sql.SQLException */ public static Geometry union(Geometry a, Geometry b) throws SQLException { if (a == null || b == null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Distance.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Distance.java index 07e201792e..ce7d3727c4 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Distance.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Distance.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * @param b Geometry instance or null * @return the 2-dimensional minimum Cartesian distance between two geometries * in projected units (spatial ref units) - * @throws java.sql.SQLException */ public static Double distance(Geometry a,Geometry b) throws SQLException { if(a==null || b==null) { diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java index 5cb989e491..d2e9c35c76 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_Explode.java @@ -59,10 +59,8 @@ public String getJavaStaticMethod() { /** * Explode Geometry Collection into multiple geometries - * @param connection - * @param tableName the name of the input table or select query + * @param connection database * @param tableName the name of the input table or select query * @return A result set with the same content of specified table but with atomic geometries and duplicate values. - * @throws java.sql.SQLException */ public static ResultSet explode(Connection connection, String tableName) throws SQLException { String regex = ".*(?i)\\b(select|from)\\b.*"; diff --git a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java index 89416ccff3..8f3dfa534c 100644 --- a/h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java +++ b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/snap/ST_Snap.java @@ -49,7 +49,6 @@ public String getJavaStaticMethod() { * @param geometryB a geometry to snap * @param distance the tolerance to use * @return the snapped geometries - * @throws java.sql.SQLException */ public static Geometry snap(Geometry geometryA, Geometry geometryB, double distance) throws SQLException { if (geometryA == null || geometryB == null) { diff --git a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java index 88a408526c..33cfe8b23e 100644 --- a/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java +++ b/h2gis-utilities/src/main/java/org/h2gis/utilities/GeometryTableUtilities.java @@ -1481,7 +1481,6 @@ public static String[] getAuthorityAndSRID(Connection connection, int srid) * * @return Array of two string that correspond to the authority name and its * SRID code - * @throws java.sql.SQLException * */ public static String[] getAuthorityAndSRID(Connection connection, String table, String geometryColumnName) throws SQLException{