Geomark Web Service REST API

The Geomark application provides the Geomark REST Web Service API to allow client applications to develop custom applications to Construct a newnd access Geomarks on behalf of their users.

Developers should be aware of cross server scripting programming if using JavaScript in a web browser client to access the Geomark REST Web Service API. Developers are recommended to use the Geomark JavaScript API rather than using the REST APIs directly.

The Geomark API supports the Cross-origin resource sharing (CORS) mechanism. This means that cross site requests are supported in modern web browsers that support CORS without any special code.

Previous versions of the Geomark API required the use of the JSONP protocol to get around cross server scripting issues. This is still supported but is no longer required. The jsonp or callback HTTP parameters can be used to specify the jsonp padding. JSONP however will not work for HTTP POST requests, only HTTP GET requests. Consult your JavaScript libraries documentation for description of how to use JSONP in your application.

Geomark

The Geomark REST Web ArcGisRestService API provides client applications with the methods add new geomarks, get geomark info and download the geomark geometry as a single feature, feature per geometry part, point, or bounding box.

Create Geomark

Construct a new new geomark from the geometries read from the 'body' parameter or file. If the multiple parameter is specified then all geometries will be read, otherwise only the first geometry will be used.

If using multiple geometries then all the geometries must have the same geometry type (Point, LineString, Polygon). Unless a buffer is specified.

The geomarks can be buffered as long as the resulting geometry does not have overlaps.

The geometry will be checked to ensure that it intersects the Province of British Columbia and is valid for the current coordinate system.

The geometries must be sent via a POST request in the body of a request or 'body' parameter in a application/x-url-encoded form, multipart/form-data form or query string. The file format of the body parameter can be specified in the 'format' query string parameter, URL file name extension or content-type header.

If the input data does not specify the coordinate system then include the 'srid' parameter.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • POST

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/new

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200If the geomark was created via a web service call.
302If the geomark was created and a redirectUrl was specified then the response will redirect to the redirectUrl with the query string parameters geomarkId and geomarkUrl of the created geomark.
302If the geomark was created and a redirectUrl was NOT specified then the response will redirect to the geomark info resource of the created geomark. If resultFormat was specified then the redirect will be to the geomark info resource for that file format. If the resultFormat was "json" and a callback was specified the callback query string parameter will be added to the URL.
302If there was an error creating the geomark and a failureRedirectUrl was specified then the response will be redirected to the failureRedirectUrl with a <fieldName>_Error query string parameter with the error message. Otherwise one of the 400 status codes below will be returned.
400

Couldn't create geomark.

Possible reasons:

  • No Polygon, Multi-Polygon, or folder(set) of Polygons provided.
  • A point or line was provided without a buffer width.
400

Couldn't create geomark. No <geometryType> , Multi-<geometryType> , or folder(set) of <geometryType> s provided.

Check that the file contains a geometry of the selected type.

400

Buffered multi-geometry has overlap which is not supported

When the buffer was applied the parts of the geometry created an overlap. Pre-buffer the geometry and perform a union on the result before submitting the geometry.

400

Multi-geometry has overlap which is not supported

Check that the parts of the geometry do not overlap. Perform a union before submitting the geometry.

400

Geomark <geometryType> must not have > <maxVertices> vertices

Simplify the geometry to reduce the number of points before submitting the geomark.

400

Geomark must intersect the Province of British Columbia

Check that the geometry intersects the province of British Columbia or that the coordinate system is specified correctly.

400

Multi-<geometryType> has overlap which is not supported.

Check that the parts of the geometry do not overlap. Perform a union before submitting the geometry.

400

Unspported geometryType <geometryType>

Only Point, LineString, or Polygon geometries or geometry collections containing all the same geometries of the same type are supported.Check the input data.

400

Unable to read geometry.

Check the file is valid, see file format for examples of each file format.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Create Geomark Copy

Construct a new new geomark by copying the geometries from one or more existing geomarks from the current server.

The geomarks can be specified by repeating the geomarkUrl parameter for each geomark to be copied. The geomarkUrl can be a URL (e.g. https://apps.gov.bc.ca/pub/geomark/geomarks/gm- abcdefghijklmnopqrstuvwxyz0000bc) or a Geomark ID (e.g. gm- abcdefghijklmnopqrstuvwxyz0000bc). The URL or Geomark ID must be on the current server.

If copying multiple geomarks then all the geomarks must have the same geometry type (Point, LineString, Polygon). Unless a buffer is specified.

The geomarks can be buffered as long as the resulting geometry does not have overlaps.

The geometry will be checked to ensure that it intersects the Province of British Columbia and is valid for the current coordinate system.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • POST

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/copy

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200If the geomark was created via a web service call.
302If the geomark was created and a redirectUrl was specified then the response will redirect to the redirectUrl with the query string parameters geomarkId and geomarkUrl of the created geomark.
302If the geomark was created and a redirectUrl was NOT specified then the response will redirect to the geomark info resource of the created geomark. If resultFormat was specified then the redirect will be to the geomark info resource for that file format. If the resultFormat was "json" and a callback was specified the callback query string parameter will be added to the URL.
302If there was an error creating the geomark and a failureRedirectUrl was specified then the response will be redirected to the failureRedirectUrl with a <fieldName>_Error query string parameter with the error message. Otherwise one of the 400 status codes below will be returned.
400

Couldn't create geomark.

Possible reasons:

  • No Polygon, Multi-Polygon, or folder(set) of Polygons provided.
  • A point or line was provided without a buffer width.
400

Couldn't create geomark. No <geometryType> , Multi-<geometryType>, or folder(set) of <geometryType>s provided.

Check that the file contains a geometry of the selected type.

400

Buffered multi-geometry has overlap which is not supported

When the buffer was applied the parts of the geometry created an overlap. Pre-buffer the geometry and perform a union on the result before submitting the geometry.

400

Multi-geometry has overlap which is not supported

Check that the parts of the geometry do not overlap. Perform a union before submitting the geometry.

400

Geomark <geometryType> must not have > <maxVertices> vertices

Simplify the geometry to reduce the number of points before submitting the geomark.

400

Geomark must intersect the Province of British Columbia

Check that the geometry intersects the province of British Columbia or that the coordinate system is specified correctly.

400

Multi-<geometryType> has overlap which is not supported.

Check that the parts of the geometry do not overlap. Perform a union before submitting the geometry.

400

A buffer must be specified for geometryType=Any

Change the geometry type or specify the bufferMetres parameter.

400

The parameter bufferMetres must be a valid number

400

The parameter bufferMitreLimit must be null or > 0

400

The parameter bufferSegments must be null or > 0

400

The parameter bufferMitreLimit must be a valid number

400

The parameter bufferSegments must be a valid number

400

The Add button must be pressed to add the geomark to the list of geomark urls

This occurs on the Create From Geomarks form if the user enters a URL but forgets to click the add button. This should not occur on API calls.

400

Geomark not found: <geomarkUrl>

Check that the geomark ID or URL does not have any additional characters and that you can access the geomark info resource. The geomark may have expired and been deleted.

400

Only geomarks from the current server are supported: <geomarkUrl>

If the geomark is from a different server save a copy of that geomark to a file and create using the create geomark resource.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Get Geomark Bounding Box

The geomark bounding box resource returns a single spatial feature with a single Polygon geometry that is the minimum bounding box of the Geomark's geometry and the geomark attribution.

The geometry and attribution can be downloaded as a spatial download file format in a supported coordinate system. The download files can then be used in a desktop GIS application (e.g. ArcMap), Google Earth or a web mapping application.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • GET

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/gm-{geomarkId}/boundingBox.{fileFormatExtension}

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkId}StringThe unique identifier for the geomark (e.g. gm-abcdefghijklmnopqrstuv0bcislands).
{fileFormatExtension}StringThe file format name extension used to represent the geomark download.

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200

The geomark will be returned in the body of the HTTP response encoded in the requested file format.

400

Coordinate system with srid = <srid> is not supported.

Check the list of supported coordinate systems.

404

The geomark <geomarkId> could not be found.

Check for extra characters on the end of the URL. The geomark may have expired and been deleted.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Get Geomark Feature

The geomark feature resource returns a single spatial feature with either a single (Point, LineString, Polygon) or multi-part geometry (MultiPoint, MultiLineString, MultiPolygon) and the geomark attribution.

The geometry and attribution can be downloaded as a spatial download file format in a supported coordinate system. The download files can then be used in a desktop GIS application (e.g. ArcMap), Google Earth or a web mapping application.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • GET

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/gm-{geomarkId}/feature.{fileFormatExtension}

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkId}StringThe unique identifier for the geomark (e.g. gm-abcdefghijklmnopqrstuv0bcislands).
{fileFormatExtension}StringThe file format name extension used to represent the geomark download.

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200

The geomark will be returned in the body of the HTTP response encoded in the requested file format.

400

Coordinate system with srid = <srid> is not supported.

Check the list of supported coordinate systems.

404

The geomark <geomarkId> could not be found.

Check for extra characters on the end of the URL. The geomark may have expired and been deleted.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Get Geomark Info

The geomark info resource returns a single record with the geomark attribution.

The attribution can be downloaded as a info file format. The download files can then be processed by a client application to access the geomark info fields and to get the URLs to the geometry download resources.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • GET
  • POST

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/gm-{geomarkId}.{fileFormatExtension}

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkId}StringThe unique identifier for the geomark (e.g. gm-abcdefghijklmnopqrstuv0bcislands).

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200

The geomark will be returned in the body of the HTTP response encoded in the requested file format.

404

The geomark <geomarkId> could not be found.

Check for extra characters on the end of the URL. The geomark may have expired and been deleted.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Get Geomark Parts

The geomark parts resource returns a one or more spatial features. One for each part of the Geomark's geomerty. Each part contains a single (Point, LineString, Polygon) geometry and the geomark attribution.

The geometry and attribution can be downloaded as a spatial download file format in a supported coordinate system. The download files can then be used in a desktop GIS application (e.g. ArcMap), Google Earth or a web mapping application.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • GET

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/gm-{geomarkId}/parts.{fileFormatExtension}

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkId}StringThe unique identifier for the geomark (e.g. gm-abcdefghijklmnopqrstuv0bcislands).
{fileFormatExtension}StringThe file format name extension used to represent the geomark download.

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200

The geomark will be returned in the body of the HTTP response encoded in the requested file format.

400

Coordinate system with srid = <srid> is not supported.

Check the list of supported coordinate systems.

404

The geomark <geomarkId> could not be found.

Check for extra characters on the end of the URL. The geomark may have expired and been deleted.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Get Geomark Point

The geomark point resource returns a single spatial feature with a single Point and the geomark attribution.

The point geometry will be created from the first geometry part of the Geomark.

  • Point geomarks will return the first Point part in the geomark.
  • LineString geomarks will return the first coordinate of the first LineString part in the geomark.
  • Polygon geomarks will return the centroid or another point inside the first Polygon part in the geomark.

The geometry and attribution can be downloaded as a spatial download file format in a supported coordinate system. The download files can then be used in a desktop GIS application (e.g. ArcMap), Google Earth or a web mapping application.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • GET

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarks/gm-{geomarkId}/point.{fileFormatExtension}

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkId}StringThe unique identifier for the geomark (e.g. gm-abcdefghijklmnopqrstuv0bcislands).
{fileFormatExtension}StringThe file format name extension used to represent the geomark download.

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
200

The geomark will be returned in the body of the HTTP response encoded in the requested file format.

400

Coordinate system with srid = <srid> is not supported.

Check the list of supported coordinate systems.

404

The geomark <geomarkId> could not be found.

Check for extra characters on the end of the URL. The geomark may have expired and been deleted.

500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Geomark Group

The Geomark Group REST Web ArcGisRestService API provides methods to add or delete geomarks from a geomark group.

Add Geomark To Group

Add the list of geomarks to the geomark group.

The geomarks can be specified by repeating the geomarkId parameter for each geomark to be added to the group. The geomarkId can be a geomark identifier (e.g. gm- abcdefghijklmnopqrstuvwxyz0000bc) or a geomark URL (e.g. https://apps.gov.bc.ca/pub/geomark/geomarks/gm- abcdefghijklmnopqrstuvwxyz0000bc) or. The URL or geomark identifier must be on the current server.

Each request must include a signature generated using the geomark group secret key.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • POST

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarkGroups/{geomarkGroupId}/geomarks/add

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkGroupId}StringThe geomark group identifier (e.g. gg-abcdefghijklmnopqrstuvwxyz012345).

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.

Delete Geomark From Group

Delete the list of geomarks from the geomark group.

The geomarks can be specified by repeating the geomarkId parameter for each geomark to be deleted from the group. The geomarkId can be a geomark identifier (e.g. gm- abcdefghijklmnopqrstuvwxyz0000bc) or a geomark URL (e.g. https://apps.gov.bc.ca/pub/geomark/geomarks/gm- abcdefghijklmnopqrstuvwxyz0000bc) or. The URL or geomark identifier must be on the current server.

Each request must include a signature generated using the geomark group secret key.

HTTP Request Methods

The resource can be accessed using the following HTTP request methods.

  • POST

URI Templates

The URI templates define the paths that can be appended to the base URL of the service to access this resource.

/geomarkGroups/{geomarkGroupId}/geomarks/delete

URI Template Parameters

The URI templates support the following parameters which must be replaced with values as described below.

ParameterTypeDescription
{geomarkGroupId}StringThe geomark group identifier (e.g. gg-abcdefghijklmnopqrstuvwxyz012345).

Parameters

The resource supports the following parameters. For HTTP get requests these must be specified using query string parameters. For HTTP POST requests these can be specified using query string, application/x-www-form-urlencoded parameters or multipart/form-data unless otherwise specified. Array values [] can be specified by including the parameter multiple times in the request.

ParameterTypeDefaultRequiredDescription

HTTP Status Codes

The resource will return one of the following status codes. The HTML error page may include an error message. The descriptions of the messages and the cause are described below.

HTTP Status CodeDescription
500

Internal Server Error

This error indicates that there was an unexpected error on the server. This is sometimes temporary so try again after a few minutes. The problem could also be caused by bad input data so verify all input parameters and files. If the problem persists contact the support desk with exact details of the parameters you were using.