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.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
1k views

Fuller/Dymaxion in proj4/gdal/qgis?

I know this question has been asked a million times already, but I can't find many detailed responses on exactly what I want to do. As far as I can tell, the full C code for the fuller projection is ...
Alex McVittie's user avatar
6 votes
0 answers
350 views

What is the structure of Standard Interchange Format (SIF) used by spatial data providers?

What is the structure of Standard Interchange Format(SIF) used by navteq and other spatial data providers? Any documentation/sample files? Is there a SIF parser available in C/C++/Java/PHP ?
Anuraj Ennai's user avatar
5 votes
0 answers
85 views

Implementing PostgreSQL extension using PostGIS types?

I would like to create a new data type for PostgreSQL/PostGIS, but I have some difficulties. Here's what I've done so far: /* PostgreSQL */ #include <postgres.h> #include <liblwgeom.h> #...
Fabi_Z's user avatar
  • 71
3 votes
0 answers
249 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 ...
huckfinn's user avatar
  • 3,518
1 vote
0 answers
109 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 ...
Son of a Beach's user avatar
1 vote
0 answers
380 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 ...
Roger Almengor's user avatar
1 vote
0 answers
165 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 ...
anonymous's user avatar
1 vote
0 answers
690 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 "...
Roger Almengor's user avatar
1 vote
0 answers
251 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>...
Roger Almengor's user avatar
1 vote
0 answers
106 views

Cannot print the correct values of array in C - GDAL

I have the following code, which opens a raster file using C, then gets some attributes, and then declares in line :23 a variable called line, then I read the raster as array using GDALRasterIO. #...
Roger Almengor's user avatar
1 vote
0 answers
331 views

Python GDAL ReadAsArray vs C-GDALR

I am trying to iterate over the values of a raster dataset (band1). I am able to do it in python with the following code snippet (sorry I can't provide the original raster) import numpy as np import ...
Roger Almengor's user avatar
1 vote
0 answers
111 views

Iterate over every single value in a Raster GDAL C API

I am learning C, and I am trying to use the C API to iterate over the values of an array. So far I've been playing around printing the projection, Width and Height of the raster, but I would like to ...
Roger Almengor's user avatar
1 vote
0 answers
198 views

GDAL project lat lon coordinates to UTM in C

I have dug up some old code I wrote 6 years ago that was doing the conversion from Lat Lon coordinates to UTM. I have tried to run it today and the code returns NaN values. I suspect there has been ...
rbeucher's user avatar
1 vote
0 answers
125 views

SEGFAULT when creating own index in postgresql for POINT3DZ

I'm trying to write my own index for 3d points - POINT3DZ (using pgis and postgres 9.4). I have written a code similar to spgquadtreeproc.c [1] This is my spg_quad_point3dz_picksplit function: ...
i_p's user avatar
  • 11
1 vote
0 answers
268 views

Proj.4 get 3x3 or 4x4 projection matrix

How can I get a 3x3 or 4x4 transformation matrix between two CRS, using the proj4 library in C/C++? It's OK if it makes some approximations.
manatttta's user avatar
  • 241
1 vote
0 answers
33 views

Ingest 8-band satellite imagery into an array in C?

I’ve been unable to locate a lightweight library implemented in C to ingest 8-band geotiff files. GDAL can do this easily in python, though I’ve been unable to get the GDAL C libraries working; I’ve ...
toddstavish's user avatar
1 vote
0 answers
61 views

What is the easiest way to write C extensions to Python for use in QGIS?

I would like to write some functions in C to call from the Python console in QGIS. What is the easiest way to do this? Does there exist anything comparable to Matlab's MEX?
Matt D.'s user avatar
  • 403
0 votes
0 answers
78 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 ...
gonzalez.ivan90's user avatar
0 votes
0 answers
237 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 ...
user153770's user avatar