[GRASS-user] how to derive polygons from text strings

Maris Nartiss maris.gis at gmail.com
Sun Dec 19 23:24:57 PST 2021


AFIAK no*

It is more tricky than it might seem as exact dimensions depend not
only on font size but also on selected font (see monospace vs
condensed fonts), kerning, styling (bold, italics). Thus final size of
bonding box of a string is a product of all of its properties. Thus
the best option to get the size right is to ask the same rendering
engine to calculate exact dimensions as it will know the size it will
use.


* apart from one used for vector labelling in d.* modules, but that is
not exposed to the enduser. See D_get_text_box from display library.

Māris.

sestd., 2021. g. 18. dec., plkst. 18:50 — lietotājs Uwe Fischer
(<gisfisch at t-online.de>) rakstīja:
>
> Hello list,
>
> I have a point feature layer with attributes for a text string (call it 'label') and the fontsize in map units (which are meters in my case). Is there a way in Grass to derive polygons from this input information which enclose the label strings  when those are used to label the points? For those who know ArcMap: what I mean is exactly what happens when you save Annotations as Shapes in ArcCatalog: you get a polygon layer in which each text string has a polygon hull which fits the height and width, respectively.
>
> best regards,
>
> Uwe
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list