Get country, county and street name from layers - here-api

currently we fetch the address information from reverse.geocoder but we are also using rme and pde so i was wondering if I can everything without reverse geocoder call?
What we need at the end is
STREET NAME, COUNTY, COUNTRY
Country and street name we have, but the county (federal state name) is only an id in ROAD_ADMIN_FC. Is there a way to map it to a name?

Geocoder API is the best to get street, county and country information all in one query. But depending on your usecase, you can also check out ROAD_NAME_FC* and ROAD_ADMIN_NAMES_FC* to get these information. Refer tcs.ext.here.com/pde/layers?region=WEU&release=18135&url_root=pde.api.here.com to check the responses you can get from these PDE layers.

Related

How to get a geoID for the Google Analytics Measurement Protocol from a zipcode or coords?

is it possible to get a geoID for the Geographical Override parameter in the Google Analytics Measurement Protocol from a zipcode or coordinates?
Geographical Override The geographical location of the user. The geographical ID should be a two letter country code or a criteria ID representing a city or region (see Geographical IDs). This parameter takes precedent over any location derived from IP address, including the IP Override parameter. An invalid code will result in geographical dimensions to be set to '(not set)'.
You will need to download the file found at Geographical IDs and then parse it against some kind of world wide zip code list in order to parse your zipcodes into Geoiids.
Sending a zip code to Google analytics isnt going to work it must be a valid GeoId
format of Googles CSV File
The file from google is a CSV with the following columns Criteria ID,Name,Canonical Name,Parent ID,Country Code,Target Type,Status
"1014315","Sunnyvale","Sunnyvale,California,United States","21137","US","City",Active
Geoid 1014315
city Sunnyvale
Cononical name Sunnyvale,California,United States
parent id 21137 (i beleave this is state id in the case of the usa)
country code US
Active
Note: small towns and villages will probably not be listed. You will have to try to find something as close as you can get

Geocode searchText with State and Country provided shows results outside of State

When using the Nokia Here Geocoding Service the State parameter is ignored when searching by searchText: 315 NE 14th Street, State: FL and Country: US.
The only result returned is a location in Louisiana. Adding the State to the end of the searchText doesn't work either.
Google and MapQuest properly return the result in Florida. The client does not want to include a city but rather an address, state and country.
I know that the Nokia Here algorithm does not filter down a closely as Google and MapQuest but expected that the inclusion of the State parameter would force the result search.
You can try setting a search area, so you can further narrow down the results. The following Android example will return one result in Homestead, Florida City:
String query = "315 NE 14th Street Florida US";
GeocodeRequest geocodeRequest = new GeocodeRequest(query);
GeoCoordinate areaCenterCoordinate = new GeoCoordinate(27.82353, -81.760254);
geocodeRequest.setSearchArea(areaCenterCoordinate , 15000);
According to documentation GeocodeRequest processes text string queries, so I believe you can omit state or country parameters and add state or country as part of the search term. Please note that multiple results can be returned if they all match to the given search term.
An example on how to use GeoCoder can be found here.
Depending on your use case, maybe consider to use SearchRequest instead. If this does not help it would be great if you can provide more details in your question, e.g. what API flavor you are referring to.

google trip planner auto-fill

We are currently using the google trip planning feature on our transit website. The issue we are running into is the fact that when a customer types in a starting point (for example "Queensway" in Kelowna, BC Canada) we get auto-fill results from all over North America. Can the auto-fill results be restricted to a specific province or state? Thanks!
Try using Component Filtering
In a geocoding response, the Google Maps Geocoding API can return address results restricted to a specific area. The restriction is specified using the components filter. A filter consists of a list of component:value pairs separated by a pipe (|). Only the results that match all the filters will be returned. Filter values support the same methods of spelling correction and partial matching as other geocoding requests. If a geocoding result is a partial match for a component filter it will contain a partial_match field in the response.
The components that can be filtered include:
route matches long or short name of a route.
locality matches against both locality and sublocality types.
administrative_area matches all the administrative_area levels.
postal_code matches postal_code and postal_code_prefix.
country matches a country name or a two letter ISO 3166-1 country code.
Note: Each address component can only be specified either in the address parameter or as a component filter, but not both. Doing so may result in ZERO_RESULTS.
A geocode for "Santa Cruz" with components=country:ES will return Santa Cruz de Tenerife in Canary Islands, Spain. Request:
https://maps.googleapis.com/maps/api/geocode/json?address=santa+cruz&components=country:ES&key=YOUR_API_KEY
See this sample: Place Autocomplete Hotel Search for code implementation.
Hope it helps!

Get city and street name for a link from PDE

In the project I am working on, I need to get the address of a link(street, city, postcode, country) for links returned from RME.
For the postcode and country, I can get the tileXY and level from index resource, and then use the ROAD_ADMIN_FC3 layer from the tile resource. But I couldnt find a way to find city and street.
How can I get the city and street name of a link from PDE while having only the link ID?
Note: I prefer not to use the routing api.
The Layer ROAD_GEOM_FC3 should give you the road name and ROAD_ADMIN_FC3 contains ADMIN_PLACE_IDS, this along with ADMIN_PLACE_1, ADMIN_PLACE_2 should give you city details.

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