How to upload a new layer in HERE Geofencing API v8
The user can upload a layer containing one geometry type - polygons, polylines, or points. Use the below sample request to upload a polygon via Geofencing API.
Upload a layer with a polygon
curl -X POST
-H "Content-Type: multipart/form-data"
-F "zipfile=@C:\temp\layer_4711_shapes.zip"
'https://geofencing.hereapi.com/v8/geofence/upload?layerId=a4GhqqfHX8T8EbqhbLTL..MyTestLayer&apikey={YOUR_API_KEY}'Response
The response contains the number of objects stored (called storedTilesCount), and the response code.
{
"storedTilesCount": 1,
"response_code": "201 Created"
}The sample well-known text (WKT) file that can be used for the upload request.
ID NAME ABBR WKT
1 Frankfurt2 FRAN "POLYGON ((8.670293702971577 50.09986623625284, 8.671916888624878 50.1004752458006, 8.672936128050537 50.099656287980345, 8.672174380690308 50.09903001667139, 8.67176132496428 50.09920865749298, 8.671764007173294 50.09920779722777, 8.670293702971577 50.09986623625284))"Upload a layer with points
curl -X POST
-H "Content-Type: multipart/form-data"
-F "zipfile=@C:\temp\layer_4711_shapes.zip"
'https://geofencing.hereapi.com/v8/geofence/upload?layerId=a4GhqqfHX8T8EbqhbLTL..MYPOILayer&apikey={YOUR_API_KEY}'Response
The response contains the number of objects stored (called storedTilesCount), and the response code.
{
"storedTilesCount": 5,
"response_code": "201 Created"
}The sample WKT file that can be used for the upload request.
poi_id link_id side_of_street names chain_id cat_id diesel biodiesel lpg cng open_24_hours secure_parking truck_service truck_wash showers hgv_pumps convenience_store power_supply chemical_toilet_disposal restaurant snack_bar parking MATCH_LEVEL WKT
1 77552445 L ENGBNNEW ENERGY Station NULL 9720 y y y y y y y y y y y y y y y y houseNumber POINT(13.57083 41.67976)
2 556223987 N ENGBNFABIANO ENERGIA Station NULL 9720 y y y y y y y y y y y y y y y y street POINT(14.49321 40.92409)
3 757978877 L ENGBNKFZ-Service & Abschleppdienst NULL 9720 y y y y y y y y y y y y y y y y houseNumber POINT(12.67418 50.74473)
4 761530474 R ENGBNKFZ-Service & Abschleppdienst NULL 9720 y y y y y y y y y y y y y y y y houseNumber POINT(12.48815 50.74359)
5 1299913056 R ENGBNMOYA Station NULL 9720 y y y y y y y y y y y y y y y y houseNumber POINT(21.79279 51.74445)Updated 7 days ago