2 Replies Latest reply on Aug 2, 2017 11:37 AM by tibor.mozes.1

    10.2 : Shapefile and HP Vertica Spatial Tables

    Antoine Tignon

      Hi,

      Since the release 10.2, Tableau knows how to deal with shapefile, i would like to know if it's possible to use spatial tables from hp vertica as a shapefile.

      Some functions exist in Hp Vertica to get shapefile into tables : https://my.vertica.com/docs/8.0.x/HTML/index.htm#Authoring/AnalyzingData/Geospatial/GeospatialAnalytics/LoadingSpatialDa…

      STV_ShpCreateTable(), STV_ShpSource() and STV_ShpParser()

      I used them to try it  without success, the field geometry isnt recognize as a geospatial data by Tableau.

      The shapefile is a Polygon Type.

      Did someone manage to make it work?

      Thanks for your help

        • 1. Re: 10.2 : Shapefile and HP Vertica Spatial Tables
          Sujay Paranjpe

          Hi Antonie,

           

          As per the documentation Create Tableau Maps from Spatial Files tableau can read the shape files in the following format.

           

          • For ESRI shapefiles: The folder must contain .shp, .shx, and .dbf files.
          • For MapInfo tables: The folder must contain .TAB, .DAT, .MAP, and .ID or .MID or .MIF files.
          • For KML files: The folder must contain the .kmlfile. (No other files are required.)
          • For GeoJSON files: The folder must contain the the .geojson file.(No other files are required.)

           

          To answer you question, the thing that you are trying to do cannot be done.

          Out of curiosity, why do you want to read the shape file into tables and what is the advantage of that, when Tableau can read them directly?

           

          Best,

          Sujay

          If this solves your query, please mark the post as helpful or mark the answer correct.

          • 2. Re: 10.2 : Shapefile and HP Vertica Spatial Tables
            tibor.mozes.1

            Hello Antoine and Sujay,

             

            This is a use case that I also ran into: a table contains fields about POIs (id, address, name). Vertica can store a geography field, one could use that field to display the polygon of a POI (a building).

             

            This is how this can be done, assuming you are using Vertica 8.x and you have a table say 'my_pois' that has the geometry field in it:

            1) Set the export directory where the shape file could be exported:

            SELECT STV_SetExportShapefileDirectory( USING PARAMETERS path='/tmp' );

             

            2) Export the table with the polygons into a shape file into the export directory

            SELECT

              STV_Export2Shapefile(* USING PARAMETERS shapefile = 'my_pois.shp', overwrite = true, shape = 'Polygon')

            OVER()

            FROM

              my_pois;

             

            3) Copy the all the 3 exported files my_pois.shp, my_pois.dbf, my_pois.shx from the export directory (/tmp ) to a local folder where Tableau can access them.

            4) Connect to the shape file in Tableau and the field that has the geometry will show up as a geometry type field as a Measure. Drop that on the shelves and you should see your polygons.

             

            Sujay, note to Tableau:@ It would be ideal if this could simply pulled in via a regular database connection.