|
POST
|
Sorry, Neil, but you are not the one I heard it from so it's hard to quote you. Why don't you link to these several references and you can have your day in the sun?
... View more
03-09-2015
08:08 AM
|
0
|
0
|
3298
|
|
POST
|
This code is meant to be run from a script tool with two parameters: workspace and feature class. For your purposes, you can just enter values for each parameter (sorry, the code block won't let me format it correctly, so there are some indentation issues, but substituting values for the sys.argv parameters is the take-home message). import arcpy, sys workspace = r'C:/someworkspace'
featureclass = r'C:/somefolder/someGDB.gdb/somefeatureclass'
try: arcpy.env.workspace = workspace fields = arcpy.ListFields(featureclass) for fld in fields: print fld except: print arcpy.GetMessages()
... View more
03-08-2015
09:18 PM
|
0
|
0
|
2556
|
|
POST
|
Have you collected any parameters in sys.argv[]? The error indicates you have not. You can check with: print len(sys.argv) This should return 1 (which holds the name of the script) if no extra parameters have been specified.
... View more
03-08-2015
07:29 PM
|
0
|
0
|
2556
|
|
POST
|
Please see Posting Code Blocks in the New GeoNet. Posting code blocks properly is especially crucial for indentation problems. import arcpy
import pythonaddins
class ButtonClass1(object):
"""Implementation for test_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
mxd = arcpy.mapping.MapDocument('current')
Ll=arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
for elm in Ll:
if elm.text="Text":
elm.text="Text1" Your error refers to indentation of the Ll line. You can see it's not at the same indentation level as the mxd line (mxd is two spaces ahead of Ll). Make it the same.
... View more
03-08-2015
11:00 AM
|
0
|
0
|
932
|
|
POST
|
Building off Ian's answer, and for some reason remembering what I think were Dan Pattersonwise words, "You must set a spatial reference when creating geometries", behold: >>> sr = arcpy.Describe("onecall_poly").spatialReference
array = arcpy.Array()
array.add(arcpy.Point(-92.09936200, 46.73024000))
array.add(arcpy.Point(-92.09936200, 46.73137900))
array.add(arcpy.Point(-92.09782100, 46.73137900))
array.add(arcpy.Point(-92.09782100, 46.73024000))
array.add(arcpy.Point(-92.09936200, 46.73024000))
cur = arcpy.da.InsertCursor("onecall_poly", ["SHAPE@"])
polygon = arcpy.Polygon(array,sr)
cur.insertRow([polygon])
... View more
03-06-2015
05:58 PM
|
1
|
3
|
3298
|
|
POST
|
You're asking some very wide-ranging questions, almost on par with, "what is GIS?". You're best source of information is the ESRI help (e.g. A Quick Tour of Geodatabases). A one-sentence answer is: geodatabase feature classes are like other spatial files (e.g. shapefiles), with extra functionality, like topology, networks, domains, relationships, etc.
... View more
03-06-2015
11:21 AM
|
1
|
0
|
1369
|
|
POST
|
Is this what you are describing? If so, can you provide an example of how this doesn't work for you?
... View more
03-05-2015
10:19 PM
|
0
|
0
|
867
|
|
POST
|
Have you symbolized your raster as a bi-level image? ArcScan can vectorize any raster format supported by ArcGIS so long as it is represented as a bi-level image. This requires that you symbolize raster layers with two unique colors. You can use either the ArcMap Unique Values or Classified rendering options to separate the raster into two colors.
... View more
03-05-2015
01:49 PM
|
0
|
1
|
8237
|
|
POST
|
You can't "edit" rasters, but you can turn that raster into an editable vector polygon or polyline feature class using ArcScan or raster classification/raster to polygon operation.
... View more
03-05-2015
01:31 PM
|
0
|
4
|
8237
|
|
POST
|
As Lisa touches on, your first step is to georeference your raster, if not done already. Then, your task is to turn that raster into something more usable, using ArcScan or manually tracing the lines into a polygon/polyline feature class. I've also used a supervised classification to train the data into usable classes (i.e. draw training polygons for a few known classes, then run the classification to apply those training polygons to the entire raster).
... View more
03-05-2015
01:23 PM
|
0
|
1
|
1107
|
|
POST
|
You can do your entire map fairly painlessly using the Project tool in batch processing mode. This will open a batch processing grid into which you can drag and drop the desired layers from the table of contents. edit: apparently this functionality is so popular that there is a Batch Project script tool packaged with ArcGIS (at least at 10.1).
... View more
03-05-2015
01:13 PM
|
2
|
1
|
4014
|
|
POST
|
If Hillary's suggestion does not work, try creating or re-creating the spatial index of both files (ArcCatalog->Feature Class Properties->Indexes tab). This fixes all kinds of inexplicable geometry problems.
... View more
03-05-2015
11:14 AM
|
0
|
0
|
5444
|
|
POST
|
Do the GRID and GDB raster have the same pixel depth? If not, the new raster may have truncated or scaled the original values to fit the new pixel depth, moving away from the standard flow direction codes (1, 2, 4, 8, etc.). You do mention that the data are the same, so this may not be your problem.
... View more
03-05-2015
11:05 AM
|
0
|
1
|
769
|
|
POST
|
Oh, I completely misunderstood how you wanted to use user input. I'm going to say that it's not possible the way you've got it. I'm actually still not quite sure what you're trying to achieve - for each bore drill location, the user needs to type in the number? That could be a lot of typing...
... View more
03-04-2015
03:41 PM
|
0
|
1
|
1241
|
|
POST
|
I assume you've checked that "mergeBuffer" is what you think it is. Can't do much else than inspect your data.
... View more
03-04-2015
10:05 AM
|
0
|
0
|
2717
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|