13 Replies Latest reply on Oct 5, 2018 10:35 PM by Damian Milne

    Trouble with map polygon that spans Longitude = 180

    desiree.abbott

      Hi all,

       

      I've a map with a polygon on NE Asia and I'm having trouble making the dots connect correctly.  I'm pretty sure it's due to the fact that some of the points have longitude > 180, but Tableau is drawing the polygon such that lines connecting those points are going BACK around the Earth instead of using the shortest distance between those points.

       

      mapissue.png

       

      I'm honestly not sure if it's something I've done wrong, or if I've encountered a really weird quirk of Tableau's.  My data is quite protected so I'm not sure if I can really post anything here, thus I'm starting with just a screenshot in the hopes that someone else has encountered and fixed this problem.  I am using a style created in Mapbox Studio for the background map, but I don't know if that has anything to do with anything.

       

      Thanks in advance, you beautiful community!

        • 1. Re: Trouble with map polygon that spans Longitude = 180
          Ken Flerlage

          Do you have anything on the Path card? That card defines the order in which Tableau connects the dots.

           

          Any chance you could upload a packaged workbook?

          • 2. Re: Trouble with map polygon that spans Longitude = 180
            desiree.abbott

            Ok, I think I scrubbed it thoroughly!  Here's the packaged workbook.

             

            And no, nothing is on the path card because it's a map, not a line.  Am I missing something?

             

            ( Ken Flerlage )

            • 3. Re: Trouble with map polygon that spans Longitude = 180
              Sarah Battersby

              Is there any way that you could share the scrubbed shapefile (or whatever spatial file format) for the dataset?  I'd like to take a look at the actual coordinates in the file, and not just how Tableau 2018.2 converted the geometry in the extract so that I can look into what might be going on with the lines crossing the international date line.

               

              -Sarah

              Tableau Research  

              • 5. Re: Trouble with map polygon that spans Longitude = 180
                Sarah Battersby

                Thanks Desiree.  I'm going to look into this and see if I can figure it out ( I haven't had problems with other files crossing the international date line in 2018.2+ so this is an interesting new issue to explore).   

                 

                -Sarah.

                • 6. Re: Trouble with map polygon that spans Longitude = 180
                  desiree.abbott

                  I was hesitant to say this, but I made the original in 2018.3 and then exported as v2018.2 to attach here.  Oddly, I can't seem to connect to that JSON file as a spatial file from 2018.2 or below to see if the behavior is truly replicated there.

                   

                  On my end, I will work on getting my JSON into an actual spatial file type that 2018.2 will play nicely with, and then see if it does the same thing there.

                   

                  Apologies, I didn't think to put this on the Beta site because I didn't think it had anything to do with beta features, and I still see the behavior in 2018.2.

                   

                  EDIT:  Got it to open from a brand new connection in 2018.2, but it's still screwy just like before. 

                  • 7. Re: Trouble with map polygon that spans Longitude = 180
                    Sarah Battersby

                    Hi Desiree - so, good news, bad news... bad news is that you found a cool bug (which I still see as good news, but...well, I work at Tableau and I like to make sure things we get things fixed).  I was pretty amazed because this is the *first* file that I've found that crossed the IDL and doesn't render correctly in 2018.2+.  The good news is that I talked with one of our engineers, he has figured out the cause, has a fix figured out, and it's in the works.  So...not immediate solution, but it's on the way.

                     

                    In the meantime, this isn't optimal, but I went old-school Tableau and converted the JSON to a file with just the nodes of the polygons.  Until the fix is shipped out, you can always use the attached file and create the polygons from the individual nodes and the polygon mark.

                     

                    I still have one more thing I want to try to see if I can force your data into a polygon that will render correctly because this really is the only file crossing the IDL that I haven't been able to get working so far (I was going to try writing it from scratch into a hyper extract)... if that works I'll amend my response and attach the .hyper file so that you can just use the geometry directly.

                     

                    -Sarah.

                    Tableau Research

                    4 of 4 people found this helpful
                    • 8. Re: Trouble with map polygon that spans Longitude = 180
                      desiree.abbott

                      This is great news all around, thank you Sarah Battersby!! 

                      • 9. Re: Trouble with map polygon that spans Longitude = 180
                        Sarah Battersby

                        Desiree Abbott -

                         

                        Possibly more good news - it seems to works just fine if I write the json out to a .hyper file using the Extract API (Tableau Extract API).  Go figure...there is something magical about your JSON that just didn't make Tableau happy.  So, try it out with this .hyper for now and you can avoid my earlier old-school Tableau polygon mapping method.

                         

                        I wrote the multipolygon as two separate shapes because it was easier than remembering the WKT syntax for Multipolygons when I made the Hyper file, but Tableau should render those polygons together since they have the same ID.

                         

                        -Sarah

                        Tableau Research

                        2 of 2 people found this helpful
                        • 10. Re: Trouble with map polygon that spans Longitude = 180
                          desiree.abbott

                          You are a rockstar. Thanks a million!

                          • 11. Re: Trouble with map polygon that spans Longitude = 180
                            Damian Milne

                            Hi Desiree, I'm assuming these issues are linked...

                             

                            I suddenly noticed that my view in Tableau Public now has a line running down the 180 degree longitude which wasn't there previously, see here: Tableau Public 

                             

                            I tried to update the view from my original desktop Tableau project (version 2018.2.2), however I found that I am now getting the same line in my desktop project. I've tried all sorts or projections and modifications on my original spatial file (ESRI Shapefile) to no avale. Do you know if the engineer is any closer to a solution? Would you happen to have any other suggestions for how I might fix? I don't think the EXTRACT API option is applicable in my case.

                             

                            Regards, Damian

                            • 12. Re: Trouble with map polygon that spans Longitude = 180
                              Daniel Strebe

                              Hello Damian.

                               

                              Geographic data come in a variety of formats of different meaning even when the polygon coordinates are the same. In the past, Tableau only accepted Shapefile and similar sources, and performed no spatial analysis.

                               

                              With the advent of SQL Server connections, proper interpretation of KML, and the spatial join faculty that we introduced in Tableau 2018.2, we needed to standardize the way Tableau represents these data internally, regardless of where they come from. Mixing Shapefile with SQL Server meant we have to reverse the vertex ordering in polygons for one of the two formats, as well as impose a common way of looking at the resulting polygons. Shapefile permits (that is, its specification is silent on the topic of) longitudes outside the range of [–180°, 180°] in order for polygons that span the 180th meridian to be easily interpreted as continuous. This convention is absent in more rigorous formats, where geographic data are considered to exist on an ellipsoidal earth and there is nothing special about the 180th meridian.

                               

                              We chose to separate polygons at the 180th meridian to give us a feasible path toward integrating heterogeneous data sources. We would like to eliminate that behavior eventually. For now, apologies for the ugliness.

                               

                              Regards,

                              — daan

                              1 of 1 people found this helpful
                              • 13. Re: Trouble with map polygon that spans Longitude = 180
                                Damian Milne

                                Hi daan, thank you for the comprehensive explanation. Indeed, Shapefiles do allow longitudes outside the range of +/- 180 degrees. However it also allows geographically correct topology around the 180 meridian as well, therefore your thinly veiled criticism of ESRI's Shapefile format does seem a little unfair when you compared to Tableau's implementation of a new system architecture for mapping that results in unavoidable errors, particularly in existing applications such as mine, and no means of fixing that error is provided.

                                 

                                I hope Tableau fixes the issue sooner rather than later. Your statement 'We would like to eliminate that behavior eventually' indicates that this is unlikely.

                                 

                                Regards, Damian