MCPcopy Create free account
hub / github.com/microsoft/SandDance / quantizeGeometry

Function quantizeGeometry

docs/tests/v2/es6/js/sanddance.js:80907–80940  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

80905 }
80906
80907 function quantizeGeometry(input) {
80908 var output;
80909
80910 switch (input.type) {
80911 case "GeometryCollection":
80912 output = {
80913 type: "GeometryCollection",
80914 geometries: input.geometries.map(quantizeGeometry)
80915 };
80916 break;
80917
80918 case "Point":
80919 output = {
80920 type: "Point",
80921 coordinates: quantizePoint(input.coordinates)
80922 };
80923 break;
80924
80925 case "MultiPoint":
80926 output = {
80927 type: "MultiPoint",
80928 coordinates: input.coordinates.map(quantizePoint)
80929 };
80930 break;
80931
80932 default:
80933 return input;
80934 }
80935
80936 if (input.id != null) output.id = input.id;
80937 if (input.bbox != null) output.bbox = input.bbox;
80938 if (input.properties != null) output.properties = input.properties;
80939 return output;
80940 }
80941
80942 function quantizeArc(input) {
80943 var i = 0,

Callers 1

_defaultFunction · 0.70

Calls 1

quantizePointFunction · 0.70

Tested by

no test coverage detected