If I get the lon and lat of a Point by Google maps or bing maps API, what are the maximum and minimum valid values for that variables?
I want to check some user Input before storing lon and lat into a database.
Assuming, those values correspond to longitude and latitude:
The longitude is between -180° to 180° and the latitude between -90° and 90°.
I think you will find that it is the earth, or rather human conventions in mathematics that defined a circle to have 360 degrees, that define the maximum and minimum of latitude and longitude. Latitude ranges from -90 to 90 and longitude from -180 to 180.
However, in web mapping there is often a lot of confusion about coordinate systems. Google maps use something called web mercator which is a projected coordinate system, ie, in meters, with the assumption of a spherical earth.
EDIT: Yes, Bing also uses Web Mercator to represent position on the earth, also known as EPSG 900913 or 3857 in official designation. My personal view is that the Google Maps api is nicer to use and the quality of the mapping is higher, especially now that they have introduced vector-based tiles.
A big issue to be aware of, which I cannot advise on, with both Google and Bing, is over the ownership of derived data -- ie, there are legal considerations as well as technical considerations.
I use a library called OpenLayers which is a very fully featured mapping API, but does not come with any built in mapping -- so you either have to provide your own wms or use somehthing like Open Street Map (which is extremely good in most developed parts of the world, but somewhat lacking elsewhere). There are other options, such as, Leaflet which are slightly lighter-weight than OpenLayers, but will suffice for many needs.
Related
I have coordinates of restaurants and have to measure average human density around each of them. I couldn't find anything about this on the web.
I want to be able to input a coordinate, run the script for a day and see how many people passed by. If there is a faster way that would be even better.
I found this Sample Code at Apple's Developer Site:
https://developer.apple.com/library/ios/samplecode/footprint/Introduction/Intro.html
The discription says:
Use Core Location to take a Latitude/Longitude position and project it
onto a flat floorplan. Demonstrates how to do the conversions between
a Geographic coordinate system (Latitude/Longitude), a floorplan PDF
coordinate system (x, y), and MapKit.
I have tried it and it works really well.
Basically, you provide a map image for a building and specify two coordinates manually. Then, using CoreLocation, it is converting latitude/longitute into (x,y) position.
My question is - how is it possible to grab latitude/longitude while indoors?
I have watched some Apple's videos and they said they vastly improved CoreLocation, but how is my iPhone getting a correct informations?
TL;DR: It works. I am just wondering how.
Big companies, especially map providers such as Apple, Google, etc. gather information about all Wi-Fi access points (AP). They use so-called crowdsourcing technology in order to estimate position of AP by combining GPS coordinates with recieved signal strength (RSS) from all visible APs.
Once user requests a fix on their location, they send to server a list of all the MAC (media access control) addresses associated with wireless hot spots available within range to be checked against a database of those addresses. Then trilateration technique is used, that is fused with positional data provided by smartphone internal sensors (accelerometer, gyros, magnetometer, barometer). But this approach still suffer from lack of accuracy that is 7-20 meters so far depending from number of visible APs and quality of the sensors.
Learm more here, or here.
In order to have 1-5 meters accuracy, it's required to have additional correcting information. State of the art is to use bluetooth beacons. Given their coordinates it is possible to estimate user's position. Nowadays there are plenty of companies who develop this technology e.g. Navigine, indoors, nextome.
CoreLocation uses GPS when outdoors, and WiFi access points (APs) when indoors (when mapped, otherwise you're getting GPS which isn't very good when indoors). CoreLocation uses iBeacons for proximity positioning, not for giving you a lat/lon. That is, you can use CoreLocation to say "When I get close to this iBeacon let me know". For WiFi positioning to work, you must upload floor plans to Apple, get them converted to their IMDF format, then use a surveying tool to fingerprint your indoor location. Only then will CoreLocation actually leverage the WiFi APs to give you an accurate indoor location (3-5 meter accuracy).
I'm working on a project where the locations visited by people are captured in terms of latitude and longitude and analyze all these coordinates to identify the mostly visited places.
I finished up to retrieving the all the coordinates visited by the people and sending those data to a database as well as writing them to a text file. I tried to cluster the data by retrieving them from the text files. Since I'm totally new to machine learning, I'm finding it hard to figure out what to do exactly with the data.
So can anyone please help me to figure out a correct approach to identify the mostly visited places by analyzing the coordinates that I'm having ?
As stated, there is quite a bit of missing information for this question but I will have a go from what I understand.
I can think of two scenarios, and the approach to solving each is not something I would really consider as machine learning. The first scenario is that you have already attributed the lat/long to a definitive location e.g. “visitors of Buckingham Palace”, which would have a set lat/long coordinate associated with it. You’d then be able to generate a list of (Monument_lat, Monument_lon, weight) where weight is the number of visitors attributed to that location. Then it would simply be a case of sorting that list by weight, as has been suggested. I’m not clear on why you don’t think this is the most efficient way (list sorting is trivial and fast).
The other scenario involves raw lat/long data from a phone where you might have extremely similar lat/long pairs, but not exactly the same. You want to group these to single locations. You could divide the region of interest into small rectangular zones where you store the lat/long data for each of the corners of the zones. You then run a ray-casting algorithm to solve the point-in-polygon problem, thereby attributing the raw lat/long data to a zone, and you find the centre coordinate of each zone to apply the "weight".
I don’t know what language you are using, but there is an open-source ray casting algorithm for Python. Depending on the scope of your problem, there could be slight alterations that you might want to make. Firstly, if you are defining the location by a monument name and you don’t have too many, you could go on Google Maps and define your own lat/long corners of zones, to store as a list. If you’re not interested in classifying in a monument-name fashion, you simply divide the whole area into even rectangles. If you wanted, say, 10 metre precision across an entire country then you need to have layers of different sized zones to minimise the computational effort. You might divide the country into 10x10km squares and do a ray cast on that scale to give a rough sorting stage, before doing another ray cast on a 10x10m scale within the 10x10km zone.
I need enough accuracy in my app but Google Places seems to be poorly accurate filtering by category. So I'm considering migrating to Factual API. Do you guys have used it? What do you think about its accuracy?
In the other hand, I NEED to know the distance to a place and the estimated travel time. I'm getting this info with Google Distance Matrix API, but I don't know if Factual has this functionality or not.
Thanks in advance.
I used Factual's api for one app and the result is worse than Google Place's, at least for the super-market/grocery category
If the Factual API allows you to display the data on a Google Map, you can use the Factual data with the Distance Matrix.
Factual provides distance in query results(in meters from search center). It has a much better category tree system. Factual allows "IncludeAny(Category ids)" (Google only has single level types and does not allow multiple types search). What I do is use Factual for initial search and Google Places for detail on a particular place. Google places has photo[s], reviews(3)and openNow(boolean).
The quality of data is slightly better in Google. (Both need work)
We are working on a project to add vector map data from OSM and NAVTEQ to a iOS GPS app.
Currently, the app displays raster map images and provides moving map navigation features. We now want to take it a step further by integration vector maps but don't know where to start.
Guidance from developers with experience on GPS navigation would be great.
Here is the brief on the requirements:
Target Devices:
iOS. C++ is preferred for the core for future compatibility with other platforms.
Data integration and packaging:
Map data source:
- NAVTEQ
- OpenStreetMap
File format:
- Ideal for mobile devices with considerations of device limitations.
- Either find an already established format, or create one in house.
Compiling:
- Determine a format for source data (Shp, MapInfo etc)
- Compile source format to required format.
Map rendering engine:
Display of maps:
- Vector map view will be separate to the current raster map view.
- Render data into lines, points, polygons etc in real time. Tiled or pre-rendered is not acceptable.
- 2D birdseye view. (3D is planned for future versions).
- Shade relief to illustrate elevation.
- Display user generated data such as routes, tracklogs, waypoints.
- A scale, e.g. 500 metres.
- Speedy performance is essential to provide better user experience.
- Good examples would be the Tom Tom iOS app.
Map Interactions:
- Pan, Zoom, rotate.
- Make use of multitouch functionality.
Search
- Address, locations, POI (Geo Coding)
- Address from location (Reverse Geo Coding)
Style sheets
- Easily customise the look of the map been displayed.
- Every element can be cusomised.
We would like to find out where to start our research. What libraries and SDKs are out there that are worth spending the time investigating?
Some notes based on my experience:
Source data format: you'll probably want to be able to import data from ESRI shapefiles and OpenStreetMap (which comes as XML or a more compact but equivalent binary format). NAVTEQ data can be obtained as ESRI shapefiles. Shaded relief can be obtained by processing USGS height data (http://dds.cr.usgs.gov/srtm/).
2D versus 3D: the step from one to the other is a big one. 2D data is almost invariably provided as latitude and longitude and projected to a plane: Google Maps and OpenStreetMap use a very simple but much derided spherical Mercator projection. Moving to 3D requires a decision on the coordinate system - projected plane plus height versus true 3D based on the shape of the earth - and possibly problems involving level of detail. A good way to proceed might be to draw the shape of the earth (hills and valleys) as a triangle mesh, then drape the rest of the map on it as a texture. You might want to consider "two and a half D" - using a perspective transformation to display the map as if viewing it from a height.
Libraries: there's quite a big list of map rendering libraries here, both commercial and non-commercial (disclosure: mine is one of them). Many of these libraries have style sheet systems for customising the map look and feel.
A very good open-source rendering library (not mine) is Mapnik, but I am not sure whether that will port very easily on to iOS. However, it's a very good idea to read up on how Mapnik and other rendering libraries do their work, to get a feel for the problem. The OpenStreetMap wiki is a good portal for learning more about the field.
Text rendering on maps is nearly always done using FreeType, an open-source rasterizer library with an unrestrictive license.
Try out MapBox library: http://mapbox.com/
There is a list on the OSM Wiki but it is sadly not complete.
Two vector libraries that I know of are CartoType (which you can see in use in the newer Lonely Planet Guides) and Skobbler - Skobbler don't have an off the shelf product but I bellieve they will integrate their vector maps and routing for you.
There is also a related question on the OSM StackExchange