Using spatial types

3D point creation

Complete the following code to create a 3D point to represent the Burj Khalifa in Dubai.

Java
Double longitude = 55.296233;
Double latitude = 25.276987;
Double height = 828.0;

var location3d = Values.point(
    4979,
    /*select:longitude, latitude, height*/
);
  • ❏ longitude, latitude

  • ✓ longitude, latitude, height

  • ❏ Values.coords(longitude, latitude, height)

  • ❏ WGS84Point(latitude, longitude, height)

Hint

The Values.point constructor takes coordinates in the order: srid, longitude, latitude, height. The height parameter is optional but makes it a 3D point.

Solution

The correct answer is longitude, latitude, height.

The following code creates a 3d Point representing the Burj Khalifa in Dubai:

Java
Double longitude = 55.296233;
Double latitude = 25.276987;
Double height = 828.0;

var location3d = Values.point(
    4979,
    longitude, latitude, height
);

The coordinates must be provided in the order longitude, latitude, height. Including the height value creates a 3D point with an SRID of 4979.

Lesson Summary

In this lesson, you enforced your understanding of spatial types in Neo4j.

In the next module, you will learn all you need to know to put your application into production.