[Qgis-user] Reproduction of Northarrow-function from ArcView 3 in QGIS
Bernhard Ströbl
bernhard.stroebl at jena.de
Fri Jun 27 00:10:56 PDT 2014
Hi Julian,
AFAIU this is what you want to achieve:
Have lines (having only two nodes, no vertices) in a map with CRS
GaussKrüger 3 (EPSG:31467 ?) that are labeled with a) their length (in
meters) and b) their angle towards north (in degrees), i.e. North is 0,
East 90 etc.
You can do that with the expression based labelling, please check the
documentation for an introduction [1] esp. "Define labels based on
expressions"
Am 26.06.2014 17:39, schrieb Julian Schall:
> Hello together,
>
> is there any possibility known in QGIS to reproduce the
> Northarrow-function from ArcView 3.0?
> Background is having a tool to easy generate a way to find boundary
> stones or landmarks from a known place.
>
> The Northarrow-Button works as follows:
>
> After clicking the northarrow-button you can click in the map an draw a
> line and clicking again defines the end of the line (comparable to line
> measurement in QGIS). Then automatically the line is labeled with the
> angle (0-360° and the length from start to endpoint). Difference between
> the two informations/decimal numbers gets understandable through
> parallel declaration of the unit (for example: 25,7 m on top of the line
> and 23,5° below the line). In ArcView that is actually a label, not a
> vectorlayer.
>
> I was searching for plugins first, but didn’t find any suitable.
> Then I tried to rebuild the function through line-vectorlayer with
> columns “Angle” and “Length” and predefined labeling. Problems are
>
> 1.That I couldn’t calculate the angle between north and the line (GK3).
> I only found a term for UTM: (atan((xat(-1)-xat(0))/(yat(-1)-yat(0)))) *
> 180/3.14159 + (180 *(((yat(-1)-yat(0)) < 0) + (((xat(-1)-xat(0)) < 0 AND
> (yat(-1) - yat(0)) >0)*2)))
Why not? Both, UTM and GaussKrüger are transversale mercator
projections. I parsed this expression as labelling expression for one of
my line layers (EPSG:31468) and it works. Be careful with the line
direction.
>
> 2.That I couldn’t manage automatic calculation of length and angle in
> the attribute table after adding a line to the layer. It’s very painful
> to every time calculate length and angle again.
You need not store it in the table (which means updating all the time),
the expression-based labels calculate this on-the-fly from your geometry
>
> 3.That I couldn’t display to labels respectively the content of two
> attribute columns.
>
> 4.That I couldn’t manage to label the units ° and m.
sse [1]
>
>
> I would be very thankful for help or advices how to do that.
>
>
> *Julian***
>
>
Bernhard
[1]
http://docs.qgis.org/2.2/en/docs/user_manual/working_with_vector/vector_properties.html#labels-menu
__________ Information from ESET Mail Security, version of virus signature database 10008 (20140627) __________
The message was checked by ESET Mail Security.
http://www.eset.com
More information about the Qgis-user
mailing list