Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection from EPSG:2274 to WGS84 incorrect #102

Closed
daveisfera opened this issue Dec 23, 2016 · 1 comment
Closed

Projection from EPSG:2274 to WGS84 incorrect #102

daveisfera opened this issue Dec 23, 2016 · 1 comment

Comments

@daveisfera
Copy link

Doing a projection with pyproj from EPSG:2274 to WGS84 doesn't give the same results as when using proj directly.

Here's the pyproj example:

#!/usr/bin/env python3

from pyproj import Proj, transform


def main():
    x = 1744000
    y =  675000

    pj1 = Proj("+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs")
    pj2 = Proj("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")

    lat, lon = transform(pj1, pj2, x, y)
    print("{:.2f}\t{:.2f}".format(lat, lon))


if __name__ == "__main__":
    main()

And the C example:

#include "proj_api.h"
#include "stdio.h"

int main(int argc, char **argv) {
    projPJ pj1, pj2;
    double x = 1744000;
    double y =  675000;

    if (!(pj1 = pj_init_plus("+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs")) ) {
        return 1;
    }
    if (!(pj2 = pj_init_plus("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")) ){
        return 1;
    }

    pj_transform(pj1, pj2, 1, 1, &x, &y, NULL );
    x *= RAD_TO_DEG;
    y *= RAD_TO_DEG;
    printf("%.2f\t%.2f\n", x, y);

    return 0;
}
@micahcochran
Copy link
Collaborator

See issue #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants