Tag Info

New answers tagged

0

I stick with what I said in my previous comment on this post. I believe that the issue is that you are forcing factors rather than letting the raster predict function handle them. The raster predict wrapper code has explicit factor handling build in. You should coerce the appropriate variables in your training data to factors and not your rasters. To ...


0

As long as all of your images share the exact same extent, origin, and cell size, they would be considered co-registered meaning they perfectly align to each other. In this case, yes, you can georeference one of them and then apply the exact same control points / georeferencing information / transformation to all of the remaining rasters and they should come ...


2

Yes. Convert the grasslands data to raster and, if necessary, query that to produce a binary indicator raster of grasslands presence (1 or logical 'true' where grasslands exist and 0 or logical 'false' where they do not). The focal (neighborhood) mean of this binary raster produces a "simple" density map. Use a circular neighborhood of the desired radius. ...


-1

If you want make a wind map in ArcGIS, you can check this post. http://en.acolita.com/how-to-create-a-wind-map-in-arcgis.html


0

Of course there is a "Save as" option for raster layers which can be used to export raster layers at high resolution. Considering combining raster layers, have a look at the Raster Calculator functionality.


2

To add values to the polygons see SpatialPolygonsDataFrame in sp package and for converting the polygon ids to a raster, given a fixed extent, see rasterize in the raster package. If you have polygons that occur outside the rasters extent you can play with the mask argument. Here is a quick illustration using the op's "reproducible example" (thank you). ...


2

You should be able to set your default rendering options from ArcMap so that any images you load will be rendered in a specified way. To do this, go to "Customize", select "ArcMap Options", select the "Raster" tab, and then the "Raster Layer" secondary tab. In this menu you will find many options for rendering any newly loaded rasters. The section ...


0

What you need is a software that can resample with an average resampling method. If your input data is binary (0/1) then the output of the average resampling metho will be equivalent to the proportion of "ones". For instance, gdalwarp -tr 30 30 -r average input.tif output.tif From what I know, this is not directly possible with ArcGIS. You will need to ...


0

You can do that in the Python Console of QGIS with this code: from qgis.gui import QgsMapCanvas nc = iface.mapCanvas() layers = [] renderers=[] n = nc.layerCount() for i in range(n): layers.append(nc.layer(i)) for layer in layers: renderers.append(layer.renderer()) for renderer in renderers: renderer.setOpacity(0.1) #I used a too low value ...


2

You must use the Con tool with the following parameters (put the full path to the first, second and output rasters, not like I did here):


1

It should be doable with gdal_translate http://www.gdal.org/gdal_translate.html by giving the extended size with the -projwin parameter together with -a_nodata 0 for defining the nodata value.


0

Could someone sanity check what I've done? I got what I was after, but I want to make sure I have all of the necessary and none of the unnecessary steps so that people can replicate it in the future. Per this page: http://memhamwan.org/user-coverage-map-how-is-it-made/ I ran (after setting PATH and GDAL_DATA environmental variables properly): ...


0

So, i figured it out by myself. It is because of the tiff compression. it was jpeg and it has to be LZ77 or LZW. Any compression without data loss. http://help.arcgis.com/de/arcgisdesktop/10.0/help/index.html#//001w00000020000000


1

gdalwarp -geoloc allows you to use the complete 2d-array of latlon as georeference. With that, you can use any target CRS to reproject your data to a commonly used projection. See my answer to this question for an example: How to match a raster NetCDF data with a vector layer in QGIS?


0

Using stratified random point sampling will allow you to say "10 points in this class", eg in QGIS. You might need to convert to polygons first, I am not sure.


0

I finally made it using the following expression y QGIS Raster Calculator: ("rasterlayer" != -9999) * "rasterlayer"


2

I can't say exactly why the runandload method doesn't work with raster memory layers (not experienced enough) but since you only want to use the result as an intermediate calculation, an alternative can be: int_raster = processing.runalg("gdalogr:cliprasterbymasklayer", path_to_raster, path_to_shape, "", False, False, "", None) You can use int_raster ...


1

Another illustrative documentation may be found here


1

It seems that you've followed all the steps except one, that is ticking the"Add layer to canvas" box. Check in the directory where you stored your new layer, it might be there. Alternatively, try to add the layer you've just created and see what happens. I hope this was of some help. Cheers


0

I had some problems getting ArcGIS to handle NoData values correctly with the examples shown here. I extended the example from reomtesensing.io blog (which is more or less similar to the solutions shown here) to better handle NoData. Apparently ArcGIS (10.1) likes the value -3.40282347e+38 as NoData. So I convert back and forth between numpy NaN and ...


1

So thanks to an answer from Mike T to this question, I used listgeo to create TFW files to replicate the geodata that already exists in the TIFs. listgeo -tfw x.tif # FTW Once I did that, MapInfo behaved like a post-Y2K piece of software (although "drag'n'drop" functionality is still beyond it).


2

You can use the Rasterize function (Raster / Conversion / Rasterize) that will convert a vector file (shapefile) to raster. Just be sure to select the attribute field with your classifications. It's important to note that the attribute field must be numeric. Also, when creating the new raster, you have to set either the raster size (width / height) or pixel ...


3

You can use the Interpolation function (Raster > Interpolation > Interpolation) to create a raster map based on multiple classes: You can choose various settings such as which interpolation method you prefer, how fine a resolution you want the output etc. Note that this is a plugin which I think should already be enabled by default. Hope this helps!


3

Provided you have the Spatial Analyst or 3D Analyst extension installed, you can use the Contour tool. This allows you to set an interval as you require. This will create contours over your whole raster. Then you can easily select those between 700 and 1000 using Select By Attributes.


1

A blog entitled Help! My ECW has speckled edges! from Hexagon Geospatial covers this topic quite well because knocking out pixels is not a reliable solution. If the ECW was created with an Opacity Band, QGIS would use this as an Alpha band. If you received the rail corridor ECW image from a third-party data supplier, I would go back to them and ask that ...


1

I've used filled elevation model (with streams removed) to replicate your coefficients: Keeping in mind that water usually runs downhill :), it is reasonable to expect that all the values in output should be less or equal to the value at start point. I've checked results using difference [Filled]-[ScriptOutput] and found that script (see below) failed ...


-1

I was able to solve the problem using Spatial Analyst Tools > Generalization > Nibble Replaces cells of a raster corresponding to a mask with the values of the nearest neighbors.


0

It seems to me that there are many problems with the Macports version of QGIS (setting SAGA folder for QGIS with OS X macports install, QGIS Semi-automatic classification plugin install error on OS X 10.10: matplotlib.backends.backend_qt4agg, How to use grass.script in MacOS,...). So my question is why use this version ? You need to add MrSID driver support ...


1

As Felix is unwilling to answer this I will have a go. The tool to intersect two (integer) rasters is Combine which will merge the attributes of up to 20 rasters. It is unclear from the tool help what happens to raster attributes other than value, should they be built, after running this tool but from the graphic it appears only the value will be copied ...


1

As geo_dd pointed out, the raster calculator tool (Spatial Analyst Tools > Map Algebra > Raster Calculation) should do the trick here you can find some examples of calculations


0

Do you need something like Raster-Extraction-Clipper plugin?? you can give the polygon file as mask layer or you can "play" with the extent (for the parts you want to cut).


0

Using r.watershed -s with cells of interest provided as flow on a distance to network raster map (from r.grow.distance), i obtained the accumulation map answering our issues.


1

Try this: # Import arcpy module import arcpy # Check out any necessary licenses arcpy.CheckOutExtension("spatial") # Local variables: c1 = "F:\\img1.tif" c2 = "F:\\img2.tif" c3 = "F:\\img3.tif" output = "F:\\output.tif" # Process: Raster Calculator arcpy.gp.RasterCalculator_sa("(\"%c1%\"+\"%c2%\"+\"%c3%\")/3", output)


0

r.category should give you all the flexibility you need to manage category values and labels


0

Are the xml files *.aux.xml? If so, it's not QGIS creating them, it's the GDAL library which uses them to store metadata, including statistics. You can disable completely by setting the environment variable GDAL_PAM_ENABLED=NO though I don't advise this if you'll be displaying the rasters again as there won't be any statistics cached. Instead, you can ...


1

I ended up rasterizing the polygon to the extent of the original raster, and simply reclassified the rasterized polygon so that areas overlapping with the original raster were coded as 1 and the remaining cells were coded as 0.


0

Package raster provides a function calc that executes a function over all raster pixels, returning the raster with results; it can deal with large rasters (out-of-memory). raster also provides cluster/multi-core functionality, look into function beginCluster; it's meant to work with calc.


0

look. I had to do the same task for my Master research, so i think i can help you. I'm gonna show you the steps using Arcgis, but you cand do with Qgis or Grass, if you get the general idea. The first thing you need are the nodes. Nodes are the points of intersects between each segment of road (link). Each ling should have an ID, id of the first node ...


2

In QGIS v.2.6.1, I can effectively use the Identify tool to get values from each raster band on a mouse click. Additionally (and if you are using other QGIS versions), you could use the Value Tool plugin, which displays raster band values (and even a graph) on mouse movement.


1

I found that ST_SetValues can work with a collection of geometries and values as an aggregated array. So my SQL solution is this: UPDATE empty_raster SET rast = ST_SetValues(rast, 1, geomval) FROM ( SELECT array_agg((geom, (ST_Area(ST_Transform(intersected_geometry, 3400)) / 1000000))::geomval) as geomval FROM ( SELECT geom, ...


0

You should use Raster Calculator and there is a useful and relevant line of code from ESRI's Support page HowTo: Remove and replace no data values within a raster using statistical information from the surrounding data values. From your question, it sounds like this would do exactly what you're trying to do, but let me know if I'm wrong. Here's my ...


1

It appears that you are missing the '-l dgm-10-epsg-32633' before your vrt-file. In essence, it doesn't know which layer of the vrt-file to use (even if there only is one layer). See the example in the man-page of gdal_grid: gdal.org/gdal_grid.html


1

Easiest thing to do is to use the Clipper function in the Raster Menu. You'll see in that there is a "clipping mode" option set and you can set it to a mask layer which will allow you to select a vector layer. You would need the 7 polygons to be in different layers though. In the processing toolbox you will find a "clip raster by mask layer" which does ...


1

If I understand you correctly, you can use the Clipper tool (Raster > Extraction > Clipper): If you want to automate this, you can do it by creating a model or by python scripting.


2

If you have a Java background then python should be easy.. here's something that I put together: import sys, os, arcpy InRaster = sys.argv[1] InShape = sys.argv[2] SplitField = sys.argv[3] OutFolder = sys.argv[4] # simple switches based on the output, change as needed # note that python is case sensitive (true != True) so in # the case of booleans ...


1

What you want to do is Set Raster Properties in a script or change it manually in ArcCatalog. This will not create a new raster or even take very long. In python it's a bit tricky: import sys, os, arcpy InFolder = sys.argv[1] arcpy.env.workspace = InFolder for Ras in arcpy.ListRasters(): arcpy.AddMessage("Processing " + Ras) ...


3

This works: filled = sa.Con(sa.IsNull(in_raster),sa.FocalStatistics(in_raster, sa.NbrRectangle(w, h),'MEAN'), in_raster) Where "w" and "h" are the search radius. This only does focal stats on the NoData areas. I verified by erasing data from a DEM, and then finding the difference. You just have to make sure the search radius is ...


1

Use the focal statistics function, as you described to average all cells for the raster. Then, use the Con and IsNull functions in raster calculator to replace only the cells that are null. Con(IsNull(<inputRaster>), <focalRaster>, <inputRaster>) One possible drawback with this solution is that you may see some unwanted additional ...


0

Wrong syntax, use ([mosaic].isnull).Con([average],[mosaic])


0

You need to enable the command-line tools to work from your shell sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/pgsql2shp sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/raster2pgsql



Top 50 recent answers are included