View Ticket
Not logged in
Ticket Hash: 6763032337d71a2a38ba9bea75a100471e4bf02b
Title: ST_InterpolatePoint returns incorrect answer
Status: Closed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2019-01-06 16:12:01
Version Found In: 5.0.0.0 beta 0
User Comments:
anonymous added on 2018-11-28 02:44:55:
ST_InterpolatePoint returns incorrect answer

Simple example - I would expect the following query to return an answer of .435 - instead it returns a value of 3.291123

Note that the projection of this data is GDA94

select ST_InterpolatePoint(GeomFromText('LINESTRING M(116.404019 -34.379864 0, 116.403816 -34.379859 .019, 116.403179 -34.37945 .093, 116.401979 -34.378665 .233, 116.400826 -34.377559 .395, 116.400458 -34.377359 .435, 116.399807 -34.377308 .496, 116.398666 -34.377412 .601, 116.397431 -34.37747 .715, 116.396135 -34.377296 .835, 116.395355 -34.377383 .908, 116.394444 -34.377685 .998, 116.393555 -34.378073 1.09, 116.393131 -34.378341 1.139, 116.392584 -34.378789 1.21, 116.392159 -34.379054 1.258, 116.391407 -34.379292 1.332, 116.390897 -34.379356 1.38, 116.390437 -34.379443 1.423, 116.38961 -34.379514 1.5, 116.387901 -34.379178 1.661, 116.385978 -34.378827 1.842, 116.38527 -34.378649 1.91, 116.384733 -34.378365 1.968, 116.382644 -34.377008 2.212, 116.382099 -34.37669 2.273, 116.380506 -34.375976 2.44, 116.37832 -34.375018 2.669, 116.377664 -34.374687 2.739, 116.3763 -34.37362 2.913, 116.374924 -34.371886 3.143, 116.373875 -34.370884 3.291, 116.372742 -34.369823 3.449, 116.372525 -34.369634 3.478, 116.37239 -34.369329 3.514, 116.372272 -34.36752 3.716, 116.372166 -34.366917 3.783, 116.371787 -34.366416 3.849, 116.362385 -34.361087 4.9, 116.36066 -34.36 5.098, 116.357487 -34.357946 5.467, 116.352272 -34.354362 6.087, 116.350957 -34.353716 6.227, 116.349281 -34.35237 6.441, 116.347972 -34.351055 6.629, 116.346843 -34.350107 6.776, 116.346113 -34.349677 6.858, 116.345711 -34.349493 6.9, 116.345162 -34.349399 6.951, 116.344465 -34.349456 7.015, 116.343695 -34.349452 7.086, 116.34322 -34.349328 7.132, 116.342784 -34.348778 7.204, 116.341877 -34.347587 7.36, 116.341445 -34.346643 7.471, 116.341523 -34.345944 7.549, 116.341638 -34.345336 7.617, 116.341752 -34.344911 7.665, 116.341536 -34.344363 7.728, 116.341135 -34.344117 7.774, 116.340453 -34.343909 7.84, 116.339743 -34.343988 7.906, 116.338876 -34.344294 7.992, 116.33766 -34.345333 8.152, 116.336872 -34.346281 8.279, 116.336137 -34.34719 8.4, 116.335808 -34.347432 8.44, 116.335206 -34.347582 8.498, 116.334141 -34.347789 8.598, 116.332673 -34.348024 8.735, 116.331428 -34.347896 8.85, 116.330148 -34.347524 8.974, 116.329382 -34.347124 9.057, 116.328982 -34.346666 9.119, 116.328679 -34.345981 9.2, 116.328446 -34.345336 9.276, 116.32809 -34.34487 9.338, 116.327574 -34.344436 9.406, 116.326937 -34.344101 9.476, 116.325621 -34.343696 9.607, 116.325065 -34.343362 9.671, 116.324391 -34.342695 9.769, 116.32348 -34.341662 9.912, 116.322765 -34.341062 10.007, 116.32185 -34.340526 10.111, 116.321014 -34.34019 10.198, 116.320297 -34.339888 10.273, 116.319545 -34.339055 10.39, 116.31915 -34.338456 10.466, 116.318955 -34.337859 10.536, 116.319083 -34.336799 10.655, 116.319335 -34.335341 10.821, 116.319906 -34.333853 10.996, 116.320436 -34.332596 11.145, 116.3206 -34.3321 11.203, 116.320603 -34.331669 11.252, 116.320248 -34.331137 11.32, 116.319576 -34.330271 11.435, 116.319107 -34.32891 11.594, 116.318158 -34.327744 11.752, 116.316824 -34.325167 12.067, 116.316671 -34.323891 12.211, 116.315883 -34.322528 12.381, 116.31517 -34.321695 12.496, 116.314482 -34.320962 12.6)'), GeomFromText('POINT(116.400458 -34.377359)')) x

mj10777 added on 2018-11-29 15:03:06:

The cause of this problem and its solution has (possibly) been found.
Possible drawbacks to the proposed solution must still be looked into.


sandro added on 2019-01-06 16:12:01:
Oops, there was a very stupid error in the computation leading to wrong results ... thanks a lot for reporting the issue.

fixed by the most recent commit [da9fa1854b]