gdal

Parsing osm.pbf data using GDAL/OGR python module

青春壹個敷衍的年華 提交于 2019-12-05 23:46:00
I'm trying to extract data from an OSM.PBF file using the python GDAL/OGR module. Currently my code looks like this: import gdal, ogr osm = ogr.Open('file.osm.pbf') ## Select multipolygon from the layer layer = osm.GetLayer(3) # Create list to store pubs pubs = [] for feat in layer: if feat.GetField('amenity') == 'pub': pubs.append(feat) While this little bit of code works fine with small.pbf files (15mb). However, when parsing files larger than 50mb I get the following error: ERROR 1: Too many features have accumulated in points layer. Use OGR_INTERLEAVED_READING=YES MODE When I turn this

gdal/ogr: How to really crop a shapefile?

心已入冬 提交于 2019-12-05 22:54:18
问题 Given a SHP file corresponding to European countries , and... Given defined area corresponting to France such : West : 005° 48' W East : 010° E North : 051° 30' N South : 041° N How to get only the dots/geometries which intersects my defined area with gdal ? so my crop indeed is a real crop, which just keep the necessary geometries. Strong preference to gdal , ogr or console solutions. 回答1: Use GDAL's ogr2ogr command-line utility. If you have a file Europe.shp which has a spatial reference

rgdal won't install on AWS RStudio AMI

做~自己de王妃 提交于 2019-12-05 22:10:19
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 GDAL to 1.11.4 or later" which I suspect is the problem, but have no idea how to correct. Any thoughts or

Installing gdal-config on my linux

放肆的年华 提交于 2019-12-05 21:26:32
I search the entire net could not find a guide to get gdal-config . I have yum but yum does not have gdal-config , i already installed gdal . I just need to be able to do this on shell - gdal-config and not get a command not found error. My distro is Fedora. I don't have apt-get . You probaby have "yum" instead of "apt-get" on Fedora. Try.. yum install gdal gdal-devel I had a similar problem, that is "gdal-config" was missing. I could solve it by installing the development packages. So you could try installing gdal-dev . Ezra Boyd I'm running Ubuntu 16.04, so I use apt-get instead of Yum. But

no such option: --no-install

断了今生、忘了曾经 提交于 2019-12-05 12:59:23
I am trying to setup cartodb in ubuntu 12.04 by following https://github.com/danseely/cartodb-install/blob/master/DEV-INSTALLATION.md and as a part of the installation, there are some python dependencies to be installed.Below is a part which i tried export CPLUS_INCLUDE_PATH=/usr/include/gdal export C_INCLUDE_PATH=/usr/include/gdal sudo pip install --no-install GDAL While giving sudo pip install --no-install GDAL it is giving an error no such option --no-install. FYI i have python 2.7 dev version installed.I don't know whats wrong. Help would be appreciated. The --no-install option has been

python: perform gdalwarp in memory with gdal bindings

扶醉桌前 提交于 2019-12-05 10:09:52
I currently have a processing chain in R which downloads MODIS data and then calls gdalwarp from the system to reproject a specific subdataset (e.g. NDVI) into WGS1984. The resulting GeoTiffs are then collected into an HDF5 file for further processing. Now I'm moving the processing chain to python , and I was wondering if there's a way to skip the step of writing GeoTiffs to disk with the functionalities of the gdal module. To be clear, the question is: Can i perform gdalwarp with using strictly the python bindings from the gdal module and without writing to disk? I've been researching a bit

Install GDAL on Python 2.7 on a Amazon Linux virtual server

蹲街弑〆低调 提交于 2019-12-05 06:47:47
问题 I have a t2.micro Amazon Linux instance running. Python 2.7.12 is pre-installed already. I would like to install GDAL with the Python. I have got gcc c++ and numpy installed. None of the following commands worked for me: sudo yum install gdal-devel sudo yum install gdal sudo yum install python-gdal They all resulted in a following message saying. No package {PACKAGE_NAME} available. Error: Nothing to do I cannot run apt-get on a Amazon Linux instance. Also none of the relevant SO posts worked

RGDAL won't install

余生长醉 提交于 2019-12-05 03:06:43
I can't get RGDAL to install in R. I'm using Ubuntu 12.04. configure: error: gdal-config not found or not executable. ERROR: configuration failed for package ‘rgdal’ * removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.2/rgdal’ Warning in install.packages : installation of package ‘rgdal’ had non-zero exit status I found some solutions which said to do this: sudo apt-get install aptitude sudo aptitude install libgdal-dev sudo aptitude install libproj-dev I follow these through, accepting 'yes' when prompted, but afterwards the same original error. It doesn't resolve it. I wonder whether I

Linker Error Building GDAL

折月煮酒 提交于 2019-12-05 01:50:55
问题 I am building GDAL from source using the MSVC 2015 64-bit command prompt. I am using Windows 8. Part way through the build, I get the following error: Creating library gdal_i.lib and object gdal_i.exp odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol _vsnwprintf_s referenced in function StringCchPrintfW gdal201.dll : fatal error LNK1120: 1 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return

How can I get the installed GDAL/OGR version from python?

做~自己de王妃 提交于 2019-12-05 01:37:25
How can I get the installed GDAL/OGR version from python? I aware of the gdal-config program and are currently using the following: In [3]: import commands In [4]: commands.getoutput('gdal-config --version') Out[4]: '1.7.2' However, I suspect there is a way to do this using the python API itself. Any dice? gdal.VersionInfo() does what I want: >>> osgeo.gdal.VersionInfo() '1604' This works on both my Windows box and Ubuntu install. gdal.__version__ gives an error on my Windows installation, although it works on my Ubuntu installation: >>> import osgeo.gdal >>> print osgeo.gdal.__version__