Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jfkinspari
Partner - Specialist
Partner - Specialist

Native Qlik Map with Line Layer takes the long way

I've made a Qlik Sense native map and added a Line Layer using Line Geometry.

If the line goes from Asia to North- or South America, Qlik Sense draws a line across the entire globe. Not exactly the path, I would imagine the ship would have traveled...

I would prefer the line to simply be drawn to the right side of the canvas and reappearing on the left side.
The line is using the coordinates seen in the table in the right side of the picture.

Can anyone help?

Map_taking_the_long_way.png

7 Replies
jfkinspari
Partner - Specialist
Partner - Specialist
Author

@Patric_Nordstromdo you have any tips? 🙂

Patric_Nordstrom
Employee
Employee

Can you post the line geometry? the snapshot seems to clip the line.

Thanks,

Patric

jfkinspari
Partner - Specialist
Partner - Specialist
Author

The line geometry

[[117.583333333333,0.138333333333333],[118.514998333333,0.545],[123.336003333333,2.09],[128.408341666667,2.91333333333333],[132.810001666667,3.19],[138.118326666667,3.44333333333333],[143.61167,3.65333333333333],[148.753336666667,3.82666666666667],[153.183333333333,1.73666666666667],[157.11167,-0.835],[160.871663333333,-3.26166666666667],[164.921663333333,-5.765],[168.83667,-8.148335],[172.829996666667,-10.57],[176.67666,-12.8383333333333],[-179.284993333333,-15.108335],[-175.395003333333,-17.1433333333333],[-171.090006666667,-19.3616666666667],[-166.771663333333,-21.4133333333333],[-162.221663333333,-23.3716633333333],[-157.83833,-25.085],[-153.165006666667,-26.7233333333333],[-148.443326666667,-28.1716666666667],[-143.50166,-29.49],[-138.959993333333,-30.5149966666667],[-134.348331666667,-31.3683366666667],[-129.535001666667,-32.07],[-124.416666666667,-32.6083333333333],[-119.541666666667,-32.9133333333333],[-114.675,-32.9900016666667],[-109.408333333333,-32.9933333333333],[-104.103336666667,-32.9883333333333],[-98.4200033333333,-32.9933333333333],[-93.0700033333333,-32.991665],[-87.525,-32.9933333333333],[-81.7799966666667,-32.9900016666667],[-76.531665,-34.495],[-73.067,-36.533]]
Patric_Nordstrom
Employee
Employee

If you want to cross the date line to the right, let the coordinates flow past 180.
For example T.ex. 170 -> -170 => 170 -> 190.

linewrap.png

 

Thanks,

Patric

jfkinspari
Partner - Specialist
Partner - Specialist
Author

Thanks, great you included the sample app 🙂
jfkinspari
Partner - Specialist
Partner - Specialist
Author

While adding 360 to negative coordinates solved the issue when traveling across the pacific, it created trouble for the paths that cross the prime meridian at 0 degrees. 

I'm thinking I need to differentiate between the logic dependent on whether it's crossing the 0 degree prime meridian or not. I'll be glad to hear any (better) suggestions?

[[32.1469983333333,-28.8280016666667],[31.13667,-30.33],[26.8899966666667,-33.9016683333333],[21.15,-34.906665],[16.4666666666667,-33.8333316666667],[12.4816666666667,-30.0216666666667],[8.82166666666667,-26.343335],[4.485,-23.4433333333333],[0.106666666666667,-20.6516666666667],[356.018333333333,-17.8600033333333],[351.943333333333,-14.8733333333333],[347.9,-11.75],[343.788333333333,-8.46666666666667],[339.91,-5.325],[335.966666666667,-2.015],[331.848333333333,1.44833333333333],[327.646666666667,4.94166666666667],[323.913333333333,7.99833333333333],[320.113333333333,11.095],[315.983333333333,14.2116666666667],[311.653333333333,17.4183333333333],[307.08,20.5166666666667],[307.08,20.5166666666667],[305.027001666667,21.83],[302.95,22.655],[298.978333333333,24.2233333333333],[294.75833,25.8700016666667],[290.512003333333,27.4979983333333],[286.433333333333,29.0333333333333],[284.491666666667,29.7733333333333],[284.421663333333,29.7933333333333],[284.443335,29.8916666666667],[284.360001666667,30.0149966666667],[284.331665,30.0333333333333],[283.495003333333,31.1216633333333],[281.875,33.48],[281.928003333333,33.7649983333333],[281.178336666667,30.1333333333333],[280.416666666667,25.3283333333333],[276.173331666667,23.7533366666667],[270.435001666667,25.4866666666667],[266.803336666667,28.9416683333333]]

TRack_path_crossing_prime_0_line.png

Patric_Nordstrom
Employee
Employee

Yes, I would have done the same.