latitude-longitude

Convert lat/long to pixel X&Y co-ordinates

依然范特西╮ 提交于 2019-11-29 15:39:47
问题 This type of question seems to have been asked numerous times but none of the solutions posted get me anywhere near the answer I need. I have this map of Northland, New Zealand and I'd like to map Lat/Long values to x/y (pixel) values on this image (http://i.stack.imgur.com/3ok4O.gif - which is 400px square) Right now I do not know the precise lat/long boundaries of this image, but I do have some example data which should be useful to someone who knows what they are doing. LAT LONG X Y -35

latitude and longitude bounding box for C#?

早过忘川 提交于 2019-11-29 14:48:59
问题 I just want to find a straightforward, C# class that takes in a starting latitude and longitude and a distance and finds the bounding box (max lat, min lat, max lon, min lon). There are other, similar, questions here on SO but none of them really answer this and the ones that do are not in C#. Help. 回答1: Here's what you are asking for. Kudos to Federico A. Ramponi who wrote the original in Python here. public class MapPoint { public double Longitude { get; set; } // In Degrees public double

Convert longitude/latitude to x/y on iPhone

丶灬走出姿态 提交于 2019-11-29 14:41:03
问题 I am showing an image in an UIImageView and i'd like to convert coordinates to x/y values so i can show cities on this image. This is what i tried based on my research: CGFloat height = mapView.frame.size.height; CGFloat width = mapView.frame.size.width; int x = (int) ((width/360.0) * (180 + 8.242493)); // Mainz lon int y = (int) ((height/180.0) * (90 - 49.993615)); // Mainz lat NSLog(@"x: %i y: %i", x, y); PinView *pinView = [[PinView alloc]initPinViewWithPoint:x andY:y]; [self.view

Finding nearest street given a lat-long location

旧巷老猫 提交于 2019-11-29 14:35:35
问题 Is there any such API where given a location (in terms of latlong), I could find whether the given point is on road/street or not. And if possible also gives me nearest street/road to that location. I found API from [Find nearby Streets] -> http://www.geonames.org/maps/us-reverse-geocoder.html#findNearbyStreets , but it just gives solution for US. Help me if u know of any better solution/algorithm. ( I am particularly interested in India.) 回答1: You can use the Google Maps Geocoding API which

Calculate latitude and longitude having meters distance from another latitude/longitude point

陌路散爱 提交于 2019-11-29 14:01:06
问题 I need to calculate latitude and longitude of a given point. I know latitude and longitude of a reference point, and an value indicating meters on x and y axis from the reference point. Starting from this data I have to find latitude and longitude of the point. I searched for similar questions but it looks like most questions are about finding distance between two lat/long points. I need to do the contrary. How can I do? I use Java 回答1: Here is the best starting point for such questions:

Projecting a point onto a path

自古美人都是妖i 提交于 2019-11-29 12:56:41
Suppose I have an ordered array containing points (lat, lon) describing a path, and I also have a point (lat, lon) describing my current location. How can I project the point onto the path (and place the point in the appropriate place in the array)? What I tried is just simply by searching for the nearest two points and assume it's in the middle of them. It's a good guess, but sometimes fails. What would be a good way of doing this? I see it like this: p0,p1 are path line segment endpoints p is your position q' closest point on line in 3D cartessian q is q' corrected by spherical projection So

How to get more accuracy by GPS_PROVIDER

喜你入骨 提交于 2019-11-29 12:44:21
I've a challenges task for getting very high accuracy . So I am using GPS_PROVIDER. But my code is getting incorrect accuracy . some time it shows me 10 to 50 meter from my current location . and some time it shows me 5 to 15 meter distance from my current location . I've tested it two devices as XOLO and Sony. I've completed involved with that problems and not able to fix it. This is my code:- @Override protected void onResume() { super.onResume(); if(mMap!= null) mMaprivate LatLng geo; map.clear(); locationManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE); mFragment

Converting UTM (wsg84) coordinates to Latitude and Longitude

强颜欢笑 提交于 2019-11-29 12:26:01
问题 I've been searching for a while now (here and on google obviously) for a neat way to convert a set of UTM coordinates to Latitude and Longitude. I've got the coordinates and I know in what zone they are, but how do I convert this to Latitude and Longitude? I Was hoping there would be some kind of class that could do at least some of the magic for me, but it doesn't seem so :( Any suggestions on this? I know it can be done, as this converter seems to work just fine Geographic/UTM Coordinate

How can i send latitude longitude of android device every 15minute to php web service

a 夏天 提交于 2019-11-29 08:23:01
I want to send every 15minute updated latitude and longitude of android device to php web service. How can i do this? Use an AlarmManager that starts a service every 15 minutes. The service should include a class that implements a location listener. follow this link - http://ukgupta.blogspot.com/2011_09_01_archive.html class GpsListener implements LocationListener{ public void onLocationChanged(Location location) { // TODO Auto-generated method stub double latitude = location.getLatitude(); double longitude = location.getLongitude(); float speed = location.getSpeed(); ... } public void

How to calculate angle between two Geographical/GPS coordinates?

为君一笑 提交于 2019-11-29 07:05:12
I have two GPS Coordinates e.g. (Lat1, Long1) and (Lat2,Long2) Could anybody please help me find the angle between those two points. Values should be 0-360 degrees. npinti Taken from this previous SO post: float dy = lat2 - lat1; float dx = cosf(M_PI/180*lat1)*(long2 - long1); float angle = atan2f(dy, dx); I suppose you mean the bearing to and not the angle between the locations: If (lat1,long1) is stored in a Location object loc1 and (lat2,long2) is stored in loc2 you get the bearing from loc1 to loc2 like this: float bearing = loc1.bearingTo(loc2); The result is in degrees east of true north