sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1799776 - in /sis/branches/JDK8: core/sis-feature/src/main/java/org/apache/sis/internal/feature/ core/sis-referencing/src/main/java/org/apache/sis/geometry/ core/sis-utility/src/main/java/org/apache/sis/setup/ storage/sis-xmlstore/src/main...
Date Sat, 24 Jun 2017 15:34:10 GMT
Author: desruisseaux
Date: Sat Jun 24 15:34:10 2017
New Revision: 1799776

URL: http://svn.apache.org/viewvc?rev=1799776&view=rev
Log:
Add an option for selecting the geometry implementation.

Added:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/ESRI.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/JTS.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Java2D.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.properties
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources_fr.properties
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/ESRI.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/ESRI.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/ESRI.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/ESRI.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -23,6 +23,7 @@ import com.esri.core.geometry.MultiPath;
 import com.esri.core.geometry.Polyline;
 import com.esri.core.geometry.Point;
 import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.math.Vector;
 
 
@@ -42,7 +43,7 @@ final class ESRI extends Geometries {
      * Creates the singleton instance.
      */
     ESRI() {
-        super(Geometry.class, Point.class);
+        super(GeometryLibrary.ESRI, Geometry.class, Point.class);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Geometries.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -22,6 +22,7 @@ import java.util.logging.LogRecord;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.math.Vector;
 
 
@@ -50,6 +51,11 @@ public abstract class Geometries {
     }
 
     /**
+     * The enumeration that identifies the geometry library used.
+     */
+    public final GeometryLibrary library;
+
+    /**
      * The root geometry class.
      */
     public final Class<?> rootClass;
@@ -72,7 +78,8 @@ public abstract class Geometries {
     /**
      * Creates a new adapter for the given root geometry class.
      */
-    Geometries(final Class<?> rootClass, final Class<?> pointClass) {
+    Geometries(final GeometryLibrary library, final Class<?> rootClass, final Class<?>
pointClass) {
+        this.library    = library;
         this.rootClass  = rootClass;
         this.pointClass = pointClass;
         fallback = implementation;
@@ -99,10 +106,18 @@ public abstract class Geometries {
     /**
      * Returns an accessor to the default geometry library implementation in use.
      *
+     * @param  library  the required library, or {@code null} for the default.
      * @return the default geometry implementation.
+     * @throws IllegalArgumentException if the given library is non-null but not available.
      */
-    public static Geometries implementation() {
-        return implementation;
+    public static Geometries implementation(final GeometryLibrary library) {
+        if (library == null) {
+            return implementation;
+        }
+        for (Geometries g = implementation; g != null; g = g.fallback) {
+            if (g.library == library) return g;
+        }
+        throw new IllegalArgumentException(Resources.format(Resources.Keys.UnavailableGeometryLibrary_1,
library));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/JTS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/JTS.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/JTS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/JTS.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -48,7 +48,8 @@ final class JTS extends Geometries {
      * Creates the singleton instance.
      */
     JTS() throws ClassNotFoundException, NoSuchMethodException {
-        super(Class.forName("com.vividsolutions.jts.geom.Geometry"),
+        super(/*GeometryLibrary.JTS, */ null,                               // TODO
+              Class.forName("com.vividsolutions.jts.geom.Geometry"),
               Class.forName("com.vividsolutions.jts.geom.Point"));
         getEnvelopeInternal = rootClass.getMethod("getEnvelopeInternal", (Class[]) null);
         final Class<?> envt = getEnvelopeInternal.getReturnType();

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Java2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Java2D.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Java2D.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Java2D.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -23,6 +23,7 @@ import java.awt.geom.Path2D;
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.internal.referencing.j2d.ShapeUtilities;
 import org.apache.sis.math.Vector;
 
@@ -43,7 +44,7 @@ final class Java2D extends Geometries {
      * Creates the singleton instance.
      */
     Java2D() {
-        super(Shape.class, Point2D.class);
+        super(GeometryLibrary.JAVA2D, Shape.class, Point2D.class);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -149,6 +149,11 @@ public final class Resources extends Ind
         public static final short PropertyNotFound_2 = 16;
 
         /**
+         * The {0} geometry library is not available in current runtime environment.
+         */
+        public static final short UnavailableGeometryLibrary_1 = 21;
+
+        /**
          * The “{1}” value given to “{0}” property should be separable in {2} components,
but we got
          * {3}.
          */

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.properties?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources.properties
[ISO-8859-1] Sat Jun 24 15:34:10 2017
@@ -36,6 +36,7 @@ NotASingleton_1                   = Prop
 OptionalLibraryNotFound_2         = The {0} optional library is not available. Geometric
operations will ignore that library.\nCause is {1}.
 PropertyAlreadyExists_2           = Property \u201c{1}\u201d already exists in feature \u201c{0}\u201d.
 PropertyNotFound_2                = No property named \u201c{1}\u201d has been found in \u201c{0}\u201d
feature.
+UnavailableGeometryLibrary_1      = The {0} geometry library is not available in current
runtime environment.
 UnexpectedNumberOfComponents_4    = The \u201c{1}\u201d value given to \u201c{0}\u201d property
should be separable in {2} components, but we got {3}.
 UnresolvedFeatureName_1           = Feature named \u201c{0}\u201d has not yet been resolved.
 UnsupportedGeometryObject_1       = Unsupported geometry {0}D object.

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources_fr.properties?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/internal/feature/Resources_fr.properties
[ISO-8859-1] Sat Jun 24 15:34:10 2017
@@ -41,6 +41,7 @@ NotASingleton_1                   = La p
 OptionalLibraryNotFound_2         = La biblioth\u00e8que optionnelle {0} n\u2019est pas disponible.
Les op\u00e9rations g\u00e9om\u00e9triques ignoreront cette biblioth\u00e8que.\nLa cause est
{1}.
 PropertyNotFound_2                = Aucune propri\u00e9t\u00e9 nomm\u00e9e \u00ab\u202f{1}\u202f\u00bb
n\u2019a \u00e9t\u00e9 trouv\u00e9e dans l\u2019entit\u00e9 \u00ab\u202f{0}\u202f\u00bb.
 PropertyAlreadyExists_2           = La propri\u00e9t\u00e9 \u00ab\u202f{1}\u202f\u00bb existe
d\u00e9j\u00e0 dans l\u2019entit\u00e9 \u00ab\u202f{0}\u202f\u00bb.
+UnavailableGeometryLibrary_1      = La biblioth\u00e8que de g\u00e9om\u00e9tries {0} n\u2019est
pas disponible dans l\u2019environnement d\u2019ex\u00e9cution actuel.
 UnexpectedNumberOfComponents_4    = La valeur \u00ab\u202f{1}\u202f\u00bb donn\u00e9e \u00e0
la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb devrait \u00eatre s\u00e9parable en {2}
composantes, mais on en a obtenus {3}.
 UnresolvedFeatureName_1           = L\u2019entit\u00e9 nomm\u00e9e \u00ab\u202f{0}\u202f\u00bb
n\u2019a pas encore \u00e9t\u00e9 r\u00e9solue.
 UnsupportedGeometryObject_1       = Object g\u00e9om\u00e9trique {0}D non-support\u00e9.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -81,6 +81,8 @@
  *       than an inclusion area.</li>
  * </ul>
  *
+ * @see org.apache.sis.setup.GeometryLibrary
+ *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @version 0.8
  * @since   0.3

Added: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java?rev=1799776&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
(added)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.setup;
+
+
+/**
+ * Some libraries providing geometric objects or topological operations.
+ * Apache SIS uses its own implementation for the most basic objects like
+ * {@linkplain org.apache.sis.geometry.GeneralDirectPosition direct positions} and
+ * {@linkplain org.apache.sis.geometry.GeneralEnvelope envelopes},
+ * and can delegate to one of the enumerated libraries for more complex geometries.
+ * All those libraries are optional.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ *
+ * @see OptionKey#GEOMETRY_LIBRARY
+ *
+ * @since 0.8
+ * @module
+ */
+public enum GeometryLibrary {
+    /**
+     * The Java Topology Suite (JTS) library. This open source library provides an object
model
+     * for Euclidean planar geometry together with a set of fundamental geometric functions.
+     *
+     * <ul>
+     *   <li><b>Package name:</b> {@code com.vividsolutions.jts.geom}</li>
+     *   <li><b>Web site:</b> <a href="http://locationtech.github.io/jts/">http://locationtech.github.io/jts/</a></li>
+     *   <li><b>License:</b> LGPL prior JTS 1.14, Eclipse Distribution
License afterward.</li>
+     * </ul>
+     */
+//  JTS,
+
+    /**
+     * The ESRI geometry API library. This library can be used for spatial vector data processing.
+     * It is used in ESRI GIS Tools for Hadoop and has an Android port.
+     *
+     * <ul>
+     *   <li><b>Package name:</b> {@code com.esri.core.geometry}</li>
+     *   <li><b>Web site:</b> <a href="https://github.com/Esri/geometry-api-java/wiki">https://github.com/Esri/geometry-api-java/wiki</a></li>
+     *   <li><b>License:</b> Apache 2.</li>
+     * </ul>
+     */
+    ESRI,
+
+    /**
+     * The Java 2D Graphics and Imaging library. This library does not provide as many topological
operations
+     * than other libraries, but is available on most standard Java environments and constitute
a reliable
+     * fallback when no other library is available.
+     *
+     * <ul>
+     *   <li><b>Package name:</b> {@code java.awt.geom}</li>
+     *   <li><b>Web site:</b> <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/2d/index.html">http://docs.oracle.com/javase/8/docs/technotes/guides/2d/index.html</a></li>
+     *   <li><b>License:</b> GPL with classpath exception.</li>
+     * </ul>
+     */
+    JAVA2D
+}

Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/GeometryLibrary.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java [UTF-8]
Sat Jun 24 15:34:10 2017
@@ -75,6 +75,16 @@ public class OptionKey<T> implements Ser
     private static final long serialVersionUID = -7580514229639750246L;
 
     /**
+     * The library to use for creating geometric objects at reading time.
+     * Some libraries are the Java Topology Suite (JTS), ESRI geometry API and Java2D.
+     * If this option is not specified, then a library will be selected automatically
+     * among the libraries available in the runtime environment.
+     *
+     * @since 0.8
+     */
+    public static final OptionKey<GeometryLibrary> GEOMETRY_LIBRARY = new OptionKey<>("GEOMETRY_LIBRARY",
GeometryLibrary.class);
+
+    /**
      * The locale to use for locale-sensitive data. This option determines the language to
use for writing
      * {@link org.apache.sis.util.iso.AbstractInternationalString international strings}
when the target
      * storage support only one language. It may also control number and date patterns in
some file formats

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -17,6 +17,8 @@
 package org.apache.sis.internal.storage.gpx;
 
 import java.net.URISyntaxException;
+import org.opengis.util.NameFactory;
+import org.opengis.util.FactoryException;
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.distribution.Format;
 import org.apache.sis.storage.StorageConnector;
@@ -24,10 +26,14 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.storage.ConcurrentReadException;
 import org.apache.sis.storage.IllegalNameException;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.storage.xml.stream.StaxDataStore;
 import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Version;
+import org.apache.sis.setup.OptionKey;
+import org.apache.sis.setup.GeometryLibrary;
+import org.apache.sis.util.iso.DefaultNameFactory;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.metadata.iso.distribution.DefaultFormat;
@@ -84,7 +90,14 @@ public final class Store extends StaxDat
      */
     public Store(final StoreProvider provider, final StorageConnector connector) throws DataStoreException
{
         super(provider, connector);
-        types = Types.DEFAULT;
+        final GeometryLibrary library = connector.getOption(OptionKey.GEOMETRY_LIBRARY);
+        if (library == null || Types.DEFAULT.geometries.library == library) {
+            types = Types.DEFAULT;
+        } else try {
+            types = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class),
null, library);
+        } catch (FactoryException e) {
+            throw new DataStoreException(e);
+        }
     }
 
     /**

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java?rev=1799776&r1=1799775&r2=1799776&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
[UTF-8] Sat Jun 24 15:34:10 2017
@@ -26,6 +26,7 @@ import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
+import org.apache.sis.setup.GeometryLibrary;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.content.ContentInformation;
 import org.apache.sis.storage.gps.Fix;
@@ -104,7 +105,7 @@ final class Types {
     static final Types DEFAULT;
     static {
         try {
-            DEFAULT = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class),
null);
+            DEFAULT = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class),
null, null);
         } catch (FactoryException | IllegalNameException e) {
             throw new AssertionError(e);        // Should never happen with DefaultNameFactory
implementation.
         }
@@ -115,10 +116,13 @@ final class Types {
      *
      * @param  factory   the factory to use for creating names, or {@code null} for the default
factory.
      * @param  locale    the locale to use for formatting error messages, or {@code null}
for the default locale.
+     * @param  library   the required geometry library, or {@code null} for the default.
      * @throws FactoryException if an error occurred while creating an "envelope bounds"
operation.
      */
-    Types(final NameFactory factory, final Locale locale) throws FactoryException, IllegalNameException
{
-        geometries = Geometries.implementation();
+    Types(final NameFactory factory, final Locale locale, final GeometryLibrary library)
+            throws FactoryException, IllegalNameException
+    {
+        geometries = Geometries.implementation(library);
         final Map<String,InternationalString[]> resources = new HashMap<>();
         final ScopedName    geomName = AttributeConvention.GEOMETRY_PROPERTY;
         final Map<String,?> geomInfo = Collections.singletonMap(AbstractIdentifiedType.NAME_KEY,
geomName);



Mime
View raw message