A cool python script has been created that allows you to easily convert your google location (Takeout) data into a shapefile.
You can get your data from: Google Takeout
And you only need the “Location History – JSON format”
The conversion python script can be downloaded from: GitHub
The python script requires GDAL and its python bindings, but can be easily run if you installed QGIS using the OSGeo4W installer. From the advanced installer, under the Lib section.
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.