Issue 11292

registry-migration: ensure lat/long fields use proper decimals with "." instead of ","

11292
Reporter: kbraak
Assignee: fmendez
Type: SubTask
Summary: registry-migration: ensure lat/long fields use proper decimals with "." instead of ","
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2012-06-04 16:44:54.812
Updated: 2013-12-16 17:50:31.959
Resolved: 2012-06-13 16:27:51.95
TimeEstimate: 0
TimeSpent: 3600
        
Description: Creating a BigDecimal from "46,2222" fails. It must be in the format "46.2222

This change requires the registry-migration scripts to ensure that the agent.decimal_latitude and agent.decimal_longitude fields are written following this proper decimal format.]]>
    


Author: kbraak@gbif.org
Created: 2012-06-04 17:14:45.864
Updated: 2012-06-04 17:14:45.864
        
Alternatively, at the end of writing just run:

update agent set decimal_latitude = replace (decimal_latitude, ',', '.');
update agent set decimal_longitude = replace (decimal_longitude, ',', '.');
    


Author: mdoering@gbif.org
Comment: What is the reason for having varchar lat long fields in the first place? Wouldn't it be better to have a numerical data type like DECIMAL(18,12)?
Created: 2012-06-04 21:48:27.838
Updated: 2012-06-04 21:48:27.838


Author: fmendez@gbif.org
Comment: in the cleaning phase all ',' are replaced by '.'
Created: 2012-06-13 16:27:51.989
Updated: 2012-06-13 16:27:51.989