(geometry, separated, wrapFeature, sourceFeature, sourceFeatureIndex)
| 104748 | return separated; |
| 104749 | } |
| 104750 | function separateGeometry(geometry, separated, wrapFeature, sourceFeature, sourceFeatureIndex) { |
| 104751 | var type = geometry.type, coordinates = geometry.coordinates; |
| 104752 | var pointFeatures = separated.pointFeatures, lineFeatures = separated.lineFeatures, polygonFeatures = separated.polygonFeatures, polygonOutlineFeatures = separated.polygonOutlineFeatures; |
| 104753 | if (!validateGeometry(type, coordinates)) { |
| 104754 | (0, _core.log).warn("".concat(type, " coordinates are malformed"))(); |
| 104755 | return; |
| 104756 | } |
| 104757 | switch(type){ |
| 104758 | case "Point": |
| 104759 | pointFeatures.push(wrapFeature({ |
| 104760 | geometry: geometry |
| 104761 | }, sourceFeature, sourceFeatureIndex)); |
| 104762 | break; |
| 104763 | case "MultiPoint": |
| 104764 | coordinates.forEach(function(point) { |
| 104765 | pointFeatures.push(wrapFeature({ |
| 104766 | geometry: { |
| 104767 | type: "Point", |
| 104768 | coordinates: point |
| 104769 | } |
| 104770 | }, sourceFeature, sourceFeatureIndex)); |
| 104771 | }); |
| 104772 | break; |
| 104773 | case "LineString": |
| 104774 | lineFeatures.push(wrapFeature({ |
| 104775 | geometry: geometry |
| 104776 | }, sourceFeature, sourceFeatureIndex)); |
| 104777 | break; |
| 104778 | case "MultiLineString": |
| 104779 | coordinates.forEach(function(path) { |
| 104780 | lineFeatures.push(wrapFeature({ |
| 104781 | geometry: { |
| 104782 | type: "LineString", |
| 104783 | coordinates: path |
| 104784 | } |
| 104785 | }, sourceFeature, sourceFeatureIndex)); |
| 104786 | }); |
| 104787 | break; |
| 104788 | case "Polygon": |
| 104789 | polygonFeatures.push(wrapFeature({ |
| 104790 | geometry: geometry |
| 104791 | }, sourceFeature, sourceFeatureIndex)); |
| 104792 | coordinates.forEach(function(path) { |
| 104793 | polygonOutlineFeatures.push(wrapFeature({ |
| 104794 | geometry: { |
| 104795 | type: "LineString", |
| 104796 | coordinates: path |
| 104797 | } |
| 104798 | }, sourceFeature, sourceFeatureIndex)); |
| 104799 | }); |
| 104800 | break; |
| 104801 | case "MultiPolygon": |
| 104802 | coordinates.forEach(function(polygon) { |
| 104803 | polygonFeatures.push(wrapFeature({ |
| 104804 | geometry: { |
| 104805 | type: "Polygon", |
| 104806 | coordinates: polygon |
| 104807 | } |
no test coverage detected