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

@orbat-mapper/convert-symbology

v1.0.2

Published

Convert between letter based and number based symbol identification codes (MILSTD 2525/APP6)

Downloads

1,087

Readme

Convert symbology

Convert between letter based symbol identification codes (SIDC) and number based SIDCs (MILSTD 2525C ↔ 2525D / APP-6 C ↔ D ). The mappings from 2525C to 2525D are based on data from the Joint Military Symbology Markup Language (JMSML) project.

Limitations

Please note that it is not possible to convert every symbol identification code. Most symbols from 2525C/APP-6C are available in 2525D/APP-6D. However, many symbol variants from 2525D/APP-6D does not exist in older versions.

Most of the available mappings are for symbols that are ment to be drawn. Some symbol codes exists only for hierarchical purposes and the conversion process may fail for these symbol codes. In these cases, the conversion process will try to pick the closest matching symbol code.

Feel free to open an issue or start a discussion if you find a symbol that is not converted correctly.

Installation

# or pnpm or yarn
npm install @orbat-mapper/convert-symbology

Usage

import { convertLetterSidc2NumberSidc } from "@orbat-mapper/convert-symbology";

const { sidc } = convertLetterSidc2NumberSidc("SFGPUCIC---E---");
console.log(sidc); // "10031000151211000002"

You can also convert from a number based SIDC to a letter based SIDC:

import { convertNumberSidc2LetterSidc } from "@orbat-mapper/convert-symbology";

const { sidc } = convertNumberSidc2LetterSidc("10031000151211000002");
console.log(sidc); // "SFGPUCIC---E---"

The conversion functions return an object with the following properties:

  • sidc - a string with the converted number or letter based SIDC. If the conversion failed, the sidc property will be an empty string.
  • match - a string indicating the type of match found during the conversion process. Possible values are exact, partial, closest and failed
  • success - a boolean flag indicating if the conversion was successful. If true the match property will be exact. If false the match property will be eiter partial, closest or failed.

Examples:

import { convertLetterSidc2NumberSidc } from "@orbat-mapper/convert-symbology";

// convert TACGRP.MOBSU.OBST.AVN (a hierarchical symbol with no graphic representation)
const { sidc, match, success } =
  convertLetterSidc2NumberSidc("G-M-OH---------");
// Protection Points - Vertical Obstructions
console.log(sidc); // "10032500002820000000"
console.log(match); // "exact";
console.log(success); // true;

// convert TACGRP.MOBSU.OBST.AVN.TWR (a hierarchical symbol with no graphic representation)
const { sidc, match, success } =
  convertLetterSidc2NumberSidc("G-M-OHT--------");
// Does not exist in 2525D. Picking closest Protection Points - Vertical Obstructions - Tower High
console.log(sidc); // "10032500002820020000"
console.log(match); // "closest";
console.log(success); // false;
import { convertNumberSidc2LetterSidc } from "@orbat-mapper/convert-symbology";

const { sidc, match, success } = convertNumberSidc2LetterSidc(
  "10031000151211000002",
);
console.log(sidc); // "SFGPUCIC---E---"
console.log(match); // "exact";
console.log(success); // true;

// Convert "Bicyle equipped infantry with dog".
const { sidc, match, success } = convertNumberSidc2LetterSidc(
  "10031000001211002004",
);
// This symbol does not exist in 2525C. Picking partial match Unit - Combat . Infantry
console.log(sidc); // "SFGPUCI--------"
console.log(match); // "partial";
console.log(success); // false;

API

convertLetterSidc2NumberSidc()

Type declarations

function convertLetterSidc2NumberSidc(
  letterSidc: string,
  options?: Letter2NumberOptions,
): Letter2NumberResult;

interface Letter2NumberOptions {}

interface Letter2NumberResult {
  sidc: string;
  success: boolean;
  match: MatchType;
}

type MatchType = "exact" | "partial" | "closest" | "failed";

convertNumberSidc2LetterSidc()

Type declarations

function convertNumberSidc2LetterSidc(
  numberSidc: string,
  options?: Number2LetterOptions,
): Number2LetterResult;

interface Number2LetterOptions {}

interface Number2LetterResult {
  sidc: string;
  success: boolean;
  match: MatchType;
}

type MatchType = "exact" | "partial" | "closest" | "failed";

Credits

The mappings from 2525C to 2525D are based on data from the Joint Military Symbology Markup Language (JMSML) project. Thank you ESRI for making this data available!