In certain cases clipping of a LineString will result in a MultiLineString containing a line which (after rounding) only contains multiple instances of the same point. This results in a single MOVE_TO
command followed by 0 LINE_TO
commands, which is not valid according to the vector tile specifications. A proposed fix can be found in #44.
Example of LineString causing the issue:
LINESTRING (3641 722,3642 720,3642 718,3642 716,3642 715,3642 713,3643 710,3643 706,3643 705,3643 704,3643 702,3644 700,3644 698,3644 696,3644 695,3644 694,3645 692,3645 691,3645 689,3645 687,3645 685,3645 684,3645 682,3645 680,3644 679,3644 678,3644 676,3644 675,3644 674,3643 673,3642 671,3642 668,3641 666,3640 664,3640 662,3639 660,3639 659,3638 658,3639 658,3641 657,3645 655,3646 655,3647 654,3648 653,3649 653,3649 652,3650 652,3650 650,3651 649,3651 647,3652 646,3653 644,3653 642,3654 641,3654 640,3655 640,3655 638,3656 638,3657 636,3658 635,3659 633,3661 630,3662 629,3663 628,3664 626,3666 624,3666 623,3669 620,3672 616,3673 614,3674 613,3675 612,3676 611,3678 609,3681 607,3682 606,3684 604,3685 603,3689 601,3694 596,3698 594,3700 592,3702 591,3704 588,3706 586,3707 584,3708 583,3708 582,3708 581,3708 579,3708 575,3707 569,3707 566,3707 564,3707 563,3708 562,3708 561,3709 559,3710 557,3712 554,3716 550,3720 546,3723 541,3725 538,3730 533,3734 528,3739 522,3743 517,3745 514,3748 511,3749 510,3750 508,3752 506,3755 503,3756 502,3759 499,3762 496,3766 491,3768 489,3769 488,3769 487,3770 487,3770 486,3771 484,3772 484,3773 481,3775 476,3776 473,3780 466,3782 460,3784 455,3786 450,3788 447,3789 444,3790 442,3791 439,3794 435,3797 432,3800 428,3803 426,3805 423,3806 420,3808 419,3810 415,3812 412,3814 408,3814 406,3816 402,3817 398,3818 396,3819 393,3819 390,3819 389,3819 388,3819 385,3819 383,3819 380,3820 379,3821 376,3821 374,3821 373,3821 372,3821 371,3824 371,3825 370,3826 370,3827 370,3828 368,3829 366,3829 364,3829 361,3829 360,3829 357,3829 355,3830 354,3830 353,3831 352,3831 351,3831 350,3832 350,3835 350,3837 349,3840 349,3842 349,3843 349,3845 349,3847 349,3851 349,3853 349,3854 349,3855 349,3858 350,3860 350,3864 350,3865 350,3868 350,3870 349,3871 349,3872 348,3875 347,3877 344,3879 343,3881 342,3883 342,3884 341,3885 341,3887 342,3889 343,3891 344,3892 345,3894 345,3898 344,3899 343,3900 343,3900 342,3900 341,3901 340,3901 339,3901 338,3902 337,3902 336,3903 336,3904 334,3906 333,3906 332,3908 331,3910 329,3912 327,3914 325,3915 324,3916 324,3920 322,3921 322,3924 320,3926 319,3927 318,3929 317,3931 315,3933 314,3935 312,3939 310,3940 309,3941 308,3942 308,3943 307,3946 307,3949 307,3951 306,3952 306,3955 306,3958 306,3961 306,3964 307,3965 307,3967 307,3970 307,3971 307,3973 307,3975 306,3976 306,3978 306,3982 304,3985 304,3987 303,3989 303,3991 302,3992 302,3996 301,4001 300,4002 300,4006 299,4008 299,4013 298,4016 298,4020 298,4024 297,4026 297,4031 297,4034 297,4036 296,4037 296,4039 296,4040 295,4043 295,4044 294,4045 294,4046 293,4047 293,4051 292,4056 289,4061 287,4066 284,4072 281,4075 279,4077 278,4079 277,4081 275,4083 273,4084 273,4083 273,4081 275,4079 277,4077 278,4075 279,4072 281,4066 284,4061 287,4056 289,4051 292,4047 293,4046 293,4060 287,4077 278,4083 273,4086 271,4087 270,4089 268,4091 267,4093 265,4095 264,4099 262,4102 260,4104 259,4108 257,4113 256,4118 254,4120 253,4122 252,4127 250,4130 249,4133 249,4137 248,4140 247,4144 246,4146 245,4148 245,4150 244,4154 242,4156 240,4159 239,4161 237,4163 237,4165 235,4166 235,4167 234)
after clipping:
(4046 293, 4047 293),
(4047 293, 4051 292),
(4051 292, 4056 289),
(4056 289, 4061 287),
(4061 287, 4066 284),
(4066 284, 4072 281),
(4072 281, 4074.5714285714284 279.2857142857143),
(4074.5714285714284 279.2857142857143, 4075 279),
(4075 279, 4077 278),
(4077 278, 4079 277),
(4079 277, 4081 275),
(4081 275, 4083 273),
(4083 273, 4084 273),
(4046 293, 4060 287, 4074.5714285714284 279.2857142857143),
(4074.5714285714284 279.2857142857143, 4077 278),
(4077 278, 4083 273),
(4083 273, 4086 271, 4087 270, 4089 268, 4091 267, 4093 265, 4095 264, 4096 263.5))```
The 9th line segment `(4074.5714285714284 279.2857142857143, 4075 279)` contains the same point twice (after rounding) and no further points, resulting in a single `MOVE_TO` command.