简体   繁体   English

长时间显示远离预期点

[英]Lat long shows up far away from intended point

I'm trying to use the EPA's TRI database to get all the hazardous-materials factories in a certain area, such as Virginia. 我正在尝试使用EPA的TRI数据库来获取某个地区(例如弗吉尼亚州)的所有危险材料工厂。 However, doing this requires converting the location from degrees-minutes-seconds to decimal latitude/longitude. 但是,这样做需要将位置从度-分-秒转换为十进制纬度/经度。 I used this formula: 我用这个公式:

var long = deg + min/60 + sec/3600

However, when I plot the points on a map, most of them end up clustered near Afghanistan, with two in India and one lonely marker off in Denmark. 但是,当我在地图上绘制点时,大多数点最终聚集在阿富汗附近,其中有两个在印度,一个孤独的人在丹麦。 I only used data from Virginia, and the database is only for the US anyways. 我只使用了弗吉尼亚州的数据,无论如何该数据库仅适用于美国。

Does anyone know why this is happening? 有人知道为什么会这样吗?

I'm using Javascript and Google Maps, and this is the link to the locations API 我正在使用Javascript和Google Maps,这是Locations API的链接

Never mind. 没关系。 Somehow, when I multiply the longitude by -1, it moves it to the right spot... oh well. 不知何故,当我将经度乘以-1时,它会将其移到正确的位置……哦,好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM