GetSpatialReferenceFromExtent Method

Description

Gets the spatial reference for an extents within a spanned cube in a Coordinate Reference System.

Syntax

Visual Basic
Public Function GetSpatialReferenceFromExtent( _
   ByVal x1 As Double, _
   ByVal y1 As Double, _
   ByVal z1 As Double, _
   ByVal x2 As Double, _
   ByVal y2 As Double, _
   ByVal z2 As Double, _
   ByVal projection As String, _
   ByVal span As Double _
) As String

Parameters

x1
The first x coordinate of the cuboid extent to be queried.
 
y1
The first y coordinate of the cuboid extent to be queried.
 
z1
The first z coordinate of the cuboid extent to be queried.
 
x2
The second x coordinate of the cuboid extent to be queried.
 
y2
The second y coordinate of the cuboid extent to be queried.
 
z2
The second z coordinate of the cuboid extent to be queried.
 
projection
The named Coordinate Reference System used in the calculation of the spatial reference. This can be defined as:
  • OGC URNs (eg 'urn:ogc:def:crs:OGC:1.3:CRS84')
  • EPSG URNs (eg 'urn:ogc:def:crs:EPSG::27700')
  • EPSG code strings (eg 'EPSG:27700')
  • EPSG URLs (eg 'http://www.example.com/epsg#27700' or 'http://www.example.com/epsg.xml#27700')
  • EPSG codes as a simple string (eg '27700')
If blank, this will default to the current 'axes' CRS.
 
span
The span of the cube used in the calculation of the spatial reference.

Return Type

A 16 character string which encodes a spatial reference.

Remarks

The spatial reference string encodes a position and a radius which together describe an extent’s circle.

The span used when calculating a spatial reference must be big enough to cover all of the possible coordinates. A smaller span will give spatial references with a finer resolution. The spatial reference does not affect the accuracy or resolution of the positions of the Item it is associated with, only the accuracy of whether or not the Item is loaded in a particular view.

The worst that can happen with a coarse resolution is that extra items are loaded.

Available: GEO OD SISpy

Groups:

Example

SpatRef = sis.GetSpatialReferenceFromExtent (540000, 230000, 0, 540123, 230234, 0, "*APrjNatGrid", 2000000)

Returns the spatial reference an item whose extents are as shown above (see also GetExtent) based on the National Grid coordinate reference system, within a 2 000 000m cube.