r-spatial / mapedit

Interactive editing of spatial data in R
https://www.r-spatial.org/r/2019/03/31/mapedit_leafpm.html
Other
218 stars 33 forks source link

Integration leafmap new feature #119

Open agronomofiorentini opened 2 years ago

agronomofiorentini commented 2 years ago

Dear Creators, First of all i really enjoy the package that you develop.

I am using this tool every day since i have discovered.

I would like to ask you if whether in your development plans for such a package it is possible to integrate the tools shown in this tweet

https://twitter.com/giswqs/status/1487438525108785153

It will be great to have it, in order to create on-fly training shapefile for remote sensing AI applications.

tim-salabim commented 2 years ago

If I am not mistaken, this is pretty much what the current (long standing) PR by @mrjoh3 is about... Am I correct @jlerickson?

mrjoh3 commented 2 years ago

That's correct, for the PR we have a new function that launches a shiny app with these features. We are almost ready to submit a PR, but I just want to add some more documentation and testing.

@agronomofiorentini if you wish to try it out, install mapedit from the fork using remotes::install_github("mrjoh3/mapedit") then run the code below. Once the app opens select a row in the table then add geometry. I would love to hear how intuitive (or unintuitive) you find the UI

# let's a fake site list
data <- data.frame(
  name = c('SiteA', 'SiteB'),
  type = factor(c('park', 'zoo'), levels = c('park', 'factory', 'zoo', 'warehouse')),
  size = c(35, 45),
  stringsAsFactors = FALSE
)

data_with_added_geometry <- editAttributes(data, zoomto = 'Montana', col_add = T, reset = F)

mapview(data_with_added_geometry)

@tim-salabim I expect to be ready for the PR in the next week or two.

tim-salabim commented 2 years ago

Nice! @mrjoh3 just let me know whenever it's ready & I will hopefully find the time to review and merge :-)

agronomofiorentini commented 2 years ago

It will be a pleasure to test it.

I will report here if something is wrong or otherwise if everything is OK.

Thanks a lot to all of you.

agronomofiorentini commented 2 years ago

Dear creators i have tried to install the package by using the remotes procedure remotes::install_github("mrjoh3/mapedit") but i have got the follow error

Downloading GitHub repo mrjoh3/mapedit@HEAD
√  checking for file 'C:\Users\Fiorentini\AppData\Local\Temp\Rtmp8webAX\remotes13d830cf1b5\mrjoh3-mapedit-31deb4b/DESCRIPTION' ... 
-  preparing 'mapedit':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
-  building 'mapedit_0.6.1.tar.gz'

Installazione pacchetto in ‘C:/Users/Fiorentini/Documents/R/win-library/4.1’
(perché ‘lib’ non è specificato)
* installing *source* package 'mapedit' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Avvertimento: sostituzione dell'importazione precedente 'shiny::dataTableOutput' con 'DT::dataTableOutput' durante il caricamento di 'mapedit'
Avvertimento: sostituzione dell'importazione precedente 'shiny::renderDataTable' con 'DT::renderDataTable' durante il caricamento di 'mapedit'
** help
*** installing help indices
  converting help for package 'mapedit'
    finding HTML links ... done
    addToolbar                              html  
    drawFeatures                            html  
    editAttributes                          html  
Errore: C:/Users/Fiorentini/AppData/Local/Temp/Rtmpon6dmt/R.INSTALL3b247cea7cc6/mapedit/man/editAttributes.Rd:48: Bad \link text
* removing 'C:/Users/Fiorentini/Documents/R/win-library/4.1/mapedit'
* restoring previous 'C:/Users/Fiorentini/Documents/R/win-library/4.1/mapedit'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/FIOREN~1/AppData/Local/Temp/Rtmp8webAX/file13d839e0180d/mapedit_0.6.1.tar.gz’ had non-zero exit status

Moreover i have tried to delete and reinstall the mapedit package based on your resource but i have still the same problem.

mrjoh3 commented 2 years ago

Hi @agronomofiorentini I have fixed the code indicated by the error

Errore: C:/Users/Fiorentini/AppData/Local/Temp/Rtmpon6dmt/R.INSTALL3b247cea7cc6/mapedit/man/editAttributes.Rd:48: Bad \link text
* removing 'C:/Users/Fiorentini/Documents/R/win-library/4.1/mapedit'
* restoring previous 'C:/Users/Fiorentini/Documents/R/win-library/4.1/mapedit'

If you have time please try again, can you also let me know what system and R version you are on as I was not getting that error on linux.

thanks

agronomofiorentini commented 2 years ago

Now i could install it and it is working perfectly.

I will work it around, and you will give you a feedback in a while.

My system and R version is the follow

>version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          1.2                         
year           2021                        
month          11                          
day            01                          
svn rev        81115                       
language       R                           
version.string R version 4.1.2 (2021-11-01)
nickname       Bird Hippie 

From the first approach it is great.

mrjoh3 commented 2 years ago

That's great to hear, thanks for letting us know.

On Fri, 4 Feb 2022, 02:18 agronomofiorentini, @.***> wrote:

Now i could install it and it is working perfectly.

I will work it around, and you will give you a feedback in a while.

My system and R version is the follow

version _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 4 minor 1.2 year 2021 month 11 day 01 svn rev 81115 language R version.string R version 4.1.2 (2021-11-01) nickname Bird Hippie

— Reply to this email directly, view it on GitHub https://github.com/r-spatial/mapedit/issues/119#issuecomment-1029096114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOVGANYL5TMTZ4P3MTBZIDUZKMEPANCNFSM5NLPKFIQ . You are receiving this because you were mentioned.Message ID: @.***>

agronomofiorentini commented 2 years ago

I have been using the tool a lot over the last few days and I find it very useful, especially for generating shapefiles which I can then use to train algorithms.

One suggestion is to develop a shiny module that has these integrations.

That would be great, like editMod.

Anyway really thanks

joshualerickson commented 2 years ago

Hey @agronomofiorentini that's a great idea! Right now I'm strapped for time and wouldn't be able to dive in for a while... If you'd like to develop please go for it! @mrjoh3 have any time or interest? Thanks.

agronomofiorentini commented 2 years ago

I have to tell you the truth, I have never developed an R package and perhaps I am not yet so experienced that I can try my hand at it. But I'll try to get a better understanding of what I can do.

joshualerickson commented 2 years ago

Hey no worries! I might have some time in a couple weeks to take a look and see about a module.

agronomofiorentini commented 2 years ago

Hi there, Any news about the development of the shiny module?

Thanks, Marco

joshualerickson commented 2 years ago

Oh crap, sorry I hadn't looked into it... I'll try and take a look later this week. Thanks for the reminder!

tim-salabim commented 2 years ago

As a heads-up for everyone, I've merged @mrjoh3 's PR and had to clean it up a little but then was denied the push to the repo because of old ssh keys. I'd advise everyone to wait until I can actually push to the repo again. Probably not before the weekend

joshualerickson commented 2 years ago

Sounds good Tim. If you need any help let me know! And, totally understand about the keys :) no worries.

joshualerickson commented 2 years ago

Hey @agronomofiorentini, I'm sorry but I haven't had time to dive into a module for this. There are a couple of reasons; 1). 'code smell' Jenny Byran. I just don't know if the structure is setup for a module. 2). Time. I just don't have enough time right now to dig into this. I intuit this would be challenging (relates back to 'code smell') and I have a lot of other projects at the top of the list. I'm sorry I can't look into this right now 😒 Take care!