geotools/geotools — pull request #40 by jive (2012-10-12 13:03:24+00:00)
Title: WMS 1.3.0 support with transforms in Layer.getEnvelope and GetMap.setBounds( Envelope )

TLDR: Use CRS.transform to handle bounding boxes correctly when served by Layer, or when added using GetMapRequest. Refactor out a common method for toServerCRS for consistent handling

For context of this issue see https://jira.codehaus.org/browse/GEOT-4283 WMS 1.3.0 GetMap Request

The main change here is a toServerCRS method which takes server version into account when determining a CoordinateReferenceSystem.

* CRSEnvelope.getCoordinateReferenceSystem(). Use toServerCRS() to ensure the data structure matches the server description. This allows Layer.getEnvelope will then use a transform to process the data into the Envelope the user expects (according the global forceXY setting).

* GetMap.setBounds(Envelope): Uses toServerCRS() to transform the Envelope into the order expected by the Server.

Implementation notes:
- This pull request contains no changes to ft-referencing
- Considered delaying transform to server CRS until executing the GetMapRequest. Rejected to ensure the GetMapRequest matches what we send over.
- The methods used by WMS cascade - setBounds( String ) and setSRS( String ) remain fire and forget and do not make any attempt at consistency.