Skip to content

ms_simplify() not preserving data: converting logical to NA #177

@jkennedyie

Description

@jkennedyie

Hi. The data in an sf object that I loaded with sf::st_readf() is not being preserved by ms_simplify() with defaults on rmapshaper 0.5.0.

Seem to have isolated the problem to feature 4 or 5 in attached geojson file...couldn't upload geojson so here it is with .txt extension:

rm_sharper_test.geojson.txt

Just looking at first 4 features, Current is False as expected

st_read("rm_sharper_test.geojson") |>
	slice_head(n = 4) |>
	ms_simplify() |>
	select(Current)

  Current                       geometry
1   FALSE POLYGON ((606251.1 917987.8...
2   FALSE POLYGON ((607071.2 919101.6...
3   FALSE POLYGON ((595753.3 902791.1...
4   FALSE POLYGON ((638244.3 939982.9...

But looking at 5 features, Current is NA for everything:

st_read("rm_sharper_test.geojson") |>
	slice_head(n = 5) |>
	ms_simplify() |>
	select(Current)

  Current                       geometry
1      NA POLYGON ((606251.1 917987.8...
2      NA POLYGON ((607071.2 919101.6...
3      NA POLYGON ((595753.3 902791.1...
4      NA POLYGON ((638244.3 939982.9...
5      NA POLYGON ((572453.1 909521.4...

Features seem valid. I wonder if related to #102.

Thanks

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