Hello all,
I'm using UTM to project coordinates to a screen. One coordinate is the reference (basically 0,0 on the screen). Then I'm translating easting/northing to x,y on the screen. Everything works fine, as long as all coordinates are within the same zone, e.g. easting and northing use the same reference.
This obviously doesn't work when the coordinates are in a zone different from the reference coordinate. I suspect that this is what the alternate zone is there for, however the documentation just says
* The mutable state consists of the UTM or UPS coordinates for a alternate
* zone. A method SetAltZone is provided to set the alternate UPS/UTM zone.
Am I interpreting the use case for the alternate zone correctly or do I have to do the mapping between different zones by hand?
Thanks in advance
Jorg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you setting the coordinates from latitude + longitude with the GeoCoords class? If so, you can specify your preferred zone with GeoCoords::Reset(lat, lon, zone). In this case, you don't have to bother with the AltZone.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is quick. Yes, I'm using latitude + longitude, but at the time of creation I don't know what will be the reference zone. The center of the map comes from a live GPS feed, so the zone might change from moment to moment. I'd prefer to query Easting/Northing with a zone number...
Is this what the AltZone is meant for or do I have to duplicate each coordinate with the current zone number?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not really. Set your first point with GeoCoords(lat, lon). Get its zone with Zone(). Then set subsequent points with Reset(lat, lon, zone). But be aware that there's only about 100 km overlap between zones. So this won't work for points arbitrarily far from the starting point.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't now remember why I implemented the alternate zone. I can envision situations where you need to keep track of the coordinates in two different zones. Maybe I can look at improving the documentation...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I'm using UTM to project coordinates to a screen. One coordinate is the reference (basically 0,0 on the screen). Then I'm translating easting/northing to x,y on the screen. Everything works fine, as long as all coordinates are within the same zone, e.g. easting and northing use the same reference.
This obviously doesn't work when the coordinates are in a zone different from the reference coordinate. I suspect that this is what the alternate zone is there for, however the documentation just says
Am I interpreting the use case for the alternate zone correctly or do I have to do the mapping between different zones by hand?
Thanks in advance
Jorg
Are you setting the coordinates from latitude + longitude with the GeoCoords class? If so, you can specify your preferred zone with
GeoCoords::Reset(lat, lon, zone)
. In this case, you don't have to bother with theAltZone
.That is quick. Yes, I'm using latitude + longitude, but at the time of creation I don't know what will be the reference zone. The center of the map comes from a live GPS feed, so the zone might change from moment to moment. I'd prefer to query Easting/Northing with a zone number...
Is this what the AltZone is meant for or do I have to duplicate each coordinate with the current zone number?
Not really. Set your first point with
GeoCoords(lat, lon)
. Get its zone withZone()
. Then set subsequent points withReset(lat, lon, zone)
. But be aware that there's only about 100 km overlap between zones. So this won't work for points arbitrarily far from the starting point.Charles, thanks for the explanation. I will follow your suggestion.
Out of curiosity: Can you explain the actual purpose of the alternate zone? And maybe add this to the documentation?
Thanks
Jorg
I don't now remember why I implemented the alternate zone. I can envision situations where you need to keep track of the coordinates in two different zones. Maybe I can look at improving the documentation...