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) {
5454 *
5555 * @param {array } coords
5656 * results form calcTraceToLineCoords
57- * @param {object } trace
58- * (optional) full trace object to be added on to output
59- *
6057 * @return {object } out
6158 * GeoJSON object
6259 *
6360 */
64- exports . makeLine = function ( coords , trace ) {
65- var out = { } ;
66-
61+ exports . makeLine = function ( coords ) {
6762 if ( coords . length === 1 ) {
68- out = {
63+ return {
6964 type : 'LineString' ,
7065 coordinates : coords [ 0 ]
7166 } ;
72- }
73- else {
74- out = {
67+ } else {
68+ return {
7569 type : 'MultiLineString' ,
7670 coordinates : coords
7771 } ;
7872 }
79-
80- if ( trace ) out . trace = trace ;
81-
82- return out ;
8373} ;
8474
8575/**
8676 * Make polygon ('Polygon' or 'MultiPolygon') GeoJSON
8777 *
8878 * @param {array } coords
8979 * results form calcTraceToLineCoords
90- * @param {object } trace
91- * (optional) full trace object to be added on to output
92- *
9380 * @return {object } out
9481 * GeoJSON object
9582 */
96- exports . makePolygon = function ( coords , trace ) {
97- var out = { } ;
98-
83+ exports . makePolygon = function ( coords ) {
9984 if ( coords . length === 1 ) {
100- out = {
85+ return {
10186 type : 'Polygon' ,
10287 coordinates : coords
10388 } ;
104- }
105- else {
89+ } else {
10690 var _coords = new Array ( coords . length ) ;
10791
10892 for ( var i = 0 ; i < coords . length ; i ++ ) {
10993 _coords [ i ] = [ coords [ i ] ] ;
11094 }
11195
112- out = {
96+ return {
11397 type : 'MultiPolygon' ,
11498 coordinates : _coords
11599 } ;
116100 }
117-
118- if ( trace ) out . trace = trace ;
119-
120- return out ;
121101} ;
122102
123103/**
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