<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font color="#0080ff">Hi,</font></p>
    <p><font color="#0080ff">See below</font><br>
    </p>
    <div class="moz-cite-prefix">On 2020-05-14 3:53 a.m., Priv.-Doz. Dr.
      Maria Shinoto wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap="">Hi, 

it seems that my points are too many. I am waiting for the TIN process to finish (needs a few hours it seems), then I will select a part of the point I am interested in and go on working on that selection. Then I will try your suggestions, thank you. 
</pre>
    </blockquote>
    <font color="#0080ff">This will crash if you have too many points.
      Trust me!</font><br>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap="">
Some other remarks: 

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">You can also correct this 5x5 problem by using gdal grid with Nearest neighbour interpolation. You could use the point data to do this.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
So the GDAL tools in the processing toolbox?</pre>
    </blockquote>
    <font color="#0080ff">Yes, use Grid(Nearest neighbor) in the
      processing toolbox.</font><br>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap="">

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I also post a small presentation that can help go from vector to raster with point data. Sometimes, keeping it simple is better.

<a class="moz-txt-link-freetext" href="https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.slideshare.net%2fshencoop%2fqgis%2draster%2dto%2dpoint&umid=81eb74bc-6e72-4f88-9170-4c7619c9c983&auth=4ff16eacbc1d620fae2da429677ec7b85b28c904-585e8c6c01c6d3b66ea068001e65de5403305b6f">https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.slideshare.net%2fshencoop%2fqgis%2draster%2dto%2dpoint&umid=81eb74bc-6e72-4f88-9170-4c7619c9c983&auth=4ff16eacbc1d620fae2da429677ec7b85b28c904-585e8c6c01c6d3b66ea068001e65de5403305b6f</a>
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
This is the other way round, but I could check that everything went right with my .xyz-Data and the creation of the point cloud.</pre>
    </blockquote>
    <font color="#0080ff">Yes but you could do this with the original
      raster and it works both ways.</font><br>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap=""> 

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">If you do decide to make a shapefile with the csv, make sure to store the coordinates in a text field.  Placing the coordinates in a $x and $y object fields will lead to rounding.  Any rounding would corrupt the raster therefore you need to original coordinates for this to work. This may explain your problems also.
</pre>
      </blockquote>
    </blockquote>
    <p><font color="#0080ff">If you use the above method of going from
        raster to vector (or the other way), you cannot change any
        coordinates (lets call these the CSV xyz).  If you create a shp
        file with the CSV xyz, you will have some points created from
        the x an y imported from the csv and the CSV xy become shp xy. 
        Those shp xy coordinates will be rounded or very slightly
        modified from the original data (we are talking sub milometer). 
        You can recreate the raster if the CSV xyz data stored in a
        field but you cannot use the shp xy as this data has been
        modified.  You can however use the Gdal Grid to recreate the
        grid.</font></p>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap="">
I do not really understand, but I think when I try, I will see what you mean. 

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I used this method to change the geoids of a thousands of rasters because the program I was using was designed to change the z value for texte files only and not rasters (NRCAN GPS-H).
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Sounds good :-)

I will report tomorrow again, and thanks for taking care, 
Maria

</pre>
    </blockquote>
    <p><font color="#0080ff">In any case, I would try to figure out what
        errors you have made to have this coordinate shift.  I expect
        the original data was in Long-Lat.  Having data in longitude and
        Latitude <u>will result in rectangular pixels</u> when
        reprojected in meters.  I imagine that the data has been
        reprojected.</font></p>
    <p><font color="#0080ff">Nicolas</font><br>
    </p>
    <blockquote type="cite"
      cite="mid:9819BB73-0273-47A2-BFFF-E2014D94AF92@zaw.uni-heidelberg.de">
      <pre class="moz-quote-pre" wrap="">
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
Nicolas Cadieux
Ça va bien aller!

</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Le 13 mai 2020 à 11:25, chris hermansen <a class="moz-txt-link-rfc2396E" href="mailto:clhermansen@gmail.com"><clhermansen@gmail.com></a> a écrit :


Maria and list,

On Tue, May 12, 2020 at 7:00 PM Priv.-Doz. Dr. Maria Shinoto <a class="moz-txt-link-rfc2396E" href="mailto:maria.shinoto@zaw.uni-heidelberg.de"><maria.shinoto@zaw.uni-heidelberg.de></a> wrote:
Hi, 

Thanks for helping. -- Thanks to you and Chris Hermansen I got a result, but it could be better. 

For the records, a short explanation:

*****
Well, I checked the properties, jgd2011 is in Meters, the raster is said to be 5m. In the official Japanese viewer, which creates a beautiful raster image without white pixels, the pixels are exactly 5m*5m. 

Today I tried the export to .xyz since the shapefile looked ugly, and after realising that the Japanese xyz is indeed yxz, everything looked fine, and I could store it in a Geopackage. But the grid is now 5,276m * 6,146m. But it fits well on top of the basemap. The basemap is of the same special Japanese GML format, but QGIS could read it all without problem. I do not understand why QGIS does not read the point data from  the GML fille, but that is an aside, I am amazed by what QGIS actually can do. 

>From the Geopackage I could rasterize. It is as Chris Hermansen said, thanks. Unfortunately, I did not get it done from the shapefiles, they always looked weird or like nothing, even with identical settings. But the geopackages from xyz tiles are fine. 

For resolution, I chose georeferenced units as Chris suggested, and since the measurement tool got some different length, I put it to 5,276m by 6,146m. A 5m by 5m resolution created a weird layer with horizontally expanding white pixels.

It seems that tweaking with the resolution might lead to an even better result, but for the time being, it is OK as it is. 
*****


Upon reflection I think the basic problem here is that the point data should be interpolated to create a raster if you want a precise 5x5m resolution.

For this, rather than use the Raster > Rasterize tool, the approach should be:
        • open the processing toolbox Processing > Toolbox
        • in the toolbox open Interpolation > TIN interpolation
        • in the TIN Interpolation screen:
                • select the Vector layer
                • select the Interpolation attribute
                • click the + to add to the vector layer panel
                • choose the interpolation method - probably best to use cubic
                • click on the ... next to extent and set it to the layer extent
                • set the pixel size to 5.0 and 5.0
                • click Run
This way you won't have the odd sizes you mentioned.  This may give you a smoother surface in the end as well.


-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
</pre>
        </blockquote>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
</html>