Namespace: profile3d

Mapspace.util. profile3d

This namespace contains definitions of static functions for common Profile3d operations.

Source:
mapspace/util/profile3d/util.jsdoc

Methods


<static> drawPlaneFromCoordsAndHeight(viewer, entities, coords, height, useGrid, color, outline, outlineColor, outlineWidth)

Draws a plane to given Cesium viewer and save created entity in given array.

Parameters:
Name Type Description
viewer Cesium.Viewer

Cesium viewer.

entities Array.<Cesium.Entity>

Array of entities.

coords Array.<Mapspace.Coordinate>

Array of a pair of coordinates in mercator projection and with elevations in meters.

height number

Height of the plane. It must be an integer value in meters.

useGrid boolean

If use a grid material or not.

color Cesium.Color

The color for the plane.

outline boolean

If true then draws the outline of the plane.

outlineColor Cesium.Color

The color for the outline.

outlineWidth number

The width of the outline.

Source:
mapspace/util/profile3d/util.js
Returns:

The created entity.

Type
Cesium.Entity

<static> drawPlaneFromNormalAndPoint(viewer, entities, vNormal, point, width, height, color, outline, outlineColor, outlineWidth)

Creates a plane with a specific color and alpha channel

Parameters:
Name Type Description
viewer Cesium.Viewer

Cesium viewer.

entities Array.<Cesium.Entity>

Array of entities.

vNormal Cesium.Cartesian3

Normal vector to create the plane

point Cesium.Cartesian3

A point in the plane

width number

Width of the plane.

height number

Height of the plane.

color Cesium.Color

The color for the plane.

outline boolean

If true then draws the outline of the plane.

outlineColor Cesium.Color

The color for the outline.

outlineWidth number

The width of the outline.

Source:
mapspace/util/profile3d/util.js
Returns:

The created entity.

Type
Cesium.Entity

<static> drawPoint(viewer, entities, point, size, color, description)

Creates a new entity and adds it to viewer.

Parameters:
Name Type Description
viewer Cesium.Viewer

Cesium viewer.

entities Array.<Cesium.Entity>

Array of entities.

point Cesium.Cartesian3

Point to draw

size number

The size of the point

color Cesium.Color

The color for the point

description String

The text to add to the entity.

Source:
mapspace/util/profile3d/util.js

<static> getClippingPlanesForProfile(profileFeature)

Return the collection of clipping planes that will be used to limit the rendering for the given profile. First plane in the collection is front plane, second is back plane, third is right plane in viewing direction and fourth is left plane.

Parameters:
Name Type Description
profileFeature ol.Feature

The feature that defines the profile.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Cesium.ClippingPlaneCollection

<static> getClippingPlanesForProfileRafa(profileFeature, rootPoint, elevation, cameraSettings)

Return the collection of clipping planes that will be used to limit the rendering for the given profile. First plane in the collection is front plane, second is back plane, third is right plane in viewing direction and fourth is left plane.

Parameters:
Name Type Description
profileFeature ol.Feature

The feature that defines the profile.

rootPoint Cesium.Cartesian3

The root point of the tileset.

elevation number

Elevation.

cameraSettings Object

Object to store camera settings.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Cesium.ClippingPlaneCollection

<static> getFrustumWidthForProfile(profileFeature)

Returns the frustum width required to fit given profile in viewer viewport.

Parameters:
Name Type Description
profileFeature ol.Feature

The feature that defines the profile.

Source:
mapspace/util/profile3d/util.js
Returns:

Width in meters.

Type
number

<static> getMainPointsForProfile(profileFeature, elevation)

Returns a pair of points that are the main points of a profile. First point is the one on the right side of the profile when looking from viewing point; second is on the left side. Elevations are zero meters on ground. Coordinates are in Cesium Cartesian 3D.

Parameters:
Name Type Description
profileFeature ol.Feature

The feature that defines the profile.

elevation number

Elevation.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Array.<Cesium.Cartesian3>

<static> getNewestProjectsName(projects)

Returns the name of newest LiDAR project from an array.

Parameters:
Name Type Description
projects Array.<Mapspace.LiDARProjectMetadata>

LiDAR projects metadata objects.

Source:
mapspace/util/profile3d/util.js
Returns:

Name of newest project or null if passed an empty array.

Type
string

<static> getProfile3dCenter(profileFeature)

Returns the Mercator Spheric coordinate at the center of the box that defines the profile. Return a coordinate with no elevation.

Parameters:
Name Type Description
profileFeature ol.Feature

The profile feature.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Mapspace.Coordinate

<static> getProjectsForProfile3d(profileFeature)

Returns an array of LiDAR projects metadata objects that overlap the given profile feature.

Parameters:
Name Type Description
profileFeature ol.Feature

The profile feature to search proyects for.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Array.<Mapspace.LiDARProjectMetadata>

<static> getViewForProfile(profileFeature, elevation)

Returns the view object required to fit given profile in viewer viewport.

Parameters:
Name Type Description
profileFeature ol.Feature

The feature that defines the profile.

elevation number

Elevation.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
Object

<static> profile3dToString(profile)

Converts a ol.Feature object to string to make it easy to compare them.

Parameters:
Name Type Argument Description
profile ol.Feature <nullable>

Profile or null.

Source:
mapspace/util/profile3d/util.js
Returns:
Type
string

<static> to3DGeometry(geometry, z, viewer)

Returns a new fixed geometry with a given Z value if geometry has no Z, or the same geometry object but with a fixed Z if it has Zs.

Parameters:
Name Type Description
geometry ol.geom.Geometry

The input geometry.

z number

The Z value to use to fix the input geometry.

viewer Mapspace.profile3d.Viewer

Profile3d viewer

Source:
mapspace/util/profile3d/util.js
Returns:

The returned geometry always have Z values.

Type
ol.geom.Geometry