Import Geometries in a WKT or Shape File
Import polygons, polylines or points in WKT (Wellknown Text) or Shapefile format geometries using an HTTP POST request, or import WKT geometries using HTTP GET. A layer can contain only one geometry type - polygons, polylines or points, but not a mix of different types. After the response there is a delay of several seconds to compile, store and make the geometries available in the service.
You can also use the dashboard to upload and manage your geometries: Custom Locations Dashboard (PRD).
Resource methods and URI
GET/POST/2/layers/upload.json
Query Parameters
Parameters | Required? | Description |
---|---|---|
file | For GET request | For GET requests: URL-encoded WKT file content as parameter value. For POST requests: Instead of this parameter, a multipart/form-data body is sent. The filename of the multipart entity is arbitrary. The file can be a plain or zipped WKT text file ending with .wkt, or a zipped archive containing a .shp, .shx and .dbf file (optionally .prj or .cpg files). A WKT file consists of TAB separated elements. The first line contains the column names, the last column must be "wkt". The subsequent lines contain the content, the attributes and the geometry. Both Shapefiles and WKT files must use unprojected WGS84. To create an index on a set of columns for faster all.json responses, append ;* to these column names. |
apiKey | Yes | A 43-byte Base64 URL-safe encoded string used for the authentication of the client application. As a logged in user, you can generate it at https://developer.here.com/projects. API Keys never expire but you can invalidate your API Keys at any time. You cannot have more than two API Keys for one app at the same time. You must include an |
app_id | Yes | A URL-safe encoded string obtained during the application registration. If you use the app ID/app code option as an authentication method, for further details see the Identity & Access Management Developer Guide. |
app_code | Yes | A URL-safe encoded string obtained during the application registration. If you use the app ID/app code option as an authentication method, for further details see the Identity & Access Management Developer Guide. |
layer_id | Yes | Layer the geometries are imported to. |
level | No | Specify tile size for the database for performance optimization |
storage | No | Either updatable or read-only . Default = updatable . If entries within a layer shall be modified later on, 'updatable' must be chosen. If the layer will always get replaced by full layer uploads, then read-only can be chosen. For read-only , larger data sets can be uploaded and the performance can be superior. |
wkt_quote | No | Specify the quote character to use. Default = " (double quotes). Specifying NONE disables quotes. |
callback | No | Specifies the function used to wrap the JSON response. |
Example WKT file
ADMIN_PLACE_ID CARTO_ID WKT
20300625 751498000 POLYGON ((1.73514 42.5498, 1.73619 42.55064, 1.73663 42.55115, 1.73682 42.55179, 1.73514 42.5498))
20128886 751882887 MULTIPOLYGON (((4.23844 51.37467, 4.22362 51.37412, 4.21795 51.3739, 4.22218 51.3673, 4.88942 51.42354, 4.89138 51.42328)))
Example WKT file defining an Index
STORE_TYPE;* ADMIN_PLACE_ID CARTO_ID WKT
13 20300625 751498000 POLYGON ((1.73514 42.5498, 1.73619 42.55064, 1.73663 42.55115, 1.73682 42.55179, 1.73514 42.5498))
14 20128886 751882887 MULTIPOLYGON (((4.23844 51.37467, 4.22362 51.37412, 4.21795 51.3739, 4.22218 51.3673, 4.88942 51.42354, 4.89138 51.42328)))