2016-04-28 8 views
0

〜4k gpsポイントをポリラインに変換しようとしています。私は最終的にポイントをバッファリングし、パスカバレッジを特定したいと考えています。私が得意なのは、不完全な行です。そこ重複ポイントと重複ポイントがありますが、私はこのデータセットで以下のコードをテストし、私がポイントファイルを投稿する幸せになる現在のコードArcpyポイントをポリラインに簡略化する

coordArray = arcpy.Array() 
feature_info = [] 
newcoord = [] 
# Open a searchcursor 
Input = '.../5PT175.shp' 
rows = arcpy.SearchCursor(Input, fields="Latitude; Longitude;Timestamp;Speed", sort_fields="Timestamp A") 

# Iterate through the rows in the cursor and print out the 
# state name, county and population of each. 
for row in rows: 
    position = [row.getValue("Longitude"),row.getValue("Latitude")] 
    newcoord.append(position) 
    coordArray.add(arcpy.Point(latitude,longitude)) 
newcoord = [newcoord] 

# A list that will hold each of the Polyline objects 
features = [] 

for feature in newcoord: 
    # Create a Polyline object based on the array of points 
    # Append to the list of Polyline objects 
    features.append(
     arcpy.Polyline(
      arcpy.Array([arcpy.Point(*coords) for coords in feature]))) 

# Persist a copy of the Polyline objects using CopyFeatures 
output = '.../polylines.shp' 
arcpy.CopyFeatures_management(features, output) 

フィン

feature_info = [[[1, 2], [2, 4], [3, 7],[3, 7],[3, 7],[3, 7],[3, 7],[3, 7], [2, 4], [7, 2], [9, 5],[.5,0]]] 

Points and polyline to connect points を実行するように見えましたしかし、私はこのサイトでそれを行う方法がわかりません。ここでは、スニペットコードをテストするのに

newcoord = [[[-119.286071777, 37.165851593], [-119.287513733, 37.164966583], [-119.287521362, 37.164966583], [-119.287513733, 37.164966583], [-119.287521362, 37.164966583], [-119.287513733, 37.164966583], [-119.287521362, 37.164958954], [-119.28754425, 37.164936066], [-119.28755188, 37.164897919], [-119.287559509, 37.164890289], [-119.287559509, 37.164890289], [-119.287574768, 37.16488266], [-119.287567139, 37.164878845], [-119.287597656, 37.164810181], [-119.287590027, 37.164775848], [-119.287574768, 37.164779663], [-119.287582397, 37.164787292], [-119.287536621, 37.16481781], [-119.287498474, 37.164867401], [-119.287506104, 37.164875031], [-119.287498474, 37.164875031], [-119.287483215, 37.164867401], [-119.287475586, 37.164878845], [-119.287460327, 37.164890289], [-119.287460327, 37.164905548], [-119.287460327, 37.164897919], [-119.287460327, 37.164909363], [-119.287460327, 37.164909363], [-119.287460327, 37.164905548], [-119.287452698, 37.164901733], [-119.287452698, 37.164901733], [-119.287452698, 37.164901733], [-119.287452698, 37.164901733], [-119.287445068, 37.164905548], [-119.287437439, 37.164905548], [-119.287437439, 37.164909363], [-119.28742981, 37.164905548], [-119.28742981, 37.164897919], [-119.28742981, 37.164890289], [-119.28742981, 37.164886475], [-119.28742218, 37.164886475], [-119.28742218, 37.164886475], [-119.28742218, 37.164886475], [-119.28742218, 37.164905548], [-119.287414551, 37.164920807], [-119.287445068, 37.16488266], [-119.287452698, 37.164901733], [-119.287506104, 37.164863586], [-119.287521362, 37.164829254], [-119.287483215, 37.164833069], [-119.287483215, 37.164829254], [-119.287475586, 37.164821625], [-119.287475586, 37.16481781], [-119.287368774, 37.164878845], [-119.287246704, 37.164955139], [-119.287193298, 37.164936066], [-119.28717804, 37.164970398], [-119.28717804, 37.16500473], [-119.28717804, 37.165008545], [-119.28717804, 37.165008545], [-119.28717804, 37.165000916], [-119.28717804, 37.164993286], [-119.287223816, 37.164958954], [-119.287246704, 37.16493988], [-119.287246704, 37.164936066], [-119.287246704, 37.164936066], [-119.287246704, 37.16493988], [-119.287246704, 37.16494751], [-119.287246704, 37.164955139], [-119.287239075, 37.164970398], [-119.287223816, 37.16500473]]] 
+0

パスに沿って順番にGPSポイントがありますか? – Erica

+0

これらは重複しており、ポイントが移動しないか同じポイントに戻るシーケンスがある – Risato

答えて

0

リック、

あなたはPoints to Line ESRIツールを試してみましたのですか?

+0

はい、上記の例と同じ結果を返します。http://i.stack.imgur.com/UQDOm .png。私の同僚と私は、エラーが2つの連続したポイントが同じ場所にあったときにラインが重なっているか、ラインが動いていないことが原因だと思っていました。 – Risato