2

I have a database of home addresses and service locations. People drive to the service locations. I'd like to create a map with transparent colored circles indicating the average drive times people face getting to our service locations.

I know I can easily get the drive times using Google's Developer API, but I have a slight privacy concern: I'm not sure we're allowed to use the addresses in a way that would necessarily share them with google.

So, the question is really this: is there a way I can geocode these locations and then calculate drive times between them, without having to use a service that will store the data?

EDIT: Sorry for the lack of clarity. This is in the US and I have two basic tasks: (1) geocode addresses, and (2) get driving times between two addresses. In each case, I am looking for a software/tool that does not require disclosing the addresses to an outside source. My understanding is that we can use the datasciencetoolkit to geocode the addresses locally. But, I don't know what I can use to get directions.

  • 1
    You are missing some details, i.e: What software you are using? Which country your addresses are? Geocoding requires a lot of spatial information, and mostly using API's, e.g. Google or OSM is required. You can check plugins for QGIS, such as GeoCoding, but I'm not sure about privacy. – dof1985 Apr 11 '15 at 15:56
  • Yes. You geocode locally and don't rely on a service or API to do it. You'd need reference data (for example TIGER line data from the census) and software with local address locators (such as ArcGIS or QGIS with the MMQGIS plugin). From there you'd need some network analysis, again with a local street layer (the TIGER data may or may not work and would likely require cleanup) and proper software (QGIS and pgrouting, ArcGIS Network Analyst). What do you have access to and how much experience/learning/time is available for the task? – Chris W Apr 11 '15 at 19:39
1

Reflecting on your privacy concern, I decide to suggest the following solution.

Note that many web services, i.e. API, give access to geocoding data using external codes from plugins in softwares like qgis or from R libraries. One R solution, that I find easy to implement is attached here and based upon the RJSONIO package.

Now about the privacy concern. I think that it shouldn't discourge you from using those API's, since:

  1. Be sure that it is most possible that google, already has data on those locations.
  2. Second, and most important - you can easily dis-link data of an address from other information about the teanent or costumer on those adresses. That is through a unique ID-field that relate address, and after geocoding x,y coords, with other relevant data.

Namely, ou have to split your data table to create (1) UniqueID and adresses and (2) UniqueID and other data table. You will use table (1) for geocoding, not giving away any data but addresses (thah google already has); Than you can take the geocoded data and join it to table (2) based on your UniqueID.

Other calculations of distance than can be made using arcmap, R or qgis; and for my taste there is a room to discuss them in other questions, if needed.

Here is a R code that uses Google API for geocoding. Disclaimer: I downloaded the code from a R-tutorial website, and can't remember the author, so can't give any credit. Yet it is GNU.

library(RCurl)
library(RJSONIO)
library(plyr)

url <- function(address, return.call = "json", sensor = "false") {
  root <- "http://maps.google.com/maps/api/geocode/"
  u <- paste(root, return.call, "?address=", address, "&sensor=", sensor, sep = "")
  return(URLencode(u))
}

geoCode <- function(address,verbose=FALSE) {
  if(verbose) cat(address,"\n")
  u <- url(address)
  doc <- getURL(u)
  x <- fromJSON(doc,simplify = FALSE)
  if(x$status=="OK") {
    lat <- x$results[[1]]$geometry$location$lat
    lng <- x$results[[1]]$geometry$location$lng
    location_type <- x$results[[1]]$geometry$location_type
    formatted_address <- x$results[[1]]$formatted_address
    return(c(lat, lng, location_type, formatted_address))
  } else {
    return(c(NA,NA,NA, NA))
  }
}
  • Thanks dof1985. I have used Google's geocoder in R before and it's awesome. Google also has another perfect tool - the Directions API, which gives the distance in minutes based on car/bike/public transport. So, it really is perfect. I just work for a non-profit and I don't know how comfortable people would be with sending addresses through google. It might be OK, but I just am not sure. I wanted to see if there's a non-google/bing/yahoo tool that can do this. – Mike Apr 11 '15 at 22:12
0

The company I work for has a geocoding tool called YAddress. It can be deployed locally on your own hardware, in which case your data never leaves the server and never travels over the internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.