Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#707 closed defect (duplicate)

WKBReader does not read geometries with Z, M or ZM outside of Point

Reported by: benmorel Owned by: geos-devel@…
Priority: blocker Milestone: 3.6.1
Component: Default Version: main
Severity: Critical Keywords: WKBReader
Cc: royseto

Description

Strangely, trying to read any Geometry, apart from a Point, with Z, M or ZM coordinates from WKB always fails with a message such as:

"ParseException: Unknown WKB type 234"

An example of such geometry is the following:

LINESTRING Z (0 1 2, 1 2 3, 2 3 4)

Its (hex) WKB representation is:

01ea030000030000000000000000000000000000000000f03f0000000000000040000000000000f03f00000000000000400000000000000840000000000000004000000000000008400000000000001040

This WKB is correct, and PostGIS and others handle it properly.

I will post a pull request on GitHub with failing tests, and put the link here.

Change History (6)

comment:2 by Mike Taves, 10 years ago

This is a duplicate of #466

The example geometry is ISO WKB. GEOS currently only supports EWKB, defined by PostGIS (however, PostGIS seamlessly supports both ISO WKB and EWKB formats).

The EWKB equivalent of the example linestring is:

0102000080030000000000000000000000000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000840000000000000004000000000000008400000000000001040

But yeah, I agree it would be nice to have GEOS catch up to the abilities of PostGIS.

comment:3 by benmorel, 10 years ago

Thanks, I did not think one second that GEOS would not be able to handle ISO WKB. I'll see if I can make changes to the WKBReader so that it can handle WKB as well: any WKB being valid EWKB, it should be possible without breaking anything.

comment:4 by royseto, 9 years ago

Cc: royseto added

comment:5 by strk, 9 years ago

Resolution: duplicate
Status: newclosed

comment:6 by strk, 7 years ago

Milestone: 3.4.33.6.1

Ticket retargeted after milestone deleted

Note: See TracTickets for help on using tickets.