Page Properties | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Overview
The Department for Environment Food & Rural Affairs (DEFRA) provide a wealth of data such as Sites of Special Scientific Interest (SSSI) in ESRI FeatureServer format which may be downloaded to your Spatial Data Warehouse (SDW) as GeoJSON. This may then be transformed into ESRI Shape, MapInfo TAB etc. files for displaying in iShare.
Step-by-step guide
Step 1 - Find URL for the FeatureServer Layer you are interested in
Brose to https://environment.data.gov.uk/ and search for the dataset you want. For this example we've used Sites of Special Scientific Interest (England) which, when you select it from the search results, should take you to a page like this.
...
The URL (highlighted in red in the above image) is https://environment.data.gov.uk/arcgis/rest/services/NE/SitesOfSpecialScientificInterestEngland/FeatureServer and this is what you need to import download the data.
Step 2 - Determine the Bounding Box for your dataset
As the DEFRA dataset is for the whole of England you will probably only need the data for your area. Usually your iShare Maps / GIS will have Start up Boundary Settings (Min X, Min Y, Max X, Max Y). You can use these values to cookie cut the data.
Step 3 - Create a Workflow Program Task to Import the data
First you need to configure a Program Task in Studio to import In Studio create a Program Task to download the data from DEFRA.
Uses Give the Task a Name.
The Program you need to use to download the data is ogr2ogr.exe so you need to browse to where this is installed. This is usually D:\Astun\Tools\OGR2.2.1\ogr2ogr.exe (or whichever version of ogr2ogr is installed)
In the Additional parameters you need to pass the following information:
Code Block |
---|
-f GeoJSON E:\iShareData\{new_layer}.geojson {featureserver URL} |
Where: is the path to where you wish to save your GeoJSON file
E:\iShareData\ | Is the path to where you wish to save your GeoJSON file |
{new_layer} | Is the name for your new GeoJSON file. |
{featureserver URL |
...
} | This is the URL you have noted in Step 1 together with the geometry information e.g. "http://environment.data.gov.uk/arcgis/rest/services/NE/SitesOfSpecialScientificInterestEngland/FeatureServer/0/query?geometry="xMin:"293890.40,"yMin":461082.70,"xMax:"389794.00,"yMax":588517.40,"spatialreference":{"wkid":27700}}&geometryType=esriGeometryEnvelope&outfields=*&f=json". You need to replace the values in red with the bounding box information you gathered in Step 2. |
You should end up with an entry something like this.
Paste code macro |
---|
f GeoJSON E:\iShareData\SSSI.geojson "http://environment.data.gov.uk/arcgis/rest/services/NE/ |
...
SitesOfSpecialScientificInterestEngland/FeatureServer/0/query? |
...
geometry="xMin:"293890.40,"yMin":461082.70,"xMax:"389794.00,"yMax":588517.40,"spatialreference":{"wkid":27700}} |
...
&geometryType=esriGeometryEnvelope |
...
&outfields=* |
...
&f=json" |
...
To get the featureserver layer name and firstly go to https://environment.data.gov.uk/
...
Step 4 - Create a Spatial Data Transformation Task
In Studio create a Spatial Data Transformation Task to load the GeoJSON into a SDW PostGIS table. You could also output as an ESRI Shape file or MapInfo tab file by selecting different Output.
Enter a Name for the Task and pick GeoJSON File as the Source Data.
Note | ||
---|---|---|
If GeoJSON File does not exist in the list of "Source Data" types then you will need to edit the ConTypes.xml file, which you will find in the ...Astun\iShare\n.n\Studio\config folder. If you open ConTypes.xml with a text editor you will see options for DBConTypes (servers, such as PostgreSQL and Oracle) and FileConTypes (file formats such as shapefile or mapinfo tab). Create a new FileConType entry after the last closing </FileConType> tag (but before the closing </ConnectionTypes> tag as follows:
|
Select the type of Output you require and Save the Task.