New answers tagged


libpq allows us to connect to Postgres/postgis for read write operations. If you have installed Postgres,libpq is already available.It would be available at installation path like C:\Program Files\PostgreSQL\9.5\include . //To make use in C/C++, you include these header files #include "libpq/libpq-fs.h" #include "libpq-fe.h" #include <stdlib.h> ...


from pyproj import Proj, transform P3857 = Proj(init='epsg:3857') P4326 = Proj(init='epsg:4326') x,y = transform(P4326, P3857, lon, lat)


It's generally discouraged to write c++ QGIS plugins, for the following reasons: They can't be distributed via the plugin library (only python plugins with no binary dependencies are accepted) The c++ API is not stable between QGIS releases (including point releases), so you need to update and recompile c++ plugins for each QGIS version used. (In contrast, ...


This is very doable using C++. Some example code is below. You just need to use the correct driver. See here for driver formats. "HFA" is the code for the Erdas imagine (.img) format. GDALDataset *pDS; GDALDriver *pDriver; pDriver = GDALGetDriverManager->getDriverByName("Name of you driver here"); //open the raster in read only mode pDS = ...


You must understand the logic of the Python version of GDAL. With a raster with the same projection (EPSG:3857) from osgeo import gdal data_set = gdal.Open("test.tif") # Getting the Spatial Reference System (returned in Well Known Text(WKT) format) projInfo = data_set .GetProjection() projInfo 'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS ...


If the output from gdalinfo file_name.tif is to be believed, it looks like the C++ implementation assumed your datum was WGS84 and filled out the rest of the WKT for you, although there shouldn't be an entry for both PROJCS and GEOGCS. It's hard to tell for certain without digging into the gdal source code and libraries.

Top 50 recent answers are included