.ProjectAs를 사용한 경험이있는 사람이 있습니까? ArcGIS geometry class?
포인트 셰이프 파일을 만듭니다. 포인트는 텍스트 파일에서 WGS1984 lat/long (EPSG 4326)
으로 읽었으며 OSGB (EPSG: 27700)
에 투영 한 다음 InsertCursor를 사용하여 빈 포인트 모양 파일에 삽입하고 싶습니다. 점 지오메트리를 만들 수 있지만 행을 삽입 할 때 OSGB에 투영이 적용되지 않습니다. "SHAPE의 @의 X", "SHAPE로 새로운 기하학적 도형에 InsCur.insertRow 명령 (투영법과) (마지막 줄) 당신은 원래의 Y 좌표를 통과, X 좌표, 높이Arcpy 기하학 클래스 .ProjectAs 함수
with open(nmealist,'r') as srcFile:
with arcpy.da.InsertCursor(OutShp, ["[email protected]", "[email protected]", "[email protected]", "[email protected]"]) as InsCur:
for fileLine in srcFile:
# split the line up into a list
lSplit = fileLine.split(",")
if len(lSplit) == 1:
lSplit = fileLine.split(",")
if len(lSplit) > 1:
# more than just one word on the line
pointsOK = True
try:
FILENAME = str(lSplit[0])
DOS = yymmdd
TIME = str(lSplit[1])
EASTING = float(lSplit[3])
NORTHING = float(lSplit[2])
HEIGHT = float(lSplit[4])
HEADING = float(lSplit[5])
IVA = float(lSplit[6])
FLIGHTID = sortie
except:
arcpy.AddWarning("Unable to translate points")
pointsOK = False
if pointsOK:
newGeom.SpatialReference = srwgs1984 # set spatial reference
# create a point geometry from the 3 coordinates - EASTING, NORTHING, HEIGHT
newGeom = arcpy.PointGeometry(arcpy.Point(EASTING,NORTHING,HEIGHT))
# project point into OSGB
projectedpoint = newGeom.projectAs(srosgb)
InsCur.insertRow([projectedpoint, EASTING, NORTHING, HEIGHT])# insert this point into the feature class
을 Exchange는 ArcPy 질문에 대한 조사/요청 사이트입니다. – PolyGeo