NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I would like to create a piece of software (with VB preferably) which displays maps offline. So, it seems that the best solution is OpenStreetMap. But the question is : how to use a OSM bin file in a program, like Navit software does ? Do you know some tools (API, SDK, ...) which allow to include an OSM map in a piece of software ?

Is there a documeentation about the file structure of OSM files ?

Louis

asked 07 Nov '11, 17:54

louis10's gravatar image

louis10
30112
accept rate: 0%

edited 08 Nov '11, 09:51

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866

As I am totally new in maps, I don't fully understand all the comments. Here is that I understand.

I just would like to draw maps (without interest points, pubs, ...), only maps (with streets, roads, highways, rivers, maybe railways). Just in order to know where I am in a car. I don't want to deploy any software.

I understand that I can download OSM data files, so which file extension(s) ? There are a lot : 7z, bz2, ... If we download tile files without knowning it, are we aware of the licence problem when downloading ?

With your explanations, I still don't know if downloading Navit files is good or not. Same for .7z files.

NaviPOWM seems interesting but it doesn't work on Windows (missing file QtCore4.dll) and, moreover, the source code is not downloaded. I understand that this point is external to your site but how to get the code ?

Last question : why did somebody change "software" to "piece of software", and maybe other words ? What is the meaning ?

(08 Nov '11, 19:12) louis10

When you say "know where I am in a car" do you mean "so that I can see my current position superimposed on a picture of where I am" or "so that my software can work out how to get from where I am to somewhere else"?

That's the key question, but I'm guessing from what you've said above that you just want a picture of where you are, and so may be able to make do with tiles - with the caveat as mentioned previously that bulk downloading from the OSM site isn't an option.

(08 Nov '11, 20:23) SomeoneElse ♦

Not knowing exactly what you want to do and not being familar with Navit's binfile format (beyond Vclaw's link) I can't say whether that's ideal for your purposes or not - it may (if you just need what we refer to as "tiles") overcomplicate things.

(08 Nov '11, 20:35) SomeoneElse ♦

Finally - I plead guilty to changing "a software" to "a piece of software" in the question. That's because there's no such thing as "a software" in English (it's a funny language) - in the sentence "I work for a company that sells software" the word "software" is a singular noun that refers to multiple items, hence commonly used constructions such as "a piece of ..." to indicate just one.

(08 Nov '11, 20:36) SomeoneElse ♦

When I say "to know where I am in my car", I mean "just to see my current position on a map". Help for navigation to go somewhere else is not interesting for me, I prefer to ... improvise and search my way by myself ! But from a position ... And the main feature I'll forecast is the recording (in any simple text file) of a position (longitude+latitude) which I found interesting. I don't need other functions.

To do that, are tiles necessary ?

I forgot to mention that I also need street and city names in addition to roads and rivers.

(09 Nov '11, 18:20) louis10

I mentioned Navit because that's the 1st free "software" (or program !) that I found, with free maps proposed on the site http://maps7.navit-project.org (so, I did not wonder anything about policy), which works offline, and works on Windows and Windows Mobile. But it is not suitable for me because of the user interface.

As I found many free softwares, I supposed that creating a software is not too difficult ! Otherwise, they would be not free of charge.

(09 Nov '11, 18:31) louis10

As you suppose, English is not my usual language. But I did not think that "software" was not correct, or funny, or a familiar word. In information technology, we can see everywhere "software engineer", "software development", "software package", ... ! Do English and American people think or speak in the same way ? So "program" seems more suitable... In French, we say "logiciel" but it seems that "software" is now a french word ! Dictionaries include this word. But we are making a digression ... Generally not accepted in forums.

(09 Nov '11, 18:50) louis10

If you just want to see your location superimposed on a picture of where you are, then tiles may be the way to go. To get familiar with how these can be created from OSM data, and how different style rules can be used to create different-looking maps, I'd have a play with something such as Maperitive (http://maperitive.net/). You can also use that to generate tiles at whatever zoom level you like for your new offline map application, when you need them.

(09 Nov '11, 21:46) SomeoneElse ♦

So, if I'll use tiles files as you advise, I'll be "exposed" to the policy, isn't it ? Even if my application is installed only on my computer and my phone.

(10 Nov '11, 11:08) louis10

Generate your own tiles and you're not bound by OSM's tile usage policy because you're not using OSM tiles. You're bound by the terms described on http://www.openstreetmap.org/copyright , but that's pretty easy to do.

(10 Nov '11, 13:01) SomeoneElse ♦
showing 5 of 10 show 5 more comments

You'll find plenty of information in the wiki. The osm format is explained here. Follow the category links at the bottom of that page to get info on other formats, tools, libraries, etc.

Programming your own rendering from osm data can be a dauting task (altough very interesting), especially if you're rather new to programming (sorry for my bias, that's what the mention of VB triggers). Note that there are tons of existing software for all kinds of usages (again, see wiki). Maybe if you have an itch to scratch which isn't served by existing software, you'd be better off improving said software instead of starting from nothing ?

If on the other hand you're mainly interested by the fun of learning, then go ahead and dive in, start from scratch :) But be prepared to spend a lot of time in the wiki at first.

permanent link

answered 07 Nov '11, 18:36

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
17.3k18152249
accept rate: 19%

Thanks for the information.

The osm format is explained in the above link but what about the OSM bin file we can download from http://maps7.navit-project.org ?

And ... don't worry, even if I like to use VB, I'm not new in programming ! :) . That's my job. But I'm new in maps and GPS. Anyway, I have no much time, so I'll try to catch open sources.

(07 Nov '11, 18:58) louis10

I think that it's worth taking a step back and trying to expand on ChrisH's excellent comments about data and tiles.

What is behind OpenStreetMap (essentially what IS OpenStreetMap) is just lots and lots of data. Here's an example:

http://www.openstreetmap.org/browse/node/254949910

It's a pub (a very nice pub, actually). Click on the "download XML" link on that web page and you'll see the XML associated with it - what it is (a "node"), where it is, who last edited it and tags associated with it that in this case say "it's a pub".

Together with lots of other pieces of data that makes up OpenStreetMap. If you only want to work with part of it, it's often convenient to obtain extracts of it. For example, if I'm creating maps for my Garmin GPS I'll download data from here:

http://download.geofabrik.de/osm/europe/great_britain/

I'll then process the data using a program to create something that my Garmin GPS understands and load it onto my GPS. On there the pub appears both as an icon on a map (actually a vector map rather than just a simple picture) and as a searchable point of interest.

A slightly different process happens to create main Mapnik map on the OSM site here:

http://www.openstreetmap.org/?lat=53.27722&lon=-1.72995&zoom=18&layers=M

In this case some other software runs behind the scenes and creates a picture from the data (a "tile"):

http://a.tile.openstreetmap.org/18/129812/85057.png

That is just an image - the only thing that communicates "pub" is the picture of the beer glass on it. It's no use for routing, and would be no use to an application that wanted to find the nearest pub. Also, this is just one of many different renderings of the data - on the main OSM site there are 4 (click the + at the top-right of the map); on other sites there are many more.

Depending on what you want to be able to do in your application, it might be appropriate to handle data internally as just data, or (if you only want to display pictures) as tiles.

If you do only want to display tiles, you won't be able to download them in bulk from OSM - see the tile usage policy for details as to why and what your alternatives are.

However, if you want to be able to something with the map other than just look at the picture, you'll probably want to download data, store it in a manner that's appropriate for your application, and render it in a manner that's also appropriate.

It's possible that other people may have already solved some of the problems that you'll need to solve to get your application working (and Navit might be one example of that) but first you'll need to define what you want to be able to do with your application, and that will define what data you need to store on whatever is going to run your application, and so on.

permanent link

answered 08 Nov '11, 11:56

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Displaying maps offline sounds like you intend to download tiles into a cache for later use. Please be aware that we have a policy that restricts that on OSM tiles. http://wiki.openstreetmap.org/wiki/Tile_usage_policy There are other sources of tiles, including commercial ones. You can also create your own tiles by downloading the OSM data (not the tiles) and rendering your own tiles.

permanent link

answered 07 Nov '11, 18:06

ChrisH's gravatar image

ChrisH
4.1k134262
accept rate: 15%

1

Rather sounds to me like he wants to do his own rendering from an *.osm file, not download tiles.

(07 Nov '11, 18:24) Vincent de P... ♦

I downloaded 2 files from http://maps7.navit-project.org (respectively 1 Mb and 208 Mb) in order to know if Navit software works (the first free software that I found). So, if I'll be able to render maps in my software (that seems diffcult at present because of the documentation), I'll download probably one map for France, and 1 or 2 close countries, just once and maybe one update per year. I suppose that it is authorized ! Please confirm.

For example, the small file is named osm_bbox_11.3,47.9,11.7,48.2.bin. Is it a tile file or a data file ?

Louis

(07 Nov '11, 18:42) louis10
1

Vincent, I wanted Louis to understand the issue from the beginning. It's good you pointed him to the data, but many developers see a map and the tiles as what OSM is about, when OSMers know that the data is the real prize. There are too many apps (esp. mobile apps) that cache OSM tiles and cause OSM a lot of problems, so it is good Louis asked first and that he understands to use the data not the tiles. His question sounded like a newbie so tile usage is a good thing to understand, not least to save him wasting his time.

(07 Nov '11, 19:01) ChrisH

Could you explain your reply ? Downloading the bin files from http://maps7.navit-project.org is bad or good ? I don't know the difference between tiles and data...

(07 Nov '11, 19:07) louis10
2

I don't know about Navit - that is an app that uses the OSM data in its own format and not native OSM data. It seems their .BIN file is specialised to their app. You would have to ask them about their format. Native OSM data is available as XML. The moving map images you see on the osm.org website are made of tiles. Using OSM tiles have a usage limit, as above, but you can use the OSM data (XML) with with no usage limit. You can get downloads that cover a country from geofabrik [1] or cloudmade [2] websites.

[1] http://download.geofabrik.de/osm/ [2] http://downloads.cloudmade.com/

(07 Nov '11, 19:34) ChrisH

There is some documentation about the Navit binfile format here: http://wiki.navit-project.org/index.php/Navit%27s_binary_map_driver

(07 Nov '11, 20:24) Vclaw

... you can also have a look at NaviPOWM (search in the wiki!) ... this opensource program also uses an own vector map format to display OSM data on PC or WinMobile.

(08 Nov '11, 17:01) stephan75
showing 5 of 7 show 2 more comments

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×113
×59
×31
×5

question asked: 07 Nov '11, 17:54

question was seen: 17,281 times

last updated: 10 Nov '11, 13:01

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum