Load data from a Shapefile

This example illustrates how to load data from a shapefile using GeoPandas. A shapefile is a complex format, compared to CSV or GeoJSON, so GeoPandas offers more options for reading it.


In [1]:
from geopandas import read_file

gdf = read_file('https://libs.cartocdn.com/cartoframes/files/sustainable_palm_oil_production_mills.zip')
gdf.head()


Out[1]:
carbon_con objectid entity_id latitude longitude audit_stat legal_radi illegal_ra radius_umd radius_for ... carbon_r_3 peat_for_2 peat_for_3 primary_10 primary_11 mill_name parent_com rspo_certi date_updat geometry
0 460.463240 1 ID1822 -1.585833 103.205556 ASA 1 0 0.321764 0.225759 1099 ... 1224 0 29 0.004508 0.135391 Muara Bulian Mill PT Inti Indosawit Subur yes 14-Aug POINT (103.20556 -1.58583)
1 2408.120739 2 ID1847 0.077043 102.030838 Renewal Certification 0 0.445960 0.258855 1979 ... 2038 7 523 0.017304 0.321418 Pabrik Kelapa Sawit Batang Kulim POM PT Musim Mas yes 14-Aug POINT (102.03084 0.07704)
2 273.474468 3 ID1720 1.660222 100.590611 Initial Certification 0 0.498531 0.248520 1432 ... 1518 0 476 0.000811 0.193365 Kayangan and Kencana POM PT Salim Ivomas Pratama Tbk yes 14-Aug POINT (100.59061 1.66022)
3 37544.098740 4 ID1945 -2.894444 112.543611 ASA 1 0 0.662863 0.186332 226 ... 269 59 66 0.124882 0.189169 PT Sarana Titian Permata POM Wilmar International Ltd yes 14-Aug POINT (112.54361 -2.89444)
4 2475.128290 5 ID1553 3.593333 98.947222 Initial Certification 0 0.533668 0.028972 382 ... 412 0 0 0.000216 0.009296 Adolina POM PT Perkebunan Nusantara IV (PERSERO) yes 14-Aug POINT (98.94722 3.59333)

5 rows × 73 columns


In [2]:
from cartoframes.viz import Layer

Layer(gdf)


Out[2]:
:
StackTrace
    ">