[GEOS] #1005: Writing POINT EMPTY in WKB

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

[GEOS] #1005: Writing POINT EMPTY in WKB

geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+--------------------------
 Reporter:  Mike Taves  |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  master
 Severity:  Annoyance   |   Keywords:
------------------------+--------------------------
 An empty point can be created in GEOS by reading the WKT `POINT EMPTY` or
 the WKB `0101000000000000000000F87F000000000000F87F` (i.e. "POINT(NaN
 NaN)").

 This point can be written back by GEOS as WKT to get `POINT EMPTY`,
 however it cannot be converted back to WKB, as
 [https://github.com/libgeos/geos/blob/030ee891c8bf571f37174b51084e76c01d738950/src/io/WKBWriter.cpp#L126-L127
 WKBWriter.cpp will throw]:
 > `util::IllegalArgumentException("Empty Points cannot be represented in
 WKB")`

 Given that GEOS is happy to read/write `POINT EMPTY` and read the WKB,
 shouldn't it be able to write the WKB geometry too?

 See PostGIS [https://trac.osgeo.org/postgis/ticket/3031 ticket #3031] for
 related discussion.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005>
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] #1005: Writing POINT EMPTY in WKB

geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 Or more relevant, see PostGIS [https://trac.osgeo.org/postgis/ticket/3181
 #ticket 3181]

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by jorisvandenbossche):

 What are the thoughts about adding this special case to GEOS?
 I think it would be good to have consistency in reading vs writing in
 GOES, and enable a full roundtrip.

 Further, PostGIS does this as well, and I think Shapely/PyGEOS would like
 to do this as well (in which case they need to add a special case on top
 of their usage of GEOS if it is not changed in GEOS itself).

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by mdavis):

 +1, especially since this was recently
 [https://github.com/locationtech/jts/pull/567 fixed] in JTS.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by Paul Ramsey <pramsey@…>):

 In [changeset:"466cff135c8e504632ae38b79a1348dbadb390f1/git" 466cff1/git]:
 {{{
 #!CommitTicketReference repository="git"
 revision="466cff135c8e504632ae38b79a1348dbadb390f1"
 Output POINT EMPTY in WKB. References #1005
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------
Changes (by pramsey):

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


--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#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
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 Just tested master, and I see `POINT EMPTY` ->
 `0101000080000000000000F87F000000000000F87F000000000000F87F` -> `POINT Z
 EMPTY`, which is a bit of a surprise. Three-dimensional empty geometries
 are getting really abstract. Could this just be WKB for `POINT EMPTY`?

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#comment:6>
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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 With `POINT EMPTY`, `GEOSGeom_getCoordinateDimension` is currently
 returning 3.

 With `MULTIPOINT EMPTY` this is 2, not 3.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#comment:7>
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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------

Comment (by Mike Taves):

 A related issue regarding the 3D oddities is in #1048

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1005#comment:8>
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] #1005: Writing POINT EMPTY in WKB

geos-2
In reply to this post by geos-2
#1005: Writing POINT EMPTY in WKB
------------------------+---------------------------
 Reporter:  Mike Taves  |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Annoyance   |  Resolution:  fixed
 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/1005#comment:9>
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