当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript proj4.defs函数代码示例

本文整理汇总了TypeScript中proj4.defs函数的典型用法代码示例。如果您正苦于以下问题:TypeScript defs函数的具体用法?TypeScript defs怎么用?TypeScript defs使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了defs函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

  }
);

const crs3 = new L.Proj.CRS('EPSG:3006',
  '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
  {
    origin: [218128.7031, 6126002.9379],
    resolutions: [8192, 4096, 2048],
    scales: [1, 2],
    bounds: new L.Bounds([[1, 2], [3, 4]]),
    transformation: new L.Transformation(1, 2, 3, 4),
  }
);

// geoJson
proj4.defs("urn:ogc:def:crs:EPSG::26915", "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs");

const geojson = {
  type: "Feature",
  geometry: {
    type: "Point",
    coordinates: [481650, 4980105]
  },
  crs: {
    type: "name",
    properties: {
      name: "urn:ogc:def:crs:EPSG::26915"
    }
  }
};
开发者ID:IceCreamYou,项目名称:DefinitelyTyped,代码行数:30,代码来源:proj4leaflet-tests.ts

示例2: proj4

const point1 = [-71, 41]
const point2 = {x: 2, y: 5}
const mgrs = "24XWT783908"

///////////////////////////////////////////
// Tests Measurement
///////////////////////////////////////////
proj4(epsg['4269'], epsg['4326'], point1)
proj4(epsg['4269'], point1)
proj4(epsg['4269'], epsg['4326']).forward(point2)
proj4(epsg['4269'], epsg['4326']).inverse(point2)

///////////////////////////////////
// Named Projections
///////////////////////////////////
proj4.defs('WGS84', epsg['4326'])
proj4.defs([
  ['EPSG:4326', epsg['4326']],
  ['EPSG:4269', epsg['4269']]
])
proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326'))

///////////////////////////////////
// Utils
///////////////////////////////////
// WGS84
proj4.WGS84

// Proj
proj4.Proj('WGS84')
开发者ID:Agamnentzar,项目名称:DefinitelyTyped,代码行数:30,代码来源:proj4-tests.ts

示例3:

  IConnection,
  IDiva,
  IMode,
  INode,
  IPin,
  IPlatform,
  IStop,
  IStopLocation,
  ITrip,
  PIN_TYPE,
  POI_TYPE,
} from "./interfaces";

// EPSG:31468
proj4.defs(
  "GK4",
  "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"
);

// EPSG:3857
proj4.defs(
  "WM",
  "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
);

export function WGS84toGK4(lng: number, lat: number): coord {
  return proj4("WGS84", "GK4", [lng, lat]).map(Math.round);
}

export function WGS84toWm(lng: number, lat: number): coord {
  return proj4("WGS84", "WM", [lng, lat]).map(Math.round);
}
开发者ID:kiliankoe,项目名称:dvbjs,代码行数:32,代码来源:utils.ts


注:本文中的proj4.defs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。