Tuesday, May 20, 2014

GeoTools 11.1 Released

The GeoTools community is happy to announce the latest  GeoTools 11.1 download:
This release is also available from our maven repositoryThis release is made in conjunction with GeoServer 2.5.1.

This is a release of the GeoTools 11 Stable series recommended for production systems. The release schedule now offers 6 months of stable releases followed by six months of maintenance releases.

A few highlights from the GeoTools 11.1-Release Notes:
  • 2.5D coordinates are available in GML2 (even if the CRS is 2D)
  • Fixes for the ECQL Parser Fid Filter handling
  • FilterToSQL improperly encodes fid filters with multiple fids
  • Fix for multi line labels
  • Fixes for Oracle axis name and spatial index name
  • ImageMosaic support continues to improve with create/delete support and safety checks for heterogeneous resolutions management
Thanks to Andrea and Jody for this release (and GeoSolutions and Boundless respectively).

About GeoTools 11.1

Summary of the new features for the GeoTools 11.1 series:
  • The DataStore API has a new removeSchema method to drop feature types. This new optional feature is currently implemented by the JDBCDataStore family (all spatial database backed stores), other stores will likely throw an UnsupportedOperationException
  • JDBCDataStore now exposes facilities to list, create and destroy indexes on database columns.
  • Ability to create and drop databases from the PostgisNGFactory
  • PostGis data store will now call ST_Simplify when the GEOMETRY_SIMPLIFICATION hint is provided, significantly speeding up loading of complex geometries  (the renderer can perform scale based simplification already, but doing it before sending the data speeds up data retrieval significantly)
  • ImageMosaic can now manage vector footprints for its granules, allowing to filter out no-data or corrupted sections of the imagery
  • All properties in a SLD style can now have a local unit of measure, as opposed to specifying the unit of measure per symbolizer. For example, if you need to have a line width to be 10 meters, its value can now be "10m"
  • Improved handling of data with 3D coordinates in JDBC data stores
  • A number of small improvements to the rendering engine, such as improved raster icon placement resulting in cleaner, less blurry output, improved label grouping, better handling of icons at the border of the map and in general much improved estimation of the buffer area needed to include all symbols in a map (for features that sit outside the map, but whose symbols are big enough to enter it).

Tuesday, May 6, 2014

Filter Cleanup and ECQL Fixes

Quick update from the GeoTools development pipeline. It is kind of a tricky update to be excited about ... here is what it looks like:

Eclipse Auto-Complete

So what are you looking at? You are looking at Eclipse auto-complete for Filter. Since GeoTools 2.3 we have had two filter interfaces in the system:

a) org.opengis.filter.Filter - read only interface from GeoTools 2.3
b) org.geotools.filter.Filter - read/write interface from GeoTools 2.0

For the next release of GeoTools we are down to one, making GeoTools that much easier to get started with.

FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
Filter filter = ff.equals("type"), ff.literal("city"));
SimpleFeatureCollection features = source.getFeatures( filter );

More importantly, and the motivation for the work, no more surprising ClassCastExceptions. Thanks to Boundless for sponsoring this work (and Andrea for reviewing the pull request).

Another bit of code seeing some love is the ECQL representation of Filter. ECQL is our "enhanced" version of OGC common query language.

String cql = ECQL.toCQL(filter);

Will produce: type = 'city'

In effect ECQL is similar to the "WHERE" part of an SQL statement. Be aware that GeoTools is not executing SQL directly, instead the filter data structure is translated into SQL specific for each database we support.

I took the opportunity to make sure some of the more interesting ECQL output correctly:

filter = ECQL.toFilter("type IN ('city','town')");

Thanks to Andrew Hulbert on the geotools-user list for helping catch these glitches.

For more information on filter check out our documentation on the subject.