Opened 8 years ago
Last modified 6 years ago
#3225 new defect
r.plane: ValueError: invalid literal for float(): 0:04:14.5E
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Python | Version: | svn-trunk |
Keywords: | r.plane | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description (last modified by )
At time (besides the weird fact that the angle convention of azimuth does not match the standard GRASS convention) the easting and northing input does not accept sexagesimal input in lat-long location:
GRASS 7.2.0svn (latlong):~ > r.plane output=plane dip=45 azimuth=9 \ easting=0:04:14.5E northing=48:52:14.5N elev=1000 type=CELL Traceback (most recent call last): File "/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/scripts/r.plane", line 128, in <module> main() File "/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/scripts/r.plane", line 78, in main ea = float(options['easting']) ValueError: invalid literal for float(): 0:04:14.5E
AFAIK G_OPT_M_COORDS would support that but here the values have to be specified separately.
Change History (7)
comment:1 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:2 by , 6 years ago
Milestone: | 7.0.7 → 7.6.2 |
---|
follow-up: 4 comment:3 by , 6 years ago
comment:4 by , 6 years ago
Replying to neteler:
I guess a Python equivalent of G_scan_easting() and G_scan_northing() is needed here.
It's here: https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/script/utils.py#L33
comment:6 by , 6 years ago
Description: | modified (diff) |
---|---|
Version: | unspecified → svn-trunk |
Replying to lucadelu:
Please look and try r74438
Thanks, but now I get
r.plane output=plane dip=45 azimuth=9 easting=0:04:14.5E northing=48:52:14.5N elev=1000 type=CELL ERROR: Input coordinates seems to be invalid
With debug output added locally, I see that "E" and "N" are the problem (which are accepted in g.region, see https://grass.osgeo.org/grass76/manuals/g.region.html#changing-extent-and-raster-resolution-using-values):
r.plane output=plane dip=45 azimuth=9 easting="00:04:14.5E" northing="48:52:14.5N" elev=1000 type=CELL Traceback (most recent call last): File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/scripts/r.plane", line 134, in <module> main() File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/scripts/r.plane", line 84, in main print(gscript.utils.float_or_dms(options['easting'])) File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/script/utils.py", line 45, in float_or_dms return sum(float(x) / 60 ** n for (n, x) in enumerate(s.split(':'))) File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/script/utils.py", line 45, in <genexpr> return sum(float(x) / 60 ** n for (n, x) in enumerate(s.split(':'))) ValueError: invalid literal for float(): 14.5E # trying without "E": r.plane output=plane dip=45 azimuth=9 easting="00:04:14.5" northing="48:52:14.5N" elev=1000 type=CELL 0.0706944444444 ERROR: Input coordinates seems to be invalid # trying without E and N: r.plane output=plane dip=45 azimuth=9 easting=00:04:14.5 northing=48:52:14.5 elev=1000 type=CELL 36% ...
IMHO float_or_dms() needs an update to accept E and N.
I guess a Python equivalent of G_scan_easting() and G_scan_northing() is needed here.