Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
3
votes
1answer
31 views

GDAL - Register Pixel Function for Command-Line Utilities

I'm new to GDAL and am just learning the inner-workings of C++ compilation at the moment so please bear with me. I am trying to define a pixel function to produce a VRT from input TIFs, with a band ...
0
votes
0answers
13 views

QGIS crashes loading raster layer (.tif) through GDAL provider

I am working on a project that uses QGIS within another application using QT Creator. When I try loading my raster data (using C++ API), I get a SIGSEGV error that traces back to my GDAL provider ...
3
votes
0answers
31 views

Modifying QGIS Project with C++

I have a QGIS project file, it has a point layer in GPKG format and online map layers. Coordinate System of online map layers is WGS 84 / Pseudo-Mercator. Point layer's default coordinate system is ...
0
votes
0answers
12 views

SIGABRT when calling QgsMeshLayer class (QGIS)

I am working on a C++ application that uses the QGIS API to overlay weather data from NetCDF files onto a KDE Marble map. I am using version 5.11.3 of Qt and 3.8 of QGIS on Fedora 28. When trying to ...
1
vote
0answers
16 views

How to get the error if GDALOpenEx fails?

I am using GDAL 2.1.0 in a C++ application. I call GDALOpenEx() to open a dataset file. If it fails to open the file, it returns NULL. That is sufficient to bail early. But, I would also like to ...
3
votes
0answers
26 views

Draw a QgsPolyLine with QGIS C++ API

I have a simple polyline with three points. I want to draw it on a QgsVectorLayer, but can't seem to get it working. I am able to draw a simple geometry on the layer, but that doesn't allow for ...
0
votes
1answer
37 views

How to execute GDALRasterize() function wtih options?

I am using GDAL 2.1.0, in both Windows and Linux environments. I want to programmatically rasterize a shape file in my C++ app. Thanks for any clues you can provide. gdal_rasterize I can successfully ...
-1
votes
1answer
17 views

Should a GDAL vector dataset have a geotransform?

For example: Does a shapefile have a geotransform? The answer is probably: No, a vector dataset does not have a geotransform, because the purpose of a geotransform is to transform between projection ...
0
votes
0answers
14 views

Converting GDAL Raster to a Boost Python Array (C++)

My Python project has a C++ extension that accepts detection coordinates to crop a GDAL raster, and then return the crop to the Python side. On the C++ side, I create a uint8_t buffer to hold the crop....
0
votes
0answers
36 views

How to load WMS in C++ with GDAL?

I am trying to load a WMS into my C++ program to use it as a GDALDataset. The problem is that I am able to load the WMS but every time I am doing a GetRasterCount() I get 0; and every time I am trying ...
8
votes
0answers
98 views
+50

Reading raster backward using GDAL

I am currently working on two-scan raster algorithms (euclidean distance transformations, cost surface analysis, etc.). Those algorithms require a line-wise forward raster scan (from top left to ...
2
votes
1answer
118 views

Cropping raster file with GDAL warp C++ API

I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation. The algorithm is written in C++ so I want to call ...
0
votes
0answers
42 views

How to include QGIS libraries to C++ QT

I'm a newbie to QGIS. Initially, I only want to display a map on the screen, nothing more, but I couldn't find a solution for my problem on the web. Also, I want to use that map as QWidget; is it ...
0
votes
0answers
32 views

Blinking QGIS raster layer with zoom out and pan

I am using QGIS dev lib 3.10 with Ubuntu 18.04. Once I try to zoom out or pan the raster layer always blinks. How can I fix that? I already tried to update the render time and cache setting in my ...
0
votes
0answers
15 views

In GDAL are there equivalent vector functions for gpkg files similar to those provided by GetRasterBand?

I am using GDAL (C++) to read raster files into a buffer for example: cplErr = resDS->GetRasterBand(1)->RasterIO(GF_Read, xPixelUL, yPixelUL, pWidth, pHeight, buff3, pWidth, pHeight, GDT_Float32,...
1
vote
0answers
26 views

How to get all the column number and row number of DTED file

I am not very familiar with GDAL. I use this coding to get all the 3601*3601 elevation value into an vector array.The issues that it only show elevation point and not the row and column. How can I get ...
1
vote
1answer
190 views

Using QGIS C++ API In Custom GIS Application

I'm trying to develop a custom GIS application using Qt. Which will show a map and have some figure drawing options on the map. While searching on the web, I came across with QGIS. I wonder if I could ...
0
votes
0answers
44 views

Plot (latitude, longitude) data into a picture

I have a matrix where en each position I have certain latitude, longitude and each position has a certain value, i.e. amount of rain in that location. I want to plot in C++ the values in an image but ...
1
vote
0answers
75 views

Use Boost Rtree with geographic coordinates

In order to find nearest nodes I'm using boost rtree as follows: typedef boost::geometry::model::point<double, 2, boost::geometry::cs::geographic<boost::geometry::degree>> RtreePoint; ...
1
vote
0answers
32 views

How to create RGB image using GDAL C++?

I'm working with GDAL using C++. I've got a code to create a black-and-white image: GDALAllRegister(); GDALDriver *pDriverTiff = GetGDALDriverManager()->GetDriverByName("GTiff"); GDALDataset *...
2
votes
1answer
276 views

Visual Studio's CMake with vcpkg: Error gdal is not found

I have been trying to build a cmake c++ project. More specifically I am trying to use the gdal library in this project. In the CMakeLists.txt it says find_library(GDAL gdal) after doing some research ...
0
votes
0answers
26 views

Is there a solution in QGIS python or C++ API which detects HOVER ACTION on “vertexmarker”?

After too much searching I finally found how to add markers on maps by using QGIS C++ API. However, I did not find a solution for detecting mouse cursor hover action. I have searched the source code ...
0
votes
0answers
39 views

Create tiles from GeoTFF in C++

I am trying to create a C++ app to generate tiles from a GeoTIFF file. I have found gdal2tiles but just for python. Are there something similar for C++?
2
votes
1answer
38 views

QgsMapCanvas on-the-fly feature does not work

I am writing a simple program to display raster data using qgis api C++. When I open raster data that has different coordinate systems, the on-the-fly feature does not work on my mapCanvas. Can ...
1
vote
0answers
50 views

How to smooth discrete raster data with GDAL in C++?

I am using GDAL in C++ for upsampling land-cover raster data. When upsampling, I would like to smooth out the edges, so that I do not get aliased stairs but nice diagonal lines. Essentially, the "...
1
vote
0answers
37 views

Embedded QGIS map functionalities in User Interface

I am using QGIS to analyze a set of data in which there are locations of different interest points and I need to calculate the distance between these locations considering roads network. I have ...
4
votes
1answer
1k views

Cannot find proj.db in QGIS 3.10.3

I would like to program a standalone application using C++. In version 3.4 LTR, my program ran fine and I did not receive any notification when running it. However, when I compiled using the qgis ...
0
votes
0answers
95 views

How to use OGREnvelope* function to GetExtent() using OGR/GDAL C++ API

#include "gdal/gdal_priv.h" #include "gdal/ogrsf_frmts.h" #include "gdal/ogr_api.h" void ShpfileRead(const char* name) { GDALAllRegister(); GDALDataset *poD1S; poD1S = (GDALDataset *) ...
0
votes
1answer
83 views

QGIS C++ API doesn't work with ECW files

I'm new with QGIS. After lots of trying I finally executed a successful compile on QGIS libs and used them in my program. In my simple program I just read some layers (vector and raster) and showed ...
0
votes
1answer
36 views

Implementation of multiple-point statistics in GIS

Is there any implementation of multiple-point statistical algorithms in GIS? at least for spatial interpolation. code for instance.
1
vote
0answers
36 views

QgsMapCanvas map rendering issue

Background : I am making a raster + vector map navigation application using Qt4 and QGIS in C++. Map is loaded inside QgsMapCanvas, which is quite slow, mapcanvas is the part of QGraphicScene, ...
0
votes
0answers
35 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
1answer
87 views

Using DTED file as raster elevation source at ArcGIS SDK for Qt?

I am using ArcGIS SDK for Qt 100.7 for development and I was getting elevation from the code ArcGISTiledElevationSource* elevationSource = new ArcGISTiledElevationSource(QUrl("https://elevation3d....
1
vote
1answer
143 views

Different Behaviour of GDAL.RasterIo with Python and C++

I was using GDAL C++ API and Python API to open a tif dataset and read it into memory, but then I got some annoying issue, when I use Python,all works fine. import gdal ds = gdal.Open('/*.tif') band =...
3
votes
0answers
99 views

QGIS C++ 3D Map Scene

I want to use QGIS with c++ api like ArcGis runtime sdk. I tried to use Qgs3DMapScene class like QgsAbstract3DEngine *m_window3DEngine; Qgs3DMapSettings *m_mapSettings = new Qgs3DMapSettings; ...
1
vote
1answer
66 views

How to transform camera calibration parameters to other coordinate system?

I have all camera calibration parameters (X0, Y0, focal length, R0, P0, P1, K0, K1, coarse rotation, rotation, translation) and position of the image in WGS84 (XYZ in meters) and other parameters like ...
0
votes
1answer
165 views

QGIS Application in C++ [closed]

I'm new to QGIS 2.8 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour ...
1
vote
0answers
47 views

What is the meaning of a bearing exactly?

I have encountered this bearing concept as the following. Background: Given the profile "testbot" And a grid size of 10 meters Scenario: Testbot - Intial bearing in simple case ...
2
votes
1answer
175 views

Using Geos C++ Library to return overlap and intersects [closed]

I'm running GEOS C++ Library v 3.6 on Fedora. I have a list of geometries I loaded from a shapefile and converted to geos polygons. The shapefile is large and I may be overlaying several ones to ...
2
votes
0answers
64 views

QGIS Layer List upgrade to V3 C++ plugin

I was upgrading a c++ plugin that I had used in the past and almost eliminated all the the usual changes according to the most current version (3.6). The plugin used to collect current map canvas ...
1
vote
0answers
59 views

Loading offline tiles as QgsRasterLayer in C++ or Python?

I have created tiles via Qtiles plugin in QGIS. Here is the code snippet I have so far: QString url = "file:///C:/Users/USER/Desktop/TiledMap/{z}/{x}/{y}.png"; QgsRasterLayer * lyr = new ...
1
vote
0answers
45 views

Refreshing only part of QgsMapCanvas? [closed]

When using the refresh() function, is it possible to only refresh part of the map canvas, instead of refreshing all of it? I am using C++ but can use any code snippet even if it is in Python.
2
votes
1answer
183 views

stack_raster.cpp:35:99: error: 'YES' was not declared in this scope

I've been playing around with C++ and the API for GDAL to create some functions that I have done using Python. One of them was to create a virtual raster based on a list of files found in certain ...
-1
votes
1answer
61 views

Any algorithm to draw lines inside a shape? [closed]

Let's say you have a circle and have all the coordinates (x,y) that make up the circle.... How would you create lines (vertical and horizontal inside it? What about a rectangle? What if you have the ...
2
votes
1answer
82 views

QGIS - How to render QgsMapCanvas on QApplication's main window

I am working with C++, QT 5.11.3, Visual Studio 2015 and QGIS 3.7 I'm trying to develop QT c++ application that uses the qgis api. I want to display simple raster and vector map in my qt application. ...
1
vote
0answers
26 views

Using QGIS C++ API to open .sfx

Trying to load layers from .SXF: QgsProviderRegistry::instance(qgisPluginPath); pLayerFromProvider = new QgsVectorLayer( filePath.toUtf8(), SL_LayerList.at(index....
3
votes
1answer
464 views

Seeking code behind Fix Geometries tool in QGIS?

I used the very nice "Fix Geometries" tool in the Processing Toolbox of QGIS 3.6 to repair a vector layer that was giving me trouble. The tool in QGIS worked just fine, but I was hoping to find out ...
1
vote
0answers
863 views

How to calculate OSM WGS84 Lat and Lon to meters in C++?

Summary I am converting OSM coordinates into X and Y values with accurate distances in meters between all points using c++. The calculations/code I am using is resulting in an incorrect ratio/scale ...
1
vote
1answer
197 views

How to catch the event the mousePressEvent on Esri :: ArcGISRuntime :: Graphic?

All events mouse protected. I tried to do it via eventFilter and using QObject :: connect, but the result false. How do I catch a click event on Graphic? What I tried: ... void ViewshedGeoElement:...
0
votes
1answer
168 views

Getting PNG binary data from GDALDataset

I have an in memory GDALDataset of driver type PNG. How can I get the binary PNG data to send to a web client without first writing the GDALDataset PNG to disk and reading it back as a binary file?

1
2 3 4 5
8