Skip to main content

CreatePoint

Use the CreatePoint gem to convert longitude and latitude coordinates into geographic points.

Parameters

Each longitude and latitude column pair produces one target column. You can provide more than one longitude and latitude pairing to produce multiple target columns if necessary.

ParameterDescription
Longitude Column NameInput column that contains longitude values.
Latitude Column NameInput column that contains latitude values.
Target Column NameColumn in the gem output that will contain resulting geo points.
info

The target column(s) will contain points in Well-known text (WKT) geometric format.

Example

Assume you have the following airline route table.

start_citystart_latstart_longdestination_citydestination_latdestination_long
New York40.7128-74.0060Los Angeles34.0522-118.2437
London51.5074-0.1278Paris48.85662.3522
Tokyo35.6895139.6917Sydney-33.8688151.2093
Toronto43.6511-79.3470Chicago41.8781-87.6298
Dubai25.276055.2962Mumbai19.076072.8777

To convert the start and destination coordinates into geographic points:

  1. Create the first column pairing:

    1. Click Add a Point.

    2. For Longitude Column Name, select the start_long column.

    3. For Latitude Column Name, select the start_lat column.

    4. For the Target Column Name, type source_point.

  2. Create another column pairing:

    1. Click Add a Point.

    2. For Longitude Column Name, select the destination_long column.

    3. For Latitude Column Name, select the destination_lat column.

    4. For the Target Column Name, type dest_point.

Result

The CreatePoint gem will produce the following output with two new columns: source_point and dest_point.

start_citystart_latstart_longdestination_citydestination_latdestination_longsource_pointdest_point
New York40.7128-74.0060Los Angeles34.0522-118.2437POINT (-74.0060 40.7128)POINT (-118.2437 34.0522)
London51.5074-0.1278Paris48.85662.3522POINT (-0.1278 51.5074)POINT (2.3522 48.8566)
Tokyo35.6895139.6917Sydney-33.8688151.2093POINT (139.6917 35.6895)POINT (151.2093 -33.8688)
Toronto43.6511-79.3470Chicago41.8781-87.6298POINT (-79.3470 43.6511)POINT (-87.6298 41.8781)
Dubai25.276055.2962Mumbai19.076072.8777POINT (55.2962 25.2760)POINT (72.8777 19.0760)