Giter Site home page Giter Site logo

indonesia's Introduction

indonesia

This package includes things related to Indonesia. For the initial development, this package includes sf spatial data frame for:

  • Indonesia: 'provinsi' and 'kota' level
  • Jakarta: 'kecamatan', 'kelurahan' and 'RW' level

For Indonesia map, the data is get from GADM and for Jakarta map, the data is get from Jakarta Smart City.

Installation

You need to use sf package to enable the class of sf data frame. Also, you need to install ggplot2 development version to use geom_sf functionality (for visualization purpose).

# install.packages("devtools")
install.packages("sf")
devtools::install_github("tidyverse/ggplot2")
devtools::install_github("rasyidstat/indonesia")

Example

library(indonesia)
hai()
#> [1] "Selamat Datang di Indonesia!"

id_map is the function that return sf spatial data frame. It contains two parameters: region and level. For the initial development, it only contains two regions: "indonesia" and "jakarta".

  • "indonesia" consists of two geographical levels such as "provinsi" and "kota".
  • "jakarta" consists of three geographical levels such as "kecamatan", "kelurahan" and "rw".
library(sf)
library(indonesia)

# get indonesia map for 'provinsi' level
indonesia_provinsi <- id_map("indonesia", "provinsi")

# get indonesia map for 'kota' level
indonesia_kota <- id_map("indonesia", "kota")

# get jakarta map for 'kelurahan' level
jakarta_kelurahan <- id_map("jakarta", "kelurahan")

head(jakarta_kelurahan)
#> Simple feature collection with 6 features and 8 fields
geometry type:  POLYGON
dimension:      XY
bbox:           xmin: 106.7928 ymin: -6.373226 xmax: 106.92 ymax: -6.331914
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs
  kode_provinsi                 nama_provinsi kode_kota       nama_kota kode_kecamatan nama_kecamatan kode_kelurahan  nama_kelurahan
1            31 DAERAH KHUSUS IBUKOTA JAKARTA      3171 Jakarta Selatan        3171010      Jagakarsa     3171010001         Cipedak
2            31 DAERAH KHUSUS IBUKOTA JAKARTA      3172   Jakarta Timur        3172020        Ciracas     3172020001         Cibubur
3            31 DAERAH KHUSUS IBUKOTA JAKARTA      3172   Jakarta Timur        3172030       Cipayung     3172030001  Pondok Ranggon
4            31 DAERAH KHUSUS IBUKOTA JAKARTA      3172   Jakarta Timur        3172030       Cipayung     3172030003          Munjul
5            31 DAERAH KHUSUS IBUKOTA JAKARTA      3172   Jakarta Timur        3172010     Pasar Rebo     3172010001         Pekayon
6            31 DAERAH KHUSUS IBUKOTA JAKARTA      3171 Jakarta Selatan        3171010      Jagakarsa     3171010002 Srengseng Sawah
                        geometry
1 POLYGON((106.800101597915 -...
2 POLYGON((106.884067296907 -...
3 POLYGON((106.894108150063 -...
4 POLYGON((106.902775722093 -...
5 POLYGON((106.868279333562 -...
6 POLYGON((106.835497431474 -...

indonesia's People

Contributors

rasyidstat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.