2012-07-26 126 views
1

我正在尋找詳盡的Google地圖導航標誌列表。谷歌地圖導航標誌

爲了避免混淆,我是而不是正在尋找this

我要找的導航標記像左,右轉的完整列表,環島,左叉,叉右,稍向左轉,稍向右轉等

據我所知,文本表示會有一些變數像迴旋處第三齣口。這可能是第一齣口第二齣口等但我期待從此提取回旋處,並留下該指令的變量部分。爲此我需要一個完整的標記列表。

我搜索了很多,但我只發現標誌物的像條感興趣的地方,高爾夫球場等

在此先感謝:)

編輯:爲了進一步澄清我的要求: Google地圖API包含「html_instructions」標籤。我想將圖像分配給儘可能多的不同指令。爲此,我需要確定詳盡的駕駛指示清單。

+0

教育局對,這是語言(和區域)的依賴,但是人們知道你需要一個英文單詞/短語列表,它們不在中的'b'標籤之間,如出現[here](http://maps.googleapis.com/maps/api/directions/xml?origin=Chicago,IL&destination=Los+Angeles,CA&waypoints=Joplin,MO|Oklahoma+City,OK&sensor=false)。 – Xantix 2012-07-26 04:42:54

+0

他謝謝。我沒有意識到地圖的意義。 @Xantix是的你是對的。我沒有把文本視爲語言依賴。不過,我編制了英文說明清單,可能對未來某人有所幫助。我應該在此主題中將其作爲附加答案發布嗎? – ameyazing 2012-07-27 04:16:41

+0

看看我的答案,輸出鏈接包含大部分英語說明。 – Xantix 2012-07-27 18:16:40

回答

2

如果我正確理解您的問題,那麼可以在下面的圖像中找到完整列表(以可視形式)this url。我無法找到翻譯列表,但無論如何,這將是語言無關的。

direction icons

+0

非常感謝@edb :) – ameyazing 2012-07-26 05:40:01

1

我希望你期待這http://mapicons.nicolasmollet.com/

+0

Hi @ Mr.Black,感謝您的快速回復。對不起,這不是我要找的。我正在尋找儘可能多的關聯符號的駕駛路線。我會在我的問題中添加一個編輯來更加明確我的要求。 – ameyazing 2012-07-26 04:21:47

+0

所以,你需要駕駛方向符號。是的,它也在那裏..你知道,許多類別下有許多圖標。 http://mapicons.nicolasmollet。com/markers/transportation/directions/directions/ – 2012-07-26 04:29:30

+0

嗨,我很抱歉,但這仍然不是我要找的東西。我正在尋找可以接收的駕駛路線列表,例如輕微左轉,輕微右轉,左轉叉等。您的努力是值得讚賞的。 – ameyazing 2012-07-26 04:33:25

0

我沒發現什麼官,所以我做了一個快速C#程序提取關鍵短語。

輸出是here:

我的代碼是:

static void Main(string[] args) 
{ 
    ConcurrentDictionary<string,int> phrases = new ConcurrentDictionary<string,int>(); 

    List<string> citiesOfUS = new List<string>() 
    { 
     "Chicago,IL", 
     "Los+Angeles,CA", 


     "Montgomery"  + "," +  "AL", 
     "Juneau"   + "," +  "AK", 
     "Phoenix"   + "," +  "AZ", 
     "Little+Rock"  + "," +  "AR", 
     "Sacramento"  + "," +  "CA", 
     "Denver"   + "," +  "CO", 
     "Hartford"  + "," +  "CT", 
     "Dover"   + "," +  "DE", 
     "Tallahassee"  + "," +  "FL", 
     "Atlanta"   + "," +  "GA", 
     "Honolulu"  + "," +  "HI", 
     "Boise"   + "," +  "ID", 
     "Springfield"  + "," +  "IL", 
     "Indianapolis" + "," +  "IN", 
     "Des+Moines"  + "," +  "IA", 
     "Topeka"   + "," +  "KS", 
     "Frankfort"  + "," +  "KY", 
     "Baton+Rouge"  + "," +  "LA", 
     "Augusta"   + "," +  "ME", 
     "Annapolis"  + "," +  "MD", 
     "Boston"   + "," +  "MA", 
     "Lansing"   + "," +  "MI", 
     "St.+Paul"  + "," +  "MN", 
     "Jackson"   + "," +  "MS", 
     "Jefferson+City" + "," +  "MO", 
     "Helena"   + "," +  "MT", 
     "Lincoln"   + "," +  "NE", 
     "Carson+City"  + "," +  "NV", 
     "Concord"   + "," +  "NH", 
     "Trenton"   + "," +  "NJ", 
     "Santa+Fe"  + "," +  "NM", 
     "Albany"   + "," +  "NY", 
     "Raleigh"   + "," +  "NC", 
     "Bismarck"  + "," +  "ND", 
     "Columbus"  + "," +  "OH", 
     "Oklahoma+City" + "," +  "OK", 
     "Salem"   + "," +  "OR", 
     "Harrisburg"  + "," +  "PA", 
     "Providence"  + "," +  "RI", 
     "Columbia"  + "," +  "SC", 
     "Pierre"   + "," +  "SD", 
     "Nashville"  + "," +  "TN", 
     "Austin"   + "," +  "TX", 
     "Salt+Lake+City" + "," +  "UT", 
     "Montpelier"  + "," +  "VT", 
     "Richmond"  + "," +  "VA", 
     "Olympia"   + "," +  "WA", 
     "Charleston"  + "," +  "WV", 
     "Madison"   + "," +  "WI", 
     "Cheyenne"  + "," +  "WY" 

    }; 

    Parallel.ForEach(citiesOfUS, (string origin) => 
    { 
     foreach (string destination in citiesOfUS) 
     { 
      string json = new WebClient().DownloadString("http://maps.googleapis.com/maps/api/directions/xml?origin=" + origin + "&destination=" + destination + "&sensor=false"); 

      bool shouldExitLoop = false; 

      while (!shouldExitLoop) 
      { 
       int pos1 = json.IndexOf("<html_instructions>"); 
       if (pos1 == -1) { shouldExitLoop = true; break; } 

       int pos2 = json.IndexOf("</html_instructions>"); 
       if (pos2 == -1) { shouldExitLoop = true; break; } 

       string subString = json.Substring(pos1 + 19, pos2 - pos1 - 19); 

       json = json.Substring(pos2 + 20); 

       int posB1 = subString.IndexOf("&lt;b"); 

       while (posB1 != -1) 
       { 
        int posB2 = subString.IndexOf("&lt;/b"); 

        string part1 = subString.Substring(0, posB1); 
        string part2 = subString.Substring(posB2 + 6); 

        subString = part1 + " SYM " + part2; 

        posB1 = subString.IndexOf("&lt;b"); 
       } 

       int posSpace = subString.IndexOf("&gt;"); 

       while (posSpace != -1) 
       { 
        string part1 = subString.Substring(0, posSpace); 
        string part2 = subString.Substring(posSpace + 4); 

        subString = part1 + part2; 

        posSpace = subString.IndexOf("&gt;"); 
       } 

       int posDiv1 = subString.IndexOf("&lt;div"); 

       while (posDiv1 != -1) 
       { 
        int posDiv2 = subString.IndexOf("&lt;/div"); 

        string part1 = subString.Substring(0, posDiv1); 
        string part2 = subString.Substring(posDiv2 + 8); 

        subString = part1 + " SYM " + part2; 

        posDiv1 = subString.IndexOf("&lt;div"); 
       } 

       phrases.AddOrUpdate(subString, 1, (key, oldvalue) => oldvalue + 1); 

      } 
     } 

    }); 


    string[] lines = phrases.Keys.ToArray(); 

    Array.Sort(lines); 

    System.IO.File.WriteAllLines(@"C:\Users\Xantix\Desktop\WriteLines.txt", lines);    

    return; 
} 

基本上這些都是英文短語你想從每個省會城市走在了美國的每一個其他時。

任何大膽的標籤之間出現了替換單詞「SYM」,像左,右,街道名稱的,等

注:我刪除div的的html_instructions內部之間出現的東西,所以像「部分收費公路「和」正在建設中,直到SomeDate「失蹤。

隨意修改我的代碼在其他城市添加到列表或添加街道地址等

2

正如在他的回答@edb建議,文字是語言和區域有關。因爲,我不需要在我的項目中處理本地化,所以我編寫了一份英文說明列表。 @ edb的答案中可以使用相應的方向符號。

方向命令

  • 採取<第n > <離開| right >
  • 轉< Left |右> [< at ... > | <到... >]
  • 出口駛入<...>
  • 取[...]出口向<...>
  • 在環島,<繼續直行|採取<第n >出口>
  • 左轉駛入<...>
  • 走匝道<上離開了< |右轉>到... |到... >
  • 駛入<...>
  • 保持<左|右邊>在叉[繼續朝...]
  • 稍微<左|右> [到...]
  • 夏普<離開|右>在<...>
  • 使調頭在<...>

一些指令沒有關聯的象徵。

  • 繼續到...
  • 頭<迎...,華北,華南,... >
  • 路過<...>

希望這是有益:)