Hot answers tagged

3

You need to transform your points to the coordinate system of the raster. You could warp the raster to your points' coordinate system but warping rasters is a bit messy. First create a SpatialPoints object from your coordinates and tell R it is in lat-long coordinates (4326): library(raster);library(sp);library(rgdal) pts2 = SpatialPoints(points,...


2

There is no fault in the data or python script. QGIS's default for opening a raster dataset looks for a minimum and maximum value to provide band rendering. However, this dataset contains a single value. Within QGIS's layer properties style menu by setting both the Min and Max values of the dataset to the single dataset value and selecting "No enhancement"...


2

The end code that worked for creating the selection. I ended up having to define the projection using a constant, so I used the Authority Code for the projection. Thanks for your help! import arcpy, os arcpy.env.overwriteOutput =True # Calculates the center of the raster image. def RasterCenter(rasterInput): #raster: string reference to raster ...


2

After trying several attempts the following successfully worked: (a-b)


1

You need to form your namelist in the actual ToolValidator class code. This is just used to pass the arguments into your script tool and cannot actually read values from the script you're running unless you imported it.


1

I prefer adding rasters described from the QGIS docs which I've incorporated into your script in addition to importing a couple more required classes: import glob, os from PyQt4 import QtGui from PyQt4.QtCore import QFileInfo rast_path = "/home/user/Desktop/data/gsi/output" rasters = glob.glob(os.path.join(rast_path, "*le.tif")) print(rasters) for raster ...


1

This is not a bug but an expected behavior. Note that rasterize takes a fun argument that handles grid cells with two or more values. By default it uses that last function, namely the value that appears last on the data data.frame is used. Similarly first will use the value that appears first. Other functions include count, mean, etc. Here is a short ...


1

you could create thiessen polygons around each raster value (using euclidian allocation tool). Then you can extract the value for each point using extract value to point. Note that distance analysis at global scale has two problems: 1) there is a rupture in the map (usually between -180 and + 180) and the scale is not constant.


1

I believe that a call to "data.frame" is all you need. If you have several rasters, just stack them. If you want the rasters as columns and the statistic as rows you can just transpose on the fly (see second example) library(raster) x <- stack(system.file("external/rlogo.grd", package="raster")) ( x.stats <- data.frame(x.mean=cellStats(x, "mean")) ) ...


1

What exactly are you wanting to compare? A point pattern is a representation of an explicit spatial process that is significant from a spatial random assumption. A raster does not meet the same criteria of a point process. You can test the similarity of values but, this does not at all demonstrate the equivalency of an underlying spatial process. Think of ...


1

You can simply add a new field named area with type double, then right-click the field name, go to calculate geometry. In the property field, select area and choose meter square as units. Then go to Select by Attribute and select the areas that is more than the threshold area and save the selected polygons into a new shapefile.


1

There is a plugin tool in QGIS called Mutant. Load all Rasters into a layer. Choose a point. (Make sure that in the Options Tab in Mutant the "Plot values only when mouse is clicked" is checked.) In the Mutant plugin in the Table tab there should now be a long list of values, click 'Export to CSV'. Open in Excel and manipulate the data as desired into ...


1

The plugin is installed by default, but for strange reasons it might get deactivated in the plugin manager. Checking the square left to the plugin name, or double-click on the plugin name will enable the plugin permanently.


1

I found an answer on the following website on how to do this in R. The solution that is given above also works, but I am having memory problems to run it. http://article.gmane.org/gmane.comp.lang.r.geo/24010/match= ########################################################################## library(fields) library(chron) library(ncdf4) setwd("C:/Users/...



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