The plugin has a number of examples that show usage with image hosting platforms, like Google Photos and Instagram, which have assicaited API’s for returning information about the image in question.
I was however keen to host the sollution completely myself, so simply have a folder of images that would populate on the map if they had exif GPS information.
OS MasterMap has an annotation layer, which is simple to symbolise in a GIS program. But becomes more difficult in CAD software.
With ogr2org, when writing a DXF file, if you have an input point geometry, which has an OGR_STYLE attribute, it will be written as a text geometry when opened in CAD.
So for our MasterMap data we have one layer we want to convert to text:
CartographicText
But lets try that as text. We will keep this simple and only take into account orientation and to a small extent height. Lets look at orientation:
Orientation – The orientation of text or symbol features for cartographic placement. This is measured in tenths of a degree anticlockwise from due east (0–3599).
So conversion to degree will be simple. Orientation/10
We can also take into consideration height as a multiplier.
And “textString” stores the text itself.
The command:
ogr2ogr.exe -f DXF CartographicText2.dxf os-mastermap-topography-layer-sample-data.gml CartographicText -sql "SELECT 'LABEL(f:""Arial"",s:""'||(height*800)||'"",t:""'||textString||'"",a:""'||(orientation/10)||'"",p:5)' AS OGR_STYLE, * FROM CartographicText" -dialect SQLITE
Full extent:
Zoomed in:
Explained:
Since this is run in windows, through the regular console, the escape character for quotes is two quotes “”‘. So a combination on ‘ ” and “”‘ we can accommodate all the required quotes.