Ungenerate (Coverage)
Summary
Creates a text file of x,y coordinates from the input coverage.
Usage
-
Ungenerate provides a useful mechanism to create simple coordinate files from coverages. This allows you to easily transfer coverages to other mapping systems or view and update individual coordinates using your computer's text editor.
-
The output text file is in a format that is readable by the Generate tool.
-
User-IDs are written to the Output Generate File for lines, points, polygons, regions, and tics.
-
All internal calculations are done in double precision regardless of the precision of the input or output dataset. Single-precision output is accurate to approximately seven significant digits. Ignore values beyond seven significant digits for ungenerated files in single precision. For accuracy to approximately 15 digits, use double precision.
-
The coordinates created by Ungenerate are in the same coordinate precision as the Input Coverage. Single-precision coordinates are generated for single-precision coverages, and double-precision coordinates for double-precision coverages.
-
For files created with the Region.<subclass>, further processing with the Line Coverage To Region tool and the Build or Clean tool is necessary to fully restore regions.
-
When using the Poly option, polygons that are not properly closed will not be written to the Output file. If there are two label points in one polygon, only one will be written. If no label point exists, then zero is written for the ID number of that polygon feature, and the x,y coordinate for the centroid will be written.
-
Ungenerate writes a flag for island polygons. The island polygon will have an ID number of -99999 and a set of vertices defining the polygon. This is useful for converting ArcInfo polygon coverages to other systems that require special handling of island polygons.
-
The Poly option treats all line segments that are wholly contained within a polygon as island polygons and tags them with an ID number of -99999. Line segments that fall inside the polygon but touch the border of the polygon are also considered islands inside the polygon. However, line segments that fall outside a polygon are considered part of the universe polygon and are ignored.
-
All vertices that define each component arc of a polygon feature will be written. To weed out vertices of very dense coverages, use the Simplify Line tool prior to using the Generate tool. The arcs for each polygon are written starting at the lower left of the polygon and continuing in a clockwise direction. Arcs that are shared by more than one polygon will be duplicated in the output file. Nodes and arc orientation are not preserved.
-
When using the ANNO option, the annotations within a specified class will be written to a file in the following format. All the annotation shape points up to 500 will be written.
ID, LEVEL, SYMBOL, HEIGHT TEXT X,Y X,Y .. END
-
It is important to note that the above format for Ungenerate annotation is not compatible with the format expected by the Generate command. Its main use is to provide a simple way to translate annotation to a different format.
Syntax
Parameter | Explanation | Data Type |
in_cover |
The coverage from which feature coordinates will be written. | Coverage |
out_generate_file |
The text file to which the x,y coordinates will be written. | File |
feature_type |
The type of features that will be used in the generation of the output file.
| String |
duplicate_nodes (Optional) |
Determines whether duplicate node coordinates will be retained or dropped in the Output Generate File. This applies only to the POLY option.
| Boolean |
format (Optional) |
Selects either exponential or fixed representation of floating point numbers in the Output Generate File.
| String |
Code Sample
The following stand-alone script demonstrates how to create a text file from a coverage.
# Name: Ungenerate_Example.py # Description: Creates a text file from a coverage. # Requirements: ArcInfo Workstation # Author: ESRI # Import system modules import arcpy from arcpy import env # Set environment settings env.workspace = "C:/data" # Set local variables inCover = "tong_azone" outGenerateFile = "C:/output/tong_azone.gen" featureType = "POLY" format = "FIXED" # Execute Ungenerate arcpy.Ungenerate_arc(inCover, outGenerateFile, featureType, "", format)