OSM 軟體分析

來源:互聯網
上載者:User

友情連結:http://lovespss.blog.51cto.com/1907593/515192

               http://josm.openstreetmap.de/wiki/Download#Ubuntu

http://sourceforge.net/projects/viking/

               論壇:http://forum.openstreetmap.org/

 

OpenStreetMap's Editing Applications

終於進入我最喜歡的環節,實際操作。這章開始講如何把收集到資訊轉化成資料存放區到OpenStreetMap的Database裡。介紹了三個工具:

Potlatch—基於WEB的編輯器
JOSM—基於Java的編輯器
Merkaartor—案頭應用

三個工具的比較圖:

 

Potlatch取義冬季贈禮節,但對這個禮物不感冒,直接跳過了這段。Merkaartor 是用C++寫的,也沒有多大興趣,重點看了下JSOM。官方網站:http://josm.openstreetmap.de/。

現在覺悟高了點,先Down人家的原始碼
http://josm.openstreetmap.de/svn/trunk。找到Build檔案,先打個包再說。打包過程中報了個錯,提示找不到 svn。

[exec] Execute failed: java.io.IOException: Cannot run program "svn": CreateProcess error=2, The system cannot find the file specified
官網上也有這個Bug,指出需要配置SVNAnt。但經過實驗,發現跟 SVNAnt 還沒有多大關係。好在我前幾天裝上了VisualSVN Server,它下面有svn.exe,加到path 環境變數,重啟Eclipse後,OK了。

打完Jar包才發覺自己幹嘛打Jar包(⊙o⊙)?下載代碼就是要研究學習的嘛,趕緊找到入口類MainApplication,Debug起來。

速度比較慢,等了好幾分鐘才出來介面。先把這個樣本軌跡下下來:

http://www.openstreetmap.org/user/Jonathan%20Bennett/traces/564418

終於出來了,現在載入剛剛下載的軌跡檔案。

按照書上提示,點擊Download。又等待了大約一分鐘,正準備罵它,視窗蹦了出來,原來他已經載入了這個軌跡相應地區的映像資料。對不起,我錯了。

當然下載還有有限制的,大概就是50KM*50KM的地區。人家也不容易,免費的地圖服務,伺服器資源有限,要是同時遇到大量下載,還不掛了。而且下載資料還不需要使用者名稱密碼的。閑話少說啦,勾上Raw GPS Data,開始下載。看看下載完成後的地圖情況。

JOSM支援兩種視圖,standard和wireframe,意即標準和架構,可用Ctrl+w進行切換。如下是wireframe視圖,沒有太多裝飾,簡潔不少。

作者想要來個案例重演,重畫地圖,來就來唄,誰怕誰啊。先把下下來的Downloaded GPX data和Data Layer 1層都給它幹掉,打回原形。

載入圖片

匯入後,將會看到建立的Geotagged Images層。

接下來的編輯操作整了半天也沒弄出來,PASS了,真沒繪畫的天分。來看最後一個環節,編輯好了準備上傳資料。這就需要使用者名稱密碼了。JOSM支援兩種認證方式,一是簡單的使用者名稱/密碼,另外一個是OAuth。來看看OAuth是怎麼回事吧。

1.單擊Edit--》Preference,定位到Connection選項,Server URL裡輸入http://www.openstreetmap.org/api 並進行驗證,下面的認證方式選擇Use OAuth。

2.通過瀏覽器登陸到openstreetma。

3. 點擊Authorise now。

4. 認證流程選擇Semi-automatic。

5.點擊Retrieve Request Token,將會切換到瀏覽器視窗。確保勾選上所有選項,然後Save changes。

 

6. 切回JOSM,單擊Retrieve Access Token。

7. 單擊 Test Access Token 進行測試.

 
8. 最後點擊Accept Access Token,完事。

Linux / *BSD
packages
In some Distributions prepacked packages exist to install JOSM with your favourite package manager from the repositories.Although these packages might be a bit older than the .jar files on the main page, they usually fit better into the environment and
install dependencies and a starter in the menu automatically.

Note: There is no problem with installing the prepacked package and still using the .jar files listed above.

If there exists no package or you do not want to use it you can download the JOSM .jar file from themain page (tested or latest version) or build it from source.

using the shell
Go to the directory where the josm-latest.jar is and type

java -jar josm-latest.jar

to launch. Replace josm-latest.jar with the name of the jar file you loaded, e.G.josm.jar for releases.

If this doesn't help, try to set your JAVA_HOME variable to the java location (the root location, not the bin. As example:

 export JAVA_HOME=/usr/lib/sun-j2se6.0-jdk java -jar ''josm.jar''
KDE
There is a
tutorial on how to setup your environment to start jar-files by clicking on them.
GNOME
Right click on the JAR file, and select Open with "Sun Java 6.0 Runtime", or whatever java version you have.
XGL/Compiz
Type this into a shell:

export AWT_TOOLKIT=MToolkit && java -jar josm-test.jar

as described here:
http://kubasik.net/blog/index.php/2006/06/19/java-sun-150-and-xglcompiz-on-ubuntu/

Blank window on startup
AWT before JDK7
doesn't play well with non-reparenting window managers (i.e. xmonad, awesome, dwm, ratpoison, Ion3, ...), resulting in the main window not being displayed properly on startup. The Awesome Wiki hasworkarounds
for this problem. There is also anxmonad specific way of doing the wmname thing.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.