Coordinatensystem projections

Installation und Anwendung von Datenbankschnittstellen wie SQLite, PostgreSQL, MariaDB/MySQL, der DB-API 2.0 und sonstigen Datenbanksystemen.
Antworten
hicham
User
Beiträge: 6
Registriert: Mittwoch 23. April 2014, 14:16

Hallo zusammen,
ich bin recht neu in Python und habe hier gleich zwei Fragen?
ich baue gerade ein tools für arcgis (projizierin) und geth so:
1- wenn man feature class oder files lädt muss automatisch den koordinaten zugewiesen
2- bei projiziern muss nur 4 cooradinaten in der Liste erscheinen ( oordinatensystem (25833,3857,4326,3068)


Code: Alles auswählen

import arcpy
import os


arcpy.env.workspace = "C:\Users\chris\MEINE_DATEN"
arcpy.env.overwriteOutput = True


outWorkspace = "C:\Users\chris\MEINE_DATEN\TEST"

try:
    
    for infc in arcpy.ListFeatureClasses():
    
        
        dsc = arcpy.Describe(infc)
    
        if dsc.spatialReference.Name == "Unknown":
            print ('skipped this fc due to undefined coordinate system: ' + infc)
        else:
            # Determine the new output feature class path and name
            outfc = os.path.join(outWorkspace, infc)
            
            # Set output coordinate system
            outCS = arcpy.SpatialReference('NAD 1983 UTM Zone 11N')
            
            # run project tool
            arcpy.Project_management(infc, outfc, outCS)
            
            # check messages
            print(arcpy.GetMessages())
            
except arcpy.ExecuteError:
    print(arcpy.GetMessages(2))
    
except Exception as ex:
    print(ex.args[0])
hier habe ich die cooradinaten einzeln
1.Coordinate

Code: Alles auswählen

import arcpy

prjFile1 = "C:\Users\\chris\\MEINE_DATEN\\koordinates\\WGS 1984 Web Mercator (auxiliary sphere).prj"

spatialRef1 = arcpy.SpatialReference(prjFile1)


inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)

arcpy.Project_management (inPath, outPath, spatialRef1)
2.Cooradinat

Code: Alles auswählen

import arcpy

prjFile1 = "C:\Users\\chris\\MEINE_DATEN\\koordinates\\DHDN Soldner Berlin.prj"

spatialRef1 = arcpy.SpatialReference(prjFile1)


inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)

arcpy.Project_management (inPath, outPath, spatialRef1)
3.Coordinate

Code: Alles auswählen

import arcpy

prjFile1 = "C:\Users\\chris\\MEINE_DATEN\\koordinates\\4326.prj"

spatialRef1 = arcpy.SpatialReference(prjFile1)


inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)

arcpy.Project_management (inPath, outPath, spatialRef1)
4.Cooradinate

Code: Alles auswählen

import arcpy

prjFile1 = "C:\Users\\chris\\MEINE_DATEN\\koordinates\\ETRS 1989 UTM Zone 33N 7stellen.prj"

spatialRef1 = arcpy.SpatialReference(prjFile1)


inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)

arcpy.Project_management (inPath, outPath, spatialRef1)
wie kriege ich beim (Set output coordinate system ) nur die 4 cooradinaten gezeigt wird (25833,3857,4326,3068)

Vielen Dank schonmal
Antworten