HeavyIQ visualization and Choropleth

Comments

14 comments

  • Official comment
    Avatar
    Todd Mostak

    Hi Gianfranco.

    In 8.0 only certain types of geographies are renderable in choropleths using frontend Vega rendering, namely countries, states, and counties, but as of 8.1 targeted for later this summer, you'll be able to render arbitrary choropleths of any geometries, provided you have the geometries (polygons/multipolygons) in a table and are running on GPU.

    Todd

    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Thank for the answer, Todd.
    Therefore if HeavyIQ suggests a Choropleth as predefined output, based on the query and results, I cannot avoid the unpleasant empty geography (for the current ver. 8.0), is this correct?

    0
    Comment actions Permalink
  • Avatar
    Todd Mostak

    Hi Gianfranco Campana, yes unfortunately you will need to wait until 8.1 to generate choropleth maps for the geometries that are not countries, US states, or US counties.


    1
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Hi Todd,

    I upgraded to 8.1 

    HeavyDB:
    8.1.0-20240724-0a82950155
    
    Immerse:
    545-release-prod
    dede756
    
    
    Web Server:
    2eb6317
    
    HeavyIQ:
    2024-07-22T20:24:03Z-8d7ad30

    but still I don't see my custom geometries in the choropleth generated.

    How can I use custom geometries?

     

    0
    Comment actions Permalink
  • Avatar
    Todd Mostak

    Hi Gianfranco Campana, what was the query generated? And do you have backend rendering enabled?

    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    The query generated is:

    SELECT
      prov,
      SUM(c) AS tot_c,
      SUM(tb) AS tot_tb,
      SUM(te) AS tot_te,
      SUM(h) AS tot_h,
      SUM(f) AS tot_f,
      SUM(i_MM) AS tot_i_mm,
      SUM(i_VET) AS tot_i_vet
    FROM
      fh2
    WHERE
      cau = '30'
      AND mm = '3'
      AND aa = '2023'
    GROUP BY
      prov;

    Backend rendering is enabled as far as I know, I'm running HeavyAI on GPU, and in my dashboard the Choropleth chart works fine.

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Todd Mostak

    So it looks HeavyIQ is not projecting out a geometry column for your provinces, can you try manually adding one to the SQL to see if triggers the correct backend choropleth render? Currently with the lack of a backend geometry, I think the names or abbreviations of your provinces must be overlapping with country codes, and hence we are getting a spurious frontend choropleth of countries.

    You can also give hints to HeavyIQ that you want the geometry columns in your result, usually something like "Make a map of" will do the trick, but if not you can be explicit and ask it to return the geometry column along with the name/other requested stats. We're adding additional training to make the model better at picking up visualization intent.

    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Here some additional, hopefully useful details:

    I want to use the geometry in the "province_centrosud" table.

    SIGLA
    FR
    CE
    NA
    BN
    BA
    CB
    TA
    BR
    MT
    CS
    IS
    CZ
    LT
    AV
    SA
    FG
    KR
    VV
    LE
    PZ
    RC
    BT

     

    Using this prompt:

    Mostrami provincia, sigla della provincia, colli, peso totale, trasporto base e trasporto extra, handling fuel e immmobile mm e vet  a Marzo  2023  solo causale 3010 per le provincie del centrosud italia

    I get the ai writing a good query, joining the correct geometry table.
    I still cannot get the auto select table source working, so I'm adding manually both the names of the tables involved, postponing the solution of this problem.

    This is the query generated:

    SELECT
      T2.PROVINCIA,
      T2.SIGLA,
      SUM(T1.colli) AS colli,
      SUM(T1.peso) AS peso_totale,
      SUM(T1.trasporto_base) AS trasporto_base,
      SUM(T1.trasporto_extra) AS trasporto_extra,
      SUM(T1.handling) AS handling,
      SUM(T1.fuel) AS fuel,
      SUM(T1.immobile_MM) AS immobile_mm,
      SUM(T1.immobile_VET) AS immobile_vet
    FROM
      fh206 AS T1
      JOIN province_centrosud AS T2 ON T1.prov = T2.SIGLA
    WHERE
      T1.mm = '3'
      AND T1.aa = '2023'
      AND T1.cau = '3010'
    GROUP BY
      T2.PROVINCIA,
      T2.SIGLA;

    With this query I get the worldmap geometry, despite HeavyIQ already picked up in the query the correct geometry table:

    I'm aware that a number of worldmap country codes overlap with my province_centrosud codes, but in this case I explicty gave the hint "per le province del centrosud italia" in the prompt, and added manually the correct geometry table as source, but still the province_centrosud geometry was not projected.

    So, something else should occurs here.

     

    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Anyway, I got to project the correct south Italy map, by requesting explicity the geometry column in my prompt :

    Mostrami geometria, colli, peso totale, trasporto base e trasporto extra, handling fuel e immmobile mm e vet  a Marzo  2023  solo causale 3010 

    This just before HeavyIQ stopped working with the message in Immerse (https://support.heavy.ai/hc/en-us/community/posts/24411563560343):

    You currently don't have HeavyIQ enabled, our new AI curator. Speak with your administrator to enable this feature.

    That is a good news, being the first successfully attempt to show custom map in auto generated choropleth: unfortunately I cannot experimenting more because HeavyIQ not enabled anymore.

     

    0
    Comment actions Permalink
  • Avatar
    Todd Mostak

    Hi Gianfranco Campana, good to hear you got the map working (and yes, have to explicitly request the geometry sometimes... working on more training to get the model to always include it if a map is requested).

    Re the other issue, we need to troubleshoot that. I know Candido Dessanti is on vacation this week, but perhaps we can set up a call to walk through your install? I'll try to join if I can.

    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Hi Todd,
    sure, let me know what day and time better fit you .

    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    Just adding what I found in the /logs/iq/console log:

      File "<frozen heavyiq.api>", line 155, in create_app
      File "<frozen heavyiq.config>", line 78, in get_config
      File "<frozen heavyiq.config>", line 60, in validate_config
    ValueError: Custom LLM type is set to 'API_VLLM', but API base URL is not set.
    0
    Comment actions Permalink
  • Avatar
    Gianfranco Campana

    In addition in /logs/all I get:

    time="2024-08-20T08:40:11Z" level=error msg="Could not GET HeavyIQ version"
    time="2024-08-20T08:40:11Z" level=error msg="Could not get HeavyIQ version"
    0
    Comment actions Permalink
  • 0
    Comment actions Permalink

Please sign in to leave a comment.