Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work SOLVED

2020-05-18 Thread Nicolas Cadieux
Nice to know you got it!

Nicolas Cadieux
Ça va bien aller!

> Le 16 mai 2020 à 06:13, Priv.-Doz. Dr. Maria Shinoto 
>  a écrit :
> 
> Hi, 
> 
> I had some intensive learning during the last days, and thanks again for your 
> help. 
> 
> After all it turns out that it is something Nicolas wrote, it is a matter of 
> the projection. The Japanese software just exported to a projected format, 
> but the original data seem to be in lat long. I found a way to get the 
> unprojected data and now can create a beautiful hillshade in an unprojected 
> lat long layer. And it even looks good in a projected project (EPSG:6670) 
> with on the fly projection. 
> 
> For hydrological analyses I need to use the projected data, but the artifacts 
> do not matter here. While binge-watching YouTube videos I realized that these 
> artifacts occur with the pros as well when they use the projected layers for 
> their analyses. Now everything much better and "in place".
> 
> Best, 
> Maria
> 
> 
>> Am 15.05.2020 um 13:21 schrieb Nicolas Cadieux 
>> :
>> 
>> 
>> 
>> Nicolas Cadieux
>> Ça va bien aller!
>> 
 Le 14 mai 2020 à 23:12, Nicolas Cadieux  a 
 écrit :
>>> 
>>> Hi,
>>> 
>>> 
>>> See below for comments.
>>> 
>>> Nicolas Cadieux
>>> Ça va bien aller!
>>> 
 Le 14 mai 2020 à 22:21, Priv.-Doz. Dr. Maria Shinoto 
  a écrit :
 
 Hi again, 
 
 and sorry for the ongoing discussion.
 
 Today I exported a selection of the DEM data to a shapefile, just 9MB for 
 the main file, and this makes testing very fast.
 
 (A) TINs did not work. 
>>> 
>>> TIn interpolation has memory problems with large data sets.  Same problem 
>>> since QGIS 2x at least.  It was cool features but is not made to handle 
>>> today’s data sets.
 
 (B) I tried all steps carefully again, but even the GDAL raster is 
 horrible now. 
 
 Here are some screenshots with my explanation and the protocol for 
 rasterization and filling nodata. 
 
 It seems that the artifacts are due to no data fields that evolve during 
 rasterization as a pattern. These nodata fields may be due to a slight 
 inclination of the grid from the export of the data with the Japanese 
 software. 
 
 1) The point grid, one can see the inclination
 
>>> <01.jpeg>
 
 
 2) The raster of the same area, one can see the points of the vector point 
 grid along the white empty space; this is NODATA.
 
>>> <02.jpeg>
 
 
>>> I would use gdal_grid not rasterize. Use Gdal grid with a larger search 
>>> circle will solve this problem.  Use nearest neighborhood with a search 
>>> radius larger than the pixel (like 7m).  That will reduce the no data. 
>>> Click on the help or go to the gdal website. That will help you add the 
>>> missing parameters like the -txe and -tye. (The extent) and the -outsize 
>>> for the number of pixels. 
>>> 
 I add the protocol
>>> <2020-05-15-rasterize-protocol-for-selection.txt>
 
 
 
 3) Using the Fill NODATA from the Raster menu makes a beautiful looking 
 raster, there seem to be no flaws.
 
>>> <03.jpeg>
 
 
>>> 
>>> That fixes things but adds new data to the raster. This may be unwanted.
>>> 
 I add the protocol.
 
>>> <2020-05-15-fill-nodata-protocol-for-selection.txt>
 
 
 4) This is the same area as in (3), but instead of a pseudocolor ramp 
 shown as hillshade.
 
>>> <04.jpeg>
 
 
>>> This is normal if you select a bad z factor (probably not the case here).  
>>> You will have the same thing if you zoom in and have nearest neighbour in 
>>> the “zoomed in” under “resampling“ in the hillshade symbology window.
 
 5) This is the impression from a larger area.
 
>>> <05.jpeg>
 
 
 
 6) This is the same small area hillshaded with the GDAL tools. Looks good, 
 but suffers from the same artifacts. 
 
>>> 
>>> No this is way it should look like (Image under).  You can see the pixels 
>>> because you are zoomed in.  Again, select the correct z factor (if x,y are 
>>> in long -lat and z is in meters or feet.) (probably ok here).
>>> 
>>> <06.jpeg>
 
 
 
>>> Play with the resampling zoomed out parameters in symbology 
>>> 
>>> 
 7) The larger area from hillshade in GDAL tools. 
 
>>> <07.jpeg>
 
 
 
 
 
 I sorry to be so insisting on the problem, I think it is not the problem 
 of QGIS, but perhaps there are solutions to such a case. -- The projection 
 is OK, and the base map fits perfectly. 
 
 Best and Thanks to anyone trying to help, 
 Maria
 
 
 
 
> 
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work SOLVED

2020-05-16 Thread Priv.-Doz. Dr. Maria Shinoto
Hi, 

I had some intensive learning during the last days, and thanks again for your 
help. 

After all it turns out that it is something Nicolas wrote, it is a matter of 
the projection. The Japanese software just exported to a projected format, but 
the original data seem to be in lat long. I found a way to get the unprojected 
data and now can create a beautiful hillshade in an unprojected lat long layer. 
And it even looks good in a projected project (EPSG:6670) with on the fly 
projection. 

For hydrological analyses I need to use the projected data, but the artifacts 
do not matter here. While binge-watching YouTube videos I realized that these 
artifacts occur with the pros as well when they use the projected layers for 
their analyses. Now everything much better and "in place".

Best, 
Maria


> Am 15.05.2020 um 13:21 schrieb Nicolas Cadieux :
> 
> 
> 
> Nicolas Cadieux
> Ça va bien aller!
> 
>> Le 14 mai 2020 à 23:12, Nicolas Cadieux  a 
>> écrit :
>> 
>> Hi,
>> 
>> 
>> See below for comments.
>> 
>> Nicolas Cadieux
>> Ça va bien aller!
>> 
>>> Le 14 mai 2020 à 22:21, Priv.-Doz. Dr. Maria Shinoto 
>>>  a écrit :
>>> 
>>> Hi again, 
>>> 
>>> and sorry for the ongoing discussion.
>>> 
>>> Today I exported a selection of the DEM data to a shapefile, just 9MB for 
>>> the main file, and this makes testing very fast.
>>> 
>>> (A) TINs did not work. 
>> 
>> TIn interpolation has memory problems with large data sets.  Same problem 
>> since QGIS 2x at least.  It was cool features but is not made to handle 
>> today’s data sets.
>>> 
>>> (B) I tried all steps carefully again, but even the GDAL raster is horrible 
>>> now. 
>>> 
>>> Here are some screenshots with my explanation and the protocol for 
>>> rasterization and filling nodata. 
>>> 
>>> It seems that the artifacts are due to no data fields that evolve during 
>>> rasterization as a pattern. These nodata fields may be due to a slight 
>>> inclination of the grid from the export of the data with the Japanese 
>>> software. 
>>> 
>>> 1) The point grid, one can see the inclination
>>> 
>> <01.jpeg>
>>> 
>>> 
>>> 2) The raster of the same area, one can see the points of the vector point 
>>> grid along the white empty space; this is NODATA.
>>> 
>> <02.jpeg>
>>> 
>>> 
>> I would use gdal_grid not rasterize. Use Gdal grid with a larger search 
>> circle will solve this problem.  Use nearest neighborhood with a search 
>> radius larger than the pixel (like 7m).  That will reduce the no data. Click 
>> on the help or go to the gdal website. That will help you add the missing 
>> parameters like the -txe and -tye. (The extent) and the -outsize for the 
>> number of pixels. 
>> 
>>> I add the protocol
>> <2020-05-15-rasterize-protocol-for-selection.txt>
>>> 
>>> 
>>> 
>>> 3) Using the Fill NODATA from the Raster menu makes a beautiful looking 
>>> raster, there seem to be no flaws.
>>> 
>> <03.jpeg>
>>> 
>>> 
>> 
>> That fixes things but adds new data to the raster. This may be unwanted.
>> 
>>> I add the protocol.
>>> 
>> <2020-05-15-fill-nodata-protocol-for-selection.txt>
>>> 
>>> 
>>> 4) This is the same area as in (3), but instead of a pseudocolor ramp shown 
>>> as hillshade.
>>> 
>> <04.jpeg>
>>> 
>>> 
>> This is normal if you select a bad z factor (probably not the case here).  
>> You will have the same thing if you zoom in and have nearest neighbour in 
>> the “zoomed in” under “resampling“ in the hillshade symbology window.
>>> 
>>> 5) This is the impression from a larger area.
>>> 
>> <05.jpeg>
>>> 
>>> 
>>> 
>>> 6) This is the same small area hillshaded with the GDAL tools. Looks good, 
>>> but suffers from the same artifacts. 
>>> 
>> 
>> No this is way it should look like (Image under).  You can see the pixels 
>> because you are zoomed in.  Again, select the correct z factor (if x,y are 
>> in long -lat and z is in meters or feet.) (probably ok here).
>> 
>> <06.jpeg>
>>> 
>>> 
>>> 
>> Play with the resampling zoomed out parameters in symbology 
>> 
>> 
>>> 7) The larger area from hillshade in GDAL tools. 
>>> 
>> <07.jpeg>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> I sorry to be so insisting on the problem, I think it is not the problem of 
>>> QGIS, but perhaps there are solutions to such a case. -- The projection is 
>>> OK, and the base map fits perfectly. 
>>> 
>>> Best and Thanks to anyone trying to help, 
>>> Maria
>>> 
>>> 
>>> 
>>> 

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread Priv.-Doz. Dr. Maria Shinoto
Hi, 

I am testing the GDAL tools the way you explained, but I still get artifacts. 
When I say artifacts, I do not mean pixels, I know what pixels are since I 
started using a scanner nearly 30 years ago, I think of sudden jumps in the 
lightness, which leads to lines and grids in the raster image. Now I am 
checking more options, I am working on it and will be back in a day or two. 
Meanwhile, if you have an idea, I will be happy to read about it. 

Best, 
Maria


> Am 15.05.2020 um 13:21 schrieb Nicolas Cadieux :
> 
> 

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread Nicolas Cadieux


Nicolas Cadieux
Ça va bien aller!

> Le 14 mai 2020 à 23:12, Nicolas Cadieux  a 
> écrit :
> 
> Hi,
> 
> 
> See below for comments.
> 
> Nicolas Cadieux
> Ça va bien aller!
> 
>> Le 14 mai 2020 à 22:21, Priv.-Doz. Dr. Maria Shinoto 
>>  a écrit :
>> 
>> Hi again, 
>> 
>> and sorry for the ongoing discussion.
>> 
>> Today I exported a selection of the DEM data to a shapefile, just 9MB for 
>> the main file, and this makes testing very fast.
>> 
>> (A) TINs did not work. 
> 
> TIn interpolation has memory problems with large data sets.  Same problem 
> since QGIS 2x at least.  It was cool features but is not made to handle 
> today’s data sets.
>> 
>> (B) I tried all steps carefully again, but even the GDAL raster is horrible 
>> now. 
>> 
>> Here are some screenshots with my explanation and the protocol for 
>> rasterization and filling nodata. 
>> 
>> It seems that the artifacts are due to no data fields that evolve during 
>> rasterization as a pattern. These nodata fields may be due to a slight 
>> inclination of the grid from the export of the data with the Japanese 
>> software. 
>> 
>> 1) The point grid, one can see the inclination
>> 
> <01.jpeg>
>> 
>> 
>> 2) The raster of the same area, one can see the points of the vector point 
>> grid along the white empty space; this is NODATA.
>> 
> <02.jpeg>
>> 
>> 
> I would use gdal_grid not rasterize. Use Gdal grid with a larger search 
> circle will solve this problem.  Use nearest neighborhood with a search 
> radius larger than the pixel (like 7m).  That will reduce the no data. Click 
> on the help or go to the gdal website. That will help you add the missing 
> parameters like the -txe and -tye. (The extent) and the -outsize for the 
> number of pixels. 
> 
>> I add the protocol
> <2020-05-15-rasterize-protocol-for-selection.txt>
>> 
>> 
>> 
>> 3) Using the Fill NODATA from the Raster menu makes a beautiful looking 
>> raster, there seem to be no flaws.
>> 
> <03.jpeg>
>> 
>> 
> 
> That fixes things but adds new data to the raster. This may be unwanted.
> 
>> I add the protocol.
>> 
> <2020-05-15-fill-nodata-protocol-for-selection.txt>
>> 
>> 
>> 4) This is the same area as in (3), but instead of a pseudocolor ramp shown 
>> as hillshade.
>> 
> <04.jpeg>
>> 
>> 
> This is normal if you select a bad z factor (probably not the case here).  
> You will have the same thing if you zoom in and have nearest neighbour in the 
> “zoomed in” under “resampling“ in the hillshade symbology window.
>> 
>> 5) This is the impression from a larger area.
>> 
> <05.jpeg>
>> 
>> 
>> 
>> 6) This is the same small area hillshaded with the GDAL tools. Looks good, 
>> but suffers from the same artifacts. 
>> 
> 
> No this is way it should look like (Image under).  You can see the pixels 
> because you are zoomed in.  Again, select the correct z factor (if x,y are in 
> long -lat and z is in meters or feet.) (probably ok here).
> 
> <06.jpeg>
>> 
>> 
>> 
> Play with the resampling zoomed out parameters in symbology 
> 
> 
>> 7) The larger area from hillshade in GDAL tools. 
>> 
> <07.jpeg>
>> 
>> 
>> 
>> 
>> 
>> I sorry to be so insisting on the problem, I think it is not the problem of 
>> QGIS, but perhaps there are solutions to such a case. -- The projection is 
>> OK, and the base map fits perfectly. 
>> 
>> Best and Thanks to anyone trying to help, 
>> Maria
>> 
>> 
>> 
>> 
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread chris hermansen
María and list

On Thu, May 14, 2020, 00:46 Priv.-Doz. Dr. Maria Shinoto <
maria.shin...@zaw.uni-heidelberg.de> wrote:

> Chris,
>
> Thank you for your ideas. I am trying now, but there are some questions:
>
> > 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
>
> OK until this point
>
>
> >   • in the TIN Interpolation screen:
> >   • select the Vector layer
>
> OK.
>
> >   • select the Interpolation attribute
>
> First problem: I stored the vector layer in a Geopackage; so I have an fid
> from the geopackage database, an ID from the original xyz-File in field_1,
> and the x, y, z values in field_2, _3 and _4.
>
> Which attribute should I choose?  I think only field_2 and field_3?
>

No you just want the elevation field here I guess it's your _4?

>
> There is a checkbox for the Z-coordinate, whether I with to use it for
> interpolation. I guess I leave unchecked?
>

Yes

>
> >   • click the + to add to the vector layer panel
>
> So I added the two fields, they are "Points"
>

Just the one field

>
> >   • choose the interpolation method - probably best to use
> cubic
> >   • click on the ... next to extent and set it to the layer
> extent
>
> OK
>
> >   • set the pixel size to 5.0 and 5.0
>
> OK
>
> >   • click Run
>
> OK
>
> > This way you won't have the odd sizes you mentioned.  This may give you
> a smoother surface in the end as well.
>
> I started the prozess, but with more than 11 Million points, it seems to
> take too long, I am stuck at 50%. Will try later again.
>

You can always try IDW instead of TIN.

Chris
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread Nicolas Cadieux

Hi,

See below

On 2020-05-14 3:53 a.m., Priv.-Doz. Dr. Maria Shinoto wrote:

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.

This will crash if you have too many points. Trust me!

Some other remarks:


You can also correct this 5x5 problem by using gdal grid with Nearest neighbour 
interpolation. You could use the point data to do this.

So the GDAL tools in the processing toolbox?

Yes, use Grid(Nearest neighbor) in the processing toolbox.



I also post a small presentation that can help go from vector to raster with 
point data. Sometimes, keeping it simple is better.

https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.slideshare.net%2fshencoop%2fqgis%2draster%2dto%2dpoint=81eb74bc-6e72-4f88-9170-4c7619c9c983=4ff16eacbc1d620fae2da429677ec7b85b28c904-585e8c6c01c6d3b66ea068001e65de5403305b6f

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.

Yes but you could do this with the original raster and it works both ways.
  


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.


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.



I do not really understand, but I think when I try, I will see what you mean.


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).

Sounds good :-)

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

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 _will result in rectangular 
pixels_ when reprojected in meters.  I imagine that the data has been 
reprojected.


Nicolas


Nicolas Cadieux
Ça va bien aller!


Le 13 mai 2020 à 11:25, chris hermansen  a écrit :


Maria and list,

On Tue, May 12, 2020 at 7:00 PM Priv.-Doz. Dr. Maria Shinoto 
 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 

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread Priv.-Doz. Dr. Maria Shinoto
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. 

Some other remarks: 

> You can also correct this 5x5 problem by using gdal grid with Nearest 
> neighbour interpolation. You could use the point data to do this.

So the GDAL tools in the processing toolbox?

> I also post a small presentation that can help go from vector to raster with 
> point data. Sometimes, keeping it simple is better.
> 
> https://www.slideshare.net/shencoop/qgis-raster-to-point

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. 

> 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.

I do not really understand, but I think when I try, I will see what you mean. 

> 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).

Sounds good :-)

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


> 
> Nicolas Cadieux
> Ça va bien aller!
> 
>> Le 13 mai 2020 à 11:25, chris hermansen  a écrit :
>> 
>> 
>> Maria and list,
>> 
>> On Tue, May 12, 2020 at 7:00 PM Priv.-Doz. Dr. Maria Shinoto 
>>  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.

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-14 Thread Priv.-Doz. Dr. Maria Shinoto
Chris, 

Thank you for your ideas. I am trying now, but there are some questions: 

> 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

OK until this point


>   • in the TIN Interpolation screen:
>   • select the Vector layer

OK. 

>   • select the Interpolation attribute

First problem: I stored the vector layer in a Geopackage; so I have an fid from 
the geopackage database, an ID from the original xyz-File in field_1, and the 
x, y, z values in field_2, _3 and _4. 

Which attribute should I choose?  I think only field_2 and field_3?

There is a checkbox for the Z-coordinate, whether I with to use it for 
interpolation. I guess I leave unchecked?

>   • click the + to add to the vector layer panel

So I added the two fields, they are "Points"

>   • choose the interpolation method - probably best to use cubic
>   • click on the ... next to extent and set it to the layer extent

OK

>   • set the pixel size to 5.0 and 5.0

OK

>   • click Run

OK

> This way you won't have the odd sizes you mentioned.  This may give you a 
> smoother surface in the end as well.

I started the prozess, but with more than 11 Million points, it seems to take 
too long, I am stuck at 50%. Will try later again.

Best, 
Maria


> 
> 
> -- 
> Chris Hermansen · clhermansen "at" gmail "dot" com
> 
> C'est ma façon de parler.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-13 Thread Nicolas Cadieux
Hi,

You can also correct this 5x5 problem by using gdal grid with Nearest neighbour 
interpolation. You could use the point data to do this.

I also post a small presentation that can help go from vector to raster with 
point data. Sometimes, keeping it simple is better.

https://www.slideshare.net/shencoop/qgis-raster-to-point

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.

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).

Nicolas Cadieux
Ça va bien aller!

> Le 13 mai 2020 à 11:25, chris hermansen  a écrit :
> 
> 
> Maria and list,
> 
>> On Tue, May 12, 2020 at 7:00 PM Priv.-Doz. Dr. Maria Shinoto 
>>  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.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-13 Thread chris hermansen
Maria and list,

On Tue, May 12, 2020 at 7:00 PM Priv.-Doz. Dr. Maria Shinoto <
maria.shin...@zaw.uni-heidelberg.de> 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:

   1. open the processing toolbox Processing > Toolbox
   2. in the toolbox open Interpolation > TIN interpolation
   3. in the TIN Interpolation screen:
  1. select the Vector layer
  2. select the Interpolation attribute
  3. click the + to add to the vector layer panel
  4. choose the interpolation method - probably best to use cubic
  5. click on the ... next to extent and set it to the layer extent
  6. set the pixel size to 5.0 and 5.0
  7. 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.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-12 Thread Priv.-Doz. Dr. Maria Shinoto
Chris, 

Thanks for helping me out. Your detailed explanation was really helpful. I 
could not have done without it, thanks for taking so much time. 

A short memo about what I did is in my answer to Nicolas Cadieux. 

Best, 
Maria


> Am 13.05.2020 um 01:36 schrieb chris hermansen :
> 
> Maria and list,
> 
> On Tue, May 12, 2020 at 4:24 AM Priv.-Doz. Dr. Maria Shinoto 
>  wrote:
> Hi, 
> 
> I am having problems to set up the parameters for Raster > Convert > 
> Rasterize Vector to Raster
> 
> My basic map is JGD2011 / Japan Plnae Rectangular CS II, and I downloaded an 
> xml file JPGIS/GML format, that had to be converted to shapefile in a special 
> application. 
> 
> So according to this https://epsg.io/30162 that projection is:
> Coordinate system: Cartesian 2D CS. Axes: northing, easting (X,Y). 
> Orientations: north, east. UoM: m.
> 
> 
> 
> 
> Now I have the points as a grid with approximately 5m distance and want to 
> convert them to Raster, since this is what I want to use as DEM for analyses. 
> 
> Everything works, but the pixel are extremely largen, not 5m.
> 
> I set the units to pixel, and since it is 5m mesh (from 0.2 seconds), I was 
> told to use 0.56 for horizontal and vertical resolution, but I do not 
> know what I am doing there, and I do not find any similar application in 
> tutorials, handbooks and books, the options in QGIS documentation do not 
> really help. 
> 
> This sounds completely incorrect to me.  I believe you should specifically 
> set the following on your Rasterize (Vector to Raster) dialogue:
> 
> Output raster size units: Georeferenced units
> 
> Width/Horizontal resolution: 5.0
> 
> Height/Vertical resolution: 5.0
> 
> Output extent -> use canvas extent
> 
> 
> Can anybody guide me to the correct value? Or to another flaw in my thinking?
> 
> 
> Since your input point data is in a cartesian (ie x-y) projection and in 
> metres (apparently with Tokyo as its zero point), and since you want your 
> output raster in metres in the same reference system, there is no need to be 
> thinking about how many seconds correspond to metres at your latitude, nor 
> pixels, nor anything like that.
> 
> If you refer to the link above describing the Japan Plane Regular CS II 
> projection, you will see it is based on the Bessel 1841 spheroid.  It may be 
> useful for you to set your project properties before doing the vector to 
> raster conversion.
> 
> Select Project > Properties > CRS, then use the filter to find Tokyo / Japan 
> Plane Rectangular CS II EPSG:30162  Select that coordinate reference system 
> and click Apply.  The menu should look like this:
> 
> 
> 
> 
> -- 
> Chris Hermansen · clhermansen "at" gmail "dot" com
> 
> C'est ma façon de parler.

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-12 Thread Priv.-Doz. Dr. Maria Shinoto
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. 
*

Thanks again, 
Maria






> Am 13.05.2020 um 00:12 schrieb Nicolas Cadieux :
> 
> Hi,
> 
> What is the resolution of the jgd20011 raster?  Look in the layer properties. 
>  Once you are done, use a base map, like something from the quickmap plugin 
> and check the results and the georeferencing.  Pixels will be big if you zoom 
> on them.
> 
> Nicolas Cadieux
> Ça va bien aller!
> 
>> Le 12 mai 2020 à 07:24, Priv.-Doz. Dr. Maria Shinoto 
>>  a écrit :
>> 
>> Hi, 
>> 
>> I am having problems to set up the parameters for Raster > Convert > 
>> Rasterize Vector to Raster
>> 
>> My basic map is JGD2011 / Japan Plnae Rectangular CS II, and I downloaded an 
>> xml file JPGIS/GML format, that had to be converted to shapefile in a 
>> special application. 
>> 
>> Now I have the points as a grid with approximately 5m distance and want to 
>> convert them to Raster, since this is what I want to use as DEM for 
>> analyses. 
>> 
>> Everything works, but the pixel are extremely largen, not 5m.
>> 
>> I set the units to pixel, and since it is 5m mesh (from 0.2 seconds), I was 
>> told to use 0.56 for horizontal and vertical resolution, but I do not 
>> know what I am doing there, and I do not find any similar application in 
>> tutorials, handbooks and books, the options in QGIS documentation do not 
>> really help. 
>> 
>> Can anybody guide me to the correct value? Or to another flaw in my 
>> thinking? 
>> 
>> Thanks a lot, 
>> Maria
>> 
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] vector point grid to raster grid -- pixel size does not work

2020-05-12 Thread Priv.-Doz. Dr. Maria Shinoto
Hi, 

I am having problems to set up the parameters for Raster > Convert > Rasterize 
Vector to Raster

My basic map is JGD2011 / Japan Plnae Rectangular CS II, and I downloaded an 
xml file JPGIS/GML format, that had to be converted to shapefile in a special 
application. 

Now I have the points as a grid with approximately 5m distance and want to 
convert them to Raster, since this is what I want to use as DEM for analyses. 

Everything works, but the pixel are extremely largen, not 5m.

I set the units to pixel, and since it is 5m mesh (from 0.2 seconds), I was 
told to use 0.56 for horizontal and vertical resolution, but I do not know 
what I am doing there, and I do not find any similar application in tutorials, 
handbooks and books, the options in QGIS documentation do not really help. 

Can anybody guide me to the correct value? Or to another flaw in my thinking? 

Thanks a lot, 
Maria

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user