Export altitude from LandXML coordinates
This commit is contained in:
parent
109abecb97
commit
2ddf34822b
|
@ -1,6 +1,4 @@
|
||||||
import { getProp, parseSequence, getColor } from './util'
|
import { getProp, parseSequence, getColor } from './util'
|
||||||
import { polygon } from '@turf/helpers';
|
|
||||||
import union from '@turf/union';
|
|
||||||
import proj4 from 'proj4';
|
import proj4 from 'proj4';
|
||||||
|
|
||||||
export const LANDXML_POINT = 'cg_point';
|
export const LANDXML_POINT = 'cg_point';
|
||||||
|
@ -52,7 +50,7 @@ function convertPoint(cgPoint, projection, featureProps) {
|
||||||
type: "Feature",
|
type: "Feature",
|
||||||
geometry: {
|
geometry: {
|
||||||
type: "Point",
|
type: "Point",
|
||||||
coordinates: [...pointCoords, pointCoords[2]],
|
coordinates: [...pointCoords],
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
...featureProps,
|
...featureProps,
|
||||||
|
|
|
@ -17,7 +17,7 @@ export function convertParcels(xmlObj, projection, opts) {
|
||||||
const opt = originalPoints[pt]
|
const opt = originalPoints[pt]
|
||||||
const name = opt.$.name.replace(/ /g,'');
|
const name = opt.$.name.replace(/ /g,'');
|
||||||
let coords = parseSequence(opt._).map(coord => parseFloat(coord))
|
let coords = parseSequence(opt._).map(coord => parseFloat(coord))
|
||||||
coords = [coords[1], coords[0]]
|
coords = [coords[1], coords[0], coords[2]]
|
||||||
coords = proj4(projection, 'WGS84', coords)
|
coords = proj4(projection, 'WGS84', coords)
|
||||||
points[name] = coords
|
points[name] = coords
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ function convertStructs(pipeNetwork, projection, baseProps, opts) {
|
||||||
|
|
||||||
// Parse and convert center coordinates
|
// Parse and convert center coordinates
|
||||||
const seq = parseSequence(centerNode).map(v => parseFloat(v));
|
const seq = parseSequence(centerNode).map(v => parseFloat(v));
|
||||||
let center = [seq[1], seq[0]];
|
let center = [seq[1], seq[0], seq[2]];
|
||||||
center = proj4(projection, 'WGS84', center);
|
center = proj4(projection, 'WGS84', center);
|
||||||
|
|
||||||
let geometry;
|
let geometry;
|
||||||
|
|
|
@ -81,7 +81,7 @@ function convertFaces(surface, projection, featureProps, opts) {
|
||||||
|
|
||||||
pointNodes.forEach(p => {
|
pointNodes.forEach(p => {
|
||||||
let pointCoords = parseSequence(p._).map(v => parseFloat(v));
|
let pointCoords = parseSequence(p._).map(v => parseFloat(v));
|
||||||
pointCoords = [pointCoords[1], pointCoords[0]];
|
pointCoords = [pointCoords[1], pointCoords[0], pointCoords[2]];
|
||||||
pointCoords = proj4(projection, 'WGS84', pointCoords);
|
pointCoords = proj4(projection, 'WGS84', pointCoords);
|
||||||
const pointId = p.$.id;
|
const pointId = p.$.id;
|
||||||
points[pointId] = { name: p.$.name, coords: pointCoords };
|
points[pointId] = { name: p.$.name, coords: pointCoords };
|
||||||
|
|
Loading…
Reference in New Issue