sample examples of codes written in python

98565
6
01-17-2012 02:28 PM
RameshGautam
New Contributor
I am wondering if you can help to get plenty of examples of codes written in ArcPY (ArcGIS 10.0 version) including actual data. That will help to see how each code behaves to each example, and then, would be useful to accelerate the learning curve of python in ArcGIS 10.0. ESRI arcpy site package does not have much information on example datasets. Although they try to do their best, they have not incorporated any sample data. Sample data would help to quickly check the code, and , subsequently customize for your own datasets.

I would appreciate for your help on any website links, books, or any other journal articles etc. Please note that I am looking Python sample codes written for ArcGIS10.0 or higher version.

Thanks
Tags (2)
0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus
0 Kudos
RDHarles
Occasional Contributor
In my opinion, the best way to learn arcpy coding is to use the Arc10 help file (link below).
Simply go to the link, search the tool you want to use, and then go to the bottom of the page and study the sample code.
Assuming you know "general python coding" (loops, if/then, while, etc.) you can easily put together a meaningful script.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geoprocessing_tools/002s00000004000000...
JT2
by
New Contributor II
dozens of examples
http://resources.arcgis.com/gallery/file/geoprocessing


This so-called 'resource' centre is shockingly bad. There's nothing to tell you if it's a python script or a model, or a toolbox or whatever. The thumbnail images are way too large, and impede navigation.

The OP's question is valid: apart from the documented examples, ESRI have done very little indeed to give users real world examples of full scripts plus data. This would be easy to do, and would allow users to see best practice. Perhaps also the code could be commented.

As it stands, however, the resources centre is, to me at least, useless. Compared to arcscripts of old, the new site is stunningly bad.
ChrisBater
New Contributor II
Assuming you know "general python coding" (loops, if/then, while, etc.) you can easily put together a meaningful script.


Just in case you don't, this site is pretty good:

http://www.python-course.eu/index.php
JT2
by
New Contributor II
This course is also excellent: https://www.e-education.psu.edu/geog485/node/17
0 Kudos
MathewCoyle
Frequent Contributor
If you want ArcGIS specifics then this free course is fairly thorough I hear. I haven't actually gone through all the materials myself, but what I did see seemed like a good base to start with.

http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&courseid=1868
0 Kudos