[postgis-users] digit problem about sql file.

Mike Adams madams55075 at comcast.net
Thu Feb 4 18:25:19 PST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
On 2010.02.04 09:45, Chris Hermansen wrote:
> Actually the problem is not ArcGIS; the problem is that decimal floating
> point numbers like 0.1 (1.0e-1) cannot exactly representable in binary
> floating point, at least with a fixed number of digits, which is the
> number format for coordinates in shapefiles.
>
> On Thu, 2010-02-04 at 10:25 +0100, Suhr, Ralf wrote:
>> ArcGIS does not use floating point numbers. The conversation from
intern ArcGIS number representation to Shapefile, Gml, Geodatabase, ...
is the problem.
>>
>> Gr Ralf
>>
>> -----Ursprüngliche Nachricht-----
>> Von: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] Im Auftrag von
Ben Madin
>>
>> Kevin,
>>
>> I suspect this is mainly an artefact of floating-point numbers, and
the conversion to and storage of these points in binary format.
>>
>> On 04/02/2010, at 15:40 , Hyung Joo Lee wrote:
>>> Hi all.
>>>
>>> I have a question about the decimal of shapefile that was created in
Arcgis.
>>>
>>> The file I have defined the coordinates of the coordinate system like
(56.631 55.612)
>>>
>>> That file was put in the DB using shp2pgsql( ---# shp2pgsql -a -w -S
-I ###.shp table_name > ###.sql).
>>>
>>> And then I checked the sql file. But the point coordinates that comes
a lot more than 3-digit  like 56.6313000004739 55.6119999999646
>>>
>>> I want to come out only 3-digit, so how can I do?
And, just 2 more cents from a lurker:
What Every Computer Scientist Should Know About Floating-Point
Arithmetic: http://docs.sun.com/source/806-3568/ncg_goldberg.html

Cheers,

Michael Adams

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iD8DBQFLa4GOFUo+7qhKZegRAqlYAKCHsWZ+vlsr2+Mw/eYuOdIBtJbueQCfRgpU
kxgPMc0Jh2y8zo5tprSZbC0=
=Vk8I
-----END PGP SIGNATURE-----




More information about the postgis-users mailing list