Donate using PayPal

CycleStreets blog

News from CycleStreets

Archive for the ‘API’ Category

CycleStreets.net in the Propensity to Cycle Tool

Wednesday, December 21st, 2016

A guest post from Robin Lovelace:

After 2 years in the making, the paper describing the Propensity to Cycle Tool (PCT), and the thinking behind it, has finally been published (Lovelace et al. 2016). The PCT is an online tool for helping to decide where to prioritise cycling policies such as new cycle paths.

The PCT would not have been possible without CycleStreets.net, so as well as describing the PCT and its use of their routing services, this article serves as a big Thank You from PCT to CycleStreets.net.

What is the Propensity to Cycle Tool?

For those new to the PCT, it’s an online tool for helping to decide where to prioritise cycling policies such as new cycle paths. It lives at www.pct.bike – check it out!

The context of its development is explained in the accompanying video on that page. This article reports how the tool itself works and how it uses data from CycleStreets.net.

The PCT is best understood by using it to explore current cycling levels, at regional, area, desire line, route and route network levels. We will take a look at how the PCT works at each of these levels, after a brief look at the scenario results at the regional level (the senarios are described in more detail in the paper).

Under the 2011 Census scenario, the PCT represents levels of cycling to work based on the Census. This is a reasonable proxy for levels of utility cycling overall. We used origin-destination (OD) data from the Census as the basis of the PCT as this is best publicly available dataset on English travel patterns. The input data is described in the paper and can be freely downloaded from the official UK Data Service website.

The regional picture and scenarios

The first thing the user sees on the front page is a map of England, broken into 44 regions:

We used deliberately large regions because successful cycling plans should be strategic and joined up, covering both large areas and large spans of time. This discourages the stop-start investment plans that have typified funding for active travel.

By hovering over different regions, the user can see what the current level of cycling to work is. We can discover that West Yorkshire has a low current level of cycling to work, 1.3% in the 2011 census, and that Cambridgeshire has a relatively high (but low by Dutch standards) level of cycling of 9.7%.

An exciting feature of the PCT is its ability to allow the user to imagine ‘cycling futures’. This can be seen on the front page map by clicking on the different scenarios (set to Census 2011 by default). We can see, for example, that under the Government Target to double cycling levels by 2025, West Yorkshire’s level would rise to 3.3% (more than a doubling) whereas Cambridgeshire would see cycling levels grow to 13.7% (a larger rise in absolute terms):

plot of chunk unnamed-chunk-2plot of chunk unnamed-chunk-2

Under the Go Dutch scenarios, these regions would see 23.1 and 13.5% of people cycling to work, respectively. This represents a huge leveling-out of cycling levels across the country, but still highlights the fact that some regions have higher cycling potentials than others, due to average trip distances and levels of hilliness.

Cycling levels at the area level

To launch the PCT for a region, click on it. Try clicking on West Yorkshire. You should be presented with the following image, which shows the area-based level of cycling to work from the 2011 Census. (When using the PCT, it is worth remembering that the visualisations work for every scenario.)

This shows that West Yorkshire has very low levels of cycling to work, hovering around 1% to 2% in most places. This suggests strongly that the region has low levels of utility cycling overall (despite the successes of the region’s sport cyclists). There is a cluster of zones with a higher level of cycling to the north of Leeds city centre (around Headingly) but even there the percentage of people cycling as their main mode of travel to work does not exceed 5%.

Cycling potential at the desire line level

This is all useful information, especially when we look at how the cycling potential could shift in the future. However, it provides little information about where current and future cyclists actually go. This is where the desire line level can be useful. This can be selected by clicking on the Straight Lines option from the Cycling Flows dropdown menu. The results (zoomed in for Leeds) are shown in the figures below (see Figure 3 in the paper).

What the above figures show is that as the level of cycling increases in a city, the spatial distribution of cycling can be expected to change. Under current conditions (be they related to socio-demographics or infrastructure or other factors), cycling in Leeds is dominated by the travel corridor to the north of the city centre. Yet there are clearly many short trips taking place from the south into the centre, as illustrated by the high cycling potential south of the city under the Go Dutch scenario.

Allocating cycling potential to the route network

This is where CycleStreets.net comes into play.

We know how many people go from A to B by cycling from Census data. But we have very little idea of how they are likely to travel. This is where the routing algorithm of CycleStreets.net comes in handy. We used the CycleStreets cycle routing API to estimate the ‘fastest’ route for all short (well, up to 20 km in Euclidean distance) desire lines in England.

Not only does CycleStreets.net allow us to find all the fastest routes, a good indication of where new infrastructure should be built as people (especially women and elderly) have a strong preference for cycling along the most direct routes.

The results of all this routing work is illustrated in the future below, which shows the fastest and quietest routes associated with the top cycled routes in Leeds.

Interestingly, the big fat line up to the north-west is Otley Road, well-known to have very high level of cycling. This also shows up in Strava data as having high current levels of cycling:

This is not formal validation but it is a good sign that the PCT and other data sources line-up for the current level of cycling. The big question is whether the PCT’s estimates of cycling levels under various cycling futures, including Go Dutch.

Here is not the place to answer such a question. Only the passage of time, and commitment from people (perhaps informed by models such as the PCT) to sustainable travel will help answer that one.

There is much more to say about the use of CycleStreets.net in the PCT but it gets rather technical very quickly.
Suffice to say at this stage that it involved writing lots of code in R, a language for statistical programming, and that this has now resulted in the publication of stplanr, an R package for sustainable transport.

(For more on how to install R and (for bells and whistles) RStudio, which this blog post was written in, please see the relevant sections of the book Efficent R Programming (Gillespie and Lovelace, 2016).)

With R installed, stplanr can be installed with:

install.packages("stplanr")

With this package installed, you can start using the CycleStreets.net routing algorithm with the following function:

library(stplanr)
route = route_cyclestreet(from = "Leeds", to = "Cambridge")

which results in spatial data, which can be visualised as follows:

library(leaflet)
leaflet() %>% addTiles() %>% addPolylines(data = route)

There is much more I could say about the technical side of things but at the request of the editors I will leave it there for now. For more info please see the stplanr vignette.

I plan to follow this overview article up with a more technical blog post in the New Year. Watch this space!

Reference

Lovelace, R., Goodman, A., Aldred, R., Berkoff, N., Abbas, A., & Woodcock, J. (2016). The Propensity to Cycle Tool: An open source online system for sustainable transport planning. Journal Of Transport And Land Use, 0. doi:10.5198/jtlu.2016.862

Bike Hub app relaunched

Sunday, December 18th, 2016

A guest post from Carlton Reid, who writes about the fantastic new version of the Bike Hub app:

The Bike Hub cycle-specific satnav app, available for iPhone and Android, has been redesigned from scratch. Now six years old the all-new app still uses the CycleStreets routing engine so can still navigate on quiet roads, cycleways and away from hills. However, it now sports many of the core upgrades that smartphone operating systems have benefitted from in the past twelve months.

    

A tender was put out to three agencies and the contract was won by Tinderhouse of Canterbury, the existing development house. The app is now more intuitive to use, and – because it’s a new-build – works better with the latest smartphones. It can still find the nearest bike shop from where a user is standing, but is now quicker and slicker. The satnav voices for the app have also been updated.

While it has a UK focus – it’s paid for by the Bicycle Association of Great Britain – the free app is able to route in various other countries too. With upgraded graphics the maps are sharper, including up to tablet size for ride pre-planning. Users can toggle between three map styles: OpenCycleMap, Ordnance Survey Opendata and a clinically-clean Bike-Hub-specific map. Users navigate by choosing the quickest, shortest or quietest route, or a mix of all three.

Within a few weeks more features will be added to the app including syncronisation with Map My Tracks, Wahoo RFKLT and Apple Watch.

The Bicycle Association is the industry membership body that represents UK cycle and accessory suppliers. Industry companies and bike shops donate funds to the Bike Hub levy, which pays for the app, sponsorship of British Cycling’s Go Ride scheme and other projects. The Bike Hub app was first released in 2010.

    

The Bike Hub app makes use of map data from OpenCycleMap, pulls down map tiles from Thunderforest, and has a rendering engine from Map Box.

The Bike Hub app works on iPhones and Androids.

Making data more usable by campaigners: our Outlandish Fellowship

Wednesday, August 24th, 2016

We’re really pleased to announce that we’ve been selected for the Outlandish Fellowship to help local cycle campaigners by expanding our collisions data pages into a broader resource covering more types of data (e.g. traffic counts, pollution) and add lots of new ways to access it.

Helping campaigners campaign

Getting more people cycling brings a more sustainable and efficient transport system, improved public health, and greater access to employment. However, in the UK, cities have failed to make space for cycling on our streets, preventing mass uptake.

We know from our own activity as campaigners in Cambridge, that making a good evidence­-base for reallocating roadspace or challenging poor developments involves significant work. For instance, developers often claim that their route has “good connections to the local cycle network” whereas in practice we know that this often means a shared-use path that is hard to access.

We lack the data to make a strong case that, for instance, a combination of a high collision rate, congestion, pollution in an area means that a developer or a Local Authority needs to improve their plans. Of course there remains the need for making arguments based on broader policy, such as that cycling should be prioritised as a positive and healthy form of transport, but hard data for specific cases helps backs this up.

What kind of data is out there?

There’s lots out there that could be useful for cycle campaigning. Things like collision data (which we’ve already done a bit of work on), traffic count data, travel time data, census travel data, on-street counts, etc. Imagine if, instead of having to search these out and find someone technical to process it, you could simply point and click, with national coverage?

Collisions

This data is becoming available but it’s very scattered, meaning that correlations are hard to make. It’s often in raw formats that need significant work before it can be understood, or hidden in Local Authority websites that are not sufficiently flexible or easy for non-specialists to use. Often it’s not arranged for the kinds of tasks that cycle campaigners specifically need.

We’re aiming over time to build up a multi­functional resource to help build this case, enabling users to a build and link to an interactive display of the relevant data (involving multiple layers, clickable points, reports, summary info) for a particular location or route, that they can use in their advocacy and liaison work.

Mark, better known as ‘Ranty Highwayman’ in cycle planning circles, said:

“The project looks really exciting. From my point of view, the ability to generate information from one place is a great idea as at the moment, it’s a really labour-intensive process, this could create maps for reports, committee papers etc.”

Our plan is that it would be available for embedding in local campaign websites, exporting to reports, used in apps, and so on.

Some examples

Here are just a few sample stories that we’ve come across in our own work as cycle campaigners, some from Cambridge:

  • Justification of removal of one-way street restrictions for cycling. In previous decades, traffic planning favoured one-way streets as a way to regularise traffic flows and avoid rat-running. However, the side-effect is to stop easy cycling. If we could compare collision data easily in a particular location, we could show how streets that have been made two-way for cycling haven’t caused a safety hazard.
  • Worsened likelihood of collisions in areas with an existing poor record. A supermarket developer wanted to open a local store under a just-in-time delivery regime in a high street with a narrow carriageway that has heavy traffic and high pedestrian and cycle flows. A good evidence base, combining flow level data, Origin/Destination data, collisions and traffic data delay data, would have enabled us to argue that the developer will need to amend their delivery plans to be more sympathetic to the local circumstances.
  • Higher levels of pollution in areas with significant problems already. Areas with many schools particularly need to avoid pollution. A developer proposes a new estate in such an area but fails to provide good connections into the site for walking and cycling. A better evidence base, combining socio-economic data, school travel data, pollution and cycling levels would help us convince the Local Authority that the developer needs to provide this connectivity.

What changes can people expect?

We’ve started from our collision data viewer as the base, and to this we’re adding:

  • Completely reworking the search facility so that it’s actually useful – currently it’s stuck in a prototyped state, with lots of non-useful fields. This will mean that common scenarios like “Collisions between a date range in area X” are possible.
  • Adding typical scenarios as new front-end ways to access it. Currently, it’s very map-based, whereas we want to enable common use-cases much more easily.
  • Making everything Local Authority -aware. Currently it’s all manual boundaries, but we’d like users to be able to do things like compare casualty rates (and other data – see below) between areas.
  • Upgrading the interface. We’ve now got some nice new icons for a start :)
  • Adding a better way to import the data. Currently, updating it each year is not as easy as we’d like, and new data types (see below) need to be supported.
  • Adding generalised origin-destination data for areas, using analysis from our own journey planner
  • Adding traffic count data, from the DfT
  • More data (in future – after the current Fellowship work)
  • Adding the ability to switch between multiple layers of data
  • Making all the above available through a more generalised Advocacy data API. In fact, this will be the system powering all the above!
  • Adding the ability to embed custom views of the data in other sites

The code will be open source too :)

We’ll be giving updates via this blog over the coming 6 weeks – stay tuned!

Collisions

Blackfriars Bridge, scene of many unfortunate collisions over many years. With the new data platform, it will be possible to make easy comparisons about how the introduction of the new Dutch-standard cycle infrastructure just built reduces these collisions.

Outlandish

OutlandishOutlandish is a web agency based in Finsbury Park, down the train from us in Cambridge. The members of Outlandish want to unleash technology’s potential to make the world a fairer, better place. It’s a worker co-operative and invests all surpluses into projects that help achieve the members’ goals. They build digital applications and websites for companies, charities and universities that make their lives easier and help them to discover and communicate new insights from their data.

Outlandish has made available fellowships for people who are using the Internet and digital technologies to address social issues. The fellowships include funding and other forms of support to allow participants to start their own projects. The aim of the fellowship is to support work that matches the mission of Outlandish, and to expand the network of people that they actively collaborate with.

We’re really proud to be in the first set of Fellows, and it’s going to be great to be working with a co-op!

  
Photos from the launch of the Outlandish Fellowhip

Our project team

Our main developer on this project is Martin, doing most of the work, as the Outlandish Fellow.

He’s being helped by Simon (CycleStreets’ other principal developer), when he can be wrestled away from interesting routing quality challenges like turn delays that we’ve been working on recently.

We’ve also set up a Stakeholder board, to ensure that the data work we’re doing is genuinely useful. This is:

A version of this blog post also appears on the Outlandish blog.

CycleHack Cambridge 2016

Sunday, April 10th, 2016

CycleHack is a 48-hour event aiming to make cities cycle-friendly through reducing the barriers to cycling and prototyping new ideas to improve the cycling experience and encourage more and safer cycling. More than 40 other cities around the world have signed up to host CycleHack events in their communities over the weekend of 24 to 25 June, 2016.

Cyclehack

Cambridge, home of CycleStreets, will be joining cities around the world for a weekend-long CycleHack event, which will be held at Anglia Ruskin University and other locations where specialist equipment may be required. Participants will be encouraged to test their ideas and prototypes around town during the event.

CycleHack was launched in 2014 in Glasgow and has since grown to a global event. In 2015 CycleHack had more than 600 participants from over 25 countries across five continents. 67% of participants were inspired to cycle more. In 2016 the event is set to be even bigger with more than 40 cities already registered.

Cyclehack CambridgeCycleHack Cambridge is hoping to attract a whole range of people from developers, makers and data scientists to non-technical artists, designers and those who are interested in cycling and have some great ideas. We also want to include representation from all corners of our diverse cycling community and want to see lots of students and young people taking part. This event will bring together the key elements of our Cambridge culture: cycling, innovation and technology.

The event encourages participants to prototype and test their ideas during the weekend to see how they will work in their intended context. Solutions can fall into one of the five CycleHack categories; digital, physical, policy, local plan, event/campaign. Hacks will be loaded to the online open source catalogue to show how the ideas can be replicated. Prizes will be awarded to the best hacks.

CycleStreets is one of the partners organising the event. We’ll be on hand to help out and give advice to people considering doing a digital hack. Perhaps you’ve never used an API (a data interface – like the CycleStreets API for instance) before or don’t know what it is? We can help you get started.

Cambridge Cycling Campaign is the main organiser of the event. Other partners include the Smart Cambridge Programme (Cambridge County Council) and CoDE Research Institute at Anglia Ruskin University.

There are more details on the Facebook event page about the event, and you can register online.

Urban Cycle Parking website goes live across London

Monday, March 21st, 2016

A new website, Urban Cycle Parking, built by CycleStreets, has been launched by London Cycling Campaign and Transport for London, aiming to outline where existing bike parking facilities are available in and around the capital and invites people to highlight existing facilities as well as outlining where more is needed.

The site builds on the crowdsourcing components of our data API, which had various enhancements made to enable auditing facilities.

urbancycleparking
Image credit: Primary Image

London Cycling Campaign’s Chief Executive Ashok Sinha commented:

“Substantially more high quality cycle parking at stations and on streets is vital to sustain the welcome growth in cycle use.

“The launch of this interactive Urban Cycle Parking website is a great opportunity for London cyclists to play an active role in improving cycling provision and to suggest the right places to install cycle stands.”

Cyclists just need to click on the map, or take a photo (which will auto-locate the image on a modern phone), and add a few details, such as the number of stands which would be useful. After agreeing to the open data license, the location is added, so that TfL can consider the suggestions.

Urban Cycle Parking

The site has been in public beta for several boroughs. Various improvements have been made to the site during this period to enable a wider rollout.

The visual design of the site, which is mobile-friendly, was created by Mike from Primary Image, who was a pleasure to work with. We then worked with this design to implement the functionality.

The Urban Cycle Parking site replaces the previous Cycle Parking 4 London site that we created several years ago for LCC.

TransportHack @ Smarter Travel LIVE!

Monday, March 14th, 2016

Matt Whittle writes:

This weekend we attended the Smarter Travel Live hack weekend. The aim of the hack event was to produce an output to support one of five challenges set by various organisations. We chose to tackle the Carplus challenge which was to try and find a way to reduce the use of cars as the primary transport means around the Lake District.

To begin the challenge we brainstormed several possible ways in which provisions could be made to facilitate the ease of switching peoples mode of transport, these included:

  • Increasing cycling space on trains and buses
  • Car sharing schemes
  • Bike hire and sharing scheme

It soon became apparent that as a group we felt that a hire and sharing scheme would work best for the area, therefore we set off to try and gather evidence of how popular the scheme could potentially be as well as providing evidence to where the scheme would best be suited.

We were provided with a travel survey which listed the origins and destinations of c. 8,000 visitors to the park, this listed the mode of transport as well as the number of people making the journey. From this data we were able to visualize the flows of people to the park as shown below.

flows

From this data we then began to summarize what the most popular locations were in the region. For this we set out a criteria that popular locations had to attract more than 100 visitors from the data. The results can be seen below.

loc.JPG

This then lead to the question, where do current cyclists cycle in the Lake district? By using the flow data and some clever use of CycleStreets API we were then able to allocate all of the current cycle flows to the route network.

The approach, using origin-destination data routed to the on and off road travel network using CycleStreets.net, is similar to that used in the Propensity to Cycle Tool (PCT). An early draft of a report describing the methods in more detail is available.

cycling

The analysis showed the the current popular cycle network had one main entry point to the lake the district, the thick red line flowing from Milnthorpe, through Kendal and out to Windermere. Beyond the corridor the data supported evidence that flows up to Ambleside, Grasmere, Coniston and Hawkshead were also popular.

The next question to answer we decided to answer involved trying to discover which car journeys could potentially be replaced by cycle journeys. Using the flow data and R code we managed to find all of the car journeys in the data set that were under 10km. Once again, using the CycleStreets API these were allocated to the road network and then visualized.

cars

This visualisation supports the idea developed in from the cycling data that cycling could be popular in the north Windermere area. A 10km journey would take an estimated 30 mins when travelling at a reasonable cycling speed of 12mph (19kmh).

These two visualizations therefore supported out idea that cycling could be a popular activity in the north Windermere/ Kendal corridor area. However what we had overseen was where should this system be implemented e.g. hire locations and how should it be carried out e.g. new infrastructure or rework existing infrastructure. Some research into cycle hire in the Lake District was carried out and we discovered that there was already a fairly large economy in the region, however the system does not support A to B trips, it is primarily for users to hire bikes from a location and drop off at the same location. Plans have already been suggested for cycle hire in Kendal. What we therefore propose is that a cycle hire system could work by working with the current bicycle hire network (see below, these are current e-bike cycle hire locations from electric bicycle network) to support A to B transportation by bicycle.

ebikes

Using all of this analysis we then created a ‘core’ cycle network based on the popular destinations, current cycling, car journeys less than 10km and the existing hire locations. This is where we suggest cycling infrastructure should be placed initially. Once this is built extentsions could be built to Grasmere, Coniston, Troutbeck and Grizedale in order to link up to other popular locations.

network

Our hack has therefore provided evidence to support a cycle hire network in the Lake District. The analysis has suggested that cycle journeys could replace a large amount of car journeys in the region, therefore reducing congestion. The initial brief stated that people wanted to get out of their cars when they were visiting the Lake District, this has provided a potential solution to that need.

We put all of our data, code and visualisations on Github.

You can view the map of all the spatial data created for the project.

Thanks to Landor and Transport API for organising such a great event.

Cycle commuting analysis of Bristol

Saturday, December 19th, 2015

We love it when our API comes in useful for academic purposes. This is a guest post by Richard Thomas.


Average time to cycle commute

Bristol: Typical cycle commute time

For my MSc dissertation, I investigated determinants of the proportion of people who choose to cycle for their daily commute. Specifically, I wanted to see whether an analysis of realistic cycling routes of a representatively large sample of a city’s population could give improved predictors over existing models.

From 2011 Census data, I extracted commuting origin/destination data for everyone in the Bristol built-up area in its most detailed form of aggregation (typically accurate to within 500m). I wanted to generate plausible cycling routes for these commutes, then for each of these routes to evaluate metrics (distance, hills, cycle paths, traffic). As census data is available giving the proportion of commuters living in each small area who cycle, multi-variate correlation could then be used to estimate the influence of these routing metrics, together with other known influential population measures taken from the census.

So how best to perform this cycle routing and evaluate suitable metrics? On both these counts the CycleStreets Journey Planner API proved invaluable (and made my MSc dissertation a feasible proposition!) I had considered using an existing open source routing engine (such as pgRouting or Graphhopper) operating on an extract of the OpenStreetMap database as this would allow me to directly query tags on each node of a route. However the complexity in interpreting OpenStreetMap cycle-related tags is quite daunting (as documented here on CycleStreets.net).

Because the API returned not just the route, but details of routed distance, duration, “quietness”, estimated calories required and spot heights, useful metrics could be derived quickly from the JSON data using just Python scripts. It would have been good to more directly quantify dedicated cycle infrastructure along routes: although the “quietness” measure included this, it also included road traffic expectations. Given more time, this could have been done by using the actual route coordinates to interrogate the OpenStreetMap or CycleStreets databases, though this was complicated by API-returned points being only in latitude/longitude format rather than database node/segment numbers. In order to limit the amount of data to be processed (and the load on the CycleStreets API server, routing was limited to the 4 most popular routes from each area, although this still required nearly 16,000 routes to be generated and analyzed!


Summed routes (detail)

Summed cycle commute routes (Overview)

The most notable results of these new routing-based metrics (i.e. beyond the key predictor of crow-fly distance) were as follows:

  • Directness (Crow-fly / Routed Distance): strong indication that cycling was less popular if a reasonable (“balanced”) cycling route was particularly circuitous.
  • Max Height Increase (Maximum of sum of all hill climbs for outward or return direction): strong indication (as might be expected) that hills were a strong detractor. This metric was only developed after the MSc was completed; interestingly, in the MSc analysis, the related metric of Effort Ratio (calories / distance) was not a statistically significant indicator.
  • Traffic Exposure (Inverse of “Quietness”): Although this metric visually gives a good indication of cycling routes along busy roads and/or away from dedicated cycle infrastructure it was not a statistically significant predictor of cycling. Although not conclusive, this supports other research showing that cyclists are more sensitive to time taken than to pleasantness or safety when it concerns their daily commute (priorities may be different for a leisure ride).

Summed routes (street level detail)

Street level detail (OpenCycleMap)

 

More details of the analysis are available in the full dissertation (or short synopsis). Detailed 2011 census origin/destination data (table WF02 for OA/WZ) was only made available after the end of my MSc (and then only to academics for specific projects). Thus for the MSc, synthetic data was generated based on (publicly available) census data. However, a later reworking of the full analysis using the new WF02 census data gave very similar results showing that lack of public access to detailed statistics need not be a serious impediment to analysis.

Beyond the key MSc analysis, an interesting spin-off of all the cycle routing was the development of maps (see right and below) that sums the 4 most popular commute routes from the centroid of each census Output Area, giving a good indication of the number of cyclists along individual streets if all these people were to commute by bicycle.

Thanks again to CycleStreets for making the API available to enable this research project. Data processing was done in Python and SPSS with additional processing and map rendering in the open source QGIS package.

Richard Thomas

Editor’s note: We now have a batch routing system available which we’re keen to encourage for academic use like this. It can handle millions of combinations happily – not just the 16,000 combinations noted above!

Beautiful new galleries page unveiled

Monday, July 27th, 2015

We are pleased to unveil the new Galleries front page, which brings your beautiful photos and content to the front and centre. Galleries is a really neat feature to group cycling-related media for presentation or campaigning.

There is also a lot more flexibility available while adding a new gallery – you can now navigate away from the Create Gallery form to find more photos to add, and when you return all the fields will be exactly as you left them. You can even close your browser window and come back later, and the gallery creation form will still show your data as you left it.

As well as the graphical front end, our intern Patrick has been busy developing a new Galleries API for developers, which enables API calls to list and show the content of Galleries, and create and update Galleries.

We hope you enjoy browsing and adding to the Galleries.

Screen Shot 2015-07-27 at 17.13.12

Moving to Leaflet.js

Sunday, July 27th, 2014

This is a tech post mainly for our OpenStreetMap and techie users!

During recent months we’ve quietly been working on a major change behind the scenes in preparation for some large-changes to our web interface (which has long been in need of upgrading) and to prepare for a more mobile-friendly experience:

We’ve moved the large amount of our mapping code from OpenLayers 2 to Leaflet. This is the part of the site you see whenever you come across a map that you can drag around – the ‘slippy maps’. Last Monday, our commit “Removed OpenLayers” landed.

This has been quite a major undertaking, and a rather painful one at that. It has meant not only rewriting every bit of map javascript code, but also creating a new, second-generation API (data feed) using GeoJSON, as that is the native format that makes working with Leaflet so easy. In creating the V2 API, we’ve also had to keep every part of the old V1 API running perfectly so as not to break third-party mobile apps and sites that rely on it.

We had to rewrite Javascript modules for the every one of the types of slippy map used around on the site:

The V2 API (the technical interface to the underlying data that gets shown on the maps) emits data in the easily-parsable GeoJSON format. The V2 API, to be made public soon, is something we’ve wanted to do anyway for a while now. As we’ve moved to GeoJSON, we’ve found that throwing objects of all kinds onto a map is far easier compared to generating GML using XML DOM structures and writing Javascript to handle that.

When we launched CycleStreets back in 2009, GML was in vogue, and OpenLayers was the only real choice available. In fact, in 2009, many of the wonderful tools like Leaflet, jQuery, and autocomplete were either not available or were in their infancy. Now these tools are available, we no longer have to deal with the pain of generating XML DOM (for GML) structures and that is a very welcome relief.

It’s fair to say that we’ve always struggled with OpenLayers 2. OpenLayers is a very powerful map framework, basically letting you do almost anything on top of a map canvas, and with a very ‘correct’ object-orientated style. But with things like a standard web projection and GeoJSON standardisation now the norm for web mapping, the swiss-army-knife approach has not been ideal for us.

The force-point came for us when we ran into an intractable problem where a clickable layer of shop icons, used on a journey planner we run for a third party, had the odd behaviour that one of the two start/finish itinerary waypoint markers could not be moved if an icon had been clicked. We spent two days trying to debug this, even going as far as picking through the OpenLayers source code. Long ago we had learnt which of the five popup types to use, but we simply could not work out the mechanism for changing focus between layers. So we changed tack, generating GeoJSON for the icon layer and got a prototype working in Leaflet pretty quickly, and it ‘just worked’. From that point our V2 API project really got going.

It’s great to see that a new version of OpenLayers, OpenLayers 3, is in the works, which will undoubtedly take that very respected project forward. But for us, for now, Leaflet is where we plan to put our development focus.

PS The V2 API is going live shortly. All of our site is running from it and documentation is in place – we’ve just resolving the remaining few format issues now.

Our debugging view, now running from a GeoJSON data endpoint in our V2 API

Our debugging view, now running from a GeoJSON data endpoint in our V2 API.

The redesign upgrade project, of which the above work is part, has been possible thanks to part-funding from the Cambridge City Council Cycling & Walking Grants scheme, helping get more people cycling in Cambridge. We are most grateful to them for their support.

Space for Cycling – your infrastructure photos mapped

Friday, April 25th, 2014

CTC logoCTC, the national cycling charity, has launched a new cycling infrastructure map to help communicate what makes good conditions for cycling and where improvements need to be made. CTC have linked up with CycleStreets to ensure these locations are also saved to the CycleStreets Photomap. Chris Peck, CTC, explains this new initiative.

What is the Space for Cycling campaign?

Space For CyclingLondon Cycling Campaign created Space for Cycling, which in London is focussing on lobbying candidates in this year’s local elections. CTC is taking LCC’s London-born campaign nationwide, and is coordinating the campaign to seek commitments from local politicians to provide Space for Cycling, in conjunction with the Cyclenation federation of local campaign groups around the UK. The campaign is funded by a generous grant from the cycle industry’s ‘Bike Hub’ levy, run by the Bicycle Association, and by private donations.

Space for Cycling calls on councils to improve our streets so that anyone can cycle anywhere. But what does that mean in practice? CTC wants your photos and examples of infrastructure that’s good or bad to explain to councils what works, and what needs improvement.

You can submit the photos to the map, and write to councillors, challenging them to make Space for Cycling in your area.

Bus stop bypass
Space for Cycling in Brighton – bus stop bypasses on the Lewes Road

If you’ve got photos of examples of infrastructure for cycling – whether good or bad – CTC wants to see them.

We welcome your feedback, especially to report bugs or give us route feedback.

My comments relate to: *






Your comments: *
URL of page: * https://www.cyclestreets.net/footer.html
How did you find out about CycleStreets?:
Your name:
Our ref: Please leave blank - anti-spam measure

* Items marked with an asterisk [*] are required fields and must be fully completed.