0

我正在构建一个谷歌地图应用程序,我有很多纬度和经度位置。我希望以编程方式为这些点创建一个周长。

谁能指出我正确的方向?

谢谢!

以下是一些例子:

var points = [[-37.81398385040291,145.22083640098572],[-37.813970000000005,145.22084],[-37.81398,145.22050000000002],[-37.814060000000005,145.22045],[-37.814910000000005,145.22047],[-37.814910000000005,145.22047],[-37.81506,145.22048],[-37.815070000000006,145.22404],[-37.815070000000006,145.22404],[-37.81401,145.22409000000002],[-37.81401,145.22409000000002],[-37.81398,145.22109],[-37.81398,145.22088000000002],[-37.815899365036444,145.2239316701889],[-37.815900000000006,145.22393000000002],[-37.816190000000006,145.22287],[-37.81626,145.22258000000002],[-37.81627,145.22230000000002],[-37.816230000000004,145.22192],[-37.81618,145.22156],[-37.8162,145.22143],[-37.81624,145.22137],[-37.81631,145.22133000000002],[-37.8164,145.22135],[-37.816810000000004,145.22131000000002],[-37.81692,145.22132000000002],[-37.817,145.22137],[-37.81701,145.22164],[-37.81705,145.22223000000002],[-37.81705,145.22235],[-37.81705,145.22235],[-37.81702000000001,145.22268000000003],[-37.816930000000006,145.22318],[-37.81676,145.22400000000002],[-37.816660000000006,145.22442],[-37.816460000000006,145.22435000000002],[-37.81609,145.22428000000002],[-37.81609,145.22428000000002],[-37.81591,145.22424],[-37.81591,145.22422],[-37.815900000000006,145.22418000000002],[-37.815850000000005,145.22412],[-37.81589,145.22399000000001],[-37.81513655542966,145.22676408290863],[-37.81514000000001,145.22676],[-37.815690000000004,145.22476],[-37.815810000000006,145.22432],[-37.815830000000005,145.22432],[-37.815870000000004,145.22431],[-37.815900000000006,145.22428000000002],[-37.81591,145.22424],[-37.816460000000006,145.22435000000002],[-37.8166,145.2244],[-37.8166,145.2244],[-37.816660000000006,145.22442],[-37.81656,145.22495],[-37.816390000000006,145.22565],[-37.81618,145.22644000000003],[-37.815920000000006,145.22707000000003],[-37.815920000000006,145.22707000000003],[-37.81582,145.22727],[-37.815650000000005,145.2273],[-37.81539,145.22729],[-37.81501,145.22729],[-37.81512,145.22683],[-37.817136794967546,145.22047698497772],[-37.81714,145.22049],[-37.81805000000001,145.22048],[-37.818180000000005,145.22045],[-37.818070000000006,145.22222000000002],[-37.81806,145.22223000000002],[-37.81806,145.22223000000002],[-37.81804,145.22234],[-37.818000000000005,145.22242],[-37.81795,145.22243],[-37.81761,145.22246],[-37.81734,145.22243],[-37.81723,145.22241000000002],[-37.81723,145.22241000000002],[-37.81716,145.22240000000002],[-37.81716,145.22214000000002],[-37.81712,145.22135],[-37.81707,145.22069000000002],[-37.81707,145.22069000000002],[-37.817060000000005,145.22049],[-37.81711,145.22049],[-37.81416184279526,145.23091077804565],[-37.814150000000005,145.23091000000002],[-37.81412,145.23112],[-37.81407,145.23126000000002],[-37.81398,145.23141],[-37.81392,145.2314],[-37.813750000000006,145.23125000000002],[-37.813750000000006,145.23125000000002],[-37.813750000000006,145.23102],[-37.813770000000005,145.23094],[-37.81383,145.23085],[-37.81383,145.23085],[-37.81385,145.23083000000003],[-37.814,145.23085],[-37.814130000000006,145.23087],[-37.81693338325279,145.21743535995483],[-37.816930000000006,145.21744],[-37.81702000000001,145.21764000000002],[-37.81689,145.21853000000002],[-37.81689,145.21853000000002],[-37.81610701739786,145.21855000000002],[-37.81610701739786,145.21748000000002],[-37.81685286596086,145.21914325654507],[-37.816880000000005,145.21917000000002],[-37.816950000000006,145.2204],[-37.81696,145.22048],[-37.81691,145.22048],[-37.81691,145.22048],[-37.81656,145.22049],[-37.81506,145.22048],[-37.81452,145.22045],[-37.8140537760368,145.22044000000002],[-37.8140537760368,145.21914325654507],[-37.81292860097769,145.22728443145752],[-37.81181824192457,145.22730588912964],[-37.811801289748544,145.22651195526123],[-37.81291,145.22652000000002],[-37.813916043664385,145.23245573043823],[-37.81392,145.23246],[-37.81347,145.23212],[-37.81369,145.23165],[-37.813700000000004,145.23158],[-37.81373,145.23138],[-37.813750000000006,145.2313],[-37.813750000000006,145.2313],[-37.813750000000006,145.23125000000002],[-37.81392,145.2314],[-37.813970000000005,145.23142],[-37.813970000000005,145.23142],[-37.81401,145.23137],[-37.81412,145.23112],[-37.814150000000005,145.23094],[-37.814150000000005,145.23094],[-37.81416,145.23088],[-37.81423,145.23088],[-37.81457,145.23104],[-37.813852474790444,145.2325201034546],[-37.813880000000005,145.23254],[-37.81277,145.23481],[-37.812560000000005,145.23520000000002],[-37.812380000000005,145.23549],[-37.8119,145.23614],[-37.811530000000005,145.23665000000003],[-37.81145,145.23675],[-37.811310000000006,145.23682000000002],[-37.81119,145.23685],[-37.8111,145.23684],[-37.8110045330848,145.2360498905182],[-37.811945383120715,145.23480534553528],[-37.812123380427515,145.23499846458435],[-37.81264584576343,145.23389339447021],[-37.81344563270114,145.23215532302856],[-37.813966898724125,145.2273005247116],[-37.813970000000005,145.22731000000002],[-37.81293,145.22732000000002],[-37.81291535728967,145.22652006017208],[-37.814,145.22653000000003],[-37.81834030281087,145.22042334079742],[-37.818340000000006,145.22043000000002],[-37.818180000000005,145.22045],[-37.81805000000001,145.22048],[-37.817370000000004,145.22048],[-37.817060000000005,145.22049],[-37.81702000000001,145.21984],[-37.816990000000004,145.21900000000002],[-37.81703,145.21854000000002],[-37.81709,145.21807],[-37.81709,145.21807],[-37.81716,145.21769],[-37.81727,145.21754],[-37.817350000000005,145.2174],[-37.817400000000006,145.21734],[-37.8175,145.21731],[-37.817750000000004,145.2174],[-37.81826,145.21741],[-37.81826,145.21741],[-37.81853,145.2174],[-37.81656469809118,145.2271020412445],[-37.816570000000006,145.22709],[-37.81645,145.22708],[-37.81629,145.22709],[-37.81624,145.22706000000002],[-37.8162,145.22702],[-37.816190000000006,145.22694],[-37.8162,145.22676],[-37.816500000000005,145.22568],[-37.81678,145.22446000000002],[-37.81702000000001,145.22333],[-37.817130000000006,145.22268000000003],[-37.817150000000005,145.22248000000002],[-37.817150000000005,145.22248000000002],[-37.81716,145.22240000000002],[-37.81734,145.22243],[-37.81761,145.22246],[-37.81795,145.22243],[-37.818000000000005,145.22242],[-37.81803,145.22239000000002],[-37.818090000000005,145.22255],[-37.818110000000004,145.2226],[-37.818110000000004,145.2226],[-37.818110000000004,145.22271],[-37.81795,145.22356000000002],[-37.817800000000005,145.22407],[-37.81774,145.22420000000002],[-37.817640000000004,145.22434],[-37.81758000000001,145.22453000000002],[-37.817510000000006,145.22474000000003],[-37.816990000000004,145.226],[-37.81178857561397,145.22652804851532],[-37.811800000000005,145.22653000000003],[-37.811800000000005,145.22731000000002],[-37.811800000000005,145.22731000000002],[-37.811800000000005,145.22736],[-37.811580000000006,145.22735],[-37.811,145.22733000000002],[-37.81087,145.22732000000002],[-37.810840000000006,145.22727],[-37.81078,145.22721],[-37.81063,145.22712],[-37.810550000000006,145.227],[-37.810550000000006,145.227],[-37.810520000000004,145.22694],[-37.81049,145.22651000000002]];

注意:我想用我计算的周长点绘制一个不规则的形状 - 一个由最外面的点组成的多边形。有了这个绑定,我认为 Bounds 就足够了,因为我相信它是矩形的。

4

0 回答 0