Skip to main content

Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
0 votes
2 answers
240 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 ...
1 vote
1 answer
407 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 ...
1 vote
1 answer
313 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 {...
1 vote
1 answer
344 views

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

I'm loading two layers to QGIS maps canvas: the first is a shapefile, with EPSG:4326 crs. The second is an xml for Goolge TileServer, with EPSG:3857 crs. Google TileServer - Hybrid.xml <...
1 vote
1 answer
332 views

Undefined reference to mapnik::hit_grid from C++ compile?

I am trying to compile a c++ mapnik program with code in question being: mapnik::grid my_grid(256, 256, "id"); and the command to compile being: g++ grid_gen.cpp -std=c++11 -lmapnik -lcairo -...
2 votes
1 answer
401 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/...
4 votes
1 answer
277 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. ...
6 votes
1 answer
208 views

Match housenumbers on buildings (special case of point-in-polygon-test)

Task with example I'm working with geodata (country-size) from openstreetmap. Buildings are often polygons without housenumbers and a single point with the housenumber is placed within the polygon of ...
2 votes
1 answer
1k views

OGRFeature set Multiple fields

To start off with: Using Gdal compiled with Xerces Coding in C++ with the QT Creator version 5.4.1 So my problem is I'm trying to use Gdal to create my own Esri shapefile, I get a strange runtime ...
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 ...
0 votes
1 answer
3k views

TMS format specification [closed]

I want to convert large map file to tms format i.e. how directory structure, zoom levels , tile size, xml file creation have to be dealt with. Can you point to the relevant docs? And is there any gdal ...
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(...
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 ...
3 votes
1 answer
2k views

QGIS Plugin Windows [closed]

I have written a QGIS plugin (RTools) which acts mostly like a independent plugin (minimal interaction with QGIS core functions). On Linux both QGIS and RTools were build using QT 4.8 on Qt creator. ...
0 votes
1 answer
214 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 ++?
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"> ...
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 ...
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 ...
3 votes
1 answer
230 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 ...
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 ...
1 vote
0 answers
75 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 ...
1 vote
1 answer
140 views

Show differenet SVG icons on one layer at runtime

I need to show several SVG icons (more than 388 icons) with different name on a single layer(if possible on memory layer). I am using QGis 2.8 and qt4.8.6 The icons represent different kind of ...
6 votes
2 answers
2k views

How to filter the MouseWheel event in a QGIS C++ plugin?

I’m developing a C++ plugin for QGIS and I want to filter/override the mouse-wheel event. I created a “maptool” to select a polygon feature on a vector layer, the feature has two attributes : an id &...
3 votes
3 answers
829 views

Installing the development files libqgis-dev in Ubuntu 12.04

I am trying to install development files which include the headers and the libraries for qgis in Ubuntu 12.04. I used Ubuntu software center, synaptic and the terminal and am still getting the same ...
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. ...
0 votes
0 answers
75 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 ...
-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 ...
0 votes
1 answer
129 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. ...
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 ...
0 votes
0 answers
85 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* ...
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::...
1 vote
0 answers
102 views

C++ parser for OGC Filter Encoding 1.0

I'm developing a C++ application and I have to parse a OGC Filter in order to implement querying functionality on a metadata repository. Does anyone know any C++ library to parse OGC Filters?
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(...
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 ...
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 ...
2 votes
0 answers
752 views

Setup of development environment of QGIS on windows with qt creator [closed]

Can anyone help me in setting up environment for working on QGIS on windows using qt-creator? I am using qt creator version 1.3.1,qt version 4.6 and QGIS version 1.8.
0 votes
1 answer
747 views

Multispectral images (Band Sequential format) [closed]

How can I create a multispectral image file (in band sequential (BSQ) format), from several 1-band images, using GDAL libraries? I work with C++ language.
0 votes
2 answers
653 views

Requesting tiles without using XML file (GDAL C++) [closed]

I have been able to request a specific tile with my XML through GDAL lib. However, is there is another way of requesting the tiles from a web server without using XML? I want to do it directly through ...
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 ...
1 vote
1 answer
194 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 ...
14 votes
2 answers
15k views

Characteristics of different methods to convert ECEF to LLA

I'm trying to convert ECEF (Earth Centered, Earth Fixed) coordinates, which are defined in X,Y,Z, centered at (0,0,0) to LLA (Latitude, Longitude, Altitude). There are a couple of methods I found on ...
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 ...
1 vote
1 answer
490 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 ...
0 votes
1 answer
355 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 ...
0 votes
1 answer
382 views

Updated version of QGIS coding and compilation guide [closed]

Is there an updated version of QGIS coding and compilation guide? The current version is clearly outdated. I have been trying to compile the first example, 1_hello_world_qgis_style, though to no avail ...
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 ...
13 votes
5 answers
19k views

Converting latitude, longitude (EPSG:4326) into EPSG:3857?

I'm looking to study the math involved to see how a given latitude and longitude in decimal degrees can be converted to EPSG:3857. Can anybody point to a good reference or a possible Ppython/C/C++/...
1 vote
0 answers
159 views

Stepping into C++ functions from external Python app while debugging [closed]

I just wanted to see how to step into the C++ class QgsVectorLayer()'s methods from the python call to QgsVectorLayer(self.uri.uri(),'foo','postgres'). I'm trying to debug and it trying to step into ...
0 votes
2 answers
490 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 ...
2 votes
1 answer
66 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
2 3 4 5
9