Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-07 Thread Greg Troxel via Qgis-user

A further suggestion, which may be too much.

UTM, and the various LCC used in the US at State Plane Coordinate
Systems, have x/y coordinates that are nominally in meters (well, the
older ones used ft or ftUS).  Central meridian or standard parallel
scale factors are chosen to make distance measurements on the ground
correspond to cartesian distances calculated from project coordinates.

When printing UTM maps, standard practice as I understand it is to use a
scale such as 1:25 000, where 1 mm on the map is 25 m in cartesian
distance in projected coordinates.  So the 1 km grid lines would be 40
mm apart.  This is true even if the map is near the edge of the UTM zone
(or in the center).

So, it makes sense to treat a layout in UTM such that scale means the
previous paragraph, even though it's off slightly from my previous
suggestion.  I view this as scale being sort of "snap to standard" if
close.

With quality projections, I suspect this is a difference that might not
be perceptible, but in thinking of printed maps in UTM at standard
scales being used with transparent overlay rules to read coordinates for
search and rescue, I think it makes sense to be able to match this
practice.


signature.asc
Description: PGP signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-07 Thread Greg Troxel via Qgis-user

Nyall Dawson  writes:

> I've been thinking about introducing a new warning when exporting
> layouts, which would look something like this:
>
> 1. For each scale bar, look at the referenced map
> 2. Measure the scale using multiple lines, each across the
> top/middle/bottom horizontally and left/center/right vertically
> 3. Compare these scale values, and if any differ by more than XXX %
> then show a warning to the user. Something like "The scale for map 1
> varies from 1: to 1:y across different parts of the map.
> Consider using an alternative form of representing the map scale (such
> as a grid overlay), as the scale bar may be misleading for this map."

UTM and Lambert Conformal Conic (1SP) have a central scale factor chosen
to make the scale error ratio straddle 1.0, to more or less minimize the
max error.  LCC 2SP is essentially the same but specified differently.

Given that, I'd suggest making the map scale bar be some sort of
geometric mean of horizontal scale, to minimize the max error in a rough
way (without getting too complicated).

Then, when considering large-scale 3857, I'd suggest making the scale
bar be the geometric mean of horizontal and vertical.

So my first suggestion is:

  calculate horiztonal scale top/middle/bottom

  calculate vertical scale left/middle/right

  set scale bar to geometric mean of min and max of the 6 scales

  do this calculation anyway even if there is no scale bar

As for warnings, I don't think we want to warn about 3857 class scale
errors.  So

  If any of the 6 scales are more different from what would be obtained
  with 3857 at 70 N or S, warn if there is a scalebar.  (Maybe that's
  not right, but something like that).

  If any are more different than 1.1x of what Mercator would be, warn,
  even if there is not a scale bar.


I think the big points are

   to warn on the lat/lon non-projection, which is basically always a
   wrong thing to do

   to warn if the scale bar is unreliable at the level of a human using
   a ruler on a paper map


and avoid complaints for commonly-accepted projections for
continent-scale maps.



signature.asc
Description: PGP signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-07 Thread Jorge Gustavo Rocha via Qgis-user

Hi,

Thanks to Greg, Patrick, Nicolas and Nyall for the good discussion.

I never used lat/lon based layouts before and the result can be odd. I 
was trying to make it work, but it is not easy. The layout must include 
a warning about the difference in scales along the axes.


As Nyall said, additional logic could be added to detect scale changes 
along different directions. That introduces newer configurable 
parameters to decide the percentage of change to warn the users.


I think that it would be enough to warn users when they start a layout 
with a lat/lon coordinate system. The warning can be as simple as: 
"Please consider the usage of a projected CRS for your layout. Be aware 
that lat/lon printed maps can have different scales on the x and y axes.".


Regards,

Jorge

On 07/04/22 02:51, Nicolas Cadieux via Qgis-user wrote:


Hi Nyall,

That would be a "nice to have"!

Nicolas

On 2022-04-06 9:13 p.m., Nyall Dawson via Qgis-user wrote:

On Thu, 7 Apr 2022 at 10:26, Greg Troxel  wrote:


Nyall Dawson  writes:


In all cases (projected OR geographic) the scalebar logic is:

1. Create a horizontal line across the width of the layout map
2. Calculate the length of that line using great circle/ellipsoidal
calculations, based on the project's ellipsoid settings.
3. Compare the length of the ellipsoidal line vs the map width to
calculate the corresponding scale

That is a very straightforward approach with easy-to-understand
semantics.


So qgis scalebar calculations are ALWAYS based on great
circle/ellipsoidal lengths*.

And more precisely, a true geodesic between two points varying in x and
with constant y in the layout CRS.  For north-up (at least ish)
projections, that means a line of constant latitude.

For a lat/lon CRS in the layout, at mid latitudes, it's going to mean
that the scale in the y axis is smaller by about 110km/70km; a 
square in

lat/lon is taller than it is wide (and plus it's not a square, but
that's less obvious).  Equivalently, a square on the ground has a 
larger

difference in longitude than it does in latitude.  Or maybe I have that
backward, but using lat/lon in a layout does not preserve shapes.

This is what I was trying to get at: a single concept of scale is 
really
only valid for a projection that has the same scale in x and y.  
Which I

think is true iff the projection is conformal.  And it's only truly
valid if the scale doesn't change over the layout, which is probably
~never exactly true, but many projections aim to have it remain close
enough to be treated as constant (e.g. UTM).

Which is a long way of getting around to "if you are using lat/lon as
the axes in your layout, either you are doing something odd on purpose
or you probably should rethink your approach."  If you really do mean
it, I would find the explanation of why interesting.

All correct, indeed!

I've been thinking about introducing a new warning when exporting
layouts, which would look something like this:

1. For each scale bar, look at the referenced map
2. Measure the scale using multiple lines, each across the
top/middle/bottom horizontally and left/center/right vertically
3. Compare these scale values, and if any differ by more than XXX %
then show a warning to the user. Something like "The scale for map 1
varies from 1: to 1:y across different parts of the map.
Consider using an alternative form of representing the map scale (such
as a grid overlay), as the scale bar may be misleading for this map."

What do you think?

Nyall



* Unless the project itself is set to not use ellipsoidal calculations
and only use planar calculations, in the project properties dialog

Presumably those calculations are in the project CRS's xy space, and
would typically (when used sensibly) be grid distance in UTM, some 
State

Plane Coordinate System, or similar.

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Nicolas Cadieux via Qgis-user

Hi Nyall,

That would be a "nice to have"!

Nicolas

On 2022-04-06 9:13 p.m., Nyall Dawson via Qgis-user wrote:

On Thu, 7 Apr 2022 at 10:26, Greg Troxel  wrote:


Nyall Dawson  writes:


In all cases (projected OR geographic) the scalebar logic is:

1. Create a horizontal line across the width of the layout map
2. Calculate the length of that line using great circle/ellipsoidal
calculations, based on the project's ellipsoid settings.
3. Compare the length of the ellipsoidal line vs the map width to
calculate the corresponding scale

That is a very straightforward approach with easy-to-understand
semantics.


So qgis scalebar calculations are ALWAYS based on great
circle/ellipsoidal lengths*.

And more precisely, a true geodesic between two points varying in x and
with constant y in the layout CRS.  For north-up (at least ish)
projections, that means a line of constant latitude.

For a lat/lon CRS in the layout, at mid latitudes, it's going to mean
that the scale in the y axis is smaller by about 110km/70km; a square in
lat/lon is taller than it is wide (and plus it's not a square, but
that's less obvious).  Equivalently, a square on the ground has a larger
difference in longitude than it does in latitude.  Or maybe I have that
backward, but using lat/lon in a layout does not preserve shapes.

This is what I was trying to get at: a single concept of scale is really
only valid for a projection that has the same scale in x and y.  Which I
think is true iff the projection is conformal.  And it's only truly
valid if the scale doesn't change over the layout, which is probably
~never exactly true, but many projections aim to have it remain close
enough to be treated as constant (e.g. UTM).

Which is a long way of getting around to "if you are using lat/lon as
the axes in your layout, either you are doing something odd on purpose
or you probably should rethink your approach."  If you really do mean
it, I would find the explanation of why interesting.

All correct, indeed!

I've been thinking about introducing a new warning when exporting
layouts, which would look something like this:

1. For each scale bar, look at the referenced map
2. Measure the scale using multiple lines, each across the
top/middle/bottom horizontally and left/center/right vertically
3. Compare these scale values, and if any differ by more than XXX %
then show a warning to the user. Something like "The scale for map 1
varies from 1: to 1:y across different parts of the map.
Consider using an alternative form of representing the map scale (such
as a grid overlay), as the scale bar may be misleading for this map."

What do you think?

Nyall



* Unless the project itself is set to not use ellipsoidal calculations
and only use planar calculations, in the project properties dialog

Presumably those calculations are in the project CRS's xy space, and
would typically (when used sensibly) be grid distance in UTM, some State
Plane Coordinate System, or similar.

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--
Nicolas Cadieux
https://gitlab.com/njacadieux

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Nyall Dawson via Qgis-user
On Thu, 7 Apr 2022 at 10:26, Greg Troxel  wrote:
>
>
> Nyall Dawson  writes:
>
> > In all cases (projected OR geographic) the scalebar logic is:
> >
> > 1. Create a horizontal line across the width of the layout map
> > 2. Calculate the length of that line using great circle/ellipsoidal
> > calculations, based on the project's ellipsoid settings.
> > 3. Compare the length of the ellipsoidal line vs the map width to
> > calculate the corresponding scale
>
> That is a very straightforward approach with easy-to-understand
> semantics.
>
> > So qgis scalebar calculations are ALWAYS based on great
> > circle/ellipsoidal lengths*.
>
> And more precisely, a true geodesic between two points varying in x and
> with constant y in the layout CRS.  For north-up (at least ish)
> projections, that means a line of constant latitude.
>
> For a lat/lon CRS in the layout, at mid latitudes, it's going to mean
> that the scale in the y axis is smaller by about 110km/70km; a square in
> lat/lon is taller than it is wide (and plus it's not a square, but
> that's less obvious).  Equivalently, a square on the ground has a larger
> difference in longitude than it does in latitude.  Or maybe I have that
> backward, but using lat/lon in a layout does not preserve shapes.
>
> This is what I was trying to get at: a single concept of scale is really
> only valid for a projection that has the same scale in x and y.  Which I
> think is true iff the projection is conformal.  And it's only truly
> valid if the scale doesn't change over the layout, which is probably
> ~never exactly true, but many projections aim to have it remain close
> enough to be treated as constant (e.g. UTM).
>
> Which is a long way of getting around to "if you are using lat/lon as
> the axes in your layout, either you are doing something odd on purpose
> or you probably should rethink your approach."  If you really do mean
> it, I would find the explanation of why interesting.

All correct, indeed!

I've been thinking about introducing a new warning when exporting
layouts, which would look something like this:

1. For each scale bar, look at the referenced map
2. Measure the scale using multiple lines, each across the
top/middle/bottom horizontally and left/center/right vertically
3. Compare these scale values, and if any differ by more than XXX %
then show a warning to the user. Something like "The scale for map 1
varies from 1: to 1:y across different parts of the map.
Consider using an alternative form of representing the map scale (such
as a grid overlay), as the scale bar may be misleading for this map."

What do you think?

Nyall


>
> > * Unless the project itself is set to not use ellipsoidal calculations
> > and only use planar calculations, in the project properties dialog
>
> Presumably those calculations are in the project CRS's xy space, and
> would typically (when used sensibly) be grid distance in UTM, some State
> Plane Coordinate System, or similar.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Greg Troxel via Qgis-user

Nyall Dawson  writes:

> In all cases (projected OR geographic) the scalebar logic is:
>
> 1. Create a horizontal line across the width of the layout map
> 2. Calculate the length of that line using great circle/ellipsoidal
> calculations, based on the project's ellipsoid settings.
> 3. Compare the length of the ellipsoidal line vs the map width to
> calculate the corresponding scale

That is a very straightforward approach with easy-to-understand
semantics.

> So qgis scalebar calculations are ALWAYS based on great
> circle/ellipsoidal lengths*.

And more precisely, a true geodesic between two points varying in x and
with constant y in the layout CRS.  For north-up (at least ish)
projections, that means a line of constant latitude.

For a lat/lon CRS in the layout, at mid latitudes, it's going to mean
that the scale in the y axis is smaller by about 110km/70km; a square in
lat/lon is taller than it is wide (and plus it's not a square, but
that's less obvious).  Equivalently, a square on the ground has a larger
difference in longitude than it does in latitude.  Or maybe I have that
backward, but using lat/lon in a layout does not preserve shapes.

This is what I was trying to get at: a single concept of scale is really
only valid for a projection that has the same scale in x and y.  Which I
think is true iff the projection is conformal.  And it's only truly
valid if the scale doesn't change over the layout, which is probably
~never exactly true, but many projections aim to have it remain close
enough to be treated as constant (e.g. UTM).

Which is a long way of getting around to "if you are using lat/lon as
the axes in your layout, either you are doing something odd on purpose
or you probably should rethink your approach."  If you really do mean
it, I would find the explanation of why interesting.

> * Unless the project itself is set to not use ellipsoidal calculations
> and only use planar calculations, in the project properties dialog

Presumably those calculations are in the project CRS's xy space, and
would typically (when used sensibly) be grid distance in UTM, some State
Plane Coordinate System, or similar.


signature.asc
Description: PGP signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Nyall Dawson via Qgis-user
On Wed, 6 Apr 2022 at 09:34, Greg Troxel via Qgis-user
 wrote:
>
> Jorge Gustavo Rocha via Qgis-user  writes:
>
> > I need you help to understand how scale works with geographic
> > coordinate systems.


In all cases (projected OR geographic) the scalebar logic is:

1. Create a horizontal line across the width of the layout map
2. Calculate the length of that line using great circle/ellipsoidal
calculations, based on the project's ellipsoid settings.
3. Compare the length of the ellipsoidal line vs the map width to
calculate the corresponding scale

So qgis scalebar calculations are ALWAYS based on great
circle/ellipsoidal lengths*.

Nyall

* Unless the project itself is set to not use ellipsoidal calculations
and only use planar calculations, in the project properties dialog
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Nicolas Cadieux via Qgis-user
Hi,
Your calculations are based on a sphere.  The different crs use a geoids. It 
would help if you could say what crs you are using and the differences between 
what you get and what you expect.

Nicolas Cadieux
https://gitlab.com/njacadieux

> Le 6 avr. 2022 à 13:13, Jorge Gustavo Rocha via Qgis-user 
>  a écrit :
> 
> Hi,
> 
> Thank you all for the comments.
> 
> As far as I can see from my tests, the behavior is not related with the CRS 
> in use. I've used more than one meter based projection to make sure the areas 
> were fine. I use the advanced digitizing tools to create segments with the 
> exact distance. Using projected CRS, the layouts are always fine.
> 
> The problem is related to the map area calculated for a giving scale, in the 
> composer, when a lat/long coordinate system is in use.
> 
> If I make a very simple calculation of the area to render at a giving scale, 
> my calculations work fine.
> 
> The width does not depend on the latitude, and should be:
> 
> layout_width_mm * scale / 1000.0
> 
> The height depends on the latitude. To compute it, I use the cosine of the 
> latitude:
> 
> cosine = cos( center_latitude * PI / 180 );
> 
> layout_height_mm * scale / 1000.0 / cosine;
> 
> Based on this simple math, after converting these distances to lat/log, I can 
> compute the "correct" ( ie expected) extend of the map in the layout. If I 
> setup this extent manually, it works fine.
> 
> But the extent calculated by QGIS is different. I'll have to check the code 
> to see why the logic if different from this one. Probably I am simplifying 
> the calculations too much.
> 
> I'll return back after reading the code.
> 
> Regards,
> 
> Jorge Gustavo
> 
>> On 06/04/22 15:10, Greg Troxel via Qgis-user wrote:
>> Patrick Dunford via Qgis-user  writes:
>> 
>>> On 6/04/22 11:34, Greg Troxel via Qgis-user wrote:
 Jorge Gustavo Rocha via Qgis-user  writes:
 
 2) Using a geographic CRS, the same 150mm x 150mm map, at the same
> 1:1 scale, the area is bigger then the 1500m polygon. The result
> is attached https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y
> 
> On both layouts the scale bar widget is working properly. The
> distances (and areas) are properly calculated in QGIS interface. I
> have set the GRS 1980 ellipsoid for distance and area calculations.
 What does it mean to use a geographic CRS for a print layout?  Do you
 really expect longitude on the x axis and latitude on the y axis?  The
 value of meters/degree is different for x and y, unless you are at or
 near the equator.  (Living at 42N-ish, I'm very aware of this.)
>>> This may be the case for projections like EPSG:3857 that are based on
>>> a spherical projection of the Earth but is it the case for all
>>> projections?
>> By "geographic CRS", I interpet that to mean one that is latitude and
>> longitude.  That is not really a "projection".
>> 
>> Yes, EPSG:3857 has an incorrect spherical assumption, and I'd have to
>> calculate, but I would not expect massive scale distortion, where
>> massive is casually visually apparent.
>> 
>> Perhaps Jorge can be precise about which CRS codes are in use.
>> 
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Jorge Gustavo Rocha via Qgis-user

Hi,

Thank you all for the comments.

As far as I can see from my tests, the behavior is not related with the 
CRS in use. I've used more than one meter based projection to make sure 
the areas were fine. I use the advanced digitizing tools to create 
segments with the exact distance. Using projected CRS, the layouts are 
always fine.


The problem is related to the map area calculated for a giving scale, in 
the composer, when a lat/long coordinate system is in use.


If I make a very simple calculation of the area to render at a giving 
scale, my calculations work fine.


The width does not depend on the latitude, and should be:

layout_width_mm * scale / 1000.0

The height depends on the latitude. To compute it, I use the cosine of 
the latitude:


cosine = cos( center_latitude * PI / 180 );

layout_height_mm * scale / 1000.0 / cosine;

Based on this simple math, after converting these distances to lat/log, 
I can compute the "correct" ( ie expected) extend of the map in the 
layout. If I setup this extent manually, it works fine.


But the extent calculated by QGIS is different. I'll have to check the 
code to see why the logic if different from this one. Probably I am 
simplifying the calculations too much.


I'll return back after reading the code.

Regards,

Jorge Gustavo

On 06/04/22 15:10, Greg Troxel via Qgis-user wrote:

Patrick Dunford via Qgis-user  writes:


On 6/04/22 11:34, Greg Troxel via Qgis-user wrote:

Jorge Gustavo Rocha via Qgis-user  writes:

2) Using a geographic CRS, the same 150mm x 150mm map, at the same

1:1 scale, the area is bigger then the 1500m polygon. The result
is attached https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y

On both layouts the scale bar widget is working properly. The
distances (and areas) are properly calculated in QGIS interface. I
have set the GRS 1980 ellipsoid for distance and area calculations.

What does it mean to use a geographic CRS for a print layout?  Do you
really expect longitude on the x axis and latitude on the y axis?  The
value of meters/degree is different for x and y, unless you are at or
near the equator.  (Living at 42N-ish, I'm very aware of this.)

This may be the case for projections like EPSG:3857 that are based on
a spherical projection of the Earth but is it the case for all
projections?

By "geographic CRS", I interpet that to mean one that is latitude and
longitude.  That is not really a "projection".

Yes, EPSG:3857 has an incorrect spherical assumption, and I'd have to
calculate, but I would not expect massive scale distortion, where
massive is casually visually apparent.

Perhaps Jorge can be precise about which CRS codes are in use.

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Greg Troxel via Qgis-user

Patrick Dunford via Qgis-user  writes:

> On 6/04/22 11:34, Greg Troxel via Qgis-user wrote:
>> Jorge Gustavo Rocha via Qgis-user  writes:
>>
>> 2) Using a geographic CRS, the same 150mm x 150mm map, at the same
>>> 1:1 scale, the area is bigger then the 1500m polygon. The result
>>> is attached https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y
>>>
>>> On both layouts the scale bar widget is working properly. The
>>> distances (and areas) are properly calculated in QGIS interface. I
>>> have set the GRS 1980 ellipsoid for distance and area calculations.
>> What does it mean to use a geographic CRS for a print layout?  Do you
>> really expect longitude on the x axis and latitude on the y axis?  The
>> value of meters/degree is different for x and y, unless you are at or
>> near the equator.  (Living at 42N-ish, I'm very aware of this.)
>
> This may be the case for projections like EPSG:3857 that are based on
> a spherical projection of the Earth but is it the case for all
> projections?

By "geographic CRS", I interpet that to mean one that is latitude and
longitude.  That is not really a "projection".

Yes, EPSG:3857 has an incorrect spherical assumption, and I'd have to
calculate, but I would not expect massive scale distortion, where
massive is casually visually apparent.

Perhaps Jorge can be precise about which CRS codes are in use.


signature.asc
Description: PGP signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Nicolas Cadieux via Qgis-user
Hi,

Great question!  I am not the best person to answer it as this is a question 
for the Proj4 project  people. They do geodesy and generally, a conversation 
with them bring me back to my worse math class experiences! I should have 
listened, I say to myself!

Anyways, CRS are not all created the same.  If you read the link below, you 
will see that a CRS can minimize distorsion for the area, distance, shape, 
direction and bearing but not all of them at once.  Google for the projected 
coordinates system you used.  You may find what quality it aims to minimize 
distortion.  If not, Google for the type of projection it’s based on 
(conformal, equal-area…)
https://en.wikipedia.org/wiki/Map_projection

As others have pointed, a degree of longitude does not measure the same length 
as a degree of latitude.  I would expect scales to reflect latitude distances 
for the latitude of your map.  If this is not the case, then they are possibly 
using a short cut and using a latitude distance at the equator.  This would be 
a good question for the developers.

Whatever test you do, make sure your polygon in the projected CRS does measure 
the correct 1000x1000m or 1500x1500m in length.  The easiest way to do this is 
to draw the rectangle using advanced digitizing modes is a local UTM zone.  You 
can also use a WKT polygon you created in a csv file.

 (https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) 

Then,  « densify » (processing tools box) the rectangle to add tons of nodes to 
the lines.  ( A rectangle with only 4 corner nodes cannot be accurately 
reprojected on a sphere.) Then, reproject the layer to a projected CRS you want 
to test.  Make sure all the layers are in the same crs as the project, same 
thing for the map space.  You need to make sure QGIS does not do any 
reprojection on the fly without you knowing it.

Nicolas Cadieux
https://gitlab.com/njacadieux

> Le 5 avr. 2022 à 11:00, Jorge Gustavo Rocha via Qgis-user 
>  a écrit :
> 
> Hi,
> 
> I need you help to understand how scale works with geographic coordinate 
> systems.
> 
> For projected coordinates systems, the layouts seems to work as expected.
> 
> This is my use case:
> 
> I've draw a polygon with 1000m width and height, and another with 1500, width 
> and height, sharing the upper left corner.
> 
> 1) Using a projected CRS, if I create a layout with a 150mm x 150mm map, the 
> 1500m polygon fits perfectly on the print area, setting a 1:1 scale. 
> That's what I expected. The results is 
> https://nextcloud.geomaster.pt/index.php/s/TKpkBaqty8BdLL8
> 
> 2) Using a geographic CRS, the same 150mm x 150mm map, at the same 1:1 
> scale, the area is bigger then the 1500m polygon. The result is attached 
> https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y
> 
> On both layouts the scale bar widget is working properly. The distances (and 
> areas) are properly calculated in QGIS interface. I have set the GRS 1980 
> ellipsoid for distance and area calculations.
> 
> My question is: why the second layout does not fit the 1500m polygon 
> properly? The second layout shows approximately a 2000m square, instead of a 
> 1500m square.
> 
> Regards,
> 
> Jorge Gustavo
> 
> 
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-06 Thread Patrick Dunford via Qgis-user

On 6/04/22 11:34, Greg Troxel via Qgis-user wrote:

Jorge Gustavo Rocha via Qgis-user  writes:

2) Using a geographic CRS, the same 150mm x 150mm map, at the same

1:1 scale, the area is bigger then the 1500m polygon. The result
is attached https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y

On both layouts the scale bar widget is working properly. The
distances (and areas) are properly calculated in QGIS interface. I
have set the GRS 1980 ellipsoid for distance and area calculations.

What does it mean to use a geographic CRS for a print layout?  Do you
really expect longitude on the x axis and latitude on the y axis?  The
value of meters/degree is different for x and y, unless you are at or
near the equator.  (Living at 42N-ish, I'm very aware of this.)


This may be the case for projections like EPSG:3857 that are based on a 
spherical projection of the Earth but is it the case for all projections?



___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Help with scales in print layouts for geographic CRS

2022-04-05 Thread Greg Troxel via Qgis-user
Jorge Gustavo Rocha via Qgis-user  writes:

> I need you help to understand how scale works with geographic
> coordinate systems.

A good question.

> This is my use case:

It seems like your minimal example to show what doesn't work like you
think it should, instead of what you want to do, but that's good -
simpler is better for discussing.

> I've draw a polygon with 1000m width and height, and another with
> 1500, width and height, sharing the upper left corner.

Presumably you have some project CRS, and a layer in which you drew the
polygon and it has a layer CRS.  You then say width and height, which is
a map concept more than an on-the-ground concept.  But I'll assume you
are using UTM or similar and have a square in UTM coordinates.

Presumably also the 1000m is measured in your layer or project CRS.

> 1) Using a projected CRS, if I create a layout with a 150mm x 150mm
> map, the 1500m polygon fits perfectly on the print area, setting a
> 1:1 scale. That's what I expected. The results is
> https://nextcloud.geomaster.pt/index.php/s/TKpkBaqty8BdLL8

That makes sense.

> 2) Using a geographic CRS, the same 150mm x 150mm map, at the same
> 1:1 scale, the area is bigger then the 1500m polygon. The result
> is attached https://nextcloud.geomaster.pt/index.php/s/H2eAytsPANyxn6Y
>
> On both layouts the scale bar widget is working properly. The
> distances (and areas) are properly calculated in QGIS interface. I
> have set the GRS 1980 ellipsoid for distance and area calculations.

What does it mean to use a geographic CRS for a print layout?  Do you
really expect longitude on the x axis and latitude on the y axis?  The
value of meters/degree is different for x and y, unless you are at or
near the equator.  (Living at 42N-ish, I'm very aware of this.)

> My question is: why the second layout does not fit the 1500m polygon
> properly? The second layout shows approximately a 2000m square,
> instead of a 1500m square.

I would expect Scale to relate units in the project CRS to dimensions on
the layout.  But, there's perhaps some implicit conversion to meters
from geographic coordinates.  I wonder if that's happening, and if so if
it's a bug -- it feels like a bug to me.

I also wonder if geographic coordinates somehow use different scaling on
each axis to make it seem more conformal than it is.

Overall, it feels like a bug to use geographic coordinates in a print
layout.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user