1.0.10 • Published 1 year ago

wkt-formatter v1.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

wkt-formatter

Formats WKT string to add a new line and tabs for each WKT property.

Installation

npm

npm install wkt-formatter

yarn

yarn add wkt-formatter

Usage

Import formatWKTString function to the file where you would like to use it.

import formatWKTString from "wkt-formatter";

or

const formatWKTString = require("wkt-formatter");
const inputStr = 'PROJCS["NAD_1927_StatePlane_New_York_East_FIPS_3101",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-74.33333333333333],PARAMETER["Scale_Factor",0.9999666666666667],PARAMETER["Latitude_Of_Origin",40.0],UNIT["Foot_US",0.3048006096012192]]'

const outputString = formatWKTString(inputStr);

The output string should be formatted as in the following example:

PROJCS["NAD_1927_StatePlane_New_York_East_FIPS_3101", 
	GEOGCS["GCS_North_American_1927", 
		DATUM["D_North_American_1927", 
			SPHEROID["Clarke_1866", 6378206.4, 294.9786982]], 
		PRIMEM["Greenwich", 0.0], 
		UNIT["Degree", 0.0174532925199433]], 
	PROJECTION["Transverse_Mercator"], 
	PARAMETER["False_Easting", 500000.0], 
	PARAMETER["False_Northing", 0.0], 
	PARAMETER["Central_Meridian", -74.33333333333333], 
	PARAMETER["Scale_Factor", 0.9999666666666667], 
	PARAMETER["Latitude_Of_Origin", 40.0], 
	UNIT["Foot_US", 0.3048006096012192]]
1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago