Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change methods calls

Change the methods calls because the Osmium API differs from the origin
development times.
  • Loading branch information...
commit a96b8f6e943bdf59f8eb7ea9cdc76d1a8bf50f94 1 parent 58e68c5
@yageek yageek authored
Showing with 12 additions and 10 deletions.
  1. +1 −1  Makefile
  2. +3 −3 osm/handler.cc
  3. +8 −6 osm2shp.cc
View
2  Makefile
@@ -16,7 +16,7 @@ FILES = \
osm/point_database.o
osm2shp: $(FILES)
- $(CPP) $(CXXFLAGS) $+ -lexpat -lsqlite3 -lshp -lboost_iostreams $(LIB_PROTOBUF) $(LIB_SHAPE) -o $@
+ $(CPP) $(CXXFLAGS) $+ -lexpat -lsqlite3 -lshp $(LIB_PROTOBUF) $(LIB_SHAPE) -o $@
%.o: %.cc
$(CPP) $(CXXFLAGS) -c $< -o $@
View
6 osm/handler.cc
@@ -12,13 +12,13 @@ namespace osm {
template<typename T, class K>
inline bool has_key(const T& map, const K& key) {
- const char *v = map.get_tag_by_key(key);
+ const char *v = map.get_value_by_key(key);
return v;
}
template<typename T, class K, class V>
inline bool has_key_value(const T& map, const K& key, const V& value) {
- const char *v = map.get_tag_by_key(key);
+ const char *v = map.get_value_by_key(key);
return v && !strcmp(v, value);
}
@@ -88,7 +88,7 @@ void handler::node(const shared_ptr<Osmium::OSM::Node const>& node) {
tmp_nodes_.set(id_, x_, y_);
- const char* name = node->tags().get_tag_by_key("name");
+ const char* name = node->tags().get_value_by_key("name");
if (!name)
return;
View
14 osm2shp.cc
@@ -1,6 +1,11 @@
-#include "osm/handler.hpp"
+#define OSMIUM_WITH_PBF_INPUT
+#define OSMIUM_WITH_XML_INPUT
+
#include <osmium.hpp>
+#include <osmium/input.hpp>
+
+#include "osm/handler.hpp"
int main(int argc, char* argv[]) {
try {
@@ -8,12 +13,9 @@ int main(int argc, char* argv[]) {
std::cerr << "usage: " << argv[0] << " planet.osm(.gz|.bz2) base-path" << std::endl;
return 1;
}
-
- Osmium::init(true);
-
- Osmium::OSMFile infile(argv[1]);
+ Osmium::OSMFile infile(argv[1]);
osm::handler handler(argv[2]);
- infile.read(handler);
+ Osmium::Input::read(infile, handler);
return 0;
} catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
Please sign in to comment.
Something went wrong with that request. Please try again.