This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Parse PBF files as text

-1

May I ask how to parse PBF files as text. I need to upload it through a HTTP requester using PUT command. However, it only supports plain text body, without any file format support. Thanks

asked 07 Dec '16, 16:24

Wetitpig0's gravatar image

Wetitpig0
307161928
accept rate: 10%

1

Can you explain what you are trying to do in a few more words? Why do you need to upload a plain text file?

(08 Dec '16, 08:29) scai ♦

2 Answers:

2

You could try to upload a base64 encoded PBF file.

answered 07 Dec '16, 18:21

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

How! How can a plain text request upload a file in Ubuntu?

(07 Dec '16, 23:27) Wetitpig0
1

On Ubuntu use base64, it is located in the coreutils package and already preinstalled.

To transform any file into a base64 encoded ASCII file run base64 origFile > asciiFile. To transform it from ASCII back into the original format run base64 -d asciiFile > origFile. Note that a base64 encoded file will be around 33% larger.

(08 Dec '16, 08:28) scai ♦

1

The first web search result after the adverts is this. Does that help?

answered 07 Dec '16, 16:30

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 07 Dec '16, 16:31

No, it suggests parsing into an OSM XML file, but that would be too large for my computer.

(07 Dec '16, 23:27) Wetitpig0

Source code available on GitHub .