Skip to content

Commit

Permalink
Merge commit '6e95fe82feb986a7aa657f4ffa406d8c290af509' into rjm-master
Browse files Browse the repository at this point in the history
  • Loading branch information
RichMacDonald committed Oct 19, 2024
2 parents 662aca1 + 6e95fe8 commit d14775c
Show file tree
Hide file tree
Showing 234 changed files with 18,246 additions and 6,423 deletions.
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ The JTS Topology Suite is a Java library for creating and manipulating vector ge

![JTS logo](jts_logo.png)

[![Travis Build Status](https://api.travis-ci.org/locationtech/jts.svg)](http://travis-ci.org/locationtech/jts) [![GitHub Action Status](https://github.com/locationtech/jts/workflows/GitHub%20CI/badge.svg)](https://github.com/locationtech/jts/actions)
[![GitHub Action Status](https://github.com/locationtech/jts/workflows/GitHub%20CI/badge.svg)](https://github.com/locationtech/jts/actions)

[![Join the chat at https://gitter.im/locationtech/jts](https://badges.gitter.im/locationtech/jts.svg)](https://gitter.im/locationtech/jts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


JTS is a project in the [LocationTech](http://www.locationtech.org) working group of the Eclipse Foundation.
JTS is a project in the [LocationTech](https://www.locationtech.org) working group of the Eclipse Foundation.

![LocationTech](locationtech_mark.png)

## Requirements

Currently JTS targets Java 1.8 and above.
Currently JTS targets Java 8 and above.

## Resources

Expand All @@ -41,7 +40,7 @@ Currently JTS targets Java 1.8 and above.
JTS is open source software. It is dual-licensed under:

* [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-v20.html)
* [Eclipse Distribution License 1.0](http://www.eclipse.org/org/documents/edl-v10.php) (a BSD Style License)
* [Eclipse Distribution License 1.0](https://www.eclipse.org/org/documents/edl-v10.php) (a BSD Style License)

See also:

Expand Down Expand Up @@ -74,7 +73,7 @@ If you are interested in contributing to JTS please read the [**Contributing Gui
* [**GEOS**](https://trac.osgeo.org/geos) - C++
* [**NetTopologySuite**](https://github.com/NetTopologySuite/NetTopologySuite) - .NET
* [**JSTS**](https://github.com/bjornharrtell/jsts) - JavaScript
* [**dart_jts]([https://pub.dev/packages/dart_jts](https://github.com/moovida/dart_jts)) - Dart
* [**dart_jts**](https://github.com/moovida/dart_jts) - Dart

### Via GEOS
* [**Shapely**](https://github.com/Toblerity/Shapely) - Python wrapper of GEOS
Expand Down
5 changes: 3 additions & 2 deletions USING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Our [build server](https://ci.eclipse.org/jts/) publishes to the LocationTech Ma
<repositories>
<repository>
<id>locationtech-releases</id>
<url>https://repo.eclipse.org/content/groups/releases</url>
<url>https://repo.eclipse.org/content/repositories/jts</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
Expand All @@ -66,7 +66,7 @@ The latest snapshot builds are now avaialble:

```xml
<properties>
<jts.version>1.17.0-SNAPSHOT</jts.version>
<jts.version>1.20.0-SNAPSHOT</jts.version>
</properties>
<dependency>
<groupId>org.locationtech.jts</groupId>
Expand Down Expand Up @@ -123,6 +123,7 @@ module org.foo.baz {
## JTS System Properties

* `-Djts.overlay=ng` enables the use of OverlayNG in `Geometry` overlay methods. (*Note: in a future release this will become the default behaviour*)
* `-Djts.relate=ng` enables the use of RelateNG in `Geometry` topological predicate methods. (*Note: in a future release this will become the default behaviour*)

## JTS Tools

Expand Down
2 changes: 1 addition & 1 deletion build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.locationtech.jts</groupId>
<artifactId>build-tools</artifactId>
<version>1.20.0-SNAPSHOT</version>
<version>1.20.0</version>
<name>JTS Topology Suite Build Configuration</name>

<build>
Expand Down
41 changes: 40 additions & 1 deletion doc/JTS_Version_History.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,23 @@ Distributions for older JTS versions can be obtained at the

<!-- ================================================================ -->

Version 1.x

Release Date: TBD

# Version 1.x

*Release Date: TBD*
### New Features

### Functionality Improvements

### Bug Fixes

### Performance Improvements

# Version 1.20.0

*Release Date: 09/18/2024*

### New Features
* Add `CoverageValidator` `CoveragePolygonValidator` (#900)
Expand All @@ -30,14 +44,22 @@ Distributions for older JTS versions can be obtained at the
* Add `Geometry.hasDimension(int dim)` method {#944}
* Add `ConcaveHull.alphaShape` function (#952)
* Add `OffsetCurve` Joined mode (#956)
* Add `PointLocation.isOnSegment` function (#1048)
* Add `RelateNG` API for improved topological relationship functionality and performance (#1052, #1055)
* Add system property `jts.relate=ng` to enable use of RelateNG in `Geometry` methods (#1073)

### Functionality Improvements
* Improve `TopologyPreservingSimplifier` to prevent edge-disjoint line collapse (#925)
* Improve `OffsetCurve` to return more linework for some input situations (#956)
* Reduce buffer curve short fillet segments (#960)
* Added ability to specify boundary for `LargestEmptyCircle` (#973)
* Improve `DouglaPeuckerSimplifier` and `TopologyPreservingSimplifier` to handle ring endpoints (#1013)
* Add `Angle` functions `sinSnap` and `cosSnap` to avoid small errors, e.g. with buffer operations (#1016)
* Improve Buffer input simplification for rings (#1022)
* Improve CoverageSimplifier with ring removal, smoothing, inner/outer and per-feature tolerances (#1060)

### Bug Fixes
* Fix `WKBReader` and `WKBWriter` handling of M measures when writing to WKB and reading from WKB (#734)
* Fix `PreparedGeometry` handling of EMPTY elements (#904)
* Fix `WKBReader` parsing of WKB containing multiple empty elements (#905)
* Fix `LineSegment.orientationIndex(LineSegment)` to correct orientation for non-collinear segments on right (#914)
Expand All @@ -57,11 +79,28 @@ Distributions for older JTS versions can be obtained at the
* Fix `Geometry.getCoordinate` to return non-null coordinate for collections with empty first element (#987)
* Fix `LargestEmptyCircle` to handle polygonal obstacles (#988)
* Make intersection computation more robust (#989)
* Fix `VariableBuffer` to handle zero vertex buffer distances correctly (#997)
* Fix `IncrementalDelaunayTriangulator` to ensure triangulation boundary is convex (#1004)
* Fix OverlayNG Area Check heuristic for difference (#1005)
* Fix `InteriorPointPoint` to handle empty elements
* Fix `DistanceOp` for empty elements (#1010)
* Fix predicates for MultiPoint with EMPTY (#1015)
* Fix `InteriorPoint` for MultiLineString with EMPTY (#1023)
* Fix TopologyPreservingSimplifier to prevent incorrect topology from jumping components (#1024)
* Fix OffsetCurve to ensure end segments are included (#1029)
* Fix `PointLocator` to respect `BoundaryNodeRule` for single lines (#1031)
* Fix `BufferOp` Inverted Ring Removal check (#1038)
* Improve `VariableBuffer` segment buffer cap generation (#1041)
* Fix `TopologyPreservingSimplifier` ring endpoint removal indexing (#1059)

### Performance Improvements

* Improve `Polygonizer` performance in some cases with many islands (#906)
* Improve Convex Hull performance by avoiding duplicate uniquing (#985)
* Improve `HPRtree` performance (#1012)
* Improve performance of noding and overlay via `HPRtree` (#1012)
* Improve `DistanceOp` performance for Point-Point (#1049)
* Improve `CoveragePolygonValidator` via section performance optimization (#1053)

# Version 1.19

Expand Down
2 changes: 1 addition & 1 deletion modules/app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-modules</artifactId>
<version>1.20.0-SNAPSHOT</version>
<version>1.20.0</version>
</parent>
<artifactId>jts-app</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ public class CommandOptions {
public static final String EACHA = "eacha";
public static final String EACHB = "eachb";
public static final String ARGS = "args";
public static final String VALIDATE = "validate";
public static final String INDEX = "index";
public static final String TIME = "time";
public static final String LIMIT = "limit";
public static final String OFFSET = "offset";
public static final String QUIET = "q";
public static final String VALIDATE = "validate";
public static final String WHERE = "where";

public static final String SOURCE_STDIN = "stdin";

public static final String STDIN = "stdin";
public static final String FORMAT_GML = "gml";
public static final String FORMAT_WKB = "wkb";
public static final String FORMAT_TXT = "txt";
public static final String FORMAT_WKT = "wkt";
public static final String FORMAT_GEOJSON = "geojson";
public static final String FORMAT_SVG = "svg";
public static final String TIME = "time";
public static final String LIMIT = "limit";
public static final String OFFSET = "offset";
public static final String WHERE = "where";



}
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,35 @@
*
* <pre>
* --- Compute the area of a WKT geometry, output it
* jtsop -a some-file-with-geom.wkt -f txt area
* jtsop -a some-file-with-geom.wkt area
*
* --- Validate geometries from a WKT file using limit and offset
* jtsop -a some-file-with-geom.wkt -limit 100 -offset 40 -f txt isValid
* jtsop -a some-file-with-geom.wkt -limit 100 -offset 40 isValid
*
* --- Compute the unary union of a WKT geometry, output as WKB
* jtsop -a some-file-with-geom.wkt -f wkb Overlay.unaryUnion
*
* --- Compute the union of two geometries in WKT and WKB, output as WKT
* jtsop -a some-file-with-geom.wkt -b some-other-geom.wkb -f wkt Overlay.Union
* jtsop -a some-file-with-geom.wkt -b some-other-geom.wkb Overlay.Union
*
* --- Compute the buffer of distance 10 of a WKT geometry, output as GeoJSON
* jtsop -a some-file-with-geom.wkt -f geojson Buffer.buffer 10
*
* --- Compute the buffer of a literal geometry, output as WKT
* jtsop -a "POINT (10 10)" -f wkt Buffer.buffer 10
* jtsop -a "POINT (10 10)" Buffer.buffer 10
*
* --- Compute buffers of multiple sizes
* jtsop -a "POINT (10 10)" -f wkt Buffer.buffer 1,10,100
* jtsop -a "POINT (10 10)" Buffer.buffer 1,10,100
*
* --- Run op for each A
* jtsop -a "MULTIPOINT ((10 10), (20 20))" -eacha -f wkt Buffer.buffer
* jtsop -a "MULTIPOINT ((10 10), (20 20))" -eacha Buffer.buffer
*
* --- Output a literal geometry as GeoJSON
* jtsop -a "POINT (10 10)" -f geojson
*
* --- Run op but don't output result (quiet mode)
* jtsop -a "MULTIPOINT ((10 10), (20 20))" -q Buffer.buffer
* </pre>
*
* @author Martin Davis
Expand Down Expand Up @@ -120,6 +124,7 @@ private static CommandLine createCmdLine() {
.addOptionSpec(new OptionSpec(CommandOptions.LIMIT, 1))
.addOptionSpec(new OptionSpec(CommandOptions.OFFSET, 1))
.addOptionSpec(new OptionSpec(CommandOptions.REPEAT, 1))
.addOptionSpec(new OptionSpec(CommandOptions.QUIET, 0))
.addOptionSpec(new OptionSpec(CommandOptions.SRID, 1))
.addOptionSpec(new OptionSpec(CommandOptions.WHERE, 2))
.addOptionSpec(new OptionSpec(CommandOptions.VALIDATE, 0))
Expand All @@ -145,6 +150,7 @@ private static CommandLine createCmdLine() {
" [ -explode",
" [ -srid SRID ]",
" [ -f ( txt | wkt | wkb | geojson | gml | svg ) ]",
" [ -q",
" [ -time ]",
" [ -v, -verbose ]",
" [ -help ]",
Expand All @@ -166,15 +172,16 @@ private static CommandLine createCmdLine() {
" -eachb execute op on each element of B",
" -index index the B geometries",
" -repeat repeat the operation N times",
" -where op v output geometry where operation result matches predicate op and value.",
" Predicates ops are: eq,ne,ge,gt,le,lt",
" -where cond v output geometry where operation result matches condition and value.",
" Conditions are: eq, ne, ge, gt, le, lt",
" -validate validate the result of each operation",
" -geomfunc specifies class providing geometry operations",
" -op separator to delineate operation arguments",
"===== Output options:",
" -srid Sets the SRID on output geometries",
" -srid sets the SRID on output geometries",
" -explode output atomic geometries",
" -f output format to use. If omitted output is silent",
" -f output format to use. Default is txt/wkt",
" -q quiet mode - result is not output",
"===== Logging options:",
" -time display execution time",
" -v, -verbose display information about execution",
Expand Down Expand Up @@ -331,14 +338,18 @@ JTSOpRunner.OpParams parseArgs(String[] args) throws ParseException, ClassNotFou
? commandLine.getOptionArgAsInt(CommandOptions.OFFSET, 0)
: 0;

cmdArgs.format = commandLine.getOptionArg(CommandOptions.FORMAT, 0);
cmdArgs.format = commandLine.hasOption(CommandOptions.FORMAT)
? commandLine.getOptionArg(CommandOptions.FORMAT, 0)
: CommandOptions.FORMAT_TXT;

cmdArgs.srid = commandLine.hasOption(CommandOptions.SRID)
? commandLine.getOptionArgAsInt(CommandOptions.SRID, 0)
: -1;

cmdArgs.isIndexed = commandLine.hasOption(CommandOptions.INDEX);

cmdArgs.isQuiet = commandLine.hasOption(CommandOptions.QUIET);

cmdArgs.repeat = commandLine.hasOption(CommandOptions.REPEAT)
? commandLine.getOptionArgAsInt(CommandOptions.REPEAT, 0)
: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ static class OpParams {

public boolean isGeomAB = false;
public boolean isCollect = false;
String format = null;
public boolean isQuiet = false;
public String format = null;
public Integer repeat;
public boolean eachA = false;
public boolean eachB = false;
Expand Down Expand Up @@ -361,7 +362,9 @@ private Object executeFunctionOnce(Geometry geomA, GeometryFunction func, Object
if (param.validate) {
validate(result);
}
outputResult(result, param.isExplode, param.format);
if (! param.isQuiet) {
outputResult(result, param.isExplode, param.format);
}
return result;
}

Expand Down Expand Up @@ -430,7 +433,7 @@ private List<Geometry> readGeometry(String geomLabel, String filename, String ge
if (filename == null) return null;

// must be a filename
if (filename.equalsIgnoreCase(CommandOptions.STDIN)){
if (filename.equalsIgnoreCase(CommandOptions.SOURCE_STDIN)){
return readStdin(limit, offset);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public static Geometry toMultiPolygon(Geometry g1, Geometry g2)
.createMultiPolygon( GeometryFactory.toPolygonArray(polys));
}

public static Geometry toGeometryCollection(Geometry g, Geometry g2)
public static Geometry toGeometryCollection(Geometry g1, Geometry g2)
{
List atomicGeoms = new ArrayList();
if (g != null) addComponents(g, atomicGeoms);
if (g1 != null) addComponents(g1, atomicGeoms);
if (g2 != null) addComponents(g2, atomicGeoms);
return g.getFactory().createGeometryCollection(
return FunctionsUtil.getFactoryOrDefault(g1, g2).createGeometryCollection(
GeometryFactory.toGeometryArray(atomicGeoms));
}

Expand Down
Loading

0 comments on commit d14775c

Please sign in to comment.