Tag Info

New answers tagged

0

Add this to PATH variable (replace "C:\Program Files\QGIS Valmiera" with QGIS install location): C:\Program Files\QGIS Valmiera\bin;C:\Program Files\QGIS Valmiera\apps\qgis\bin and this to PYTHONPATH variable: C:\Program Files\QGIS Valmiera\apps\qgis\python; C:\Program Files\QGIS Valmiera\apps\qgis\python\plugins; C:\Program Files\QGIS ...


0

I'm using GDAL Version 1.11 in C++, that said my answer may not be relevant depending on the version you are using. The the Create() method is not supported by the PNG driver (I'm not familiar with the JPEG driver), so you must first create a GDALDataset with a different driver the use a the CreateCopy method from a PNG driver to get your PNG image. Also, ...


0

You don't actually need to parse Wikipedia. It's already parsed and structured as Linked Open Data by DBPedia. For instance, you can get the area of London with this HTTP query: ...


1

I've caught my error. May be it will be helpful for somebody. CreateCopy() makes read-only Dataset for PNG and JPG, so RasterIO() doesn't write anything into dataset's bands. We have to call RasterIO for the memory Dataset. I've made tests for PNG, JPEG and TIFF, it works. Create() call for "MEM" dataset doesn't allocate memory for the raster. Memory ...


1

Not all band types are supported with all format. If you look at the format support pages for jpg and png, 8 or 16 bit are needed. Float values could be simply rounded so that it does not results in an error, but gives some zeros or NoData. You should try to use "rescale" to fit in a Byte. JPEG files are created using the "JPEG" driver code. Only Byte ...


0

As user30184 said, in Python, the process would be creating a memory raster of the same dimensions (layers and layer extension), and executing the CreateCopy after that: driver = gdal.GetDriverByName( 'MEM' ) driver2 = gdal.GetDriverByName( 'PNG' ) ds = driver.Create( '', 255, 255, 1, gdal.GDT_Int32) ds2 = driver.CreateCopy('/tmp/out.png', ds, 0) Then, ...


1

Perhaps you could start with JTS and use first RandomPointsInPolygon and create then VoronoiDiagram from this point set. Create lots of polygons and union the smallest one with its neighbor and loop until you are happy. But because the points in the first step are random it is always possible that some of the Voronoi polygons are bigger than the 1 sq km ...



Top 50 recent answers are included