Questions tagged [c]
C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.
42 questions
3
votes
1
answer
163
views
How to cancel 'GDALWarp()' in GDAL Utils (C API)?
My iOS app allows users to reproject rasters to different spatial reference systems. This is implemented with GDAL Utils (C API, in a Swift wrapper) to run a GDALWarp(). Sometimes these operations ...
5
votes
1
answer
2k
views
How to speed up rasterio.transform.xy
REPRODUCIBLE SETUP
In a Google Colab notebook, I install rasterio:
!pip3 install rasterio
Import modules:
import rasterio
import numpy as np
import time
from rasterio.crs import CRS
from rasterio ...
3
votes
1
answer
1k
views
Converting grid corners from UTM to degrees, minutes, and second in QGIS
I have a shapefile of a 10km grid that is in UTM projection but I would like to convert all coordinates to Degrees, Minutes, and Seconds. The attribute table has corners (Top, Bottom, left, and right)....
1
vote
0
answers
125
views
GDAL fails to get SRS authority or SRS code for OziExplorer .map file
Using GDAL C API (version 2.2.2), I've been unable to extract the Authority (or Authority Code) from a raster. I can get the Spatial Reference System, and print the WKT from the SRS, but querying the ...
2
votes
2
answers
1k
views
How to run equivalent of gdal2tiles using GDAL C/C++ API?
GDAL includes a comprehensive low-level API in C and C++. It also includes some high-level APIs that effectively run the equivalent of some of the GDAL command-line utilities. (See:
https://gdal.org/...
3
votes
0
answers
314
views
Is it possible to proceed direct geo-referencing and ortho-rectification for a GeoTIFF with GDAL/OpenCV in one step
I work under Debian Linux and want to ortho-rectify and geo-reference images aquired by a tilted twin camera system using:
the attitude parameter (roll, ptich and heading) of the gyro-stabilized ...
0
votes
1
answer
466
views
GDAL cannot read KML file that it just created
I'm using GDAL 2.2 standard C library within a Swift wrapper in an iOS app. After creating a KML data source and populating it with data, GDAL is unable to open the KML file that it just created. ...
1
vote
0
answers
559
views
Cannot Compile and add GDAL library for Visual C++ project in Visual Studio IDE
I wanted o create a project using the GDAL library and its API for C code.
I can create an executable for this code by entering the following on the command line in a Linux Machine:
gcc -o myprogram ...
0
votes
1
answer
326
views
RuntimeError: wrapped C/C++ object of type RasterizeStringAlgorithm has been deleted
There is a very similar problem to mine, but with a different plugin. The error is the same.
The error is this:
RuntimeError: wrapped C/C++ object of type RasterizeStringAlgorithm has been deleted
...
0
votes
0
answers
102
views
Calling GDALGetRasterHistogram( ) from R
I need to calculate a histogram (pixel-count by each unique value, actually) for more than 256 values , the default number of buckets in gdalinfo.
I understand that GDALGetRasterHistogram can deal ...
2
votes
1
answer
465
views
Clip raster with postgis outputting result in clipping geometry extent
I want postgis st_clip to output clipped result in extent of initial clipping geometry.
Currently, it's crop option can be set to output either in initial raster extent or in extent of intersection ...
0
votes
0
answers
287
views
Convert and set projection from h5 file
I want to save georeferences readed from input data to output data.
I don't want use copy georeferences because input data is in .h5 format and georeferences was read from metadata.
I use GDAL and C ...
1
vote
0
answers
202
views
Error: unable to open Unable to open %s.shp or %s.SHP
I am using c shapelibrary (http://shapelib.maptools.org/) SHAPE API for creating and reading shapefiles. I am able to create a new shapefile using SHPcreate(). However I am unable to read it using ...
1
vote
0
answers
849
views
ERROR 5: <band_name.tif>, band 1: Access window out of range in RasterIO(). Requested (0,76) of size 843402319x1 on raster of 10980x10980
I am trying to create a processing chain using C-GDAL. The main() code is as follows:
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "...
1
vote
0
answers
278
views
Get pixel value GDAL in C
I have the following code that works well to print out the individual values of pixels on a image (first band), using C-GDAL.
#include "gdal/gdal.h"
#include "gdal/cpl_conv.h"
#include <stdio.h>...