[GRASS-user] Using GRASS on a ply file

Moritz Lennert mlennert at club.worldonline.be
Thu Jun 7 00:10:35 PDT 2018



Hi Marion,

Please keep the discussion on the list.


Am 7. Juni 2018 06:55:33 MESZ schrieb marion-brunet at sfr.fr:
><span style="font-family:arial,helvetica,sans-serif;
>font-size:12px">Thank you very much for your answer!<br>
>However, I have another ERROR when I use the command , even when
>I  remove the white spaces. My command is:</span><br>
>v.in.ply input=path\file.ply output=test<br>
>and I get:<br>
><br>
>AttributeError<br>
>:<br>
>'exceptions.UnicodeDecodeError' object has no attribute<br>
>'value'<br>
><br>
>I really don't know what it means..


I have the feeling that you provide us with only an extract of the message. Please provide the complete traceback and the exact command you used. 

If you launch the command via the GUI you can find the history of commands in the console window (up arrow to see previous commands) or you can use the 'copy' button in the module GUI to copy the command line just before pushing run.

Moritz




.<br>
><br>
> 
><div class="gl_quote" style="margin-top: 20px; padding-top: 5px;">De :
>"Moritz Lennert"<br>
>A : marion-brunet at sfr.fr,grass-user at lists.osgeo.org<br>
>Envoyé: mercredi 6 juin 2018 13:49<br>
>Objet : Re: [GRASS-user] Using GRASS on a ply file<br>
> 
><div class="gl_quoted">Hello Marion and welcome to the GRASS community
>!<br>
><br>
>On 06/06/18 12:03, marion-brunet wrote:<br>
>> ‌Hello,<br>
>><br>
>> I have two point clouds of an open-pit mine taken a few weeks
>apart. I<br>
>> would like to estimate the volume that has been excavated during
>that<br>
>> interval, i.e the difference between the two point clouds. For
>that I<br>
>> used CloudCompare to get a new point cloud corresponding to the
>distance<br>
>> between the first two clouds. Now I need to know the<br>
>> Z information of each point of this last cloud. I want to use
>GRASS to<br>
>> do it, but I can't find a method that is working...<br>
>><br>
>> The first method I was suggested is to use*v.in.ply* and
>then*r.report*,<br>
>> but I have several issues:<br>
>> - When I use *v.in.ply* I have this error: *ERROR: Wrong number
>of<br>
>> properties*. Is it a common error? How can I solve it? I have
>attached a<br>
>> part of my .ply file to this email so you can see how it  is
>formatted.<br>
><br>
>[Marion sent me an extract of the data offline]<br>
><br>
>It seems that every data line in your .ply file has a trailing
>white<br>
>space at the end. This is counted as an extra property and explains
>the<br>
>message. When I erase these trailing white spaces, I don't get this<br>
>error anymore. I don't know the format enough to know whether this is
>an<br>
>issue with v.in.ply not tolerating these white spaces, or an issue
>with<br>
>the program creating the .ply file which shouldn't add a white space
>at<br>
>the end.<br>
><br>
>> - After importing my .ply file, I would like to use something
>like<br>
>> *r.report *to get the value of each point. However, I don't know
>how to<br>
>> convert my file into a format that this command will work with...
>Could<br>
>> you help me?<br>
><br>
>r.report gives you a summary report about a raster, not a value by
>point.<br>
><br>
>Generally, if you want to cover an entire zone (your entire
>open-pit<br>
>mine, you will probably want to go the raster way. So, with the
>points<br>
>imported with v.in.ply, you could do something like the following:<br>
><br>
>g.region vect=points res=1 -ap #set the xy extension of your raster
>to<br>
>the xy extension of the point cloud, and the resolution to 1 (you
>have<br>
>to adjust that depending on the size of your zone)<br>
>v.surf.rst in=points out=mined_surface #interpolate a continous
>height<br>
>surface across the entire area<br>
>r.volume mined_surface #calculate volume<br>
><br>
><br>
>><br>
>> The second method I read about is *r.in.xyz*, but I don't know how
>it<br>
>> works, or what format of input I should use. Can I have more
>information<br>
>> about it?<br>
><br>
>r.in.xyz is another option. It takes XYZ data and aggregates it by
>pixel<br>
>using a user-determined aggregation function. If you have a higher
>point<br>
>density than your target resolution, then you could use just the
>data<br>
>part of your .ply file, i.e. the part which has lines such as<br>
><br>
>[...]<br>
>97.08156 121.6752 99.27532 0 0 0 12 9 2 255<br>
>97.08911 121.718 99.50104 0 0 0 46 40 24 255<br>
>93.25124 115.0372 102.7768 0 0 0 62 53 20 255<br>
>97.96031 123.8419 103.3994 0 0 0 150 184 211 255<br>
>97.10852 121.6866 99.42679 0 0 0 9 9 0 255<br>
>97.11196 121.7049 99.59032 0 0 0 19 12 4 255<br>
>97.13282 121.688 99.43796 0 0 0 38 28 16 255<br>
>97.17371 121.7129 99.41496 0 0 0 43 31 15 255<br>
>97.1614 121.6344 99.27691 0 0 0 9 6 1 255<br>
>[...]<br>
><br>
>Knowing that there are 17 lines of other info at the top of the
>extract<br>
>you sent me, I could import the data using:<br>
><br>
>r.in.xyz in=BROL/BascFin2-extrait.ply skip=17 out=xyz_mean
>method=mean<br>
>sep=space<br>
><br>
>However, as the extent of the cloud is very large, but there are only
>a<br>
>few points, most of the pixels in the resulting raster are filled
>with<br>
>NULL values as there are no points falling within these pixels.<br>
><br>
>Moritz</div>
>
><div class="gl_quoted"> </div>
></div>


More information about the grass-user mailing list