Сервис mail.ru в ответ на запрос прокладки маршрута
- Код: Выделить всё
http://maps.mail.ru/stamperx/getPath.aspx?mode=distance&x0=39.7746276855469&y0=54.6333933646418&x1=39.9613952636719&y1=54.9500160322243
присылает примерно такое:
- Код: Выделить всё
{ "A" : { "text" : "54.640135N, 39.762386E", "x" : "39.762386", "y" : "54.640135" }, "parts" : [ { "totalLength" : "41810", "totalTime" : "2150", "B" : { "text" : "54.950027N, 39.960945E", "x" : "39.960945", "y" : "54.950027" }, "points" : [ { "x" : "39.762386", "y" : "54.640135" }, { "x" : "39.766972", "y" : "54.642924" }, { "x" : "39.797599", "y" : "54.673455" }, { "x" : "39.802998", "y" : "54.694627" }, { "x" : "39.826782", "y" : "54.717647" }, { "x" : "39.833720", "y" : "54.739542" }, { "x" : "39.829977", "y" : "54.771879" }, { "x" : "39.839713", "y" : "54.793496" }, { "x" : "39.861668", "y" : "54.805612" }, { "x" : "39.926689", "y" : "54.828320" }, { "x" : "39.943542", "y" : "54.835375" }, { "x" : "40.000009", "y" : "54.875087" }, { "x" : "40.000009", "y" : "54.902354" }, { "x" : "40.004360", "y" : "54.919833" }, { "x" : "39.979874", "y" : "54.934524" }, { "x" : "39.960302", "y" : "54.941573" }, { "x" : "39.960945", "y" : "54.950027" } ], "items" : [ { "text" : "РџСЂСЏРјРѕ", "x" : "39.762386", "y" : "54.640135", "turn" : "0", "length" : "41810" }] } ]}
Видно, что есть координаты точки A и точки B, длина маршрута (в метрах), время прохождения (в секундах), набор промежуточных точек для отображения и указания поворотов (в данном случае поворотов нет, поэтому написано "Прямо"). Но нужно учесть, что прокладывает этот сервис настолько криво, что рекомендовать его для составления маршрутов хотя бы минимальной сложности никак нельзя. От дорог областного значения в сторону ни-ни!
Сервис yournavigation.com в ответ на запрос
- Код: Выделить всё
http://www.yournavigation.org/api/1.0/gosmore.php?format=kml&v=motorcar&fast=1&layer=mapnik&flat=54.6493235053765&flon=39.7952270507813&tlat=54.8312770736843&tlon=40.2909851074219
присылает нормальный kml:
- Код: Выделить всё
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>KML Samples</name>
<open>1</open>
<distance>42.178668254836</distance>
<description>To enable simple instructions add: 'instructions=1' as parameter to the URL</description>
<Folder>
<name>Paths</name>
<visibility>0</visibility>
<description>Examples of paths.</description>
<Placemark>
<name>Tessellated</name>
<visibility>0</visibility>
<description><![CDATA[If the <tessellate> tag has a value of 1, the line will contour to the underlying terrain]]></description>
<LineString>
<tessellate>1</tessellate>
<coordinates> 39.780907,54.636711
39.781802,54.638055
39.787676,54.643676
39.790492,54.646322
39.793750,54.648459
39.794552,54.648832
39.796366,54.649681
39.797076,54.650013
39.797917,54.650406
39.800146,54.651282
39.813762,54.655931
39.817011,54.656887
39.818339,54.657529
39.819596,54.658503
39.820779,54.659721
39.823446,54.664756
39.824436,54.666629
39.824609,54.666956
39.824839,54.667391
39.845959,54.708096
39.846139,54.708443
39.846389,54.709025
39.847901,54.712546
39.848149,54.715030
39.848347,54.718165
39.847730,54.721246
39.847602,54.721693
39.844051,54.729934
39.841304,54.736651
39.840790,54.739560
39.840832,54.739835
39.840526,54.743621
39.840267,54.745300
39.839967,54.747251
39.838421,54.753150
39.838785,54.754621
39.840034,54.755981
39.853922,54.763112
39.855803,54.764745
39.857387,54.766456
39.858460,54.768227
39.862255,54.776627
39.863779,54.779289
39.866704,54.782372
39.869244,54.785049
39.871634,54.787783
39.873096,54.790604
39.877900,54.801931
39.879637,54.804029
39.882862,54.805836
39.889313,54.809240
39.894958,54.818648
39.898114,54.821251
39.901958,54.823651
39.903458,54.824185
39.912802,54.827755
39.915375,54.830077
39.917543,54.832592
39.919801,54.834512
39.924331,54.837424
39.928001,54.839069
39.934871,54.842257
39.938130,54.844201
39.940934,54.846477
39.943322,54.848963
39.945917,54.850825
39.949483,54.852648
39.952777,54.853785
39.961112,54.855994
39.961254,54.857440
39.961657,54.858157
39.962653,54.858885
39.966583,54.860758
39.968154,54.861425
39.969139,54.861625
39.971474,54.862004
39.972943,54.862600
39.980135,54.866184
39.983368,54.868579
39.984089,54.869344
39.984927,54.871230
39.986119,54.872686
39.987710,54.874504
39.988693,54.875121
39.994124,54.877801
39.994599,54.878153
39.996386,54.880399
40.000511,54.884778
40.001253,54.887048
40.002405,54.889264
40.002883,54.891431
40.003009,54.892430
40.002635,54.893166
40.000143,54.894826
39.999670,54.895428
39.999775,54.896095
40.001324,54.898096
40.001707,54.898807
40.003085,54.902003
40.003492,54.903035
40.003262,54.903776
40.002581,54.904428
40.000344,54.905807
39.999332,54.907370
39.998302,54.909738
39.997745,54.911257
39.997789,54.913874
39.997473,54.914872
39.997897,54.915787
39.997891,54.916259
39.997314,54.917221
39.996242,54.918816
39.996433,54.919256
39.997653,54.920561
39.997907,54.921929
39.997479,54.923143
39.996917,54.924085
39.996438,54.924380
39.992755,54.924789
39.990410,54.925279
39.988724,54.926264
39.987009,54.927055
39.985724,54.927141
39.982335,54.926815
39.979550,54.927465
39.978194,54.928401
39.976485,54.928994
39.975302,54.929717
39.974357,54.930917
39.974122,54.932039
39.970354,54.933436
39.969861,54.934491
39.969956,54.938858
39.969342,54.939482
39.969248,54.941273
39.971325,54.943525
39.971373,54.945532
39.968161,54.947349
39.964005,54.948326
39.961928,54.949709
39.960704,54.950109
</coordinates>
</LineString>
</Placemark>
</Folder>
</Document>
</kml>
Этот сервис более адекватен, он видит не только автомагистрали. И маршруты рисует гораздо подробнее. Если использовать для прокладки маршрутов, то только его.