At least in the table that you screen captured it looks like your Polygon column is WKT and not actually a geography data type. When I query a table in one of my SQL Server databases the geography column ends up looking something like this:
- 0xE610000010405<blah blah blah more random letters and numbers>
I think that you should be able to use RAWSQL to convert WKT to geography if that is the problem though. What did your calculation look like for that?
1 of 1 people found this helpful
Fred Verbeek - I just tested out a RAWSQL query to convert WKT to geography to make sure it would work - it worked just fine. My query looked like this:
- RAWSQL_SPATIAL("geography::STGeomFromText(%1, 4326).MakeValid()", [WKT])
"WKT" was my un-creative original field name containing the WKT string
4326 was the EPSG code for the dataset I happened to use
Let me know if this doesn't work for you and I'll see if I can dig in a bit more to help out.
Thanks Sarah. I am going to try this.
You are right that the polygon-column is shown as text. I also tried the geography data type which is shown as below, but that doesn't work either (Tableau does not show the field).
I am going to try the RAWSQL_SPATIAL-solution, and I will inform you if it works!
Key Travel distance Polygon lat lon 232989 10 0xE610000001040B000000C00BCF77A9054A4006BF6BB27F921640955053A8A7054A40FEA0E5DE7D921640F5866D1BA6054A4075EE77318A92164079A7DA68A5054A405F78A20BA0921640BA106BD6A5054A408F6CF70BB7921640761B2339A7054A40C5003758C6921640AACD9E08A9054A40DFF4C22BC892164001CB8495AA054A40115733D9BB921640D6D11748AB054A40279A04FFA5921640084E87DAAA054A40105FAAFE8E921640C00BCF77A9054A4006BF6BB27F92164001000000020000000001000000FFFFFFFF0000000003 52,0442064458315 5,6431984186822
So long as you're using Tableau 2018.1 or later, it should recognize a geography column from SQL Server... One thing to check is that you are using one of the following SRIDs:
- NAD83 (EPSG:4269)
- ETRS89 (EPSG:4258)
- WGS84 (EPSG:4326)
When you say that Tableau doesn't show the field are you saying that it doesn't even appear as a dimension or measure? That would happen in versions earlier than 2018.1, but after 2018.1 you should see your geography column.