TransWikia.com

Spatial thinning Earth Engine

Geographic Information Systems Asked by Sean Carter on August 18, 2020

I am trying to spatially thin occurrence data for use in a Species Distribution Model. Because my data represent "presence-only" or "citizen science" data, I am trying to account for the effects of sampling bias by subsampling the points so that no two points fall within X distance of each other. This is the Systematic sampling approach detailed in Fourcade etal. 2014 and many other recent Species Distribution models.

So far, I have tried variations on this theme:

Create spatial buffer around each occurrence point:

var hydrilla = users/me/myoccurrencecsv.csv
var hyd_buffered = hydrilla.map(function(feat){
  return feat.buffer(5000)
})

//Join data so that no two points fall within 5 km

var distFilter =  ee.Filter.intersects({
  leftField: '.geo', 
  rightField: '.geo', 
  maxError: 100
});

var join = ee.Join.inner()
var hydrilla_corrected = join.apply(hydrilla,hyd_buffered,distFilter)

I am still fairly unfamiliar with the ee.Join process, so I’m sure something I am doing is wrong, but I have tried an ee.Join.inverted() as well as an ee.Join.simple() but nothing seems to give me what I want. I have done an extensive googling of this problem in EE and have not found any satisfactory results.

Edit: Here is another pseudo solution that I propose

var hyd_corrected = hydrilla.map(function(feat){
//Buffer around each feature
  var buffered = feat.buffer(5000)

//Cast each buffer object to a geometry object by referencing the geometry properties of the feature 
// and receiving the coordinates
  var geom = ee.Geometry.Polygon(ee.List(buffered.geometry().coordinates()));

//Return Null if the feature intersects the geometry
  return ee.Algorithms.If(feat.intersects(geom),null,feat)
})

This doesn’t work because each feature obviously intersects its own buffered geometry, but what is relevant is adjacent features.

Here is the link to my script: https://code.earthengine.google.com/190c7ec503bd9aff08099c7b500ad8a6

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP