[postgis-tickets] [PostGIS] #3084: shp2pgsql - illegal number format when specific system locale set

PostGIS trac at osgeo.org
Wed Mar 18 07:30:37 PDT 2015


#3084: shp2pgsql - illegal number format when specific system locale set
---------------------+------------------------------------------------------
 Reporter:  infrag   |       Owner:  pramsey
     Type:  defect   |      Status:  new    
 Priority:  medium   |   Milestone:         
Component:  postgis  |     Version:  2.1.x  
 Keywords:           |  
---------------------+------------------------------------------------------
 I come across faulty behavior of shp2pgsql tool.
 When system locale is set to some locale with i.e. different decimal
 separator sign shp2pgsql produces faulty output.

 I had my locale on ubuntu linux set to LANG=cs_CZ.UTF-8
 then shp2pgsql output illegal format of GEOMETRY:

 ...
 MULTIPOLYGON(((-759009,328 -1010948,384,-758995,543 -1010943,409, ...

 You can see the collision of decimal delimiters with point separators.
 When I changed LOCALE to LANG=en.UTF-8 the output was correct:

 ...
 MULTIPOLYGON(((-759009.328 -1010948.384,-758995.543 -1010943.409,
 ...

 The output of shp2pgsql should be locale independent since only one number
 format is acceptable by postgres/postgis.

 Similar faults could exist for various locales and various types which
 should be output.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3084>
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