OHDSI / GIS

https://ohdsi.github.io/GIS
Apache License 2.0
8 stars 8 forks source link

[BUG] Docker Fails When Attempting Geocoding #320

Open TheCedarPrince opened 4 months ago

TheCedarPrince commented 4 months ago

Hey folks,

I was just following the tutorial concerning Eunomia and ran into this error:

> geocodedLocation <- geocodeAddresses(addressTable = notGeocodedLocation)
Geocoding chunk 1 of 1
Fatal error: cannot create 'R_TempDir'
Error: '/tmp/RtmpD7WMaA\add_geocoder_3.3.0_score_threshold_0.5.csv' does not exist.

Not sure what exactly this error is.


Here are system details:

OS: Fedora 38

R details: R version 4.3.1 (2023-06-16) -- "Beagle Scouts" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

GIS Commit Hash: a5279642ccc883e34cdb1009daf8c827a71bb872


Here's the code I was using too as well

library(DatabaseConnector)
library(gaiaCore)

gaia <- createConnectionDetails(
  dbms = "postgresql",
  server = "localhost/gaiadb",
  user = "thecedarprince",
  password = "",
  pathToDriver = "./drivers"
)
synthea <- createConnectionDetails(
  dbms = "postgresql",
  server = "localhost/synthea",
  user = "thecedarprince",
  password = "",
  pathToDriver = "./drivers"
)

transformedLocation <- getLocationAddresses(connectionDetails = synthea,
                                            cdmDatabaseSchema = "omop")
splitResult <- splitAddresses(addressTable = transformedLocation)

alreadyGeocodedLocation <- splitResult$geocoded

notGeocodedLocation <- splitResult$ungeocoded
geocodedLocation <- geocodeAddresses(addressTable = notGeocodedLocation)
kzollove commented 4 months ago

Hi @TheCedarPrince ! Thanks for creating an issue for this.

> geocodedLocation <- geocodeAddresses(addressTable = notGeocodedLocation)
Geocoding chunk 1 of 1
Fatal error: cannot create 'R_TempDir'
Error: '/tmp/RtmpD7WMaA\add_geocoder_3.3.0_score_threshold_0.5.csv' does not exist.

This function leverages DeGauss geocoder, which writes and reads a csv using R's tempdir() function.

It looks like its either not able to create the directory and subsequently can't read it. That backslash looks suspicious to me.

I will dig into the issue a little deeper and get back to you.

TheCedarPrince commented 4 months ago

I noticed that too -- I wonder if there was something going wrong internally with the pathing... :thinking:

Seems to be coming from here:

https://github.com/OHDSI/GIS/blob/a5279642ccc883e34cdb1009daf8c827a71bb872/R/geocode.R#L44