@@ -150,6 +150,63 @@ TEST testPDALClonePointView(void)
150150 PASS();
151151}
152152
153+ TEST testPDALGetPointViewProj4(void)
154+ {
155+ PDALResetPointViewCollection(gPointViewCollection);
156+ bool hasNext = PDALHasNextPointView(gPointViewCollection);
157+ ASSERT_FALSE(!hasNext);
158+
159+ PDALPointViewPtr view = PDALGetNextPointView(gPointViewCollection);
160+ ASSERT_FALSE(view == NULL);
161+
162+ char proj[1024];
163+ size_t size = PDALGetPointViewProj4(NULL, proj, 1024);
164+ ASSERT_FALSE(size > 0);
165+ ASSERT_FALSE(proj[0] != '\0');
166+
167+ size = PDALGetPointViewProj4(view, NULL, 1024);
168+ ASSERT_FALSE(size > 0);
169+
170+ size = PDALGetPointViewProj4(view, proj, 0);
171+ ASSERT_FALSE(size > 0);
172+
173+ // TODO Enable when test incorporates a pipeline with projection info
174+ // size = PDALGetPointViewProj4(view, proj, 1024);
175+ // ASSERT_FALSE(size == 0 || size > 1024);
176+ // ASSERT_FALSE(proj[0] == '\0');
177+ // printf("\n%s\n", proj);
178+
179+ PASS();
180+ }
181+
182+ TEST testPDALGetPointViewWkt(void)
183+ {
184+ PDALResetPointViewCollection(gPointViewCollection);
185+ bool hasNext = PDALHasNextPointView(gPointViewCollection);
186+ ASSERT_FALSE(!hasNext);
187+
188+ PDALPointViewPtr view = PDALGetNextPointView(gPointViewCollection);
189+ ASSERT_FALSE(view == NULL);
190+
191+ char wkt[1024];
192+ size_t size = PDALGetPointViewWkt(NULL, wkt, 1024, false);
193+ ASSERT_FALSE(size > 0);
194+ ASSERT_FALSE(wkt[0] != '\0');
195+
196+ size = PDALGetPointViewWkt(view, NULL, 1024, false);
197+ ASSERT_FALSE(size > 0);
198+
199+ size = PDALGetPointViewWkt(view, wkt, 0, false);
200+ ASSERT_FALSE(size > 0);
201+
202+ // TODO Enable when test incorporates a pipeline with projection info
203+ // size = PDALGetPointViewWkt(view, wkt, 1024, false);
204+ // ASSERT_FALSE(size == 0 || size > 1024);
205+ // ASSERT_FALSE(wkt[0] == '\0');
206+ // printf("\n%s\n", wkt);
207+
208+ PASS();
209+ }
153210
154211GREATEST_SUITE(PointViewTest)
155212{
@@ -160,6 +217,8 @@ GREATEST_SUITE(PointViewTest)
160217 RUN_TEST(testPDALGetPointViewSize);
161218 RUN_TEST(testPDALIsPointViewEmpty);
162219 RUN_TEST(testPDALClonePointView);
220+ RUN_TEST(testPDALGetPointViewProj4);
221+ RUN_TEST(testPDALGetPointViewWkt);
163222
164223 SET_SETUP(NULL, NULL);
165224 SET_TEARDOWN(NULL, NULL);
0 commit comments