Tag Info

Hot answers tagged

4

I suggest tackling this using Virtual Raster Table (.vrt) format. How the end result is to be used will determine how many steps are needed. Simplest possible case is the end product will be used by a GDAL or GDAL-aware program, create one .vrt in the desired projection and then use that in your final program: gdalwarp -t_srs wgs84 -of vrt ...


3

It is nearest neighbor as written in http://lists.osgeo.org/pipermail/gdal-dev/2006-November/010619.html There is also a hint in the mail "If you want control over the resampling used, you should use gdalwarp instead."


3

Here's just the nuts-and-bolts from some working code: #include "gdal_priv.h" #include "gdal_alg.h" // in main()... GDALAllRegister(); // register all drivers // open your raster - format doesn't matter as all the drivers are registered GDALDataset* SourceRasterDS = (GDALDataset*) GDALOpen(Raster,GA_ReadOnly); double GeoTransform[6]; ...


2

You need to post the input raster (in UTM) information too so a true before-and-after comparison can be made. Representing data using lat/lon in a raster means using a Plate Carree-like projection and treating the decimal degree values as if they're linear measures. UTM data is often 'tilted' in comparison so data is resampled. There'll be 'no data' values ...


1

It is probably possible with GDAL but not extremely easy. Everything that can be done with SQL in SpatiaLite can also be done with GDAL http://www.gdal.org/ogr_sql_sqlite.html and this query could be used as starting point: ogrinfo -dialect sqlite test.shp -sql "select attr, st_union(geometry) from test group by attr" However, the query creates one ...


1

I cannot imagine that UTM is not suitable for your purposes. Are you sure you picked the correct zone for the location of your dataset? Example: http://spatialreference.org/ref/epsg/32632/ I don't know much about P.T.L. but it seems to work similarly as UTM. It is unlikely that it is included in common GIS coordinate reference system (CRS) definitions, ...


1

Your problem comes from adressing the subdatasets wrong. If you run gdalinfo on the complete file it will display the names of the subdatasets: SUBDATASET_1_NAME=HDF5:"A2015069000500.L2_LAC_OC.nc"://geophysical_data/Kd_490 To get the information of the first subdataset you need to feed the complete name into gdalinfo gdalinfo ...


1

Assuming the string field is named text and the field with corresponding integer values is named code and field code already exists, then the following Python code will do the job. # get active layer aLayer = qgis.utils.iface.activeLayer() # get fieldindex fni_t = aLayer.fieldNameIndex('text') fni_c = aLayer.fieldNameIndex('code') # initializations ...


1

assuming that the goal is to determine an elevation with a user-supplied set of coordinates, there should be a way to do this with gdal - i use a function like this, which came almost verbatim from this answer (assumes raster is not rotated). rast = 'myIMGfile.img' mx = XCOORDINATE my = YCOORDINATE def readRastPix(rast,mx,my): src_ds=gdal.Open(rast) ...


1

If you are on Windows you could give the precompiled wheels by Christoph Gohlke a try, he has a stable 1.11 with bindings for Python 3.4 listed. If you are on Linux your best bet is compiling from source with support for your Python version (./configure --with-python).


1

If you use gdal_polygonize.py to extract the shape of the nodata area (or the ! nodata) area into a polygon, you can use ST_Buffer() in PostGIS with a negative parameter to shrink that area back a little and then ST_Intersection() to clip the contour lines with it.


1

It looks very strange, but warping with QGIS (which runs its embedded gdalwarp) is much faster! I was able to process 14Gb file in 70 minutes, on windows, without much resource consumption. It still was not looking like it used multiple cores, but did the work, which is great. Also, it seems the same applies to gdal_translate. Probably, they build gdal ...


1

I use a simple way to solve this using the UNIX bash. I made a script in the same path of images and ran it ("script.sh"). #!/bin/bash for i in *.tif do gdal_calc.py -A $i -B MASK.dat --calc="A/B" --NoDataValue=0 --format=ENVI --outfile=directory/$i.bin done MASK.dat is a binary image with only 10.000 values to scale in NDVI range. "i" are all the MODIS ...


1

I believe you're after re-sampling a raster on the fly which I don't believe is possible (though I'd be happy to be proved wrong). You'll have to create a new dataset at the required sample level. In ArcGIS you can do this using the Resample tool (which you can add to a python script). This does create a new file on your disk which depending on the size of ...


1

If you can see your layer on a map using L.TileLayer, the problem is in the boundary polygon you pass in L.TileLayer.BoundaryCanvas. It is difficult to guess the exact problem without example sources, but you can try the following checks: Add your layer using L.TileLayer and your boundary using L.Polygon (or using L.GeoJOSN). Check that your polygon ...



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