Closed DaveIR closed 5 years ago
Can you be more specific about which UTM zone you are working in?
UTM Zone 30N (if doing N/S only), or 30U. Lat/Long of 55.9 N, 4.3 W Sunny Glasgow, Scotland :-)
Is it EPSG:32630 or EPSG:25830 ?
Not sure it is either of those. I was using [EPSG 3857] (https://epsg.io/3857) as used in Google maps projection as I want to produce a KMZ file using the website below:
http://www.p.fne.com.au/rg/cgi-bin/o-utils.cgi?act=manager&keksi=
Thanks for your replys. I am not familiar with the tool you link, so I won't help you with that.. Maybe it is a red herring, but the problem might be in the conversion between different ellipsoids, and then the UTM variant you use for your geodata would be very important (EPSG:32630 would mean there is no ellipsoid transformation and hence the problem is somewhere else).
Don't use EPSG 3857. It was invented for Web cartography, and Mapper doesn't really support it at the moment. Cf. https://github.com/OpenOrienteering/mapper/issues/1197. (It will probably get better after integration of pull request #1210, which I am currently revising.)
Thanks for the various replies. I was trying to use EPSG 3857 so that I could georeference a map to use with MapRun (http://maprunners.weebly.com/), a program to allow orienteering against GPS referenced controls. This needs the map as a KMZ file, thus the need to use EPSG 3857 (as far as I understand the whole process).
I see. Let's leave this ticket open for a moment, maybe there is a solution with the revised grid scaling support.
Revising automatic grid scaling support just made me realize that probably all you need is the right value for the grid scale factor field which is already available in v0.8.4. (Well, this is answered in https://github.com/OpenOrienteering/mapper/issues/1197#issuecomment-453771314.) At 55.932129° N (your screenshot), the average of horizontal and vertical scale factor for EPSG 3857 is:
1.782935
Hope this helps!
Yes, that does help a lot, many thanks. For interest, how did you work out the scale factor? It looks very close, but not exactly equal to 1/cos(lat).
EPSG:3857 aka Web Mercator scale factor is more complicated, and different E/W vs. N/S. The value is the average of the east-west and north-south scale factors. Explanations and formulas taken from http://hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf
I had the east-west formula already implemented in a unit test and just added north-south.
/**
* Returns the nominal east-west scale factor for "Web Mercator".
*/
double epsg3857ScaleX(double latitude)
{
constexpr auto e = 0.081819191; // WGS84 eccentricity
auto phi = qDegreesToRadians(latitude);
return pow(1.0 - e * e * sin(phi) * sin(phi), 0.5) / cos(phi);
}
/**
* Returns the nominal north-south scale factor for "Web Mercator".
*/
double epsg3857ScaleY(double latitude)
{
constexpr auto e = 0.081819191; // WGS84 eccentricity
auto phi = qDegreesToRadians(latitude);
return pow(1.0 - e * e * sin(phi) * sin(phi), 1.5) / (1 - e * e) / cos(phi);
}
I have a map georeference in UTM coordinates. Have two reference points on the map, the Reference point which on which the georeferencing is based, and a second Test point for checking the georeferencing. If I set the cursor to show its position in Lat/Long then the Reference point and Test point are in the expected places and the map distance between them is also correct.
If I now change the reference system to EPSG 3857 then the reference point stays at it's expected Lat Long, and the map distance between the Reference and Test point remains the same, correct, value, but the reported Lat/Long of the test point is now very different.
Example data Lat/Long Ref Point 55.931119, -4.360130 UTM 55.931117, -4.360130 EPSG 3857 Test Point 55.932129, -4.319183 UTM 55.931688, -4.337151 EPSG 3857
I would expect the Lat/Long to remain pretty much the same in different coordinate systems.
A second, probably related, issue is that when exporting a georeferenced JPG using EPSG 3857 the Reference point is in the correct position, but the scaling is wrong by a factor of around 1.8.
Configuration
Mapper Version: 0.8.4 Operating System: OSX High Sierra 10.13.6
Pictures of Reference and Test points in both UTM and EPSG 3857