Ticket #1041 (closed defect: fixed)
ST_Collect is screwy with M dimension
| Reported by: | robe | Owned by: | pramsey |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.0.0 |
| Component: | postgis | Version: | 1.5.X |
| Keywords: | Cc: |
Description
SELECT ST_AsEWKT(ST_Collect(ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1261 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261 42.2702 1,-71.1261 42.2703 1))'),
ST_GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((-71.0821 42.3036 2,-71.0822 42.3036 3,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036 2)))') ));
Yields:
SRID=4326;GEOMETRYCOLLECTIONM(POLYGON((-71.1261 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261 42.2702 1,-71.1261 42.2703 1)),MULTIPOLYGON(((-71.0821 42.3036 2,-71.0822 42.3036 3,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036 2))))
Which causes this
SELECT ST_GeogFromText(ST_AsEWKT(ST_Collect(ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1261 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261 42.2702 1,-71.1261 42.2703 1))'),
ST_GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((-71.0821 42.3036 2,-71.0822 42.3036 3,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036 2)))') )));
To fail with error:
ERROR: can not mix dimensionality in a geometry HINT: "...0819 42.3037 2,-71.0821 42.3036 2))))" <-- parse error at position 266 within geometry
It's the same issue in 1.5, but 1.5 doesn't error out with ST_Geog because evidentally 1.5 c\geog check doesn't care as much about dimensionality as 2.0 does.
Change History
Note: See
TracTickets for help on using
tickets.
