• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Indonesia administrative map

Wilayah Indonesia

Travis status: Build Status

Migrating only data into PostgreSQL

Use https://github.com/rubenv/sql-migrate install with:

go get -v github.com/rubenv/sql-migrate/...

Create database in postgres, for example database id_area, and change your database configuration in file rubenv-migrate.yml, then run:

sql-migrate up -config rubenv-migrate.yml

Using REST API

You can use Rest API with just one binary.

  • First, migrate the data using sql-migrate.
  • Second, build using Golang by go mod download and go build -o artifacts/wilayah_indonesia main.go Then set config on .env file and run the program ./artifacts/wilayah_indonesia

Endpoints

Just 4 simple Rest API:

Using JAVA API

Please move all inside /data directory to /resources in your root project:

- your-project
  - resources
    - list_of_area
    - geojson
  - src
    - main
      - java
  - target

then add this to your maven pom.xml

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

then add the dependency:

<dependency>
  <groupId>com.github.yusufsyaifudin</groupId>
  <artifactId>wilayah-indonesia</artifactId>
  <version>0.0.4</version>
</dependency>

If you're using gradle, add this in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    maven { url "https://jitpack.io" }
  }
}

and add the dependency

dependencies {
  compile 'com.github.yusufsyaifudin:wilayah-indonesia:0.0.4'
}

Calling the data

If you have move the data to resources directory, you can now call this method to load the data (without database):

import wilayah.indonesia.*;
import wilayah.indonesia.model.*;

Location.Provinces() // will return List<Province>
Location.Regencies() // will return List<Regency>  
Location.Districts() // will return List<District>
Location.Villages() // will return List<Village>

Note

Data in this repo come from many source:

License

  • The data are under: ODBL v1.0.
  • The source data is attributed to list mentioned above.

More Repositories

1

raft-sample

Straightforward implementation of Raft Consensus
Go
61
star
2

go-kafka-example

An API and Worker using Kafka publish+subscribe written in Golang
Go
58
star
3

indonesia-ner

Named Entity Recognition for Bahasa Indonesia
Java
53
star
4

oauth2-example-hydra

Login and Consent ory/hydra example. Read article here https://yusufs.medium.com/practical-example-of-implementing-oauth-2-0-using-ory-hydra-fbaa2765d94f
Go
47
star
5

template-skripsi-mipa

Template Skripsi MIPA UGM
TeX
37
star
6

tokenizer-id

Tokenizer untuk Bahasa Indonesia
Java
13
star
7

node-fasttext

A https://github.com/facebookresearch/fastText wrapper in nodeJS
C++
5
star
8

benthos-sample

Go
4
star
9

gopg-mock

Sql mock for https://github.com/go-pg/pg
Go
4
star
10

go-opentracing-example

Opentracing example using echo router. Presentation: https://speakerdeck.com/yusufsyaifudin/understand-your-system-behavior-by-implement-distributed-tracing-using-jaeger Article: https://yusufs.medium.com/understand-your-system-behavior-by-implement-distributed-tracing-using-jaeger-9041df1104ec
Go
4
star
11

grader-library

This is a library to create an online judge system based on PHP.
C
3
star
12

ipostagger

Maven Repository untuk IPOSTagger menggunakan HMM dari http://www.informatika.org/~ayu/2010postagger.pdf
3
star
13

go-project-structure

Go
3
star
14

kongko

Go
2
star
15

go-jwt-login-example

Example authentication and authorization user process in Go
Go
2
star
16

tax-calculator-example

Go
2
star
17

babel-vs-typescript

A brief example how to coding using BabelJS vs TypeScript
JavaScript
2
star
18

txtproc

Simple text processor in Golang
Go
1
star
19

random-generator

Random String Generator
Java
1
star
20

dit

Catatan uang harian dengan menggunakan CodeIgniter.
PHP
1
star
21

node-cpp-matmul

An example of matrix multiplication using pure JS and CPP Eigen library
C++
1
star
22

archived-danbam

Go
1
star
23

gitrows-go

Git as Key-Value database
Go
1
star