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
This commit is contained in:
Jochen Topf 2011-06-03 12:05:44 +02:00
parent b3586a7b19
commit 282bb229f5
7 changed files with 34 additions and 9 deletions

7
README
View File

@ -4,6 +4,13 @@ OSM PBF
See http://wiki.openstreetmap.org/wiki/PBF_Format .
To include in your program use:
#include <osmpbf/osmpbf.h>
and link with:
-lpthread -lz -lprotobuf-lite -losmpbf
To build the Debian/Ubuntu package call:
debuild -I -us -uc

8
debian/changelog vendored
View File

@ -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 <jochen@topf.org> Fri, 3 Jun 2011 11:36:17 +0100
libosmpbf-dev (0.1) maverick; urgency=low
* Initial debian package

1
debian/docs vendored
View File

@ -1,2 +1,3 @@
src/fileformat.proto
src/osmformat.proto
README

3
debian/rules vendored
View File

@ -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.

View File

@ -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

View File

@ -7,13 +7,20 @@
// this describes the high-level OSM objects
#include <osmpbf/osmformat.pb.h>
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;
}

View File

@ -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