GeographyPoint.From
ValueCreates a record representing a geographic point from its constituent parts such as longitude, latitude, and optional elevation.
Syntax
GeographyPoint.From(longitude as number, latitude as number, optional z as nullable number, optional m as nullable number, optional srid as nullable number) as recordParameters
| Name | Type | Required | Description |
|---|---|---|---|
longitude | number | Yes | The longitude of the geographic point, in degrees. |
latitude | number | Yes | The latitude of the geographic point, in degrees. |
z | number | No | The elevation (Z coordinate) of the geographic point. Omit if not applicable. |
m | number | No | The measure (M value) associated with the geographic point. Omit if not applicable. |
srid | number | No | The Spatial Reference Identifier (SRID) for the point. Defaults to 4326 (WGS 84) if not specified. |
Return Value
record — A structured record representing a geographic point with the specified coordinates.
Remarks
GeographyPoint.From creates a structured record representing a geographic point from individual coordinate values. This provides a convenient way to construct geographic point values without needing to write WKT strings.
The function uses a round-earth (ellipsoidal) coordinate system. The longitude and latitude parameters specify the point's position on the globe in degrees. Longitude values typically range from -180 to 180, and latitude values from -90 to 90.
The optional z parameter represents elevation, and the optional m parameter represents an arbitrary measure value (often used for linear referencing). The optional srid parameter specifies the Spatial Reference Identifier; if omitted, it defaults to 4326 (WGS 84), which is the standard GPS coordinate system.
The resulting record can be serialized to WKT format using Geography.ToWellKnownText, making it easy to round-trip geographic data between structured records and text representations.
Examples
Example 1: Create a geographic point for Seattle
let
SeattlePoint = GeographyPoint.From(-122.3321, 47.6062)
in
Record.ToTable(SeattlePoint)Example 2: Create geographic points with elevation
let
Points = #table({"City", "Longitude", "Latitude", "Elevation"}, {
{"Denver", -104.9903, 39.7392, 1609},
{"Seattle", -122.3321, 47.6062, 56}
}),
WithGeo = Table.AddColumn(Points, "GeoPoint", each GeographyPoint.From([Longitude], [Latitude], [Elevation]))
in
WithGeoExample 3: Create a point and convert to WKT
let
Point = GeographyPoint.From(-74.006, 40.7128),
WKT = Geography.ToWellKnownText(Point, true)
in
#table({"City", "WKT"}, {{"New York", WKT}})