1

Everytime I use the viewsheds plugin up to this point I get an memory error. I projected my raster files and the point which I added as an observervation point into a metric system (EPSG:3857 - WGS 84 / Pseudo Mercator) and still no luck. The error I get is the following:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:/Users/Milevski/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysis.py", line 194, in run
    z_obs_field, z_target_field, curv, refraction)
  File "C:/Users/Milevski/.qgis2/python/plugins\ViewshedAnalysis\doViewshed.py", line 496, in Viewshed
    mx_dist = numpy.sqrt(temp_x[:,None] + temp_y[None,:])
MemoryError

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.6.0-Brighton Brighton, exported
0

The units for the EPSG:3857 projection is not meters but degrees: https://en.wikipedia.org/wiki/Web_Mercator

So if you input 100 as the viewshed radius in degrees the radius in kilometers could be up to 100*111km (111km is what a degree corresponds to at the equator. This value will diminish as you move toward either pole, but chances are it will be very substantial).

If your data is confined to a small area, e.g. not on a continental level, I suggest you transform into a another projection, which uses meters as the units, then your calculations will probably not be memory constrained.

The projection you chose depends on where in the world your data is situated and if you want area or distance true projection. look into the Universal Transverse Mercator projections if your area is small enough:

http://geokov.com/education/utm.aspx

Alternatively you can calculate the degree to meter ratio for the latitude your data is positioned at and use the right degree input for your viewshed input. Link to an online calculator below:

http://msi.nga.mil/MSISiteContent/StaticFiles/Calculators/degree.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.