1 Reply Latest reply on Aug 17, 2018 3:06 PM by Sarah Battersby

    Calculating ZIP-level spatial averages (from its SHP file) for datapoints Lat/Long on another layer (Dual Axis map)

    Japhy Ryder

      Dear all,

      I'm rather new to the forum, so let me break the ice with the following:

       

      -  in a Dual Axis map (resulting from a SHP-CSV spatial join), is there a simple way to (spatially) average at ZIP Code level (SHP file) a set of Lat/Long measurement points (CSV file) belonging to a different layer? Namely, each ZIP Code should report the aggregate average (or whatever else) of all the points visually belonging to that area (i.e. there's only a spatial relationship among the two sets, nothing more)

       

      -  I read thru all of Sarah's excellent tips & tricks (thanks Sarah Battersby | Tableau Software !), but I'm not sure if e.g. a Bivariate Choropleth map (How to make effective bivariate choropleth maps with Tableau | Tableau Software) is the best fit, as I'd like to avoid editing my meas.points CSV (>1GB big, hence quite cumbersome for QGIS & the likes to e.g. reverse geocode each point into its corresponding ZIP area)

       

      - I also thought to Spatial Binning (Data Map Discovery: How to use spatial binning for complex point distribution maps | Tableau Software), but then bins wouldn't exactly overlap with my ZIP Code areas (unless I spend ages modeling them one by one...)

       

      - in general, more advanced geoanalytics features (like e.g. kriging, etc.) would be very welcome for next releases (some of your competitors do that already: Spotlight on TIBCO: Exploring Spotfire Today - Analytics Industry Highlights )

       

       

      Any feedback/ideas welcome.

       

      Thanks in advance,

      Japhy

        • 1. Re: Calculating ZIP-level spatial averages (from its SHP file) for datapoints Lat/Long on another layer (Dual Axis map)
          Sarah Battersby

          Hi Japhy,

           

          I think that to average the point locations within the zip code, you will need to create a spatial relationship between the points and polygons (e.g., each point needs to know which zip code polygon it falls inside).  From your description of the problem, I think you're going to want to do the spatial join (either in Tableau 2018.2, QGIS, or a spatial database). It sounds like your dataset is pretty gigantic, so it might be optimal to do the join with a spatial index.  I'd probably lean towards doing it with PostGIS, but I hear that lots of folks find R to be quite speedy as well (comparatively for large datasets...bigger datasets with more complex polygons will just take longer to calculate).

           

          -Sarah

          Tableau Research