Bug report #3672

region error when creating a GRASS location?

Added by Giovanni Manghi over 8 years ago. Updated about 5 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:GRASS
Affected QGIS version:master Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:13731

Description

Hi, I have seen this on both Linux and Windows.

If I open a "old" mapset (don't remember exactly when it was created), that was created with EPSG 40000, g.region -p will return as expected

projection: 99 (Transverse Mercator)
zone:       0
datum:      rome40
ellipsoid:  international
north:      4834913.78536118
south:      4803364.45415656
west:       1650370.47056664
east:       1689398.62729587
nsres:      24.99947005
ewres:      25.00202225
rows:       1262
cols:       1561
cells:      1969982

if I create new location with EPSG 40000 then g.region -p will return

projection: 99 (Transverse Mercator)
zone:       0
datum:      towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
ellipsoid:  international
north:      5336010
south:      4004460
west:       1240010
east:       2430820
nsres:      1191.01073345
ewres:      1192.002002
rows:       1118
cols:       999
cells:      1116882

that I don't know if it is correct.

Now if I create a location in EPSG 3003 (that should be 40000==3003+towgs) the result of g.region -p is

projection: 99 (Transverse Mercator)
zone:       0
datum:      ** unknown (default: WGS84) **
ellipsoid:  international
north:      5336090
south:      4004520
west:       1239980
east:       2430820
nsres:      1191.02862254
ewres:      1190.84
rows:       1118
cols:       1000
cells:      1118000

that seems wrong.

The same result happens also with other projection, for example epsg 3763 (or all other CRS system I use normally)

projection: 99 (Transverse Mercator)
zone:       0
datum:      ** unknown (default: WGS84) **
ellipsoid:  grs80
north:      -497.84044931
south:      -292994.94849781
west:       -98340.22283752
east:       105157.76515519
nsres:      4.99995056
ewres:      4.99995056
rows:       58500
cols:       40700
cells:      2380950000

History

#1 Updated by Giovanni Manghi over 8 years ago

FYI

creating the location (ex. epsg 3763) with wingrass (6.4.0) returns the expected g.region result

g.region -p                                                                     
projection: 99 (Transverse Mercator)
zone:       0
datum:      etrs89
ellipsoid:  grs80

opening with wingrass a different location created with QGIS (with the same epsg) r.region returns

g.region -p                                                                     
projection: 99 (Transverse Mercator)
zone:       0
datum:      ** unknown (default: WGS84) **
ellipsoid:  international

#2 Updated by Markus Neteler over 8 years ago

The reason will be that several datums are associated to EPSG 3003:

g.proj -c epsg=3003 datumtrans=-1 location=loc_epsg_3003
---
1
Used in whole rome40 region
towgs84=-225.000,-65.000,9.000
Default 3-Parameter Transformation (May not be optimum for older datums; use this only if no more appropriate options are available.)
---
2
Used in Italy (Peninsular Part)
towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
Accuracy 3-4m
---
3
Used in Italy (Sardinia)
towgs84=-168.6,-34.0,38.6,-0.374,-0.679,-1.379,-9.48
Accuracy 3-4m
---
4
Used in Italy (Sicily)
towgs84=-50.2,-50.4,84.8,-0.690,-2.012,0.459,-28.08
Accuracy 3-4m

When creating such a new location (the same applies to all projections with multiple datum
choices), the user must be presented with a related datum dialog to choose from.

#3 Updated by Giovanni Manghi over 8 years ago

The same applies, for example, for epsg 3763?

#4 Updated by Markus Neteler over 8 years ago

Here the test with 3763:

g.proj -c epsg=3763 datumtrans=-1 location=loc_epsg_3763
Location loc_epsg_3763 created!
exit

grass64 ~/grassdata/loc_epsg_3763/PERMANENT/
GRASS 6.4.1svn (loc_epsg_3763):~ > g.proj -w
PROJCS["Transverse Mercator",
    GEOGCS["grs80",
        DATUM["European_Terrestrial_Reference_System_1989",
            SPHEROID[[Geodetic_Reference_System_1980]],
            TOWGS84[0,0,0,0,0,0,0]],
        PRIMEM[[Greenwich]],
        UNIT[[degree]],
    PROJECTION[[Transverse_Mercator]],
    PARAMETER[[latitude_of_origin]],
    PARAMETER[[central_meridian]],
    PARAMETER[[scale_factor]],
    PARAMETER[[false_easting]],
    PARAMETER[[false_northing]],
    UNIT[[Meter]]

Compared to http://spatialreference.org/ref/epsg/3763/prettywkt/ it looks as expected in GRASS.

Concerning the original report:

projection: 99 (Transverse Mercator)
zone:       0
datum:      towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
ellipsoid:  international
...

that is (see http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/gis/datumtransform.table) the first choice here:

63    rome40  "towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68" "Italy (Peninsular Part)" "Accuracy 3-4m" 
64    rome40  "towgs84=-168.6,-34.0,38.6,-0.374,-0.679,-1.379,-9.48" "Italy (Sardinia)" "Accuracy 3-4m" 
65    rome40  "towgs84=-50.2,-50.4,84.8,-0.690,-2.012,0.459,-28.08" "Italy (Sicily)" "Accuracy 3-4m" 

Something in the QGIS method to create a new location with multiple datum choices
seems to be broken.

#5 Updated by Paolo Cavallini over 8 years ago

In QGIS we used a different approach: we defined additional ad hoc projections (e.g. code 40000) with the additional datum. It used to work, so I think it has been broken by some changes recently.

#6 Updated by Giovanni Manghi almost 8 years ago

  • Target version changed from Version 1.7.0 to Version 1.7.4

#7 Updated by Paolo Cavallini over 7 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0
  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to master

#8 Updated by Paolo Cavallini about 7 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#9 Updated by Giovanni Manghi about 5 years ago

  • Pull Request or Patch supplied set to No
  • Status changed from Open to Closed
  • Resolution set to invalid

Also available in: Atom PDF