Skip to content

Commit

Permalink
1st commit
Browse files Browse the repository at this point in the history
  • Loading branch information
charleyglynn committed Jul 22, 2015
0 parents commit fdb3b72
Show file tree
Hide file tree
Showing 84 changed files with 19,494 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##OS MasterMap Topography Layer SQL & stylesheets

This repository contains database SQL scripts and cartographic stylesheets for styling OS MasterMap Topography Layer. Our hope is for this new method to become the standard way to post process the data so that styling OS MasterMap Topography Layer is far simpler and easier than before. It will also enable all of our customers and partners to utilise the released cartographic stylesheets.

##Licence

The contents of this repository are licensed under the [Open Government Licence 3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/)

![Logo](http://www.nationalarchives.gov.uk/images/infoman/ogl-symbol-41px-retina-black.png "OGL logo")

1 change: 1 addition & 0 deletions Schema version 7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You will need to apply the post processing SQL scripts before you will be able to style OS MasterMap Topography Layer with the different styles in the Stylesheets folder
18 changes: 18 additions & 0 deletions Schema version 7/SQL/Oracle/boundaryline_update_string.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
UPDATE osmm_topo.boundaryline SET style_description =
CASE
WHEN featurecode = 10136 THEN 'Parish Boundary'
WHEN featurecode = 10131 THEN 'District Boundary'
WHEN featurecode = 10128 THEN 'Electoral Boundary'
WHEN featurecode = 10127 THEN 'County Boundary'
WHEN featurecode = 10135 THEN 'Parliamentary Boundary'
ELSE 'Unclassified'
END,
style_code =
CASE
WHEN featurecode = 10136 THEN 1
WHEN featurecode = 10131 THEN 2
WHEN featurecode = 10128 THEN 3
WHEN featurecode = 10127 THEN 4
WHEN featurecode = 10135 THEN 5
ELSE 99
END;
20 changes: 20 additions & 0 deletions Schema version 7/SQL/Oracle/cartographicsymbol_update_string.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
UPDATE osmm_topo.cartographicsymbol SET style_description =
CASE
WHEN featurecode = 10091 THEN 'Culvert Symbol'
WHEN featurecode = 10082 THEN 'Direction Of Flow Symbol'
WHEN featurecode = 10130 THEN 'Boundary Half Mereing Symbol'
WHEN featurecode = 10066 OR featurecode = 10170 THEN 'Bench Mark Symbol'
WHEN featurecode = 10165 THEN 'Railway Switch Symbol'
WHEN featurecode = 10177 THEN 'Road Related Flow Symbol'
ELSE 'Unclassified'
END,
style_code =
CASE
WHEN featurecode = 10091 THEN 1
WHEN featurecode = 10082 THEN 2
WHEN featurecode = 10130 THEN 3
WHEN featurecode = 10066 OR featurecode = '10170' THEN 4
WHEN featurecode = 10165 THEN 5
WHEN featurecode = 10177 THEN 6
ELSE 99
END;
121 changes: 121 additions & 0 deletions Schema version 7/SQL/Oracle/cartographictext_update_string.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
UPDATE osmm_topo.cartographictext SET style_description =
CASE
WHEN INSTR(descriptivegroup, 'Buildings Or Structure') > 0 THEN 'Building Text'
WHEN INSTR(descriptivegroup, 'Inland Water') > 0 THEN 'Water Text'
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 THEN 'Road Text'
WHEN descriptivegroup = 'Terrain And Height' THEN 'Height Text'
WHEN INSTR(descriptivegroup, 'Roadside') > 0 THEN 'Roadside Text'
WHEN INSTR(descriptivegroup, 'Structure') > 0 THEN 'Structure Text'
WHEN descriptivegroup = 'Political Or Administrative' THEN 'Administrative Text'
WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 'General Surface Natural Text'
WHEN descriptivegroup = 'General Surface' AND make = 'Manmade' OR descriptivegroup = 'General Surface' AND make IS NULL THEN 'General Surface Manmade Text'
WHEN descriptivegroup = 'Landform' and make = 'Natural' THEN 'Landform Natural Text'
WHEN descriptiveterm = 'Foreshore' THEN 'Foreshore Text'
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 THEN 'Tidal Water Text'
WHEN descriptivegroup = 'Built Environment' THEN 'Built Environment Text'
WHEN INSTR(descriptivegroup, 'Historic Interest') > 0 THEN 'Historic Text'
WHEN descriptivegroup = 'Rail' THEN 'Rail Text'
WHEN INSTR(descriptivegroup, 'General Feature') > 0 THEN 'General Feature Text'
WHEN descriptivegroup = 'Landform' and make = 'Manmade' THEN 'Landform Manmade Text'
ELSE 'Unclassified'
END,
style_code =
CASE
WHEN INSTR(descriptivegroup, 'Buildings Or Structure') > 0 THEN 1
WHEN INSTR(descriptivegroup, 'Inland Water') > 0 THEN 2
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 THEN 3
WHEN descriptivegroup = 'Terrain And Height' THEN 4
WHEN INSTR(descriptivegroup, 'Roadside') > 0 THEN 5
WHEN INSTR(descriptivegroup, 'Structure') > 0 THEN 6
WHEN descriptivegroup = 'Political Or Administrative' THEN 7
WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 8
WHEN descriptivegroup = 'General Surface' AND make = 'Manmade' OR descriptivegroup = 'General Surface' AND make IS NULL THEN 9
WHEN descriptivegroup = 'Landform' and make = 'Natural' THEN 10
WHEN descriptiveterm = 'Foreshore' THEN 11
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 THEN 12
WHEN descriptivegroup = 'Built Environment' THEN 13
WHEN INSTR(descriptivegroup, 'Historic Interest') > 0 THEN 14
WHEN descriptivegroup = 'Rail' THEN 15
WHEN INSTR(descriptivegroup, 'General Feature') > 0 THEN 16
WHEN descriptivegroup = 'Landform' and make = 'Manmade' THEN 17
ELSE 99
END,
colour_code =
CASE
WHEN INSTR(descriptivegroup, 'Buildings Or Structure') > 0 THEN 1
WHEN INSTR(descriptivegroup, 'Inland Water' THEN 2
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 THEN 1
WHEN descriptivegroup = 'Terrain And Height' THEN 3
WHEN INSTR(descriptivegroup, 'Roadside') > 0 THEN 1
WHEN INSTR(descriptivegroup, 'Structure') > 0 THEN 1
WHEN descriptivegroup = 'Political Or Administrative' THEN 5
WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 1
WHEN descriptivegroup = 'General Surface' AND make = 'Manmade' OR descriptivegroup = 'General Surface' AND make IS NULL THEN 1
WHEN descriptivegroup = 'Landform' and make = 'Natural' THEN 4
WHEN descriptiveterm = 'Foreshore' THEN 4
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 THEN 2
WHEN descriptivegroup = 'Built Environment' THEN 1
WHEN INSTR(descriptivegroup, 'Historic Interest') > 0 THEN 1
WHEN descriptivegroup = 'Rail' THEN 1
WHEN INSTR(descriptivegroup, 'General Feature') > 0 THEN 1
WHEN descriptivegroup = 'Landform' and make = 'Manmade' THEN 4
ELSE 1
END,
font_code =
CASE
WHEN INSTR(descriptivegroup, 'Buildings Or Structure') > 0 THEN 1
WHEN INSTR(descriptivegroup, 'Inland Water') > 0 THEN 2
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 THEN 1
WHEN descriptivegroup = 'Terrain And Height' THEN 1
WHEN INSTR(descriptivegroup, 'Roadside') > 0 THEN 1
WHEN INSTR(descriptivegroup, 'Structure') > 0 THEN 1
WHEN descriptivegroup = 'Political Or Administrative' THEN 1
WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 1
WHEN descriptivegroup = 'General Surface' AND make = 'Manmade' OR descriptivegroup = 'General Surface' AND make IS NULL THEN 1
WHEN descriptivegroup = 'Landform' and make = 'Natural' THEN 1
WHEN descriptiveterm = 'Foreshore' THEN 1
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 THEN 2
WHEN descriptivegroup = 'Built Environment' THEN 1
WHEN INSTR(descriptivegroup, 'Historic Interest') > 0 THEN 3
WHEN descriptivegroup = 'Rail' THEN 1
WHEN INSTR(descriptivegroup, 'General Feature') > 0 THEN 1
WHEN descriptivegroup = 'Landform' and make = 'Manmade' THEN 1
ELSE 1
END,
rotation = (orientation/10),
geo_x =
CASE
WHEN anchorposition = 0 THEN 0
WHEN anchorposition = 1 THEN 0
WHEN anchorposition = 2 THEN 0
WHEN anchorposition = 3 THEN 0.5
WHEN anchorposition = 4 THEN 0.5
WHEN anchorposition = 5 THEN 0.5
WHEN anchorposition = 6 THEN 1
WHEN anchorposition = 7 THEN 1
WHEN anchorposition = 8 THEN 1
END,
geo_y =
CASE
WHEN anchorposition = 0 THEN 0
WHEN anchorposition = 1 THEN 0.5
WHEN anchorposition = 2 THEN 1
WHEN anchorposition = 3 THEN 0
WHEN anchorposition = 4 THEN 0.5
WHEN anchorposition = 5 THEN 1
WHEN anchorposition = 6 THEN 0
WHEN anchorposition = 7 THEN 0.5
WHEN anchorposition = 8 THEN 1
END,
anchor =
CASE
WHEN anchorposition = 0 THEN 'SW'
WHEN anchorposition = 1 THEN 'W'
WHEN anchorposition = 2 THEN 'NW'
WHEN anchorposition = 3 THEN 'S'
WHEN anchorposition = 4 THEN ' '
WHEN anchorposition = 5 THEN 'N'
WHEN anchorposition = 6 THEN 'SE'
WHEN anchorposition = 7 THEN 'E'
WHEN anchorposition = 8 THEN 'NE'
END;
80 changes: 80 additions & 0 deletions Schema version 7/SQL/Oracle/topographicarea_update_string.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
UPDATE osmm_topo.topographicarea SET style_description =
CASE
WHEN INSTR(descriptivegroup, 'Building') > 0 AND descriptiveterm IS NULL THEN 'Building Fill'
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm = 'Multi Surface' THEN 'Multi Surface Fill'
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm IS NULL AND make = 'Natural' THEN 'Natural Fill'
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 AND descriptiveterm IS NULL AND make = 'Manmade' THEN 'Road Or Track Fill'
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm IS NULL AND (make = 'Manmade' OR make = 'Unknown') THEN 'Manmade Fill'
WHEN INSTR(descriptivegroup, 'Roadside') > 0 AND make = 'Natural' THEN 'Roadside Natural Fill'
WHEN INSTR(descriptivegroup, 'Roadside') > 0 AND make = 'Manmade' THEN 'Roadside Manmade Fill'
WHEN INSTR(descriptivegroup, 'Inland Water') > 0 AND descriptiveterm IS NULL THEN 'Inland Water Fill'
WHEN INSTR(descriptivegroup, 'Path') > 0 AND descriptiveterm IS NULL THEN 'Path Fill'
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 AND descriptiveterm = 'Track' THEN 'Track Fill'
WHEN descriptiveterm = 'Slope' THEN 'Slope Fill'
WHEN INSTR(descriptivegroup, 'Structure') > 0 AND (descriptiveterm IS NULL OR descriptiveterm = 'Upper Level Of Communication' OR descriptiveterm = 'Overhead Construction') THEN 'Structure Fill'
WHEN descriptiveterm = 'Cliff' THEN 'Cliff Fill'
WHEN descriptiveterm = 'Step' THEN 'Step Fill'
WHEN descriptiveterm = 'Foreshore' THEN 'Foreshore Fill'
WHEN descriptiveterm = 'Traffic Calming' THEN 'Traffic Calming Fill'
WHEN descriptivegroup = 'Glasshouse' THEN 'Glasshouse Fill'
WHEN INSTR(descriptivegroup, 'Rail') > 0 AND descriptiveterm IS NULL AND make = 'Natural' THEN 'Rail Natural Fill'
WHEN descriptiveterm = 'Pylon' THEN 'Pylon Fill'
WHEN INSTR(descriptivegroup, 'Building') > 0 AND descriptiveterm = 'Archway' THEN 'Archway Fill'
WHEN INSTR(descriptivegroup, 'Landform') > 0 AND make = 'Natural' THEN 'Landform Natural Fill'
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 AND descriptiveterm IS NULL THEN 'Tidal Water Fill'
WHEN INSTR(descriptivegroup, 'Landform') > 0 AND make = 'Manmade' THEN 'Landform Manmade Fill'
WHEN descriptivegroup = 'Rail' AND (make = 'Manmade' OR make = 'Unknown') THEN 'Rail Manmade Fill'
WHEN (INSTR(descriptiveterm, 'Nonconiferous Trees') > 0 OR INSTR(descriptiveterm,'Nonconiferous Trees (Scattered)') > 0) AND (INSTR(descriptiveterm, 'Coniferous Trees') > 0 OR INSTR(descriptiveterm , 'Coniferous Trees (Scattered)') > 0) THEN 'Mixed Woodland Fill'
WHEN INSTR(descriptiveterm, 'Nonconiferous Trees') > 0 OR INSTR(descriptiveterm, 'Nonconiferous Trees (Scattered)') > 0 THEN 'Nonconiferous Tree Fill'
WHEN INSTR(descriptiveterm, 'Coniferous Trees') > 0 OR INSTR(descriptiveterm, 'Coniferous Trees (Scattered)') > 0 THEN 'Coniferous Tree Fill'
WHEN INSTR(descriptiveterm, 'Orchard') > 0 THEN 'Orchard Fill'
WHEN INSTR(descriptiveterm, 'Coppice Or Osiers') > 0 THEN 'Coppice Or Osiers Fill'
WHEN INSTR(descriptiveterm, 'Scrub') > 0 THEN 'Scrub Fill'
WHEN INSTR(descriptiveterm, 'Boulders') > 0 OR INSTR(descriptiveterm, 'Boulders (Scattered)') > 0 THEN 'Boulders Fill'
WHEN INSTR(descriptiveterm, 'Rock') > 0 OR INSTR(descriptiveterm, 'Rock (Scattered)') > 0 THEN 'Rock Fill'
WHEN INSTR(descriptiveterm, 'Scree') > 0 THEN 'Scree Fill'
WHEN INSTR(descriptiveterm, 'Rough Grassland') > 0 THEN 'Rough Grassland Fill'
WHEN INSTR(descriptiveterm, 'Heath') > 0 THEN 'Heath Fill'
WHEN INSTR(descriptiveterm, 'Marsh Reeds Or Saltmarsh') > 0 THEN 'Marsh Fill'
ELSE 'Unclassified'
END,
style_code =
CASE
WHEN INSTR(descriptivegroup, 'Building') > 0 AND descriptiveterm IS NULL THEN 1
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm = 'Multi Surface' THEN 2
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm IS NULL AND make = 'Natural' THEN 3
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 AND descriptiveterm IS NULL AND make = 'Manmade' THEN 4
WHEN INSTR(descriptivegroup, 'General Surface') > 0 AND descriptiveterm IS NULL AND (make = 'Manmade' OR make = 'Unknown') THEN 5
WHEN INSTR(descriptivegroup, 'Roadside') > 0 AND make = 'Natural' THEN 6
WHEN INSTR(descriptivegroup, 'Roadside') > 0 AND make = 'Manmade' THEN 7
WHEN INSTR(descriptivegroup, 'Inland Water') > 0 AND descriptiveterm IS NULL THEN 8
WHEN INSTR(descriptivegroup, 'Path') > 0 AND descriptiveterm IS NULL THEN 9
WHEN INSTR(descriptivegroup, 'Road Or Track') > 0 AND descriptiveterm = 'Track' THEN 10
WHEN descriptiveterm = 'Slope' THEN 11
WHEN INSTR(descriptivegroup, 'Structure') > 0 AND (descriptiveterm IS NULL OR descriptiveterm = 'Upper Level Of Communication' OR descriptiveterm = 'Overhead Construction') THEN 12
WHEN descriptiveterm = 'Cliff' THEN 13
WHEN descriptiveterm = 'Step' THEN 14
WHEN descriptiveterm = 'Foreshore' THEN 15
WHEN descriptiveterm = 'Traffic Calming' THEN 16
WHEN descriptivegroup = 'Glasshouse' THEN 17
WHEN INSTR(descriptivegroup, 'Rail') > 0 AND descriptiveterm IS NULL AND make = 'Natural' THEN 18
WHEN descriptiveterm = 'Pylon' THEN 19
WHEN INSTR(descriptivegroup, 'Building') > 0 AND descriptiveterm = 'Archway' THEN 20
WHEN INSTR(descriptivegroup, 'Landform') > 0 AND make = 'Natural' THEN 21
WHEN INSTR(descriptivegroup, 'Tidal Water') > 0 AND descriptiveterm IS NULL THEN 22
WHEN INSTR(descriptivegroup, 'Landform') > 0 AND make = 'Manmade' THEN 23
WHEN descriptivegroup = 'Rail' AND (make = 'Manmade' OR make = 'Unknown') THEN 24
WHEN (INSTR(descriptiveterm, 'Nonconiferous Trees') > 0 OR INSTR(descriptiveterm,'Nonconiferous Trees (Scattered)') > 0) AND (INSTR(descriptiveterm, 'Coniferous Trees') > 0 OR INSTR(descriptiveterm , 'Coniferous Trees (Scattered)') > 0) THEN 25
WHEN INSTR(descriptiveterm, 'Nonconiferous Trees') > 0 OR INSTR(descriptiveterm, 'Nonconiferous Trees (Scattered)') > 0 THEN 26
WHEN INSTR(descriptiveterm, 'Coniferous Trees') > 0 OR INSTR(descriptiveterm, 'Coniferous Trees (Scattered)') > 0 THEN 27
WHEN INSTR(descriptiveterm, 'Orchard') > 0 THEN 28
WHEN INSTR(descriptiveterm, 'Coppice Or Osiers') > 0 THEN 29
WHEN INSTR(descriptiveterm, 'Scrub') > 0 THEN 30
WHEN INSTR(descriptiveterm, 'Boulders') > 0 OR INSTR(descriptiveterm, 'Boulders (Scattered)') > 0 THEN 31
WHEN INSTR(descriptiveterm, 'Rock') > 0 OR INSTR(descriptiveterm, 'Rock (Scattered)') > 0 THEN 32
WHEN INSTR(descriptiveterm, 'Scree') > 0 THEN 33
WHEN INSTR(descriptiveterm, 'Rough Grassland') > 0 THEN 34
WHEN INSTR(descriptiveterm, 'Heath') > 0 THEN 35
WHEN INSTR(descriptiveterm, 'Marsh Reeds Or Saltmarsh') > 0 THEN 36
ELSE 99
END;
Loading

0 comments on commit fdb3b72

Please sign in to comment.