source: josm/trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java@ 9108

Last change on this file since 9108 was 8568, checked in by wiktorn, 9 years ago

Basic WMTS support.

  • added information about units and to_meter to EPSG projection definitions (needed for WMTS)
  • added WMTSTileSource and WMTSLayer classes
  • a bit of cleanup of AbstractTileSourceLayer and align so it will work properly with WMTS tile definitions
  • added Imagery Preferences panel for WMTS and icon for button
  • added removal of wms: / tms: / wmts: prefix, if user will paste them into the field
  • CachedFile - added possibility to send custom headers with request
  • added support for unit and to_meter in CustomProjection
  • AbstractTMSTileSource cleanups (change of Coordinate to ICoordinate)
  • moved JCSCachedTileLoaderJob.read() to Utils

Addresses: #10623

Tested with Polish WMTS service proivders, Walonnie needs still some debugging, as it is not working right now.

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection.proj;
3
4import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
5
6/**
7 * A projection (in the narrow sense).
8 *
9 * Converts lat/lon the east/north and the other way around.
10 *
11 * Datum conversion, false easting / northing, origin of longitude
12 * and general scale factor is already applied when the projection is invoked.
13 *
14 * Lat/lon is not in degrees, but in radians (unlike other parts of JOSM).
15 * Additional parameters in the constructor arguments are usually still in
16 * degrees. So to avoid confusion, you can follow the convention, that
17 * coordinates in radians are called lat_rad/lon_rad or phi/lambda.
18 *
19 * East/north values are not in meters, but in meters divided by the semi major
20 * axis of the ellipsoid (earth radius). (Usually this is what you get anyway,
21 * unless you multiply by 'a' somehow implicitly or explicitly.)
22 *
23 */
24public interface Proj {
25
26 /**
27 * Replies a human readable name of this projection.
28 * @return The projection name. must not be null.
29 */
30 String getName();
31
32 /**
33 * Replies the Proj.4 identifier.
34 *
35 * @return The Proj.4 identifier (as reported by cs2cs -lp).
36 * If no id exists, return {@code null}.
37 */
38 String getProj4Id();
39
40 /**
41 * Initialize the projection using the provided parameters.
42 * @param params The projection parameters
43 *
44 * @throws ProjectionConfigurationException in case parameters are not suitable
45 */
46 void initialize(ProjParameters params) throws ProjectionConfigurationException;
47
48 /**
49 * Convert lat/lon to east/north.
50 *
51 * @param lat_rad the latitude in radians
52 * @param lon_rad the longitude in radians
53 * @return array of length 2, containing east and north value in meters,
54 * divided by the semi major axis of the ellipsoid.
55 */
56 double[] project(double lat_rad, double lon_rad);
57
58 /**
59 * Convert east/north to lat/lon.
60 *
61 * @param east east value in meters, divided by the semi major axis of the ellipsoid
62 * @param north north value in meters, divided by the semi major axis of the ellipsoid
63 * @return array of length 2, containing lat and lon in radians.
64 */
65 double[] invproject(double east, double north);
66}
Note: See TracBrowser for help on using the repository browser.