Fix segmentize on geography #90

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@mhugo
mhugo commented Feb 18, 2016

Segments were split on the straight line going from one vertex to the other and then "projected back" on the surface of the sphere. It resulted in segments with wrong distances.
Segments need to be computed based on equal angles between two adjacent vertices.

@strk strk commented on an outdated diff Feb 18, 2016
regress/geography_expected
@@ -27,3 +27,4 @@ geog_precision_pazafir|0|0
#2422|1|1609|t|t|1400.230|1396.816|1400.230|1400.230
#2422|1|1600|t|t|1400.230|1396.816|1400.230|1400.230
#2422|1|1068|f|f|1400.230|1396.816|1400.230|1400.230
+segmentize_geography|t
@strk
strk Feb 18, 2016 Member

I think it would be better to give a rounded number than a boolean value.
Otherwise a max distance of 0 would still not be caught as a failure

@mhugo
mhugo commented Feb 18, 2016

@strk code updated with a rounded number in test

@mhugo
mhugo commented Feb 26, 2016

updated code that should now fix the broken regression test

@pramsey pramsey closed this Feb 26, 2016
@strk strk pushed a commit that referenced this pull request Feb 26, 2016
@pramsey pramsey Segmentize geography using equal length segments, from
#90
Hugo Mercier, @mhugo


git-svn-id: http://svn.osgeo.org/postgis/trunk@14706 b70326c6-7e19-0410-871a-916f4a2858ee
119c3ba
@robe2 robe2 reopened this Jul 31, 2016
@robe2
Member
robe2 commented Jul 31, 2016

As noted here - https://trac.osgeo.org/postgis/ticket/3539 this change broke ST_Segmentize functionality pretty badly. Please fix or we'll have to revert.

@mhugo
mhugo commented Aug 17, 2016

@robe2 @pramsey Here is the new patch that fixes both segment distances and curvatures, using sphere_direction and sphere_project functions.

@pramsey
Member
pramsey commented Aug 17, 2016

yeah, better to use that one. I have an approach that I think would be more efficient but I don't think I'll get it done in a short period of time...

@robe2
Member
robe2 commented Aug 17, 2016

Thanks. I'll test later today and then commit

@robe2
Member
robe2 commented Aug 17, 2016

Test fails on sfcgal

`
regress_sfcgal .. ok
sfcgal/empty .. ok
sfcgal/geography .. ok
sfcgal/legacy .. ok
sfcgal/measures .. ok
sfcgal/regress_ogc_prep .. ok
sfcgal/regress_ogc .. ok
sfcgal/regress .. ok
sfcgal/tickets .. failed (diff expected obtained: /projects/postgis/tmp/2.3_pg9.6w64/test_126_diff)
sfcgal/concave_hull .. ok
sfcgal/wmsservers .. ok
sfcgal/approximatemedialaxis .. ok
uninstall .. ok (4578)

`

No worries, looks like you just forgot to make same change there. I'll fix on my end.

@strk strk pushed a commit that closed this pull request Aug 17, 2016
@robe2 robe2 Segmentize geography using equal length segments, (Hugo Mercier of Os…
…landia)

Closes #3613
Closes #3539
Closes #90

git-svn-id: http://svn.osgeo.org/postgis/trunk@15044 b70326c6-7e19-0410-871a-916f4a2858ee
598feab
@strk strk closed this in 598feab Aug 17, 2016
@mhugo
mhugo commented Aug 17, 2016

@strk thanks !

@strk
Member
strk commented Aug 17, 2016

Robe did all, only mirroring pushes are all in my name :)

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