TransWikia.com

Splitting GeoJSON column, what is in one dictionary?

Geographic Information Systems Asked by amudaria on April 15, 2021

I’m new to GIS. I can’t find anything to solve my problem.
What instrument can I use to do this? (pandas, geopandas)

enter image description here

One Answer

Based on the very rudimentary information you provided, you can try something like this, using QGIS expressions with map. Please provide more information for a an answer more to the point - but the basics should become clear from the following example and you can use it where you need it:

To get the fieldnames as an array, use map_akeys:

map_akeys( 
    json_to_map( 
        '{"UNOM": 10044, "OBJ_TYPE":"Zdanie","OnTerritoryOfMoscow":"da","ADDRESS":"gorod moskva, ulica Kiprenskogo, dom 4"}'
    )
)

Output looks something like: [ 'ADDRESS', 'OBJ_TYPE', 'OnTerritoryOfMoscow', 'UNOM' ]

With array_first (), you get: 'ADDRESS'. Use array_get(array,index) to get each element of the array.


To get the attribute-values as an array, use map_avals:

map_avals( 
    json_to_map( 
    '{"UNOM": 10044, "OBJ_TYPE":"Zdanie","OnTerritoryOfMoscow":"da","ADDRESS":"gorod moskva, ulica Kiprenskogo, dom 4"}'
    )
)

Output looks something like: [ 'gorod moskva, ulica Kiprenskogo, dom 4', 'Zdanie', 'da'… ]

With array_first (), you get: 'gorod moskva, ulica Kiprenskogo, dom 4'. Use array_get(array,index) to get each element of the array.

Correct answer by Babel on April 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP