Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
0 votes
2 answers
28 views

Transforming using ntv2 nadgrids is behaving different between GDAL 2.3.1 and GDAL 3.4.2

I am working on upgrading to a newer version of GDAL and have an issue transforming coordinates using nadgrids (the beta2007.gsb ntv2 file which can be downloaded here) using GDAL 3.4.2. The issue is ...
user avatar
  • 397
0 votes
0 answers
27 views

Get instance from QDialog in Topology Checker Plugin in QGIS (PYQGIS)

I want to acces to rulesDialog instance because I want to fill information througth a script. In python console I can acces to checkDock instance but when I try to acces to rulesDialog trhows me an ...
user avatar
1 vote
1 answer
31 views

Custom map pan tool freezes map canvas extent, cuts off map tiles (QGIS 3.18)

I've written my own QGIS map tool class to access the protected member functions (canvasPressEvent, canvasReleaseEvent, etc) as well as to be able to limit the distance panned. Specifically I've ...
user avatar
2 votes
1 answer
67 views

How to run QGIS 3 processing tool (DISSOLVE) in c++

For my QGIS C++ Plugin I have to run the QgsDissolveAlgorithm- processing tool. I have found an example, how to do that in python: import processing infn = "path/to/dissolve" outfn2 = &...
user avatar
  • 1,186
0 votes
0 answers
9 views

How to convert hrp format to hrpt16

I have an hrp file, I want to process it in the AAPP software package, for this it needs to be converted to hrpt16 format? This is the Noaa satellite data encoding format. We need an example to write ...
user avatar
  • 129
2 votes
0 answers
30 views

Change default point symbol with an icon in QGIS using API [duplicate]

I want to change default point symbol in the vector layer with an icon, which is an image in .png type using QGIS API. I found a question "Creating custom marker from vector image using PyQGIS&...
user avatar
  • 73
0 votes
1 answer
70 views

Change point with icon in QGIS using API [closed]

I want to change points in the vector layer with an icon, which is an image in .png type using QGIS C++. I found Creating custom marker from vector image using PyQGIS but how can I do that ...
user avatar
  • 73
2 votes
1 answer
24 views

Separate left and right mouse clicks when clicking on canvas

I want to call some functions when I click left and right on the canvas. I wrote the following code for this: mpMapCanvas = new QgsMapCanvas(); mpClickPoint = new QgsMapToolEmitPoint(mpMapCanvas); ...
user avatar
  • 73
1 vote
1 answer
53 views

Opening GRASS GIS 7.8.4 Results in Error

When trying to create a new location in GRASS GIS 7.8.4 on a machine running Windows 11 I get the following error: Traceback (most recent call last): File "C:\PROGRA~1\QGIS32~1.1\apps\grass\...
user avatar
  • 573
1 vote
0 answers
15 views

PDAL LAS writer, how to set the writer as a output stream?

I have a C++ script for my lidar data processing and map building. However, there is no example to set the output stream. So how should I set up the output in the calculation function? The code is ...
user avatar
  • 133
0 votes
0 answers
36 views

Unable to resize legend in QGIS application

I am attempting to display a legend for a mesh map layer in a custom QGIS application (3.20 Odense, C++). I've previously just added the layer tree view to a dock widget, but it took too much space ...
user avatar
1 vote
0 answers
41 views

put marker on a vector layer / map Qt-Qgis

I am designing a GUI using Qt and QGIS and showing maps (shapefiles - Vector layers) on the GUI. I want to put a marker on the vector layers when I click somewhere on the map. I could get coordinates ...
user avatar
  • 73
1 vote
0 answers
26 views

Setting mesh layer visibility in QGIS application?

I am utilizing the QgsMeshLayer class to load a NetCDF file that contains multiple variables (temperature, velocity, etc). I want to be able to set the visible dataset by variable name. I know how ...
user avatar
1 vote
0 answers
73 views

Using QGIS Library in Qt Creator

I wanted to create a GUI in Qt Creator using QGIS libraries. I followed build steps and could build QGIS in Qt Creator. I can open the application from Qt Creator. I have created a GUI using QT ...
user avatar
  • 73
1 vote
0 answers
46 views

Undefined reference to `proj_context_create' while run PROJ example

I have installed Proj 6.3.1 and I tried to run a Proj example from https://proj.org/development/quickstart.html. I implemented it with CLion on Ubuntu 20.04. And I got many undefined reference errors ...
user avatar
  • 11
1 vote
0 answers
141 views

Setup QGIS to use in C++ Qt Application

I have been working on a Qt5 Widgets based application. I'm required to display maps (vector charts) in my application on a widget and for that purpose I've decided to use the QGIS library in my ...
user avatar
  • 33
2 votes
1 answer
198 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 ...
user avatar
  • 250
0 votes
0 answers
50 views

QGIS: Application path not initialized

I've created a QGIS application in C++ using Qt5 (5.11.3) and QGIS version 3.10. While the application seems to run fine, I always get a warning that the application path is not initialized. Here is ...
user avatar
0 votes
0 answers
8 views

Iterating a OGRMultiPoint to extract long/latt/depth data from "SOUNDG" layer (GDAL/OGR C++)

How are the begin() and end() functions on OGRMultiPoint used: While getting the first point is done by casting to an OGRPoint, how do I get access to the remaining points? Presumably iteration is the ...
user avatar
  • 1
3 votes
1 answer
65 views

.gdb table creation speed

I'm trying to convert a shapefile containing N single point shapes to a .gdb using the FileGDBAPI for C++ from Esri. The structure of the shapefile is: x | y | date1 | date2 | ...
user avatar
  • 143
0 votes
0 answers
50 views

Convert an OGR File to a Raster in C++

C++ RegisterOGRSXF(); GDALDataset *poDS2 = static_cast<GDALDataset*>( GDALOpenEx( "file.sxf", GDAL_OF_VECTOR, NULL, NULL, NULL )); // file.sxf = any of your files //...
user avatar
  • 1
1 vote
0 answers
39 views

What toolchain for a Win10 C++/Qt QGis custom application based on QGis v3.20?

We have a C++/Qt application based on the KDE Marble library. I would like to replace the Marble library with the QGis library. However it is not too easy to figure out the correct environment for ...
user avatar
0 votes
1 answer
103 views

GDALWarpOperation in c++ with cutline

I am currently trying to crop a raster by mask layer using the c++ GDAL API. I am using the GDALWarpOptions struct. GDALWarpOptions *psWO = GDALCreateWarpOptions(); I then enter all the necessary ...
user avatar
1 vote
1 answer
129 views

Reprojecting vector geometry in place using C++ & GDAL

I'm trying to implement a reprojection method in my C++ code using GDAL. I open a shape file, pass the pointer to the layer object to my method, and iterate through the features while retrojecting ...
user avatar
0 votes
1 answer
49 views

List supported WKT spatial references in GDAL, c++

I would like to ask if I can retrieve a list of supported projections from GDAL API. I am trying to use GDAL to coordinate transformation for my internal data in the following way. struct MyConverter {...
user avatar
0 votes
0 answers
45 views

Bringing QgisApp & Qgisappinterface to environment using osgeo4w-setup-x86_64

I am using QGIS 3 C++ API. I used osgeo4w-setup-x86_64.exe for installing QGIS. Also, I have installed qgis-dev and Qt5 within QGIS3 SDK. I need to use the QgisApp class in my application, but there ...
user avatar
0 votes
0 answers
55 views

Setup standalone Qt/C++ app with QGIS

i need to develop an Qt/C++ app, that contains dashboards and other info, but I also need the map tools that QGIS offers, but I am struggling to setup this app. I've searched for several instructions, ...
user avatar
1 vote
0 answers
35 views

Symbol change of line and polygon vector layer

I am trying to change the symbols of the polygon/ line vector layer using QGIS C++ APIs. I am able to change the symbol of the point vector layer using below code. I am able to change the color for ...
user avatar
1 vote
0 answers
129 views

Problem on running a sample code of QGIS3 C++ API

I have written a code using QGIS 3 C++ API. But there are runtime errors. My environment is: Windows 10 64bit Qt 5.15.1(MSVC 2019) Qt Creator 4.13.1 QGIS 3.x.x using osgeo4w-setup-x86_64.exe, and ...
user avatar
0 votes
1 answer
74 views

QGIS 3 C++ API, QgsApplication crash

I'm trying to create a simple application using QGIS 3 SDK. I have used osgeo4w-setup-x86_64.exe for installing QGIS, and I have also installed qgis-dev and qgis-ltr-dev and Qt5. I have set up my .pro ...
user avatar
1 vote
0 answers
83 views

Setting layer visibilty in custom QGIS 3.x application (C++ versus Python)

In my QGIS application, I would like to be able to have a QDialog window pop upon clicking a toolbar icon which lists the layers set to the map canvas, and have QCheckBoxes that allow the user to show/...
user avatar
1 vote
0 answers
45 views

Hide layers with custom widget in QGIS 3.10 (C++)

I have written a custom application that loads multiple QgsMapLayers onto a basemap (OpenStreetMap raster tiles). I am attempting to include a menu option that allows the user to hide or show one or ...
user avatar
2 votes
0 answers
167 views

Loading online OSM raster tiles using URL in custom QGIS application (C++)

I am trying to write a C++ version of a custom QGIS (v 3.10) application I initially wrote in Python that overlays data onto OpenStreetMap. I am able to do this successfully by loading online tiles ...
user avatar
1 vote
0 answers
90 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 ...
user avatar
3 votes
1 answer
96 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 ...
user avatar
  • 41
3 votes
1 answer
78 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 ...
user avatar
1 vote
0 answers
143 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 ...
user avatar
3 votes
0 answers
60 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 ...
user avatar
1 vote
1 answer
460 views

Executing GDALRasterize() function wtih options

I am using GDAL 2.1.0, in both Windows and Linux environments. I want to programmatically rasterize a shapefile in my C++ app. gdal_rasterize I can successfully execute the stand-alone gdal_rasterize ...
user avatar
-1 votes
1 answer
68 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 ...
user avatar
0 votes
0 answers
53 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....
user avatar
0 votes
0 answers
235 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 ...
user avatar
14 votes
1 answer
247 views

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 ...
user avatar
  • 2,287
2 votes
1 answer
419 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 ...
user avatar
  • 290
1 vote
0 answers
44 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 ...
user avatar
  • 11
2 votes
1 answer
660 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 ...
user avatar
0 votes
0 answers
160 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 ...
user avatar
1 vote
0 answers
334 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; ...
user avatar
  • 111
1 vote
0 answers
95 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 *...
user avatar
2 votes
1 answer
614 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 ...
user avatar
  • 21

1
2 3 4 5
9