JSProj
Provides APIs for coordinate system transformation calculations.
Creates Module.JSProj API.
If no input value is provided, it defaults to EPSG:4326.
Apart from the EPSG list, any coordinate system worldwide can be used by entering a PROJ4 code (refer to epsg.io).
let projection = new Module.JSProj(); // Defaults to epsg:4326
let projection = new Module.JSProj("EPSG code (epsg:4326)");
let projection = new Module.JSProj("PROJ4 code (+proj=longlat +datum=WGS84 +no_defs +type=crs)"); // PROJ4 code
Function
apply(code) → object
Resets the Projection.
Initializes the previous Projection and creates a Projection with the input value.
code
string
Input value for epsg, proj4 code.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (failure error code).
find(epsg) → object
Checks the existence of an EPSG in the list of Projections supported by the engine.
Returns the corresponding PROJ4 for the entered EPSG code.
Refer to the supported EPSG list.
epsg
string
Input value for epsg code.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (PROJ4 string: normal return value, string: failure error code).
getProjCode() → string
Returns the proj4 code, which is a component of the Projection applied to the JSProj variable.
Return
API result information return (PROJ4 string: normal return value, blank: JSProj initialization state).
transform(option) → object
Performs coordinate transformation.
Transforms the entered coordinate information to the Projection applied to the JSProj variable.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (Array: transformed coordinate list, string: failure error code).
Sample
Refer to function transform.
Class Function
list() → object
Provides the entire list of Projections supported by the engine to the user.
The list information is composed of epsg codes in number Type.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (Array: epsg code list).
find(epsg) → object
Checks the existence of an EPSG in the list of Projections supported by the engine
Returns the corresponding PROJ4 for the entered EPSG code.
Refer to the supported EPSG list.
epsg
string
Input value for epsg code.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (PROJ4 string: normal return value, string: failure error code).
transform(option) → object
Performs coordinate transformation.
Transforms the entered coordinate information to the Projection applied to the JSProj variable.
Return
.result: API success status (1: Success, 0: Failure).
.name: Operating API name.
.return: API result information return (Array: transformed coordinate list, string: failure error code).
Type Definitions
TransformOptions
Options for coordinate transformation
source
string
Input CRS string for coordinates.
coordinates
Array(JSVector2D, JSVector3D), JSVector2D, JSVector3D, JSVec2Array, JSVec3Array
Target location coordinates.
ClassTransformOptions
Options for coordinate transformation
target
string
Target CRS string.
source
string
Input CRS string for coordinates.
coordinates
Array(JSVector2D, JSVector3D), JSVector2D, JSVector3D, JSVec2Array, JSVec3Array
Target location coordinates.
EPSG Coordinate Type List
A list of EPSG codes commonly used in Korea.
Inside the engine, corresponding PROJ4 codes can be returned through EPSG:"number".
If an unsupported EPSG code is entered, PROJ4 provided by epsg.io can be entered for use.
2087
epsg:2087
2096
epsg:2096
2097
epsg:2097
3857
epsg:3857
4019
epsg:4019
4044
epsg:4044
4162
epsg:4162
4166
epsg:4166
4326
epsg:4326
4737
epsg:4737
5173
epsg:5173
5174
epsg:5174
5175
epsg:5175
5176
epsg:5176
5177
epsg:5177
5178
epsg:5178
5179
epsg:5179
5180
epsg:5180
5181
epsg:5181
5182
epsg:5182
5183
epsg:5183
5184
epsg:5184
5185
epsg:5185
5186
epsg:5186
5187
epsg:5187
5188
epsg:5188
32651
epsg:32651
32652
epsg:32652
Last updated