- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a simple .dwg from OS map data, which will have the topographic lines and cartographic text (cartographic symbols is a battle for another day) but can't find a guide anywhere. I've added the data, “cartographic_text_subregion_point”, to Map 3D from my PostgreSQL connection.
Using Style Editor, I've changed the standard symbol to MTEXT to show the OS map text (e.g. the road name) using the "textstring" property of the feature. If I try showing the text using Feature Label, I can't set the insertion offset and text alignment using the feature properties in the map data (and the label disappears if I accepted having the text in the centre of the point - although the solution I found online seems cumbersome).
Using expressions, I can set the font size ("height) , rotation ("rotation") , and insertion offsets ("geo_x" and "geo_y").
However, I can't figure out the expressions for the vertical and horizontal alignments for the text. The feature property "anchor" determines this but my OS map data uses compass orientations e.g. N, NW, C (centre), S, etc. while Map 3D uses Left, Right, Top, Halfline, etc. I've tried the following expressions which end up being valid, but don't end up working.
Attempt 1: The OR function doesn't work in the IF function (although the expression is valid) and all text ends up (horizontally) aligned in the centre.
(If('anchor=''C''OR''N''OR''S''','Center',' ')) (If('anchor=''NW''OR''W''OR''SW''','Left',' '))
(If('anchor=''NE''OR''E''OR''SE''','Right',' '))
If I try using an OR function between each IF function I get an error. Not sure how I should be using the OR function here.
Attempt 2: Instead of using an OR function in the IF function, I have expressions for each. This doesn't work because only the first IF function is applied, and all other text is center aligned, even if I don't use 'Center' in the expression.
(If('anchor=''C''','Center',' ')) (If('anchor=''N''','Center',' ')) (If('anchor=''S''','Center',' ')) (If('anchor=''NW''','Left',' ')) (If('anchor=''W''','Left',' ')) (If('anchor=''SW''','Left',' ')) (If('anchor=''NE''','Right',' ')) (If('anchor=''E''','Right',' ')) (If('anchor=''SE''','Right',' '))
Any help will be greatly appreciated.
Solved! Go to Solution.