[GRASS-user] custom local map location

Ken Mankoff mankoff at gmail.com
Sun May 20 00:02:13 PDT 2018


Hi Markus,

On 2018-05-19 at 15:35 +0200, Markus Metz <markus.metz.giswork at gmail.com> wrote:
> On Sat, May 19, 2018 at 11:35 AM, Ken Mankoff <mankoff at 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


More information about the grass-user mailing list