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

Make Geometry.reverse() consistent #513

Merged

Conversation

FObermaier
Copy link
Contributor

  • Add protected reverseInternal function to Geometry,
    implement in Point, LineString, LinearRing, Polygon and
    GeometryCollection
  • Remove abstract from Geometry.reverse function,
    implementation calls reverseInternal and copies
    Envelope and SRID values
  • To avoid breaking change make Geometry.reverse overrides
    return super.reverse()
  • Add unit test

Note:
The reversal of items in MultiLineString has been removed.

closes to #305

Signed-off-by: Felix Obermaier felix.obermaier@netcologne.de

* Add protected reverseInternal function to Geometry,
  implement in Point, LineString, LinearRing, Polygon and
  GeometryCollection
* Remove abstract from Geometry.reverse function,
  implementation calls reverseInternal and copies
  Envelope and SRID values
* To avoid breaking change make Geometry.reverse overrides
  return super.reverse()
* Add unit test

Note:
The reversal of items in MultiLineString has been removed.

relates to locationtech#305

Signed-off-by: Felix Obermaier <felix.obermaier@netcologne.de>
* Fix ExtractLineByLocation to not use deprecated
  Geometry.reverse() overrides
* Remove dead code

relates to locationtech#305

Signed-off-by: Felix Obermaier <felix.obermaier@netcologne.de>
* LengthIndexedLineTest.testExtractLineReverseMulti

relates to locationtech#305

Signed-off-by: Felix Obermaier <felix.obermaier@netcologne.de>
@FObermaier FObermaier force-pushed the fix/make-geometry-reverse-consistant branch from 6634ae3 to 4b67365 Compare January 24, 2020 08:12
@dr-jts
Copy link
Contributor

dr-jts commented Jan 25, 2020

Thanks, code looks good.

It's unfortunate that the commits are cluttered up with formatting changes (mainly whitespace removal). Not sure if it's possible to avoid this?

@FObermaier
Copy link
Contributor Author

IntelliJ did that. I must admit I like it. See #397.

@dr-jts
Copy link
Contributor

dr-jts commented Jan 26, 2020

Yes, I like consistent formatting as well (have been working with Go lately, and it's opinionated formatting works very well).

It's just not ideal to mix formatting changes and code changes, since the code changes get swamped by all the trivial format changes.

@FObermaier
Copy link
Contributor Author

For the review you might want to try
grafik

I'm not going to re-add trailing white-space to get this accepted. Take what you like.

@dr-jts
Copy link
Contributor

dr-jts commented Jan 27, 2020

Oh, great, didn't know that was available. That helps with reviewing for sure.

@dr-jts dr-jts merged commit 709b739 into locationtech:master Jan 27, 2020
@FObermaier FObermaier deleted the fix/make-geometry-reverse-consistant branch January 27, 2020 19:13
dbaston added a commit to dbaston/libgeos that referenced this pull request Jan 30, 2020
Updated for consistency with the behavior of other geometry types (as
changed in locationtech/jts#513)
strk pushed a commit to libgeos/geos that referenced this pull request Feb 5, 2020
Updated for consistency with the behavior of other geometry types (as
changed in locationtech/jts#513)

Fixes #1013
strk pushed a commit to libgeos/geos that referenced this pull request Feb 5, 2020
Updated for consistency with the behavior of other geometry types (as
changed in locationtech/jts#513)

Fixes #1013
@dr-jts
Copy link
Contributor

dr-jts commented Jul 6, 2020

@FObermaier the deprecations on the subclass reverse methods are causing problems, since they shadow the Geometry.reverse method. Isn't it sufficient to just remove the subclass methods? Or does that break something?

@FObermaier
Copy link
Contributor Author

I'm no java expert. I wanted to avoid introducing a breaking change. I was not aware that this causes other issues.

@dr-jts
Copy link
Contributor

dr-jts commented Jul 7, 2020

@FObermaier understood. This is a trickier design situation than it first appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants