OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
849 stars 308 forks source link

[Bug] Error message on reprojection in Data tab #1273

Closed nilason closed 3 years ago

nilason commented 3 years ago

Describe the bug

Reprojecting vector or raster map in Data tab causes a error/warning message in the console. The reprojection succeeds, so this is mostly an annoyance.

TypeError
:
Validate() takes 1 positional argument but 2 were given

See full console output below.

Vector:

TypeError
:
Validate() takes 1 positional argument but 2 were given
(Tue Jan 26 08:56:57 2021)                                                      
v.proj dbase=/Volumes/grassdata location=nc_spm_08 mapset=user1 input=railroads_copy output=railroads_copy smax=10000
Input CRS definition converted from '+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +towgs84=0.000,0.000,0.000 +type=crs ' to '+proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs'
Output CRS definition converted from '+proj=utm +no_defs +zone=17 +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +type=crs ' to '+proj=utm +zone=17 +ellps=WGS84 +units=m +no_defs +type=crs'
Reprojecting primitives ...
Building topology for vector map <railroads_copy@PERMANENT>...
Registering primitives...
GRASS_INFO_PROGRESS: 10000
(Tue Jan 26 08:57:01 2021) Command finished (4 sec)                             

Raster:

r.proj dbase=/Volumes/grassdata location=nc_spm_08 mapset=user1 input=testelev output=testelev method=bilinear
TypeError
:
Validate() takes 1 positional argument but 2 were given
Input CRS definition converted from '+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +towgs84=0.000,0.000,0.000 +type=crs ' to '+proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs'
Output CRS definition converted from '+proj=utm +no_defs +zone=17 +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +type=crs ' to '+proj=utm +zone=17 +ellps=WGS84 +units=m +no_defs +type=crs'

Input:
Cols: 500 (original: 500)
Rows: 450 (original: 450)
North: 228500.000000 (original: 228500.000000)
South: 215000.000000 (original: 215000.000000)
West: 630000.000000 (original: 630000.000000)
East: 645000.000000 (original: 645000.000000)
EW-res: 30.000000
NS-res: 30.000000

Output:
Cols: 499 (original: 500)
Rows: 451 (original: 452)
North: 3965422.819731 (original: 3965453.436973)
South: 3951614.443223 (original: 3951614.443223)
West: 701104.243097 (original: 701073.625855)
East: 716382.247259 (original: 716382.247259)
EW-res: 30.617243
NS-res: 30.617243

Allocating memory and reading input raster map...
Projecting...
r.proj complete.

To Reproduce Steps to reproduce the behavior:

  1. Contextual (right button) click in Data Tab on map to project
  2. Select 'Copy'
  3. Contextual click>'Paste' in destination location
  4. See error...

Expected behavior There should not be any error/warning message.

System description:

Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] 4.1.1 osx-cocoa (phoenix) wxWidgets 3.1.5

petrasovaa commented 3 years ago

This is related to #1069 but I didn't look at the specific here yet.

wenzeslaus commented 3 years ago

I get the Validate() error in Attribute Table Manager when pressing Submit in Update existing record dialog (Edit selected record context menu item). The following appears in the Console tab:

TypeError
:
Validate() takes 1 positional argument but 2 were given

In this case, the editing does not proceed, so records can't be modified in this way.

petrasovaa commented 3 years ago

I believe both problems should be fixed in #1069 which is now merged, could you test it and confirm? It probably needs to be backported.

nilason commented 3 years ago

Just tested with f111963ee , a bit different, but still an issue:

v.proj dbase=/Volumes/grassdata location=nc_spm_08 mapset=PERMANENT input=boundary_county output=boundary_county smax=10000
Traceback (most recent call last):
  File "/Volumes/grass/dist.x86_64-apple-darwin19.6.0/gui/wxpython/gui_core/widgets.py", line 588, in
Validate

text = win.GetValue()
AttributeError
:
'Panel' object has no attribute 'GetValue'
Found 2 possible transformations
petrasovaa commented 3 years ago

Could you be more specific about how to reproduce this? I am not getting anything when I open and fill v.proj dialog or run reprojection in data catalog.

nilason commented 3 years ago

Could you be more specific about how to reproduce this? I am not getting anything when I open and fill v.proj dialog or run reprojection in data catalog.

This is gui related (command line r.proj works without warning) and (seemingly) not harmful. I copy in Data Catalog (cxt menu copy, paste between locations), extract from gui console:

g.region -p                                                                     
projection: 1 (UTM)
zone:       17
datum:      wgs84
ellipsoid:  wgs84
north:      3959790.17312004
south:      3955901.78237385
west:       707319.70880694
east:       712473.61255189
nsres:      9.9958631
ewres:      10.00758009
rows:       389
cols:       515
cells:      200335
(Tue Mar  2 11:55:15 2021) Command finished (0 sec)                             
Traceback (most recent call last):
(Tue Mar  2 11:55:39 2021)                                                      
r.proj dbase=/Volumes/grassdata location=nc_spm_08 mapset=user1 input=basin_50K output=basin_50K22 method=nearest
  File "/Volumes/dev/git/grass/dist.x86_64-apple-
darwin19.6.0/gui/wxpython/gui_core/widgets.py", line 588, in
Validate

text = win.GetValue()
AttributeError
:
'Panel' object has no attribute 'GetValue'
Found 2 possible transformations
************************
Operation 1:
Description: Inverse of UTM zone 17N + Inverse of NAD83(HARN) to WGS 84 (3) + SPCS83 North Carolina zone (meters)

Area of use: United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin;
Wyoming.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=push +v_3 +step +proj=cart +ellps=WGS84 +step +inv +proj=helmert +x=-0.991 +y=1.9072 +z=0.5129 +rx=-0.0257899075194932 +ry=-0.0096500989602704 +rz=-0.0116599432323421 +s=0 +convention=coordinate_frame +step +inv +proj=cart +ellps=GRS80 +step +proj=pop +v_3 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
Operation 2:
Description: Inverse of UTM zone 17N + Inverse of NAD83(HARN) to WGS 84 (1) + SPCS83 North Carolina zone (meters)

Area of use: American Samoa - onshore - Tutuila, Aunu'u, Ofu, Olesega, Ta'u and Rose islands. Guam - onshore. Northern Mariana Islands - onshore. Puerto Rico - onshore. United States (USA) - onshore Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin and Wyoming; offshore Gulf of Mexico continental shelf (GoM OCS). US Virgin Islands - onshore.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
See also output of:
projinfo -o PROJ -s "EPSG:32617" -t "EPSG:3358"
Please provide the appropriate PROJ string with the pipeline option
************************
Selected PROJ pipeline:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
Found 2 possible transformations
************************
Operation 1:
Description: Inverse of SPCS83 North Carolina zone (meters) + NAD83(HARN) to WGS 84 (3) + UTM zone 17N

Area of use: United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +step +proj=push +v_3 +step +proj=cart +ellps=GRS80 +step +proj=helmert +x=-0.991 +y=1.9072 +z=0.5129 +rx=-0.0257899075194932 +ry=-0.0096500989602704 +rz=-0.0116599432323421 +s=0 +convention=coordinate_frame +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=utm +zone=17 +ellps=WGS84
************************
Operation 2:
Description: Inverse of SPCS83 North Carolina zone (meters) + NAD83(HARN) to WGS 84 (1) + UTM zone 17N

Area of use: American Samoa - onshore - Tutuila, Aunu'u, Ofu, Olesega, Ta'u and Rose islands. Guam - onshore. Northern Mariana Islands - onshore. Puerto Rico - onshore. United States (USA) - onshore Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin and Wyoming; offshore Gulf of Mexico continental shelf (GoM OCS). US Virgin Islands - onshore.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +step +proj=utm +zone=17 +ellps=WGS84
************************
See also output of:
projinfo -o PROJ -s "EPSG:3358" -t "EPSG:32617"
Please provide the appropriate PROJ string with the pipeline option
************************
Selected PROJ pipeline:
+proj=pipeline +step +inv +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +step +proj=utm +zone=17 +ellps=WGS84
************************

Input:
Cols: 1494 (original: 1494)
Rows: 1356 (original: 1356)
North: 228811.066496 (original: 228811.066496)
South: 214693.867198 (original: 214693.867198)
West: 629724.951275 (original: 629724.951275)
East: 645278.856696 (original: 645278.856696)
EW-res: 10.410914
NS-res: 10.410914

Output:
Cols: 1492 (original: 1492)
Rows: 1359 (original: 1360)
North: 3965746.055336 (original: 3965746.055336)
South: 3951306.769794 (original: 3951296.144860)
West: 700810.033152 (original: 700810.033152)
East: 716662.434939 (original: 716662.434939)
EW-res: 10.624934
NS-res: 10.624934

Allocating memory and reading input raster map...
Found 2 possible transformations
************************
Operation 1:
Description: Inverse of UTM zone 17N + Inverse of NAD83(HARN) to WGS 84 (3) + SPCS83 North Carolina zone (meters)

Area of use: United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia;
Wisconsin; Wyoming.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=push +v_3 +step +proj=cart +ellps=WGS84 +step +inv +proj=helmert +x=-0.991 +y=1.9072 +z=0.5129 +rx=-0.0257899075194932 +ry=-0.0096500989602704 +rz=-0.0116599432323421 +s=0 +convention=coordinate_frame +step +inv +proj=cart +ellps=GRS80 +step +proj=pop +v_3 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
Operation 2:
Description: Inverse of UTM zone 17N + Inverse of NAD83(HARN) to WGS 84 (1) + SPCS83 North Carolina zone (meters)

Area of use: American Samoa - onshore - Tutuila, Aunu'u, Ofu, Olesega, Ta'u and Rose islands. Guam - onshore. Northern Mariana Islands - onshore. Puerto Rico - onshore. United States (USA) - onshore Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin and Wyoming; offshore Gulf of Mexico continental shelf (GoM OCS). US Virgin Islands - onshore.

Accuracy within area of use: 1 m

PROJ string:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
See also output of:
projinfo -o PROJ -s "EPSG:32617" -t "EPSG:3358"
Please provide the appropriate PROJ string with the pipeline option
************************
Selected PROJ pipeline:
+proj=pipeline +step +inv +proj=utm +zone=17 +ellps=WGS84 +step +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80
************************
Projecting...
r.proj complete.
(Tue Mar  2 11:55:41 2021) Command finished (2 sec)                             

Using Python 3.9.1/wxPython 4.1.1, compiled with fd92e673b :

g.version -rge                Mapset <PERMANENT> in <nc_epsg_32617>
version=7.9.dev
date=2021
revision=fd92e673b
build_date=2021-03-02
build_platform=x86_64-apple-darwin19.6.0
build_off_t_size=8
libgis_revision=62f0ccf0a
libgis_date=2021-03-02T10:42:22+00:00
proj=7.2.1
gdal=3.2.1
geos=3.9.1
sqlite=3.34.1
petrasovaa commented 3 years ago

Does this happen in 78 too?

nilason commented 3 years ago

Does this happen in 78 too?

Yes, it does. Should be backported.

petrasovaa commented 3 years ago

Does this happen in 78 too?

Yes, it does. Should be backported.

Done

nilason commented 3 years ago

Thanks!