Tag Info

Hot answers tagged

10

A good approximation to a 'textbook' hillslope with a convex upper slope, a straight mid-slope, and a concave lower slope would be a sigmoid. The most common sigmoidal function for this type of application would be the logistic function. A standard form of this function would be: z = 1 / (1 + e-x) And here is what it looks like when you model the ...


5

I'd really give SpatiaLite a go for getting this done! Most conveniently you could use the QSpatiaLite plugin in QGIS. Just set up a polygon grid with a sensible size for gridcells. Then intersect the grid with the ethnic group's polygon and calculate area of each intersection. With the resulting table you can calculate your indices by using the ...


4

Use spTransform to transform the coordinates to WGS84: library("rgdal") library("rgeos") map <- readOGR(".", "kommuner1983") map_wgs84 <- spTransform(map, CRS("+proj=longlat +datum=WGS84")) plot(map_wgs84, axes=TRUE) gCentroid(map_wgs84) # SpatialPoints: # x y # 1 10.05 55.96 # Coordinate Reference System (CRS) arguments: +proj=longlat ...


4

Here's one method for accomplishing this in R: # Building a fake hillslope # This hillslope is 6 rows by 5 columns # alter bins / width to alter rows / columns x <- seq(-15, 15, by=0.01) z <- 1/(1+1.5^-x) # equation used to generate the shape of the hillslope plot(z) z <- 150 - (1-z)*5 plot(z) # ...


3

In QGIS, you could generate a point grid on top of your polygons. You'll find this function under Vector -> Research tools (I think it's called that in English, my QGIS version is in another language.) You'll have to find some reasonable granularity when it comes to the point grid spacing. Then under the Vector menu, you do a Join attributes by location ...


2

If you would like to keep the object type(s) as raster I would take a look at the ratify function although, I do not think that it is intended for numeric data. require(raster) r2 <- raster(nrow=10, ncol=10) r2[] = 1 r2[51:100] = 2 r2[3:6, 1:5] = 3 r2 <- ratify(r2) rat <- levels(r2)[[1]] rat$MyRATValue <- c(100,200,300) ...


2

Here is a very simple and quick solution to generate a conic hill in R, using the dnormfunction: library(raster) a <- matrix(rep(dnorm(1:100, 50, sd = 25)), nrow = 100, ncol = 100, byrow = TRUE) hill <- raster(a * dnorm(1:100, 50, sd = 25)) plot(hill) You could also add some variations / heterogeneity with: hill2 <- hill + ...


2

There are a number of assumptions in your question which need to be addressed before you get to the implementation question. The example you provide is a biodiversity analysis that is based on a sample of varieties of a given plant species. I looked at the manual for the software that was used to generate this raster, and there is no indication that this is ...


2

You said: I am trying to extract values of raster cells on points using extract from raster package in R (similar to 'Extract Values to Points' in ArcGIS-10.2). Lets set up a test raster: require(raster) r = raster(ncol=100,nrow=100,xmn=0,xmx=1,ymn=0,ymx=1) r[]=runif(100*100) You said: After doing so in order to check integrity, I computed ...


1

As you try to cluster your points by latitude you can explicitly divide them (to subsets or just add an attribute) depending on the value of the latitude. Assuming coprdinates are in Lat and Lon columns stations['clustres'] <- NA stations$clusters [stations$Lat > n] <- 'North' stations$clusters [n > stations$Lat >= n1] <- 'Center' ...


1

Looking at the examples provided with the ?iconlabels function, the author uses the column landuse from the meuse dataset. That column is from class factor. So I tried to convert your column cluster from class integer to class factor and it worked. X = read.table(text="code,cluster,name,longt,latit 101,1,A,-89.6171,35.24992 ...


1

First, you should add some fields : 1) sogtest (select by attribute SOG!=0, and use field calculator to fill the selected values with 1) 2) X, Y and Z (use the field calculator to compute your "cartesian" coordinates) Then you can use "dissolve"(or summarize table if you don"t need to merge the geometries) with sogtest as a case field and the required ...


1

I believe that you need to set the argument "longlat=TRUE". Since your data is in geographic coordinates it is likely that the kernel is being incorrectly defined. You also may want to explicitly specify the data slot "data = spdf@data". Please use caution with specification of the GWR method in anything other than exploratory analysis of nonstationarity. ...


1

Nine points is a quite small number, so I would use some arbitrary boundary instead of trying to build a complex algorithm that might "go wild". I suggest that you use r.grow.distance in grass to create a distance layer around your points, and to set a threshold that would constraint the size of your study area (for instance, the largest distance value ...


1

Below is a work around method using python and bunch of libraries such as netCDF4, numpy and shapefile. With Anaconda, these library installations are very much easy. The steps of the method are Import WRF ARW output into python, by python netCDF4 library. Query WRF ARW output variable XLAT, XLONG into numpy array of latitude and longitude using python ...


1

Your 'ENGL_NAME' shouldn't be abbreviated at all (less than 10 characters), but writeOGR has its own will, it seems. Instead of writeOGR(shp, "PolygonsV2", speciesname, driver="ESRI Shapefile") you might try currdir <- getwd() #store your current working directory setwd(paste(currdir,"PolygonsV2",sep="/")) #switch to your desired folder ...


1

I extended Mark Janikas' work on interfacing R and ArcGIS. Specifically, I built an "R script to ArcGIS Toolbox converter." The user writes an annotated R script and loads it to an ArcMap add-in, which generates a ToolBox for the R script. The ToolBox can be used to load results to ArcMap. This is the work flow: And this is how the ArcMap add-in looks ...



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