Re: [GRASS-user] Re: grass-user Digest, Vol 205, Issue 33

2023-05-25 Thread Stefan Blumentrath


 
 Hi,If NOAA data is CF-convention-compliant data in NetCDF format, you may check out: https://grass.osgeo.org/grass82/manuals/addons//t.rast.import.netcdf.htmlAnd https://grass.osgeo.org/grass82/manuals/addons/m.crawl.thredds.htmlif the data is distributed via threads server...Cheers,StefanOn 25/05/2023, 11:11 kyawmoeaung.kyaw...@gmail.com wrote:

  
   
Dear Markus, Tom and Valcus,

 


 Thank you very much for your invaluable reply. 


 


 I tried to ask ChatGPT as Markus suggested.


 


 However, I can not figure out which web api are available for active cyclone/hurrican/typhoon so that I can test them with the aid of AI.


 


 Any hints?


 


 Below is the code generated by ChatGPT.


 


 import requests import json import grass.script as gscript # Function to download data from a URL def download_data(url, output_file): response = requests.get(url) with open(output_file, 'wb') as file: file.write(response.content) # Function to import meteorological data into GRASS GIS def import_data(file_path, map_name): gscript.run_command('r.in.gdal', input=file_path, output=map_name) # Function to track cyclones using GRASS GIS modules def track_cyclones(data_map): # Set computational region to match the imported data gscript.run_command('g.region', raster=data_map)  # Perform cyclone tracking analysis using GRASS modules # Replace the following commands with the appropriate GRASS GIS modules and parameters for cyclone tracking # Example: # gscript.run_command('r.mapcalc', _expression_='cyclone_track = ...') # Print a message indicating the completion of the tracking process gscript.message('Cyclone tracking completed.')  # Define URLs for downloading data from NOAA, NHC, and JTWC noaa_url = 'https://example.com/noaa_data.nc' nhc_url = 'https://example.com/nhc_data.nc' jtwc_url = 'https://example.com/jtwc_data.nc' # Define output file paths noaa_file = '/path/to/noaa_data.nc' nhc_file = '/path/to/nhc_data.nc' jtwc_file = '/path/to/jtwc_data.nc' # Download meteorological data from NOAA, NHC, and JTWC download_data(noaa_url, noaa_file) download_data(nhc_url, nhc_file) download_data(jtwc_url, jtwc_file) # Import meteorological data into GRASS GIS import_data(noaa_file, 'noaa_data') import_data(nhc_file, 'nhc_data') import_data(jtwc_file, 'jtwc_data') # Track cyclones using the imported data track_cyclones('noaa_data') # Replace 'noaa_data' with the appropriate data map name # Clean up: remove the downloaded data files if desired # Uncomment the following lines if you want to delete the downloaded files # import os # os.remove(noaa_file) # os.remove(nhc_file) # os.remove(jtwc_file)
 


 


 


 Best regards,


 


 Kyaw Moe Aung

   
  
  
  
   
On Thu, May 25, 2023 at 1:31 AM  wrote:

   
   
Send grass-user mailing list submissions to
         grass-user@lists.osgeo.org
 
 To subscribe or unsubscribe via the World Wide Web, visit
         https://lists.osgeo.org/mailman/listinfo/grass-user
 or, via email, send a message with subject or body 'help' to
         grass-user-requ...@lists.osgeo.org
 
 You can reach the person managing the list at
         grass-user-ow...@lists.osgeo.org
 
 When replying, please edit your Subject line so it is more specific
 than "Re: Contents of grass-user digest..."
 
 
 Today's Topics:
 
    1. Re: Active Tropical Cyclone Tracking with GRASS GIS and
       Jupyter Notebook (Thomas Adams)
    2. Re: Active Tropical Cyclone Tracking with GRASS GIS and
       Jupyter Notebook (Markus Neteler)
    3. Re: Active Tropical Cyclone Tracking with GRASS GIS and
       Jupyter Notebook (Thomas Adams)
    4. Re: Active Tropical Cyclone Tracking with GRASS GIS and
       Jupyter Notebook (Markus Neteler)
 
 
 --
 
 Message: 1
 Date: Wed, 24 May 2023 11:56:53 -0400
 From: Thomas Adams 
 To: Vaclav Petras 
 Cc: kyawmoeaung.kyaw...@gmail.com, grass-user@lists.osgeo.org
 Subject: Re: [GRASS-user] Active Tropical Cyclone Tracking with GRASS
         GIS and Jupyter Notebook
 Message-ID:
         
 Content-Type: text/plain; charset="utf-8"
 
 Hi all,
 
 Yes ? agreed that a lot of scripting would be needed, but importing readily
 available data is very doable.
 
 Tom
 
 On Mon, May 22, 2023 at 2:17?PM Vaclav Petras  wrote:
 
 > Hi Kyaw,
 >
 > I think it is fairly safe to say that GRASS GIS supports that, but someone
 > would need to 

Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Stefan Blumentrath
Hei Bernardo,

The problem is likely that the layout of the addon repo changed after 7.8.5, 
thus the path is not constructed correctly by g.extension in that version.

A workaround could be to fetch the add on repo with git (git clone 
https://github.com/osgeo/grass-addons)

And then point g.extension to your local copy:
g.extension extension=r.area url=./grass-addons/src/raster/r.area

You may need a zip file, but you can try the above first...

Good luck.. 

Cheers,
Stefan

> Gesendet: Montag, den 09.01.2023 um 21:14 Uhr
> Von: "Bernardo Santos via grass-user" 
> An: "Markus Neteler" 
> Cc: "GRASS User List" 
> Betreff: Re: [GRASS-user] How to use g.extension in GRASS7.8
> 
>  Hi Markus and Vero,
> Thanks. Indeed, my GRASS version is old:GRASS 7.8.5Ubuntu 18.04.6 LTS
> I unfortunately do not have a way to upgrade it myself since this is a 
> company server shared with other people (and we have been fighting with IT to 
> change to GRASS 8).But maybe it is easier to at lease update GRASS to version 
> 7.8.7 (or 7.8.8).
> I just talked to a colleague (@mauricio.vancince) who mentioned he had the 
> same problem but could overcome it opening the terminal as a superuser and 
> using g.extension r.area -sUnfortunately I do not have admin rights, but I 
> will see what is possible to be done.
> Thanks!BestBernardo 
> Em segunda-feira, 9 de janeiro de 2023 15:19:07 GMT+1, Markus Neteler 
>  escreveu:  
>  
>  Hi Bernardo,
> 
> On Mon, Jan 9, 2023 at 2:58 PM Bernardo Santos
>  wrote:
> >
> > Hi Markus,
> >
> > That was my first try, and then I get the error below:
> >
> > > g.extension extension=r.area
> > Fetching  from GRASS GIS Addons repository (be patient)...
> > svn: E17: URL 
> > 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> > exist
> > ERROR: GRASS Addons  not found
> 
> Ah right. Then your GRASS GIS 7.8 version may be too old. G 7.8.7
> should be ok (G 7.8.8 is on the way these days) but in any case, as
> Vero pointed out, we highly recommend to upgrade to GRASS GIS 8.2.x.
> 
> Best,
> Markus
>   ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Export raster to PostGIS

2022-08-28 Thread Stefan Blumentrath
Hi Asim,

You could try to use raster2pgsql after making sure you have the GDAL-GRASS 
plugin installed.

Then you should be able to load GRASS GIS raster maps directly into PostGIS by 
pointing to the header of your GRASS GIS maps. Something like:
raster2pgsql -s 4326 -C -l 2,4 -I -F -t 2700x2700 
/your_grassdb/location/mapset/cellhd/your_raster_map output_pg_shema_name. 
output_table_name | psql -h your_host -p 5432 -U postgres -d your_pg_database
(obviously you have to adjust options and flags of raster2pgsql to your 
case...).

Hope that helps.

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Asim via 
grass-user
Sent: lørdag 27. august 2022 11:38
To: Maris Nartiss 
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Export raster to PostGIS

Hi Māris

Thank you for pointing out the read-only limitation of GDAL library.  A natural 
workaround is to convert the raster to vector with r.to.vect and then use 
v.out.postgis.  However, there are some hurdles with regards to the type of 
resulting geometries (boundary, centroid and area) arising after the conversion 
to vector.  I will start a separate thread if I can articulate the problem 
somewhat precisely. 

Asim

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStefan.Blumentrath%40nina.no%7Ce039842dbdef478ee35408da880fe04f%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637971899037805938%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=4KmNrDMDYpVNlHGVghYR86DjRvNf%2BMtT3tMOZ3FFiSs%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Running r-grass examples when building a R package

2022-08-26 Thread Stefan Blumentrath
Hi Bernardo,

Seems like GRASS GIS isn`t installed on the CI VM.

Please see:
https://github.com/NINAnor/oneimpact/pulls

You may add UbuntuGIS PPAs if you want other versions than shipped by plain 
Ubuntu.

Cheers
Stefan

From: grass-user  On Behalf Of Bernardo 
Santos via grass-user
Sent: fredag 26. august 2022 12:56
To: grass-st...@lists.osgeo.org; GRASS User List 
Subject: [GRASS-user] Running r-grass examples when building a R package

Dear all,

I am building a R package and some of the functions use rgrass to connect to a 
GRASS project and run thingfs within GRASS.
I have now set up a webpage for the package using pkgdown in integrated to 
Github actions. This means when I push new commits all the examples of R 
functions are run again and the webpage is updated with the results of the 
examples. Here is the webpage: 
https://ninanor.github.io/oneimpact/

All works fine, except the functions calling GRASS. When I run the examples 
form my local computer everything works, but in the Github actions it does not 
run, apparently because the command


system("grass78
 --config path", intern = T)
to find the GRASS folder and use within rgrass::initGRASS does not work, so the 
connection between R and GRASS do not exist.

Does someone in the group has experience with that and could help with hints to 
solve it?
Is there a recommended way to make sure Github actions know where GRASS is and 
use it?

Best
Bernardo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] temporal raster accumulation

2022-08-09 Thread Stefan Blumentrath
Hi Ivan,

A simple, quick-and-dirty approach could be:
t.rast.algebra basename=rain5 expression="rain5=rain + rain[-1] + rain[-2] + 
rain[-3] + rain[-4] + rain[-5]"

Temporal selection (start_date(rain)...) is probably more elegant...

See:
https://grass.osgeo.org/grass78/manuals/t.rast.algebra.html

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Ivan 
Marchesini
Sent: tirsdag 9. august 2022 09:45
To: GRASS user list 
Subject: [GRASS-user] temporal raster accumulation

Dear GRASS users

I'm a little bit confused about which can be the best module/tool to perform 
the following task I have a strd having a daily granularity. It contains total 
daily cumulated rainfall.

I would like to create a new strd where, for each day, I have the cumulated 
rainfall in the antecedent 5 days

can you kindly suggest which is the best tool (or combination of tools) to 
reach this aim?

thank you very much

Ivan





___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStefan.Blumentrath%40nina.no%7C1944c976bd1f4fb14a3608da79db2020%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637956279455240967%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=BKqu%2F7tSMq7jNp8BF6bKDc04rf4BpwElNSif3G12gc4%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Using a script as a GRASS addon

2022-08-02 Thread Stefan Blumentrath
Hei Bernado,

On Linux you make the script executable:
chmod ugo+x path_to/r.ls.func_connectivity.py

You can rename it to r.ls.func_connectivity if you want to get rid of the .py 
ending.

Furthermore, the script should be located in directory that is part of your 
PATH environment variable.
e.g. ~/.grass7/addons/scripts/

If the script has a proper shebang (#!/usr/bin/env python3) the python 
interpreter should be launched when you call the script.

On MS Windows things are a bit different and you need a -bat wrapper script…

Please also have a look at https://github.com/wenzeslaus/r.example.plus
Which is a great start for writing addons, and provides you with a make recipe 
to install things as usual addons…

Hope that helps,
Stefan


From: grass-user  On Behalf Of Bernardo 
Santos via grass-user
Sent: mandag 1. august 2022 14:00
To: GRASS User List 
Subject: [GRASS-user] Using a script as a GRASS addon

Dear all,

I have been following some forums and instructions from GRASS documentation to 
be able to write new GRASS addons - or what I call an addon, basically a python 
script that does what I want, and follow the same standards of published GRASS 
addons, with description of the addon and usage, parameters etc, followed be 
the script with procedures.

It seems to work, but I am not sure how I can test them as GRASS addons. Right 
now, to be able to run them I need to call python like this:

python r.ls.func_connectivity.py input=map1 output=map1_func_connect 
gap_crossing=60

Is there a way I can run that without needing to call python and to use the 
".py" in the end of the script? Like a folder where I can place the files, or a 
way to build it as a formal GRASS addon. What I want is to be able to test it 
and use it (even if only locally for now) as

r.ls.func_connectivity input=map1 output=map1_func_connect gap_crossing=60

Is this documented somewhere?

Best wishes,
Bernardo

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] GRASS: Permission denied

2022-05-24 Thread Stefan Blumentrath
Hi Wolfgang,

The OSGeo4W network installer 
(http://download.osgeo.org/osgeo4w/v2/osgeo4w-setup.exe) should provide you 
with the following GRASS GIS version (per 24.05.2022):
GRASS GIS 7.8.7 (package "grass")
GRASS GIS 8.0.2 (package "grass8")
GRASS GIS 8.3.dev (package "grass-dev")

You may have to choose "advanced install" to be able to select another (or 
multiple) GRASS GIS versions.

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Wolfgang 
Kresse
Sent: mandag 23. mai 2022 16:18
To: Veronica Andreo 
Cc: GRASS user-list 
Subject: Re: [GRASS-user] GRASS: Permission denied

Hello Veronica,

thank you for your great help! After having used the OSGeo4W installer, it 
works fine, i.e. I can start GRASS without admin-rights.

Remarks:

In my first try, I did the standalone-installation with 
WinGRASS-8.0.1-1-Setup.exe

Now, the installation with OSGeo4W gave me version 7.8.5. But this is fine for 
me.

With kind regards
Wolfgang



Am 23/05/2022 um 07:16 schrieb Veronica Andreo:
> Hello Wolfgang,
> 
> In our PSC meeting, Martin commented on this (last bullet point here: 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftrac
> .osgeo.org%2Fgrass%2Fwiki%2FPSC%2FMinutes%2FPSC_Meeting_20220513d
> ata=05%7C01%7CStefan.Blumentrath%40nina.no%7C078bc7de7f7a41812a8308da3
> cc717b6%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C63788912316923948
> 9%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6
> Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=zoJh%2BFe%2FQlU2CbmKZ
> 8AhDn3jfrgiRlPlfltOPqWZvpM%3Dreserved=0
> ).
>  
> Are you by chance using the standalone installer? Would it be possible 
> for you to test GRASS installed through the OSGeo4W installer?
> 
> Best,
> Vero
> 
> El lun, 23 may 2022 a las 5:58, Wolfgang Kresse ( >) escribió:
> 
> Hi,
> 
> I am new to GRASS, but I apply it for giving a course for practitioners
> in Peru.
> 
> Problem:
> Permission denied after start of GRASS
> 
> Actions:
> I did the installation with my user account (kresse). Right after the
> installation, GRASS worked fine. But after logoff and login I got this
> error message after start:
> 
> "C:\Program Files\GRASS GIS 8.0\extrabin\python3.exe: can't open file
> 'C:\Program Files\GRASS GIS 8.0\etc\grass80.py': [Errno 13] Permission
> denied"
> 
> I got the same error message when I logged in as admin.
> 
> The only work-around that I found was a reinstallation with admin
> rights
> and then run the program with admin, too. The forums in the Internet
> gave indications to the bug.
> 
> What shall I do?
> 
> Remark: I scanned through the "grass-user Archives" back to January
> 2020, however with no success.
> 
> With best regards
> Wolfgang
> 
> 
> Neubrandenburg University of Applied Sciences
> Faculty of Landscape Sciences and Geomatics
> Brodaer Strasse 2
> 17033 Neubrandenburg
> Germany
> 
> Tel.  +49 (0) 395 5693 4865 or 4002
> Fax   +49 (0) 395 5693 4999
> E-mail kre...@hs-nb.de 
> 
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org 
> 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStefan.Blumentrath%40nina.no%7C078bc7de7f7a41812a8308da3cc717b6%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637889123169239489%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=2030ACqng2oLH2d9y8qK113TVZGxITsuOxcT4XtdbBI%3Dreserved=0
> 
>  ts.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStef
> an.Blumentrath%40nina.no%7C078bc7de7f7a41812a8308da3cc717b6%7C6cef3730
> 21314901831055b3abf02c73%7C0%7C0%7C637889123169239489%7CUnknown%7CTWFp
> bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn
> 0%3D%7C3000%7C%7C%7Csdata=2030ACqng2oLH2d9y8qK113TVZGxITsuOxcT4Xt
> dbBI%3Dreserved=0>
> 

___
grass-user mailing list
grass-user@lists.osgeo.org

Re: [GRASS-user] GRASS GIS Unable to load GDAL library

2022-04-28 Thread Stefan Blumentrath
Hi Ming,

Could you please try to install the “gdal-303-runtime” package (when you choose 
advanced install, it is in the libs section). If I am not mistaken, this is a 
glitch that should be fixed with the upcoming GRASS GIS 8.0.2 release.

Cheers
Stefan

From: grass-user  On Behalf Of ming han
Sent: torsdag 28. april 2022 16:38
To: qgis-user ; GRASS user list 

Subject: [GRASS-user] GRASS GIS Unable to load GDAL library

Hi everyone

   I installed the GRASS GIS and the QGIS at here
[cid:image001.png@01D85B22.291EF520]
   I use all default options and when I tried to use GRASS GIS,I got the 
following error.

  GRASS_INFO_ERROR(17904,1): Unable to load GDAL library
  GRASS_INFO_END(17904,1)

   Would you please let me know if you have any idea to solve this problem?

Thanks
Ming
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] multiple

2022-04-27 Thread Stefan Blumentrath
Hi Frank,

Yes, you are right. To get the intersection point you patch the line maps 
(v.patch), use v.clean on the patched maps and sve the intersection points 
(errors option in v.clean). Then you add categories to the generated points 
with v.category...
That just for correction of my earlier suggestion. Your approach with v.profile 
seems way more appropriate.

If all your lines have the same cat value, you could create new, induvial cat 
values with v.category, before you run v.profile (I have not looked at your 
dataset yet...)?

Cheers
Stefan

From: Frank David 
Sent: onsdag 27. april 2022 19:23
To: Stefan Blumentrath ; GRASS user list 

Subject: Re: [GRASS-user] multiple


Hi Stephan,

I'm not very used to v.overlay, but it seems to be used with area and not with 
lines crossing lines, isn't it ?

Frank

Le 27/04/2022 à 09:14, Stefan Blumentrath a écrit :

Hi Frank,



My general approach would be like this:

v.overay to intersect transects and lines

v.to.points use=start to get transect start points

v.distance to get distance from transect start point to point where lines cross



With v.distance you need to try whether it is sufficient to compute distance to 
the nearest point only or if you need to compute distance to all intersection 
points within the distance equal to the length of the transect...

If the latter is the case you would need to filter out lines with distances 
that are not along a transect.



Hope that helps.

v.distance can produce lines, so you could check visually if the approach works 
as expected.



Just a suggestion.



Cheers

Stefan



-Original Message-

From: grass-user 
<mailto:grass-user-boun...@lists.osgeo.org> 
On Behalf Of Frank David

Sent: tirsdag 26. april 2022 20:01

To: GRASS user list 
<mailto:grass-user@lists.osgeo.org>

Subject: [GRASS-user] multiple



Hello,



I need to identify vector lines (like roads, rivers) crossed by a transect and 
get distance from the beginning of the transect. For the moment I'm using 
v.profile but it returns only the first item. Is there any way to get all 
crossed lines ?



Thank for your help,



Frank



___

grass-user mailing list

grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStefan.Blumentrath%40nina.no%7Caf69c18ee50c48d0e93508da27afbd3a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637865933270370389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7Csdata=nldQo6FwP%2FW2SFmeQdPQCw2GKnR%2B2Dr%2FbyaTrjuteg8%3Dreserved=0<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user=05%7C01%7CStefan.Blumentrath%40nina.no%7C1240fd7d1fc9422c513408da287297be%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637866769889954957%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=1NJMtzy00JhCzzWX%2BjN7y5kiLER8wa21Xp40ceYKOYU%3D=0>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] multiple

2022-04-27 Thread Stefan Blumentrath
Hi Frank,

My general approach would be like this:
v.overay to intersect transects and lines
v.to.points use=start to get transect start points
v.distance to get distance from transect start point to point where lines cross

With v.distance you need to try whether it is sufficient to compute distance to 
the nearest point only or if you need to compute distance to all intersection 
points within the distance equal to the length of the transect...
If the latter is the case you would need to filter out lines with distances 
that are not along a transect.

Hope that helps.
v.distance can produce lines, so you could check visually if the approach works 
as expected.

Just a suggestion.

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Frank David
Sent: tirsdag 26. april 2022 20:01
To: GRASS user list 
Subject: [GRASS-user] multiple

Hello,

I need to identify vector lines (like roads, rivers) crossed by a transect and 
get distance from the beginning of the transect. For the moment I'm using 
v.profile but it returns only the first item. Is there any way to get all 
crossed lines ?

Thank for your help,

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=05%7C01%7CStefan.Blumentrath%40nina.no%7Caf69c18ee50c48d0e93508da27afbd3a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637865933270370389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7Csdata=nldQo6FwP%2FW2SFmeQdPQCw2GKnR%2B2Dr%2FbyaTrjuteg8%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] standalone grass installer version 7.6

2022-04-25 Thread Stefan Blumentrath
Hi Bernado,

Seems the download directory of older Windows Standalone installers is empty 
indeed:
https://grass.osgeo.org/grass76/binary/mswindows/native/x86_64/

For Wndows you can get older packages with osgeo4w version 1:
http://download.osgeo.org/osgeo4w/v1/osgeo4w-setup-x86_64-v1.exe

There (OSGeo4W V1) are many older GRASS packages available:
http://download.osgeo.org/osgeo4w/v1/x86_64/release/grass/grass/

Here are older generic Linux binaries:
https://grass.osgeo.org/grass74/binary/linux/snapshot/

Cheers
Stefan


From: grass-user  On Behalf Of Bernardo 
Santos via grass-user
Sent: mandag 25. april 2022 09:29
To: GRASS User List 
Subject: [GRASS-user] standalone grass installer version 7.6

Hi,

I have an application I developed a few years ago that still uses python 2.7 
and has a wxPython GUI, that I used to use until GRASS 7.6. Later on it got 
outdated and, even though a colleague and I are updating it, it still does not 
run in GRASS 7.8 or 8.

In the meanwhile, is it still possible to download and install GRASS 7.6 for 
using it? Is the standalone installer for Windows available somewhere? Or I 
would have to build it from the source?

Best
Bernardo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] GRASS and Flatpak

2022-02-28 Thread Stefan Blumentrath
Hi Vassily,

GRASS GIS seems to be included in the QGIS flatpack:
org.qgis.qgis/org.qgis.qgis.json at master · flathub/org.qgis.qgis 
(github.com)

Cheers
Stefan

From: grass-user  On Behalf Of Vassily 
Poddubny
Sent: mandag 28. februar 2022 09:00
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] GRASS and Flatpak

Hi all !

I've been having compatibility problems with packages like python, 
python-wxpython, python-wxpython-dev, etc. for about the last six months. I am 
working in Manjaro based on Arch. Today, after upgrading GRASS to version 
8.0.1-1, the Layers tab is still not working.

Is it possible to distribute GRASS using flatpak technology (to build and 
distribute desktop applications on Linux)? Are there any fundamental obstacles 
to doing so?
All the best,
 Vassily Poddubny
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] installing grass.jupyter

2022-02-02 Thread Stefan Blumentrath
BTW: You can preview some cool new stuff Caitlin is about to add here:
https://mybinder.org/v2/gh/chaedri/grass/Jupyter-Timeseries?urlpath=lab%2Ftree%2Fdoc%2Fnotebooks%2FTemporal.ipynb

Cheers
Stefan

From: Laura Poggio 
Sent: onsdag 2. februar 2022 09:36
To: Veronica Andreo 
Cc: Stefan Blumentrath ; GRASS user list 

Subject: Re: [GRASS-user] installing grass.jupyter

Hi Stephan and Veronica,
thanks! I installed grass 8.0.0RC2 and it is there. I will test if this is 
enough for the moment. If not I will install the development version from 
source.

Thanks a lot
Laura

On Tue, 1 Feb 2022 at 18:52, Veronica Andreo 
mailto:veroand...@gmail.com>> wrote:
Hi Laura,

Indeed, it's shipped with GRASS 8.0 already as experimental, but the newest 
stuff will be in the dev branch only.
This workshop from FOSS4G 2021 is a nice example of usage: 
https://github.com/ncsu-geoforall-lab/grass-gis-workshop-FOSS4G-2021<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fncsu-geoforall-lab%2Fgrass-gis-workshop-FOSS4G-2021=04%7C01%7CStefan.Blumentrath%40nina.no%7Cced3b46fa1204331654208d9e6271ad5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637793879280705721%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=HDqcvUFnRRUhyoi8gT%2BoktXKkFWMMUTQ7BbTrlhwm20%3D=0>

HTH,
Vero

El mar, 1 feb 2022 a las 17:58, Stefan Blumentrath 
(mailto:stefan.blumentr...@nina.no>>) escribió:
Hi Laura,

You would need a current development version (GRASS GIS 
8.1.dev<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2F8.1.dev%2F=04%7C01%7CStefan.Blumentrath%40nina.no%7Cced3b46fa1204331654208d9e6271ad5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637793879280705721%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=hayGm7D%2F566hPIC9dXhMwxCrKW1Fn%2BSanJJIDYip1XA%3D=0>).

For MS Windows you can get it here:
https://wingrass.fsv.cvut.cz/grass81/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwingrass.fsv.cvut.cz%2Fgrass81%2F=04%7C01%7CStefan.Blumentrath%40nina.no%7Cced3b46fa1204331654208d9e6271ad5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637793879280705721%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=FDLoSvQUF5zeyYeKE27nXrNI%2Fn5gh6VxIh11vJkEJ%2BI%3D=0>
On Linux you could clone the code and compile...

Cheers
Stefan

From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Laura Poggio
Sent: tirsdag 1. februar 2022 17:45
To: GRASS user list 
mailto:grass-user@lists.osgeo.org>>
Subject: [GRASS-user] installing grass.jupyter

Dear all,
I came across this project: 
https://trac.osgeo.org/grass/wiki/GSoC/2021/JupyterAndGRASS<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftrac.osgeo.org%2Fgrass%2Fwiki%2FGSoC%2F2021%2FJupyterAndGRASS=04%7C01%7CStefan.Blumentrath%40nina.no%7Cced3b46fa1204331654208d9e6271ad5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637793879280705721%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=ToKmIthi9KadfxuzmRn7h76CEmiFK%2FpUv8qxp8%2B8YmQ%3D=0>.
 It would be great to use it for some training material that I am working on.

I most likely have missed something, but I could not find instructions on how 
to install grass.jupyter.
Any pointers will be really helpful

Thanks
Laura
___
grass-user mailing list
grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-user<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user=04%7C01%7CStefan.Blumentrath%40nina.no%7Cced3b46fa1204331654208d9e6271ad5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637793879280705721%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=zynRww5TlgiivtoZLrQm%2BrLdaiS5A47QOoRG8LepdHQ%3D=0>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] installing grass.jupyter

2022-02-01 Thread Stefan Blumentrath
Hi Laura,

You would need a current development version (GRASS GIS 8.1.dev).

For MS Windows you can get it here:
https://wingrass.fsv.cvut.cz/grass81/
On Linux you could clone the code and compile...

Cheers
Stefan

From: grass-user  On Behalf Of Laura Poggio
Sent: tirsdag 1. februar 2022 17:45
To: GRASS user list 
Subject: [GRASS-user] installing grass.jupyter

Dear all,
I came across this project: 
https://trac.osgeo.org/grass/wiki/GSoC/2021/JupyterAndGRASS.
 It would be great to use it for some training material that I am working on.

I most likely have missed something, but I could not find instructions on how 
to install grass.jupyter.
Any pointers will be really helpful

Thanks
Laura
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.csv available?

2021-10-28 Thread Stefan Blumentrath
Hei Johannes,

Sounds like v.in.csv is the right tool.

The manual is build 
(https://grass.osgeo.org/grass78/manuals/addons/v.in.csv.html), also on MS 
Windows: https://wingrass.fsv.cvut.cz/grass78/x86_64/addons/latest/logs/
It should be available via g.extension. You would need GRASS 7.8.6 (or 8.0) 
though du to recent restructuring of the addons repository...
Alternatively, you can clone the repo and install from local file-URL (on 
non-Windows systems).

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Johannes 
Radinger
Sent: torsdag 28. oktober 2021 10:42
To: GRASS user list 
Subject: [GRASS-user] v.in.csv available?

Hi all,

I was wondering if the addon v.in.csv is available or not? I want to import a 
simple point file (*.csv) which is unfortunately in another projection then my 
location. So the tool v.in.csv looks handy.

This tool is listed here 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2Fgrass78%2Fmanuals%2Faddons%2Fdata=04%7C01%7CStefan.Blumentrath%40nina.no%7C1983499eb4f1445533b608d999eedfff%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637710074397800843%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=nE7Wfm6iA%2FSiLSkHq9bXa09PYDeNxb2wHYCIrQOWS0k%3Dreserved=0

but not here 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrasswiki.osgeo.org%2Fwiki%2FAddOns%2FGRASS7%2Fvectordata=04%7C01%7CStefan.Blumentrath%40nina.no%7C1983499eb4f1445533b608d999eedfff%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637710074397810835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=IAZc5CpQDMKkiPqlXSIIUX3G0T4IhtRYNvJGfHIeGXQ%3Dreserved=0
 and seems not be available via g.extension(?)

Any suggestion? What would be the most convenient way to do such an import with 
coordinate transformation to match my current location?

Cheers,

Johannes

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7CStefan.Blumentrath%40nina.no%7C1983499eb4f1445533b608d999eedfff%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637710074397810835%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=Sn%2FJqpmJUDP80ygS%2FT5BF2S3s7EHjFdl66Spqryu%2FpA%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.ascii column identifications

2021-10-01 Thread Stefan Blumentrath
Hi Rich,

Please check your "separator" settings. Default is pipe |, but your data seems 
to be comma delimited.

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Rich Shepard
Sent: fredag 1. oktober 2021 18:07
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] v.in.ascii column identifications

The 8.0.dev manual for v.in.ascii describes the column identifiers:
x=integer
 Number of column used as x coordinate (points mode)
 First column is 1
 Default: 1
y=integer
 Number of column used as y coordinate (points mode)
 First column is 1
 Default: 2
z=integer
 Number of column used as z coordinate (points mode)
 First column is 1. If 0, z coordinate is not used
 Default: 0

Entering v.in.ascii on the command line (lines wrapped in alpine):
v.in.ascii -z
in=~/projects/washington/project/data/bathymetry/coe/CL_33_LDYX_20210712_CS.xyz
out=lady_xsec_depths for=point x=1 y=2 z=3 col='x double precision, y double 
precision, z integer' --o

yields this response from GRASS:
WARNING: ntokens: 1, xcol: 0, ycol: 1, zcol: 2
ERROR: Broken row 2: '7709581.42,697951.64,24'

When I change the command to match the above:
ERROR: Column numbers must not be negative GRASS project/bathymetry:analyses > 
ERROR: Column numbers must not be negative

And when I try it again:
bash: GRASS: command not found

What might be going on here? Now neither the command line nor the GUI will 
import an ASCII point file.

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7CStefan.Blumentrath%40nina.no%7Cfebb7f0f75b04a758b1008d984f57cf7%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637687012593647527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=wPke%2FDQRpWHE0Xg6jZwhrh0XoVEOkj9ISz51fH6fXQg%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Searching EPSG database [RESOLVED]

2021-09-30 Thread Stefan Blumentrath
What about:
https://grass.osgeo.org/grass78/manuals/addons/g.projpicker.html
?

-Original Message-
From: grass-user  On Behalf Of Jeff McKenna
Sent: torsdag 30. september 2021 05:21
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Searching EPSG database [RESOLVED]

On 2021-09-29 8:21 p.m., Rich Shepard wrote:
> On Wed, 29 Sep 2021, Rich Shepard wrote:
> 
>> I registered with epsg.org but when I enter a state's name in the 
>> search box and click the 'GO' button nothing changes; displayed is 
>> the entire list starting with Aruba.
> 
> I used spatialreferences.org instead. When I enter a state's name in 
> their search box a list of all projection codes is presented.
> 


Please note that spatialreferences.org is no longer maintained.  If you 
want a fancy search, use 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fepsg.io%2Fdata=04%7C01%7CStefan.Blumentrath%40nina.no%7C4d521c91cf24459dde3908d983c16236%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637685689463298331%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=3iBP2%2FCz%2BeU5uO6L%2FmnvFctap7ofIypli66K%2BSbqoBE%3Dreserved=0
   (but remember, epsg.org has 
the guaranteed search results in terms of searching the actual EPSG database 
source - see my previous message on this)

-jeff


--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of 
FOSS4G
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgatewaygeo.com%2Fdata=04%7C01%7CStefan.Blumentrath%40nina.no%7C4d521c91cf24459dde3908d983c16236%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637685689463298331%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=nm5K6R3I1usVceQ%2B%2Fl%2FInUs2fxS9xomCVxRafHHWW9I%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7CStefan.Blumentrath%40nina.no%7C4d521c91cf24459dde3908d983c16236%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637685689463298331%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=iSrT8dEYJryJtLM%2FLGQGsE3pT9ZwqeDsXlUmUmjy%2Bjk%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error import from grass.pygrass.vector library

2021-08-24 Thread Stefan Blumentrath
What version of grass_sessions do you use?
I run grass_session 0.4 on Ubuntu 18.04 with GRASS 7.8 and your script works 
fine...

From: grass-user  On Behalf Of Manuele 
Pesenti
Sent: tirsdag 24. august 2021 10:53
To: Grass User 
Subject: Re: [GRASS-user] Error import from grass.pygrass.vector library




 Attivato mar, 24 ago 2021 10:10:10 +0200 Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> ha scritto 

Hm...

Did you initialize the session, e.g. like:

with Session(gisdb="/tmp", location="location", create_opts="EPSG:4326"):
from grass.pygrass.vector import Vector

Yes it's exactly what I do, the strange fact is that I can by-pass the 
exception assigning the LD_LIBRARY_PATH value before running the script even if 
even now before importing vector lib this env variable has the correct value 
exactly thanks to the grass_session lib import...

so the script modified as you suggested reported here under still raise the 
exception

# -*- coding: utf-8 -*-

import os, sys

GISBASE = '/usr/lib/grass78'
GRASSBIN = '/usr/bin/grass78'

# Define GRASS-Python environment
os.environ['GISBASE'] = GISBASE

os.environ['GRASSBIN'] = GRASSBIN

sys.path.append(os.path.join(GISBASE, "etc", "python"))

from grass_session import Session
import grass.script as gs

print(f"LD_LIBRARY_PATH: {os.environ['LD_LIBRARY_PATH']}")
print(f"GRASSBIN: {os.environ['GRASSBIN']}")

with Session(gisdb="/tmp", location="location", create_opts="EPSG:4326"):

from grass.pygrass.vector import Vector

print('DONE!')


while the old script (for convenience reported here under) runned as

$ LD_LIBRARY_PATH=$(grass78 --config path)/lib python import_test.py
LD_LIBRARY_PATH: /usr/lib/grass78/lib
GRASSBIN: /usr/bin/grass78
DONE!

returns just what printed in the script without raising the exception.

# -*- coding: utf-8 -*-

import os, sys

GISBASE = '/usr/lib/grass78'
GRASSBIN = '/usr/bin/grass78'

# Define GRASS-Python environment
os.environ['GISBASE'] = GISBASE

os.environ['GRASSBIN'] = GRASSBIN

sys.path.append(os.path.join(GISBASE, "etc", "python"))

# from grass_session import Session
import grass.script as gs

print(f"LD_LIBRARY_PATH: {os.environ['LD_LIBRARY_PATH']}")
print(f"GRASSBIN: {os.environ['GRASSBIN']}")

# with Session(gisdb="/tmp", location="location", create_opts="EPSG:4326"):

from grass.pygrass.vector import Vector

print('DONE!')

Cheers

Manuele



Cheers
Stefan

From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Manuele Pesenti
Sent: tirsdag 24. august 2021 09:38
To: Grass User mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] Error import from grass.pygrass.vector library


Drear Stefan,
thanks for your quick reply but the solution is not so clear, I already use 
grass_session library even if not reported in the attached example, how can it 
helps with the issue? Just import the vector library after the session is 
loaded does not solve as far as I've tested.

Cheers

Manuele

 Attivato ven, 20 ago 2021 21:26:22 +0200 Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> ha scritto 

Dear Manuele,

For ctypes in pygrass, the C-libraries need to be loaded explicitly.

You could have a look here:
https://github.com/zarch/grass-session/blob/6097f834be20ee0d703deb2af90f22d6dc66f368/grass_session/session.py#L332<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzarch%2Fgrass-session%2Fblob%2F6097f834be20ee0d703deb2af90f22d6dc66f368%2Fgrass_session%2Fsession.py%23L332=04%7C01%7C%7C787f11b2fc5246a7da6d08d966dc9ee5%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637653920686707703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000=XA2vZhGMasSyLFE3KRrBPaXUjewtp2MNBzA4Dwfre9g%3D=0>
to see how it can be done, or just use the grass_session python library (pip 
install grass-session) for convenience...

Cheers
Stefan

From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Manuele Pesenti
Sent: fredag 20. august 2021 16:40
To: grass-user mailto:grass-user@lists.osgeo.org>>
Subject: [GRASS-user] Error import from grass.pygrass.vector library

Dear All,

I'm moving my first steps on the development of a python script that uses 
Grass, but I cannot import from the grass.pygrass.vector library.
I work on a Ubuntu/Linux environment and I've installed grass using apt, this 
is the test script I'm currently running:

# -*- coding: utf-8 -*-

import os, sys

GISBASE = '/usr/lib/grass78'
GRASSBIN = '/usr/bin/grass78'

# Define GRASS-Python environment
os.environ['GISBASE'] = GISBASE

os.environ['GRASSBIN'] = GRASSBIN

sys.path.append(os.path.join(GISBASE, "etc", "python"))

from grass_session import Session
import grass.script as gs

print(f"LD_

Re: [GRASS-user] Error import from grass.pygrass.vector library

2021-08-24 Thread Stefan Blumentrath
Hm...

Did you initialize the session, e.g. like:

with Session(gisdb="/tmp", location="location", create_opts="EPSG:4326"):
from grass.pygrass.vector import Vector


Cheers
Stefan

From: grass-user  On Behalf Of Manuele 
Pesenti
Sent: tirsdag 24. august 2021 09:38
To: Grass User 
Subject: Re: [GRASS-user] Error import from grass.pygrass.vector library


Drear Stefan,
thanks for your quick reply but the solution is not so clear, I already use 
grass_session library even if not reported in the attached example, how can it 
helps with the issue? Just import the vector library after the session is 
loaded does not solve as far as I've tested.

Cheers

Manuele

 Attivato ven, 20 ago 2021 21:26:22 +0200 Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> ha scritto 

Dear Manuele,

For ctypes in pygrass, the C-libraries need to be loaded explicitly.

You could have a look here:
https://github.com/zarch/grass-session/blob/6097f834be20ee0d703deb2af90f22d6dc66f368/grass_session/session.py#L332<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzarch%2Fgrass-session%2Fblob%2F6097f834be20ee0d703deb2af90f22d6dc66f368%2Fgrass_session%2Fsession.py%23L332=04%7C01%7C%7C5490515dd62a4bc57acf08d966d433e6%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637653884462405890%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000=V0ecwomhbdvobU2B3tal1udBRXj5jkvWwN9e4K0dKSw%3D=0>
to see how it can be done, or just use the grass_session python library (pip 
install grass-session) for convenience...

Cheers
Stefan

From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Manuele Pesenti
Sent: fredag 20. august 2021 16:40
To: grass-user mailto:grass-user@lists.osgeo.org>>
Subject: [GRASS-user] Error import from grass.pygrass.vector library

Dear All,

I'm moving my first steps on the development of a python script that uses 
Grass, but I cannot import from the grass.pygrass.vector library.
I work on a Ubuntu/Linux environment and I've installed grass using apt, this 
is the test script I'm currently running:

# -*- coding: utf-8 -*-

import os, sys

GISBASE = '/usr/lib/grass78'
GRASSBIN = '/usr/bin/grass78'

# Define GRASS-Python environment
os.environ['GISBASE'] = GISBASE

os.environ['GRASSBIN'] = GRASSBIN

sys.path.append(os.path.join(GISBASE, "etc", "python"))

from grass_session import Session
import grass.script as gs

print(f"LD_LIBRARY_PATH: {os.environ['LD_LIBRARY_PATH']}")
print(f"GRASSBIN: {os.environ['GRASSBIN']}")

from grass.pygrass.vector import Vector

print('DONE!')

and this is the output:

$ python import_test.py
LD_LIBRARY_PATH: /usr/lib/grass78/lib
GRASSBIN: /usr/bin/grass78
Traceback (most recent call last):
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 76, in 
load
return ctypes.cdll.LoadLibrary(path)
  File "/usr/lib/python3.9/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
  File "/usr/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libgrass_datetime.7.8.so: cannot open shared object file: No such file 
or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/manuele/Lavoro/ETS/ETSCore/scripts/import_test.py", line 21, in 

from grass.pygrass.vector import Vector
  File "/usr/lib/grass78/etc/python/grass/pygrass/vector/__init__.py", line 5, 
in 
import grass.lib.gis as libgis
  File "/usr/lib/grass78/etc/python/grass/lib/gis.py", line 23, in 
_libs["grass_gis.7.8"] = load_library("grass_gis.7.8")
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 62, in 
load_library
return self.load(path)
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 78, in 
load
raise ImportError(e)
ImportError: libgrass_datetime.7.8.so: cannot open shared object file: No such 
file or directory

Thank you very mutch for any help

Cheers

  Manuele






___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error import from grass.pygrass.vector library

2021-08-20 Thread Stefan Blumentrath
Dear Manuele,

For ctypes in pygrass, the C-libraries need to be loaded explicitly.

You could have a look here:
https://github.com/zarch/grass-session/blob/6097f834be20ee0d703deb2af90f22d6dc66f368/grass_session/session.py#L332
to see how it can be done, or just use the grass_session python library (pip 
install grass-session) for convenience…

Cheers
Stefan

From: grass-user  On Behalf Of Manuele 
Pesenti
Sent: fredag 20. august 2021 16:40
To: grass-user 
Subject: [GRASS-user] Error import from grass.pygrass.vector library

Dear All,

I'm moving my first steps on the development of a python script that uses 
Grass, but I cannot import from the grass.pygrass.vector library.
I work on a Ubuntu/Linux environment and I've installed grass using apt, this 
is the test script I'm currently running:

# -*- coding: utf-8 -*-

import os, sys

GISBASE = '/usr/lib/grass78'
GRASSBIN = '/usr/bin/grass78'

# Define GRASS-Python environment
os.environ['GISBASE'] = GISBASE

os.environ['GRASSBIN'] = GRASSBIN

sys.path.append(os.path.join(GISBASE, "etc", "python"))

from grass_session import Session
import grass.script as gs

print(f"LD_LIBRARY_PATH: {os.environ['LD_LIBRARY_PATH']}")
print(f"GRASSBIN: {os.environ['GRASSBIN']}")

from grass.pygrass.vector import Vector

print('DONE!')

and this is the output:

$ python import_test.py
LD_LIBRARY_PATH: /usr/lib/grass78/lib
GRASSBIN: /usr/bin/grass78
Traceback (most recent call last):
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 76, in 
load
return ctypes.cdll.LoadLibrary(path)
  File "/usr/lib/python3.9/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
  File "/usr/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libgrass_datetime.7.8.so: cannot open shared object file: No such file 
or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/manuele/Lavoro/ETS/ETSCore/scripts/import_test.py", line 21, in 

from grass.pygrass.vector import Vector
  File "/usr/lib/grass78/etc/python/grass/pygrass/vector/__init__.py", line 5, 
in 
import grass.lib.gis as libgis
  File "/usr/lib/grass78/etc/python/grass/lib/gis.py", line 23, in 
_libs["grass_gis.7.8"] = load_library("grass_gis.7.8")
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 62, in 
load_library
return self.load(path)
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 78, in 
load
raise ImportError(e)
ImportError: libgrass_datetime.7.8.so: cannot open shared object file: No such 
file or directory

Thank you very mutch for any help

Cheers

  Manuele




___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.external, postgis materialized views and projection

2021-08-17 Thread Stefan Blumentrath
Hi Donovan,

Did you try the suggestion from the error message to use the -o flag?
That overwrites the projection check and should link the data assuming the 
projection of your GRASS mapset.

Cheers
Stefan

From: grass-user  On Behalf Of Donovan 
Cameron
Sent: tirsdag 17. august 2021 07:06
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] v.external, postgis materialized views and projection

On 2021-08-16 12:18 p.m., Phillip Allen wrote:
I am not sure about GRASS's quirks in respect to this problem but I do see in 
QGIS that in my views I often have to specifically CAST my geometries so QGIS 
can see the Z & M values:

example: SELECT b. sample_id, b. au_ppm, b. as_ppm, b. cu_ppm, 
ST_TRANSFORM(b.geom, 32718 )::geometry(LineStringZM,32718) FROM bore_hole b;

Tested on a new set of polygons and casted but it didn't make a difference. 
GRASS doesn't like ST_Transform on materialized views it looks like.

All the views are opening in QGIS fine and with their correct projection and 
geometry type (with and without casting to a specific type).


On Mon, Aug 16, 2021 at 1:10 PM Saulteau Don 
mailto:sault@gmail.com>> wrote:
When I use v.external to load a postgis materialized view it says the 
projection mismatches the Location but they are actually the same.

% v.external input="PG:host=localhost dbname=database" layer=table_1 output=t
ERROR: Projection of dataset does not appear to match current location.

  Location PROJ_INFO is:
  name: NAD83 / UTM zone 10N
  datum: nad83
  ellps: grs80
  proj: utm
  zone: 10
  no_defs: defined
  init: EPSG:26910

  Dataset PROJ_INFO is:
  name: NAD83 / BC Albers
  datum: nad83
  ellps: grs80
  proj: aea
  lat_0: 45
  lon_0: -126
  lat_1: 50
  lat_2: 58.5
  x_0: 100
  y_0: 0
  no_defs: defined

  Difference in: proj

  In case of no significant differences in the projection definitions,
  use the -o flag to ignore them and use current location definition.
  Consider generating a new location from the input dataset using the
  'location' parameter.

It looks like GRASS sees the projection from the source table used for the 
materialized view instead of the materialized views projection that was set in 
postgis using ST_Transform().

Is this normal for grass to see materialized views like this?




Donovan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Error with installing addons in Windows

2021-08-01 Thread Stefan Blumentrath
Hi Sajid,

On Windows, addons are distributed as precompiled binaries for a specific 
version.
7.8.6 is just a release candidate, so there are no pre-compiled addons yet.
With OSGeo4W Version 1, which you can get here:
https://download.osgeo.org/osgeo4w/osgeo4w-setup-x86-v1.exe
you can get GRASS 7.8.5 where installation of addons works fine.

In order to make addons work for GRASS 7.8.6 we would first need a release and 
then packaging of addons for that version. So no quick fix.

As a workaround you could download the required addons for GRASS 7.8.5 and ask 
your students to extract them into their user profile, which is typically:
C:\Users\%USER%\AppData\Roaming\GRASS7\addons\
That is a hack of course but should work (though I have not tested)...

As for your related questions:
1) Might be a good idea to support installation of addons from local zip files. 
At least for Python scripts that should generally work. There is already a 
similar feature request in here: 
https://github.com/OSGeo/grass/issues/625#issuecomment-797414504...
2) Not sure I understand the question correctly, but you could check if an 
addon is present (e.g. with 
https://grass.osgeo.org/grass79/manuals/libpython/script.html?highlight=find_#script.core.find_program)

Hope that helps a bit (though it may be late for your course).

Cheers
Stefan

Fra: grass-user  på vegne av Sajid Pareeth 

Sendt: torsdag 29. juli 2021 16:48
Til: GRASS user list 
Emne: [GRASS-user] Error with installing addons in Windows

Dear all

While installing an addon using g.extension in Windows 10, gives the following 
error.

"ERROR: Cannot open URL:
   
http://wingrass.fsv.cvut.cz/grass78/x86_64/addons/grass-7.8.6RC1/r.series.lwr.zip"

I see that the addons for 7.8.5 are accessible:   
http://wingrass.fsv.cvut.cz/grass78/x86_64/addons/grass-7.8.5RC1/r.series.lwr.zip
 ; But not accessible for 7.8.6RC1.

The latest OSGeo4W setup gives two GRASS GIS versions: 7.8.6RC1-4 and 
7.8.6RC1-5.

So there is no option to install 7.8.5 using OSGeo4W.

Any quick work around for this issue? I am in the middle of providing training, 
and it would be great if there is a quick fix.

Related questions:
1) Is there any way to install an addon from a local zip package or url in 
Windows? In the manual it says it works only for Linux and Mac.

2) Is there any way to skip installation of an addon, if it is already 
installed? Useful within a python script.

Many thanks in advance

Best

Sajid


___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Cannot read NetCDF with 'semi_major_axis' or 'inverse_flattening'

2021-07-24 Thread Stefan Blumentrath
Hei Ken,

Did you try the -o flag ("Override projection check (use current location's 
projection)
Assume that the dataset has same projection as the current location")?
https://grass.osgeo.org/grass78/manuals/r.external.html
As the error message suggests?

If you are sure that projections in fact match, a mismatch in CRS description 
can be overridden that way, without modifying the input file.

Alternatively, you can use r.import to reproject while converting to GRASS 
format or you create a new location...

Cheers
Stefan


-Original Message-
From: grass-user  On Behalf Of Ken Mankoff
Sent: fredag 23. juli 2021 19:33
To: GRASS user list 
Subject: [GRASS-user] Cannot read NetCDF with 'semi_major_axis' or 
'inverse_flattening'

Hello list,

I have been given an updated NetCDF file - everything is the same as the old 
version except there are two new attributes in the 'mapping' variable:

char mapping ;
mapping:geoid = "eigen-6c4" ;
mapping:grid_mapping_name = "polar_stereographic" ;
mapping:latitude_of_projection_origin = 90. ;
mapping:standard_parallel = 70. ;
mapping:straight_vertical_longitude_from_pole = -45. ;
mapping:semi_major_axis = 6378273. ;
mapping:inverse_flattening = 298.27940504282 ;
mapping:false_easting = 0. ;
mapping:false_northing = 0. ;
mapping:_Storage = "contiguous" ;


Specifically:
mapping:semi_major_axis = 6378273. ;
mapping:inverse_flattening = 298.27940504282 ;

When I try to load this file with:

r.external source=netCDF:file.nc:surface output=surface

I get this error:

WARNING: Datum  not recognised by GRASS and no parameters found
ERROR: Projection of dataset does not appear to match current location.

Location PROJ_INFO is:
name: WGS 84 / NSIDC Sea Ice Polar Stereographic North
datum: wgs84
ellps: wgs84
proj: stere
lat_0: 90
lat_ts: 70
lon_0: -45
x_0: 0
y_0: 0
no_defs: defined
init: EPSG:3413

Dataset PROJ_INFO is:
name: unnamed
a: 6378273
es: 0.00669388300017
proj: stere
lat_0: 90
lat_ts: 70
lon_0: -45
x_0: 0
y_0: 0
no_defs: defined

ERROR: datum

In case of no significant differences in the projection definitions, use the -o 
flag to ignore them and use current location definition.
Consider generating a new location from the input dataset using the 'location' 
parameter.


If I remove thos two attributes (semi_major_axis and inverse_flattening) with:

ncatted -O -h -a semi_major_axis,mapping,d,l,6378273 -a 
inverse_flattening,mapping,d,f,298.27940504282 file.nc foo.nc

And then try to read in the data, it works.

Is there some reason that those two attributes make it difficult to load the 
data in GRASS? Is there a better work-around than removing them? The documented 
projection of the data has not changed, only some of the metadata.

Versions:
gdal 3.0.4
grass 7.8.2

Thank you,

   -k.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7C900b853648c545edd6fd08d94dffe4cb%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637626583719044920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=wWKyBuAKwbuobSGVQ6q97VXj1OIiCLSN9NlbXDLw7tc%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Extracting data from 4D or higher D (not 3D) NetCDF file

2021-06-03 Thread Stefan Blumentrath
Hei Ken,

I am working on an import module for that right now, if the netCDF file follows 
the CF convention.

I do have a prototype in a private git repo. Will invite you to test if you 
like...
Hope I can publish it soon!

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Ken Mankoff
Sent: torsdag 3. juni 2021 14:52
To: GRASS user list 
Subject: [GRASS-user] Extracting data from 4D or higher D (not 3D) NetCDF file

Hello GRASS List,

I regularly extract raster slices from a 3D NetCDF using the 'band' option to 
r.external or r.in.gdal.

I now have a NetCDF file with a 4D raster (x,y,layer,t). Is there some way to 
access all x, all y, one layer, and loop through t?

Thanks,

  -k.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7C2cddb4a2a6d5405dea7608d9268e5c1d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637583215134654760%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Z2O6uqTrNnybW9a%2FCVMqVjsU1ShF6gut2Jwhev03Jms%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] bayesian belief network analysis (was r.binfer)

2021-06-01 Thread Stefan Blumentrath
Hi Donovan,

If you know how to put together some Python code, you could have a look at 
PyMC3: https://docs.pymc.io/
That can be basically used like scikit-learn in r.learn.ml.

You load GRASS data into a numpy array with e.g. r.what, r.stats, v.db.select, 
or using pygrass (e.g. reading entire raster maps with raster2numpy) and create 
training and test data that that you feed into a model...

There have been some efforts to move to TensorFlow as backend in PyMC, but that 
seems to be abandoned and PyMC devs are now continuing with JAX 
(https://pymc-devs.medium.com/the-future-of-pymc3-or-theano-is-dead-long-live-theano-d8005f8a0e9b).

Cheers,
Stefan


From: grass-user  On Behalf Of Saulteau Don
Sent: lørdag 29. mai 2021 21:13
To: GRASS user list 
Subject: Re: [GRASS-user] bayesian belief network analysis (was r.binfer)

OK thanks! I'll see if I can find an old grass executable, compile in a VM with 
r.binfer in it or fallback to QGIS and OpenBugs. I thought I'd poke around 
cause I prefer analysis in GRASS over any other platform out there :)

I've started to assist indigenous nations with assertion and 
protection/preservation of their rights with GIS. Some of these analytical 
methods like fuzzy/boolean patch modelling, weighted overlays, bayesian belief 
networks (BBN) allow them to translate their oral history and ecological 
knowledge into tools that help them engage effectively and meaningfully with 
other parties such as other nations/governments and industries who have 
expressed interest in their lands and resources.

I SO wish I could code or even knew what to ask for in procurement for these 
things cause I would.

Been a lowly user, bug reporter, package maintainer and crowd funder. 
Continuing to find ways to feed back and wholly contribute into these FOSS 
communities any way I can.




Donovan
On Sat., May 29, 2021, 03:12 Markus Neteler, 
mailto:nete...@osgeo.org>> wrote:
On Sat, May 29, 2021 at 4:20 AM Donovan Cameron 
mailto:sault@gmail.com>> wrote:
>
> Evening,
>
> I'm attempting to analyze a set of layers (slope, aspect, vegetation,
> soil, etc) that have been coded/scored based on expert opinion to output
> a probability/suitability map.
>
> I'm looking to apply a bayesian belief network [1] and i've got the
> raster layers ready for the inputs and coded like seen in this figure [2].
>
> There was a grass4 module called r.binfer [3] that did this and I can't
> seem to find it with GRASS 78 - deprecated or replaced?

The latest code trace which I could find is this one:

GRASS GIS 5.5:
https://github.com/OSGeo/grass-legacy/tree/releasebranch_5_5/src/raster/r.binfer

I do not recall why the module has been abandoned in GRASS GIS 6
(maybe no particular reason and a volunteer could update it...?).

Another option might be to rely on R and use "rgrass7" to exchange
data between GRASS GIS and R.

Best,
Markus

> Searches lead me to either r.regression.multi [4] or 
> r.learn.ml
>  [5] but
> i'm not sure where to start with these to get a BBN processed thru them.
>
>
> SaultDon
>
> [1] 
> https://www.gislounge.com/gis-bayesian-belief-networks/
> [2]
> https://www.sciencedirect.com/science/article/pii/S0169204618307497#f0010
> [3] 
> 

Re: [GRASS-user] GRASS GIS 7.8.5 r.water.outlet

2021-05-19 Thread Stefan Blumentrath
Hi Kelesy,

In addition to Michas very good suggestions you can try the table module in 
pygrass: 
https://grass.osgeo.org/grass78/manuals/libpython/pygrass.vector.html?highlight=table#module-pygrass.vector.table
Or the db_select module from the scripting library: 
https://grass.osgeo.org/grass78/manuals/libpython/script.html?highlight=select#script.db.db_select
 for all kind of tables
Or the vector_db_select module: 
https://grass.osgeo.org/grass78/manuals/libpython/script.html?highlight=select#script.vector.vector_db_select
 for tables connected to vector maps
To get the coordinates in Python...

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Kelsey Wong
Sent: onsdag 19. mai 2021 20:52
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] GRASS GIS 7.8.5 r.water.outlet

Hi,

I am trying to use the r.water.outlet function in a python script in GRASS. For 
the 'coordinates' parameter my x,y coordinate values are stored in two columns 
in the attribute table of another layer. Is there a way to access these values 
from the attribute table directly?

Thanks,

Kelsey
___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7Cd2729cbc538a4733864908d91af73bb6%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637570471438665050%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=OrVazRa4Mkas0DxUkYtb8i0lfHwFul06zoYFzxO0Dhs%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] GRASS GIS 7.8.5 v.distance

2021-05-13 Thread Stefan Blumentrath
Hi Kelsey,

Try: "from_"

So, 
gs.run_command('v.distance', 
from_ = 'buildings', 
to = 'mappedStreams',

The problem is indeed that from is a keyword...

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Kelsey Wong
Sent: torsdag 13. mai 2021 21:32
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] GRASS GIS 7.8.5 v.distance

Hi,

I am trying to use the v.distance function in GRASS GIS 7.8.5, however, it 
won't accept 'from' as a parameter as it's a python keyword (I think). When I 
use 'FROM' I get an error saying:

WARNING: Illegal filename . Character <=> not allowed.
ERROR: Vector map  not found

This is the code I'm trying to run:

gs.run_command('v.distance', 
FROM = 'buildings', 
to = 'mappedStreams', 
upload = 'to_attr', 
column = 'stream_id', 
to_column = 'OBJECTID', 
output = 'distanceLines', 
overwrite = True)

Any help would be greatly appreciated.

Thanks!
___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7C8d24cded0189434d8cc708d91646e043%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637565316357978059%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Wi6V%2FnzJQvTKzyUf0oK6q18d0MOMI%2FPOrLbNms2BfZQ%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Orthorectification without GCPs

2021-04-16 Thread Stefan Blumentrath
Hei Dugal,

g.gui.image2target generates the "CONTROL_POINTS" file (I guess in the folder 
of the image group).
If you want to skip g.gui.image2target, you have to create that file a 
different way.

Here is one possible way:
Just create a random list of GCPs in g.gui.image2target to see how the file 
should look like and then re-create it with the GCPs you have (e.g. in a script 
or however your workflow is).

Cheers
Stefan

From: grass-user  On Behalf Of Dugal Harris
Sent: fredag 16. april 2021 12:42
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Orthorectification without GCPs

Good day

I wonder if anyone could help with this...  I am new to GRASS and am trying to 
orthorectify aerial images.  I have accurate camera exterior orientations 
already, so want to skip the manual g.gui.image2target step in 
https://grass.osgeo.org/grass78/manuals/i.ortho.photo.html,
 and just apply the exterior orientation as is.  Is this possible?

If I run i.ortho.rectify without that step, I get:
WARNING: Unable to find file [CONTROL_POINTS] of group 
[3318D_2016_1143_07_0315_RGB_NoRotate@NGI_3318DD_Ortho_Test in 
NGI_3318DD_Ortho_Test]
WARNING: unable to open control point (Z) file for group 
[3318D_2016_1143_07_0315_RGB_NoRotate@NGI_3318DD_Ortho_Test in 
NGI_3318DD_Ortho_Test]

Thank you
Dugal


___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 7.6

2021-03-09 Thread Stefan Blumentrath
Hi again,

Yes, this seems to be a Python2/3 issue. Good suggestions from Vero.
Enrico, can also try to replace python3 with just python in the shebang (first 
line in the script)?

Cheers
Stefan

From: Veronica Andreo 
Sent: mandag 8. mars 2021 12:38
To: Enrico Gabrielli bonushenricus 
Cc: Stefan Blumentrath ; grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in 
GRASS 7.6

Hi Enrico,

GRASS 7.6 is the last using python 2, and in 7.8 we moved to python 3, though 
still supporting python 2. Could that be a problem?

What about compiling GRASS 7.8+ if not in the Debian stable repos?
https://grasswiki.osgeo.org/wiki/Compile_and_Install#Debian<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrasswiki.osgeo.org%2Fwiki%2FCompile_and_Install%23Debian=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002815993017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000=R7UVMefbQoGJbH7Hy4rfjjI0qDfREnG1XyMZ3f1nNtE%3D=0>

my 0.2 cents
Vero

El lun, 8 mar 2021 a las 11:37, Enrico Gabrielli bonushenricus 
(mailto:bonushenricu...@gmail.com>>) escribió:
Thanks
some problems:
> File "/home/bonushenricus/.grass7/addons/scripts/r.slope.d
> irection.py", line 291, in 
> options, flags = gscript.parser()
>   File "/usr/lib/grass76/etc/python/grass/script/core.py",
> line 800, in parser
> return _parse_opts(lines[1:])
>   File "/usr/lib/grass76/etc/python/grass/script/core.py",
> line 751, in _parse_opts
> os.environ[var] = val
>   File "/usr/lib/python3.7/os.py", line 682, in __setitem__
> key = self.encodekey(key)
>   File "/usr/lib/python3.7/os.py", line 753, in encode
> raise TypeError("str expected, not %s" %
> type(value).__name__)
> TypeError: str expected, not bytes
It seems that the files are all there, but perhaps they must be
updated. That's pity. Alternatively I will use MAPCALC with
ABS (ATAN (TAN (slope) * COS (aspect - raster_direction)))
but unfortunately with an extra passage and without the possibility of
defining calculation steps.


Il giorno lun, 08/03/2021 alle 09.04 +, Stefan Blumentrath ha
scritto:
> Hm, maybe some fixes for g.extension should be backported to 7.6...
>
> Anyway, as a workaround, you can just save the python script from (as
> r.slope.direction
> https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/raster/r.slope.direction/r.slope.direction.py<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2FOSGeo%2Fgrass-addons%2Fmaster%2Fgrass7%2Fraster%2Fr.slope.direction%2Fr.slope.direction.py=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002815993017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000=Z09e%2BMFUsYSqmqr%2F4GBoOiUmIJIPrrIk4L8FKXMISj8%3D=0>
> ) to:
> ~/.grass7/addons/scripts/
>
> Then make it executable:
> chmod u+x ~/.grass7/addons/scripts/r.slope.direction
>
> And it should work...
>
> Cheers
> Stefan
>
> -Original Message-
> From: Enrico Gabrielli bonushenricus 
> mailto:bonushenricu...@gmail.com>>
> Sent: mandag 8. mars 2021 09:44
> To: Stefan Blumentrath 
> mailto:stefan.blumentr...@nina.no>>;
> grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of
> 7.8) in GRASS 7.6
>
> Hi Stefan
> and thanks
> Thanks to all and all developers! And here I have the answer directly
> from those who have developed R-Slope.Direction, no ??
> Here's what happens:
> > g.extension extension=r.slope.direction
> > operation=add
> > Fetching  from GRASS GIS Addons repository (be
> > patient)...
> > ERROR: Extension  not found
>
> Il giorno lun, 08/03/2021 alle 08.38 +, Stefan Blumentrath ha
> scritto:
> > Hi Enrico,
> >
> > GRASS 7.6 should not be a limiting factor. Did you try to install
> > the
> > addon through g.extension?
> >
> > g.extension extension=r.slope.direction operation=add
> >
> > If not, please try. If you did but get an error message, please
> > provide the error message you got...
> >
> > Cheers
> > Stefan
> >
> >
> > -Original Message-
> > From: grass-user 
> > mailto:grass-user-boun...@lists.osgeo.org>>
> >  On Behalf Of
> > Enrico Gabrielli bonushenricus
> > Sent: søndag 7. mars 2021 23:59
> > To: grass-ita...@listserv.unipr.it<mailto:grass-ita...@listserv.unipr.it>; 
> > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
>

Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 7.6

2021-03-08 Thread Stefan Blumentrath
Hm, maybe some fixes for g.extension should be backported to 7.6...

Anyway, as a workaround, you can just save the python script from (as 
r.slope.direction 
https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/raster/r.slope.direction/r.slope.direction.py)
 to:
~/.grass7/addons/scripts/

Then make it executable:
chmod u+x ~/.grass7/addons/scripts/r.slope.direction

And it should work...

Cheers
Stefan

-Original Message-
From: Enrico Gabrielli bonushenricus  
Sent: mandag 8. mars 2021 09:44
To: Stefan Blumentrath ; grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in 
GRASS 7.6

Hi Stefan
and thanks
Thanks to all and all developers! And here I have the answer directly from 
those who have developed R-Slope.Direction, no ??
Here's what happens:
> g.extension extension=r.slope.direction
> operation=add   
> Fetching  from GRASS GIS Addons repository (be 
> patient)...
> ERROR: Extension  not found

Il giorno lun, 08/03/2021 alle 08.38 +, Stefan Blumentrath ha
scritto:
> Hi Enrico,
> 
> GRASS 7.6 should not be a limiting factor. Did you try to install the 
> addon through g.extension?
> 
> g.extension extension=r.slope.direction operation=add
> 
> If not, please try. If you did but get an error message, please 
> provide the error message you got...
> 
> Cheers
> Stefan
> 
> 
> -Original Message-
> From: grass-user  On Behalf Of 
> Enrico Gabrielli bonushenricus
> Sent: søndag 7. mars 2021 23:59
> To: grass-ita...@listserv.unipr.it; grass-user@lists.osgeo.org
> Subject: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) 
> in GRASS 7.6
> 
> Hello everyone and everyone.
> I write maybe once every one or two years!
> I am a geographer and agricultural consultant.
> I am using GRASS to design in KeyLine (you can easily find news about 
> this ingenious technique, which is also the basis of permaculture, on 
> the internet).
> I found that in GRASS 7.8 there is a new add-on module called 
> r.slope.direction which would be very useful for keyline designs.
> Unfortunately I use Debian stable, and therefore GRASS 7.6.
> I have tried to use the r.slope.direction source script which I find 
> here
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2FOSGeo%2Fgrass-addons%2Ftree%2Fmaster%2Fgrass7%2Fraster%2Fr.sl
> ope.directiondata=04%7C01%7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7
> C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507898555085492%7CUnkno
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL
> CJXVCI6Mn0%3D%7C1000sdata=QpindTE6R0zQP6ArlP9rc2d3nFOYLMHhwtDniM8
> EksA%3Dreserved=0 but can't use it. If I install it following the 
> instructions I find here
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgras
> swiki.osgeo.org%2Fwiki%2FGRASS_and_Python%23Installationdata=04%7
> C01%7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3ab
> f02c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sd
> ata=1%2BzzVwsIW7mBcsBvuI%2Bvt2c7yULb%2B2oioSZCcAH1yUU%3Dreserved=
> 0 it gives me several errors. I created the directory in / usr / lib /
> grass76 / scripts /
> I can attach the result of the terminal.
> But if you think that it is simply not easy to install in GRASS 7.6 it 
> will mean that I will be looking forward to Debian 11 (I never install
> testing)
> --
> Perito agrario Enrico Gabrielli
> Tessera n. 633 Collegio Periti agrari prov. Di Modena Biblioteca
> agricoltura: 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> zotero.org%2Fgroups%2Faplomb%2Fdata=04%7C01%7C%7C6f03009d912c4bed
> 9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C63750789
> 8555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=kW8u9MG0ZAcaWy%2BWnII
> C%2F8KEZrchtuvGzZt0KegMGDg%3Dreserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fit.l
> inkedin.com%2Fpub%2Fenrico-gabrielli%2F9a%2F186%2F159data=04%7C01
> %7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02
> c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata
> =%2BudmXF9XutKPUBRmxCFM0J6Y1vUjy00sgNHxN4sea4Y%3Dreserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fenri
> cogabrielli76.wordpress.com%2Fdata=04%7C01%7C%7C6f03009d912c4bed9
> a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507898
> 555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=L

Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 7.6

2021-03-08 Thread Stefan Blumentrath
Hi Enrico,

GRASS 7.6 should not be a limiting factor. Did you try to install the addon 
through g.extension?

g.extension extension=r.slope.direction operation=add

If not, please try. If you did but get an error message, please provide the 
error message you got...

Cheers
Stefan


-Original Message-
From: grass-user  On Behalf Of Enrico 
Gabrielli bonushenricus
Sent: søndag 7. mars 2021 23:59
To: grass-ita...@listserv.unipr.it; grass-user@lists.osgeo.org
Subject: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 
7.6

Hello everyone and everyone.
I write maybe once every one or two years!
I am a geographer and agricultural consultant.
I am using GRASS to design in KeyLine (you can easily find news about this 
ingenious technique, which is also the basis of permaculture, on the internet).
I found that in GRASS 7.8 there is a new add-on module called r.slope.direction 
which would be very useful for keyline designs.
Unfortunately I use Debian stable, and therefore GRASS 7.6.
I have tried to use the r.slope.direction source script which I find here
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOSGeo%2Fgrass-addons%2Ftree%2Fmaster%2Fgrass7%2Fraster%2Fr.slope.directiondata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808270723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=%2B57KfELJq8o574mNFA5bXr%2BzFktjBCzyEVUJVrGMaJw%3Dreserved=0
but can't use it. If I install it following the instructions I find here 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrasswiki.osgeo.org%2Fwiki%2FGRASS_and_Python%23Installationdata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808270723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=mAiEmMf4GNB%2FBSjGuS4KOvzOAKnFbEK4iUdVZEZ%2FYUI%3Dreserved=0
 it gives me several errors. I created the directory in / usr / lib /
grass76 / scripts /
I can attach the result of the terminal.
But if you think that it is simply not easy to install in GRASS 7.6 it will 
mean that I will be looking forward to Debian 11 (I never install
testing)
--
Perito agrario Enrico Gabrielli
Tessera n. 633 Collegio Periti agrari prov. Di Modena Biblioteca agricoltura: 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.zotero.org%2Fgroups%2Faplomb%2Fdata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808270723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=WdQo31pdh44v1QXjsg7Psde34m3QPzlIUYCOAuH8lHE%3Dreserved=0
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fit.linkedin.com%2Fpub%2Fenrico-gabrielli%2F9a%2F186%2F159data=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808270723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=3Ouk5FFFNCyHfmPw%2BF1V7jWltSf1RlWp%2FDcCczVgzqI%3Dreserved=0
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fenricogabrielli76.wordpress.com%2Fdata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808270723%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=k2fBrPk1BqhAi50h5NeMQ%2FP2MCM2b3G3xkSYDZMaOjc%3Dreserved=0
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.inaturalist.org%2Fobservations%2Fbonushenricusdata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808280712%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=yBLov2z5rUOVuMG%2Fe%2FdlDOQ%2Fv6cqpKqUjoYv6f20BMM%3Dreserved=0
skype: enricogabrielli (enricogabrielli76.per...@gmail.com)

___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7Cc948a6d62a5d41a9266008d8e1bcaf3d%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507547808280712%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=f7vm7CcA1q0loF6aVHF8rkFaKpTQTJZj6R7Ab6n87%2Bo%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Library question

2021-02-27 Thread Stefan Blumentrath
Hi Rich,

I think you also need LAPACK (liblapack-dev, not sure how that package is named 
on slackware).

Cheers
Stefan


-Original Message-
From: grass-user  On Behalf Of Rich Shepard
Sent: lørdag 27. februar 2021 15:27
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Library question

I run grass-7.9.dev on Slackware-14.2 with OpenBLAS-0.3.12-x86_64-1_SBo 
installed. When I configure a new download from the git repo it does not find 
this library, but asks for BLAS:
checking whether to use BLAS... yes
checking for location of BLAS includes... 
checking for location of BLAS library... 
checking for cblas.h... yes
checking for dnrm2_ in -lblas... no
checking for dnrm2_ in -lblas... no
configure: error: *** Unable to locate BLAS library.

Can I change the request for BLAS to OpenBLAS?

TIA,

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-userdata=04%7C01%7C%7Cd53f0bb6a4d2444b072508d8db2d245e%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637500334228564091%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=RRFDqFvjpqo5RxLfOGGnqaQH1gbD9SdjPh7L%2FH8Vj3k%3Dreserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.rast.stats error: "Unable to seek"

2021-02-02 Thread Stefan Blumentrath
Hi again Luis,

The error comes from v.to.rast (which is used inside v.rast.stats).

From the error message (which suggests that the G_fseek() function gets an 
invalid argument), it occurs most likely here: 
https://github.com/OSGeo/grass/blob/master/lib/gis/seek.c 
However, the root cause may be at a different place...

Could you try:

a) if assigning more memory to v.to.rast has any effect
v.to.rast input=PSU output=test use=cat memory=1
b) if assigning category values to the raster causes problems
v.to.rast input=PSU output=test use=val value=1
in order to narrow down a bit?

Please also report v.info PSU -c (to see data types of the columns)...

Anyway, I guess here are people with C-knowledge required...

Cheers
Stefan

-Original Message-
From: Luís Moreira de Sousa  
Sent: tirsdag 2. februar 2021 15:56
To: Stefan Blumentrath 
Cc: Micha Silver ; GRASS user list 

Subject: RE: [GRASS-user] v.rast.stats error: "Unable to seek"

Thank you all for various replies. Some reactions:

1. The workstation has 32 GB of RAM and 12 CPU. What is the expected RAM 
requirements for v.rast.stats?

2. v.to.rast also fails, see below.

3. What would be the way to check the health of the vector? The table in 
Postgres at least is fully usable.



> v.to.rast input=PSU output=test use=cat
ERROR: Unable to seek: Invalid argument



--
Luís

‐‐‐ Original Message ‐‐‐
On Monday, February 1, 2021 11:56 PM, Stefan Blumentrath 
 wrote:

>
> So the vector contains about 20 million polygons, and the raster about 8 
> billion cells. (~=32GB ?)
>
> Does you computer have enough muscle for this?
>

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-02-01 Thread Stefan Blumentrath
Hei,

Maybe a two-step approach with t.rast.aggregate and t.rast.mapcalc could work?
In t.rast.aggregate you define the granularity as e.g. 48 days if you want to 
get a running median over three time steps of a 16 days time series.

If you want to do it in one go (which would be understandable for heavy time 
series), I assume t.rast.algebra is your best bet. Here is an example on how to 
add a new function: https://github.com/OSGeo/grass/pull/905/files to the module 
(which admittedly is quit complex) (the d-falg helps with testing under 
development).
You may have to invent a distinct pattern for aggregate functions from 
r.mapcalc…

Cheers
Stefan


From: grass-user  On Behalf Of Veronica 
Andreo
Sent: torsdag 28. januar 2021 16:43
To: Nikos Alexandris 
Cc: grass-user @lists.osgeo.org 
Subject: Re: [GRASS-user] Median filtering time series in time only



El jue, 28 ene 2021 a las 0:05, 
mailto:n...@nikosalexandris.net>> escribió:

On 2021-01-27 16:59, Veronica Andreo wrote:

Both r.series and t.rast.series will estimate the median per pixel in time 
(either for the whole series or the time period you want). Would it be possible 
then with so e sort of special for cycle?

Sorry, I didn't pay attention. Reading more carefully.
Indeed, r.series (t.rast.series) do the median. But they will just create a 
single pixel for each pixel time series.
Then, as you write, it would take to hack-around a way to iterate over a given 
time series at the desired (number of) intervals, then compile a new time 
series.

What is the 'e sort' part?
Did you mean to type 'with some sort of...'?
And what does the 'cycle' refer to?

Sorry Nikos! I was writing from my phone and it gets messy sometimes. The 
intended sentence was: "Would it be possible then with some sort of special 
`for loop`?"


Thanks, Nikos

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.rast.stats error: "Unable to seek"

2021-02-01 Thread Stefan Blumentrath
Hi Luis,

From the error message, it seems v.to.rast is failing, which may be due to a 
lack of resources - as Micha suggests.

Can you try
a) v.to.rast input=PSU output=test use=cat
if that does not work, we at least know it is not v.rast.stats and we might get 
a more specific error message... Not sure if the memory option in v.to.rast 
would have an effect here...

b) try to subdivide your data into chunks / tiles (polygons within tiles)?

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Micha Silver
Sent: mandag 1. februar 2021 21:32
To: Luí s Moreira de Sousa ; GRASS user list 

Subject: Re: [GRASS-user] v.rast.stats error: "Unable to seek"

Hi Luis:


On 2/1/21 5:30 PM, Luí s Moreira de Sousa wrote:
> Hi Micha, thank you for replying.
>
> I recreated the PSU layer in another mapset with the default SQLite 
> back-end, v.rast.stats fails with the exact same error. So this is not 
> related to the back-end.
>
> Below are the outputs you requested. Thank you.
>
> > v.info PSU
> ++
> | Name: PSU   |
> | Mapset: MAL   |
> | Location: S4AHomolosine 
> | |
> | Database: /home/duque004/Work/GRASSDATA 
> | |
> | Title: |
> | Map scale: 1:1   
> | | Name of creator:
> duque004  |
> | Organization: |
> | Source date: Fri Jan 29 08:13:08
> 2021  |
> | Timestamp (first layer): 
> none  |
> ||
> | Map format: native    
> | |
> ||
> |   Type of map: vector (level: 
> 2)   |
> | |
> |   Number of points:   0   Number of centroids:
> 19468516   |
> |   Number of lines:    0   Number of boundaries: 
> 38945853   |
> |   Number of areas:    19468516    Number of islands:
> 1  |
> | |
> |   Map is 3D: No   |
> |   Number of dblinks: 1    
> ||
> | |
> |   Projection: 
> unknown  |
> | |
> |   N:  4289569.27224353    S: 
> -4452930.72775647 |
> |   E:  6679312.25515029    W: 
> -2226387.74484971 |
> | |
> |   Digitization threshold: 
> 0    |
> | Comment: |
> | |
> ++
>
> > r.info MAL_Mode_5x5
> ++
> | Map:  MAL_Mode_5x5   Date: Thu Jan 28 09:08:14
> 2021    |
> | Mapset:   MAL    Login of Creator: 
> duque004    |
> | Location: S4AHomolosine |
> | DataBase: /home/duque004/Work/GRASSDATA |
> | Title:    5x5 neighborhood: mode of
> MAL_AFRICA |
> | Timestamp: none |
> ||
> | |
> |   Type of Map:  raster   Number of Categories: 
> 0   |
> |   Data Type: 
> CELL   |
> |   Rows: 87425  |
> |   Columns: 89057  
> ||
> |   Total Cells: 
> 7785808225 |
> |    Projection: 
> unknown |
> |    N: 4289569.27224353    S: -4452930.72775647 Res:
> 100    |
> |    E: 6679312.25515029    W: -2226387.74484971 Res:
> 100    |
> |   Range of data:    min = 0  max =
> 1   |
> | |
> |   Data Description: |
> |    generated by
> r.neighbors    |
> | |
> | Comments: |
> |    r.neighbors input="MAL_AFRICA" output="MAL_Mode_5x5" 
> method="mode" s\   |
> | ize=5 |
> | |
> ++
>

So the vector contains about 20 million polygons, and the raster about 8 
billion cells. (~=32GB ?)

Does you computer have enough muscle for this?



>
> --
> Luís
>
> Sent with ProtonMail 
> 

Re: [GRASS-user] Raster gaussian filter

2021-01-27 Thread Stefan Blumentrath
Hei Eric,

Try r.neighbors.

Cheers
Stefan

Get Outlook for Android


From: grass-user  on behalf of Eric Patton 
via grass-user 
Sent: Wednesday, January 27, 2021 3:59:15 PM
To: grass-user 
Subject: [GRASS-user] Raster gaussian filter

Hi all,

I was wondering if there was any tool in grass that does a Gaussian blur of a 
raster data set. I am trying to smooth out and blur survey-related artefacts in 
a swath multibeam dataset. I seem to remember in Grass 6.x there was r.gauss, 
but I don’t see it anymore in Grass 7.8.x.

Thanks,

~ Eric.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] [GRASS-dev] [GRASS GIS Elections 2020] Voting phase closed, presentation of results

2021-01-26 Thread Stefan Blumentrath
Dear all,

Yes, indeed. Many thanks to Hernán for organizing the election! It is by no a 
matter of course that you cleared space in your calendar to meet the schedule.

And congratulations to the GRASS GIS community to the excellent PSC elected. We 
got a diverse group of people, the best possible gender balance (given the 
candidates) and a fine balance of continuity and renewal. I have no doubt that 
all those thee aspects will further strengthen the project in the forthcoming 
period!

Cheers
Stefan

From: grass-dev  On Behalf Of Moritz Lennert
Sent: tirsdag 26. januar 2021 17:46
To: cro.gr...@osgeo.org; Chief Return Officer (CRO) - GRASS GIS election 2020 
; grass-user ; 
grass-...@lists.osgeo.org; GRASS-PSC ; 
grass-st...@lists.osgeo.org; grass-translati...@lists.osgeo.org; 
grass-...@lists.osgeo.org; grass-annou...@lists.osgeo.org
Subject: Re: [GRASS-dev] [GRASS GIS Elections 2020] Voting phase closed, 
presentation of results

Dear all !

Thank you very much for the honor of being part of the new PSC !

Looking forward to working with everyone, whether elected or not, on bringing 
this great project forward.

Special kudos to Hernán for the great job !

Moritz
Am 25. Januar 2021 12:30:46 GMT+00:00 schrieb "Chief Return Officer (CRO) - 
GRASS GIS election 2020" 
mailto:variablestarli...@gmail.com>>:
Dear members of the GRASS GIS community,

The voting phase of the GRASS GIS Election 2020 is now finished. Out of 245 
registered voters, 98 completed the survey. The results are shown below and are 
now available in the Trac Wiki.



Voting result (ranking, name, number of votes):

 1. Markus Neteler95

 2. Anna Petrášová88

 3. Helena Mitasova  86

 4. Martin Landa  83

 5. Verónica Andreo   76

 6. Moritz Lennert74

 7. Vaclav Petras 68

 8. Michael Barton58

 9. Huidae Cho56

10. Helmut Kudrnovsky 55

11. Peter Löwe52

12. Māris Nartišs     47

13. Stefan Blumentrath44







The new PSC is then composed of the following 9 members:

 1. Markus Neteler95

 2. Anna Petrášová88

 3. Helena Mitasova  86

 4. Martin Landa  83

 5. Verónica Andreo   76

 6. Moritz Lennert74

 7. Vaclav Petras 68

 8. Michael Barton58

 9. Huidae Cho56





Regards,

Hernán

Chief Return Officer (CRO)





___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] PSC Election: Statement Stefan Blumentrath

2021-01-16 Thread Stefan Blumentrath
Dear GRASS GIS Community,

I am honored to be nominated for the GRASS GIS PSC.

Some of you may have read my name asking or answering questions on the user and 
developer mailing list. Fewer of you may have met me, e.g. at Community sprints 
in Bonn or video calls.
For those of you who do not know me: I learned GRASS GIS during my studies at 
the University of Hanover around 2000 (with GRASS 5.4). Being an environmental 
planner by education, I consider myself mostly as a "power user" with some 
"learning-by-doing" skills in Python. My focus has been on using GRASS GIS in 
applied ecology and my first contributions to GRASS GIS have been in form of 
AddOns[1] (r.connectivity, r.maxent.lambdas, v.rast.bufferstats, 
v.strds.timestamp). In 2018 I became a member for the core development team. I 
mostly contribute[2] to the Python code base or by discussing aspects of the 
development on the mailing list, github, or (virtual) meetings.

I use GRASS mainly on Linux for a broad range of analysis relevant in 
environmental research and advocate actively for the use of Open Source 
technology in that domain. In my work GRASS is often used in combination with 
other OSGeo tools, like PostGIS, QGIS, GDAL. So, as a PCS member - if elected - 
I will focus on the interoperability of GRASS GIS.

That said, I benefited a lot from my interactions with the great GRASS GIS 
community, so frankly being elected or not will most likely not have a major 
effect on my participation in the project one way or another. However, I would 
view it as an opportunity to "give back" though, by getting involved in the 
more administrative aspects of the project.

Finally, I also like to add that I have been very happy with the current PSC, 
and want to thank them for their work. Looking at the list of nominations I can 
already say that I will be happy with the next PSC too, whoever of the nominees 
gets elected. I am looking forward to future collaboration with the community 
in whatever formal role.

Cheers,
Stefan

1: Commits * OSGeo/grass-addons 
(github.com)
2: Commits * OSGeo/grass 
(github.com)
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Can't use simple GRASS modules in python when not using ".py" in module call

2021-01-15 Thread Stefan Blumentrath
Dear Camille,

I don`t get that error in GRASS 7.8.3 with your example.

Can you post the exact command (if it was different from your example), and 
GRASS version as well as OS?
Addons need to be on your PATH / ADDON_PATH.

Cheers
Stefan


From: grass-user  On Behalf Of Cam Morlus
Sent: fredag 15. januar 2021 11:37
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Can't use simple GRASS modules in python when not using 
".py" in module call

Dear All,

I am using grass 7.8.4. I'm trying to run some simple commands using the Grass 
Python Scripting Library in Python. For modules for which the source code is 
written in C or any other language than Python, it works without problem but 
for the modules written in Python it does not. Here is an example of a simple 
command I tried to run:

import grass.script as gscript
gscript.run_command("v.db.dropcolumn", flags="help")

It raises the error:

grass.exceptions.CalledModuleError: Module run None v.db.dropcolumn --help 
ended with error.
Process ended with non-zero return code 9009

I already checked and I know that return code 9009 means it does not find the 
python script. I solved the error by just adding ".py" in the command:

gscript.run_command("v.db.dropcolumn.py",
 flags="help")

I would like the command to work without the ".py" because I'm writing a python 
script that makes use of some addons. For the addons to work in my python 
script I sometimes need to modify them because there are running commands like 
"v.db.dropcolumn" without the ".py", so I have to add it. But then, the addons 
do not work anymore when I use them directly in the grass GUI. I tried to use 
pygrass and it also raises an error if I'm using Module("v.db.dropcolumn") 
instead of 
Module("v.db.dropcolumn.py").

Does anybody know how to solve this?

Thank you in advance for the answer,

Best,

Camille Morlighem
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to create a GRASS addon that returns something when using read_command()

2021-01-14 Thread Stefan Blumentrath
Hi Camille,

Great resources to start with are:
wenzeslaus/python-grass-addon: How to write a Python GRASS GIS 7 addon 
(github.com)
and
wenzeslaus/r.example.plus: An example of a GRASS GIS module for processing 
rasters (github.com)

If you want your module to return not maps or tables but output on stdout (what 
read_command() captures), just use the print() function in python.

Hope that helps to get started!?

If there is a module that has a UI that could be a good template for what you 
want to do, you can use e.g. “r.info –script” to get a script template for the 
UI and general content.

Cheers
Stefan


From: grass-user  On Behalf Of Cam Morlus
Sent: torsdag 14. januar 2021 21:23
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] How to create a GRASS addon that returns something when 
using read_command()

Dear All,

I am using grass 7.8.4. I'm calling commands externally using the Grass Python 
Scripting Library in Python. I wanted to know when you create an addon in 
python how to end the addon script so that when you call that addon with 
read_command() it returns something. I would like to have something similar to 
what happens when calling read_command(g.gisenv) which returns the grass 
variables settings so that you can store them into a variable.

Thank you in advance for your answer.

Best,

Camille Morlighem
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] TPI (terrain position index) in GRASS GIS

2020-10-08 Thread Stefan Blumentrath
Hi Brenado,

TPI is rather simple and can be computed with r.neighbors + r.mapcalc:

r.neighbors -c input=dem output=dem_avg_9 size=9
r.mapcalc expression=”TPI_9=dem-dem_avg_9”
g.remove -f type=raster name=dem_avg_9

Cheers
Stefan

From: grass-user  On Behalf Of Bernardo 
Santos
Sent: torsdag 8. oktober 2020 12:35
To: GRASS User List 
Subject: [GRASS-user] TPI (terrain position index) in GRASS GIS

Hi everyone,

Do any of you know if we can calculate TPI (terrain position index) in GRASS 
GIS?
Or should we go for other tools such as SAGA GIS?

Best wishes,
Bernardo Niebuhr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Classify basins as "narrow"

2020-09-03 Thread Stefan Blumentrath
Hei Ken,

What about a combination of r.grow.distance and r.neighbors?

1) Extract boundaries from raster basins
r.neighbors input=basins output=basin_diversity method=diversity
r.reclass input=basin_diversity output=basin_boundary rc=-
"1 = NULL
2 thru 999 = 1" (if you need the boundaries later on the vector solution is 
probably more efficient)

2) compute distance from boundaries
r.grow.distance input=basin_boundary output=basin_boundary_distance

3) get the maximum distance from the boundaries
r.neighbors method=maximum size="twice what you would consider narrow"

Depends if it is computationally more efficient... If narrow still means "a 
lot" of pixels in width, then r.neighbors might be relatively slow. But you 
might increase resolution in that case.

In order to get the skeleton of the basin you could use r.neighbors as well:
r.neighbors input=basin_boundary_distance method=maximum 
output=basin_boundary_distance_max
r.mapcalc expression="skeletons=if(basin_boundary_distance < 
basin_boundary_distance_max, null(), 1)"
This should approximate the center lines...
Note that you could skip r.neighbors and use the neighborhood modifier in 
r.mapcalc...

Just some ideas for the width issue...

Cheers,
Stefan

-Original Message-
From: grass-user  On Behalf Of Ken Mankoff
Sent: onsdag 2. september 2020 20:03
To: GRASS user list 
Subject: Re: [GRASS-user] Classify basins as "narrow"

Hi List,

On 2020-09-02 at 04:27 -07, Ken Mankoff  wrote...
> I'd like to detect "narrow" features in GRASS. The attached screenshot 
> shows some basins (thick) and streams (thin) and some regions 
> (hatched). These regions are spurious because the basin is narrow 
> here. I'd like to estimate narrowness with an algorithm.
>
> I've looked into r.grow.distance r.distance and v.distance but haven't 
> been able to imagine a solution yet. Can anyone on this list suggest 
> something?

I've solved this, although it takes a lot of steps, and it only computes the 
width of the downstream region, not everywhere. The downstream/outflow region 
is what I'm interested in (but didn't specify this in my initial post) so this 
is OK with me. By this I mean that for a "Y" shaped catchment with three narrow 
regions and outflow at the bottom of the stem, the current algorithm will 
compute the width of one of the branches and the stem, but not the other branch.

I'm sharing this in case it helps someone else, or someone sees a way to do 
this more efficiently (perhaps all basins at once?). Here is the algorithm:

# elevation raster is input

# compute streams, outlets, and basins

r.stream.extract elevation=elevation threshold=11 memory=16384 direction=dir 
stream_raster=streams stream_vector=streams

r.mapcalc "outlets = if(dir < 0, 1, null())" # outlets

r.to.vect input=outlets output=outlets type=point

r.stream.basins -m direction=dir points=outlets basins=basins memory=16384 # 
basins

# compute distance from edge of each basin

r.to.vect -v input=basins output=basins type=area

v.to.lines input=basins output=bounds

v.to.rast -d input=bounds output=bounds use=val val=1

r.grow.distance input=bounds distance=edge_dist metric=euclidean

# Now the algorithm can only work on one basin at a time.
# Pick a basin with narrow outlet region manually, and mask to that basin.

basin_id=1174

r.mask raster=basins maskcats=${basin_id} --o

# Invert so center line is low, but make outlet lowest.
# Edge dist is 0 at edges, so this cost surface is a hole # Make the outlet the 
lowest point so it pours from there.
r.mapcalc "cost_surf = if(isnull(outlets), -edge_dist, -max(edge_dist)-100)"

# Route a stream down the center line

r.stream.extract elevation=cost_surf threshold=11 memory=16384 
direction=cost_dir stream_raster=cost_streams stream_vector=cost_streams

# Find the main stream (hack = 1)

r.stream.order -m stream_rast=cost_streams direction=cost_dir 
elevation=cost_surf hack=hack memory=16384

r.mapcalc "hack_1 = if(hack == 1, 1, null())"

# Grow center stream to edges

r.grow.distance -m input=hack_1 distance=center_dist

# DONE

Now the value of center_dist at the basin boundary is the distance to the 
center line, or 1/2 the width.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Clarifying use of postgres/postgis

2020-08-16 Thread Stefan Blumentrath
Hi Dheeraj,

GRASS uses a special topological vector format, that – as Micha pointed out – 
requires for most operations that data are stored in native GRASS format and 
not PostGIS.
However, for points for example external vector data (e.g. in PostGIS) can be 
used in GRASS in those modules directly that support topology level 1. Here one 
would use v.external to link PostGIS data to GRASS.

g.search.modules keyword=level1
gives you a list of those modules.

A typical use case for such a setup (vector in PostGIS, raster in GRASS) I am 
familiar with are GPS tracking data in PostGIS that are matched with GRASS GIS 
raster data…

If you use PostGIS as the database backend in GRASS (instead of default 
sqlite), then you would have almost the setup you are looking for, just that 
GRASS does not add geometry columns but stores the geometry in the GRASS DB 
(and attributes in PG).

Cheers
Stefan


From: grass-user  On Behalf Of Dheeraj Chand
Sent: søndag 16. august 2020 05:03
To: Micha Silver 
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Clarifying use of postgres/postgis

I think that maybe my request was unclear, sorry.

I am okay and comfortable with GRASS on how to use it, but not on the man pages 
about how to edit the source code to patch/change it.

What I was really hoping for was to avoid having two spatial databases, one 
PostGIS and one GRASS, with the idea that GRASS would store everything in 
PostGIS with perhaps its only specific column for its own geometries.

I guess not!




On Aug 15, 2020, at 9:10 AM, Micha Silver 
mailto:tsvi...@gmail.com>> wrote:


On 15/08/2020 16:22, Dheeraj Chand wrote:
‘’’

When importing a shapefile or other vector data, only the attrib tables get 
saved to some database: sqlite by default, or PostgrSQL if you have configured 
for that backend. But the geometry is still kept in the GRASS vector format.
‘’’


1. How would one configure that? Please assume that I am unfamiliar and 
uncomfortable with GRASS when explaining, but able to read Java and Python man 
pages with ease, also comfortable with PSQL and PostGIS.
In that case you might want to first go thru some tutorials on using GRASS. 
We're here to help if encounter anything that is unclear, or not working as you 
expected.
All GRASS commands can be called thru the GRASS-python bindings, so that might 
be easiest for you. But do go into the beginning tutorials first.
The GRASS module that sets the backend database connection is `db.connect`. 
Have a look at the man page:
https://grass.osgeo.org/grass78/manuals/db.connect.html
You would choose the driver parameter as "pg", then set the database and schema 
as required. This comes after running `db.login` one time to save your DB auth 
credentials.

2. Would we get all the speed benefits of PSQL, would it be used for 
computations whenever possible?
Not sure how to answer here. GRASS in general sends SQL commands back to the DB 
backend for any undates. If, for example, you had a point vector of cities, 
with two columns "population" and "number_hospitals" in the attribute table, 
and you wanted to calculate number of hospitals per 1000 people, then you would 
construct a regular SQL query that would be sent to the backend. So I guess 
that the speed would be determined by PostgreSQL.

3. Is there a way to easily move from GRASS and PSQL geometry and topology 
models when doing this?
Sorry to repeat again: GRASS maintains all geometry (and topology) within its 
own internal vector data structure. NO PostGIS involved here. But You could 
easily export GRASS vectors to a PostGIS database using the `v.out.postgis` 
module.
https://grass.osgeo.org/grass78/manuals/v.out.postgis.html

To pull a PostGIS vector table into GRASS would require either `v.in.ogr` or 
`v.import`


Sent from my iPhone


On Aug 15, 2020, at 7:50 AM, Rich Shepard 
 wrote:
On Sat, 15 Aug 2020, Micha Silver wrote:


But again, don't confuse - this is NOT PostGIS, and GRASS does not
need/use PostGIS for geometry. GRASS geometry is always independent of any
external geospatial format.

Micha,

Thanks for clarifying; I must have mis-understood what I read. I assumed the
geometry was kept by GRASS and didn't know why PostGIS was mentioned ... and
I don't recall just where I read all this.


It's the other way around: When you export GRASS map layers, you can, as
you know, choose to save out to several formats: shp, Geopackage (the
current default) or to PostGIS. PostGIS is the best choice when you need
multiuser access to the geospatial data. But you point out that you're the
only user, so why would you need the overhead of PostGIS?

Ah, so. I don't.


To repeat, you can set the default for saving attribute tables to
PostgreSQL, but do not try to save a GRASS layer to PostGIS in the same
database! That will definitely lead to trouble. If you want/need a PostGIS
instance for some reason independent of GRASS, then keep it totally
separated from GRASS. i.e. at 

[GRASS-user] r.regression.multi for logistic regression?

2020-07-24 Thread Stefan Blumentrath
Dear all,

Currently, I am trying to establish a statistical relationship between the 
occurrence of a land cover type and a set of local and global climate variables.

So far, I tried amongst others machine learning as well as bayesian and other 
modelling techniques. Unfortunately, those approaches proved so computationally 
demanding that I was only able to use a subset of my datapoints that does not 
really cover the variation.

In r.regression.multi I can use the entire map which is great. However, I am 
not sure if it is statistically sound to use r.regression.multi for logistic 
regression (0/1 data). Is the module appropriate for that purpose?

If not, could it be extended?

Cheers
Stefan




___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Stefan Blumentrath
Here is the documentation for the LIKE operator in SQLite:
https://www.sqlitetutorial.net/sqlite-like/

It should be possible to use it in a “searched case statement”:
https://www.sqlitetutorial.net/sqlite-case/

So the syntax would be:
db.execute sql="UPDATE myroads SET width=CASE WHEN TYPE LIKE 'M%' THEN 'Wide' 
WHEN TYPE LIKE 'Loc%' THEN 'Narrow' ELSE 'Unknown' END;"

Cheers
Stefan

From: grass-user  On Behalf Of Margherita 
Di Leo
Sent: onsdag 17. juni 2020 18:39
To: Micha Silver 
Cc: GRASS user list 
Subject: Re: [GRASS-user] Reclassify a vector adding a column

Dear Micha,

On Wed, Jun 17, 2020 at 4:05 PM Micha Silver 
mailto:tsvi...@gmail.com>> wrote:

On 17/06/2020 16:14, Margherita Di Leo wrote:
Ciao Stefan,

thank you, I tried and it didn't give me any error but didn't update the column 
either...






The sqlite CASE statement should be:

CASE  WHEN '' THEN '' WHEN '' THEN 
''END;



Here's an example that worked for me. I have a "myroads" vector with column 
'TYPE'



# Add new column for road width as text

v.db.addcolumn myroads column="width TEXT"

# Run update with CASE

db.execute sql="UPDATE myroads SET width=CASE TYPE WHEN 'Main' THEN 'Wide' WHEN 
'Local' THEN 'Narrow' ELSE 'Unknown' END;"



Best, Micha
This worked! Thank you so much! I have one last question. Does it also support 
an IS LIKE condition, and if yes, how can I express it?

Thanks!


--
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Stefan Blumentrath
Ciao Madi,

You could use db.execute and do something like:
db.execute sql="ALTER TABLE vectormap ADD COLUMN reclass_column TEXT;
UPDATE vectormap SET reclass_column = CASE
 WHEN old_column = ' old value 1' THEN ' new value 1'
 WHEN old_column = ' old value 2' THEN ' new value 2'
 WHEN old_column = ' old value 3' THEN ' new value 3'
 ELSE ' new value 4'
END; "

Maybe worth adding as an (validated) example to the manual of db.execute 
(https://grass.osgeo.org/grass78/manuals/db.execute.html)…

Cheers
Stefan

P.S.: I did not alidate the SQL syntax, but it should be roughly along those 
lines…

From: grass-user  On Behalf Of Margherita 
Di Leo
Sent: onsdag 17. juni 2020 10:35
To: GRASS user list 
Subject: [GRASS-user] Reclassify a vector adding a column

Hi,

I need to reclassify a vector in the following way: based on a column of type 
string I have to create a new column of type string based on certain rules that 
I give upon the first column, and I thought it would be really handy if I could 
do it like  CASE WHEN... THEN ...
I have tried to feed a similar rules file to v.reclass but this statement is 
not recognised. How can I translate it? Furthermore, I would like to be able to 
just add a reclass column rather than creating a new vector file, is that 
possible? How?

Thank you in advance

Kind regards,

--
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.what.rast - solved

2020-05-29 Thread Stefan Blumentrath
Hei Uwe,

It is unfortunately not obvious from the very beginning, but actually one of 
the nice features of GRASS GIS.

No need to "clip" any data. You can easily operate on any subset of your data 
and all data will be cleanly aligned even if the extent of on layer changes

Once you are used to it you will enjoy it.

Cheers
Stefan

From: grass-user  On Behalf Of Uwe Fischer
Sent: fredag 29. mai 2020 08:42
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] v.what.rast - solved

Hello list,

thanks to Micha Silver and Helmut Kudrnovsky, the problem ist solved. I did not 
set g.region prior to using v.what.rast. Seems to be a typical 
non-Grass-Professional mistake. Now it works fine.

But to be honest, I do not really understand what it is good for. When the 
raster image and the points to be updated share the same Grass location and 
CRS, why do I have to set a region in addition?

Best regards and thanks again, Uwe

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] East/West Horizons Giving Negative Numbers

2020-05-27 Thread Stefan Blumentrath
Hi Ashley,

The possibility to return negative horizon values was introduced here:
https://github.com/OSGeo/grass/commit/688d5885557f22c7ea6618dcac3ddfbfc764731a#diff-5ce8290f429502e23efaf9ebdc18bd2b

The output with the d-flag is azimuth degree (-90 – 90, where 0 is parallel 
with the focal cell).
So, from my understanding, negative values indicate horizon height below the 
cell it is computed from.

Maybe the manual could be a bit more specific here…?

Cheers
Stefan

From: grass-user  On Behalf Of Ashley Cale
Sent: tirsdag 26. mai 2020 21:16
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] East/West Horizons Giving Negative Numbers

  Hello Everyone!

Can help me figure out what's wrong with my east and west horizon calculations?

I am trying to compute my east and west horizon angle from my DEM using the 
command r.horizon. My output raster contains negative numbers and it's my 
understanding that the range of output values should be between 0 and 360. I 
used -d to make sure that my output is in degrees rather than radians.

Can anyone help me solve this problem? Or point me in the right direction?

Thank you for the help!
Ashley

Here is the r.info output from my generated east horizon raster.
 ||
 |  |
 |  Type of Map: rasterNumber of Categories: 0|
 |  Data Type:  FCELL   |
 |  Data Units:  degrees   Vertical datum: (none)|
 |  Rows: 7532|
 |  Columns:   5860|
 |  Total Cells: 44137520  |
 |Projection: UTM (zone 10)  |
 |  N: 4543151.24515692  S: 4317194.98362237  Res: 29.99950366  |
 |  E: 759846.34683197  W: 584057.70444841  Res: 29.99806184   |
 |  Range of data:  min = -90 max = 78.47394   |
 |  |
 |  Data Description:|
 |  generated by r.horizon |
 |  |
 |  Comments:|
 |  r.horizon -d elevation="dem30m@PERMANENT" direction=0 start=0.0 end=\  |
 |  360.0 output="east" distance=1.0 file="-"|
 |  |
 |  Horizon view from azimuth angle 0.00 degrees CCW from East   |
 |  |
 ++

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Geomorphic index for valley, using "height of the valley / width of the top of the valley"

2020-04-11 Thread Stefan Blumentrath
Hi Valter,

please have a look at:
https://grass.osgeo.org/grass78/manuals/addons/r.stream.distance.html
r.stream.distance - GRASS GIS 
manual
NAME r.stream.distance - Calculates distance to and elevation above streams and 
outlet. The module can work in stream mode where target are streams and outlets 
mode where targets are outlets. KEYWORDS raster, hydrology, stream network, 
watercourse distance SYNOPSIS
grass.osgeo.org

However, it is an addon. So it is - unfortunately - not necessarily straight 
forward to integrate it into your workflows (I understood you use GRASS from 
QGIS). At least in the processing framework you would need a workaround.

Hope that helps a bit never the less.

Cheers
Stefan

Fra: grass-user  på vegne av Valter Albino 

Sendt: lørdag 11. april 2020 23:18
Til: grass-user 
Emne: [GRASS-user] Geomorphic index for valley, using "height of the valley / 
width of the top of the valley"

Hi all
I would like to calculate a geomorphic index for valley, using the following 
equation: height of the valley / width of the top of the valley - the higher 
the index values, the greater the notch (carve in the landscape) in the valley.
I found that SAGA gives the "Vertical distance to the channel network".
Does GRASS have a function to calculate each ot the two input?
Thanks in advance

Cumprimentos,
Valter Albino - Geógrafo Físico, M.Sc.
Modelação H / Riscos ambientais / OT
www.valteralbino.wixsite.com/hydrodynamics
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Install package for add-on in /usr/bin/python3

2020-04-08 Thread Stefan Blumentrath
Hi Robin,

After installing from python-fmask source as described I got the same error 
message as you did on:

from fmask import fmask

(just importing fmask worked also before).

The problem seems to be that fmask (including it`s C components) gets installed 
in /usr/local/. See:
https://github.com/ubarsc/python-fmask/issues/19

You can fix that by specifying /usr as a prefix during install:
sudo python3 setup.py install --prefix=/usr

(note that I also had to specifically call setup.py with python3 which was an 
error in my initial installation script.)

When python-fmask gets available on PyPi, I guess this will be taken care of…

If you set the PYTHONPATH environment variable before starting GRASS GIS, GRASS 
should temporarily add the path to the GRASS python libs (but nothing more). If 
you use a prepackaged GRASS installation, it is compiled against a specific 
Python version (usually system Python). You can see which Python installation 
GRASS is using by typing:

echo $GRASS_PYTHON

So, if you want to use your conda Python in GRASS (despite possible issues 
other places), my understanding is that you would need to point GRASS_PYTHON 
variable to conda python. However, with the installation described above, GRASS 
should find fmask and _fillminima from fmask… In the long run, this will be the 
most convenient solution for an addon. For the time being, the installation 
procedure could be added to the manual as a note (and probably as an error 
message if import fails), until it becomes available on PyPi.

Hope that helps.

Cheers
Stefan

From: robin 
Sent: søndag 5. april 2020 19:13
To: Stefan Blumentrath 
Subject: Re: [GRASS-user] Install package for add-on in /usr/bin/python3


Hi Stefan,

thank you very much!! Why does my PYTHONPATH needs to point to the 
system-python? So the issue is, that I would like to have a script that I can 
run from within GRASS with launch user-defined script. I created a conda 
environment (“spatial”) and installed python-fmask with:

conda install -c conda-forge python-fmask

This automativally installes python3.8.2, fmask and rios in:

home/robin/miniconda3/envs/spatial/lib/python3.8/site-packages/

I then added this path in my .bashrc (I thought I needed to put it in the 
.profile, but this didn’t work for some reason) my PYTHONPATH with:

export 
PYTHONPATH=/home/robin/miniconda3/envs/spatial/lib/python3.8/site-packages

I then did a source .bashrc and when printing the PYTHONPATH with

echo $PYTHONPATH it prints

/home/robin/miniconda3/envs/spatial/lib/python3.8/site-packages

I then made a little test script where I wanted to test if the fmask-import and 
rios-import works
from within GRASS

#



  1 #! /usr/bin/env python3

  2

  3 import sys

  4 import os

  5

  6 for i in sys.path:

  7 print(i)

  8

  9 print("PYTHONPATH")

 10 print(os.environ["PYTHONPATH"])

 11

 12 import fmask

 13 import rios

 13 import rios

#

When importing this script in GRASS with the “launch user-defined 
script”-option, the output is:

/home/robin/Desktop

/usr/lib/grass78/etc/python

/usr/lib/python36.zip

/usr/lib/python3.6

/usr/lib/python3.6/lib-dynload

/home/robin/.local/lib/python3.6/site-packages

/usr/local/lib/python3.6/dist-packages

/usr/lib/python3/dist-packages

PYTHONPATH

/usr/lib/grass78/etc/python

Traceback (most recent call last):

  File "/home/robin/Desktop/test.py", line 12, in 

import fmask

ModuleNotFoundError: No module named 'fmask'

I don’t know why the PYTHONPATH is different when run from GRASS. Probably I’m 
just not understanding something really basic. If so I’m really sorry. It’s 
just a little frustrating to spend so much time in something so basic.

Anyways: Thanks so much for the help!
Cheers,
Robin

On 05.04.2020 14:35, Stefan Blumentrath wrote:
Did you check that your pythonpath again points to system python. And can you 
share your code, esp. the imports. That would simplify testing...
Sent from Outlook Mobile<https://aka.ms/blhgte>


From: robin kohrs <mailto:robin.ko...@uni-jena.de>
Sent: Sunday, April 5, 2020 11:04:02 AM
To: Stefan Blumentrath 
<mailto:stefan.blumentr...@nina.no>
Subject: Re: [GRASS-user] Install package for add-on in /usr/bin/python3

Hi Stefan,

thank you very much for the answer! That would be great if it'd become a
standard python package!
I managed to install everything as you explained it. But when I run:

In [1]: from fmask import fmask

I still get

ModuleNotFoundError: No module named 'rios'

I guess this is, because they are still in seperate folders right?
When I copy everything from the installed rios into fmask (I know this
seems really wrong...) and then do :

In [2]: from fmask import fmask

ImportError: cannot import name '_fillminima'

I'm sorry for these basic questions, but I just can't find a solution:/

cheers and thanks a lot!!
Robin

On 04.04.20 20:56, Stefan Blumentrath wrote:
> Hi Robin,
>
>

Re: [GRASS-user] Install package for add-on in /usr/bin/python3

2020-04-04 Thread Stefan Blumentrath
Hi Robin,

The errors you encountered after setting the python path, occurred because 
fmask depends on another, non-standard Python package, namely rios (that would 
have to be added to the PYTHONPATH as well).

Yet, it seems there is some more interest in getting python-fmask (and thus 
also RIOS) available as a standard python package. See: 
https://github.com/ubarsc/python-fmask/issues/30
So, your problem might get solved "upstreams".

Meanwhile you could install both packages manually into your standard Python 
installation as follows:

wget 
https://github.com/ubarsc/rios/releases/download/rios-1.4.10/rios-1.4.10.zip
unzip rios-1.4.10.zip
cd rios-1.4.10/
sudo python setup.py install
cd ..

wget 
https://github.com/ubarsc/python-fmask/releases/download/pythonfmask-0.5.4/python-fmask-0.5.4.zip
unzip -q python-fmask-0.5.4.zip  
cd python-fmask-0.5.4/
python setup.py build
sudo python setup.py install

For me (on Ubuntu 18.04) this gives:

$ ipython
Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import fmask

In [2]: fmask.__version__   
Out[2]: '0.5.4'

In [3]: import rios 

In [4]: rios.__version__
Out[4]: '1.4.10'

Cheers
Stefan


-Original Message-
From: Robin Kohrs  
Sent: tirsdag 31. mars 2020 15:42
To: Stefan Blumentrath 
Cc: Markus Neteler ; GRASS user list 

Subject: Re: [GRASS-user] Install package for add-on in /usr/bin/python3

Hi Stefan,

thank you very much for the effort and the patience in answering!
I'll definitely give this a try. I already have so many issues on my computer, 
one more doesn't matter;)

thanks again and best regards,
Robin

Citando Stefan Blumentrath :

> Hi Robin,
>
> You could try setting the GRASS_PYTHON environment variable to your 
> Python installation with fmask.
>
> import os
> os.environ['GRASS_PYTHON'] = '/YOUR/PYTHON/PATH'
>
> As Markus indicates that can cause other issues.
>
> You may also have a look at https://github.com/zarch/grass-session
> for inspiration.
>
> Hope that gives you at least a lead...
>
> Cheers
> Stefan
>
>
> -Original Message-
> From: grass-user  On Behalf Of 
> Robin Kohrs
> Sent: tirsdag 31. mars 2020 09:25
> To: Markus Neteler 
> Cc: GRASS user list 
> Subject: Re: [GRASS-user] Install package for add-on in 
> /usr/bin/python3
>
> Hi Markus,
>
> thank you very much for your answer and the help!
> Do you have any idea what I could do to make the fmask-package 
> "locatable" for the python-interpreter that grass is using?
>
> I tried the following options, but I guess I just don't know 
> sufficiently about how python and grass really work together:
>
> My python-script looks more or less like this:
> ---
> #!/usr/bin/env python3
>
> import sys
>
> print("SYS PATH")
> print(sys.path)
> print("")
> print("SYS EXECUTABLE")
> print(sys.executable)
>
> import grass.script as grass
> from rios import fileinfo # that's where it fails from fmask import 
> fmask
>
> ---
>
> That's why I tried until now:
>
> - I created an environment with conda and installed python-fmask via 
> "conda install -c conda-forge python-fmask". The function 
> "fmask_sentinel2Stacked.py" lies in 
> "/home/robin/miniconda3/bin/fmask_sentinel2Stacked.py".
>
> - When I open an interactive python-shell and import fmask and rios 
> and the type: "fmask.__file__" it gives me 
> "/home/robin/miniconda3/envs/fmask/lib/python3.7/site-packages/fmask/__init__.py"
>
> - I then added
> "/home/robin/miniconda3/envs/fmask/lib/python3.7/site-packages/" to 
> the variable PYTHONPATH in my .bashrc
>
> - When I now start the interpreter that grass uses from the command 
> line by typing "/usr/bin/pyton3" I can import fmask and rios
>
> - However when I run the script with grass it always says that there 
> is no package names rios. Moreover the path I added to PYTHONPATH is 
> not printed when it executes "sys.path" in my grass script
>
>
> I'm sorry for this little confusing question. But in case someone  
> has any idea how I could make grass find fmask, would be super highly
> appreciated:)
>
> thanks a lot in advance! Cheers
> Robin
>
> Citando Markus Neteler :
>
>> Hi Robin,
>>
>> On Sat, Mar 21, 2020 at 6:15 PM Robin Ko

Re: [GRASS-user] GRASS "shell" plugin + GRASS "Add-ons" in QGIS

2020-03-31 Thread Stefan Blumentrath
Yes, I think so.
The shell should give you your OS native GRASS command line.
Could you try out and report back?

From: grass-user  On Behalf Of Valter Albino
Sent: tirsdag 31. mars 2020 12:43
To: grass-user 
Subject: [GRASS-user] GRASS "shell" plugin + GRASS "Add-ons" in QGIS

Good Morning

Sorry for the naivety, but I appreciate any good answers:
- is "GRASS SHELL" in the plugin, in QGIS, usable with double click? Is he 
supposed to let you write right?
[imagem.png]
- is it possible to use the GRASS "Add-ons" previously installed by "GRASS GIS" 
through the QGIS plugin?

Thanks
Cumprimentos,
Valter Albino - Geógrafo Físico, M.Sc.
Modelação H / Riscos ambientais / OT
www.valteralbino.wixsite.com/hydrodynamics
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Install package for add-on in /usr/bin/python3

2020-03-31 Thread Stefan Blumentrath
Hi Robin,

You could try setting the GRASS_PYTHON environment variable to your Python 
installation with fmask.

import os
os.environ['GRASS_PYTHON'] = '/YOUR/PYTHON/PATH'

As Markus indicates that can cause other issues.

You may also have a look at https://github.com/zarch/grass-session for 
inspiration.

Hope that gives you at least a lead...

Cheers
Stefan


-Original Message-
From: grass-user  On Behalf Of Robin Kohrs
Sent: tirsdag 31. mars 2020 09:25
To: Markus Neteler 
Cc: GRASS user list 
Subject: Re: [GRASS-user] Install package for add-on in /usr/bin/python3

Hi Markus,

thank you very much for your answer and the help!
Do you have any idea what I could do to make the fmask-package "locatable" for 
the python-interpreter that grass is using?

I tried the following options, but I guess I just don't know sufficiently about 
how python and grass really work together:

My python-script looks more or less like this:
---
#!/usr/bin/env python3

import sys

print("SYS PATH")
print(sys.path)
print("")
print("SYS EXECUTABLE")
print(sys.executable)

import grass.script as grass
from rios import fileinfo # that's where it fails from fmask import fmask

---

That's why I tried until now:

- I created an environment with conda and installed python-fmask via "conda 
install -c conda-forge python-fmask". The function "fmask_sentinel2Stacked.py" 
lies in "/home/robin/miniconda3/bin/fmask_sentinel2Stacked.py".

- When I open an interactive python-shell and import fmask and rios and the 
type: "fmask.__file__" it gives me 
"/home/robin/miniconda3/envs/fmask/lib/python3.7/site-packages/fmask/__init__.py"

- I then added
"/home/robin/miniconda3/envs/fmask/lib/python3.7/site-packages/" to the 
variable PYTHONPATH in my .bashrc

- When I now start the interpreter that grass uses from the command line by 
typing "/usr/bin/pyton3" I can import fmask and rios

- However when I run the script with grass it always says that there is no 
package names rios. Moreover the path I added to PYTHONPATH is not printed when 
it executes "sys.path" in my grass script


I'm sorry for this little confusing question. But in case someone has any idea 
how I could make grass find fmask, would be super highly
appreciated:)

thanks a lot in advance! Cheers
Robin

Citando Markus Neteler :

> Hi Robin,
>
> On Sat, Mar 21, 2020 at 6:15 PM Robin Kohrs  wrote:
>>
>>
>> Hi everyone:)
>> I'm really sorry for this naive question. I'm kind of starting with 
>> GRASS and I just can't find a solution...
>> The issue is, that I would like to try to write a little GRASS Add-on 
>> and use the python-fmask package. While this package is only 
>> downloadable via conda it always installs into 
>> `/home/user/miniconda3/bin/python3`. Even when I did `conda 
>> deactivate` prior to this.
>
> I guess that mixing conda packages and "regular" ones is causing troubles.
>
>> When I then have the import statement `import fask` in the 
>> grass-script it always throws an error, saying that fmask is not 
>> installed. When I print the `sys.executable` in the grass-script it 
>> tells me that the interpreter is in `usr/bin/python3`. So I thought 
>> that I'd install the fmask-package in a way that this interpreter can 
>> find it while executing the script. But I just don't know how. I can 
>> add the fmask-path to sys.path, but I don't think this is the 
>> solution. Maybe someone has a pointer what I'm not getting.
>
> There is also the environment variable PYTHONPATH which could be set 
> in the session.
> But again, mixing might cause problems.
>
> Now I wanted to check
> http://pythonfmask.org/en/latest/#downloads
> but the server is down...
>
>> Hope everyone is good these days:)!
>
> Good luck everyone,
>
> Markus



___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] garray.read() returns 0-filled array

2020-03-17 Thread Stefan Blumentrath
Hi Ken,

Thanks for volunteering to test.

This is how you can install grass-session from (my) git branch: 
pip3 install git+https://github.com/ninsbl/grass-session.git@grass_versions

If you are allowed to add a PPA to your system you could get GRASS 7.8 from 
UbuntuGIS PPA (even in the stable one):
https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa

Hilsen,
Stefan

-Original Message-
From: Ken Mankoff  
Sent: tirsdag 17. mars 2020 02:02
To: Stefan Blumentrath 
Cc: GRASS user list 
Subject: Re: [GRASS-user] garray.read() returns 0-filled array

Hi Stefan,

On 2020-03-16 at 07:01 -07, Stefan Blumentrath  
wrote...
> Hei Ken,
>
> With this PR:
> https://github.com/zarch/grass-session/pull/14
> applied, also pygrass modules should work as usual with grass-session.

Thank you for submitting that. It'll take me a while to get up and running with 
the git version as opposed to the pip version, but I will test it.

> GRASS GIS 7.8 should use Python 3, so I am surprised to see that your 
> $GRASS_PYTHON version is /usr/bin/python2.7 ... That is possibly also 
> a source for your trouble with garray...

I'm on an LTS OS - Ubuntu 18.04 and the default GRASS that comes with that: 
7.4. I'm looking forward to 7.8 but haven't upgraded yet.

  -k.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] garray.read() returns 0-filled array

2020-03-16 Thread Stefan Blumentrath
Hei Ken,

With this PR:
https://github.com/zarch/grass-session/pull/14
applied, also pygrass modules should work as usual with grass-session.

I just updated it, so it needs testing...

If you define the GRASS_PYTHON environment variable, it should be possible to 
use any Python installation. If these are compatible is a different question...

GRASS GIS 7.8 should use Python 3, so I am surprised to see that your 
$GRASS_PYTHON version is /usr/bin/python2.7 ... That is possibly also a source 
for your trouble with garray...

Cheers
Stefan

-Original Message-
From: Ken Mankoff  
Sent: mandag 16. mars 2020 01:14
To: Stefan Blumentrath 
Cc: GRASS user list 
Subject: Re: [GRASS-user] garray.read() returns 0-filled array


On 2020-03-15 at 15:11 -07, Stefan Blumentrath  
wrote...
> I have no experience with garray, but raster2numpy function in pygrass 
> worked quite well for me:
> https://grass.osgeo.org/grass78/manuals/libpython/pygrass.raster.html#
> pygrass.raster.raster2numpy

Thank you for this suggestion. This works but raises new issues.

1) Fully external-to-GRASS interactions works better for me. This solution 
requires running Python from within GRASS, which adds an extra layer, which 
makes it harder to get to the same place interactively in Python and debug.

2) Worse, it seems I need to run the $GRASS_PYTHON version which is 
/usr/bin/python2.7, so I no longer have access to my scientific Python stack.

The 1st issue can be worked around. The 2nd not so much. I hope I'm mis-using 
the library and can do this from within my Anaconda Python.

  -k.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] garray.read() returns 0-filled array

2020-03-15 Thread Stefan Blumentrath
Hi Ken,

I have no experience with garray, but raster2numpy function in pygrass worked 
quite well for me:
https://grass.osgeo.org/grass78/manuals/libpython/pygrass.raster.html#pygrass.raster.raster2numpy

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Ken Mankoff
Sent: søndag 15. mars 2020 16:36
To: GRASS user list 
Subject: [GRASS-user] garray.read() returns 0-filled array

Hello,

I'm trying to use GRASS via Python and import some rasters into numpy. I'm 
using garray.read(raster) and the result is always 0. When I inspect the raster 
in GRASS (via bash) it is not zero. I can re-create this with the following 
MWE. Can someone suggest what I might be doing wrong or if this is a bug?

Thank you,

  -k.



import numpy as np
import shutil
import os

from grass_session import Session
from grass.pygrass.modules.shortcuts import general as g from 
grass.pygrass.modules.shortcuts import raster as r import grass.script.array as 
garray

if os.path.exists("G_test"): # reset everything
shutil.rmtree("G_test", ignore_errors=False, onerror=None)

W = Session()
W.open(gisdb='.', location='G_test', create_opts="EPSG:3413") g.region(w=0, 
s=0, n=100, e=100) r.mapcalc("foo = 42.24") foo = garray.array().read("foo", 
null=np.nan)
W.close()

print(np.max(foo))
# 0.0 is
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Univariate statistics with a moving temporal window over a STRDS

2020-02-25 Thread Stefan Blumentrath
Dear all,

I would like to calculate a running univariate statistics over a Space Time 
Raster Dataset: e.g. for each day the maximum temperature looking up to three 
days back.
In t.rast.algebra, I can use temporal buffering (buff_t() function) or temporal 
offset for that purpose, but functions like min(), max(), median(), are not 
supported.
t.rast.aggregate is not suitable because it does not allow for overlapping 
aggregation...

Any idea how to achieve that? Did I overlook a relevant module?

Cheers,
Stefan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Example project for a GRASS GIS module on GitHub

2020-02-04 Thread Stefan Blumentrath
Hi,

In this context we should probably also keep JOSS in mind and probably make 
devs aware of that possibility, including linking a JOSS paper to the repo. See 
presentation from FOSSDEM [1] for more background.

Question is, if it is possible to have the link on a module basis in 
grass-addons. Cause, I also think that getting stuff into grass-addons is 
important for the reasons Vaclav lists in the repo.

Cheers
Stefan

1: https://video.fosdem.org/2020/AW1.126/open_research_joss.webm

-Original Message-
From: "Peter Löwe"  
Sent: tirsdag 4. februar 2020 11:24
To: grass-user@lists.osgeo.org
Cc: Stefan Blumentrath ; wenzesl...@gmail.com
Subject: [GRASS-user] Example project for a GRASS GIS module on GitHub

Hi Vasek,

thanks for setting up the demo module on GitHub!

To demonstrate how module authors can get credit by scientific citation, some 
kind of reference/howto describing how the integration of the GitHub project 
and the Zenodo data repositiory (https://www.zenodo.org/) can be achieved, as 
explained here: 
https://www.zenodo.org/login/?next=%2Faccount%2Fsettings%2Fgithub%2F  
https://guides.github.com/activities/citable-code/
By doing so, a persistent identifier (DOI) is assigned to the GRASS module 
codebase. Zenodo also offers a handy tool to provide citation strings for the 
modulde code in hundreds of citation styles.

Best regards,
Peter



> From: grass-user  On Behalf Of Vaclav 
> Petras
> Sent: torsdag 30. januar 2020 02:31
> To: grass-...@lists.osgeo.org; GRASS user list 
> Subject: [GRASS-user] Example project for a GRASS GIS module on GitHub
>
> Dear users and contributors,
>
> I've created an example project (repository) on GitHub. It is a GRASS GIS 
> module written in Python which simply adds two raster maps together. It uses 
> GitHub Actions to build the module and publish its documentation as a website 
> (using GitHub Pages).
>
> https://github.com/wenzeslaus/r.example.plus
>
> This is based on my earlier work on an example project on GitLab [1] and 
> includes several improvements and changes:
>
> * There is a test suite included with couple of test functions.
> * It uses Black for code formatting (assuming author runs it manually).
> * Repository is marked as a template (see the big "Use this template" button).
> * GitHub Actions are used for:
>   * compiling the module and running tests,
>   * checking code quality with Flake8 and Pylint, and
>   * checking code style with Black.
> * GitHub Actions are now used for publishing documentation (done by GitLab CI 
> before).
> * Option names now follow GRASS GIS standards more.
> * More documentation in the code and on how to use the code.
> * Badges are now in the README file (GitLab had those as project properties).
>
> Otherwise, I hope the project should describe itself and if something is 
> missing or is not documented enough, please open an issue or a pull request.
>
> Best,
> Vaclav
>
> PS: We can discuss on grass-dev if this should go under some organization and 
> how to improve the "what's next" part [2].
>
> [1] https://lists.osgeo.org/pipermail/grass-dev/2018-November/090438.html
> [2] https://github.com/wenzeslaus/r.example.plus#what-is-next

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Example project for a GRASS GIS module on GitHub

2020-01-30 Thread Stefan Blumentrath
Hi,

Great work, Vasek!

I found the gitlab version already very useful and I can just recommend it for 
any addon-dev to use as a starting point!
Esp. for beginners and autodidacts like me it is very valuable to see 
everything (and esp. the manual) checked, so a working version can be finally 
submitted to grass-addons.

In other words, r.example.plus is a perfect sandbox!

Cheers
Stefan



From: grass-user  On Behalf Of Vaclav Petras
Sent: torsdag 30. januar 2020 02:31
To: grass-...@lists.osgeo.org; GRASS user list 
Subject: [GRASS-user] Example project for a GRASS GIS module on GitHub

Dear users and contributors,

I've created an example project (repository) on GitHub. It is a GRASS GIS 
module written in Python which simply adds two raster maps together. It uses 
GitHub Actions to build the module and publish its documentation as a website 
(using GitHub Pages).

https://github.com/wenzeslaus/r.example.plus

This is based on my earlier work on an example project on GitLab [1] and 
includes several improvements and changes:

* There is a test suite included with couple of test functions.
* It uses Black for code formatting (assuming author runs it manually).
* Repository is marked as a template (see the big "Use this template" button).
* GitHub Actions are used for:
  * compiling the module and running tests,
  * checking code quality with Flake8 and Pylint, and
  * checking code style with Black.
* GitHub Actions are now used for publishing documentation (done by GitLab CI 
before).
* Option names now follow GRASS GIS standards more.
* More documentation in the code and on how to use the code.
* Badges are now in the README file (GitLab had those as project properties).

Otherwise, I hope the project should describe itself and if something is 
missing or is not documented enough, please open an issue or a pull request.

Best,
Vaclav

PS: We can discuss on grass-dev if this should go under some organization and 
how to improve the "what's next" part [2].

[1] https://lists.osgeo.org/pipermail/grass-dev/2018-November/090438.html
[2] https://github.com/wenzeslaus/r.example.plus#what-is-next

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.in.lidar / v.in.lidar missing in Ubnutu 18.04 package

2020-01-14 Thread Stefan Blumentrath
Good point. Yes, indeed it is built without liblas support (see: 
https://launchpadlibrarian.net/455539996/buildlog_ubuntu-bionic-amd64.grass_7.8.2-1~bionic1_BUILDING.txt.gz
 and search for dh_auto_configure).
Will open a ticket...

-Original Message-
From: Markus Neteler  
Sent: mandag 13. januar 2020 15:57
To: Stefan Blumentrath 
Cc: grass-user grass-user 
Subject: Re: [GRASS-user] r.in.lidar / v.in.lidar missing in Ubnutu 18.04 
package

Hi Stefan,

On Mon, Jan 13, 2020 at 1:28 PM Stefan Blumentrath  
wrote:
>
> Hi Markus,
>
> And thanks for your reply.
>
> On the one box I also have self-compiled GRASS GIS 7.9. And for that 
> r.in.lidar works fine.
> I also added more liblas related packages. But that did not help with GRASS 
> 7.8.2...

Do you mean a self-compiled GRASS 7.8.2? Or the Ubuntu package?

> So I am not sure if this is a packaging issue with liblas. If liblas works 
> for self-compiled GRASS 7.9, shouldn`t it work with 7.8.2 as well.
>
> In order to double check, I downloaded the grass-core package manually, and 
> it does not seem to contain r.in.lidar (at least I could not find it)...
>
> Thus, I guess it is an issue with the grass-core package, no?

... of Ubuntu, right?
You may want to compare the build scripts used there, perhaps in one liblas is 
simply not enabled.

Best
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.in.lidar / v.in.lidar missing in Ubnutu 18.04 package

2020-01-13 Thread Stefan Blumentrath
Hi Markus,

And thanks for your reply.

On the one box I also have self-compiled GRASS GIS 7.9. And for that r.in.lidar 
works fine.
I also added more liblas related packages. But that did not help with GRASS 
7.8.2...
So I am not sure if this is a packaging issue with liblas. If liblas works for 
self-compiled GRASS 7.9, shouldn`t it work with 7.8.2 as well.

In order to double check, I downloaded the grass-core package manually, and it 
does not seem to contain r.in.lidar (at least I could not find it)...

Thus, I guess it is an issue with the grass-core package, no?

Cheers
Stefan




-Original Message-
From: Markus Neteler  
Sent: fredag 10. januar 2020 21:16
To: Stefan Blumentrath 
Cc: grass-user grass-user 
Subject: Re: [GRASS-user] r.in.lidar / v.in.lidar missing in Ubnutu 18.04 
package

On Thu, Jan 9, 2020 at 9:35 AM Stefan Blumentrath  
wrote:
> Hi,
>
> On two different Ubuntu (18.04) installations with packages from 
> ubuntugis-unstable (GRASS GIS 7.8.2), I am missing 
> r.in.lidar/v.in.lidar modules. Neither GRASS nor a OS search finds 
> r.in.lidar/v.in.lidar…
>
> I double-checked and liblas and pdal are installed on both of boxes.

So far it requires on liblas.

For PDAL support, see

- https://github.com/OSGeo/grass/pull/61 (still work in progress)
- addon: 
https://github.com/OSGeo/grass-addons/tree/master/grass7/raster/r.in.pdal

>
> Is this a packaging issue or is a specific order of installation required for 
> r.in.lidar / v.in.lidar to become available.

I guess a packaging error with liblas on Ubuntu.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] r.in.lidar / v.in.lidar missing in Ubnutu 18.04 package

2020-01-09 Thread Stefan Blumentrath
Hi,

On two different Ubuntu (18.04) installations with packages from 
ubuntugis-unstable (GRASS GIS 7.8.2), I am missing r.in.lidar/v.in.lidar 
modules. Neither GRASS nor a OS search finds r.in.lidar/v.in.lidar...
I double-checked and liblas and pdal are installed on both of boxes.

Is this a packaging issue or is a specific order of installation required for 
r.in.lidar / v.in.lidar to become available.

Thanks any hint on how to get those modules!

Kind regards,
Stefan

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] S.K. Jenson and J.O. Domingue (1988) method to filter the elevation map

2019-12-11 Thread Stefan Blumentrath
I assume you refer to:
https://grass.osgeo.org/grass78/manuals/r.fill.dir.html

There is also:
https://grass.osgeo.org/grass78/manuals/r.terraflow.html
and
https://grass.osgeo.org/grass76/manuals/addons/r.hydrodem.html
as well as a couple of AddOns based on richdem (starting with r.richdem.*):
https://github.com/OSGeo/grass-addons/tree/master/grass7/raster
[https://avatars2.githubusercontent.com/u/1058467?s=400=4]
grass-addons/grass7/raster at master · OSGeo/grass-addons · 
GitHub
You signed in with another tab or window. Reload to refresh your session. You 
signed out in another tab or window. Reload to refresh your session. to refresh 
your session.
github.com


Maybe that helps. Can you inform us about the new methods you had in mind?

Cheers
Stefan
GRASS GIS manual: 
r.hydrodem
DESCRIPTION r.hydrodem applies hydrological conditioning (sink removal) to a 
required input elevation map. If the conditioned elevation map is going to be 
used as input elevation for r.watershed, only small sinks should be removed and 
the amount of modifications restricted with the mod option. For other modules 
such as r.terraflow or third-party software, full sink removal is recommended.
grass.osgeo.org


Fra: grass-user  på vegne av Luis Moreira 

Sendt: onsdag 11. desember 2019 14:16
Til: grass-user@lists.osgeo.org 
Emne: [GRASS-user] S.K. Jenson and J.O. Domingue (1988) method to filter the 
elevation map

Hello everyone,

I'd like to know if Grass still uses the S.K. Jenson and J.O. Domingue
(1988) method to filter the elevation map, in its original conception. I've
read about some new and more improved methods and was wondering if there
wasn't any improvement in Grass method.

Thank you.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] compute path with a maximum slope

2019-12-10 Thread Stefan Blumentrath
Hi,

you can either try r.walk (https://grass.osgeo.org/grass78/manuals/r.walk.html) 
and modify variable according to Your threshold or you set slope values above 
your maximum to NULL (e.g. r.mapcalc 
expression="slope_below_max=if(slope>37.5,null(),slope)") and then use r.cost 
(https://grass.osgeo.org/grass78/manuals/r.cost.html, NULL ("NoData") are not 
traversed by the algorithm).

Cheers,
Stefan
GRASS GIS manual: r.walk
DESCRIPTION r.walk computes anisotropic cumulative cost of moving between 
different geographic locations on an input elevation raster map whose cell 
category values represent elevation combined with an input raster map layer 
whose cell values represent friction cost.. r.walk outputs 1) a raster map 
showing the lowest cumulative cost (time) of moving between each cell and the 
user-specified ...
grass.osgeo.org


Fra: grass-user  på vegne av 
li...@lazygranch.com 
Sendt: tirsdag 10. desember 2019 10:34
Til: grass-user@lists.osgeo.org 
Emne: [GRASS-user] compute path with a maximum slope

I have a DEM in grass using a proj that is in UTM. Viewshed, slope, etc
work fine. What I want to do is have grass compute a path between two
points such that the slope doesn't exceed a maximum value. I don't care
about the path length.

I suspect there is some guide on the internet for this problem, but
just can't compose the right question for a search engine. A link would
be appreciated. If not, some basic guidance would be helpful.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment: band_suffix does not seem to have effect

2019-11-20 Thread Stefan Blumentrath
Hi Moritz,

Thanks for the hint. Indeed, I used the default region_growing method, not 
mean_shift.
Maybe a warning message if band_suffix is given but not mean_shift method would 
avoid confusion?
Or a note in the manual (or both)...

Cheers
Stefan

Fra: Moritz Lennert 
Sendt: onsdag 20. november 2019 13:16
Til: Stefan Blumentrath ; GRASS users list 

Emne: Re: [GRASS-user] i.segment: band_suffix does not seem to have effect

On 20/11/19 11:19, Stefan Blumentrath wrote:
> Hi,
>
> I thought that if I give the band_suffix option in i.segment it
> produces bands with modified band values for all input bands. However,
> the option does not seem to have effect (no modified output bands are
> produced). Did I do or understand something wrong?

AFAIR, this option is only relevant if you use the mean shift
segmentation approach. Is that what you are doing ?

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] i.segment: band_suffix does not seem to have effect

2019-11-20 Thread Stefan Blumentrath
Hi,

I thought that if I give the band_suffix option in i.segment it produces bands 
with modified band values for all input bands. However, the option does not 
seem to have effect (no modified output bands are produced). Did I do or 
understand something wrong?

Cheers
Stefan

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] stitching together aerial imagery with edge blending

2019-10-17 Thread Stefan Blumentrath
Hi Henry,

You could try:  
https://grass.osgeo.org/grass76/manuals/addons/r.patch.smooth.html

Cheers,
Stefan

Get Outlook for Android


From: grass-user  on behalf of Henry House 

Sent: Thursday, October 17, 2019 8:40:42 PM
To: grass-user@lists.osgeo.org 
Subject: [GRASS-user] stitching together aerial imagery with edge blending

I have a selection of vintage aerial imagery from 1929 which features
variable brightness, with edges of images generally overly dark. While
I'm grateful that imagery from 1929 exists at all for my study area,
this is annoying and detrimental to classification efforts. As most of
the images overlap each other around their edges, I'd like to blend the
pixels from area where the raster overlap in some way, ideally such that
there are no sharp changes visible in transition from one exposure to
another in the patched map.

I can patch the images together with r.patch, but then I get the
artifacts of the edges. I also thought using r.mapcalc to blend pixels
pixels 50/50 where maps overlap. But surely this has been done many
times before and I can avoid inventing my own method. Do there exist any
specialized tools for smart stitching of aerial imagery tiles together
such that overlapping area a blended; or could someone suggest a good
technique?

--
Henry House
House Agricultural Consultants
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] g.findfile

2019-10-10 Thread Stefan Blumentrath
I would say it is a bug.

-Original Message-
From: grass-user  On Behalf Of Vincent Bain
Sent: torsdag 10. oktober 2019 10:41
To: GRASS user list 
Subject: [GRASS-user] g.findfile

Trying to test the existence of maps with g.findfile I see there is something 
wrong with the command and its manual. It says the -l option provides a list of 
"elements" keywords. In my case it gives the
following:

 raster(raster map(s))
 raster_3d (3D raster map(s))
 vector(vector map(s))
 label (paint label file(s))
 region(region definition(s))
 group (imagery group(s))

But in case I want to test if raster map foo exits (and it actually
exists) the following command says it does not:

   g.findfile element=raster file=foo

whereas

   g.findfile element=cell file=foo

matches the map.


In fact, the file $GISBASE/etc/element_list contains these keywords:

 cell:raster:raster:raster map(s)
 cellhd:header
 cats:category
 colr:color
 hist:history
 cell_misc:misc
 fcell:fcell
 g3dcell:g3dcell
 grid3:raster_3d:3D raster:3D raster map(s)
 vector:vector:vector:vector map(s)
 paint/labels:label:label:paint label file(s)
 windows:region:region definition:region definition(s)
 group:group:imagery group:imagery group(s)

Should I consider this a bug?

Yours,
Vincent.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Resample DEM to larger cells

2019-09-26 Thread Stefan Blumentrath
Hi Rich,

Copy and paste from the raster commands overview:
"r.resamp.stats Resamples raster map layers to a coarser grid using 
aggregation."
I thought that was what you were up to, aggregate a higher resolution raster to 
5m resolution, no?
Which aggregation method to use depends on your use case of course. For 
Hydrological applications I would probably use low percentiles (5 or 10%)...
If that was not the case, please reformulate your initial question.

In addition to r.resamp.stats, also in the manuals of r.resamp.filter, 
r.resamp.interp as well as r.resamp there is a description of the purpose the 
modules are intended for. Do I thus understand you correctly, that you ask for 
additional clarifications in the rasterintro?

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Rich Shepard
Sent: torsdag 26. september 2019 00:50
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Resample DEM to larger cells

On Wed, 25 Sep 2019, Stefan Blumentrath wrote:

> Please have a look at:
> https://grass.osgeo.org/grass76/manuals/r.resamp.stats.html

Stefan,

I don't need statistics on the raster map

> Also https://grass.osgeo.org/grass76/manuals/rasterintro.html has a 
> section on resampling and you can get a brief overview over available 
> options on: https://grass.osgeo.org/grass76/manuals/raster.html

Yes, this information is also found elsewhere. It tells us what methods are 
available and how they work but do not explain for what type of raster map each 
is best suited; or, why should I select this one?

I'm looking to understand the situations for which each interpolation method is 
best suited. Or, when more than one is possible, what criteria should be 
applied to the choice.

Thank you,

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Resample DEM to larger cells

2019-09-25 Thread Stefan Blumentrath
Hi Rich,

Please have a look at:
https://grass.osgeo.org/grass76/manuals/r.resamp.stats.html

With g.search.modules 
(https://grass.osgeo.org/grass76/manuals/g.search.modules.html) you can search 
for modules using keywords.

Also https://grass.osgeo.org/grass76/manuals/rasterintro.html has a section on 
resampling and you can get a brief overview over available options on: 
https://grass.osgeo.org/grass76/manuals/raster.html

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Rich Shepard
Sent: onsdag 25. september 2019 21:26
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Resample DEM to larger cells

I have a DEM built with 68 raster maps (attached) developed from LiDAR (1m) 
data and reprojected using lanczos_f (which might have been a poorer choice for 
this type of raster, but I wasn't aware of this at the time). There's still a 
source map missing (I've contacted the source about this) but I want to 
resample the maps to 5m x 5m cell size. I think that would eliminate some of 
the sharp discrepancies in the assembled map.

There are five or six flavors of r.resample and I would appreciate advice on 
which would be most appropriate for me to use on these data. I don't know 
enough about the underlying algorithms to make an intelligent choice.

TIA,

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] question exporting from grass GeoTif files

2019-09-09 Thread Stefan Blumentrath
Hi Gabriel,

I would be surprised if the data range is exported incorrectly (if you left 
autodetection of the data type to export to). Did you check the range of the 
data with:
gdalinfo -mm F101992_c.tif
?
Maybe it is just a display issue cause for example ArcGIS might just estimates 
the range…

See otherwise also examples here for compatibility:
https://grass.osgeo.org/grass76/manuals/r.out.gdal.html

Cheers
Stefan


From: grass-user  On Behalf Of Gabriel 
Cotlier
Sent: mandag 9. september 2019 07:44
To: grass-user ; Markus Metz 
; Nikos Alexandris ; 
Veronica Andreo 
Subject: [GRASS-user] question exporting from grass GeoTif files

Dear grass users,
I got after intercallibrarion the following layer (with a correct Range of 
data:min = -0.3458  max = 61.9423 ) whats is the recommended way to get it 
exported out of grass to be opened in ArcGIS, conserving the range.
When i do :
[image.png]
but, when I open the exported layer in ArcGIS the Range of values in modified...
Thanks a lot for your help.
Kid regards
Gabriel


[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]
Virus-free. 
www.avast.com

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] WinGRASS addons partly back

2019-09-04 Thread Stefan Blumentrath
Hi Helmut,

Did you set the computational region properly?
Import of data outside the current region is only supported in lat/lon 
locations...

v.in.pygbif -o output=poa_pratensis taxa="Poa pratensis" rank=species

Gave me ~ 11k records for Norway and ~58 k records if I move the region 2000k 
towards south...

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Helmut 
Kudrnovsky
Sent: onsdag 4. september 2019 22:11
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] WinGRASS addons partly back

>Of the add-ons I need, only v.strds.stats and v.in.pygbif show problems 
>in
Windows.

tested winGRASS addon v.in.pygbif like mentioned in 
https://lists.osgeo.org/pipermail/grass-user/2019-September/080733.html

the addon is starting, though

v.in.pygbif -o output=test8 taxa=Fagus sylvatica, Poa pratensis rank=species 
continent=europe Found 0 occurrences for taxon Fagus sylvatica...
Found 0 occurrences for taxon  Poa pratensis...

a bit strange, as doing it with GBIF plugin in QGIS 3.8 (based upon the same 
pygibif python library as v.in.pygbif), I get ~48000 entries for Poa pratensis 
just for Germany.



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] 7.9.dev: SQLite3 error

2019-08-26 Thread Stefan Blumentrath
Hi Rich,

There seems to be a typo in your columns option. There should not be a "=" 
after the last column name, but a white space:
Should be:
columns='x double precision, y double precision, name char(10)'

(not: columns='x double precision, y double precision, 
> \ name=char(10)')

That should fix it...

Cheers
Stefan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASSBIN environment variable

2019-08-16 Thread Stefan Blumentrath
Hi Alex,

Yes indeed. Would be nice to avoid that.

There is actually an open pull request about it:
https://github.com/zarch/grass-session/pull/12/files
However, I guess a completely version independent solution would be 
preferable...

With Python 3 shutil.which() will be available also on Windows, however, in 
OSGeo4W, a version independent "grass.bat" does not seem to be available.
So, currently, for Windows, it is inevitable to include versions. Could be done 
like this:

def get_grassbin():
"""Find GRASS GIS startup binary"""
from shutil import which

grassbin = which('grass')
if not grassbin:
for v in range(71, 80):
grassbin_version = which('grass{}'.format(v))
if grassbin_version:
grassbin = grassbin_version

return grassbin
get_grassbin()

Not sure when the GRASSBIN variable is set, I guess during startup of GRASS. So 
when you run grass-session from within GRASS the variable should be set (just 
guessing though)...

Cheers
Stefan

From: grass-user  On Behalf Of Moody, Alex
Sent: fredag 16. august 2019 01:00
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] GRASSBIN environment variable

Hi all - I am trying out the grass-session package for the first time and am 
having issues with the GRASSBIN environment variable. It looks like the 
grass-session I was able to download references grass75svn.bat. I'm onto 
grass76.

I was able to get around this in a python session with 
os.environ['GRASSBIN']=D:\\grass76.bat, but it'd be nice to not have to 
do that.

If I run "set GRASS" from the command line, I see that 
GRASSBIN=D:\\grass75svn.bat even GRASS_VERSION=7.6.1

Where is the GRASSBIN variable set? I've been looking around and can't seem to 
find it.

Cheers,
Alex
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] sample a strds at specific locations (areas)

2019-08-12 Thread Stefan Blumentrath
Ciao Vero,

Currently, areas, lines and points are rasterized by default.
Centroids would come in addition.

That means, small polygons that only cover parts of a pixel would get 
rasterized never the less. This can of course be useful in some cases but cause 
issues in others. However, given that GRASS centroids are located inside areas 
it should be mostly OK.

Cheers
Stefan

From: Veronica Andreo 
Sent: mandag 12. august 2019 16:24
To: Stefan Blumentrath 
Cc: Margherita Di Leo ; grass-user 

Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Ciao Madi,

is the region properly set?

@Stefan in this case, if the centroid only is rasterized, then stats will also 
belong to that pixel only? AFAIU, we don't want that, but stats for the area. 
Or rasterization of centroid would have a different effect?

best,
Vero

El vie., 9 ago. 2019 a las 21:29, Stefan Blumentrath 
(mailto:stefan.blumentr...@nina.no>>) escribió:
Ciao Margherita,

This is strange. The area (I assume it is an area though your image just shows 
the boundary) should definitely get rasterized and thus analysed in 
v.strds.stats.

Can you post the output of:
v.category input=big_areas2@PERMANENT option=report
and
v.info<http://v.info> test -t ?

I double-checked, and the possibility to rasterize also centroids is 
unfortunately not handed down to v.rast.stats (and moduls build ontop of that, 
like v.strds.stats). This should be done for GRASS version >= 7.6 (e.g. by 
adding centroids to the default selection of types to rasterize in v.to.rast) 
and is probably worth a ticket.

Cheers
Stefan

From: Margherita Di Leo mailto:direg...@gmail.com>>
Sent: fredag 9. august 2019 16:51
To: Veronica Andreo mailto:veroand...@gmail.com>>
Cc: Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>>; grass-user 
mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Hi,

excuse me if I return on this. I have again the same problem, of v.strds.stats 
skipping lots of polygons. Now I'm using a brand new dataset - strds of 
Sentinel 1 and a brand now vector of polygons - and the skipped polygons are 
not narrow, I'm sure that there are cells centroids in it. See for example 
screenshot attached, depicting a polygon that was skipped. I also tried to run 
v.strds.stats on that polygon alone, like:

v.strds.stats in=big_areas2@PERMANENT where="cat == '1'"  
strds=db_cross_pol@scaled out=test method=average

v.info<http://v.info> test
 ++
 | Name:test  |
 | Mapset:  stats |
 | Location:S1|
 | Database:/media/madi/TOSHIBA EXT/S1/grassdata  |
 | Title:   Output from v.patch   |
 | Map scale:   1:1   |
 | Name of creator: madi  |
 | Organization:  |
 | Source date: Fri Aug  9 12:12:49 2019  |
 | Timestamp (first layer): none  |
 ||
 | Map format:  native|
 ||
 |   Type of map: vector (level: 2)   |
 ||
 |   Number of points:   0   Number of centroids:  0  |
 |   Number of lines:0   Number of boundaries: 0  |
 |   Number of areas:0   Number of islands:0  |
 ||
 |   Map is 3D:  No   |
 |   Number of dblinks:  0|
 ||
 |   Projection: UTM (zone 34)|
 ||
 |   N: 0S: 0 |
 |   E: 0W: 0 |
 ||
 |   Digitization threshold: 0   

Re: [GRASS-user] sample a strds at specific locations (areas)

2019-08-09 Thread Stefan Blumentrath
Ciao Margherita,

This is strange. The area (I assume it is an area though your image just shows 
the boundary) should definitely get rasterized and thus analysed in 
v.strds.stats.

Can you post the output of:
v.category input=big_areas2@PERMANENT option=report
and
v.info test -t ?

I double-checked, and the possibility to rasterize also centroids is 
unfortunately not handed down to v.rast.stats (and moduls build ontop of that, 
like v.strds.stats). This should be done for GRASS version >= 7.6 (e.g. by 
adding centroids to the default selection of types to rasterize in v.to.rast) 
and is probably worth a ticket.

Cheers
Stefan

From: Margherita Di Leo 
Sent: fredag 9. august 2019 16:51
To: Veronica Andreo 
Cc: Stefan Blumentrath ; grass-user 

Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Hi,

excuse me if I return on this. I have again the same problem, of v.strds.stats 
skipping lots of polygons. Now I'm using a brand new dataset - strds of 
Sentinel 1 and a brand now vector of polygons - and the skipped polygons are 
not narrow, I'm sure that there are cells centroids in it. See for example 
screenshot attached, depicting a polygon that was skipped. I also tried to run 
v.strds.stats on that polygon alone, like:

v.strds.stats in=big_areas2@PERMANENT where="cat == '1'"  
strds=db_cross_pol@scaled out=test method=average

v.info<http://v.info> test
 ++
 | Name:test  |
 | Mapset:  stats |
 | Location:S1|
 | Database:/media/madi/TOSHIBA EXT/S1/grassdata  |
 | Title:   Output from v.patch   |
 | Map scale:   1:1   |
 | Name of creator: madi  |
 | Organization:  |
 | Source date: Fri Aug  9 12:12:49 2019  |
 | Timestamp (first layer): none  |
 ||
 | Map format:  native|
 ||
 |   Type of map: vector (level: 2)   |
 ||
 |   Number of points:   0   Number of centroids:  0  |
 |   Number of lines:0   Number of boundaries: 0  |
 |   Number of areas:0   Number of islands:0  |
 ||
 |   Map is 3D:  No   |
 |   Number of dblinks:  0|
 ||
 |   Projection: UTM (zone 34)|
 ||
 |   N: 0S: 0 |
 |   E: 0W: 0 |
 ||
 |   Digitization threshold: 0|
 |   Comment: |
 ||
 ++
I confess I hadn't look much further into it because I thought it was a problem 
with nodata, but this is not the case and I think it's  worth of further 
investigation. Thanks for any pointers.

Regards,


On Thu, Feb 7, 2019 at 4:10 PM Margherita Di Leo 
mailto:direg...@gmail.com>> wrote:
Thanks for testing, Vero. I assume it's due to a local problem then.

Cheers,

On Thu, Feb 7, 2019 at 3:29 PM Veronica Andreo 
mailto:veroand...@gmail.com>> wrote:
Hi Stefan and Madi,

Thanks Stefan for the explanations :) Indeed I agree that a flag to avoid the 
alignment to input rasters (and just use region settings) sounds good.
I tested what Madi said, but cannot reproduce in the climate NC location [0]. 
This is the command I used:

v.strds.stats in=boundary_county where="cat == '261'" strds=tempmean 
t_where="start_time >= '2012-01-01'" out=test

to make it faster (it feels indeed kinda slow for the whole vector and full 
time series), I selected only one polygon and a rang

[GRASS-user] Open permanent position as Scientist in spatial analyses and remote sensing in applied ecology in NINA, Oslo, Norway

2019-08-09 Thread Stefan Blumentrath
Dear all,

Just want to inform you that there is an open permanent position as "Scientist 
in spatial analyses and remote sensing in applied ecology" at the Norwegian 
Institute for Nature Research (NINA), Oslo, Norway:
https://www.nina.no/Aktuelt/Nyhetsartikkel/ArticleId/4794/Scientist-in-spatial-analyses-and-remote-sensing-in-applied-ecology-1

Tasks in this position are amongst others to develop NINA´s research and 
project activities on landscape analyses, spatial modelling and the use of 
remote sensing data (satellite, air-born or in-situ) in ecology research and 
nature conservation.

The application should contain:
* A one-page letter where the candidate explains her/his motivation for 
applying for this scientist position and a brief description of the scientific 
relevance of the candidate's research experience.
* A CV including a list of publications with bibliographical references and 
contact details (telephone and e-mail) for three references.

The application must be submitted in English or Norwegian. It should be 
submitted by e-mail to siri.svend...@nina.no

Norwegian skills are no prerequisite for the application, but the work will 
require communication in Norwegian. Thus, we expect that the candidate acquires 
sufficient Norwegian language skills and at least achieves level A2 (equivalent 
to 92 hours evening course) during the probationary period, where fees for 
Norwegian courses are financed by NINA.

For further information, please contact Research Director in NINA Oslo Kristin 
Thorsrud Teien (phone: +47 930 06 805; e-mail: kristin.te...@nina.no).

Dead line for application: 10. of September 2019.

I would be glad to see strong applications from the OSGeo Community...

Kind regards,
Stefan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Wrangling CityGML with GRASS ?

2019-08-06 Thread Stefan Blumentrath
Hi Peter,

Not personally...
I would guess you would import CityGML through GDAL:
https://3d.bk.tudelft.nl/svitalis/citygml/gdal/2017/07/24/messing-around-with-citygml-on-gdal-2.2.html
There you can create subsets and the like...

What are you planning to do with it, roughly?

Cheers
Stefan


-Original Message-
From: grass-user  On Behalf Of "Peter Löwe"
Sent: torsdag 1. august 2019 11:10
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Wrangling CityGML with GRASS ?

Hi list,

I'm looking for information/howtos/etc. about how to deal with large CityGML 
data sets using GRASS.

Has anybody already explored this ?

Best,
Peter



___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Fwd: Re: remove small islands from vector areas

2019-06-21 Thread Stefan Blumentrath
Ah, OK. Got that wrong, sorry.

I don`t think holes have an area (but I may be wrong)
So you might have to add a centroid first?
https://grass.osgeo.org/grass76/manuals/v.centroids.html

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Robert Nuske
Sent: fredag 21. juni 2019 13:49
To: grass-user 
Subject: [GRASS-user] Fwd: Re: remove small islands from vector areas




 Weitergeleitete Nachricht 
Betreff: Re: [GRASS-user] remove small islands from vector areas
Datum: Fri, 21 Jun 2019 13:47:52 +0200
Von: Robert Nuske 
An: Stefan Blumentrath 

Hi Stefan,

as far as I understood does rmarea that remove small areas but not islands 
(holes) within areas. At least i didn't find a way to remove islands with 
v.clean.

thanks
   robert

Am 21.06.19 um 13:06 schrieb Stefan Blumentrath:
> Hi Robert,
> 
> Did you have a look at v.clean:
> https://grass.osgeo.org/grass77/manuals/v.clean.html
> with
> tool=rmarea >
> 
> Cheers
> Stefan
> 
> -Original Message-
> From: grass-user  On Behalf Of 
> Robert Nuske
> Sent: fredag 21. juni 2019 12:33
> To: grass-user 
> Subject: [GRASS-user] remove small islands from vector areas
> 
> Dear Listers,
> 
> sorry, it's me again.
> 
> I want to remove islands smaller than a certain threshold from my vector map 
> or if that is not possible all islands.
> 
> I found some trick on an old manual page of v.extract. But this does not work 
> anymore. Is there a new trick?
> 
> 
> thnaks
>robert
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
> 

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] remove small islands from vector areas

2019-06-21 Thread Stefan Blumentrath
Hi Robert,

Did you have a look at v.clean:
https://grass.osgeo.org/grass77/manuals/v.clean.html
with
tool=rmarea

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Robert Nuske
Sent: fredag 21. juni 2019 12:33
To: grass-user 
Subject: [GRASS-user] remove small islands from vector areas

Dear Listers,

sorry, it's me again.

I want to remove islands smaller than a certain threshold from my vector map or 
if that is not possible all islands.

I found some trick on an old manual page of v.extract. But this does not work 
anymore. Is there a new trick?


thnaks
  robert
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] get raster name in r.series min/max

2019-05-25 Thread Stefan Blumentrath
Hei Vero,
Use min_raster and max_for raster method in r.series...
Did you try that?
Cheers
Stefan


From: grass-user  on behalf of Veronica 
Andreo 
Sent: Sunday, May 26, 2019 6:02:47 AM
To: Frank David
Cc: grass-user
Subject: Re: [GRASS-user] get raster name in r.series min/max

Hi Frank

El sáb., 25 may. 2019 22:51, Frank David 
mailto:frank.da...@geophom.fr>> escribió:
Hi all,

I would like to identify the raster, in a r.series calculation for min
(or max), where the result is coming from.

Is there a way to do so ?

max_raster, min_raster in r.series will give you the index of the raster map in 
the series containing either max or min values

Is that what you need?

Vero

Thank you

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Early "warning": upcoming switch of SVN to readonly mode for planned GitHub migration

2019-05-16 Thread Stefan Blumentrath
Great news! Thanks to all contributing to this effort!

From: grass-user  on behalf of Markus 
Neteler 
Sent: Thursday, May 16, 2019 6:27:52 PM
To: GRASS-announce list
Cc: GRASS user list; GRASS developers list
Subject: [GRASS-user] Early "warning": upcoming switch of SVN to readonly mode 
for planned GitHub migration

Hi,

later tonight or tomorrow (Friday, May 17th, 2010) we'll switch the
GRASS GIS svn server to readonly-mode, in order make the GitHub
migration [1] possible.

Goal: have the repo up and running on Saturday (May 18th, 2019) for
the upcoming community sprint.

Some downtime of half a day or so cannot be avoided.
Git experts: please be available for questions :-)

@devs: please keep your upcoming commits locally and don't miss to
upload them later on to git(hub).

Thanks
Markus

[1] https://trac.osgeo.org/grass/wiki/GitMigration
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Detecting and carving culverts in LiDAR DEMs

2019-05-08 Thread Stefan Blumentrath
Dear all,

Since there is a lot of expertise on the ML in hydrology and LiDAR, I was 
wondering if someone is aware of a GRASS approach for identifying and carving 
Culverts (as well as removing bridges) in LiDAR DEMs.

Here some non-GRASS examples of what has been done earlier:
https://www.tandfonline.com/doi/full/10.1080/13658816.2018.1530353
https://www.sciencebase.gov/catalog/item/59971732e4b0b589267bbb22

I do have an idea of how to solve this in GRASS (also conceptually a bit 
different from the approaches above), with a rather simple / simplistic prove 
of concept based on geomorphometrics.
Yet, maybe someone around has a good procedure ready? Is there collaboration 
potential / interest?

Cheers
Stefan

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Combining 2d rasters to 3d using point files

2019-05-01 Thread Stefan Blumentrath
Maybe https://grass.osgeo.org/grass77/manuals/t.rast.to.rast3.html can be 
useful here?

From: grass-user  on behalf of Francois 
Chartier 
Sent: Wednesday, May 1, 2019 2:00:12 PM
To: GRASS user list
Subject: Re: [GRASS-user] Combining 2d rasters to 3d using point files

Are there any ideas how to run this process in batch mode for example?

On Thu., Apr. 25, 2019, 21:40 Francois Chartier, 
mailto:fra.chart...@gmail.com>> wrote:
Hi

I would like to combine potentially 100s of 2d rasters into one 3d raster.

Instead of using r.to.rast3 which could take a long time to prepare the 
setting, is there a way to export the raster as point files, and combine them 
using for example MsAccess, and then reimporting them into one 3d raster file?

Alternatively, is it possible to combine several 3d raster into one 3d raster?  
i could combine ten 2d rasters into one and then combine the multiple 3d 
rasters into one larger one.

thks
F

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Help; Running Grass from R without installing GRASS

2019-04-28 Thread Stefan Blumentrath
Hi Mehrdad,

If this is a permission issue, and the dependencies (and a build environment) 
are installed, you could try compile GRASS (and install it in your home 
directory if necessary with the --prefix configure option).
svn checkout https://svn.osgeo.org/grass/grass/ grass_trunk
cd grass_trunk
./configure
make
make install
The make install step is not required for starting GRASS though. The make 
commando creates a bin…/ directory within the grass_trunk dir, where the grass 
startupscript is located…

Hope that helps.

Cheers,
Stefan



From: grass-user  On Behalf Of Mehrdad 
Varedi
Sent: søndag 28. april 2019 18:31
To: Micha Silver 
Cc: grass-user 
Subject: Re: [GRASS-user] Help; Running Grass from R without installing GRASS

Thank you for your time and sharing your knowledge Micha for the second time.

I followed your code and found that initGRASS searches for libraries and 
binaries of GRASS in gisBase folder. If we address a folder that doesn't have 
the code it comes back with this error message: "The code execution cannot 
proceed because libgrass_gis.7.4.1.dll was not found. Reinstalling the program 
may fix this problem." it gives the same error even if I copy that file into 
GISBase folder.

I want to run my code on a shiny server which I can't install GRASS although I 
can copy files and libraries. Can I solve this issue by copying a certain 
folder of GRASS binaries with my app or I am going the wrong path?

Please advise,

Thank you once again for all the time you share to answer my questions,

Mehrdad


[https://mailfoogae.appspot.com/t?sender=admFyZWRpQGdtYWlsLmNvbQ%3D%3D=zerocontent=6036490f-455f-4578-9a0d-ec0122c7134a]ᐧ

On Sun, Apr 28, 2019 at 10:55 AM Micha Silver 
mailto:tsvi...@gmail.com>> wrote:

On 27/04/2019 22:05, Mehrdad Varedi wrote:

Hi Everyone,
I have detail explanations of connecting to an existing dataset in GRASS from R 
in this address: https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7

What I hope I could do is to create a GRASS dataset in R on the fly and without 
the need to install GRASS or create a dataset on it. Is there any way to do 
this?


Maybe this will help:

(You must have GRASS installed, of course)



# Parameters for the GRASS installation and temporary GRASS mapset

GISBase = "/usr/lib/grass76"
# Set these as you like

GISDbase = "/tmp"
Location = "tmp_location"
Mapset = "tmp_mapset"
georef = "EPSG:2039"

mapset_path = file.path(GISDbase, Location, Mapset)

# Now run the 'grass' command within R and

# use the -c and -e flags to create the temp mapset, then exit

setup_grass_cmd = paste("grass", "-c", georef, "-e", mapset_path)

system(setup_grass_cmd)



# Load the R grass interface and initialize GRASS within R,

# using the temporary mapset from above

library(rgrass7)
initGRASS(home=tempdir(),
  gisBase = GISBase,
  gisDbase = GISDbase,
  location = Location,
  mapset = Mapset,
  remove_GISRC = TRUE)



# Try some GRASS commands

input_tif = "isrlat12.tif"

grass_rast = "isrlat12"
execGRASS("r.in.gdal",  flags = c("o","overwrite"),
  input = input_tif,
  output = grass_rast)
execGRASS("g.region", flags="p", raster = grass_rast)

I did not add a command to remove the temporary mapset.  Something like:

unlink(file.path(GISDbase, Location), recusive = TRUE) might be necessary



One other note: you probably will get better suggestions on the R-sig-geo 
list...


i.e. I have a vector /raster file and use that to identify the region and 
details required to set up a dataset and use GRASS functions just by including 
rgrass library.

Thanks for your help and attention,

Mehrdad
--
Mehrdad Varedi
[https://mailfoogae.appspot.com/t?sender=admFyZWRpQGdtYWlsLmNvbQ%3D%3D=zerocontent=dbe7ab29-5a21-45c9-97bb-082f4f48224a]ᐧ


___

grass-user mailing list

grass-user@lists.osgeo.org

https://lists.osgeo.org/mailman/listinfo/grass-user

--

Micha Silver

Ben Gurion Univ.

Sde Boker, Remote Sensing Lab

cell: +972-523-665918


--
Mehrdad Varedi
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Import grass.script

2019-04-07 Thread Stefan Blumentrath
Hi,
Python 3 support is planned for GRASS 7.8...

Furthermore, you might be interested in the grass-session library on pypi...

Cheers,
Stefan

From: grass-user  on behalf of Shane Carey 

Sent: Sunday, April 7, 2019 1:35:11 AM
To: grass-user grass-user
Subject: [GRASS-user] Import grass.script

Hi,

I am trying to write an external standalone python script that is using grass 
commands. I setup my variables as below. I then run python3 in the terminal and 
import grass works fine. However, in Pycharm editor, it will not import for me. 
Any ideas of how to get around this?
Thanks

export GISBASE="$(grass76 --config path)"
export PATH="$PATH:$GISBASE/bin:$GISBASE/scripts"
export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GISBASE/lib"
export GIS_LOCK=$$
export GISRC="$HOME/.grass7/rc"
export PYTHONPATH="$PYTHONPATH:$GISBASE/etc/python"

Le gach dea ghui,
Shane Carey
GIS and Data Solutions Consultant
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] help with git migration

2019-04-01 Thread Stefan Blumentrath
Hi,

DBMI seems to be missing...
I guess that could be useful as well...

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Martin Landa
Sent: mandag 1. april 2019 11:24
To: GRASS users list ; GRASS developers list 

Subject: Re: [GRASS-user] help with git migration

Hi,

út 26. 3. 2019 v 20:45 odesílatel Martin Landa  napsal:
> Now I would like to ask to help with reducing number of open issues 
> with target 7.0+, see 
> https://trac.osgeo.org/grass/ticket/3789#comment:2.
>
> Please go through [1] and close issues which are already fixed or will 
> be not fixed from given reason. The goal is to decrease number of 
> issues which will be migrated to target git-based platform, see [2].
> [1] 
> https://trac.osgeo.org/grass/query?status=assigned=new=r
> eopened=8.0.0=7.8.0=7.6.1=7.4.
> 5=7.2.4=7.0.7=id=summary=status=ow
> ner=type=priority=milestone=priority

first of all, thanks to all how did a review of open tickets (especially of 
those which you have been reported [1] !). And also a kind reminder for those 
who could do a review in order to close at least part of open issues [1].

Thanks for help. Ma

[1] 
https://trac.osgeo.org/grass/query?status=assigned=new=reopened=7.8.0=7.6.2=8.0.0=7.0.7=7.2.4=7.4.5=reporter=3=id=summary=status=type=priority=milestone=component=priority

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] merging small areas but keep raster categories

2019-03-10 Thread Stefan Blumentrath
Hi Ken,

Did you try the rmarea method for r.reclass.area?
That converts to vector, runs v.clean with rmarea and then converts back to 
raster (if I understood correctly...

Cheers,
Stefan

From: grass-user  on behalf of Ken Mankoff 

Sent: Saturday, March 9, 2019 9:44:31 PM
To: grass-user
Subject: [GRASS-user] merging small areas but keep raster categories


I'd like to merge small areas from a raster with their large neighbors.

I can do this with `r.clump` with the `minsize` argument.

But r.clump reclassifies everything, which is causing problems downstream with 
my workflow. I've tried working around this with `r.reclass.area ... 
mode=greater`, but that doesn't have the same functionality.

Can anyone suggest a workflow or tool that merges clumps but does not 
re-categorize them?

Thanks,

 -k.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] sample a strds at specific locations (areas)

2019-02-07 Thread Stefan Blumentrath
Hi Madi,

With this combination (polygon size vs. raster resolution), the shape of the 
polygons can be an issue (narrow areas that do not cover the center of any 
pixel).

Debugging should be simple with v.db.select or v.extract.

Areas that did not get rasterized should be NULL in the column with statistics 
computed with v.rast.stats.

In verbose mode v.rast.stats (or probably even v.to.rast) should probably give 
a more informative Warning message (e.g. listing categories not rasterized). It 
also would help if you can rasterize the areas yourself and provide a raster 
with categories as (optional) input to v.rast.stats…

For high resolution data like yours, the speed improvement of multiple raster 
input might help quite a bit esp. with many maps in the time series. Will see 
if I can come up with a patch rather soon…

Cheers
Stefan

From: Margherita Di Leo 
Sent: torsdag 7. februar 2019 10:37
To: Stefan Blumentrath 
Cc: Veronica Andreo ; grass-user 

Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Hi,

thank you for your replies. To give a little more context: I selected my 
polygon areas to be > 0.5 ha each (this would be 5 mq if I'm not mistaken) 
and I'm sampling NDVI maps at 10m resolution (the region being the same as NDVI 
maps). So I think I need an idea on how to debug the areas that were excluded 
to check them individually to see what could be the problem...
Regarding the alignment problem, if I understand it correctly: if the polygon 
doesn't include the *center* of the raster beneath it, can't retrieve the value 
and the polygon is discarded? But a value exists, so it would be correct that 
it returned a value in any case. But I admit I don't have a full grasp of the 
problem.

On Wed, Feb 6, 2019 at 10:52 PM Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> wrote:
Hi Vero,

I think there is a little misunderstanding.
v.rast.stats did not change it behaviour with regards to the computational 
region (at least not if only one raster map is used). The alignment to the 
input raster (resolution) has been around since the module got ported to Python 
(like 10 years ago):
https://trac.osgeo.org/grass/browser/grass/trunk/scripts/v.rast.stats/v.rast.stats.py?rev=33522#L148

So, adding a flag for skipping the alignment was more an idea for an 
enhancement that allows the behaviour you seem to prefer (too).

Cheers
Stefan

From: Veronica Andreo mailto:veroand...@gmail.com>>
Sent: onsdag 6. februar 2019 21:38
To: Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>>
Cc: Margherita Di Leo mailto:direg...@gmail.com>>; 
grass-user mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

I had a similar problem some time ago, just that it was not raster resolution, 
but region resolution that I changed to solve my problem (see this thread and 
MM's answer: 
http://osgeo-org.1560.x6.nabble.com/v-to-rast-for-polygons-not-overlapping-center-of-raster-cell-td5355686.html#a5355729)

IIUC, MM's proposed solution to my case then does not work anymore because 
v.to.rast call inside v.rast.stats is affected by the region alignment to the 
raster to be queried. So, the solution is indeed now, to change raster 
resolution... ? Then the region would be aligned to it (them)?

If one has large areas or long time series and has to resample all rasters to 
get smallish polygons rasterized, I do not see the advantage of this new 
behavior... but maybe I'm missing something

Cheers,
Vero

El mié., 6 feb. 2019 16:54, Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> escribió:
Ciao Madi, Vero,

Starting with GRASS 7.6, also centroids are used to get the raster 
representation of your area vector map. That increases the likelihood of 
smaller areas to be rasterized.
Increasing the resolution of the current region alone does not help, because 
v.rast.stats temporarily changes the computational region to align with the 
input raster map(s) (see also: https://trac.osgeo.org/grass/ticket/3523 and 
https://trac.osgeo.org/grass/ticket/3598 for discussion) Even if the first 
ticket is closed, comments are welcome.
It might make sense to add a flag to v.rast.stats like in r.slope.aspect to not 
align the computational region.

Furthermore, with regards to efficiency, v.strds.stats could gain some speed if 
multi-raster support in v.rast.stats - added in G 7.6 - would be handed down to 
the addon. Might almost double the speed for larger STRDS…

Cheers
Stefan

From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Veronica Andreo
Sent: onsdag 6. februar 2019 17:20
To: Margherita Di Leo mailto:direg...@gmail.com>>
Cc: GRASS user list 
mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Hi Madi

El mié., 6 feb. 2019 a las 16:31, Margherita Di Leo 
(mailto:direg...@gmail.com>>) escribió:
I have a questi

Re: [GRASS-user] sample a strds at specific locations (areas)

2019-02-06 Thread Stefan Blumentrath
Ciao Madi, Vero,

Starting with GRASS 7.6, also centroids are used to get the raster 
representation of your area vector map. That increases the likelihood of 
smaller areas to be rasterized.
Increasing the resolution of the current region alone does not help, because 
v.rast.stats temporarily changes the computational region to align with the 
input raster map(s) (see also: https://trac.osgeo.org/grass/ticket/3523 and 
https://trac.osgeo.org/grass/ticket/3598 for discussion) Even if the first 
ticket is closed, comments are welcome.
It might make sense to add a flag to v.rast.stats like in r.slope.aspect to not 
align the computational region.

Furthermore, with regards to efficiency, v.strds.stats could gain some speed if 
multi-raster support in v.rast.stats - added in G 7.6 - would be handed down to 
the addon. Might almost double the speed for larger STRDS…

Cheers
Stefan

From: grass-user  On Behalf Of Veronica 
Andreo
Sent: onsdag 6. februar 2019 17:20
To: Margherita Di Leo 
Cc: GRASS user list 
Subject: Re: [GRASS-user] sample a strds at specific locations (areas)

Hi Madi

El mié., 6 feb. 2019 a las 16:31, Margherita Di Leo 
(mailto:direg...@gmail.com>>) escribió:
I have a question regarding v.strds.stats. I get the following warning message:

WARNING: Not all vector categories converted to raster. Converted 120 of 265.

What could be the reason for that?

Some vector areas might not be converted because they are too small with 
respect to the pixel size that you try to query. Others will tell better but I 
think the polygon must overlap the center of the pixel in order to be converted 
into raster. One solution could be to resample your rasters to a higher 
resolution.
HTH,
Vero
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] sharing GRASS mapsets

2019-02-06 Thread Stefan Blumentrath
Hi Laura,

There are several options.

One option would be to subdivide “ENVIROMENTAL_COVARIATES” into e.g. topics.
In my organisation (also environmental research) we organized mapsets with 
prefixes (g_ for mapsets of general interest, gt_ for time series, p_ for 
projects, u_ for users). Different users can take care of different topics (but 
everybody has to clean up his/her own mess).
These mapsets can then easily added to the users search_path with g.mapsets 
(https://grass.osgeo.org/grass74/manuals/g.mapsets.html)…

An advantage of splitting up ENVIROMENTAL_COVARIATES into smaller mapsets is 
that it is easier to move chunks of data (e.g. from central storage to compute 
units (laptop/server))…

If your users are allowed to change file ownership, they could in principle 
take over “ENVIROMENTAL_COVARIATES”. However, an important point of the 
ownership check implemented in GRASS is to make sure that users do not shoot 
each others in the foot…
That check can be overwritten with the GRASS_SKIP_MAPSET_OWNER_CHECK 
environment variable (see: 
https://grass.osgeo.org/grass74/manuals/variables.html)

See also the related issue: https://trac.osgeo.org/grass/ticket/1829

For both of the latter options there is a significant risk in a multi-user 
environment…

Hope that helps a bit…

Cheers
Stefan

From: grass-user  On Behalf Of Laura Poggio
Sent: onsdag 6. februar 2019 12:22
To: GRASS user list 
Subject: [GRASS-user] sharing GRASS mapsets

Dear all,
we need to share a GRASS location and its mapsets across multiple users.
We would like to have a structure similar to this:
LOCATION:
 PERMANENT
 ENVIROMENTAL_COVARIATES
 working_mapset_for_each_user

It is clear in the documentation that a user can only write in a mapset that it 
owns.
However we would need to have multiple users to be able to add/delete/modify 
files to the ENVIROMENTAL_COVARIATES mapset. Is this possible at all? any 
workaround that can be implemented?

Thanks in advance

Laura




___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] 2-years postdoctoral position in species distribution modeling at NINA; deadline 1 February 2019

2019-01-07 Thread Stefan Blumentrath
Dear all,

Just want to inform you that there is a vacant GIS-related position at NINA in 
Trondheim.

NINA is seeking applicants for a 2-year postdoctoral fellowship to join a 
research consortium for species distribution modeling of birds in northern 
Europe. The Future Bird Scenarios project is scheduled to begin in 2019 with 
new funding from the BiodivERsA-Belmont Forum.

Please see: 
https://www.nina.no/Aktuelt/Nyhetsartikkel/ArticleId/4664/Postdoctoral-position-in-species-distribution-modeling
 for more detailed information.

Essential qualifications for all applicants will include:
1) A PhD degree in quantitative ecology, statistics, or a related discipline;
2) Evidence of research productivity, with publications in the peer-reviewed 
literature; and
3) Good communication skills, including successful research grants and oral 
presentations at scientific conferences.

Applicants must be fluent in English. Language skills in Norwegian or one of 
the other Scandinavian languages are not required but will be considered an 
asset.

Desired qualifications will include technical skills in one or more of the 
following areas:
1) Ornithology, with a foundation of knowledge in the ecology of migratory 
birds;
2) Quantitative ecology, with experience in computer programming, hierarchical 
models in a Bayesian framework, and testing for ecological predictors of 
organismal responses;
3) Data science, with experience in working with species distribution modeling 
or with large complex datasets; and
4) Geographic sciences, with experience at acquiring and compiling geographic 
data and GIS layers from different sources.

Would be glad to see strong applicants from the OSGeo community. Please feel 
free to spread the word!

Kind regards,
Stefan

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Sentinel2- flooding

2018-12-07 Thread Stefan Blumentrath
Hi Shane,

Following up on robertos answer:
You could try the Normalized Difference Water Index (NDWI) which is computed 
for S-2 as:
ndwi = (B08-B11)/(B08+B11)
or alternatively
ndwi = (B03 - B08) / (B03 + B08)
See e.g.: 
https://github.com/sentinel-hub/custom-scripts/blob/master/sentinel-2/ndwi/script.js

You could also take a look at Sentinel-1 for flooding / water bodies. However, 
Sentinel-1 would have to be pre-processed in SNAP/gpt.

Cheers
Stefan

From: grass-user  On Behalf Of Shane Carey
Sent: fredag 7. desember 2018 17:35
To: roberto.marzoc...@gmail.com
Cc: grass-user grass-user 
Subject: Re: [GRASS-user] Sentinel2- flooding

Ok, thanks.
Le gach dea ghui,
Shane Carey
GIS and Data Solutions Consultant


On Fri, Dec 7, 2018 at 2:45 PM Roberto Marzocchi 
mailto:roberto.marzoc...@gmail.com>> wrote:
I Think there isn't any tool pre-configured. You need to find an index to 
calculate "flooded" cells and then you can simply use r.mapcalc

R

Il giorno ven 7 dic 2018 alle ore 14:45 Shane Carey 
mailto:careys...@gmail.com>> ha scritto:
Hi,

I've obtained an image from sentinel2 where it shows flooding. Just wondering 
are there tools in Grass to classify an image in order to pull out these 
"flooded" pixels?

Thanks
--
Le gach dea ghui,
Shane Carey
GIS and Data Solutions Consultant
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Sentinel 1 in GRASS

2018-11-26 Thread Stefan Blumentrath
Forgot to upload the graph.xml file, where the SNAP processing chain is 
described…
Will upload the latest version with variables (instead of hardcoded file path) 
to github.
The attached file should open in SNAP GUI, however…

Cheers
Stefan

From: Margherita Di Leo 
Sent: mandag 26. november 2018 11:33
To: Stefan Blumentrath 
Cc: GRASS user list 
Subject: Re: [GRASS-user] Sentinel 1 in GRASS

Stefan,

I overlooked to mention that my aim is to explore the capabilities for 
detecting areas of deforestation. Thanks for sharing your workflow! It will 
surely be useful for me.

Kind regards,

On Mon, Nov 26, 2018 at 11:15 AM Stefan Blumentrath 
mailto:stefan.blumentr...@nina.no>> wrote:
Hi Margherita,

There are a lot of very different possible workflows with S-1, depending on 
what you are aiming at...

For terrestrial mapping applications, feel free to take inspiration from here 
(finishing off a report on the project right now):
https://github.com/NINAnor/sentinel4nature/blob/master/Tree%20canopy%20cover/preprocessing/sentinel_1_pp.sh
However, first parts of the pre-processing has to be done in SNAP / gpt as the 
relevant radar tools are to my knowledge not available in GRASS…

Cheers
Stefan


From: grass-user 
mailto:grass-user-boun...@lists.osgeo.org>> 
On Behalf Of Margherita Di Leo
Sent: mandag 26. november 2018 11:08
To: GRASS user list 
mailto:grass-user@lists.osgeo.org>>
Subject: [GRASS-user] Sentinel 1 in GRASS

Hi,

has anyone worked with Sentinel 1 in GRASS and can share a nice tutorial?

Thanks in advance

--
Margherita Di Leo


--
Margherita Di Leo


graph_subs.xml
Description: graph_subs.xml
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Sentinel 1 in GRASS

2018-11-26 Thread Stefan Blumentrath
Hi Margherita,

There are a lot of very different possible workflows with S-1, depending on 
what you are aiming at...

For terrestrial mapping applications, feel free to take inspiration from here 
(finishing off a report on the project right now):
https://github.com/NINAnor/sentinel4nature/blob/master/Tree%20canopy%20cover/preprocessing/sentinel_1_pp.sh
However, first parts of the pre-processing has to be done in SNAP / gpt as the 
relevant radar tools are to my knowledge not available in GRASS…

Cheers
Stefan


From: grass-user  On Behalf Of Margherita 
Di Leo
Sent: mandag 26. november 2018 11:08
To: GRASS user list 
Subject: [GRASS-user] Sentinel 1 in GRASS

Hi,

has anyone worked with Sentinel 1 in GRASS and can share a nice tutorial?

Thanks in advance

--
Margherita Di Leo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Get values from raster map following a direction map for n steps

2018-11-20 Thread Stefan Blumentrath
Dear all,

In an r.mapcalc expression, I would like to trace values along a direction map 
for 1 to n steps (e.g. looking 4 steps ahead along a path or stream or along a 
given direction (degrees or 45degrees).

I tried using the neighborhood modifier within an eval function in r.mapcalc. 
Unfortunately, using this command:
r.mapcalc --o << EOF
eval(elev_200 = elevation[1,1] - 200, elev_5 = 5 * elev_200[1,1], elev_p = 
pow(elev_5, 2))
gradient_1 = (0.5 * elev_200) + 0.8 * elev_p
EOF

I get the following error message:
syntax error, unexpected '[', expecting ')'

However, this command works fine:
r.mapcalc --o << EOF
eval(elev_200 = elevation[1,1] - 200, elev_5 = 5 * elevation[1,1], elev_p = 
pow(elev_5, 2))
gradient_1 = (0.5 * elev_200) + 0.8 * elev_p
EOF

My questions now are:
a) is it generally not supported to use the neighbourhood modifier on a 
temporary map defined in an eval() function in r.mapcalc?
b) are there other (efficient) approaches for those of us who do not know C 
(e.g. pygrass)?

I am grateful for any hint.

Kind regards,
Stefan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Help Puerto Rico Crowdsource GIS Data

2018-11-12 Thread Stefan Blumentrath
You could also have a look at GeoSHAPE:
http://geoshape.org/

However, there are plenty of tools out there, like:
https://geopaparazzi.github.io/geopaparazzi/


Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Moritz 
Lennert
Sent: mandag 12. november 2018 08:18
To: grass-user@lists.osgeo.org; Yosem Companys 
Subject: Re: [GRASS-user] Help Puerto Rico Crowdsource GIS Data



Am 12. November 2018 06:00:53 MEZ schrieb Yosem Companys :
>Hi All,
>
>Do you or someone you know have expertise crowdsourcing GIS data?
>
>I'm currently advising Hunter College's Center for Puerto Rican Studies 
>("Centro"), one of only a handful of groups using GIS mapping to help 
>Puerto Rico.
>
>Since Hurricane Maria's landfall, Centro's GIS mapping has shifted from 
>relief to recovery and reconstruction. Centro would like to accelerate 
>its efforts by creating a crowdsourcing platform for gathering GIS 
>data.
>
>To avoid reinventing the wheel, I suggested to Centro to connect with 
>developers with expertise in crowdsourcing GIS data. Should you or 
>someone you know have such expertise, please let me know.

This sounds like a typical use case for HotOSM: https://www.hotosm.org/.

Moritz

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] remove sliver polygons and dissolving adjacent ones

2018-11-01 Thread Stefan Blumentrath
Hei Giuseppe,

For your first task use v.clean: 
https://grass.osgeo.org/grass76/manuals/v.clean.html
For the second v.dissolve: 
https://grass.osgeo.org/grass76/manuals/v.dissolve.html

Cheers
Stefan

From: grass-user  On Behalf Of Giuseppe 
Cillis
Sent: torsdag 1. november 2018 10:39
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] remove sliver polygons and dissolving adjacent ones

Dear all,
First, I would like all polygons with area less than, for example, 100 
squaremeters, to be joined to adjacent ones with a larger area. There is a 
module linked to the polygons sliver, right? Finally, the thing to which I just 
can not give a solution. I would like to "merge/dissolve" just the adjacent 
polygons that have the same attribute. How can I do?
Thanks

GC
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Stefan Blumentrath
Hei Frank,

Did you try the “spatial” option in v.in.ogr (or the r-flag) (if your data is 
in a shape-file to start with):
https://grass.osgeo.org/grass74/manuals/v.in.ogr.html ?

And is v.clip slower than v.overlay (that could be used as well)?

Cheers
Stefan

From: grass-user  On Behalf Of Frank David
Sent: onsdag 31. oktober 2018 13:14
To: Veronica Andreo 
Cc: grass-user 
Subject: Re: [GRASS-user] partial vector copy to smaller territory


Hello Vero,

Thanks for your reply. It took almost one hour to extract my area (I guess 
because of topology). I do the same with Qgis from a shape in less than 10 
minutes (but with several operations)... it's may be a bad idea to have a so 
heavy vector map in Grass...

Cheers,

Frank
Le 31/10/2018 à 11:26, Veronica Andreo a écrit :
Check v.extract or v.clip

Cheers,
Vero

El mié., 31 oct. 2018 7:20, Frank David 
mailto:frank.da...@geophom.fr>> escribió:
Hello,

What is the best and fast way to make a copy of a part of vector map
(national) to get a smaller territory ? (partial copy).
Thank you for your advice !

Frank
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] zonal statistics for multiple areas

2018-10-29 Thread Stefan Blumentrath
Hi Alessandro,

You could try v.rast.bufferstats [1], if you do not have hundrets of thousands 
of points….

If the buffers don`t overlap, you could use v.rast.stats [2] from the upcoming 
GRASS 7.6 release, that will allow multiple raster input…

Otherwise have a look at the general introduction to GRASS and Python [3].

Cheers
Stefan

1: https://grass.osgeo.org/grass74/manuals/addons/v.rast.bufferstats.html
2: https://grass.osgeo.org/grass76/manuals/v.rast.stats.html
3: https://grasswiki.osgeo.org/wiki/GRASS_and_Python


From: grass-user  On Behalf Of Alessandro 
Sebastiani
Sent: mandag 29. oktober 2018 16:06
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] zonal statistics for multiple areas

Hello to everybody,
I hope my question is appropriate for this mail list. I have created 5 
different buffer layers (d=100,200,300,400,500 m) from a point vector. Now i 
want to compute some zonal statistics using different rasters as input. I know 
how to do that separately, but i was wondering how could i automate this 
procedure using a python script. I know python's basics, but i was not able to 
do so following guidelines that i found on the internet, e.g GRASS tutorial. 
Thank you in advance, A
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

  1   2   >