latitude-longitude

Open source PHP function for converting UTM coordinates to latitude and longitude?

送分小仙女□ 提交于 2019-11-27 16:34:57
问题 I'm making a PHP application involving Google Maps. Maps only accepts lat&lng pairs, and the data I want to display comes only with UTM style coordinates. Is there an open-source PHP function to convert from one to the other? Something like this would be great: $UTM_ZONE = '32'; $UTMX = '60329834,34'; $UTMY = '67382984,9'; $latlng = convert($UTM_ZONE, $UTMX, $UTMY); // $latlng = now looks like // array('lat' => '59.4472917501', 'lng' => '5.3928572425') 回答1: I've found sort of a dirty class

Get results from mysql based on latitude longitude

非 Y 不嫁゛ 提交于 2019-11-27 16:15:09
问题 I have a mysql Database and 2 tables let's say clients and schools. Now each table has columns latitude and longitude. And I need do make a SELECT for example from second table where schools are in a given radius of one record from first table. Calculations should be made based on latitude and longitude. PS: I am using PHP. 回答1: You can calculate a distance using a Spherical law of cosines: SELECT DEGREES(ACOS(SIN(RADIANS(clients.latitude)) * SIN(RADIANS(schools.latitude)) + COS(RADIANS

MySQL latitude and Longitude table setup

这一生的挚爱 提交于 2019-11-27 14:27:30
I want to store latitude and longitude values of places in a mysql database table. With the future in mind I will want to be able to find these places within a certain radius of a specific location. Having said that, what datatypes should I store the latitude and longitude values in? Please could you provide me with a create table script for columns like so: place_id | lat | long Is there perhaps a column I am missing in the above table that will provide me with additional information that I may not see I need at the current time? Thanks for any help. You should store the points in a singe

Finding a set of coordinates within a certain range from latitude and longitide

不想你离开。 提交于 2019-11-27 14:15:28
问题 I am working on a project in javascript involving google maps. The goal is to figure out 16-20 coordinate points within n kilometers from a set of latitude longitude coordinates such that the 16 points if connected will form a circle around the original coordinates. The end goal is to make it so I can figure out coordinates to plot and connect on google maps to make a circle around a given set of coordinates. The code would go something like: var coordinates = Array(); function

How do you click on a map and have latitude and longitude fields in a form populated?

☆樱花仙子☆ 提交于 2019-11-27 14:08:21
I have a form that a user needs to fill out where the location needs to be identified. I have latitude and longitude input fields on the form. I am also looking for the decimal lat and long. What I would like seems really simple. I just want to have a link that the user can click on that would popup a map (google or yahoo) and he could use the map to find the location and just click on it and that would automatically populate the two input fields for lat and long from the map. Has anyone done this before? Using the Google Maps API, you can do this pretty easily. Just add a click event handler

Getting GPS data from an image's EXIF in C#

ⅰ亾dé卋堺 提交于 2019-11-27 11:29:15
I am developing a system that allows for an image to be uploaded to a server using ASP.NET C#. I am processing the image and all is working great. I have managed to find a method that reads the Date Created EXIF data and am parsing it as a DateTime. That works great too. I am now trying to read GPS data from the EXIF. I am wanting to capture the Latitude and Longitude figures. I am using this list as a reference to the EXIF data (using the numbers for the property items) http://www.exiv2.org/tags.html Here is the method to capture the date created (which works). public DateTime GetDateTaken

Maximum Lat and Long bounds for the world - Google Maps API LatLngBounds()

混江龙づ霸主 提交于 2019-11-27 11:02:07
The Google Maps terrain view by default has unlimited panning of the map tile. You can use LatLngBounds() to limit this, but what are the maximum and minimum coordinates I should use to set the viewport as just the earth and not outside the map region? Coordinates for North America: var strictBounds = new google.maps.LatLngBounds( new google.maps.LatLng(28.70, -127.50), new google.maps.LatLng(48.85, -55.90) ); I've tried (+90, -180)(-90,180) to no luck. The links provided by @Marcelo & @Doc are good for understanding the derivation of the Lat Lng: http://www.cienciaviva.pt/latlong/anterior/gps

Determine if one coordinate is in radius of another

让人想犯罪 __ 提交于 2019-11-27 10:49:10
Let's say I have a Table of rows that contain coordinates. What would be the best way to pull only the rows of coordinates which are in the radius of another coordinate? To simplify my question, I'm giving the following example: Table like: Columns: Latitude, Longitude. Row1: 23.44444 24.55555 Row2: 32.44444 28.22222 Row3: 35.11111 32.12345 In an SQL statement, how do I get the rows of coordinates that are in the radius of Row3 for example? jbochi This post shows how to do this in SQL Server. And here is how to do it in MySQL: SELECT ((ACOS(SIN($lat * PI() / 180) * SIN(lat * PI() / 180) + COS(

Longitude and latitude value from IP address

℡╲_俬逩灬. 提交于 2019-11-27 10:41:27
Is it possible to get the longitude and latitude value from IP address in asp.net? If it is possible, please let me know how can I get this. MaxMind Geolite city is free . If it is not good enough, you can apparently upgrade to a more accurate paid-version. I can't speak for the quality of the paid version, as I have never used it. If you like your SQL, download the CSV version . Load it into your database of choice, and query away. The faster and space-efficient option is to download the file binary blob version of the same database, and then use the C# class to query it. Alternatively, I

Find closest longitude and latitude in array?

本小妞迷上赌 提交于 2019-11-27 10:11:00
问题 I have a longitude and latitude as a string in PHP like below 49.648881 -103.575312 And I want to take that and look in an array of values to find the closest one. The array looks like array( '0'=>array('item1','otheritem1details....','55.645645','-42.5323'), '1'=>array('item1','otheritem1details....','100.645645','-402.5323') ); I want to return the array that has the closest long and lad. In this case it would be the first one (and yes I know -400 is not a a possible value). Is there any