latitude-longitude

how to get lat long from google map when our own geojson layer is there?

狂风中的少年 提交于 2019-12-04 07:25:59
问题 google.maps.event.addListener(map, 'click', function( event ){ alert( "Latitude: "+event.latLng.lat()+" "+", longitude:"+event.latLng.lng() ); }); this code gives us lat long when we click on google map. but it does not work when there is our own geojson layer that is if we have our own geojson layer of polygon over google map then clicking inside that polygon the above code would not work 回答1: Either add your click event listener to the Data layer or set the Data layer to not accept mouse

Python code to calculate angle between three points (lat long coordinates)

只谈情不闲聊 提交于 2019-12-04 06:49:15
Can anybody suggest how to calculate angle between three points (lat long coordinates) A : (12.92473, 77.6183) B : (12.92512, 77.61923) C : (12.92541, 77.61985) I see two main ways to solve your problem, assuming you want angle ABC (B is the vertex of the angle). Since your three points are close to each other (less than 0.0007° latitude and 0.002° longitude apart), we can approximate the earth as a plane and use two-dimensional vector calculations. A degree of longitude and of latitude are not the same distance when we are away from the equator, but we can adjust for that. Another solution is

SQL Server: Error converting data type varchar to float

半腔热情 提交于 2019-12-04 06:43:44
问题 I have the following SELECT statement to calculate RADIANS and COS . SELECT COS(RADIANS(latitude)) as Lat FROM tbl_geometry; But I'm getting an error: Error converting data type varchar to float. My attempts: Attempt #1 : select Cos(convert(float, (Radians(convert(float, latitude))))) as Lat from tbl_geometry; Attempt #2 . select Cos(Radians(convert(float, latitude))) as Lat from tbl_geometry; Both attempts result in the same error. Note : column Latitude is of type varchar . 回答1: Use try

How to use GeometricShapeFactory in geoTools to create a Circle on map

不羁的心 提交于 2019-12-04 05:30:58
问题 I am currently using the below code to create a GeoJson Polygon. this gives me a bad circle which is not valid... in this case RADIUS = 1609.34 , which is 1 mile in meters. public GeoJsonPolygon createRadiusPolygon( Point point,double RADIUS) { GeometricShapeFactory shapeFactory = new GeometricShapeFactory(); shapeFactory.setNumPoints(32); shapeFactory.setCentre(new com.vividsolutions.jts.geom.Coordinate(point.getX(), point.getY())); shapeFactory.setSize(RADIUS * 2); com.vividsolutions.jts

Latitude / Longitude and meters

大憨熊 提交于 2019-12-04 03:49:49
I have a small algorithmic problem. I am developing an Android application. I get GPS coordinates. For example: latitude: 23.23907 , longitude: 50.45786 . So I get a point. I want to compute bounds details on this point plus or minus 5 meters. I.e.: [23.23907 - 5 meters ; 23.23907 + 5 meters] [50.45786 - 5 meters ; 50.45786 + 5 meters] How to make this calculation? Thank you very much! The haversine formula can be simplified a great deal when you work in north-south and east-west directions only. If Earth's circumference is C, the point at d kilometers to south of a given point is 360*d/C

MySQL - Searching negative longitude values with BETWEEN

只谈情不闲聊 提交于 2019-12-04 03:27:59
I have found many similar posts and even tried to find out how to handle negative values within MySQL, but to no avail. I have a site that I'm using Google Maps on and as a performance enhancement I'm limiting the markers that are drawn on the map to those that are within the map boundaries. I would like to develop a query that will work with positive or negative latitude and longitude values. For the database: latitude FLOAT( 10, 6 ) longitude FLOAT( 10, 6 ) The query: SELECT * FROM `table` WHERE `latitude` BETWEEN 47.926930 AND 47.929806 AND `longitude` BETWEEN -97.077303 AND -97.083997 If I

rough estimate of the time offset from GMT from latitude longitude

南笙酒味 提交于 2019-12-04 00:41:46
Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether to display "today" or "tonight" when giving information to various users so it wouldn't need to be too accurate (an hour or two off wouldn't be bad). offset = direction * longitude * 24 / 360 where direction is 1 for east, -1 for west, and longitude is in (-180,180) James D Basing the time zone on the longitude alone is wildly inaccurate outside of

how to get the current location latitude and longitude of android mobile device?

…衆ロ難τιáo~ 提交于 2019-12-03 22:07:04
I have implemented sample application for get the current location latitude longitude.If i lunch my application in emulator and i am sending latitude and longitude from Emulator Controls at eclipse then i am getting current location latitude and longitude which from emulator controls.If i lunch the same application in real device then i am not able to get current location latitude and longitude I have implemented code for get the current location latitude and longitude as follows: LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); LocationListener

How to find a geographic point between two other points

允我心安 提交于 2019-12-03 22:05:55
问题 For my application I have to find the position of a point on Google map knowing only that it's located between 2 other points and the time (in ms) when the coordinates have been caught. In my code, assumed A and B as the points given and X as the point to find, I: calculate distance between A and B basing on time I found out the speed (in micro degrees /ms) to travel from A to B I found the distance from point A and point X (using time and speed) using similar triangle's rule, I calculate

Find nearest places by latitude and longitude

无人久伴 提交于 2019-12-03 21:47:17
I have this website that stores latitude and longitude of some places and I want to display the nearest places (lets say, in a radius of 10km) of a specific place. How do I search on my MySQL table for these places? I answered this kind of question some years ago at Google Answers and again more recently at Uclue . I should note that the preferred technical convention is to represent longitudes in the West as negative values, but this is sometimes not observed. It won't make much difference unless you are calculating across the meridian opposite to the Prime Meridian (where longitude wraps