Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to manipulate json map data most elegantly

Shulou Source: shulou.com Published: 2022-06-01 14:03:17 11月04日 Update

This article is about how to most elegantly manipulate json map data, the editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

Know that recently in the leaflet community browsing the case, found that God has provided a very good json data parsing solution, at least two (conservative estimate) more than the package can win this task, and directly call off-the-shelf functions, do not need to write their own program.

The solution mentioned above is to make use of the mature json interface (Icano) tool:

Geojsonio package and rgdal package:

The two packages can be seamlessly converted between mainstream spatial format data.

Let's take the world map as an example to demonstrate the process of data conversion.

Library ("jsonlite")

Library ("ggplot2")

Library (plyr)

Library (dplyr)

Library (geojsonio)

Library (rgdal)

If you are still stuck in the era of manually extracting data using jsonlite packages, you may need to go through the following indescribable code steps:

Setwd ("D:/R/mapdata/State")

# # #

World_data

Tags: Data function two map code that is scheme format space work elegance tools more case knowledge community article processing application maturity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia MySQL macOS Shulou Information