Re: [GRASS-user] ps.map: add elevation scale?

2023-05-16 Thread Frank David

Hello Rich,

colortable  ? : 
https://grass.osgeo.org/grass82/manuals/ps.map.html#colortable



Regards,

Frank

Le 16/05/2023 à 00:33, Rich Shepard a écrit :

On Mon, 15 May 2023, Rich Shepard wrote:


Is there a way to add the elevation color bar for a DEM map to a ps.map?


Since I can add a raster elevation legend using the GUI map window (see
attached), why can't I add in in a .psmap file?

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] rasterize 3d line

2023-04-07 Thread Frank David

Hi Vincent,

Yes it' works ! thank you for the trick

Regards,

Frank

Le 07/04/2023 à 13:37, Vincent Bain a écrit :

Hi Franck,

I would suggest you to do sth as follows :

- if necessary add vertice along your 3d lines (v.split ?) so their
"density" is roughly equivalent to (or better smaller than) your target
raster resolution ;
- turn your vector lines to points using v.to.points (with use=vertex
argument) ;
- convert this vector point map to a raster with v.to.rast (with use=z
argument) ;
- depending on what you do afterwards with that map, you can have a
look at r.null to manage null raster cells (e.g. setnull=0).

Hope this helps,

V.

Le vendredi 07 avril 2023 à 12:45 +0200, Frank David a écrit :

Hello,

Thank you for your message. But I don't think it helps me.

I want to add a bridge elevation to my DEM. So if I create a 3d
vector
line (my bridge) with two vertex at x,y,z coordinates, and is it
possible to convert in a raster where each cells crossed by the line
inherits of his extrapolated altitude ? If no module exists to do
that,
what would be the operations necessary to achieve this result ? I
hope
it is clearer.

Frank

Le 07/04/2023 à 10:16, Helmut Kudrnovsky a écrit :

Is there a way to rasterize a 3d line to get altitude on raster
cells
crossed by the line ?

not quite sure what are you trying to do?

maybe:

v.drape:

Converts 2D vector features to 3D by sampling of elevation raster
map. (https://grass.osgeo.org/grass82/manuals/v.drape.html)
Additional vertices can be added to the input 2D vector map with
v.split.

or the something like:

v.fixed.segmentpoints - segment points along a vector line with
fixed distances
(https://grass.osgeo.org/grass82/manuals/addons/v.fixed.segmentpoints.html
) followed by
v.what.rast - Uploads raster values at positions of vector points
to the table
(https://grass.osgeo.org/grass82/manuals/v.what.rast.html) or
v.sample - Samples a raster map at vector point locations
(https://grass.osgeo.org/grass82/manuals/v.sample.html).


kind regards
helmut



___
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] rasterize 3d line

2023-04-07 Thread Frank David

Hello,

Thank you for your message. But I don't think it helps me.

I want to add a bridge elevation to my DEM. So if I create a 3d vector 
line (my bridge) with two vertex at x,y,z coordinates, and is it 
possible to convert in a raster where each cells crossed by the line 
inherits of his extrapolated altitude ? If no module exists to do that, 
what would be the operations necessary to achieve this result ? I hope 
it is clearer.


Frank

Le 07/04/2023 à 10:16, Helmut Kudrnovsky a écrit :

Is there a way to rasterize a 3d line to get altitude on raster cells
crossed by the line ?

not quite sure what are you trying to do?

maybe:

v.drape:

Converts 2D vector features to 3D by sampling of elevation raster map. 
(https://grass.osgeo.org/grass82/manuals/v.drape.html)
Additional vertices can be added to the input 2D vector map with v.split.

or the something like:

v.fixed.segmentpoints - segment points along a vector line with fixed distances 
(https://grass.osgeo.org/grass82/manuals/addons/v.fixed.segmentpoints.html) 
followed by
v.what.rast - Uploads raster values at positions of vector points to the table 
(https://grass.osgeo.org/grass82/manuals/v.what.rast.html) or v.sample - 
Samples a raster map at vector point locations 
(https://grass.osgeo.org/grass82/manuals/v.sample.html).


kind regards
helmut



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


[GRASS-user] rasterize 3d line

2023-04-06 Thread Frank David

Hello,

Is there a way to rasterize a 3d line to get altitude on raster cells 
crossed by the line ?


Thank you for your help.

Regards,

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


Re: [GRASS-user] single window gui crash with Ubuntu 22.04 LTS

2023-01-03 Thread Frank David

Dear Mauricio,
Thank you for the link !
Regards,
Frank

Le 02/01/2023 à 18:52, Maurício Vancine a écrit :

Dear Frank,

I had the same problem and I solved it following this:

https://github.com/OSGeo/grass/issues/2690

Best,


Em seg., 2 de jan. de 2023 às 14:32, Micha Silver  
escreveu:


I checked on my Debian 11 with KDE desktop. Recompiled 8.2 from
git. No problem here.


On 02/01/2023 16:53, Frank David wrote:


Hello,

I've installed GRASS 8.2.0 in a fresh KDE UBUNTU 22.04  and the
GUI crash if the single window gui is enabled. As soon as I turn
off this choice in .grass8/wx.json file the GUI works.

console error message :

/usr/lib/grass82/scripts/g.extension:167: DeprecationWarning: The
distutils package is deprecated and slated for removal in Python
3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.dir_util import copy_tree
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in

lambda event: event.callable(*event.args, **event.kw
<http://event.kw>) )
File "/usr/lib/grass82/gui/wxpython/wxgui.py", line 95, in
show_main_gui
mainframe = GMFrame(parent=None, id=wx.ID_ANY,
workspace=self.workspaceFile)
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line
164, in __init__
self.BuildPanes()
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line
645, in BuildPanes
self._auimgr.AddPane(
File
"/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py",
line 4711, in AddPane
return self.AddPane4(window, arg1, target)
File
"/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py",
line 4879, in AddPane4
self.UpdateNotebook()
File
"/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py",
line 6653, in UpdateNotebook
notebook.AddPage(pane.window, title, True, pane.icon)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 3575, in AddPage
return self.InsertPage(self.GetPageCount(), page, caption,
select, bitmap, disabled_bitmap, control, tooltip)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 3653, in InsertPage
self.SetSelectionToWindow(page)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 4410, in SetSelectionToWindow
self.SetSelection(idx)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 4357, in SetSelection
ctrl.MakeTabVisible(ctrl_idx, ctrl)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 1843, in MakeTabVisible
if not self.IsTabVisible(tabPage, self.GetTabOffset(), dc, win):
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 1732, in IsTabVisible
self.Render(dc, wnd)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py",
line 1687, in Render
page.rect, tab_button.rect, x_extent = self._art.DrawTab(dc, wnd,
page, rect, tab_button.cur_state)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/tabart.py",
line 475, in DrawTab
r.SetHeight(r.GetHeight()/2)
TypeError: Rect.SetHeight(): argument 1 has unexpected type 'float'

Is there a way to solve this ?

Thank you for the trick.

Regards,

Frank


___
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

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



--
*Maurício Vancine*
Doutorando em Ecologia, Evolução e Biodiversidade
Mestre em Zoologia
Ecólogo (ABE n. 2018007)
Universidade Estadual Paulista (UNESP), Rio Claro/SP, Brasil

Site <https://mauriciovancine.github.io/> | Lattes 
<http://lattes.cnpq.br/9761288418931193> | Google Scholar 
<https://scholar.google.com/citations?user=i-2xZBQJ> | ORCID 
<https://orcid.org/-0001-9650-7575>|Publons 
<https://publons.com/researcher/1391845/mauricio-vancine/> |GitHub 
<https://github.com/mauriciovancine>


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


Re: [GRASS-user] single window gui crash with Ubuntu 22.04 LTS

2023-01-03 Thread Frank David

Hello Micha,

Thank you for your message. I never succeed to compile grass 8.2 on 
debian11... so I moved to Ubuntu.


I think there is a lack of documentation about grass 8.2 compilation on 
debian11 for intermediate users like me !


Regards,

Frank


Le 02/01/2023 à 18:32, Micha Silver a écrit :


I checked on my Debian 11 with KDE desktop. Recompiled 8.2 from git. 
No problem here.



On 02/01/2023 16:53, Frank David wrote:


Hello,

I've installed GRASS 8.2.0 in a fresh KDE UBUNTU 22.04  and the GUI 
crash if the single window gui is enabled. As soon as I turn off this 
choice in .grass8/wx.json file the GUI works.


console error message :

/usr/lib/grass82/scripts/g.extension:167: DeprecationWarning: The 
distutils package is deprecated and slated for removal in Python 
3.12. Use setuptools or check PEP 632 for potential alternatives

from distutils.dir_util import copy_tree
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in 
lambda event: event.callable(*event.args, **event.kw) )
File "/usr/lib/grass82/gui/wxpython/wxgui.py", line 95, in show_main_gui
mainframe = GMFrame(parent=None, id=wx.ID_ANY, 
workspace=self.workspaceFile)
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line 164, 
in __init__

self.BuildPanes()
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line 645, 
in BuildPanes

self._auimgr.AddPane(
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 4711, in AddPane

return self.AddPane4(window, arg1, target)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 4879, in AddPane4

self.UpdateNotebook()
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 6653, in UpdateNotebook

notebook.AddPage(pane.window, title, True, pane.icon)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
3575, in AddPage
return self.InsertPage(self.GetPageCount(), page, caption, select, 
bitmap, disabled_bitmap, control, tooltip)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
3653, in InsertPage

self.SetSelectionToWindow(page)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
4410, in SetSelectionToWindow

self.SetSelection(idx)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
4357, in SetSelection

ctrl.MakeTabVisible(ctrl_idx, ctrl)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1843, in MakeTabVisible

if not self.IsTabVisible(tabPage, self.GetTabOffset(), dc, win):
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1732, in IsTabVisible

self.Render(dc, wnd)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1687, in Render
page.rect, tab_button.rect, x_extent = self._art.DrawTab(dc, wnd, 
page, rect, tab_button.cur_state)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/tabart.py", line 
475, in DrawTab

r.SetHeight(r.GetHeight()/2)
TypeError: Rect.SetHeight(): argument 1 has unexpected type 'float'

Is there a way to solve this ?

Thank you for the trick.

Regards,

Frank


___
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___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] single window gui crash with Ubuntu 22.04 LTS

2023-01-02 Thread Frank David

Hello,

I've installed GRASS 8.2.0 in a fresh KDE UBUNTU 22.04  and the GUI 
crash if the single window gui is enabled. As soon as I turn off this 
choice in .grass8/wx.json file the GUI works.


console error message :

/usr/lib/grass82/scripts/g.extension:167: DeprecationWarning: The 
distutils package is deprecated and slated for removal in Python 3.12. 
Use setuptools or check PEP 632 for potential alternatives

from distutils.dir_util import copy_tree
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/wx/core.py", line 3282, in 
lambda event: event.callable(*event.args, **event.kw) )
File "/usr/lib/grass82/gui/wxpython/wxgui.py", line 95, in show_main_gui
mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line 164, in 
__init__

self.BuildPanes()
File "/usr/lib/grass82/gui/wxpython/main_window/frame.py", line 645, in 
BuildPanes

self._auimgr.AddPane(
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 4711, in AddPane

return self.AddPane4(window, arg1, target)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 4879, in AddPane4

self.UpdateNotebook()
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/framemanager.py", 
line 6653, in UpdateNotebook

notebook.AddPage(pane.window, title, True, pane.icon)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
3575, in AddPage
return self.InsertPage(self.GetPageCount(), page, caption, select, 
bitmap, disabled_bitmap, control, tooltip)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
3653, in InsertPage

self.SetSelectionToWindow(page)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
4410, in SetSelectionToWindow

self.SetSelection(idx)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
4357, in SetSelection

ctrl.MakeTabVisible(ctrl_idx, ctrl)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1843, in MakeTabVisible

if not self.IsTabVisible(tabPage, self.GetTabOffset(), dc, win):
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1732, in IsTabVisible

self.Render(dc, wnd)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/auibook.py", line 
1687, in Render
page.rect, tab_button.rect, x_extent = self._art.DrawTab(dc, wnd, page, 
rect, tab_button.cur_state)
File "/usr/lib/python3/dist-packages/wx/lib/agw/aui/tabart.py", line 
475, in DrawTab

r.SetHeight(r.GetHeight()/2)
TypeError: Rect.SetHeight(): argument 1 has unexpected type 'float'

Is there a way to solve this ?

Thank you for the trick.

Regards,

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


Re: [GRASS-user] regex in wxGUI

2022-12-01 Thread Frank David

Hi Anna,

Thank you for the trick !

By the way, do you know how to do with g.list -e rast pattern= ?

Regards,

Frank

Le 01/12/2022 à 05:00, Anna Petrášová a écrit :
It's using Python regular expressions, so after some googling, 
something like this seems to work:

^(?:(?!string).)*$
Seems rather complicated, maybe you can find a simpler solution...

Anna

On Wed, Nov 30, 2022 at 3:25 AM Frank David  
wrote:


Hello,

How can I select layers in the wxGUI when using CTRL+shift+L that
does not contain a specific string ?

Thank you for your help.

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


[GRASS-user] regex in wxGUI

2022-11-30 Thread Frank David

Hello,

How can I select layers in the wxGUI when using CTRL+shift+L that does 
not contain a specific string ?


Thank you for your help.

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


Re: [GRASS-user] Parallelizing r.mapcalc

2022-09-19 Thread Frank David

Thank you Vero.
The last link is very interesting. But nothing about python 
run_command() with r.mapcalc

Regards,
Frank

Le 16/09/2022 à 13:58, Veronica Andreo a écrit :

Hi Frank,

While not an expert here, did you see this other wiki: 
https://grasswiki.osgeo.org/wiki/Parallel_GRASS_jobs or Anna's 
presentation at FOSS4G 2022: 
https://htmlpreview.github.io/?https://github.com/petrasovaa/FUTURES-CONUS-talk/blob/main/foss4g2022.html#/ 
?


Perhaps useful?

Best,
Vero

El jue, 15 sept 2022 a las 14:33, Frank David 
() escribió:


Hello,

Is there a way to parallelize r.mapcalc in python scripts with
start_command() as it is with other command ?

https://grasswiki.osgeo.org/wiki/Parallelizing_Scripts

It seems to me r.mapcalc.tiled is not using processors at 100%

Thank you

Regards,

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


[GRASS-user] Parallelizing r.mapcalc

2022-09-15 Thread Frank David

Hello,

Is there a way to parallelize r.mapcalc in python scripts with 
start_command() as it is with other command ?


https://grasswiki.osgeo.org/wiki/Parallelizing_Scripts

It seems to me r.mapcalc.tiled is not using processors at 100%

Thank you

Regards,

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


[GRASS-user] r.mapcalc.tiled and mapset

2022-08-19 Thread Frank David

Hello,

When I use r.mapcalc.tiled, all the mapsets become available from the 
working mapset.


example : r.mapcalc.tiled expression="test=1" process=8

Is there any reason ?

I'm using grass 7.8

Thank you for your help.

Frank

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


Re: [GRASS-user] r.mapcalc radians vs degrees

2022-08-13 Thread Frank David

Hello,
Argg.. I was shamefully wrong. Python is in radian... sorry for the noise.
Frank

Le 13/08/2022 à 05:18, Anna Petrášová a écrit :



On Wed, Aug 10, 2022 at 11:20 AM Frank David  
wrote:


Hello,

It seems to me that there is an error on r.mapcalc manual page.
The angle should be entered in radians and not in degrees in the
trigonometric functions...


Why do you think so? In the past I've used degrees in r.mapcalc 
without problems and I don't think there was any change impacting this.


Anna

Regards,

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


[GRASS-user] r.mapcalc radians vs degrees

2022-08-10 Thread Frank David

Hello,

It seems to me that there is an error on r.mapcalc manual page. The 
angle should be entered in radians and not in degrees in the 
trigonometric functions...


Regards,

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


Re: [GRASS-user] multiple

2022-04-28 Thread Frank David

Hi Stephan,

Thanks for your message. I got intersection point with your method. I 
did not succeed to add cat to the error v.clean with v.category 
(database connection is missing ?). Anyway, another problem is I cannot 
copy attribute table v.patch. So I have to do a v.what on my original 
river lines to get its name and v.to.db to get coordinates. It's quite a 
long process, and my data counts numerous lines (river our roads, 
between 500 upto 2000 lines)... I will try


Another way could be to use v.buffer for transect lines and use this 
buffer as transect with v.overlay. I keep the attribute table and I can 
get coordinate with v.to.db. Do you think it is suitable ?


I think v.profile should be the way, but this function is not available yet.

Regards,

Frank


Le 27/04/2022 à 23:02, Stefan Blumentrath a écrit :


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


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 Frank David

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  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] multiple

2022-04-27 Thread Frank David

Hello Maris,

Thanks for your message.

If the lines (road or rivers) makes laces and the transect line cross 
them several times at different distances, only the first intersection 
is reported by v.profil. I have only one CAT by vector lines. You can 
download a data set here > https://we.tl/t-X8GVhWxgW6


The projection is french Lambert93 EPSG 2154. The data comes from IGN 
(French national geographic board)

and you can try this command :

/v.profile input=rivers type="line" buffer=10 profile_map=transect 
profile_where="cat=38"/


On my Grass 7.8.3 (on debian) the command does not return all 
intersection, not even the fisrt one. I don't know why...


Reagrds,
Frank
Le 27/04/2022 à 07:34, Maris Nartiss a écrit :

Hello Frank,
Could you elaborate on „first item“ as I just digitized a vector map
with three lines and crossed them with a profile and got back three
distances.
Things to check – do all lines have a CAT value in specified layer?
If you have a problem with a specific data set, you can send me it
off-list so I can take a look.

Māris.

otrd., 2022. g. 26. apr., plkst. 21:08 — lietotājs Frank David
() rakstīja:

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://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] multiple

2022-04-26 Thread Frank David

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://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] grass command to subset the columns of a vector

2022-02-08 Thread Frank DAVID

Hello,

May be duplicate your file and remove the unwanted column.

Frank


Le 09/02/2022 à 01:39, Bernardo Santos via grass-user a écrit :

Dear list,

Is there a GRASS GIS command (maybe a v.db.* one) to subset, in a 
single command, the columns of a vector?


What I have: vector "vect" with 5 columns "a, b, c, d, e" in the 
attribute table

What I want: vector "vect_sub" with only, for instance, "a, c, e"

I can use v.extract to subsample rows, but not columns. What is the 
easiest way of doing that, what needing many commands (like creating 
or copying the vector to a new one, creating a new attribute table, 
then copying only the columns I want).

I looked for that in the documentation but did not found it so easily.

Thanks!
Bernardo

___
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] gui not working in 7.9 after debian uprade to bullseye

2021-11-18 Thread Frank David

Hi Vero,

Thanks for your reply.

Shall I do "Make distclean" from the folder where I have built grass7.9 ?

I get :

/sudo make distclean//
//include/Make/Vars.make:1: include/Make/Platform.make: Aucun fichier ou 
dossier de ce type//
//make: *** Aucune règle pour fabriquer la cible 
« include/Make/Platform.make ». Arrêt./


Something seems wrong ??

For the moment I prefer to keep on 7.9, but if I can't manage to repair 
7.9 I will go to 8.0.


Cheers,

Frank


Le 18/11/2021 à 13:22, Veronica Andreo a écrit :

Hi Frank,

Did you `make distclean`, configure and recompile your grass79 after 
the system upgrade?

Also, maybe update your local copy as there have been changes.

So, if you only did a simple git clone to get the source code and 
compile, then:

make distclean
git fetch --all --prune && git checkout main && git pull && sh 
conf_grass_dev.sh && make


## Note we now also have a releasebranch_8_0 :)
## conf_grass_dev.sh is my configuration script

my 0.2 cents

Vero

El jue, 18 nov 2021 a las 9:56, Frank David (<mailto:frank.da...@geophom.fr>>) escribió:


Hello,

I have upgraded my distro from debian buster to bullseye. I had
two grass release installed installed : 1- grass 7.8.5 from
repository, still works fine. 2- a grass 7.9 compiled. When I run
this one I get this message :

Lancement de l'interface graphique  en tâche de fond,
merci de patienter ...
GRASS 7.9.dev <http://7.9.dev> (France_L93):~ > free(): double
free detected in tcache 2
Impossible de déterminer la version de GRASS
free(): double free detected in tcache 2
Traceback (most recent call last):
  File "/usr/local/grass79/scripts/g.extension", line 2177, in

    version = grass_version['version'].split('.')
KeyError: 'version'
free(): double free detected in tcache 2
Traceback (most recent call last):
  File "/usr/local/grass79/gui/wxpython/wxgui.py", line 106, in OnInit
    mainframe = GMFrame(parent=None, id=wx.ID_ANY,
  File "/usr/local/grass79/gui/wxpython/lmgr/frame.py", line 143,
in __init__
    self.notebook = self._createNoteBook()
  File "/usr/local/grass79/gui/wxpython/lmgr/frame.py", line 337,
in _createNoteBook
    self.goutput = GConsoleWindow(
  File "/usr/local/grass79/gui/wxpython/gui_core/goutput.py", line
118, in __init__
    self.cmdPrompt = GPromptSTC(parent=self,
menuModel=self._menuModel)
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line
138, in __init__
    GPrompt.__init__(self, parent=parent, menuModel=menuModel)
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line
56, in __init__
    self.mapList = self._getListOfMaps()
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line
100, in _getListOfMaps
    result['raster'] = grass.list_strings('raster')
  File "/usr/local/grass79/etc/python/grass/script/core.py", line
1347, in list_strings
    for line in read_command("g.list",
  File "/usr/local/grass79/etc/python/grass/script/core.py", line
565, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "/usr/local/grass79/etc/python/grass/script/core.py", line
392, in handle_errors
    raise CalledModuleError(module=module, code=code,
grass.exceptions.CalledModuleError: Module run g.list g.list --q
-m type=raster ended with error
Process ended with non-zero return code -6. See errors in the
(error) output.
OnInit returned false, exiting...
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion "GetEventHandler() ==
this" failed at ../src/common/wincmn.cpp(477) in ~wxWindowBase():
any pushed event handlers must have been removed

Do you have an idea to solve this problem ?

Thank you

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-user
<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] gui not working in 7.9 after debian uprade to bullseye

2021-11-18 Thread Frank David

Hello,

I have upgraded my distro from debian buster to bullseye. I had two 
grass release installed installed : 1- grass 7.8.5 from repository, 
still works fine. 2- a grass 7.9 compiled. When I run this one I get 
this message :


Lancement de l'interface graphique  en tâche de fond, merci de 
patienter ...

GRASS 7.9.dev (France_L93):~ > free(): double free detected in tcache 2
Impossible de déterminer la version de GRASS
free(): double free detected in tcache 2
Traceback (most recent call last):
  File "/usr/local/grass79/scripts/g.extension", line 2177, in 
    version = grass_version['version'].split('.')
KeyError: 'version'
free(): double free detected in tcache 2
Traceback (most recent call last):
  File "/usr/local/grass79/gui/wxpython/wxgui.py", line 106, in OnInit
    mainframe = GMFrame(parent=None, id=wx.ID_ANY,
  File "/usr/local/grass79/gui/wxpython/lmgr/frame.py", line 143, in 
__init__

    self.notebook = self._createNoteBook()
  File "/usr/local/grass79/gui/wxpython/lmgr/frame.py", line 337, in 
_createNoteBook

    self.goutput = GConsoleWindow(
  File "/usr/local/grass79/gui/wxpython/gui_core/goutput.py", line 118, 
in __init__

    self.cmdPrompt = GPromptSTC(parent=self, menuModel=self._menuModel)
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line 138, 
in __init__

    GPrompt.__init__(self, parent=parent, menuModel=menuModel)
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line 56, 
in __init__

    self.mapList = self._getListOfMaps()
  File "/usr/local/grass79/gui/wxpython/gui_core/prompt.py", line 100, 
in _getListOfMaps

    result['raster'] = grass.list_strings('raster')
  File "/usr/local/grass79/etc/python/grass/script/core.py", line 1347, 
in list_strings

    for line in read_command("g.list",
  File "/usr/local/grass79/etc/python/grass/script/core.py", line 565, 
in read_command

    return handle_errors(returncode, stdout, args, kwargs)
  File "/usr/local/grass79/etc/python/grass/script/core.py", line 392, 
in handle_errors

    raise CalledModuleError(module=module, code=code,
grass.exceptions.CalledModuleError: Module run g.list g.list --q -m 
type=raster ended with error
Process ended with non-zero return code -6. See errors in the (error) 
output.

OnInit returned false, exiting...
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" 
failed at ../src/common/wincmn.cpp(477) in ~wxWindowBase(): any pushed 
event handlers must have been removed


Do you have an idea to solve this problem ?

Thank you

Frank

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


Re: [GRASS-user] can't install and execute python script

2021-03-16 Thread Frank David

Hi Markus,

Le 16/03/2021 à 18:56, Markus Neteler a écrit :

On Tue, Mar 16, 2021 at 3:02 PM Frank David  wrote:

Hi Markus,

Thank you for your reply and correction. But no thing has changed on my Grass 
7.8.3 / Ubuntu 20.10, and it's still working on may Grass 7.69 / Debian Buster 
(see console below)

Yes:

- GRASS GIS 7.6 uses Python 2
- GRASS GIS 7.8 uses Python 3

I wrote 7.69 but it's 7.9...



(Tue Mar 16 14:50:05 2021)
g.extension extension=r.wtg 
url=/media/zephyr/ress/informatique/scripts/grass/scripts/r.wtg
Fetching  from 
 (be patient)...
Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
WARNING: No metadata available for module 'r.wtg'.
WARNING: No metadata available for module 'r.wtg'.
Installation of  successfully finished
(Tue Mar 16 14:50:14 2021) La commande s'est terminée (9 sec)

It's curious that Grass say "...not found" on every script, while copying the 
file in addons/ ?

Here I didn't get that error but mainly the one with the wrong
formatting. The "... not found" might be a secondary error while the
original error message isn't visible (for whatever reason).

Let me suggest that you update all Python script to Python 3 (there is
the "2to3" script as well as "autopep8" and others for that purpose).
Once done, perhaps the errors you get are gone?


Ok I will update at least one script, and remove the other for testing 
(I know I must update all). But I'm surprised because scripts could be 
executed with File>Launch script...

I wil tell you soon.

Thank you for your help.
Cheers,
Frank




Markus


Frank DAVID

Le 16/03/2021 à 13:24, Markus Neteler a écrit :

Hi,

On Mon, Mar 15, 2021 at 11:31 PM Markus Neteler  wrote:

On Mon, Mar 15, 2021 at 11:07 AM Frank David  wrote:

Hello,

I've installed GRASS 7.8.3 on Ubuntu 20.10 (groovy) and when I try to install 
my own python script, the message is :

Fetching  from 
 (be patient)...
Compiling...
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.threshold: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.conv: not 
found

...

Do you have any idea that problem ?

This is somehow hard to say - is the addon available for testing?

For posterity:

I received the addon offlist. Some files showed Python 3 syntax
errors, fixed with "autopep8" and now the installation works (for me).

cheers,
Markus

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


Re: [GRASS-user] can't install and execute python script

2021-03-16 Thread Frank David

Hi Markus,

Thank you for your reply and correction. But no thing has changed on my 
Grass 7.8.3 / Ubuntu 20.10, and it's still working on may Grass 7.69 / 
Debian Buster (see console below)


(Tue Mar 16 14:50:05 2021)
g.extension extension=r.wtg 
url=/media/zephyr/ress/informatique/scripts/grass/scripts/r.wtg
Fetching  from 
 (be 
patient)...

Compiling...
Installing...
Updating extensions metadata file...
Updating extension modules metadata file...
WARNING: No metadata available for module 'r.wtg'.
WARNING: No metadata available for module 'r.wtg'.
Installation of  successfully finished
(Tue Mar 16 14:50:14 2021) La commande s'est terminée (9 sec)

It's curious that Grass say "...not found" on every script, while 
copying the file in addons/ ?


Frank DAVID

Le 16/03/2021 à 13:24, Markus Neteler a écrit :

Hi,

On Mon, Mar 15, 2021 at 11:31 PM Markus Neteler  wrote:

On Mon, Mar 15, 2021 at 11:07 AM Frank David  wrote:

Hello,

I've installed GRASS 7.8.3 on Ubuntu 20.10 (groovy) and when I try to install 
my own python script, the message is :

Fetching  from 
 (be patient)...
Compiling...
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.threshold: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.conv: not 
found

...

Do you have any idea that problem ?

This is somehow hard to say - is the addon available for testing?

For posterity:

I received the addon offlist. Some files showed Python 3 syntax
errors, fixed with "autopep8" and now the installation works (for me).

cheers,
Markus

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


[GRASS-user] can't install and execute python script

2021-03-15 Thread Frank David

Hello,

I've installed GRASS 7.8.3 on Ubuntu 20.10 (groovy) and when I try to 
install my own python script, the message is :


Fetching  from 
 (be 
patient)...

Compiling...
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.threshold: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility.conv: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.surround: not 
found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visibility: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.intervisibility: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visual.area: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visual.cone: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.visual.competition: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.horizontal.visibility: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.terrain.vertical.angle: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.terrain.horizon: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.pit2hwtg: not 
found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.overhang: not 
found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/v.wtg.visibility.what: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/r.wtg.series: not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/v.wtg.surround: not 
found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/g.wtg.listfromtable: 
not found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/v.wtg.drawline: not 
found
/bin/sh: 1: 
/tmp/grass7-geophom-78286/tmp1tw0ncyb/r.wtg/scripts/v.wtg.transect: not 
found

Installing...
Updating private addons metadata file...
WARNING: No addons metadata available. Addons metadata file not updated.
Installation of  successfully finished

All files are well copied in /home/me/.grass7/addons/scripts

And when i want to execute one of them (here r.wtg.visibility), I get :

Traceback (most recent call last):
  File "/usr/lib/grass78/etc/python/grass/script/task.py",
line 473, in get_interface_description

p = Popen([cmd, '--interface-description'], stdout=PIPE,
  File "/usr/lib/grass78/etc/python/grass/script/core.py",
line 63, in __init__

subprocess.Popen.__init__(self, args, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 854, in
__init__

self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in
_execute_child

raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError
:
[Errno 2] No such file or directory: 'r.wtg.visibility'
During handling of the above exception, another exception
occurred:
Traceback (most recent call last):
  File "/usr/lib/grass78/gui/wxpython/gui_core/prompt.py",
line 272, in OnItemSelected

self.cmdDesc = gtask.parse_interface(cmd)
  File "/usr/lib/grass78/etc/python/grass/script/task.py",
line 522, in parse_interface

tree = etree.fromstring(get_interface_description(name))
  File "/usr/lib/grass78/etc/python/grass/script/task.py",
line 501, in get_interface_description

raise ScriptError(_("Unable to fetch interface description
for command '<{cmd}>'."
grass.exceptions
.
ScriptError
:
Unable to fetch interface description for command
''.
Details: <[Errno 2] No such file or directory:
'r.wtg.visibility'>

If i rename a script with .py, I can execute it from the menu 
File>execute script


I have two other Grass (7.9) on Debian Buster and it works fine...

The $GRASS_ADDON_BASE = /home/me/.grass7/addons
The $GRASS_ADDON_PATH = /home/me/.grass7/addons/scripts

Do you have any idea that problem ?

Thank you for your help.

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


Re: [GRASS-user] r.viewshed for multiple points

2020-11-25 Thread Frank David

Hello Bernardo,

I never use it, but the addon r.viewshed.cva should help you : 
https://grass.osgeo.org/grass78/manuals/addons/r.viewshed.cva.html


Regards,
Frank

Le 24/11/2020 à 22:56, Bernardo Santos a écrit :

Dear list,

I need to calculate a viewshed surface for multiple points (and have, 
in the end, a single surface of where any of those points can see). In 
fact this is to deal with the other way around: I want to know, in any 
position, if it is possible to see back to one of those points modeled.


r.viewshed seems to do the job, but for a single point at a time.
Is there any implementation doing this for multiple points, like a 
poit vector as input instead of a pair (x,y)?


Thank!
Best wishes
Bernardo



___
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] [GRASS-dev] 37 years of GRASS GIS: celebrating with a new GRASS GIS website!

2020-08-01 Thread Frank David
BRAVO pour ce nouveau site et votre formidable travail. Longue vie à 
GRASS GIS ! ;-)


Frank DAVID
www.geophom.fr
Le 30/07/2020 à 10:00, Paulo van Breugel a écrit :

Congratulations, absolutely looks great!

On July 29, 2020 4:04:09 PM Markus Neteler  wrote:


Wednesday, July 29, 2020

The new GRASS GIS website


The new GRASS GIS website is out!

In occasion of its *37th birthday the GRASS GIS project* is proud to 
present its *new website* <https://grass.osgeo.org>! The site has 
been redesigned with modern tools to be responsive and also easier to 
maintain. Content is more discoverable now and easy to browse too.



  What’s cool

  * The *Learn* <https://grass.osgeo.org/learn> page offers a curated
list of tutorials in different languages and links to videos. The
new Try online <https://grass.osgeo.org/learn/tryonline> section
provides links to Binder and rollApp online applications that
allow testing GRASS GIS without installing it.
  * Our long standing and *rich history*
<https://grass.osgeo.org/about/history> in the GIS and open
source world is now presented in a much more attractive layout.
Have a look at the timeline of /releases/
<https://grass.osgeo.org/about/history/releases> and /websites/
<https://grass.osgeo.org/about/history/web-evolution>!
  * The revamped *gallery of screenshots*
<https://grass.osgeo.org/learn/gallery> shows some of GRASS GIS
capabilities through visual examples.
  * Project resources easily reachable: mailing lists, wiki, RSS news
feed, the various GitHub and docker repositories.


  The technology

We chose a static format based on HUGO <https://gohugo.io/> and all 
the code and content is hosted in a dedicated repo 
<https://github.com/OSGeo/grass-website> in GitHub. *Nicolas Bozon* 
<http://cartogenic.com/> designed the website theme and many others 
helped with content curation and creation. In detail, the page 
content is now written in markdown. Several times a day the website 
is automatically deployed from the GitHub repository to our internet 
server at https://grass.osgeo.org/ .



  What’s next

With this new web technology and the availability of the code and 
content in a public repository, we want to *encourage and simplify 
community members’ participation*. If you want your GRASS GIS use 
cases, blog posts and cool screenshots to be part of if, you only 
need to create a pull request. No fear, we have a manual for 
contributions <https://grass.osgeo.org/about/theme/>.


We thank all the contributors for their input and help to see this 
project finally realized! Special thanks to OSGeo 
<https://www.osgeo.org/> as well as individuals 
<https://grasswiki.osgeo.org/wiki/Sponsors> for their financial support.


Stay tuned, there’s more yet to come!

___
grass-dev mailing list
grass-...@lists.osgeo.org <mailto:grass-dev%40lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-dev



___
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] fail to, compile on Buster

2020-03-31 Thread Frank David

Hi Markus,

Thank you for your reply.

Unfortunately I have no longer access to this laptop (my colleague is 
now at home because covid). But I've not seen error in the the configure 
return.


The command was :

CFLAGS="-Wall -Werror-implicit-function-declaration -fno-common -Wextra 
-Wunused" \
 CXXFLAGS="-Wall"  \
 ./configure \
  --prefix=/usr/local \
  --with-gdal --with-proj --with-proj-share=/usr/share \
  --with-glw --with-nls --with-readline \
  --with-cxx --enable-largefile \
  --with-freetype --with-freetype-includes=/usr/include/freetype2 \
  --with-sqlite --with-cairo --with-python=/usr/bin/python-config \
  --with-wxwidgets --with-geos \
  --with-blas --with-blas-includes=/usr/include/atlas/ \
  --with-lapack --with-lapack-includes=/usr/include/atlas/ \
  --with-netcdf=/usr/bin/nc-config --with-odbc=yes \
  --with-openmp=yes --with-pthread=no --with-postgres=yes \
  --with-postgres-includes=/usr/include/postgresql \
  --with-postgres-libs=/usr/lib/postgresql \
  --with-mysql=yes --with-mysql-includes=/usr/include/mysql

and I also tried the command in INSTALL file, but with the same message.

Anyway, I've installed Grass from Debian Buster repository (7.6), and it's 
enough for this laptop for the moment (at least until the end of covid crises).

Take care

Regards,
Frank

Le 30/03/2020 à 19:22, Markus Neteler a écrit :


Hi Frank,

On Sat, Mar 28, 2020 at 7:54 PM  wrote:

Hello,

I'm trying to install last release of grass (sources downloaded from
github) on a debian 10.3 (Laptop). I've followed the install steps of
https://grasswiki.osgeo.org/wiki/Compile_and_Install#GRASS_7_on_Debian_Buster
and also from install text file, and I always get :

can you post your "configure .. " command?

Do any errors show up?

Best
Markus


sudo make
include/Make/Vars.make:1: include/Make/Platform.make: Aucun fichier ou
dossier de ce type
make: *** Aucune règle pour fabriquer la cible
« include/Make/Platform.make ». Arrêt.

I have not seen error in the configure step... Any idea of the problem ?

Thanks,
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

[GRASS-user] fail to, compile on Buster

2020-03-28 Thread frank . david

Hello,

I'm trying to install last release of grass (sources downloaded from 
github) on a debian 10.3 (Laptop). I've followed the install steps of 
https://grasswiki.osgeo.org/wiki/Compile_and_Install#GRASS_7_on_Debian_Buster 
and also from install text file, and I always get :


sudo make
include/Make/Vars.make:1: include/Make/Platform.make: Aucun fichier ou 
dossier de ce type
make: *** Aucune règle pour fabriquer la cible 
« include/Make/Platform.make ». Arrêt.


I have not seen error in the configure step... Any idea of the problem ?

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

[GRASS-user] remove vect from gui

2020-01-20 Thread Frank David

Hello,

I cannot remove vector object and attribute data from the right-clic 
menu on attribute box in the gui (as I was used to do) with grass 7.9 
(on debian buster)


But "v.edit tool=delete map=mymap where="mycolum=myvalue" and db.execute 
"sql=DELETE FROM mymap WHERE mycolomn = myvalue" work fine.


Is there any trick here ?

Thanks

Frank

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

Re: [GRASS-user] no more gui after upgrade to buster

2020-01-11 Thread Frank David

Done.

Thanks

Frank

Le 11/01/2020 à 18:51, Markus Neteler a écrit :

Could you open a ticket here?
https://trac.osgeo.org/grass

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

Re: [GRASS-user] no more gui after upgrade to buster

2020-01-11 Thread Frank David

Markus,

I've installed needed packages for garss 7.8 included python3-wxgtk4. 
libmaria does not exist but libmaria3


_Configuration has return :_

  BLAS support:   yes
  BZIP2 support:  no
  C++ support:    yes
  Cairo support:  yes
  DWG support:    no
  FFTW support:   yes
  FreeType support:   yes
  GDAL support:   yes
  GEOS support:   yes
  LAPACK support: yes
  Large File support (LFS):   yes
  libLAS support: no
  MySQL support:  yes
  NetCDF support: yes
  NLS support:    yes
  ODBC support:   yes
  OGR support:    yes
  OpenCL support: no
  OpenGL support: yes
  OpenMP support: yes
  PDAL support:   no
  PNG support:    yes
  POSIX thread support:   no
  PostgreSQL support: yes
  Readline support:   yes
  Regex support:  yes
  SQLite support: yes
  TIFF support:   yes
  X11 support:    no
  Zstandard support:  yes

  using new PROJ 5+ API

---

Compile & install ok

The gui is working.

BUT my scripts does not work any more. See belows errors :

Traceback (most recent call last):
  File "/usr/local/grass78/gui/wxpython/gui_core/forms.py",
line 2866, in ParseCommand

blackList=_blackList)
  File "/usr/local/grass78/etc/python/grass/script/task.py",
line 522, in parse_interface

tree = etree.fromstring(get_interface_description(name))
  File "/usr/local/grass78/etc/python/grass/script/task.py",
line 498, in get_interface_description

"\n\nDetails: <{det}>").format(cmd=cmd, det=decode(cmderr)))
grass.exceptions
.
ScriptError
:
Unable to fetch interface description for command
''.
Details: 
    from grass.pygrass.utils import set_path
  File
"/usr/local/grass78/etc/python/grass/pygrass/utils.py", line
7, in 
    import grass.lib.gis as libgis
  File "/usr/local/grass78/etc/python/grass/lib/gis.py",
line 4
SyntaxError: Non-ASCII character '\xc3' in file
/usr/local/grass78/etc/python/grass/lib/gis.py on line 5,
but no encoding declared; see
http://python.org/dev/peps/pep-0263/ for details
>
During handling of the above exception, another exception
occurred:
Traceback (most recent call last):
  File "/usr/local/grass78/gui/wxpython/core/gconsole.py",
line 493, in RunCmd

task = GUI(show=None).ParseCommand(command)
  File "/usr/local/grass78/gui/wxpython/gui_core/forms.py",
line 2868, in ParseCommand

raise gcmd.GException(e.value)
core.gcmd
.
GException
:
Unable to fetch interface description for command
''.
Details: 
    from grass.pygrass.utils import set_path
  File
"/usr/local/grass78/etc/python/grass/pygrass/utils.py", line
7, in 
    import grass.lib.gis as libgis
  File "/usr/local/grass78/etc/python/grass/lib/gis.py",
line 4
SyntaxError: Non-ASCII character '\xc3' in file
/usr/local/grass78/etc/python/grass/lib/gis.py on line 5,
but no encoding declared; see
http://python.org/dev/peps/pep-0263/ for details
>
During handling of the above exception, another exception
occurred:
Traceback (most recent call last):
  File "/usr/local/grass78/gui/wxpython/gui_core/prompt.py",
line 413, in OnKeyPressed

self._runCmd(self.GetCurLine()[0].strip())
  File "/usr/local/grass78/gui/wxpython/gui_core/prompt.py",
line 120, in _runCmd

self.promptRunCmd.emit(cmd=cmd)
  File
"/usr/local/grass78/etc/python/grass/pydispatch/signal.py",
line 229, in emit

dispatcher.send(signal=self, *args, **kwargs)
  File "/usr/local/grass78/etc/python/grass/pydispatch/dispa
tcher.py", line 349, in send

**named
  File "/usr/local/grass78/etc/python/grass/pydispatch/robus
tapply.py", line 60, in robustApply

return receiver(*arguments, **named)
  File
"/usr/local/grass78/gui/wxpython/gui_core/goutput.py", line
120, in 

self._gconsole.RunCmd(command=cmd))
  File "/usr/local/grass78/gui/wxpython/core/gconsole.py",
line 496, in RunCmd

message=unicode(e),
NameError
:
name 'unicode' is not defined



If I add *# -*- coding:UTF-8 -*-* on first line in 
/usr/local/grass78/etc/python/grass/lib/gis.py and 
/usr/local/grass78/etc/python/grass/lib/raster.py my scripts work !


Is-it the good fix ??

Thank you for your help.

Regards

Frank


Le 11/01/2020 à 17:19, Markus Neteler a écrit :

On Sat, Jan 11, 2020 at 4:51 PM Frank David  wrote:

Hi,

Yes why not. Is the installation procedure is same than stretch ?

I guess it will be the same/similar (I am more Fedora focused but
others here will know).


Is Python3 support will not make problems with my Python2 scripts ? and what to 
do to avoid in that case ?

The Python package "python3-dev[el]" contains a `2to3` script t

Re: [GRASS-user] no more gui after upgrade to buster

2020-01-11 Thread Frank David

Hi,

Yes why not. Is the installation procedure is same than stretch ? Is 
Python3 support will not make problems with my Python2 scripts ? and 
what to do to avoid in that case ?


Do I follow this ? > 
https://grasswiki.osgeo.org/wiki/Compile_and_Install#GRASS_7_on_Debian_Stretch


Thank you

Le 10/01/2020 à 21:01, Markus Neteler a écrit :

Hi,

any chance that you update to the much more modern GRASS GIS 7.8?

Best
Markus

On Thu, Jan 9, 2020 at 6:05 PM Frank David  wrote:

Hello all,

I have no more gui on grass 7.6 after upgrade from debian strech to buster.

Thank you for your help !

Regards

Frank

See below last errors :

Traceback (most recent call last):
   File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 169, in 
 sys.exit(main())
   File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 156, in main
 app = GMApp(workspaceFile)
   File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 50, in __init__
 wx.App.__init__(self, False)
   File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 8628, 
in __init__
 self._BootstrapApp()
   File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 8196, 
in _BootstrapApp
 return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 103, in OnInit
 workspace=self.workspaceFile)
   File "/usr/local/grass-7.6.0/gui/wxpython/lmgr/frame.py", line 142, in 
__init__
 self.notebook = self._createNoteBook()
   File "/usr/local/grass-7.6.0/gui/wxpython/lmgr/frame.py", line 337, in 
_createNoteBook
 gcstyle=GC_PROMPT)
   File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/goutput.py", line 118, in 
__init__
 self.cmdPrompt = GPromptSTC(parent=self, menuModel=self._menuModel)
   File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 139, in 
__init__
 GPrompt.__init__(self, parent=parent, menuModel=menuModel)
   File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 57, in 
__init__
 self.mapList = self._getListOfMaps()
   File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 101, in 
_getListOfMaps
 result['raster'] = grass.list_strings('raster')
   File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 1252, in 
list_strings
 mapset=mapset).splitlines():
   File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 478, in 
read_command
 return handle_errors(returncode, stdout, args, kwargs)
   File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 334, in 
handle_errors
 returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['g.list', '--q', '-m', 
'type=raster'] ended with error
Process ended with non-zero return code 127. See errors in the (error) output.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
   File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
 func(*targs, **kargs)
PyAssertionError: C++ assertion "GetEventHandler() == this" failed at 
../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have 
been removed
Error in sys.exitfunc:
Traceback (most recent call last):
   File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
 func(*targs, **kargs)
wx._core.PyAssertionError: C++ assertion "GetEventHandler() == this" failed at 
../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have 
been removed

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




--
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] no more gui after upgrade to buster

2020-01-09 Thread Frank David

Hello all,

I have no more gui on grass 7.6 after upgrade from debian strech to buster.

Thank you for your help !

Regards

Frank

See below last errors :

Traceback (most recent call last):
  File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 169, in 


    sys.exit(main())
  File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 156, in main
    app = GMApp(workspaceFile)
  File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 50, in __init__
    wx.App.__init__(self, False)
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 
8628, in __init__

    self._BootstrapApp()
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx/_core.py", line 
8196, in _BootstrapApp

    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/usr/local/grass-7.6.0/gui/wxpython/wxgui.py", line 103, in OnInit
    workspace=self.workspaceFile)
  File "/usr/local/grass-7.6.0/gui/wxpython/lmgr/frame.py", line 142, 
in __init__

    self.notebook = self._createNoteBook()
  File "/usr/local/grass-7.6.0/gui/wxpython/lmgr/frame.py", line 337, 
in _createNoteBook

    gcstyle=GC_PROMPT)
  File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/goutput.py", line 
118, in __init__

    self.cmdPrompt = GPromptSTC(parent=self, menuModel=self._menuModel)
  File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 
139, in __init__

    GPrompt.__init__(self, parent=parent, menuModel=menuModel)
  File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 
57, in __init__

    self.mapList = self._getListOfMaps()
  File "/usr/local/grass-7.6.0/gui/wxpython/gui_core/prompt.py", line 
101, in _getListOfMaps

    result['raster'] = grass.list_strings('raster')
  File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 
1252, in list_strings

    mapset=mapset).splitlines():
  File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 
478, in read_command

    return handle_errors(returncode, stdout, args, kwargs)
  File "/usr/local/grass-7.6.0/etc/python/grass/script/core.py", line 
334, in handle_errors

    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['g.list', '--q', 
'-m', 'type=raster'] ended with error
Process ended with non-zero return code 127. See errors in the (error) 
output.

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
PyAssertionError: C++ assertion "GetEventHandler() == this" failed at 
../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event 
handlers must have been removed

Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
wx._core.PyAssertionError: C++ assertion "GetEventHandler() == this" 
failed at ../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed 
event handlers must have been removed


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

[GRASS-user] split vector entity

2019-12-06 Thread Frank David

Hello,

I get a vector data with several polygons. I can't select one by one, 
all are selected at the same time. How can I separate into different 
entities (one by polygon) in order to connect each polygon to an 
attribute table record ?


Regards,

Frank

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

[GRASS-user] read null cell with python

2019-05-31 Thread Frank DAVID

Hello,

I'm writing a script where i need to read rasters to get cells values. 
I'm using :


a  =  garray.array()
a.read(map)

It seems that null cells are read as 0.0 How to make the difference with 
zero ?


I'm using Grass 7.6.1 on Linux Debian9

Thanks for your help

Frank

___
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-31 Thread Frank David

Hello,

I d'ont know how to do so, and my english is not very fluent... :-/

If someone write something about min/max_raster it could be useful to 
inform that it's the output is the index of first min/max meet. Because 
the order of input raster make outpout different shape in case of equal 
min/max values in different input rasters and it's a bit confusing at first


Cheers,

Frank

Le 27/05/2019 à 16:43, Markus Neteler a écrit :


On Mon, May 27, 2019 at 4:22 PM Frank David  wrote:

Hello,


Thank you very much Vero and Micha, It's exactly what I was looking for ! 
That's great !

Please consider to write up a small example for the manual page and/or
the Wiki as it is of interest to many.

thanks
Markus
___
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-27 Thread Frank David

Hello,


Thank you very much Vero and Micha, It's exactly what I was looking for 
! That's great !



Cheers,

Frank


Le 26/05/2019 à 12:11, Micha Silver a écrit :


On 26/05/2019 7:02, Veronica Andreo wrote:

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



Hello Frank:


I used Vero's suggestion in a script I was working on some months ago: 
I had a list of rasters, each represented a "station_id". I used 
g.list to create the list of raster names, and fed that into r.series 
input= method=max_raster.


Then I used r.reclass to get back the station_id from the list index. 
I had a text file with matches between the index of the raster in the 
list, and it's actual "station_id". So r.reclass returned a raster 
with each pixel value being the station_id of the maximum raster in 
the list.


HTH




Thank you

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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

--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

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

2019-05-25 Thread Frank David

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 ?

Thank you

Frank

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

Re: [GRASS-user] sqrt sql

2019-03-08 Thread Frank David

Thank you very much Vero !

Frank

Le 08/03/2019 à 11:10, Veronica Andreo a écrit :

Hi

functionalities like sqrt() or log() are not available in base SQLite, 
then you have to install an extension


See v.db.update manual page and this wiki: 
https://grasswiki.osgeo.org/wiki/Build_SQLite_extension_on_Linux


HTH,
Vero



El vie., 8 mar. 2019 05:22, Frank David <mailto:frank.da...@geophom.fr>> escribió:


Hello,

How Is it possible to calculate a sqrt from attribut fields to fill
another field, like :

v.db.update map=myvector column=field2 query_column=sqrt(field1)

Or is there any trick ?

Thank you

Frank
___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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] sqrt sql

2019-03-08 Thread Frank David

Hello,

How Is it possible to calculate a sqrt from attribut fields to fill 
another field, like :


v.db.update map=myvector column=field2 query_column=sqrt(field1)

Or is there any trick ?

Thank you

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

Re: [GRASS-user] get the shifted minimum from a raster series

2019-02-16 Thread Frank David

Hi Micha,


Thank you for your email. Your script is very interesting, but I think I 
cannot use it because:


1- you make a sum of your viewshed list, and each viewshed value is 0 or 
1 (hidden or visible). But my problem is with viewshed values from 0 
upto 250 (for each viewshed this is the hidden height from a viewpoint). 
So make a sum has no sens.


2- you search the pourcent of visible terrain from all viewpoints, and I 
want find pourcent of viewpoints able to see terrain (actually to not 
see the maximum hidden height above terrain)


Tell me if I'm wrong...


I wrote a script with garray.array() which read the value for each 
specific x,y cell coordinates from all viewshed rasters, create a list 
of data, sort that list, and get the shifted min (according to my 
tolerance, for example 80% of 100 viewpoints get the twentieth smallest 
value). In that way Each cell of my output raster give the hidden height 
from 80% of my viewpoints. The script is working, but I believe that 
adding this function in r.series could be useful.



Cheers,

Frank


Le 15/02/2019 à 15:52, Micha Silver a écrit :


Hello Frank:


On 2/7/19 3:16 PM, Frank David wrote:


I forgot one thing to well understand my wish. Each viewshed raster 
is a r.series (250-sum) of 250 r.viewshed with 2m target and 0 upto 
250m terrain height. So each raster gives the hidden height of a 
building (250m max) anywhere on the region from a specific point of 
view. The purpose is to get the area of hidden wind turbine from 
roads for a specific wind turbine height.


Cheers,

Frank



A friend and I were working on an idea some months ago that might be 
of interest. Not the same as your project but the method I used is 
similar.



The search and rescue teams here are interested to see what areas were 
actually visible after they finish searching along a certain route, 
and what areas were not seen at all. I used the same approach as you, 
creating a series of overlapping r.viewshed intermediate rasters.



After seeing your post, I have added new input parameters for minimum 
and maximum values of overlap. The user can enter percents of minimum 
or maximum viewshed overlaps. Suppose I put in 20 as the minimum, then 
only those pixels with at least 20% of the total number of viewsheds 
will be shown. Similarly, if I enter 80 as the maximum, then only 
those pixels with less than 80% of the maximum number of viewsheds 
will appear in the final raster.



If you are on Gitlab, you can clone the files: No documentation yet :-(

https://gitlab.com/tsvibar/route_viewshed


If you do adopt any of this script, I'd appreciate to hear of any bugs 
or suggestions for improvement. If the script raises any interest, 
I'll add it to the Addons.



Regards,

Micha



Le 07/02/2019 à 12:48, Frank David a écrit :


Hi,

Thanks for your reply. I can have numerous raster (several 
hundreds). I want to find a minimum but with a tolerance, it's why I 
want to be able to shift the value. In fact I want to sort the value 
of my all input raster for each x,y cell and get the second or 
third, or any position in the sorted list, to build my output 
raster. My application is to get the area not visible from a road (I 
did 1600 viewshed raster from the roads every 250m). I want a 
tolerance in order that one point of view (top of hill) does not 
reduce too much the hidden area. To do so, a fixed number of my 
point of view (20%) does not reduce the hidden area. The result is 
the area is hidden from 80% of the road.


I already wrote a python script that read all rasters for each x,y 
cell and make a array(), sort the array values, and build a raster. 
It works on reasonable number of cell, but seems to fails with large 
number of cells. I'm not a programmer !


I wondered if this kind of treatment exists already in Grass.

If somebody wants to hemps me to develop this, I could be nice. But 
I think it could be an improvement of r.series function.


Sorry for my bad english, I hope you have understand my wishes !

Cheers

Frank

Le 07/02/2019 à 12:04, Veronica Andreo a écrit :

Hi Ken,

There isn't any build-in function for that in grass, afaik. 
Depending on how long is your series, you could shift the map list 
you use in each run and then use r.univar on each output from 
r.series to get the minimum and by comparison, get the second 
minimum of the series of maps (a scalar).


However, if what you need is a map of second minimums per pixel, I 
believe that might require some programming for a new function... 
Do you know any other software which has this function? Maybe, if 
there's such thing in Python for example, it could be recycled or 
used with grass maps in a script... Dunno, just thinking out loud


best,
Vero

El jue., 7 feb. 2019 07:16, Ken Mankoff <mailto:mank...@gmail.com>> escribió:


Hi Frank,

On 2019-02-07 at 08:27 +0100, Frank David
mailto:frank.da...@geophom.fr>>
wrote...
> I try to find how to get the shi

Re: [GRASS-user] get the shifted minimum from a raster series

2019-02-07 Thread Frank David
I forgot one thing to well understand my wish. Each viewshed raster is a 
r.series (250-sum) of 250 r.viewshed with 2m target and 0 upto 250m 
terrain height. So each raster gives the hidden height of a building 
(250m max) anywhere on the region from a specific point of view. The 
purpose is to get the area of hidden wind turbine from roads for a 
specific wind turbine height.


Cheers,

Frank

Le 07/02/2019 à 12:48, Frank David a écrit :


Hi,

Thanks for your reply. I can have numerous raster (several hundreds). 
I want to find a minimum but with a tolerance, it's why I want to be 
able to shift the value. In fact I want to sort the value of my all 
input raster for each x,y cell and get the second or third, or any 
position in the sorted list, to build my output raster. My application 
is to get the area not visible from a road (I did 1600 viewshed raster 
from the roads every 250m). I want a tolerance in order that one point 
of view (top of hill) does not reduce too much the hidden area. To do 
so, a fixed number of my point of view (20%) does not reduce the 
hidden area. The result is the area is hidden from 80% of the road.


I already wrote a python script that read all rasters for each x,y 
cell and make a array(), sort the array values, and build a raster. It 
works on reasonable number of cell, but seems to fails with large 
number of cells. I'm not a programmer !


I wondered if this kind of treatment exists already in Grass.

If somebody wants to hemps me to develop this, I could be nice. But I 
think it could be an improvement of r.series function.


Sorry for my bad english, I hope you have understand my wishes !

Cheers

Frank

Le 07/02/2019 à 12:04, Veronica Andreo a écrit :

Hi Ken,

There isn't any build-in function for that in grass, afaik. Depending 
on how long is your series, you could shift the map list you use in 
each run and then use r.univar on each output from r.series to get 
the minimum and by comparison, get the second minimum of the series 
of maps (a scalar).


However, if what you need is a map of second minimums per pixel, I 
believe that might require some programming for a new function... Do 
you know any other software which has this function? Maybe, if 
there's such thing in Python for example, it could be recycled or 
used with grass maps in a script... Dunno, just thinking out loud


best,
Vero

El jue., 7 feb. 2019 07:16, Ken Mankoff <mailto:mank...@gmail.com>> escribió:


Hi Frank,

On 2019-02-07 at 08:27 +0100, Frank David mailto:frank.da...@geophom.fr>>
wrote...
> I try to find how to get the shifted minimum value of a series of
> raster map. I want to shift by one, or more, the "minimum"
value found
> on each cell to get the "almost minimum" of the series. Is there an
> available function/method to do that ?

I don't think I fully understand what you want. Are you working
with strds? You mention "series". If I wanted to get the
second-minimum of a single raster, I would use r.stats with the
"-1" flag, sort, and search for the 2nd (or 2nd-to-last).

  -k.

___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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] get the shifted minimum from a raster series

2019-02-07 Thread Frank David

Hi,

Thanks for your reply. I can have numerous raster (several hundreds). I 
want to find a minimum but with a tolerance, it's why I want to be able 
to shift the value. In fact I want to sort the value of my all input 
raster for each x,y cell and get the second or third, or any position in 
the sorted list, to build my output raster. My application is to get the 
area not visible from a road (I did 1600 viewshed raster from the roads 
every 250m). I want a tolerance in order that one point of view (top of 
hill) does not reduce too much the hidden area. To do so, a fixed number 
of my point of view (20%) does not reduce the hidden area. The result is 
the area is hidden from 80% of the road.


I already wrote a python script that read all rasters for each x,y cell 
and make a array(), sort the array values, and build a raster. It works 
on reasonable number of cell, but seems to fails with large number of 
cells. I'm not a programmer !


I wondered if this kind of treatment exists already in Grass.

If somebody wants to hemps me to develop this, I could be nice. But I 
think it could be an improvement of r.series function.


Sorry for my bad english, I hope you have understand my wishes !

Cheers

Frank

Le 07/02/2019 à 12:04, Veronica Andreo a écrit :

Hi Ken,

There isn't any build-in function for that in grass, afaik. Depending 
on how long is your series, you could shift the map list you use in 
each run and then use r.univar on each output from r.series to get the 
minimum and by comparison, get the second minimum of the series of 
maps (a scalar).


However, if what you need is a map of second minimums per pixel, I 
believe that might require some programming for a new function... Do 
you know any other software which has this function? Maybe, if there's 
such thing in Python for example, it could be recycled or used with 
grass maps in a script... Dunno, just thinking out loud


best,
Vero

El jue., 7 feb. 2019 07:16, Ken Mankoff <mailto:mank...@gmail.com>> escribió:


Hi Frank,

On 2019-02-07 at 08:27 +0100, Frank David mailto:frank.da...@geophom.fr>>
wrote...
> I try to find how to get the shifted minimum value of a series of
> raster map. I want to shift by one, or more, the "minimum" value
found
> on each cell to get the "almost minimum" of the series. Is there an
> available function/method to do that ?

I don't think I fully understand what you want. Are you working
with strds? You mention "series". If I wanted to get the
second-minimum of a single raster, I would use r.stats with the
"-1" flag, sort, and search for the 2nd (or 2nd-to-last).

  -k.

___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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] get the shifted minimum from a raster series

2019-02-07 Thread Frank David

Hello,

I try to find how to get the shifted minimum value of a series of raster 
map. I want to shift by one, or more, the "minimum" value found on each 
cell to get the "almost minimum" of the series. Is there an available 
function/method to do that ?


Thank you for your help

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

Re: [GRASS-user] ascii decode special character

2019-01-03 Thread Frank David

Hi Vero,

Ok for updating.

Concerning the problem of special character in units (kilometer) scale 
bar, we already had a post about that, and encoding in ISO-8859-1 does 
not change anything about that (but solve the problem in text string 
from user). I think the problem comes from grass code...


I met the same problem with v.label.

Cheers,

Frank

Le 03/01/2019 à 12:16, Veronica Andreo a écrit :

Hi Frank,

Good that you solved it :)

In any case, I would recommend you to update your grass version. There 
have been quite some changes since August last year in trunk (Dev 
version).


Moreover, I think the ps.map issue could be solved by saving the psmap 
instructions with a different encoding, no need to change language 
because of that. Check the last paragraph under Notes in the manual [0].


HTH,
Vero

[0] https://grass.osgeo.org/grass77/manuals/ps.map.html

El jue., 3 ene. 2019 6:45, Frank David <mailto:frank.da...@geophom.fr>> escribió:


Hi Markus,



Hi Frank,


Am Mi., 2. Jan. 2019, 16:56 hat Frank David
mailto:frank.da...@geophom.fr>> geschrieben:

Hello all,

I wish a very nice year to every GRASS user and also for GRASS
developments !


Happy New Year!

I met a decoding problem with "v.db.select map=my_vector
columns=my_name" when GRASS meet some special characters in
the string
of my_name field. The string value is "Côte de la Bouchère".

See below the error message :

Traceback (most recent call last):
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 472, in OnCmdOutput

self.cmdOutput.AddStyledMessage(message, type)
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 771, in AddStyledMessage

self.AddTextWrapped(message, wrap=None)
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 722, in AddTextWrapped

self.AddText(txt)
   File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/stc.py", line 2041, in AddText

return _stc.StyledTextCtrl_AddText(*args, **kwargs)
UnicodeDecodeError
:
'ascii' codec can't decode byte 0xc3 in position 1: ordinal
not in range(128)
(Wed Jan  2 16:40:24 2019) Command finished (0 sec)

Is there anybody who know how I can solve this ? (with GRASS
v7.5 on
debian9)


Could you please send the precise version? It looks a bit dated.

g.version -g

?


version=7.5.svn
date=2018
revision=r
build_date=2018-08-10
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8

But I was in en language. If I set in system (or french), it works!

In fact, I'm using sometimes English GUI because the scale bar
text in psmap is not well coded and is displayed kilomÄ"tre, in
english kilometer.

anyway, english GUI should handled special character isn't it ?

Best regards,

Frank


Best
Markus


___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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] ascii decode special character

2019-01-03 Thread Frank David

Hi Markus,



Hi Frank,


Am Mi., 2. Jan. 2019, 16:56 hat Frank David <mailto:frank.da...@geophom.fr>> geschrieben:


Hello all,

I wish a very nice year to every GRASS user and also for GRASS
developments !


Happy New Year!

I met a decoding problem with "v.db.select map=my_vector
columns=my_name" when GRASS meet some special characters in the
string
of my_name field. The string value is "Côte de la Bouchère".

See below the error message :

Traceback (most recent call last):
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 472, in OnCmdOutput

self.cmdOutput.AddStyledMessage(message, type)
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 771, in AddStyledMessage

self.AddTextWrapped(message, wrap=None)
   File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 722, in AddTextWrapped

self.AddText(txt)
   File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/stc.py", line 2041, in AddText

return _stc.StyledTextCtrl_AddText(*args, **kwargs)
UnicodeDecodeError
:
'ascii' codec can't decode byte 0xc3 in position 1: ordinal
not in range(128)
(Wed Jan  2 16:40:24 2019) Command finished (0 sec)

Is there anybody who know how I can solve this ? (with GRASS v7.5 on
debian9)


Could you please send the precise version? It looks a bit dated.

g.version -g

?


version=7.5.svn
date=2018
revision=r
build_date=2018-08-10
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8

But I was in en language. If I set in system (or french), it works!

In fact, I'm using sometimes English GUI because the scale bar text in 
psmap is not well coded and is displayed kilomÄ"tre, in english kilometer.


anyway, english GUI should handled special character isn't it ?

Best regards,

Frank


Best
Markus

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

[GRASS-user] ascii decode special character

2019-01-02 Thread Frank David

Hello all,

I wish a very nice year to every GRASS user and also for GRASS 
developments !


I met a decoding problem with "v.db.select map=my_vector 
columns=my_name" when GRASS meet some special characters in the string 
of my_name field. The string value is "Côte de la Bouchère".


See below the error message :

Traceback (most recent call last):
  File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 472, in OnCmdOutput

self.cmdOutput.AddStyledMessage(message, type)
  File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 771, in AddStyledMessage

self.AddTextWrapped(message, wrap=None)
  File
"/usr/local/grass-7.5.svn/gui/wxpython/gui_core/goutput.py",
line 722, in AddTextWrapped

self.AddText(txt)
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/stc.py", line 2041, in AddText

return _stc.StyledTextCtrl_AddText(*args, **kwargs)
UnicodeDecodeError
:
'ascii' codec can't decode byte 0xc3 in position 1: ordinal
not in range(128)
(Wed Jan  2 16:40:24 2019) Command finished (0 sec)

Is there anybody who know how I can solve this ? (with GRASS v7.5 on 
debian9)


Cheers,

Frank

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

Re: [GRASS-user] Attribute Table - Change Data Type from String to Double

2018-12-16 Thread Frank David

Hi,

Use dot as decimal separator instead of comma.

Regards

Frank


Le 17/12/2018 à 04:04, Francois Chartier a écrit :
Solution found - i had some text left in the column and Grass 
automatically detected it and assigned a Data Type of String.


Le dim. 16 déc. 2018 à 21:16, Francois Chartier 
mailto:fra.chart...@gmail.com>> a écrit :


Hi,

I am importing a csv file and my property column which is are
numbers with decimals, is defined as a String.  How can i change
this to a Double?

Thanks
F



Virus-free. www.avast.com






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


--
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] map calculator in python loop

2018-12-12 Thread Frank David

Hi,

What do you want to do with "k" ?

Can you send what return gscript.verbose(( " %s = %s * %s ")  % (r , r , c))

Frank
Le 12/12/2018 à 17:34, Alessandro Sebastiani a écrit :
I get the same error after trying with your suggestion! I tried to 
define rasters in different ways, like

>> c = ["costante"] ,
but nothing seems to change

Il giorno mer 12 dic 2018 alle ore 10:22 Moritz Lennert 
mailto:mlenn...@club.worldonline.be>> 
ha scritto:


On 12/12/18 12:59, Alessandro Sebastiani wrote:
> dear all,
> i'm dealing this time with r.mapcalc. I have different rasters
which i
> grouped using g.list.
> Now r_list contains all my raster. I want to multiply those
rasters to
> another raster (called "costante")  in order to obtain a new
map, that i
> want to call as r followed by the letter "k"
> Here it is what i've done:
> import grass.script as gscript
>  >>> r_list = gscript.read_command("g.list" , type = "rast"
> ).strip().split("\n")
>  >>> c = " costante"
>  >>> for r in r_list:
>  >>>     gscript.mapcalc ( " %s = %s * %s "  % ((r+"k") , r , c))

Try

" %sk = %s * %s "  % (r , r , c) "

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] buffer to wrap points

2018-11-29 Thread Frank David

Thank you,

Yes, actually it was what I was looking for...

Regards,

Frank

Le 29/11/2018 à 13:40, Daniel Victoria a écrit :

Or are you looking at a way to wrap all points? Like v.hull [1]
There is also an addon for concave hull [2]

Cheers

[1] - https://grass.osgeo.org/grass74/manuals/v.hull.html
[2] - https://grass.osgeo.org/grass74/manuals/addons/v.concave.hull.html

On Thu, Nov 29, 2018 at 10:10 AM Ken Mankoff <mailto:mank...@gmail.com>> wrote:


Hi Frank,

On 2018-11-29 at 12:46 +0100, Frank David mailto:frank.da...@geophom.fr>> wrote:
> I did not find in v.buffer the way to create a common buffer on
points
> if I want the buffer wraps all my points. Is there any tricks ?

Can you explain what you did and what happened and what you
expected to happen? There is a section in the v.buffer man page
"Circles around input points" that provides an example. Does this
work for you?

  -k.
___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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

[GRASS-user] buffer to wrap points

2018-11-29 Thread Frank David

Hello all,

I did not find in v.buffer the way to create a common buffer on points 
if I want the buffer wraps all my points. Is there any tricks ?


Thanks in advance.

Cheers

Frank

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

Re: [GRASS-user] edit vector with wxGUI

2018-11-22 Thread Frank David

Le 21/11/2018 à 19:58, Rich Shepard a écrit :

On Wed, 21 Nov 2018, Frank David wrote:


it's mostly to move the points that I need. It's a shame because the
interface could be useful if it was functional.


Frank,

  The GUI is functional; we just need to learn how it functions. :-)

  Moving points are the same. Select one, move it, save, and reload 
the GUI.

The point should now be seen in its new position.

  I have had more trouble trying to use v.edit. I also find that 
wx.gui.psmap
is good for initial layout but I need to finish the map manually in 
emacs.


  In the 1990s there was no GUI; eveything was done on the command 
line. To
a high degree, adding Python and wxPython not only made using grass 
easier
and quicker in some ways but it also opened it to many other users who 
fear

the command line like a contagious disease. The developers of the various
graphical assistants had/have a vision of how it works that might not 
match

every user's expectation of how it should work. So, we play with them and
ask on the mail list and soon they all become (excuse me) "intuitive."

Regards,

Rich


Rich,

I may be do not understand how you save and reload the gui ?. See below 
how I did :


1- I set the layer in edit mod.
2- I push the vertex move button on the gui toolbar
3- I left click on my point (it becomes yellow)
4- I right click on the map where I want to move my point (the point 
does not move)

5- I quit the layer edit mod and validate the saving box
6- I set again my layer in edit mod, but nothing has changed...

I do not see where I'm wrong...

Concerning shell command, I totally agree with you and it's why I'm 
working on Linux (only) for the past 15 years...The shell command, and 
all available tools within shell, are so powerful than I can't imagine 
computer without shell !. But sometimes, for me, or for me colleagues, 
using a GUI is a faster way when you do not practice so much a software.


Regards,

Frank

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

Re: [GRASS-user] edit vector with wxGUI

2018-11-21 Thread Frank David

Le 21/11/2018 à 18:42, Rich Shepard a écrit :

On Wed, 21 Nov 2018, Frank David wrote:


I can not use the vector editing interface wxGUI, especially for moving
and deleting points. I set the layer in edition mode. I can add points,
but cannot move or delete them. The GUI button looks like line vertex
edition rather than isolated point. Thank you for your help. Regards,


Frank,

  It takes a while to figure out just how to edit vector maps with the 
GUI.

What I do is select a bunch of points to delete, save and close the GUI,
then re-open it. The points are gone. This with 7.7.svn. My 
experiences with
it have done what I needed even though the process was not as simple 
as it

could be.

  Play with it and you'll find a rhythm that works for what you need 
to do.


Regards,

Rich


Thanks Rich,

it's mostly to move the points that I need. It's a shame because the 
interface could be useful if it was functional. Cheers, Frank




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

[GRASS-user] edit vector with wxGUI

2018-11-21 Thread Frank David

Hello all,

I can not use the vector editing interface wxGUI, especially for moving 
and deleting points. I set the layer in edition mode. I can add points, 
but cannot move or delete them. The GUI button looks like line vertex 
edition rather than isolated point. Thank you for your help. Regards, Frank


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

Re: [GRASS-user] ps.map read

2018-11-13 Thread Frank David

Hi all,

I reply to myself.

In psmap file, "read" instruction should be placed at the end of the 
file, and the "end" instruction in the read file itself.


This makes possible to create ps and pdf in a shell loop and avoid 
ERREUR message.


Cheers

Frank


Le 07/11/2018 à 18:28, Frank David a écrit :

Hello all,

If I use  instruction inside my psmap file the command > ps.map 
input=myfile.psmap output=myfile.ps does not work and the exit message 
is :


enter 'help' for help, 'end' when done, 'exit' to quit

But if I execute inside a shell loop, like > ls 01*.psmap |while read 
fic;do ps.map input="${fic}" output="${fic%.*}.ps" --overwrite;done it 
works! But I cannot run multiple ps.map with ls *.psmap. The error 
message is :


ERREUR :myfile.psmap : illegal request

If I comment  instruction with # inside my psmap. everything is 
working.


I have put my  just before the last  instruction. The read 
file contains only a v.points layer.


Using a  is very powerfull, but ps.map in a shell loop is also 
very usefull... to be able to do both would be ideal !


Thanks for your tricks if any

Cheers,

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

[GRASS-user] ps.map read

2018-11-07 Thread Frank David

Hello all,

If I use  instruction inside my psmap file the command > ps.map 
input=myfile.psmap output=myfile.ps does not work and the exit message is :


enter 'help' for help, 'end' when done, 'exit' to quit

But if I execute inside a shell loop, like > ls 01*.psmap |while read 
fic;do ps.map input="${fic}" output="${fic%.*}.ps" --overwrite;done it 
works! But I cannot run multiple ps.map with ls *.psmap. The error 
message is :


ERREUR :myfile.psmap : illegal request

If I comment  instruction with # inside my psmap. everything is 
working.


I have put my  just before the last  instruction. The read 
file contains only a v.points layer.


Using a  is very powerfull, but ps.map in a shell loop is also 
very usefull... to be able to do both would be ideal !


Thanks for your tricks if any

Cheers,

Frank

___
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-11-06 Thread Frank David


Le 05/11/2018 à 14:23, Frank David a écrit :


Le 02/11/2018 à 22:27, Markus Metz a écrit :



On Fri, Nov 2, 2018 at 6:32 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> Le 02/11/2018 à 14:43, Markus Metz a écrit :
>
>
>
> On Fri, Nov 2, 2018 at 11:58 AM Frank David <mailto:frank.da...@geophom.fr>> wrote:

> >
> > Le 31/10/2018 à 20:57, Markus Metz a écrit :
> >
> > Hi Frank,
> >
> > On Wed, Oct 31, 2018 at 1:39 PM Frank David 
mailto:frank.da...@geophom.fr>> wrote:

> > >
> > > 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...

> >
> > this kind of operation could be much faster in latest GRASS 7.4 
than in any previous versions. Which GRASS version are you using?

> >
> > Hello Markus,
> >
> > I'm using 7.4.1 on debian9
> >
> > But my grass db folder  is on a small server (Synology NAS), so 
may be the network makes slow down the operation ?

>
> This is possible, but it should not slow it down that much: 10 min 
vs 1 hour

>
> Can you provide a link to the vector from which you want to extract 
a small area, and the command you used to extract a small area? Maybe 
there is scope for optimization.

>
> Markus,
>
> The data is CorineLandCover for france. You can download 400mo here 
> https://we.tl/t-tvldlmkVw3

>
> First I have imported the shape in PERMANENT
>
> and I do : v.extract --verbose input=CLC12_FR_RGF@PERMANENT 
where=CODE_12 IN (111,112,131,311,312,313,324) output=clc12

>
> Hope it helps you...

import of the shapefile with v.in.ogr takes here 5 minutes
v.extract takes here 27 seconds instead of 1 hour

"here" means a laptop with Intel Core i7 4th generation and standard 
SATA SSD, i.e. no fancy new high-speed system at all.


I am afraid this does not help you. What could take long is writing 
attributes, depending on the database connection. I am using the 
default sqlite database.


You could use top to check if v.extract is running at 100%.


Hello Markus,

Thank you for your help.

I'm trying to do again the operation on local machine. I want fisrt, 
create a vector with only selected data (on full France area). But 
I've met a problem with v.extract.


v.extract --overwrite --verbose input=CLC12_FR_RGF@PERMANENT type=area 
where=CODE_12 IN (111,112,121,311,312,313,324) 
output=CLC12_FR_RGF_BOISBATI@PERMANENT

Loading categories from table ...
DBMI-DBF erreur de pilote :
SQL parser error (syntax error, unexpected NAME processing
'IN') in statement:
SELECT cat FROM CLC12_FR_RGF WHERE CODE_12 IN
(111,112,121,311,312,313,324)
Unable to open cursor.
DBMI-DBF erreur de pilote :
SQL parser error (syntax error, unexpected NAME processing
'IN') in statement:
SELECT cat FROM CLC12_FR_RGF WHERE CODE_12 IN
(111,112,121,311,312,313,324)
Unable to open cursor.
ERROR: Unable select records from table 

It looks that grass does not recognized "IN" sql condition. If I force 
layer=-1, it runs bur the output vector is the same as input one.


Am I wrong somewhere ? I use Grass 7.4.2 on debian9.

Thank you for your help.

Frank


Hi,

I've repeated the operation v.in.ogr and v.extract with success on 
different grass mapset, but I get always the same error (on v.extract : 
see above) only with one of my local grass mapset (PERMANENT). I do not 
understand what happens...


Regards,
Frank

___
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-11-05 Thread Frank David


Le 02/11/2018 à 22:27, Markus Metz a écrit :



On Fri, Nov 2, 2018 at 6:32 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> Le 02/11/2018 à 14:43, Markus Metz a écrit :
>
>
>
> On Fri, Nov 2, 2018 at 11:58 AM Frank David <mailto:frank.da...@geophom.fr>> wrote:

> >
> > Le 31/10/2018 à 20:57, Markus Metz a écrit :
> >
> > Hi Frank,
> >
> > On Wed, Oct 31, 2018 at 1:39 PM Frank David 
mailto:frank.da...@geophom.fr>> wrote:

> > >
> > > 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...

> >
> > this kind of operation could be much faster in latest GRASS 7.4 
than in any previous versions. Which GRASS version are you using?

> >
> > Hello Markus,
> >
> > I'm using 7.4.1 on debian9
> >
> > But my grass db folder  is on a small server (Synology NAS), so 
may be the network makes slow down the operation ?

>
> This is possible, but it should not slow it down that much: 10 min 
vs 1 hour

>
> Can you provide a link to the vector from which you want to extract 
a small area, and the command you used to extract a small area? Maybe 
there is scope for optimization.

>
> Markus,
>
> The data is CorineLandCover for france. You can download 400mo here 
> https://we.tl/t-tvldlmkVw3

>
> First I have imported the shape in PERMANENT
>
> and I do : v.extract --verbose input=CLC12_FR_RGF@PERMANENT 
where=CODE_12 IN (111,112,131,311,312,313,324) output=clc12

>
> Hope it helps you...

import of the shapefile with v.in.ogr takes here 5 minutes
v.extract takes here 27 seconds instead of 1 hour

"here" means a laptop with Intel Core i7 4th generation and standard 
SATA SSD, i.e. no fancy new high-speed system at all.


I am afraid this does not help you. What could take long is writing 
attributes, depending on the database connection. I am using the 
default sqlite database.


You could use top to check if v.extract is running at 100%.


Hello Markus,

Thank you for your help.

I'm trying to do again the operation on local machine. I want fisrt, 
create a vector with only selected data (on full France area). But I've 
met a problem with v.extract.


v.extract --overwrite --verbose input=CLC12_FR_RGF@PERMANENT type=area 
where=CODE_12 IN (111,112,121,311,312,313,324) 
output=CLC12_FR_RGF_BOISBATI@PERMANENT

Loading categories from table ...
DBMI-DBF erreur de pilote :
SQL parser error (syntax error, unexpected NAME processing
'IN') in statement:
SELECT cat FROM CLC12_FR_RGF WHERE CODE_12 IN
(111,112,121,311,312,313,324)
Unable to open cursor.
DBMI-DBF erreur de pilote :
SQL parser error (syntax error, unexpected NAME processing
'IN') in statement:
SELECT cat FROM CLC12_FR_RGF WHERE CODE_12 IN
(111,112,121,311,312,313,324)
Unable to open cursor.
ERROR: Unable select records from table 

It looks that grass does not recognized "IN" sql condition. If I force 
layer=-1, it runs bur the output vector is the same as input one.


Am I wrong somewhere ? I use Grass 7.4.2 on debian9.

Thank you for your help.

Frank



Markus M
>
> Cheers,
> Frank
>
>
> Markus M
> >
> > Cheers,
> > Frank
> >
> >
> > Markus M
> > >
> > > 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 <mailto:grass-user@lists.osgeo.org>
> > >> https://lists.osgeo.org/mailman/listinfo/grass-user
> > >
> > > ___
> > > grass-user mailing list
> > > grass-user@lists.osgeo.org <mailto: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] partial vector copy to smaller territory

2018-11-02 Thread Frank David

Le 31/10/2018 à 20:57, Markus Metz a écrit :

Hi Frank,

On Wed, Oct 31, 2018 at 1:39 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> 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...


this kind of operation could be much faster in latest GRASS 7.4 than 
in any previous versions. Which GRASS version are you using?


Hello Markus,

I'm using 7.4.1 on debian9

But my grass db folder  is on a small server (Synology NAS), so may be 
the network makes slow down the operation ?


Cheers,
Frank



Markus M
>
> 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 <mailto:grass-user@lists.osgeo.org>
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org <mailto: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] partial vector copy to smaller territory

2018-10-31 Thread Frank David

Hi Stefan,

Thank you. I did not know. That's great.

Cheers,
Frank

Le 31/10/2018 à 13:53, Stefan Blumentrath a écrit :


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 <mailto: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] partial vector copy to smaller territory

2018-10-31 Thread Frank David

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 <mailto: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] partial vector copy to smaller territory

2018-10-31 Thread Frank David

Hi Jon,

Thanks for your reply. It's very interesting to make a python script, 
even if the input data doe not come from grass database as I would like.


Cheers,

Frank

Le 31/10/2018 à 12:35, Jón Eiríksson a écrit :


The following partial script may be helpful (having the source map in 
shape format):



  assume folder in home directory containing source map - in this case
  contours.shp


  v_w,v_s,v_e,v_n are string variables with destination region


  the commands create a subset defined by the destination region:
  contours.shp


  note that the identical naming of input and output is perhaps
  confusing but harmless


  as long as the home directory does not contain files named contours.*


  —


  importing required modules

import os
import sys
import subprocess
from array import array
import string
import math
from grass.script import core as grass
from grass.script import db as grass


  excerpt

|cmd = 'ogr2ogr -clipsrc' + ' ' + v_w + ' ' + v_s + ' ' + v_e + ' ' + 
v_n cmd = cmd + ' ' + '~/contours.shp' + ' ~/folder_name/contours.shp' 
subprocess.call(cmd, shell = True) grass.run_command('v.in.ogr', 
input='contours.shp', layer='contours', output='contours') |


Jon

On 31 Oct 2018, at 10:12, Frank David wrote:

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

[GRASS-user] partial vector copy to smaller territory

2018-10-31 Thread Frank David

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

Re: [GRASS-user] accent encoding with ps.map

2018-10-30 Thread Frank David


Le 30/10/2018 à 15:38, Rich Shepard a écrit :

On Tue, 30 Oct 2018, Frank David wrote:


I think some point are missing or lack of documentation. I think about
[read] command, display layer order, language support, unit of 
position in

the page (inch/cm), etc. Some improvement would be great, like line
thickness from column for example, accent support from v.label (??)...



Frank,

  Yes, there is room for improvement in both ps.map and g.gui.psmap. 
Perhaps
Martin Landa has another undergrad student in need of a degree 
project. :-)


g.gui.psmap is great, but difficult to use because it does not 
support complex document.


  So far my use of g.gui.psmap has been fairly simple and I like that 
I can

place objects more easily than by changing coordinates in the .psmap file
and recompiling.

  Both ps.map and g.gui.psmap are very useful and for many purposes
(including mine) are more practical than using a different application 
such

as qgis.


I agree, especially when numerous maps needed ! But some malfunctions 
prevent us from using this marvellous tool ! I hope it will be improved 
soon.


cheers,

Frank



Regards,

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

[GRASS-user] accent encoding with ps.map

2018-10-30 Thread Frank David

Hello all,

I'm using ps.map and I notice that accent are not well supported in 3 
cases :


- map scale units, for example "kilomètre" is displayed "kilomÄ"tre". I 
dont'see how to solve that


- for a selecting field in vector map, like [where myfield = "classé"] 
(does not work) while [where myfield = "classe"] (works if I change my 
"é" with "e" in the attribute data). I can solve that by adding an other 
field in my table without accent.


- labels : labels created with v.label seems to cannot support accent. 
Is there any way to solve this ?


my ps.map file are encoded in ISO-8859-1 and other text works well with 
accent. I saw that an environment variable exist : GRASS_DB_ENCODING but 
I don't know how to see it and if I change if it would damage my data 
table ...


Is anybody can advice me ?

I'm using Grass 7.4.1 on debian9

Thank you for your help,

Frank


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

Re: [GRASS-user] append data after a v.in.ascii import

2018-10-30 Thread Frank David

Le 28/10/2018 à 22:33, Markus Metz a écrit :



On Sat, Oct 27, 2018 at 10:00 AM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
>
> Le 26/10/2018 à 21:11, Markus Metz a écrit :
>
>
>
> On Fri, Oct 26, 2018 at 7:17 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> > If you want to preserve attribute values, use v.patch -e, 
otherwise don't use the -e flag, but then you might get duplicate 
category values.

>
> >  v.patch -c should not work because -c is not a recognised flag. 
Which GRASS version did you use with v.patch -c?

>
> I'm sorry, when I wrote -c it was -e of course ! I'm using Grass 7.4.1
>
> But even with -e, as I wrote, the cat of the second file is shift by 
one... (?)


This is correct because it is needed to preserve attributes.
>
> I have used -e because I need to add my attribute table from both 
file. But I had imagine to keep cat relation with data, but it's may 
be better to add a id field ? is there any way to increment a unique 
key automatically when data are appended ?


This unique key is automatically incremented when data are appended 
and attribute values need to be preserved. The unique key (more 
generally: the object identifier that determines to which category an 
object belongs) is the category value.


I am sure the output with shifted category values is exactly the 
output you want when preserving attribute values.


Markus M


Thank you Markus.

I have to learn more about topology I think... I believe understand that 
cat value take care off all object of the vector map even those who are 
not connected to the attribute table... Thanks.


Cheers

Frank



>
> Frank
>
>
> Markus M
> >
> > Frank
> >
> > Le 26/10/2018 à 18:44, Markus Metz a écrit :
> >
> >
> >
> > On Fri, Oct 26, 2018 at 2:26 PM Frank David 
mailto:frank.da...@geophom.fr>> wrote:

> > >
> > > I reply to myself,
> > >
> > > I mistook, if I append, I see a cat shift too. The fisrt cat of the
> > > second map is shift by one. It's strange no ?
> >
> > Suppose there is a feature with cat 1 in map A and a feature also 
with cat 1 in map B, but corresponding attribute values for cat 1 are 
different between map A and map B. In order to avoid such conflicts, 
v.patch shifts category values and updates the resultant attribute 
table accordingly, such that attributes for each feature are preserved.

> >
> > Markus M
> > >
> > > Frank
> > >
> > > Le 26/10/2018 à 14:17, Frank David a écrit :
> > >
> > > > Hi Stephan,
> > > >
> > > > If I add two vector in a new one with :
> > > >
> > > > v.patch -c input=map1,map2 out=map3
> > > >
> > > > I notice the map3 first cat start at 2 instead of 1, so all 
cat are

> > > > shifted by one. Do you have an idea of the reason ?
> > > >
> > > > If I append my map1 with map2 :
> > > >
> > > > v.patch -c -a input=map2 output=map1 --overwrite it works well
> > > >
> > > > Thank you
> > > >
> > > > Frank
> > > >
> > > > Le 26/10/2018 à 12:01, Stefan Blumentrath a écrit :
> > > >> Hi,
> > > >>
> > > >> Try:
> > > >> v.patch -a
> > > >> https://grass.osgeo.org/grass76/manuals/v.patch.html
> > > >>
> > > >> (assuming attribute tables are equal).
> > > >>
> > > >> Cheers
> > > >> Stefan
> > > >>
> > > >> -Original Message-
> > > >> From: grass-user<mailto:grass-user-boun...@lists.osgeo.org>>  On Behalf Of Frank David

> > > >> Sent: fredag 26. oktober 2018 11:39
> > > >> To:grass-user@lists.osgeo.org 
<mailto:to%3agrass-u...@lists.osgeo.org>

> > > >> Subject: [GRASS-user] append data after a v.in.ascii import
> > > >>
> > > >> Hello,
> > > >>
> > > >> I wonder what is the best way to append a vector map and his 
attribute data created with v.in.ascii  ?

> > > >>
> > > >> Thanks
> > > >>
> > > >> Frank
> > > >>
> > > >> ___
> > > >> grass-user mailing list
> > > >> grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> > > >> https://lists.osgeo.org/mailman/listinfo/grass-user
> > > >
> > > > ___
> > > > grass-user mailing list
> > > > grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> > > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > > ___
> > > grass-user mailing list
> > > grass-user@lists.osgeo.org <mailto: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] append data after a v.in.ascii import

2018-10-27 Thread Frank David


Le 26/10/2018 à 21:11, Markus Metz a écrit :




On Fri, Oct 26, 2018 at 7:17 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> Thank you Markus,
>
> Is a feature could be created without a row data ?,  because the two 
maps have been created with a v.in.ascii from a text file, so it means 
that one object by row has been created. For both of my two maps.


If you want to preserve attribute values, use v.patch -e, otherwise 
don't use the -e flag, but then you might get duplicate category values.


v.patch -c should not work because -c is not a recognised flag. Which 
GRASS version did you use with v.patch -c?


I'm sorry, when I wrote -c it was -e of course ! I'm using Grass 7.4.1

But even with -e, as I wrote, the cat of the second file is shift by 
one... (?)


I have used -e because I need to add my attribute table from both file. 
But I had imagine to keep cat relation with data, but it's may be better 
to add a id field ? is there any way to increment a unique key 
automatically when data are appended ?


Frank



Markus M
>
> Frank
>
> Le 26/10/2018 à 18:44, Markus Metz a écrit :
>
>
>
> On Fri, Oct 26, 2018 at 2:26 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

> >
> > I reply to myself,
> >
> > I mistook, if I append, I see a cat shift too. The fisrt cat of the
> > second map is shift by one. It's strange no ?
>
> Suppose there is a feature with cat 1 in map A and a feature also 
with cat 1 in map B, but corresponding attribute values for cat 1 are 
different between map A and map B. In order to avoid such conflicts, 
v.patch shifts category values and updates the resultant attribute 
table accordingly, such that attributes for each feature are preserved.

>
> Markus M
> >
> > Frank
> >
> > Le 26/10/2018 à 14:17, Frank David a écrit :
> >
> > > Hi Stephan,
> > >
> > > If I add two vector in a new one with :
> > >
> > > v.patch -c input=map1,map2 out=map3
> > >
> > > I notice the map3 first cat start at 2 instead of 1, so all cat are
> > > shifted by one. Do you have an idea of the reason ?
> > >
> > > If I append my map1 with map2 :
> > >
> > > v.patch -c -a input=map2 output=map1 --overwrite it works well
> > >
> > > Thank you
> > >
> > > Frank
> > >
> > > Le 26/10/2018 à 12:01, Stefan Blumentrath a écrit :
> > >> Hi,
> > >>
> > >> Try:
> > >> v.patch -a
> > >> https://grass.osgeo.org/grass76/manuals/v.patch.html
> > >>
> > >> (assuming attribute tables are equal).
> > >>
> > >> Cheers
> > >> Stefan
> > >>
> > >> -Original Message-
> > >> From: grass-user<mailto:grass-user-boun...@lists.osgeo.org>>  On Behalf Of Frank David

> > >> Sent: fredag 26. oktober 2018 11:39
> > >> To:grass-user@lists.osgeo.org 
<mailto:to%3agrass-u...@lists.osgeo.org>

> > >> Subject: [GRASS-user] append data after a v.in.ascii import
> > >>
> > >> Hello,
> > >>
> > >> I wonder what is the best way to append a vector map and his 
attribute data created with v.in.ascii  ?

> > >>
> > >> Thanks
> > >>
> > >> Frank
> > >>
> > >> ___
> > >> grass-user mailing list
> > >> grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> > >> https://lists.osgeo.org/mailman/listinfo/grass-user
> > >
> > > ___
> > > grass-user mailing list
> > > grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org <mailto: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] append data after a v.in.ascii import

2018-10-26 Thread Frank David

Thank you Markus,

Is a feature could be created without a row data ?,  because the two 
maps have been created with a v.in.ascii from a text file, so it means 
that one object by row has been created. For both of my two maps.


Frank

Le 26/10/2018 à 18:44, Markus Metz a écrit :



On Fri, Oct 26, 2018 at 2:26 PM Frank David <mailto:frank.da...@geophom.fr>> wrote:

>
> I reply to myself,
>
> I mistook, if I append, I see a cat shift too. The fisrt cat of the
> second map is shift by one. It's strange no ?

Suppose there is a feature with cat 1 in map A and a feature also with 
cat 1 in map B, but corresponding attribute values for cat 1 are 
different between map A and map B. In order to avoid such conflicts, 
v.patch shifts category values and updates the resultant attribute 
table accordingly, such that attributes for each feature are preserved.


Markus M
>
> Frank
>
> Le 26/10/2018 à 14:17, Frank David a écrit :
>
> > Hi Stephan,
> >
> > If I add two vector in a new one with :
> >
> > v.patch -c input=map1,map2 out=map3
> >
> > I notice the map3 first cat start at 2 instead of 1, so all cat are
> > shifted by one. Do you have an idea of the reason ?
> >
> > If I append my map1 with map2 :
> >
> > v.patch -c -a input=map2 output=map1 --overwrite it works well
> >
> > Thank you
> >
> > Frank
> >
> > Le 26/10/2018 à 12:01, Stefan Blumentrath a écrit :
> >> Hi,
> >>
> >> Try:
> >> v.patch -a
> >> https://grass.osgeo.org/grass76/manuals/v.patch.html
> >>
> >> (assuming attribute tables are equal).
> >>
> >> Cheers
> >> Stefan
> >>
> >> -Original Message-
> >> From: grass-user<mailto:grass-user-boun...@lists.osgeo.org>>  On Behalf Of Frank David

> >> Sent: fredag 26. oktober 2018 11:39
> >> To:grass-user@lists.osgeo.org 
<mailto:to%3agrass-u...@lists.osgeo.org>

> >> Subject: [GRASS-user] append data after a v.in.ascii import
> >>
> >> Hello,
> >>
> >> I wonder what is the best way to append a vector map and his 
attribute data created with v.in.ascii  ?

> >>
> >> Thanks
> >>
> >> Frank
> >>
> >> ___
> >> grass-user mailing list
> >> grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> >> https://lists.osgeo.org/mailman/listinfo/grass-user
> >
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> > https://lists.osgeo.org/mailman/listinfo/grass-user
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org <mailto: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] append data after a v.in.ascii import

2018-10-26 Thread Frank David

I reply to myself,

I mistook, if I append, I see a cat shift too. The fisrt cat of the 
second map is shift by one. It's strange no ?


Frank

Le 26/10/2018 à 14:17, Frank David a écrit :


Hi Stephan,

If I add two vector in a new one with :

v.patch -c input=map1,map2 out=map3

I notice the map3 first cat start at 2 instead of 1, so all cat are 
shifted by one. Do you have an idea of the reason ?


If I append my map1 with map2 :

v.patch -c -a input=map2 output=map1 --overwrite it works well

Thank you

Frank

Le 26/10/2018 à 12:01, Stefan Blumentrath a écrit :

Hi,

Try:
v.patch -a
https://grass.osgeo.org/grass76/manuals/v.patch.html

(assuming attribute tables are equal).

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Frank David
Sent: fredag 26. oktober 2018 11:39
To:grass-user@lists.osgeo.org
Subject: [GRASS-user] append data after a v.in.ascii import

Hello,

I wonder what is the best way to append a vector map and his attribute data 
created with v.in.ascii  ?

Thanks

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

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

Re: [GRASS-user] append data after a v.in.ascii import

2018-10-26 Thread Frank David

Hi Stephan,

If I add two vector in a new one with :

v.patch -c input=map1,map2 out=map3

I notice the map3 first cat start at 2 instead of 1, so all cat are 
shifted by one. Do you have an idea of the reason ?


If I append my map1 with map2 :

v.patch -c -a input=map2 output=map1 --overwrite it works well

Thank you

Frank

Le 26/10/2018 à 12:01, Stefan Blumentrath a écrit :

Hi,

Try:
v.patch -a
https://grass.osgeo.org/grass76/manuals/v.patch.html

(assuming attribute tables are equal).

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Frank David
Sent: fredag 26. oktober 2018 11:39
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] append data after a v.in.ascii import

Hello,

I wonder what is the best way to append a vector map and his attribute data 
created with v.in.ascii  ?

Thanks

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

[GRASS-user] append data after a v.in.ascii import

2018-10-26 Thread Frank David

Hello,

I wonder what is the best way to append a vector map and his attribute 
data created with v.in.ascii  ?


Thanks

Frank

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

Re: [GRASS-user] d.rast in python script

2018-10-24 Thread Frank David


Le 24/10/2018 à 15:14, Nikos Alexandris a écrit :

* Frank David  [2018-10-24 12:04:43 +0200]:



Le 24/10/2018 à 11:58, Nikos Alexandris a écrit :

* Frank David  [2018-10-24 11:35:07 +0200]:


Stephan,

The G_OPT_OUTPUT option generate well the check box "add tree 
layer" in my script GUI.


My problem, now is how to add the raster output while I want to set 
his name by the script ? I succeed with g.copy my_raster_name to 
output_raster_name. The copy is well displayed but this creates a 
copy what is not very convenient...


g.rename

?


Nikos,

g.rename works too. But it's not more convenient because I need to 
keep my raster in his original name.


Cheers,

Frank



Frank,

apologies, but I think I missed the point of what you need to do. Is the
"copy" not convenient because of "wasting" space?  If yes, here another
suggestion then:

https://grasswiki.osgeo.org/wiki/LANDSAT#Hint:_Minimal_disk_space_copies

In Python, something like:

r.reclass(
   input=input_raster,
   output=output_raster,
   rules='-',
   stdin='*=*',
   verbose=False,
   quiet=True)

Nikos

Thanks Nikos, but it's not the point. I just need to add to the display 
tree rasters I calculate with python script without G_OPT_OUTPUT because 
I want to name it by script (the name comes from different attributes of 
vector maps). But, it looks that only G_OPT_OUTPUT adds the check box 
"add tree layer" on the script GUI.


Frank

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

Re: [GRASS-user] ps.map

2018-10-24 Thread Frank David

Hello all,

I notice that the same command does not produce the same result if I run 
it from the shell or if I use the ps.map GUI.


From GUI, le scale/region of ps file is correct, and if I run from the 
shell, the region/scale setting is not respected


the psmap file begin with the region settings :

# timestamp: 2018-10-23 12:18
# location: France_L93
# mapset: volkswind_beaurevoir
# page orientation: Portrait
# g.region vector=WOLKSWIND_Beaurevoir_AEE@volkswind_beaurevoir

Is anybody notice that ?

Regards,

Frank


Le 23/10/2018 à 13:35, Frank David a écrit :

Hello,

I can't succeed to scale my raster as I want in the map window with 
ps.map


I've tried :

...
# g.region vector=max_area_vector_map@my_dataset
maploc 1.0 1.0
...

or

...
# g.region n=7030981.0 s=6950949.0 e=755872.0 w=691504.0 rows=1067 
cols=858

maploc 1.0 1.0
...

with and without scale instruction like "scale 1:30", and The 
scaling when I use the command line psmap is always the same...


One thing is strange, when i use g.gui.psmap it works (the map scale 
is fine), but if I try to use the exported instruction file from 
g.gui.psmap with command line "ps.map in=myfile.txt out=myfile.ps" it 
does not export the same scale (see attached file). Like if 
g.gui.psmap do something witch is not writing in the instruction file??


Any idea from where I'm wrong ?

Thank you for your help.

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] d.rast in python script

2018-10-24 Thread Frank David


Le 24/10/2018 à 11:58, Nikos Alexandris a écrit :

* Frank David  [2018-10-24 11:35:07 +0200]:


Stephan,

The G_OPT_OUTPUT option generate well the check box "add tree layer" 
in my script GUI.


My problem, now is how to add the raster output while I want to set 
his name by the script ? I succeed with g.copy my_raster_name to 
output_raster_name. The copy is well displayed but this creates a 
copy what is not very convenient...


g.rename

?


Nikos,

g.rename works too. But it's not more convenient because I need to keep 
my raster in his original name.


Cheers,

Frank

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

Re: [GRASS-user] d.rast in python script

2018-10-24 Thread Frank David

Stephan,

The G_OPT_OUTPUT option generate well the check box "add tree layer" in 
my script GUI.


My problem, now is how to add the raster output while I want to set his 
name by the script ? I succeed with g.copy my_raster_name to 
output_raster_name. The copy is well displayed but this creates a copy 
what is not very convenient...


Cheers,

Frank

Le 24/10/2018 à 11:05, Stefan Blumentrath a écrit :


Hi Frank,

Using GRASS standard parser options is a good practice. Unfortunately, 
it does not yet generate the "add to tree layer" check box in the 
AddOn GUI (though I hope that can be added in core though).


You can use e.g. G_OPT_R_OUTPUT and still choose a non-standard 
key-name for the option in your script with a line like this:


#% key: my_option_key_name

Cheers,

Stefan

*From:*Frank David 
*Sent:* onsdag 24. oktober 2018 10:48
*To:* Stefan Blumentrath ; Nikos 
Alexandris 
*Cc:* Laurent C. ; GRASS user list 
; GRASS developers list 
(grass-...@lists.osgeo.org) 

*Subject:* Re: [GRASS-user] d.rast in python script

Stephan,

Your last message makes me search after G_OPT_OUTPUT. I had never 
realized that this option makes the "add to tree layer" check box 
appear on the script GUI.


All my scripts create rasters without G_OPT_OUTPUT option (because the 
name of output are handled by the script itself) and so, without check 
box. Using d.rast could keep interesting i think in order to select 
witch one should be display or not, but for the moment I can (may be) 
overtake that limitation by using the G_OPT_OUTPUT option (I will see).


Sorry for confusing. And thank you very much for your help. I let you 
see if the ticket you had post is appropriate.


Cheers,

Frank

Le 24/10/2018 à 10:13, Stefan Blumentrath a écrit :

Hi Frank,

My guess is that the GRASS standard parser options [1] (e.g.
G_OPT_R_OUTPUT, G_OPT_R_OUTPUTS,G_OPT_V_OUTPUT, …) would be used
in order to determine what has to be / could be added to the map
display…

But I am no GUI dev, and cannot tell for sure, hope experts on
that part of the code could chime in …

And yes, I agree that a convenient function in the Python library
for adding a map in the currently active layer manager would be a
nice new feature (if it does not exist and I just overlooked it)…

Maybe another ticket?...

Cheers

Stefan

1:
https://grass.osgeo.org/grass74/manuals/parser_standard_options.html

*From:*Frank David 
<mailto:frank.da...@geophom.fr>
*Sent:* onsdag 24. oktober 2018 09:35
*To:* Stefan Blumentrath 
<mailto:stefan.blumentr...@nina.no>; Nikos Alexandris
 <mailto:n...@nikosalexandris.net>
*Cc:* Laurent C.  <mailto:lrn...@gmail.com>;
GRASS user list 
<mailto:grass-user@lists.osgeo.org>; GRASS developers list
(grass-...@lists.osgeo.org <mailto:grass-...@lists.osgeo.org>)
 <mailto:grass-...@lists.osgeo.org>
*Subject:* Re: [GRASS-user] d.rast in python script

Hi Stephan,

Thank you for the ticket. One thing seems to me important. Some
(of my) scripts can generate numerous rasters and one or two
cumulative raster. I don't want to add base rasters but only the
few cumulative. If the script GUI have a check box, how to make
the choice between these I want to display and those I don't want ?

For my point of view, the use of d.rast inside the script, as we
do for all other grass command, should be possible, in order to
display what we want to display.

Cheers,

Frank

Le 24/10/2018 à 09:23, Stefan Blumentrath a écrit :

Hei Nikos, Frank,

I opened an enhancement ticket, and asked to activate the "Add
created map(s) into layer tree" also for addons:

https://trac.osgeo.org/grass/ticket/3686. No idea what changes
this would require…

Would that cover your needs, Frank, or do you have a more
interactive use in a python script in mind?

You can start a wx monitor (d.mon wx0) and add a map there,
but I have not found a way to address the currently active Map
Display …

This would probably require additional function(s) in the
Python libraries…?

Maybe this question is better asked at the developer list
(thus I put grass-dev in CC).

Cheers

Stefan

*From:*Frank David 
<mailto:frank.da...@geophom.fr>
*Sent:* onsdag 24. oktober 2018 08:26
*To:* Nikos Alexandris 
<mailto:n...@nikosalexandris.net>
*Cc:* Stefan Blumentrath 
<mailto:stefan.blumentr...@nina.no>; Laurent C.
 <mailto:lrn...@gmail.com>; GRASS user list
 <mailto:grass-user@lists.osgeo.org>
*Subject:* Re: [GRASS-user] d.rast in python script

Le 23/10/2018 à 23:26, Nikos Alexandris a écrit :

* Frank David 

Re: [GRASS-user] d.rast in python script

2018-10-24 Thread Frank David

Stephan,

Your last message makes me search after G_OPT_OUTPUT. I had never 
realized that this option makes the "add to tree layer" check box appear 
on the script GUI.


All my scripts create rasters without G_OPT_OUTPUT option (because the 
name of output are handled by the script itself) and so, without check 
box. Using d.rast could keep interesting i think in order to select 
witch one should be display or not, but for the moment I can (may be) 
overtake that limitation by using the G_OPT_OUTPUT option (I will see).


Sorry for confusing. And thank you very much for your help. I let you 
see if the ticket you had post is appropriate.


Cheers,

Frank


Le 24/10/2018 à 10:13, Stefan Blumentrath a écrit :


Hi Frank,

My guess is that the GRASS standard parser options [1] (e.g. 
G_OPT_R_OUTPUT, G_OPT_R_OUTPUTS,G_OPT_V_OUTPUT, …) would be used in 
order to determine what has to be / could be added to the map display…


But I am no GUI dev, and cannot tell for sure, hope experts on that 
part of the code could chime in …


And yes, I agree that a convenient function in the Python library for 
adding a map in the currently active layer manager would be a nice new 
feature (if it does not exist and I just overlooked it)…


Maybe another ticket?...

Cheers

Stefan

1: https://grass.osgeo.org/grass74/manuals/parser_standard_options.html

*From:*Frank David 
*Sent:* onsdag 24. oktober 2018 09:35
*To:* Stefan Blumentrath ; Nikos 
Alexandris 
*Cc:* Laurent C. ; GRASS user list 
; GRASS developers list 
(grass-...@lists.osgeo.org) 

*Subject:* Re: [GRASS-user] d.rast in python script

Hi Stephan,

Thank you for the ticket. One thing seems to me important. Some (of 
my) scripts can generate numerous rasters and one or two cumulative 
raster. I don't want to add base rasters but only the few cumulative. 
If the script GUI have a check box, how to make the choice between 
these I want to display and those I don't want ?


For my point of view, the use of d.rast inside the script, as we do 
for all other grass command, should be possible, in order to display 
what we want to display.


Cheers,

Frank

Le 24/10/2018 à 09:23, Stefan Blumentrath a écrit :

Hei Nikos, Frank,

I opened an enhancement ticket, and asked to activate the "Add
created map(s) into layer tree" also for addons:

https://trac.osgeo.org/grass/ticket/3686. No idea what changes
this would require…

Would that cover your needs, Frank, or do you have a more
interactive use in a python script in mind?

You can start a wx monitor (d.mon wx0) and add a map there, but I
have not found a way to address the currently active Map Display …

This would probably require additional function(s) in the Python
libraries…?

Maybe this question is better asked at the developer list (thus I
put grass-dev in CC).

Cheers

    Stefan

    *From:*Frank David 
<mailto:frank.da...@geophom.fr>
*Sent:* onsdag 24. oktober 2018 08:26
*To:* Nikos Alexandris 
<mailto:n...@nikosalexandris.net>
*Cc:* Stefan Blumentrath 
<mailto:stefan.blumentr...@nina.no>; Laurent C. 
<mailto:lrn...@gmail.com>; GRASS user list
 <mailto:grass-user@lists.osgeo.org>
*Subject:* Re: [GRASS-user] d.rast in python script

Le 23/10/2018 à 23:26, Nikos Alexandris a écrit :

* Frank David 
<mailto:frank.da...@geophom.fr> [2018-10-23 22:06:01 +0200]:



Thank you everybody for your help. Do you know why a
run_command("d.rast"... in a python script is not enough
to display a raster ? I don't understand why this command
is so different.


Display a raster map where?

Nikos

In the active map display (and respective Layer manager) as d.rast
do it with gui...

Frank

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

Re: [GRASS-user] d.rast in python script

2018-10-24 Thread Frank David

Hi Stephan,

Thank you for the ticket. One thing seems to me important. Some (of my) 
scripts can generate numerous rasters and one or two cumulative raster. 
I don't want to add base rasters but only the few cumulative. If the 
script GUI have a check box, how to make the choice between these I want 
to display and those I don't want ?


For my point of view, the use of d.rast inside the script, as we do for 
all other grass command, should be possible, in order to display what we 
want to display.


Cheers,

Frank

Le 24/10/2018 à 09:23, Stefan Blumentrath a écrit :


Hei Nikos, Frank,

I opened an enhancement ticket, and asked to activate the "Add created 
map(s) into layer tree" also for addons:


https://trac.osgeo.org/grass/ticket/3686. No idea what changes this 
would require…


Would that cover your needs, Frank, or do you have a more interactive 
use in a python script in mind?


You can start a wx monitor (d.mon wx0) and add a map there, but I have 
not found a way to address the currently active Map Display …


This would probably require additional function(s) in the Python 
libraries…?


Maybe this question is better asked at the developer list (thus I put 
grass-dev in CC).


Cheers

Stefan

*From:*Frank David 
*Sent:* onsdag 24. oktober 2018 08:26
*To:* Nikos Alexandris 
*Cc:* Stefan Blumentrath ; Laurent C. 
; GRASS user list 

*Subject:* Re: [GRASS-user] d.rast in python script

Le 23/10/2018 à 23:26, Nikos Alexandris a écrit :

    * Frank David 
<mailto:frank.da...@geophom.fr> [2018-10-23 22:06:01 +0200]:


Thank you everybody for your help. Do you know why a
run_command("d.rast"... in a python script is not enough to
display a raster ? I don't understand why this command is so
different.


Display a raster map where?

Nikos

In the active map display (and respective Layer manager) as d.rast do 
it with gui...


Frank

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

Re: [GRASS-user] d.rast in python script

2018-10-24 Thread Frank David



Le 23/10/2018 à 23:26, Nikos Alexandris a écrit :

* Frank David  [2018-10-23 22:06:01 +0200]:

Thank you everybody for your help. Do you know why a 
run_command("d.rast"... in a python script is not enough to display a 
raster ? I don't understand why this command is so different.


Display a raster map where?

Nikos
In the active map display (and respective Layer manager) as d.rast do it 
with gui...


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

Re: [GRASS-user] d.rast in python script

2018-10-23 Thread Frank David
Thank you everybody for your help. Do you know why a 
run_command("d.rast"... in a python script is not enough to display a 
raster ? I don't understand why this command is so different.


Frank


Le 23/10/2018 à 07:41, Nikos Alexandris a écrit :
* Stefan Blumentrath  [2018-10-22 08:20:05 
+]:



I think Laurents solution is for rendering maps to file/image.


If of interest, see also: 
https://lists.osgeo.org/pipermail/grass-user/2018-October/079436.html


Nikos



--
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] d.rast in python script

2018-10-22 Thread Frank David

Hi Stefan,

Sorry If I'm not clear... Yes I want add my new map in the active map 
display. Unfortunately "add created map(s) into layer tree” tick-box  
does not appear in my GUI script (I don't know why) and I would like to 
make it visible or to add another one in options tab. Just do 
run_command("d.rast", map=my_map) does not work..


Cheers,

Frank


Le 22/10/2018 à 10:20, Stefan Blumentrath a écrit :


Hi Frank,

I think Laurents solution is for rendering maps to file/image.

Do I understand you correctly, that you are looking for a solution for 
adding maps to the currently active map display (and respective Layer 
manager)?


I have not found a documentation and would be interested too. I assume 
one has to use wxgui code, like e.g. here:


https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/render.py

?

Yet, having the “Add created map(s) into layer tree” tick-box that 
core modules have available also for addons (without GUI programming 
for addon devs) would be nice (if possible)…


Kind regards,

Stefan

*From:*grass-user  *On Behalf Of 
*Frank David

*Sent:* søndag 21. oktober 2018 21:35
*To:* Laurent C. 
*Cc:* GRASS user list 
*Subject:* Re: [GRASS-user] d.rast in python script

Hello Laurent,

Thank you for your help. I'm very surprised by the complexity of the 
way to display a raster. I thought that only d.rast was needed. Other 
grass command are so simple to use...


Anayway, I don't understand why you need to set a image width and 
height. is it pixel number between west to east and south to north 
from region ?


and from where "img_file_name" is coming ? (my layer's name is "my_map")

To remove raster from display, I just manually remove from the layer tree.

Cheers,

Frank

Le 20/10/2018 à 23:06, Laurent C. a écrit :

Hello Frank,

It is not very straightforward, but it is possible.
Here is an example on how I do it:

import os
import grass.script as gscript
from grass.pygrass.gis.region import Region

# Set general env

os.environ['GRASS_RENDER_IMMEDIATE'] = "cairo"
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = "9"
os.environ['GRASS_RENDER_FILE_READ'] = "TRUE"

# Set image size using the region
region = Region()
xr = region.cols
yr = region.rows
ratio = xr/yr
height = int(WIDTH / ratio)  # Choose the width you like
os.environ['GRASS_RENDER_WIDTH'] = str(WIDTH)
os.environ['GRASS_RENDER_HEIGHT'] = str(height)

# Then you can draw
os.environ['GRASS_RENDER_FILE'] = img_file_name
gscript.run_command('d.rast', map=my_map, quiet=True)

Be aware that every time you run your script, it will add layer on
the file.

So you might want to delete the png file between the runs.

    Cheers,

Laurent

Le ven. 19 oct. 2018 à 13:00, Frank David mailto:frank.da...@geophom.fr>> a écrit :
>
> Hello,
>
> I wrote some python script and I do not find how to display created
> rasters.
>
> I tried to use d.rast but I believe this command is not designed
to be
> used in python script (no monitor available with d.mon -l). Am I
wright
> ? so how to do ?...
>
> Thank you for your help.
>
> Frank
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user

--

*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr <http://www.geophom.fr>

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

Re: [GRASS-user] d.rast in python script

2018-10-21 Thread Frank David

Hello Laurent,

Thank you for your help. I'm very surprised by the complexity of the way 
to display a raster. I thought that only d.rast was needed. Other grass 
command are so simple to use...


Anayway, I don't understand why you need to set a image width and 
height. is it pixel number between west to east and south to north from 
region ?


and from where "img_file_name" is coming ? (my layer's name is "my_map")

To remove raster from display, I just manually remove from the layer tree.

Cheers,

Frank


Le 20/10/2018 à 23:06, Laurent C. a écrit :

Hello Frank,

It is not very straightforward, but it is possible.
Here is an example on how I do it:

import os
import grass.script as gscript
from grass.pygrass.gis.region import Region

# Set general env
os.environ['GRASS_RENDER_IMMEDIATE'] = "cairo"
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = "9"
os.environ['GRASS_RENDER_FILE_READ'] = "TRUE"

# Set image size using the region
region = Region()
xr = region.cols
yr = region.rows
ratio = xr/yr
height = int(WIDTH / ratio)  # Choose the width you like
os.environ['GRASS_RENDER_WIDTH'] = str(WIDTH)
os.environ['GRASS_RENDER_HEIGHT'] = str(height)

# Then you can draw
os.environ['GRASS_RENDER_FILE'] = img_file_name
gscript.run_command('d.rast', map=my_map, quiet=True)


Be aware that every time you run your script, it will add layer on the 
file.

So you might want to delete the png file between the runs.

Cheers,
Laurent

Le ven. 19 oct. 2018 à 13:00, Frank David <mailto:frank.da...@geophom.fr>> a écrit :

>
> Hello,
>
> I wrote some python script and I do not find how to display created
> rasters.
>
> I tried to use d.rast but I believe this command is not designed to be
> used in python script (no monitor available with d.mon -l). Am I wright
> ? so how to do ?...
>
> Thank you for your help.
>
> Frank
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user


--
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] d.rast in python script

2018-10-19 Thread Frank David

Hello,

I wrote some python script and I do not find how to display created 
rasters.


I tried to use d.rast but I believe this command is not designed to be 
used in python script (no monitor available with d.mon -l). Am I wright 
? so how to do ?...


Thank you for your help.

Frank

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

[GRASS-user] select the map that does not match a string

2018-10-19 Thread Frank David

Hello,

I wonder how to filter the select box (with Shift-Ctrl-L) or the data 
tab display, to maps do not match with a string. for exemple 
"myraster.*^(?!unwanted_string)" should display all maps beginning with 
"myraster" and without "unwanted_string"


This does not work. Is there any trick ??

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] (wxgui.py:13017): WARNING

2018-10-14 Thread Frank David

Hello,

What does this error mean ? It's displayed on the shell (repeated many 
times from the beginning of the grass session after loading a workspace)


** (wxgui.py:13017): WARNING **: invalid source position for vertical 
gradient


Grass 7.4 on debian9

Cheers,

Frank

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

Re: [GRASS-user] r.category

2018-10-12 Thread Frank David



Le 12/10/2018 à 19:51, Nikos Alexandris a écrit :

* Frank David  [2018-10-12 16:31:06 +0200]:

Ha yes ! a small part of the legend is displayed on the bottom of my 
map (I did not take care). I had probably activate d.legend by the 
past to test it.


But I don't know how to remove it ?


Right click on it, then "Remove legend".

Nikos


Thank you Nikos, I succed to remove visible legend on several maps, but 
it does not solve my problem !...

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

Re: [GRASS-user] r.category

2018-10-12 Thread Frank David

Hi Stefan,

Thanks for your reply. But I did not use cat=range option. I only do 
r.category map=mymap separator=":" rules=rulefic.txt


with rulefic.txt like :

0:none
1:1 to 2
2:1 to 2
3:3 to 4
4:3 to 4
5:5 to 6

Is something missing ?
Thanks

Le 12/10/2018 à 15:02, Stefan Blumentrath a écrit :

Hi Frank,

You need to specify the range option as range=0,8 (instead of range=0-8 as you 
did).

Cheers
Stefan

-Original Message-
From: grass-user  On Behalf Of Frank David
Sent: fredag 12. oktober 2018 14:24
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] r.category

Hello grass users,

I have an error message in the console when I open some rasters with witch I've 
done a r.category.

"Failed to run command 'd.legend
raster=ZVT_nac_projet_hoht2__BDalti75_a1_8_sum@derval title=nacelle color=white 
range=0-8 at=5.0,50.0,6.9,9.9 thin=3'. Details:

ERROR: Option  must be provided in multiples of 2
      You provided 1 item(s): 0-8"

a r.describe display :

* 0.00-0.031373 0.972549-1.003922 1.976471-2.007843 2.980392-3.011765
3.984314-4.015686 4.956863-4.988235 5.960784-5.992157 6.964706-6.996078
7.968627-8.00

r.report display :

|   0-0.031373|from
to   |
|0.972549-1.003922|from
to   |
|1.976471-2.007843|from
to   |
|2.980392-3.011765|from
to   |
|3.984314-4.015686|from
to   |
|4.988235-5.019608|from
to   |
|5.992157-6.023529|from
to   |
|6.996078-7.027451|from
to   |
|   7.968627-8|from
to   |
|    *|no data


I don't understand what the error message means (in red color in the
console) ?

Thank your for your help !

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] r.category

2018-10-12 Thread Frank David
Ha yes ! a small part of the legend is displayed on the bottom of my map 
(I did not take care). I had probably activate d.legend by the past to 
test it.


But I don't know how to remove it ?

Frank

Le 12/10/2018 à 16:24, Stefan Blumentrath a écrit :


Hi Frank,

The error message you sent is related to d.legend module, which you 
may have called from the graphical user interface, more particular the 
map window, in order to add a legend to a map display.


If you have a visible legend in your map display, double click it in 
order to change the range parameter. That should fix the error message.


Or do you have other issues as well?

Cheers

Stefan

*From:*Frank David 
*Sent:* fredag 12. oktober 2018 15:17
*To:* Stefan Blumentrath ; 
grass-user@lists.osgeo.org

*Subject:* Re: [GRASS-user] r.category

Hi Stefan,

Thanks for your reply. But I did not use cat=range option. I only do 
r.category map=mymap separator=":" rules=rulefic.txt


with rulefic.txt like :

0:none
1:1 to 2
2:1 to 2
3:3 to 4
4:3 to 4
5:5 to 6

Is something missing ?
Thanks

Le 12/10/2018 à 15:02, Stefan Blumentrath a écrit :

Hi Frank,

You need to specify the range option as range=0,8 (instead of range=0-8 as 
you did).

Cheers

Stefan

-Original Message-

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

Sent: fredag 12. oktober 2018 14:24

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

Subject: [GRASS-user] r.category

Hello grass users,

I have an error message in the console when I open some rasters with witch 
I've done a r.category.

"Failed to run command 'd.legend

raster=ZVT_nac_projet_hoht2__BDalti75_a1_8_sum@derval title=nacelle 
color=white range=0-8 at=5.0,50.0,6.9,9.9 thin=3'. Details:

ERROR: Option  must be provided in multiples of 2

      You provided 1 item(s): 0-8"

a r.describe display :

* 0.00-0.031373 0.972549-1.003922 1.976471-2.007843 2.980392-3.011765

3.984314-4.015686 4.956863-4.988235 5.960784-5.992157 6.964706-6.996078

7.968627-8.00

r.report display :

|   0-0.031373|from

to   |

|0.972549-1.003922|from

to   |

|1.976471-2.007843|from

to   |

|2.980392-3.011765|from

to   |

|3.984314-4.015686|from

to   |

|4.988235-5.019608|from

to   |

|5.992157-6.023529|from

to   |

|6.996078-7.027451|from

to   |

|   7.968627-8|from

to   |

|    *|no data

I don't understand what the error message means (in red color in the

console) ?

Thank your for your help !

Frank

___

grass-user mailing list

grass-user@lists.osgeo.org  <mailto: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] r.category

2018-10-12 Thread Frank David

Hello grass users,

I have an error message in the console when I open some rasters with 
witch I've done a r.category.


"Failed to run command 'd.legend 
raster=ZVT_nac_projet_hoht2__BDalti75_a1_8_sum@derval title=nacelle 
color=white range=0-8 at=5.0,50.0,6.9,9.9 thin=3'. Details:


ERROR: Option  must be provided in multiples of 2
    You provided 1 item(s): 0-8"

a r.describe display :

* 0.00-0.031373 0.972549-1.003922 1.976471-2.007843 2.980392-3.011765
3.984314-4.015686 4.956863-4.988235 5.960784-5.992157 6.964706-6.996078
7.968627-8.00

r.report display :

|   0-0.031373|from 
to   |
|0.972549-1.003922|from 
to   |
|1.976471-2.007843|from 
to   |
|2.980392-3.011765|from 
to   |
|3.984314-4.015686|from 
to   |
|4.988235-5.019608|from 
to   |
|5.992157-6.023529|from 
to   |
|6.996078-7.027451|from 
to   |
|   7.968627-8|from 
to   |

|    *|no data


I don't understand what the error message means (in red color in the 
console) ?


Thank your for your help !

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

Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Frank David


Le 9/25/18 à 4:10 PM, Moritz Lennert a écrit :

On 25/09/18 15:40, Frank David wrote:

Thank you Vero,

If I well understand, r.series return always floating values. But 
from trunk r73206 we expect something different... Ok I will wait for 
the next release, and continue with a int().


But I still not understand from where r.series return such values 
(more or less 0.03) from integer... it's mysterious!


It creates bins that correspond to the data. So for value 1 it creates 
a bin 0.972549-1.003922, etc.


You can try r.describe -i to get integer output.

Moritz


Thank you Mortiz,

but why not 0.5-1.5 or 0.9-1.1, I don't understand the reason of that 
precise floating value... but it's not that important.


Frank

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

Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Frank David

Thank you Vero,

If I well understand, r.series return always floating values. But from 
trunk r73206 we expect something different... Ok I will wait for the 
next release, and continue with a int().


But I still not understand from where r.series return such values (more 
or less 0.03) from integer... it's mysterious!


Frank

Le 9/25/18 à 2:43 PM, Veronica Andreo a écrit :

Hello Frank,

See this related thread: 
https://lists.osgeo.org/pipermail/grass-dev/2018-August/089410.html


The method sum in r.series always returns DCELL. But maybe this is 
also a case in which a check of data type could be done beforehand, so 
the result keeps the original data type.


HTH,
Vero



El mar., 25 sept. 2018 a las 10:51, Frank David 
(mailto:frank.da...@geophom.fr>>) escribió:


Hello all,

I've done a sum with r.series from 8 rasters previously calculated
with r.mapcalc. Each raster cell content is 0 or 1. So the sum
raster cells should have 0 to 8. I was looking at r.category to
set labels like "1 to 2", "3 to 4", etc. To see my raster values,
I've done a r.describe, and the result surprised me :

0.00-0.031373
0.972549-1.003922
1.976471-2.007843
2.980392-3.011765
3.984314-4.015686
4.956863-4.988235
5.960784-5.992157
6.964706-6.996078
7.968627-8.00

instead of :

0
1-1
2-2
...
8-8

If I do int(value) with r.mapcalc in my first raster (value is
integer), r.describe returns integer result as expected.

Why r.describe return float values ? how they are calculated ? why
I must make a int() on a integer to get an integer ?

Since my values are integer, how can I force raster in CELL
instead of DCELL ?

Thanks to help me to understand this !

Regards,

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org <mailto: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] integer and discrete raster

2018-09-25 Thread Frank David

Hello all,

I've done a sum with r.series from 8 rasters previously calculated with 
r.mapcalc. Each raster cell content is 0 or 1. So the sum raster cells 
should have 0 to 8. I was looking at r.category to set labels like "1 to 
2", "3 to 4", etc. To see my raster values, I've done a r.describe, and 
the result surprised me :


0.00-0.031373
0.972549-1.003922
1.976471-2.007843
2.980392-3.011765
3.984314-4.015686
4.956863-4.988235
5.960784-5.992157
6.964706-6.996078
7.968627-8.00

instead of :

0
1-1
2-2
...
8-8

If I do int(value) with r.mapcalc in my first raster (value is integer), 
r.describe returns integer result as expected.


Why r.describe return float values ? how they are calculated ? why I 
must make a int() on a integer to get an integer ?


Since my values are integer, how can I force raster in CELL instead of 
DCELL ?


Thanks to help me to understand this !

Regards,

Frank

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

[GRASS-user] Error on opening workspace

2018-09-20 Thread Frank David

Hello,

Grass 7.4 (and 7.5) failed to open a workspace (with many layers and 
folders). The waiting box stay open and the workspace is not fully loaded.

If I try to save the current workspace, I got the following message :

"Échec d'écriture des paramètres de l'espace de travail courant.

Raison: 'NoneType' object has no attribute 'GetCmd'

Traceback (most recent call last):
  File "/usr/local/grass-7.5.svn/gui/wxpython/lmgr/frame.py", line 
1656, in SaveToWorkspaceFile

WriteWorkspaceFile(lmgr=self, file=tmpfile)
  File "/usr/local/grass-7.5.svn/gui/wxpython/core/workspace.py", line 
900, in __init__

self.__writeLayer(mapTree, item)
  File "/usr/local/grass-7.5.svn/gui/wxpython/core/workspace.py", line 
959, in __writeLayer

item, key='maplayer').GetCmd(
AttributeError: 'NoneType' object has no attribute 'GetCmd'"

I run Grass on Debian9

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

Re: [GRASS-user] r.horizon and negative tilt

2018-07-30 Thread Frank David
Hello Markus,

is it possible to add an option to evaluate the negatives hight in a
future release ? (I don't know C)

Best regards,
Frank
Le 30/07/2018 à 16:19, Markus Metz a écrit :
>
>
> On Sat, Jul 28, 2018 at 3:59 PM, Frank David  <mailto:frank.da...@geophom.fr>> wrote:
> >
> > Dear all,
> >
> > It seems that r.horizon in does not return negative heights. How
> it's possible in case of the given point from the calculation is done
> is located on mountain and the horizon around is below zero ??. I miss
> something may be...
>
> r.horizon is indeed ignoring points that are lower than the given
> point, see
> https://trac.osgeo.org/grass/browser/grass/trunk/raster/r.horizon/main.c#L1037
> and following lines
>
> I agree that this behaviour is questionable
>
> Markus M
>
> >
> > Thank you for your explanations
> >
> > Regards
> >
> > Frank
> >
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org <mailto: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] r.horizon and negative tilt

2018-07-30 Thread Frank David
Ho yes, why not. I  could use r.viewshed to find the farest part of the
topography able to see my point and get it's angle mode. The trick to
find is how to get that cell ?
Best regards,
frank

Le 30/07/2018 à 11:18, balotti@gmail.com a écrit :
> Il 30/07/2018 09:24, Frank David ha scritto:
>> Hi Andrea,
>> Thanks for your message. But what is the ground plane ? r.horizon use
>> the topography, so nothing is plane (and the earth curvature tends to
>> lower the ground). 
> Yes, what you explain below is what I mean with "ground plane".
>> I guess as the calculation is done at ground level, the minimum
>> viewable horizon cannot be lower than zero. The calculation should be
>> done higher than ground level to "see" negatives horizon.
> Have you taken a look to r.viewshed? I never tried it but maybe is
> useful for your purposes.
>> Never mind I will try to create my own r.horizon with r.transect or
>> r.profile.
>> Best regards,
>> Frank
> Best regards,
> Andrea
>
>> Le 30/07/2018 à 08:47, balotti@gmail.com a écrit :
>>> Hi Frank,
>>> just my opinion but r.horizon I suppose is targeted to solar
>>> radiation modules and because of that returns only the line-of-sight
>>> "obstacles" above the ground plane, where direct sunlight may be
>>> obstructed by obstacles.
>>> best regards,
>>>
>>> Andrea Balotti
>>>
>>> Il 28/07/2018 15:59, Frank David ha scritto:
>>>> Dear all,
>>>>
>>>> It seems that r.horizon in does not return negative heights. How
>>>> it's possible in case of the given point from the calculation is
>>>> done is located on mountain and the horizon around is below zero
>>>> ??. I miss something may be...
>>>>
>>>> Thank you for your explanations
>>>>
>>>> Regards
>>>>
>>>> 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] r.horizon and negative tilt

2018-07-30 Thread Frank David
Hi Andrea,
Thanks for your message. But what is the ground plane ? r.horizon use
the topography, so nothing is plane (and the earth curvature tends to
lower the ground). I guess as the calculation is done at ground level,
the minimum viewable horizon cannot be lower than zero. The calculation
should be done higher than ground level to "see" negatives horizon.
Never mind I will try to create my own r.horizon with r.transect or
r.profile.
Best regards,
Frank

Le 30/07/2018 à 08:47, balotti@gmail.com a écrit :
> Hi Frank,
> just my opinion but r.horizon I suppose is targeted to solar radiation
> modules and because of that returns only the line-of-sight "obstacles"
> above the ground plane, where direct sunlight may be obstructed by
> obstacles.
> best regards,
>
> Andrea Balotti
>
> Il 28/07/2018 15:59, Frank David ha scritto:
>> Dear all,
>>
>> It seems that r.horizon in does not return negative heights. How it's
>> possible in case of the given point from the calculation is done is
>> located on mountain and the horizon around is below zero ??. I miss
>> something may be...
>>
>> Thank you for your explanations
>>
>> Regards
>>
>> 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

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

[GRASS-user] r.horizon and negative tilt

2018-07-28 Thread Frank David

Dear all,

It seems that r.horizon in does not return negative heights. How it's 
possible in case of the given point from the calculation is done is 
located on mountain and the horizon around is below zero ??. I miss 
something may be...


Thank you for your explanations

Regards

Frank

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

[GRASS-user] script GUI > G_OPT_V_INPUT vs G_OPT_V_MAP

2018-07-22 Thread Frank David

Hello,

I don't understand the difference between these two entries. Both seems 
to work in a same way for my purpose ...


Thank you for your advice.

Best regards,

Frank

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

[GRASS-user] tmp file

2018-07-20 Thread Frank David
Hello dear grass users,

I'm writing python scripts and I wonder if is there a better way to
handle tmp file between several mapcalc, For the moment I create a tmp
raster file and once I don't need anymore I remove with g.remove. If the
script crash, the tmp raster still exists. If another script run and use
the same tmp name, that could make conflict.

Is there a specific way the handle tmp raster (or vector) file ?

Thank you
Frank

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

Re: [GRASS-user] script option

2018-07-14 Thread Frank David


Le 13/07/2018 à 21:51, Nikos Alexandris a écrit :

* Frank David  [2018-07-13 19:26:36 +0200]:




Le 11/07/2018 à 09:31, Nikos Alexandris a écrit :

* Frank David  [2018-07-10 15:44:51 +0200]:




Le 10/07/2018 à 12:25, Nikos Alexandris a écrit :

* frank  [2018-07-10 08:05:29 +0200]:


Hi dear grass users,

I'm trying to get two field name of an attribute table (ctx_map) 
by the options of the gui. But I can access only at the first one 
and I don't find why...??. See my code below :


#%option G_OPT_V_MAP
#% key: ctx_map
#% description: vector data
#% required : yes
#% guidependency:layer,ctx_wf,ctx_wtg
#%end
#%option G_OPT_V_FIELD
#% key:ctx_layer
#% guidependency:ctx_wf,ctx_wtg
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wf
#% description: wf name
#% required: yes
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wtg
#% description: wtg name
#% required: yes
#%end

Thank you for your help.
Frank


Dear Frank,

Hello Nikos,


if you refer to the last two "column" options,
how do you try to access these, in the script?

Like,

options['ctx_wf']
options['ctx_wtg']

Absolutely


?

Also, what .xml does

x.ScriptName --interface-description

generate?
There is no error on compilation, and help tab display Flags and 
Parameters information, like (french accent are not well encoded):


Parameters:
obj_map=name [required]
Name of vector map
MH ou WTG projet
obj_layer=string
Layer number or name
Vector features can have category values in different layers. This 
number determines which layer to use. When used with direct OGR 
access this is the layer name.

Default: 1
obj_name=name [required]
Nom de l'objet
*ctx_map=name [required] **
**Name of vector map **
*Contexte éolien *
**ctx_layer=string **
**Layer number or name **
**Vector features can have category values in different layers. 
This number determines which layer to use. When used with direct 
OGR access this is the layer name. **

**Default: 1 **
**ctx_wf=name [required] **
*Nom du parc *
**ctx_wtg=name [required] **
*Identifiant éolienne


Ah, and what does `x.ScriptName --ui` return?
Maybe an encoding related issue? Related entries in trac:
https://trac.osgeo.org/grass/search?q=encoding+french=1=on=on=on=on 




Nikos

Hello Nikos,

x.myscript --ui just launch the gui box.
I have found a trick to run the script. Actually I need one field 
from on vector table and 2 fields from an other vector table. like 
that it works :


#%option G_OPT_V_MAP
#% label: MH ou WTG projet
#% required : yes
#% guidependency: layer,obj
#%end
#%option G_OPT_V_FIELD
#% guidependency: obj
#%end
#%option G_OPT_DB_COLUMN
#% key: obj
#% description: Nom de l'objet
#% required: yes
#%end


#%option G_OPT_V_MAP
#% key: ctx_map
#% label: Contexte éolien
#% required : yes
#% guidependency:ctx_layer,ctx_wf,ctx_wtg
#%end
#%option G_OPT_V_FIELD
#% key:ctx_layer
#% guidependency:ctx_wf,ctx_wtg
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wf
#% description: Nom du parc
#% required: yes
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wtg
#% description: Identifiant éolienne
#% required: yes
#%end

But as soon as I try to name myself the first table by Key parameter 
like #%key : obj_map and add key name at layer (like in the second 
part of the code) It does not work anymore... It looks like the fisrt 
map is automatically named "map" by the gui. I don't mind but I find 
this strange. I'm sure there is a explanation,somewhere...

Cheers,
Frank


Perhaps there is something, and experienced developers will notice it 
fast.

Yet, why don't you share a minimal working code? At least the interface,
so I can try myself to compile. Even in private if you
prefer. I am willig to help in understanding this error. So I will learn
about it as well.

Nikos

Hi Nikos,

You can find below the full interface script. The script is not yet 
finished. It may be helps you to understand the problem ?!
I don't really understand how works the parameter guidependency and with 
which key I must connect it. I did not find any doc about that.. do you 
know where I can find that ?


Thanks
Frank


#!/usr/bin/python
#-*-coding:UTF-8 -*-

#%Module
#% description: Calcul de l'intervisibilité entre WTG projet et contexte 
ou objets MH et WTG projet

#% keyword: display
#% keyword: raster
#% keyword: windfarm
#%End

#%option G_OPT_V_MAP
#% label: MH ou WTG projet
#% required : yes
#% guidependency: layer,obj
#%end
#%option G_OPT_V_FIELD
#% guidependency: obj
#%end
#%option G_OPT_DB_COLUMN
#% key: obj
#% description: Nom de l'objet
#% required: yes
#%end


#%option G_OPT_V_MAP
#% key: ctx_map
#% label: Contexte éolien
#% required : yes
#% guidependency:ctx_layer,ctx_wf,ctx_wtg
#%end
#%option G_OPT_V_FIELD
#% key:ctx_layer
#% guidependency:ctx_wf,ctx_wtg
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wf
#% description: Nom du parc
#% required: yes
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wtg
#% description: Identifiant éolienne
#% required: yes
#%end

#%Option
#% key: string_zvi_obj
#% type: string
#% answer : c

Re: [GRASS-user] script option

2018-07-13 Thread Frank David



Le 11/07/2018 à 09:31, Nikos Alexandris a écrit :

* Frank David  [2018-07-10 15:44:51 +0200]:




Le 10/07/2018 à 12:25, Nikos Alexandris a écrit :

* frank  [2018-07-10 08:05:29 +0200]:


Hi dear grass users,

I'm trying to get two field name of an attribute table (ctx_map) by 
the options of the gui. But I can access only at the first one and 
I don't find why...??. See my code below :


#%option G_OPT_V_MAP
#% key: ctx_map
#% description: vector data
#% required : yes
#% guidependency:layer,ctx_wf,ctx_wtg
#%end
#%option G_OPT_V_FIELD
#% key:ctx_layer
#% guidependency:ctx_wf,ctx_wtg
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wf
#% description: wf name
#% required: yes
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wtg
#% description: wtg name
#% required: yes
#%end

Thank you for your help.
Frank


Dear Frank,

Hello Nikos,


if you refer to the last two "column" options,
how do you try to access these, in the script?

Like,

options['ctx_wf']
options['ctx_wtg']

Absolutely


?

Also, what .xml does

x.ScriptName --interface-description

generate?
There is no error on compilation, and help tab display Flags and 
Parameters information, like (french accent are not well encoded):


Parameters:
obj_map=name [required]
Name of vector map
MH ou WTG projet
obj_layer=string
Layer number or name
Vector features can have category values in different layers. This 
number determines which layer to use. When used with direct OGR 
access this is the layer name.

Default: 1
obj_name=name [required]
Nom de l'objet
*ctx_map=name [required] **
**Name of vector map **
*Contexte éolien *
**ctx_layer=string **
**Layer number or name **
**Vector features can have category values in different layers. This 
number determines which layer to use. When used with direct OGR 
access this is the layer name. **

**Default: 1 **
**ctx_wf=name [required] **
*Nom du parc *
**ctx_wtg=name [required] **
*Identifiant éolienne


Ah, and what does `x.ScriptName --ui` return?
Maybe an encoding related issue? Related entries in trac:
https://trac.osgeo.org/grass/search?q=encoding+french=1=on=on=on=on 



Nikos

Hello Nikos,

x.myscript --ui just launch the gui box.
I have found a trick to run the script. Actually I need one field from 
on vector table and 2 fields from an other vector table. like that it 
works :


#%option G_OPT_V_MAP
#% label: MH ou WTG projet
#% required : yes
#% guidependency: layer,obj
#%end
#%option G_OPT_V_FIELD
#% guidependency: obj
#%end
#%option G_OPT_DB_COLUMN
#% key: obj
#% description: Nom de l'objet
#% required: yes
#%end


#%option G_OPT_V_MAP
#% key: ctx_map
#% label: Contexte éolien
#% required : yes
#% guidependency:ctx_layer,ctx_wf,ctx_wtg
#%end
#%option G_OPT_V_FIELD
#% key:ctx_layer
#% guidependency:ctx_wf,ctx_wtg
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wf
#% description: Nom du parc
#% required: yes
#%end
#%option G_OPT_DB_COLUMN
#% key:ctx_wtg
#% description: Identifiant éolienne
#% required: yes
#%end

But as soon as I try to name myself the first table by Key parameter 
like #%key : obj_map and add key name at layer (like in the second part 
of the code) It does not work anymore... It looks like the fisrt map is 
automatically named "map" by the gui. I don't mind but I find this 
strange. I'm sure there is a explanation,somewhere...

Cheers,
Frank

--
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

  1   2   >