Tag Info

New answers tagged

0

If you don't like creating of VRT file mentioned above, you can use MyGeoData Converter - the import tool will create the VRT file automatically. Coordinate column is detected if the attribute name of X coordinate is: x, xcoord, xcoordinate, coordx, coordinatex, longitude, long or the attribute name contains: x_*, *_x Similar for Y coordinate: y, ...


0

The error message ERROR 6: GDALDriver::Create() ... no create method implemented for this format tells what goes wrong but it is pretty hard for a GDAL end user to interpret the message because it is not documented in http://www.gdal.org/gdal_sieve.html. Gdal_sieve.py must be used with a raster output format that supports Create() method. That is documented ...


4

According to the ogr2ogr csv documentation and also this answer, you need to specify which fields contain the geometry in a VRT file: <OGRVRTDataSource> <OGRVRTLayer name="test"> <SrcDataSource>test.csv</SrcDataSource> <GeometryType>wkbPoint</GeometryType> <LayerSRS>WGS84</LayerSRS> ...


0

Circumventing ogr2ogr for the first conversion, I've found a unix tool that will allow me to do this (https://github.com/mapbox/csv2geojson) csv2geojson -lat "latitude" -lon "longitude" input.csv > intermediatefile.geojson I use a constant name for the output file so it gets just overwritten a bunch of times, but now I can convert to kml ogr2ogr -f ...


0

I already fixed it. I had to follow these steps: Define GOA2_CLIENT_ID, GOA2_CLIENT_SECRET, GME_APIKEY Define GME_REFRESH_TOKEN, which allow the app to refresh the token No problem, so far. Just followed the wiki page Define GME_AUTH (or provide 'auth' in the query string). This is not specified in the wiki page, but can be found here: The steps to ...


0

So after using gdal_translate to reproject the shapefile first, then using that as the input for gdal_rasterize, everything worked. I'm assuming that gdal didn't recognize the shapefile's projection (it wasn't anything I'd seen either) and that just caused the whole thing to fail. It makes sense, but I wish the error raised would've pointed to that, and I ...


1

It is not really documented in http://www.gdal.org/gdal_polygonize.html that gdal_polygonize is using only one band of the source image. Better wording would be: creates vector polygons for all connected regions of pixels in the raster sharing a common pixel value on the selected band From the script itself you can see that by default band 1 is ...


1

You could try to install everything from packages first, then add the hdf5 libs and re-build gdal with that. All other ways (except self-compiling all) will end in the problems you discovered.


2

Turns out this is a projection issue. Prior to merging, I'm reprojecting the tiles from EPSG:4326 to EPSG:3785. When this is done after the merge no problems occur.


4

The following script determines the bounding box of a raster and creates based on the bounding box a geometry. import ogr, gdal raster = gdal.Open('sample.tif') vector = ogr.Open('sample.shp') # Get raster geometry transform = raster.GetGeoTransform() pixelWidth = transform[1] pixelHeight = transform[5] cols = raster.RasterXSize rows = raster.RasterYSize ...


1

I hit the same error message and even though my code is python (using GDAL python bindings) the behaviour is exactly the same, "Cannot Find GPTS Object" is thrown on an attempt to open the file and there is no obvious way to silence it or get around it. It looks like the error is thrown, because gdal makes an assumption about the PDF format that is not true ...


0

Answer to how to turn the csv into a vrt file For a CSV files with the x and y coordinates in the columns "x" and "y", the resulting VRT file is: <OGRVRTDataSource> <OGRVRTDataSource> <OGRVRTLayer name="points"> <SrcDataSource>/path/your.csv</SrcDataSource> ...


1

The correct syntax is: print multiline.ExportToWkt() 'MULTILINESTRING ((0 0,0 1),(0 1,0 2),(0 2,0 3,0 4))' line = ogr.ForceToLineString(multiline) print line.ExportToWkt() 'LINESTRING (0 0,0 1,0 2,0 3,0 4)' It is easier with Shapely coords = [((0,0),(0,1)),((0,1),(0,2)),((0,2),(0,3),(0,4))] from shapely.geometry import LineString, MultiLineString line1 = ...


3

For irregular polygons, and assuming that your geotiff raster file is a binary raster, you could use GDAL_Calc: GDAL_Calc.py -A Mask.tif -B CutBigImageToClip.tif --outfile=SmallerFile.tif --NoDataValue=0 --Calc="B*(A>0)" This query will populate 0 where Mask.tif <= 0 and BigImage where the Mask > 0. To do this both rasters must be the same cell ...


1

I don't know if it's possible to clip a raster with an other raster but you could use gdaltindex to build the shapefile with the extent of your raster. http://www.gdal.org/gdaltindex.html


1

I've work with both OTB and SAGA but I would advise on Ubuntu to install both libraries using the ubuntugis-unstable PPA: https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable/ It should allow you to install last stable release of both otb and saga and also qgis using the same gdal version. Take care to uninstall previous versions on your ...


0

As crmackey notes in his comment, the first element in sys.argv needs to be the current script. You also need to use '-o' instead of 'o' as your first argument for gdal_merge Try: sys.path.append('C:/Python27/ArcGIS10.2/Scripts/') import gdal_merge as gm workspace="D:/Satellitendaten/rapideye/img/testregion/cannyedge/out/" os.chdir(workspace) ...


2

Here was my problem: No way the SRTM data is that messed up. The SRTM data IS that messed up. The warping above is actually in the DEMs in the SRTM3 dataset (downloaded from http://dds.cr.usgs.gov). After examining DEMs from the improved SRTM4 dataset (available here) I found that most of these "gaps" were filled by interpolation but other issues ...


0

Use this if you don't care ppa addition, $ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable $ sudo apt-get update $ sudo apt-get install python-gdal


0

First if you are on windows,then there are straight away installers,on the link told my friends above.But if you are on Linux this is the way for installing libgdal 1.11. go to this page http://packages.ubuntu.com/trusty/libgdal1h download the required .deb file choosing your system architecture. after downloading it go to downloaded directory and run ...


1

As mentioned by @iant, there are several possibilities. I therefore suggest that you use the proj4 string with gdal, which you can customize based on your needs. e.g. "+proj=eqc +lat_ts=60 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"


1

How about EPSG:4087? Otherwise one of this list


1

Your 'ENGL_NAME' shouldn't be abbreviated at all (less than 10 characters), but writeOGR has its own will, it seems. Instead of writeOGR(shp, "PolygonsV2", speciesname, driver="ESRI Shapefile") you might try currdir <- getwd() #store your current working directory setwd(paste(currdir,"PolygonsV2",sep="/")) #switch to your desired folder ...


1

Installing Python package gdal into virualenv on Linux GDAL provides nice toolkit for GEO related operations. However, installing it to virtualenv on Linux is not trivial task. This recipe describes, how to do that. note here I use lowercase gdal for Python package and upper case GDAL for general system wide library. Requirements allow using ...


0

I have written GDAL programs using C++ and C#. It is incredibly easy to use. I advise you to download the source code. You'll find the source for gdallocationinfo, which is their command-line tool that does exactly what you want. You can use it as the lever to get going. If using gdallocationinfo on the command line won't work for you. -reilly.


0

You can tell python where to look for additional libraries (e.g. GDAL) by adding their location to the PYTHONPATH. To do this you will need privileges on your machine to edit system variables and know the exact location of your GDAL python package. The process of changing the PYTHONPATH is outlined here: Add to PYTHONPATH on Windows 7


5

I doubt your process "gets caught in a loop", I think it will just take a long time to complete as your rasters are actually quite large. Those "small rasters totally less than 100mb" are roughly 2Gb uncompressed, each. The layer properties you included in your question show that particular raster has dimensions of 36702 cols, 14147 rows and 4 bands with ...


1

You need to apply a shear to your affine transformation matrix used for SetGeoTransform. One package that is intended to work with these is affine. For example: from affine import Affine xmin = 1; xres = 2; ymax = 3; yres = 4 # dummy values # construct geotransform matrix geotransform = Affine( xres, 0, xmin, 0, -yres, ymax) # or import from ...


1

ECW comes from Erdas and is not fully supported by GDAL without Erdas licence. According to the help : The ECW 4.x SDK from ERDAS is only free for image decompression. To compress images it is necessary to build with the read/write SDK and to provide an OEM licensing key at runtime which may be purchased from ERDAS. So you can decompress your ...


0

To solve this issue you must add -lco ENGINE=MyISAM to your ogr2ogr command. -lco NAME=VALUE: Layer creation option (format specific) GDAL ogr2ogr docs In this case this parameter sets storage engine for MySQL table(s). In MySQL 5.6 spatial indexes supports only on this storage engine. For indexing spatial columns, MyISAM supports both SPATIAL ...


2

So I figured it out! gdal_translate -b 2 input_rgb.tiff output_green.tiff gdaldem color-relief output_green.tiff green_colortable.txt output_green_rgb.tiff taking the colortable from QGIS. I did this for both red and green bands. After that I combined them by using Mapnik!



Top 50 recent answers are included