FAQ Database Discussion Community


How to get geolocation and return value in html form

javascript,html,forms,geolocation
How do I get Geolocation and return it into a form when I click on a button. So when click the Geolocation get my location and then return the output in the from so I can use it later on. http://jsfiddle.net/Mikki10/as3mg177/1/ Geolocation <html> <body> <p>Click the button to get your...

HTML5 geolocation is not accurate

html5,google-maps,geolocation
I was using the following code to get my current location. But the longitude and latitude generated was not at all accurate. It was showing a location about 700 Kms away from my location. How can I make it accurate? <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation)...

Representing and comparing geographic locations in Java

java,android,geolocation
I'm trying to figure out how to represent geographic locations, and I can't seem to find any relevant classes in the SE documentation. I would like to do something like this: Location locA = new Location(aa.aaaaaaa, bb.bbbbbbb); //lat/long coordinates Location locB = ..... int meters = locA.distanceTo(locB); Ideally I would...

How to get current country location and possibly the CountryCode from a Windows Phone 8.1

c#,.net,geolocation,windows-phone-8.1,windows-8.1
How to get current country location and possibly the CountryCode from a Windows Phone 8.1? I did this, but FindLocationsAsync throws me an exception "Value does not fall within the expected range" private async void LocateMe() { Geolocator GeoLoc = new Geolocator(); GeoLoc.DesiredAccuracyInMeters = 50; try { Geoposition GeoPosition =...

jQuery AJAX Geolocation Not Working

jquery,ajax,geolocation
I am using freegeoip's API to get the location of the visitor. I have tried putting the code in $(document).ready (without click event) and also in click event but in both cases, it seems as though the AJAX call doesn't run. I've got the code from Shopify's webpage but since...

Matlabs ellipse hours calc

matlab,geolocation,geocoding,ellipse,hour
I make sundial simulator and i draw ellipse and then i have to draw hours on this ellipse. Every our is specified by: x = a * sin(t); y = b * cos(t); where: a- length of longer semi-axis b- length of smaller semi-axis t- hour in degrees ( 1...

Remove CLBeaconRegion from monitoring depending on current location

ios,geolocation,cllocationmanager,ibeacon,clbeaconregion
So I was looking for a way to remove a BeaconRegion from the monitored regions depending on how far it is from my current location. I though I could use the center property, though I think I'm missing something... Because the latitude/longitude values are like not valid... po [region center]...

How to obtain accurate latitude and longitude of user machine based on IP address

php,curl,geolocation,latitude-longitude
In my PHP based application i would like to capture the location of user machine when user logs in to the webapp based on IP address. I followed this method: $url = "http://freegeoip.net/json/$ip"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $data = curl_exec($ch); curl_close($ch); i...

Tweepy location on Twitter API filter always throws 406 error

python-2.7,twitter,geolocation,tweepy
I'm using the following code (from django management commands) to listen to the Twitter stream - I've used the same code on a seperate command to track keywords successfully - I've branched this out to use location, and (apparently rightly) wanted to test this out without disrupting my existing analysis...

sending variables to php via ajax and jquery

php,jquery,ajax,variables,geolocation
i want to request the users geolocation via html5-geolocation and send it to the next page I've been told that i've to use ajax/jquery, so this is my code: <form action="response.php"> <button onclick="getLocation()">Start</button> <script> function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(success, error); } else { x.innerHTML = "Geolocation is not...

Is there any relationship between the reach estimate in Ads Manager and in the Ads API?

facebook,geolocation,facebook-ads-api
I just noticed that the numbers given by Ads API and the Ads Manager are wildly different. For instance, when searching for the French speakers in the city of Anderlecht, Belgium, the Ads Manager shows 44,000 people and the Ads API gives me the number 12,000. See the screenshot of...

How to construct and store the geopoint

google-app-engine,twitter-bootstrap-3,geolocation,webapp2,geopoints
Am working on GAE with python. How to construct and store the latitude and longitude using GeoPoint? This is my DB class Customer(db.Model): name = db.StringProperty() address= db.PostalAddressProperty() geopoint= db.GeoPtProperty() My code class AddCustomerHandler(BaseHandler): input_fullname=self.request.get('fullname') input_cusaddress=self.request.get('cusaddress') input_latitude=self.request.get('latitude') input_longitude=self.request.get('longitude') input_geopoint= GeoPoint(input_latitude, input_longitude)...

Android Google Map how to check if the gps location is inside the circle

android,google-maps,gps,geolocation,android-maps-v2
I'm trying to detect if a user is in the radius of a Marker , using the users gps location. I have the marker's coordinates, but do not know how to calculate whether the user is in the area. I've tried to use the following, but even when the current...

Country/region codes (iso-3166-1/iso-3166-2) to longitude and latitude

java,geolocation,geocoding
I need to convert from iso-3166-1/iso-3166-2 codes to longitude/latitude Examples: Input: "US", Output: (37.09024, -95.71289100000001). Input "VE-O", Output: (10.9970723, -63.91132959999999). I have been searching around but failed to find a complete listing or, ideally, a Java library doing it. This Github project is promising but is missing a lot of...

How to detect that you are in the building using some Google /Location API on Android

android,geolocation,google-places-api,android-wifi,android-location
I need to detect when I enter into building from the street. Now I use the next: if your device are connected to the wifi - you are into the building. I use WifiManager.NETWORK_STATE_CHANGED_ACTION for that. But this is not entirely accurate, because there are many free zone wi-fi, in...

Geolocation returned location incorrect by 3 km

geolocation
I was wondering when I used the javascript geolocation it didn't pin point into my exact location.. this is thec ode I used that I got in w3schools..(http://www.w3schools.com/html/html5_geolocation.asp) <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by...

Retrive geolocation in real time (HTML5)

javascript,html5,google-maps,gps,geolocation
I have this code: var map; var geocoder; function initialize() { var mapOptions = { zoom: 18 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var marker = new google.maps.Marker({ position: pos, map: map, title: 'Posizione Attuale' });...

Why does DeviceAccessInformation.CreateFromDeviceClass throw a FileNotFound Exception

geolocation,windows-phone-8.1,win-universal-app
I have the following snippet of code that is intended to check if I can access Location Services. It builds ok but on the device and emulator I get a FileNotFound Exception on the switch (accessInfo.CurrentStatus) line (there is nothing on Google about this) var accessInfo = DeviceAccessInformation.CreateFromDeviceClass(DeviceClass.Location); accessInfo.AccessChanged +=...

Mongodb Query for finding distance between latitude and longitude points

mongodb,mongoose,geolocation,geocoding,mongodb-query
I have a user's collection with Latitude and longitude points for each user. I want to calculate distance between given Lat, long values and user's location. In MYSQL there is a query for it SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) *...

Can't get the current location with google-maps api on a website

javascript,html5,google-maps,geolocation,google-maps-api-2
i'm a bit new to google maps api, what i want to achieve is to integrate a map to my website and to get my current position. I followed some tutorials and i saw to demos, everything was fine and it's working and i get my current localisation. http://www.html5-css3.fr/demo/exemple-geolocalisation-html5-api-google-maps http://www.astuces-webmaster.ch/page/geoloc-html5-google-maps...

retrieving latitude and longitude from database(db2) and show in map in IBM worklight

google-maps,geolocation,worklight
I have saved latitude and longitude in database(db2).I want to use them to show their location in map.I am working with IBM Worklight and as database I am using DB2. My problem is I can retrieve value from database,store it in a variable but could not be able to pass...

Getting Repeated Current Location inside a Service in android?

android,service,geolocation
I am calling a service were i will get current location at some interval and match the location with a location passed to the service.and if it is in a close range it will buzz the phone.Now i tried to get the current location by FusedLocationApi.But i got error when...

how capturing geolocation with device offline - cordova

javascript,android,cordova,geolocation
I am developing an application using the cordova and found a need to take the data of latitude and longitude of the User, but my application will be used offline (without internet access). I'm with two questions: 1 - How to check if the unit is active GPS or not?...

Mongodb: Query with a field value, but also another unknown unique field

database,mongodb,geolocation,nosql
Lets say my documents are this format(random data): {"_id" : 30, "lat": 36.1212111, "lon" : 120.2312112 "uuid" : 123123123} {"_id" : 31, "lat": 36.1212111, "lon" : 120.2345112 "uuid" : 123123123} {"_id" : 32, "lat": 36.1212111, "lon" : 120.2378112 "uuid" : 123123123} {"_id" : 33, "lat": 36.1212111, "lon" : 120.2378112 "uuid"...

Sorting users by distance in mysql using st_distance

php,mysql,geolocation,geospatial
I've done a bit of reading on this but there's hardly any information on doing it using points and the st_distance function in mysql. I suppose this makes sense since according to http://bugs.mysql.com/bug.php?id=70494 it wasn't even documented until halfway through last year. Almost every solution I've seen instead uses separate...

JQuery and geolocation not sending any data

php,jquery,geolocation
Good day, I am trying to create a script that loads my Browser Geolocation and following sends it to a file that saves it. The problem is. The data does not get send. And an even bigger problem is that I have tried many things but I am quite clueless....

how can edit/remove markers from google map in html [closed]

google-maps,geolocation
i have a html page that displays address points into google map. my geo points will refresh each 20 seconds and i want to remove old locations and mark new geo locations : my html and java script code is : <script src="http://maps.google.com/maps/api/js?sensor=false"></script> <script> var markers = []; var locations...

GeoGoogle - Google Geocoder Java API

java,google-maps,geolocation,geocoding
Is still valid this project or it is deprecated ? I got a 404 Error checking the examples http://code.google.com/apis/maps/documentation/index.html#Geocoding_Examples

Use of Planet.osm with osmDroid for offline maps

android,geolocation,geospatial,openstreetmap,osmdroid
does anyone know if it is possible to build an Android application using osmDroid that makes use of Planet.osm stored on an SD card? for example, you would store Planet.osm on a large SD card that has been put in a phone. The application loaded on the phone would then...

Fusion Table with App Inventor: displaying map with location column

dictionary,geolocation,google-fusion-tables,app-inventor
I am using App Inventor 2 from MIT. I have a fusion table with location column of type location. Using the FusiontableControls component I am able to write into the table and view the table using the WebViewer component, I am able to view the URL of the Table and...

Can't extract geo keys (nodejs and mongo)

database,node.js,mongodb,data,geolocation
So i am working with nodejs (expres framwork) and mongodb with mongoose. And i am trying to save the geolocation coordinates to my db. This is how my schema looks like: //defining a schema var TopicSchema = mongoose.Schema({ topicTitle: String, topicDescription: String, topicDateCreated: { type: Date, default: Date.now }, fbId:...

Convert zip/postcode to latitude and longitude with mapbox API

javascript,geolocation,mapbox
I'm using Mapbox in a web app. I have functionality where a user inputs a zipcode and it should display on the map then do some other stuff with the data. All I'm trying to do right now is convert the zipcode to latitude and longitude to display the marker...

guide/information on building an offline mapping Android application using nutiteq

android,dictionary,geolocation,geospatial,nutiteq
Does anyone have or know of any guides/tutorials/information on how to build an offline mapping Android application using nutiteq?

xamarin forms permission to use location iOS

ios,xamarin,geolocation,cllocationmanager,xamarin.forms
I'm using Xamarin.Forms and creating an iOS App who has a background service to get a location each 10 minutes. The code is working, my problem is when I access the App configuration on an IPad. It shows the permission for accesss the camera but not to access the current...

Location Menager - Location Updates

java,android,parse.com,geolocation,location
So I'm trying to update the current location of a user every 5 seconds using a locationMenager, but it's not working. Here the code: GPSTracker.java public class GPSTracker extends Service implements LocationListener { private final Context context; boolean isGPSEnabled = false; boolean isNetworkEnabled = false; boolean canGetLocation = false; Location...

HTML5 Geolocation - Replace/Add Data to Ajax URL string

jquery,html,ajax,json,geolocation
So I'm trying to get the users location and then replace the position coords into the json URL request for latitude and longitude using jQuery and then outputing it to an ElementByID on the page. Below is what I've come up with, but it doesn't seem to be working. Instead...

How does ReadRemoteRssi() works

android,geolocation,bluetooth-lowenergy
I am using BLE beacons for indoor geolocalization puropses. As we all know, RSSI values are never accurate, but still I am trying to enhance my application. So, what i would like to know is how does Android calculate the RSSI? and how often? I found this article but im...

Get Current Location If Checkbox Checked

javascript,jquery,geolocation
Hey everyone I have a geolocation script to get a visitors city and state. I am trying to run this script if the user selects to use this automatic feature. If the script is set to document ready then it works, but everytime I add a click feature it doesn't...

Library or API for inferring country/location based on submitted string?

python,django-models,geolocation,input-sanitization
I'm retroactively sanitizing a bunch of data for the Offer Drive product (http://offerletter.io/drive.html). I'm trying to normalize a freeform "location" field to determine if submitted locations fall in the United States (or not). Values may vary in granularity, but all are "real", e.g. San Francisco, CA Milwaukee Bangalore My question...

Geolocation to find nearest place [on hold]

php,html,mysql,geolocation
I have a database of national park names (Alcatraz Island, Death Valley, Biscayne, etc.) which all have coordinates. What's the simplest way for me to match the closest park in my database to their current location whether on a mobile device or on a desktop?...

GeoLocation using PHP

php,jquery,geolocation
I copied paste following code and I am a noob at this. So can you point out error please? I am sorry for asking such a stupid question. <HTML> <HEAD> </HEAD> <BODY> <h3>Client side IP geolocation using <a href="http://ipinfo.io">ipinfo.io</a></h3> <hr/> <div id="ip"></div> <div id="address"></div> <hr/>Full response: <pre id="details"></pre> </BODY> </HTML>...

HTML5 Geolocation shows wrong speed

html5,gps,geolocation
I'm using HTML5 Geolocation to show information about visitors GPS information. When I tested the function yesterday while I sat in a bus, the speed showed under 25 km/h when the bus went over 70 km/h. Why?

get current location with runOnUiThread

java,android,geolocation,google-play-services
I am a learner in android. I am trying to get weather on current location. There is a "Refresh" button in my app to update the UI with latest weather details. When the app loads, it shows weather of 0.0, 0.0 latitude and longitude. When I click on "Refresh" button,...

Putting geolocation coordinates into array

javascript,html,arrays,geolocation,coordinates
I'm trying to put my geolocation coordinates gathered during watchPosition() into an array, so that I can work out total distance later. I have create a new array var mapArray; mapArray = new Array(); then where I assigning my latitude and longitude im putting the values to the array document.getElementById("currentLat").innerHTML...

Polygon insertion issue (due to SRID) on Postgres

postgresql,geolocation,geospatial,postgis,sequelize.js
I'm having trouble inserting a polygon into my table structure. I'm relatively new to PostGIS, so I may be making a pretty amateur mistake on this. My table is setup as "Regions" and I'm adding a column for my geometry: "SELECT AddGeometryColumn(" + "'public', 'Regions', 'geom', 4326, 'POLYGON', 2" +...

Cordova geolocation watchPosition sensitivity

cordova,geolocation,phonegap-plugins,ionic,cordova-plugins
How often would watchPosition be called if the position is constantly updated? Is this something that can be configured? The docs just say "When the device retrieves a new location, the geolocationSuccess callback executes".

NFC read tag to launch Google Maps with coordinates

android,google-maps,geolocation,nfc,ndef
I am trying to write an NFC tag with coordinates (latitude and longitude), in the following manner: This is inside onCreate(): btnWriteMap.setOnClickListener(new OnClickListener() { public void onClick(View v) { String latitude = lat.getText().toString(); String longitude = lon.getText().toString(); urlAddress = "geo:"+latitude+","+longitude; TextView messageText = (TextView)findViewById(R.id.txtMessage); messageText.setText("Touch NFC Tag to share GEO...

How to search documents with MongoDB geospatial queries within nearest cities in country?

mongodb,geolocation,geospatial
Let's say user finds documents with in Wellington New Zealand and provide coordinates of Wellington city: lat: -41.2864603, lng: 174.77623600000004. But if there are no documents within this city I need to search documents within nearest cities within New Zealand country. How could I find documents within country?...

C++ Get country code

c++,visual-studio,geolocation,country
I'm trying to get the country code (example: "UK" or "SI" or "GER") via GetGeoInfo(). GEOID GetUserGeoID(GEOCLASS_NATION); Currently getting the value 16 from the above function ^ but looking in the table there's no number 16. https://msdn.microsoft.com/en-us/library/windows/desktop/dd374073(v=vs.85).aspx I know it's only 3-4 lines of code but I can't seem to...

Get location on Android

android,geolocation
I am running this piece of code, but cannot see anything significant on logcat. What I am missing? Here is the my activity class: public class MainActivity extends Activity implements LocationListener, ConnectionCallbacks, OnConnectionFailedListener, com.google.android.gms.location.LocationListener { GoogleApiClient mGoogleApiClient; LocationRequest mLocationRequest; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnStart =...

MaxMind Get Lat/Lng from IP address, InvalidDatabaseException Error

java,geolocation,maxmind
My end goal is to obtain the latitude, longitude and country associated with a provided ip address. I am using java and the MaxMind GeoIP2 Java API. My preference is not to use their webapi as I need quick turn around time. Can anyone tell me why I am getting...

Geolocation - Check if a location belongs to an area

javascript,php,html5,geolocation
having a location coordinate(latitude,longitude), is it possible to check if it belongs to an area that have an array of coordinates (example when you draw a polygon on map that have array of coordinates) ? I am using JS, html5, and php and i would be flexible to solutions from...

Android Google Maps API V2: Exchange location information between 2 users who have same app

android,geolocation
I am currently working on an android application for my class. Our app is to help friends find each other. However for us to do so we need to exchange location data between those 2 users. I want to know if there is a way for android to send/receive location...

Inconsistent administrative_area_level_1 geocode for same city (accented)

google-maps,geolocation,geocoding,google-geocoding-api
My simple app has been working quite well until a client reported a bug as mentioned in the title. Google return sometime accent-removed result : { "long_name" : "Hanoi", "short_name" : "Hanoi", "types" : [ "administrative_area_level_1", "political" ] } And accented one: { "long_name" : "Hà Nội", "short_name" : "Hà...

Geolocation not working in Cordova Android emulator

cordova,visual-studio-2013,geolocation,phonegap-plugins,cordova-plugins
I am using visual studio Cordova tool for creating application. I am uding geolocation of HTML5 for getting user location. When I execute it in ripple naxus-galaxy, it working fine, but when I run it in android emulator, it's not working at all. It shows me GPS system on top...

Geolocation with openlayers limits

geolocation,openlayers
Are there any limitations to the geolocation with openlayers? (number of requests, unreliability etc?) Thank you, Alex...

How can i know which geopoint(lat/lng) belong to which country without reverse geocoding?

ios,google-maps,geolocation,mapkit,reverse-geocoding
I am making a camping app where i would show on map number of checkins/users to user per country initially, then when map is zoomed, it will show checkins per city in a particular country, when zoomed again, it will show sector wise checkins. I wanted to ask is there...

How do I check if a point is behind another point relative to its location and course?

javascript,math,geolocation,geometry,geo
I am working on an app which highly depends on geolocation and calculations based upon it. One of the views is a list view which gives a list of moving POI's behind the users location. +---------------------------+ +------ . ------+ +----- . -----+ +---- . [POI1] ----+ +--- . / ---+...

How to get current currency code of current location in Windows Phone 8.1

c#,.net,geolocation,windows-phone-8.1,windows-8.1
I locate the current location - Country and Country Code, but how to get the currency code of this location in Windows Phone 8.1?

Distance between two gps coodinates - javascript

javascript,gps,geolocation
I am searching to know the concept behind this since last month and till now i got these resources How do I calculate distance between two latitude-longitude points? geolib.js Function to calculate distance between two coordinates shows wrong Calculate distance, bearing and more between Latitude/Longitude points But i still can't...

Is it possible to replace an image in a web page based on the user's geolocation?

javascript,jquery,geolocation
I've been looking hard on Google for some information on this but I haven't come up with anything. Anyhow, what I want to do is change the image source (either for img tag or background-image css property) based on the users location. Looking to leverage of the HTML5 Geolocation feature...

PHP DataStore geo query

php,google-app-engine,geolocation,geo
I'm using the PHP-GDS library to get access to the AppEngine DataStore, however this doesn't seem to support geolocation queries. I'm currently storing the latitude and longitude in separate columns. What's the recommended way in 2015 (there are lots of suggestions from 2010) to query the DataStore with geoqueries? Example...

Geo Location Radius Search Using PHP and MySQL

php,mysql,elasticsearch,geolocation
I am developing a job portal , in where end users will search for jobs according to their location and proximity radius . Currently the REST APIs are powered by SLIM and MySQL . In Jobs table there are latitude and longitude in every row . I have searched for...

Finding the id of the nearest neighbour in SQL

sql-server,geolocation,greatest-n-per-group,nearest-neighbor
I have a table, #geo, with points in geolocation. Id geolocation 9201 0xE6100000010CE33995EB71164CC054791243B87441C0 9202 0xE6100000010C56B77A4E7A1B4CC0D15790662C6E41C0 I calculated the distance to the nearest neighbour for each data point. I have 1000 points for 24 month. Now I replicate my code with the first 19 points in a month create table #Geo...

google Map click marker by external link

jquery,html,google-maps,geolocation,marker
I have google map API with marker. in click marker map zooms and pop up comes. find fiddle demo google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); map.setZoom(9); map.setCenter(marker.getPosition()); } })(marker, i)); But I want to click this markers by external. function triggerClick(i) { google.maps.event.trigger(markers[i],'click'); } <ul...

Javascript Timezone get Location similar to PHP DateTimeZone::getLocation?

javascript,node.js,geolocation,timezone,location
Does anyone know of a library, function or API that functions the same way as the PHP DateTimeZone::getLocation - http://php.net/manual/en/datetimezone.getlocation.php but for Javascript (or NodeJS NPM). Please note not looking for code just to point me in the right direction. Tried looking for something similar could find anything. For example...

Location Manager - requestLocationUpdates crashes

android,multithreading,gps,geolocation
I am trying to fetch current user location - city, using the code below : private String getCurrentLocation() { LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener locListener = new MyLocationListener(); try { gps_enabled = locManager .isProviderEnabled(LocationManager.GPS_PROVIDER); } catch (Exception ex) { } try { network_enabled = locManager .isProviderEnabled(LocationManager.NETWORK_PROVIDER); } catch (Exception...

HTML5 geolocation tracking does not return correct coordinate

javascript,html5,geolocation
I have a small javascript as below <script type="text/javascript"> $(document).ready(function () { var myLat = 0, myLng = 0; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { myLat = position.coords.latitude; myLng = position.coords.longitude;} ); } alert(myLat +';'+myLng); }); </script> I tested and allowed the location tracking on IE11, Opera 29. I enabled...

Get the Latitude and Longitude of a position clicked on a maps forge 0.5.1 MapView

java,android,geolocation,mapsforge
I use the maps forge 0.5.1 libraries (api reference) I have followed all the official instructions but I have the following problem : I have attached an onTouchListener on the (org.mapsforge.map.android.view.MapView)mapView but when I try to call the method mapView.getProjection(), I get the error "Cannot resolve the method getProjection(). Even...

Best library/API to build an Android app making use of offline maps

android,geolocation,maps,google-maps-android-api-2,mapbox
I'm looking for the best library/api solution to use to build an application that uses a mapping system with completely offline map data. I would like to be able to show the user a map that is completely offline, how much storage would be needed for the offline maptiles? could...

Loop structure for adding up coordinates in an array

javascript,arrays,loops,geolocation,coordinates
I have an array with coordinates in and want to add them up to determine a total distance (not just from point A to point B). My array is structured as latitude1, longitude1, latitude2, longitude2 and so on. I have to code to actually work out the distance (shown below),...

Geohash not generated in Elastic search

elasticsearch,geolocation,geospatial,geohashing
I have created an index as follows: POST /cabtrails { "settings" : { "number_of_shards" : 3, "number_of_replicas" : 1 }, "mappings" : { "cabtrail" :{ "properties" : { "location": { "type": "geo_point", "geohash_prefix": true, "geohash_precision": "5m" }, "capture_time": { "type" : "long" }, "client_id": { "type" : "long" } }...

How do I redirect users from a specific country?

javascript,redirect,geolocation
I would like to be able to detect if visitors to a webpage are situated in the USA and if they are I would like to redirect them to a different page. I've been googling for some script that could do this but haven't found anything. Can someone point me...

Geolocation - how to get city from long and lat

javascript,jquery,api,geolocation
I am trying to get the city out of Geolocation API. I have just started some JS and jQuery learning so it might be a basic mistake. $(document).ready(function(){ function displayLocation(latitude,longitude){ var request = new XMLHttpRequest(); var method = 'GET'; var url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' + latitude + ',' + longitude +...

How to check if location available using FusedLocationProviderApi and GoogleClient?

android,geolocation
We can check for location availability using Location manager's isProviderEnabled method. I am trying to use the new api's for location, i.e. fusedLocationProviderApi and trying to check if location can be retrieved. How to check that ?

Using geo-coordinates as vertex coordinates in the igraph r-package

r,geolocation,igraph,network-analysis
In the igraph package for R, I am struggling to plot a social network using latitude/longitude coordinates as the layout of the graph. Imagine this simple example: a network with 4 nodes of which you know the geographical location and the connections: df<-data.frame("from" = c("Bob", "Klaus", "Edith", "Liu"), "to"= c("Edith",...

Stop location updates by using the last google play services api location

android,geolocation,listener,google-play-services
I'm building a simple weather application and I'm using the last google play services API to get the location. By calling the following: LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); we are able to get the location updates and thanks to the listener: @Override public void onLocationChanged(Location location) { // update the location }...

Creating a button that shows my current location using geolocation

javascript,api,google-maps-api-3,geolocation
I want to create a button which shows my current location using geolocation. Here is my code which I took from the developers page. <!DOCTYPE html> <html> <head> <title>Geolocation</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>...

How to determine an Android device's current country location regardless of user location settings?

android,geolocation,w3c-geolocation
I need to determine the country (iso3) the device is in even if the user's device has GPS turned off and does not allow apps to access it's location. I also need to account for tablets that have no sim card and thus cannot use telephonyManager. For this reason I...

SSID geolocation. Is it possible to locate an AP by knowing its SSID?

geolocation,latitude-longitude,wireless,ssid,802.11
I am doing a research project about data leakage in probe requests. As in these probe requests it is possible to see some SSIDs, I was wandering if it could be possible to locate them. For example, if I see WLAN_C11G I would like to be capable of knowing the...

Http Get Request for IpDBInfo using an IP Address

c#,asp.net-mvc,geolocation,ip
I am working on a web application and it needs to track a location using an IP Address and I am new to sending requests to some APIs and getting a response from them. I was able to retrieve IP address of the user using Request.UserHostAddress and was able to...

dynamic variables in an iframe

javascript,html5,iframe,geolocation
I am trying to use HTML5 geocoding to pass dynamic lat and long into an iframe. This is as far as I can get. I can't quite get the lat and lon to work into the iframe src. How do I pass the variables into the iframe properly? <!DOCTYPE html>...

Get tweets by hashtag by location

rest,twitter,geolocation
I'm using the new Twitter API 1.1 to fetch trending Hashtags in a given location using the woeid: /trends/place.json?id=3534 Then I can use the same API to fetch tweets with a given Hashtag: /search/tweets.json?q=Hashtag&result_type=latest But I can't find in the doc how to fetch tweets with a given Hashtag in...

This is googles standard code for getting current location of user on map but on some PC it shows incorrect results. what could be the reason?

javascript,html5,google-maps,geolocation
The code given below is the google's standard code for getting the current geolocation. This code works fine on my android mobile device but it shows my current location to Pune (841 kilometres from my current location), when I accessed the web page from my PC. On one of my...

Get current latitude and longitude android

java,android,gps,geolocation,location
Requirement: 1.Sometimes(not everytime) I am getting latitude and longitude 0.0. 2.I want to know how to get the location update after user has enabled the gps from the settings. Here is my code public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status...

cordovaGeolocation error: position retrieval timed out

angularjs,cordova,geolocation,ionic-framework
Hello I want to implement some geolocation features in my app. So I implemented a watchposition function like this: .controller('NavigationCtrl', function ($scope,$cordovaGeolocation) { var watchOptions = { frequency : 1000, timeout : 20*1000, enableHighAccuracy: false // may cause errors if true }; var watch = $cordovaGeolocation.watchPosition(watchOptions); watch.then( null, function(err) {...

Has anyone faced Geolocation permission alert for iOS showing twice issue along with bundle location?

ios,cordova,ipad,geolocation,phonegap-build
Geolocation permission alert for iOS showing twice along with bundle location . I have tried by installing latest plugin and other similar answers provided for this Even used below key in info.plist "NSLocationAlwaysUsageDescription" But still I m getting below error: "private/var/mobile/Containers/Bundle/Application/0846B1D6-02AB-4846-ACD2-F722214B9015/myapp.app/www/index.html" in iOS phone gap project. Can any one suggest...

Save Geolocation in php variables

php,html5,variables,geolocation
i want to save the latitude & longitude into php variables For example i want a output like this: <?php echo $latitude ?> Here's the script for capturing the location(from w3schools) <button onclick="getLocation()">Try It</button> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else...

Attempt to invoke virtual method when getting current location

java,android,geolocation,google-play,google-play-services
I am trying to get current location using Google Play Services. Below is my code. public class MainActivity extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { public double latitude; public double longitude; public static final String TAG = MainActivity.class.getSimpleName(); private GoogleApiClient mGoogleApiClient = null; protected Location mLastLocation; // Some butterknife code public...

AngularJS Geolocation data update

javascript,angularjs,geolocation
I'm doing a mobile app using AngularJS. What I'm trying to achieve is to update the geolocation data as soon as I turn on the GPS. How do I achieve this? The problem I'm facing is, in order for the data to be updated I have to navigate to other...

GEO location TypeError: Cannot read property 'country' of null

javascript,geolocation
On a new connection i get sometimes the error TypeError: Cannot read property 'country' of null and mostly it works correct! How do i avoid this whenever its null so i will not get the error? Error line is var location = geo.country; var ip = socket.ip //socket.ip; var geo...

MKMapView MKCircle renders a circle with too big radius

ios,swift,geolocation,mkmapview
I'm facing with a strange behaviour of MKCircle appearance. Basically I'm trying to draw a circle with a radius of 8500 km with an arbitrary center. Here is my code: private func addCircle() { mapView.removeOverlays(mapView.overlays) let circle = MKCircle(centerCoordinate: mapCenter, radius: 8500000.0) mapView.addOverlay(circle) } I also have a custom double...

Django Rest Framework - How do I limit results returned with Geolocation?

python,django,geolocation,django-rest-framework
I have a model which stores a users location: [ { "url": "http://192.168.0.22:8000/status/1/", "id": 1, "owner": 1, "test_info": "", "created_at": "2015-05-02T07:09:16.535689Z", "updated_at": "2015-05-02T07:09:16.535746Z", "geolocation": null, "jukebox_mode_enabled": false }, { "url": "http://192.168.0.22:8000/status/2/", "id": 2, "owner": 2, "test_info": "", "created_at": "2015-05-02T07:09:24.206959Z", "updated_at": "2015-05-02T07:09:24.207042Z", "geolocation": null, "jukebox_mode_enabled": false }, I am trying to...

how to get the distance or radian between two point on the earth with lng and lat?

geolocation,geometry,geospatial
how to get the distance or radian between two point on the earth with lng and lat?

Entity Framework Spacial Data Longitude and Latitude

sql-server,entity-framework,geolocation
I have entered data into a DbGeography using the FromText option. For example: DbGeography.FromText("POINT(51.28101 1.076981)") now I have noticed something odd. The 51.28101 is a latitude and the 1.076981 is a longitude so you have "POINT(latitude longitude)". If you paste that into google maps it will take you to a...

What is the best way to implement a service operation that returns places sorted by distance to the current user?

algorithm,geolocation,restful-architecture
let's say a service operation like this api/places/?category=entertainment&geo=123,456&area=30&orderBy=distance so the user is searching for places of entertainment near the geo location (123,456), no further than 30 kms boundary, and want the results sorted by distance suppose the search should be paged, say it will have 500 items satisfy the query,...

How to draw path as I move starting from my current location using Google Maps

android,google-maps,geolocation,location,locationlistener
I am trying to draw route as I move from my current location. I am facing a big problem in drawing route dynamically please help me to solve it. I am having marker at my current location in my map. As soon as I start moving I want the map...

Where to start in finding users in a radius from me [closed]

ios,gps,geolocation
Where to start to write app to have users find each other based on their defined location? I'm looking for something similar to the tinder search for people in a specific location. Would I be using map points in mapkit or GPS locations and if so, can anyone point me...

Elasticsearch node.js geo_distance filter

node.js,filter,elasticsearch,geolocation
I'm using the elasticsearch module in a nodejs app in order to find document by geo_points. according to http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search, i'm trying to do this : client.search({ index: 'myindex', type: 'mytype', body: { filtered : { query : { match_all : {} }, filter : { geo_distance : { distance :...

How to get user location continuosly without GPS

android,geolocation,location
There are some questions regarding this issue but I could not find any method works without problem. I implemented the version of the project with GPS provider and now I want to implement a version which can find the location of user without GPS, just using network provider such as...