Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jheasley
Luminary Alumni
Luminary Alumni

Line Layer Behavior in the Pacific

When trying to draw a line for Storm Tracks, if a line layer needs to cross from W to E longitude (or vice versa) in the Pacific, the line wraps all the way around the globe instead of connecting by shortest distance.  example coordinates and image below:

GeoPoints in this order:

[175,30]

[176,29]

[177,28]

[179,27]

[-178.7,24.6]

produces the following result:

Capture.PNG

3 Replies
pedrobergo
Employee
Employee

Hi Joe,

It´s occurs cause you´re trying to draw a line between "sides" of a plane world, combining negative and positive values.

In this case you need to calculate the difference between the negative value and 180 and add it to 180.

-178.7 + 180 = 1.3 + 180 = 181.3

So the points wich you need to draw are:

[176, 29],[177, 28], [179, 27], [181.3, 24.6]

Screenshot_17.png

Pedro

RichB
Contributor II
Contributor II

Can anyone tell me how to fix these "jumps" that occur on my map?

The maps below show 3 small paths at longitudes of interest ( critical longitudes where the "jumps" occur). If the path crosses the longitude discontinuity it "jumps" and takes the long way around the map. The first map shows that it jumps at location 2. If however I apply the transformation outlined in this thread where I add 360, it fixes location 2 but the "jump" moves to location 3. It seems that the jump is just moving no matter how I change my coordinates.

It appears that this transformation has shifted the jump from the (180, -180) latitude line to the (0, 360) latitude line.

The actual data of the paths on the map is: 

SmallData:
load * inline
[assetid, latitude, longitude, messagetime
2, 46.7522781 , 163.0435627 , 2019-07-26 02:39:16
2, 47.8609425 , 174.934958 , 2019-07-26 02:39:17
2, 47.9432986 , -179.0895877 , 2019-07-26 02:39:17
2, 46.386769 , -161.746896 , 2019-07-26 02:39:18

3, 30.7522781 , 5 , 2019-07-26 02:39:16
3, 30.8609425 , 1 , 2019-07-26 02:39:17
3, 30.9432986 , -1 , 2019-07-26 02:39:17
3, 30.386769 , -5 , 2019-07-26 02:39:18

4, -15.7522781 , 95 , 2019-07-26 02:39:16
4, -15.8609425 , 91 , 2019-07-26 02:39:17
4, -15.9432986 , 89 , 2019-07-26 02:39:17
4, -15.386769 , 85 , 2019-07-26 02:39:18
];

 

The map coordinates for the paths are constructed as follows:

Paths:

Load
           assetid,
           '[' & concat( GeoMakePoint(latitude,
                    if( longitude < 0 , longitude, longitude))
                     , ',', messagetime ) & ']' as trail
Resident SmallData
Group By assetid;

Skip-Pacific.PNG

 

Now apply: if( longitude < 0 , longitude + 360, longitude))

Skip-0.PNG