shadowmask() takes exactly 5 arguments (6 given)

20 views
Skip to first unread message

Chris Holcomb

unread,
Aug 22, 2014, 2:55:14 PM8/22/14
to rsgislib...@googlegroups.com
Any ideas?

import rsgislib
from rsgislib import elevation
from rsgislib.elevation import shadowmask
inputImage = '/home/elevation.tif'
outputImage = '/home/shadow.tif'
solarAzimuth = 80.214
solarZenith = 183.04
gdalFormat = 'GTiff'
maxHeight = 510
shadowmask(inputImage, outputImage, solarAzimuth, solarZenith, maxHeight, gdalFormat)

Thank you!

Chris

Daniel Clewley

unread,
Aug 22, 2014, 3:50:04 PM8/22/14
to Chris Holcomb, rsgislib...@googlegroups.com
Hi Chris,


Thanks,

Dan

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at http://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

Chris Holcomb

unread,
Aug 23, 2014, 10:26:35 PM8/23/14
to rsgislib...@googlegroups.com, hol...@thebutlerfirm.com
Hey Dan I look forward to using the tool. Thanks for quickly opening this ticket, as I'm under an abnormal time crunch for finding a solution for this. Please let me know if I need to run further tests on my end.

Cheers,

Chris

Pete Bunting

unread,
Aug 24, 2014, 12:51:25 PM8/24/14
to Chris Holcomb, rsgislib...@googlegroups.com
Hi Chris and Dan, 

I have had a look at this issue and fixed the bug. This is a command which was implemented quite some while ago and it hasn’t been used very much so please let me know if you see any results which aren’t what you expect. Note that it’s performing a ray-tracing so it does take a little while to execute. 

I’d suggest running a median filter to tidy up the result, see the python code below. 

Cheers, Pete


import rsgislib.elevation
import rsgislib.rastergis
import rsgislib.imagefilter
import rsgislib

inputImage = "/Users/pete/Desktop/TestShadowMask/Wales_fltg_grtr0_subset2.kea"
outputMaskImage = "/Users/pete/Desktop/TestShadowMask/Wales_fltg_grtr0_subset2_mask.kea"
outputHSImage = "/Users/pete/Desktop/TestShadowMask/Wales_fltg_grtr0_subset2_hs.kea"
solarAzimuth = 315 
solarZenith = 45
maxHeight = 1200
gdalFormat = "KEA"

#rsgislib.elevation.shadowmask(inputImage, outputMaskImage, solarAzimuth, solarZenith, maxHeight, gdalFormat)


outputMaskImageMed = '/Users/pete/Desktop/TestShadowMask/Wales_fltg_grtr0_subset2_mask'
gdalFormat = 'KEA'
outExt = 'kea'
filters = []
filters.append(rsgislib.imagefilter.FilterParameters(filterType = 'Median', fileEnding = 'med', size=3) )
# Apply filters
rsgislib.imagefilter.applyfilters(outputMaskImage, outputMaskImageMed, filters, gdalFormat, outExt, rsgislib.TYPE_8UINT)

outputMaskImageMed = outputMaskImageMed +"_med.kea"

rsgislib.rastergis.populateStats(clumps=outputMaskImageMed, addclrtab=True, calcpyramids=True, ignorezero=True, ratband=1)

****************************************************
* Dr Pete Bunting
* Senior Lecturer in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK

* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************
Reply all
Reply to author
Forward
0 new messages