[GRASS-user] Creating location using EPSG code

The region in the project location is incorrect. With only one small data
set imported I decided to start over by deleting that location in
/data/grassdata/.

I created a subdirectory for the project /data/grassdata/mohler/ then
started grass within that directory: grass79 -c epsg:2838 --gui PERMANENT

The EPSG code is defined as:

EPSG 2838 NAD83(HARN) <http://www.spatialreference.org/ref/epsg/2838/&gt;
proj4: +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m +no_defs

but those are not the values seen by g.region:

GRASS 7.9.dev (mohler):/data/grassdata > g.region -p
projection: 99 (NAD83(HARN) / Oregon North)
zone: 0
datum: nad83harn
ellipsoid: grs80
north: 1
south: 0
west: 0
east: 1
nsres: 1
ewres: 1
rows: 1
cols: 1
cells: 1

What have I done incorrectly?

TIA,

Rich

Hi Rich,

On 2019-08-26 at 23:10 +02, Rich Shepard <rshepard@appl-ecosys.com> wrote...

The region in the project location is incorrect.

No. Setting the region and location are different things. You set the location with your "-c EPSG:2838".

With only one small data set imported I decided to start over by
deleting that location in /data/grassdata/.

You haven't shown the import command, but you can set the region from imported data with:

g.region (raster=... | vector=....)

Or explicitly:

g.region e=... w=... n=... s=... res=...

If setting with vector=... you'll need to set the "res" explicitly.

What have I done incorrectly?

Not set your region, just your location.

  -k.

On Tue, 27 Aug 2019, Ken Mankoff wrote:

No. Setting the region and location are different things. You set the
location with your "-c EPSG:2838".

Ken,

While I know that regions are subsets within the bounds of the CRS defined
for a location I don't recall importing a vector or raster map and not being
able to zoom to its extents before explicitly setting a region.

Thanks,

Rich

On Mon, Aug 26, 2019 at 11:10 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:

The region in the project location is incorrect. With only one small data
set imported I decided to start over by deleting that location in
/data/grassdata/.

I created a subdirectory for the project /data/grassdata/mohler/ then
started grass within that directory: grass79 -c epsg:2838 --gui PERMANENT

The EPSG code is defined as:

EPSG 2838 NAD83(HARN) <http://www.spatialreference.org/ref/epsg/2838/>
proj4: +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m +no_defs

but those are not the values seen by g.region:

GRASS 7.9.dev (mohler):/data/grassdata > g.region -p
projection: 99 (NAD83(HARN) / Oregon North)
zone: 0
datum: nad83harn
ellipsoid: grs80
north: 1
south: 0
west: 0
east: 1
nsres: 1
ewres: 1
rows: 1
cols: 1
cells: 1

What have I done incorrectly?

The purpose of g.region is to show/change the current computational region.

If you want to verify the CRS of the current location, use g.proj.

Markus M

TIA,

Rich


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

On Tue, 27 Aug 2019, Markus Metz wrote:

If you want to verify the CRS of the current location, use g.proj.

Markus M,

Ah, I totally forgot that.

Many thanks!

Rich

On 2019-08-27 at 16:42 +02, Rich Shepard <rshepard@appl-ecosys.com> wrote...

While I know that regions are subsets within the bounds of the CRS
defined for a location I don't recall importing a vector or raster map
and not being able to zoom to its extents before explicitly setting a
region.

Perhaps in the earlier work the region was set w/o import based on how you created the location? If you created the location using "-c SomeGeoTiff.tif", then the region is set to that file. If you create it with "-c EPSG:nnnn", it doesn't know extent, resolution, etc. and the defaults, as you saw, are all 0 or 1.

  -k.

On Wed, 28 Aug 2019, Ken Mankoff wrote:

Perhaps in the earlier work the region was set w/o import based on how you
created the location? If you created the location using "-c
SomeGeoTiff.tif", then the region is set to that file. If you create it
with "-c EPSG:nnnn", it doesn't know extent, resolution, etc. and the
defaults, as you saw, are all 0 or 1.

Ken,

Yes, this explains the difference. Almost always prior project locations
were created using a .adf or .prj file with the CRS and the balance of the
files with the data.

Thanks for the insight.

Best regards,

Rich