Python - ArcMap

381
5
Jump to solution
02-27-2018 01:05 PM
AgataKochanowska
New Contributor

Hello

Doas somebody knows maybe why script below does not work? I want to collect all rasters into one image but unfortunetelly it does not work   Thank you for answers

0 Kudos
1 Solution

Accepted Solutions
RebeccaStrauch__GISP
MVP Esteemed Contributor

Agata Kochanowska  can you move this to the Python space and convert it to a Question.  If you can, I'll tag Michelle Mathias‌ and see if she can.

Questions tend to get more views and responses.  For additinal tips, check out https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-t...

but to also help answer, spacing is very important in Python.  When in the softwares window, you do not need to import python (that is needed if not in ArcMap or Catalog).  But as a start, have each of you import statements on one line, e.g.

   import arcpy

   import env

each command should be on a separate line.

View solution in original post

5 Replies
RebeccaStrauch__GISP
MVP Esteemed Contributor

Agata Kochanowska  can you move this to the Python space and convert it to a Question.  If you can, I'll tag Michelle Mathias‌ and see if she can.

Questions tend to get more views and responses.  For additinal tips, check out https://community.esri.com/community/help-and-feedback/blog/2016/08/15/community-news-and-tips-how-t...

but to also help answer, spacing is very important in Python.  When in the softwares window, you do not need to import python (that is needed if not in ArcMap or Catalog).  But as a start, have each of you import statements on one line, e.g.

   import arcpy

   import env

each command should be on a separate line.

MichelleMathias
Community Manager

Hi Rebecca, I converted it to a question and moved it to Python. Thanks!

Michelle Mathias
Community Manager, Esri Community Team.
MicahBabinski
Regular Contributor

Hi Agata,

You'll need to put each line of code on it's own line. You have them all on one right now which won't work.

Micah

XanderBakker
Esri Esteemed Contributor

Although we can point you in the right direction and help you create the python script, I wonder if you really need to script this, since you can also simply use the tool Composite Bands—Help | ArcGIS Desktop  directly for this purpose.

In case you want to do this for several Landsat images it might we worthwhile to script this. If that is the case it would be good to provide more info on how your data is structured (paths for instance) and any other relevant information so that the solutions provided will help you to process the specific requirements you have.

AgataKochanowska
New Contributor

Thank you All for respond!

Problem solved: I just put those data line by line, not in the row and is perfect! I am greatful for your help.