Skip to main content
I am trying to convert some 5km tiles of OS Mastermap data to a raster TIFF, but need to include all of the styling as in the Ordnance Survey Mastermap user guide.

 

 

Has anybody managaed to convert this data, into any other format really, and include all of the styling?  If so how did you do it.

Did you ever find out how to do this?


@thomasm think you could use the MapnikRasterizer transformer but to really do the full OSMM styling could be quite a lot of work. I've seen this used to process other Ordnance Survey products to make a raster product. Depends how close you want to be to the user guide spec.


Its very possible in FME but be warned its a bit of a nightmare to sort out and can take a while.

My advice would be to sort out the OSCat field that combines multiple attributes to form a style code, this is included with the SQL scripts that are on the OS website.

https://github.com/OrdnanceSurvey/OSMM-Topography-Layer-stylesheets/tree/master/Schema%20version%209/SQL

https://www.ordnancesurvey.co.uk/resources/carto-design/cartographic-stylesheets.html

If not you will need to do something very similar in FME that equates to a large case (if/else statement) statement, the AttributeValueMapper or the Conditional Value settings within an attribute creator will do what you need. An example being:

WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 'Natural Fill' (or you could swap natural fill with a colour depending on your setup.)

Creating all these case statements into FME is quite a large undertaking but fairly simple to do.

In the example attached i have assigned a style attribute which has a styling already attributed to it, but you could use this if-else statement to hard code the styling in. You would have to read through each part of the styling files available on the OS web page, i.e.

<Fill>
<CssParameter name="fill">#d2ffb4</CssParameter>
</Fill>

From this you know the colour is hex - #d2ffb4, use this web site to convert to FME colour -

http://www.tydac.ch/color/

I hope that makes sense and sends you in the right direction. I think you might be better off styling the data in QGis as you can land the qml files straight into Qgis and from there output an image. BUt if you want to create an FME work bench that will generate an image of different regions this is where to start.


Its very possible in FME but be warned its a bit of a nightmare to sort out and can take a while.

My advice would be to sort out the OSCat field that combines multiple attributes to form a style code, this is included with the SQL scripts that are on the OS website.

https://github.com/OrdnanceSurvey/OSMM-Topography-Layer-stylesheets/tree/master/Schema%20version%209/SQL

https://www.ordnancesurvey.co.uk/resources/carto-design/cartographic-stylesheets.html

If not you will need to do something very similar in FME that equates to a large case (if/else statement) statement, the AttributeValueMapper or the Conditional Value settings within an attribute creator will do what you need. An example being:

WHEN descriptivegroup = 'General Surface' AND make = 'Natural' THEN 'Natural Fill' (or you could swap natural fill with a colour depending on your setup.)

Creating all these case statements into FME is quite a large undertaking but fairly simple to do.

In the example attached i have assigned a style attribute which has a styling already attributed to it, but you could use this if-else statement to hard code the styling in. You would have to read through each part of the styling files available on the OS web page, i.e.

<Fill>
<CssParameter name="fill">#d2ffb4</CssParameter>
</Fill>

From this you know the colour is hex - #d2ffb4, use this web site to convert to FME colour -

http://www.tydac.ch/color/

I hope that makes sense and sends you in the right direction. I think you might be better off styling the data in QGis as you can land the qml files straight into Qgis and from there output an image. BUt if you want to create an FME work bench that will generate an image of different regions this is where to start.

 

oh and sorry forgot to mention, the mapnik rasterizer is where to go as mark1_spatial mentioned. Mapnik can read FME_color value, so assign the color value to an attribute and then use the drop down in mapnik to asign that colour, do the same for line thickness, marker symbol etc. You can use SVGs to render point geometry markers (svgs available on OS website), however the natural fills are going to be very difficult to do, you might have to just paint them all green.


Reply