Join GitHub today
Box-segment distance for spherical and geographic coordinate systems #478
This PL implements the box-segment distance computation for spherical and geographic coordinate systems (CS).
The CS independent functionality is still in the algorithm which is generalized to support the new coordinate systems. The CS dependent functionality is implemented in a set of new strategies.
Along the way few fixes in envelope of segment and point-segment distance are performed.
Now, distance should be able to be computed between any pair of geometries and for any CS. A new PL will test this.
changed the title from
Feature box seg
Box-segment distance for spherical and geographic coordinate systems
Apr 24, 2018
Thanks for this PR!
I'm ok in general but I have few remarks about the structure of the code, interfaces of strategies etc. It's possible that I don't understand something and that the way how it's implemented is the best way. But for now I think strategies should be restructured slightly and that the responsibilities of various strategies are mixed up.
@awulkiew thanks for the comments.
Vertical_or_meridian method is moved to P/S strategy from P/P. This is the right place since it is used by higher order strategies like P/B and S/B that derive a P/S strategy.
Regarding the interface of strategies I changed it a bit in order to have a unique interface for spherical distance strategies (apart from P/P one) i.e. the number type as a first parameter and a P/P strategy as the second. In general I think it would make things clearer to have an "as unique as possible" interface for all distance strategies but that should be done in a separate PR.