Tag Info

New answers tagged

2

1) The easiest solution is to use the processing module in the QGIS Python console: import processing processing.runalg("qgis:joinattributesbylocation","BKMapPLUTO.shp","DCP_nyc_freshzoning.shp","['intersects']",0,"sum,mean,min,max,median",0,'result.shp') 2) Without a GIS, you can use Fiona (read and write shapefiles as Python dictionaries) and Shapely ...


2

You can: Create your own solution with Leaflet http://leafletjs.com/ and one of the plugins from a list below http://leafletjs.com/plugins.html#overlay-data Use http://umap.openstreetmap.fr/ with external data overlay. Check layers. It's not as easy as paste a link into google map search, but much more power-full. Yuo could upload your data or use a link ...


2

You cannot have R objects called "2000", so presumably these are fake names? Your example actually should work, so you may want to double check why you think that the results are incorrect. @aaryno's approach should work. I would do this: library(raster) s <- stack(r2000, r2001, r2002, r2003, r2004, r2005) x <- reclassify(s, cbind(0, NA)) r <- ...


3

I wanted to point out that you can rewrite the mean function, mean, which you can write yourself to do anything you want, including ditch the 0 values and calculate the mean. For example, if you want to ignore 0s: meanIgnoringZeroes <- function(x) { mean(x[x!=0],na.rm=T) } Then you can pass the function, meanIgnoringZeroes to overlay: mean <- ...


-2

Perhaps you should try this : new_file=na.omit(file). I think with this you can ignore NAs.


0

To do this you need to define how the co-located features should relate to each other in space. That is their topological relationship in terms of their geometric construction. In ESRI software this is called a topology. I don't think any of the open source projects have this ability yet (I would love to know if they do!). You can work around these type ...


0

Here is what Mikkel suggested (use of max) library(raster) cell100 <- raster(nr=3, nc=3, vals=c(100,0,0,0,100,0,0,0,100)) cell101 <- raster(nr=3, nc=3, vals=c(0,0,101,0,101,0,101,0,0)) r <- max(cell100, cell101) as.matrix(r) # [,1] [,2] [,3] #[1,] 100 0 101 #[2,] 0 101 0 #[3,] 101 0 100 Another (more complex) approach could ...


1

A simple "ifelse" statement should suffice in evaluating a condition. Here we create two random vectors of [1,2] and apply an ifelse to evaluate the condition of if x = 2 and y = 1 THEN change (1) ELSE no change (0). ( x <- round(runif(10, 1, 2)) ) ( y <- round(runif(10, 1, 2)) ) ifelse( x == 2 & y == 1, 1, 0) Since this is just an ...


0

Maybe you'd be better off doing a spatial join the other way around? Not sure I understand what you mean by "more data". More columns of attributes or more records/features?


1

Somehow, you have to create an offset between the markers to the user be able to click on each. My suggestion is to listen pointermove event and show the markers separately. I was facing with this same issue and here is my solution. UPDATE So, based on comments. My idea is: create an array attribute of the features id at the same location. On click check ...


1

Try: var html = feature.get('address'); html += feature.get('name'); html += feature.get('whatever'); content.innerHTML = html; popup.setPosition(coord); UPDATE: If you want some markup in the popup: var html = '<h3>Here is ' + feature.get('name') + '</h3>'; html += 'And if you need some <button id="" onclick="">click</button>'; ...


1

So there it is, your fiddle forked and merged. You get rid of jquery popover and implement Openlayers popup: content.innerHTML = feature.get('name'); popup.setPosition(coord);



Top 50 recent answers are included