为什么世界需要 openstreetmap 中国

OpenStreetMapData
Writing the Open Source software behind this site and
maintaining and improving this service takes a lot of time.
Please consider supporting this effort.
collects an amazing amount of geodata and makes it available to the world for
free. But the raw OpenStreetMap data is hard to use.
On this web site you'll
find some of that data pre-processed and formatted for easier use.
Pre-processing includes removing or fixing of wrong data and assembling of
different parts of the data into a usable whole. The data is formatted into Shapefiles for easy use in the usual GIS
applications.
Coastline data processings
The most popular data sets
- used by most
OpenStreetMap based maps in some form
Generalized OpenStreetMap data
Special processings of OpenStreetMap geometries for better readable
maps at coarse scales
Other datasets
Browse the full list of available data sets onAndroid OpenStreetMap(OSM) 使用 osmbonuspack 进行导航
#0,首先,先去mapquest上面注册一个开发者账号!
强烈推荐大家先做这一步,从注册到申请到的App Key可以使用,要等待1小时左右。所以,先注册了吧。
注册好之后,你会得到一个类似于&Fmjtd%7Cluubn10zn9%2C8s%3Do5-90rnq6&这样的App key。也就是API KEY。
#1,显示地图。
这个,按照http://blog.csdn.net/mad1989/article/details/9733985来做就可以了。其中,我们只需要做完&1.3地图实例化&即可。
这个步奏不难,只是的东西比较多,大家慢慢来就可以了。
#2,下载osmbonuspack。
这里的下载方式和我们所常见的不太一样,你需要通过svn来下载。
下面是svn的代码:
svn checkout /svn/trunk/ osmbonuspack-read-only
下载好后,文件夹下会有如下的三个项目。
#3,导入到eclipse中。
如何导入不讲了,但是请注意,这里只导入OSMBounsPack项目,其他项目不是必须要导入的。
还有,请注意勾选这个选项,因为这个项目是一个 Library,不在同一级目录下,引用时会出错。
#4,将osmbonuspack引用到你的项目中。
这里的引用很简单,在你的项目上点击右键,选择Properties,在左边的栏里面选择Android,然后在右边的Library下,添加OSMBonusPack。
#5,写代码,实现导航。
这里就很简单了。由于是简单的例子,这里给大家看一下如何调用就可以了。
首先,onCreate方法的代码:
super.onCreate(savedInstanceState);
& & & & setContentView(R.layout.activity_main);
& & & & activity =
& & & & mMapView = (MapView) findViewById(R.id.mapview);
& & & & mController = mMapView.getController();
& & & & // ResourceProxy init
& & & & // mResourceProxy = new DefaultResourceProxyImpl(this);
& & & & mMapView.setTileSource(TileSourceFactory.MAPNIK);
& & & & mMapView.setBuiltInZoomControls(true);
& & & & mMapView.setMultiTouchControls(true);
& & & & // 定位当前位置,珠海
& & & & GeoPoint center = new GeoPoint(22.3.576873);
& & & & mController.setZoom(14); // 先设置缩放,后设置中心点,不然会出现偏差。
& & & & mController.setCenter(center);
& & & & mMapView.setMinZoomLevel(14);
& & & & mMapView.setMaxZoomLevel(17);
& & & & // 添加标记
& & & & setBickAndParkLocation();
& & & & mMapView.setKeepScreenOn(true);
& & & & // 右下角小地图Overlay
& & & & // MinimapOverlay MinimapOverlayoverlay = new MinimapOverlay(this,
& & & & // mMapView.getTileRequestCompleteHandler());
& & & & // mMapView.getOverlays().add(MinimapOverlayoverlay);
& & & & // mMapView.getOverlays().remove(0);
& & & & // 地图范围控制
& & & & // /questions/5403733/restricting-the-area-the-user-can-go-to-on-mapview
& & & & BoundingBoxE6 areaLimit = new BoundingBoxE6(22.499, 113.698, 22.123,
& & & & & & & & 113.363);
& & & & mMapView.setScrollableAreaLimit(areaLimit);
& & & & mZoomLevel = mMapView.getZoomLevel();
& & & & new Thread(new Runnable() {
& & & & & & @Override
& & & & & & public void run() {
& & & & & & & & RoadManager roadManager = new MapQuestRoadManager(
& & & & & & & & & & & & &这里是#0申请的那个App Key&);
& & & & & & & & roadManager.addRequestOption(&routeType=bicycle&);
& & & & & & & & Marker startMarker = new Marker(mMapView);
& & & & & & & & GeoPoint startPoint = new GeoPoint(22.274, 113.574);
& & & & & & & & startMarker.setPosition(startPoint);
& & & & & & & & startMarker.setAnchor(Marker.ANCHOR_CENTER, 1.0f);
& & & & & & & & // startMarker.setIcon(getResources().getDrawable(R.drawable.ic_launcher));
& & & & & & & & mMapView.getOverlays().add(startMarker);
& & & & & & & & // mMapView.invalidate();
& & & & & & & & startMarker.setTitle(&Start point&);
& & & & & & & & // mMapView.invalidate();
& & & & & & & & ArrayList&GeoPoint& waypoints = new ArrayList&GeoPoint&();
& & & & & & & & waypoints.add(startPoint);
& & & & & & & & waypoints.add(new GeoPoint(22.284, 113.553)); // end point
& & & & & & & & Road road = roadManager.getRoad(waypoints);
& & & & & & & & Polyline roadOverlay = RoadManager.buildRoadOverlay(road,
& & & & & & & & & & & & activity);
& & & & & & & & mMapView.getOverlays().add(roadOverlay);
& & & & & & & & // mMapView.invalidate();
& & & & & & & & Drawable nodeIcon = getResources().getDrawable(
& & & & & & & & & & & & R.drawable.marker_node);
& & & & & & & & for (int i = 0; i & road.mNodes.size(); i++) {
& & & & & & & & & & RoadNode node = road.mNodes.get(i);
& & & & & & & & & & Marker nodeMarker = new Marker(mMapView);
& & & & & & & & & & nodeMarker.setPosition(node.mLocation);
& & & & & & & & & & nodeMarker.setIcon(nodeIcon);
& & & & & & & & & & nodeMarker.setTitle(&Step & + i);
& & & & & & & & & & mMapView.getOverlays().add(nodeMarker);
& & & & & & & & }
& & & & & & & & mhandler.obtainMessage(1).sendToTarget();
& & & & & & }
& & & & }).start();
之后,在类中添加Handler:
& & Handler mhandler = new Handler() {
& & public void handleMessage(Message msg) {
& & & & mMapView.invalidate();
这里开线程的原因,是因为网络操作,不能在主线程中进行。
之后,就可以编译运行啦。
#6,Unable to execute dex: Multiple dex files define Lorg/slf4j/ILoggerFactoryJOSM is an extensible editor for
(OSM) written in
Currently it supports loading stand-alone GPX tracks and GPX track data from the OSM database as well as loading and editing existing nodes, ways, metadata tags and relations from the OSM database.
and licensed under .
recommended version, all platforms, automatic update (if link above doesn't work for you, please read )
all platforms ()
9329, requires ). Users of Mountain Lion see .
What has been changed recently?
(most important changes)
(nicely summarized)
(very detailed)
Extensions
(installation instructions)
(installation instructions)
Getting Started |
and comprehensive introduction on the .
The official
(can be reached with &F1& from within JOSM).
Tutorial on .
Ask members of the OpenStreetMap community on
OpenStreetMap's
the , including our
Found a bug? | Have an idea? | Make a suggestion?
Please report any bug found:
entry in the main menu . Alternatively, the same function is available under
Discuss ideas and suggestions also in the , on the
mailing list, or on the
IRC channel.
Contribute
Report bugs, discuss ideas, think of possible enhancements ().
Participate in
Review bugs, up/down vote tickets, find duplicates, test bugs, add more descriptive texts.
Correct/update/extend the
Unify all JOSM-related Wiki pages and join them with the online help.
program/documentation.
Design fancy new .
Write code – get the code and write patches …
for build instructions and other details.
This site is a combined online help and bug tracking system for JOSM and JOSM plugins.
No login is required to use this site (neither for reading nor for changes to wiki or bug tracker).
A login has the following advantages:
Mail is sent for changes in your own bug tracker tickets. This is possible by entering an e-mail as user name in the tickets, too, but then be aware that the address is openly visible and you are unable to change that later.
Page settings are remembered (e.g. input field size and a lot of other stuff).
Logins which have no e-mail address or which have not been used at least once are automatically deleted.
Logins to edit the OpenStreetMap database are separate from the logins on this server.
Copyright (CC-BY-SA and LGPL since April 2014) of this site is stated in the footer.
Server sponsored by:
For problems, ideas, suggestions use the .
The volunteers creating JOSM can be reached using the
mailing list or the
If you use social networks, see our
Last modified on T17:40:06+01:00
Download in other formats:

我要回帖

更多关于 openstreetmap 开发 的文章

 

随机推荐