gdal

ImportError: No module named gdal

拥有回忆 提交于 2019-12-17 16:59:27
问题 My GDAL is showing strange behaviour when I try to use ".py" functions from the command line: 1. For example, when I run gdalinfo --version , I get the standard response: GDAL 1.11.3, released 2015/09/16 2. Also when I run gdalwarp , I get the standard response showing me the flags and everything. 3. Problem: However, when I run gdal functions with a .py extension, for example gdal_polygonize.py , I get the following: Traceback <most recent call last>: File "C:\OSGeoW64\bin\gdal_polygonize.py

How can type 'SwigPyObject be registered using copy_reg.pickle in Python?

為{幸葍}努か 提交于 2019-12-14 03:48:44
问题 I have a class method which I would like to use with multiprocessing.Pool for parallelisation. As class instances are not pickleable, I have used the following: import copy_reg import types def _reduce_method(m): if m.im_self is None: return getattr, (m.im_class, m.im_func.func_name) else: return getattr, (m.im_self, m.im_func.func_name) copy_reg.pickle(types.MethodType, _reduce_method) This works no problem. However, within my class I use the GDAL module (https://pypi.org/project/GDAL/) for

How to convert point data collected at grid interval to a georeferenced dataset in r?

眉间皱痕 提交于 2019-12-13 17:06:08
问题 I have this dataset: https://www.dropbox.com/s/k06n9l05t25r6x2/newdata.csv?dl=0 (Sample) "","row","col","flagrv" "1",2361,530,2 "2",2378,531,2 "3",2360,531,2 "4",2355,531,2 "5",2363,532,2 "6",2359,532,2 "7",2368,533,2 "8",2367,533,2 "10",2359,533,2 And if I plot using this code: gs.pal <- colorRampPalette(c("blue", "green","yellow","orange","red"),bias=1,space="rgb") ggplot(data=ndata,aes(x=col,y=row,color=flagrv)) + geom_point(size = 0.01)+ scale_colour_gradientn(name = "Scale",colours = gs

can not open input file libpng15-vc9.lib

天涯浪子 提交于 2019-12-13 08:24:09
问题 I am setting up my GDAL 1.8.0 Project in Visual Studio 2010 Windows, I am on way to add libpng to project. My libpng release libs are under following folder... They are successfully built with zlib in this folder, as you can see there are no files missing as per VTP site. D:\libpng-16 And I have also changed additional libraries file names. Even though I added path in Property Manager, this error is still coming. Still I am getting following error Thank You in advance. 回答1: you should give

Working with rasters in file geodatabase (.gdb) with GDAL

大憨熊 提交于 2019-12-13 04:49:31
问题 I'm working on a tool that converts raster layers to arrays for processing with NumPy, and ideally I would like to be able to work with rasters that come packaged in a .gdb without exporting them all (especially if this requires engaging ArcGIS or ArcPy). Is this possible with the OpenFileGDB driver? From what I can tell this driver seems to treat raster layers the same as vector layers, which gives you access to some data about the layer but doesn't give you the ReadAsArray functionality.

Rgdal package installation on Amazon Linux AMI

本小妞迷上赌 提交于 2019-12-13 02:25:34
问题 I've installed geos, proj-4.8.0 and gdal-1.9.2, yet, after installing the R package rgeos, rgdal fails to install. Here is a look at my home directory: . . . and the error I get running install.packages("rgdal", type="source") : ** building package indices ** installing vignettes ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/mainstorage/michaeld/R/x86_64-redhat-linux-gnu-library/3.1/rgdal/libs/rgdal.so': libgdal

Struggling to compile gdal with hdf4 support

冷暖自知 提交于 2019-12-13 00:10:04
问题 I am unable to compile gdal with hdf4 support using bash on a mac osx el capitan version 10.11.6. I began with the homebrew approach to building gdal described on the osgeo website. Unfortunately, hdf4 is not by default supported by gdal. The hdf format page includes a great description of the hdf4 data structure but fails to help getting support for gdal. I've installed the szip, zlib, and jpeg libraries discussed here, and reviewed the struggles described by /u/dschneiderch here. The github

Python 3: How to change image data in GDAL?

风流意气都作罢 提交于 2019-12-12 09:48:45
问题 I have a GeoTIFF image that contains a color table and a single raster band with 8-bit table keys, and that uses LZW compression, that I load with gdal.Open. I also have a numpy array containing 24-bit RGB-values (for a blurred version of the image), corresponding to three 8-bit raster bands. I need to substitute these three raster bands for the raster band that is currently in the image, and then save the image (preferably as a new file if possible). How do I do that? I would like to keep

Django migration can't find GDALRaster

荒凉一梦 提交于 2019-12-12 08:54:57
问题 I took over a project with Django, Django REST framework and Leaflet to store drawn path in a database. Installing Django in an virtualenv and trying to migrate it raises: File "D:\SHK\ElektroClean\venv\lib\site-packages\django\contrib\gis\db\backends\postgis\operations.py", line 7, in from django.contrib.gis.gdal import GDALRaster ImportError: cannot import name 'GDALRaster' In the directory D:\SHK\ElektroClean\py27\Lib\site-packages\django\contrib\gis\gdal is a folder called raster. Is

GDAL WriteArray issue

陌路散爱 提交于 2019-12-12 07:59:33
问题 I'm utilizing python GDAL to write a raster data into a .tif file. Here's the code: import numpy, sys from osgeo import gdal, utils from osgeo.gdalconst import * # register all of the GDAL drivers gdal.AllRegister() # open the image inDs = gdal.Open("C:\\Documents and Settings\\patrick\\Desktop\\tiff elevation\\EBK1KM\\color_a1.tif",GDT_UInt16) if inDs is None: print "couldn't open input dataset" sys.exit(1) else: print "opening was successful!" cols = inDs.RasterXSize rows = inDs.RasterYSize