0
votes
0answers
21 views

Read large raster into lat/lon value pair to csv file using python and/or gdal?

I have rasters for all of the states in US and they are in 10m resolution. So they can be very large, containing a large number of pixels if you think of TX or AK. I want to create a csv file with ...
0
votes
1answer
15 views

Adding a Vertex To Exisiting Feature(linear) Using OGR Python

I am working on a project that involves finding the intersection of linears in a shapefile, if that vertex(the found intersection) doesn't already exist for each(or one) of the features, then that ...
0
votes
2answers
40 views

gdal2Tiles output differs from MapTiler

I'm in need to process a large batch of Landsat images with MapTiler and since the version I'm using (1.0 Beta 2) does not support multiple input files, I created a simple python script that calls ...
0
votes
1answer
35 views

Using OGR Intersection Method Python

I'm currently working to find the intersections between linears in a shapefile. I'm a newbie to the GDAL/OGR library. I've done some googling and came up with what seems to be a useful example(see ...
7
votes
2answers
179 views

Conflict between ArcPy and GDAL/OGR?

TL;DR I can't get an installation free version of GDAL/OGR to work from within ArcMap 10.0. I get an ImportError: DLL load failed on _mod = imp.load_module('_gdal', fp, pathname, description). ...
0
votes
0answers
18 views

Gdal_Calc.py random pixel error

I'm using the gdal_calc.py in python in order to do the same thing as the Con tool in ArcGIS. I'm calling the .py using os.system: os.system('gdal_calc.py -A%s -B%s --outfile=%s ...
0
votes
0answers
58 views

I cannot use Gdal Python but Gdal binary, how to fix?

**UPDATE: I can use GDAL with Python now by copy file from Gdal 1.11 compiled folder to Python package folder. But the problem with GDAL binary and GDAL library that they cannot read the HDF5 file. ...
2
votes
0answers
29 views

Why does python reads only the no data value from GeoTiff file?

I had a number of tiff files with a country's map. They had different rows, columns or different projections etc. I needed to make them with same projection, spatial resolution and same number of rows ...
1
vote
1answer
33 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
0
votes
0answers
43 views

gdal_translate from within pyqgis [duplicate]

I want to use gdal_translate from within a python script in my plugin qgis2leaf. I've tried with ...
0
votes
0answers
55 views

What is GDAL equivalent to ArcGIS Lookup (Spatial Analyst) tool?

I use the Lookup (Spatial Analyst) tool to create several raster layers from a combined raster layer. I know ArcPy can do the same thing. However, I would like to know whether GDAL (or another ...
1
vote
1answer
46 views

Map project a raster having separate latitude and longitude raster bands

I have a satellite image where one of the channels is a raster having the longitude values, another channel a raster containing the latitude values. What would be the best way for map projecting such ...
0
votes
1answer
18 views

Zoom option error on gdal_tiler.py

I'm using the tiler-tools library from: https://code.google.com/p/tilers-tools/wiki/QuickStart And specifically this command: ./gdal_tiler.py --zoom=9-15 my_map.vrt To generate tiles. When I use ...
0
votes
2answers
52 views

Is there a way to use gdal functions from OSGeo4W out of their shell?

I would like to use some gdal functions from OSGeo4W (gdal2xyz, and gdal_merge) for my work. I can use them in the OsGeo4W shell provided after installing the package. But I want to use them in ...
0
votes
1answer
63 views

Creating records in output shapefile using Python

I have a list (output from a previous loop) containing attributes from an input shapefile. What I am stuck with is inputting those attributes to a new shapefile. I have plotted the point data using ...
0
votes
0answers
32 views

Copy queried attributes of a shapefile to a new shapefile [duplicate]

I have a polyline-shapefile, which I have successfully read into python using pyshp module. My problem is to save the 2nd node of every line feature into a separate, single point file. I have ...
0
votes
2answers
105 views

GDAL_CALC works but I get a python error at the end of each process that prevents automation

Python 3.4.1, GDAL 1.11.0, OSGEO4W, Windows 7, OSGEO4W Windows Shell All 64-bit (ArcGIS is installed as well 10.2 with Python 2.7) So gdal_translate works fine. gdal_calc provides perfect ...
0
votes
0answers
26 views

SST process using just GDAL and python

I am trying to process AVHRR 4km SST using a module that uses only GDAL and Python. OSGEO4W, GDAL, Python 3.4.1. I borrowed the download code from http://grasswiki.osgeo.org/wiki/AVHRR. The rest I ...
1
vote
2answers
44 views

Running a Focal Mean or Low Pass Filter or 3 by 3 Mean Kernel in GDAL \ gdal_calc

Hi I am looking to run the equivalent of Focal Statistics in gdal_calc. Is it possible? It is a simple focal I require. I need to run a 3 by 3 kernel over the data (mean) and if possible only on ...
1
vote
1answer
57 views

How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, ...
0
votes
1answer
46 views

gdal_calc.py raster reclass equivalent of ArcGIS reclass or r.reclass in grass

Would like to achieve this in gdal_calc.Py if possible. I have a raster with a value of 0-7 in GTiff I would like one output raster where NoData = 0,1,2,3 1 = 4,5,6,7 So basically an ArcGIS ...
1
vote
1answer
60 views

How to calculate monthly maxium values from daily data in a 365 band grd?

I have a MINT2005.grd file which has 365 bands representing days of year from 2005. Each band is a 32x35 matrix representing the temperature at different latitude and longitude pair. How do I ...
3
votes
1answer
144 views

How to find the distance to the nearest coastline from a land-based latitude/longitude point?

I'm completely new to GIS and unsure what I need to solve this problem: In the image above turquoise is actually land. Sea is white. I tried using the NASA Distance to the Nearest Coast data dump ...
2
votes
1answer
118 views

QGIS says “osgeo [python-gdal]” isn't installed on Mac

I know similar questions have been asked (like this one) -- but I'm encountering a unique problem. I installed GDAL complete 1.11 from KyngChaos, but when I open QGIS, I get the following error ...
0
votes
0answers
48 views

gdal commands cannot import gdal — possibly ArcGis conflict with separate Python?

I installed ArcGIS 10.1 yesterday (Windows 7 64-bit), but have a separate Python 2.7 installation. Now my gdal does not work correctly anymore. It looks like all commands without the ending "*.py" ...
0
votes
0answers
25 views

Using GDAL and Python to replace the Spatial Analyst TabulateArea method

Has anyone tried to phase out the use of ESRI's Spatial Analyst extension by replacing it with GDAL in Python? I have a script that only uses the TabulateArea and Statistics analysis but not much else ...
2
votes
0answers
67 views

Convert a classification image to aggregated polygon in shapefile using gdal/python

My goal is convert a 2D numpy array to shapefile. The matrix results from a classification, so the numbers have a meaning. I solved my problem, but the solution is somehow involuted and complicated. ...
1
vote
1answer
86 views

syntax error when using gdal in python console QGIS

When I run the following code in the python console in QGIS I get a syntax error: import osgeo.gdal gdal_rasterize [-b 1] [-burn 255] [-a Pixelkost] [-te 170000.2 168000.27 177999.8 177999.8] ...
0
votes
0answers
50 views

MODIS products reprojection problem

I am working with Modis Data (MOD02, MOD11, MOD03, MOD35). In particular I am looking for a solution to reproject the subdatasets below, into albers equal. Because I am using NLCD dataset which uses ...
1
vote
1answer
83 views

GDAL - How to get gemetry type of a MapInfo TAB file?

I am using the OGR MapInfo File driver to read a MapInfo TAB file. However, the function GetGeomType() returns 0 which means 'wkbUnknown` even if the features in the TAB are only multi-polygons. Is ...
0
votes
0answers
37 views

need help creating layer with geom type wkbGeometryCollection with gdal python

I am having trouble creating a layer with geom type as geometry collection. Thus I am unable to output to a shapefile. I have attached code below. dstLayer is null. This does not happen if geom type ...
0
votes
0answers
42 views

Import GRD and count days with temperature below zero, using python

Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.
0
votes
0answers
62 views

aggregate counts on a grid and determine grid adjacency

So here is the problem I am working on. I have a bunch of lat, long coordinates for event occurrences. I want to create a grid and then count how many points fall into each grid pixel. Once I have ...
0
votes
1answer
88 views

create polygon adjacency matrix using python

I am trying to create an adjacency matrix from a set of polygons. That is, I have a bunch of polygons and I want to identify which polygons have a common edge or "touch" each other. Once I find this ...
1
vote
0answers
64 views

Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using: africa_sat = ...
3
votes
1answer
113 views

Are the functions in OGRPolygon accessible through the python bindings?

I'm currently trying to use the OGR python bindings to process some shapefiles. I want to obtain the number of interior rings in a polygon feature. Unfortunately I'm unable to use the documented ...
0
votes
2answers
247 views

using Python to calculate NDVI, output as a Geotiff

I need a script that can calculate NDVI from two separate input Geotiff files, then output the results as a Geotiff. I wrote following script, most of which is borrowed from various on-line sources ...
3
votes
3answers
406 views

Python - Find the largest extent in a list of extents (tuple format)

I am trying to find a way (simplest is the best) to retrieve the largest extent in a list of tuple extents in python. The list is looking like that: extents = [(-180.0, -90.0, 180.0, 83.624), ...
2
votes
1answer
86 views

How can I extract only band 4 from a geotiff multi bands to create geotiff or AAIgrid with this band using Python?

I have a geotiff file with many bands... I will like to create a .asc file or tiff file by converting only one band from the geotiff file. I don't find the solution by using python... With ...
0
votes
2answers
77 views

Get srid from a shapefile using ogr

I'm writing a script to import shp to postgis, using python, osgeo and psycopg2 ( see my previous question: Import shp to Postgis using Python and ogr ) I'd know if there is a way to get by osgeo ...
1
vote
1answer
77 views

How to call ogr2ogr from command line with Python 2.7 from ArcGIS 10.2 for Desktop?

I am trying to access ogr2ogr in the command line, and this is the message I receive: 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file. This is ...
1
vote
0answers
71 views

Decompress a LZW-compressed GeoTIFF

I have a LZW-compressed GeoTIFF file and would like to split it into several smaller regional files and change the format to png. I tried to do the spliting with gdal_translate -srcwin. I only get a ...
3
votes
2answers
108 views

Memory and Processing Efficient Approach to Read a Timeseries in Python

I am trying to store a timeseries of high resolution raster images containing NDVI values into a dictionary for calculations. I am curious as to which approach may the most efficient when loading ...
1
vote
1answer
126 views

Split Large GeoTIFF to smaller regions with python and gdal

I have quite a large GeoTIFF-file (compressed 50MB but unpacked 6GB) and want to split it into several smaller regional files. Therefor I am using python. As I am a new gdal user I do not really have ...
0
votes
1answer
101 views

gdal polygonize in python error, blank polygon created

I am having trouble using the Polygonize function in python. The cookbook example for this can be found here. The relevant portion of my code is: sourceRaster = gdal.Open('myraster.tif') band = ...
0
votes
1answer
92 views

Gdal creating raster rotated wrong way

I have been trying to read in a stack of images for a timeseries and created an output raster that contains the max pixel values of the timeseries. The arrays were created using numpy img_stack = ...
0
votes
1answer
38 views

How do I use ogr2ogr with python GDAL? [duplicate]

I've just installed GDAL, but I don't know how to import/use ogr2ogr. I've tried: from osgeo import gdal from osgeo import ogr and searched both for ogr2ogr, but it wasn't there.
0
votes
0answers
71 views

No data appears when using gdal_calc.py but source had data values

I'm in the process of calculating topographic exposure using a mix of GDAL, grass, R and python in Windows. I need to process a very large tiff file using the following calculation: ...
1
vote
0answers
66 views

How to use GDAL on Heroku?

I have a geospatial python app that I want to use on Heroku. This is my requirements.txt file: Flask==0.10.1 Jinja2==2.7.2 MarkupSafe==0.19 Werkzeug==0.9.4 gunicorn==18.0 itsdangerous==0.23 ...
1
vote
2answers
116 views

Mask image based on no-data pixels in another image with different projection - GDAL or Python

I've got a land cover image which covers the whole globe, and a satellite image which covers a very small part of the globe. These two images have different projections, co-ordinate systems and pixel ...