Data and the City workshop (day 1)

The workshop, which is part of the Programmable City project (which is funded by the European Research Council), is held in Maynooth on today and tomorrow. The papers and discussions touched multiple current aspects of technology and the city: Big Data, Open Data, crowdsourcing, and critical studies of data and software. The notes below are … Continue reading Data and the City workshop (day 1)

Continue reading »

Jeremy Corbyn’s women-only carriages: the arguments for and against – CityMetric


CityMetric

Jeremy Corbyn’s women-only carriages: the arguments for and against
CityMetric
… gentrification, deprivation and property market processes inherent in this urban change – and what future city centres and suburbs will be like. Dr Duncan Smith is a teaching fellow at the Centre for Advanced Spatial Analysis at University college

and more »

Continue reading »

Online Dating Is Not Dead: How To Increase Your Chances Of Finding ‘The One … – The Inquisitr


The Inquisitr

Online Dating Is Not Dead: How To Increase Your Chances Of Finding ‘The One
The Inquisitr
In a recent article published in Vanity Fair, author Nancy Jo Sales declared online dating to be dead. According to the author, young people are using Tinder just to have sex, while others are settling for less even when they may want more. So, she

and more »

Continue reading »

This mathematical principle reveals the type of online dating profile photo … – Business Insider Australia


Business Insider Australia

This mathematical principle reveals the type of online dating profile photo
Business Insider Australia
Standing out online — and especially when it comes to online dating — means just being yourself. And we have the maths to prove it. Hannah Fry, a mathematician at the UCL Centre for Advanced Spatial Analysis in London, explains the theory in her 2014 …

and more »

Continue reading »

This mathematical principle reveals the type of online dating profile photo … – Business Insider


Business Insider

This mathematical principle reveals the type of online dating profile photo
Business Insider
Hannah Fry, a mathematician at the UCL Centre for Advanced Spatial Analysis in London, explains the theory in her 2014 TED Talk and recently released book, “The Mathematics of Love.” When most people choose their online dating profile pictures, she …

and more »

Continue reading »

‘Nature’ Editorial on Citizen Science

The journal Nature published today an editorial on citizen science, titled ‘Rise of the citizen scientist’. It is very good editorial that addresses, head-on, some of the concerns that are raised about citizen science, but it is also have a problematic ending. On the positive side, the editorial recognises that citizen scientists can do more than just data … Continue reading ‘Nature’ Editorial on Citizen Science

Continue reading »

Residents at London’s new Nine Elms development will be able to swim IN THE … – CityMetric


CityMetric

Residents at London’s new Nine Elms development will be able to swim IN THE
CityMetric
Kelvin Campbell runs the Smart Urbanism social network and the Massive Small campaign. He is visiting professor at Centre for Advanced Spatial Analysis at UCL, London. He also wrote CABE’s “By Design”, the basis of UK’s urban design policy for many …

and more »

Continue reading »

Searching Twitter with ArcGIS Pro Using R

I committed to testing this a long time ago, however, a number of other projects intervened, so I have only just got around to writing up this short tutorial. One of the exciting things from the ESRI Developers Conference this year was the launch of the R-ArcGIS bridge. In simple terms, this enables you to run R scripts from within ArcGIS and share data between the software. In fact, this is all explained in a nice interview here.

I won’t go into detail about the R script itself, and the code can be found on github. If I am honest, this is pretty rough, and was written to demonstrate what could be done – that said, it should be usable (I hope… but don’t complain if it isn’t!). ESRI have also provided a nice example which can be found here, and was the basis of my code.

Preparing R

Before you can link ArcGIS Pro to R, you need to install and load the ‘arcgisbinding’ package, which is unfortunately not on CRAN. There are instructions about how to do this here using a Python toolbox; however, I preferred a more manual approach.

Open up R and run the following commands which installs the various packages used by the toolbox. You might also need to install the Rtools utilities as you will be compiling on Windows (available here). Although the TwitteR and httr packages are available on CRAN, for some reason I have been having issues with the latest versions failing to authenticate with Twitter; as such, links to some older versions are provided.

#Install the arcgisbinding package
install.packages("https://4326.us/R/bin/windows/contrib/3.2/arcgisbinding_1.0.0.111.zip", repos=NULL, method="libcurl")

#Install older versions of the TwitteR and httr packages
install.packages("https://cran.r-project.org/src/contrib/Archive/twitteR/twitteR_1.1.8.tar.gz", repos=NULL, method="libcurl")
install.packages("https://cran.r-project.org/src/contrib/Archive/httr/httr_0.6.0.tar.gz", repos=NULL, method="libcurl")

#Load the arcgisbinding package and check license
library(arcgisbinding)
arc.check_product()

Creating a Twitter Search App

Before you can use the Twitter Search Tool in ArcGIS Pro, you first need to register an app with Twitter, which gives you a series of codes that are required to access their API.

  1. Visit https://apps.twitter.com/ and log in with your Twitter username and password.
  2. Click the “Create New App” button where you will need to specify a number of details about the application. I used the following
  3. Name: ArcGIS Pro Example
  4. Description: An application testing R integration with ArcGIS Pro and Twitter
  5. Website: http://www.alex-singleton.com
  6. I left the callback URL blank, then checked the “Yes, I agree” to the developer agreement, and clicked the “Create your Twitter application” button.
  7. On the page that opens, you then need to click on the “Keys and Access Tokens” tab. You need four pieces of information that enable the Toolbox to link up with Twitter. The first two are displayed – “Consumer Key (API Key)” and the “Consumer Secret (API Secret)”. You then need to authorize this application for your account. You do this my clicking the “Create my access token” button at the base of the page. This creates two new codes which are now displayed – “Access Token” and “Access Token Secret”. You now have the 4 codes required to run a Twitter search in ArcGIS Pro.

R Script

I created an R script that:
1. Authenticates a session with Twitter
2. Performs a search query for a user specified term within a proximity (10 miles) of a given lat / lon location
3. Outputs the results as a Shapefile in a folder specified

The inputs to the script include the various access codes, a location, a search term and an output file location. These variables are all fed into the script based on Toolbox inputs. Getting the inputs is relatively simple – they appear in the order that they are added to the Toolbox, and are acquired via in_params[[x]] where x is the order number; thus search_term = in_params[[1]] pulls a search term into a new R object called “search_term”. The basic structure of a script are as follows (code snippet provided by ESRI):

tool_exec <- function(in_params, out_params) {
        # the first input parameter, as a character vector
        input.dataset <- in_params[[1]]
        # alternatively, can access by the parameter name:
        input.dataset <- in_params$input_dataset

        print(input.dataset)
        # ... do analysis steps

        out_params[[1]] <- results.dataset
        return(out_params)
      }

For more details about the functions available in arcgisbinding, see the documentation located here

How to use the Twitter Search Tool

The Twitter Search Tool was run within ArcGIS Pro and requires you to add a new toolbox. The toolbox should be downloaded along with the R script and placed in a folder somewhere on your hard drive. The files can be found on github here.

  1. Open ArcGIS Pro and created a new blank project called Twitter Map.
  2. Create a new map from the insert menu
  3. From the map tab, click the “basemap” button and select the OpenStreetMap tile layer
  4. Zoom into Liverpool on the map using the navigation wheel
  5. Find the latitude and longitude of map centre. These are recorded just under the map on the window border. The centre of Liverpool is approximately -2.95 (longitude), 53.4 (latitude) (although displayed as 002.95W, 53.40N)
  6. Click on the “Insert” menu, the “Toolbox” and then “Add Toolbox” buttons. Navigate to the folder where you have the Toolbox and R script. Click on the Twitter.tbx file and press the “Select” button.
  7. If you don’t see a side bar called “Geoprocessing”, then click on the “Analysis” tab and press the “Tools” button. After this is visible, under the search box there is a “Toolboxes” link. Click this and you will see the Twitter toolbox listed. If you look inside the toolbox you will see the Twitter Search script – click on this to open.
  8. Enter a search term (I used “Beatles” – hey we are in Liverpool), the Twitter authentication details, the location and where you want the output Shapefile stored. This defaults to the geodatabase associated with the project; however, you can browse to a folder and specify a Shapefile name – e.g. Twitter_Beatles.shp.
  9. Press the “Run” button and with luck you should now have a Shapefile created in the folder specified.
  10. Add the results to your map by clicking on the “Map” tab, then the “Add Data” button. Browse to where you saved the Shapefile and click the “Select” button.

The following screenshot is of the Shapefile shown on an OpenStreetMap basemap; with the attribute table also shown – you will see that the full Tweet details are displayed as attributes associated with each point.

pbec

Anyway, I hope this is of use and can assist people getting started linking R to ArcGIS.

Continue reading »

Living Somewhere Nice, Cheap and Close In – Pick Two!

When people decide to move to London, one very simple model of desired location might be to work out how important staying somewhere nice, cheap, and well located for the centre of the city is – and the relative importance of these three factors. Unfortunately, like most places, you can’t get all three of these … Continue reading Living Somewhere Nice, Cheap and Close In – Pick Two!

Continue reading »

Beyond quantification: a role for citizen science and community science in a smart city

The Data and the City workshop will run on the 31st August and 1st September 2015, in Maynooth University, Ireland. It is part of the Programmable City project, led by Prof Rob Kitchin. My contribution to the workshop is titled Beyond quantification: a role for citizen science and community science in a smart city and is extending a short article from … Continue reading Beyond quantification: a role for citizen science and community science in a smart city

Continue reading »

Extra Detail in DataShine Commute

We’ve made three changes to the DataShine Commute websites: For DataShine Scotland Commute we have made use of a new table, WU03BSC_IZ2011_Scotland, published recently on the Scotland’s Census website, which breaks out small-area journeys by mode of transport, in the same way that the England/Wales data does. The small-area geography used, Intermediate Geography “IG”, is … Continue reading Extra Detail in DataShine Commute

Continue reading »

The Modernist Sandcastles of Coney Island – Little Atoms


Little Atoms

The Modernist Sandcastles of Coney Island
Little Atoms
With over 170,000 views on Flickr, Calvin Seibert’s creations are admired the world. But what drives one man to spend 10 hours painstakingly building a brutalist sandcastle, only for it to be swept away by the sea or destroyed by drunks? We spoke to

Continue reading »

Science-Society Dialogue – from Citizen Science to Co-Design (ICCB/ECCB 2015 – Day 4)

The final day of the ICCB/ECCB 2015 (see my notes on citizen science sessions from Day 1, Day 2 and Day 3) included a symposoium that was organised by Aletta Bonn and members of the European Citizen Science Association (ECSA) to explore the wider context of citizen science. The symposium title was Science-Society Dialogue – … Continue reading Science-Society Dialogue – from Citizen Science to Co-Design (ICCB/ECCB 2015 – Day 4)

Continue reading »

Notes from ICCB/ECCB 2015 (Day 3) – Citizen Science, engaging local knowledge and urban areas

The third day of the ICCB/ECCB 2015 (here are notes from first and second days) was packed with sessions about citizen science and local knowledge throughout the day (so this post is very very long!). It started with two sessions on citizen science / public participation in science that included the following talks: Citizen science online: … Continue reading Notes from ICCB/ECCB 2015 (Day 3) – Citizen Science, engaging local knowledge and urban areas

Continue reading »

Notes from ICCB/ECCB 2015 (Day 2) – Citizen Science data quality

The second day of the ICCB/ECCB 2015 started with a session that focused on the use and interpretation of citizen science data. The  Symposium Citizen Science in Conservation Science: the new paths, from data collection to data interpretation was organised by Nick Isaac and included the following talks: Bias, information, signal and noise in citizen science data … Continue reading Notes from ICCB/ECCB 2015 (Day 2) – Citizen Science data quality

Continue reading »

The privatisation of cities’ public spaces is escalating. It is time to take a stand – The Guardian


The Guardian

The privatisation of cities’ public spaces is escalating. It is time to take a stand
The Guardian
Oliver Dawkins, doing degree work at UCL’s Centre for Advanced Spatial Analysis (Casa), created a “Pops Profiler” that enables us to see how this plays out in the Square Mile. Publicly available data on Open Street Maps (OSM) do not indicate a single

and more »

Continue reading »

The privatisation of cities’ public spaces is escalating. It is time to take a … – The Guardian


The Guardian

The privatisation of cities’ public spaces is escalating. It is time to take a
The Guardian
Oliver Dawkins, doing degree work at UCL’s Centre for Advanced Spatial Analysis (Casa), created a “Pops Profiler” that enables us to see how this plays out in the Square Mile. Publicly available data on Open Street Maps (OSM) do not indicate a single

and more »

Continue reading »
1 2