Anonymous user
Ramer-Douglas-Peucker line simplification: Difference between revisions
Ramer-Douglas-Peucker line simplification (view source)
Revision as of 10:07, 21 December 2016
, 7 years ago→{{header|Python}}
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: yet more code twiddling) |
|||
Line 172:
<lang python>from __future__ import print_function
from shapely.geometry import LineString
if __name__=="__main__":
line = LineString([(0,0),(1,0.1),(2,-0.1),(3,5),(4,6),(5,7),(6,8.1),(7,9),(8,9),(9,9)])
print (line.simplify(1.0, preserve_topology=
{{out}}
<pre>LINESTRING (0 0, 2 -0.1, 3 5, 7 9, 9 9)</pre>
|