Skip to content

Commit fe3c3d8

Browse files
Merge pull request #145 from urbanopt/feature_location_bug_fix
fix longitude, latitude input when calculating the feature's center(long,lat)
2 parents f56856c + 00dc5de commit fe3c3d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/urbanopt/geojson/feature.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ def find_feature_center(vertices)
272272

273273
x = y = z = 0.0
274274
vertices.each do |station|
275-
latitude = station[0] * Math::PI / 180
276-
longitude = station[1] * Math::PI / 180
275+
latitude = station[1] * Math::PI / 180
276+
longitude = station[0] * Math::PI / 180
277277

278278
x += Math.cos(latitude) * Math.cos(longitude)
279279
y += Math.cos(latitude) * Math.sin(longitude)

0 commit comments

Comments
 (0)