Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
2
votes
0answers
19 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
31 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
37 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
29 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
39 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
34 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
17 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
91 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
22 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
25 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
214 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
21 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
74 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
91 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
53 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
89 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
82 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
18 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
21 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
21 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
42 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
49 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
95 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
33 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
116 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
78 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 ...
0
votes
0answers
14 views

Optimize A* on a large scale data

I am working on Develop a path finding system on data with about 80,000,000 links. Now I use bidirectional A* to find the path, but it's still to slow. Anyone have a idea?
1
vote
1answer
62 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
0answers
47 views

Adding 2d and 3d base map which includes map actions in Qt application using C++?

I would like to add a base map(Map in the background) to view geospatial vector data in a Qt application i.e written in C++. I have gone through the Qt documentation here. I was only able to find 2d ...
0
votes
1answer
211 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
32 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
79 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
198 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
86 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....
0
votes
0answers
37 views

Open Local Raster Tile Layers with QGIS libs

I have tried my best to read all of the older posts before asking this question. I am a bit confused and I need a direction. from the older posts I have learned how to use SAS Planet to download the ...
4
votes
1answer
118 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
160 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
136 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
318 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
137 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
123 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
250 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
152 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
50 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
393 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,...
0
votes
1answer
54 views

Identify spectral bands in a multispectral raster dataset

I'm trying to make an application to use on precision agriculture using gdal, and want to give it some flexibility to support imagery from different providers. I've been looking around if there's a ...
0
votes
1answer
48 views

Can I change the level of detail of shapefile with OGR?

I`m working in a project where I must display shapefiles. I'm using OGR to read the shapefile data and use QT to display it. At this moment, I can display correctly shapefiles with around 2000 ...
1
vote
1answer
202 views

GDALOpenEx define papszOpenOptions

I'm using GDAL/OGR to open shapefiles. Now i'm calling this method to open a dataset: dataset = (GDALDataset *)GDALOpenEx(path.toStdString().c_str(), GDAL_OF_VECTOR, NULL,NULL, NULL); I read in http:...
1
vote
1answer
118 views

Calling GDALOpen from a function

I'm trying to call GDALOpen from a function to open a tiff raster and then use the dataset further in my main or other functions. This is the code I have so far: int main( int argc, char* argv[] ){ ...
1
vote
1answer
431 views

Most efficient way to split a polygon with lines, C++ API

I'm looking for the most efficient way to split a polygon (possibly with holes) with a set of lines (which can intersect) in C++ with GDAL/OGR or any other library which can prove useful. As shown in ...