Skip to content

Commit

Permalink
HHH-12144 - Upgrade JTS spatial library to 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
maesenka committed Sep 19, 2018
1 parent a9fd8ef commit b3e56a5
Show file tree
Hide file tree
Showing 31 changed files with 90 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ create transform for db2gse.st_geometry db2_program (
Hibernate Spatial comes with the following types:

jts_geometry::
Handled by `org.hibernate.spatial.JTSGeometryType` it maps a database geometry column type to a `com.vividsolutions.jts.geom.Geometry` entity property type.
Handled by `org.hibernate.spatial.JTSGeometryType` it maps a database geometry column type to a `org.locationtech.jts.geom.Geometry` entity property type.
geolatte_geometry::
Handled by `org.hibernate.spatial.GeolatteGeometryType`, it maps a database geometry column type to an `org.geolatte.geom.Geometry` entity property type.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import org.hibernate.testing.RequiresDialect;
import org.junit.Test;

import com.vividsolutions.jts.geom.Coordinate;
import org.locationtech.jts.geom.Coordinate;
//tag::spatial-types-mapping-example[]
import com.vividsolutions.jts.geom.Point;
import org.locationtech.jts.geom.Point;

//end::spatial-types-mapping-example[]
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.Polygon;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Polygon;

import static org.junit.Assert.assertEquals;

Expand Down
2 changes: 1 addition & 1 deletion gradle/libraries.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ext {
javassistVersion = '3.23.1-GA'
byteBuddyVersion = '1.8.17' // Now with JDK10 compatibility and preliminary support for JDK11

geolatteVersion = '1.3.0'
geolatteVersion = '1.4.0'

// Wildfly version targeted by module ZIP; Arquillian/Shrinkwrap versions used for CDI testing and testing the module ZIP
wildflyVersion = '13.0.0.Final'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public <X> X unwrap(Geometry value, Class<X> type, WrapperOptions options) {
return (X) value;
}

if ( com.vividsolutions.jts.geom.Geometry.class.isAssignableFrom( type ) ) {
if ( org.locationtech.jts.geom.Geometry.class.isAssignableFrom( type ) ) {
return (X) JTS.to( value );
}

Expand All @@ -85,8 +85,8 @@ public <X> Geometry wrap(X value, WrapperOptions options) {
return fromString( (String) value );
}

if ( com.vividsolutions.jts.geom.Geometry.class.isInstance( value ) ) {
return JTS.from( (com.vividsolutions.jts.geom.Geometry) value );
if ( org.locationtech.jts.geom.Geometry.class.isInstance( value ) ) {
return JTS.from( (org.locationtech.jts.geom.Geometry) value );
}

throw unknownWrap( value.getClass() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
import org.geolatte.geom.jts.JTS;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

/**
* A {@code Type} that maps between the database geometry type and JTS {@code Geometry}.
Expand All @@ -30,14 +30,14 @@ public JTSGeometryType(SqlTypeDescriptor sqlTypeDescriptor) {
@Override
public String[] getRegistrationKeys() {
return new String[] {
com.vividsolutions.jts.geom.Geometry.class.getCanonicalName(),
com.vividsolutions.jts.geom.Point.class.getCanonicalName(),
com.vividsolutions.jts.geom.Polygon.class.getCanonicalName(),
com.vividsolutions.jts.geom.MultiPolygon.class.getCanonicalName(),
com.vividsolutions.jts.geom.LineString.class.getCanonicalName(),
com.vividsolutions.jts.geom.MultiLineString.class.getCanonicalName(),
com.vividsolutions.jts.geom.MultiPoint.class.getCanonicalName(),
com.vividsolutions.jts.geom.GeometryCollection.class.getCanonicalName(),
org.locationtech.jts.geom.Geometry.class.getCanonicalName(),
org.locationtech.jts.geom.Point.class.getCanonicalName(),
org.locationtech.jts.geom.Polygon.class.getCanonicalName(),
org.locationtech.jts.geom.MultiPolygon.class.getCanonicalName(),
org.locationtech.jts.geom.LineString.class.getCanonicalName(),
org.locationtech.jts.geom.MultiLineString.class.getCanonicalName(),
org.locationtech.jts.geom.MultiPoint.class.getCanonicalName(),
org.locationtech.jts.geom.GeometryCollection.class.getCanonicalName(),
"jts_geometry"
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect;
import org.hibernate.type.StandardBasicTypes;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

/**
* A {@code Criterion} constraining a geometry property to be within a specified distance of a search geometry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import org.hibernate.spatial.SpatialDialect;
import org.hibernate.spatial.jts.EnvelopeAdapter;

import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;

/**
* A <code>Criterion</code> constraining a geometry property to have a bounding box that overlaps with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.hibernate.engine.spi.TypedValue;
import org.hibernate.spatial.SpatialDialect;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

/**
* A {@code Criterion} constraining a {@code Geometry} property to have specific spatial relation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.spatial.SpatialRelation;

import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;

/**
* A factory for spatial criteria.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public static Geometry from(Object object) {
}
try {

if ( object instanceof com.vividsolutions.jts.geom.Geometry ) {
return JTS.from( (com.vividsolutions.jts.geom.Geometry) object );
if ( object instanceof org.locationtech.jts.geom.Geometry ) {
return JTS.from( (org.locationtech.jts.geom.Geometry) object );
}
final WkbDecoder decoder = Wkb.newDecoder( Wkb.Dialect.POSTGIS_EWKB_1 );
if ( object instanceof Blob ) {
Expand All @@ -86,8 +86,8 @@ public static Geometry from(Object object) {
else if ( object instanceof byte[] ) {
return decoder.decode( ByteBuffer.from( (byte[]) object ) );
}
else if ( object instanceof com.vividsolutions.jts.geom.Envelope ) {
return toPolygon( JTS.from( (com.vividsolutions.jts.geom.Envelope) object ) );
else if ( object instanceof org.locationtech.jts.geom.Envelope ) {
return toPolygon( JTS.from( (org.locationtech.jts.geom.Envelope) object ) );
}
else {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.engine.spi.TypedValue;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

/**
* A static factory class for spatial criteria using the Oracle Spatial native spatial operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*/
package org.hibernate.spatial.jts;

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Polygon;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.LinearRing;
import org.locationtech.jts.geom.Polygon;

/**
* Converts an {@code Envelope} to a {@code Polygon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import org.jboss.logging.Logger;
import org.junit.Test;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.io.WKBWriter;
import com.vividsolutions.jts.io.WKTWriter;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.io.WKBWriter;
import org.locationtech.jts.io.WKTWriter;

@RequiresDialect(value = HANASpatialDialect.class, comment = "This test tests the HANA spatial functions not covered by Hibernate Spatial", jiraKey = "HHH-12426")
public class TestHANASpatialFunctions extends TestSpatialFunctions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import org.jboss.logging.Logger;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

import static java.lang.String.format;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import org.hibernate.spatial.integration.GeomEntityLike;
import org.hibernate.spatial.testing.TestDataElement;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;
import org.geolatte.geom.codec.WktDecoder;
import org.geolatte.geom.jts.JTS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import org.jboss.logging.Logger;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;

/**
* This testsuite-suite class verifies whether the <code>Geometry</code>s retrieved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

import org.jboss.logging.Logger;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;

/**
* An <code>AbstractExpectationsFactory</code> provides the expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

package org.hibernate.spatial.testing;

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryCollection;

/**
* This class tests for the equality between geometries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.hibernate.testing.AfterClassOnce;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;

import com.vividsolutions.jts.geom.Geometry;
import org.locationtech.jts.geom.Geometry;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.NativeSQLStatement;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.geolatte.geom.jts.JTS;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.NativeSQLStatement;

import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.geolatte.geom.jts.JTS;


Expand Down Expand Up @@ -115,7 +115,7 @@ protected NativeSQLStatement createNativeHavingSRIDStatement(int srid) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeDistanceStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeDistanceStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -142,7 +142,7 @@ protected NativeSQLStatement createNativeEnvelopeStatement() {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeEqualsStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeEqualsStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -157,7 +157,7 @@ protected NativeSQLStatement createNativeEqualsStatement(Geometry geom) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeFilterStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeFilterStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -171,7 +171,7 @@ protected NativeSQLStatement createNativeFilterStatement(Geometry geom) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeGeomUnionStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeGeomUnionStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -198,7 +198,7 @@ protected NativeSQLStatement createNativeGeometryTypeStatement() {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeIntersectionStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeIntersectionStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -213,7 +213,7 @@ protected NativeSQLStatement createNativeIntersectionStatement(Geometry geom) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeIntersectsStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeIntersectsStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand Down Expand Up @@ -257,7 +257,7 @@ protected NativeSQLStatement createNativeIsSimpleStatement() {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeOverlapsStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeOverlapsStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -272,7 +272,7 @@ protected NativeSQLStatement createNativeOverlapsStatement(Geometry geom) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeRelateStatement(com.vividsolutions.jts.geom.Geometry,
* createNativeRelateStatement(org.locationtech.jts.geom.Geometry,
* java.lang.String)
*/

Expand Down Expand Up @@ -311,7 +311,7 @@ protected NativeSQLStatement createNativeSridStatement() {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeSymDifferenceStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeSymDifferenceStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -327,7 +327,7 @@ protected NativeSQLStatement createNativeSymDifferenceStatement(
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeTouchesStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeTouchesStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand All @@ -342,7 +342,7 @@ protected NativeSQLStatement createNativeTouchesStatement(Geometry geom) {
* (non-Javadoc)
*
* @seeorg.hibernatespatial.test.AbstractExpectationsFactory#
* createNativeWithinStatement(com.vividsolutions.jts.geom.Geometry)
* createNativeWithinStatement(org.locationtech.jts.geom.Geometry)
*/

@Override
Expand Down
Loading

0 comments on commit b3e56a5

Please sign in to comment.