latitude-longitude

Converting Longitude & Latitude to X Y on a map with Calibration points

我与影子孤独终老i 提交于 2019-11-26 12:11:33
问题 If i have a jpeg map with size sizeX, sizeY and some calibration points on the map (X, Y, Lon, Lat) What would be the algorithm for calculating the corresponding XY point in the map with a given Longitude / Latitude pair? 回答1: Here's what worked for me, without so much bs. int x = (int) ((MAP_WIDTH/360.0) * (180 + lon)); int y = (int) ((MAP_HEIGHT/180.0) * (90 - lat)); The lat,lon coordinates were given to me by Android devices. So they should be in the same standard used by all Google Earth

Calculate distance in meters when you know longitude and latitude in java [duplicate]

痞子三分冷 提交于 2019-11-26 12:03:20
Possible Duplicate: Working with latitude/longitude values in Java Duplicate: Working with latitude/longitude values in Java How do I calculate distance between two latitude longitude points? I need to calculate the distance between two points given by two coordinates. The project I am working on is a Java-project, so Java-code will be great, but pseudo-code can also be given, then I can implement it myself :) As you probably know, there are three ways to represent coordinates: Degrees:Minutes:Seconds (49°30'00"N, 123°30'00"W) Degrees:Decimal Minutes (49°30.0', -123°30.0'), (49d30.0m,-123d30.0

What's the best way to store co-ordinates (longitude/latitude, from Google Maps) in SQL Server?

北战南征 提交于 2019-11-26 11:56:27
问题 I\'m designing a table in SQL Server 2008 that will store a list of users and a Google Maps co-ordinate (longitude & latitude). Will I need two fields, or can it be done with 1? What\'s the best (or most common) data-type to use for storing this kind of data? 回答1: Take a look at the new Spatial data-types that were introduced in SQL Server 2008. They are designed for this kind of task and make indexing and querying much easier and more efficient. More information: MS TechNet: SQL Server 2008

Determining UTM zone (to convert) from longitude/latitude

ⅰ亾dé卋堺 提交于 2019-11-26 11:13:48
问题 I\'m writing a program which expects a number of lat/long points, and I convert them internally to UTM in order to do some calculations in metres. The range of the lat/long points themselves is quite small -- about 200m x 200m. They can be relied on almost always to be within a single UTM zone (unless you get unlucky and are across the border of a zone). However, the zone that the lat/longs are in is unrestricted. One day the program might be run for people in Australia (and oh, how many

Retrieve latitude and longitude of a draggable pin via Google Maps API V3

半腔热情 提交于 2019-11-26 10:17:59
问题 I will explain. I managed to have a draggable pin on a map. I want to retrieve the coordinates of this point and put them into two fields: Latitude and Longitude. These coordinates will later be send to a SQL table via PHP. Here is an example of what I intend to do, but instead of several pins, it\'s just one and it\'s draggable. The problem is: I\'m not even able to display the coordinates of the initial point. And of course when the user moves the pin, I want the coordinates to change as

Calculating distance between two points, using latitude longitude?

邮差的信 提交于 2019-11-26 10:15:45
Here's my try, it's just a snippet of my code: final double RADIUS = 6371.01; double temp = Math.cos(Math.toRadians(latA)) * Math.cos(Math.toRadians(latB)) * Math.cos(Math.toRadians((latB) - (latA))) + Math.sin(Math.toRadians(latA)) * Math.sin(Math.toRadians(latB)); return temp * RADIUS * Math.PI / 180; I am using this formulae to get the latitude and longitude: x = Deg + (Min + Sec / 60) / 60) David George The Java code given by Dommer above gives slightly incorrect results but the small errors add up if you are processing say a GPS track. Here is an implementation of the Haversine method in

How to convert an address to a latitude/longitude?

冷暖自知 提交于 2019-11-26 10:07:55
问题 How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can \"rent\" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access. 回答1: Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for. http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html They provide online geocoding (via JavaScript): http://code

Calculating bounding box a certain distance away from a lat/long coordinate in Java

只谈情不闲聊 提交于 2019-11-26 09:19:58
问题 Given a coordinate (lat, long), I am trying to calculate a square bounding box that is a given distance (e.g. 50km) away from the coordinate. So as input I have lat, long and distance and as output I would like two coordinates; one being the south-west (bottom-left) corner and one being the north-east (top-right) corner. I have seen a couple of answers on here that try to address this question in Python, but I am looking for a Java implementation in particular. Just to be clear, I intend on

Converting longitude/latitude to X/Y coordinate

白昼怎懂夜的黑 提交于 2019-11-26 08:47:14
问题 I created a map using Google Maps API that highlights all Minnesota counties. Basically, I created the county polygons using a set of longitudes/latitudes coordinates. Here\'s a screenshot of the generated map:- One of the user requirements is to be able to have a similar map as an image so that they can embed it in their PowerPoint/keynote slides. I couldn\'t find any useful Google Maps API that allows me to save my custom map the way it is (if you know a way, let me know), so I figure I

What datatype to use when storing latitude and longitude data in SQL databases? [duplicate]

家住魔仙堡 提交于 2019-11-26 08:42:59
问题 This question already has answers here : What is the ideal data type to use when storing latitude / longitude in a MySQL database? (21 answers) Closed 4 years ago . When storing latitude or longitude data in an ANSI SQL compliant database, what datatype would be most appropriate? Should float be used, or decimal , or ...? I\'m aware that Oracle, MySql, and SQL Server have added some special datatypes specifically for handling geo data, but I\'m interested in how you would store the