diff --git a/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java b/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java index 47a2407c72..0baccaff06 100644 --- a/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java +++ b/common/src/main/java/org/apache/sedona/common/raster/RasterAccessors.java @@ -257,9 +257,9 @@ private static void ensurePoint(Geometry geometry) throws IllegalArgumentExcepti * * @param raster the raster * @return double[] with the following values: 0: upperLeftX: upper left x 1: upperLeftY: upper - * left y 2: width: number of pixels on x axis 3: height: number of pixels on y axis 4: - * scaleX: pixel width 5: scaleY: pixel height 6: skewX: skew on x axis 7: skewY: skew on y - * axis 8: srid 9: numBands + * left y 2: width: number of pixels on x-axis 3: height: number of pixels on y-axis 4: + * scaleX: pixel width 5: scaleY: pixel height 6: skewX: skew on x-axis 7: skewY: skew on + * y-axis 8: srid 9: numBands * @throws FactoryException */ public static double[] metadata(GridCoverage2D raster) throws FactoryException { diff --git a/common/src/main/java/org/apache/sedona/common/subDivide/PivotFinder.java b/common/src/main/java/org/apache/sedona/common/subDivide/PivotFinder.java index ec38d03e1c..f3b71ba91a 100644 --- a/common/src/main/java/org/apache/sedona/common/subDivide/PivotFinder.java +++ b/common/src/main/java/org/apache/sedona/common/subDivide/PivotFinder.java @@ -40,7 +40,7 @@ public static double findPivot( LinearRing ringToTrim = lwPoly.getExteriorRing(); // if the shell is too small, use the largest hole if (numberOfVertices >= 2 * lwPoly.getExteriorRing().getNumPoints()) { - // find the hole with largest area and assign to ringtotrim + // find the hole with the largest area and assign to ringtotrim double maxArea = geometryFactory.createPolygon(lwPoly.getExteriorRing()).getArea(); for (int i = 0; i < lwPoly.getNumInteriorRing(); i++) { LinearRing curHole = lwPoly.getInteriorRingN(i); diff --git a/common/src/main/java/org/apache/sedona/common/utils/GeometrySplitter.java b/common/src/main/java/org/apache/sedona/common/utils/GeometrySplitter.java index a84ee61694..89c6a08981 100644 --- a/common/src/main/java/org/apache/sedona/common/utils/GeometrySplitter.java +++ b/common/src/main/java/org/apache/sedona/common/utils/GeometrySplitter.java @@ -51,7 +51,7 @@ public GeometrySplitter(GeometryFactory geometryFactory) { /** * Split input geometry by the blade geometry. Input geometry can be lineal (LineString or * MultiLineString) or polygonal (Polygon or MultiPolygon). A GeometryCollection can also be used - * as an input but it must be homogeneous. For lineal geometry refer to the {@link + * as an input, but it must be homogeneous. For lineal geometry refer to the {@link * splitLines(Geometry, Geometry) splitLines} method for restrictions on the blade. Refer to * {@link splitPolygons(Geometry, Geometry) splitPolygons} for restrictions on the blade for * polygonal input geometry. @@ -272,7 +272,7 @@ private Geometry generateCandidatePolygons(Geometry polygons, Geometry blade) { // avoid candidate polygons that are impossible Geometry bladeWithinPolygons = blade.intersection(polygons); - // a union will node all of the lines at intersections + // a union will node all the lines at intersections // these nodes are required for Polygonizer to work correctly Geometry totalLineWork = polygons.getBoundary().union(bladeWithinPolygons); diff --git a/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java b/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java index ee6c4a185a..fb40442118 100644 --- a/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java +++ b/common/src/main/java/org/apache/sedona/common/utils/RasterUtils.java @@ -544,7 +544,7 @@ public static Raster getRaster(RenderedImage renderedImage) { public static Geometry convertCRSIfNeeded( Geometry geometry, CoordinateReferenceSystem targetCRS) { int geomSRID = geometry.getSRID(); - // If the geometry has a SRID and it is not the same as the raster CRS, we need to transform the + // If the geometry has a SRID, and it is not the same as the raster CRS, we need to transform the // geometry // to the raster CRS. // Note that: @@ -635,7 +635,7 @@ public static int getDataTypeCode(String s) { } public static boolean isDataTypeIntegral(int dataTypeCode) { - // returns true if the datatype code refers to an int-like datatype (int, short, etc) + // returns true if the datatype code refers to an int-like datatype (int, short, etc.) switch (dataTypeCode) { case 3: // int case 0: // byte diff --git a/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java b/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java index 3b02263240..f23aa279d8 100644 --- a/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java +++ b/common/src/test/java/org/apache/sedona/common/raster/RasterBandEditorsTest.java @@ -412,7 +412,7 @@ public static void testAddBand4Param(GridCoverage2D fromRaster, GridCoverage2D t assertArrayEquals(expectedBandValues, actualBandValues, 0.1d); // test preservation of original raster - // remove last index as that's number of bands and they wouldn't be equal + // remove last index as that's number of bands, and they wouldn't be equal double[] actualMetadata = Arrays.stream(RasterAccessors.metadata(actualRaster), 0, 9).toArray(); double[] expectedMetadata = Arrays.stream(RasterAccessors.metadata(toRaster), 0, 9).toArray(); assertArrayEquals(expectedMetadata, actualMetadata, 0.1d); @@ -438,7 +438,7 @@ public static void testAddBand3Param(GridCoverage2D fromRaster, GridCoverage2D t assertArrayEquals(expectedBandValues, actualBandValues, 0.1d); // test preservation of original raster - // remove last index as that's number of bands and they wouldn't be equal + // remove last index as that's number of bands, and they wouldn't be equal double[] actualMetadata = Arrays.stream(RasterAccessors.metadata(actualRaster), 0, 9).toArray(); double[] expectedMetadata = Arrays.stream(RasterAccessors.metadata(toRaster), 0, 9).toArray(); assertArrayEquals(expectedMetadata, actualMetadata, 0.1d); @@ -464,7 +464,7 @@ public static void testAddBand2Param(GridCoverage2D fromRaster, GridCoverage2D t assertArrayEquals(expectedBandValues, actualBandValues, 0.1d); // test preservation of original raster - // remove last index as that's number of bands and they wouldn't be equal + // remove last index as that's number of bands, and they wouldn't be equal double[] actualMetadata = Arrays.stream(RasterAccessors.metadata(actualRaster), 0, 9).toArray(); double[] expectedMetadata = Arrays.stream(RasterAccessors.metadata(toRaster), 0, 9).toArray(); assertArrayEquals(expectedMetadata, actualMetadata, 0.1d); diff --git a/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java b/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java index 9f5d3e1d26..378f9783f9 100644 --- a/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java +++ b/common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java @@ -4185,7 +4185,7 @@ private void verifyReprojectMatchResult( } else { // Should match with values retrieved from source raster. The transformed raster may not // have the - // same grid as the source raster so we need to fetch some nearby values from the source + // same grid as the source raster, so we need to fetch some nearby values from the source // raster and // see if any of them matches the transformed value. Please note that this requires us to // use the diff --git a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/boundary/BoundBox.java b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/boundary/BoundBox.java index 8d260ee23d..c77462830a 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/boundary/BoundBox.java +++ b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/boundary/BoundBox.java @@ -45,7 +45,7 @@ public BoundBox(BoundBox otherbox) { this.bounds = otherbox.copyBounds(); } - /** construct a initial boundBox with all value 0 */ + /** construct an initial boundBox with all value 0 */ public BoundBox() { bounds = new double[8]; } diff --git a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShapeSerde.java b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShapeSerde.java index 4e1a77b84b..30ffaeae8a 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShapeSerde.java +++ b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShapeSerde.java @@ -41,7 +41,7 @@ *

First byte contains {@link ShapeType#id}. The rest is type specific. Point: 8 bytes for X * coordinate, followed by 8 bytes for Y coordinate. LineString is serialized as MultiLineString. * MultiLineString: 16 bytes for envelope, 4 bytes for the number of line strings, 4 bytes for total - * number of vertices, 16 * num-vertices for XY coordinates of all the vertices. Polygons is + * number of vertices, 16 * num-vertices for XY coordinates of all the vertices. Polygons are * serialized as MultiPolygon. MultiPolygon: 16 bytes for envelope, 4 bytes for the total number of * exterior and interior rings of all polygons, 4 bytes for total number of vertices, 16 * * num-vertices for XY coordinates of all the vertices. The vertices are written one polygon at a diff --git a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShpFileParser.java b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShpFileParser.java index ffc7fca81e..a1fb476ef1 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShpFileParser.java +++ b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShpFileParser.java @@ -35,7 +35,7 @@ public class ShpFileParser implements Serializable, ShapeFileConst { private long remainLength = 0; /** - * create a new shape file parser with a input source that is instance of DataInputStream + * create a new shape file parser with an input source that is instance of DataInputStream * * @param inputStream */ diff --git a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/CombineShapeReader.java b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/CombineShapeReader.java index ed2904be4a..9414fceab6 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/CombineShapeReader.java +++ b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/shapes/CombineShapeReader.java @@ -86,7 +86,7 @@ public void initialize(InputSplit split, TaskAttemptContext context) paths[i], fileSplit.getOffset(i), fileSplit.getLength(i), fileSplit.getLocations()); } } - // if shape file doesn't exists, throw an IOException + // if shape file doesn't exist, throw an IOException if (shpSplit == null) { throw new IOException("Can't find .shp file."); } else { diff --git a/spark/common/src/main/java/org/apache/sedona/core/joinJudgement/DedupParams.java b/spark/common/src/main/java/org/apache/sedona/core/joinJudgement/DedupParams.java index b30b3df6b3..59ffaaf7f5 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/joinJudgement/DedupParams.java +++ b/spark/common/src/main/java/org/apache/sedona/core/joinJudgement/DedupParams.java @@ -24,7 +24,7 @@ import org.locationtech.jts.geom.Envelope; /** - * Contains information necessary to activate de-dup logic in sub-classes of {@link JudgementBase}. + * Contains information necessary to activate de-dup logic in subclasses of {@link JudgementBase}. */ public final class DedupParams implements Serializable { private final List partitionExtents; diff --git a/spark/common/src/main/java/org/apache/sedona/core/spatialPartitioning/quadtree/StandardQuadTree.java b/spark/common/src/main/java/org/apache/sedona/core/spatialPartitioning/quadtree/StandardQuadTree.java index aeff52f212..21cd45dd0d 100644 --- a/spark/common/src/main/java/org/apache/sedona/core/spatialPartitioning/quadtree/StandardQuadTree.java +++ b/spark/common/src/main/java/org/apache/sedona/core/spatialPartitioning/quadtree/StandardQuadTree.java @@ -39,7 +39,7 @@ public class StandardQuadTree extends PartitioningUtils implements Serializab public static final int REGION_NE = 1; public static final int REGION_SW = 2; public static final int REGION_SE = 3; - // Maximum number of items in any given zone. When reached, a zone is sub-divided. + // Maximum number of items in any given zone. When reached, a zone is subdivided. private final int maxItemsPerZone; private final int maxLevel; private final int level; @@ -48,7 +48,7 @@ public class StandardQuadTree extends PartitioningUtils implements Serializab // current rectangle zone private final QuadRectangle zone; private int nodeNum = 0; - // the four sub regions, + // the four sub-regions, // may be null if not needed private StandardQuadTree[] regions; @@ -224,7 +224,7 @@ private void traverse(Visitor visitor) { /** * Traverses the tree top-down breadth-first and calls the visitor for each node. Stops traversing * if a call to Visitor.visit returns false. lineage will memorize the traversal path for each - * nodes + * node */ private void traverseWithTrace(VisitorWithLineage visitor, String lineage) { if (!visitor.visit(this, lineage)) {