I am developing an Android application and would like to play a recorded track in DDMS tool. Besides latitude and longitude, my recorded data has horizontal accuracy which I'd like to pass to Android phone simulator.
Is there a way to specify accuracy in GPX or KML formats?
In neither of those specs is a named element for accuracy. Both however allow for extended data which where you can put whatever you want.
In GPX it's called 'extensions' See http://www.topografix.com/GPX/1/1/#type_extensionsType
In Kml it's called 'ExtendedData' See http://code.google.com/intl/nl-NL/apis/kml/documentation/kmlreference.html#placemark
As Eddy noted, there are no tags for accuracy.
But, GPX have something similar -- tags for dilution of precision (hdop, vdop, pdop) for every track point, waypoint or route point. Those are not exactly the same as "accuracy", but it can be used as such. See wikipedia for more.
Related
I am trying to show path between 2 different locations via google static maps api.
It's working for short distance.
But Poly line is not able to draw for long distances may be due to delimit of Url parameters.
How can I make it work for long distances?
Here is Working Example for Ahmedabad to Mumbai:
Here is Not Working Example for Ahmedabad to Goa:
You should reduce the points you get for the path. There special mathematical algorithms that will do it without losing any quality in viewing the path, especially on a higher zoom level. In the next step, you can encode the path-points.
I think all you need you can find in this discussion: Static Maps: Drawing polygons with many points. (2048 char limitation)
More you can find if you search for "simplify path" and maybe "encode Path".
Good Luck, Reinhard
PS.: Under GPSies.com you can plan a path, save and download it with different levels of reduced path-/trackpoints. Maybe you can use it for testing.
I'm fairly new to Android and trying to develop an app that identifies if a user's location is inside or outside of a given region within a state. My approach is to take the user's latlng and use ray casting to identify which region they are inside (they must be inside 1). My regions are best equated to state park lines, but Google does not have these in Google Maps (and they're too irregular for geofencing). As such, I created customer polygons. I'm not struggling with the code, but struggling with the best way to handle data.
How should I store and access the polygon data for ray casting? I was taking the approach of storing the polygons in an XML file but I'm worried about the time and processing power it may take to parse the XML and run a ray casting across up to 30 polygons in a given state. My polygons are complex enough that the XML file for one state is upwards of 4MB. My polygons only need to be read, not written, as they'll come with the app.
I think that your best option is to store your polygons is a geographic database. The best solution I've found so far to do so is SpatiaLite which is build over SQLite and works really well on Android.
Using this approach you will store you polygons in the database and query what polygons intersect with a given LatLng (Point). The query will look like this (not tested):
select * from polygons_table where st_intersects(Geometry, MakePoint(longitude, latitude, 4326));
Note that I use 4326 as the SRID because I assume that you will store your polygons in WGS84.
Here you can find the SpatiaLite 3.0.0-BETA SQL functions reference list.
I am trying to develop very basic GPS App and want to highlight path between two cities. I used the code in the following post
Answer : Draw path between two points using Google Maps Android API v2
by zeeshan0026.
And the code works fine but when you highlight path between two very far cities then it shows the straight kind of path. I think the problem with the number of LatLng points return by the decodepoly function i am trying to change the shift but nothing helps.
Please somebody help me in this regard.
Thanks in Advance
Directions API URLs are restricted to approximately 2000 characters, after URL Encoding. As some Directions API URLs may involve many locations along a path, be aware of this limit when constructing your URLs.
For more accurate path between very far cities, we need to use the polyutil.encode and decode functions.
I'm looking (and not finding) any reference in the google maps api (both Android and Web) to get a list of all the zip codes that a given driving path moves through.
Am I overlooking this or is this not something that the API supports?
So, to be clear, I have directions from point A to point B and I'm interested in pulling up all the unique zip codes that the path goes through (not just the zip codes of the individual points where navigation instructions are given, but ALL zip codes for the entire path).
Why the zip codes? of all things? The zip code in the US only represents a very small portion of an address. Also, most people don't know zip codes, a more useful piece of information would be the city/county a car is driving through. Are you from outside the United States by any chance? Or are you making an application for postal workers?
In any case, what you're looking for is reverse geocoding. See this example of reverse geocoding on Google Maps.You give it a longitude and latitude and the server sends you back an address with the zip code included (for your purpose, you'll just need to disregard the rest of the information it gives you). This will have to be done on a point by point basis. There is nothing in the documentation I just linked to, that does this for an entire path.
If I were you, I'd go directly to the source, the census bureau. That's where Google Maps takes its address data from anyway.
Zip codes tend to be irregular in their shape in size (from covering large portions of towns to just a single floor of an office block).
Google does not appear to provide a facility to get the unique zip codes that your route passes through but you could certainly try and query (reverse geocoding for a lat-long coordinate) every x meters along your route to get a (near) complete list.
When you request directions you get a directionResult object which contains many DirectionLeg objects, which contains DirectionStep objects which have a lat-lng for their path. If the lat-lngs are too far apart you can interpolate, if they are two close you can skip some.
I want to create an android application that warns me if I am to exceed the speed limit, and I thought of using the maxspeed tag in openstreetmaps , but when I got the data using the API I can't find the speedmax tag but it's there when I lookup the place in the site. is there any other way to retreive the max speed limit for each road to use it in my app ?
You are searching for the maxspeed=* tag http://wiki.openstreetmap.org/wiki/Key:maxspeed (query taginfo on right sidebar)
Furhtermore there are different solutions for your task:
Ask existing map creators on help/data (lookup "Maps" in OSM Wiki)
Create a query for the Overpass API maybe helpful is Overpass Turbo
Filter OSM Planet extracts on your own using osmosis and appropriate filter expressions
Please keep in mind, that dealing with OSM data can be difficult, as for example speed units depend on the country, same as defaults for untagged roads.
P.S. It's called OpenStreetMap (without -s) ;)
http://www.overpass-api.de/api/xapi?[maxspeed=][bbox=31.454403,30.082119,31.454266,30.082093]
just use two points (LAN/LAT) on the same road to get the road details