Tag Info

Hot answers tagged

5

you need to specify the type of code that you are using. Here I guess that it is EPSG C:\Program Files (x86)\FWTools2.4.7>gdalwarp -s_srs EPSG:25830 -t_srs EPSG:23030 C:\orto.e cw C:\orto_ed50.ecw


2

First I would use bands 4(red) and 5(nir) for Landsat 8 according to the description of the OLI instrument, and 3(red) and 4(NIR) for the Landsat TM and ETM. Second, you define an output in dtype=rasterio.uint16, but NDVI should be a float (between -1 and 1). You should either initialize your raster as dtype=rasterio.float32 , or multiply your values by ...


2

You can test it with gdalsrsinfo http://www.gdal.org/gdalsrsinfo.html gdalsrsinfo epsg:3068 PROJ.4 : '+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.45 5,6.7 +units=m +no_defs ' OGC WKT : PROJCS["DHDN / Soldner Berlin", GEOGCS["DHDN", ...


2

if you have a geotiff you can write this information in the header. Open your .prj in a text editor to identify the code (EPSG code, see spatialreference.org if it is not in your .prj). Then you can use gdal_edit.py to define the projection (without writing a new file). Example below with the EPSG code of WGS84. gdal_edit.py -a_srs EPSG:4326 yourimage.tif ...


2

A simple method that does not need programming is to digitize the area of "small" into vector file as a polygon and then burn it into the image with gdal_rasterize http://www.gdal.org/gdal_rasterize.html If the small image is rectangular without nodata regions you can get the mask shapefile with gdaltindex http://www.gdal.org/gdaltindex.html gdaltindex ...


2

The part that is going wrong is where you assumed that the coordinates in 3857 are degrees (like -5.8, 41). The units of 3857 are metres. So you're asking for something tiny, off the map (near the origin). Lets look at a conversion, using pyproj: from pyproj import Proj, transform inProj = Proj(init='epsg:4326') outProj = Proj(init='epsg:3857') x1,y1 = ...


2

The tool works well. I modified slightly the code for producing only 3 raster (10, 20 and 30 Pixel Size) with a point shapefile with 5 features. import processing RasterPixelSize = (10.0,20.0,30.0) i=1 for rps in RasterPixelSize: processing.runalg("gdalogr:rasterize",\ "/home/zeito/pyqgis_data/point.shp",\ "id",None,1,rps,rps,6, ...


2

GDAL is actually a set of toos written in C. As such it needs to be compiled prior to installation, and Windows doesn't come with a C compiler. As such your easiest bet is to download and install pre-compiled binaries of the library. The easiest place to get binaries is from Christoph Gholke who offers a package of the complete GDAL library as well as the ...


2

From http://www.gdal.org/gdalwarp.html -te xmin ymin xmax ymax: set georeferenced extents of output file to be created (in target SRS). Without -s_srs and -t_srs the target SRS will be the same as the original SRS of the image which is EPSG:32632 as you can see from the gdalinfo report. You can also see the extent in EPSG:32632 Upper Left ( ...


2

Since OGR version 1.10.0 the sqlite SQL dialect has been able to be applied to any spatial datset. Which is great, as it means that you can apply it to your GeoJSON files. Looking at the OGR GeoJSON documentation you can see that the layer name for a GeoJSON file is OGRGeoJSON which means that the SQL that selects from the GeoJSON file will translate from ...


1

You can use the gdaltindex command at the command line for this. Here is an example. gdaltindex output.shp folder/*.tif You could also use a QGIS plugin for this as inidicated in this post.


1

I discovered my error. I was expecting to see lat/lng pairs from EPSG:3857, but it's actually EPSG:4326 I should have been converting to.


1

No workaround should be needed. What you did in the first place is the right way. Take this GML as input: <?xml version="1.0" encoding="utf-8" ?> <ogr:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ogr.maptools.org/ mixed_points.xsd" xmlns:ogr="http://ogr.maptools.org/" ...


1

Use QGIS Vector to Raster to convert the shapefile points into raster, I will try to explain why: Using the GDAL_Grid utility has interpolated incorrectly, that is where the stepping is coming from, you just don't see it in a black to white renderer. This is how I see the sample data interpolated using GDAL_Grid in Esri: Note the Horizontal banding. Using ...


1

Andrew, I think you're thinking wrong and it may get you into trouble. You need to stop thinking in terms of your dataset and start thinking in terms of GDAL and GIS. Your dataset data is in some projection, in this case State Plane. That means you use state plane (ft here) coordinates to access the data. The transform (GetGeoTransform) converts between ...


1

Source of problem found. It turns out the GEOTIFF_CSV environmental variable was not set. In c#, the following code: OSGeo.GDAL.Gdal.SetConfigOption("GEOTIFF_CSV", Path.GetDirectoryName(Application.ExecutablePath) + @"\gdal-data"); makes a very big difference. Now the geoTransform contains the actual lat/long.


1

In QGIS 2.8.1 there's a tool in the Vector menu that can split a dataset based on an attribute. Look in Vector > Data Management Tools > Split Vector Layer... It's a basic tool that should work if you don't want to resort to plugins or tools in Processing; unless they offer additional functionality you need.


1

At least the GDALTools core plugin uses the tools directory for raster operations. Not sure if they are being used elsewhere.


1

This can be found from gdalinfo, except it has three forms: If rotation / shear coefficients (adfGeoTransform[2] and adfGeoTransform[4]) are zero, the output is simplified: Origin = (%.15f,%.15f) % adfGeoTransform[0], adfGeoTransform[3] Pixel Size = (%.15f,%.15f) % adfGeoTransform[1], adfGeoTransform[5] If rotation / shear coefficients are non-zero, ...


1

Using gdal_translate you have to set at least two arguments: src_dataset - yours SPOT NDVI HDF file dst_dataset - output TIFF filename, for example spot_ndvi_250m.tif (you're missing this one, that's why you've got an "No target dataset specified" error. Then in order to resample your image into 250m pixel using Nearest Neighbour you should add another ...


1

gdalwarp -geoloc allows you to use the complete 2d-array of latlon as georeference. With that, you can use any target CRS to reproject your data to a commonly used projection. See my answer to this question for an example: How to match a raster NetCDF data with a vector layer in QGIS?


1

The scale option is only needed for "unprojected" rasters with units in degrees. It is the ratio of height units used in the DEM (typically meters) to distance units in degrees. So for Mercator or other projected rasters, you can ignore the scale option, or use the default of 1 (no scale).



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