12

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


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


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


10

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

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

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


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


6

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


6

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


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

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


5

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.


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

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


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

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


5

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


5

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.


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

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 the initial dataframe, unlike Grid2Polygons. Full example: require(sp) data(meuse.grid) sgdf <- SpatialPixelsDataFrame(points=meuse.grid[c("x", "y")], ...


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


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