Skip to content

gi-nx


gi-nx / fromProjected

ts
function fromProjected(fc: 
  | FeatureCollection<Geometry, {
[name: string]: any;
}>
  | Feature<Geometry, {
[name: string]: any;
}>, origin: [number, number]): 
  | Feature<Geometry, {
[name: string]: any;
}>
  | {
  features: Feature<Geometry, {
   [name: string]: any;
  }>[];
  type: string;
};

Convert local meter coordinates back to geographic coordinates (lng/lat). Reverses the toProjected transformation using the same origin point.

Parameters

ParameterTypeDescription
fc| FeatureCollection<Geometry, { [name: string]: any; }> | Feature<Geometry, { [name: string]: any; }>Feature or FeatureCollection with meter coordinates
origin[number, number]The same origin point used in toProjected

Returns

| Feature<Geometry, { [name: string]: any; }> | { features: Feature<Geometry, { [name: string]: any; }>[]; type: string; }

Example

typescript
const origin = [-122.4194, 37.7749];
const geographic = await rpc.invoke("fromProjected", [projectedFeature, origin]);
// Coordinates are now in lng/lat