Socket
Book a DemoInstallSign in
Socket

bkk-district-geocoding

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bkk-district-geocoding

![Google Gemini](https://img.shields.io/badge/google%20gemini-8E75B2?style=for-the-badge&logo=google%20gemini&logoColor=white) ![GitLab CI](https://img.shields.io/badge/gitlab%20ci-%23181717.svg?style=for-the-badge&logo=gitlab&logoColor=white)

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Bangkok District Geocoding

Google Gemini GitLab CI

A lightweight library to find the Bangkok district based on latitude and longitude coordinates.

Features

  • Fast and Efficient: Quickly find a district from geographic coordinates.
  • Offline: No network requests needed; all data is included in the package.
  • TypeScript Support: Fully typed for a better development experience.

Data Source

The geographic data for Bangkok's 50 districts is sourced from the official Open Government Data of Bangkok website:

  • Source: พื้นที่เขตปกครอง 50 เขตของกรุงเทพมหานคร

The original data was provided in Shapefile format and was converted to GeoJSON using mygeodata.cloud.

Installation

pnpm install bkk-district-geocoding
# or
npm install bkk-district-geocoding
# or
yarn add bkk-district-geocoding

Usage

import { getDistrictFromLatLng } from 'bkk-district-geocoding'

const latitude = 13.7563
const longitude = 100.5018

const district = getDistrictFromLatLng(latitude, longitude)

if (district) {
  console.log(`The district is: ${district.properties.dname}`)
  console.log(`District Code: ${district.properties.dcode}`)
} else {
  console.log('No district found for the given coordinates.')
}

Development

This project uses pnpm as the package manager.

  • pnpm install - Install dependencies
  • pnpm dev - Start the development server
  • pnpm build - Build for production
  • pnpm test - Run all tests

License

MIT

FAQs

Package last updated on 08 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.