GEOGRAPHY

Extends:

lib/data-types.js~ABSTRACT → GEOGRAPHY

A geography datatype represents two dimensional spacial objects in an elliptic coord system.

The difference from geometry and geography type:

PostGIS 1.5 introduced a new spatial type called geography, which uses geodetic measurement instead of Cartesian measurement. Coordinate points in the geography type are always represented in WGS 84 lon lat degrees (SRID 4326), but measurement functions and relationships ST_Distance, ST_DWithin, ST_Length, and ST_Area always return answers in meters or assume inputs in meters.

What is best to use? It depends:

When choosing between the geometry and geography type for data storage, you should consider what you’ll be using it for. If all you do are simple measurements and relationship checks on your data, and your data covers a fairly large area, then most likely you’ll be better off storing your data using the new geography type. Although the new geography data type can cover the globe, the geometry type is far from obsolete. The geometry type has a much richer set of functions than geography, relationship checks are generally faster, and it has wider support currently across desktop and web-mapping tools

Example:

Defining a Geography type attribute
DataTypes.GEOGRAPHY
DataTypes.GEOGRAPHY('POINT')
DataTypes.GEOGRAPHY('POINT', 4326)

Constructor Summary

Public Constructor
public

constructor(type: string, srid: string)

Public Constructors

public constructor(type: string, srid: string) source

Params:

Name Type Attribute Description
type string
  • optional

Type of geography data

srid string
  • optional

SRID of type

Copyright © 2014–present Sequelize contributors
Licensed under the MIT License.
https://sequelize.org/v5/class/lib/data-types.js~GEOGRAPHY.html