npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@paqira/jgdtrans

v0.1.2

Published

Coordinate Transformer by Gridded Correction Parameter (par file)

Downloads

23

Readme

jgdtrans for TypeScript/JavaScript

NPM Version GitHub Actions Workflow Status Static Badge NPM License

Unofficial coordinate transformer by Gridded Correction Parameter which Geospatial Information Authority of Japan (GIAJ, formerly GSIJ) distributing for TypeScript/JavaScript.

国土地理院が公開しているパラメータファイル(par ファイル)による座標変換(順逆変換)の非公式な実装です。

Features:

  • Supports offline transformation (no web API)
    • オフライン変換(web API 不使用)
  • Supports both original forward and backward transformation
    • 順変換と逆変換の両方をサポート
  • Supports verified backward transformation
    • 精度を保証した逆変換のサポート
  • Supports all TKY2JGD, PatchJGD, PatchJGD(H), HyokoRev, SemiDynaEXE and POS2JGD (geonetF3 and ITRF2014)
  • Clean implementation
    • 保守が容易な実装

Usage

This package does not contain parameter files, download it from GIAJ.

このパッケージはパラメータファイルを提供しません。公式サイトよりダウンロードしてください。

It supports ESM and non-ESM loading:

<!-- ESM -->
<script type="module" type="text/javascript">
  import jgdtrans from 'https://cdn.jsdelivr.net/npm/@paqira/[email protected]/dist/jgdtrans.js';
  ...
</script>
<!-- non-ESM -->
<script
  nomodule
  defer
  src="https://cdn.jsdelivr.net/npm/@paqira/[email protected]/dist/jgdtrans.nomodule.min.js"
  integrity="sha256-StpZg/zmEw183fm6Dcx9ifllTnf8bwdeJWAqz+heTtU="
  crossorigin="anonymous"
></script>

Sample code:

// Comment out following `import ...;` when loading jgdtrans.nomodule{.min}.js
import jgdtrans from "https://cdn.jsdelivr.net/npm/@paqira/[email protected]/dist/jgdtrans.js";

// Contents of SemiDyna2023.par
const contents = "...";
const tf = jgdtrans.Transformer.fromString(contents, "SemiDynaEXE");

// Geospatial Information Authority of Japan
const origin = new jgdtrans.Point(36.10377479, 140.087855041, 2.34);

// forward transformation
const result = tf.forward(origin);
// prints Point(latitude=36.103773017086695, longitude=140.08785924333452, altitude=2.4363138578103)
console.log(result.toString());

// backward transformation
const p = tf.backward(result);
// prints Point(latitude=36.10377479, longitude=140.087855041, altitude=2.34)
console.log(p.toString());

// backward transformation compatible to GIAJ web app/APIs
const q = tf.backwardCompat(result);
// prints Point(latitude=36.10377479000002, longitude=140.087855041, altitude=2.339999999578243)
console.log(q.toString());

Licence

MIT

Reference

  1. Geospatial Information Authority of Japan (GIAJ, 国土地理院): https://www.gsi.go.jp/, (English) https://www.gsi.go.jp/ENGLISH/.
  2. TKY2JGD for Windows Ver.1.3.79 (reference implementation): https://www.gsi.go.jp/sokuchikijun/tky2jgd_download.html released under 国土地理院コンテンツ利用規約 which compatible to CC BY 4.0.
  3. Other implementation: Rust https://github.com/paqira/jgdtrans-rs, Python https://github.com/paqira/jgdtrans-py, Java https://github.com/paqira/jgdtrans-java.