Skip to content

Commit

Permalink
Merge pull request #1 from knowname/master
Browse files Browse the repository at this point in the history
Updates most tools to libosmium 2.9
  • Loading branch information
woodpeck authored Sep 19, 2016
2 parents bb2b8b3 + aa00a35 commit 891ec98
Show file tree
Hide file tree
Showing 11 changed files with 540 additions and 1,004 deletions.
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Binaries
osmstats
count_addresses
osmgrep
*.osm
*.pbf


# Compiled Object files
*.slo
*.lo
Expand All @@ -11,3 +19,60 @@
*.lai
*.la
*.a


# Created by https://www.gitignore.io/api/eclipse

### Eclipse ###

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

40 changes: 10 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
CXX = g++
#CXX = clang++

#CXXFLAGS = -g
CXXFLAGS = -O3
#CXXFLAGS += -g
CXXFLAGS += -O3

CXXFLAGS += -Wall -Wextra -Wdisabled-optimization -pedantic -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wno-long-long

CXXFLAGS += -std=c++11

CXXFLAGS_GEOS = $(shell geos-config --cflags)
CXXFLAGS_LIBXML2 = $(shell xml2-config --cflags)
CXXFLAGS_OGR = $(shell gdal-config --cflags)
Expand All @@ -26,54 +28,32 @@ LIB_EXPAT = -lexpat
LIB_GD = -lgd -lz -lm
LIB_GEOS = $(shell geos-config --libs)
LIB_OGR = $(shell gdal-config --libs)
LIB_PBF = -lz -lpthread -lprotobuf-lite -losmpbf
LIB_PBF = -lz -lpthread #-lprotobuf-lite -losmpbf
LIB_SHAPE = -lshp $(LIB_GEOS)
LIB_SQLITE = -lsqlite3
LIB_XML2 = $(shell xml2-config --libs)
LIB_BZ2 = -lbz2

LDFLAGS = $(LIB_EXPAT) $(LIB_PBF)

PROGRAMS = \
noderef \
count_addresses \
count \
osmgrep \
grep-user-from-history \
history-cleartext \
add_timestamp \
osmstats \
lastnode
osmstats

.PHONY: all clean

all: $(PROGRAMS)

count_addresses: count_addresses.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

noderef: noderef.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

count: count.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIB_BZ2)

osmgrep: osmgrep.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

grep-user-from-history: grep-user-from-history.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

history-cleartext: history-cleartext.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

add_timestamp: add_timestamp.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIB_BZ2)

osmstats: osmstats.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2) $(LIB_GEOS)
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIB_BZ2) $(LIB_GEOS)

lastnode: lastnode.cpp
$(CXX) $(CXXFLAGS) $(CXXFLAGS_LIBXML2) -o $@ $< $(LDFLAGS) $(LIB_XML2)

clean:
rm -f *.o core $(PROGRAMS)
Expand Down
9 changes: 0 additions & 9 deletions README

This file was deleted.

30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# A collection of osmium-based utilities for doing things with OSM data files.


## Note:

The osmcode/osmtool repo has a command line utility that can be used to replace some of these programs:

* As a lastnode.cpp replacement, use `osmium fileinfo x.osm.pbf -eg data.maxid.nodes`.
For more information call `osmium help fileinfo`.

## Updated
* osmgrep.cpp
* osmstats.cpp
* count_addresses.cpp


## Replacements

### count.cpp

$ osmium fileinfo -e karlsruhe-regbez.osm.pbf | grep Number | grep -v changesets
Number of nodes: 8291451
Number of ways: 1424970
Number of relations: 26632

---
### Dropped

* noderef.cpp
* add_timestamp.cpp
103 changes: 0 additions & 103 deletions add_timestamp.cpp

This file was deleted.

82 changes: 0 additions & 82 deletions count.cpp

This file was deleted.

Loading

0 comments on commit 891ec98

Please sign in to comment.