Re: [GRASS-user] Reprojecting to x,y grid

2020-11-19 Thread Ken Mankoff

On 2020-11-19 at 01:18 -08, Moritz Lennert  
wrote...
> Maybe because of changes linked to proj6 support ? Markus Metz will
> know.

Yes I found this yesterday. Here is the v.proj recent commits 
https://github.com/OSGeo/grass/commits/master/vector/v.proj

And I'm guessing it was this commit that introduced the behavior change 
https://github.com/OSGeo/grass/commit/ce56f30a6871356dac0db49c5faa850941e3#diff-fa03e53897bb203999fbd1b78e611058b754555626b19744b8c6f71f95c0955a

  -k.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reprojecting to x,y grid

2020-11-19 Thread Moritz Lennert

On 18/11/20 15:01, Ken Mankoff wrote:

Hello,

On 2020-11-17 at 10:06 -08, Ken Mankoff  wrote...

I've successfully worked in rotated pole coordinates (e.g., [1]) but
because I don't know what (x,y) coord contains the pole, I haven't
figured out how to adapt this to the rotated pole situation as in [1].
Anyway, this isn't a rotated pole...


I was incorrect - this is a rotated pole coordinate system.

When I run the following code on GRASS 7.4, I get the attached graphic. The key 
part here is that the rotated pole is at (lon,lat) = (-200,18).



grass -c EPSG:4326 Gnorm

# Import something into the normal location
v.import input=~/data/Zwally_2012/sectors output=Z

cat << EOF > ./Gnorm/PERMANENT/PROJ_INFO
name: General Oblique Transformation
datum: wgs84
towgs84: 0.000,0.000,0.000
proj: ob_tran
o_proj: latlon
ellps: wgs84
a: 6378137.00
es: 0.0066943800
f: 298.2572235630
lat_0: 0.00
lon_0: 180.00
o_lat_p: 18.0
o_lon_p: -200.0
EOF

# rotated_pole:grid_north_pole_latitude = 18. ;
# rotated_pole:grid_north_pole_longitude = -200.

cat << EOF > ./Gnorm/PERMANENT/PROJ_UNITS
unit: degree
units: degrees
meters: .0174532925
EOF

grass -e -c EPSG:4326 Grot
grass ./Grot/PERMANENT

v.proj location=Gnorm input=Z
g.region vector=Z

d.mon start=wx0
d.vect Z
d.grid 1:0:0


The above code run in GRASS 7.4.0 on a clean Ubuntu 18.04 VM produces the 
attached graphic. However, when I run the exact same code in GRASS 7.8.4 it 
does not work. The reproject/rotate does not occur, and Greenland remains at 
62-82 N, and 22-72 W.

The contents of the "Gnorm" folders is appears identical. The md5sum of 
DEFAULT_WIND, MYNAME, PROJ_EPSG, PROJ_INFO, and PROJ_UNITS are all the same.

I can do the work in GRASS 7.4 in a VM but I'd prefer to do it on the main 
development machine in the latest GRASS. Does anyone have any idea why this 
feature stopped working?


Maybe because of changes linked to proj6 support ? Markus Metz will know.

Moritz



Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reprojecting to x,y grid

2020-11-18 Thread Ken Mankoff
Hello,

On 2020-11-17 at 10:06 -08, Ken Mankoff  wrote...
> I've successfully worked in rotated pole coordinates (e.g., [1]) but
> because I don't know what (x,y) coord contains the pole, I haven't
> figured out how to adapt this to the rotated pole situation as in [1].
> Anyway, this isn't a rotated pole...

I was incorrect - this is a rotated pole coordinate system.

When I run the following code on GRASS 7.4, I get the attached graphic. The key 
part here is that the rotated pole is at (lon,lat) = (-200,18).



grass -c EPSG:4326 Gnorm

# Import something into the normal location
v.import input=~/data/Zwally_2012/sectors output=Z

cat << EOF > ./Gnorm/PERMANENT/PROJ_INFO
name: General Oblique Transformation
datum: wgs84
towgs84: 0.000,0.000,0.000
proj: ob_tran
o_proj: latlon
ellps: wgs84
a: 6378137.00
es: 0.0066943800
f: 298.2572235630
lat_0: 0.00
lon_0: 180.00
o_lat_p: 18.0
o_lon_p: -200.0
EOF

# rotated_pole:grid_north_pole_latitude = 18. ;
# rotated_pole:grid_north_pole_longitude = -200.

cat << EOF > ./Gnorm/PERMANENT/PROJ_UNITS
unit: degree
units: degrees
meters: .0174532925
EOF

grass -e -c EPSG:4326 Grot
grass ./Grot/PERMANENT

v.proj location=Gnorm input=Z
g.region vector=Z

d.mon start=wx0
d.vect Z
d.grid 1:0:0


The above code run in GRASS 7.4.0 on a clean Ubuntu 18.04 VM produces the 
attached graphic. However, when I run the exact same code in GRASS 7.8.4 it 
does not work. The reproject/rotate does not occur, and Greenland remains at 
62-82 N, and 22-72 W.

The contents of the "Gnorm" folders is appears identical. The md5sum of 
DEFAULT_WIND, MYNAME, PROJ_EPSG, PROJ_INFO, and PROJ_UNITS are all the same.

I can do the work in GRASS 7.4 in a VM but I'd prefer to do it on the main 
development machine in the latest GRASS. Does anyone have any idea why this 
feature stopped working?

Thanks,

  -k.
  

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reprojecting to x,y grid

2020-11-17 Thread Ken Mankoff
Hi Markus,

On 2020-11-17 at 14:40 -08, Markus Neteler  wrote...
> On Tue, Nov 17, 2020 at 7:06 PM Ken Mankoff  wrote:
>> I have a data set provided on an (x,y) grid, where each coordinate
>> does have a paired (lon,lat). I'd like to work on the native (x,y)
>> grid, and bring some other geo-referenced data there. How do I do
>> this?
>
> Here 2.5 wild guesses:
>
> If it is about "pushing around" a raster map (no squeezing):
> - https://grass.osgeo.org/grass78/manuals/r.region.html
>
> If a rotation is needed:
> - https://grass.osgeo.org/grass7/manuals/addons/i.rotate.html
>
> If it is about a real transform:
> - convert the raster matrix to its vector center point representation; then
> - https://grass.osgeo.org/grass78/manuals/v.transform.html
> - rasterize again

Thanks for getting me thinking down this path.

This isn't about the raster. I want to work in the raster XY location. I want 
to reproject a vector there. I know the (lon,lat) of every (x,y). 

I think maybe I need to solve this outside of GRASS - I can take the (lon,lat) 
of each point of the geo-referenced vector, and look up the nearest (lon,lat) 
in the XY location, and set those as the new coordinates for the vector.

I'm not yet sure what the difference is between that method and using 
v.rectify. I would build the control points using the same method: Take the 
(lon,lat) of each point of the geo-referenced vector, look up the nearest 
(lon,lat) in the XY location, from there jump to the (x,y) coord in the XY 
location, and use those as my control points. I then rectify (un-project?) the 
vector to the XY coords.

Is the only difference that the second method would "fill in" points that I 
don't map between (lon,lat) and (x,y), while the first method requires that I 
update every point?

Thanks,

  -k.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Reprojecting to x,y grid

2020-11-17 Thread Markus Neteler
On Tue, Nov 17, 2020 at 7:06 PM Ken Mankoff  wrote:
>
> Hi GRASS list,
>
> I have a data set provided on an (x,y) grid, where each coordinate does have 
> a paired (lon,lat). I'd like to work on the native (x,y) grid, and bring some 
> other geo-referenced data there. How do I do this?

Here 2.5 wild guesses:

If it is about "pushing around" a raster map (no squeezing):
- https://grass.osgeo.org/grass78/manuals/r.region.html

If a rotation is needed:
- https://grass.osgeo.org/grass7/manuals/addons/i.rotate.html

If it is about a real transform:
- convert the raster matrix to its vector center point representation; then
- https://grass.osgeo.org/grass78/manuals/v.transform.html
- rasterize again

But again, just some almost random ideas.

best,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user