Skip to content

Commit

Permalink
v0.5.80
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Dec 19, 2021
1 parent 643dedd commit 6acdf8b
Show file tree
Hide file tree
Showing 24 changed files with 485 additions and 364 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.5.80
* Added arrows, stars and polygons to undocumented -symbols command.

v0.5.79
* More permissive importing of some non-standard Shapefiles.

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mapshaper",
"version": "0.5.79",
"version": "0.5.80",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down
111 changes: 68 additions & 43 deletions src/cli/mapshaper-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,36 +1287,6 @@ export function getOptionParser() {
})
.option('target', targetOpt);

parser.command('shapes')
.describe('convert points to polygons, circles or stars')
.option('type', {
describe: 'type of shape (e.g. star, polygon, circle)'
})
.option('radius', {
describe: 'distance from center to farthest point on the shape',
type: 'distance'
})
.option('units', {
describe: 'geographical units of radius parameter (e.g. km)'
})
.option('sides', {
describe: 'number of sides; five-pointed stars have 10 sides',
type: 'number'
})
.option('rotation', {
describe: 'rotation of the shape in degrees',
type: 'number'
})
.option('orientation', {
describe: 'use orientation=b for a rotated orientation'
})
.option('star-ratio', {
describe: 'ratio of major to minor radius of stars',
type: 'number'
})
.option('name', nameOpt)
.option('target', targetOpt)
.option('no-replace', noReplaceOpt);

parser.command('simplify')
.validate(V.validateSimplifyOpts)
Expand Down Expand Up @@ -1556,26 +1526,81 @@ export function getOptionParser() {
.option('target', targetOpt);

parser.command('symbols')
// .describe('generate a variety of SVG symbols')
// .describe('symbolize points as polygons, circles, stars or arrows')
.option('type', {
describe: 'symbol type'
describe: 'symbol type (e.g. star, polygon, circle, arrow)'
})
.option('scale', {
describe: 'scale symbols by a factor',
type: 'number'
})
.option('pixel-scale', {
describe: 'symbol scale in meters-per-pixel (see polygons option)',
type: 'number',
})
.option('polygons', {
describe: 'generate symbols as polygons instead of SVG objects',
type: 'flag'
})
.option('radius', {
describe: 'distance from center to farthest point on the symbol',
type: 'distance'
})
.option('sides', {
describe: 'sides of a polygon or star symbol',
type: 'number'
})
.option('rotation', {
describe: 'rotation of symbol in degrees'
})
.option('orientation', {
describe: 'use orientation=b for a rotated or flipped orientation'
})
.option('length', {
// alias for arrow-length
})
.option('star-ratio', {
describe: 'ratio of major to minor radius of star',
type: 'number'
})
.option('arrow-length', {
describe: 'length of arrows in pixels (use with type=arrow)'
})
.option('arrow-direction', {
describe: 'angle off of vertical (-90 = left-pointing arrow)'
})
.option('arrow-head-angle', {
describe: 'angle of tip of arrow (default is 40 degrees)'
})
.option('arrow-head-width', {
describe: 'size of arrow head from side to side'
})
.option('arrow-stem-width', {
describe: 'width of stem at its widest point'
})
.option('arrow-stem-taper', {
describe: 'factor for tapering the width of the stem'
})
.option('arrow-stem-curve', {
describe: 'curvature in degrees (arrows are straight by default)'
})
.option('arrow-min-stem', {
describe: 'min ratio of stem to total length (for small arrows)',
type: 'number'
})
.option('stroke', {})
.option('stroke-width', {})
.option('fill', {})
.option('length', {})
.option('rotation', {})
.option('fill', {
describe: 'symbol fill color'
})
.option('effect', {})
.option('arrow-head-angle', {})
.option('arrow-stem-width', {})
.option('arrow-head-width', {})
.option('arrow-stem-curve', {})
.option('arrow-stem-taper', {})
.option('arrow-scaling', {})
.option('where', whereOpt)
.option('target', targetOpt);
// .option('where', whereOpt)
.option('name', nameOpt)
.option('target', targetOpt)
.option('no-replace', noReplaceOpt);
// .option('name', nameOpt);


parser.command('target')
.describe('set active layer (or layers)')
.option('target', {
Expand Down
3 changes: 1 addition & 2 deletions src/cli/mapshaper-run-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import '../commands/mapshaper-rotate';
import '../commands/mapshaper-run';
import '../commands/mapshaper-scalebar';
import '../commands/mapshaper-shape';
import '../commands/mapshaper-shapes';
import '../commands/mapshaper-simplify';
import '../commands/mapshaper-sort';
import '../commands/mapshaper-snap';
Expand Down Expand Up @@ -401,7 +400,7 @@ export function runCommand(command, catalog, cb) {
applyCommandToEachLayer(cmd.svgStyle, targetLayers, targetDataset, opts);

} else if (name == 'symbols') {
applyCommandToEachLayer(cmd.symbols, targetLayers, opts);
outputLayers = applyCommandToEachLayer(cmd.symbols, targetLayers, targetDataset, opts);

} else if (name == 'subdivide') {
outputLayers = applyCommandToEachLayer(cmd.subdivideLayer, targetLayers, arcs, opts.expression);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mapshaper-scalebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import utils from '../utils/mapshaper-utils';
import { DataTable } from '../datatable/mapshaper-data-table';
import { stop } from '../utils/mapshaper-logging';
// import { symbolRenderers } from '../svg/svg-common';
import { symbolRenderers } from '../svg/mapshaper-basic-symbols';
import { symbolRenderers } from '../svg/mapshaper-svg-symbols';

cmd.scalebar = function(catalog, opts) {
var frame = findFrameDataset(catalog);
Expand Down
106 changes: 0 additions & 106 deletions src/commands/mapshaper-shapes.js

This file was deleted.

Loading

0 comments on commit 6acdf8b

Please sign in to comment.