[Git][debian-gis-team/jts][upstream] New upstream version 1.16.0+ds
Bas Couwenberg
gitlab at salsa.debian.org
Wed Sep 19 06:28:21 BST 2018
Bas Couwenberg pushed to branch upstream at Debian GIS Project / jts
Commits:
0d00e044 by Bas Couwenberg at 2018-09-19T04:56:33Z
New upstream version 1.16.0+ds
- - - - -
18 changed files:
- RELEASING.md
- modules/app/pom.xml
- modules/core/pom.xml
- modules/core/src/main/java/org/locationtech/jts/JTSVersion.java
- modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequence.java
- modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java
- modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java
- modules/core/src/test/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceTest.java
- + modules/core/src/test/java/org/locationtech/jts/io/WKTWriterStaticFnTest.java
- modules/example/pom.xml
- modules/io/common/pom.xml
- modules/io/ora/pom.xml
- modules/io/pom.xml
- modules/io/sde/pom.xml
- modules/lab/pom.xml
- modules/pom.xml
- modules/tests/pom.xml
- pom.xml
Changes:
=====================================
RELEASING.md
=====================================
@@ -5,11 +5,13 @@ to assist them in preparing releases of the project.
## Release Checklist
-* Set the version number in the following artifacts:
- * Maven POMs
- * Java class `JTSVersion`
* Create a Release Milestone, and tag it to Issues and PRs wanted in the release
* Confirm Maven build executes with no errors
-* Review scripts in `bin` to confirm correctness
* Update the Version History, to record significant changes
+* Set the version number in the following artifacts:
+ * Java class `JTSVersion`
+ * Maven POMs (using the Maven release plugin)
+* Review scripts in `bin` to confirm correctness
+* Review and update the release notes
+* Release to Maven central with the release property and profile ("mvn clean install -Drelease")
=====================================
modules/app/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-app</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/core/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-core</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/core/src/main/java/org/locationtech/jts/JTSVersion.java
=====================================
@@ -46,7 +46,7 @@ public class JTSVersion {
/**
* An optional string providing further release info (such as "alpha 1");
*/
- private static final String releaseInfo = "RC1";
+ private static final String releaseInfo = "";
/**
* Prints the current JTS version to stdout.
=====================================
modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequence.java
=====================================
@@ -198,7 +198,7 @@ public interface CoordinateSequence
* Returns ordinate M of the specified coordinate if available.
*
* @param index
- * @return the value of the Z ordinate in the index'th coordinate, or Double.NaN if not defined.
+ * @return the value of the M ordinate in the index'th coordinate, or Double.NaN if not defined.
*/
default double getM(int index)
{
=====================================
modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java
=====================================
@@ -72,28 +72,29 @@ public final class CoordinateArraySequenceFactory
if (dimension > 3)
dimension = 3;
//throw new IllegalArgumentException("dimension must be <= 3");
+
// handle bogus dimension
if (dimension < 2)
- // TODO: change to dimension = 2 ???
- return new CoordinateArraySequence(size);
+ dimension = 2;
+
return new CoordinateArraySequence(size, dimension);
}
public CoordinateSequence create(int size, int dimension, int measures) {
- if (dimension > 4) {
- dimension = 4;
- //throw new IllegalArgumentException("dimension must be <= 4");
- }
+ int spatial = dimension - measures;
+
if (measures > 1) {
- measures = 1;
+ measures = 1; // clip measures
//throw new IllegalArgumentException("measures must be <= 1");
}
- if (dimension < 2)
- dimension = 2; // handle bogus dimension
- if (dimension - measures < 2) {
- throw new IllegalArgumentException("Minimum spatial dimension of 2 required. Input was dimension " + dimension
- + "and number of measures " + measures + ".");
+ if ((spatial) > 3) {
+ spatial = 3; // clip spatial dimension
+ //throw new IllegalArgumentException("spatial dimension must be <= 3");
}
- return new CoordinateArraySequence(size, dimension, measures);
+
+ if (spatial < 2)
+ spatial = 2; // handle bogus spatial dimension
+
+ return new CoordinateArraySequence(size, spatial+measures, measures);
}
}
\ No newline at end of file
=====================================
modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java
=====================================
@@ -18,9 +18,21 @@ import java.io.Writer;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.EnumSet;
-import java.util.Locale;
-import org.locationtech.jts.geom.*;
+import org.locationtech.jts.geom.PrecisionModel;
+import org.locationtech.jts.geom.Coordinate;
+import org.locationtech.jts.geom.CoordinateSequence;
+import org.locationtech.jts.geom.CoordinateSequenceFilter;
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.geom.Point;
+import org.locationtech.jts.geom.LineString;
+import org.locationtech.jts.geom.LinearRing;
+import org.locationtech.jts.geom.Polygon;
+import org.locationtech.jts.geom.MultiPoint;
+import org.locationtech.jts.geom.MultiLineString;
+import org.locationtech.jts.geom.MultiPolygon;
+import org.locationtech.jts.geom.GeometryCollection;
+
import org.locationtech.jts.util.Assert;
/**
@@ -78,13 +90,13 @@ public class WKTWriter
for (int i = 0; i < seq.size(); i++) {
if (i > 0)
buf.append(", ");
- buf.append(String.format(Locale.US, "%1$G %2$G", seq.getX(i), seq.getY(i)));
+ buf.append(seq.getX(i) + " " + seq.getY(i));
}
buf.append(")");
}
return buf.toString();
}
-
+
/**
* Generates the WKT for a <tt>LINESTRING</tt>
* specified by a {@link CoordinateSequence}.
@@ -104,7 +116,7 @@ public class WKTWriter
for (int i = 0; i < coord.length; i++) {
if (i > 0)
buf.append(", ");
- buf.append(String.format(Locale.US, "%1$G %2$G", coord[i].x, coord[i].y));
+ buf.append(coord[i].x + " " + coord[i].y);
}
buf.append(")");
}
=====================================
modules/core/src/test/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceTest.java
=====================================
@@ -39,10 +39,54 @@ public class CoordinateArraySequenceTest
}
@Override
- CoordinateSequenceFactory getCSFactory() {
+ CoordinateArraySequenceFactory getCSFactory() {
return CoordinateArraySequenceFactory.instance();
}
+ public void testFactoryLimits() {
+ // Expected to clip dimension and measure value within factory limits
+
+ CoordinateArraySequenceFactory factory = getCSFactory();
+ CoordinateSequence sequence = factory.create(10, 4);
+ assertEquals("clipped dimension 3", 3, sequence.getDimension());
+ assertEquals("default measure 0", 0, sequence.getMeasures());
+ assertTrue(sequence.hasZ());
+ assertTrue(!sequence.hasM());
+
+ sequence = factory.create(10, 4, 0);
+ assertEquals("clipped dimension 3", 3, sequence.getDimension());
+ assertEquals("provided measure 0", 0, sequence.getMeasures());
+ assertTrue(sequence.hasZ());
+ assertTrue(!sequence.hasM());
+
+ sequence = factory.create(10, 4, 2); // note clip to spatial dimension
+ assertEquals("clipped dimension 3", 3, sequence.getDimension());
+ assertEquals("clipped measure 1", 1, sequence.getMeasures());
+ assertTrue(!sequence.hasZ());
+ assertTrue(sequence.hasM());
+
+ sequence = factory.create(10, 5, 1);
+ assertEquals("clipped dimension 3", 4, sequence.getDimension());
+ assertEquals("provided measure 1", 1, sequence.getMeasures());
+ assertTrue(sequence.hasZ());
+ assertTrue(sequence.hasM());
+
+ // previously this clipped to dimension 3, measure 3
+ sequence = factory.create(10, 1);
+ assertEquals("clipped dimension 2", 2, sequence.getDimension());
+ assertEquals("default measure 0", 0, sequence.getMeasures());
+ assertTrue(!sequence.hasZ());
+ assertTrue(!sequence.hasM());
+
+ sequence = factory.create(10, 2, 1);
+ assertEquals("clipped dimension 3", 3, sequence.getDimension());
+ assertEquals("provided measure 1", 1, sequence.getMeasures());
+ assertTrue(!sequence.hasZ());
+ assertTrue(sequence.hasM());
+ }
+
+
+
public void testDimensionAndMeasure()
{
CoordinateSequenceFactory factory = getCSFactory();
@@ -122,13 +166,10 @@ public class CoordinateArraySequenceTest
copy = factory.create(seq);
assertTrue(isEqual(copy,array));
- try {
- seq = factory.create(5, 2, 1);
- assertEquals(3,seq.getDimension());
- assertEquals(1,seq.getMeasures());
- fail("xm not supported");
- } catch (IllegalArgumentException expected) {
- }
+ // dimensions clipped from XM to XYM
+ seq = factory.create(5, 2, 1);
+ assertEquals(3,seq.getDimension());
+ assertEquals(1,seq.getMeasures());
}
public void testMixedCoordinates()
=====================================
modules/core/src/test/java/org/locationtech/jts/io/WKTWriterStaticFnTest.java
=====================================
@@ -0,0 +1,88 @@
+package org.locationtech.jts.io;
+
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.locationtech.jts.geom.Coordinate;
+import org.locationtech.jts.geom.CoordinateSequence;
+import org.locationtech.jts.geom.CoordinateXY;
+import org.locationtech.jts.geom.LineString;
+import test.jts.GeometryTestCase;
+
+import java.util.Random;
+
+public class WKTWriterStaticFnTest extends GeometryTestCase {
+
+ private Random _rnd;
+ private WKTReader _reader;
+
+ public static void main(String[] args) {
+ TestRunner.run(new TestSuite(WKTWriterStaticFnTest.class));
+ }
+
+ public WKTWriterStaticFnTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ _rnd = new Random(13);
+ _reader = new WKTReader();
+ _reader.setIsOldJtsCoordinateSyntaxAllowed(false);
+ }
+
+ public void testStaticToPoint() throws ParseException {
+ for (int i = 0; i < 1000; i++) {
+ Coordinate cs = new Coordinate(100 * _rnd.nextDouble(), 100 * _rnd.nextDouble());
+ String toPointText = WKTWriter.toPoint(cs);
+ Coordinate cd = _reader.read(toPointText).getCoordinate();
+ assertEquals(cs, cd);
+ }
+ }
+
+ public void testStaticToLineStringFromSequence() throws ParseException {
+ for (int i = 0; i < 1000; i++) {
+ int size = 2 + _rnd.nextInt(10);
+ CoordinateSequence cs = getCSFactory(Ordinate.createXY()).create(size, 2, 0);
+ for (int j = 0; j < cs.size(); j++) {
+ cs.setOrdinate(j, CoordinateSequence.X, 100 * _rnd.nextDouble());
+ cs.setOrdinate(j, CoordinateSequence.Y, 100 * _rnd.nextDouble());
+ }
+ String toLineStringText = WKTWriter.toLineString(cs);
+ CoordinateSequence cd = ((LineString)_reader.read(toLineStringText)).getCoordinateSequence();
+ assertEquals(cs.size(), cd.size());
+ for (int j = 0; j < cs.size(); j++) {
+ assertEquals(cs.getCoordinate(j), cd.getCoordinate(j));
+ }
+ //assertEquals(cs, cd);
+ }
+ }
+
+ public void testStaticToLineStringFromCoordinateArray() throws ParseException {
+ for (int i = 0; i < 1000; i++) {
+ int size = 2 + _rnd.nextInt(10);
+ Coordinate[] cs = new Coordinate[size];
+ for (int j = 0; j < cs.length; j++) {
+ cs[j] = new CoordinateXY(100 * _rnd.nextDouble(), 100 * _rnd.nextDouble());
+ }
+ String toLineStringText = WKTWriter.toLineString(cs);
+ Coordinate[] cd = _reader.read(toLineStringText).getCoordinates();
+
+ for (int j = 0; j < cs.length; j++) {
+ assertEquals(cs[j], cd[j]);
+ }
+ }
+ }
+
+ public void testStaticToLineStringFromTwoCoords() throws ParseException {
+ for (int i = 0; i < 1000; i++) {
+ Coordinate[] cs = new Coordinate[] {new CoordinateXY(100 * _rnd.nextDouble(), 100 * _rnd.nextDouble()),
+ new CoordinateXY(100 * _rnd.nextDouble(), 100 * _rnd.nextDouble())};
+ String toLineStringText = WKTWriter.toLineString(cs[0], cs[1]);
+ Coordinate[] cd = _reader.read(toLineStringText).getCoordinates();
+ assertEquals(2, cd.length);
+ assertEquals(cs[0], cd[0]);
+ assertEquals(cs[1], cd[1]);
+ }
+ }
+}
=====================================
modules/example/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-example</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/io/common/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-io</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<groupId>org.locationtech.jts.io</groupId>
<artifactId>jts-io-common</artifactId>
=====================================
modules/io/ora/pom.xml
=====================================
@@ -4,7 +4,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-io</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0-SNAPSHOT</version>
</parent>
<groupId>org.locationtech.jts.io</groupId>
<artifactId>jts-io-ora</artifactId>
=====================================
modules/io/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-io</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/io/sde/pom.xml
=====================================
@@ -4,7 +4,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-io</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0-SNAPSHOT</version>
</parent>
<groupId>org.locationtech.jts.io</groupId>
<artifactId>jts-io-sde</artifactId>
=====================================
modules/lab/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-lab</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-modules</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
modules/tests/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
</parent>
<artifactId>jts-tests</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
=====================================
pom.xml
=====================================
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts</artifactId>
- <version>1.16.0-RC1</version>
+ <version>1.16.0</version>
<packaging>pom</packaging>
<name>JTS Topology Suite</name>
@@ -74,7 +74,7 @@
<connection>scm:git::git at github.com:locationtech/jts.git</connection>
<developerConnection>scm:git:git at github.com:locationtech/jts.git</developerConnection>
<url>https://github.com/locationtech/jts</url>
- <tag>HEAD</tag>
+ <tag>jts-1.16.0</tag>
</scm>
<distributionManagement>
View it on GitLab: https://salsa.debian.org/debian-gis-team/jts/commit/0d00e04463dececa248c709913607d5d654cada8
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/jts/commit/0d00e04463dececa248c709913607d5d654cada8
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180919/06592703/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list