Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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.

3
votes
2answers
95 views

How to use GDALGridInverseDistanceToAPower in a python script

I'm trying to use GDAL in a python script to do an inverse distance interpolation. Within the C documentation API I found GDALGridInverseDistanceToAPower function but I don't know how/if I can call ...
0
votes
1answer
26 views

How to call GEOS error handlers provided during initialization (initGEOS)?

From what I learned, when using GEOS in C/C++, it should be initialized first using initGEOS : extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function, GEOSMessageHandler ...
3
votes
0answers
53 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> #...
4
votes
0answers
347 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 ...
1
vote
0answers
56 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: ...
0
votes
1answer
159 views

Why is GDAL isn't supporting .raw images?

I tried to open a .raw image (Raw image format) using GDALOpen() with GDAL C API. So, I wrote the following code to test it : in_data = GDALOpen("/home/YOYo/workspace/NY/Data/fig.raw",GA_ReadOnly); ...
0
votes
1answer
194 views

ReadAsArray() equivalent in C

I'm new with GDAL ... and I'm trying to write some code where I have to read a .raw image and store it as an array of 32-bit floats. It seems that it is easy with python, I just have to use: array = ...
2
votes
1answer
286 views

Getting geotiff tags with C

I am trying to make a code to read and retrieve geographical and raster data from a geotiff file, but I'm having a hard time with the extended tags. I have no problem with the regular TIFF tags (like ...
1
vote
0answers
106 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.
0
votes
1answer
532 views

How to draw a shapefile over GeoTIFF geometry to a PNG [duplicate]

How I can to draw using GDAL in python or c a polygon shapefile shape.shp with a GeoTIFF as background background.tiff file? Both files are in the same projection. The result could be a PNG, JPEG or ...
1
vote
1answer
182 views

Print and write the WKB to another shapefile using OGR_G_ExportToWKB in C?

I want to convert the geometry to well known binary (WKB) format of my shapefile. I want to print and want to write it into another shapefile. My code is: #include <stdio.h> #include <...
1
vote
1answer
171 views

Run-time pointer NULL error in C with OGR

I want to find out the geometry column and then want to export the geometry to WKB format from a shapefile. I wrote a code in C to find the geometry column. But a run-time error occurred. Can you ...
1
vote
0answers
25 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 ...
3
votes
1answer
1k views

How to find the minimum perimeter oriented bounding box?

I would like to know an algorithm to calculate the minimum perimeter oriented bounding box of a point set or polygon. I know that if I use the rotating calipers, I am able to get the minimum area ...
7
votes
1answer
371 views

If degrees is zero, how should Degree Minute Second notation reflect the positive/negative hemisphere?

If degrees is zero, how should Degree Minute Second notation reflect the positive/negative hemisphere? What is the appropriate behavior when degree is zero? Basically this is a Signed Zero problem. ...
0
votes
1answer
266 views

Why having problem with GDALRasterize() in C?

I am trying to make raster file from a shapefile. I am trying to use GDALRasterize() function for it. But it is not recognizing GDALRasterize function ('GDALRasterize' was not declared in this scope). ...
2
votes
1answer
264 views

C-based implementation of Djikstra's or Fast Marching for QGIS/Python?

I need an algorithm to find least cost paths between points on a discrete grid, allowing for the direction of transport to affect the cost of transport, allowing for different modes of ...
1
vote
0answers
47 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?
1
vote
1answer
73 views

Getting DEM data programmatically with libgdal?

I'm writing a specialized tool in C to work with DEM data (typically GeoTIFF files, but one of the reasons I'm using libgdal is to leverage its ability to read multiple formats). I'm able to open a ...
1
vote
0answers
53 views

To filter the wrong data of point positioning [closed]

I have collected GPGGA data by Novatel OEMV receiver in static single point mode. I have so much data (GPGGA format) and I want to get the static point axis by averaging all data. But some of the data ...
3
votes
0answers
111 views

What is the issue with geopdf format?

I'd like to add the geopdf format as output of a library that I am working on. After have looking around, I have not been able to find a (c, c++, python) library that meet my license requirements (...
1
vote
2answers
283 views

Projection for polygon intersection confined into one hemisphere?

I have polygons where each vertex is a (lon,lat) geographic coordinate. I want to find out if they intersect or contain each other. The polygons are guaranteed to never exceed a hemisphere (so they'll ...
4
votes
0answers
214 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 ?