Hi all, I am trying to convert some data from a lat-long projection to a utm
projection. I am using v.proj, but the projected vectors come out in the wrong
location (northern hemisphere, when they should be southern). The area I am
using is in Chile, so it is in the southern hemisphere, I was thinking this
might be the problem? The v.info results are listed here.
Projection: UTM (zone 19)
|N: 8062436 S: 3775859
|E: 774210 W: -213663
Projection: Latitude-Longitude (zone 0)
|N: -18 S: -56
|E: -66 W: -76
Both projections use the wgs84 datum.
Any ideas out there?
-i
On Thu, 29 Jan 2004, Ian Macmillan wrote:
Hi all, I am trying to convert some data from a lat-long projection to a utm
projection. I am using v.proj, but the projected vectors come out in the wrong
location (northern hemisphere, when they should be southern). The area I am
using is in Chile, so it is in the southern hemisphere, I was thinking this
might be the problem? The v.info results are listed here.
Projection: UTM (zone 19)
|N: 8062436 S: 3775859
|E: 774210 W: -213663
Projection: Latitude-Longitude (zone 0)
|N: -18 S: -56
|E: -66 W: -76
Both projections use the wgs84 datum.
What are the PROJ_INFO files for your locations? (g.projinfo)
And the output of g.region -p ?
I'm thinking it should say zone -19, not 19, although that wouldn't affect
v.proj which should get all the projection information from PROJ_INFO. If
it has zone: 19 then it should also contain south: defined although
zone: -19 on its own should also work.
Quoting Paul Kelly <paul-grass@stjohnspoint.co.uk>:
On Thu, 29 Jan 2004, Ian Macmillan wrote:
> Hi all, I am trying to convert some data from a lat-long projection to a
utm
> projection. I am using v.proj, but the projected vectors come out in the
wrong
> location (northern hemisphere, when they should be southern). The area I
am
> using is in Chile, so it is in the southern hemisphere, I was thinking
this
> might be the problem? The v.info results are listed here.
>
> Projection: UTM (zone 19)
> |N: 8062436 S: 3775859
> |E: 774210 W: -213663
>
> Projection: Latitude-Longitude (zone 0)
> |N: -18 S: -56
> |E: -66 W: -76
>
> Both projections use the wgs84 datum.
What are the PROJ_INFO files for your locations? (g.projinfo)
And the output of g.region -p ?
I'm thinking it should say zone -19, not 19, although that wouldn't affect
v.proj which should get all the projection information from PROJ_INFO. If
it has zone: 19 then it should also contain south: defined although
zone: -19 on its own should also work.
Hey all, so I am a bit of an idiot, the vector I am trying to import extends
much farther than zone 19. I figured this must be the main problem. However,
when I converted the vector to a raster (v.to.rast) and cut the raster down to
an area that is definitely within zone 19 (using r.mapcalc, and resizing the
region), using r.proj (in the utm location) only yields an error message saying
the proposed raster lies outside of my current region (even though the region
was set to fit an area larger than the raster.
Ack, i am lost, i have used r.proj successfully many times, but something seems
to be wrong here.
My proj_info file says zone: 19 and south: defined in the utm location.
Any ideas?
Thanks a bunch, ian
Please do what Paul is asking for: send the output of g.region -p and
g.projinfo for both your lonlat and utm location. Then maybe we can help
you.
On Fri, 30 Jan 2004, Ian Macmillan wrote:
Quoting Paul Kelly <paul-grass@stjohnspoint.co.uk>:
> On Thu, 29 Jan 2004, Ian Macmillan wrote:
>
> > Hi all, I am trying to convert some data from a lat-long projection to a
> utm
> > projection. I am using v.proj, but the projected vectors come out in the
> wrong
> > location (northern hemisphere, when they should be southern). The area I
> am
> > using is in Chile, so it is in the southern hemisphere, I was thinking
> this
> > might be the problem? The v.info results are listed here.
> >
> > Projection: UTM (zone 19)
> > |N: 8062436 S: 3775859
> > |E: 774210 W: -213663
> >
> > Projection: Latitude-Longitude (zone 0)
> > |N: -18 S: -56
> > |E: -66 W: -76
> >
> > Both projections use the wgs84 datum.
>
> What are the PROJ_INFO files for your locations? (g.projinfo)
> And the output of g.region -p ?
> I'm thinking it should say zone -19, not 19, although that wouldn't affect
> v.proj which should get all the projection information from PROJ_INFO. If
> it has zone: 19 then it should also contain south: defined although
> zone: -19 on its own should also work.
>
Hey all, so I am a bit of an idiot, the vector I am trying to import extends
much farther than zone 19. I figured this must be the main problem. However,
when I converted the vector to a raster (v.to.rast) and cut the raster down to
an area that is definitely within zone 19 (using r.mapcalc, and resizing the
region), using r.proj (in the utm location) only yields an error message saying
the proposed raster lies outside of my current region (even though the region
was set to fit an area larger than the raster.
Ack, i am lost, i have used r.proj successfully many times, but something seems
to be wrong here.
My proj_info file says zone: 19 and south: defined in the utm location.
Any ideas?
Thanks a bunch, ian
Sorry about that, here they are.
-ian
projection: 1 (UTM)
zone: 19
datum: wgs84
ellipsoid: wgs84
north: -3236376
south: -4428820
west: -363600
east: 974700
nsres: 902
ewres: 900
rows: 1322
cols: 1487
PROJ_INFO file:
name: UTM
datum: wgs84
proj: utm
ellps: wgs84
a: 6378137.0000000000
es: 0.0066943800
f: 298.2572235630
zone: 19
south: defined
-----------------------------------------------------------
PROJ_UNITS file:
unit: meter
units: meters
meters: 1.0
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 30:29:46.068S
south: 41:00:00.936S
west: 73:40:13.872W
east: 67:49:52.284W
nsres: 0:00:30.0118
ewres: 0:00:29.988
rows: 1260
cols: 701
PROJ_INFO file:
name: Latitude-Longitude
datum: wgs84
proj: ll
ellps: wgs84
-----------------------------------------------------------
PROJ_UNITS file:
unit: degree
units: degrees
meters: 1.0
The values for north and south in the utm location should both be
positive. I tried
north: 8112600
south: 3770400
and got Chile nicely in the monitor window.
rgds
Morten
On Fri, 30 Jan 2004, Ian Macmillan wrote:
Sorry about that, here they are.
-ian
projection: 1 (UTM)
zone: 19
datum: wgs84
ellipsoid: wgs84
north: -3236376
south: -4428820
west: -363600
east: 974700
nsres: 902
ewres: 900
rows: 1322
cols: 1487
PROJ_INFO file:
name: UTM
datum: wgs84
proj: utm
ellps: wgs84
a: 6378137.0000000000
es: 0.0066943800
f: 298.2572235630
zone: 19
south: defined
-----------------------------------------------------------
PROJ_UNITS file:
unit: meter
units: meters
meters: 1.0
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 30:29:46.068S
south: 41:00:00.936S
west: 73:40:13.872W
east: 67:49:52.284W
nsres: 0:00:30.0118
ewres: 0:00:29.988
rows: 1260
cols: 701
PROJ_INFO file:
name: Latitude-Longitude
datum: wgs84
proj: ll
ellps: wgs84
-----------------------------------------------------------
PROJ_UNITS file:
unit: degree
units: degrees
meters: 1.0
Quoting morten@untamo.net:
The values for north and south in the utm location should both be
positive. I tried
north: 8112600
south: 3770400
and got Chile nicely in the monitor window.
rgds
Morten
Hmm, that is interesting, then I guess the problem isn't with v.proj. It is
with r.in.gdal. I imported a bunch of landsat rasters (from university of
maryland). The utm region that I gave is the region that shows when I set
g.region raster=mylandsat. I have posted the meta file here for the geotiffs i
imported.
www.uweb.ucsb.edu/~ian_macmillan/p233r084_7x19991226.txt
The coordinates given are all in latlong, however the projection said utm, hence
my importing them into a utm location. did I do something wrong there?
-ian
On Fri, 30 Jan 2004, Ian Macmillan wrote:
Quoting morten@untamo.net:
>
>
> The values for north and south in the utm location should both be
> positive. I tried
>
> north: 8112600
> south: 3770400
>
> and got Chile nicely in the monitor window.
>
> rgds
> Morten
>
Hmm, that is interesting, then I guess the problem isn't with v.proj. It is
with r.in.gdal. I imported a bunch of landsat rasters (from university of
maryland). The utm region that I gave is the region that shows when I set
g.region raster=mylandsat. I have posted the meta file here for the geotiffs i
imported.
Don't know about that, but in proj (and grass) the utm projection for
the south hemisphere has a built-in false northing of -10,000,000 meters.
So north and south in your location are measured as the distance from the
south pole instead of from the equator.
Morten
www.uweb.ucsb.edu/~ian_macmillan/p233r084_7x19991226.txt
The coordinates given are all in latlong, however the projection said utm, hence
my importing them into a utm location. did I do something wrong there?
-ian
Ian Macmillan wrote:
> The values for north and south in the utm location should both be
> positive. I tried
>
> north: 8112600
> south: 3770400
>
> and got Chile nicely in the monitor window.
>
> rgds
> Morten
>
Hmm, that is interesting, then I guess the problem isn't with v.proj. It is
with r.in.gdal. I imported a bunch of landsat rasters (from university of
maryland). The utm region that I gave is the region that shows when I set
g.region raster=mylandsat. I have posted the meta file here for the geotiffs i
imported.
www.uweb.ucsb.edu/~ian_macmillan/p233r084_7x19991226.txt
GROUP = METADATA_FILE
...
SCENE_UL_CORNER_MAPX = 232531.500
SCENE_UL_CORNER_MAPY = -3727258.500
SCENE_UR_CORNER_MAPX = 415957.500
SCENE_UR_CORNER_MAPY = -3755644.500
SCENE_LL_CORNER_MAPX = 194484.000
SCENE_LL_CORNER_MAPY = -3906609.000
SCENE_LR_CORNER_MAPX = 378223.500
SCENE_LR_CORNER_MAPY = -3934966.500
...
GROUP = PROJECTION_PARAMETERS
...
FALSE_NORTHING = 0
...
MAP_PROJECTION = "UTM"
END_GROUP = PROJECTION_PARAMETERS
GROUP = UTM_PARAMETERS
ZONE_NUMBER = +19
This indicates that it is using a northern-hemisphere UTM zone for
southern-hemisphere data. Some software may cope with it, but I
wouldn't rely upon it. In particular, "south: defined" will completely
mess things up (the data *should* be using a southern-hemisphere zone,
but it isn't).
--
Glynn Clements <glynn.clements@virgin.net>
Hey all, thanks a ton for your responses. It was most helpful. Turns out I
finally just erased the old southern hemisphere utm location, and made a new
utm location (zone 19) in the northern hemisphere. I imported everything into
the new location (r.in.gdal) and was able to use v.proj without any hitches.
All my regions show up as negative north and south values, but that is ok with
me. Things show where they are supposed to and everything!
Thanks again.
Ian
GROUP = METADATA_FILE
...
SCENE_UL_CORNER_MAPX = 232531.500
SCENE_UL_CORNER_MAPY = -3727258.500
SCENE_UR_CORNER_MAPX = 415957.500
SCENE_UR_CORNER_MAPY = -3755644.500
SCENE_LL_CORNER_MAPX = 194484.000
SCENE_LL_CORNER_MAPY = -3906609.000
SCENE_LR_CORNER_MAPX = 378223.500
SCENE_LR_CORNER_MAPY = -3934966.500
...
GROUP = PROJECTION_PARAMETERS
...
FALSE_NORTHING = 0
...
MAP_PROJECTION = "UTM"
END_GROUP = PROJECTION_PARAMETERS
GROUP = UTM_PARAMETERS
ZONE_NUMBER = +19
This indicates that it is using a northern-hemisphere UTM zone for
southern-hemisphere data. Some software may cope with it, but I
wouldn't rely upon it. In particular, "south: defined" will completely
mess things up (the data *should* be using a southern-hemisphere zone,
but it isn't).
On Fri, Jan 30, 2004 at 03:02:33PM -0800, Ian Macmillan wrote:
Quoting morten@untamo.net:
>
>
> The values for north and south in the utm location should both be
> positive. I tried
>
> north: 8112600
> south: 3770400
>
> and got Chile nicely in the monitor window.
>
> rgds
> Morten
>
Hmm, that is interesting, then I guess the problem isn't with v.proj. It is
with r.in.gdal. I imported a bunch of landsat rasters (from university of
maryland). The utm region that I gave is the region that shows when I set
g.region raster=mylandsat. I have posted the meta file here for the geotiffs i
imported.
www.uweb.ucsb.edu/~ian_macmillan/p233r084_7x19991226.txt
The coordinates given are all in latlong, however the projection said utm, hence
my importing them into a utm location. did I do something wrong there?
-ian
Maybe related to the problem: At least one LANDSAT scene from university
of Maryland covering Botswana was regitered to UTM Northern hemisphere.
Using the tools from libgeotiff I was able to remap the coordinates
to southern hemisphere and to add the false northing required for UTM
South. This error was confirmed for the Botswana dataset by the Maryland
people.
However, I didn't look into above file if you have the same problem.
'gdalinfo' (best from current GDAL-CVS) is a great help to identify
such data set problems.
Markus Neteler