This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE osmm_topo.topographicline ADD COLUMN style_description VARCHAR; | |
COMMIT; | |
ALTER TABLE osmm_topo.topographicline ADD COLUMN style_code INTEGER; | |
COMMIT; | |
CREATE INDEX fc_topoline_idx ON osmm_topo.topographicline(featurecode); | |
COMMIT; | |
UPDATE osmm_topo.topographicline SET (style_description, style_code) = ('Building Overhead Line', 10) WHERE style_code IS NULL AND featurecode = '10019' AND physicalpresence = 'Overhead'; --Must appear above Building Outline | |
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE osmm_topo.topographicpoint ADD COLUMN style_description VARCHAR; | |
COMMIT; | |
ALTER TABLE osmm_topo.topographicpoint ADD COLUMN style_code INTEGER; | |
COMMIT; | |
UPDATE osmm_topo.topographicpoint SET (style_description, style_code) = ('Triangulation Point Or Pillar', 11) WHERE style_code IS NULL AND descriptiveterm = '{"Triangulation Point Or Pillar"}'; --Must appear above Structure, 5 because it has the same featurecode | |
COMMIT; | |
UPDATE osmm_topo.topographicpoint SET (style_description, style_code) = ('Spot Height', 1) WHERE style_code IS NULL AND featurecode = '10197'; | |
COMMIT; | |
UPDATE osmm_topo.topographicpoint SET (style_description, style_code) = ('Culvert', 2) WHERE style_code IS NULL AND featurecode = '10085'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE osmm_topo.cartographicsymbol ADD COLUMN style_description VARCHAR; | |
COMMIT; | |
ALTER TABLE osmm_topo.cartographicsymbol ADD COLUMN style_code INTEGER; | |
COMMIT; | |
UPDATE osmm_topo.cartographicsymbol SET (style_description, style_code) = ('Culvert', 1) WHERE style_code IS NULL AND featurecode = '10091'; | |
COMMIT; | |
UPDATE osmm_topo.cartographicsymbol SET (style_description, style_code) = ('Direction Of Flow', 2) WHERE style_code IS NULL AND featurecode = '10082'; | |
COMMIT; | |
UPDATE osmm_topo.cartographicsymbol SET (style_description, style_code) = ('Boundary Half Mereing', 3) WHERE style_code IS NULL AND featurecode = '10130'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY (SELECT count(*) as total_count, featurecode, descriptiveterm FROM osmm_topo.boundaryline GROUP BY featurecode, descriptiveterm ORDER BY total_count DESC) TO 'C:/temp/boundaryline.csv' WITH CSV HEADER; | |
ALTER TABLE osmm_topo.boundaryline ADD COLUMN style_description VARCHAR; | |
COMMIT; | |
ALTER TABLE osmm_topo.boundaryline ADD COLUMN style_code INTEGER; | |
COMMIT; | |
UPDATE osmm_topo.boundaryline SET (style_description, style_code) = ('Parish Boundary', 1) WHERE style_code IS NULL AND featurecode = '10136'; | |
COMMIT; | |
UPDATE osmm_topo.boundaryline SET (style_description, style_code) = ('District Boundary', 2) WHERE style_code IS NULL AND featurecode = '10131'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE SCHEMA openmaplocal; | |
COMMIT; | |
CREATE TABLE openmaplocal.building | |
( | |
ogc_fid serial NOT NULL, | |
wkb_geometry geometry(MultiPolygon,27700), | |
id character varying, | |
featcode double precision, | |
CONSTRAINT building_pkey PRIMARY KEY (ogc_fid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE osmm.boundaryline ADD COLUMN os_cat VARCHAR; | |
UPDATE osmm.boundaryline | |
SET os_cat = (CASE | |
WHEN (descriptivegroup ='{"Political Or Administrative"}' and descriptiveterm ='{County}' and physicalpresence ='Boundary') then 'boundaryCounty' | |
WHEN (descriptivegroup ='{"Political Or Administrative"}' and descriptiveterm ='{District}' and physicalpresence ='Boundary') then 'boundaryDistrict' | |
WHEN (descriptivegroup ='{"Political Or Administrative"}' and descriptiveterm ='{Electoral}' and physicalpresence ='Boundary') then 'boundaryElectoral' | |
WHEN (descriptivegroup ='{"Political Or Administrative"}' and descriptiveterm ='{Parish}' and physicalpresence ='Boundary') then 'boundaryParish' | |
WHEN (descriptivegroup ='{"Political Or Administrative"}' and descriptiveterm ='{Parliamentary}' and physicalpresence ='Boundary') then 'boundaryParliamentary' | |
ELSE 'boundaryUnknown' | |
END) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Background | |
OS VectorMap District is made up of 23 layers of data ranging from woodland to tidal water to POI features. | |
Ordnance Survey released a number of Style Layer Descriptors (SLDs). These SLDs although they can be imported and used to style the data within QGIS several of the SLDs need editing. There also needs to be some post processing applied to the data in order to render as a cartographic product. | |
Firstly, I want to use the Dft NUmber and the Road name as a label so I added a new column and created a concatenated string using the SQL commands below. | |
ALTER TABLE vmd.road ADD COLUMN roadinfo VARCHAR; | |
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following is a guide for post processing OS VectorMap Local so that it can be rendered within QGIS. | |
We need X Y coordinates so we can use the anchor position | |
ALTER TABLE vml.text ADD COLUMN x_coordinate NUMERIC; | |
COMMIT; | |
update vml.text set x_coordinate = ST_X(wkb_geometry); | |
COMMIT; | |
ALTER TABLE vml.text ADD COLUMN y_coordinate NUMERIC; |