A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
1
vote
1answer
47 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 =...
2
votes
0answers
31 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; ...
0
votes
0answers
12 views

Is there any prebuilt libraries for GeographicLib

I have been struggling to build GeographicLib for use in a Qt project and I was wondering if there is any version of the library that has already been built to work with Qt(minGw)?
1
vote
1answer
46 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
0answers
24 views

Developing QT application with QGIS

I want to develop C++ QT(widget or quick) application which uses QGIS. However, i could not find any resources about how to merge each other. Can you help me? Link, method, example etc. will be ...
0
votes
1answer
56 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
39 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
35 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
28 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
36 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
40 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
73 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
45 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
0answers
46 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
19 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
170 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 ...
0
votes
0answers
24 views

Calculating pitch and roll in ArcGIS Runtime?

For a more realistic movement it is necessary to calculate the roll and pitch. How can I do this by knowing the coordinates of two points? my code: void ViewshedGeoElement::animate() { // if (...
0
votes
0answers
27 views

Is it possible to edit a dimension's data type from pdal?

I'm working in a viewer based in potree with entwine, and i want to have HeightAboveGround (HAG) as a additional information, without replace Z in the LAS data. The target is to show the elevation and ...
1
vote
0answers
448 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
59 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
96 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?
4
votes
1answer
119 views

How to generate triangulation file via QGIS C++ API

I created a plugin few years ago in Python. The plugin uses QGIS interpolation and works for QGIS 2.18. But because the QGIS interpolation creates raster (grid) and I need only Triangulation (TIN as ...
1
vote
1answer
92 views

Installing the QGIS C++ API for Visual Studio?

I've recently being trying to get the C++ API working in Visual Studio, but there really not allot of information out there. I've found these code examples https://github.com/ranchodeluxe/...
2
votes
2answers
101 views

Got Pacman instead of circle when buffering point QGIS 2.14 standalone C++ application

QgsVectorLayer *circleLayer = new QgsVectorLayer("Polygon", "Circle", "memory"); QgsFeature circleFeature = QgsFeature(); circleFeature.setGeometry(QgsGeometry::fromPoint(geometryPoint)->buffer(...
0
votes
1answer
115 views

Get proj4 parameters from EPSG in C++

I have the EPSG number of the projection and I want to use proj4 to get the projection descriptive string (like +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 ...
2
votes
0answers
20 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::...
1
vote
0answers
22 views

QGIS 2.14 c++ standalone application crashes using QgsMapToolIdentify

lResultList.append(mpIdentifyTool->identify(lCoord.x(),lCoord.y(),QgsMapToolIdentify::TopDownStopAtFirst, QgsMapToolIdentify::VectorLayer)); leads to crash of app. It happens when layers provided ...
1
vote
0answers
26 views

zoomScale() doesn't work in QGIS 2.14 standalone c++ application

Can't set scale for my canvas with mapCanvas.zoomScale(50000); Seems like canvas is zooming to 1:1 and for a few seconds I can't zoom in or zoom out with mouse wheel. Any suggestions?
0
votes
0answers
51 views

How to use QT signals and slots in QGIS C++ API

I'm developing a standalone QT 5.11.2 application using QGIS 3.6 C++ API. I have defined a slot that is meant to consume a currentLayerChanged(QgsMapLayer * layer) signal. The slot declaration in ...
1
vote
1answer
53 views

How to set layer transparency QGIS C++ API 2.14?

I want to set transparency for already loaded layer by taking it from canvas QgsVectorLayer *myLayer = mpMapcanvas.layer(0); myLayer.setLayerTransparency(50); myLayer.triggerRepaint(); but get an ...
0
votes
0answers
305 views

How read a raster [Tiff] file to get the correct values for every band? [duplicate]

I am trying to read a raster tiff [RGBA] file with GDAL in [C++], I can load the file, get the number of channels, the size of the bands and the metadata, but when I try to extract the Band [R, G or ...
2
votes
1answer
34 views

Problems with layer labeling QGIS standalone C++ application

mypLayer->setCustomProperty("labeling", "pal"); mypLayer->setCustomProperty("labeling/enabled", "True"); mypLayer->setCustomProperty("labeling/fontFamily", "Cantarell"); mypLayer-&...
2
votes
0answers
228 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 ...
0
votes
1answer
83 views

Difficulties working with QGIS 3.4 API

I want to work with QGIS 3.4 in a C++ Qt project, but the API in version 3 has been completely changed and the sample code for older version don't compile anymore. Is there some sample code which ...
1
vote
1answer
69 views

mapCanvas().DestinationCrs().authid() returns nothing

I want to do some work with projections in my c++ application with QGIS API v2.14. But canvas and layers didn't return their CRS. Even when I'm setting it to them with setDestinationCrs() for canvas ...
0
votes
1answer
354 views

Constructing polygons from GDAL Polygonize?

I have a geotiff file, which, for each cell ( pixel), it contains a discrete value ( you can think of this value as the "fitness" value of the cell). For the neighboring cells, they can consist of the ...
1
vote
1answer
38 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 ...
1
vote
1answer
134 views

Enabling C++ standards when compiling GEOS using cmake/ccmake?

I read from RFC # 7 of GEOS that the old autoconf based build system may be removed in the future, in favor of using cmake. I sometimes need to customize geos and add functions that uses the newest C+...
0
votes
1answer
247 views

Existing C++ libraries that convert ESRI shapefile to DXF/DWG [closed]

Is there any C++ library that can convert ESRI Shapefile to DXF/DWG file? I seek a link/or sample on how this can be done with the said C++ library. I'm aware that one can do this with ArcGIS ...
2
votes
1answer
161 views

Why do I have different maximum values for my TIFF file when importing with gdal?

I am importing a TIFF file into my programm and I am expecting a maximum value for the pixel values of 5.686229 because that's what I have when I read the file with QGIS. But then I get a maximum of 6....
4
votes
1answer
120 views

Improving QGIS source code efficiency?

I have noticed in the QGIS source code that the map layers gets added in two different places, in the Canvas and in the registry as follow: QgsMapLayerRegistry::instance()->addMapLayers(...
1
vote
1answer
220 views

C++ OGR GDAL Set spatial reference of new layer

When creating a new layer using OGR / GDAL in C++, how do i set the spatial reference? OGRLayer *poLayer2; poLayer2 = poDS2->CreateLayer( "layerName", NULL, wkbPoint, NULL ); if( poLayer2 == NULL ...
4
votes
2answers
188 views

Get a list of all supported EPSG code from OGR

I need get a a list of all supported EPSG code from OGR/GDAL. I need this becaouse i'm developing a C++ application map, and I need this information to put it in a user form. I read the OGR ...
2
votes
1answer
403 views

Using QGIS C++ API?

I'm trying to create a simple application using QGIS SDK. But currently, I'm stuck with API at very beginning stage. belows are the env. Windows 7 MSVC 2015 QGIS SDK (downlaod by OSGeo4w) include: ...
1
vote
0answers
182 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 ...
2
votes
0answers
143 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 ...
0
votes
1answer
323 views

(c++) Advanced Geospatial Analysis Library [closed]

I've been searching for a lightweight library for geospatial analysis, with low overhead. Yesterday I found TurfJS, looks great, simple and fast, yet, its made in JS. Does anyone know similar ...
1
vote
1answer
178 views

Correct Qt version to build QGIS master

I just wonder wich version of QtCreator to install, current is Qt 5.11.1. Here I've read about building QGIS master with Qt 5.9.3 debug build: https://www.itopen.it/building-qgis-master-with-qt-5-9-3-...
1
vote
0answers
53 views

How to create GeoTiff from image and inertial data with GDAL

I am trying to position photos that have seconds of week (utc) in their name with a given inertial data from a file, the file has the following columns: UTCTime Easting Northing H-MSL Roll ...
1
vote
1answer
455 views

How to open .hgts file from NASADEM data

I have the NASA SRTM1 data as .hgt files from their ftp website, but I would have these elevation data in respect to WGS84. I found by NASA's ftp site a folder named srtmOnly that contains what I want,...