gdal

how to project a flat image to spherical mercator EPGS:900013 to use in a Image Layer in openlayers

依然范特西╮ 提交于 2019-12-11 02:26:35
问题 I have a flat 400x400 pixels image which represents an area of 400x400 kilometers. I need to draw this image as an overlay on my OpenLayers mapping system. I use OpenStreetMap/Google Maps as base layers. I want to draw the overlay image using an Image Layer and I want to center my overlay image at a specific lat/lon point. The projection of the base layer is EPSG:900913 which is, in fact, the projection used by OpenStreetMap and Google Maps. What I have understood (please correct me if I'm

Can't get Python IDLE to recognize OGR/GDAL Module

落花浮王杯 提交于 2019-12-11 02:19:01
问题 Folks, Just getting started using OGR and Python for a variety of geospatial tasks. I'm working outside of OSGEO4w, and have installed GDAL w/ Python Bindings as well as Python v. 2.7.8 on my machine. That said, I can run python and import gdal from a command-line interface but am unable to import the module when I use the IDLE environment. It returns an error telling me that the module doesn't exist. My install must be sound given that it works in the cmd prompt, so what's the deal? This is

Does ComputeBandStats take nodata into account?

旧巷老猫 提交于 2019-12-11 00:41:22
问题 I am trying to compute the stats for an image which is only partly covered by data. I would like to know if ComputeBandStats ignores the pixels with the same value as the files nodata. Here is my code: inIMG = gdal.Open(infile) # getting stats for the first 3 bands # Using ComputeBandStats insted of stats array has min, max, mean and sd values print "Computing band statistics" bandas = [inIMG.GetRasterBand(b+1) for b in range(3)] minMax = [b.ComputeRasterMinMax() for b in bandas] meanSD = [b

Saving a large color image as `GTiff` with `gdal`

ぐ巨炮叔叔 提交于 2019-12-10 21:25:33
问题 I'm trying to save a large image of size (15000, 80000, 3) . This array is a numpy array that I initialized as im_final = np.zeros((15000,80000,,3)) . To do the saving, I use gdal like so: dst_ds = gdal.GetDriverByName('GTiff').Create('val.tif', 80000, 15000, 3, gdal.GDT_Byte) dst_ds.GetRasterBand(1).WriteArray(im_final[:,:,0]) # write r-band to the raster dst_ds.GetRasterBand(2).WriteArray(im_final[:,:,1]) # write g-band to the raster dst_ds.GetRasterBand(3).WriteArray(im_final[:,:,2]) #

Python gdal undefined symbol GDALRasterBandGetVirtualMem

自作多情 提交于 2019-12-10 21:25:30
问题 I'm trying to use Python GDAL bindings. When naively installing bindings through pip, installation fails with error: 'VSIFTruncateL' was not declared in this scope, probably due to a mismatch of the installed headers and the python bindings version. The proposed solution elsewhere is to install the exact same version through pip. However, my system has gdal-1.7.3 , and there are no 1.7.3 bindings. Installing 1.7.1 bindings leads to successful compilation, but attempting to run leads to

Error while trying to install GDAL using pip and easy_install with Python2.7 on Ubuntu 12.10

孤者浪人 提交于 2019-12-10 18:06:03
问题 My Error is __main__.gdal_config_error: [Errno 2] No such file or directory I get this while trying to install GDAL using pip and easy_install with Python2.7 on Ubuntu 12.10. 回答1: try this: sudo apt-get install python-gdal 回答2: Try this: sudo add-apt-repository ppa:ubuntugis/ppa sudo apt-get update sudo apt-get install gdal Source 来源: https://stackoverflow.com/questions/15004590/error-while-trying-to-install-gdal-using-pip-and-easy-install-with-python2-7-on

rgdal won't install on AWS RStudio AMI

試著忘記壹切 提交于 2019-12-10 10:15:50
问题 I have managed to successfully launch the most recent RStudio AWS EC2 instance (louisaslett.com, RStudio-1.1383_R-3.4.2…ubuntu-16.04-LTS-64). R operates mostly as expected in this instance, and I can install and open a number of packages. However I get an error if I try to install either of the rgdal of gdalUtils packages. Below is the console output when I attempt to install rgdal. The output for the gdalUtils install is too long to include here, but both include the text "error: upgrade

Python GDAL does not install on Mac OSX El Capitan

感情迁移 提交于 2019-12-09 23:02:42
问题 I am having several issues when installing pygdal in my Mac OSX El capitan. The procedure is the folowing: Install GDAL Libraries from http://www.kyngchaos.com/software/frameworks#gdal_complete pip install gdal The output is the following: . . . extensions/gdal_wrap.cpp:3085:10: fatal error: 'cpl_port.h' file not found #include "cpl_port.h" ^ 2 warnings and 1 error generated. error: command 'cc' failed with exit status 1 Looks like the installer cannot find the GDAL libraries, or headers

GDAL GDALRATSetValueAsString() how to save Chinese characters (c#)?

送分小仙女□ 提交于 2019-12-09 15:16:33
问题 I need help with GDAL. The string value with Chinese symbols is not readed/saved correctly (C#). For SAVING grid value we using: private static extern void GDALRATSetValueAsString(IntPtr handle, int row, int field, [In][MarshalAs(UnmanagedType.LPStr)] string value); method (c#) to save string value, it seems that this method saves string as ANSI string . For READING: private static extern IntPtr GDALRATGetValueAsString(IntPtr handle, int row, int field); In. Example my string "银行Flamwood C2"

rgdal doesn't recognize GDAL version

帅比萌擦擦* 提交于 2019-12-08 12:13:17
问题 I'm trying to installed rgdal on RHEL 6. I've install GDAL version 1.7.3 and PROJ version 4.7.0-1. When I run install.packages("rgdal") I get the following error: checking gdal-config usability... yes configure: GDAL: 1.7.3 checking GDAL version >= 1.11.4... no configure: error: upgrade GDAL to 1.11.4 or later ERROR: configuration failed for package ârgdalâ * removing â/usr/lib64/R/library/rgdalâ The rgdal CRAN page says you need GDAL 1.1 or above. Is GDAL 1.7 not supported? Can anyone show