Stack Exchange Network

Stack Exchange network consists of 174 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
1answer
28 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
10 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
0answers
33 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
20 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
52 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
19 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
28 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
54 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
42 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
25 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
106 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
34 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
32 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
116 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
58 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
77 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
76 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
106 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
43 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
206 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
34 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
39 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
34 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
27 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
287 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
77 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
210 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
50 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 ...
0
votes
0answers
16 views

Is there a way to pass an in-memory file to Geographiclib::Geoid?

I'm working in a project using Geographiclib. It builds a Geoid object, passing a filename. The object then calls ifstream.open(filename). The project is now going to run on the cloud, so the open ...
1
vote
0answers
97 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 ...
0
votes
0answers
76 views

Can't get EPSG from Shapefile with OGR/GDAL

At this moment, i'm working in a shapefile visor in C++ and QT and using the GDAL/OGR library. I have this method to get the EPSG of my shapefiles: OGRLayer layer = dataset->GetLayer(0); ...
1
vote
0answers
104 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 <...
0
votes
0answers
274 views

Convert x/y to lat/lon

I am using the HDF data and I have a library which I can get x,y to lat/lon and lat,lon to x/y based on that library. However when I want to extract some of my data I need to get x,y to lat/lon as ...
0
votes
0answers
173 views

Extracting Point Coordinates from Polygon in WKT format?

I would like to find an efficient way of extracting point coordinates of a polygon in wkt format in GDAL. For the moment I am reading the data in an OGR geometry following the instructions found here (...
1
vote
1answer
279 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
28 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
115 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
113 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
266 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
147 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
228 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
63 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
132 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
238 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
52 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
43 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::...
2
votes
1answer
112 views

Understand QgsRuleBasedLabeling

My c++-plugin for QGIS 2.18 should read out the labeling properties from the layer. So I was searching the API for getting informed of rule-based-labeling but still get more confused. In my example I ...
1
vote
0answers
73 views

Allocation error by deleting symbol layer

In my plugin I have a loop where a Symbol is created in first run through. During next steps the symbollayerlist should be filled. In creating with standard constructor always a symbollayer is ...
4
votes
1answer
103 views

Faster way to find nearest neighbors with LASlib?

I'm using LASlib to find the nearest neighbors of a subset of points in a point cloud. I'm using brute force to find nearest neighbors, which is extremely slow (my code below). Is there a better way,...