Retrieval of Area Shapes - Here Maps API with V7 - here-api

Is there any way to retrieval of multiple polygons,
Like for e.g, If I should search for "ABC" and "XYZ" using additionaldata as 'city', then I should get both drawn Polygons at the same time.
As per my understanding, in V6.2 we can retrieve only single polygon using searchText and additionaldata.

The requirement is not clear to me. Could you share an example of the request?
In general, the response includes a Shape element, which contains the requested outline in WKT (well-known text) format. Depending on whether the requested area is contiguous or not, this will either be a POLYGON or MULTIPOLYGON geometry.
For example:
https://geocoder.api.here.com/6.2/geocode.json
?app_id={{app_id}}
&app_code={{app_code}}
&searchtext=10115+DE
&additionaldata=IncludeShapeLevel,postalCode
Sample Response
"Shape": {
"_type": "WKTShapeType",
"Value": "POLYGON ((13.36566 52.53586, 13.36575 52.53579, 13.36582 52.53574, 13.36599 52.53564, ..., 13.36566 52.53586))"
}
The response data can be plotted using JavaScript.
This is an example using Geocode version 6: https://developer.here.com/cn/documentation/geocoder/topics/example-reverse-geocoding-shape.html
However, this feature is currently missing in the latest Geocode version 7.
https://developer.here.com/documentation/geocoding-search-api/migration_guide/migration-geocoder/topics-api/geocoding.html

Related

How can I edit the values of coordinates within a geojson file?

I am trying to map a geojson file (A map of Alaska precincts, downloaded from the division of elections and then converted online to geojson) onto a choropleth map using folium, the problem is the coordinates are in 7-digit numbers like this:
[ -16624764.227, 8465801.1497 ]
I read on a similar post that this was most likely a US coordinate system like UTM or State Plane, and recommended using an API to reproject it. Is it also possible to access the coordinates directly such as with geopandas and divide them by 100000?
The data is most likely in a specific cartographic projection. You don't just want to divide by 100k - the data will likely have nonlinear transformations which have a different effect on the position depending on the location. See the GeoPandas docs on working with projections.
If the CRS of the data is correctly encoded, you can re-project the dataframe into lat/lons (e.g. WGS84, which has the EPSG Code 4326) using geopandas.GeoDataFrame.to_crs, e.g.:
df_latlon = df.to_crs("epsg:4326")

Restricting specific patch of road using overlays

I am trying to implement overlay in HERE map to restrict specific path of a road.
To achieve this i am referring to following guidelines:
https://developer.here.com/documentation/fleet-telematics/dev_guide/topics/custom-routes.html
The road which i am trying to restrict for routing is around 5km long.
Important thing over here is to get shape points in following format:
An array of shape points where each shape point is an array of two elements, latitude and longitude, in WGS-84 degrees. Currently, the first and last point must each fit within 5 meters tolerance onto existing links. These points must not both end up on the same link.
My basic question is how one can get shape points for desired route in above format.
I tried calculating route between 2 waypoints and added all shape points received by calculateroute response in upload.json request.
Request was successful although route never gets ignored.
Following are my route request parameters:
routeRequestParams = {
mode: 'fastest;car',
representation: 'display',
routeattributes : 'waypoints,summary,shape,legs',
maneuverattributes: 'direction,action',
waypoint0: '24.799113,46.867249',
waypoint1: '24.676569,46.641192',
overlays:'OVERLAYBLOCK11'
};
Kindly let me know what am i missing.
BR,
Harshal
Please use the following format to restrict or add any link in the overlay. Try your use case in our map and also share the entire request "https://tcs.ext.here.com/examples/v3/custom_routing_basic"
/2/overlays/upload.json
?map_name=OVERLAYBASICDEMO1&overlay_spec=
[{"op":"override",
"shape":[[50.10765,8.68774],[50.10914,8.68771]],
"layer":"LINK_ATTRIBUTE_FCn",
"data":{"VEHICLE_TYPES":"0"}},
{"op":"create",
"shape":[[50.10937,8.68422],[50.10807,8.68525],[50.10737,8.68387]],
"data":{"NAMES":"ENGBNDemo Road"}}]
&app_id=inCUge3uprAQEtRaruyaZ8&app_code=9Vyk_MElhgPCytA7z3iuPA
&storage=readonly
eg [{"op":"restrict","shape":[[53.54742,9.99704],[53.54746,9.99765]], "type":"preferred", "data":{"VEHICLE_TYPES":"145","PREFERRED_ROUTE_TYPE":"201","ENTRY_PENALTY":-1,"DRIVE_PENALTY":-0.1}}]

How the ADAS_ATTRIB attribute vertical_flags has to be interpreted

I'm playing a little with the route matching function of here api.
And I stumbled across an ADAS_ATTRIB attribute called VERTICAL_FLAGS.
The only time it's mentioned in the docs is (at least what I've found so far):
"Y/N. Specifies for each coordinate point along the link, whether it was introduced on a straight road section, because of height changes. If Y then this shape point exists only in the ADAS link gemoetry, but not in the standard road geometry."
Regarding this, how can a sample output like this:
"shape": "49.00027 12.12437 49.00024 12.12431 49.00002 12.12399",
"attributes": {
"ADAS_ATTRIB_FCN": [
{
"SLOPES": "[-86, 157, 60, -1]",
"CURVATURES": "[-3051, -1015]",
"HPZ": "[38522, 0, 3, 1]",
"VERTICAL_FLAGS": "[1, 0]"
}
]
},
be interpreted?
Each link(road) is represented as a polyline between two nodes in Here map data. This polyline contains one or more shapepoints which represent the shape of the link. Data is represented as different layers in the map (for ease of storage). The road topology layer data contains basic map data like links and nodes information(along with shape points). Shape points are points on a link which are introduced whenever there is a change in road goemetry, etc. In addition to the shape points present in road topology layer, ADAS layer might have introduced some more shape points in the same link for representing ADAS information(eg: road height change, curvature etc). VERTICAL_FLAGS represents whether the shape points found for a link in ADAS attribute is also present in topology segment or not.
You can read about the entire list of ADAS Attributes available here https://tcs.ext.here.com/pde/layer?region=WEU&release=18150&url_root=pde.api.here.com&layer=ADAS_ATTRIB_FC1 (login with Here credentials). Hope this helps!

How to measure geometry efficiently in Google Map

I would like to add color to each house in the following google map example:
https://www.google.com/maps/#43.0748326,141.3479359,19z?hl=en
I found an example in leaflet that add colors to US states by giving the GeoJson data including the corners coordinates of each state. You can find the example here:
http://leafletjs.com/examples/choropleth.html
I would like to do it with Google Map. Two questions in front of me are:
1. How can I get the corner coordinates of houses?
2. As the number of houses which I want to add color is relatively large, how can I efficiently measure the corner coordinates of these houses?
How can I get the corner coordinates of houses?
You can't. The data in Google Maps API is not available to you, because of technical and legal restrictions.
You'll likely want to do this some other way: for instance, with OpenStreetMap data and one of the many services that visualizes it.

Grid based Clustering

I am trying to do a grid based clustering, specifically where each U.S. state is a grid. What I am doing now is just setting strategy option of ClusterProvider to STRATEGY_GRID_BASED, but I don't think this is what I think it is.
I tried looking into nokia.maps.clustering.IGridOptions, but there isn't anything documentation on that.
Can someone point me in the right direction? Thanks.
A Grid-based clustering strategy just breaks the map up into squares and calculates how many markers are found in each square. What you are after is known as a Chloropleth Map. The most efficient way to do this would be to cluster server-side, return a key,value pair (i.e. state, number of markers) and just display polygons for the US States. An example of such a map can be found in the HERE Maps community examples which displays the accession dates of states to the union.
If you insist on doing everything client side then you'd have to use the following pseudo code instead:
Iterate though each marker in your list:
Check to see if it is within the hit area of an existing polygon.
If it is - increment the markers counter (an additional attribute you have added.)
If it isn't make a WKT State-level shape geocoding request, and parse the result -add a new markers counter attribute to the Polygon
repeat
You will then end up with a series of polygon objects each holding an attribute with the number of markers within found within the state.

Resources