13 votes

How to produce "SpatialPixelsDataFrame" from stacked RasterLayer?

Coercion methods are included in the raster package: as(RAD.all, "SpatialPixelsDataFrame")
user avatar
  • 7,859
11 votes

QGis Save Raster as Rendered Image

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 ...
user avatar
  • 25.9k
10 votes
Accepted

Flattening multi-band raster to single-band raster in ArcMap?

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 ...
user avatar
  • 20.5k
10 votes

Converting *.tif file into headerless (flat) binary file?

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. ...
user avatar
  • 39.7k
8 votes
Accepted

Polygonizing a raster yields lots of little squares?

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 ...
user avatar
  • 19.8k
7 votes
Accepted

Create conditional to check if raster has value

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 ...
user avatar
  • 50.2k
7 votes
Accepted

Appropriate pixel size when converting vector to raster

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 ...
user avatar
  • 48.5k
6 votes
Accepted

Exporting GRID to TIFF keeping (classified) symbology using ArcGIS for Desktop?

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 ...
user avatar
6 votes
Accepted

Converting SpatialGridDataFrame into polygon shapefile in R?

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 ...
user avatar
6 votes

How to convert raster to polyline in QGIS?

If you are using QGIS with GRASS support you can: Use r.reclass reclass all the stream segments to 1 and everything else to nodata. use r.to.vect to convert the value of 1 to line, and line is ...
user avatar
6 votes

Conversion of OSM building to elevation raster

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 ...
user avatar
6 votes

Excluding extent when polygonizing raster file using Python?

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 ...
user avatar
  • 2,186
6 votes
Accepted

How to polygonize raster with range of values?

What you want to do is the re-classify the raster before polygonizing. You can GRASS tool r.recode for that (available in QGIS). For a solution with raster calculator, see below. Using GRASS r.recode ...
user avatar
  • 40.1k
5 votes

Converting *.tif file into headerless (flat) binary file?

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 ...
user avatar
  • 51.8k
5 votes

Flattening multi-band raster to single-band raster in ArcMap?

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 ...
user avatar
  • 51
5 votes
Accepted

For Loop Batch Copy Raster TIFF to BMP in ArcMap

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 ...
user avatar
5 votes

Converting a raster to shapefile for only one value?

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 ...
user avatar
  • 36.2k
5 votes
Accepted

Convert geojson to png

If you chose GeoTools it is a fairly simple process, fetch your geojson from somewhere: URL states = new URL("http://geojson.xyz/naturalearth-3.3.0/ne_110m_admin_1_states_provinces.geojson"); ...
user avatar
  • 74.7k
5 votes
Accepted

Excluding extent when polygonizing raster file using Python?

Normally you don't need a mask for that task, but RGB values of the polygon areas equals 0. So you need to change them into a value (for example 125) and to change others into 0. Since all bands have ...
user avatar
5 votes
Accepted

Is it possible to open a raster or raster dataset contained in a file geodatabase with QGIS 3.X?

So I found the answer myself. I opened up the file geodatabase with ArcGIS and saw that it indeed contained raster datasets. So the answer is: Even the new QGIS completely ignores raster datasets when ...
user avatar
  • 157
4 votes

Converting SpatialGridDataFrame into polygon shapefile in R?

Note that package sp now allows conversion of SpatialGridDataFrame into SpatialPolygonsDataFrame, you just need to use: as(., "SpatialPolygonsDataFrame") and this will contain all the attributes of ...
user avatar
  • 1,693
4 votes
Accepted

Why doesn't ArcGIS rasterize every polygon

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"...
user avatar
  • 48.5k
4 votes

Exporting GRID to TIFF keeping (classified) symbology using ArcGIS for Desktop?

There are a couple of ways to go about this depending on exactly what output you are wanting. If you want a single-band tif that preserves the original GRID values, you just need to apply the ...
user avatar
  • 15.5k
4 votes

Exporting 16 bit single-band to 8 bit in SAGA/QGIS

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: ...
user avatar
  • 842
4 votes

Transforming raster to vector in ArcGIS for Desktop?

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 ...
user avatar
  • 2,989
4 votes
Accepted

How to convert TIF to ECW with FME maintaining a certain value?

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 ...
user avatar
4 votes

Why does the 'Raster to vector' conversion give me out lines instead of polygons?

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.....
user avatar
  • 7,488
4 votes
Accepted

Importing XYZ ASCII Grid Data Into QGIS: Why does GDAL resize the raster?

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 ...
user avatar
  • 74.9k
4 votes

Convert geojson to png

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: ...
user avatar
4 votes

Using Zonal Statistics to determine percent forest cover in grid cells?

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 ...
user avatar
  • 1,333

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