ArcPY - Python
57.9K views | +3 today

 Scooped by Elpidio I F Filho onto ArcPY - Python

# Another GIS Blog: Random Number Generator (arcpy.env)

This is a tool that creates a random number based on a seed number and an algorithm selection.
Inputs are as follows:

1 - Seed—The seed is an integer value and is used to initiate the random number generator. The default value is 0.
2 - Random Generator Type—The random generator algorithm.

* ACM599—ACM collected algorithm 599. This is the default.
* MERSENNE_TWISTER—Mersenne Twister mt19937.
* STANDARD_C—Standard C Rand

So to create a random number generation environmental variable you can do it two ways:

Option 1:

from arcpy import env
env.randomGenerator = "4 MERSENNE_TWISTER"

Option 2:

from arcpy import env
env.randomGenerator = arcpy.CreateRandomValueGenerator(4, "MERSENNE_TWISTER")

................

No comment yet.

# ArcPY - Python

Information and Tutorials about ArcGis Python
 Scooped by Elpidio I F Filho

## Ce413 Lab Session 9: ArcScene, Model Builder, ArcPy, Python - YouTube

Welcome To The ninth Lab Session of the "CE-413 Introduction to Geographic Information Systems" Prepared by : Kenan BOLAT Part : 9 Before beginning the third...
No comment yet.
 Scooped by Elpidio I F Filho

## Python in QGIS and ArcGIS: A Small Example - Digital Geography

“See a small example of a buffer analysis in QGIS and ArcGIS using the Python interfaces of both with arcpy and pyqgis. here on digital-geography.com”
No comment yet.
 Scooped by Elpidio I F Filho

## Python subset xls in ArcMap - YouTube

Example of how you can use Python Excel to subset a spreadsheet based on spatial extent of ArcMap.
No comment yet.
 Scooped by Elpidio I F Filho

## 8 consejos para comenzar a trabajar con Python sobre ArcGIS

Comenzar a trabajar con Python sobre ArcGIS es más sencillo de lo que parece. En anteriores post ya hemos explicado como ejecutar código de Python y en que consiste la Arcpy.
No comment yet.
 Scooped by Elpidio I F Filho

## 10 habilidades para usar eficazmente un SIG

En esta entrada vamos a presentar 10 habilidades que debe tener un técnico GIS para usar eficazmente un Sistema de Información Geográfico: Conocer todos los tipos de archivos o formatos GIS que existen, sus fortalezas y debilidades.
No comment yet.
 Scooped by Elpidio I F Filho

## Primeros pasos con ArcGIS Online

En este artículo explicaremos qué es ArcGIS Online, qué puedes hacer con él, cómo comenzar a utilizarlo, crearemos un mapa web y una aplicación web mapping utilizando una cuenta pública gratuita y añadiremos los mapas que has creado con ArcGIS...
No comment yet.
 Scooped by Elpidio I F Filho

## Python in Hydrology

Python in Hydrology is written for learning Python using its applications in hydrology. The book covers the basic applications of hydrology, and also the advanced topic like use of copula.

The book is available under the GNU Free Documentation License. Readers are free to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.

If you have comments, corrections or suggestions, please send me email atsatkumartomer@gmail.com

No comment yet.
 Scooped by Elpidio I F Filho

## Cómo crear PDFs que contienen mapas empleando la librería PyFPDF de Python

La librería PyFPDF es una forma sencilla de crear PDFs que incluyen mapas; tal como refiere Joel Lawhead en su libro de Learning Geospatial Analysis with Python.
No comment yet.
 Scooped by Elpidio I F Filho

## Creating a quarter quarter section grid with Python

At work I was tasked with creating a quarter quarter section grid for Nebraska because the BLM didn’t have one available. They did have the Township/Range and section grid though.
No comment yet.
 Scooped by Elpidio I F Filho

## 1174 introducing the arcpy data access module 960

No comment yet.
 Scooped by Elpidio I F Filho

## Building feature classes from NumPy arrays

With ArcGIS 10.1, a NumPy array can be easily converted into a point feature class using the arcpy.da.NumPyArrayToFeatureClass function.

Notable is that other geometry types such as Polygon, Polyline or Multipoint are not supported by NumPyArrayToFeatureClass. However, all the tools needed to create other geometry types from NumPy are there. The numpy_array_to_features function below combines the new arcpy.da.InsertCursor and NumPy methods to turn a NumPy array into features.......

No comment yet.
 Scooped by Elpidio I F Filho

## A simple approach for including 3rd party Python libraries with your scripts | ArcGIS Resource Center

Often times, your Python scripts require 3rd party Python libraries. For example, the sample tools located here: http://www.arcgis.com/home/item.html?id=f3d91b8f852042e289e09a7ec8342431 requires xlrd, xlwt, and openpyxl Python libraries. This sample includes all of the dependent libraries, and demonstrates just how easy it is.

The secret to most Python modules and packages: they’re just files. You can copy any Python library into the same folder as the .py file that imports them and it will just work (Note: in the case of C extensions and compiled bytecode, the Python version and architecture must match). Here is the layout of the folder with the libraries we mentioned before:

Finding the install location of a library

Usually the Python library is located in the site-packages folder within the Python install directory, however, if it is not located in the site-packages folder and you are uncertain where it is installed, here is a Python sample to locate Python modules installed on your computer.....

No comment yet.
 Scooped by Elpidio I F Filho

## ArcGIS 10.1 arcpy Wall Reference Poster

This is an automatically generated diagram of arcpy as it is shipped in ArcGIS 10.1. This document is not the official reference: please refer to the ArcGIS 10.1 online help for an accurate, complete, actively maintained source of documentation. arcpy is big: a piece of paper with full of boxes of names out of context will not be as useful as the official help with explanations and code samples.

No comment yet.
 Scooped by Elpidio I F Filho

## Another GIS Blog: Converting PDF to TIFF (10.3) using ArcPy

“GeoPDF to GeoTIFF conversion was perhaps never this easy http://t.co/mPFPJKZRP5 #arcgis #Esri #GIS”
No comment yet.
 Scooped by Elpidio I F Filho

## Copy dbf data into a shapefile in Arcpy - User Answer To Computing Errors

... (#facebook: Copy dbf data into a shapefile in Arcpy -... http://t.co/asfv1t19nb #answer)
No comment yet.
 Scooped by Elpidio I F Filho

## What's New in ArcPy at ArcGIS 10.1 (and 10.2)? | Happenic

Learn about the key enhancements to ArcPy at ArcGIS 10.1 (including SP1 and 10.2), and how to apply them in your day-to-day work.

This one-day course is taught by an ArcGIS Geoprocessing and Python Specialist with 25+ years of experience. It builds upon skills learned in introductory Python for Geoprocessing and Mapping courses and is designed for GIS analysts and specialists, who want to extend their ArcPy and Python skills to customise ArcGIS for geoprocessing, mapping and data access by taking advantage of the features and workflows new to ArcGIS 10.1.

No comment yet.
 Scooped by Elpidio I F Filho

## 10 tendencias de futuro en GIS

Desde el lanzamiento de ArcInfo en 1982 hasta Torque de cartoDB en 2013, ha habido una clara evolución en los SIG. La visualización de datos geográficos es cada vez más sencilla y accesible a cualquier persona.
No comment yet.
 Scooped by Elpidio I F Filho

## Los 10 formatos GIS vectoriales más populares

En esta entrada vamos  dar un repaso a los formatos GIS más populares y extendidos con los que trabajar en un proyecto GIS.
No comment yet.
 Scooped by Elpidio I F Filho

## Cómo depurar código Python con PyScripter

En este post vamos a daros las claves para aprovechar el uso de PyScripter como editor de código de Python para ArcGIS, tanto para escribir código como para la detección y corrección de errores de programación.
No comment yet.
 Scooped by Elpidio I F Filho

## Publishes all mxd files in a folder to running arcgis services.

Publishes all mxd files in a folder to running arcgis services. - Gist is a simple way to share snippets of text and code with others.
No comment yet.
 Scooped by Elpidio I F Filho

## Creating a quarter quarter section grid with Python

At work I was tasked with creating a quarter quarter section grid for Nebraska because the BLM didn’t have one available. They did have the Township/Range and section grid though.
No comment yet.
 Scooped by Elpidio I F Filho

## ArcPy.Mapping and ArcPy.Time Reference

This is an offline reference for the ArcPy.Mapping and ArcPy.Time modules in PDF format. It includes classes, functions and constraints. I tried to organize it in a way which allows for navigation throughout it just by clicking.
No comment yet.
 Scooped by Elpidio I F Filho

## ArcPy and ArcPy.Da Reference - Ian Broad

An offline reference for the ArcPy and ArcPy.Da modules and environment settings. Includes classes, functions, and constraints.
No comment yet.
 Scooped by Elpidio I F Filho

## Clip, Zip and Ship your image service, using Python | ArcGIS Resource Center

Here is a Python sample that can be used to clip items from your image service, package them into a mosaic dataset with all the metadata field values, and then ship them to a client or colleague. As with all other code samples that we add to our gallery, it is meant to help show you how something can be done in code; the actual implementation may need some altering in order for it to work for your particular example.

Description:
This python sample application accepts a input image service layer or URL as input. You can draw a polygon feature to define an area on the image service that you want to clip.

The program will start creating a local mosaic dataset with all metadata field recovered from the image service. And then it will download the image service item one by one according to the geometry of the polygon, and clip the image using the polygon.

You also have the option to clip the image using the default raster function if there is any. And you can also define the output image’s cell size.

The downloaded image will be added back to the local mosaic dataset along with all the metadata field values from the image service.

Note:
This python scripting tool uses the 10.1 Image Server REST API. Some of the functionality, such as define output image spatial reference in the ExportImage REST request is not available in 10.0. This is only a sample, and you may need to alter it, order for it to work for your particular case.

No comment yet.
 Scooped by Elpidio I F Filho

## Field mapping and Python scripting | ArcGIS Resource Center

A number of geoprocessing tools including Spatial Join (Analysis), Append (Management), Merge (Management), Feature Class To Feature Class (Conversion), and Table To Table (Conversion), have a parameter for controlling how fields from the input dataset(s) are processed and written, or mapped, to the output dataset – the Field Map parameter. In addition to the simple moving of attributes from input to output, field mapping can also be useful for some common tasks such as field concatenation and calculating statistics like mean, sum, and standard deviation.

If you haven’t used the Field Map before, you should! Understanding and using field mapping will often reduce the number of processing steps in a workflow, and ensure that, in any scenario, attributes are handled in an appropriate way. Yes, the Field Map parameter is a complicated one, but it is well worth the time it takes to figure it out.

Because the Field Map is a complicated parameter, working with it in Python can also be complicated. The best way to interact with field mapping in Python scripting is with the FieldMappings object. In Python, most geoprocessing tool parameter types are seen as simple numbers or strings (specifying a feature class input is as easy as providing the feature class’ path). But several of the more complex parameters have objects that exist to help you effectively work with the parameter. The Field Map parameter can accept a long structured string indicating the field map settings (you may have seen this long string equivalent in geoprocessing messages), however, working with the field mapping string is inefficient and error-prone, so use the FieldMappings object for the best experience.

Problem

I was recently presented with a data migration problem where field mappings and Python scripting literally saved me weeks of work. The goal was to convert a collection of hundreds of VPF (Vector Product Format) databases containing many feature classes to a handful of geodatabases, and because of the large scale of the migration it had to be accomplished in an automated fashion (this is where the many weeks of work would be saved). The schema of the geodatabases was already set up with a number of feature datasets and empty feature classes into which the VPF feature class data would be imported using the Append (management) tool.

The iteration through the collection of VPF databases was solved with some simple looping techniques involving the arcpy.ListDatasets() and arcpy.ListFeatureClasses() functions. However, there was a fundamental problem that nearly derailed the automation of this process: VPF feature classes can have spaces in their field names, while geodatabase datasets cannot. When the empty geodatabase feature classes were created from the schema of the VPF feature classes, the spaces in the field names were automatically changed to underscores ( _ ) in the geodatabase feature classes. This very subtle difference caused huge ripples in the automated process, since the Append (Management) tool can not automatically match fields like ‘mcc description’ to ‘mcc_description’; in the output geodatabase feature class, all the values in the ‘mcc_description’ field are NULL because the fields were not matched.

No comment yet.