Subscribe to this thread
Home - General / All posts - Jittering Points
grmapper
239 post(s)
#30-Jul-20 11:40

Hello All,

This has likely been asked and answered but I can’t seem to find anything. I have several points that share an exact Lat / Long. I would just like to randomly move the positions of each to eliminate the overlap and make the points a bit more anonymous. Thinking about it there is likely a transform which I will investigate but I’ll ask for help just the same . I’m using and loving version 9!!!

Thanks in advance.

Greg

Dimitri


6,280 post(s)
#30-Jul-20 12:18

With the focus on the drawing, you can use the Shift transform for that. In the Shift X and the Shift Y boxes first change them to using an Expression, and then for the expression use some random number expression.

For example, (taken from the end of the Computed Fields topic) the expression:

(TABLE CALL ValueSequenceRandomInt(1, 100, [mfd_id])) + 10

Will generate a random number from 10 to 109. Using the same expression for both Shift X and Shift Y will shift the overlapping points a random distance in that range along a diagonal line (since both the X and Y shifts are the same).

If you wanted to spread the points out a bit, but still towards the upper right quadrant, you could use the above expression for Shift X and a different expression for Shift Y, such as...

(TABLE CALL ValueSequenceRandomInt(1, 100, (TABLE CALL ValueSequenceRandomInt(1, 10, [mfd_id]))))

Which generates a random number from 0 to 9 to use as a seed for the outer random function. Make sure your drawing is in a meter or foot based project, not lat/lon, since you want to shift points by dozens of meters, not degrees.

grmapper
239 post(s)
#30-Jul-20 13:45

Perfect!!!! Incredibly easy with M9. I found a way to do it in a different package. It took an hour just to understand the process. This took 5 mins from start to finish. THANK YOU Dimitri for the guidance.

BCowper


1,272 post(s)
#30-Jul-20 17:33

Might be a bit late, but one of the neat features in Manifold 9 is having multiple geometry columns in your table the drawing is generated from, you could keep the correct locations in one geometry column and graphical adjusted locations in another.

grmapper
239 post(s)
#31-Jul-20 03:29

Never too late. Excellent capability. I will incorporate that for sure. Thank You.

apo
127 post(s)
#31-Jul-20 08:36

Yes this is perfect and I would add, "population centroid", generalized geometries for different mapping scales, even proportional symbols in several columns... opens new possibilities and ease the maintenance of tables.

Sloots

485 post(s)
#31-Jul-20 14:20

I have written a query that might be worthwhile looking at. Based upon a drawing with points and an attribute named [n] it creates [n] points around the original point in a sunflower-seed-like-style. You can play with a multiplication factor to match your own needs.

The original points The dispersed points Closeup of the largest "sunflower"

Attachments:
Disperse (M9).map
points dispersed.png
points with weights.png
sunflower.png


http://www.mppng.nl/manifold/pointlabeler

BCowper


1,272 post(s)
#31-Jul-20 15:16

That looks great! Once I get the wrapper off of M9 I'll take a look at that for sure.

grmapper
239 post(s)
#01-Aug-20 00:37

Very nice.

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