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

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? ...


4

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 ...


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

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

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 ...


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

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

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 ...


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 ...


2

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.


2

This code should do what you need: from PyQt4.QtCore import QEvent, QObject from PyQt4.QtGui import QWheelEvent from qgis.gui import QgsMapCanvas from qgis.core import QgsMessageLog import qgis class EventHook(QObject): def eventFilter(self, object, event): if event.type() == QEvent.Wheel: QgsMessageLog.logMessage("Wheel event delta was %s" % ...


2

If you look at the OGR API Tutorial you will find this piece of code which does something very close to what you want: #include "ogrsf_frmts.h" int main() { OGRRegisterAll(); OGRDataSource *poDS; poDS = OGRSFDriverRegistrar::Open( "point.shp", FALSE ); if( poDS == NULL ) { printf( "Open failed.\n" ); exit( 1 ); ...


2

What you are trying to do is to Reverse geocode information. Since you'are going offline only you have imho two options: 1) Incorporate to your software a portable spatial db (eg. spatialite) loaded with the data you want. 2) You can use any reverse geocoding data dump (eg GeoNames data dump) as reference for your program (more info) Either options I ...


2

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 ...


2

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 ...


1

See the GDALRasterBand Class. Carefully using the nXOff and nXSize (etc.) parameters of GDALRasterBand::RasterIO will read a "cropped" part of the raster.


1

if gdal can help you, you can check out my answer here. beside this there are some python codes in here. you can convert it to c++.. With gdallocationinfo, we can query the elevation at one point : $ gdallocationinfo gmted/all075.vrt -geoloc 2 49 Report: Location: (87360P,19679L) Band 1: gmted/30N000E_20101117_gmted_bln075.vrt Value: 183 i hope ...


1

Libgeotiff should do the job. Libgeotiff is an open source library normally hosted on top of libtiff for reading, and writing GeoTIFF information tags. I think you'll need CPL_DLL GTIFImageToPCS Translate a pixel/line coordinate to projection coordinates. and CPL_DLL GTIFKeyGet This function reads the value of a single GeoKey from a ...


1

There's a new Writing C++ plugins page though it's rather sparse. According to @underdark C++ plugins are not obsolete per se, but most documentation effort has been put into Python plugins. C++ still has it's place for performance critical things and functionality that is supposed to be merged into QGIS core. – underdark♦ Oct 20 '11 at 14:03


1

Hi I am not sure how to use GIS for this. But since you said you need speed, you can do some math yourself. You have a point P in space and you have coordinates of that point. You can assume a sphere centered at earth's center. You get P(x1,y1) in space. Now, in the BB, which is not a box in fact since you got to see the curvature. So a surface which is ...


1

Just an idea, what about a raster approach? Your whole region would be a raster grid instead of polygons. Instead of a point in polygon operation, you would just: Convert lon lat to pixel/cell coordinate Retrieve pixel/cell value Check for corresponding state/province on lookup table. There would a a corresponding loss in precision though but I think it ...


1

The API is the same even in master and the test cases use almost the same code. If it is a standalone app, you likely need to set up some data paths, so QGIS can find the bundled CRS info ... Try adding this somewhere at the start: QgsApplication::init(); QgsApplication::initQgis();


1

Instead of using the Ubuntu sources , maybe you could switch to the official QGIS repository for Ubuntu ? See Instructions here. I don't use Ubunut, but i assume that the libqgis development files are available there.


1

According to UbuntuUpdates: Package "libqgis-dev" WARNING: the "libqgis-dev" package was deleted from this repository Name: libqgis-dev Description: Quantum GIS - development files Latest version: *DELETED* Release: precise (12.04) Level: base Repository: universe Head package: qgis Homepage: http://qgis.org/ Maybe it's part of what's ...


1

Can you just compile gdal with spatialite support? Or do you just want to store entire tiffs in a blob column. See spatialite driver docs: http://gdal.org/frmt_rasterlite.html Then you can use gdal_translate: gdal_translate -of Rasterlite source.tif RASTERLITE:my_db.sqlite,table=source


1

Step 2 Not familiar enough with QGIS, but what I have done with sectors in arcgis (for cell towers and tornado sirens) is created polygons to reflect their coverage. Decide the radius you want to reflect a specific power and an angle you want to represent the sweep. Draw a line from the center at angle azimuth - (sweep/2) for length = radius. Next, draw a ...


1

@Name - It seems the event filter is the way to go. Be careful, though, they can slow down an app, as they filter many other events. Can't help you without any code to go on. Alternatively, you could have your plugin pop up a 'zoom pad' to receive the wheeling focus. This small window, or dock widget, could be a down-and-dirty zoom-in on your selected ...


1

You can do it through using any HTTP library. You first need to call GetCapabilities on the source URL: http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?service=WMS&request=GetCapabilities&version=1.3.0 Which will give you a standard XML file (which will conform to a schema such as ...



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