Skip to content

Commit 3b8e7fe

Browse files
Merge pull request #2852 from prozvora/proz/fix-destination-coord
Changed turf-destination and turf-ellipse to pass through elevation value if present
2 parents 326a96a + 3e7c7a8 commit 3b8e7fe

File tree

7 files changed

+322
-2
lines changed

7 files changed

+322
-2
lines changed

packages/turf-destination/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ function destination<P extends GeoJsonProperties = GeoJsonProperties>(
6666
);
6767
const lng = radiansToDegrees(longitude2);
6868
const lat = radiansToDegrees(latitude2);
69-
69+
if (coordinates1[2] !== undefined) {
70+
return point([lng, lat, coordinates1[2]], options.properties);
71+
}
7072
return point([lng, lat], options.properties);
7173
}
7274

packages/turf-destination/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "7.2.0",
44
"description": "turf destination module",
55
"author": "Turf Authors",
6+
"contributors": [
7+
"Pavel Rozvora <@prozvora>"
8+
],
69
"license": "MIT",
710
"bugs": {
811
"url": "https://github.com/Turfjs/turf/issues"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"type": "Feature",
3+
"properties": {
4+
"bearing": 0
5+
},
6+
"geometry": {
7+
"type": "Point",
8+
"coordinates": [-75, 38.10096062273525, 100]
9+
}
10+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"type": "FeatureCollection",
3+
"features": [
4+
{
5+
"type": "Feature",
6+
"properties": {
7+
"bearing": 0
8+
},
9+
"geometry": {
10+
"type": "Point",
11+
"coordinates": [-75, 38.10096062273525, 100]
12+
}
13+
},
14+
{
15+
"type": "Feature",
16+
"properties": {},
17+
"geometry": {
18+
"type": "Point",
19+
"coordinates": [-75, 39.000281, 100]
20+
}
21+
},
22+
{
23+
"type": "Feature",
24+
"properties": {},
25+
"geometry": {
26+
"type": "LineString",
27+
"coordinates": [
28+
[-75, 38.10096062273525, 100],
29+
[-75, 39.000281, 100]
30+
]
31+
}
32+
}
33+
]
34+
}

packages/turf-ellipse/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.",
55
"author": "Turf Authors",
66
"contributors": [
7-
"Moacir P. de Sá Pereira <@muziejus>"
7+
"Moacir P. de Sá Pereira <@muziejus>",
8+
"Pavel Rozvora <@prozvora>"
89
],
910
"license": "MIT",
1011
"bugs": {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "Feature",
3+
"properties": {
4+
"xSemiAxis": 5,
5+
"ySemiAxis": 1
6+
},
7+
"geometry": {
8+
"type": "Point",
9+
"coordinates": [-73.9975, 40.730833, 120]
10+
}
11+
}
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
{
2+
"type": "FeatureCollection",
3+
"features": [
4+
{
5+
"type": "Feature",
6+
"properties": {
7+
"xSemiAxis": 5,
8+
"ySemiAxis": 1
9+
},
10+
"geometry": {
11+
"type": "Point",
12+
"coordinates": [-73.9975, 40.730833, 120]
13+
}
14+
},
15+
{
16+
"type": "Feature",
17+
"properties": {
18+
"stroke-width": 6,
19+
"stroke": "#F00",
20+
"fill": "#F00",
21+
"fill-opacity": 0
22+
},
23+
"geometry": {
24+
"type": "Polygon",
25+
"coordinates": [
26+
[
27+
[-73.9975, 40.775799, 120],
28+
[-74.00332, 40.775582, 120],
29+
[-74.009084, 40.774934, 120],
30+
[-74.014736, 40.773862, 120],
31+
[-74.020222, 40.772374, 120],
32+
[-74.025489, 40.770486, 120],
33+
[-74.030485, 40.768216, 120],
34+
[-74.035164, 40.765586, 120],
35+
[-74.039479, 40.762621, 120],
36+
[-74.043389, 40.75935, 120],
37+
[-74.046857, 40.755804, 120],
38+
[-74.049849, 40.752018, 120],
39+
[-74.052336, 40.748028, 120],
40+
[-74.054295, 40.743872, 120],
41+
[-74.055706, 40.739591, 120],
42+
[-74.056557, 40.735225, 120],
43+
[-74.056839, 40.730818, 120],
44+
[-74.056549, 40.726411, 120],
45+
[-74.055691, 40.722046, 120],
46+
[-74.054273, 40.717766, 120],
47+
[-74.052308, 40.713612, 120],
48+
[-74.049816, 40.709624, 120],
49+
[-74.04682, 40.705841, 120],
50+
[-74.04335, 40.702298, 120],
51+
[-74.039439, 40.69903, 120],
52+
[-74.035125, 40.696068, 120],
53+
[-74.030448, 40.69344, 120],
54+
[-74.025456, 40.691173, 120],
55+
[-74.020194, 40.689288, 120],
56+
[-74.014714, 40.687802, 120],
57+
[-74.009069, 40.68673, 120],
58+
[-74.003312, 40.686083, 120],
59+
[-73.9975, 40.685867, 120],
60+
[-73.991688, 40.686083, 120],
61+
[-73.985931, 40.68673, 120],
62+
[-73.980286, 40.687802, 120],
63+
[-73.974806, 40.689288, 120],
64+
[-73.969544, 40.691173, 120],
65+
[-73.964552, 40.69344, 120],
66+
[-73.959875, 40.696068, 120],
67+
[-73.955561, 40.69903, 120],
68+
[-73.95165, 40.702298, 120],
69+
[-73.94818, 40.705841, 120],
70+
[-73.945184, 40.709624, 120],
71+
[-73.942692, 40.713612, 120],
72+
[-73.940727, 40.717766, 120],
73+
[-73.939309, 40.722046, 120],
74+
[-73.938451, 40.726411, 120],
75+
[-73.938161, 40.730818, 120],
76+
[-73.938443, 40.735225, 120],
77+
[-73.939294, 40.739591, 120],
78+
[-73.940705, 40.743872, 120],
79+
[-73.942664, 40.748028, 120],
80+
[-73.945151, 40.752018, 120],
81+
[-73.948143, 40.755804, 120],
82+
[-73.951611, 40.75935, 120],
83+
[-73.955521, 40.762621, 120],
84+
[-73.959836, 40.765586, 120],
85+
[-73.964515, 40.768216, 120],
86+
[-73.969511, 40.770486, 120],
87+
[-73.974778, 40.772374, 120],
88+
[-73.980264, 40.773862, 120],
89+
[-73.985916, 40.774934, 120],
90+
[-73.99168, 40.775582, 120],
91+
[-73.9975, 40.775799, 120]
92+
]
93+
]
94+
}
95+
},
96+
{
97+
"type": "Feature",
98+
"properties": {
99+
"stroke-width": 6,
100+
"stroke": "#00F",
101+
"fill": "#00F",
102+
"fill-opacity": 0
103+
},
104+
"geometry": {
105+
"type": "Polygon",
106+
"coordinates": [
107+
[
108+
[-74.056839, 40.730818, 120],
109+
[-74.055302, 40.732853, 120],
110+
[-74.052325, 40.734262, 120],
111+
[-74.048754, 40.735355, 120],
112+
[-74.044876, 40.736239, 120],
113+
[-74.040832, 40.73697, 120],
114+
[-74.036706, 40.737578, 120],
115+
[-74.032549, 40.738085, 120],
116+
[-74.028398, 40.738507, 120],
117+
[-74.024279, 40.738856, 120],
118+
[-74.020211, 40.739139, 120],
119+
[-74.016209, 40.739366, 120],
120+
[-74.012284, 40.739542, 120],
121+
[-74.008444, 40.739671, 120],
122+
[-74.004697, 40.73976, 120],
123+
[-74.001048, 40.73981, 120],
124+
[-73.9975, 40.739826, 120],
125+
[-73.993952, 40.73981, 120],
126+
[-73.990303, 40.73976, 120],
127+
[-73.986556, 40.739671, 120],
128+
[-73.982716, 40.739542, 120],
129+
[-73.978791, 40.739366, 120],
130+
[-73.974789, 40.739139, 120],
131+
[-73.970721, 40.738856, 120],
132+
[-73.966602, 40.738507, 120],
133+
[-73.962451, 40.738085, 120],
134+
[-73.958294, 40.737578, 120],
135+
[-73.954168, 40.73697, 120],
136+
[-73.950124, 40.736239, 120],
137+
[-73.946246, 40.735355, 120],
138+
[-73.942675, 40.734262, 120],
139+
[-73.939698, 40.732853, 120],
140+
[-73.938161, 40.730818, 120],
141+
[-73.939701, 40.728784, 120],
142+
[-73.942681, 40.727378, 120],
143+
[-73.946253, 40.726289, 120],
144+
[-73.950132, 40.725407, 120],
145+
[-73.954176, 40.72468, 120],
146+
[-73.958302, 40.724075, 120],
147+
[-73.962459, 40.72357, 120],
148+
[-73.966609, 40.723151, 120],
149+
[-73.970728, 40.722804, 120],
150+
[-73.974795, 40.722522, 120],
151+
[-73.978796, 40.722297, 120],
152+
[-73.98272, 40.722122, 120],
153+
[-73.986559, 40.721994, 120],
154+
[-73.990305, 40.721906, 120],
155+
[-73.993953, 40.721856, 120],
156+
[-73.9975, 40.72184, 120],
157+
[-74.001047, 40.721856, 120],
158+
[-74.004695, 40.721906, 120],
159+
[-74.008441, 40.721994, 120],
160+
[-74.01228, 40.722122, 120],
161+
[-74.016204, 40.722297, 120],
162+
[-74.020205, 40.722522, 120],
163+
[-74.024272, 40.722804, 120],
164+
[-74.028391, 40.723151, 120],
165+
[-74.032541, 40.72357, 120],
166+
[-74.036698, 40.724075, 120],
167+
[-74.040824, 40.72468, 120],
168+
[-74.044868, 40.725407, 120],
169+
[-74.048747, 40.726289, 120],
170+
[-74.052319, 40.727378, 120],
171+
[-74.055299, 40.728784, 120],
172+
[-74.056839, 40.730818, 120]
173+
]
174+
]
175+
}
176+
},
177+
{
178+
"type": "Feature",
179+
"properties": {
180+
"stroke-width": 6,
181+
"stroke": "#0F0",
182+
"fill": "#0F0",
183+
"fill-opacity": 0
184+
},
185+
"geometry": {
186+
"type": "Polygon",
187+
"coordinates": [
188+
[
189+
[-73.9975, 40.775799, 120],
190+
[-73.994813, 40.774633, 120],
191+
[-73.992956, 40.772376, 120],
192+
[-73.991515, 40.769669, 120],
193+
[-73.990349, 40.76673, 120],
194+
[-73.989387, 40.763666, 120],
195+
[-73.988587, 40.760539, 120],
196+
[-73.987919, 40.757389, 120],
197+
[-73.987364, 40.754244, 120],
198+
[-73.986906, 40.751122, 120],
199+
[-73.986533, 40.74804, 120],
200+
[-73.986235, 40.745008, 120],
201+
[-73.986004, 40.742034, 120],
202+
[-73.985834, 40.739125, 120],
203+
[-73.985719, 40.736286, 120],
204+
[-73.985653, 40.73352, 120],
205+
[-73.985632, 40.730832, 120],
206+
[-73.985654, 40.728144, 120],
207+
[-73.985721, 40.725379, 120],
208+
[-73.985837, 40.72254, 120],
209+
[-73.986008, 40.719631, 120],
210+
[-73.98624, 40.716657, 120],
211+
[-73.986538, 40.713625, 120],
212+
[-73.986912, 40.710543, 120],
213+
[-73.987371, 40.707422, 120],
214+
[-73.987927, 40.704276, 120],
215+
[-73.988595, 40.701126, 120],
216+
[-73.989395, 40.697999, 120],
217+
[-73.990357, 40.694935, 120],
218+
[-73.991522, 40.691996, 120],
219+
[-73.992961, 40.68929, 120],
220+
[-73.994817, 40.687033, 120],
221+
[-73.9975, 40.685867, 120],
222+
[-74.000183, 40.687033, 120],
223+
[-74.002039, 40.68929, 120],
224+
[-74.003478, 40.691996, 120],
225+
[-74.004643, 40.694935, 120],
226+
[-74.005605, 40.697999, 120],
227+
[-74.006405, 40.701126, 120],
228+
[-74.007073, 40.704276, 120],
229+
[-74.007629, 40.707422, 120],
230+
[-74.008088, 40.710543, 120],
231+
[-74.008462, 40.713625, 120],
232+
[-74.00876, 40.716657, 120],
233+
[-74.008992, 40.719631, 120],
234+
[-74.009163, 40.72254, 120],
235+
[-74.009279, 40.725379, 120],
236+
[-74.009346, 40.728144, 120],
237+
[-74.009368, 40.730832, 120],
238+
[-74.009347, 40.73352, 120],
239+
[-74.009281, 40.736286, 120],
240+
[-74.009166, 40.739125, 120],
241+
[-74.008996, 40.742034, 120],
242+
[-74.008765, 40.745008, 120],
243+
[-74.008467, 40.74804, 120],
244+
[-74.008094, 40.751122, 120],
245+
[-74.007636, 40.754244, 120],
246+
[-74.007081, 40.757389, 120],
247+
[-74.006413, 40.760539, 120],
248+
[-74.005613, 40.763666, 120],
249+
[-74.004651, 40.76673, 120],
250+
[-74.003485, 40.769669, 120],
251+
[-74.002044, 40.772376, 120],
252+
[-74.000187, 40.774633, 120],
253+
[-73.9975, 40.775799, 120]
254+
]
255+
]
256+
}
257+
}
258+
]
259+
}

0 commit comments

Comments
 (0)