[OSM-dev] Progress information

Rainer Schlönvoigt rainer.schloeni at gmail.com
Mon Mar 2 19:51:10 UTC 2015


Thanks for the quick reply :)

That’s too bad, but it makes sense.
The only thing I could think of is, if the header of a file would also include the total number of nodes, ways, etc…
That would at least allow some rough estimates.

Greetings
Rainer 

> On 02.03.2015, at 20:45, Jochen Topf <jochen at remote.org> wrote:
> 
> Hi!
> 
> I have thought about how Osmium could supply that information, but it is rather
> difficult due to the way the reader works with several threads etc. And even if
> I implemented some way of accessing the byte count the best you'll get is an
> estimate how far you are in the file, because the number of bytes read is a
> poor predictor for the number of objects read. There are huge differences
> between, say, a simple node without any tags, and a long way or complex
> relation. And it will not work at all when reading from stdin or a pipe. So
> I am not sure it is worth the effort.
> 
> The best option you currently have is checking the file size, use some estimate
> for bytes-per-object to estimate the number of objects that are probably in the
> file and counting the objects being read yourself. And yes, thats ugly.
> 
> Ideas and opinions welcome.
> 
> Jochen
> 
> On Mo, Mär 02, 2015 at 07:39:51 +0100, Rainer Schlönvoigt wrote:
>> Date: Mon, 2 Mar 2015 19:39:51 +0100
>> From: Rainer Schlönvoigt <rainer.schloeni at gmail.com>
>> To: Paul Mahon <pmahon at decarta.com>
>> Cc: dev at openstreetmap.org
>> Subject: Re: [OSM-dev] Progress information
>> 
>> I forgot to add that I am using Osmium.
>> 
>> The issue is that I don’t have access to exactly that information.
>> The reader does not provide it and a buffers size is also not representative since the internal data representation is not the same as in the files…
>> 
>> Greetings
>> Rainer
>> 
>>> On 01.03.2015, at 19:51, Paul Mahon <pmahon at decarta.com> wrote:
>>> 
>>> Couldn't you just count the number of bytes read and compare it to the number of bytes in the file?
>>> 
>>> On 15-03-01 08:24 AM, Rainer Schlönvoigt wrote:
>>>> While iterating through an OSM file, is there a way to find out how much of the information has already been iterated through?
>>>> 
>>>> When going through a planet file, it would be very helpful in order to show something to a user.
>>>> 
>>>> Greetings
>>>> Rainer
>>>> _______________________________________________
>>>> dev mailing list
>>>> dev at openstreetmap.org
>>>> https://lists.openstreetmap.org/listinfo/dev
>>> 
>>> 
>>> _______________________________________________
>>> dev mailing list
>>> dev at openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/dev
>> 
>> 
>> _______________________________________________
>> dev mailing list
>> dev at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/dev
> 
> -- 
> Jochen Topf  jochen at remote.org  http://www.jochentopf.com/  +49-173-7019282




More information about the dev mailing list