locationtech / proj4j

Java port of the Proj.4 library for coordinate reprojection
Other
181 stars 71 forks source link

VN2000 Error Exception in thread "main" java.lang.IllegalStateException: Latitude is out of range: 9738.514891355962 #103

Open longtran84 opened 1 year ago

longtran84 commented 1 year ago
    CRSFactory crsFactory = new CRSFactory();
    CoordinateReferenceSystem WGS84 = crsFactory.createFromParameters("WGS84",
            "+proj=longlat +datum=WGS84 +no_defs");
    CoordinateReferenceSystem UTM = crsFactory.createFromParameters("VN-2000",
            "+proj=longlat +ellps=WGS84 +towgs84=-191.90441429,-39.30318279,-111.45032835,0.00928836,-0.01975479,0.00427372,0.252906278 +no_defs");
    CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();
    CoordinateTransform wgsToUtm = ctFactory.createTransform(WGS84, UTM);

// result is an output parameter to transform() ProjCoordinate result = new ProjCoordinate(); wgsToUtm.transform(new ProjCoordinate(13, 13), result); System.err.println(result);