Closed rrrnld closed 3 years ago
Hi,
the missing class de.topobyte.osm4j.pbf.protobuf.Fileformat$BlobHeader
should be contained in the dependency that you are already including in your project via de.topobyte/osm4j-pbf {:mvn/version "1.2.0"}
No idea if it has anything to do with NixOS. Did it work with a different OS? I'd like to take a look myself, but I don't know how to set up a Closure project. If you provide a minimal Closure project that tries to read a PBF file, I'm happy to take a look.
Thanks for the quick reply. :)
I tried producing a minimal example:
deps.edn
in project root:
{:deps
{de.topobyte/osm4j-pbf {:mvn/version "1.2.0"}}
:mvn/repos
{"central" {:url "https://repo1.maven.org/maven2/"}
"clojars" {:url "https://clojars.org/repo"}
"topobyte" {:url "http://mvn.topobyte.de"}
"slimjars" {:url "http://mvn.slimjars.com"}}}
example.clj
in the src
folder:
(ns example
(:import [de.topobyte.osm4j.pbf.seq PbfIterator])
(:require [clojure.java.io :as io]))
(-> (io/input-stream "resources/bremen-latest.osm.pbf")
(PbfIterator. false)
(iterator-seq)
(count))
(You can also stat a repl via clj
and paste the contents of the file to try it out interactively.)
Interestingly that didn't break. Being too lazy to bisect the problem for now and following your comment I changed the osm4j-pbf
dependency in the problematic project to de.topobyte/osm4j-pbf-full-runtime {:mvn/version "1.2.0"}
and I can say that this fixed the problem. :)
This soliution works well enough for me, I don't know if you see a reason to dig deeper. If not I think this issue can be closed.
OK, good to hear that it's working with the full runtime. There are two versions of the pbf library, one using the lite runtime of protocol buffer and the other using the full / main runtime of protocol buffers. Maybe the lite runtime isn't working well with Clojure.
Thanks anyways for the minimal example!
Hi and first of all thanks for the library. :)
I'm trying to use it from Clojure (not sure if this is relevant) and I have some issues using the
PbfIterator
. I can construct the object, but iterating it fails:My dependencies are as follows:
This is the error message:
To make things more complicated I recently switched to using
NixOS
, so it might very well be that my setup is so unusual that you say you can't support it.Do you have any idea however how I could debug this? I have no idea how the protocolbuffers bindings are generated or how they work. From what I've read the compiler generates java bindings, so why are there missing classes? Do I need some global packages for this?
I'd be very happy if this could somehow be made to work. Thanks in advance!