ArcPY - Python
Follow
Find
39.9K views | +0 today
ArcPY - Python
Information and Tutorials about ArcGis Python
Your new post is loading...
Your new post is loading...
Rescooped by Elpidio I F Filho from Geoprocessing
Scoop.it!

If you are stuck at "if" – Part 3 – Does Extension Exists model example | ArcGIS Resource Center

If you are stuck at "if" – Part 3 – Does Extension Exists model example | ArcGIS Resource Center | ArcPY - Python | Scoop.it

Recap
If you haven’t already, take a quick look at:

Part 1 on examples of using the Calculate Value tool to create branches using if-else logic.

Part 2 builds on Part1 highlighting how to create a script tool from the Python script, creating a value list, exposing tool parameters and creating model parameters.

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Especial: Formato de Dados Raster

Especial: Formato de Dados Raster | ArcPY - Python | Scoop.it
Este tópico será utilizado como introdução para qualquer assunto relacionado a dados raster. No momento estou preparando uma sequência de tutoriais sobre Processamento Digital de Imagens e surgiu a necessidade...
more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Boxplots using matplotlib

Another GIS Blog: Boxplots using matplotlib | ArcPY - Python | Scoop.it

If you ever need to graph anything using python, I recommend matplotlib. Here is an example of a boxplot below. The link will take you to the help documentation in matplotlib. It's pretty good compared to many other python modules.

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Fitting Text in Page Elements Based on Sentence Length

When working with Page Layout and Map Automation, sometimes you want to let the user pass some random text into a text element, but you need to format the text so it doesn't look like one big line of mush.

For this example assume you have a page layout and the maximum length a text item can be is 90 characters. To format this correctly, you need to check if the values provided are less than 90 characters, if it is, write it, if not, start a new line....

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Exit that Script, and exit it now!

Help, I need to kill my script! Use the sys.exit() gives me an error!! What to do?

Use the try/except method to just move beyond those errors my friend. Very simple.......

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Python Tip: Format number with comma

Another GIS Blog: Python Tip: Format number with comma | ArcPY - Python | Scoop.it

Here is a good little tip for the client that wants to see those commas in there numbers: (for python 2.6).......

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Python Snippet, Writing Text To A File

Another GIS Blog: Python Snippet, Writing Text To A File | ArcPY - Python | Scoop.it

Let's say you have a program that runs a long process, and you want to write information to a text file. Using the file IO functions, you can easily do this:

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Sean Gillies Blog / 1138 / Reintroducing a Python protocol for geospatial data

Python has a number of built-in protocols (descriptors, iterators, etc). A very simple and familiar one involves string representations of objects. The built-in ''str()'' function calls the ''__str__()'' method of its single argument. By implementing ''__str__()'', instances of any class can be printed by any other Python program.

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

python - Use arcpy.SearchCursor with raster - GIS - Stack Exchange

python - Use arcpy.SearchCursor with raster - GIS - Stack Exchange | ArcPY - Python | Scoop.it
Use arcpy.SearchCursor with raster http://t.co/NKUSLnqT #python...
more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Recortando – Georreferenciando e Vetorizando no SPRING

Recortando – Georreferenciando e Vetorizando no SPRING | ArcPY - Python | Scoop.it
Este vídeo dará início ao processo de vetorização de curvas de nível a partir de uma carta do IBGE em uma escala de 1/50000 Neste primeiro Vídeo será realizado o Recorte da área de Interes...
more...
No comment yet.
Rescooped by Elpidio I F Filho from Geoprocessing
Scoop.it!

Managing Cultural Data with ModelBuilder and Python - Blogs - Exprodat

Managing Cultural Data with ModelBuilder and Python - Blogs - Exprodat | ArcPY - Python | Scoop.it

Cultural data which E&P organisations rely on for exploration and commercial developments is ever-changing by nature. Status of leases change, as do company equities and stakes in existing and new blocks, number of wells and information about production.
Typically, cultural data is made available by the data suppliers as regular updates, often in an unstructured format, including shapefiles or file geodatabases, tables and .csv files, which need to be incorporated within the organisation's corporate spatial data repositories. Datasets also need to comply with internal standards, not only in terms of data format, but also in term of naming conventions (for both feature classes as well as attributes), coordinate reference system and language......

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Python's version for Object Model Diagram

Is there anything similar to the object model diagram for Python. I looked at the documentation starting on this page: http://help.arcgis.com/en/arcgisdesk...00000v7000000/ However, this section on arcpy does not appear to cover all functions, ...
more...
No comment yet.
Rescooped by Elpidio I F Filho from Geoprocessing
Scoop.it!

If you are stuck at "if" – Part 1 | ArcGIS Resource Center

If you are stuck at "if" – Part 1 | ArcGIS Resource Center | ArcPY - Python | Scoop.it

If-then-else logic is a simple yet powerful concept for performing different actions based on different conditions. If-then-else logic can be explained like this:

 

IF some condition is true, THEN
perform an action;
ELSE the condition is false,
perform a different action.

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Getting the Extent is Easy as Describe() - ArcPy

Early in my blog, I posted methods on obtaining the extent, and creating an extent polygon using the Array and Poylgon objects. Here is the short cut for creating extent polygons for a whole feature class: ...

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Convert Decimal Degree to Degrees Minutes Seconds Using Python

Here is a function that will convert decimal degree values to degrees, minutes, and seconds. It's nice to show DMS notation as labels for points at times, so here is a script I made to do this:

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Displaying Messages for a Specific Tool

Robust messaging is very important to help developers debug issues and it helps end users understand what the tool is doing.

ArcGIS Desktop geoprocessing tools have robust messaging built in, but when you run a script, those messages get lost. To access individual tool messages, just do the following: ......

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Tip - Faster Update Cursors

There are many ways to limit the number of fields an update cursor can update. The cursor object itself has a where clause option. Another way, which seems at first glance to be faster than just a where clause on the cursor, is to use a Layer object with a definition query defined on the Layer object, then reference the object instead of the feature class or feature layer itself.

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Sending Email At the End of Your Process

Another GIS Blog: Sending Email At the End of Your Process | ArcPY - Python | Scoop.it

ere is a nice script that will allow you to send emails at the end of your python script, or where ever you want to. Today I just posted a comment on my topic of long running scripts, and I am adding this component onto my workflow, so I know when processes finish or that they have completed......

 

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Another GIS Blog: Snippet: Add a Spatial Index To All Feature Classes

Another GIS Blog: Snippet: Add a Spatial Index To All Feature Classes | ArcPY - Python | Scoop.it

Ever need to run a batch spatial index in a work space? Yes, well here is a snippet to help you out. import arcpy
from arcpy import env

env.workspace = arcpy.GetParameterAsText(0) # workspace parameter
fcs = arcpy.ListFeatureClasses()
for fc in fcs:
arcpy.AddSpatialIndex_management(fc)
print 'fin' Enjoy

more...
No comment yet.
Rescooped by Elpidio I F Filho from Geoprocessing
Scoop.it!

Python script to rename image tiles (geotiffs, sids, ecws…) using the index shapefile | Geography and Other Stuff

Python script to rename image tiles (geotiffs, sids, ecws…) using the index shapefile | Geography and Other Stuff | ArcPY - Python | Scoop.it

Elsewhere I posted a script that I wrote to allow me to do this same task, to rename imagery tiles based on attributes in the index shapefile. It wasn’t perfect, and it had a couple extra steps, but I wrote it pretty quickly and it worked well enough. If you want to, you can read more about it on that other post, or the example application linked from there.......

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Unpacking Model Builder: 2

Unpacking Model Builder: 2 | ArcPY - Python | Scoop.it
I ended off the last article where I created a basic model based on the the Clip Tool from ArcToolbox into a new ModelBuilder window, created the relevant variables and selected the Feature Classes...
more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Optinalysis: How to Improve Coding Style (In Python)

I'm finally cracking open the Python Style Guide. I've been programming python for years now so I thought I'd join the club.

In addition to all of the nifty tools available to speed up and optimize python code, there are a few utilities out there to help with coding style. PyLint is a program which analyzes source code and reports lines which do not follow the PEP 8 coding convention. There is another program called CloneDigger which looks through source code and points out duplicate code.....

more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

Adventures with GIS: an introduction to IPython and the joy of play | Geoprocessing - Geoprocessamento

Adventures with GIS: an introduction to IPython and the joy of play | Geoprocessing - Geoprocessamento | ArcPY - Python | Scoop.it
In this talk (which was recorded as a dry run for a seminar) I present a very brief introduction to the Python programming language from the point of view of...
more...
No comment yet.
Scooped by Elpidio I F Filho
Scoop.it!

a goes to c: Great circle flights from Beijing, arcpy version

a goes to c: Great circle flights from Beijing, arcpy version | ArcPY - Python | Scoop.it
In the previous post, we found a pure Python solution to generating great circles from a common point, specifically from Beijing airports to all other airports in the world that maintain commercial flight routes from it.
more...
No comment yet.