[GRASS-dev] [GRASS GIS] #2101: Different results from m.proj in different locations
GRASS GIS
trac at osgeo.org
Fri Jan 5 09:00:42 PST 2018
#2101: Different results from m.proj in different locations
---------------------------------+---------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.4.0
Component: Projections/Datums | Version: svn-trunk
Resolution: | Keywords: m.proj, projections
CPU: Unspecified | Platform: Unspecified
---------------------------------+---------------------------------
Comment (by mmetz):
Replying to [comment:4 neteler]:
> I just made a new test here:
>
> {{{
> # part 1:
> GRASS 7.4.0svn (nc_spm_08_grass7):~/grassdata > eval $(r.info
map=elevation -g)
> GRASS 7.4.0svn (nc_spm_08_grass7):~/grassdata > m.proj -o -d input=-
separator=space <<EOF
> > $east $north
> > $west $south
> > EOF
> -78.60830318 35.80918894 0.00000000
> -78.77462049 35.68792712 0.00000000
>
> g.version -reg
> version=7.4.0svn
> date=2018
> revision=r72020
> build_date=2018-01-04
> build_platform=x86_64-pc-linux-gnu
> build_off_t_size=8
> libgis_revision=70829
> libgis_date="2017-04-04 09:43:02 +0200 (Tue, 04 Apr 2017) "
> proj4=4.9.3
> gdal=2.1.3
> geos=3.6.1
> sqlite=3.20.1
> }}}
>
> Then:
>
> {{{
> # part 2:
> GRASS 7.4.0svn (TEST):~/grassdata > g.proj -w
> PROJCS["WGS 84 / Pseudo-Mercator",
> GEOGCS["unnamed",
> DATUM["unknown",
> SPHEROID["unnamed",6378137,"inf"]],
> PRIMEM["Greenwich",0],
> UNIT["degree",0.0174532925199433]],
> PROJECTION["Mercator_2SP"],
> PARAMETER["standard_parallel_1",0],
> PARAMETER["central_meridian",0],
> PARAMETER["false_easting",0],
> PARAMETER["false_northing",0],
> UNIT["Meter",1]]
>
> eval $(r.proj -g input=elevation location=nc_spm_08_grass7
mapset=PERMANENT)
>
> m.proj -o -d input=- separator=space <<EOF
> > $e $n
> > $w $s
> > EOF
> -78.60830318 35.80960938 0.00000000
> -78.77462049 35.68750730 0.00000000
>
> # expected (?)
> -78.60830318 35.80918894 0.00000000
> -78.77462049 35.68792712 0.00000000
> }}}
No, not expected: first you reproject the upper-right corner and the
lower-left corner with `m.proj`. Then you run `r.proj -g` which reprojects
all outer corners of all border cells to figure out the new extents. This
test assumes that a rectangle stays a rectangle after reprojection and
that north of the upper-left and upper-right corner are the same after
reprojection (not to mention northing of points in between the upper-left
and upper-right corner). This assumption is wrong.
EPSG:3857 (WGS 84 Pseudo-Mercator) is now handled reasonably well in 7.4
and 7.5, as long as the location is newly created to get correct
projection information.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2101#comment:5>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list