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 <[email protected]>
> To: Paul Mahon <[email protected]>
> Cc: [email protected]
> 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 <[email protected]> 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
> >> [email protected]
> >> https://lists.openstreetmap.org/listinfo/dev
> > 
> > 
> > _______________________________________________
> > dev mailing list
> > [email protected]
> > https://lists.openstreetmap.org/listinfo/dev
> 
> 
> _______________________________________________
> dev mailing list
> [email protected]
> https://lists.openstreetmap.org/listinfo/dev

-- 
Jochen Topf  [email protected]  http://www.jochentopf.com/  +49-173-7019282

_______________________________________________
dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/dev

Reply via email to