Using spatial types

3D point creation

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

python
from neo4j.spatial import WGS84Point

longitude = 55.296233
latitude = 25.276987
height = 828

point = WGS84Point(
  #select:(longitude, latitude, height)
)
  • ❏ (latitude, longitude, height)

  • ✓ (longitude, latitude, height)

  • ❏ point=(longitude, latitude, height)

  • ❏ WGS84Point.latlng(latitude, longitude, height)

Hint

The WGS84Point constructor takes coordinates in the order: 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 WGS84Point representing the Burj Khalifa in Dubai:

python
point = WGS84Point((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.