From 282bb229f502985f68e1c7f3552b264db4193a7d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Fri, 3 Jun 2011 12:05:44 +0200 Subject: [PATCH] New osmpbf.h and new debian package. * New osmpbf.h makes including easier and defines some often used constants * README now explains how to use the lib * New version of debian package includes * osmpbf.h * osmpbf-outline tool * README --- README | 7 +++++++ debian/changelog | 8 ++++++++ debian/docs | 1 + debian/rules | 3 +++ src/Makefile | 2 +- src/osmpbf.h | 15 +++++++++++---- tools/Makefile | 7 +++---- 7 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README b/README index f09e399..d579913 100644 --- a/README +++ b/README @@ -4,6 +4,13 @@ OSM PBF See http://wiki.openstreetmap.org/wiki/PBF_Format . +To include in your program use: + +#include + +and link with: + -lpthread -lz -lprotobuf-lite -losmpbf + To build the Debian/Ubuntu package call: debuild -I -us -uc diff --git a/debian/changelog b/debian/changelog index 7599db6..c4bf50b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libosmpbf-dev (1.1.1j1) maverick; urgency=low + + * Add support for OSM history file + * Add some often used constants to OSMPBF namespace + * Add osmpbf-outline testing tool + + -- Jochen Topf Fri, 3 Jun 2011 11:36:17 +0100 + libosmpbf-dev (0.1) maverick; urgency=low * Initial debian package diff --git a/debian/docs b/debian/docs index fe686d9..fb7cedf 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1,3 @@ src/fileformat.proto src/osmformat.proto +README diff --git a/debian/rules b/debian/rules index 72cb333..093785a 100755 --- a/debian/rules +++ b/debian/rules @@ -24,6 +24,7 @@ build-stamp: configure-stamp # Add here commands to compile the package. $(MAKE) -C src + $(MAKE) -C tools touch $@ @@ -34,6 +35,7 @@ clean: # Add here commands to clean up after the build process. $(MAKE) -C src clean || /bin/true + $(MAKE) -C tools clean || /bin/true dh_clean @@ -45,6 +47,7 @@ install: build # Add here commands to install the package into debian/libosmpbf-dev. $(MAKE) -C src DESTDIR=$(CURDIR)/debian/libosmpbf-dev install + $(MAKE) -C tools DESTDIR=$(CURDIR)/debian/libosmpbf-dev install # Build architecture-independent files here. diff --git a/src/Makefile b/src/Makefile index efd938a..37382b2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,7 +18,7 @@ install: install -m 755 -g root -o root -d $(DESTDIR)/usr/lib install -m 644 -g root -o root libosmpbf.a $(DESTDIR)/usr/lib install -m 755 -g root -o root -d $(DESTDIR)/usr/include/osmpbf - install -m 644 -g root -o root fileformat.pb.h osmformat.pb.h $(DESTDIR)/usr/include/osmpbf + install -m 644 -g root -o root osmpbf.h fileformat.pb.h osmformat.pb.h $(DESTDIR)/usr/include/osmpbf clean: rm -f *.pb.h *.pb.cc *.pb.o libosmpbf.a diff --git a/src/osmpbf.h b/src/osmpbf.h index 6bff1a8..ce6a7b1 100644 --- a/src/osmpbf.h +++ b/src/osmpbf.h @@ -7,13 +7,20 @@ // this describes the high-level OSM objects #include -namespace osmpbf { +namespace OSMPBF { + + // library version + const char *version = "1.1.1j1"; // the maximum size of a blob header in bytes - const int max_blob_header_size = 64 * 1024; + const int max_blob_header_size = 64 * 1024; // 64 kB - // the maximum size of a blob in bytes - const int max_uncompressed_blob_size = 32 * 1024 * 1024; + // the maximum size of an uncompressed blob in bytes + const int max_uncompressed_blob_size = 32 * 1024 * 1024; // 32 MB + + // resolution for longitude/latitude used for conversion + // between representation as double and as int + const int lonlat_resolution = 1000 * 1000 * 1000; } diff --git a/tools/Makefile b/tools/Makefile index 771ef9c..9598dcf 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,17 +1,16 @@ CXX = g++ CXXFLAGS = -O3 -LDFLAGS = -lpthread -LIB_PROTOBUF = -lz -lprotobuf-lite -losmpbf +LDFLAGS = -lpthread -lz -lprotobuf-lite -losmpbf all: osmpbf-outline osmpbf-outline: osmpbf-outline.cpp - $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIB_PROTOBUF) + $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) install: install -m 755 -g root -o root -d $(DESTDIR)/usr/bin - install -m 644 -g root -o root osmpbf-outline $(DESTDIR)/usr/bin + install -m 644 -g root -o root -s osmpbf-outline $(DESTDIR)/usr/bin clean: rm -f osmpbf-outline