# Unobstructed Views: Scenic Quality Provision AttributeError

**URL:** <https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062>\
**Category:** Software Support\
**Tags:** scenic-quality\
**Created:** [June 12, 2020, 6:29pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062 "2020-06-12T18:29:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarahhalperin](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sarahhalperin](https://community.naturalcapitalalliance.org/u/sarahhalperin)\
**Post date:** [June 12, 2020, 6:29pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/1 "2020-06-12T18:29:34Z")

</div>

Hi,

I am having trouble running the Unobstructed Views model and keep getting an error titled “Attribute Error encountered: ‘NoneType’ object has no attribute 'GetRasterBand”. I can see people have had similar issue with other models and hoping somehow can help me out.

I really appreciate your help!

I believe the issue is with the DEM data, however, I am not entirely sure. I have attached it here.  
Sarah[ISU\_Ned.tif](https://community.naturalcapitalalliance.org/uploads/short-url/bvfpPmQ7Mv1moGdMtjaXtJxLdzt.tif) (513.4 KB)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 12, 2020, 11:12pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/2 "2020-06-12T23:12:25Z")

</div>

Hi @sarahhalperin, usually these issues have something to do with opening a raster file, but it’s hard to say exactly which raster is causing this issue offhand. Could you attach the logfile from this run of InVEST so that we can take a closer look at where this error is occurring?

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![sarahhalperin](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sarahhalperin](https://community.naturalcapitalalliance.org/u/sarahhalperin)\
**Post date:** [June 15, 2020, 2:17pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/3 "2020-06-15T14:17:25Z")

</div>

Thank you so much! I really appreciate your help. Please find the log attached. There is only one raster in the model which is the DEM. I have tried multiple DEM files and all of them come back with that error. I also see in the intermediate files that the DEM has successfully been clipped.

[InVEST-Scenic-Quality-log-2020-06-12–12\_12\_45.txt.zip](https://community.naturalcapitalalliance.org/uploads/short-url/bCalN4QFzvoUFXiEvdo1zB5YA15.zip) (423.5 KB)

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 16, 2020, 1:23am UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/4 "2020-06-16T01:23:34Z")

</div>

Ah! Now this is an interesting error … really gets at some low-level restrictions of the operating system there 🙂 Not every day that we see something like this! Basically, because you have so many viewpoints, the model had far too many files open and that was causing an error. If that hadn’t crashed, I suspect there would have been a _different_ error a little later on.

In any case, could you try running this development build and see if that corrects the issue for you and let me know how it goes? I think you’re on a mac (based on the logfile) so here’s the mac binary: [https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post44%2Bgf87794e8/InVEST-3.8.2.post44%2Bgf87794e8-mac.zip](https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post44%2Bgf87794e8/InVEST-3.8.2.post44%2Bgf87794e8-mac.zip)

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![sarahhalperin](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sarahhalperin](https://community.naturalcapitalalliance.org/u/sarahhalperin)\
**Post date:** [June 16, 2020, 4:30pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/5 "2020-06-16T16:30:11Z")

</div>

Hi James,

Thank you! I tried running with the development build and still got the same error. However, when I ran with less viewpoints it worked perfectly fine. I will reconsider how many points I need and try running it on my office desktop and see if that helps. Thank you so much for the help!

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 16, 2020, 4:42pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/6 "2020-06-16T16:42:56Z")

</div>

Thanks for trying out the development build! I’m glad things are at least working with fewer viewpoints, but I’d still like to fix this issue if at all possible. Would it be possible to share your inputs so I can try to reproduce it on my end? Feel free to attach them here to the thread or dropbox/gdrive/email them to jdouglass@stanford.edu. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![sarahhalperin](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sarahhalperin](https://community.naturalcapitalalliance.org/u/sarahhalperin)\
**Post date:** [June 16, 2020, 4:50pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/7 "2020-06-16T16:50:26Z")

</div>

No problem! I really appreciate your help. I have sent you a link to a gdrive folder. Let me know if you have any problems with accessing the data.

---

<div class="post-metadata">

**Author:** ![rmgriffin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/rmgriffin/32/23_2.png) [@rmgriffin](https://community.naturalcapitalalliance.org/u/rmgriffin)\
**Post date:** [June 16, 2020, 6:17pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/8 "2020-06-16T18:17:21Z")

</div>

One thing to note with this model is that, depending on your use case, a simple workaround here would be to split it up into multiple runs using subsets of your points. I think the model is currently designed to take advantage of parallel processing, so this shouldn’t be necessary if James can sort this out - but worth keeping in mind. If you have a really computationally demanding application, even for parallel processing, you could take advantage of this fact to run it on both of your computers, for example. This helped me considerably in an [early application](https://doi.org/10.1016/j.marpol.2015.09.024) of this model I was involved in.

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 16, 2020, 8:35pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/9 "2020-06-16T20:35:43Z")

</div>

Hi @sarahhalperin, I don’t see the invitation to the gdrive folder … could you maybe try resending the link? Thanks!

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [June 17, 2020, 10:22pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/10 "2020-06-17T22:22:28Z")

</div>

OK! @sarahhalperin, thanks again for sharing your inputs to the model over email. I was able to reproduce the issue and made a few improvements to the model that should make it much, much more reliable when running on lots of viewpoints. It should also be a bit faster, too, and even more so on repeated runs using the same workspace. Here’s another development build in case you’d like to try out these latest changes: [https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post50%2Bg78913a2c/InVEST-3.8.2.post50%2Bg78913a2c-mac.zip](https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.8.2.post50%2Bg78913a2c/InVEST-3.8.2.post50%2Bg78913a2c-mac.zip)

Of course, running it on fewer points, or splitting the modelling across a few computers as @rmgriffin mentioned would also help to work around the issue!

James

---

<div class="post-metadata">

**Author:** ![sarahhalperin](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@sarahhalperin](https://community.naturalcapitalalliance.org/u/sarahhalperin)\
**Post date:** [June 18, 2020, 2:06pm UTC](https://community.naturalcapitalalliance.org/t/unobstructed-views-scenic-quality-provision-attributeerror/1062/11 "2020-06-18T14:06:46Z")

</div>

Thank you so much! I really appreciate all the time you spent on this.
