Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Nov 4, 2024
1 parent f4162b0 commit de79472
Show file tree
Hide file tree
Showing 17 changed files with 139 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void computeMaxDistance() {
/**
* Return the max distance
*
* @return
* @return distance
*/
public Double getDistance() {
if (geomA == null || geomB == null) {
Expand All @@ -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) {
Expand Down Expand Up @@ -148,7 +148,7 @@ private void updateDistance(Coordinate coord) {
/**
* Return the maximum distance
*
* @return
* @return distance
*/
public double getDistance() {
return distance;
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Loading

0 comments on commit de79472

Please sign in to comment.