Convert Map View

Description

Converts from one map view to another type of map view at a specified location to zoom and center for a bounding box, to a bounding box for a specified zoom and center, or to a bounding box for a specified scale and center.

ACL Authorization Flow

No ACL permission is required.

HTTP GET URL Format

The following format is used for HTTP GET requests using the /zoomAndCenter.json endpoint, which returns a zoom and center given a bounding box:

HTTP GET /zoomAndCenter.rep?b=x1,y1,x2,y2,srs&w=width&h=height/
The following format is used for HTTP GET requests using the /bbox.json endpoint, which returns a bounding box given a center and zoom or a center and scale:
HTTP GET /bbox.rep?w=width&h=height&c=x,y,srs&z=zoom/
or
HTTP GET /bbox.rep?w=width&h=height&c=x,y,srs&s=scale/

Parameters

For information on the parameter types listed below, see Request URL Data Types.

Parameter Type Required Description
rep String yes The representation to be returned. Supported representation is JSON.
w=width Integer yes Width of the image in pixels
h=height Integer yes Height of the image in pixels
b=x1, y1, x2, y2, srs Double, Double, Double, Double, String y The bounding box that defines the entire view in real world coordinates using opposing x, y corner positions and the srs name (spatial reference system).
c=x, y, srs Double, Double, String yes The center of the view in geographic coordinates consisting of a x, y position and the srs name (spatial reference system).
z=zoom Integer, String yes The zoom, or distance across the view in linear units. The zoom is represented by a string with a number followed by one or more spaces followed by a linear unit abbreviation (for example, mi, km, m).
s=scale Integer yes The map view will be zoomed to the specified scale. The scale value is used to compare map and real world distance values. For example, if a value of 1000 is specified, the map scale is 1:1000 (1 map unit is equal to 1000 real world units).

Returns

Returns a JSON object in the specified format.

Examples

Example 1

Transform the bounding box -40,-40,50,50 in popular visualization to a zoom and center that fits into an image 300 by 200:

http://hostname:port/rest/Spatial/MappingService/zoomAndCenter.json?b=-40,-40,50,50,epsg:3857&w=300&h=200

This returns a JSON object with a zoom and center:

{"zoom":{"uom":"METER","value":135.22613065326632},
"center":{
	"type":"Point",
	"coordinates":[5,5],
	"crs":{
		"type":"name",
		"properties":{"name":"epsg:3857"}
		}
	}
} 

Example 2

Transform the zoom and center in popular visualization to a bbox that fits into an image 300 by 200:

http://hostname:port/rest/Spatial/MappingService/bbox.json?w=300&h=200&c=327630.72,613718.44,epsg:3857&z=176000%20m

This returns a bounding box given a zoom and center:

{"bbox":[239630.72,555149.88,415630.72,672287],
"crs":{
	"type":"name",
	"properties":{"name":"epsg:3857"}
	}
}