Former leader of the free world
Download
1 / 30

Former leader of the “free” world … - PowerPoint PPT Presentation


  • 77 Views
  • Uploaded on

“I know what I believe. I will continue to articulate what I believe and what I believe – I believe what I believe is right.” “Science is not an art – I mean, reading is not an art. It's a science.” “If a person doesn't have the capacity that we all want that

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Former leader of the “free” world …' - leda


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Former leader of the free world

“I know what I believe. I will continue to articulate what I believe and what I believe – I believe what I believe is right.”

“Science is not an art –

I mean, reading is not an art.

It's a science.”

“If a person doesn't have the

capacity that we all want that

person to have, I suspect hope

is in the far distant future,

if at all.”

“Rarely is the question asked:

Is our children learning?”

“We spent a lot of time talking

about Africa, and we should.

Africa is a nation that suffers

from incredible disease.”

“Our nation must come together to unite.”

“I know the human being and fish can coexist peacefully”

G. Dubya Bush

Former leader of the “free” world …

http://www.dubyaspeak.com



Overview
Overview

  • Cursors

  • arcpy.da module

  • Geometrys

  • Arrays

  • SpatialReferences

  • Licensing and Installation









Insert update and locked data
Insert/Update and Locked data

  • Can not Insert/Update if data is locked

  • Feature class or table can be locked if it is:

    • Part of a map in an MXD that is open in ArcMap

    • Part of a workspace being viewed by ArcCatalog

  • Best practices include:

    • Exit ArcGIS applications when running scripts that create or modify tables or feature classes

    • Delete cursor objects when you have finished using them …


The data access da module
The Data Access (da) module

New at 10.1

arcpy.da.Walk( ) – an ArcGIS-aware version of os.path.walk ( )


Searchcursor function and class
SearchCursor Function and Class

arcpy Function

arcpy.da Class


Searchcursor function and class example
SearchCursor Function and Class Example

arcpy.SearchCursor Function syntax

SearchCursor (dataset, {where_clause}, {spatial_reference}, {fields}, {sort_fields})

262 sec for Function

0.66 sec for Class

~ 400 times faster in this case

arcpy.da.SearchCursor Class syntax

SearchCursor (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause})

Output:



Geometry properties
Geometry Properties


Geometry methods
Geometry Methods

… and

clip

contains

convexHull

crosses

difference

disjoint

distanceTo

equals

getArea

getLength

getPart

intersect

overlaps

positionAlongLine

projectAs

symmetricDifference

touches

union

within



Writing geometries using python
Writing geometries using Python

Problem:

We have a text file containing a line identifier and

x,y coordinates that we would like to use to create

polylines in an new feature class similar to an

existing feature class

Solution:

Create a script tool that has two inputs (text file name and

template feature class) and one output feature class.

The script will

- Create a new feature class based on the template feature class

- Read the ID and coords for each line from the text file

- Use an insert cursor to add each line to the new feature class


Before writing polylines to a feature class
Before writing polylines to a feature class …

  • … need some other background

    • Polylines are created from an array of points

    • How is a point created?

    • How is an array points created?






Writing geometries using python1
Writing geometries using Python

Input file structure:

For Update/InsertCursor objects, test your scripts on a copy of the dataset. It is sometimes hard to undo modifications to data!





Licensing and installation1
Licensing and Installation

Check to see if a license is available

Returns license to license manager

Check out license from license manager

See if requested product is available

Information about installation

Install types that used with GetInstallInfo

Current product license

Legacy … replaced by


ad