Details Ticket 2098


Comment | Reply | Take | Open


Serial Number 2098
Subject pg.in.dbf truncating or rounding real numbers
Area grass5.0
Queue grass
Requestors michael.barton@asu.edu
Owner none
Status resolved
Last User Contact Mon Feb 5 21:50:38 2007 (2 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Mon Feb 5 21:50:38 2007 (2 yr ago)
Created Fri Sep 12 21:31:34 2003 (5 yr ago)

Transaction History Ticket 2098


Fri, Sep 12 2003 21:31:34    Request created by guest  
Subject: pg.in.dbf truncating or rounding real numbers

Platform: other
grass obtained from: Other (CDROM etc)
grass binary for platform: Compiled from Sources
GRASS Version: 5.0.2

I was importing into PostgreSQL a dbf file of points with UTM values for x and
y coordinates. 
These did not plot correctly in d.site.pg. I discovered that the UTM coordinates
were truncated. I 
had used UTM coordinates to 2 decimal places to identify coring locations. After
some 
experimentation, I discovered that if the value is a real number, pg.in dbf pads
it with a lot of 
zeros to the right. When the real number is over a total of 7 places, it rounds
to the nearest 7 
places when being inserted into PostgreSQL. Hence, a UTM of 7350250.57 becomes
7350251. I 
have no idea what is causing this. I can see nothing obviously awry in the PostgreSQL
configuration (4 byte real numbers) or insert statement that flashes by in pg.in.dbf
that should 
cause this.

A workaround is to make the long real number a text field in the dbf file. It
becomes a text field 
in PostgreSQL, preserving all meaningful digits. However, d.site.pg will still
read it correctly 
when specified as an x or y coordinate.
Tue, Mar 1 2005 08:44:21    Area changed to grass5.0 by pcavallini  
Mon, Feb 5 2007 21:50:38    Status changed to resolved by mneteler  
Mon, Feb 5 2007 21:50:38    Mail sent by mneteler  
pg.in.dbf was deprecated, closing.
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request