0

I have a data set I am trying to display on map in streamlit using pydeck ColumnLayer. Pydeck seems not to read/process correctly the coordinates and displays ever data point on 0,0 coordinates. Height gets parsed correctly for each record, same as the coordinates in the tooltip.

Part of the csv data file:

country,radku,lat,lon
ALB,1,41,20
ARE,126,24,54
ARG,24,-34,-64
AUS,103,-27,133
AUT,1217,47.3333,13.3333
AZE,2,40.5,47.5
BEL,582,50.8333,4
BGR,40,43,25
BHR,8,26,50.55
BIH,2,44,18
BRA,243,-10,-55

layer definition:

    layer=pdk.Layer(
                'ColumnLayer',
                data=mdata,
                get_position='[lon, lat]',
                get_elevation ="radku",
                auto_highlight = True,
                radius = 100000,
                elevation_scale = 1000,
                pickable = True,
                extruded = True,
                get_Fill_Color = [48, 128, 255, 255],
            )    
 
    tooltip = {
    "html": "<b>{radku}</b> lines shipped in 2022 to <b>{country}</b> {lon} , {lat}",
    "style": {"background": "grey", "color": "white", "font-family": '"Helvetica Neue", Arial', "z-index": "10000"}}

writing the layer to console: "getPosition": "@@=[lon, lat]"

result: map

Tried all possible syntaxes to read the position but nothing seems to work

JaNo
  • 1

0 Answers0