Skip to content

Possible floating point issue when merging on x,y #52

@gschlauch

Description

@gschlauch

In overlay_weights.R, I believe I am encountering a floating point issue when merging on "x" and "y" in line 181.

Using

  1. grid = the ERA5-Land grid,
  2. secondary_raster = Landsat 2010 population estimates, and
  3. polygons = 2010 US County shapefile,

w_merged only contains 43,567 rows with non-missing values for "weight". However, when I round "x" and "y" to 7 decimal points in area_weights and weights_dt before merging, this number jumps up to 120,754.

A possible fix could be to round "x" and "y" in area_weights and weights_dt just before merging in line 181.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions