Subscribe to this thread
Home - General / All posts - Help on adding a compass rose to a map
dprellwitz59 post(s)
#01-Jul-20 23:14

Adding a compass rose to a layout.

Seems like an easy task, but it's had me baffled for a few days. can someone point me to the proper documentation/help notes? I have a series of maps i'd like to add a compass for my users. thanks.

dale

558 post(s)
#02-Jul-20 00:33

If you are using M9, then in the short term, you will have to draw one using a new drawing layer.

Otherwise if you have access to M8, then use one of the many options there to append a north arrow/compass rose.

Others may have a better work around than the above.

dprellwitz59 post(s)
#06-Jul-20 07:24

I have M8 so i'll research that avenue until M9 has it added as AdamW notes.

CurtissP401 post(s)
#02-Jul-20 00:50

New Drawing, place one point in it.

Style and use image of compass rose you want.

Drag as layer into layout, double click to resize, and move to where you want it to show

adamw


9,299 post(s)
#02-Jul-20 13:39

Since we don't have any built-in means to create a north arrow, here's an example query that does this. You might need a more complex shape, but maybe that would work as a reasonable start.

--SQL9

 

CREATE TABLE [compass] (

  [mfd_id] INT64INDEX [mfd_id_x] BTREE ([mfd_id]),

  [geom] GEOMINDEX [geom_x] RTREE ([geom])

);

CREATE DRAWING [compass_d] (

  PROPERTY 'Table' '[compass]',

  PROPERTY 'FieldGeom' 'geom'

);

 

-- 0 = 0 deg, 1 = 45 deg, ..., 8 = 360 deg

FUNCTION CompassPoint(@n INT32FLOAT64X2 AS

  VectorMakeX2(

    RoundDecs((100 - (@n MOD 2) * 70) * Cos(@n * 3.14159 / 4), 2),

    RoundDecs((100 - (@n MOD 2) * 70) * Sin(@n * 3.14159 / 4), 2)

  )

END;

 

DELETE FROM [compass];

 

-- outline

INSERT INTO [compass] ([geom])

SELECT GeomConvertToLine(GeomConvertToPoint(GeomMergePoints(

  GeomMakePoint(CompassPoint([value]))), FALSE))

FROM CALL ValueSequence(0, 8, 1);

 

-- internal connectors

INSERT INTO [compass] ([geom])

SELECT GeomMakeSegment(VectorMakeX2(0, 0), CompassPoint([value]))

FROM CALL ValueSequence(0, 8, 1);

 

-- area slices, can be colored independently using per-record style,

-- for example

INSERT INTO [compass] ([geom])

SELECT GeomMakeTriangle(VectorMakeX2(0, 0), CompassPoint([value]),

  CompassPoint([value] + 1))

FROM CALL ValueSequence(0, 8, 1);

We are going to add built-in support for north arrows, that's in the plans.

lionel

648 post(s)
#02-Jul-20 23:15

I really like how manifold is powerfull to create point line area from geometry/mathematic function.

Here the doc to learn valueSequence ( i discover it) .

Attachments:
rose_logic.png

tjhb

9,320 post(s)
#02-Jul-20 23:38

Mais tu blagues! That is beautiful code, and a beautiful idea!

Great stuff, what a lovely example of what can be done.

[P.s. You can use the SQL constant PI for pi.]

dchall8
760 post(s)
#03-Jul-20 00:57

I like the elegance of 355/113 as an easy sub for pi. It's good for a few more decimal places than I can remember it. Easy to remember as the first three odd numbers, 113355, with a split between the threes.

tjhb

9,320 post(s)
#03-Jul-20 01:03

Nice! I will remember that. As you say, elegant.

adamw


9,299 post(s)
#03-Jul-20 08:07

In old-style Russian textbooks, constants like that are usually remembered by remembering a phrase. The phrase for PI is:

Это я знаю и помню прекрасно

(Translated as: this is something that I remember well)

You count the number of letters in each word and together these numbers form an approximate value of pi: Это = 3, я = 1, знаю = 4, etc.

tjhb

9,320 post(s)
#03-Jul-20 08:24

Это я люблю. What is the phrase for e?

adamw


9,299 post(s)
#03-Jul-20 08:43

E seems to be kind of an exception, most people remember it as '2.7' and then the year in which Lev Tolstoy was born (1828), repeated two times. So: 2.718281828.

tjhb

9,320 post(s)
#03-Jul-20 08:49

(Speechless, happily laughing)

tjhb

9,320 post(s)
#03-Jul-20 09:09

...especially about прекрасно, exactly the right joke for young children to understand.

mlinth
435 post(s)
#03-Jul-20 08:40

How I wish I could recollect pi easily today!

Here's one for e:

We require a mnemonic to remember e whenever we scribble math.

adamw


9,299 post(s)
#03-Jul-20 08:43

Exactly!

tjhb

9,320 post(s)
#03-Jul-20 08:44

Very nice! I wonder how many people knew that. Not me!

(x2)

adamw


9,299 post(s)
#03-Jul-20 08:03

Heh, there is indeed an extra connector line and an extra area slice.

The call to ValueSequence in the first query has to go from 0 to 8, inclusive (counting 9 times), so that the outline is closed. But the calls to ValueSequence in the next two queries have to go from 0 to 7 (counting 8 times), else there's an extra line and an extra area created.

Thanks for noticing the issue!

PS: Yes, it'd be better to use PI instead of 3.14159. Forgot we have that built-in. :-)

lionel

648 post(s)
#04-Jul-20 10:54

Hi

I think the way of have rose can be use in artistic way ( tesselation symmetry) to create motif ( i think use in France for create the euro coin)

1) I want to use GeomRotate(<geom>, <centerx2>, <angle>) : <geom>

can i write for <geom> the code

SELECT GeomConvertToLine(GeomConvertToPoint(GeomMergePoints(GeomMakePoint(CompassPoint([value]))), FALSE))

FROM CALL ValueSequence(0, 8, 1)

so i have

--SQL 

INSERT INTO [compass] ([geom])

SELECT GeomRotate(

SELECT GeomConvertToLine(GeomConvertToPoint(GeomMergePoints(GeomMakePoint(CompassPoint([value]))), FALSE))

FROM CALL ValueSequence(0, 8, 1)

,

GeomMakePoint(VectorMakeX2(0,0)),

45);

2) is there a function to convert  degre to pi for <angle> ? 

thank's 

lionel

648 post(s)
#04-Jul-20 11:31

A)

for 2) i think all the value <angle> mean or should be interpret by default in degre angle unit .

in a way inside sinus the value unit is number more relative to pi radian than degre

B) I think for distance between 2 points the distance unit use by M9 is by default meter but i have to search..

regard's

https://www.mathsisfun.com/algebra/amplitude-period-frequency-phase-shift.html

tonyw
595 post(s)
#03-Jul-20 20:22

Adding a compass rose to a layout.

My solution is pretty low tech, I searched Google images for a nice compass rose, some of the historic maps have nice ones. I save the image as an image file (.png with transparent background) and import to my ayout. However mostly I'm still finishing my maps in a drawing program and I import the image of the compass rose there. If your maps are not aligned with north upwards, you can add a very faint north pointing line in your map or layout and align the image of the compass rose to that faint reference line.

dchall8
760 post(s)
#04-Jul-20 18:23

I like the faint north line idea. I started to color mark my maps with faint yellow lines after some people brought in a map swearing I printed it and it was misleading.

tonyw
595 post(s)
#04-Jul-20 22:49

If I understand your strategy, it's to put a distinguishing mark on your maps and if the mark is not present, it's not your map? I do that sometimes with my graphics in general for the reverse effect. Sometimes other authors claim my work (and work from other reports) as their own work. I can point to the distinguishing mark as proof of plagiarism.

dprellwitz59 post(s)
#06-Jul-20 07:21

WOW! What a stunning array of concepts a simple question can generate! I'm far more enriched than i ever thought i would be! Thank you all!

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.