Skip to main content

Questions tagged [c++]

An object-oriented programming language

124 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
0 answers
1k 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 ...
Alex McVittie's user avatar
8 votes
0 answers
2k views

GDAL RasterIO performance in C++ vs ReadAsArray in python/numpy

I'm currently writing optimisations for a raster viewer program which uses gdal as it's base. It's currently written purely in python, and has some major speed issues which cause problems when we are ...
gjones's user avatar
  • 213
6 votes
1 answer
207 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 ...
user2033412's user avatar
6 votes
0 answers
355 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 ?
Anuraj Ennai's user avatar
5 votes
0 answers
845 views

ATDI free map read with software

I am interested in working with the freely available ATDI MAPS. The maps are provided for their proprietary software ICS manager or ICS telecom. I am involved in a project to develop a software in c++ ...
rowman's user avatar
  • 101
3 votes
0 answers
83 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
3 votes
0 answers
657 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
3 votes
0 answers
226 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; ...
barber's user avatar
  • 41
3 votes
0 answers
203 views

ArcGIS Server Object Extensions: how do I deploy extra .dll's?

I am developing an ArcGIS Server Object Extensions in C# that makes calls into a C++ .dll. How do I add this .dll to deployment? By that I mean that I want it included in the .soe.
Andy's user avatar
  • 375
3 votes
0 answers
530 views

GDALRasterizeGeometries doesn't burn correct Values

What I have is a vector shapefile with a string field. What I've done is written a CSV file with the field ID, field_value and now I would like to rasterize the vector layer as a byte raster with the ...
Raychaser's user avatar
  • 613
3 votes
0 answers
4k views

Correct way to extract pixel data using GDAL. Current method gives repeated but changing value.

I am trying to open a spectral file and move bands of data from GDAL to OpenCV's Mat data structures. As of now I am just trying to make sure that I can correctly access each band using GDAL and pull ...
aaron burns's user avatar
3 votes
0 answers
253 views

How do I get the domain from an OGRSpatialReference?

I would like to know what the projected bounds are for a spatial reference using OGRSpatialReference. Is there some way to use the GetProjParm method to get this information? An example of what I'...
David's user avatar
  • 183
3 votes
0 answers
886 views

How to extract an adjacency matrix from OSM?

I would like to use graph algorithms from the Boost graph library on OSM data. What are my choices to use Openstreetmaps data from within a C++ program ? I need at least a flat file with a list of ...
alecail's user avatar
  • 131
2 votes
1 answer
375 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
  • 101
2 votes
0 answers
314 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
2 votes
0 answers
504 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 ...
Mike Finch's user avatar
2 votes
0 answers
161 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 ...
dirtshell's user avatar
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 ...
Bach Nguyen's user avatar
2 votes
0 answers
114 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, ...
Hamza Mehmood's user avatar
2 votes
0 answers
105 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 ...
mazda's user avatar
  • 21
2 votes
0 answers
46 views

Support materials and shaders in ArcGIS when importing model from 3D Max?

Does ArcGIS support materials and shaders when importing a model from 3D Max? Can I change the texture of the model when it is already added to the scene? How to do it? Esri::ArcGISRuntime::...
Ivan Triumphov's user avatar
2 votes
0 answers
600 views

Fill masked array values with reflect padding

I have a square matrix (image) with masked values in an area. The mask corresponds to missing values in areas close to the border (always). I want to create a new image where the masked values are ...
Foivos's user avatar
  • 121
2 votes
0 answers
410 views

Adding SpatiaLite to Visual Studio project (already has SQLite)

I am very new to SpatiaLite. I am working on a large Visual Studio C++ project that already supports SQLite, and I am trying to add SpatiaLite capabilities to it. After reading the documentation and ...
dan's user avatar
  • 21
2 votes
0 answers
225 views

How to use QGIS plugins functionality in standalone application

I'm new to QGIS 3 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 plugin ...
Biruk Sitotaw's user avatar
2 votes
0 answers
119 views

effective debugging my QGIS c++ plugin

For debugging my QGIS-plugins in Visual Studio 2008 I have to start QGIS and attach the process (with Ctrl-P) to my debugger in VS. This is because the plugin is a dll and has to be loaded during QGIS ...
Frau Schmidt's user avatar
  • 1,181
2 votes
0 answers
601 views

How to create tiles using GDAL from georeferenced tiff in C++?

I used GDAL to georeference a static image. However, when I load it in the map canvas (QGIS API), the image gets blurry when I zoom in. I need to generate map tiles but I cannot figure out how I would ...
user2522981's user avatar
2 votes
0 answers
104 views

longitude and latitude values calculated using gdal differs from values displayed in various tools like (photoscan , global mapper etc..)

I have used gdal to read geotiff file. I tried to calculate longitude and latitude value for each pixel and line. Here is part of my code. for (int l_idx = 0;l_idx < line;l_idx++ ) { for (...
SUD2193's user avatar
  • 139
2 votes
0 answers
84 views

coordinate returned by xyCoordinate signal is different

I am working on a project based on the api qgis 2.8 and qt 4.8.5 I have two computer one with the qgis 2.8.1 and the other with the qgis 2.8.3 In my application I have a connect to the signal ...
ainardi's user avatar
  • 843
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 ...
Jake Wade's user avatar
  • 163
2 votes
0 answers
268 views

Microsoft Visual C ++ Crash when Install qgis.2.8.1

I have installed and reinstalled QGIS ver.2.8.1. and always display a message as shown below. I hope someone can help me fix these problems.
syafrauf's user avatar
  • 257
2 votes
0 answers
58 views

In version 2.4 vector layers with labeling switch off caching

I am developing a map display stand alone application using the C++ API. With version 2.6 the caching mechanism is ignored for vector layers with labels. The reason is to avoid conflicting labels. ...
Dieter's user avatar
  • 21
2 votes
0 answers
279 views

How do you clip a gnomonic or stereographic azimuthal projection?

I have polygons comprised of lat/lon coordinates and I want to project them onto a plane that's appropriate for polygon operations (such as checking for intersections). In some cases, the polygons ...
Pris's user avatar
  • 1,251
2 votes
0 answers
331 views

How to rasterize a vector data with style

I want to make a utility in c++ which can rasterize vector data with some specified style. I know about gdal_rasterize. But the problem with it is, we cannot specify the style details. Do we have a ...
Ranjith Pillai's user avatar
2 votes
0 answers
262 views

start gdalbuildvrt from c++ plugin

I want to create a vrt from my plugin via gdal-tool. From OSGEO4W-Shell the command works. In my code i tried this: QString program = "gdalbuildvrt"; QStringList arguments; ...
Frau Schmidt's user avatar
  • 1,181
2 votes
0 answers
72 views

Is there a way to distinguish between digitized and pasted features?

Is there a way to tell if an added feature in QGIS is in fact a newly digitized one or a pasted feature? I think QGIS is treating both cases in the same way, emitting the same signal: ...
QgisTn's user avatar
  • 378
2 votes
0 answers
629 views

gdallocationinfo from C++?

I need a C++ API to convert x,y Image Coordinates in their native projection to output image pixel,line coordnates. I see the gdallocationinfo documentation, but no API for it. Where in online GDAL ...
Frederick Irani's user avatar
2 votes
0 answers
314 views

What do I need to build a C++ plugin on windows 7?

I want to make a plugin in C++ and I need to write and build it in windows (Im better with *nix systems). While I have skimmed the various updated C++Plugin docs I can understand if I need to build ...
OHTO's user avatar
  • 243
1 vote
0 answers
62 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
1 vote
0 answers
82 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
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
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
1 vote
0 answers
176 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
258 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
116 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
316 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
635 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
703 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
1 vote
0 answers
59 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
398 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