PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_geom()

static void test_geom ( void  )
static

Definition at line 154 of file cu_homogenize.c.

155{
156 /* Already simple geometry */
157 do_geom_test("POINT(1 2)",
158 "POINT(1 2)");
159
160 do_geom_test("LINESTRING(1 2,3 4)",
161 "LINESTRING(1 2,3 4)");
162
163 do_geom_test("POLYGON((1 2,3 4,5 6,1 2))",
164 "POLYGON((1 2,3 4,5 6,1 2))");
165
166 do_geom_test("POLYGON((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8))",
167 "POLYGON((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8))");
168
169
170 /* Empty geometry */
171 do_geom_test("GEOMETRYCOLLECTION EMPTY",
172 "GEOMETRYCOLLECTION EMPTY");
173
174
175 /* A MULTI with a single geometry inside */
176 do_geom_test("MULTIPOINT(1 2)",
177 "POINT(1 2)");
178
179 do_geom_test("MULTILINESTRING((1 2,3 4))",
180 "LINESTRING(1 2,3 4)");
181
182 do_geom_test("MULTIPOLYGON(((1 2,3 4,5 6,1 2)))",
183 "POLYGON((1 2,3 4,5 6,1 2))");
184
185 do_geom_test("MULTIPOLYGON(((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8)))",
186 "POLYGON((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8))");
187
188
189 /* A real MULTI */
190 do_geom_test("MULTIPOINT(1 2,3 4)",
191 "MULTIPOINT(1 2,3 4)");
192
193 do_geom_test("MULTILINESTRING((1 2,3 4),(5 6,7 8))",
194 "MULTILINESTRING((1 2,3 4),(5 6,7 8))");
195
196 do_geom_test("MULTIPOLYGON(((1 2,3 4,5 6,1 2)),((7 8,9 10,11 12,7 8)))",
197 "MULTIPOLYGON(((1 2,3 4,5 6,1 2)),((7 8,9 10,11 12,7 8)))");
198
199 do_geom_test("MULTIPOLYGON(((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8)),((13 14,15 16,17 18,13 14)))",
200 "MULTIPOLYGON(((1 2,3 4,5 6,1 2),(7 8,9 10,11 12,7 8)),((13 14,15 16,17 18,13 14)))");
201
202
203 /* A Collection */
204 do_geom_test("GEOMETRYCOLLECTION(POINT(1 2),LINESTRING(3 4,5 6))",
205 "GEOMETRYCOLLECTION(POINT(1 2),LINESTRING(3 4,5 6))");
206
207
208 /* SRID */
209 do_geom_test("SRID=4326;GEOMETRYCOLLECTION EMPTY",
210 "SRID=4326;GEOMETRYCOLLECTION EMPTY");
211
212 /* See http://trac.osgeo.org/postgis/ticket/2129 */
213 do_geom_test("SRID=4326;GEOMETRYCOLLECTION(MULTIPOINT(0 0))",
214 "SRID=4326;POINT(0 0)");
215
216 /* See http://trac.osgeo.org/postgis/ticket/2129 */
217 do_geom_test("SRID=4326;GEOMETRYCOLLECTION(MULTIPOINT(0 0, 1 2))",
218 "SRID=4326;MULTIPOINT(0 0,1 2)");
219
220 /* See http://trac.osgeo.org/postgis/ticket/2129 */
221 do_geom_test("SRID=4326;GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 0))",
222 "SRID=4326;GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 0))");
223
224 do_geom_test("SRID=4326;POINT(1 2)",
225 "SRID=4326;POINT(1 2)");
226
227 do_geom_test("SRID=4326;MULTIPOINT(1 2)",
228 "SRID=4326;POINT(1 2)");
229
230 do_geom_test("SRID=4326;MULTIPOINT(1 2,3 4)",
231 "SRID=4326;MULTIPOINT(1 2,3 4)");
232
233 do_geom_test("SRID=4326;MULTILINESTRING((1 2,3 4))",
234 "SRID=4326;LINESTRING(1 2,3 4)");
235
236 do_geom_test("SRID=4326;MULTILINESTRING((1 2,3 4),(5 6,7 8))",
237 "SRID=4326;MULTILINESTRING((1 2,3 4),(5 6,7 8))");
238
239 /* 3D and 4D */
240 do_geom_test("POINT(1 2 3)",
241 "POINT(1 2 3)");
242
243 do_geom_test("POINTM(1 2 3)",
244 "POINTM(1 2 3)");
245
246 do_geom_test("POINT(1 2 3 4)",
247 "POINT(1 2 3 4)");
248}
static void do_geom_test(char *in, char *out)

References do_geom_test().

Referenced by homogenize_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: