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

Enable round-tripping unsupported types #19

Closed
wants to merge 1 commit into from

Conversation

bricelam
Copy link
Collaborator

@bricelam bricelam commented May 27, 2021

Discussed in #18

/cc @ajcvickers @JeremyLikness

public override bool EqualsExact(Geometry other, double tolerance) => throw Unsupported();
public override bool EqualsTopologically(Geometry g) => throw Unsupported();
public override Geometry GetGeometryN(int n) => throw Unsupported();
public override int GetHashCode() => throw Unsupported();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😈 This and Equals probably breaks EF Core. We need to refine this a bit. I also haven't tested the experience with other parts of NTS.

Comment on lines +241 to +245
case OpenGisType.CircularString:
case OpenGisType.CompoundCurve:
case OpenGisType.CurvePolygon:
case OpenGisType.FullGlobe:
return new UnsupportedGeometry(shape.Type, geography);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, if a GeometryCollection contains one of these, the whole collection will be returned as unsupported. A slightly better solution might be to return a GeometryCollection containing an UnsupportedGeometry.

@jamesra
Copy link

jamesra commented May 28, 2021

I added a comment to the original issue regarding whether UnsupportedGeometry should be public instead of internal.

@bricelam bricelam mentioned this pull request May 29, 2021
@bricelam
Copy link
Collaborator Author

Closing in favor of PR #20 and issue #21

@bricelam bricelam closed this May 29, 2021
@bricelam bricelam deleted the unsupported branch June 2, 2021 17:39
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.

2 participants