Ticket #746 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

ST_Dump with GSerialized POINT EMPTY and EWKT/AsText mismatch?

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
Keywords: Cc:

Description

You might know about this one already since I recall you saying you were having issues with dump.

SELECT ST_Dump(ST_GeomFromText('POINT EMPTY',4326))

On non-gserialized returns empty record set as I would expect.

On gserialized gives error: ERROR: WKB structure does not match expected size!

I wonder if this is related to the fact that I can't get a POINT EMPTY back EVER - this is the case with both gserialized and non-gserialized installs.

SELECT ST_AsEWKT(ST_GeomFromEWKT('POINT EMPTY'));

Gives: MULTIPOINT EMPTY

A little bizarre if you's ask me.

Change History

Changed 2 years ago by robe

  • summary changed from ST_Dump with GSerialized POINT EMPTY does not match expected size to ST_Dump with GSerialized POINT EMPTY and EWKT/AsText mismatch?

Okay I stand corrected. Evidentally you can get back a POINT EMPTY in gserialized if you use ST_AsText, but not if you use ST_AsEWKT. There is a big disconnect there.

Example: SELECT ST_AsText(ST_GeomFromText('POINT EMPTY')); -- gserialized POINT EMPTY

-- out current install (not gserialized) MULTIPOINT EMPTY

If you use ST_AsEWKT in both cases its

MULTIPOINT EMPTY

This AsEWKT/AsText mismatch in GSerialized may explain the large number of discrepancies I'm seeing between the two during my regress checks.

Changed 2 years ago by pramsey

Somehow AsEWK must be passing through the WKB handler which can't work with POINT EMPTY. Something to fix.

Changed 2 years ago by pramsey

As of now this works

SELECT ST_AsEWKT(ST_GeomFromEWKT('POINT EMPTY'));

Changed 2 years ago by pramsey

A deeper question is what the right answer to the ST_Dump() question is. Try the following:

SELECT ST_Dump(ST_GeomFromText('POINT EMPTY',4326));
SELECT ST_Dump(ST_GeomFromText('LINESTRING EMPTY',4326));
SELECT ST_Dump(ST_GeomFromText('MULTILINESTRING EMPTY',4326));
SELECT ST_Dump(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY',4326));

Try the final one in PostGIS 1.5 too. That seems to indicate the "right" answer for ST_Dump(empty) is "no records".

Changed 2 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

Fixed (to my mind) at r7436 in trunk

Note: See TracTickets for help on using tickets.