forked from geodmms/xdgnjobs

?? ?
2008-08-25 d6730f9476e7313e33a08a1d6024e69ae1eda184
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ximple.eofms.util;
 
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
 
/**
 * Created by IntelliJ IDEA.
 * User: Ulysses
 * Date: 2007/6/15
 * Time: 上午 01:20:20
 * To change this template use File | Settings | File Templates.
 */
public final class GeomUtil
{
    public static double convertLogicalValue(double value)
    {
        return value / 1000.0 + 2147483.648;
    }
 
    public static Coordinate convertLogicalCooridate(Coordinate value)
    {
        return new Coordinate(convertLogicalValue(value.x), convertLogicalValue(value.y), convertLogicalValue(value.z));
    }
 
    public static Envelope convertLogicalEnvelope(Envelope value)
    {
        return new Envelope(convertLogicalValue(value.getMinX()), convertLogicalValue(value.getMaxX()),
                convertLogicalValue(value.getMinY()), convertLogicalValue(value.getMaxY()));
    }
}