[postgis-tickets] [PostGIS] #2372: KML with space around ordinate values considered invalid

PostGIS trac at osgeo.org
Mon Jul 1 01:05:06 PDT 2013


#2372: KML with space around ordinate values considered invalid
----------------------+-----------------------------------------------------
  Reporter:  strk     |       Owner:  strk         
      Type:  defect   |      Status:  reopened     
  Priority:  high     |   Milestone:  PostGIS 1.5.9
 Component:  postgis  |     Version:  1.5.X        
Resolution:           |    Keywords:  history, kml 
----------------------+-----------------------------------------------------

Comment(by strk):

 I think 'Junk KML I' is valid because it contains 2 coordinates of 3
 dimensions each, with each ordinate value separated by comma and
 coordinates separated by _only_ spaces.

 Instead 'Junk KML II' is invalid because it contains a mix of 3d and 2d
 coordinates.
 I tried a version of 'Junk KML II' without spaces and guess what ? The old
 implementation considers it valid:

 {{{
 SELECT 'Junk KML II no spacepad', ST_AsEWKT(ST_GeomFromKML('
                 <LineString>
                         <coordinates>-71.1663,42.2614,12
 42.2616,14</coordinates>
                 </LineString>'));
 }}}

 So accepting it is not even a regression.

 You're right I generally think it's better to accept invalids and clean
 within the database, but anyway I've not seens a KML in the wild with
 mixed coordinate values so it shouldn't be a problem to bail out in that
 case. It'd be a matter of _checking_ num_dims variable to match the
 previous value whenever a new coordinate is pushed on the stack. Do you
 want me to do that ?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2372#comment:17>
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