Opened 13 years ago

Last modified 9 years ago

#1397 new defect

Lat/lon compatibility for r.water.outlet

Reported by: awickert Owned by: grass-dev@…
Priority: major Milestone: 6.4.6
Component: Raster Version: svn-releasebranch64
Keywords: r.water.outlet Cc:
CPU: x86-64 Platform: All

Description

Adding the attached line to r.water.outlet allows it to work across the 180 meridian in lat/lon coordinate systems.

I believe that the GRASS command G_adjust_east_longitude() is flagged to work only in lat/lon coordinate systems, so there should not be backwards-compatibility issues, but I haven't tested it with a projected coordinate system.

It might be good as well to change to documentation to reflect that the Northing and Easting can also be Latitude and Longitude.

Attachments (3)

r.water.outlet_latlon_fix (399 bytes ) - added by awickert 13 years ago.
Extra line in main.c to solve longitude wraparound problem when building draiange basins with r.water.outlet
main.c (5.0 KB ) - added by awickert 10 years ago.
r.water.outlet main from 6.4.5svn
main.diff (387 bytes ) - added by awickert 10 years ago.
diffs from 9 OCT 2014

Download all attachments as: .zip

Change History (12)

by awickert, 13 years ago

Attachment: r.water.outlet_latlon_fix added

Extra line in main.c to solve longitude wraparound problem when building draiange basins with r.water.outlet

comment:1 by awickert, 13 years ago

Platform: LinuxAll
Priority: normalmajor

Just got an email from someone else having problems with this, so I increased the priority and the affected OS (it should be a totally cross-platform problem since it is a computational issue). This is really just an issue of copying and pasting one line of code, so it should be a simple fix.

comment:2 by martinl, 13 years ago

Keywords: r.water.outlet added

comment:3 by neteler, 12 years ago

Probably the added function needs to be encapsulated into a LatLong test?

http://grass.osgeo.org/programming6/window__map_8c_source.html#l00149

comment:4 by awickert, 12 years ago

Yes - looks like you are correct and that I misread when I used G_adjust_east_longitude and thought it performed the check; I really wanted G_adjust_easting that wraps G_adjust_east_longitude in the lat/lon projection check.

Thanks for looking into this!

comment:5 by neteler, 12 years ago

Milestone: 6.4.26.4.4

in reply to:  4 ; comment:6 by mlennert, 10 years ago

Replying to awickert:

Yes - looks like you are correct and that I misread when I used G_adjust_east_longitude and thought it performed the check; I really wanted G_adjust_easting that wraps G_adjust_east_longitude in the lat/lon projection check.

Thanks for looking into this!

Any reasons for not applying the proposed patch (but using G_adjust_easting instead of G_adjust_east_longitude) ?

Moritz

in reply to:  6 comment:7 by awickert, 10 years ago

Milestone: 6.4.46.4.5

Replying to mlennert:

Replying to awickert:

Yes - looks like you are correct and that I misread when I used G_adjust_east_longitude and thought it performed the check; I really wanted G_adjust_easting that wraps G_adjust_east_longitude in the lat/lon projection check.

Thanks for looking into this!

Any reasons for not applying the proposed patch (but using G_adjust_easting instead of G_adjust_east_longitude) ?

Moritz

In my case, I'm not a GRASS-dev, so write access was what prevented me from doing this! I have now downloaded GRASS 6.4.5svn to incorporate all updates to date and have applied and checked this change. I am now working to incorporate it into GRASS 7.1.0svn and will open a separate ticket on that once I have finished.

Thanks in advance to whomever looks into (and hopefully accepts!) this fix. Files attached.

Andy Wickert

by awickert, 10 years ago

Attachment: main.c added

r.water.outlet main from 6.4.5svn

by awickert, 10 years ago

Attachment: main.diff added

diffs from 9 OCT 2014

comment:8 by martinl, 9 years ago

Milestone: 6.4.5

Ticket retargeted after milestone closed

comment:9 by martinl, 9 years ago

Milestone: 6.4.6
Note: See TracTickets for help on using tickets.