3

For a project I want to create a little program that does simple things like export a map from the python command line, but also users are able to edit said map (without having to open arcmap) e.g change font text, replace a street name with another street name, change map layout. I know you can do something similiar in arcpy.mapping from the command line - but what if I use gui tools to create a small program that allows users to do so by pressing buttons (e.g one button exports map, I could then upload a few example maps that can be worked on) - I'm looking at using tkinter.

Does this sound overly complex?

I can remove the gui tools part if its too hard - is it possible to test out python programs somewhere?

  • like can I upload it somewhere and test it out and do I need html knowledge?

  • on a second note - does anyone know a way to replace a graphic in all maps - for example, if I want to replace the company logo of all my maps with another logo I've made - I've googled and can't seem to find an answer to it.

4

You're going to be quite limited if you're going the pure Python route -- for one, you can't use Tkinter in arc*.exe, the event loops will conflict. If you do something that runs in python.exe instead, Tkinter will work but you'll have no way to show the map for any sort of interactive selection (though you might hack something together with PIL and a canvas and exporting maps to temporary .JPG or .PNG files). Obviously in that case a Tkinter UI will work, but ideally coming to terms with a geoprocessing tool and its associated dialog might be your best bet.

| improve this answer | |
  • Thanks - was thinking along the lines of map requests from users who don't have access to arcmap but don't know how to use python. If its too difficult what about creating the scripts in python? arp.mapping can be used to export maps and change fonts, extents, so on. I also forgot to add it doesn't have to neccessarily work on a server - since its just for a python class. As long as it works on my computer. – Nevi Oct 5 '11 at 5:49
  • Does Tkinter really conflict with arc*.exe? This link seems to hint otherwise resources.arcgis.com/gallery/file/geoprocessing/… – Sideshow Bob Dec 6 '11 at 12:54
  • 1
    You will eventually run into issues, yes. It works briefly in a few limited contexts, but it starts to fall down when used in geoprocessing tools. – Jason Scheirer Dec 6 '11 at 16:48
0

If a user doesn't have access to ArcGIS Desktop, they will not be able to edit the map. The map requires an ArcGIS Software and License installed.

If a user has these installed, and you don't want to open ArcMap, you could use win32com to connect to the COM components, but it isn't going to be very easy, and you will essentially be opening up ArcMap anyways, so might as well just make it a script tool or add-in.

You could do a GUI with tkinter or pyQt or anything really, then call arcpy if you wanted to, but I don't recommend it. Instead I would just do a script tool in ArcMap/ArcCatalog as it will handle the GUI for you. Have two different tools in a toolbox to do each function you want to do. Or have a checkbox in the tool. http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/a-quick-tour-of-creating-script-tools.htm

As for your final question, yes, you can replace images in a map. You can look in to PictureElement objects. You get these by listing elements in the map. http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/pictureelement-class.htm

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.