You are not logged in.

#1 2010-06-10 14:41:39

marsteegh
Member
Registered: 2010-06-10
Posts: 3

announcement: osmbrowser

What is it?
  An application to display/browse largish osm files (for example a complete european country)

How finished is it
In very early alpha stage: it can display maps and save them to pdf. it can filter what is draw using easy to write rules.

Where to get it:
  http://wiki.github.com/wziard/osmbrowser/

runs on:
it is built using wxwidgets and cairo, which are both cross platform, so it should be buildable anywhere these two work (cairo is sortof optional, you can make do with only wx, though that's slow and ugly). I work on ubuntu (.10 and 10.04) myself though, so I haven't tested anything else.
Needs wxwidgets > 2.8 and cairo 1.2 or greater.


This is a project to scratch a personal itch. I was looking for an application to easily filter out specific features from an osm map to draw for example railroad maps, or river maps, or just the motorways etc etc., but couldn't really find anything useful which worked on linux. I decided to put it up on github since it might be useful for others as well.

Offline

#2 2010-06-10 15:09:58

pberck
Member
Registered: 2008-09-16
Posts: 111

Re: announcement: osmbrowser

It sounds cool!

I quickly tried to compile it on my mac, I had to remove the -Wno-unused-result from the compiler options to get it to compile.

Then it fails with

ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file

but that probably depends on my Mac. I will try it on Linux tonight when I get home!

-peter

Last edited by pberck (2010-06-10 15:24:42)

Offline

#3 2010-06-10 18:36:54

stephan75
Member
Registered: 2008-05-28
Posts: 2,805

Re: announcement: osmbrowser

@marsteegh:

Is the current version of osmbrowser stabel enough to create a page in the OSM wiki? So more people get to know of your application an can add suggestions and opinions.

And you can add screenshots there ...

Offline

#4 2010-06-10 21:03:09

pberck
Member
Registered: 2008-09-16
Posts: 111

Re: announcement: osmbrowser

Ok,

I think I got it to work, but I had to make some changes.

I removed both the -Wno-unused-result and the -Werror flags from the compiler options, otherwise it got stuck on:

parse.cpp: In function ‘void ReadNode(OsmData*, FILE*)’:
parse.cpp:225: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result

Now it compiles and I did

./osmbrowser thuis.osm.

It gives me a window with a black and white map, I can zoom with the mousewheel, click on lines. Selecting "Print" gives me a out.pdf with the same black and white map.

Machine info: uname -a
Linux margretetorp 2.6.31-gentoo-r6 #1 SMP Mon Jan 18 14:43:24 CET 2010 x86_64 Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz GenuineIntel GNU/Linux

gcc version 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5)

-peter

Offline

#5 2010-06-10 22:36:01

martijnv
Member
Registered: 2010-06-10
Posts: 4

Re: announcement: osmbrowser

stephan75 wrote:

Is the current version of osmbrowser stabel enough to create a page in the OSM wiki? So more people get to know of your application an can add suggestions and opinions.

Not yet really, no. Well, it's quite stable bbut not yet very useful (except for tinkering)


ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file

I don't really know what this means (I'm not an OSX expert), but I do know I didn't yet test a 64 bit compile ;-)

pberck wrote:

Ok,

I think I got it to work, but I had to make some changes.

I removed both the -Wno-unused-result and the -Werror flags from the compiler options, otherwise it got stuck on:

parse.cpp: In function ‘void ReadNode(OsmData*, FILE*)’:
parse.cpp:225: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result

very strange... -Wno-unused-result disables that particular warning. Maybe I have a different gcc version? (4.4.1 here)

It gives me a window with a black and white map, I can zoom with the mousewheel, click on lines. Selecting "Print" gives me a out.pdf with the same black and white map.

There is a bit more (though not much)

You can filter what is drawn and give elements colors by typing a filter in the top left box. The filter syntax is explained in  the readme.txt (which I probvably pushed to github after you cloned your copy)

I'll paste the relevant part of the readme at the bottom of this post.

Thanks for the feedback, I'll try to fix that one warning.

documentation follows:


interface explanation
------------------------
In the center is the main map display. Dragging the mouse pans the map, the scrollwheel zooms.
The light read square is the currenly selected osm node. It's info is displayed on the right. If you click on the selected nod the selection is
'locked' and won't follow your mouse, you can then click on the info on the right to select a way on the map. Clicking on the map again unlocks the selection.


On the left is the filter display. The first box is for the draw rule, which determines what is going to be drawn. Below that you can add color rules which
determine the color of what is drawn. Each way is first matched against the drawrule. If this matches then it is matched to the color rules from top to bottom
and the first match is used to determine how to draw this way. If no colorrule matches it is drawn in light gray.

rules
------------------------
A rule is a logical expression written down as a lisp s-expression.

RULE =
        (tag "key") // true if the object matched has a tag with this key
        | (tag "key" "value") // true if the object matched has this exact tag
        | (or SUBRULES) // true if any of the SUBRULES is true
        | (and SUBRULES) // true if all SUBRULES are true
        | (not RULE) // true if RULE is false and vv

SUBRULE = RULE ... // one or more rules

examples:

match all naturals, waterways and boundaries

(or
  (tag "natural")
  (tag "boundary")
  (tag "waterway")
)

match everything but buildings and landuse

(not
    (or
        (tag "building")
        (tag "landuse")
    )
)


match only forests and parks

(or
    (tag "landuse" "forest")
    (tag "landuse" "woodland")
    (tag "leisure" "park")
)

Offline

#6 2010-06-11 07:24:08

pberck
Member
Registered: 2008-09-16
Posts: 111

Re: announcement: osmbrowser

martijnv wrote:

very strange... -Wno-unused-result disables that particular warning. Maybe I have a different gcc version? (4.4.1 here)

It gives me a window with a black and white map, I can zoom with the mousewheel, click on lines. Selecting "Print" gives me a out.pdf with the same black and white map.

There is a bit more (though not much)

You can filter what is drawn and give elements colors by typing a filter in the top left box. The filter syntax is explained in  the readme.txt (which I probvably pushed to github after you cloned your copy)

I'll paste the relevant part of the readme at the bottom of this post.

Thanks for the feedback, I'll try to fix that one warning.

(snip)

Ok, thanks! I played a bit more, and can get different colours on different kind of keyword-values in the data with the Lisp expressions (happens to be my favourite programming language, long time ago I used it though).

What kind of additions do you have planned? It would be nice to be able to load and save a bunch of expressions :-)

-peter

Offline

#7 2010-06-11 08:04:48

martijnv
Member
Registered: 2010-06-10
Posts: 4

Re: announcement: osmbrowser

pberck wrote:

What kind of additions do you have planned? It would be nice to be able to load and save a bunch of expressions :-)
-peter

Yes saving the expressions would be nice. You can sortof save them now by the way. If you type a name in the dropdown box at the top-left and press enter the current set of expressions is remembered under that name and can be picked again from the drop down. But it's not very intuitive.

plans:

-spicing up the map display a bit (wide roads, line styles etc, draw names and icons-)
-saving the current view back to osm format.


anti-plans:
- there will be no editing features as far as I'm concerned, there are way better programs for that (merkaartor,josm, potlatch)

The main goal for me is the ability to browse large maps and quickly filter stuff

Offline

#8 2010-06-12 08:08:44

pberck
Member
Registered: 2008-09-16
Posts: 111

Re: announcement: osmbrowser

martijnv wrote:

Yes saving the expressions would be nice. You can sortof save them now by the way. If you type a name in the dropdown box at the top-left and press enter the current set of expressions is remembered under that name and can be picked again from the drop down. But it's not very intuitive.

Yeah, that works,

martijnv wrote:

plans:

-spicing up the map display a bit (wide roads, line styles etc, draw names and icons-)
-saving the current view back to osm format.

anti-plans:
- there will be no editing features as far as I'm concerned, there are way better programs for that (merkaartor,josm, potlatch)

The main goal for me is the ability to browse large maps and quickly filter stuff

Spicing up the map would be nice. Make it so it can read mapnik stylesheets and you have an interactive mapmaker smile

By "saving the current view to osm" do you mean the filtered view?

-peter

Offline

#9 2010-06-14 22:07:26

martijnv
Member
Registered: 2010-06-10
Posts: 4

Re: announcement: osmbrowser

pberck wrote:

Spicing up the map would be nice. Make it so it can read mapnik stylesheets and you have an interactive mapmaker smile

Would be nice indeed ;-) I haven't read into the mapnik stylesheets at all yet, so I have no Idea how much work that would be. It would probably be better to just use mapnik as the drawing backend
then.

By "saving the current view to osm" do you mean the filtered view?

Yes, and maybe with cropping. So you have a more lightweight osm file for further processing with other tools.

Offline

#10 2012-10-20 21:54:35

marsteegh
Member
Registered: 2010-06-10
Posts: 3

Re: announcement: osmbrowser

Just a small post to let people know this project is not (completely) dead ;-). new since the last time I posted:

- compiles/runs in 64 bit now (if it still runs in 32 bit remains to be seen ;-) )
- understands polygonal relations/multipolygons

Other features are still in the wishlist, though I'm working on it.

Offline

Board footer

Powered by FluxBB