top of page

SELECTED PYTHON SCRIPTS

(ARCPY GIS)

This script generates graduate color maps using geometrical intervals

AMES Plantation Landcover Map by Hunting Units of Fayette and Hardeman Counties, TN, USA

Batch Reprojection

The Python script re-projects the vector datasets in a folder based on spatial reference of a file.

Copy Certain Feature Classes

The Python script reads all the feature classes in a personal or file geodatabase and copies only the polygon feature classes to a new file geodatabase.

Perimeter and Area

The Python script determines the perimeter (in meters ) and area (in square meters ) of each of the individual islands of a multipart feature class.

Extensions Availablility

The Python script determines whether the following extensions are available: ArcGIS 3D Analyst, ArcGIS Network Analyst, and ArcGIS Spatial Analyst.

Addin a Text Field

The Python script adds a text field to the roads.shp feature class called FERRY and populates this field with YES and NO values, depending on the value of the FEATURE field.

Buffering

The Python script creates a 15,000-meter buffer around features in the airports.shp feature class classified as an airport (based on the FEATURE field ) and a 7,500-meter buffer around features classified as a seaplane base. The results is two separate feature classes, one for each airport type.

Envelope a Polygon

The Python script creates an envelope polygon feature class for a feature class.

Prime Numbers

The Python script finds prime numbers.

CherryO Game

The Python script counts the average time and iteration for solving CherryO game over different playings. You can play it unlimitedly while the number of cherries is unlimited, too (both are user-defined). Spinner has 7 different options as [-1,-2,-3,-4,2,2,Reset_to_Total_Cherries].

Creating a New Polygon

The Python script creates a new polygon feature class containing a single ( square ) polygon with the following coordinates: ( 0, 0 ), ( 0, 1,000 ),(1,000, 0), and ( 1,000, 1,000 ).

Copying Raster to Geodatabase

The Python script copies all the rasters in a workspace to a new file geodatabase.

Raster Processing

The Python script classifies slope, aspect and forested lands.

Rock Paper Scissor Game

The Python function simulates two computer player’s Rock Paper Scissor game: the function will have one argument supply as how many games to play. Then the function will print results about each player’s win and lose and return draw game percentage out of the total.

Random. Even or Odd!

The Python script generates 100 random numbers (in the range of 1-1000) and keeps a count of how many of those random numbers are even and how many are odd. Then prints the results.

Temperature Classification

The Python script will prompt a user to enter a temperature as an integer and will print "it is hot" if the temperature is over 100, "it is cold" if the temperature is under 60, and "it is just right" if the temperature is between 61 and 99 inclusive...

​Population Classification

The script creates a new filed (name: “POP_group”) for the feature class and write a text value (either “High” or “Low”) for each cities that if a city population (e.g. POP1990) is greater than (>=) 50,000 then write “H”, otherwise write “L”.

Clean Integer Fields

The script deletes all fields whose type is an integer.

Please reload

google_scholar1-300x150.png
ResearchGate.png
Ehsan Momeni ORCID GIS Remote Sensing Ur
Ehsan Momeni LinkedIn GIS Remote Sensing
ncbi-300x150.png
academia.png

(Information on this website may not be up to date)

bottom of page