得到经度和纬度的负值

时间:2018-08-01 06:09:53

标签: android android-location

我想在我的应用程序中获取经度和纬度的值,但是我的问题是Iam获取带有值的负号。虽然值是正确的,但不知道为什么要使用值获取负号。< / p>

java类的代码:

{
"errorMessage": "Error processing GET request '/partition_load' due to 'com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]'.",
"stackTrace": "java.util.concurrent.ExecutionException: com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]\n\tat java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)\n\tat java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)\n\tat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.getAndMaybeReturnProgress(KafkaCruiseControlServlet.java:1347)\n\tat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.getPartitionLoad(KafkaCruiseControlServlet.java:716)\n\tat com.linkedin.kafka.cruisecontrol.servlet.KafkaCruiseControlServlet.doGet(KafkaCruiseControlServlet.java:361)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:564)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)\n\tat org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)\n\tat org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.linkedin.kafka.cruisecontrol.exception.KafkaCruiseControlException: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]\n\tat com.linkedin.kafka.cruisecontrol.KafkaCruiseControl.clusterModel(KafkaCruiseControl.java:352)\n\tat com.linkedin.kafka.cruisecontrol.async.GetClusterModelInRangeRunnable.getResult(GetClusterModelInRangeRunnable.java:36)\n\tat com.linkedin.kafka.cruisecontrol.async.GetClusterModelInRangeRunnable.getResult(GetClusterModelInRangeRunnable.java:15)\n\tat com.linkedin.kafka.cruisecontrol.async.OperationRunnable.run(OperationRunnable.java:45)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\t... 1 more\nCaused by: com.linkedin.cruisecontrol.exception.NotEnoughValidWindowsException: There is no window available in range [1533101050920, 1533102938311]\n\tat com.linkedin.cruisecontrol.monitor.sampling.aggregator.MetricSampleAggregator.aggregate(MetricSampleAggregator.java:197)\n\tat com.linkedin.kafka.cruisecontrol.monitor.sampling.aggregator.KafkaPartitionMetricSampleAggregator.aggregate(KafkaPartitionMetricSampleAggregator.java:150)\n\tat com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor.clusterModel(LoadMonitor.java:423)\n\tat com.linkedin.kafka.cruisecontrol.KafkaCruiseControl.clusterModel(KafkaCruiseControl.java:346)\n\t... 8 more\n",
"version": 1  }

3 个答案:

答案 0 :(得分:1)

  

LatitudeLongitude可以为负值。

您的代码很好

Check any ref

答案 1 :(得分:1)

纬度表示赤道以北和以南。经度表示本初子午线的东西方。

纬度为负表示赤道以南,经度为负表示本初子午线以西。

位置数据通常以纬度和经度对的形式表示,如下所示:

37.427619,-122.166972 [斯坦福大学胡佛塔]

下面的简单框架可以帮助您解码位置对。

+ + : North and East 
+ - : North and West 
- - : South and West 
- + : South and East

请注意,该框架的中心点是几内亚湾本初子午线与赤道相交的0,0。

答案来自Quora。 Quora Link

答案 2 :(得分:0)

LatLong可以为正也可以为负。

示例:
44.389061321549, -114.659369144245是美国爱达荷州的有效LatLong

只需复制您的LatLong,然后将其粘贴到Google Maps的搜索框中,即可获得LatLong的确切位置。