coordinate

iOS定位服务与地图应用开发:高德地图开发

半腔热情 提交于 2020-03-01 14:04:48
由于博客迁移至 www.coderyi.com ,文章请看 http://www.coderyi.com/archives/419 之前工作在一家智能设备的公司,做过一个亲友定位监控系统,类似现在比较流行的360儿童手环。所以这里简单介绍定位与地图。 1 定位服务 iOS设备提供三种不同定位途径,蜂窝式移动电话基站定位;WiFi定位,通过查询一个WiFi路由器的地理位置信息,比较省电;GPS卫星定位,通过3~4颗卫星定位,最为准确,但是耗电量大。iOS系统如果能够接收GPS信息,那么设备优先采用GPS,其次是WiFi,最后是基站,开发人员不能选择哪种定位方式。 定位服务使用CoreLocation框架,主要使用CLLocationMananger、CLLocationManangerDelegate和CLLocation三个类,CLLocationMananger是定位服务管理类,获取设备的位置信息,CLLocationManangerDelegate是代理协议,CLLocation封装了位置信息。 这里要注意,CLLocationManangerDelegate 的locationManager:didUpdateToLocation:fromLocation:方法得到的坐标是火星坐标,这个原因你懂得,所以需要转换成真实的地理坐标。我使用的是一个第三方的CSqlite类

How to get object in WebGL 3d space from a mouse click coordinate

断了今生、忘了曾经 提交于 2020-02-09 01:10:56
问题 I'm building a boardgame in WebGL. The board can be rotated/zoomed. I need a way to translate a click on the canvas element (x,y) into the relevant point in 3D space (x, y, z). The ultimate result is that I want to know the (x, y, z) coordinate that contains the point that touches the object closest to the user. For instance, the user clicks a piece, and you imagine a ray traveling through 3D space that goes through both the piece and the game board, but I want the (x, y, z) coord of the

How to Fix: Cannot assign value of type 'CLLocationDegrees' (aka 'Double') to type 'Float!' in Swift 3

人走茶凉 提交于 2020-01-24 09:48:26
问题 I get a coordinate from my google map and I want to assign it to a float variable, but it shows this error: Cannot assign value of type 'CLLocationDegrees' (aka 'Double') to type 'Float!' func markerButtonClicked(sender:MapButton) { let coord = self.getCenterCoordinate() let addressObj = Address() addressObj.latitude = coord.latitude addressObj.longitude = coord.longitude } func getCenterCoordinate() -> (CLLocationCoordinate2D) { let location = CGPoint(x:self.mView.bounds.size.width/2,y:self

Faster numpy cartesian to spherical coordinate conversion?

99封情书 提交于 2020-01-09 04:38:08
问题 I have an array of 3 million data points from a 3-axiz accellerometer (XYZ), and I want to add 3 columns to the array containing the equivalent spherical coordinates (r, theta, phi). The following code works, but seems way too slow. How can I do better? import numpy as np import math as m def cart2sph(x,y,z): XsqPlusYsq = x**2 + y**2 r = m.sqrt(XsqPlusYsq + z**2) # r elev = m.atan2(z,m.sqrt(XsqPlusYsq)) # theta az = m.atan2(y,x) # phi return r, elev, az def cart2sphA(pts): return np.array(

Transfer coordinates from one triangle to another triangle

别等时光非礼了梦想. 提交于 2019-12-29 07:08:22
问题 I have two triangles , which can be in any sizes. The problem is that, how I can transfer coordinates from one triangle to another? I know both of triangle position in coordinate system and yes, they both are in one system. Basically, i have point in triangle1 and I need to transfer it in triangle2. Reading some posts, I found out that I could be calculated using affine transformation matrix , but I didn't undestand how to solve this with affine transformation matrix. Thank you for any help.

Calculating midpoint from two coordinates

限于喜欢 提交于 2019-12-25 04:08:43
问题 I was having some problem when trying to find the mid point between two point. Here is the part where I get the shortest distance between two point: double distance = 0; double minDistance = Double.MAX_VALUE; convertedHotSpotGeomList = RetrieveHotSpotAsyncTask.convertedHotSpotGeom; LatLng[] minPoints = new LatLng[2]; for(int i = 0; i < convertedHotSpotGeomList.size(); i++){ LatLng point1 = new LatLng(convertedHotSpotGeomList.get(i).getY(), convertedHotSpotGeomList.get(i).getX()); LatLng

Pyqt get pixel position and value when mouse click on the image

浪尽此生 提交于 2019-12-24 00:46:21
问题 Overwriting mouse event on pixMapItem didn't work for me ; the mouse click event is not detected by the pixMapItem. Here is my code : import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class DrawImage( QMainWindow ): def __init__(self, path): QMainWindow.__init__(self) self.setWindowTitle('Select Window') self.local_image = QImage(path) self.local_grview = QGraphicsView() self.setCentralWidget( self.local_grview ) self.local_scene = QGraphicsScene() self.image_format = self.local

iPhone: mapView.showUserLocation. VS locationUpdate function

↘锁芯ラ 提交于 2019-12-23 05:07:12
问题 I'm developing on an app that is location-based, I have a mapView set to show the user location (mapView.showUserLocation); I also have a locationUpdate function to retrieve lat/long of current position: (void)locationUpdate:(CLLocation *)location{} After I call the function stopUpdatingLocation to stop the update location, the mapview (blue ball) continues to update my location... In other word: is there another locationUpdate function is called automatically from the mapview? 回答1: I think

Calculating distance between two points in 3D

老子叫甜甜 提交于 2019-12-21 16:51:14
问题 My assignment is to create main class in which I initialize the value of any point to be at (0,0,0) and to be able to access and mutate all three values (x,y,z) individually. To do this I have used getters and setters. My next task is to create a method within my main class (which I shall call "distanceTo") that calculates the distance between two points. How do I go about creating the method " distanceTo " that calculates the distance between two points by taking in the x,y,z coordinates ? I

Calculating distance between two points in 3D

此生再无相见时 提交于 2019-12-21 16:50:33
问题 My assignment is to create main class in which I initialize the value of any point to be at (0,0,0) and to be able to access and mutate all three values (x,y,z) individually. To do this I have used getters and setters. My next task is to create a method within my main class (which I shall call "distanceTo") that calculates the distance between two points. How do I go about creating the method " distanceTo " that calculates the distance between two points by taking in the x,y,z coordinates ? I