2

I'm trying to convert coordinates from the NY State Plane Coordinate System for Long Island (zone #3104) to WGS84 using the GeoTools Java API. The latitude value is correct, but the longitude is consistently 3.665 degrees off to the west:

public static void main(String[] args) throws FactoryException, TransformException {
        CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4456"); //http://www.geotoolkit.org/modules/referencing/supported-codes.html
        CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");
        MathTransform tr = CRS.findMathTransform(sourceCRS, targetCRS);
        DirectPosition sourcePt = new GeneralDirectPosition(982394.0, 199298.0); 
        DirectPosition targetPt = tr.transform(sourcePt, null);
        System.out.println("Source point: " + sourcePt);
        System.out.println("Target point: " + targetPt); 
}

The code above, earthpoint.us, and Google all return similar values for latitude: ~40.714. For longitude, earthpoint.us and Google show values of ~-74.006, but the code above produces -77.671, putting the point in the middle of Pennsylvania.

Using different source NY SPCS values produces similar errors, with the difference in longitude always being 3.665 degrees to the west and latitude being correct. GeoToolkit produces the same results.

Am I doing something wrong? Is there a 3.665 constant I should know about?

EDIT: the source values are NAD27.

1

I'm going to go out on a limb and say that you aren't including the False Easting and False Northing in your XY coordinates. EPSG:4456 states the FE and FN values should be 2000000 and 100000 respectively. Being short 2 million feet on the easting value would explain why your point is in Pennsylvania.

If you change your point to include these values (x=2982394 y=299298) then that looks like the location you might be expecting.

EDIT -- I just checked earthpoint.us and WGS84 is the datum they are basing the calculation on. There is no State Plane Zone based on WGS84, so they're probably using the NAD83 parameters. For NAD83 NY/Long Island, the False Easting/Northing values are 984250/0 respectively. Try changing your output EPSG code to 2263 and see if that fixes the issue.

SIDE NOTE! If you are 100% positive that your data is in NAD27, then it's possible the wrong FE/FN values have been applied to your data.

  • Thanks! You were correct - the values were actually in NAD83, and the False Easting/Northing values were throwing me off. I tried everything but that, and assumed the source was correct. – Bart Feb 11 '14 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.