[GRASS-dev] new addon: v.faultdirections
Moritz Lennert
mlennert at club.worldonline.be
Mon Nov 7 07:45:22 PST 2016
On 07/11/16 10:25, Helmut Kudrnovsky wrote:
> Moritz Lennert wrote
>>>
>>> maybe some issue with the matplotlib backend?
>>>
>>> see
>>>
>>> https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.width.funct/r.width.funct.py#L46
>>> https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.hypso/r.hypso.py#L52
>>>
>>> where I've added some lines that it works also on windows.
>>
>> Thanks Helmut ! I've just committed the same. Could you try if that
>> makes it work ?
>
> https://wingrass.fsv.cvut.cz/grass73/x86_64/addons/grass-7.3.svn/logs/
>
> it compiles now also on windows.
>
> a quick test with
>
> v.report map=test at user1 option=length
> cat|vazimuth|length
> 1|244.950779|9348.35400342
> 2|221.312441|9951.01054944
> 3|199.83213|9730.81864487
> 4|175.322582|9600.70580563
> 5|141.98849|3207.86482835
> 6|94.698681|2123.01170046
> 7|277.507347|3772.31624213
> 8|285.610989|2051.88943075
> 9|71.113913|1169.71795667
> 10|78.146996|2419.67219737
> 11|90|2231.6347053
> 12|164.298026|7512.31179866
> 13|213.13561|7509.69092987
> 14|241.484453|8406.23126945
> 15|247.890552|7014.05058479
> 16|251.482848|6388.22365365
>
> v.faultdirections map=test at user1 column=vazimuth
> C:\OSGEO4~1\apps\Python27\lib\site-
> packages\matplotlib-1.3.1-py2.7-win-
> amd64.egg\matplotlib\cbook.py:1711:
> VisibleDeprecationWarning: using a non-integer number
> instead of an integer will result in an error in the future
> result = np.zeros(new_shape, a.dtype)
>
> some matplotlib warning, but a nice polar barplot is created.
I don't see these warnings, but then again, I have matplotlib 1.5.3...
>
> polar barplot polar barplot
> <http://osgeo-org.1560.x6.nabble.com/file/n5294559/figure_1.png>
>
> but I get an error when using
>
> -a Use absolute values in legend, instead of percentages
>
> v.faultdirections -a map=test at user1 column=vazimuth
> Traceback (most recent call last):
> File "C:\Users\hkmyr\AppData\Roaming\GRASS7\addons/scripts
> /v.faultdirections.py", line 100, in <module>
> sys.exit(main())
> File "C:\Users\hkmyr\AppData\Roaming\GRASS7\addons/scripts
> /v.faultdirections.py", line 87, in main
> labelradii = [x for x in np.arange(0,
> int(np.ceil(max(radii))), labelstep) if x > 0]
> ZeroDivisionError: division by zero
>
>
This was due to the fact that in your example there are only very few
lines per direction. I believe I solved this issue in r69786.
Thanks for testing !
Moritz
More information about the grass-dev
mailing list