qedus / osmpbf

OpenStreetMap PBF file format parser in Go Lang.
MIT License
142 stars 30 forks source link

PBF Encoder #20

Open przmv opened 7 years ago

przmv commented 7 years ago

Is there any progress in PBF Encoder development? Or are there any hints/ideas on how it could be implemented? I need such functionality and I'd really like to help with development, but I need just some initial assistance to get started.

jongillham commented 7 years ago

I am not aware of anyone creating an encoder. The only people I assumed needed one were those that run openstreetmap.org. I would be interested to know your use case though.

On the whole we try to follow the same pattern as the Go standard library encoder/decoder pairs such as encoding/json. Therefore the API might look like this:

type Encoder struct { }

func NewEncoder(w io.Writer) *Encoder { }

func (e *Encoder) Encode(v interface{}) error { }

Where v can only be a Node, Relation or Way. However I am certain there are a few nuances about how these entities should be batched up.

przmv commented 7 years ago

I would be interested to know your use case though.

@jongillham Our use case is the following:

  1. Parse some PBF data
  2. Filter on some entries
  3. Obtain a PBF with filtered entries

So, we've implemented the first two points and now are investigating the ways to do the third as well.