Can I get GDP history in JSON format from ONS API? - ons-api

I'd like to create some dynamic graphs charting UK GDP movements over the last couple of years with a library such as D3.
Is it possible to get GDP related info via the ONS API ?

Some GDP-related datasets are available in JSON-Stat via the OpenAPI e.g. http://web.ons.gov.uk/ons/api/data/dataset/RegGVA02.json?context=Economic&jsontype=json-stat&apikey=12345&geog=2015EUROSTATH&diff=&totals=false
However if you just want a simple timeseries, the main ONS web site is a good shout. If you go to https://www.ons.gov.uk/economy/grossdomesticproductgdp
you'll get a list of GDP-related time series. When you find the one you want, append /data to the URL to get the underlying numbers in JSON.
E.g. https://www.ons.gov.uk/economy/grossdomesticproductgdp/timeseries/ybha/edp2/data

Related

Extracting Polygons from Online Map

The below linked map contains a number of layers which I would like to be able to extract as polygons [if possible]. I've not previously done any web-scraping and realise that doing so in regards to the geographic data on this system represents a significant challenge.
Ideally I would only want to extract the data relating to the 'Shopping Local Centre' category.
Happy to try to use Phython or R to achieve such, just wondered if anyone had any ideas.....
Web scraping (using BeautifulSoup, for example) would get you the HTML objects from a webpage. You would need basic knowledge of Python for this.
Or you could avoid that by going this route:
With QGIS and Geofabrik you can gather retail location polygons and their attributes of a given area.
Use Geofabrik to download your area of interest in *.shp (shapefile) format. It looks like you're in Greater Manchester, so I navigated to the download page here (it's a 50MB file for the greater-manchester-latest-free.shp.zip).
Once you download that, open it in QGIS and you'll see in the attributes it has retail locations.
That site is using WMS to display the map (I work for the company that makes iShare) so there is no vector content for you to scrape as it works entirely with images.
The easiest way to get the data would be to ask the council to provide it, you might need to make it a freedom of information request but they should be happy to provide the data in a usable GIS format.

IMPORTHTML / Table Pull Issues [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
Trying to import weather forecasts for multiple sales markets, but the site I was using blocked Bot Crawl, so my ImportHTML function can't fetch the URL.
I found another site, but the table is formatted in calendar view instead of the list view.
Can I still pull this information into Google Sheets (GS) somehow? I've gotten it to pull information, but it just comes up as [TABLE] in GS.
This is the code I was using to pull changing dates:
=CONCATENATE("https://www.wunderground.com/calendar/us/ca/eureka/KACV/date/",$B$3,"-",$C$3,"?cm_ven=localwx_calendar")
And the code to pull the completed URL's table into GS:
=IMPORTHTML(A2, "Table", 1)
I want the first string of code to pull today's year and month from B3 and C3, and Concatenate, and then the second string of code pulls all that together and then pulls the desired table from the website, but I get a bunch of cells with [TABLE].
There is an API that returns json. Look into documentation to see if there is an endpoint that meets your needs. For example, network tab shows the following for 15 day forecast
https://api.weather.com/v3/wx/forecast/daily/15day?language=en-US&apiKey=6532d6454b8aa370768e63d6ba5a832e&geocode=40.95%2C-124.11&units=e&format=json
You would probably need to write your own script to handle this response though or use a tool like ImportJSON. With a little research it is highly likely you will find something suitable.
Explore 15 day forecast JSON here

Create dashboard views that are based off of current date (ie. show resource overview for next 2 months)

I'm attempting to create a report that is based off the current date. So, for example, creating a line graph that shows total work for all resources for the next 2 months. It would be very similar to the resource overview dashboard, but it wouldn't be pulling in data from the entire project.
The 'Resource Usage' view below has been very helpful, as it would be visual aids based on the hour allocations below.
We can create a graph like the one below in the reporting module, I would like the graph to only look at the next 2 months (instead of the entire project duration).
The goal is to look at capacity and future work allocation to easily look at resource availability to aid in assigning future tasks.
Thoughts? Tips? Advice?
You should be able to use the built-in Report capability in MS Project 2016. Try modifying the Progress Versus Cost chart in the Cost Overview report.

How to time-enable a raster layer using ArcGIS Javascript API?

I have a set of raster layers that cover the same place, over different years. I want to display it on my website using the timeslider so that I can clearly view the changes between rasters over different years. However, the example given by ESRI site is based on featurelayer, and I have a raster layer. How can I make the raster layer time-aware?
If you currently have multiple raster layers, you will need to convert them to a single layer that also happens to be time-aware.
Esri Support wrote a blog post about this -- back in 2011, but the principles should still work -- and a GIS StackExchange question covers publication of time-aware datasets as an image service. To summarize their workflow:
Create a new mosaic dataset or raster catalog. Add the individual rasters in.
Add a new field, of type date (e.g. year).
Populate year with values.
Enable time on the layer, and publish it as an image service.
The Esri JavaScript API example will help with implementation, once you've got everything configured and published.

How to modify weather information displayed on google map

I have created a google map displaying markers and the weather layer using Google Maps API V3.
The weather layer is great for displaying weather information at well-known locations; however, for my map I only care about the wind speed rather than the forecast (ex. sunny, rainy, etc). Is there any way to modify the weather layer so that it displays "wind: s 5m/s" directly on the map instead of the sun/rain icon?
I realize that you can click on the icon to get the wind information but given that we do not care about the actual weather, we do not want people to have to click to get that. Instead we want the wind displayed directly.
(If it is not possible, then any alternative suggestions would be greatly appreciated as well :) )
I made a Weather API available on mashape, and they have a ready to use simple PHP SDK.
This api is really simple to use because we use the cool standards that are available nowadays, like JSON and REST.
If you like it please give it a try on mashape
I've tried but haven't found a way to change how the weather icons look when they are loaded.
It is possible (as you may know) to create a custom overlay using discrete weather data items (like wind speed) when a weather icon is clicked but that wouldn't seem to solve your problem.
See" "google.maps.weather.WeatherConditions object specification" in the V3 API reference
Like many of these kinds of things, I imagine it is theoretically possible to scan the DOM, find the weather 'markers', extract the info you want and redraw them as you wish them to look, but you may (unsure about this) find that the weather icons are actually images and data like wind speed doesn't actually exist in the DOM until the weather icon is clicked: The discrete data may be the product of an ajax load in response to the click event. Even if you got a DOM crawler to work it could be broken by a new release of the API and you'd never know what hit you.
Best bet may be to submit a change request to the API developers asking for the ability to format the weather icons and specify their content.
or
Use some other online source of json or xml weather data and create your own weather markers, labels, or whatever on your map.
Sorry I can't provide a more constructive answer :-(

Resources