Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error with undefined similar in polygonize #202

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

tiemvanderdeure
Copy link
Contributor

polygonize calls similar on a Type and the abstractranges provided, but similar is not defined for all AbstractRange types.

I think the easiest fix is just to call length on the range first.

@asinghvi17
Copy link
Member

Looks good, thanks! Do you have a test case that failed, so we can add it to the tests?

@tiemvanderdeure
Copy link
Contributor Author

I just noticed there is a very similar PR that never got merged #190

Maybe this is not as simple as I thought?

@tiemvanderdeure
Copy link
Contributor Author

I just went ahead and added tests, and let's see what happens.

I wanted to add a better test to make sure this returns the same polygon with different xs and ys like so:

    data_mp = polygonize(data)
    data_mp_range200 = polygonize(2:2:200, 2:2:200, data)
    data_mp_range200_2 = GO.apply(GI.PointTrait, data_mp_range200) do p
        p ./ 2
    end
    @test GO.equals(data_mp_range200_2, data_mp)

but this fails.

@rafaqz rafaqz merged commit 9c87f03 into JuliaGeo:main Sep 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants