grass-addons icon indicating copy to clipboard operation
grass-addons copied to clipboard

i.sentinel.mask: adapt for non-SQlite vector databases

Open griembauer opened this issue 4 years ago • 4 comments

This PR adaps i.sentinel.mask such that it works in a mapset with a non-SQlite vector database connection. SQlite allows some simplifications of commands that are not possible in other systems (tested here with PostgreSQL):

  • when running v.db.addtable to also add new columns, the datatype of the column must be indicated
  • running v.db.droptable only works if the table exists in the database, it will otherwise throw an error. Because of this, a check is now implemented beforehand
  • running v.to.db already creates an appropriate column so it is not necessary to create the column with v.db.addcolumn beforehand.

griembauer avatar Jun 08 '21 10:06 griembauer

Update: Please ignore for now, more adaptions to i.sentinel.mask are to come (performance improvement)

griembauer avatar Jun 09 '21 06:06 griembauer

Hi, @griembauer When you are looking for speed improvements, maybe you could have a look at #138 for a significant speed improvement of cloud shaddow detection in cases where one has a significant amount clouds that slow vector processing. Basically, the idea is to keep things in raster all the way and use r.region (which takes seconds) + r.stats instead of v.transform + v.overlap which both can take minutes... With few clouds, the vector approach may still be faster though. Since you need the mask as raster dataset further down the processing chain, staying in the raster world is probably an advantage for the next processing steps too... Unfortunately, I have not found the time to implement that myself. So pleasee feel free to pick from there, if relevant for you...

ninsbl avatar Jun 11 '21 07:06 ninsbl

Hi @ninsbl, Thanks a lot for the link, I wasn't aware of this PR honestly, but of course it makes much more sense to take it from there! (indeed staying in the raster world as long as possible is probably the best way to go)

griembauer avatar Jun 11 '21 07:06 griembauer

Please see: #1002

Is this PR still needed then?

ninsbl avatar Dec 28 '23 11:12 ninsbl