Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

An object-oriented programming language

1
vote
0answers
13 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
14 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
13 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
26 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
27 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
30 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
35 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
52 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
12 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
48 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
31 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
81 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
22 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
39 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
98 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
51 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
30 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
110 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
55 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
1answer
47 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 ...
1
vote
1answer
177 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
90 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
94 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 ...
-1
votes
1answer
132 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
122 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
47 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
264 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
39 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
44 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
66 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
43 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
315 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 ...
-2
votes
1answer
108 views

Visual C++ runtime error

I had a working ArcGIS installation on my computer. Suddenly one day this error occurred. Runtime error! in Microsoft Visual C++ Runtime Library . I have reinstalled ArcGIS, reinstalled all the ...
0
votes
1answer
270 views

Set Metadata domain with GDAL (python bindings)

I'm trying to set geolocation metadata in a gdal vrt with python bindings. ds = gdal.Open('foo') ds.SetMetadata ({'X_BAND' : '1'}) gdal.BuildVRT('bar', ds) Results in a vrt with the following ...
1
vote
1answer
61 views

Unresolved externals on simple mapnik c++ application

I'm attempting to write a simple win32 x64 console application in c++ using VS 2017 that uses the Mapnik v3.0.9 SDK to render a png from a pgsql database. All I've done so far is include a reference ...
1
vote
0answers
101 views

Reproject map without resampling

I am going to build my on On-The-Fly projection system, just like QGIS's. A re there any C++ Libraries that will allow this? QGIS does not to resample the raster while on-the-fly reprojection, but to ...
1
vote
0answers
115 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
1answer
308 views

Read a CSV with two Polygons(WKT) with GDAL

I am trying to read a CSV file where the geometries of neighbouring polygons are stored in couples. The file looks like this. I usually read shapefiles in GDAL using the following syntax ...
1
vote
0answers
32 views

Using Google Earth server data with custom GIS app

I have implemented my own GIS-like app that is able to show tiled data (Bing & Esri tiles for example) and georeferenced images. However, customer wants to use the app in an offline environment ...
0
votes
1answer
140 views

C++ GDAL API: Add more than one rasters to VRT

I want to add more than one tiff file into a vrt file, Well Based on GDAL documentations it is possible to create a vrt using this code GDALDriver *poDriver = (GDALDriver *) GDALGetDriverByName( "VRT"...
0
votes
0answers
140 views

GDAL C++ Re-Project Coordinate with Elevation (Z)

I need some assistance in determining why the following code is not re-projecting the elevation parameter. It works perfectly for the Latitude and Longitude portions but seems to completely ignore the ...
2
votes
1answer
321 views

Coordinates Reprojection with GDAL in C++

So I am trying to re-project a coordinate from WGS 84 / UTM zone 33N (Meters) to WGS 84 (DD). I have tried the below methods but both times when it gets to the portion to translate it throws Unhandled ...
1
vote
1answer
164 views

Raster reprojection with GDAL in C++

I'm working in a GIS program with C++ and in this moment, i'm working in my raster visor. I need reproject my Raster in ejecution time, but i dont want create a output file with this reprojected ...
2
votes
0answers
242 views

reading 13 bands (Sentinel 2A) .tif image in cv::Mat (opencv C++)

I want to read 13 bands of a .tif image in separate cv::Mat objects for processing. I have tried reading it with opencv imread() function but it fails to load it. Also, I have used libtiff but I am ...
0
votes
0answers
74 views

False converting from lat/long into UTM

Im trying to convert lat/long into UTM, but have some problems in it. First I get my coordinates in lat and long latitude_wgs84_radians: 0.924593 longitude_wgs84_radians: 0.176054 Then Im trying to ...
1
vote
0answers
1k views

How to convert lat long to UTM

I want to convert two double (double longitude_wgs84_radians, double altitude_wgs84_meters) which I get from a function. The coordinates looks like latitude_wgs84_radians: 0.924593 ...
1
vote
0answers
149 views

How do I import QGIS C++ libraries into my Qt/C++ project?

I'm working on Ubuntu 14.04 and I downloaded QGIS Desktop version 2.18.14... I also have Qt Creator version 3.0.1 (based on Qt 5.2.1)... When I downloaded QGIS Desktop via the Ubuntu software center,...
1
vote
1answer
288 views

Gdal RasterIO error about Too few parameters

I want to get the value using GDAL RasterIO in C++, there is my code. howveer there is a bug that error C2660: “GDALDataset::RasterIO” and there are too few parameters GDALRasterBand* ...
1
vote
0answers
57 views

ArcObject C++ Quick Start Guide Loop layer in FileGDB [closed]

Could anyone guide on how to create console app (c++) that use ArcObjects? I've searched Google a lot on this topic but can't find any tutorial on how to do this. You may wonder why would I use C++ ...
2
votes
1answer
48 views

Getting “not data-defined” label properties

My plugin needs to read out the labeling of a feature layer. I can read via QgsPalLayerSettings the data-defined properties. QgsDataDefined * dd = set->dataDefinedProperty(QgsPalLayerSettings::...