# Geodata in .xyz format

**URL:** <https://forums.chaos.com/t/geodata-in-xyz-format/8484>\
**Category:** Off-topic\
**Created:** [August 19, 2005, 9:45am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484 "2005-08-19T09:45:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonasa](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonasa/32/235036_2.png) [@jonasa](https://forums.chaos.com/u/jonasa)\
**Post date:** [August 19, 2005, 9:45am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/1 "2005-08-19T09:45:43Z")

</div>

Anybody out there who have any experience converting simple ASCII pointclouds to a 3D format (dxf, 3ds etc.) - what I’ve got is a textfile in this format:

352000,178500,18.889  
352000,178499,18.880  
352000,178498,18.919  
352000,178497,18.909  
352000,178496,18.898  
352000,178495,18.960  
352000,178494,18.956  
…and on it goes for 250000 lines

Presume its X, Y, Z in meters…

Been trying a bunch of different converters.. but starting to think that a maxscript could do it - nothing on script spot, though.

Anyone?

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [August 19, 2005, 9:47am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/2 "2005-08-19T09:47:29Z")

</div>

Reading the points with MaxScript is not a problem; getting a polygonal geometry out of them is a lot more complicated though.

Best regards,  
Vlado

---

<div class="post-metadata">

**Author:** ![jonasa](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonasa/32/235036_2.png) [@jonasa](https://forums.chaos.com/u/jonasa)\
**Post date:** [August 19, 2005, 9:53am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/3 "2005-08-19T09:53:52Z")

</div>

Oh… I see…

BUT… if you know the size of the matrix - couldn’t you create a plane through max-script with a corresponding no. of vertices and then apply the z values through some sort of array…

(not an expert on maxscript - as you might notice)

---

<div class="post-metadata">

**Author:** ![dennis](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@dennis](https://forums.chaos.com/u/dennis)\
**Post date:** [August 19, 2005, 10:32am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/4 "2005-08-19T10:32:19Z")

</div>

funny im struggling with the same this very moment.

what you need is to make a triangulated irregular network (TIN)

[http://www.codeproject.com/cpp/kazumi.asp](http://www.codeproject.com/cpp/kazumi.asp)  
[http://pisha.phm.vcu.edu/~jca/gh2o/tin/tinlib.html](http://pisha.phm.vcu.edu/~jca/gh2o/tin/tinlib.html)

this is where im at at the moment. i dont have the data other than from Mtext objects in acad wich i cant import into max and convert to pointclouds with maxscript…arghh !!

im not really sure what i would use the TIN to for though. either it could be used as is or with meshsmooth or even as a basis for a displacement map.

---

<div class="post-metadata">

**Author:** ![jonasa](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonasa/32/235036_2.png) [@jonasa](https://forums.chaos.com/u/jonasa)\
**Post date:** [August 19, 2005, 11:22am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/5 "2005-08-19T11:22:19Z")

</div>

Had a quick go at the Triangle Net app… but it ran out of memory :shock: - have a feeling my data isn’t quite what the app expects.

My data is more like a matrix than a scattered pointcloud - but I guess it still needs triangulation in order to output any sort of mesh

the Tinlib app looks promising - haven’t got around to compiling the app, though.

I’ll keep you posted if I have any luck.

Dennis… what’s your data like - can you post a sample?

---

<div class="post-metadata">

**Author:** ![dennis](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@dennis](https://forums.chaos.com/u/dennis)\
**Post date:** [August 19, 2005, 11:51am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/6 "2005-08-19T11:51:33Z")

</div>

my ‘data’ is spot levels in cad

unfortunatly without the z coordinate plotted. i thought i could make an maxscript wich read the nearest text to the spot level and generated the z coordinate with that. unfortunatly max wont import MTEXT objects from acad and i know nada about scripting in acad, so my only choice is to by hand plot the elevation of all the points (there are \_many\_ ).

the tinlib is working well. i couldnt get the other app to work either, but the webpage had good explanation about the process. you dont need to to compile it though. if you download tinlib\_w.zip its already compiled with a GUI think its called tingui.exe where you can load a .txt file in this format:

```auto
num_points=67
x y z
x y z
. . .

```

it will generate the tri’s and you have the choice to save the tri’s as a textfile. from there you then need to make a maxscript wich will transform the data to a mesh ( not to complicated )

---

<div class="post-metadata">

**Author:** ![Gijs](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/gijs/32/56024_2.png) [@Gijs](https://forums.chaos.com/u/Gijs)\
**Post date:** [August 19, 2005, 12:16pm UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/7 "2005-08-19T12:16:56Z")

</div>

Have you tried to import the point cloud in Rhino? Rhino can make a patch surface through a point cloud, and also there are additional plugins if I remember well to handle point cloud data and coverting them to surfaces.

ah wait, here is one:  
[http://www.fpsols.com/point\_cloud\_rh.html](http://www.fpsols.com/point%5C_cloud%5C_rh.html)

And I think this one is standalone:  
[http://www.fpsols.com/point\_cloud.html](http://www.fpsols.com/point%5C_cloud.html)

---

<div class="post-metadata">

**Author:** ![CCS](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/ccs/32/1765_2.png) [@CCS](https://forums.chaos.com/u/CCS)\
**Post date:** [August 19, 2005, 2:25pm UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/8 "2005-08-19T14:25:32Z")

</div>

I wouldn’t call this a point cloud. To me a point cloud is a mass of clustered points, such as would result from a laser scan.

What you have is terrain data. What you need to make is a TIN. Many packages available to do this. Plus, a simple TIN will use far fewer polys than a mesh from a point cloud.

---

<div class="post-metadata">

**Author:** ![jonasa](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonasa/32/235036_2.png) [@jonasa](https://forums.chaos.com/u/jonasa)\
**Post date:** [August 19, 2005, 2:40pm UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/9 "2005-08-19T14:40:03Z")

</div>

Yeah… been trying some apps to convert into TIN - so far no luck. They either don’t understand my format, crashes while recalculating my 250000 point landscape or doesn’t have much export options… but i’ll keep looking, TIN definately seems to be the way forward.

Unfortunately we don’t have Rhino, but as far as i can understand, Rhino is also struggling with that much data.

We’ve put a request in with the company supplying us with the data, to see if they do TIN.

Found out that the .xyz file is based on LIDAR data, ring any bells? - quite a few references on the web, but nothing that really explains how the points has been measured.

---

<div class="post-metadata">

**Author:** ![CCS](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/ccs/32/1765_2.png) [@CCS](https://forums.chaos.com/u/CCS)\
**Post date:** [August 19, 2005, 3:52pm UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/10 "2005-08-19T15:52:46Z")

</div>

Sure. LIDAR is an acronym for LIght Detection And Ranging.  
It’s an airplane-based laser that sweeps the earth and records distances. Like a giant fish-finder. 😉

The main difference between data returned by LIDAR and other sources (like DEMs, aerial topos from photogrammetry, etc.) is that LIDAR data reflects elevation of the first thing it hits. That could include tops of buildings, tree tops, etc. May not be a problem for you - just something to be aware of.

As far as how to read it, are the points all arranged in a grid? If so. you may be able to read them as a DEM and skip the TIN generation.

---

<div class="post-metadata">

**Author:** ![samuel\_bubat](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@samuel\_bubat](https://forums.chaos.com/u/samuel_bubat)\
**Post date:** [August 24, 2005, 9:26am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/11 "2005-08-24T09:26:20Z")

</div>

I don Â´t know if this plugin works for your data but itÂ´s worth a try.  
[http://www.habware.at/max6/Terrain26.zip](http://www.habware.at/max6/Terrain26.zip)

quote from maxplugins  
““A utility which reads ASCII xyz elevation data and builds an editable mesh from it””

cheers

---

<div class="post-metadata">

**Author:** ![jonasa](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonasa/32/235036_2.png) [@jonasa](https://forums.chaos.com/u/jonasa)\
**Post date:** [August 24, 2005, 10:03am UTC](https://forums.chaos.com/t/geodata-in-xyz-format/8484/12 "2005-08-24T10:03:29Z")

</div>

BINGO!

Thanks a lot… that terrain plugin was spot on what I needed…

😄 8)
