This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new df8c4d966c Superficial reformatting of shapefile commit before merge.
df8c4d966c is described below

commit df8c4d966c6f75c0b62df6b37fb68fbbc5cc2919
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Nov 6 11:51:31 2023 +0100

    Superficial reformatting of shapefile commit before merge.
---
 .../org.apache.sis.feature/main/module-info.java    |  2 +-
 .../src/org.apache.sis.util/main/module-info.java   |  2 +-
 .../sis/storage/shapefile/ShapefileProvider.java    | 21 ++++++++++-----------
 .../sis/storage/shapefile/ShapefileStore.java       | 21 ++++++++++++---------
 .../storage/shapefile/shp/ShapeGeometryEncoder.java |  4 ++--
 .../sis/storage/shapefile/shx/IndexReader.java      |  1 +
 .../sis/storage/shapefile/ShapefileStoreTest.java   | 20 +++++++++-----------
 7 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/endorsed/src/org.apache.sis.feature/main/module-info.java 
b/endorsed/src/org.apache.sis.feature/main/module-info.java
index b9f78b899c..2c55dac851 100644
--- a/endorsed/src/org.apache.sis.feature/main/module-info.java
+++ b/endorsed/src/org.apache.sis.feature/main/module-info.java
@@ -51,8 +51,8 @@ module org.apache.sis.feature {
             org.apache.sis.storage,
             org.apache.sis.storage.xml,
             org.apache.sis.storage.netcdf,
+            org.apache.sis.storage.shapefile,       // In the "incubator" 
sub-project.
             org.apache.sis.portrayal,
-            org.apache.sis.storage.shapefile,        // In the "incubator" 
sub-project.
             org.apache.sis.gui;                     // In the "optional" 
sub-project.
 
     exports org.apache.sis.geometry.wrapper to
diff --git a/endorsed/src/org.apache.sis.util/main/module-info.java 
b/endorsed/src/org.apache.sis.util/main/module-info.java
index ed334ac345..afebada7be 100644
--- a/endorsed/src/org.apache.sis.util/main/module-info.java
+++ b/endorsed/src/org.apache.sis.util/main/module-info.java
@@ -127,9 +127,9 @@ module org.apache.sis.util {
             org.apache.sis.storage.netcdf,
             org.apache.sis.storage.geotiff,
             org.apache.sis.storage.earthobservation,
+            org.apache.sis.storage.shapefile,           // In the "incubator" 
sub-project.
             org.apache.sis.cql,                         // In the "incubator" 
sub-project.
             org.apache.sis.portrayal,
-            org.apache.sis.storage.shapefile,
             org.apache.sis.cloud.aws,
             org.apache.sis.console,
             org.apache.sis.gui,                         // In the "optional" 
sub-project.
diff --git 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileProvider.java
 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileProvider.java
index 3d371337a3..1420cef0e8 100644
--- 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileProvider.java
+++ 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileProvider.java
@@ -18,28 +18,28 @@ package org.apache.sis.storage.shapefile;
 
 import java.net.URI;
 import java.nio.file.Path;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreProvider;
-import static org.apache.sis.storage.DataStoreProvider.LOCATION;
 import org.apache.sis.storage.ProbeResult;
 import org.apache.sis.storage.StorageConnector;
-import org.opengis.parameter.ParameterDescriptor;
-import org.opengis.parameter.ParameterDescriptorGroup;
+
 
 /**
  * Shapefile format datastore provider.
- * 
+ *
  * @author Johann Sorel (Geomatys)
  * @see <a 
href="http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf";>ESRI 
Shapefile Specification</a>
  */
 public final class ShapefileProvider extends DataStoreProvider {
 
     public static final String NAME = "Shapefile";
-    
+
     public static final String MIME_TYPE = "application/x-shapefile";
-    
+
     /**
      * URI to the shp file.
      */
@@ -47,14 +47,14 @@ public final class ShapefileProvider extends 
DataStoreProvider {
             .addName(LOCATION)
             .setRequired(true)
             .create(URI.class, null);
-    
+
     public static final ParameterDescriptorGroup PARAMETERS_DESCRIPTOR =
             new 
ParameterBuilder().addName(NAME).addName("ShapefileParameters").createGroup(
                 PATH);
-    
-    public ShapefileProvider() {        
+
+    public ShapefileProvider() {
     }
-    
+
     @Override
     public String getShortName() {
         return NAME;
@@ -79,5 +79,4 @@ public final class ShapefileProvider extends 
DataStoreProvider {
         final Path path = connector.getStorageAs(Path.class);
         return new ShapefileStore(path);
     }
-    
 }
diff --git 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java
 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java
index 03aa111d42..33c46f120d 100644
--- 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java
+++ 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java
@@ -36,6 +36,12 @@ import java.util.function.Predicate;
 import java.util.function.UnaryOperator;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
+import org.opengis.geometry.Envelope;
+import org.opengis.metadata.Metadata;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 import org.apache.sis.feature.builder.AttributeRole;
 import org.apache.sis.feature.builder.AttributeTypeBuilder;
 import org.apache.sis.feature.builder.FeatureTypeBuilder;
@@ -62,18 +68,15 @@ import org.apache.sis.storage.shapefile.shp.ShapeHeader;
 import org.apache.sis.storage.shapefile.shp.ShapeReader;
 import org.apache.sis.storage.shapefile.shp.ShapeRecord;
 import org.apache.sis.util.collection.BackingStoreException;
+
+// Specific to the geoapi-3.1 and geoapi-4.0 branches:
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
-import org.opengis.geometry.Envelope;
-import org.opengis.metadata.Metadata;
-import org.opengis.parameter.ParameterValueGroup;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.util.FactoryException;
-import org.opengis.util.GenericName;
+
 
 /**
  * Shapefile datastore.
- * 
+ *
  * @author Johann Sorel (Geomatys)
  */
 public final class ShapefileStore extends DataStore implements FeatureSet {
@@ -85,10 +88,10 @@ public final class ShapefileStore extends DataStore 
implements FeatureSet {
     /**
      * Internal class to inherit AbstractFeatureSet.
      */
-    private final AsFeatureSet featureSetView = new AsFeatureSet();    
+    private final AsFeatureSet featureSetView = new AsFeatureSet();
     private FeatureType type;
     private Charset charset;
-    
+
     /**
      * Lock to control read and write operations.
      */
diff --git 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shp/ShapeGeometryEncoder.java
 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shp/ShapeGeometryEncoder.java
index 853bd16391..1f122301fb 100644
--- 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shp/ShapeGeometryEncoder.java
+++ 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shp/ShapeGeometryEncoder.java
@@ -29,6 +29,7 @@ import 
org.locationtech.jts.geom.impl.PackedCoordinateSequence;
 import org.locationtech.jts.algorithm.Orientation;
 import org.locationtech.jts.algorithm.RayCrossingCounter;
 
+
 /**
  * Encoders and decoders for shape types.
  * This class should be kept separate because I might be used in ESRI 
geodatabase format.
@@ -92,7 +93,7 @@ public abstract class ShapeGeometryEncoder<T extends 
Geometry> {
     public int getShapeType() {
         return shapeType;
     }
-    
+
     /**
      * @return geometry class handled by this encoder
      */
@@ -673,5 +674,4 @@ public abstract class ShapeGeometryEncoder<T extends 
Geometry> {
             throw new UnsupportedOperationException("Not supported yet.");
         }
     }
-
 }
diff --git 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shx/IndexReader.java
 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shx/IndexReader.java
index 2e02455a92..71132aeb53 100644
--- 
a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shx/IndexReader.java
+++ 
b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/shx/IndexReader.java
@@ -22,6 +22,7 @@ import org.apache.sis.io.stream.ChannelDataInput;
 import java.io.EOFException;
 import java.io.IOException;
 
+
 /**
  * Seekable shx index file reader.
  *
diff --git 
a/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java
 
b/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java
index d8d1503736..0cdb00b890 100644
--- 
a/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java
+++ 
b/incubator/src/org.apache.sis.storage.shapefile/test/org/apache/sis/storage/shapefile/ShapefileStoreTest.java
@@ -24,13 +24,14 @@ import java.util.Iterator;
 import java.util.stream.Stream;
 import static org.junit.jupiter.api.Assertions.*;
 import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.shapefile.shp.ShapeIOTest;
 import org.junit.Test;
 import org.locationtech.jts.geom.Point;
+
+// Specific to the geoapi-3.1 and geoapi-4.0 branches:
 import org.opengis.feature.AttributeType;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
-import org.opengis.feature.PropertyType;
+
 
 /**
  *
@@ -50,12 +51,12 @@ public class ShapefileStoreTest {
         assertNotNull(type.getProperty("sis:identifier"));
         assertNotNull(type.getProperty("sis:envelope"));
         assertNotNull(type.getProperty("sis:geometry"));
-        final AttributeType geomProp = (AttributeType) 
type.getProperty("geometry");
-        final AttributeType idProp = (AttributeType) type.getProperty("id");
-        final AttributeType textProp = (AttributeType) 
type.getProperty("text");
-        final AttributeType integerProp = (AttributeType) 
type.getProperty("integer");
-        final AttributeType floatProp = (AttributeType) 
type.getProperty("float");
-        final AttributeType dateProp = (AttributeType) 
type.getProperty("date");
+        final var geomProp    = (AttributeType) type.getProperty("geometry");
+        final var idProp      = (AttributeType) type.getProperty("id");
+        final var textProp    = (AttributeType) type.getProperty("text");
+        final var integerProp = (AttributeType) type.getProperty("integer");
+        final var floatProp   = (AttributeType) type.getProperty("float");
+        final var dateProp    = (AttributeType) type.getProperty("date");
         assertEquals(Point.class, geomProp.getValueClass());
         assertEquals(Long.class, idProp.getValueClass());
         assertEquals(String.class, textProp.getValueClass());
@@ -83,10 +84,7 @@ public class ShapefileStoreTest {
             assertEquals(LocalDate.of(2023, 10, 28), 
feature2.getPropertyValue("date"));
             Point pt2 = (Point) feature2.getPropertyValue("geometry");
 
-            
             assertFalse(iterator.hasNext());
         }
-
     }
-
 }

Reply via email to