[GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+--------------------------
 Reporter:  Mike Taves  |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  master
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 This is related to #1005

 An empty point geometry can be created using either `POINT EMPTY` or with
 `GEOSGeom_createEmptyPoint_r`. This geometry returns 0 from `GEOSHasZ_r`
 and the WKT representation is `POINT EMPTY`, as expected.

 However, the WKB representation is
 `0101000080000000000000F87F000000000000F87F000000000000F87F` or `POINT Z
 EMPTY`. The expected result should be
 `0101000000000000000000F87F000000000000F87F`.

 The only workaround is to use `GEOSWKBWriter_setOutputDimension_r` to
 write a 2D representation.

 Note that WKB representations of `MULTIPOINT EMPTY` or
 `GEOSGeom_createEmptyLineString_r` do not contain Z coordinate info, for
 any WKB writer output dimension setting.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 Also, unsure if this is directly related, but WKT `GEOMETRYCOLLECTION
 (MULTIPOINT EMPTY)` returns WKB
 `0107000080010000000101000080000000000000F87F000000000000F87F000000000000F87F`
 or `GEOMETRYCOLLECTION Z (POINT Z EMPTY)`

 Whereas `GEOMETRYCOLLECTION (MULTIPOINT EMPTY)` remains a 2D
 !GeometryCollection with `010700000001000000010400000000000000`

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048#comment:1>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
In reply to this post by geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 Another related inconsistency `GEOMETRYCOLLECTION (POINT(1 2), POINT
 EMPTY)` returns
 `0107000080020000000101000000000000000000F03F00000000000000400101000080000000000000F87F000000000000F87F000000000000F87F`,
 which is not portable WKB. Handing this to PostGIS raises "Dimensions
 mismatch in lwcollection", because of the extra coordinate surprise.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048#comment:2>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
In reply to this post by geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by pramsey):

 In general the WKT reader and default creators try to create things with
 3d coordinates, which is counter to my own sense of "least surprise".
 Directly relating to this ticket, the EMPTY case in WKT reader fails to
 note the presence of any dimensionality tags in the input (POINT Z EMPTY)
 and just creates a 3d empty every time. Looks like most types will need to
 be touched to put this completely right.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048#comment:3>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
In reply to this post by geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by pramsey):

 In general the WKT parser did not parse in "GEOMETRY Z EMPTY" forms and
 notice there was a Z there. Point was fiddly to fix, and that still left
 other types, so I figured I'd fix them all... turns out the core model of
 GEOS/JTS can't even represent a "GEOMETRYCOLLECTION Z EMPTY" of any type.
 There's nowhere for the dimensionality to live!

 Also! The question of what to instantiate for a "POINT EMPTY",
 dimensionally speaking. The default in the code was a 3D empty. That
 seemed wrong to me, so I've moved it down to a 2D empty. That should also
 cause other things to harmonize. There was also a bug hiding, in the
 clone() method, that incorrectly cloned 2D POINT EMPTY.

 Anyways, just waiting for a CI build before merging, but suffice to say
 this isn't a *comprehensive* fix, since that requires some larger
 restructuring to even be able to represent some of these concepts that are
 expressible in WKT and WKB.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048#comment:4>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1048: WKB representation of POINT EMPTY has 3 dimensions

geos-2
In reply to this post by geos-2
#1048: WKB representation of POINT EMPTY has 3 dimensions
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------
Changes (by Paul Ramsey <pramsey@…>):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"708d32b2cd2dd3bedc38ff1d839368656b1f9626/git" 708d32b/git]:
 {{{
 #!CommitTicketReference repository="git"
 revision="708d32b2cd2dd3bedc38ff1d839368656b1f9626"
 Create new EMPTY geometry with 2D coordinates by default. Parse Z EMPTY
 geometry in WKT reader, for simple (non-multi) geometries. Closes #1048
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1048#comment:5>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel