Changes between Initial Version and Version 1 of Help/Concepts/Coordinates


Ignore:
Timestamp:
2010-01-29T22:07:46+01:00 (16 years ago)
Author:
stoecker
Comment:

Recreated page with correct name

Legend:

Unmodified
Added
Removed
Modified
  • Help/Concepts/Coordinates

    v1 v1  
     1[[TranslatedPages]]
     2[[TOC(inline)]]
     3
     4= Understanding JOSM Coordinates =
     5
     6== Openstreetmap coordinates ==
     7
     8Openstreetmap uses Latitude/Longitude coordinates in the [http://en.wikipedia.org/wiki/World_Geodetic_System WGS84] [http://en.wikipedia.org/wiki/Geodetic_datum geodetic datum] (being compatible with GPS) for its [http://wiki.openstreetmap.org/wiki/Data_Primitives#Node nodes], stored in decimal degree notation with 7 decimal places in the [http://wiki.openstreetmap.org/wiki/.osm .osm] XML files.
     9
     10The same spot on earth would have slightly different Latitude/Longitude values in other coordinate systems, depending on the respective [http://en.wikipedia.org/wiki/Reference_ellipsoid reference ellipsoid] and reference points being used.
     11
     12== Editor coordinates ==
     13
     14=== Java ===
     15To render nodes and ways on the rectangular, flat computer screen, the location of the nodes needs to be reversibly mapped into a [http://en.wikipedia.org/wiki/Cartesian_coordinates cartesian] coordinate system, i.e. having perpendicular axes. JOSM uses the [http://java.sun.com/docs/books/tutorial/2d/overview/index.htm Java 2D graphics API] to take care of the rendering process. The Java API implements the concept of a [http://java.sun.com/docs/books/tutorial/2d/overview/coordinate.html user space] that could be understood as a large canvas with an origin (0,0) in the top left corner, and virtually infinite extension to the right (x) and down (y). Java 2D supports both integers and single or double precision float variables for the (x,y) pair.
     16
     17When displaying an area from this virtual canvas to the limited device space, the screen window in this case, Java internally converts these (x,y) coordinates to screen coordinates, automatically during rendering.
     18
     19Although negative coordinates, going left of or above the (0,0) origin, are theoretically possible, it is not recommended to draw outside of the available screen space, as not all Java version work reliably with points outside of the visible area.
     20
     21=== JOSM ===
     22JOSM defines the coordinates to be used both for Lat/Lon representation as well as the EastNorth editor canvas as '''{{{double float}}}''' in the class [source:/trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java Coordinate].
     23
     24==== LatLon ====
     25The class [source:/trunk/src/org/openstreetmap/josm/data/coor/LatLon.java LatLon] inherits from [source:/trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java Coordinate] and provides checks for the legitimate bounds of being within -90,90 for the latitude or -180,180 for the longitude.
     26
     27==== EastNorth ====
     28The class [source:/trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java EastNorth] inherits from [source:/trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java Coordinate].
     29
     30{{{east()}}} returns the x and {{{north()}}} returns the y coordinate.
     31
     32This means that the numerical value of east() ''increases'' towards East, while the value of north() ''decreases'' towards North.
     33
     34The class also provides some methods for manipulating the coordinates. 
     35
     36=== Projection ===
     37
     38The reversible mapping from LatLon coordinates to a flat map or the flat computer screen is a [http://en.wikipedia.org/wiki/Map_projection projection]. JOSM supports a number of different projections because they have different use cases, in particular in the representation of shapes or the usage of different source material which comes already projected, such as printed maps, land registry data, satellite imagery, WMS servers, etc. to be traced over.  Some WMS servers may support a variety of projections on request, others are limited to a specific one.
     39
     40The projections are defined in classes in [source:/trunk/src/org/openstreetmap/josm/data/projection org.openstreetmap.josm.data.projection].
     41
     42Using JOSM, the projection can be switched in the Preferences menu. Current versions of JOSM support switching without restart.
     43
     44When switching projection, the same LatLon coordinate becomes represented as different numerical values of EastNorth.
     45
     46The bidirectional conversion between LatLon and EastNorth is the core calculation of each implementation of the class [source:/trunk/src/org/openstreetmap/josm/data/projection/Projection.java Projection]. The implementation needs to take care that the valid range of LatLon values is mapped to a valid range of EastNorth values.
     47
     48Since some projections are valid only for certain regions of the earth, the implementation can also define boundaries in which JOSM can edit, i.e. pan the device window over the user space.
     49
     50Some use cases for projections supported in JOSM are summarised below.
     51
     52==== Mercator ====
     53
     54The cylindrical [http://en.wikipedia.org/wiki/Mercator_projection Mercator] projection, named after its inventor,
     55maps meridians and parallels straight and perpendicular.
     56
     57In JOSM, e.g. small round objects such as roundabouts appear as a circle,
     58and rectangular buildings are seen rectangular.
     59
     60Disadvantage is the stretching of the poles to infinity.
     61
     62Currently Mercator is the standard projection in JOSM.
     63
     64Most WMS servers don't support this projection, but JOSM does display EPSG:4326 data also for Mercator projection (which is not completely correct, but the resulting errors are small in the current version of the software).
     65
     66==== EPSG:4326 ====
     67
     68[http://en.wikipedia.org/wiki/EPSG:4326 EPSG:4326] is a common Lat/Lon coordinate reference system that refers to WGS84.
     69
     70(discuss need for WMS servers / Landsat and Yahoo Sat usage)
     71
     72==== UTM ====
     73
     74The [http://en.wikipedia.org/wiki/Transverse_Mercator_projection Transverse Mercator] projection is an adaptation of the Mercator projection,
     75rotating the cylinder 90°.
     76
     77The [http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system Universal Transverse Mercator] (UTM) with its 60 zones, as well as a number
     78of national grid reference systems, are based on this projection.
     79
     80Within UTM zones or the national grid systems, a reference of 2-dimensional cartesian coordinates can be defined,
     81typically given in [http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#Locating_a_position_using_UTM_coordinates Eastings and Northings]
     82as a meter value from a particular point of origin.  These Eastings and Northings must not be confused with the EastNorth coordinate within JOSM.
     83
     84==== Country-specific projections ====
     85
     86Many countries specify their own reference systems, some based on Transverse Mercator, some not.
     87
     88In general, JOSM can support any of these systems as soon as the LatLon to EastNorth conversion has been implemented.
     89
     90It is planned to have support for PROJ4 library as plugin, which supports lots of transformations.