File tree Expand file tree Collapse file tree 5 files changed +8
-291
lines changed Expand file tree Collapse file tree 5 files changed +8
-291
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -54,70 +54,50 @@ exports.calcTraceToLineCoords = function(calcTrace) {
54
54
*
55
55
* @param {array } coords
56
56
* results form calcTraceToLineCoords
57
- * @param {object } trace
58
- * (optional) full trace object to be added on to output
59
- *
60
57
* @return {object } out
61
58
* GeoJSON object
62
59
*
63
60
*/
64
- exports . makeLine = function ( coords , trace ) {
65
- var out = { } ;
66
-
61
+ exports . makeLine = function ( coords ) {
67
62
if ( coords . length === 1 ) {
68
- out = {
63
+ return {
69
64
type : 'LineString' ,
70
65
coordinates : coords [ 0 ]
71
66
} ;
72
- }
73
- else {
74
- out = {
67
+ } else {
68
+ return {
75
69
type : 'MultiLineString' ,
76
70
coordinates : coords
77
71
} ;
78
72
}
79
-
80
- if ( trace ) out . trace = trace ;
81
-
82
- return out ;
83
73
} ;
84
74
85
75
/**
86
76
* Make polygon ('Polygon' or 'MultiPolygon') GeoJSON
87
77
*
88
78
* @param {array } coords
89
79
* results form calcTraceToLineCoords
90
- * @param {object } trace
91
- * (optional) full trace object to be added on to output
92
- *
93
80
* @return {object } out
94
81
* GeoJSON object
95
82
*/
96
- exports . makePolygon = function ( coords , trace ) {
97
- var out = { } ;
98
-
83
+ exports . makePolygon = function ( coords ) {
99
84
if ( coords . length === 1 ) {
100
- out = {
85
+ return {
101
86
type : 'Polygon' ,
102
87
coordinates : coords
103
88
} ;
104
- }
105
- else {
89
+ } else {
106
90
var _coords = new Array ( coords . length ) ;
107
91
108
92
for ( var i = 0 ; i < coords . length ; i ++ ) {
109
93
_coords [ i ] = [ coords [ i ] ] ;
110
94
}
111
95
112
- out = {
96
+ return {
113
97
type : 'MultiPolygon' ,
114
98
coordinates : _coords
115
99
} ;
116
100
}
117
-
118
- if ( trace ) out . trace = trace ;
119
-
120
- return out ;
121
101
} ;
122
102
123
103
/**
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments