-
Notifications
You must be signed in to change notification settings - Fork 9
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
Optional +x_0, +y_0 projection parameters #62
Comments
I'm not sure! I checked if it may be due to different versions, but using the bundled proj from PROJ_jll I get the same result: import PROJ_jll
# from test/applications.jl
function read_cmd(cmd)
bytes = read(cmd)
str = String(bytes)
# on Windows there are CFLR line endings
lf_only = replace(str, "\r" => "")
no_tabs = replace(lf_only, "\t" => " ")
return String(strip(no_tabs))
end
PROJ_jll.proj() do proj
read_cmd(pipeline(IOBuffer("0 0"),
`$proj +proj=ob_tran +o_proj=longlat +ellps=sphere +no_defs +to_meter=0.017453292519943295 +o_lon_p=198.0 +o_lat_p=39.25 +x_0=2.997602990300261 +y_0=1.7528341677779053 +R=6371229`))
end
# -> "9.75 49.68" |
I assume the difference probably lies in that |
Thanks, this has solved the problem for me. I was using the wrong application. |
I am having a problem with optional projection parameters. I am using this proj4 strings:
pj4string = "+proj=ob_tran +o_proj=longlat +ellps=sphere +no_defs +to_meter=0.017453292519943295 +o_lon_p=198.0 +o_lat_p=39.25 +x_0=2.997602990300261 +y_0=1.7528341677779053 +R=6371229"
reference = "+proj=latlong +R=6371229"
Using it on the proj command line utility the above proj4 string gives me the below result:
proj +proj=ob_tran +o_proj=longlat +ellps=sphere +no_defs +to_meter=0.017453292519943295 +o_lon_p=198.0 +o_lat_p=39.25 +x_0=2.997602990300261 +y_0=1.7528341677779053 +R=6371229
0 0
9.75 49.68
I am getting different answer using the Julia implementation:
using Proj
dirtrans = Proj4.Transformation(pj4string, reference)
dirtrans((0.0,0.0))
2-element StaticArrays.SVector{2, Float64} with indices SOneTo(2):
152.81767357346513
-47.4333686809606
I can get the above from command line by using the inverse projection and removing the optional parameters:
invproj +proj=ob_tran +o_proj=longlat +ellps=sphere +no_defs +to_meter=0.017453292519943295 +o_lon_p=198.0 +o_lat_p=39.25 +R=6371229 -f "%f"
152.817674 -47.433369
What am I missing?
The text was updated successfully, but these errors were encountered: