[GRASS-git] [OSGeo/grass] b9fc83: json parser: fix mapsets in tokenizing (#1252)
Markus Neteler
noreply at github.com
Thu Jan 21 21:28:19 PST 2021
Branch: refs/heads/releasebranch_7_8
Home: https://github.com/OSGeo/grass
Commit: b9fc836384bb24f4aebdaf8d7f7304adf190fbd0
https://github.com/OSGeo/grass/commit/b9fc836384bb24f4aebdaf8d7f7304adf190fbd0
Author: Markus Neteler <neteler at gmail.com>
Date: 2021-01-22 (Fri, 22 Jan 2021)
Changed paths:
M lib/gis/parser_json.c
Log Message:
-----------
json parser: fix mapsets in tokenizing (#1252)
* json parser: fix mapsets in tokenizing
This PR fixes the broken tokenizing of `map at mapset`.
Wrong "import_descr":
```
GRASS :~ > r.info globcover at globcover --json
{
"module": "r.info",
"id": "r.info_1804289383",
"inputs":[
{"import_descr": {"source":"globcover", "type":"raster"},
"param": "map", "value": "globcover"}
]}
```
Fixed with this PR:
```
GRASS :~ > r.info globcover:@globcover --json
{
"module": "r.info",
"id": "r.info_1804289383",
"inputs":[
{"param": "map", "value": "globcover:"}
]}
```
And this remains functional:
```
GRASS :~ > r.slope.aspect elevation="elevation at https://storage.googleapis.com/graas-geodata/elev_ned_30m.tif" slope="slope+GTiff" aspect="aspect+GTiff" --json
{
"module": "r.slope.aspect",
"id": "r.slope.aspect_1804289383",
"inputs":[
{"import_descr": {"source":"https://storage.googleapis.com/graas-geodata/elev_ned_30m.tif", "type":"raster"},
"param": "elevation", "value": "elevation"},
{"param": "format", "value": "degrees"},
{"param": "precision", "value": "FCELL"},
{"param": "zscale", "value": "1.0"},
{"param": "min_slope", "value": "0.0"}
],
"outputs":[
{"export": {"format":"GTiff", "type":"raster"},
"param": "slope", "value": "slope"},
{"export": {"format":"GTiff", "type":"raster"},
"param": "aspect", "value": "aspect"}
]
}
```
It completes the earlier fix in #175.
Co-authored-by: @anikaweinmann
- URL parsing: fatal error checking added
- Check URL to start with http://, https:// or ftp://
- catch multiple `@` chars in user input
- URL detection: only investigate token[1] if there is more then one token
- initialize `urlfound` variable
Co-authored-by: Markus Metz <33666869+metzm at users.noreply.github.com>
More information about the grass-commit
mailing list