Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json parser: fix mapsets in tokenizing (#1252)
* json parser: fix mapsets in tokenizing This PR fixes the broken tokenizing of `map@mapset`. Wrong "import_descr": ``` GRASS :~ > r.info globcover@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@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@users.noreply.github.com>
- Loading branch information