Skip to main content

Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Select rectangle area from vector layer on qgsmapcanvas

I have created simple Qt project (C++) to load the vector layer on map Canvas. You can find the layer in QGISTest03_MapData Folder. I have attached the project link below. I want to select a rectangle ...
Bharath G U's user avatar
0 votes
0 answers
28 views

Why is the azimuthal projection not drawn correctly?

I am using Azimuthal equidistant projection, formulas from wiki const double R=1000.0; double calcDist(double phi0, double lamda0, double lamda, double phi) { double cos=qSin(phi0)*qSin(phi)+qCos(...
andrew13121312's user avatar
3 votes
0 answers
89 views

Writing COG using GDAL C++ API fails with block order warning

I'm using the GDAL C++ API to write a COG which is constructed by the rest of the code. If I use the Geotiff driver, there are no problems. But when I switch over to the COG driver, I'm not able to ...
goalie39's user avatar
0 votes
1 answer
28 views

QGIS 2.18 C++ API: How do I match the scale of vector and OSM tile layers with different crs?

I'm loading two layers to QGIS maps canvas: the first is a shapefile, and the second is an xml for OSM TileServer. OSM TileServer - OSM.xml <GDAL_WMS> <Service name="TMS"> ...
ty_2024's user avatar
0 votes
0 answers
14 views

Empty error when reading 3D .wkt out put file of Mean Curvature sleleton

I wrote a code that takes the 3D skeleton from the Mean Curvature Skeleton algorithm as an input to .wkt from the Polyhedron Demo program. It extends to the user with the radius it receives from the ...
zahra_kheyrollahi's user avatar
3 votes
1 answer
229 views

Where is the source code for the Processing Plugin "Buffer"?

Context: In the Graphical Modeler, I want to use an attribute of my source layer to set the buffer distance parameter. Using the "Pre-calculated Value" option, and entering the attribute ...
kbjshop's user avatar
  • 63
1 vote
0 answers
74 views

Running c++ executable file from python console in QGIS

I am trying to run a simple c++ program which I have already compiled from python console in QGIS3.32 My goal is to take the output of the C++ program which is nothing but adding 2 numbers, printing ...
BenStone's user avatar
  • 333
0 votes
1 answer
30 views

How to remove VLRs from header?

I want to create a .las file without any VLR using pdal. Apparently, two VLR are automatically created by the writer. That happens even with the las writer option "pdal_metadata" set to ...
Wellington's user avatar
1 vote
0 answers
83 views

Add one OpenGL object like QOpenGLWidget in QgsMapCanvas in a correct lat and lon

I want to add a large number of points to a QgsMapCanvas in a way that updates them every 100 milliseconds. In my initial attempt, I used QgsMapCanvasItem and QPainter to draw these points on the map. ...
Parisa.H.R's user avatar
0 votes
0 answers
73 views

How to make use of tile caching in QGIS using the C++ API?

I can load TMS Maps using C++ API of QGIS but as zoomIn/zoomOut Map it takes time to show map again.I want it to be smoother. I understand that QGIS has classes like QgsNetworkDiskCache or ...
Parisa.H.R's user avatar
-1 votes
1 answer
24 views

Microsoft C++exception occurred in vs2019 when using pdal debug mode: std:: bad_ Alloc's situation

On the debug x64 platform, running the code to (las_opts. add (las_opt)) will throw an exception, std:: bad_ Alloc's situation. When I switch to release x-64 mode, it can run normally. I don't know if ...
cj cc's user avatar
  • 1
0 votes
1 answer
128 views

qgis._core.QgsLayoutTable represents a C++ abstract class and cannot be instantiated

When i try to access the QgsLayoutTable class it says that it is abstract, but in the documentation it is referred as a builder exactly as a QgsLayoutItemTextTable or QgsLayoutItemAttributeTable. ...
Kabloom's user avatar
1 vote
0 answers
23 views

Customizing popup using C++ Qt SDK

I have a KML layer on my map. I want to have a customized popup that will appear on click of placemark on my KML layer. I want to have customized fields in my popup. I am using C++ qt SDK and tried to ...
Trupti Desai's user avatar
0 votes
0 answers
83 views

GDAL keeps giving me a error C++

I have this code float scalingFactor = 1.0f / 2.122f; GDALAllRegister(); const char* filename = "C:/Users/awips/Desktop/BOLTgui/BOLT/test.nc"; GDALDataset* ...
Linuxuser1234's user avatar
0 votes
2 answers
236 views

Reading MrSID (.sid) files with a GDAL built by vcpkg

I have built GDAL 3.7.0 with vcpkg, creating ..\Documents\vcpkg\installed\x86-windows\lib\gdal.lib (I make a .lib to statically link into my C++ application). It is my understanding that when vcpkg ...
M Katz's user avatar
  • 503
1 vote
1 answer
55 views

Is it possible to write your processing provider in C++ as a plugin?

Added a processing provider to his plugin, the plugin stopped downloading. Maybe c++ cannot be created at all. plugin.cpp void MyPlugins::initGui() { initProcessing(); } void MyPlugins::...
alex's user avatar
  • 11
0 votes
0 answers
38 views

GDALTranslate output has not Coordinate Reference System when chunking raster C++

I am trying to take a chunk from a raster file using the GDAL library in C++. Here is the code I am using: const char * inputFile = "water_mask.img"; auto *dataset = (GDALDataset*) GDALOpen(...
justanotherguy's user avatar
1 vote
0 answers
79 views

Show/hide sublayers, QGIS API C++

I'm loading .osm map using QGIS API C++ 3.22.4. The map has several sublayers (points, lines, multilinestrings...) I'm trying to switch on/off sublayers with setSubLayerVisibility(), but always ...
V2718's user avatar
  • 11
1 vote
0 answers
114 views

Cannot propagate events from QgsMapCanvas to QgsMapCanvasItem

I've extended the QgsMapCanvas to catch mouse events and all works well. Then I try to catch events from a QgsMapCanvasItem. Reading the classes QgsMapCanvas extends QgraphicsView, and ...
Gab74's user avatar
  • 31
3 votes
1 answer
533 views

Copied the red band of the RGB TIFF file with GDAL in C++

I'm a rookie in GDAL and C++. I tried to copy the red band of the RGB tif file with Create() and GetRasterBand(1)->RasterIO(). I got the right size of my new tif file, but all the value of the new ...
Blue's user avatar
  • 31
1 vote
1 answer
488 views

GDAL warp in C++

What is the equivalent to the following GDAL terminal command in C++? I looked into GDAL C++ API, but could not figure it out. gdalwarp -te xmin ymin xmax ymax -ts 1 1 -r max input.vrt output.vrt for ...
ARAFAT's user avatar
  • 21
0 votes
1 answer
354 views

Detecting empty TIFFs [closed]

How to detect if a TIFF or VRT is empty. I don't want to loop all over values. By empty, I mean full of NODATA values. A C++ method is preferred. Using the flag -stats with gdalinfo I can get ...
ARAFAT's user avatar
  • 21
0 votes
0 answers
21 views

How to convert a TIF file into a bmp file in C++ 98? [duplicate]

I am new in C++? How i can convert TIF file into a bmp file in C++ 98 without any library? Here is the link i found with library ?link Here is my code but it is giving me error.I have taken it from ...
user211113's user avatar
2 votes
1 answer
399 views

QGIS Building From Source Code with QtCreator in Windows 10 - Flex Dependency

My end objective is to develop QGIS plugins using C++ for a Windows 10 target machine, and to use QtCreator as the software development and build environment. Following https://docs.qgis.org/3.22/en/...
paulQGIS's user avatar
  • 121
0 votes
1 answer
213 views

Using QGIS processing algorithms in C++

There are no instructions for using QGIS processing algorithms in the C ++ programming language but it exists in the Python language. Is it possible to use QGIS processing algorithms in C ++?
Alireza Rahimi's user avatar
0 votes
2 answers
489 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 ...
Burrow's user avatar
  • 441
1 vote
1 answer
192 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 ...
skew_t_pie's user avatar
2 votes
1 answer
177 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 = &...
Frau Schmidt's user avatar
  • 1,181
2 votes
0 answers
34 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&...
kry23's user avatar
  • 93
1 vote
1 answer
351 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 ...
kry23's user avatar
  • 93
2 votes
1 answer
158 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); ...
kry23's user avatar
  • 93
1 vote
1 answer
311 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\...
Nandula's user avatar
  • 783
1 vote
0 answers
180 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 ...
Bogdan's user avatar
  • 133
1 vote
0 answers
259 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 ...
kry23's user avatar
  • 93
1 vote
0 answers
118 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 ...
skew_t_pie's user avatar
1 vote
0 answers
327 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 ...
kry23's user avatar
  • 93
1 vote
0 answers
636 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 ...
Bing's user avatar
  • 11
1 vote
0 answers
724 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 ...
Fuzail's user avatar
  • 133
4 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 ...
zabop's user avatar
  • 2,224
3 votes
1 answer
127 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 | ...
John Doe's user avatar
  • 143
1 vote
0 answers
60 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 ...
user190521's user avatar
1 vote
1 answer
406 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 ...
N Strahl's user avatar
1 vote
1 answer
563 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 ...
Ross Wardrup's user avatar
1 vote
1 answer
310 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 {...
user4663214's user avatar
1 vote
0 answers
94 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 ...
Puneet Kumar's user avatar
2 votes
0 answers
319 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 ...
Alireza_Armn's user avatar
1 vote
1 answer
231 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 ...
Alireza_Armn's user avatar
1 vote
0 answers
138 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/...
skew_t_pie's user avatar
1 vote
0 answers
129 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 ...
skew_t_pie's user avatar
3 votes
0 answers
663 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 ...
skew_t_pie's user avatar

1
2 3 4 5
9