ronnyhdez / reclaimed_sites_ab

https://ronnyhdez.github.io/reclaimed_sites_ab/
0 stars 0 forks source link

Create negative buffer in polygons for the pixel count filtering #108

Closed ronnyhdez closed 2 months ago

ronnyhdez commented 3 months ago

We want to avoid the edges

ronnyhdez commented 3 months ago

I'm obtaining this:

image

ronnyhdez commented 3 months ago

probably use the error parameter

ronnyhdez commented 3 months ago

In normal squared polygons, the inward buffer is fine:

image

The problem is with shapes different than squares

ronnyhdez commented 3 months ago

I used the error parameter in the function:

var dilatedCollection = feature_collection.map(function(feature) {
return feature.difference(feature.buffer(-30, 500));
});

And the buffer shape changes, but not as expected:

image

ronnyhdez commented 3 months ago

@rfernand387 is there a preference on this case? Does this have to match exactly the shape of the polygon of just the -30m buffer with error=1 works fine?

ronnyhdez commented 3 months ago

happens the same in python:

second_test = abandoned_wells[abandoned_wells['WELLSITE_FOOTPRINT_ID'] == 149236.0]

second_test_buffer = second_test.copy()
second_test_buffer['geometry'] = second_test_buffer['geometry'].buffer(-30, 1)

fig, ax = plt.subplots()

second_test.plot(ax = ax, color = 'blue', edgecolor = 'black', alpha = 0.5)
second_test_buffer.plot(ax = ax, color = 'red', edgecolor = 'black', alpha = 0.5)

plt.show()

image

ronnyhdez commented 3 months ago

With gee, for the complete polygons, it looks like this:

This is with -30m and maxError of 1%

image

ronnyhdez commented 2 months ago

In ref #113