Table of contents
Official Content

The GeoPoint data type is derived from the Geography data type. This means it has a similar functionality to the Geography data type but is specific to represent the Geometry Point.

Constructor

To initialize an attribute or variable based on the GeoPoint data type, use the New constructor.

Syntax

Att/Variable = GeoPoint.New(Latitude Number, Longitude Number)

Sample

OfficeLocation = GeoPoint.New(-34.8910275746741, -56.18720064473088)

Below is more information to initialize Geopoint data.

Properties

Specific properties that apply to the GeoPoint data type are as follows:

Property Type Description
Srid int Spatial Reference System Identifier (SRID), identifies the reference system for the represented Geographic object. See https://en.wikipedia.org/wiki/SRID.
Longitude int(12,8) Value of the Longitude (horizontal) coordinate for the point.
Latitude int(12.8) Value of the Latitude (vertical) coordinate for the point.

Methods

Specific methods that apply to the GeoPoint data type are as follows:

Method Type Returned Description
    All the methods for Geography apply.
FromWKT(char String) GeoPoint The format of the string parameter should be: 'POINT(LongitudeNumber LatitudeNumber)'
FromString(char String) GeoPoint Analogous to the FromWKT method. In addition to using the FromWKT method (that receives a Wkt format as an input parameter), the FromString method can be applied to a GeoPoint data type (receiving a string based on the Geolocation domain as an input parameter). This is only available for Android.
Sample:
&GeoPointVariable.FromString("-34.92478600243492, -56.163740158081055")
FromGeoJson(char String) GeoPoint The format of the string parameter should be: ''{"type":"Point","coordinates":(LongitudeNumber, LatitudeNumber)]}'
ToGeography(GeoPoint object) Geography Converts the Point to a Geography type (cast).

There is also a static version of these methods.

For detailed information about the Properties and Methods of the data type, refer to Geography data type.

Scope

DBMSs: SQL Server, Oracle, MySQL, SAP Hana, and PostgreSQL.
Generators: .NET, .NET Framework, Java, Android, Apple

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant