tools: add --link and --out parameters for raster and vector files#7182
Open
tangelll wants to merge 3 commits intoOSGeo:mainfrom
Open
tools: add --link and --out parameters for raster and vector files#7182tangelll wants to merge 3 commits intoOSGeo:mainfrom
tangelll wants to merge 3 commits intoOSGeo:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr open for this issue :#7176
Description:
There is a project in Grass Gsoc ideas list which name is Subcommand CLI for GRASS. I am being able to finish Add
--link-raster=some/file.tiffwhich links (r.external) a raster file (same for vector and similarly for r.external.out).How to do:
I tested the raster linking functionality using the
ortho2010_t792_subset_20cm.tiffile from thenc_spm_08_grass7dataset, ensuring the map name matched the filename. For vector testing, I used the ne_110m_admin_0_countries dataset from Natural Earth as an external sample to verify the link process.https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/
To run my commands succesfuly you need to ensure that these files are in your workplaces.
Before Start
Before starting the test, ensure that you have copied your updated cli.py to the GRASS installation directory.
For me (macOS m4):
cp cli.py /usr/local/grass85/etc/python/grass/app
To Test Image file
python3 -m grass.app run r.info --link-raster=ortho2010_t792_subset_20cm.tif map=ortho2010_t792_subset_20cm.1Result
| Type of Map: GDAL-link Number of Categories: 0 |
| Data Type: CELL Semantic label: (none) |
| Rows: 3750 |
| Columns: 3500 |
| Total Cells: 13125000 |
| Projection: x,y |
| N: 220750 S: 220000 Res: 0.2 |
| E: 639000 W: 638300 Res: 0.2 |
| Range of data: min = 0 max = 251 |
| |
| Data Source: |
| /Users/tangel/Works/grass/ortho2010_t792_subset_20cm.tif band 1 |
| |
| |
| Data Description: |
| generated by r.external |
| |
| Comments: |
| r.external -o input="ortho2010_t792_subset_20cm.tif" output="ortho20\ |
| 10_t792_subset_20cm"
To Test Map file
python3 -m grass.app run v.info --link-vector=/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp map=ne_110m_admin_0_countriesResult
OGR layer: ne_110m_admin_0_countries | 18:01 [260/653]
| OGR datasource: /Users/tangel/Downloads/ne_110m_admin_0_countries/ne_110m |
|