Opened 14 years ago
Closed 14 years ago
#3875 closed enhancement (fixed)
Understanding JOSM Coordinates
Reported by: | Polarbear | Owned by: | Polarbear |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | coordinates, UTM, doc | Cc: |
Description
Hi, after spending a weekend reading the code and the web to understand the usage of coordinates in JOSM, and obtaining some half-knowledge, I have created this page:
http://josm.openstreetmap.de/wiki/Help/Concepts/Coordinates
containing my observations, assumptions and some questions.
I would appreciate if the developers, in particular those with the geodetic expertise, can review and correct.
Still wondering if the numeric North indeed should be called South, or is the rendering being flipped somewhere else?
(I tried to keep terminology consistent, but still see java code through C glasses, being amused how programmers Try to play Catch...)
@Gubaer, I still had a local copy of the text when you had changed the URL... :)
Attachments (0)
Change History (7)
comment:1 by , 14 years ago
follow-up: 3 comment:2 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
I fixed some things:
Question: still, and depending on the implementation of the formulas, would there be some intrinsic relation
between a UTM reference and the JOSM-EastNorth coordinate?
What do you want to know here?
ASSUMPTION: So, as UTM-specific Eastings and Northings are not used in the core JOSM, implementation of the
respective formulas is not mandatory, but could potentially support JOSM-plugins to handle country-specific
datasets using these references.
And here?
Could somebody please explain what QuadTiling and QuadBuckets are and why the world is divided...
Generally we need a way to access data based on the current screen position instead of searching the whole tree. The Quad... structures are the first step to reach that goal by storing the data based on position and not only in a liked list or array. I think this has nothing to do with projection and coordinate handling at all, or does it?
comment:3 by , 14 years ago
Replying to stoecker:
I fixed some things
Thanks. Hope you found that way of asking questions productive.
intrinsic relation between a UTM reference and the JOSM-EastNorth coordinate?
and
ASSUMPTION: So, as UTM-specific Eastings and Northings are not used in the core JOSM, implementation of the
respective formulas is not mandatory, but could potentially support JOSM-plugins to handle country-specific
datasets using these references.
Basically the same question speculating about the relation between UTM (or national) grid refs
and the JOSM-EastNorth. As I understand JOSM does not need to know about any grid refs, while
a plugin might be interested. So, depending how the latlon2eastNorth is implemented,
a function latlon2gridref cold be very simple.
QuadTiling and QuadBuckets are and why the world is divided...
I think this has nothing to do with projection and coordinate handling at all, or does it?
Apparently not, I just found the QuadTiling.java in the data/coor directory and got curious
what is is for. Thanks.
follow-up: 5 comment:4 by , 14 years ago
Actually EastNorth IS Projection coordinates (i.e. UTM). I don't know if JOSM will work with projections, where this is not true. I think we silently assume that the results are east/north and rectangular (the east-north orientation is only a convertion and can be ignored - e.g. for polar projections :-).
E.G. WMS plugins assumes that EastNorth is equal to projected coordinates.
Actually we have 3 coordinate systems. LatLon (since my last rework ALWAYS the base), EastNorth as projection variant and screen coordinates for display. Only LatLon should be used to store values, all others are to be used temporary only.
And currently there are still some problems left (i.e. coordinates outside projection area, ...) which must be fixed or switching projection for image layers.
comment:5 by , 14 years ago
Replying to stoecker:
Actually EastNorth IS Projection coordinates (i.e. UTM).
That's what I guessed from how it is calculated (without reading the cited book).
Except that I'm still confused with the EastNorth decreasing towards north,
while a grid reference Northing would increase towards north.
I don't know if JOSM will work with projections, where this is not true. I think we silently assume that the results are east/north and rectangular (the east-north orientation is only a convertion and can be ignored - e.g. for polar projections :-).
E.G. WMS plugins assumes that EastNorth is equal to projected coordinates.
Actually we have 3 coordinate systems. LatLon (since my last rework ALWAYS the base), EastNorth as projection variant and screen coordinates for display. Only LatLon should be used to store values, all others are to be used temporary only.
Hm I understood that EastNorth is the screen (or canvas) user-space coordinate as being used by Java2D, no? (and the display coordinate internally handled by Java as device-space). That's what I tried to document on that wiki page yesterday.
As long as EastNorth is only used by JOSM core it does not matter if it is the projected grid ref or not, i.e. you could shift everything by 10000 and it looks all the same. As soon as somebody
assumes that these are identical to grid refs and used to grab tiles or so, that should be
explicitly said, and a function encapsule that (even if the implementation is just returning the
internal EastNorth). This would prevent a change of implementation of the internal conversion break
a plugin.
And currently there are still some problems left (i.e. coordinates outside projection area, ...) which must be fixed or switching projection for image layers.
comment:6 by , 14 years ago
Oh, seems I overlooked some parts (well, yesterday was not my best day anyway). Coordinates increase into north and into east. Screen coordinates are not equal to EastNorth. EastNorth should better be "ProjectedCoordinates". These are then changed regarding axis directions and point of origin for display. Display coordinates are only used for immediate actions regarding drawing and mouse actions.
comment:7 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | needinfo → closed |
Closing this one. wiki page now exists and work can continue there.
lucky me :-)