On Wed, Jan 25, 2012 at 11:21 AM, Rainer Suddendorf <[email protected]>wrote:

> Hi,
>
> if I use EPSG:3146x our WMS Server does not return an image. I found
> out, that the axises mut be swapped in WMS 1.3.0. The current code in
> WMSCoverageReader is:
>
>  if(requestCRS instanceof GeographicCRS && flipGeographic) {
>             requestEnvelope = flipEnvelope(requestEnvelope);
>  }
>
> I think, the test must take the axis order into account:
>
> String orientation = requestCRS.getCoordinateSystem().getAxis(0).getName()
>                     .getCode();
> if ("Northing".equals(orientation) || "Southing".equals(orientation)
> ||"Geodetic latitude".equals(orientation)) {
>
>
You are looking at old code. The current code base evaluates the axis order
this way:

private boolean axisFlipped(String srsName) {
        Version version = new Version(wms.getCapabilities().getVersion());
        if(version.compareTo(new Version("1.3.0")) < 0) {
            // aah, sheer simplicity
            return false;
        } else {
            // gah, hell gates breaking loose
            if(srsName.startsWith("EPSG:")) {
                try {
                    String epsgNative =
 "urn:x-ogc:def:crs:EPSG:".concat(srsName.substring(5));
                    return CRS.getAxisOrder(CRS.decode(epsgNative)) ==
AxisOrder.NORTH_EAST;
                } catch(Exception e) {
                    LOGGER.log(Level.WARNING, "Failed to determine axis
order for "
                            + srsName + ", assuming east/north", e);
                    return false;
                }
            } else {
                // CRS or AUTO, none of them is flipped so far
                return false;
            }
        }
    }

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to