0

[OP: my error, circle CRS in LR corner is Project's CRS, not layer's.] QGIS 3.10; Ubuntu 18.04

Glossary for new users: CRS-Coordinate reference system (one of two types, geographic or projected); GCS-geographic coord. system, on-the-globe, lat/long, angles; PCS-projected coordinate system, onto a 2D map, lengths

Here are my steps:

  1. start QGIS and set Project->Properties->CRS to a PCS (EPSG:5070)
  2. load a PCS raster file as a layer (saved from a previous GCS raster layer, as in this thread)
  3. verify that the layer's CRS is identical to the project's
  4. note that the coordinates displayed below the layer view are still GCS, lat/long, only.

Another thread advises to edit the attribute table, but that applies to vector layers only.

I know I've expressed a considerable amount of thickness regarding how to handle mixed layers of GCS and PCS coordinates over some years, but it's beginning to feel like I'm closing in on it.

Q. Is there a 'toggle' between displaying GCS and PCS in the main QGIS window? No, but discussion follows.

Response to @Ian Turton's request for 'gdalinfo layer-file'

    grdn36w112_1$ gdalinfo w001001.adf 
Driver: AIG/Arc/Info Binary Grid
Files: .
       ./sta.adf
       ./log
       ./w001001.adf
       ./hdr.adf
       ./prj.adf
       ./metadata.xml
       ./dblbnd.adf
       ./w001001x.adf
Size is 3612, 3612
Coordinate System is:
GEOGCS["NAD83",
    DATUM["North_American_Datum_1983",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6269"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4269"]]
Origin = (-112.001666666700004,36.001666666664136)
Pixel Size = (0.000277777777778,-0.000277777777778)
Corner Coordinates:
Upper Left  (-112.0016667,  36.0016667) (112d 0' 6.00"W, 36d 0' 6.00"N)
Lower Left  (-112.0016667,  34.9983333) (112d 0' 6.00"W, 34d59'54.00"N)
Upper Right (-110.9983333,  36.0016667) (110d59'54.00"W, 36d 0' 6.00"N)
Lower Right (-110.9983333,  34.9983333) (110d59'54.00"W, 34d59'54.00"N)
Center      (-111.5000000,  35.5000000) (111d30' 0.00"W, 35d30' 0.00"N)
Band 1 Block=256x4 Type=Float32, ColorInterp=Undefined
  Min=1079.405 Max=3847.728 
  NoData Value=-3.4028234663852886e+38

conflictingGCScoordsWithPCSystem

6
  • This might be happening in the right-click "ExportLayer" step, which has a dialog I had not noticed, about the "Extents", which are pre-filled with Lat/Long coordinates, although the layer CRS was changed to a PCS before saving. It seems likely that the "Extents" are being read/redd back in with the reloaded file, and controlling what coordinates are displayed. – quagmire Jun 24 '20 at 17:39
  • The extent units are always geographic regardless of the type of the reference system of the layer. The problem seems to be that you have just changed the reference system of the layer instead of reproject it. – Gabriel De Luca Jun 24 '20 at 17:42
  • 1
    You may be mistaken. At least in the case where the layer's reference system is NAD83 and the project's NAD83 UTM 12N, when the layer is exported, if the project's PCS is selected for the output file, the Extents shown are displayed in UTM meters. – quagmire Jun 24 '20 at 18:46
  • please add the layer properties or the output of gdalinfo on the raster – Ian Turton Jun 24 '20 at 19:07
  • Too long to add as a comment. Posted it as an edit to the original post. – quagmire Jun 24 '20 at 23:58
2

Is there a 'toggle' between displaying GCS and PCS in the main QGIS window?

When the map reference system is geographic, you can only see geographic coordinates. But when the map system is projected, you can see the geographic coordinates referring to the base geographic system from which the projection is made, instead of the projected plane coordinates.

From the Project Properties, in the General tab, change the Coordinates and Bearing Display options:

1

So, since your map is defined in a projected reference system, you can see longitudes and latitudes in the coordinates.


If you're displaying the projected plane coordinates and they look like geographic ones, it's a strong indication that you've changed the layer reference system without reprojecting it. Don't do that, because you are changing the geolocation of the data.

Reload the source raster file in a new layer and export it to your desired reference system.

Change the map reference system to the same projected reference system of the projected layer if you want to see the projected coordinates.


A raster layer is always a rectangle of rows and columns of pixels, but when you reproject them to a system with a meridian convergence, you can see triangles of no-data pixels in the corners. If you want to remove them, you need to draw a rectangle in the same reference system and just clip the raster with the rectangle mask, or clip the raster with an extent defined inside the raster.

If you want to see all the raster data which was provided in a rectangle of geographic coordinates, but reprojected in a system which have a 10 degrees of meridian convergence in that location, in a rectangular map without being the raster inclined 10 degrees, and the raster placed in its correct geolocation, it is just not possible.

5
  • Referring to the uploaded image, note that the coordinates displayed, whatever their units, are values which derive from the latitude and longitude extents of the original raster. The project CRS has a projected UTM CRS. The layer has the same. The coordinates should look like UTM. I was not asking about toggling between GCS and PCS coordinate systems, because only PCS systems were involved. Instead, I was asking if there was a way to toggle between seeing geographic coordinates (computed by some unseen force for an unquestionably UTM layer) and what should be its normal metric coordinates. – quagmire Jun 24 '20 at 18:07
  • 1
    The coordinates are shown in the reference system of the map. If they don't look like normal UTM coordinates, is because the layer is not located in normal UTM coordinates, and that is usually due a change in its reference system without a reprojection. If an object is located in longitude 111 degrees west and latitude 35 degrees north, and you indicate to QGIS that they are UTM coordinates without reproject them to UTM, you are changing the geolocation of the object, to where 111 meters west and 31 meters north referred to that UTM system origin is. – Gabriel De Luca Jun 24 '20 at 18:18
  • I get what you are saying; namely, that if I merely "define" a layer's coordinates, in this case a NAD83, to be in UTM, the values in the ranges of numbers, left-to-right, top-do-bottom, don't change. If the original was ranged from 112 to 113 DEGREES east-to-west, the definition will report the range as 112 to 113 METERS. I understand that, and I have also loaded and exported the layer to an external file in the same UTM format as the project. I just noticed that there is a DIFFERENCE leaving the layer CRS at NAD83 and setting it to 5070 b4 savg. The latter stores lat/long as extents. – quagmire Jun 24 '20 at 18:38
  • 1
    I re-read your extenstive answer and today I understand it better. Thank you for your patience and thank you especially for this observation: "Don't do that, because you are changing the geolocation of the data." – quagmire Jul 18 '20 at 12:08
  • 1
    And thank you for this one too: "If you want to see [a collection of conflicting requirements], it is just not possible." – quagmire Jul 18 '20 at 12:19
0

[I leave my answer rather than delete it because it expresses I think a level of confusion and misconception shared by a lot of newcomers to QGIS. I insert footnote {numbers} and comment on them below.]

This is a practical answer of sorts. I conclude a) that how layers finally appear do depend on the choice of project CRS{1}, and that similarly named proj. coord. sys. do not necessarily give similar results{2}, and b) that sometimes the obvious thing to do is precisely wrong{3}.

I post three images. In the first two, the Project's CRS is 5070 (NAD83-Conus-Albers{1}). In the third, it is 3742 (NAD83 UTM 12N{2}). In all three cases, the same, single NAD83 raster layer, 4269, is loaded and displayed.

In the first image, the layer does show UTM coordinates, as expected from a projected coord system, but it is rotated{1}. This rotation is a problem because I wish to measure and crop rectangular areas.

In the second image, the layer's CRS has been changed to match the project's, which caused it to disappear{4}, requiring "Zoom to layer." Although unrotated now, the coord. values, in meters no doubt, are apparently merely copies of the geographic coords. in the original NAD83 layer, and thus useless for measuring.

Note that in the third image, I appear to get what I quest: an unrotated image with UTM coordinates{2}. A new project has been created with CRS set to 3742 before the NAD83 raster layer is added.

Note: recalling discussions that "defining" a layer's CRS is completely distinct from "projecting" it, I went back to the situation in the first image; namely, Project 5070, Layer 4269. I then exported that layer to a file with a 5070 CRS and loaded it back in. It came back in rotated{1}: unusable for my purposes. For completeness' sake, I repeated that with 3742 as the project CRS, saving and reloading the 4269 layer as a 3742 file. It came back without rotation, and displaying UTM coords{2}.

P5070 L4269 P5070 L4269-Set-to-5070 P3752 L4269

4
  • re: Footnote {1} above: EPSG 5070 is a projected coordinate system optimized to "flatten" the part of the globe covering the United States. Distortion is minimized and distributed with some areas being distortion-free and others having more or less. I should not have been surprised that my region of interest was altered by rotation. – quagmire Jul 18 '20 at 12:35
  • re: Footnote {2} above: EPSG 3742 is a projected coordinate system optimized to flatten a (much) smaller area, and covering my region of interest. I should not have been surprised that less distortion results. – quagmire Jul 18 '20 at 12:39
  • re: Footnote {3} above: Although embarrassing to me, I leave it in with the reminder, harking back to a beloved professor's advice: "When you are unable to solve your problem and have verified that every step is correct, inspect your assumptions." Just a caution to new users: what's 'obvious' to us may be more or less silly. – quagmire Jul 18 '20 at 12:42
  • re: Footnote {4} above: Precisely what @Gabriel de Luca was trying to get me to understand in his answer. The fact that taking his advice to re-project the layer by saving it out in the proper PCS and reloading it resulted in "something I can't use!!" owed to Footnote {1}. Simultaneous errors, whether in computation or in thinking, usually compound, not cancel. – quagmire Jul 18 '20 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.