[postgis-tickets] [PostGIS] #4437: pgsql2shp makes dangerous call to liblwgeom on POINT EMPTY

PostGIS trac at osgeo.org
Wed Jul 31 13:55:12 PDT 2019


#4437: pgsql2shp makes dangerous call to liblwgeom on POINT EMPTY
----------------------------+---------------------------
  Reporter:  strk           |      Owner:  robe
      Type:  defect         |     Status:  new
  Priority:  critical       |  Milestone:  PostGIS 2.5.3
 Component:  loader/dumper  |    Version:  trunk
Resolution:                 |   Keywords:
----------------------------+---------------------------

Comment (by pramsey):

 This is interesting... there is no explicit handling of empty in the
 dumper.

 If you ask for a `LINESTRING EMPTY` it will create for you a line string
 with zero vertices in the shape file. Similarly for a `POLYGON EMPTY`.

 For a `POINT EMPTY` there is no structural analogue to create in a shape
 file. So we are left with two options:

 * Treat `POINT EMPTY` as SHP_NULL type (which is also used for actual SQL
 NULLs)
 * Treat _all_ empties as SHP_NULL type
 * Treat `POINT EMPTY` as a special case as in WKB, filling in the
 coordinates with NAN (hmm).

 The second case changes existing behaviour the least, so I'm inclined to
 it. The third has a certain symmetry with WKB, but then we also need the
 inverse behaviour to convert POINT(NAN NAN) in a shape file into an
 empty...

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4437#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list