Skip to main content

Questions tagged [c++]

An object-oriented programming language

Filter by
Sorted by
Tagged with
4 votes
1 answer
9k views

QT C++ application using QGIS API

I'm trying to develop a QT C++ application that uses QGIS API and I can't manage Qt Creator to compile the code. I've read several topicts at gis.stackexchange and from other sources. The information ...
Diego Sartori's user avatar
34 votes
10 answers
17k views

How do I develop my GIS programming skills?

I would like to develop my GIS programming skills, where do I start? People say learn C++ or Python but where can I learn this in a geographic context? Tutorials or anything would be very helpful, as ...
Will's user avatar
  • 481
3 votes
1 answer
1k views

Using QGIS C++ API In Custom GIS Application

I'm trying to develop a custom GIS application using Qt. Which will show a map and have some figure drawing options on the map. While searching on the web, I came across with QGIS. I wonder if I could ...
nedret ozay's user avatar
15 votes
2 answers
18k views

Creating sectors for telecom towers

I work in the Mobile networks industry and i took up a task to create a plugin for QGIS using c++/python that does the following: step 1: Create points corresponding to each mobile tower based on Lat/...
Bavin's user avatar
  • 159
14 votes
2 answers
15k views

Characteristics of different methods to convert ECEF to LLA

I'm trying to convert ECEF (Earth Centered, Earth Fixed) coordinates, which are defined in X,Y,Z, centered at (0,0,0) to LLA (Latitude, Longitude, Altitude). There are a couple of methods I found on ...
Pris's user avatar
  • 1,251
8 votes
1 answer
5k views

Setting up an application in QT Creator that uses QGIS API

I am a 15 year veteran of Java making my first entry in to C++ applications. I have a specific need to develop a desktop application that produces graphics type output as well as displaying embedded ...
user1078284's user avatar
6 votes
1 answer
2k views

Seeking open source solution to access rasters in File Geodatabase?

I'm looking for a way to access raster layers in an Esri File-GeoDatabase without using ArcObjects or ArcPy, specifically I would like to access the raster layers with GDAL. I understand that the GDAL ...
khafen's user avatar
  • 480
6 votes
2 answers
3k views

Looking for QGIS 2.4 C++ Hello World example?

In the project I'm working on (C/C++/Qt application), we are trying to integrate QGIS (latest version desirable, 2.4 for the moment). But there is very little information in the web on how to use QGIS ...
Kalitine's user avatar
  • 291
5 votes
1 answer
3k views

QGis Plugin Licence

I would like to create a plugin using commercial software. Does the QGis licence permit this? Are there any restrictions on the licence I can choose to apply to my plugin?
Damian Dixon's user avatar
3 votes
1 answer
700 views

Georeferencing las files using liblas

I am trying to write georeferencing information to a '.las' file using liblas and c++. Here is my code: ofstream ofs; ofs.open("test.las", ios::out | ios::binary); liblas::Header header; ...
cpiury's user avatar
  • 315
3 votes
0 answers
4k views

Correct way to extract pixel data using GDAL. Current method gives repeated but changing value.

I am trying to open a spectral file and move bands of data from GDAL to OpenCV's Mat data structures. As of now I am just trying to make sure that I can correctly access each band using GDAL and pull ...
aaron burns's user avatar
1 vote
1 answer
9k views

Convert Lat/Long to UTM specifying which zone to use (C++)

I need to convert Latitude/Longitude coordinates into UTM, in C++, specifying which zone to use. I am working with locations that fall in two zones, and would like to project them all into one zone - ...
iomartin's user avatar
  • 113
-5 votes
3 answers
911 views

How can I use ogrinfo to reach information about a .shp?

How can I use ogrinfo? where should I write it? In the visual studio's command prompt or somewhere else? Can you make some examples? when I use ogrinfo in the windows or visual studio's command ...
Sepideh Abadpour's user avatar
13 votes
5 answers
18k views

Converting latitude, longitude (EPSG:4326) into EPSG:3857?

I'm looking to study the math involved to see how a given latitude and longitude in decimal degrees can be converted to EPSG:3857. Can anybody point to a good reference or a possible Ppython/C/C++/...
user50614's user avatar
  • 131
6 votes
1 answer
2k views

How to use GEOS/C++ to efficiently find all point pairs closer than a threshold?

Can anyone tell me how to use GEOS/C++ to efficiently find all point pairs in a dataset closer than a threshold distance d? I suspect this might involve quadtrees or rtrees but not quite sure how ...
Sideshow Bob's user avatar
  • 2,343
6 votes
2 answers
6k views

How to store raster data in spatialite?

I want to cache my raster data(large geotiff files) on local database. I thought to use spatialite. I found librasterlite which provide functionality to do that. Can anybody point to some tutorial on ...
user8119's user avatar
  • 337
5 votes
1 answer
607 views

How to refresh layers independently?

I'm writing a C++ application using QGIS API and I would like to improve the performance. I want to render 5 layers: one raster layer using gdal to load Bing/Google Map tiles 4 custom QgsMapLayer (...
atonda's user avatar
  • 78
5 votes
1 answer
16k views

Calculate bearing between two decimal GPS coordinates (Arduino / C++)

I am trying to calculate the bearing just like in this example: Calculate bearing between two decimal GPS coordinates , but my environment is Arduino. I got the code translated (please see below), ...
carlosbvz's user avatar
4 votes
1 answer
2k views

How to speed up rasterio.transform.xy

REPRODUCIBLE SETUP In a Google Colab notebook, I install rasterio: !pip3 install rasterio Import modules: import rasterio import numpy as np import time from rasterio.crs import CRS from rasterio ...
zabop's user avatar
  • 2,214
4 votes
2 answers
11k views

How to get long, lat and altitude info from geotiff file using GDAL and C++

I need to get longitude, latitude and altitude info for each pixel in GeoTiff image. I have installed GDAL in my system. Since I am new to GDAL I don't know how to proceed further. How can I get the ...
SUD2193's user avatar
  • 139
4 votes
1 answer
2k views

Using the C++ GDAL API how do I set the GDAL_DATA path?

If I want to change the directory of the GDAL_DATA path or point to a different version of a csv file for EPSG numbers how do I do that using the C++ API?
David's user avatar
  • 183
3 votes
1 answer
783 views

Cropping raster file with GDAL warp C++ API

I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation. The algorithm is written in C++ so I want to call ...
Chang's user avatar
  • 310
3 votes
1 answer
5k views

How to determine latitude longitude point from a pixel within a MODIS tile?

I need to know latitude / longitude of each pixel in a MODIS tile image in HDF in order to reproject from sinusoidal (MODIS) to mercator (Google Maps). I Can read values from HDF in my C++ program, I ...
nostromo100's user avatar
3 votes
5 answers
3k views

How do I turn a GeoTIFF file into a bmp file?

I need to get GeoTIFF files transformed into bmp files so that I can display them as apart of some software that I am working on. Unfortunately, I am a total newbie with GIS and really don't know much ...
user1240592's user avatar
3 votes
1 answer
1k views

Determining if a group in legend is selected, using PyQGIS

How can I determine in code (python or c++) whether a group in legend is selected or not? mQGisIface->legendInterface()->selectedLayers() gives me only selected layers and no groups, and in ...
Frau Schmidt's user avatar
  • 1,181
3 votes
2 answers
891 views

Why does GDAL open a DTED file as a vector format?

GDAL version: 2.1.1 Language: C++ Given the path of a geospatial file, I want to know whether the file is a raster or vector format. The only way I have found so far to make that distinction is to ...
Mike Finch's user avatar
3 votes
1 answer
553 views

Is it possible to change the geometry without startEditing the layer

I am working in c++/QT 4.5 with the QGis 2.8.2 API. I had to change the geometry of features in a layer each second. Each second new data comes from the Ethernet connection, the application gets the ...
ainardi's user avatar
  • 843
2 votes
0 answers
314 views

Problem on running a sample code of QGIS3 C++ API

I have written a code using QGIS 3 C++ API. But there are runtime errors. My environment is: Windows 10 64bit Qt 5.15.1(MSVC 2019) Qt Creator 4.13.1 QGIS 3.x.x using osgeo4w-setup-x86_64.exe, and ...
Alireza_Armn's user avatar
2 votes
1 answer
292 views

Keeping a vector layer always on top

I want to know how to keep a layer always on top of other layers! After adding a vector layer ( QgisInterface->addVectorLayer ), I want that layer to always be displayed on top of layers added later. ...
QgisTn's user avatar
  • 378
2 votes
3 answers
2k views

Convert .tiff data to bitmap just when rendering and at runtime by visualC++ code

I need to convert a .tiff image to a bitmap one without saving the bitmap. I know that I should use GDAL_translate but because I'm new, this function's interface is a little complicated for me. Could ...
Sepideh Abadpour's user avatar
2 votes
5 answers
5k views

How to crop Geotiff image in C++ (GDAL or other possibilities)? [closed]

I am developing a code to process a geotiff image. But firsly I need to crop a geotiff image preserving its metadata (projection...) in C++. My idea it's to provide the corners and the geotiff image ...
Andreww's user avatar
  • 39
2 votes
1 answer
286 views

Implement r.cross / ArcGIS Combine with GDAL

I am using GDAL to process a lot of rasters. I then need to combine all the arrays to create a single output raster that represents all the unique combinations of values. I.E the same thing as r....
James's user avatar
  • 2,268
2 votes
1 answer
9k views

Sample for MS Visual Studio C++ using GDAL library

I need to create a sample console application on c++ that will use *.hdf file as an input and will read it. As I got, I need a GDAL library. I've found a GDAL tutorial on official GDAL website, but ...
AKovtunov's user avatar
  • 151
1 vote
1 answer
917 views

Get the keyPress-Event in QGis-Plugin

I have a QTreeWidget in a QWidget which is the gui of my plugin(cpp). Now i want to get the keyPress-Event of a Node in the TreeView. I try to reimplement the signal of the QWidget. protected: ...
Frau Schmidt's user avatar
  • 1,181
1 vote
1 answer
72 views

Changing Dataset Property

I 'm working on GDAL C++. But I have some trouble to change GDALDataset property. I have converted "jpg" to "bmp" an image. But I want to do read an image(jpg) to gdaldataset then change dataset ...
coderkan's user avatar
1 vote
1 answer
2k views

Most optimal algorithm for contour correctness?

Am creating an app which correctly calculates contours from a DEM file or any height-map given to it. The correctness of the contour holding the most importance, since a person viewing the contours ...
Nav's user avatar
  • 375
1 vote
1 answer
340 views

Change point with icon in QGIS using API [closed]

I want to change points in the vector layer with an icon, which is an image in .png type using QGIS C++. I found Creating custom marker from vector image using PyQGIS but how can I do that ...
kry23's user avatar
  • 93
1 vote
1 answer
405 views

Porting QGIS C++ plugins to other QGIS installations

I developed a C++ plugin for QGIS using VC++ express 2008 and a QGIS dev release (1.9.90 alpha), my plugin works fine on this release and now I want to port it to other QGIS installations, so I copied ...
QgisTn's user avatar
  • 378
1 vote
2 answers
449 views

Free 3rd party library for showing geospatial vector information

Up to now, I have used GDAL to extract raster data from geotiffs and then, OpenGL to show that raster data. But when it comes to extract vector data with the help of OGR, what library would you ...
Sepideh Abadpour's user avatar
1 vote
0 answers
1k views

How to read vector datasets using GDAL library

Up to now, I have used GDAL in order to read raster information and geotiffs and show them with the help of OpenGL. Now I have a vector dataset, and by that, I mean I have the files with types: DBF ...
Sepideh Abadpour's user avatar
1 vote
2 answers
1k views

QGIS Rule Based Rendering

I am looking for an example of how to use the QgsRuleBasedRendererV2 to filter features of a layer based on an attribute value (0 or 1). Has anyone done this in Python or C++?
William Wilson's user avatar
1 vote
1 answer
2k views

How to get values to create world file format?

i have researched regarding making world file format and tried to create one using c++ in windows, can somebody confirm if where i am getting the values from are correct? the literature regarding ...
Reuben Capio's user avatar
0 votes
1 answer
718 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"...
Majid Hojati's user avatar
0 votes
0 answers
747 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 ...
Josh's user avatar
  • 121