I'm a student and I need a python script that i can use for ArcMap

4326
17
Jump to solution
11-12-2014 11:48 AM
PhilipKegels
New Contributor II

i'm a student and I need a python script that i can use for ArcMap

"A developer is looking for 10 lots for residential property development. Conditions to which the land to be acquired must satisfy:

Uncultivated ?

Located in a residential zone or residential expansion Conditions to which the land to be acquired should preferably meet:

Surface area per plot: between 500 and 700 m²

The plots are located at:      o minimum distance of 2.0 km from any form of industrial

                                         o maximum distance of 2.0 km from recreation

                                         o maximum distance of 500 m from park or forest

                                         o maximum distance of 3 km from a regional road

"

Is there any one that can help me?!

Thx

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

Just in case the assignment isn't due yet, I have posted another installment on my blog You are not allowed to use geoprocessing results the students get smarter  Enjoy
Dan

View solution in original post

0 Kudos
17 Replies
Zeke
by
Regular Contributor III

Maybe show what you've got so far, then get help for that.

0 Kudos
PhilipKegels
New Contributor II

I don't know how to begin on it. I already did it in ArcMap. I have already over the 10 lots (picture).

Now, i have to write a script that i can use for ArcMap and just put different conditions.ARcMap1.jpg

0 Kudos
DanPatterson_Retired
MVP Emeritus

Homework is helped when the "what I have tried" is provided...or when the due date has passed.

PhilipKegels
New Contributor II

I've been working eight days on it for research. My teacher has just placed an order and we had to look up everything on ourselfs.

0 Kudos
ChrisDonohue__GISP
MVP Alum

Ooof.  Sounds like you are a grad student.

Unfortunately, using Python in ArcGIS is not something that is learned immediately, so if you haven't had an opportunity to study it before, hopefully you have some time before this project is due.

One potential solution - if you know Modelbuilder at all, you can create your analysis process there, then export the whole thing as a Python Script.  Given that your analysis criteria don't appear to be too complex, this could work out well.  For the most part you would not have to learn Python, as Modelbuilder will create the code for you.

Modelbuilder (in general):

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w00000001000000

Exporting Modelbuilder to a Python Script

http://resources.arcgis.com/en/help/main/10.1/index.html#//002w00000031000000

Chris Donohue, GISP

PhilipKegels
New Contributor II

Thanks a lot! I Will try it tomorrow! keep you posting!

X

0 Kudos
DanPatterson_Retired
MVP Emeritus

To add to Chris's suggestion...If you go to the Results window in the Geoprocessing section...the workflow that you used for tools in ArcToolbox will be saved, whether they were successful or not.  you can reconstruct your workflow by exporting python snippets.  These can be used to generate a script directly by filling in the blanks...it can be used to verify the output from Modelbuilderbuilder to Python and other purposes.  Good luck

0 Kudos
DanPatterson_Retired
MVP Emeritus

Here is a quick example...

CopyToPythonSnippet1.png

Step 1, select the Results in Geoprocessing option
2...select the day that you did something that worked (or failed)
3  select the Arctoolbox tool used
4  copy to a python snippet to give you the bare bones python syntax to build a standalone script or to verify Modelbuilder script output

ie  below is the output below for two processes...but it isn't ready to run standalone...that is the next lesson...


# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "AOI_demo"
arcpy.RepairGeometry_management(in_features="AOI_demo",delete_null="DELETE_NULL")


# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "AOI_mtm9"
arcpy.DefineProjection_management(in_dataset="AOI_mtm9",coor_system="PRO .......


PhilipKegels
New Contributor II

THanks a lot! The thing is that using modelbuilder is forbidden So i have to do iT only with python. Using ArcMap is not That difficult bUT to write a script that do the same thing is not That easy i think. Keep you posting. I hope tomorrow i will be a step further.

x

0 Kudos