Skip to main content

CreatePoint

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

Input and Output

The CreatePoint gem accepts the following input and output.

PortDescription
in0Source dataset containing pairs of columns with longitude and latitude coordinates.
outOutput dataset containing one or more new columns with points in Well-known Text (WKT) geometric format.

Parameters

The CreatePoint gem accepts longitude and latitude columns as parameters.

In the Create Spatial Points section, you need to Click to Add a Point. For each point you add, fill in the following information.

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.

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)