New answers tagged

1

If you use a spatial join you can append the attributes of one dataset to the other. If you are trying to fill a particular field you can then just copy it across using the field calulator


2

To do this I would use the Union tool to calculate the overlap relationships between polygons. I would then use arcpy.da.UpdateCursor to iterate through each polygon and add up the ranks/weights of any polygons that overlap in that area.


1

Updating R and sp to the released versions will resolve this. It was caused by a change in R's behavior on what nchar(NA) returns: see the help file of ?nchar, argument keepNA.


4

Such a slight systematic shift is usually due to a lack of datum transformation before reprojecting the data. You should test the different transformation and your data will overlap correctly. I can't tell which one is best for you based on the information provided, but you can test it relatively fast. EDIT: if this doesn't work, you have two solutions: ...


1

You may not need KML for the whole world just to get labels turned on. Have you tried selecting a different base imagery layer? It's the second icon from the upper-right on the toolbar. var imagery = Cesium.createDefaultImageryProviderViewModels(); var viewer = new Cesium.Viewer('cesiumContainer', { imageryProviderViewModels: imagery, ...


0

A vectorized form would be MyFun <- function(x, y) { i <- x < 0 x[i] <- abs(x) * y x[!i] <- x * y x } But it might be more efficient (and certainly less error prone) to do MyFun <- function(x, y) abs(x) * y res <- overlay(x, y, fun = MyFun) Or simply res <- abs(x) * y


1

You could use ifelse as an alternative to if and else blocks in a function. You can nest multiple statements in an ifelse and if you are trying to vectorize a problem, it is much cleaner. Note that an absolute abs statement on a zero value still returns zero so, I just used a very small number as a constant. library(raster) x <- raster(nrows=100, ...



Top 50 recent answers are included