[GRASS-user] r.shade python issues

Gareth Grewcock garethgrewcock at gmail.com
Wed May 25 02:36:10 PDT 2016


Hi Vaclav - I agree, the GRASS GIS functionality itself is brilliant and is
just what I need and the issue does lie with Python.

That said, it is a bit strange with what is going on, using the module
object works for other modules apart from r.shade, I seem to get an XML
parsing error: *xml.etree.ElementTree.ParseError: no element found: line 1,
column 0*

Can anybody advise what the correct syntax should be for using r.shade with
pygrass please?

I can't even seem to be able to initialize the *r.shade* module as per the
wiki but I can others.

This works:

*slope_aspect = Module('r.slope.aspect')*

This doesn't:

*shade = Module('r.shade')*

Thanks,
Gareth


On Tue, May 24, 2016 at 10:29 PM, Vaclav Petras <wenzeslaus at gmail.com>
wrote:

>
> On Tue, May 24, 2016 at 1:11 PM, Laurent C. <lrntct at gmail.com> wrote:
>
>> 2016-05-24 4:36 GMT-05:00 Gareth Grewcock <garethgrewcock at gmail.com>:
>> > Again - thanks for all the help so far, it is much appreciated.
>> >
>> > Laurent - I ran the read2_command and it returned the following:
>> >
>> > output='shaded_raster_hillshade_map', brighten='25', overwrite=True)
>> > AttributeError: 'module' object has no attribute 'read2_command'
>>
>> You have to define the function yourself with the code from the wiki,
>> it is not part of the GRASS scripting library.
>
>
> Hi all,
>
> let me enter the conversation here.
>
> Gareth, using custom function might be quite an overkill here, the
> original problem was wrong Python syntax (unrelated to any GRASS GIS
> functionality).
>
> Laurent, if you think you must consistently use some custom function, then
> you should consider opening a enhancement ticket and ideally provide a
> patch as well. What you are using might be useful for others.
>
> Best,
> Vaclav
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160525/58bd05f5/attachment.html>


More information about the grass-user mailing list