8
votes
Accepted
How to use GDALGridInverseDistanceToAPower in a python script
Yes, you can call this from a Python script. But you don't directly call the low-level C API.
First, take a look at the GDAL Grid Tutorial for background info. From the Python library, the relevant ...
5
votes
Accepted
Converting grid corners from UTM to degrees, minutes, and second in QGIS
You can use these expressions:
left:
to_dms(x_min(transform($geometry,layer_property(@layer,'crs'),'EPSG:4326')),'x',3)
top:
to_dms(y_max(transform($geometry,layer_property(@layer,'crs'),'EPSG:4326'))...
3
votes
Accepted
Why is GDAL isn't supporting .raw images?
If your "*.raw" images are digital camera raw image files, then you'll need to convert them to a format that GDAL can read using a RAW Editor like Adobe Lightroom (commercial), Darktable (opensource), ...
3
votes
Accepted
If degrees is zero, how should Degree Minute Second notation reflect the positive/negative hemisphere?
If possible, stay in decimal degrees and eschew DMS, but sounds like you must.
Negative minutes and Negative seconds seems the most appropriate path, placing the negative on the degrees, then the ...
2
votes
Accepted
C-based implementation of Djikstra's or Fast Marching for QGIS/Python?
There are two modules in QGIS Python included:
Scipy csgraph:
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.csgraph.dijkstra.html
NetworkX:
http://networkx.readthedocs.io/en/...
2
votes
Accepted
Getting DEM data programmatically with libgdal?
You are looking for GDALRasterBand::RasterIO. For efficiency, if you are indexing multiple points, you will want to read data in blocks then index into the resulting array
2
votes
Print and write the WKB to another shapefile using OGR_G_ExportToWKB in C?
OGRwkbByteOrder
(docs on eByteOrder)
You are likely wanting to use wkbNDR, which is enum 1, assuming you are running on an intel architecture.
invalid conversion error
(docs on OGR_G_ExportToWkb())
...
2
votes
ReadAsArray() equivalent in C
From the GDAL API tutorial:
There are a few ways to read raster data, but the most common is via the GDALRasterBand::RasterIO() method
2
votes
How to speed up rasterio.transform.xy
It appears like the authors of rasterio know about the slow conversions and have a WIP branch to address this issue. You could implement xy method yourself as the example in the first link ...
1
vote
Accepted
GDAL cannot read KML file that it just created
Turns out that GDAL's KML driver will write KML just fine, but will not read KML unless it has been compiled with the Expat library.
I only figured this out because I was having a similar problem with ...
1
vote
RuntimeError: wrapped C/C++ object of type RasterizeStringAlgorithm has been deleted
Open rasterize_string_provider.py file stated in the error
Go to line 60
Remove for loop (two lines)
for alg in self.alglist:
self.addAlgorithm(alg)
Add the following lines
self.addAlgorithm(...
1
vote
Clip raster with postgis outputting result in clipping geometry extent
Try this:
WITH blade AS (
SELECT ST_MakeEnvelope(0, 0, 4, 4) geom
), butter AS (
SELECT ST_AddBand(ST_MakeEmptyRaster(4, 4, 1, 5, 1), '8BUI'::text, 4) rast
), blade_as_raster AS (
SELECT ...
1
vote
How to call GEOS error handlers provided during initialization (initGEOS)?
It seems to be GEOSContextHandle_HS::ERROR_MESSAGE(fmt, ...). An example of calling the notice/error functions seems to be in the source code, e.g. for GEOSWKTWriter_destroy:
void
...
1
vote
Getting GeoTIFF tags with C
After two days of trying to answer this precise question, I finally found the solution of GTIFImageToPCS(). TIFFGetField() is not intended to do this, and GTIFKeyGet() only works on single-field keys.
1
vote
Accepted
Run-time pointer NULL error in C with OGR
I would guess that the name of the layer getting passed into GDALDatasetGetLayerByName is incorrect. With a shapefile the layer name is the filename without the extension. In this case the layer name ...
1
vote
How to find the minimum perimeter oriented bounding box?
Here is Python Code to determine the MBR by minimum Area. It seems easy to change the criteria to minimum Width or Perimeter. https://github.com/dbworth/minimum-area-bounding-rectangle/blob/master/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c × 42gdal × 25
python × 10
c++ × 8
coordinate-system × 6
qgis × 4
postgis × 3
postgresql × 3
geotiff-tiff × 3
shapefile × 2
ogr × 2
proj × 2
image × 2
geos × 2
raster × 1
pyqgis × 1
r × 1
point × 1
dem × 1
convert × 1
kml × 1
georeferencing × 1
java × 1
interpolation × 1
extents × 1