Fix segmentize on geography #90

wants to merge 1 commit into


None yet

4 participants

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
@@ -27,3 +27,4 @@ geog_precision_pazafir|0|0
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 commented Feb 18, 2016

@strk code updated with a rounded number in test

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
Hugo Mercier, @mhugo

git-svn-id: b70326c6-7e19-0410-871a-916f4a2858ee
@robe2 robe2 reopened this Jul 31, 2016
robe2 commented Jul 31, 2016

As noted here - this change broke ST_Segmentize functionality pretty badly. Please fix or we'll have to revert.

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 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 commented Aug 17, 2016

Thanks. I'll test later today and then commit

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…

Closes #3613
Closes #3539
Closes #90

git-svn-id: b70326c6-7e19-0410-871a-916f4a2858ee
@strk strk closed this in 598feab Aug 17, 2016
mhugo commented Aug 17, 2016

@strk thanks !

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