Projected to Geographical conversion breaks with Lambert_Conformal_Conic_2SP
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
提供された Python 再現コードと mikecore.Projections.MapProjection エントリーポイントから始め、投影 Lambert_Conformal_L擎Conic_2SP について Proj2Geo と Geo2Proj を比較します。逆変換が (444.87039857071056, nan) を返す理由を追跡し、その後、動作している Transverse_Mercator のケースを壊すことなく、同じ座標ペアが期待される地理座標値に変換されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Hi,
I had issues in mikeio when trying to create a Dfs2 file with a Lambert_Conformal_Conic_2SP projection. I can do this succesfully when trying manually (i.e. in MIKE Zero GUI), and in mikecore. So I traced the issue to the mikecore.projections.MapProjection class used to setup the Dfs2 projection info for the Dfs2 builder: when it tries to convert projected coordinates it runs into numerical issues. See example below:
Fail case: Lambert_Conformal_Conic_2SP projection
from mikecore.Projections import MapProjection
# The projected and geographic coordinates here are the same
# This can be converted back and forth using the Datum Converter tool in MIKE Zero
origin_projected = [ -65900.32888812723, -678217.039068304]
origin_geographic = [ 24.01529,-34.987278]
# Custom projection string
proj_str = 'PROJCS["Custom",GEOGCS["Unused",DATUM["User defined",SPHEROID["WGS 1984",6378137,298.257223563]],'+\
'PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],'+\
'PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",24.751587],'+\
'PARAMETER["Standard_Parallel_1",-40],PARAMETER["Standard_Parallel_2",-10],'+\
'PARAMETER["Latitude_Of_Origin",-28.702538],UNIT["Meter",1]]'
# Try conversion using MIKE MapProjection
proj_core = MapProjection.Create(proj_str)
# Projected to Geographic Fails
print(proj_core.Proj2Geo(*origin_projected))
# Geographic to Projected works
print(proj_core.Geo2Proj(*origin_geographic))
>>> (444.87039857071056, nan)
>>> (-65900.2668223073, -678217.0403999202)
As you can see the Lambert_Conformal_Conic_2SP coordinate pairs fail when trying to converted from projected to geographical coordinates, while the reverse works just fine. I haven't tested this in the .NET/C# code, but I'm confident this isn't correct behaviour.
Working case: Transverse_Mercator projection
from mikecore.Projections import MapProjection
# Coordinate info
# The projected and geographic coordinates here are the same
# This can be converted back and forth using the Datum Converter tool in MIKE Zero
origin_projected = [ -89907.8133323,-3873624.5460040]
origin_geographic = [ 24.01529,-34.987278]
# Custom projection string
proj_str = 'PROJCS["WG25",GEOGCS["Unused",DATUM["User defined",SPHEROID["WGS 1984",6378137,298.257223563]],'+\
'PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],'+\
'PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",25],PARAMETER["Scale_Factor",1],'+\
'PARAMETER["Latitude_Of_Origin",0],UNIT["Meter",1]]'
# Try conversion using MIKE MapProjection
proj_core = MapProjection.Create(proj_str)
# Projected to Geographic Fails
print(proj_core.Proj2Geo(*origin_projected))
# Geographic to Projected works
print(proj_core.Geo2Proj(*origin_geographic))
>>> (24.015290000000082, -34.9872779999965)
>>> (-89907.81333230426, -3873624.5460043526)
Success - works as expected!
- 主要言語
- Python
- スター
- 5
- フォーク
- 1
- 平均マージ
- 1時間 18分
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DHI/mikecore-python のほかの issue
-
Four test assertions carried over from the C# suite are still commented out対応中かも @ryan-kipawa が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DHI/mikecore-python#49 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
DHI/mikecore-python#59 ·
メンテナーはふだん 1 日以内に返信
-
New submesh feature (2027) makes all dfsu fail!対応中かも @ryan-kipawa が 8 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
DHI/mikecore-python#54 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
DHI/mikecore-python#52 ·
メンテナーはふだん 1 日以内に返信
-
Remaining TODOs in production code: platform notes, licensing questions, and one likely-stale markerオープン
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
DHI/mikecore-python#51 ·
メンテナーはふだん 1 日以内に返信
DHI/mikecore-python の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Vector35/community-plugins#376 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
py-econometrics/pyfixest#1883 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ietf-tools/rfc2html#81 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
mysql/mysql-operator#60 ·
-
Python: Bug: split_plaintext_paragraph / split_markdown_paragraph can return a chunk larger than max_tokens対応中かも @xThreeh が今日担当しました。 オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/semantic-kernel#14566 ·
メンテナーはふだん 4 日以内に返信