|
POST
|
No, I ran this directly from the provided Excel file. I just highlighted the zero distance rows in Excel, right-click delete (don't leave blank rows by pressing delete key), save Excel, then run Bearing Distance to Line tool on Excel file. That said, sometimes Excel files cause funky issues and can vary between versions of Excel and ArcGIS, so don't be shocked if it doesn't work in .xlsx format.
... View more
12-04-2015
10:38 AM
|
0
|
0
|
6025
|
|
POST
|
I assume your problem is now that you're trying to draw lines of distance zero. I deleted those rows in your table, and it seems to work, although I'm not sure what your spatial reference is:
... View more
12-04-2015
09:08 AM
|
1
|
4
|
6025
|
|
POST
|
I'll give you the trick answer of "the best way to use your function is not to use the field calculator". You can get the same result by calling your function as it is from within an UpdateCursor. There may be a way to format your function call within a formatted string in the field calculator expression, but it seems unnecessarily complicated (as you're finding). untested: with arcpy.da.UpdateCursor(outClipFC, ["PERCENTAGE_OF_OVERLAP_OF_LAYER","AREA_OF_OVERLAP_HA_OF_LAYER"]) as cursor:
for row in cursor:
row[0] = getPercentOverlapValueOfAOI(row[1],extentArea)
cursor.updateRow(row)
... View more
12-03-2015
02:03 PM
|
2
|
2
|
4397
|
|
POST
|
No matter what projection I originally set Those are Lat/Long, so your original coordinate reference system for the point(s) should be geographic, not projected. Try WGS84 as a default, or other if you know.
... View more
12-03-2015
01:55 PM
|
3
|
1
|
3203
|
|
POST
|
Hmmm... Yes, all valid points. edit: although, any workflow that includes creating null geometries is somewhat debatable as being "valid".
... View more
12-03-2015
10:34 AM
|
0
|
0
|
1027
|
|
POST
|
Here's a link to the above referenced knowledge base article. I'd say it's no more than 50/50 whether CAD is being created in a recognized CRS. Perhaps a recognized projection, but in my experience CAD operators prefer to adjust the origin closer to local, which requires adjustment, and thus a custom prj file. The above knowledge base article does link to this other useful article, which outlines how to Create a custom projection file to align CAD Data in ArcMap 10.1 and above ... but now we've circled back to creating a new .prj file.
... View more
12-03-2015
09:44 AM
|
1
|
1
|
3251
|
|
POST
|
Do you already have an enterprise license? It sounds like it. How does it bring value to your office? Just being the devil's advocate, but maybe it's not bringing value. I'll add: the main reason I bring this up is that in other areas on these forums, you're expected to start with "what you've got so far" so others can help.
... View more
12-03-2015
09:22 AM
|
1
|
0
|
2555
|
|
POST
|
What does the error (if any) in the Results window tell you was the problem?
... View more
12-02-2015
02:00 PM
|
0
|
1
|
4253
|
|
POST
|
If you can tolerate the line ends being connected together, you can explore Buffer (probably want to run in batch mode, and specify flat line end type) or Multiple Ring Buffer. Then, convert to line.
... View more
12-02-2015
01:21 PM
|
0
|
0
|
5443
|
|
POST
|
You've already found the "right" way to do this (digitize the lines, keeping track of a unique ID to join back to the attributes), but here is a spectacularly wrong way to do it. 1.) Make a note of how many records are in your table. 2.) If you table isn't in DBF format, make it so. 3.) Create a new line shapefile (mine is called "bad_idea.shp") 4.) We need to make as many null geometries as there are records in your table. You can do so with the following Python code: >>> insCursor = arcpy.da.InsertCursor("bad_idea","SHAPE@")
... for i in range(7):# change to the number of null geometries you want to make
... myArray = arcpy.Array()
... myPoint = arcpy.Point()
... myArray.add(myPoint)
... myLine = arcpy.Polyline(myArray)
... insCursor.insertRow([myLine]) 5.) Close down ArcGIS to release any locks on bad_idea.shp 6.) Delete "bad_idea.dbf" in file explorer 7.) Rename your original table (the one with the attributes you want to keep) to "bad_idea.dbf" 8.) ArcGIS won't open "bad_idea.shp" anymore (I'm not exactly sure why), but QGIS is more liberal with that sort of thing. Bring this diseased shapefile into QGIS and save a copy, say "bad_idea_copy.shp" 9.) Bring "bad_idea_copy.shp" into ArcGIS. It should have your original attribute table associated with null polyline geometries. 10.) Start editing. 11.) Select the feature from the attribute table for which you want to update the existing null geometry to a real geometry 12.) Start editing vertices (editing toolbar) 13.) From the edit vertices toolbar, select Continue Feature Tool 14.) Draw your new feature. This geometry is associated with the selected record in the attribute table. 15.) Repeat. Have fun. I take no responsibility for any damage this method may cause.
... View more
12-02-2015
10:27 AM
|
2
|
2
|
1027
|
|
POST
|
You appear to be back to this method, so just open and write the file, without an arcpy SpatialReference whatsoever. To reiterate: prj = open(r"C:\junk\my_new_prj_file.prj", "w")
crs_string = 'PROJCS["NAD_1983_UTM_Zone_10N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]'
prj.write(crs_string)
prj.close()
... View more
12-02-2015
09:14 AM
|
1
|
1
|
10216
|
|
POST
|
Buuuuuut, the help says 'name' (at least) is read/write, which I guess is a mistake judging by Adrian's example.
... View more
12-01-2015
02:35 PM
|
1
|
4
|
4338
|
|
POST
|
The tool is Project (under Data Management->Projections and Transformations).
... View more
12-01-2015
12:41 PM
|
0
|
1
|
4857
|
|
POST
|
However, this feels like cheating. Is it easy to screw stuff up when doing it this way? Or should I just double check each time to make sure it was all entered correctly? Is this the best way to modify/create a .prj file with how I am going through the process? I don't think it's cheating to manipulate the prj file directly. You're just getting over the frightfulness of operating outside of what ESRI wants you to believe is the right and only way to do things (i.e. through the GUI or copying a GUI-made prj file). Granted, there are smart people making these tools and they may have thought of something you haven't, yet, and built in a check for that. And, yes, it is easy to screw things up if you're not careful. And, it's easier still for someone else to screw things up once you've made something and released it into the wild. As a rule, you should always verify user entry because they will find a way to do it wrong. Whether this is the best way, I don't know. If you're making different custom CRSes, one way or another you need to get those parameters into a prj file, whether you have them do it through the GUI to copy later or enter the values into your custom tool to write a dynamic prj file.
... View more
12-01-2015
10:33 AM
|
1
|
0
|
3251
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|