NAME

ms2proj -- mapsoft2 coordinate converter (libproj wrapper)

SYNOPSIS

ms2proj <options> <forms to convert>

DESCRIPTION

This is a command-line interface to mapsoft2 coordinate conversions. You can specify source and destination coordinate systems using libproj parameter strings or mapsoft aliases and convert points, lines, multisegment lines, rectangles. When converting lines additional points may appear if converted segments are not liner in the destination coordinate system. Accuracy of such transformation can be set using --acc parameter. Use --acc 0 to do point-to-point conversion of lines. A rectangle is transformed as a line, and bounding box of the result is returned. Conversions of angles and scales is supported by mapsoft2 library, but not by this program yet.

Ponts are written as JSON arrays of two of three numbers: [x,y] or [x,y,z]. Altitude (z-coordinate) is converted if --alt option is used. Lines are written as JSON arrays of points: [[x1,y1],[x2,y2],...]. Multisegments lines are JSON arrays of lines. Rectangle is a JSON array with four numbers: [x,y,w,h].

OPTIONS

-h, --help

Show help message.

--pod

Show help message as POD template.

-f, --from <arg>

Source coordinate systeg, "libproj" parameter string (e.g. "+datum=WGS84 +proj=lonlat") or mapsoft2 alias ("WGS", "WEB", "FI", "CH", "SU39", etc.). Default: "WGS"

-t, --to <arg>

Destination coordinate system. Default: "WGS"

-b, --back

Do inverse conversion, destination -> source.

-z, --alt

Convert altitude (by default it is not converted).

-a, --acc <arg>

Convertion accuracy for lines and rectangles in source units, (default: 1.0).

-M, --shift <arg>

Shift coordinates before conversion (default: [0,0])

-S, --scale <arg>

Scale coordinate after shifting and before conversion (default: 1)

EXAMPLES

Convert point from WGS84 to Web mercator:

ms2proj --to WEB [30,50]

Convert point from Web mercator to WGS84:

ms2proj --from WEB [3339584,6446275]

Same, but coordinates are in kilometers:

ms2proj --from WEB --scale 1000 [3339.584,6446.275]

Same, but source and target projections are written as libproj options:

ms2proj --from '+proj=webmerc +datum=WGS84' --to ' +proj=lonlat +datum=WGS84' [3339584,6446275]

Convert line from Finnish KKJ system to WGS84:

ms2proj --from FI [[3385908,6675072],[3385908,6677072]]

Convert line from WGS84 to Soviet map system with lon0=33. Accuracy which is 1.0 by default is measured in source system (WGS84) and straight lines are converted to straight lines here:

ms2proj --to SU33 [[30,50],[30,54],[36,54],[36,50],[30,50]]

To specify accuracy in meters we do this trick. Now the result contains more points when stright lines are converted to arcs:

ms2proj --back --from SU33 [[30,50],[30,54],[36,54],[36,50],[30,50]]

AUTHOR

Vladislav Zavjalov <slazav@altlinux.org>

SEE ALSO