Closed frodrigo closed 2 years ago
I tried hard to reproduce this but couldn't with imposm3 v0.11.1, which has 9a98d9c5066e2c751c381b817013111226246895 in it. I see the original report at https://github.com/openmaptiles/openmaptiles/issues/1018#issuecomment-782148237 identified that OMT uses an old version of imposm3. Is it possible it's using one that doesn't support PostGIS 3?
Fixed with #263
Generalization of multi-polygon table may produce polygon table. Then it fails to update, when the update come with a multipolygon geometry.
The geometry type of generalized table is left to postgres.
When the imported tables is from polygons, the geometry type is
geometry(Geometry,3857)
allowing any type of geometry, and it fine. On generalisation process with a filter (WHERE
), multi-polygon may be excluded. Resulting only with polygon. Postgres compute the type of the column from the data. So it maybe a mix of polygons and multipolygonsgeometry(Geometry,3857)
or only polygongeometry(Polygon,3857)
.When an update come with a type of multipolygon while the generalized table is only for polygon, the insert fails with:
It look like to me the issue com from here: https://github.com/omniscale/imposm3/blob/master/database/postgis/postgis.go#L335 The generalized field are computed here: https://github.com/omniscale/imposm3/blob/master/database/postgis/columns.go#L29 and only the name is used.
The column must contain cast to the desired type, from the original field type:
https://github.com/openmaptiles/openmaptiles/issues/1018