1 / 13

Using Describe

Using Describe. Topics. How to use describe? Retrieving Descriptive Information about data. Describe( ) Function. Describe function returns a describe object containing a set of properties

helki
Télécharger la présentation

Using Describe

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Describe

  2. Topics • How to use describe? • Retrieving Descriptive Information about data

  3. Describe( ) Function • Describe function returns a describe object containing a set of properties • Depending on what data type is being described, different describe properties will be available for use.

  4. Describe( ) Function • Describe on a FeatureClass returns a set of FeatureClass properties along with access to Table Properties and Dataset Properties That is using Describe() against a feature class not only provide access to a FeatureClass property group, but also a Table property group and a Dataset property group.

  5. Describe( ) Property Group Can explore each of them from ArcGIS online help!

  6. FeatureClass Properties • Commonly used FeatureClass properties • featureType Simple, Annotation, etc • shape Type Point, Polyline, Polygon, etc

  7. FeatureClass properties example import arcpy des = arcpy.Describe(“Auburn.gdb\\Parcel”) print “Feature Type: “ + des.featureType # returns Feature Type: Simple print “Shape Type: “ + des.shapeType # returns Shape Type: Polygon

  8. Table Properties This group contains a very useful propery • fields

  9. Field Object • Each field has a number of properties • The most common ones are -- name and -- type

  10. Field properties example import arcpy des = arcpy.Describe(“C:\\Data.gdb\\Parcel”) test = des.fields for field in test: print field.name print field.aliasName print field.type # returns LandUse Use String

  11. Dataset Properties • The dataset property group contains a number of useful properties • Commonly used properties are: - spatialReference - extent etc.

  12. Dataset Properties Example import arcpy file = "C:\\temp\\Data\\Schools.shp” des = arcpy.Describe(file) print des.spatialreference.name #Returns: NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet xyExtent= des.extent print "Xmin: " , xyExtent.XMin print "Xmax: " , xyExtent.XMax print "Ymin: " , xyExtent.YMin print "Ymax: " , xyExtent.YMax # returns: Xmin: 3037436.94 Xmax: 3220253.81 Ymin: 10006450.57 Ymax: 10164067.2

  13. Let’s try it!

More Related