Hi GRASS List,
I've just spent 30 days on a field campaign collecting data. I have a large amount of it in a GRASS mapset with location EPSG:3413. I'd like to set up a new location with (0,0) centered on our basecamp and everything nearby relative to that. Can someone advise how to use "proj" to create a new location centered on either a (lon,lat) location but with units meter, or centered on an (x,y) location from a different projection?
The reason for this is so I can push data to ParaView which doesn't work well with coordinate systems far removed from the origin.
Thanks,
-k.
* Ken Mankoff <mankoff@gmail.com> [2018-05-19 11:35:23 +0200]:
Hi GRASS List,
I've just spent 30 days on a field campaign collecting data. I have a
large amount of it in a GRASS mapset with location EPSG:3413. I'd like
to set up a new location with (0,0) centered on our basecamp and
everything nearby relative to that. Can someone advise how to use
"proj" to create a new location centered on either a (lon,lat) location
but with units meter, or centered on an (x,y) location from a different
projection?
The reason for this is so I can push data to ParaView which doesn't
work well with coordinate systems far removed from the origin.
Ken,
some starter idea (?)
# create an unprojected XY location
grass -c /grassdb/xy
# import an 256 by 256 sized (unprojected) TIFF
r.external input=SomeTIFF out=SomeTIFF
# re-set SomeTIFF's region
r.region n=128 s=-128 w=-128 e=128
Now (0,0) is in the center of the image.
Nikos
On Sat, May 19, 2018 at 11:35 AM, Ken Mankoff <mankoff@gmail.com> wrote:
Hi GRASS List,
I’ve just spent 30 days on a field campaign collecting data. I have a large amount of it in a GRASS mapset with location EPSG:3413. I’d like to set up a new location with (0,0) centered on our basecamp and everything nearby relative to that. Can someone advise how to use “proj” to create a new location centered on either a (lon,lat) location but with units meter, or centered on an (x,y) location from a different projection?
You could create a custom CRS based on EPSG:3413
the PROJ.4 term for EPSG:3413 is:
+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs
now get the coordinates of the basecamp, invert the sign of the coordinates and use these as false easting / false northing
e.g. if the basecamp is at 4000000, 5000000, use
+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=-4000000 +y_0=-5000000 +datum=WGS84 +units=m +no_defs
to define a custom projection centered on the basecamp
HTH,
Markus M
The reason for this is so I can push data to ParaView which doesn’t work well with coordinate systems far removed from the origin.
Thanks,
-k.
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
Hi Markus,
On 2018-05-19 at 15:35 +0200, Markus Metz <markus.metz.giswork@gmail.com> wrote:
On Sat, May 19, 2018 at 11:35 AM, Ken Mankoff <mankoff@gmail.com> wrote:
I'd like to set up a new location with (0,0) centered on our basecamp
and everything nearby relative to that. Can someone advise how to use
"proj" to create a new location centered on either a (lon,lat)
location but with units meter, or centered on an (x,y) location from a
different projection?
You could create a custom CRS based on EPSG:3413 the PROJ.4 term for
EPSG:3413 is: +proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0
+y_0=0 +datum=WGS84 +units=m +no_defs
now get the coordinates of the basecamp, invert the sign of the
coordinates and use these as false easting / false northing e.g. if
the basecamp is at 4000000, 5000000, use +proj=stere +lat_0=90
+lat_ts=70 +lon_0=-45 +k=1 +x_0=-4000000 +y_0=-5000000 +datum=WGS84
+units=m +no_defs
This works perfectly. Thank you!
-k.
Full code I use is:
grass74 ./G/PERMANENT
v.import input=./GPX/camp.gpx output=camp --o
CAMP=$(v.out.ascii camp)
CAMP_X=$(echo $CAMP | cut -d"." -f1)
CAMP_Y=$(echo $CAMP | cut -d"|" -f2 | cut -d"." -f1)
CAMP_X=$(( -1 * $CAMP_X ))
CAMP_Y=$(( -1 * $CAMP_Y ))
PROJ=$(g.proj -j)
PROJ_ADJ=$(echo $PROJ | sed s/x_0=0/x_0=${CAMP_X}/ | sed s/y_0=0/y_0=${CAMP_Y}/)
echo $PROJ_ADJ > ./G_XY.tmp
grass74 -c ./G_XY
cat ./G_XY.tmp | g.proj -c proj4=-
trash G_XY.tmp
exit # G_XY
exit # G