OpenStreetMap Map Data Introduction

Source: Internet
Author: User
Tags ruby on rails

Original link: daily read packtpub.openstreetmap (1)

I believe most people know the wiki, but to mention the map, everyone's first reaction must be Google Maps. Before I read the book, I didn't know there was a OpenStreetMap, a wiki-like, freely editable world map, created by the user, that allows you to view, edit, or use geographic data from around the world.

Making a free, Editable maps of the world

A brief introduction to the history of OpenStreetMap, from the original Java to the present Ruby on Rails.

Getting started at openstreetmap.org

From http://www.openstreetmap.org/, you can see two location search engines: Nominatim and Geonames. It is recommended to register an account, then build a chant. Then the wordy introduction of a pass OpenStreetMap.

Gathering Data using GPS

As the name implies, use GPS to collect information. Suffer from the pocket shy, can't play GPs, skip directly. But the last section of this chapter took care of me a little bit, collecting information without a GPS. You can not collect data, to help others change the data is still possible. There are roughly two sites that need to be used:

http://downloads.cloudmade.com/http://walking-papers.org/. After seeing it, I found that I could not do it. People want you to print out, hand animation up. Forget it, I don't have the talent for that painting.

How OpenStreetMap Records geographical Features

OPENSTREETMAP has its own data model, which is different from the normal GIS data model.

OpenStreetMap ' s design goals goals

1. The easier the better.

Not by thinking of their first project, to be a resource management system of a mineral company, mainly to deal with the map. Since the completion of the module in advance, this time the self-abuse syndrome and entangled me. Nothing to do, do not have to follow the whole SSH in. After the whole SSH, and think the forum that block not dazzle, Tinker Tinker, and put FCKeditor rub in. After finishing, triumphantly, the code to a close. Then the teacher grabbed the past and asked, how the speed has become so slow ....
2. A wiki-style editing function.

3. Ability to record topology.

4. Maximum editing freedom for map editors, to be able to label what I want.

The data structures used data structure

Three basic data types: nodes,ways and relations.

Nodes

A node is a point in space that is uniquely used to identify the type of location information in the data type, and the other two depend on him. Take a look at the examples in the book:

<OSM version= "0.6" generator= "OpenStreetMap Server" >
<node id= "483034256" lat= "55.9458449" lon= " -3.2035477" version= "1"
changeset= "2369219" user= "Spytfyre" uid= "166957" visible= "true"
timestamp= "2009-09-04t13:35:42z" >
<tag k= "name" v= "the Blue Blazer"/>
<tag k= "amenity" v= "pub"/>
</node>
</osm>

Each node has at least two attributes of latitude and longitude. I was reminded of my first project, and I thought about the years when I talked to my teacher about how to add latitude and longitude fields to the Oracle database. Why people always forget the first time, no matter how miserable the result ...

lat= "55.9458449" lon= " -3.2035477" latitude latitude longitude longitude

<tag k= "amenity" v= "pub"/> Tag in the k,v attribute, I believe that Java can be guessed, that is key,value.

Ways

What is "road"? There is no road in the world, there are more people to go. The world has no road, stepping on the "point" more on the. Ways is a sorted set of node. A road must have at least two nodes. Let's also look at an example:

&LT;OSM version= "0.6" generator= "OpenStreetMap Server" >
<way id= "43157302" visible= "true" timestamp= "2009-10-26t10:45:09z"
version= "1" changeset= "2954960" user= "Ed Avis" uid= "31257" >
<nd ref= "540653724"/>
<nd ref= "25507043"/>
<nd ref= "107762"/>
<nd ref= "25507038"/>
<nd ref= "107759"/>
<tag k= "Highway" v= "primary"/>
<tag k= "Lcn_ref" v= "6a"/>
<tag k= "name" v= "Parliament Street"/>
</way>
</osm>

It seems quite simple, at least, than my first one, O (∩_∩) o~. The ref attribute tells you which "point" to take and is straightforward.

Relations

Relationship this thing is complicated. Can have nodes, there are ways, there are other relations, disorderly. In short, a bunch of basic data types and their combinations formed. To see a relationship:

<OSM version= "0.6" generator= "OpenStreetMap Server" >
<relation id= "113421" visible= "true" timestamp= "2009-11-03t10:08:27z"
version= "2" changeset= "3023369" user= "Jonathan Bennett" uid= "5352" >
<member type= "Node" ref= "270186" role= "via"/>
<member type= "" "ref=" 4418767 "role=" from "/>
<member type= "" "ref=" 4641665 "role=" to "/>
<tag k= "restriction" v= "No_right_turn"/>
<tag k= "type" v= "restriction"/>
</relation>
</osm>

Dizzy, this guy means, "Don't turn right." The book also says that this is the most immature data type of OPENSTREETMAP.

Changesets

In addition to the three basic data types, there are changesets such a little brother. As the name implies, it is used to denote change.

<OSM version= "0.6" generator= "OpenStreetMap Server" >
<changeset id= "1787116" user= "Jonathan Bennett" uid= "5352"
created_at= "2009-07-10t09:52:28z" closed_at= "2009-07-10t09:52:31z"
Open= "false" min_lon= " -4.4224237" min_lat= "56.1382502" max_lon= "-3.9613266"
max_lat= "56.6330162" >
<tag k= "created_by" v= "JOSM"/>
<tag k= "comment" v= "additions and edits to NCR7"/>
</changeset>
</osm>

As you can see, the change of information is not reflected here, you have to go to the database to the corresponding XML down before you know. The description and content are separate.

The tagging system

We have seen a lot of tag tag, tag why use it. Tag is a key-value pair used to tell you the real world situation. A key of course can only have a valuse, but I want to have a number of what to do. There are ways, guest tube please see:

&LT;OSM version= "0.6" generator= "OpenStreetMap Server" >
<node id= "107775" lat= "51.5072647" lon= " -0.1278328" version= "29"
changeset= "2628959" user= "Edinburghgael" uid= "170586" visible= "true"
timestamp= "2009-09-25t23:04:28z" >
<tag k= "Place" v= "City"/>
<tag k= "Name:zh" v= "London"/>
<tag k= "NAME:SV" v= "London"/>
<tag k= "Name:sk" v= "Londyn"/>
<tag k= "Name:ru" v= "Лондон"/>
<tag k= "Name:fi" v= "Lontoo"/>
<tag k= "Name:es" v= "Londres"/>
<tag k= "NAME:GV" v= "Lunnin"/>
<tag k= "Name:zh_pyt" v= "Lúndūn"/>
...
<tag k= "is_in" v= "England, Kingdom, UK, great Britain,europe"/>
<tag k= "capital" v= "yes"/>
<tag k= "Name:fr" v= "Londres"/>
<tag k= "Name:cy" v= "Llundain"/>
</node>
</osm>

In fact, add a prefix or suffix, is not a bit like the internationalization of Java.

"Any tags are like"

The main idea is that you can apply the tag arbitrarily, without restrictions. In fact, you can customize the tag, tell OpenStreetMap what the meaning of this tag is, what it means to represent. There is no limit, in fact, there is a limit , "Don ' t tag for the renderer." is not to move the original picture of the device.

This chapter concludes with a few URLs that describe the core tag and common third-party tools:

Http://wiki.openstreetmap.org/wiki/Map_Features http://osmdoc.com/en/tags/http://tagwatch.stoecker.eu/

Http://www.google.com/cse/home?cx=015487330990472192076:qvmeg3q9qus

After reading this chapter, I kinda miss my first project. "Ah ha, can I make him perfect again (⊙o⊙)?" ”。。。。。。

OpenStreetMap Map Data Introduction (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.