Skip to main content

JgdTransformer

Struct JgdTransformer 

Source
pub struct JgdTransformer { /* private fields */ }
Expand description

JGD2011座標変換器

Tokyo Datum/JGD2000からJGD2011への変換を行う。

  • Step 1: Tokyo Datum → JGD2000 (TKY2JGD)
  • Step 2: JGD2000 → JGD2011 (PatchJGD統合)
  • Step 3: JGD2011 → WGS84 (proj)

Implementations§

Source§

impl JgdTransformer

Source

pub fn with_survey_date<P: AsRef<Path>>( tky_path: P, patch_dir: P, survey_date: SurveyStartDate, ) -> Result<Self, TransformError>

パラメータファイルを読み込んで変換器を初期化(調査日指定あり)

§Arguments
  • tky_path - TKY2JGD.par のパス
  • patch_dir - PatchJGD系ファイルが入ったディレクトリのパス
  • survey_date - 調査日(地震補正の適用判定に使用)
§地震補正の適用ルール
  • 調査日が地震発生日より前の場合のみ、その地震の補正を適用
  • 調査日が地震発生日より後の場合、補正は適用しない(既に変動後の位置)
  • ジオイド補正(hyokorev2014_geoid2011_h.par)は常に適用
§Example
ⓘ
let survey_date = SurveyStartDate::new(2010, 5, 15);
let transformer = JgdTransformer::with_survey_date(
    "params/TKY2JGD.par",
    "params/patch_files",
    survey_date
)?;
Source

pub fn new<P: AsRef<Path>>( tky_path: P, patch_dir: P, ) -> Result<Self, TransformError>

パラメータファイルを読み込んで変換器を初期化(調査日なし)

注意: 調査日が不明な場合、地震補正は適用されません。 ジオイド補正のみが適用されます。

§Arguments
  • tky_path - TKY2JGD.par のパス
  • patch_dir - PatchJGD系ファイルが入ったディレクトリのパス
Source

pub fn new_tky_only<P: AsRef<Path>>(tky_path: P) -> Result<Self, TransformError>

TKY2JGDのみで変換器を初期化 (PatchJGDファイルなし)

JGD2000→JGD2011変換が不要な場合に使用

Source

pub fn transform_horizontal( &self, lat: f64, lon: f64, system_code: &str, ) -> Option<(f64, f64)>

座標をJGD2011に変換 (水平座標のみ)

§Arguments
  • lat - 緯度 (度, 10進数)
  • lon - 経度 (度, 10進数)
  • system_code - 測地系コード (“00”=Tokyo, “01”=JGD2000, “02”=JGD2011)
§Returns

変換後の (緯度, 経度) または変換失敗時にNone

Source

pub fn transform_full( &self, lat: f64, lon: f64, alt: f64, system_code: &str, ) -> Result<(f64, f64, f64), TransformError>

座標をJGD2011に変換 (水平+垂直)

§Arguments
  • lat - 緯度 (度, 10進数)
  • lon - 経度 (度, 10進数)
  • alt - 標高 (m)
  • system_code - 測地系コード (“00”=Tokyo, “01”=JGD2000, “02”=JGD2011)
§Returns

変換後の (緯度, 経度, 標高)

Source

pub fn to_wgs84( &self, lat: f64, lon: f64, system_code: &str, ) -> Option<(f64, f64)>

座標をWGS84に変換 (水平座標のみ)

Tokyo Datum/JGD2000 → JGD2011 → WGS84 の変換を行う。

§Arguments
  • lat - 緯度 (度, 10進数)
  • lon - 経度 (度, 10進数)
  • system_code - 測地系コード (“00”=Tokyo, “01”=JGD2000, “02”=JGD2011)
§Returns

変換後の (経度, 緯度) - WGS84座標

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.