coordinates

Get the center coordinates of phone screen

别等时光非礼了梦想. 提交于 2019-12-05 03:08:43
Can someone give me an example of how to get the center coordinates of the current displayed screen? I would like my objects to always be relative to the center coordinates of the active view. Devrath You can try with DisplayMetrics to achieve your solution int mWidth= this.getResources().getDisplayMetrics().widthPixels; int mHeight= this.getResources().getDisplayMetrics().heightPixels; Here is how I resolved the issue. As a background, I have a button that once the user moves the map to the desired location (cross hairs showing the centre of map) they can tap the button and a marker appears

How Can I Use (Ruby) RGeo to Transform (Unproject) Coordinates

假如想象 提交于 2019-12-05 02:24:37
问题 I started with How can I transform the coordinates of a Shapefile? . The response there started me on [what I think is] the right track, but I still haven't been able to solve my problem. One issue is that I haven't found the correct projection yet: https://gis.stackexchange.com/questions/13330/how-can-i-correctly-transform-unproject-from-lcc EDIT: That question on the gis site has been answered, and I was able to reproduce a correct transformation using the PROJ command line tool cs2cs. It

Extract coordinates from KML file in Java

Deadly 提交于 2019-12-05 01:29:45
问题 I'm trying to parse a Kml file in Java. Cause I need to take the coordinates of a Placemark, to generate a poligon in java, and use it. But my problem , is that i'm using JAK this library to parse it, and i'm not able to extract the information that i want.(I read the "help" in the official page, but I didn't found any help abut my problem) I'm trying to do something like that: final Kml kml = Kml.unmarshal(new File("C:/Users/A556520/Documents/Proyectos/GeoFencing/res/labasa.kml")); final

Detect if a co-ordinate falls within a longitude and latitude boundary box

ぃ、小莉子 提交于 2019-12-04 22:45:17
Maths has never been my strong point and I'm struggling with a task. I need to determine if a set of longitude and latitude co-ordinates fall inside a box, where the max/min longitude and max/min latitude have been given. Any help would be appreciated. ** EDITED ** I'm using GPS co-ordinates, so the minimum longitude could be larger than the maximum longitude. i.e if the box is over date line. Given minlat , maxlat , minlong and maxlong (ie the 4 corners of your box) then it's a simple matter of determining whether your lat lies between minlat and maxlat and your long between minlong and

Determining location of tray icon

[亡魂溺海] 提交于 2019-12-04 22:28:17
问题 My application is designed to sit in the system tray and behave similarly to the Network/Volume/Power/Action Centre tray items in Windows 7 (and the equivalent items in Windows Vista). That is, it becomes visible when the tray icon is clicked, and becomes hidden when focus is lost. The application is written in WPF, but I am currently using NotifyIcon from WinForms for the tray icon. I would like to know if anyone has any suggestions as to how I might determine the position (i.e. screen

Show current location of user on an offline static image (jpeg) - Android

南笙酒味 提交于 2019-12-04 21:51:48
Background / Concept: I want to create an application that can help user searching for specific things. Let say nearby restaurants. Here I want to include an offline map covering 1 km area around that restaurant, (its easy i can take snap of google map). Problem: is it possible to indicate current user position on that static image file? I have some idea that I note the Lat / Long of all four corners of that image, take user current position, do some calculation and show the current spot.. But I m not sure where to start and if there is already a good optimized solution. If I can show current

UIView touch location coordinates

纵饮孤独 提交于 2019-12-04 20:40:23
What are the coordinates used in UIViews and their corresponding superviews? I have this code which i would like to detect a 'corridor' where the user can touch... similar to this image: alt text http://img17.imageshack.us/img17/4416/bildschirmfoto20100721u.png This is the code i have: CGPoint touch = [recognizer locationInView:[shuttle superview]]; CGPoint centre = shuttle.center; int outerRadius = shuttle.bounds.size.width/2; int innerRadius = (shuttle.bounds.size.width/2) - 30; if ((touch.x < outerRadius && touch.y <outerRadius)){ NSLog(@"in outer"); if(touch.x > innerRadius && touch.y >

How to get pixel coordinates of a pixel inside an html5 canvas

岁酱吖の 提交于 2019-12-04 19:38:51
I know that you can get the value of each pixel inside the html5 Canvas using getImageData() and .data() but is there a way to get their coordinates and not just their values? var w = ctx.canvas.width, h = ctx.canvas.height; var id = ctx.getImageData(0,0,w,h); var d = id.data; for (var y=0;y<h;++y){ for (var x=0;x<w;++x){ var i=(y*w+x)*4; var r=d[i],g=d[i+1],b=d[i+2],a=d[i+3]; } } It's just as easy to derive the x/y from the index while looping through the image data array, or to add in offsets if you have fetched only part of the canvas pixels. for (var i=0,len=d.length;i<len;i+=4){ var x=i/4

ARKit - Update only the world coordinates origin

守給你的承諾、 提交于 2019-12-04 18:34:42
Once the user has scanned the environment and that I detected a plane, I would like the world origin anchor, which is the device position when the app opens (which is the origin of the 3D world), to be reset to where my device is right now so that the user can see my AR objects in front of him. (my objects are floating and not related to the floor but detecting a plane makes the objects more stable) I didn't find a way to do that. It's linked to ARConfiguration but it doesn't seem like we can update the coordinate system without resetting all the tracking. Do you have any idea? According to

How do I increase or decrease the size of a button in Swift?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 18:13:19
I have a UIButton in my app that I call "buttonPlay". I am using AutoLayout but the button doesn't have any NSLayoutConstraints attached to it. I would like to code an animation to increase and the decrease the height and the width of the button. Here's how the animation code looks like: // "Repeat" because the animation must repeat itself UIView.animateWithDuration(1.0, delay: 0.6, options: UIViewAnimationOptions.Repeat, animations: { // Animation code goes here // nil: the animation is not supposed to end }, completion: nil) } To get the original values of the x position, y position, width