Getting latitud - longitud data from route create on Here Maps - traffic viewer - here-api

How can i get lat - long from a specific corridor created on traffic viewer
if i need the lat-long from point A start to point B finished , were is that information that i need ?

you must consider the Geo-coding in order to convert the place name into geo coordinates form the html page itself.

Related

Get Lat/Long from City Auto Complete

I am using a plugin that provides a location field type (City/State/Country, etc) that uses the Google Maps API to autocomplete the field. I am using only the City field. It works as it should: start typing the city and the dropdown fills with possible city/country matches. Then I pick one. Is it possible to extract the lat/long coordinates from the selection made in the dropdown?
If so, how?

Here Fleet Telematics admin area

I am using fleet telematics and accessing tile for kuwait. If a place is present into two tiles I combine combine all coordinates from all rows for that place and convert that coordinates into polygon.
Please see the image below as i see weird polygons.
To get the city bounds of Kuwait city admin area, you may want to use ADMIN_POLY_8.
If you query that layer, you will notice that the ADMIN_LEVEL attribute here is '4' which corresponds to city.
To understand which layer to pick, check the description of the layer on sending this call
https://s.fleet.ls.hereapi.com/1/doc/layer.json?layer=ADMIN_POLY_8&apiKey={{RESTapiKey}}
In the response, you will see the attribute 'ADMIN_LEVEL' which says 'Administrative level 1 - 9.To look up the country specific name/meaning, applications can load the static table {COUNTRY} and fetch the value from column'
When you query the static layer 'COUNTRY' , you will see that 'ADMIN_LEVEL_DESCRIPTION_4' corresponds to city.
This is how you can find out which layer to choose.
you have selected ADMIN_POLY_9 which has places with ADMIN_LEVEL 5.
This gives you the geometric bounds of SETTLEMENT within the city and thus the multiple polygons.

Google places api not showing results for some places

Hello i am using simple google map places api to get near by atms for users. My client lives around new york and for some strange reason api shows zero results for that place, but works fine near me (pakistan) . I searched for it a little and found out it was google's issue and some other places were also experiencing the same problem. But i never quite found any solution for this.
This is the get call i use
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7128,74.1059&radius=10000000&keyword=atm&key=MY_KEY
I would really appreciate the help. Thank you :)
Google place nearby search maximum 50,000 meters (31 miles) . if you try enter more than 50,000 it not work proper.
There is another way for find all ATM in a city. google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=atm+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search
OR (second way)
There is another way for find all ATM in a city.
Open Google Maps .
create 10-12 or more points latitude , longitude value to trigger
request.
Then use a loop to find all places within these points.
If you want more appropriate results, increase first trigger points
for your requests.
- It is just a logic i created in php.
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $tP){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$tP&radius=[YOUR_RADIUS_VALUE]&type=[YOUR_TYPE]&name=panera&key=[YOUR_KEY_HERE";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}
SHORT ANSWER: Use logical types with your needs.
In my case i used food types instead of supermarket. In some cases, my local market named A101 wasnt found under supermarkets. To find which keywords is best for you, you can search below url with your location and map_key and find most common keywords under types for each query and use it.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.986527896166244,%2029.24326049097467&rankby=distance&keyword=a101&key=YOUR_MAP_KEY

How to covert HERE incidents RDS-TMC data to geometries (points)

I'm using the HERE traffic API such as:
http://traffic.cit.api.here.com/traffic/6.0/incidents.xml?bbox=43.8,-79.5;43.6,-79.4&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&status=active&maxresults=50
The XML returns:
...
<RDS-TMC>
<ORIGIN>
<EBU_COUNTRY_CODE>C</EBU_COUNTRY_CODE>
<TABLE_ID>9</TABLE_ID>
<LOCATION_ID>04184</LOCATION_ID>
<LOCATION_DESC>DUFFERIN ST/EXIT 364</LOCATION_DESC>
<RDS_DIRECTION>-</RDS_DIRECTION>
</ORIGIN>
<TO>
<EBU_COUNTRY_CODE>C</EBU_COUNTRY_CODE>
<TABLE_ID>9</TABLE_ID>
<LOCATION_ID>04187</LOCATION_ID>
<LOCATION_DESC>HWY-11A/AVENUE RD/EXIT 367</LOCATION_DESC>
<RDS_DIRECTION>-</RDS_DIRECTION>
</TO>
<DIRECTION>+</DIRECTION>
<ALERTC>
<TRAFFIC_CODE>701</TRAFFIC_CODE>
<QUANTIFIERS>0</QUANTIFIERS>
<DESCRIPTION>(Q) (--//set of//sets of) roadwork</DESCRIPTION>
<ALERTC_DURATION>L</ALERTC_DURATION>
<ALERTC_DIRECTION>1</ALERTC_DIRECTION>
<UPDATE_CLASS>11</UPDATE_CLASS>
<PHRASE_CODE>E1</PHRASE_CODE>
<EXTENT>3</EXTENT>
<DURATION>0</DURATION>
</ALERTC>
</RDS-TMC>
...
Is there any API to turn the RDS-TMC section information to geometries (points):
Maybe something like this for example:
<Path><Point lat,long /><Point lat,long />[snip]<Point lat,long /><Point lat,long /></Path>
Anything that returns the road geometry (lat, long) will do. Thanks for your assistance.
Could you use the latitude and longitude elements within the geoloc/origin ? Maybe store these in a look up table? I know not all elements are always present, so you may need to use Street Intersection Gecoding in the Geocoding API as well. Street geometry is available from the Enterprise Routing API
I’m not aware of an API that does exactly what you want (then again, I’m not too familiar with HERE services, so there may be something I’ve missed).
The XML you are posting looks like a decoded TMC message, with the <origin> and <to> elements describing the start and end of the affected route. To work even over low-bandwidth connections such as RDS, TMC just transmits 16-bit location codes and relies on lookup tables in the receiver for all the rest; HERE seems to be doing some of that work for you by resolving the description for eqach location.
Three elements in each of these uniquely identify the location: <ebu_country_code> and <table_id> identify the location table, and <location_id> identyfies a unique location within that table. You could decode this into coordinates by obtaining the location table (rather, one location table for each area you want to cover). These will give you one point each for <origin> and <to>. For longer stretches of road, where there are additional TMC locations between these two points, you could walk through the table and obtain these as well (on highways, there is usually al location for each junction and each rest area). However, it would still not give you a complete road geometry—you would need to use map data for that.
A list of sources for TMC location datasets (not exhaustive, though) is here.

Google map api v3 markers exclude a city or certain bound

I am using google maps api v3. I have a database of markers with lat and long address that I display on a map and that works fine.
The map is displaying markers for entire state and now I want to know how can exclude markers in a certain city? Say I am displaying a map of Indiana and want to exclude Indianapolis.
I have a rough idea where I can select the points and some how check if they are between a certain range but could someone elaborate on this with a more specific example or is there a better approach to this?
What you need is something called Reverse Geocoding, which will give you result of street name, city name and country name, given longitude latitude example.
I will do these steps :
Iterate all the marker and "reverse geocoding" the marker lat-long.
Check city result of the "reverse geocoding".
If the City is not inside your accepted cities, remove the marker.

Resources