POST
|
I received a project with a shapefile from another department. When I try and load it into ArcMap 10.2.1, I receive the following: Properties: Just looking for some direction on how to resolve. I understand the distinction between Geographic Cood. Sys. vs Projections but I'm struggling to identify, if this is my issue.
... View more
10-07-2016
09:27 AM
|
0
|
1
|
923
|
POST
|
This is what I was trying to do for my script. For whatever reason, I could not get the looping straight.Thanks so much for the assistance.
... View more
02-16-2016
06:47 AM
|
0
|
3
|
711
|
POST
|
The print was just a way to know when it ended. I did get it to update my shapefile but with only the last line of the loop.
... View more
02-12-2016
06:55 PM
|
0
|
1
|
1599
|
POST
|
@Aaron - That's what I'm having trouble doing if I understand your point. Create a set of points for Line_1, then Line_2, etc. That's what I do not know how to do.
... View more
02-12-2016
01:01 PM
|
0
|
0
|
1599
|
POST
|
forln in inputFile:
pointList = arcpy.Array()
ln = ln.split(",")
name = ln[0]
point = arcpy.Point(ln[1], ln[2])
pointList.add(point)
polyline = arcpy.Polyline(pointList)
cursor.insertRow((name, polyline)) Attribute table: Shape Name polyline Line_4
... View more
02-12-2016
12:55 PM
|
0
|
1
|
711
|
POST
|
for ln in inputFile:
pointList = arcpy.Array()
ln = ln.split(",")
name = ln[0]
point = arcpy.Point(ln[1], ln[2])
pointList.add(point)
polyline = arcpy.Polyline(pointList)
... View more
02-12-2016
12:35 PM
|
0
|
5
|
1599
|
POST
|
So I need to create a line based on a series of points. In the example below, there are 4 lines to be created, Line_1. Line_2, etc. Struggling with the loop that creates each pointList. cursor = arcpy.da.InsertCursor(fc, ["Name","SHAPE@"])
for ln in inputFile:
name = ln[0]
pointList = Point. Array() # initial Array
ln = line.split(",") # Split the lines in text file
point = arcpy.Point(ln[1], ln[2]) # Create points
pointList.add(point) # Add points to array
polyline = arcpy.Polyline(pointList)
cursor.insertRow(name, polyline) Line_1, 529018.125025, 4108038.05548 Line_1, 529005.718792, 4108028.20659 Line_1, 528993.340503, 4108018.73931 Line_1, 528980.990158, 4108009.65364 Line_1, 528968.667757, 4108000.94958 Line_2, 528956.373301, 4107992.62713 Line_2, 528944.106788, 4107984.68629 Line_2, 528931.86822, 4107977.12705 Line_3, 528919.657595, 4107969.94943 Line_3, 528907.474915, 4107963.15341 Line_3, 528895.320179, 4107956.739 Line_3, 528883.193387, 4107950.7062 Line_4, 528871.09454, 4107945.055 Line_4, 528859.023636, 4107939.78542 Line_4, 528846.980676, 4107934.89744 Line_4, 528834.965661, 4107930.39107
... View more
02-12-2016
11:44 AM
|
0
|
17
|
6808
|
POST
|
Disclosure: Portion of my homework The following script creates a count of wells per county and works: ********************************************************************************************************************* import arcpy arcpy.overWriteOutput = True arcpy.env.workspace = "C:\\Users\\kkirkeby\\Desktop\\GIS-4080\\Lesson5_Data\\Lesson5_Data" # Variables wells = "Wells.shp" counties = "COUNTIES.shp" Wells_Intersect = "Wells_Intersect.shp" Wells_Intersect_Layer = "Wells_Intersect_Layer" input_f = ["Wells.shp", "COUNTIES.shp"] # Process: Intersect #arcpy.Intersect_analysis(input_f, Wells_Intersect, "ALL", "", "INPUT") # Process: Make Feature Layer #arcpy.MakeFeatureLayer_management(Wells_Intersect, Wells_Intersect_Layer) # List County Names countyList = [row[0] for row in arcpy.da.SearchCursor(counties, "COUNTY")] # Count wells for each county for cname in countyList: whereclause = "{} = '{}'".format("COUNTY", cname) wellCnt = 0 with arcpy.da.SearchCursor(Wells_Intersect_Layer, "COUNTY",whereclause) as cursor: for row in cursor: wellCnt = wellCnt + 1 print cname + ", " + str(wellCnt) ********************************************************************************************************************* I need to update the second to last column in the row with wellCnt. My thought was to modify the script with the following: forcname in countyList: whereclause = "{} = '{}'".format("COUNTY", cname) wellCnt = 0 with arcpy.da.UpdateCursor(Wells_Intersect_Layer, "COUNTY",whereclause) as cursor: for row in cursor: wellCnt = wellCnt + 1 row[-2] = wellCnt cursor.updateRow(row) Error: IndexError: list assignment index out of range Thanks for any advice or assistance.
... View more
02-05-2016
09:13 AM
|
0
|
8
|
3984
|
POST
|
I had read the link you listed before and thought I was good. I like your comment about using os.path instead. Thanks for all your help to date. Ken
... View more
01-29-2016
09:01 AM
|
1
|
0
|
1385
|
POST
|
Well there's 4 hours I'll never get back ... Thanks. Details, details, details.
... View more
01-29-2016
08:43 AM
|
1
|
2
|
1385
|
POST
|
Same result: Also change gdb_fullPath = out_folder_path +'\\' + gdb_name print out_folder_path = C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data print gdb_name = l4_ex5 print gdb_fullPath = C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data\l4_ex5 print arcpy.Exists(gdb_fullPath) = False
... View more
01-29-2016
08:34 AM
|
0
|
4
|
1385
|
POST
|
ArcGIS 10.3.1; Python 2.7.11 The file DOES exist but reporting that it does not. The syntax looks correct to my newbie eyes. ****************************************************************************************************************** import arcpy arcpy.env.workspace = "C:\\Users\\kkirkeby\\Desktop\\GIS-4080\\Lesson4_Data\\Lesson4_Data" #Variables out_folder_path = 'C:\\Users\\kkirkeby\\Desktop\\GIS-4080\\Lesson4_Data\\Lesson4_Data' gdb_name = 'L4E5' gdb_fullPath = out_folder_path +'/' + gdb_name fclist = arcpy.ListFeatureClasses() fcIn = 0 fcOut = 0 # Create gdb if it doesn't exist. if arcpy.Exists(gdb_fullPath): print "Geodatabase already exist" else: print "Geodatabase does not exist. Creating..." print arcpy.Exists(gdb_fullPath) print gdb_fullPath # arcpy.CreateFileGDB_management(out_folder_path, gdb_name) ****************************************************************************************************************** Output: ================================ RESTART ================================ Geodatabase does not exist. Creating... False C:\Users\kkirkeby\Desktop\GIS-4080\Lesson4_Data\Lesson4_Data/L4E5
... View more
01-29-2016
07:44 AM
|
0
|
8
|
3650
|
POST
|
Had to add the brackets to ITEM or the list was individual letters. myList = [] Item = 'None' while item <> '': item = (raw_input("Please enter a number (Blank to quit): ")) myList.extend([item]) printmyList ************************************************************ Please enter a number (Blank to quit): Ken Please enter a number (Blank to quit): Jim Please enter a number (Blank to quit): Bill Please enter a number (Blank to quit): ['Ken', 'Jim', 'Bill', '']
... View more
01-26-2016
02:34 PM
|
0
|
1
|
258
|
Title | Kudos | Posted |
---|---|---|
1 | 01-29-2016 09:01 AM | |
1 | 01-29-2016 08:43 AM | |
1 | 01-21-2016 10:00 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|