[Qgis-user] Text label wrap
Carlos López PSIG
carlos.lopez at psig.es
Thu May 22 05:01:37 PDT 2014
Hi,
You can use an expression like this
CASE
WHEN "CRLFPOS1" = 0 THEN "TEXT_TOP"
WHEN "CRLFPOS1" > 0 AND "CRLFPOS2" = 0
THEN
substr("TEXT_TOP",1,"CRLFPOS1"-1)||'\n'||substr("TEXT_TOP","CRLFPOS1"+1,length("TEXT_TOP")-"CRLFPOS1"+1)
WHEN "CRLFPOS1" > 0 AND "CRLFPOS2" > 0
THEN
substr("TEXT_TOP",1,"CRLFPOS1"-1)||'\n'||substr("TEXT_TOP","CRLFPOS1"+1,"CRLFPOS2"-"CRLFPOS1")||'\n'||substr("TEXT_TOP","CRLFPOS2"+1,length("TEXT_TOP")-"CRLFPOS2"+1)
END
Where CRLFPOS1 and 2 are two integer fields that i have in my layer.
Good luck and I'm sorry for answer late!!
* <http://www.psig.es> *
*Carlos López Quintanilla*
www.psig.es
carlos.lopez at psig.es
+34 699.680.261
2014-05-22 12:52 GMT+02:00 Richard McDonnell <richard.mcdonnell at opw.ie>:
> I think the solution you are looking for in in expression based
> Labelling. Under the functions list, there is the string function, you
> should have a play around there.
> Regards,
>
> Richard.
>
>
>
> On 16/05/2014 22:15, AntonioLocandro wrote:
> > Is there a way to wrap text so it wont be to long for labeling but
> without
> > altering the text field or making another extra field for labels? I got
> > something like this
> >
> > asdasdas adasdasda asdasdas asdasdasd
> >
> > If I use space as wrap on character I would get
> >
> > asdasdas
> > adasdasda
> > asdasdas
> > asdasdasd
> >
> > I want this
> >
> > asdasdas adasdasda
> > asdasdas asdasdasd
> >
> > And only if asdasdas adasdasda asdasdas asdasdasd is> amount of
> character
> > should rule be applied
> >
> >
> >
> > --
> > View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Text-label-wrap-tp5140846.html
> > Sent from the Quantum GIS - User mailing list archive at Nabble.com.
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-user
> >
>
>
> **********************************************************************
> Email Disclaimer: http://www.opw.ie/en/disclaimer/
> **********************************************************************
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140522/4fe40543/attachment.html>
More information about the Qgis-user
mailing list