2011-04-21

quick iphone location data

I threw together some code to look at my iphone location data. There are a couple strange features to the data, and I'm eager to get my hands on a friend’s iphone4 data to see if it is the same. Timestamps are often the same — I’ll have 350 entries on some days, but only 7 or max 10 unique timestamps. On the other hand, location points themselves are pretty good.

Yup. NYC, Chicago, and I was in DC around xmas.

There are a couple wild points in NJ, and perhaps the ocean, making the bounding box too large here.

This is a couple weeks ago when I was out in Elmhurst, Queens, for the Thai Songkran festival. See my pictures (with amod gps logger geotags) here!

I flew into Chicago on New Year’s Eve. But, no points are stored from the rest of the day, only the train ride in, from O’hare apparently.

And last time I was in chicago, on one day I only went to the Maxwell Street Market for mexican food, and mostly hung out at home. Which is somewhere not far from that cloud of points.

Here’s the code.

library(RgoogleMaps)
library(RSQLite)
dbh <- dbConnect("SQLite", "~/Consolidated.db")
Loc <- dbReadTable(dbh, "CellLocation")
dbDisconnect(dbh)
Loc$time <- as.POSIXct(Loc$Timestamp,
                       origin=as.Date("2001-01-01"))
Loc$date <- as.Date(Loc$time)
Loc <- subset(Loc, Latitude != 0)

## Focus on a couple a specific days
Days <- list(
             ## whole thing
             all=Loc
             ## last sunday, park, soho
             Sunday <- Loc[Loc$date == as.Date("2011-04-17"),],
             ## songkran
             Songkran <- Loc[Loc$date == as.Date("2011-04-10"),],
             ## NYE
             Nye <- Loc[Loc$date == as.Date("2010-12-31"),],
             ## Maxwell
             Maxwell <- Loc[Loc$date == as.Date("2011-04-04"),],
             )



lapply(Days, function(Df) {
  png(file=paste(paste(range(Df$Latitude),collapse=""),
        ".png",collapse="",sep=""),
      640,640)
  bb <- qbbox(lat=range(Df$Latitude),
              lon=range(Df$Longitude))
  ##m <- c(mean(range(Df$Latitude)), # better for 'all' plot
  ##       mean(range(Df$Longitude)))
  m <- c(median(Df$Latitude),
         median(Df$Longitude))
  
  zoom <- min(MaxZoom(latrange=bb$latR,lonrange=bb$lonR))
  Map <- GetMap.bbox(bb$lonR,
                     bb$latR,
                     center=m,zoom=zoom,
                     maptype="terrain",
                     NEWMAP=TRUE,
                     destfile="tempmap.jpg",
                     RETURNIMAGE=TRUE,
                     GRAYSCALE=TRUE)
  tmp <- PlotOnStaticMap(lat=Df$Latitude, lon=Df$Longitude,
                         cex=.7,pch=20,col="#00aa0065",
                         MyMap=Map, NEWMAP=FALSE)
  dev.off()
})

2011-04-07

things to eat

  • roasted potato and sweet potato with garlicky yogurt-spinach sauce
  • roasted squash and parsnips with maple glaze, garlic oil, and olives. Perhaps even better with mushrooms (Sunday market)
  • variation on dan dan noodles, with ground beef, my chili oil, and some blanched *choy
  • kale peanut stew, couscous
  • E(μ) chorizo challah. Yes. Like this, but with an E(μ) egg. Salad.
  • some manner of rajma, still unmade; spinach-onion rice
  • south indian liver curry (listed before, unmade)
  • pasta with tasso and onion cream sauce (actually made a couple days ago)