Tag Info

Hot answers tagged

5

Install Raspbian: Download NOOBS Follow the NOOBS Setup instructions. Update Raspbian from its Debian wheezy base to Debian jessie: sudo vi /etc/apt/sources.list # or use your favourite editor change all references of wheezy to jessie sudo apt-get update sudo apt-get upgrade # this will take a long time, with occasional user prompts sudo apt-get ...


4

Reorganise your shapefile so that one shapefile contains one feature (A,B,C in your case) only Then use a loop like for i in A B C; do gdalwarp -cutline $i.shp ... $i.tif done to create each output raster. Example of script: #!/bin/sh # "shp" - folder for shapefiles # "outputraster" - folder for output rasters cd /home/user/cliprasters/ # ...


3

gdal_merge.py -o output.tif `ls *.tif` The back ticks mean execute whatever is inside the back ticks before the main command, so this will find all tif files in current directory, which will then be used as the input to gdal_merge.py. Instead of backticks, you can also use the $(command) syntax, ie, gdal_merge.py -o output.tif $(ls *.tif) is ...


3

Although it would require another library (which currently is only available on OS X and Linux) you could use RSGISLib (http://rsgislib.org), which is built on top of GDAL to do this. There is a function to stack bands, as an example: #!/usr/bin/env python import rsgislib from rsgislib import imageutils # Create list of images imageList = ...


2

Turns out it is as easy as this: MIMETYPE "application/json; subtype=geojson; charset=utf-8" Without the setting, no content encoding is returned by the server.


2

It's highly inefficient to merge mosaic using gdal merge. Instead, make a VRT (Virtual Dataset) and convert it to your favourite format.


2

Yes another way exists. Just use gdal_calc.py For example, below will convert the values below 3 to 0 and above 3 to 1. You can use equals as well. gdal_calc.py -A C:temp\raster.tif --outfile=result.tiff --calc="0*(A<3)" --calc="1*(A>3)"


2

Try adding the -et (error threshold) option with lower thresholds than the default (0.125). When I use "-et 0.01", the horizontal artifacts disappear: gdalwarp -t_srs "+proj=stere +lat_0=90 +lon_0=-45 +lat_ts=70 +ellps=WGS84 +datum=WGS84 +units=m" \ -et 0.01 \ ./UiMbqSd.withmetadata.tif ./regridded_lon0_-45.tif


2

Here is an example that does roughly what you ask for. The main parameters are the geotransform array that gdal uses to describe a raster location (position, pixel scale, and skew) and the epsg code of the projection. With that, the following code should properly georeference the raster and specify its projection. I did not test this much, but it seemed to ...


2

If you don't know the extent in coordinates of the prj file, you have to georeference the file manually using ground control points. This is rather comfortable if you have QGIS installed, and you can guess some details from the image. In some cases, you can build the extent manually if the filename follows a certain rule, like the one-degree-SRTM files do. ...


2

After following a subset of this advice, this is how I got the Python GDAL 1.11.0 install to work on Ubuntu 14.04 with pip: Install dependencies: sudo apt-get install libgdal-dev libgdal1h Pip install and pass along the include path: sudo pip install --global-option=build_ext --global-option="-I/usr/include/gdal" gdal


2

Your code is wrong. Do this: from osgeo import gdal GDAL is a module of the osgeo package. You don't ever import osgeo itself. In Python a package is a convenient collection of modules and provides a 'name-space' for that collection. So, you can drill down further and import specific functions or variables from a module within a package like this: ...


1

Sorry, I can't replicate your problem. I have a 2048x1024px image of Blue Marble referenced to WGS84, and warped it in GDAL with gdalwarp -t_srs "+proj=sinu" bluemarble-WGS84.tif bluemarble-sinu.tif and get:


1

You cannot only unzip the folder, you must install the module with python setup.py installbut osgeo is a Python wrapper of the GDAL C++ library. Therefore you need to install first the GDAL library and then install the Python module witch uses the GDAL libraries Dependencies: * libgdal (1.11.0 or greater) and header files (gdal-devel) You can compile ...


1

In OGR, the elevation data gets stored in a point layer called track_points. You can do "normal" ogr2ogr operations preserving the elevation data like this: ogr2ogr -f GPX output.gpx input.gpx waypoints routes track_points However, that fails on your ST_UNION command because you requested a Multilinestring (which has no vertex elevation data by ...


1

All four of the databases you listed have the capability to support the type of query you're asking about. SQLite and Postgres through extensions (Spatialite & PostGIS respectively), mySQL and MariaDB have some basic GIS support built in natively. As to which to use, it depends on your needs. Personally I go with SQLite for simple in house ...


1

I did a little more digging and found the answer to my question: instead of using os.system, the correct syntax for storing the result in a variable is: result = os.popen('gdallocationinfo -valonly -wgs84 %s %s' % (lyr, loc)).read()


1

I think you will have to use the subprocess syntax, it is explained in this post: subprocess to call gdal from within python


1

The global 50 m mosaics available to download from http://www.eorc.jaxa.jp/ALOS/en/palsar_fnf/fnf_index.htm are mapped binary files with an ENVI header. You should just be able to read them using GDAL with the ENVI driver (I've not had any problems doing this). You need to apply the following equation to calibrate HH and HV data to gamma0 gamma0 = ...


1

Assuming you have saved the output of your GCP points, can you compare the values in this file with the auto-generated script? I've noticed that the script rounds values; I wonder if this could be introducing a source of error.


1

to accomplish what your code is doing, # reclassify raster values equal 16 to 7 using Numpy temp = numpy.equal(raster, 16) numpy.putmask(raster, temp, 7) another, perhaps more intuitive way is: # reclassify raster values equal 16 to 7 using Numpy temp = raster == 16 #gives you a numpy array of bools with same shape raster[temp] = 7 #or a short cut ...


1

Looks like GDAL and QGIS are part of the Raspbian Repository. So check that your /etc/apt/sources.list file is configured, then try: sudo apt-get update sudo apt-get install gdal-bin qgis I don't have a RPi, so I can't check if it works. You can try virtualise Raspbian with QEMU, so you can check it out yourself before making a large investment.


1

GDAL is deeply inside a library but there are many command line tools for vector and raster processing which can be considered to be a part of GDAL. See raster and vector utility programs from http://gdal.org/. However, GDAL is used in large number of programs which may offer graphival user interface to GDAL ...


1

You could create a GDALDataset with as many bands as you have raster bands, then copy the data from each of your bands into the corresponding band in the GDALDataset. Here's some example code in C++ (since that's where I'm most familiar with GDAL). //create the dataset const char *filename = "example.tif"; GDALDriver *pDriverTiff = ...


1

In the end I wrote the following script that solved my problem. The script converts raster pixels with a specified value to vector lines. For example the blue pixels (value = 0) are converted to vector lines. There is definitly room to improve the script, as you can see in the result image. The script can be found and edited here. Raster Image Raster ...



Only top voted, non community-wiki answers of a minimum length are eligible