@ifc-lite/parser 4.3.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attribute-helpers.d.ts +38 -4
- package/dist/attribute-helpers.d.ts.map +1 -1
- package/dist/attribute-helpers.js +71 -4
- package/dist/attribute-helpers.js.map +1 -1
- package/dist/columnar-parser-attributes.d.ts.map +1 -1
- package/dist/columnar-parser-attributes.js +35 -5
- package/dist/columnar-parser-attributes.js.map +1 -1
- package/dist/columnar-parser-indexes.d.ts.map +1 -1
- package/dist/columnar-parser-indexes.js +17 -2
- package/dist/columnar-parser-indexes.js.map +1 -1
- package/dist/columnar-parser-relationships.d.ts.map +1 -1
- package/dist/columnar-parser-relationships.js +6 -1
- package/dist/columnar-parser-relationships.js.map +1 -1
- package/dist/columnar-parser.d.ts +3 -1
- package/dist/columnar-parser.d.ts.map +1 -1
- package/dist/columnar-parser.js +27 -76
- package/dist/columnar-parser.js.map +1 -1
- package/dist/compact-entity-index-transport.d.ts +23 -0
- package/dist/compact-entity-index-transport.d.ts.map +1 -0
- package/dist/compact-entity-index-transport.js +28 -0
- package/dist/compact-entity-index-transport.js.map +1 -0
- package/dist/compact-entity-index.d.ts +0 -10
- package/dist/compact-entity-index.d.ts.map +1 -1
- package/dist/compact-entity-index.js +31 -24
- package/dist/compact-entity-index.js.map +1 -1
- package/dist/data-store-transport.d.ts +2 -12
- package/dist/data-store-transport.d.ts.map +1 -1
- package/dist/data-store-transport.js +7 -20
- package/dist/data-store-transport.js.map +1 -1
- package/dist/entity-extractor.d.ts.map +1 -1
- package/dist/entity-extractor.js +101 -6
- package/dist/entity-extractor.js.map +1 -1
- package/dist/entity-refs-from-index.d.ts.map +1 -1
- package/dist/entity-refs-from-index.js +12 -2
- package/dist/entity-refs-from-index.js.map +1 -1
- package/dist/entity-scanner.d.ts +63 -0
- package/dist/entity-scanner.d.ts.map +1 -1
- package/dist/entity-scanner.js +79 -2
- package/dist/entity-scanner.js.map +1 -1
- package/dist/express-id.d.ts +47 -0
- package/dist/express-id.d.ts.map +1 -0
- package/dist/express-id.js +57 -0
- package/dist/express-id.js.map +1 -0
- package/dist/generated/entities.d.ts +1 -1
- package/dist/generated/entities.d.ts.map +1 -1
- package/dist/generated/schema-registry.js +146 -146
- package/dist/generated/schema-registry.js.map +1 -1
- package/dist/georef-epset.d.ts +25 -0
- package/dist/georef-epset.d.ts.map +1 -0
- package/dist/georef-epset.js +214 -0
- package/dist/georef-epset.js.map +1 -0
- package/dist/georef-extractor.d.ts +9 -12
- package/dist/georef-extractor.d.ts.map +1 -1
- package/dist/georef-extractor.js +66 -304
- package/dist/georef-extractor.js.map +1 -1
- package/dist/georef-map-conversion.d.ts +29 -0
- package/dist/georef-map-conversion.d.ts.map +1 -0
- package/dist/georef-map-conversion.js +75 -0
- package/dist/georef-map-conversion.js.map +1 -0
- package/dist/georef-transform.d.ts +25 -0
- package/dist/georef-transform.d.ts.map +1 -0
- package/dist/georef-transform.js +97 -0
- package/dist/georef-transform.js.map +1 -0
- package/dist/ifc-schema.d.ts +4 -2
- package/dist/ifc-schema.d.ts.map +1 -1
- package/dist/ifc-schema.js +15 -5
- package/dist/ifc-schema.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/map-unit-label.d.ts +43 -0
- package/dist/map-unit-label.d.ts.map +1 -0
- package/dist/map-unit-label.js +140 -0
- package/dist/map-unit-label.js.map +1 -0
- package/dist/material-extractor.d.ts +2 -17
- package/dist/material-extractor.d.ts.map +1 -1
- package/dist/material-extractor.js +12 -37
- package/dist/material-extractor.js.map +1 -1
- package/dist/material-layer-reader.d.ts +45 -0
- package/dist/material-layer-reader.d.ts.map +1 -0
- package/dist/material-layer-reader.js +63 -0
- package/dist/material-layer-reader.js.map +1 -0
- package/dist/material-resolver.d.ts.map +1 -1
- package/dist/material-resolver.js +14 -14
- package/dist/material-resolver.js.map +1 -1
- package/dist/measure-unit-scale.d.ts +41 -0
- package/dist/measure-unit-scale.d.ts.map +1 -0
- package/dist/measure-unit-scale.js +53 -0
- package/dist/measure-unit-scale.js.map +1 -0
- package/dist/on-demand-cache.d.ts +3 -0
- package/dist/on-demand-cache.d.ts.map +1 -0
- package/dist/on-demand-cache.js +25 -0
- package/dist/on-demand-cache.js.map +1 -0
- package/dist/on-demand-extractors.d.ts +5 -21
- package/dist/on-demand-extractors.d.ts.map +1 -1
- package/dist/on-demand-extractors.js +64 -437
- package/dist/on-demand-extractors.js.map +1 -1
- package/dist/on-demand-georeferencing.d.ts +19 -0
- package/dist/on-demand-georeferencing.d.ts.map +1 -0
- package/dist/on-demand-georeferencing.js +139 -0
- package/dist/on-demand-georeferencing.js.map +1 -0
- package/dist/owning-project.d.ts +54 -0
- package/dist/owning-project.d.ts.map +1 -0
- package/dist/owning-project.js +76 -0
- package/dist/owning-project.js.map +1 -0
- package/dist/parser.worker.d.ts +14 -0
- package/dist/parser.worker.d.ts.map +1 -1
- package/dist/parser.worker.js +2 -0
- package/dist/parser.worker.js.map +1 -1
- package/dist/project-units-symbols.d.ts +33 -0
- package/dist/project-units-symbols.d.ts.map +1 -0
- package/dist/project-units-symbols.js +265 -0
- package/dist/project-units-symbols.js.map +1 -0
- package/dist/project-units.d.ts +11 -19
- package/dist/project-units.d.ts.map +1 -1
- package/dist/project-units.js +9 -267
- package/dist/project-units.js.map +1 -1
- package/dist/property-set-merge.d.ts +65 -8
- package/dist/property-set-merge.d.ts.map +1 -1
- package/dist/property-set-merge.js +130 -29
- package/dist/property-set-merge.js.map +1 -1
- package/dist/property-value-parser.d.ts +55 -0
- package/dist/property-value-parser.d.ts.map +1 -0
- package/dist/property-value-parser.js +277 -0
- package/dist/property-value-parser.js.map +1 -0
- package/dist/quantity-collect.d.ts +135 -0
- package/dist/quantity-collect.d.ts.map +1 -0
- package/dist/quantity-collect.js +253 -0
- package/dist/quantity-collect.js.map +1 -0
- package/dist/query-backend-maps.d.ts +5 -8
- package/dist/query-backend-maps.d.ts.map +1 -1
- package/dist/query-backend-maps.js +159 -15
- package/dist/query-backend-maps.js.map +1 -1
- package/dist/relationship-extractor.d.ts.map +1 -1
- package/dist/relationship-extractor.js +18 -0
- package/dist/relationship-extractor.js.map +1 -1
- package/dist/scan-entities-balanced.d.ts +38 -0
- package/dist/scan-entities-balanced.d.ts.map +1 -0
- package/dist/scan-entities-balanced.js +258 -0
- package/dist/scan-entities-balanced.js.map +1 -0
- package/dist/scan-worker-inline.d.ts +17 -11
- package/dist/scan-worker-inline.d.ts.map +1 -1
- package/dist/scan-worker-inline.js +9 -235
- package/dist/scan-worker-inline.js.map +1 -1
- package/dist/scan-worker-source.d.ts +9 -0
- package/dist/scan-worker-source.d.ts.map +1 -0
- package/dist/scan-worker-source.js +383 -0
- package/dist/scan-worker-source.js.map +1 -0
- package/dist/source-header.d.ts +23 -1
- package/dist/source-header.d.ts.map +1 -1
- package/dist/source-header.js +133 -43
- package/dist/source-header.js.map +1 -1
- package/dist/spatial-hierarchy-builder.js +3 -3
- package/dist/spatial-hierarchy-builder.js.map +1 -1
- package/dist/step-lexing.d.ts +94 -0
- package/dist/step-lexing.d.ts.map +1 -1
- package/dist/step-lexing.js +292 -25
- package/dist/step-lexing.js.map +1 -1
- package/dist/step-trivia.d.ts +60 -0
- package/dist/step-trivia.d.ts.map +1 -0
- package/dist/step-trivia.js +63 -0
- package/dist/step-trivia.js.map +1 -0
- package/dist/tokenizer.d.ts +20 -21
- package/dist/tokenizer.d.ts.map +1 -1
- package/dist/tokenizer.js +164 -203
- package/dist/tokenizer.js.map +1 -1
- package/dist/unit-extractor.d.ts +56 -1
- package/dist/unit-extractor.d.ts.map +1 -1
- package/dist/unit-extractor.js +80 -6
- package/dist/unit-extractor.js.map +1 -1
- package/dist/worker-parser.d.ts +11 -1
- package/dist/worker-parser.d.ts.map +1 -1
- package/dist/worker-parser.js +16 -2
- package/dist/worker-parser.js.map +1 -1
- package/package.json +6 -6
package/dist/georef-extractor.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { computeTransformMatrix } from './georef-transform.js';
|
|
5
|
+
// The transform side lives in ./georef-transform.ts; re-exported here so
|
|
6
|
+
// every existing `from './georef-extractor.js'` import keeps resolving.
|
|
7
|
+
export { transformToWorld, transformToLocal, getCoordinateSystemDescription, } from './georef-transform.js';
|
|
8
|
+
import { getString, getNumber, getReference, isUnrepresentableNumericValue, } from './attribute-helpers.js';
|
|
9
|
+
import { extractMapConversion } from './georef-map-conversion.js';
|
|
10
|
+
import { extractEPSetMapConversion } from './georef-epset.js';
|
|
11
|
+
import { CONVERSION_BASED_UNIT_FACTORS, SI_PREFIX_MULTIPLIERS } from './unit-extractor.js';
|
|
6
12
|
import { getAttributeNames } from './ifc-schema.js';
|
|
7
13
|
/**
|
|
8
14
|
* Compute angle to grid north from XAxisAbscissa and XAxisOrdinate (in degrees).
|
|
@@ -17,6 +23,17 @@ export function computeAngleToGridNorth(xAxisAbscissa, xAxisOrdinate) {
|
|
|
17
23
|
const radians = Math.atan2(xAxisOrdinate, xAxisAbscissa);
|
|
18
24
|
return radians * (180 / Math.PI);
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Every concrete class that carries an IfcMapConversion's attributes, in the
|
|
28
|
+
* mixed-case spelling `entitiesByType` is keyed by. `IfcMapConversionScaled`
|
|
29
|
+
* is IFC4X3's scaled variant and the only subtype in any bundled schema; it is
|
|
30
|
+
* listed here rather than folded into the caller so that every consumer of the
|
|
31
|
+
* exported `extractGeoreferencing` widens identically.
|
|
32
|
+
*/
|
|
33
|
+
export const MAP_CONVERSION_TYPE_NAMES = [
|
|
34
|
+
'IfcMapConversion',
|
|
35
|
+
'IfcMapConversionScaled',
|
|
36
|
+
];
|
|
20
37
|
/**
|
|
21
38
|
* Extract georeferencing information from IFC entities
|
|
22
39
|
*/
|
|
@@ -24,13 +41,28 @@ export function extractGeoreferencing(entities, entitiesByType) {
|
|
|
24
41
|
const info = {
|
|
25
42
|
hasGeoreference: false,
|
|
26
43
|
};
|
|
27
|
-
// Extract IfcMapConversion
|
|
28
|
-
|
|
44
|
+
// Extract IfcMapConversion — including IFC4X3's concrete subtype
|
|
45
|
+
// IfcMapConversionScaled, which a type-keyed lookup for the supertype alone
|
|
46
|
+
// never sees. Its first eight attributes ARE IfcMapConversion's (SourceCRS,
|
|
47
|
+
// TargetCRS, Eastings, Northings, OrthogonalHeight, XAxisAbscissa,
|
|
48
|
+
// XAxisOrdinate, Scale); the three it adds (FactorX/Y/Z) sit after them, so
|
|
49
|
+
// reading it as its supertype is well-defined. Missing it did not merely
|
|
50
|
+
// omit a field: with no mapConversion there is no `transformMatrix`, so a
|
|
51
|
+
// file georeferenced this way was placed at its local origin instead of its
|
|
52
|
+
// map position.
|
|
53
|
+
const mapConversionIds = MAP_CONVERSION_TYPE_NAMES.flatMap((typeName) => entitiesByType.get(typeName) ?? []);
|
|
29
54
|
if (mapConversionIds.length > 0) {
|
|
30
55
|
const entity = entities.get(mapConversionIds[0]);
|
|
31
56
|
if (entity) {
|
|
32
|
-
|
|
33
|
-
|
|
57
|
+
// A refused conversion leaves the field absent and does not claim
|
|
58
|
+
// `hasGeoreference`. An IfcProjectedCRS further down may still claim it —
|
|
59
|
+
// correct: the file does declare a CRS, it just carries no usable
|
|
60
|
+
// placement.
|
|
61
|
+
const mapConversion = extractMapConversion(entity);
|
|
62
|
+
if (mapConversion) {
|
|
63
|
+
info.mapConversion = mapConversion;
|
|
64
|
+
info.hasGeoreference = true;
|
|
65
|
+
}
|
|
34
66
|
}
|
|
35
67
|
}
|
|
36
68
|
// Extract IfcProjectedCRS
|
|
@@ -63,181 +95,6 @@ export function extractGeoreferencing(entities, entitiesByType) {
|
|
|
63
95
|
}
|
|
64
96
|
return info;
|
|
65
97
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Unwrap an IfcValue `NominalValue`. The columnar/on-demand extractor delivers
|
|
68
|
-
* typed values as a `[TYPENAME, value]` tuple (e.g.
|
|
69
|
-
* `["IFCLENGTHMEASURE", 160073528]`, `["IFCLABEL", "EPSG:7415"]`), which
|
|
70
|
-
* `getNumber`/`getString` don't see through; raw scalars (used by the
|
|
71
|
-
* entity-map callers) pass through untouched.
|
|
72
|
-
*/
|
|
73
|
-
function unwrapNominalValue(value) {
|
|
74
|
-
if (Array.isArray(value) && value.length >= 2 && typeof value[0] === 'string') {
|
|
75
|
-
return value[1];
|
|
76
|
-
}
|
|
77
|
-
return value;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Read an `IfcPropertySet`'s `IfcPropertySingleValue` children into a
|
|
81
|
-
* name → raw-value map, keeping the value as-is (string or number) so both
|
|
82
|
-
* numeric (Eastings) and string (TargetCRS, EPSG Name) properties survive.
|
|
83
|
-
*/
|
|
84
|
-
function readPsetSingleValues(entities, pset) {
|
|
85
|
-
const values = {};
|
|
86
|
-
// IfcPropertySet: GlobalId (0), OwnerHistory (1), Name (2), Description (3), HasProperties (4)
|
|
87
|
-
const props = pset.attributes[4];
|
|
88
|
-
if (Array.isArray(props)) {
|
|
89
|
-
for (const propRef of props) {
|
|
90
|
-
const propId = getReference(propRef);
|
|
91
|
-
if (!propId)
|
|
92
|
-
continue;
|
|
93
|
-
const prop = entities.get(propId);
|
|
94
|
-
if (!prop)
|
|
95
|
-
continue;
|
|
96
|
-
// IfcPropertySingleValue: Name (0), Description (1), NominalValue (2)
|
|
97
|
-
const propName = getString(prop.attributes[0]);
|
|
98
|
-
if (!propName)
|
|
99
|
-
continue;
|
|
100
|
-
const raw = unwrapNominalValue(prop.attributes[2]);
|
|
101
|
-
if (typeof raw === 'number') {
|
|
102
|
-
values[propName] = raw;
|
|
103
|
-
}
|
|
104
|
-
else if (typeof raw === 'string') {
|
|
105
|
-
// Keep the raw string verbatim. Coordinate fields are coerced on read
|
|
106
|
-
// via `asNumber` (some writers store Eastings/Scale as strings), while
|
|
107
|
-
// CRS metadata that merely looks numeric — `Name: "7415"`, `MapZone:
|
|
108
|
-
// "31N"` — must stay a string so `asString` doesn't discard it.
|
|
109
|
-
values[propName] = raw;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return values;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Find the first `IfcPropertySet` whose Name matches `targetName`
|
|
117
|
-
* case-insensitively. buildingSMART's geo-referencing guide spells the
|
|
118
|
-
* IFC2x3 property sets `ePSet_…` (capital S), but real authoring tools (e.g.
|
|
119
|
-
* the `ifc-georeferencer` post-processor) write `ePset_…` (lowercase) — an
|
|
120
|
-
* exact match silently dropped those models to the legacy IfcSite/EPSG:4326
|
|
121
|
-
* fallback, so they displayed the wrong CRS.
|
|
122
|
-
*/
|
|
123
|
-
function findPsetByName(entities, entitiesByType, targetName) {
|
|
124
|
-
const target = targetName.toLowerCase();
|
|
125
|
-
const psetIds = entitiesByType.get('IfcPropertySet') || [];
|
|
126
|
-
for (const psetId of psetIds) {
|
|
127
|
-
const pset = entities.get(psetId);
|
|
128
|
-
if (!pset)
|
|
129
|
-
continue;
|
|
130
|
-
const name = getString(pset.attributes[2]);
|
|
131
|
-
if (name && name.toLowerCase() === target)
|
|
132
|
-
return pset;
|
|
133
|
-
}
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
function asString(value) {
|
|
137
|
-
if (typeof value === 'string')
|
|
138
|
-
return value.length > 0 ? value : undefined;
|
|
139
|
-
if (typeof value === 'number')
|
|
140
|
-
return String(value);
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
function asNumber(value) {
|
|
144
|
-
return typeof value === 'number' ? value : getNumber(value);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Map an IFC unit label (e.g. "MILLIMETRE", "FOOT") to its metre scale.
|
|
148
|
-
* Mirrors the viewer's `inferMapUnitScale` and the native `IfcProjectedCRS`
|
|
149
|
-
* path so direct parser/MCP consumers of `ProjectedCRS.mapUnitScale` see the
|
|
150
|
-
* same scale regardless of whether the CRS came from a native entity or an
|
|
151
|
-
* ePSet. Returns `undefined` for an absent/unknown unit (the ePSet convention
|
|
152
|
-
* then defers to the project length unit downstream).
|
|
153
|
-
*/
|
|
154
|
-
function inferMapUnitScaleFromLabel(mapUnit) {
|
|
155
|
-
if (!mapUnit)
|
|
156
|
-
return undefined;
|
|
157
|
-
const n = mapUnit.toUpperCase();
|
|
158
|
-
if (n.includes('US') && (n.includes('SURVEY') || n.includes('FTUS')))
|
|
159
|
-
return 0.3048006096;
|
|
160
|
-
if (n.includes('FOOT') || n.includes('FEET'))
|
|
161
|
-
return 0.3048;
|
|
162
|
-
if (n.includes('MILLI'))
|
|
163
|
-
return 0.001;
|
|
164
|
-
if (n.includes('CENTI'))
|
|
165
|
-
return 0.01;
|
|
166
|
-
if (n.includes('DECI'))
|
|
167
|
-
return 0.1;
|
|
168
|
-
if (n.includes('KILO'))
|
|
169
|
-
return 1000;
|
|
170
|
-
if (n.includes('METRE') || n.includes('METER'))
|
|
171
|
-
return 1;
|
|
172
|
-
return undefined;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* IFC2x3 fallback: a property set named `ePSet_MapConversion` (any casing)
|
|
176
|
-
* carrying Eastings/Northings/OrthogonalHeight (+ optional
|
|
177
|
-
* XAxisAbscissa/XAxisOrdinate/Scale/TargetCRS), optionally paired with an
|
|
178
|
-
* `ePSet_ProjectedCRS` set carrying the EPSG `Name`. Mirrors
|
|
179
|
-
* `GeoRefExtractor::extract_from_pset` in rust/core/src/georef.rs.
|
|
180
|
-
*/
|
|
181
|
-
function extractEPSetMapConversion(entities, entitiesByType) {
|
|
182
|
-
const pset = findPsetByName(entities, entitiesByType, 'ePSet_MapConversion');
|
|
183
|
-
if (!pset)
|
|
184
|
-
return null;
|
|
185
|
-
const values = readPsetSingleValues(entities, pset);
|
|
186
|
-
// Some writers store the offsets as strings, so coerce on read.
|
|
187
|
-
const eastings = asNumber(values['Eastings']) ?? 0;
|
|
188
|
-
const northings = asNumber(values['Northings']) ?? 0;
|
|
189
|
-
const orthogonalHeight = asNumber(values['OrthogonalHeight']) ?? 0;
|
|
190
|
-
const mapConversion = {
|
|
191
|
-
id: pset.expressId,
|
|
192
|
-
sourceCRS: 0,
|
|
193
|
-
targetCRS: 0,
|
|
194
|
-
eastings,
|
|
195
|
-
northings,
|
|
196
|
-
orthogonalHeight,
|
|
197
|
-
xAxisAbscissa: asNumber(values['XAxisAbscissa']),
|
|
198
|
-
xAxisOrdinate: asNumber(values['XAxisOrdinate']),
|
|
199
|
-
scale: asNumber(values['Scale']),
|
|
200
|
-
};
|
|
201
|
-
// Resolve the CRS name from ePSet_ProjectedCRS.Name, falling back to the
|
|
202
|
-
// MapConversion's TargetCRS (the ifc-georeferencer tool writes both as the
|
|
203
|
-
// same EPSG label). Without this the EPSG code in the file was never
|
|
204
|
-
// surfaced on the IFC2x3 path.
|
|
205
|
-
const crsPset = findPsetByName(entities, entitiesByType, 'ePSet_ProjectedCRS');
|
|
206
|
-
const crsValues = crsPset ? readPsetSingleValues(entities, crsPset) : {};
|
|
207
|
-
const crsName = asString(crsValues['Name']) ?? asString(values['TargetCRS']);
|
|
208
|
-
// Reject only when there is nothing to georeference by: no CRS name AND the
|
|
209
|
-
// placement sits at the local origin. Mirrors `has_georef()` in rust/core
|
|
210
|
-
// (a CRS name OR any non-zero offset is sufficient) so a valid zero-origin
|
|
211
|
-
// placement at a real projected CRS is kept rather than dropping to the
|
|
212
|
-
// legacy IfcSite/EPSG:4326 fallback.
|
|
213
|
-
if (!crsName && eastings === 0 && northings === 0 && orthogonalHeight === 0)
|
|
214
|
-
return null;
|
|
215
|
-
let projectedCRS;
|
|
216
|
-
if (crsName || crsPset) {
|
|
217
|
-
const mapUnit = asString(crsValues['MapUnit']);
|
|
218
|
-
projectedCRS = {
|
|
219
|
-
id: crsPset?.expressId ?? pset.expressId,
|
|
220
|
-
name: crsName ?? '',
|
|
221
|
-
description: asString(crsValues['Description']),
|
|
222
|
-
geodeticDatum: asString(crsValues['GeodeticDatum']),
|
|
223
|
-
verticalDatum: asString(crsValues['VerticalDatum']),
|
|
224
|
-
mapProjection: asString(crsValues['MapProjection']),
|
|
225
|
-
mapZone: asString(crsValues['MapZone']),
|
|
226
|
-
mapUnit,
|
|
227
|
-
// An explicit ePSet MapUnit carries its own scale (parity with the native
|
|
228
|
-
// IfcProjectedCRS path). When absent, leave it undefined so consumers fall
|
|
229
|
-
// back to the project length unit per the buildingSMART convention.
|
|
230
|
-
mapUnitScale: inferMapUnitScaleFromLabel(mapUnit),
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
hasGeoreference: true,
|
|
235
|
-
source: 'ePSetMapConversion',
|
|
236
|
-
mapConversion,
|
|
237
|
-
projectedCRS,
|
|
238
|
-
transformMatrix: computeTransformMatrix(mapConversion),
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
98
|
function getAttributeValueByName(entity, attributeName) {
|
|
242
99
|
const attributeNames = getAttributeNames(entity.type);
|
|
243
100
|
const index = attributeNames.indexOf(attributeName);
|
|
@@ -245,6 +102,12 @@ function getAttributeValueByName(entity, attributeName) {
|
|
|
245
102
|
return undefined;
|
|
246
103
|
return entity.attributes[index];
|
|
247
104
|
}
|
|
105
|
+
// Canonical sign lives on the first non-zero component (`minutesRaw < 0`
|
|
106
|
+
// below already handles it); this also defensively honours `-0` on a
|
|
107
|
+
// zero-magnitude degree token, which `x < 0` alone misses (IEEE-754 -0).
|
|
108
|
+
function isNegativeComponent(n) {
|
|
109
|
+
return n < 0 || Object.is(n, -0);
|
|
110
|
+
}
|
|
248
111
|
function compoundPlaneAngleToDecimalDegrees(value) {
|
|
249
112
|
if (!Array.isArray(value) || value.length < 3)
|
|
250
113
|
return undefined;
|
|
@@ -254,7 +117,12 @@ function compoundPlaneAngleToDecimalDegrees(value) {
|
|
|
254
117
|
if (numbers.length < 3)
|
|
255
118
|
return undefined;
|
|
256
119
|
const [degreesRaw, minutesRaw, secondsRaw, millionthsRaw = 0] = numbers;
|
|
257
|
-
const sign = degreesRaw
|
|
120
|
+
const sign = isNegativeComponent(degreesRaw) ||
|
|
121
|
+
isNegativeComponent(minutesRaw) ||
|
|
122
|
+
isNegativeComponent(secondsRaw) ||
|
|
123
|
+
isNegativeComponent(millionthsRaw)
|
|
124
|
+
? -1
|
|
125
|
+
: 1;
|
|
258
126
|
const degrees = Math.abs(degreesRaw);
|
|
259
127
|
const minutes = Math.abs(minutesRaw);
|
|
260
128
|
const seconds = Math.abs(secondsRaw);
|
|
@@ -269,7 +137,20 @@ function extractLegacySiteGeoreference(entities, entitiesByType) {
|
|
|
269
137
|
continue;
|
|
270
138
|
const latitude = compoundPlaneAngleToDecimalDegrees(getAttributeValueByName(site, 'RefLatitude'));
|
|
271
139
|
const longitude = compoundPlaneAngleToDecimalDegrees(getAttributeValueByName(site, 'RefLongitude'));
|
|
272
|
-
|
|
140
|
+
// The same rule again, on the legacy site path. An absent `RefElevation`
|
|
141
|
+
// legitimately means "at the datum" and keeps its `0`; an elevation the
|
|
142
|
+
// double range cannot hold does not, and this site is skipped so a later
|
|
143
|
+
// one — or no georeference at all — is reported instead of a model pinned
|
|
144
|
+
// to the datum. `?? 0` alone stopped being safe when `getNumber` began
|
|
145
|
+
// answering `undefined` for such a literal.
|
|
146
|
+
const rawElevation = getAttributeValueByName(site, 'RefElevation');
|
|
147
|
+
if (isUnrepresentableNumericValue(rawElevation)) {
|
|
148
|
+
console.warn(`[georef-extractor] IfcSite #${site.expressId} RefElevation is outside the ` +
|
|
149
|
+
`IEEE-754 double range (${String(rawElevation)}); skipping this site rather than ` +
|
|
150
|
+
`reporting it at a substituted elevation.`);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const elevation = getNumber(rawElevation) ?? 0;
|
|
273
154
|
if (latitude === undefined || longitude === undefined)
|
|
274
155
|
continue;
|
|
275
156
|
return {
|
|
@@ -296,32 +177,6 @@ function extractLegacySiteGeoreference(entities, entitiesByType) {
|
|
|
296
177
|
}
|
|
297
178
|
return null;
|
|
298
179
|
}
|
|
299
|
-
function extractMapConversion(entity) {
|
|
300
|
-
// IfcMapConversion attributes (IFC4):
|
|
301
|
-
// [0] SourceCRS (IfcCoordinateReferenceSystem)
|
|
302
|
-
// [1] TargetCRS (IfcCoordinateReferenceSystem)
|
|
303
|
-
// [2] Eastings (IfcLengthMeasure)
|
|
304
|
-
// [3] Northings (IfcLengthMeasure)
|
|
305
|
-
// [4] OrthogonalHeight (IfcLengthMeasure)
|
|
306
|
-
// [5] XAxisAbscissa (OPTIONAL IfcReal)
|
|
307
|
-
// [6] XAxisOrdinate (OPTIONAL IfcReal)
|
|
308
|
-
// [7] Scale (OPTIONAL IfcReal)
|
|
309
|
-
return {
|
|
310
|
-
id: entity.expressId,
|
|
311
|
-
sourceCRS: getReference(entity.attributes[0]) || 0,
|
|
312
|
-
targetCRS: getReference(entity.attributes[1]) || 0,
|
|
313
|
-
eastings: getNumber(entity.attributes[2]) || 0,
|
|
314
|
-
northings: getNumber(entity.attributes[3]) || 0,
|
|
315
|
-
orthogonalHeight: getNumber(entity.attributes[4]) || 0,
|
|
316
|
-
xAxisAbscissa: getNumber(entity.attributes[5]),
|
|
317
|
-
xAxisOrdinate: getNumber(entity.attributes[6]),
|
|
318
|
-
scale: getNumber(entity.attributes[7]),
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
/** SI prefix → scale factor */
|
|
322
|
-
const SI_PREFIX_SCALE = {
|
|
323
|
-
'MILLI': 0.001, 'CENTI': 0.01, 'DECI': 0.1, 'KILO': 1000,
|
|
324
|
-
};
|
|
325
180
|
/**
|
|
326
181
|
* Resolve an `IfcMeasureWithUnit` reference to metres.
|
|
327
182
|
*
|
|
@@ -354,7 +209,7 @@ function resolveMeasureWithUnit(ref, resolveEntity) {
|
|
|
354
209
|
if (component && (component.type ?? '').toUpperCase() === 'IFCSIUNIT') {
|
|
355
210
|
const prefix = component.attributes?.[2];
|
|
356
211
|
if (typeof prefix === 'string' && prefix !== '$') {
|
|
357
|
-
const prefixScale =
|
|
212
|
+
const prefixScale = SI_PREFIX_MULTIPLIERS[prefix.replace(/\./g, '').toUpperCase()];
|
|
358
213
|
if (prefixScale !== undefined)
|
|
359
214
|
componentScale = prefixScale;
|
|
360
215
|
}
|
|
@@ -412,7 +267,7 @@ function extractProjectedCRS(entity, resolveEntity) {
|
|
|
412
267
|
const prefix = unitEntity.attributes?.[2];
|
|
413
268
|
if (prefix != null && prefix !== '$' && typeof prefix === 'string') {
|
|
414
269
|
const prefixStr = prefix.replace(/\./g, '').toUpperCase();
|
|
415
|
-
const prefixScale =
|
|
270
|
+
const prefixScale = SI_PREFIX_MULTIPLIERS[prefixStr];
|
|
416
271
|
if (prefixScale !== undefined) {
|
|
417
272
|
mapUnitScale = prefixScale;
|
|
418
273
|
mapUnit = prefixStr === 'MILLI' ? 'MILLIMETRE' : prefixStr + 'METRE';
|
|
@@ -437,97 +292,4 @@ function extractProjectedCRS(entity, resolveEntity) {
|
|
|
437
292
|
mapUnitScale,
|
|
438
293
|
};
|
|
439
294
|
}
|
|
440
|
-
/**
|
|
441
|
-
* Compute 4x4 transformation matrix from local to world coordinates
|
|
442
|
-
*/
|
|
443
|
-
function computeTransformMatrix(mapConversion) {
|
|
444
|
-
const { eastings, northings, orthogonalHeight, xAxisAbscissa, xAxisOrdinate, scale } = mapConversion;
|
|
445
|
-
// Default scale to 1.0 if not specified
|
|
446
|
-
const s = scale || 1.0;
|
|
447
|
-
// Compute rotation angle from X-axis direction
|
|
448
|
-
let angle = 0;
|
|
449
|
-
if (xAxisAbscissa !== undefined && xAxisOrdinate !== undefined) {
|
|
450
|
-
angle = Math.atan2(xAxisOrdinate, xAxisAbscissa);
|
|
451
|
-
}
|
|
452
|
-
const cos = Math.cos(angle);
|
|
453
|
-
const sin = Math.sin(angle);
|
|
454
|
-
// Build 4x4 transformation matrix (IfcMapConversion applies the one
|
|
455
|
-
// Scale equally to x, y AND z, then rotates about z, then translates):
|
|
456
|
-
// [scale*cos -scale*sin 0 eastings ]
|
|
457
|
-
// [scale*sin scale*cos 0 northings ]
|
|
458
|
-
// [0 0 scale height ]
|
|
459
|
-
// [0 0 0 1 ]
|
|
460
|
-
return [
|
|
461
|
-
s * cos, s * sin, 0, 0,
|
|
462
|
-
-s * sin, s * cos, 0, 0,
|
|
463
|
-
0, 0, s, 0,
|
|
464
|
-
eastings, northings, orthogonalHeight, 1,
|
|
465
|
-
];
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Transform a point from local to world coordinates
|
|
469
|
-
*/
|
|
470
|
-
export function transformToWorld(localPoint, georef) {
|
|
471
|
-
if (!georef.transformMatrix) {
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
|
-
const [x, y, z] = localPoint;
|
|
475
|
-
const m = georef.transformMatrix;
|
|
476
|
-
// Apply transformation: [x', y', z', 1] = [x, y, z, 1] * M
|
|
477
|
-
const xWorld = m[0] * x + m[4] * y + m[8] * z + m[12];
|
|
478
|
-
const yWorld = m[1] * x + m[5] * y + m[9] * z + m[13];
|
|
479
|
-
const zWorld = m[2] * x + m[6] * y + m[10] * z + m[14];
|
|
480
|
-
return [xWorld, yWorld, zWorld];
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Transform a point from world to local coordinates
|
|
484
|
-
*/
|
|
485
|
-
export function transformToLocal(worldPoint, georef) {
|
|
486
|
-
if (!georef.transformMatrix) {
|
|
487
|
-
return null;
|
|
488
|
-
}
|
|
489
|
-
// Compute inverse transformation
|
|
490
|
-
const m = georef.transformMatrix;
|
|
491
|
-
const [xWorld, yWorld, zWorld] = worldPoint;
|
|
492
|
-
// Extract rotation and scale
|
|
493
|
-
const scale = georef.mapConversion?.scale || 1.0;
|
|
494
|
-
const angle = Math.atan2(m[1], m[0]);
|
|
495
|
-
const cos = Math.cos(-angle);
|
|
496
|
-
const sin = Math.sin(-angle);
|
|
497
|
-
const invScale = 1.0 / scale;
|
|
498
|
-
// Apply inverse translation
|
|
499
|
-
const xTrans = xWorld - m[12];
|
|
500
|
-
const yTrans = yWorld - m[13];
|
|
501
|
-
const zTrans = zWorld - m[14];
|
|
502
|
-
// Apply inverse rotation and scale
|
|
503
|
-
const x = invScale * (cos * xTrans - sin * yTrans);
|
|
504
|
-
const y = invScale * (sin * xTrans + cos * yTrans);
|
|
505
|
-
// Scale applies to z too (IfcMapConversion scales all three axes).
|
|
506
|
-
const z = invScale * zTrans;
|
|
507
|
-
return [x, y, z];
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* Get coordinate system description
|
|
511
|
-
*/
|
|
512
|
-
export function getCoordinateSystemDescription(georef) {
|
|
513
|
-
if (!georef.hasGeoreference) {
|
|
514
|
-
return 'Local Engineering Coordinates';
|
|
515
|
-
}
|
|
516
|
-
const parts = [];
|
|
517
|
-
if (georef.projectedCRS) {
|
|
518
|
-
parts.push(georef.projectedCRS.name);
|
|
519
|
-
if (georef.projectedCRS.mapProjection) {
|
|
520
|
-
parts.push(`(${georef.projectedCRS.mapProjection})`);
|
|
521
|
-
}
|
|
522
|
-
if (georef.projectedCRS.geodeticDatum) {
|
|
523
|
-
parts.push(`Datum: ${georef.projectedCRS.geodeticDatum}`);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (georef.mapConversion) {
|
|
527
|
-
const { eastings, northings, orthogonalHeight } = georef.mapConversion;
|
|
528
|
-
const originLabel = georef.source === 'siteLocation' ? 'Site' : 'Origin';
|
|
529
|
-
parts.push(`${originLabel}: (${eastings.toFixed(2)}, ${northings.toFixed(2)}, ${orthogonalHeight.toFixed(2)})`);
|
|
530
|
-
}
|
|
531
|
-
return parts.join(' ');
|
|
532
|
-
}
|
|
533
295
|
//# sourceMappingURL=georef-extractor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"georef-extractor.js","sourceRoot":"","sources":["../src/georef-extractor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,aAAsB,EACtB,aAAsB;IAEtB,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACzD,OAAO,OAAO,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC;AA4BD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAgC,EAChC,cAAqC;IAErC,MAAM,IAAI,GAAqB;QAC7B,eAAe,EAAE,KAAK;KACvB,CAAC;IAEF,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACtE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG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C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,kFAAkF;IAClF,+DAA+D;IAE/D,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,SAAS;QACpB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;QAC3C,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5C,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9C,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9C,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads one `IfcMapConversion` (or `IfcMapConversionScaled`) into a
|
|
3
|
+
* `MapConversion`, or refuses it.
|
|
4
|
+
*
|
|
5
|
+
* Split out of `georef-extractor.ts` the same way the transform side lives in
|
|
6
|
+
* `georef-transform.ts`: the refusal rule below is the part most likely to
|
|
7
|
+
* grow — every mandatory component added to a future schema revision is
|
|
8
|
+
* another slot to check — and it does not belong in a file that is already at
|
|
9
|
+
* its module-size budget.
|
|
10
|
+
*/
|
|
11
|
+
import type { IfcEntity } from './entity-extractor.js';
|
|
12
|
+
import type { MapConversion } from './georef-extractor.js';
|
|
13
|
+
/**
|
|
14
|
+
* Refuse the whole map conversion when a component the transform reads names a
|
|
15
|
+
* number the double range cannot hold, rather than letting `|| 0` put a zero
|
|
16
|
+
* there.
|
|
17
|
+
*
|
|
18
|
+
* `eastings`/`northings`/`orthogonalHeight` are typed `number` and feed
|
|
19
|
+
* `transformMatrix`, the STEP georeferencing writer and the viewer's placement
|
|
20
|
+
* editor, so absence cannot be expressed in the field itself.
|
|
21
|
+
* `GeoreferenceInfo.mapConversion` IS optional, and every consumer already
|
|
22
|
+
* reaches it as `georef.mapConversion?.eastings` — so refusing here reports
|
|
23
|
+
* "this file has no usable georeference", which is true and which a caller can
|
|
24
|
+
* see. A zero easting is a plausible coordinate: it silently places the model
|
|
25
|
+
* at the projection origin, and nothing downstream can tell that apart from a
|
|
26
|
+
* model that really sits there.
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractMapConversion(entity: IfcEntity): MapConversion | null;
|
|
29
|
+
//# sourceMappingURL=georef-map-conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"georef-map-conversion.d.ts","sourceRoot":"","sources":["../src/georef-map-conversion.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA4B3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,IAAI,CAiC5E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { getNumber, getReference, isUnrepresentableNumericValue } from './attribute-helpers.js';
|
|
5
|
+
/**
|
|
6
|
+
* Every numeric component of `IfcMapConversion` that `computeTransformMatrix`
|
|
7
|
+
* reads.
|
|
8
|
+
*
|
|
9
|
+
* Slots 2-4 are the mandatory `IfcLengthMeasure` placement components. Slots
|
|
10
|
+
* 5-7 are OPTIONAL in the schema, and their absence is not the problem — an
|
|
11
|
+
* absent attribute is not a numeric literal, so the predicate below is false
|
|
12
|
+
* for it and the conversion is built as before. What they cannot do is be
|
|
13
|
+
* *present and unrepresentable*: `computeTransformMatrix` turns an undefined
|
|
14
|
+
* `scale` into `1.0` and an undefined axis pair into an angle of `0`, so
|
|
15
|
+
* dropping just the overflowing optional field would substitute the schema
|
|
16
|
+
* default for a value the file explicitly stated. That is the same plausible
|
|
17
|
+
* substitution as a `0` easting — an unrotated, unscaled placement is exactly
|
|
18
|
+
* what a normal file looks like — so an overflowing optional component
|
|
19
|
+
* refuses the whole conversion too.
|
|
20
|
+
*/
|
|
21
|
+
const TRANSFORM_NUMERIC_SLOTS = [
|
|
22
|
+
[2, 'Eastings'],
|
|
23
|
+
[3, 'Northings'],
|
|
24
|
+
[4, 'OrthogonalHeight'],
|
|
25
|
+
[5, 'XAxisAbscissa'],
|
|
26
|
+
[6, 'XAxisOrdinate'],
|
|
27
|
+
[7, 'Scale'],
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Refuse the whole map conversion when a component the transform reads names a
|
|
31
|
+
* number the double range cannot hold, rather than letting `|| 0` put a zero
|
|
32
|
+
* there.
|
|
33
|
+
*
|
|
34
|
+
* `eastings`/`northings`/`orthogonalHeight` are typed `number` and feed
|
|
35
|
+
* `transformMatrix`, the STEP georeferencing writer and the viewer's placement
|
|
36
|
+
* editor, so absence cannot be expressed in the field itself.
|
|
37
|
+
* `GeoreferenceInfo.mapConversion` IS optional, and every consumer already
|
|
38
|
+
* reaches it as `georef.mapConversion?.eastings` — so refusing here reports
|
|
39
|
+
* "this file has no usable georeference", which is true and which a caller can
|
|
40
|
+
* see. A zero easting is a plausible coordinate: it silently places the model
|
|
41
|
+
* at the projection origin, and nothing downstream can tell that apart from a
|
|
42
|
+
* model that really sits there.
|
|
43
|
+
*/
|
|
44
|
+
export function extractMapConversion(entity) {
|
|
45
|
+
for (const [slot, name] of TRANSFORM_NUMERIC_SLOTS) {
|
|
46
|
+
const raw = entity.attributes[slot];
|
|
47
|
+
if (isUnrepresentableNumericValue(raw)) {
|
|
48
|
+
console.warn(`[georef-extractor] ${entity.type} #${entity.expressId} ${name} is outside the ` +
|
|
49
|
+
`IEEE-754 double range (${String(raw)}); refusing the map conversion rather than ` +
|
|
50
|
+
`placing the model at a substituted origin.`);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// IfcMapConversion attributes (IFC4):
|
|
55
|
+
// [0] SourceCRS (IfcCoordinateReferenceSystem)
|
|
56
|
+
// [1] TargetCRS (IfcCoordinateReferenceSystem)
|
|
57
|
+
// [2] Eastings (IfcLengthMeasure)
|
|
58
|
+
// [3] Northings (IfcLengthMeasure)
|
|
59
|
+
// [4] OrthogonalHeight (IfcLengthMeasure)
|
|
60
|
+
// [5] XAxisAbscissa (OPTIONAL IfcReal)
|
|
61
|
+
// [6] XAxisOrdinate (OPTIONAL IfcReal)
|
|
62
|
+
// [7] Scale (OPTIONAL IfcReal)
|
|
63
|
+
return {
|
|
64
|
+
id: entity.expressId,
|
|
65
|
+
sourceCRS: getReference(entity.attributes[0]) || 0,
|
|
66
|
+
targetCRS: getReference(entity.attributes[1]) || 0,
|
|
67
|
+
eastings: getNumber(entity.attributes[2]) || 0,
|
|
68
|
+
northings: getNumber(entity.attributes[3]) || 0,
|
|
69
|
+
orthogonalHeight: getNumber(entity.attributes[4]) || 0,
|
|
70
|
+
xAxisAbscissa: getNumber(entity.attributes[5]),
|
|
71
|
+
xAxisOrdinate: getNumber(entity.attributes[6]),
|
|
72
|
+
scale: getNumber(entity.attributes[7]),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=georef-map-conversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"georef-map-conversion.js","sourceRoot":"","sources":["../src/georef-map-conversion.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAe/D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;A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M,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/C,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9C,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9C,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The local <-> world side of georeferencing: the 4x4 matrix an
|
|
3
|
+
* IfcMapConversion defines, the two point transforms that use it, and the
|
|
4
|
+
* human-readable description of the resulting coordinate system. Split out of
|
|
5
|
+
* georef-extractor.ts, which reads the entities; this file only does the
|
|
6
|
+
* arithmetic on what that produced.
|
|
7
|
+
*/
|
|
8
|
+
import type { MapConversion, GeoreferenceInfo } from './georef-extractor.js';
|
|
9
|
+
/**
|
|
10
|
+
* Compute 4x4 transformation matrix from local to world coordinates
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeTransformMatrix(mapConversion: MapConversion): number[];
|
|
13
|
+
/**
|
|
14
|
+
* Transform a point from local to world coordinates
|
|
15
|
+
*/
|
|
16
|
+
export declare function transformToWorld(localPoint: [number, number, number], georef: GeoreferenceInfo): [number, number, number] | null;
|
|
17
|
+
/**
|
|
18
|
+
* Transform a point from world to local coordinates
|
|
19
|
+
*/
|
|
20
|
+
export declare function transformToLocal(worldPoint: [number, number, number], georef: GeoreferenceInfo): [number, number, number] | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get coordinate system description
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCoordinateSystemDescription(georef: GeoreferenceInfo): string;
|
|
25
|
+
//# sourceMappingURL=georef-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"georef-transform.d.ts","sourceRoot":"","sources":["../src/georef-transform.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,EAAE,CA4B7E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACpC,MAAM,EAAE,gBAAgB,GACvB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAcjC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACpC,MAAM,EAAE,gBAAgB,GACvB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CA4BjC;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAwB/E"}
|