loreabad6 / masters-thesis-geotech

BNA-EU: Advances of my master thesis for the Erasmus Mundus Masters of Geospatial Technologies
3 stars 1 forks source link

Reproducibility issues: revisiting after 2 years #4

Open loreabad6 opened 2 years ago

loreabad6 commented 2 years ago

After having several issues with the dbConnect() function to reproduce the BNA-Europe.Rmd, I updated the code to change the dependency to Rpostgres instead of RPostgreSQL.

Also dbWriteTable() is has changed syntax, since schemas are not recognized as string vectors, so now:

dbWriteTable(
    conn,
    name = Id(schema = "received", table = "sa_boundary"),
    value = study_area_bb
  )

for example, should be the preferred syntax.

@elebrux the changes in the Rmd should fix the issue we were looking at:

dbWriteTable(conn, c("received","sa_boundary"), study_area_bb) 
Error in dbExistsTable(conn, name) : length(name) == 1 is not TRUE
loreabad6 commented 2 years ago

So far, managed to run up to Step 4, all the way through.

Next task:

elebrux commented 2 years ago

What you wrote here (about changing to RPostgreSQL and dbWriteTable) worked for me! I still have to manage to set up osm2pgsql. I'm working from home now on my personal computer but I'll try to do this tomorrow when I'm back in the office.

elebrux commented 2 years ago

I'm stuck at setting up the pgpass.conf password file. I've looked around in different AppData folders but I can't find it and don't understand how I can create it. (BTW, I don't have a folder called postgresql in low caps, only a PostgreSQL folder, but can't find a password file there either).

So, after running the end of ###4, I get:

2021-12-23 15:16:34  osm2pgsql version 1.5.1
Password:2021-12-23 15:16:34  ERROR: Connecting to database failed: fe_sendauth: no password supplied

[1] 1
[1] 127
[1] 127

ps. What does the 127 mean?

loreabad6 commented 2 years ago

That probably error 127. If you don't find the folder you can create it. So in %APPDATA%, which for me is C:\Users\Lore\AppData\Roaming\ you create a new postgresql directory and in there a new text file with the syntax hostname:port:database:username:password. Once you are done change the name of the file to pass.conf, i.e., change the extension from .txt to .conf

elebrux commented 2 years ago

Hi! Just a little update from my side after some holidays. I've switched to Python for now, using Jupyter and Colab, because it allows me to stay with one language and to work in the browser, but maybe at a later stage when I'm done with the current prototype, I'll look again at postgreSQL etc. Thank you for the help so far! If you're interested, I can send you my current prototype later this month (so far it only includes length of cycle tracks vs lanes etc, but nothing yet about LTS and so on).

loreabad6 commented 2 years ago

Hi @elebrux, yes by all means I'll be happy to take a look at the prototype :) Good luck!