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()...
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
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 ...
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 ...
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 ...
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
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. ...
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:
Export the polygons to a Shapefile and then use ...
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 ...
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
You need a simple text-file defining the classes. Just copy the text below in a file and save it as .txt file (you can use a text editor for that, as e.g. the ...
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 ...
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/...
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 ...
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.
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 default output. If one says you need GRASS 7 just use the other.
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 ...
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");
FeatureJSON featureJSON = new FeatureJSON();
FeatureCollection features = featureJSON.readFeatureCollection(states.openStream());
Then add them to a map with a style:
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 same value, so it's sufficient to change one band to polygonize the raster as you did.
from osgeo import gdal, ogr
src_ds = gdal.Open( "C:\\Users\\select3.tif"...
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 opening a file geodatabase. You wouldn't even know whether or not the GDB contains such data if you are not able to open it with ArcGIS. Very unfortunate.
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. ...
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".
Note that package sp now allows conversion of SpatialGridDataFrame into SpatialPolygonsDataFrame, you just need to use:
and this will contain all the attributes of the initial dataframe, unlike Grid2Polygons.
sgdf <- SpatialPixelsDataFrame(points=meuse.grid[c("x", "y")], ...
Look up the RasterToPoint_conversion tool in the ArcGIS Help:
This page is for 10.0, other versions might be slightly different.
Lets have a close look at statistics about scene enclosed by you:
C:\Program Files\QGIS Chugiak\bin>gdalinfo C:\Users\Janek\Desktop\LC819402420142
STATISTICS_MAXIMUM=65535 - this especially!
STATISTICS_MINIMUM=0 - and this one
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.
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