11

You can do that in Python Console of QGIS by using a QgsRasterPipe object (pipe) for setting a renderer clone of the image employed as active layer before to use the 'writeRaster' method of QgsRasterFileWriter class (you don't need gdal_translate). I used the following code: layer = iface.activeLayer() extent = layer.extent() width, height = layer.width()...


11

Coercion methods are included in the raster package: as(RAD.all, "SpatialPixelsDataFrame")


10

I found this good discussion at http://www.cartotalk.com/index.php?showtopic=7109 and thought it would be useful to add to GIS.stackexchange for posterity. in ArcMap 10.2, choose > Windows > Image Analysis in the top panel, select the input image in the Processing section, choose the first tool (Clip) this adds a new temporary raster to the TOC right-click ...


9

GDAL's ENVI driver can be used to write headerless binary data files. The default data interleave is band sequential (BSQ), but BIP or BIL interleave options can be specified as a creation option. For example, to convert a GeoTIFF file foo.tif to a headerless file foo.bin: gdal_translate -of ENVI foo.tif foo.bin The ASCII file foo.bin.hdr will also be ...


8

you can use gdal: (you can change PNG to JPG or TIFF too) for %i in (*.tif) do gdal_translate -of PNG -scale -co worldfile=no %i %~cnvt.png i hope it helps you...


8

The reason for this is that while you see yellow pixels, or pink pixels, QGIS sees thousands of discrete colours Zoom in really close to scanned map you'll see lots of noise - neighbouring pixels have very similar, but not identical, colours. When there are two pixels with rgb values of (128,128,0) and (127,127,1), they will look identical, but be treated ...


7

From a cartographic point of view, it is commonly assumed that the human perception of a line position is around 0.3 mm. For a given map scale of 1:20,000 or smaller, the USGS’ NMAS has established that 90% of all the points tested must fall within 1/50 of an inch (0.5 mm) (as measured on the map) to their known positions on the planet (see here). This can ...


7

There are several ways to incorporate raster properties into a conditional statement. Here are three methods: import arcpy, os, numpy ras = r"C:\path\to\raster.tif" # Method 1 Using Spatial Analyst if arcpy.sa.Raster(ras).maximum > 0: arcpy.RasterToPoint_conversion(ras, r"C:\temp\out.shp", "VALUE") # Method 2 using the raster properties if arcpy....


6

You probably don't need to convert a GeoTiff to a Tiff. As a GeoTiff your image will not only be readable by any GIS package but probably can also be read by any image manipulation package too (e.g. Photoshop, GIMP etc) baring some exceptions. Image editing packages simply ignore the bits in the Tiff header that make it a GeoTiff - either that or they ...


6

I have done a LOT of work in this field and I strongly suggest that you DON'T pursue your current plan. It will completely lack credibility with developers, the community and planners alike. You need to do a proper Zones of Theoretical Visibility (ZTV) analysis rather than fudge the issue. I also strongly doubt that your turbines are 200m tall, so your ...


6

For flat roofs: You could manually create a height attribute in the shapefile if you're just doing this for one building. Otherwise, you need to import the OSM and then export the Topology and select Polygons. There is a guide for this kind of thing here: http://learnosm.org/en/osm-data/osm-in-qgis/ Export the polygons to a Shapefile and then use ...


5

How to do this using Map Algebra is described under the topic of Conditional evaluation with Con in the ArcGIS for Desktop Online Help.


5

Suggestion from Stephen Lead is sufficient for grayscaled rasters but not for coloured rasters (e.g. DOF). If you want to preserve the colours (conversion is quite good) then use Copy Raster tool and select RGB to Colormap option (by default is unselected). Your result will be a single band coloured image. The output will be quite good approximation of the ...


5

This is not as complicated as it seems. Factors in R are ordered in the object. If you use levels() to look at the contents of the factor the order corresponds to the factor index (i.e., first class is 1, second 2, ect...). Because of this you can deal with the character component of a factor indirectly and never have to muck with the actual attribute value. ...


5

Ok, there is a way to do this but it's nasty. Using your ranges (in a table or ASCII file) reclassify the data, this will turn your ranges into values (like 23.6-24.4 becomes 1). Then you can apply a colourmap to the file to get the same colours, this is the nasty part. The colourmap file looks like this: 1 255 255 0 2 64 0 128 3 255 32 32 4 0 255 0 5 0 0 ...


5

In ENVI 5x (the procedure is similar in ENVI 4x or ENVI 5 Classic), use the File > Save As menu to save your TIFF to ENVI format which is a flat binary file. This should default to BSQ, but if it doesn't you can convert using the Convert Interleave tool. You also get header (.hdr) and pyramid (*.enp) files, but you can delete those.


5

outRaster = os.path.join(outFolder, rasterFile + "bmp") #THIS LINE?? should be outRaster = os.path.join(outFolder, rasterFile + ".bmp") #THIS LINE?? instead of using glob perhaps use the inbuilt arcpy.ListRasters: rasterpath = r"C:\VMshared\small_example_valley2\snowdepthout" outFolder = r"C:\VMshared\small_example_valley2\snowrast" arcpy.env.workspace =...


5

If you have SAGA installed under QGIS, you can use Victorising grid classes tool located in Processing Toolbox -> SAGA -> Shapes - Grid -> Victorising grid classes. As you can see in the image below, you need to change the Class Selection from All Classes to One single class specified by the class identifier, Then Choose the class pixel value (in ...


5

This can be achieved by applying a mask as the second argument in the Polygonize function, as stated in the GDAL documentation. The mask needs to be a separate raster layer, that has 0 where you don't want the algorithm to polygonize. With your data, follow these steps to implement: 1) Run raster calculator on your original raster ("select3.tif") with ...


4

If you are after a network, I suggest that you use "raster to polyline" instead of raster to polygon. Once the lines are created, you can still create buffer around those lines in order to recover the polygons. The raster can be clean using "thin" before you convert it. EDIT: feature to line gives you the connectivity. Then you can create a small buffer (1/...


4

GDAL (and therefore QGIS) can only read ECW files. ECW is a proprietary file format, and one needs to buy the ERDAS-ECW-JP2 SDK to be able to write files. More details here.


4

This is what zonal raster functions are for. You can obtain zonal variance by using the ArcGIS "Zonal Statistics as Table" tool and then taking the square-root of the standard deviation. Variance is a simple and common measure of roughness. Your polygon feature-class of countries would be your zone data and your elevation raster would be the value raster. ...


4

your objects seem to be very small. If you don't have a conversion for all of them, this is probably because they do not include any cell center. As you seem to look for a "one polygon<-> one pixel" relationship, you should try converting your polygons to centroids, then use "point to raster" instead of "feature to raster".


4

Look up the RasterToPoint_conversion tool in the ArcGIS Help: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001200000007000000 This page is for 10.0, other versions might be slightly different.


4

Lets have a close look at statistics about scene enclosed by you: C:\Program Files\QGIS Chugiak\bin>gdalinfo C:\Users\Janek\Desktop\LC819402420142 48LGN00_B5.TIF -stats [...] Metadata: STATISTICS_MAXIMUM=65535 - this especially! STATISTICS_MEAN=10396.365071613 STATISTICS_MINIMUM=0 - and this one STATISTICS_STDDEV=7547.8323562457 .....


4

This problem is addressed in part by http://blog.hexagongeospatial.com/help-ecw-speckled-edges/ The only way to achieve consistent background color values after compression is by using an AllOpacity band which doesn't appear to be supported by the version of ECWJP2 SDK used in FME.


4

This doesn't answer your question, but your real need : you should download Corine Land cover in an ESRI geodatabase or SQLite format. You'll find your polygonal entities inside ! Job is already done... Download Corine Land Cover 2012


4

This seems to be a bug in QGIS, utilizing some odd behaviour of the gdalwarp utility. If gdalwarp does not like the input raster (in this case due to the y axis positive down), it creates a new raster with a square cell size by default. On the command line, you can override this with gdalwarp -tr 0.125 0.5 -s_srs EPSG:4326 -t_srs EPSG:4258 import_test_data....


4

I read points from a shapefile and burn in a png, also with a color classification. The recipe is in python, you need in java but the structure is the same, only must to learn the image java api: https://docs.oracle.com/javase/tutorial/2d/images/drawonimage.html http://gdal.org/java/ import sys from osgeo import gdal, ogr from PIL import Image, ...


4

Try reclassifying your raster (Spatial Analyst > Reclass > Reclassify) so that every pixel that used to have a value (forested) gets a value of 1, and everything that didn't becomes 0. Then, you could use Zonal Statistics with Sum to calculate how many forested pixels are in each zone (add up all the ones). Divide by the total number of pixels per zone ...


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