GeoTools

OSGeo

Wednesday, May 12, 2010

Oracle GeoRaster & Custom JDBC Access


Coming with version 2.6.4, the Imagemosiac-jdbc module adds support for storing image/raster data in a customized database layout. This enables integration of an already existing database table structure into geotools.

The standard imagemosiac-jdbc module is based on a predefined table setup and is useful if you start importing your image data in a SQL database. Handling tiles and pyramids is supported.

For special use cases, other database designs may be necessary . The module was redesigned to encapsulate JDBC Access in a single plugin. Developing a customized JDBC Access plugin will create the missing link between the image composing logic and a custom database layout.

Additionally, users having an existing image database could make their data available for developers using the geotools API.

Look at the documentation .

A first implementation of this concept is a plugin for Oracle GeoRaster integrating the Oracle RASTER data type into imagemosaic-jdbc.

Again, look at the documentation .

Tuesday, May 4, 2010

Open Trip Planner

One of the really cool parts of GeoTools is the graph module - which offers services similar to PGRouting; but years before PGRounting :-) The code is actually a port of an original JUMP graph plugin done by Refractions; and has been steadily improved by grad students over the years in GeoTools.

While I have used this module myself; one thing I am always on the look out for is creative uses of the GeoTools library for this blog; and this week on the user list I was pointed in the direction of OpenTripPlanner.



Thanks to Nicholas from the user list for the pointer; Nicholas is a contributor the Open Trip Planner project.

Now before you get too excited; just as with PGRouting; the ability to go from point A to point B (with a few waypoints along the way) is really dependent on the quality of your data and how much information you have about the intersections (turn directions and so forth).

Check out the links to both OpenTripPlanner and the GeoTools graph module; perhaps you can use a bit of direction in your next Java project.

Update: After hunting in the internals it looks like OpenTripPlanner has there own implementation of graph functionality and are using GeoTools for data access.

Friday, April 30, 2010

A faster, better GeoTools 2.7

GeoTools 2.7.x is current development branch (or "trunk"). Consider this a sneak peak of some of the ideas that are taking shape for the future.

First up we have speed. One of the common use-cases we have on the geotools-gt2-users email list is displaying a Map in a Java Swing application. Still it is nice to see something; especially when learning. With this in mind we have recast our initial introduction tutorials to be a bit more visual.

Out of the box GeoTools focus on providing a standard compliant SLD rendering engine. This engine is not specific to display - and actually never loads data into memory (it simply streams it off disk onto the screen).

In the interest of performance Andrea has donated a wrapper that will cache data in memory (storing it in a JTS spatial index).

File file = JFileDataStoreChooser.showOpenFile("shp", null);

FileDataStore store = FileDataStoreFinder.getDataStore(file);

FeatureSource featureSource = store.getFeatureSource();


CachingFeatureSource cache = new CachingFeatureSource(featureSource);


MapContext map = new DefaultMapContext();

map.setTitle("Using cached features");

map.addLayer(cache, null);


JMapFrame.showMap(map);


For more details please see the updated (and aptly named) Quickstart. This functionality has been back ported to 2.6.x and we are soliciting feedback (and test cases) from users.

Returning to 2.7 we have two great usability improvements:
  • For the longest time we have had a Query interface and a DefaultQuery implementation. These have been combined making code examples just that much readable.
  • We introduced the use of Generics to support application schema work. While we now have a happy team working on application schema; it did impact readably.
    Specifically FeatureCollection < SimpleFeatureType, SimpleFeature > gets tiring.
    Introducing SimpleFeatureCollection to the rescue.
With this in mind a couple of recent proposals have allowed us to write the following:


SimpleFeatureSource source = dataStore.getFeatureSource( typeName );

Query query = new Query( typeName, filter, attributes );

SimpleFeatureCollection features = source.getFeatures(query);


It is all good!

If you are using maven switch to 2.7-SNAPSHOT to try out these improvements today; we will issue a milestone release laster this month.

Friday, March 26, 2010

GeoTools 2.6.3 released

The GeoTools project is pleased to announce the release of GeoTools version 2.6.3.

This release is a bug fix release (27 issues fixed) made in conjunction with uDig 1.2-RC2. A special thank you to to community members that submitted patches this release.

Improvements and new capabilities:
  • Improvements to JMapPane thanks to an active user list
  • Support for WMS Extent and Dimension information
  • Support for the Robinson projection
We also have a few internal improvements:
  • Support for Online Test cases using JUnit4
For the complete list please review the 2.6.3 release notes.

GeoTools 2.6.3 is available from source forge:

Or from our public maven or subversion repositories:

The GeoTools Community

Thursday, March 4, 2010

GeoTools 2.6.2 released

The GeoTools project is pleased to announce the release of GeoTools version 2.6.2.

This release is mostly intended to provide a number of important bug-fixes, but there are also some new features and improvements for your programming pleasure including:
  • The rendering system now has the ability to draw polygon fills and SVGs as vectors and draw marks with arbitrary sizes.
  • GeoTools applications can now use the H2 database with a spatial index provided by Hatbox.
  • Support added for polyconic projections.
Refer to the 2.6.2 release notes for full details.

You can download the complete GeoTools 2.6.2 source distribution from Sourceforge, or click the 'View all files' button on that page for separate downloads for pre-compiled binaries and javadocs. You can also download the source code with your favourite Subversion client from: http://svn.osgeo.org/geotools/tags/2.6.2

If you use Maven as your build tool, simply update the version number for GeoTools modules in your pom.xml files to "2.6.2".

Share and enjoy !
The GeoTools Community

Tuesday, March 2, 2010

Make your own map-based mashup

IBM produced a nice tutorial making use of GeoTools, JTS and SkateKML with the ever present OpenLayers and PostGIS database.

The tutorial mostly uses the MathTransform services to handle coordinates. You can actually use GeoTools DataStore to perform the SQL query for you resulting in a FeatureCollection. The IBM tutorial performs these steps by hand (Constructing the SQL and translating Well Known Binary into a JTS Geometry etc...).

For more information on using GeoTools FeatureCollection please review QueryLab (java).

Wednesday, February 24, 2010

GeoTools continuous map wrapping

Recently the GeoTools team under GeoSolutions' funding has addressed an issue with the rendering module that was preventing users from drawing polygons crossing the dateline change, or, to put it another way, to be able to have maps that were wrapping like continuous wrapped maps from Google.


As an example specific use case involved the use of a projection in which the dateline change has been moved away from the usual -180/+180 by using a non standard central meridian
The result, prior to the work described here, does not look so good across the discontinuity, as shown below


Bad results when crossing the dateline


The problem was that our renderer was performing point by point reprojections, therefore when a point was crossing the dateline the modular math we used kicked in, transforming +181 -> -179. This meant that the next point, when crossing the dateline, was moved to the other side of the world.


In order to perform proper processing of projection singularities and dateline wrapping on selected projections, in particular, Mercator, Transverse Mercator, and flat geographic, we have had to modify the renderer in its projection handling part. The outcome is that we finally have obtained seamless wrapping maps similar to the Google ones, as shown here:


Continents Oracle layer with EPSG:3329
Continents layer from Oracle datastore in EPSG:3329


Continents Oracle layer with EPSG:90013
Continents layer from Oracle datastore in EPSG:90013


You can try this work yourself starting from GeoTools 2.5.x and above. On the development versions of the two software the tweak is automatically applied while on the other side for the stable versions you need to specify two JVM options:
-DADVANCED_PROJECTION_ HANDLING=true
-DUSE_STREAMING_RENDERER=true

A big thanks goes to Andrea Aime who has been hired for the implementation of this feature.