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

importWKT not compatible with reproject #434

Open
toihr opened this issue Aug 12, 2024 · 2 comments
Open

importWKT not compatible with reproject #434

toihr opened this issue Aug 12, 2024 · 2 comments

Comments

@toihr
Copy link

toihr commented Aug 12, 2024

When trying to reproject a point in MARS2000 Coordinates to South Polar Stereographic coordinates as follows:

PROJCS["Mars_2000_South_Pole_Stereographic_sphere",
    GEOGCS["Mars_2000_(Sphere)",
        DATUM["Mars_2000_(Sphere)",
            SPHEROID["Mars_2000_(Sphere)",3396190,0],
            AUTHORITY["ESRI","106971"]],
        PRIMEM["Reference_Meridian",0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Polar_Stereographic"],
    PARAMETER["latitude_of_origin",-90],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1],
    AUTHORITY["ESRI","103884"]]
""")

MARS2000 = ArchGDAL.importWKT("""
GEOGCS["Mars_2000_(Sphere)",
    DATUM["Mars_2000_(Sphere)",
        SPHEROID["Mars_2000_(Sphere)",3396190,0,
            AUTHORITY["ESRI","107971"]],
        AUTHORITY["ESRI","106971"]],
    PRIMEM["Reference_Meridian",0,
        AUTHORITY["ESRI","108900"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["ESRI","104971"]]
""") 


Test = (1,1)
Point = ArchGDAL.createpoint(Test)
ArchGDAL.reproject(Point,MARS2000,SOUTHPOLARSTEREOGRAPHIC)

But I only get the following error:
ERROR: MethodError: no method matching reproject(::ArchGDAL.IGeometry{ArchGDAL.wkbPoint}, ::ArchGDAL.ISpatialRef, ::ArchGDAL.ISpatialRef)

I think I understand the issue is due to the Reprojection using GeoFormat types and not the ArchGDAL.ISpatialRef.
If the only way to transform between CRS is to use geoformat types then i think the Import methods should result GeoFormatTypes.

@felixcremer
Copy link
Contributor

This is a duplicate or quite close to #403

@toihr
Copy link
Author

toihr commented Aug 13, 2024

Oh yeah thats correct, Sorry I did not see this.

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