/* Shortcut to drop geometries smaller than the resolution */
double geom_width = gserialized_box.xmax - gserialized_box.xmin;
double geom_height = gserialized_box.ymax - gserialized_box.ymin;
- double geom_area = geom_width * geom_height;
- double bounds_width = (bounds->xmax - bounds->xmin) / extent;
- double bounds_height = (bounds->ymax - bounds->ymin) / extent;
-
- /* We use 1/4th of the grid square area as the minimum resolution */
- double min_resolution_area = bounds_width * bounds_height / 4.0;
-
- if (geom_area < min_resolution_area)
+ /* We use half of the square height and width as limit: We use this
+ * and not area so it works properly with lines */
+ double bounds_width = ((bounds->xmax - bounds->xmin) / extent) / 2.0;
+ double bounds_height = ((bounds->ymax - bounds->ymin) / extent) / 2.0;
+ if (geom_width < bounds_width && geom_height < bounds_height)
{
PG_RETURN_NULL();
}
true
));
+SELECT '#4294_Horizontal', ST_AsText(ST_AsMVTGeom(
+ ST_GeomFromText('MULTILINESTRING((0 0, 0 5))'),
+ ST_MakeBox2D(ST_Point(0, 0), ST_Point(10, 10)),
+ 10, 0, true));
+
+SELECT '#4294_Vertical', ST_AsText(ST_AsMVTGeom(
+ ST_GeomFromText('MULTILINESTRING((0 0, 5 0))'),
+ ST_MakeBox2D(ST_Point(0, 0), ST_Point(10, 10)),
+ 10, 0, true));
-- Feature id encoding tests
SELECT 'FI1', encode(ST_AsMVT(q, 'test', 4096, 'geom', 'c1'), 'base64') FROM (
ERROR: pgis_asmvt_transfn: parameter row cannot be other than a rowtype
TU3|
#3922|6.5
+#4294_Horizontal|LINESTRING(0 10,0 5)
+#4294_Vertical|LINESTRING(0 10,5 10)
FI1|GicKBHRlc3QSDggBEgIAABgBIgQJMt4/GgJjMiIGCgRhYmNkKIAgeAI=
FI2|GicKBHRlc3QSDggBEgIAABgBIgQJMt4/GgJjMiIGCgRhYmNkKIAgeAI=
FI3|GicKBHRlc3QSDggBEgIAABgBIgQJMt4/GgJjMiIGCgRhYmNkKIAgeAI=