Export altitude from LandXML coordinates

This commit is contained in:
wpetit 2021-01-25 16:16:29 +01:00
parent 109abecb97
commit 2ddf34822b
4 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,4 @@
import { getProp, parseSequence, getColor } from './util'
import { polygon } from '@turf/helpers';
import union from '@turf/union';
import proj4 from 'proj4';
export const LANDXML_POINT = 'cg_point';
@ -52,7 +50,7 @@ function convertPoint(cgPoint, projection, featureProps) {
type: "Feature",
geometry: {
type: "Point",
coordinates: [...pointCoords, pointCoords[2]],
coordinates: [...pointCoords],
},
properties: {
...featureProps,

View File

@ -17,7 +17,7 @@ export function convertParcels(xmlObj, projection, opts) {
const opt = originalPoints[pt]
const name = opt.$.name.replace(/ /g,'');
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)
points[name] = coords
}

View File

@ -152,7 +152,7 @@ function convertStructs(pipeNetwork, projection, baseProps, opts) {
// Parse and convert center coordinates
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);
let geometry;

View File

@ -81,7 +81,7 @@ function convertFaces(surface, projection, featureProps, opts) {
pointNodes.forEach(p => {
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);
const pointId = p.$.id;
points[pointId] = { name: p.$.name, coords: pointCoords };