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

0
votes
0answers
18 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
13 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
110 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
12 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
23 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
71 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
36 views

How to install 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
82 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
35 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
12 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
17 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
19 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
28 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
36 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
31 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
55 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
69 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
13 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
53 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
36 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
116 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
26 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
54 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
145 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
66 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
31 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
111 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
76 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
85 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
234 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
100 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
104 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
190 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
137 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
48 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
321 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
47 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
45 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
84 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
54 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
349 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
140 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
332 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
70 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
105 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
123 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
333 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
33 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
155 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"...