GeoTools

OSGeo

Tuesday, September 18, 2018

GeoTools 20 Release Candidate Available

The GeoTools team is pleased to announce the release of GeoTools 20-RC:
This release candidate is also available from our Maven repository, and is made in conjunction with GeoServer 2.14-RC.

This release includes a various major changes.

Please Test this Release Candidate

A release candidate is your chance to both try out new features and contribute to the project with valuable feedback when we need it most.

Please test this release and let us know of any regression before we release GeoTools 20.0 final, in the second half of September.

JTS upgraded to version 1.16

JTS has been upgraded to version 1.16. This marks a significant change in package naming, the library has switched from "com.vividsolutions" to "org.locationtech"  packages and all GeoTools code has been updated to follow suit.

JTS classes are widely used in GeoTools, as a result the client code using GeoTools will also have to be modified to follow suite. Thankfully the changes amount to a search and replace and can be easily automated, please check the upgrade instructions available in the GeoTools site.

Units library migrated to JSR-363

GeoTools was using an aging and un-maintained units library and this development round moved it to a modern and maintained set of packages compatible with Java 10. Like the JTS upgrade this might require the client code to be updated, both in terms of packages and in terms of classes and methods being used.

We have provided a Units utility class, providing an easy way to match unit defined at runtime with the the correct constant.
Unit deg = Units.autoCorrect(SI.RADIAN.multiply(0.0174532925199433));
Please check the upgrade instructions available in the GeoTools site for more details.

Thanks to César Martínez Izquierdo and the participants of the OSGeo Code sprint for this work.

Various other assorted dependencies upgrades

The release upgrades many dependencies to newer versions, in particular:
  • Batik upgraded to version 1.10
  • Commons-lang to version 3.7
  • Commons-io to version 2.6
  • Mysql JDBC driver to 5.1.46
  • HSQLDB to 2.4.1
  • SQLite-JDBC to version 3.23.1
  • GeographicLib upgrades to version 1.49
These upgrades should not cause major incompatibilities, but look for for potential API changes.

Channel selection name allow expressions

GeoTools 20.x allows expressions to be used in SourceChannelName SLD elements, and in their code counterpart, thus allowing dynamic channel selection. This is welcomed news for anyone building applications that display multispectral or hyperspectral data, thus avoiding the need to build many different styles for the various interesting false color combinations.

Here is an SLD example:

<RasterSymbolizer>
  <ChannelSelection>
    <RedChannel>
      <SourceChannelName>
          <ogc:Function name="env">
             <ogc:Literal>B1</ogc:Literal>
             <ogc:Literal>2</ogc:Literal>
          </ogc:Function>
      </SourceChannelName>
    </RedChannel>
    <GreenChannel>
      <SourceChannelName>
          <ogc:Function name="env">
             <ogc:Literal>B2</ogc:Literal>
             <ogc:Literal>5</ogc:Literal>
          </ogc:Function>
      </SourceChannelName>
    </GreenChannel>
    <BlueChannel>
      <SourceChannelName>
          <ogc:Function name="env">
             <ogc:Literal>B3</ogc:Literal>
             <ogc:Literal>7</ogc:Literal>
          </ogc:Function>
      </SourceChannelName>
    </BlueChannel>
  </ChannelSelection>
<RasterSymbolizer>

Map algebra

This release adds support for an efficient map algebra package knows as Jiffle. Jiffle has been the work of a former GeoTools contributor, Michael Bedwards, that has been salvaged, upgraded to support Java 8, and integrated in jai-ext. From the there support has been added into the GeoTools gt-process-raster module, to be used either directly or as a rendering transformation.

The following SLD style calls onto Jiffle to perform a NDVI calculation on top of Sentinel 2 data:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" version="1.0.0">
  <NamedLayer>
    <Name>Sentinel2 NDVI</Name>
    <UserStyle>
      <Title>NDVI</Title>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="ras:Jiffle">
            <ogc:Function name="parameter">
              <ogc:Literal>coverage</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>script</ogc:Literal>
              <ogc:Literal>
                nir = src[7];
                vir = src[3];
                dest = (nir - vir) / (nir + vir);
              </ogc:Literal>
            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
            <ColorMap>
              <ColorMapEntry color="#000000" quantity="-1"/>
              <ColorMapEntry color="#0000ff" quantity="-0.75"/>
              <ColorMapEntry color="#ff00ff" quantity="-0.25"/>
              <ColorMapEntry color="#ff0000" quantity="0"/>
              <ColorMapEntry color="#ffff00" quantity="0.5"/>
              <ColorMapEntry color="#00ff00" quantity="1"/>
            </ColorMap>
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
The performance is good enough for interactive display, and the result looks as follows:

PostGIS store improvements

The PostGIS datastore has been for years the only one that could encode a few filter functions used in filters down into native SQL, but it required a datastore creation flag to be enabled.
Starting with this release it will do so by default.


The functions supported for SQL encoding by the store are:
  • String functions: strConcat, strEndsWith, strStartsWith, strEqualsIgnoreCase, strIndexOf, strLength, strToLowerCase, strToUpperCase, strReplace, strSubstring, strSubstringStart, strTrim, strTrim2
  • Math functions: abs, abs_2, abs_3, abs_4, ceil, floor
  • Date functions: dateDifference
Along with improvements in the handling of GroupByVisitor, this makes for efficient histogram computation directly in the database, while retaining the ability to share the same code with other stores that do not have the same optimizations.

This release adds support for "array" data type in the store, with full reading and writing support, as well as native filtering (with index support, where feasible).

Finally, it's now possible to read geometries with measures from PostGIS, also thanks to JTS improved CoordinateSequence API, and encode the results in GML (the encoding is subject to a configuration flag, as GML does not officially support M encoding). The work will continue in the next few month in order to cover more formats.

Image mosaic improvements

The image mosaic module never sleeps, in this release we see the following improvements:
  • Support for remote images (e.g. S3 or Minio). In order to leverage this the mosaic index will have to be created up-front (manually, or with some home grown tools)
  • A new "virtual native resolution" read parameter allows the mosaic to compose outputs respecting a native resolution other than its native one (useful in case you want to give selective resolution access to different users)
  • Supporting multiple WKBs footprint for pixel precise overviews masking
  • A new read mask parameter allows to cut the image to a given geometry (again, helps in providing different selective views to different users)
  • Speed up NetCDF mosaics by allowing usage of stores coming from a repository, instead of re-creating them every time a NetCDF file is needed (to be setup in the auxiliary store config file, while the repository instance needs to be passed as a creation hint).
  • The mosaic now works against images without a proper CRS, setting them into the "CRS not found" wildcard CRS, aka "EPSG:404000"

App-schema improvements

The app-schema module got significant performance and functionality improvements since 19.x series, in particular:
  • Better delegation of spatial filters on nested properties to native database
  • Improved support for multiple nested attribute matches in filters
  • It is now possible to use Apache SOLR as a data source for app-schema
  • The configuration files can be hosted on a remote HTTP server

Modules moving up and down

This release sees a number of modules moving down to unsupported due to lack of maitainers, unsupported module being removed, while other modules graduate to supported status. In particular:
  • The unsupported image-collection, sfs, efeature, caching, feature-aggregate and geotiff-new module have been removed from the code base (you can still find them in older releases and version control history)
  • The OGR and GTOPO30 modules have been downgraded to unsupported status due to lack of maintainership
  • The MongoDB module moves up to supported status

Building on Windows

The GeoTools project builds again on Windows (with tests) and all new pull requests are verified using AppVeyor.

GeoTools is looking for Windows developers to join and help keep the build passing, as well as locating and squashing a few intermittent failures we're still experiencing.

Assorted improvements

Other highlights from our issue tracker release-notes:
  • Some speedups in in memory Expression evaluation, in particular attribute value extraction in simple features and equality tests
  • Support for "none" values in GeoCSS (to allow turning off symbolization/properties in override rules)
There is also a large set of bug fixes. For more information see the 20-RC release notes.

Tuesday, August 21, 2018

GeoTools 18.5 Released

The GeoTools team is pleased to announce the release of GeoTools 18.5:
Thanks to everyone who contributed to this release. This release is made in conjunction with GeoServer 2.12.5.
This release is a maintenance release providing bug fixes and security updates for production systems and is not recommended for new development.

This is the last maintenance release of the 18.x series, you should consider migrating to 19.x or 20.x in the near future.

Fixes include:
  • [GEOT-6057] - Upgrade Batik to version 1.10
  • [GEOT-6055] - Upgrade commons-io dependency to 2.6
  • [GEOT-6050] - Upgrade HSQLDB to 2.4.1
  • [GEOT-6005] - Renderer can paint label overlapping itself on sharp turns in geometry along with large font
  • [GEOT-6061] - Engineering CRS 404000 does not round trip through WKT correctly
  • [GEOT-6080] - CSS translator does not support mark offset/anchors based on expressions (but SLD does)
  • [GEOT-5964] - Allow the selection of a default geometry attribute in App-Schema
  • [GEOT-6047] - Demote GTOPO30 plugin to unsupported
For more information see release notes (18.5 | 18.4 |18.3 18.2 18.1 | 18.0 | 18-RC1).

Monday, July 23, 2018

GeoTools 19.2 released

The GeoTools team is pleased to announce the release of GeoTools 19.2:
This release is the current stable release and as such users and downstream projects should consider moving from older releases to this one.

This release is made in conjunction with GeoServer 2.13.2 and GeoWebCache 1.13.2.

GeoTools is proud to be an OSGeo project, and would like to thank Jürgen Fische and the OSGeo System Administration Committee for their infrastructure support this release.

Highlights from our issue tracker release-notes:

Tasks and Improvements:
  • Image mosaic virtual native resolution read parameter,  to force mosaic using a user provided native resolution in place of the actual one
  • Image mosaic mask read parameter, to provide a custom mask for the mosaic output
  • Image mosaic support for multiple WKB sidecar files as granule footprints (one per overview)
  • HSQLDB (used in gt-epsg-hsql) upgraded to version 2.4.1, Batik upgraded to version 1.10, commons-io to 2.6
  • Speed up rendering with "Advanced Projection Handling" enabled on maps having axis flipping and lots of small geometries
Bug Fixes:
  • Allow usage of "env" function in RasterSymbolizer ChannelSelect
  • Labelling roads with U turns can cause the renderer to paint a self-overlapping label
  • Better compatibility with ESRI servers in the WMTS client
  • EPSG:40400 does not round-trip properly when writtend in WKT format (prevented mosaics of non georeferenced images to work)

See release notes for this and previous 19.x releases for more details (19.2 19.1 19.0 19-RC1 19-beta).

Tuesday, June 19, 2018

GeoTools 18.4 released.

GeoTools 18.4 Released

The GeoTools team is pleased to announce the release of GeoTools 18.4:
Thanks to everyone who contributed to this release. This release is made in conjunction with GeoServer 2.12.4.
This release is a maintenance release providing bug fixes and security updates for production systems and is not recommended for new development.

This is expected to be the last release of the 18.x branch, you should consider migrating to 19.x or 20.x in the near future as there is no expectation that any further bug fixes will be accepted on to it.

Fixes include:
  • [GEOT-5688] - Env function in RasterSymbolizer's ChannelSelection doesn't evaluate in StreamingRenderer
  • [GEOT-5986] - The two simplifiers in the SimplifyProcess class got mixed up.
  • [GEOT-5987] - ImageUtilties.disposePlanarImageChain disposes image input streams, but won't dispose of the image readers
  • [GEOT-5994] - Minor coefficient error in Transverse Mercator inverse transform
  • [GEOT-5996] - GroupByVisitor may fail with null input values
  • [GEOT-5997] - MergeSortReader will lose some data if the size of the dataset is bigger than the on disk page size, but not a multiple
  • [GEOT-5998] - Interpolate function is not null safe
  • [GEOT-6005] - Renderer can paint label overlapping itself on sharp turns in geometry along with large font
  • [GEOT-6006] - ProjectionHandler fails to recognize no reprojection is needed on datum axis swap in projected CRS
  • [GEOT-6010] - WMS GetMapRequest fail against MongoDB complex feature types (App-Schema)
  • [GEOT-6012] - Image mosaic initialization can stop abruptly if one of the granule acceptors throws an exception
  • [GEOT-6016] - WMS client may return an opaque image when cascading a transparent output from MapXTreme
  • [GEOT-6017] - WMTSCoverageReader throws exception when talking to ESRI servers
  • [GEOT-6022] - Axis flipping triggers advanced projection handling when there is no need to, slows down maps with lots (10k+) of small geometries
For more information see release notes (18.4 |18.3 18.2 18.1 | 18.0 | 18-RC1).

Monday, May 21, 2018

GeoTools 19.1 Released

The GeoTools team is pleased to announce the release of GeoTools 19.1:
This release is the current stable release and as such users and downstream projects should consider moving from older releases to this one.

This release is made in conjunction with GeoServer 2.13 and GeoWebCache 1.13.


Highlights from our issue tracker release-notes:

Tasks and Improvements:
  • Move MongoDB unsupported module to plugins
  • Update MySql jdbc driver to version 5.1.46
Bug Fixes:
  • GeoTools wfs.xsd outdated, reports a LockFeature without AbstractQueryExpression as invalid
  • Minor coefficient error in Transverse Mercator inverse transform
  • Image mosaic initialization can stop abruptly if one of the granule acceptors throws an exception
  • WMS client may return an opaque image when cascading a transparent output from MapXTreme

See release notes for this and previous 19.x releases for more details (19.1 19.0 19-RC1 19-beta).

Wednesday, April 25, 2018

GeoTools 18.3 Released

The GeoTools team is pleased to announce the release of GeoTools 18.3:
Thanks to everyone who contributed to this release. This release is made in conjunction with GeoServer 2.12.3.

This release is a maintenance release providing bug fixes and security updates for production systems and is not recommended for new development.

Fixes includes:
  • Series of improvements to rendering stability including representation of polygons when zoomed out, preventing multiple threads from loading the same SVG
  • GML 3.2 output gains the GML2 ability limit the number of decimal places used
  • RasterZonalStatistics pixel count now includes pixels that are zero or negative
For more information see release notes (18.3 18.2 18.1 | 18.0 | 18-RC1).

Monday, March 19, 2018

GeoTools 19.0 released

The GeoTools team is pleased to announce the release of GeoTools 19.0:
This is the first release of the 19.x series, now marked as stable and deemed suitable for production systems, while 18.x switches to maintenance mode and 17.x gets out of support.

This release is made in conjunction with GeoServer 2.13. This release includes a two major changes, both related to Java 9 compatibility, and a significant set of new features and improvements.

FactorRegistry Refactoring

In JDK 9 javax.imageio.spi.ServiceRegistry verifies that it is extended by JDK-classes only. For GeoTools' org.geotools.factory.FactoryRegistry that means that an exception is thrown, thus crashing GeoTools. To fix this, it was necessary to reimplement the ServiceRegistry functionality that is needed by GeoTools in FactoryRegistry.

For most users, this should not require any changes to make your project compatible. However, if you are accessing the FactorRegistry directly, there are some API changes that you will need to handle. For more details, refer to the FactoryRegistry Refactoring for Java 9 Compatibility proposal.

Java 9 Compatibility

More generally, GeoTools as a whole has been updated to be able to run on Java 9.

If your project depends on GeoTools 19.x, and you want to use it with Java 9, you will need to add the following flags to your JVM runtime arguments:
--add-modules=java.xml.bind --add-modules=java.activation

These add-modules runtime arguments enable the JAXB and Activation modules to the Java Runtime.  The Java startup system has been changed, splitting the Java Runtime into modules for a smaller foot print. The jaxb and activation modules are no longer turned on by default.

The add-modules runtime argument is only used in Java 9. To allow your application to start in Java 8  or Java 9 include:
-XX:+IgnoreUnrecognizedVMOptions

GeoTools on Java 9 introduces a few functional changes:
  • XML pretty-print behaviour has changed, so that CDATA tags will now be on their own lines. These changes are only cosmetic - there are no functional changes to the XML. 
  • Certain math functions are more precise on Java 9. This can result differences in the last digit of double values between Java 8 and Java 9. In particular, this has been observed when dealing with reprojected coordinates.
  • Small changes in horizontal offset have been observed in labels following lines.

GeoPackage performance improvements

GeoPackage reading and rendering performance improved significantly, up to two times faster on large datasets full extractions and 50% faster on small bounding box searches, bringing GeoPackage on par with PostGIS. We also have a Google spreadsheet with more details.

Shapefile remains king of full dataset extractions and the fastest data source for pure spatial driven queries.

Support for more PostGIS data types


The PostGIS data store now has simple support for HStore and JSON columns. HStore is returned as a Map, while JSON is read as a String. In both cases no special query support has been added for those types (but we'd be very happy if someone would work, or sponsor, that functionality too).

Better label position control in map rendering

When setting maxDisplacement on point/polygons the renderer used to search in a circular area around the designated label point. The new displacementMode vendor option allows to control the positioning by specifying the preferred cardinal positions, as a comma separated list.


Shapefile now supporting all Java object types on write

Shapefile used to throw exceptions if unrecognized object types were fed to it (basically, anything but geometries, strings, numbers and dates). From now on it will write unrecognized objects as strings instead.

Assorted improvements

    A single bug fix was applied since 19-beta, fixing an issue with NetCDF data reading. See release notes for this and previous 19.x releases for more details (19.0 19-RC1 19-beta).