誰でも.ProjectAsを使用した経験がありますか?ArcGIS geometry class?
ポイントシェイプファイルを作成しています。ポイントはテキストファイルからWGS1984 lat/long (EPSG 4326)
として読み込まれており、OSGB (EPSG: 27700)
に投影してから、InsertCursorを使用して空白のポイントシェイプファイルに挿入します。ポイントジオメトリを作成することはできますが、行を挿入するときはOSGBに投影を適用しません。Arcpy Geometryクラス.ProjectAs関数
http://pro.arcgis.com/en/pro-app/arcpy/classes/geometry.htm
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
を私は[gis.se]スタックを考えますExchangeは、ArcPyの質問を研究/尋ねるサイトです。 – PolyGeo