2020import neo4j from '../../src/v1' ;
2121import sharedNeo4j from '../internal/shared-neo4j' ;
2222import { ServerVersion , VERSION_3_4_0 } from '../../src/v1/internal/server-version' ;
23- import { isPoint2D , isPoint3D , Point2D , Point3D } from '../../src/v1/spatial-types' ;
23+ import { isPoint , Point } from '../../src/v1/spatial-types' ;
2424
2525const WGS_84_2D_CRS_CODE = neo4j . int ( 4326 ) ;
2626const CARTESIAN_2D_CRS_CODE = neo4j . int ( 7203 ) ;
@@ -67,25 +67,27 @@ describe('spatial-types', () => {
6767
6868 it ( 'should receive 2D points' , done => {
6969 testReceivingOfPoints ( done , 'RETURN point({x: 169.99, y: 12.1718})' , point => {
70- expect ( isPoint2D ( point ) ) . toBeTruthy ( ) ;
70+ expect ( isPoint ( point ) ) . toBeTruthy ( ) ;
7171 expect ( point . srid ) . toEqual ( CARTESIAN_2D_CRS_CODE ) ;
7272 expect ( point . x ) . toEqual ( 169.99 ) ;
7373 expect ( point . y ) . toEqual ( 12.1718 ) ;
74+ expect ( point . z ) . toBeUndefined ( ) ;
7475 } ) ;
7576 } ) ;
7677
7778 it ( 'should receive 2D points with crs' , done => {
7879 testReceivingOfPoints ( done , `RETURN point({x: 2.3, y: 4.5, crs: 'WGS-84'})` , point => {
79- expect ( isPoint2D ( point ) ) . toBeTruthy ( ) ;
80+ expect ( isPoint ( point ) ) . toBeTruthy ( ) ;
8081 expect ( point . srid ) . toEqual ( WGS_84_2D_CRS_CODE ) ;
8182 expect ( point . x ) . toEqual ( 2.3 ) ;
8283 expect ( point . y ) . toEqual ( 4.5 ) ;
84+ expect ( point . z ) . toBeUndefined ( ) ;
8385 } ) ;
8486 } ) ;
8587
8688 it ( 'should receive 3D points' , done => {
8789 testReceivingOfPoints ( done , 'RETURN point({x: -19.9, y: 45.99, z: 8.88})' , point => {
88- expect ( isPoint3D ( point ) ) . toBeTruthy ( ) ;
90+ expect ( isPoint ( point ) ) . toBeTruthy ( ) ;
8991 expect ( point . srid ) . toEqual ( CARTESIAN_3D_CRS_CODE ) ;
9092 expect ( point . x ) . toEqual ( - 19.9 ) ;
9193 expect ( point . y ) . toEqual ( 45.99 ) ;
@@ -95,7 +97,7 @@ describe('spatial-types', () => {
9597
9698 it ( 'should receive 3D points with crs' , done => {
9799 testReceivingOfPoints ( done , `RETURN point({x: 34.76, y: 11.9, z: -99.01, crs: 'WGS-84-3D'})` , point => {
98- expect ( isPoint3D ( point ) ) . toBeTruthy ( ) ;
100+ expect ( isPoint ( point ) ) . toBeTruthy ( ) ;
99101 expect ( point . srid ) . toEqual ( WGS_84_3D_CRS_CODE ) ;
100102 expect ( point . x ) . toEqual ( 34.76 ) ;
101103 expect ( point . y ) . toEqual ( 11.9 ) ;
@@ -104,33 +106,33 @@ describe('spatial-types', () => {
104106 } ) ;
105107
106108 it ( 'should send and receive 2D point' , done => {
107- testSendingAndReceivingOfPoints ( done , new Point2D ( CARTESIAN_2D_CRS_CODE , 19.101 , - 88.21 ) ) ;
109+ testSendingAndReceivingOfPoints ( done , new Point ( CARTESIAN_2D_CRS_CODE , 19.101 , - 88.21 ) ) ;
108110 } ) ;
109111
110112 it ( 'should send and receive 3D point' , done => {
111- testSendingAndReceivingOfPoints ( done , new Point3D ( WGS_84_3D_CRS_CODE , 1.22 , 9.8 , - 6.65 ) ) ;
113+ testSendingAndReceivingOfPoints ( done , new Point ( WGS_84_3D_CRS_CODE , 1.22 , 9.8 , - 6.65 ) ) ;
112114 } ) ;
113115
114116 it ( 'should send and receive array of 2D points' , done => {
115117 const arrayOfPoints = [
116- new Point2D ( WGS_84_2D_CRS_CODE , 12.3 , 11.2 ) ,
117- new Point2D ( WGS_84_2D_CRS_CODE , 2.45 , 91.302 ) ,
118- new Point2D ( WGS_84_2D_CRS_CODE , 0.12 , - 99.9 ) ,
119- new Point2D ( WGS_84_2D_CRS_CODE , 93.75 , 123.213 ) ,
120- new Point2D ( WGS_84_2D_CRS_CODE , 111.13 , - 90.1 ) ,
121- new Point2D ( WGS_84_2D_CRS_CODE , 43.99 , - 1 )
118+ new Point ( WGS_84_2D_CRS_CODE , 12.3 , 11.2 ) ,
119+ new Point ( WGS_84_2D_CRS_CODE , 2.45 , 91.302 ) ,
120+ new Point ( WGS_84_2D_CRS_CODE , 0.12 , - 99.9 ) ,
121+ new Point ( WGS_84_2D_CRS_CODE , 93.75 , 123.213 ) ,
122+ new Point ( WGS_84_2D_CRS_CODE , 111.13 , - 90.1 ) ,
123+ new Point ( WGS_84_2D_CRS_CODE , 43.99 , - 1 )
122124 ] ;
123125
124126 testSendingAndReceivingOfPoints ( done , arrayOfPoints ) ;
125127 } ) ;
126128
127129 it ( 'should send and receive array of 3D points' , done => {
128130 const arrayOfPoints = [
129- new Point3D ( CARTESIAN_3D_CRS_CODE , 83.38 , 123.9 , - 19 ) ,
130- new Point3D ( CARTESIAN_3D_CRS_CODE , 31 , 39.1 , - 19.19 ) ,
131- new Point3D ( CARTESIAN_3D_CRS_CODE , 0.845 , - 0.74 , 3.48 ) ,
132- new Point3D ( CARTESIAN_3D_CRS_CODE , 123.33 , 93.3 , 96.96 ) ,
133- new Point3D ( CARTESIAN_3D_CRS_CODE , - 54.9 , 13.7893 , - 90.9 )
131+ new Point ( CARTESIAN_3D_CRS_CODE , 83.38 , 123.9 , - 19 ) ,
132+ new Point ( CARTESIAN_3D_CRS_CODE , 31 , 39.1 , - 19.19 ) ,
133+ new Point ( CARTESIAN_3D_CRS_CODE , 0.845 , - 0.74 , 3.48 ) ,
134+ new Point ( CARTESIAN_3D_CRS_CODE , 123.33 , 93.3 , 96.96 ) ,
135+ new Point ( CARTESIAN_3D_CRS_CODE , - 54.9 , 13.7893 , - 90.9 )
134136 ] ;
135137
136138 testSendingAndReceivingOfPoints ( done , arrayOfPoints ) ;
0 commit comments