More

Displaying coordinate references in GeoTools?

Displaying coordinate references in GeoTools?


I'm using this library to finish my final project and I have to say I'm no familiar with the maps worlds. My question is if geotools has a method to show automatically the coordinates references in the map, and how use it? That would be really helpful because I spend a lot of time trying to find it without success. I use the quickstart example to show a shapefile with the worlds map. The user can select a rectangular zone of interes and then the application draw the Sea Surface Temperature. The map generated needs the references of where are positioned because we export it to a png image.

One example of what I am looking for are the blue lines in the map below.


You can draw these using the vector-grids module and some code like:

ReferencedEnvelope gridBounds = new ReferencedEnvelope( 110.0, 150.0, -45.0, -5.0, DefaultGeographicCRS.WGS84); SimpleFeatureSource grid = Grids.createSquareGrid(gridBounds, 10.0);

There are a variety of grids and options available depending on your exact needs which are described in the tutorial.


Core Features¶

Definition of interfaces for key spatial concepts and data structures

Integrated Geometry support provided by Java Topology Suite (JTS)

Attribute and spatial filters using OGC Filter Encoding specification

A clean data access API supporting feature access, transaction support and locking between threads

Access GIS data in many file formats and spatial databases

Coordinate reference system and transformation support

Work with an extensive range of map projections

filter and analyze data in terms of spatial and non-spatial attributes

A stateless, low memory renderer, particularly useful in server-side environments.

compose and display maps with complex styling

vendor extensions for fine control of text labels and color blending

Powerful schema assisted parsing technology using XML Schema to bind to GML content

The parsing / encoding technology is provided with bindings for many OGC standards including GML, Filter, KML, SLD, and SE.

GeoTools Plugins: open plug-in system allowing you to teach the library additional formats

Plug-ins for the ImageIO-EXT project allowing GeoTools to read additional raster formats from GDAL

Provide additional capabilities built using the spatial facilities of the core library.

Extensions provide graph and networking support (for finding the shortest path), validation, a web map server client, bindings for XML parsing and encoding and color brewer!

GeoTools also operates as part of a wider community with a staging area used to foster new talent and promote experimentation.

Some highlights are swing support (used in our tutorials!), SWT, local and web process support, additional symbology, additional data formats, generation of grids and a couple of implementations of ISO Geometry.


Andrae C, Fitzke J, Zipf A (ed) (2009) OpenGIS essentials. Wichmann Verlag, Heidelberg, Germany

Behrens J, Androsov A, Babeyko AY, Harig S, Klaschka F, Mentrup L (2010) A new multi-sensor approach to simulation assisted tsunami early warning. Natural Hazards and Earth System Sciences 10:1085–1100. doi:10.5194/nhess-10-1085-2010

de Berg M, Cheong O, van Kreveld M, Overmars M (2000) Computational geometry. Springer, Berlin, Germany

Deegree (2010) Implementation Overview. http://wiki.deegree.org/deegreeWiki/deegree3, [accessed 27 August]

DEWS (2010) Distant Early Warning System. http://www.dews-online.org/, [accessed 8 November]

Egenhofer MJ, Herring JR (1990) Categorizing binary topological relations between regions, lines and points in geographic databases. Technical report, department of surveying engineering, University of Maine, USA

Egenhofer M. J., Mark D. M., Herring J.R., 1994. The 9-Intersection: Formalism And Its Use For Natural-Language Spatial Predicates. National Center for Geographic Information and Analysis, Report 94-1, USA

Elsinghorst J (2010) Integration Heterogener Geodienste (Integration of Heterogeneous Geo Services). GIS Business 5/2010, pp. 46-51 [in German], abcverlag GmbH, Heidelberg, Germany

Fleischer J, Häner R, Herrnkind S, Kloth A, Kriegel U, Schwarting H, Wächter J (2010) An integration platform for heterogeneous sensor systems in GITEWS—Tsunami Service Bus. Natural hazards and earth system sciences 10:641–646. doi:10.5194/nhess-10-1239-2010

GADM (2010) Global administrative areas dataset version 1.0. http://www.gadm.org, [accessed 27 August 2010]

Garnett J (2002) Spatial Validation—Academic References. http://vwfs.refractions.net/docs/Spatial_Validation_Academic.pdf, [accessed 27 August 2010]

Garnett J (2009) Point Set Theory and the DE-9IM Matrix. In: Documentation of the GeoTools Project. http://docs.codehaus.org/display/GEOTDOC/Point+Set+Theory+and+the+DE-9IM+Matrix, [accessed 27 August 2010]

GeoTools (2010) The Open Source Java GIS Toolkit. http://geotools.org/, [accessed 27 August]

Hammitzsch M, Lendholt M (2009) The DEWS National Demonstrator. In: Proceedings of the DEWS Midterm Conference, Potsdam, Germany, pp. 19-30. doi:10.2312/GFZ.DEWS.001

Hostmann M (2010) MobiGIS für die Schweiz (MobiGIS for Suisse). In: Geo Business News 2/2010, p3 [in German]. http://www.landmarcs.de/images/lm201002/landmarcs10_02.pdf, [accessed 27 August 2010]

Hoyois P, Scheuren J-M, Below R, Guha-Sapir D (2007) Annual disaster statiscical review: numbers and trends 2006. Technical Report, CRED, Brussels, Belgium

ISO-3166 (2010) Codes for the representation of names of countries and their subdivisions. International Organization for Standardization. http://www.iso.org/iso/country_codes/, [accessed 27 August]

Law G (1999) Administrative subdivisions of countries: a comprehensive world reference – 1900 Through 1998. Mcfarland & Co Inc, Jefferson, North Carolina, USA

Nash E (2008) WPS application profiles for generic and specialized processes. Proceedings of GI-Days, Universität Münster, Germany, pp. 69-79

OGC (2007) OpenGIS Web Processing Service. Open Geospatial Consortium, Reference number: OGC 05-007r7

OGC (2010) OpenGIS Implementation Standard for Geographic information—Simple feature access—Part 1: Common architecture. Open Geospatial Consortium, Reference number: OGC 06-103r4

Pendleton C (2010) New Bing Map App: Bing health Maps. Microsoft Bing Community Blog, http://www.bing.com/community/blogs/maps/archive/2010/06/02/new-bing-map-app-bing-health-maps.aspx, [accessed 27 August 2010]

Raape U, Teßmann S, Wytzisk A, Steinmetz T, Wnuk M, Hunold M, Strobl C, Stasch C, Walkowski AC, Meyer O, Jirka S (2010) Decision support for tsunami early warning in Indonesia: The Role of OGC Standards. In: Geographic information and cartography for risk and crisis Management, Springer, Germany, pp. 233–247

Reichardt M (2010) Open standards-based geoprocessing Web services support the study and management of hazard and risk. Geomatics, Natural Hazards and Risk, 1:2, 171-184. doi:10.1080/19475701003643458

Setten W (2009) The Chorist Warning System (CHOR-WARN) Communication to Citizen, in case of an emergency, Proceedings of the DEWS Midterm Conference, Potsdam, Germany, pp. 91-95. doi:10.2312/GFZ.DEWS.001

UN-LOCODE (2010) United Nations Code for Trade and Transport Locations. United Nations Economic Commission for Europe. http://www.unece.org/cefact/locode/, [accessed 27 August]

UN-SALB (2010) Second Administrative Level Boundaries. United Nations Geographic Information Working Group (UNGIWG). http://www.unsalb.org/, [accessed 27 August]

US-DHS—United States Department of Homeland Security (2002) Homeland Security Presidential Directive-3: Homeland Security Advisory System. http://www.dhs.gov/xabout/laws/gc_1214508631313.shtm, [accessed 27 August 2010]

US-NGA—United States National Geospatial Intelligence Agency (1990) Technical Manual DMA-8358.1: Datums, Ellipsoids, Grids and Grid Reference Systems. http://earth-info.nga.mil/GandG/publications/tm8358.1/tr83581a.html, [accessed 27 August 2010]

van Oosterom P, van Kreveld M (2006) Geo-information and computational geometry. Nederlandse Commissie voor Geodesie, Delft, Netherlands


Displaying coordinate references in GeoTools? - Geographic Information Systems

When using CoordinateReferenceSystem matching methods of this class ( equalsIgnoreMetadata(Object, Object) , lookupIdentifier(IdentifiedObject, boolean) , lookupEpsgCode(CoordinateReferenceSystem, boolean) , lookupIdentifier(IdentifiedObject, boolean) , lookupIdentifier(Citation, CoordinateReferenceSystem, boolean) ) against objects derived from a database other than the official EPSG one it may be advisable to set a non zero comparison tolerance with Hints.putSystemDefault(java.awt.RenderingHints.Key, Object) using the Hints.COMPARISON_TOLERANCE key. A value of 10e-9 has proved to give satisfactory results with definitions commonly found in .prj files accompaining shapefiles and georeferenced images.
Warning: the tolerance value is used in all internal comparison, this will also change the way math transforms are setup. Use with care.

Nested Class Summary

Method Summary

Methods inherited from class Object

Method Detail

GetAuthorityFactory

This factory can be used as a kind of system-wide factory for all authorities. However for more determinist behavior, consider using a more specific factory (as returned by ReferencingFactoryFinder.getCRSAuthorityFactory(java.lang.String, org.geotools.util.factory.Hints) when the authority in known.

GetCoordinateOperationFactory

GetVersion

GetSupportedCodes

If there is more than one factory for the given authority, then this method merges the code set of all of them. If a factory fails to provide a set of supported code, then this particular factory is ignored. Please be aware of the following potential issues:

  • If there is more than one EPSG databases (for example an Access and a PostgreSQL ones), then this method will connect to all of them even if their content are identical.
  • If two factories format their codes differently (e.g. "4326" and "EPSG:4326" ), then the returned set will contain a lot of synonymous codes.
  • For any code c in the returned set, there is no warranty that decode(c) will use the same authority factory than the one that formatted c .
  • This method doesn't report connection problems since it doesn't throw any exception. FactoryException s are logged as warnings and otherwise ignored.

If a more determinist behavior is wanted, consider the code below instead. The following code exploit only one factory, the "preferred" one.

GetSupportedAuthorities

Decode

CRS objects created by previous calls to this method are cached in a buffer using weak references. Subsequent calls to this method with the same authority code should be fast, unless the CRS object has been garbage collected.

Decode

This method argument Hint value Meaning
true TRUE All coordinate reference systems are forced to ( longitude , latitude ) axis order.
false null Coordinate reference systems may or may not be forced to ( longitude , latitude ) axis order. The behavior depends on user setting, for example the value of the system property.
FALSE Forcing ( longitude , latitude ) axis order is not allowed, no matter the value of the system property.

ParseWKT

GetEnvelope

This method fetchs the domain of validity associated with the given CRS. Only geographic extents of kind bounding polygon are taken in account. If none are found, then the geographic bounding boxes are used as a fallback.

The returned envelope is expressed in terms of the specified CRS.

GetGeographicBoundingBox

This method fetchs the domain of validity associated with the given CRS. Only geographic extents of kind geographic bounding box are taken in account.

GetHorizontalCRS

GetProjectedCRS

GetMapProjection

GetVerticalCRS

GetTemporalCRS

GetEllipsoid

EqualsIgnoreMetadata

IsTransformationRequired

  • source or target are null
  • source or target are a wildcard CRS, see DefaultEngineeringCRS.isWildcard()
  • source and target test positively to equalsIgnoreMetadata(Object, Object)
  • the transformation between source and target is nevertheless and identity, e.g., same projected CRS based on a geographic one that has straight and flipped axis

ToSRS

  • EPSG:4326 - this is the usual format understood to mean forceXY order prior to WMS 1.3.0. Note that the axis order is not necessarly ( longitude , latitude ), but this is the common behavior we observe in practice.
  • AUTO:43200 -
  • CRS:84 - similar to DefaultGeographicCRS.WGS84 (formally defined by CRSAuthorityFactory)
  • ogc:uri. - understood to match the EPSG database axis order.
  • Well Known Text (WKT)

ToSRS

Some older web services are unable to deal with the full ogc:uri syntax, set simple to true for force a very simple representation that is just based on the code portion.

LookupIdentifier

This convenience method delegates its work to IdentifiedObjectFinder . Consider using the later if more control are wanted, for example if the search shall be performed only on some authority factories instead of all registered onez, or if the full identified object is wanted instead of only its identifier.

LookupIdentifier

  • if fullScan is true , then this method scans the factories in search for an object equals, ignoring metadata, to the given object. If one is found, its identifier is returned.
  • Otherwise (if fullScan is false or if no identifier was found in the previous step), this method returns null .

LookupEpsgCode

FindMathTransform

FindMathTransform

GetTransforms

FindMathTransform

Transform

Don't use this method if there is many envelopes to transform. This method is provided as a convenience when there is only one envelope to transform between CRS that can't be known in advance. If there is many of them or if the CRS are restricted to known values, get the coordinate operation or math transform once for ever and invoke one of the methods below instead (unless if performance is not a concern).

Transform

Note that this method can not handle the case where the envelope contains the North or South pole, or when it cross the ±180° longitude, because math transforms do not carry suffisient informations. For a more robust envelope transformation, use transform(CoordinateOperation, Envelope) instead.

Transform

This method can handle the case where the envelope contains the North or South pole, or when it cross the ±180° longitude.

Transform

Note that this method can not handle the case where the rectangle contains the North or South pole, or when it cross the ±180° longitude, because math transforms do not carry suffisient informations. For a more robust rectangle transformation, use transform(CoordinateOperation, Rectangle2D, Rectangle2D) instead.

Transform

This method can handle the case where the rectangle contains the North or South pole, or when it cross the ±180° longitude.

Reset

CleanupThreadLocals

GetAxisOrder

GetAxisOrder

The useBaseGeoCRS parameter is used to control behaviour for projected crs. When set to true the comparison will use the coordinate system for the underlying geographic crs object for the comparison. When set to false the comparison will use the coordinate system from projected crs itself.

By default, this method prints all enumerated objects as Well Known Text . However this method can prints different kind of information if an option such as -factories , -codes or -bursawolfs is provided.

Usage: java org.geotools.referencing.CRS [options] [codes]
Options:

-authority = name
Uses the specified authority factory, for example "EPSG" . The authority name can be any of the authorities listed by the -factories option. If this option is not specified, then the default is all factories.

-bursawolfs codes
Lists the Bursa-Wolf parameters for the specified CRS ou datum objects. For some transformations, there is more than one set of Bursa-Wolf parameters available. The standard Well Known Text format prints only what look like the "main" one. This option display all Bursa-Wolf parameters in a table for a given object.

-codes
Lists all available authority codes. Use the -authority option if the list should be restricted to a single authority.

-colors
Enable syntax coloring on ANSI X3.64 compatible (aka ECMA-48 and ISO/IEC 6429) terminal. This option tries to highlight most of the elements relevant to the equalsIgnoreMetadata method, with the addition of Bursa-Wolf parameters.

-encoding = charset
Sets the console encoding for this application output. This value has no impact on data, but may improve the output quality. This is not needed on Linux terminal using UTF-8 encoding (tip: the terminus font gives good results).

-dependencies
Lists authority factory dependencies as a tree.

-factories
Lists all availables CRS authority factories.

-forcexy
Force "longitude first" axis order.

-help
Prints the list of options.

-locale = name
Formats texts in the specified locale.

-operations sourceCRS targetCRS
Prints all available coordinate operations between a pair of CRS. This option prints only the operations explicitly defined in a database like EPSG. There is sometime many such operations, and sometime none (in which case this option prints nothing - it doesn't try to find an operation by itself).

-transform sourceCRS targetCRS
Prints the preferred math transform between a pair of CRS. At the difference of the "-operations" option, this option pick up only one operation (usually the most accurate one), inferring it if none were explicitly specified in the database.

CRS EPSG:4181 EPSG:4326 CRS:84 AUTO:42001,30,0
Prints the "Luxembourg 1930" CRS, the "WGS 84" CRS (from EPSG database), the ""WGS84" CRS (from the Web Map Service specification) and a UTM projection in WKT format.

CRS -authority=EPSG 4181 4326
Prints the "Luxembourg 1930" and "WGS 84" CRS, looking only in the EPSG database (so there is no need to prefix the codes with "EPSG" ).

CRS -colors EPSG:7411
Prints the "NTF (Paris) / Lambert zone II + NGF Lallemand" CRS with syntax coloring enabled.

CRS -bursawolfs EPSG:4230
Prints three set of Bursa-Wolf parameters for a CRS based on "European Datum 1950".

CRS -authority=EPSG -operations 4230 4326
Prints all operations declared in the EPSG database from "ED50" to "WGS 84" geographic CRS. Note that for this particular pair of CRS, there is close to 40 operations declared in the EPSG database. This method prints only the ones that Geotools can handle.

CRS -transform EPSG:4230 EPSG:4326
Prints the math transform that Geotools would use by default for coordinate transformation from "ED50" to "WGS 84".


Checking Your Results

With this set up we can test the results. The output should look like this:

To verify the data, we can use The World Coordinate Converter on the input data and compare the results.


A hazy picture emerges.

The first meeting did a pretty good job of getting everyone's desires and requirements out in the open. An unorganized list can be found in the IRC logs, a slightly higher level overview can be found in the notes. Now, a day later and with much pondering, a synthesis at the 50,000 foot level can be produced.

Our current state is that we desire n-Dimensional capability, and some aspects of the coverage facility may need to be revisited in this regards. For example ISO 19111 provides standard interfaces for spatiotemporal dimensions only. However, ISO 19111 is extensible and nothing prevent us from adding a SpectralCS class (for referencing a wavelength in a spectrum) if we want, but such addition would be non-standard. We also have to decide if it is the right thing to do on a conceptual point of view.

However, even an extended ISO 19111 may be insufficient for adequate axis representation in some sample dimension space (the "sample dimension" term come from the legacy OGC grid coverage specification. A sample dimension is a band in an image. Thus, "sample dimension" is distinct from "spatiotemporal dimensions"). It is possible that ISO 19123 falls a little bit short on those axis issues. The legacy OGC grid coverage specification editor is aware of that and submitted a proposal for ISO 19123 with better axis support. His proposal is available in the GeoAPI "pending" folder under com.owsx packages (more direct ISO 19123 translation to Java appears in org.opengis.coverage packages).

It has become apparent that to n-Dimensionally enable Geotools, we may need to modify the persistence model ( GridCoverageExchange ). Additionally, we have become aware of the need for an n-Dimensional extension to a deferred execution model, much like JAI's. For 3D coverage implemented as a stack of 2D coverages, the JAI mechanism may be sufficient. Same applies to 4D coverage implemented as a stack of 3D coverages, which cascade to stacks of 2D coverages, etc.


Renderers

Geotools has two renderer implementations:

  • LiteRenderer - a 'stateless' renderer, particularly useful in server-side environments. Main features: code simplicity and low memory footprint, but it's faster than J2D only for the first map rendering.
  • J2D - a 'stateful' renderer with optimizations for update rate, good for interactive client-side displays. It's way more complex but supports on the fly coordinate reprojection, fast update by intelligent data decimation and memory caching.

Displaying coordinate references in GeoTools? - Geographic Information Systems

Grid coverages are usually two-dimensional. However, their envelope may have more than two dimensions. For example, a remote sensing image may be valid only over some time range (the time of satellite pass over the observed area). Envelopes for such grid coverage can have three dimensions: the two usual ones (horizontal extent along x and y ), and a third one for start time and end time (time extent along t ). However, the grid range for all extra-dimension must have a size not greater than 1. In other words, a GridCoverage2D can be a slice in a 3 dimensional grid coverage. Each slice can have an arbitrary width and height (like any two-dimensional images), but only 1 voxel depth (a "voxel" is a three-dimensional pixel).

Serialization note:
Because it is serializable, GridCoverage2D can be included as method argument or as return type in Remote Method Invocation (RMI). However, the pixel data are not sent during serialization. Instead, the image data are transmitted "on-demand" using socket communications. This mechanism is implemented using JAI SerializableRenderedImage class. While serialization (usually on server side) should work on J2SE 1.4 and above, deserialization (usually on client side) of GridCoverage2D instances requires J2SE 1.5.


Displaying coordinate references in GeoTools? - Geographic Information Systems

public class Renderer extends java.lang.Object implements Renderer2D

A renderer for drawing map objects into a Graphics2D . A newly constructed Renderer is initially empty. To make something appears, RenderedLayer s must be added using one of addLayer(. ) methods. The visual content depends of the RenderedLayer subclass. It may be an isoline ( RenderedGeometries ), a remote sensing image ( RenderedGridCoverage ), a set of arbitrary marks ( RenderedMarks ), a map scale ( RenderedMapScale ), etc.

Version: $Id: Renderer.java 17890 2006-02-06 08:46:14Z desruisseaux $ Author: Martin Desruisseaux

Field Summary
protected java.awt.RenderingHints hints
Deprecated. A set of rendering hints.
protected java.beans.PropertyChangeSupport listeners
Deprecated. Listeners to be notified about any changes in this layer's properties.
Constructor Summary
Renderer (java.awt.Component owner)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D .
Method Summary
void addLayer (RenderedLayer layer)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#add .
void addPropertyChangeListener (java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener .
void addPropertyChangeListener (java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener .
void dispose ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#dispose .
javax.swing.Action getAction (GeoMouseEvent event)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getAction .
CoordinateSystem getCoordinateSystem ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getObjectiveCRS .
int getLayerCount ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getGraphics .
RenderedLayer[] getLayers ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getGraphics .
java.util.Locale getLocale ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getLocale .
java.lang.String getName (java.util.Locale locale)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getTitle .
ImageType getOffscreenBuffered (float zOrder)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getOffscreenBuffered .
java.awt.geom.Rectangle2D getPreferredArea ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getEnvelope2D .
java.awt.geom.Dimension2D getPreferredPixelSize ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getTypicalCellDimension .
java.lang.Object getRenderingHint (java.awt.RenderingHints.Key key)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getRenderingHint .
float getScale ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getScale .
java.lang.String getToolTipText (GeoMouseEvent event)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getToolTipText .
void paint (java.awt.Graphics2D graph, java.awt.geom.AffineTransform zoom, java.awt.Rectangle zoomableBounds)
Deprecated. Use paint(Graphics2D, Rectangle, AffineTransform) instead.
void paint (java.awt.Graphics2D graph, java.awt.Rectangle zoomableBounds, java.awt.geom.AffineTransform zoom)
Deprecated. Use paint(Graphics2D,Rectangle,AffineTransform,boolean) instead.
void paint (java.awt.Graphics2D graph, java.awt.Rectangle zoomableBounds, java.awt.geom.AffineTransform zoom, boolean isPrinting)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#paint .
void removeAllLayers ()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removeAll .
void removeLayer (RenderedLayer layer)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#remove .
void removePropertyChangeListener (java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener .
void removePropertyChangeListener (java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener .
void setCoordinateSystem (CoordinateSystem cs)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setObjectiveCRS .
void setOffscreenBuffered (float lower, float upper, ImageType type)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setOffscreenBuffered .
void setRenderingHint (java.awt.RenderingHints.Key key, java.lang.Object value)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setRenderingHint .
java.lang.String toString ()
Deprecated. Returns a string representation of this renderer and all its RenderedLayer s.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Hints

See Also: Hints.FINEST_RESOLUTION , Hints.REQUIRED_RESOLUTION , Hints.COORDINATE_TRANSFORMATION_FACTORY , Hints.PREFETCH , RenderingHints.KEY_RENDERING , RenderingHints.KEY_COLOR_RENDERING , RenderingHints.KEY_INTERPOLATION

Listeners

Renderer

Construct a new renderer for the specified component.

Parameters: owner - The widget that own this renderer, or null if none.

Method Detail

GetName

Returns this renderer's name. The default implementation returns the title of the window which contains the map pane.

Parameters: locale - The desired locale, or null for a default locale. Returns: This renderer's name, or null if none. See Also: getLocale() , Component.getName() , RenderedLayer.getName(java.util.Locale)

GetLocale

Returns to locale for this renderer. The renderer will inherit the locale of its Component , if it have one. Otherwise, a default locale will be returned.

See Also: Component.getLocale() , JComponent.getDefaultLocale() , Locale.getDefault()

GetCoordinateSystem

Returns the view coordinate system. This is the "real world" coordinate system used for displaying all RenderedLayer s. Note that underlying data in RenderedLayer s doesn't need to be in this coordinate system: transformations will performed on the fly as needed at rendering time.

Returns: The two dimensional coordinate system used for display.

SetCoordinateSystem

Set the view coordinate system. This is the "real world" coordinate system to use for displaying all RenderedLayer s. Layers are notified of the coordinate system change with RenderedLayer.setCoordinateSystem(org.geotools.cs.CoordinateSystem) .

Parameters: cs - The view coordinate system. If the specified coordinate system has more than two dimensions, then it must be a CompoundCoordinateSystem with a two dimensional headCS . Throws: org.opengis.referencing.operation.TransformException - If cs can't be reduced to a two-dimensional coordinate system, or if data can't be transformed for some other reason.

GetPreferredArea

Returns a bounding box that completely encloses all layer's preferred area, visible or not. This bounding box should be representative of the geographic area to drawn. Coordinates are expressed in this renderer's coordinate system.

Returns: The enclosing area computed from available data, or null if this area can't be computed.

GetPreferredPixelSize

Returns the preferred pixel size in "real world" coordinates. For image layers, this is the size of image's pixels. For other kind of layers, "pixel size" are to be understood as some dimension representative of the layer's resolution. This method invokes RenderedLayer.getPreferredPixelSize() for each layers and returns the finest resolution.

Returns: The preferred pixel size in "real world" coordinates (in this renderer's coordinate system) or null if no layer provided a preferred pixel size. Task: TODO: Transformations should use MathTransform.derivative(. ) instead, but it is not yet implemented for projections.

GetScale

Returns the scale factor, or Float.NaN if the scale is unknow. The scale factor is usually smaller than 1. For example for a 1:1000 scale, the scale factor will be 0.001. This scale factor takes in account the physical size of the rendering device (e.g. the screen size) if such information is available. Note that this scale can't be more accurate than the information supplied by the underlying system.

Returns: The rendering scale factor as a number between 0 and 1, or Float.NaN . See Also: RenderingContext.getScale()

AddLayer

Add a new layer to this renderer. A Renderer do not draw anything as long as at least one layer hasn't be added. A RenderedLayer can be anything like an isobath, a remote sensing image, city locations, map scale, etc. The drawing order (relative to other layers) is determined by the z-order property. A RenderedLayer object can be added to only one Renderer object.

Parameters: layer - Layer to add to this Renderer . This method call will be ignored if layer has already been added to this Renderer . Throws: java.lang.IllegalArgumentException - If layer has already been added to an other Renderer , or if the layer can't be added for some other reason. See Also: removeLayer(org.geotools.renderer.j2d.RenderedLayer) , removeAllLayers() , getLayers() , getLayerCount()

RemoveLayer

Remove a layer from this renderer. Note that if the layer is going to be added back to the same renderer later, then it is more efficient to invoke RenderedLayer.setVisible (false) .

Parameters: layer - The layer to remove. This method call will be ignored if layer has already been removed from this Renderer . Throws: java.lang.IllegalArgumentException - If layer is owned by an other Renderer than this . See Also: addLayer(org.geotools.renderer.j2d.RenderedLayer) , removeAllLayers() , getLayers() , getLayerCount()

RemoveAllLayers

Remove all layers from this renderer.

GetLayers

Returns all registered layers. The returned array is sorted in increasing z-order: element at index 0 contains the first layer to be drawn.

Returns: The sorted array of layers. May have a 0 length, but will never be null . Change to this array, will not affect this Renderer . See Also: addLayer(org.geotools.renderer.j2d.RenderedLayer) , removeLayer(org.geotools.renderer.j2d.RenderedLayer) , removeAllLayers() , getLayerCount()

GetLayerCount

Returns the number of layers in this renderer.

GetRenderingHint

Parameters: key - The hint key (e.g. Hints.FINEST_RESOLUTION ). Returns: The hint value for the specified key, or null if there is no hint for the specified key. See Also: Hints.FINEST_RESOLUTION , Hints.REQUIRED_RESOLUTION , Hints.COORDINATE_TRANSFORMATION_FACTORY , Hints.PREFETCH , RenderingHints.KEY_RENDERING , RenderingHints.KEY_COLOR_RENDERING , RenderingHints.KEY_INTERPOLATION

SetRenderingHint

Add a rendering hint. Hints provides optional information used by some rendering code.

Parameters: key - The hint key (e.g. Hints.FINEST_RESOLUTION ). value - The hint value. A null value remove the hint. See Also: Hints.FINEST_RESOLUTION , Hints.REQUIRED_RESOLUTION , Hints.COORDINATE_TRANSFORMATION_FACTORY , Hints.PREFETCH , RenderingHints.KEY_RENDERING , RenderingHints.KEY_COLOR_RENDERING , RenderingHints.KEY_INTERPOLATION

GetOffscreenBuffered

Returns the offscreen buffer type for the given z-order. This is the value of the type argument given to the last call to setOffscreenBuffered(. ) for a range containing zOrder .

Parameters: zOrder - The z-order to query. Returns: One of ImageType.NONE , ImageType.VOLATILE or ImageType.BUFFERED enumeration.

SetOffscreenBuffered

Enable or disable the use of offscreen buffer for all layers in the given range of z-orders. When enabled, all layers in the given range will be rendered once in an offscreen buffer (for example an VolatileImage ) the image will then been reused as much as possible. The offscreen buffer may be invalidate at any time by some external event (including a call to any of RenderedLayer.repaint() methods) and will be recreated as needed. Using offscreen buffer for background layers that do not change often (e.g. a background map) help to make the GUI more responsive to frequent changes in foreground layers (e.g. a glass pane with highlighted selections).

An arbitrary amount of ranges can be specified. Each distinct range will use its own offscreen buffer. This means that if this method is invoked twice for enabling buffering in overlapping range of z-values, then the union of the two ranges will shares the same offscreen image.

Parameters: lower - The lower z-order, inclusive. upper - The upper z-order, inclusive. type - ImageType.VOLATILE for enabling offscreen buffering for the specified range, or ImageType.NONE for disabling it.

Paint

Paint this Renderer and all visible layers it contains. This method invokes RenderedLayer.paint(org.geotools.renderer.j2d.RenderingContext) for each layer.

Parameters: graph - The graphics handler. zoom - The zoom (usually provided by ZoomPane.zoom . zoomableBounds - The bounds of drawing area (usually provided by ZoomPane.getZoomableBounds(java.awt.Rectangle) ).

Paint

Paint this Renderer and all visible layers it contains.

Specified by: paint in interface Renderer2D Parameters: graph - The graphics handler to draw to. zoomableBounds - The bounds of the output area in output units (usually pixels). The upper left corner is (0,0) in most cases. However, a different value is allowed if some widget area must be preserved, for example a margin on the left and top size for painting a graduation. zoom - A transform which converts "World coordinates" to output coordinates. This transform will be concatenated to the graphics transform (as of graphics. transform (transform) ) before the rendering take place.

Paint

Paint this Renderer and all visible layers it contains. This method invokes RenderedLayer.paint(org.geotools.renderer.j2d.RenderingContext) for each layer.

Parameters: graph - The graphics handler to draw to. zoomableBounds - The bounds of the output area in output units (usually pixels). Those bounds are usually provided by ZoomPane.getZoomableBounds(java.awt.Rectangle) ). zoom - A transform which converts "World coordinates" to output coordinates. This transform is usually provided by ZoomPane.zoom . isPrinting - true if the map is printed instead of painted on screen. When printing, layers like RenderedGridCoverage should block until all data are available instead of painting only available data and invokes RenderedLayer.repaint() later.

GetToolTipText

Returns the string to be used as the tooltip for a given mouse event. This method queries registered layers in decreasing z-order until one is found to returns a non-null string. Note: This method is not a commited part of the API. It may moves elsewhere in a future version.

Parameters: event - The mouse event. Returns: The tool tip text, or null if there is no tool tip for the given mouse location.

GetAction

Returns the action to be used for a given mouse event. This method queries registered layers in decreasing z-order until one is found to returns a non-null action. Note: This method is not a commited part of the API. It may moves elsewhere in a future version.

Parameters: event - The mouse event. Returns: The action, or null if there is no action for the given mouve event.

AddPropertyChangeListener

Add a property change listener to the listener list. The listener is registered for all properties. For example, adding or removing layers may fire a "preferredArea" change events.

Parameters: listener - The property change listener to be added

AddPropertyChangeListener

Add a PropertyChangeListener for a specific property. The listener will be invoked only when that specific property changes.

Parameters: propertyName - The name of the property to listen on. listener - The PropertyChangeListener to be added.

RemovePropertyChangeListener

Remove a property change listener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters: listener - The property change listener to be removed

RemovePropertyChangeListener

Remove a PropertyChangeListener for a specific property.

Parameters: propertyName - The name of the property that was listened on. listener - The PropertyChangeListener to be removed.

Dispose

Provides a hint that a renderer will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this renderer, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative.


GeoTools: An android phone application in geology

GeoTools is an Android application that can carry out several tasks essential in geological field studies. By employing the accelerometer in the Android phone, the application turns the handset into a pocket transit compass by which users can measure directions, strike and dip of a bedding plane, or trend and plunge of a fold. The application integrates functionalities of photo taking, videotaping, audio recording, and note writing with GPS coordinates to track the location at which each datum was taken. A time-stamped file name is shared by the various types of data taken at the same location. Data collected at different locations are named in a chronological sequence. At the end of each set of operations, GeoTools also automatically generates an XML file to summarize the characteristics of data being collected corresponding to a specific location. In this way, GeoTools allows geologists to use a multimedia approach to document their field observations with a clear data organization scheme in one handy gadget.

Highlights

► The application makes the Android phone a digital field assistant. ► The application can measure the strike and dip of a plane. ► The application can record multimedia data. ► GPS coordinates are used to index the recorded data. ► Time stamps are used to facilitate the post-trip data sorting and correlation.


Watch the video: Γ. Πλακιωτάκης: Ενίσχυση της ασφάλειας στις παραλίες της χώρας