MCPcopy
hub / github.com/microsoft/SandDance / geometry

Function geometry

docs/app/js/sanddance-app.js:109496–109529  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

109494 return arcs.map(ring);
109495 }
109496 function geometry(o) {
109497 var type = o.type, coordinates;
109498 switch(type){
109499 case "GeometryCollection":
109500 return {
109501 type: type,
109502 geometries: o.geometries.map(geometry)
109503 };
109504 case "Point":
109505 coordinates = point(o.coordinates);
109506 break;
109507 case "MultiPoint":
109508 coordinates = o.coordinates.map(point);
109509 break;
109510 case "LineString":
109511 coordinates = line(o.arcs);
109512 break;
109513 case "MultiLineString":
109514 coordinates = o.arcs.map(line);
109515 break;
109516 case "Polygon":
109517 coordinates = polygon(o.arcs);
109518 break;
109519 case "MultiPolygon":
109520 coordinates = o.arcs.map(polygon);
109521 break;
109522 default:
109523 return null;
109524 }
109525 return {
109526 type: type,
109527 coordinates: coordinates
109528 };
109529 }
109530 return geometry(o2);
109531}
109532

Callers 2

objectFunction · 0.70
extractArcsFunction · 0.70

Calls 8

pointFunction · 0.70
lineFunction · 0.70
polygonFunction · 0.70
extract1Function · 0.70
extract2Function · 0.70
extract3Function · 0.70
extractFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected