I am working with a geometry object projected in EPSG 6455 but would like to add its extent to a feature class that is in EPSG 4326.
arcpy.Project_management() wants a feature class as input and output.
Here's what I've got so far (please note that using ZLAS is in no way an endorsement of ZLAS as a proprietary format)
### ZLAS testing ### zlas = "C:/Data/USGS_LPC_IL_4County_Cook_2017_LAS_15008550_LAS_2019.zlas" des = arcpy.Describe(zlas) print(des.dataType) print(des.spatialReference.factoryCode) print(des.extent) polys = [] las_extent = [ [ [des.extent.YMin, des.extent.XMin], [des.extent.YMax, des.extent.XMin], [des.extent.YMax, des.extent.XMax], [des.extent.YMin, des.extent.XMax] ] ] for coord_ring in las_extent: poly = arcpy.Polygon(arcpy.Array([arcpy.Point(*coords) for coords in coord_ring]), arcpy.SpatialReference(6455)) polys.append(poly)
How would I coerce "poly" from 6455 to 4326 without incurring the IO expense of writing feature classes?
The background, if useful: I am plowing through a directory structure with thousands and thousands of point clouds. The intent is to gather their extents, add them to a global feature class, and then serve that feature class up as a service identifying where all of our holdings are, allowing users to browse our holdings geographically rather than trying to hunt through a directory tree. Because many of the files are projected differently (some requiring transformation - default transformation being fine as this isn't high precision) I want to harmonize them all into a single GCS feature class.
Solved! Go to Solution.
Like this example in
Polygon—ArcPy classes | Documentation
projectAs (spatial_reference, {transformation_name})
Parameter | Explanation | Data Type |
spatial_reference | The new spatial reference. This can be a SpatialReference object or the coordinate system name. | SpatialReference |
transformation_name | The geotransformation name. | String |
Like this example in
Polygon—ArcPy classes | Documentation
projectAs (spatial_reference, {transformation_name})
Parameter | Explanation | Data Type |
spatial_reference | The new spatial reference. This can be a SpatialReference object or the coordinate system name. | SpatialReference |
transformation_name | The geotransformation name. | String |
Thanks Dan... Sometimes one just needs a pointer to the right doc. I tell ya, if the Esri UC was happening this year I'd hunt you down and buy you an adult beverage of your choice. Really appreciate all the help.
I will be online