ans-4175 / peta-indonesia-geojson

Peta GeoJSON Indonesia dengan Kode Provinsi
MIT License
73 stars 50 forks source link

There might be something wrong with Kalimantan's boundaries #6

Open j4p opened 2 years ago

j4p commented 2 years ago

Before going further, I'd like to put on a disclaimer that I'm not very well-versed in GIS.

I was using this geojson for a choropleth map in R. For some reason, I couldn't get it to work properly: some areas seemed to be hidden. I tried changing the color scale and found out that it was the color that represents the z-value that was leaking out, and not that some areas are hidden.

Here are the data that I used: leak_test.xlsx I tried to use only the first few rows and found out that it worked well until the 19th row as you can see down below: image When I tried to include the 20th row, this happened: image As you can see from leak_test.xlsx, the 20th row has the province id of 61 (Kalimantan Barat).

The same process is done from the bottom. Last 10 rows returned a perfectly fine plot: image But not the last 11 rows: image As you can also see from leak_test.xlsx, the 11th row from the bottom has the province id of 65 (Kalimantan Utara).

These findings led me to believe that there might be something wrong with Kalimantan's boundaries.

Libraries used:

The code if anyone is interested:

library(tidyverse)
library(plotly)
library(readxl)
library(rjson)

id_map <- fromJSON(file="https://raw.githubusercontent.com/ans-4175/peta-indonesia-geojson/master/indonesia-prov.geojson")
lt <- read_xlsx("leak_test.xlsx")
lt_subset <- head(lt, 19)
# lt_subset <- head(lt, 20)
# lt_subset <- tail(lt, 10)
# lt_subset <- tail(lt, 11)

plot_ly() %>%
  add_trace(
    type="choropleth",
    geojson=id_map,
    locations=lt_subset$Province,
    z=lt_subset$Value,
    colorscale="Viridis"
  ) %>%
  colorbar(title="Value") %>%
  layout(
    geo=list(
      fitbounds="locations",
      showcoastlines=FALSE),
    title="Province Value"
  )
ans-4175 commented 2 years ago

Hi @j4p , thanks for your report. I believe its valid, since it's Kalimantan have multiple geojson polyfill. I will take a look at it