Douglas coordinate Extraction Algorithm Without $ polyline116.621222, 41.028553; 116.621648, 41.029848 ;.....; $ plsplit (;, $ polyline); $ plstr; $ flag0; $ min0.0001; for ($ j0; $ jcount ($ pl)-1; $ j + 3) {$ xy1split (, $ pl [$ j]); $ x1 $ xy1 [0]; $ y1 $ xy1
Douglas coordinate Extraction Algorithm Without $ polyline = "116.621222, 41.028553; 116.621648, 41.029848 ;..... "; $ pl = split ("; ", $ polyline); $ plstr =" "; $ flag = 0; $ min = 0.0001; for ($ j = 0; $ j count ($ pl)-1; $ j = $ j + 3) {$ xy1 = split (",", $ pl [$ j]); $ x1 = $ xy1 [0]; $ y1 = $ xy1
Douglas coordinate Extraction Algorithm <无>
$ Polyline = "116.621222, 41.028553; 116.621648, 41.029848 ;..... "; $ pl = split ("; ", $ polyline); $ plstr =" "; $ flag = 0; $ min = 0.0001; for ($ j = 0; $ j <count ($ pl)-1; $ j = $ j + 3) {$ xy1 = split (",", $ pl [$ j]); $ x1 = $ xy1 [0]; $ y1 = $ xy1 [1]; $ xy2 = split (",", $ pl [$ j + 2]); $ x2 = $ xy2 [0]; $ y2 = $ xy2 [1]; $ B = $ x1-$ x2; $ a = $ y2-$ y1; $ c = ($ y1-$ y2) * $ x1-$ y1 * ($ x1-$ x2); $ xys = split (",", $ pl [$ j + 1]); $ d = (abs ($ a * $ xys [0] + $ B * $ xys [1] + $ c )) /(sqrt ($ a * $ a + $ B * $ B); if ($ d <$ min) {if ($ flag = 0) $ plstr. = $ pl [$ j + 1]; else $ plstr. = ";". $ pl [$ j + 1]; $ flag ++; }}$ polyline = $ plstr; // hope you can give me more tips and help me improve the Code. Thank you very much.