Tag Info

Hot answers tagged

7

As you would have seen from the referenced GIS SE question, there doesn't appear to be much in the way of viewshed stand-alone packages at least in the Open Source market beyond SAGA and GRASS GIS. Apart from writing a wrapper around the code for these algorthims you may end up implementing viewshed yourself unfortunately. (Though I would love to be ...


6

You can compare the two. In most applications I suspect the second (direct) method will be the one to choose. Accuracy of the first (iterative) method depends on the accuracy with which you do the computations and when you decide to stop iterating. It therefore can be made as accurate as the second method for all inputs where both are valid (the first ...


6

FGDB_BULK_LOAD is not a compilation setting, it is a configuration option for the command line tools (can also be done programmatically). ogr2ogr --config FGDB_BULK_LOAD YES -f "FileGDB" MyFileGDB.gdb myKML.kml Would create a filegdb and load the KML vector data to it. Let me know if your performance still sucks. By the way, what platform are you on? ...


6

Foreword : I think you mean «proprietary» and not «commercial». Any opensource product can be a commercial product, even GPL ones. You can write plugins for QGIS in C++ or Python, the latter being advised, as it simplifies plugins distribution and deployment. QGIS is licenced as GPL, and the Python bindings are GPL too. So is PyQT, which is used in QGIS ...


4

Addins are based on managed code (or Java), so you can develop them in managed C++/CLI, not in pure C++.


4

You need to build the plugin with the 1.7.4 libraries.


4

Ok, got this working - and feel like putting the long answer here, as it has a lot of useful GEOS example bits in it. Here we go. Warnings I haven't compiled this - I stripped out a load of project specific stuff and replaced it with a simple Point class which probably needs a copy/assignment operator. But it worked before I did that. I'm not sure this ...


4

Unprojected: gdal_translate -srcwin xstart ystart xstop ystop input.raster output.raster Projected: gdal_translate -projwin ulx uly lrx lry input.raster output.raster If you are using gdal on your system, gdal_translate is installed.


4

Mapnik is a c++ toolkit for making maps and has python bindings – http://mapnik.org


4

If you're looking for something that's really easy to use and your lat/long data come from a shapefile, you could check out the Python Geographic Visualizer (GeoVis) module. It has no dependencies, requires no installation, and is very easy to use. In the newest version you can also zoom in on specific areas and symbolize based on attribute classification: ...


4

Using QgsMapCanvasItem is the way to go here as you will not have to refresh the canvas. You just have to make sure your implementation is correct. Here is a basic example (taken from https://github.com/DMS-Aus/Roam/blob/master/src/roam/gps_action.py) class GPSMarker(QgsMapCanvasItem): def __init__(self, canvas): ...


4

Here is a good paper which has a C++ focus. It seems very detailed, 147 pages.Automated Label Placement In Theory and Practice


3

You might want to try using GEOS, a C++ port of the Java Topology Suite: http://trac.osgeo.org/geos/ You were on the right lines with a bounding-box check, but the even smarter way is build a spatial index which means you can do better than O(n) for that first pass. GEOS can build spatial indexes for you. I'm wondering what mobile platform you're ...


3

To find which feature the coordinate is near, you first need to build an R-Tree index of bounding boxes or envelope of each feature. A popular library for this is libspatialindex. Secondly, you would then need to know for each of the matched features from your R-tree, which ones match. GDAL/OGR does have some operations based on GEOS to see if the geometry ...


3

Try to look at Proj.4 library. You can reproject you points to common coordinate system and then perform the comparison. Try to create some wrapper class that will perform automate reprojection to common CS and then compare coordinates.


3

For converting from GeoTiff to BMP you can use GDAL library. It has C++ API and well-documented. I have found GDAL convertion example for C#. I hope it will help you to start from. For BMP you will need to create "world file" to store GeoReferencing information. I think GDAL will create it by default.


3

The "bounding box" can have several interpretations. The two most natural are (a) the sides are meridians and the top and bottom are circles of constant latitude and (b) the sides are still meridians, but now the top and bottom are geodesics (which therefore do not necessarily have constant latitude). Fortunately, the solution method is the same in both ...


3

There is a freeware package called RadioMobile which is designed for radio communication studies that generates a view shed. The output is based on a DEM input and can be either a vector (point file) or Raster. I have been able to use the vector point file to create polygons through some scripting which I will be happy to share with you. Since you can set a ...


3

Solved, This can be done by using : QgisInterface::openFeatureForm ( QgsVectorLayer *vlayer, QgsFeature &f, bool updateFeatureOnly = false )


3

This is just a normal Qt thing. You can do: QApplication::setOverrideCursor(Qt::WaitCursor);


3

Thank you Mike. I have solved the problem of cropping the image using VC++ with gdal libraries. I have created VRTDataset of my desired size of raster to be cropped and then save it using CreateCopy().


3

GDALRasterBand::GetStatistics() should work for you after you create your datasets and bands, see: http://gdal.org/classGDALRasterBand.html#a48883c1dae195b21b37b51b10e910f9b if you are translating data, gdal_translate -stats forces calculation of stats.


3

There's a similar question, but not doing it with a programming language. here's a small python snippet which checks the difference between two numpy matrixes. a = np.random.randint(-10,400,(500,500)) # or gdal.Open("path/to/raster").GetRasterBand(0).ReadAsArray() b = np.random.randint(-10,400,(500,500)) dif = abs((a-b)/(b+1e-5))<0.05 ...


3

Use CPLSetConfigOption. See the Config Options docs.


3

ogrinfo as nothing to do with Visual Studio. It is a command line tool (Windows, Linux, Mac OS X) So you use it in the Windows console or in the Linux and Mac OS X shell in the same way. ogrinfo yourshape.shp with a lot of options: (ogrinfo) And, there are many, many tutorials in Gis.StackExchange : search ogrinfo and on the Web....


3

C++ projection library proj https://trac.osgeo.org/proj/ We've used DLLImport to write calls into it from C# code for MapDotNet and MapsJS, works great! You'll need to go to http://spatialreference.org/ to get proj4 strings for your source and destination projections (WGS 84 is a good choice for lat/lon) Call pj_init_plus(initParameters) with each of ...


3

This http://workshops.boundlessgeo.com/postgis-intro/advanced_geometry_construction.html and this http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html provide the basics of recursively walking a collection.


3

You're trying to use an OGR (vector) driver with GDAL (raster) tools. Here's a few lines of my working code that may help: char* BasePath = new char[FullPathMax]; // this does have a value before it's used OGRRegisterAll(); OGRDataSource *hDS = NULL; OGRSFDriver *Driver = NULL; hDS = OGRSFDriverRegistrar::Open(BasePath,FALSE,&Driver); As you can ...


3

I had your same problem. I solved it updating the code in order to match the QGis 2 major changes: int main(int argc, char *argv[]) { QgsApplication app(argc, argv, true); QString myPluginsDir = "/usr/lib64/qgis"; QString myLayerPath = "pathtoashapefile"; QString myLayerBaseName = "italy"; QString myProviderName = "ogr"; // ...


2

I've just recently learnt how to use gdal from a command line using pre-built libraries found on the gdal site. http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries Dunno if this answers your question or not but I was able to strip the alpha from a tiff tile and re-save it, could possibly envoke a cmd prompt and wait for it to finish? gdal_translate ...



Only top voted, non community-wiki answers of a minimum length are eligible