Skip to content
Prev 12477 / 29559 Next

problem in writing shapefiles with writePointsShape() - SKUMT!

Thanks Roger


-----Original Message-----
From: Roger Bivand [mailto:Roger.Bivand at nhh.no] 
Sent: Monday, August 08, 2011 8:45 PM
To: Jeff Ranara
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] problem in writing shapefiles with
writePointsShape() - SKUMT!
On Mon, 8 Aug 2011, Jeff Ranara wrote:

            
No, just read ?write.dbf (in foreign). You find there that the 
representation "maxes" out at 19 characters, as in DBF specs. In this 
case, a negative scale is generated, which should not happen, but the 
limitation is documented.

So your heuristics are correct, either divide the too large variable by 
some orders of magnitude to allow it to be represented within 19 digits, 
including sign and decimal point, or use the OGR implementation, which 
permits a non-standard larger precision than 19. I'll add a link to 
?write.dbf on ?writeSpatialShape.

Roger
given
factor2char
150521517
45442762056
150521517
45442762056
-2147483648
-2147483648