<div dir="ltr"><div><div><div>Se possível, e principalmente se já estiver feito, com certeza é melhor pular a lida com CSV e ir direto a um PostgreSQL. Começando que a "atualização" periódica do dados ficaria facilitada. E o principal: o banco já pode (e deverá) estar normalizado.<br>



<br></div>Se aquela ferramenta do osm-history-renderer que entrega um PostgreSQL não lhe der um banco útil, você pode usar osmium e criar a sua própria, imitando-a. Modele bem o seu esquema relacional.<br><br></div>A ideia do unipt-stats não exclui nada do que estamos falando aqui. Só que inicialmente o caso de testes dele é aqueles CSV (o que inclui a problemática da importação útil deles). Ele fica uma camada acima. Provendo um modo organizado (design) para utilizar em Python uma base de dados tal como esse banco PostgreSQL que o osm-history-renderer entrega.<br>



<br></div>Alexandre Magno<br><div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">Em 9 de abril de 2014 13:58, Lucas Ferreira Mation <span dir="ltr"><<a href="mailto:lucasmation@gmail.com" target="_blank">lucasmation@gmail.com</a>></span> escreveu:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">ops, repetindo:<div><br></div><div>transcrevo mais dicas do Piter:<div><br></div><div>



<div style="font-family:arial,sans-serif;font-size:13.3333px">> Then I intend to use: OSMIUM or Osmconvert<br>
</div><span style="font-family:arial,sans-serif;font-size:13.3333px">I don't think osmconvert can process history files. osmosis can't</span><br style="font-family:arial,sans-serif;font-size:13.3333px">
<span style="font-family:arial,sans-serif;font-size:13.3333px">either. osmium is a library that can do this but you'll have to write a</span><br style="font-family:arial,sans-serif;font-size:13.3333px">
<span style="font-family:arial,sans-serif;font-size:13.3333px">program agains this lib which does what ever you want.</span><br style="font-family:arial,sans-serif;font-size:13.3333px"><div style="font-family:arial,sans-serif;font-size:13.3333px">




<br>> now in need to do some homework to find out what do do after that.<br>> What format to convert the data into? and how that would work?<br>> I'm thinking I'll need to create a CSV with all the points that<br>




> existed in a given period. And repeat the processo for every 6months<br>> or so. And take note of the number of lines in each CSV. Or maybe<br>> query the history file directly for the number of nodes in each<br>




> period.<br></div><span style="font-family:arial,sans-serif;font-size:13.3333px">You may take a look at</span><br style="font-family:arial,sans-serif;font-size:13.3333px"><span style="font-family:arial,sans-serif;font-size:13.3333px"><</span><a href="https://github.com/MaZderMind/osm-history-renderer/blob/master/TUTORIAL.md" style="font-family:arial,sans-serif;font-size:13.3333px" target="_blank">https://github.com/MaZderMind/osm-history-renderer/blob/master/TUTORIAL.md</a><span style="font-family:arial,sans-serif;font-size:13.3333px">></span><br style="font-family:arial,sans-serif;font-size:13.3333px">




<br style="font-family:arial,sans-serif;font-size:13.3333px"><span style="font-family:arial,sans-serif;font-size:13.3333px">Its one of the tools I use to process history files. I't'll give you a</span><br style="font-family:arial,sans-serif;font-size:13.3333px">




<span style="font-family:arial,sans-serif;font-size:13.3333px">postgres -database which you can query to give you numbers for a given</span><br style="font-family:arial,sans-serif;font-size:13.3333px">
<span style="font-family:arial,sans-serif;font-size:13.3333px">point in time.</span><br style="font-family:arial,sans-serif;font-size:13.3333px"><div style="font-family:arial,sans-serif;font-size:13.3333px">
<br>> I suppose a more interesting ,but also more complicated thing, would<br>> be to calculate the ways lenght of all ways in a given period<br></div><span style="font-family:arial,sans-serif;font-size:13.3333px">the above importer creates PostGIS-Geometries for ways, nodes and</span><br style="font-family:arial,sans-serif;font-size:13.3333px">




<span style="font-family:arial,sans-serif;font-size:13.3333px">polygons, so you can use PostGIS-Functions to get way-lenghtes,</span><br style="font-family:arial,sans-serif;font-size:13.3333px"><span style="font-family:arial,sans-serif;font-size:13.3333px">polygon-areas for each given point in time.</span><br style="font-family:arial,sans-serif;font-size:13.3333px">




<div style="font-family:arial,sans-serif;font-size:13.3333px"><br>> In the end what I want is a graph in with Y=number of nodes, or lenght<br>> for ways and X=time<br></div><span style="font-family:arial,sans-serif;font-size:13.3333px">There should be tons of fools go generate charts and graphs from</span><br style="font-family:arial,sans-serif;font-size:13.3333px">




<span style="font-family:arial,sans-serif;font-size:13.3333px">postgresql queries.</span><br></div></div></div>
</blockquote></div><br></div></div></div></div></div></div>