Skip to content

gi-nx


gi-nx / importRawSections

ts
function importRawSections(features: (
  | RawPoint & {
  temporary?: never;
}
  | RawMultiPoint & {
  temporary?: never;
}
  | RawLineString & {
  temporary?: never;
}
  | RawMultiLineString & {
  temporary?: never;
}
  | RawPolygon & {
  temporary?: never;
}
  | RawMultiPolygon & {
  temporary?: never;
})[], options?: {
  blocks?: {
     description?: string;
     features: (
        | PreStackedPoint
        | PreStackedLineString
       | PreStackedPolygon<Record<string, any>>)[];
     id: string;
     keyWords?: string[];
     name: string;
     properties?: Record<string, any>;
  }[];
  decisionType?: "replace" | "ignore" | "keep both";
  featureCategories?: {
   [key: string]: FeatureCategory;
     parkingType?: FeatureCategory;
     treeSpecies?: FeatureCategory;
     usage: {
      [usageName: string]: Usage;
     };
  };
  flows?: {
     dependencies: GiraffeNodeGraphFeatureDependancy[];
     description?: string;
     edges: GiraffeEdge[];
     id: string;
     inputs: Record<string, GiraffeNodeInputHandle>;
     name: string;
     nodes: GiraffeNode[];
     outputs: Record<string, GiraffeNodeInputHandle>;
     supportedShapes?: string[];
  }[];
  insertionPoint?: [number, number];
  keepLayerIds?: boolean;
}): Promise<(
  | RawPoint & {
  temporary?: never;
}
  | RawMultiPoint & {
  temporary?: never;
}
  | RawLineString & {
  temporary?: never;
}
  | RawMultiLineString & {
  temporary?: never;
}
  | RawPolygon & {
  temporary?: never;
}
  | RawMultiPolygon & {
  temporary?: never;
})[]>;

Import RawSections into the current project, with options for usages, flows, etc.

See the return type of getProjectBundle

Parameters

ParameterTypeDescription
features( | RawPoint & { temporary?: never; } | RawMultiPoint & { temporary?: never; } | RawLineString & { temporary?: never; } | RawMultiLineString & { temporary?: never; } | RawPolygon & { temporary?: never; } | RawMultiPolygon & { temporary?: never; })[]RawSections to import
options.blocks?{ description?: string; features: ( | PreStackedPoint | PreStackedLineString | PreStackedPolygon<Record<string, any>>)[]; id: string; keyWords?: string[]; name: string; properties?: Record<string, any>; }[]-
options.decisionType?"replace" | "ignore" | "keep both"-
options.featureCategories?{ [key: string]: FeatureCategory; parkingType?: FeatureCategory; treeSpecies?: FeatureCategory; usage: { [usageName: string]: Usage; }; }-
options.featureCategories.parkingType?FeatureCategory-
options.featureCategories.treeSpecies?FeatureCategory-
options.featureCategories.usage{ [usageName: string]: Usage; }-
options.flows?{ dependencies: GiraffeNodeGraphFeatureDependancy[]; description?: string; edges: GiraffeEdge[]; id: string; inputs: Record<string, GiraffeNodeInputHandle>; name: string; nodes: GiraffeNode[]; outputs: Record<string, GiraffeNodeInputHandle>; supportedShapes?: string[]; }[]-
options.insertionPoint?[number, number]-
options.keepLayerIds?boolean-

Returns

Promise<( | RawPoint & { temporary?: never; } | RawMultiPoint & { temporary?: never; } | RawLineString & { temporary?: never; } | RawMultiLineString & { temporary?: never; } | RawPolygon & { temporary?: never; } | RawMultiPolygon & { temporary?: never; })[]>

features successfully imported in the project

Throws

Error if feature validation fails or project app JSON is too large