[GRASS-dev] [GRASS GIS] #3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
-------------------------+---------------------------------
Reporter: stjo | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Keywords: r.in.srtm | CPU: Unspecified
Platform: All |
-------------------------+---------------------------------
I developed an enhancement for r.in.srtm to import SRTM water bodies in
the .raw format and .raw.zip format, e.g. from
https://dds.cr.usgs.gov/srtm/version2_1/SWBD/
Internally, it uses r.in.bin and is activated by the flag 'w' for 'water'.

Maybe someone can check my changes and take a look if my python coding
Style is ok. :slight_smile:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------
Changes (by neteler):

* Attachment "r.in.srtm.diff" added.

enhancement patch

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

I updated the patch, but I'm not able to test it because there are no raw
files in ​https://dds.cr.usgs.gov/srtm/version2_1/SWBD/. In the zip files
there are only shapefile.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

I'm not able to upload the new patch because there is an error [0].

I'm attaching the new patch here

[0] https://trac.osgeo.org/osgeo/ticket/1875

---------- Forwarded message ----------
From: GRASS GIS <trac@osgeo.org>
Date: 10 February 2017 at 17:17
Subject: Re: [GRASS GIS] #3246: r.in.srtm: patch to support SRTM water
bodies import (SWBD)
To:

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

I updated the patch, but I'm not able to test it because there are no raw
files in https://dds.cr.usgs.gov/srtm/version2_1/SWBD/. In the zip files
there are only shapefile.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

--
ciao
Luca

www.lucadelu.org

(attachments)

r_in_srtm.diff (11.4 KB)

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------
Changes (by neteler):

* Attachment "r_in_srtm_luca.diff" added.

Patch updated by lucadelu

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by stjo):

I'm really sorry for the wrong link.

If you still want to test my changes, the correct link is:
https://e4ftl01.cr.usgs.gov/SRTM/SRTMSWBD.003/2000.02.11/

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

Replying to [comment:2 stjo]:
> I'm really sorry for the wrong link.
>
> If you still want to test my changes, the correct link is:
> https://e4ftl01.cr.usgs.gov/SRTM/SRTMSWBD.003/2000.02.11/

Sorry I cannot access again to this link. It seems it requires special
permission, I already authorized LP DAAC on my account.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by stjo):

USGS has changed the link, you can access the data now on:
- https://e4ftl01.cr.usgs.gov/MEASURES/SRTMSWBD.003/2000.02.11/
or
- https://e4ftl01.cr.usgs.gov//MODV6_Dal_D/SRTM/SRTMSWBD.003/2000.02.11/

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

GDAL doesn't support this format by default, reading a little bit more
about the data it seems that is is only the line coast and they also
provide shapefile for this dataset
https://lta.cr.usgs.gov/srtm_water_body_dataset

I think the shapefile is more useful than raster, if you really need
raster you can rasterize the vector.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by neteler):

Replying to [comment:8 lucadelu]:
> I think the shapefile is more useful than raster, if you really need
raster you can rasterize the vector.

I think the idea is that their raster mask precisely matches what was used
in the processing chain. to reach that with self-rasterized vector maps
may lead to slightly different results.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

In [changeset:"72569" 72569]:
{{{
#!CommitTicketReference repository="" revision="72569"
r.in.srtm: added support to SRTM SWBD, see #3246
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by rouault):

Support for opening SRTM SWBD in GDAL added per
https://github.com/OSGeo/gdal/commit/a85292c5af40a48bf5b68ca36712b286ff2a95fb

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.2
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by neteler):

Replying to [comment:10 lucadelu]:
> In [changeset:"72569" 72569]:
> {{{
> #!CommitTicketReference repository="" revision="72569"
> r.in.srtm: added support to SRTM SWBD, see #3246
> }}}

Is this ticket done?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:13&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

Replying to [comment:13 neteler]:
>
> Is this ticket done?

Yes, to me it seems done. Maybe one more test could useful

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:15&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Python | Version: svn-releasebranch72
Resolution: | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------

Comment (by lucadelu):

Closing, reopen if needed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>

#3246: r.in.srtm: patch to support SRTM water bodies import (SWBD)
--------------------------+---------------------------------
  Reporter: stjo | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.6.0
Component: Python | Version: svn-releasebranch72
Resolution: fixed | Keywords: r.in.srtm
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------
Changes (by martinl):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3246#comment:17&gt;
GRASS GIS <https://grass.osgeo.org>