Ignore:
Timestamp:
2015-07-08T20:59:09+02:00 (4 years ago)
Author:
wiktorn
Message:
  • added axis definition to ESPG projections definition, where it's not default (i.e. North/East)
  • added switchXY boolean in Projection interface
  • WMTS and WMS (1.3.0) uses now switchXY when doing requests against servers
  • better error reporting when there are problems with parsing the WMTS TileSource

Addresses: #10623

Now http://webgis.linz.at/WMTS/1.0.0/getCapabilities.xml should work.

Wallonie services still being debugged.

Location:
trunk/src/org/openstreetmap/josm/data/projection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r8570 r8584  
    5050    protected Bounds bounds;
    5151    private double metersPerUnit = METER_PER_UNIT_DEGREE; // default to degrees
     52    private String axis = "enu"; // default axis orientation is East, North, Up
    5253
    5354    /**
     
    9899        no_defs("no_defs", false),
    99100        init("init", true),
     101        /** crs units to meter multiplier */
    100102        to_meter("to_meter", true),
     103        /** definition of axis for projection */
     104        axis("axis", true),
    101105        // JOSM extensions, not present in PROJ.4
    102106        wmssrs("wmssrs", true),
     
    212216            if (s != null) {
    213217                this.metersPerUnit = parseDouble(s, Param.to_meter.key);
     218            }
     219            s = parameters.get(Param.axis.key);
     220            if (s != null) {
     221                this.axis  = s;
    214222            }
    215223        }
     
    548556    }
    549557
     558    @Override
     559    public boolean switchXY() {
     560        // TODO: support for other axis orientation such as West South, and Up Down
     561        return this.axis.startsWith("ne");
     562    }
     563
    550564    private static Map<String, Double> getUnitsToMeters() {
    551565        Map<String, Double> ret = new ConcurrentHashMap<>();
  • trunk/src/org/openstreetmap/josm/data/projection/Projection.java

    r8568 r8584  
    7979     */
    8080    double getMetersPerUnit();
     81
     82    /**
     83     * Does this projection natural order of coordinates is North East,
     84     * instead of East North
     85     *
     86     * @return true if natural order of coordinates is North East, false if East North
     87     */
     88    boolean switchXY();
    8189}
Note: See TracChangeset for help on using the changeset viewer.