[Python] Geojsonio does not render jsonfile

Discussão em 'Python' iniciado por Stack, Dezembro 21, 2024.

  1. Stack

    Stack Membro Participativo

    All,

    The geojsonio package is not rendering simple JSON files on geojson.io as it should be. I get empty map as shown below

    [​IMG] Here is the Python code I use to render the geojson file.

    import geopandas as gpd
    states = gpd.read_file('us-states.json') # available at https://github.com/PublicaMundi/MappingAPI/tree/master/data/geojson
    print(states.head())

    states_ = states.to_json()
    print(states_)

    import geojsonio
    geojsonio.display(states_)


    However, I can render it by opening the json file via open tap https://geojson.io/#map=2/0/20 as shown below [​IMG]

    Any ideas. Thanks

    Continue reading...

Compartilhe esta Página