|
POST
|
Hello, When I tried for to export an feature class from the geodatabase to a shapefile, it failed and it reports a Fatal Error, Segment Violation? Any idea what it could be? thanks A common issue of low-level system errors like that is if the output folder is not writeable for any reason, including invalid or unsupported pathnames or field names.
... View more
11-19-2012
07:36 AM
|
0
|
0
|
684
|
|
POST
|
Field names cannot be longer than 10 characters. No limitation for the file name that I'm aware of. Luke you're absolutely right. I posted a little quick there. The 10-char limitation is indeed on the field names. In general, you should always at least start with a letter and stick to alphanumeric characters plus "_" for folder paths and names in ArcGIS.
... View more
11-19-2012
07:29 AM
|
0
|
0
|
6508
|
|
POST
|
The usually way to do this kind of modeling is to optimize multiple factors, for example: distance to population centers, existing power lines, streamflow, basin area, minimal environmental cost, etc. Using the hydrology tools to find basin area would be a start, but other data layers would help as well. Be creative!
... View more
11-17-2012
11:31 AM
|
0
|
0
|
1131
|
|
POST
|
... and then tell me how to apply it to the code block on Calculate Field GP tool. Expression: ExtractNum(!INFIELD!) Code block:
def ExtractNum(fieldValue):
try:
val = ''.join([i for i in fieldValue if i.isdigit()])
except:
val = None
return val
... View more
11-17-2012
11:24 AM
|
2
|
0
|
9144
|
|
POST
|
De nada. For the record, this is exactly the same tool, licensed under Spatial Analyst or 3D Analyst.
... View more
11-17-2012
11:16 AM
|
0
|
0
|
1900
|
|
POST
|
I had a different solution to get around the not-so-helpful extent handling in ModelBuilder iteration: I used Calculate Value to extract the extent and then split that result to calculate the other parameters for the Create Fishnet tool. Here are two of the Calculate Value setups and how I put the model together. Note I added some grace area around the extent (hence the complicated math): [ATTACH=CONFIG]19389[/ATTACH][ATTACH=CONFIG]19390[/ATTACH] [ATTACH=CONFIG]19391[/ATTACH]
... View more
11-16-2012
05:25 PM
|
0
|
0
|
5119
|
|
POST
|
Is there a maximum length for the shapefile name? I read somewhere it is 10 characters. Yes, for this and other details of shapefile limitations, see this article in the help: Geoprocessing considerations for shapefile output
... View more
11-16-2012
05:04 PM
|
0
|
0
|
6508
|
|
POST
|
Is it possible? Sure is. Two ideas to help you along: 1) Use the Iterate Value tool to iterate the multivalue 2) Use Calculate Value to create the SQL expression as a string and set its output as type "SQL Expression"
... View more
11-16-2012
04:51 PM
|
0
|
0
|
1178
|
|
POST
|
If the checkout fails, it doesn't generate an error. You will see the result if you enter: print arcpy.CheckOutExtension("3D") See the example code in the help for CheckOutExtension-- it has a nice example of how to check whether the license was successfully acquired.
... View more
11-16-2012
04:21 PM
|
0
|
0
|
1900
|
|
POST
|
Every stop has a ID so I have joined to that file from an excel file a worksheet with the ID and associated ridership. When setting up the point density options I can get a successful result provided I leave the "Population field" dropdown alone, just displays "NONE" but that just gives me the density of stops as opposed to what I need to display is the ridership Data types in excel often get read wrong (ie text instead of number or vice versa) and joins can be dicey with Excel links -- so I suggest you copy your stops feature class to a new one so all the data is in a shapefile or gdb feature class. If the data comes across as text you can then add a numeric field and copy it over from the text field.
... View more
11-16-2012
11:20 AM
|
0
|
0
|
1761
|
|
POST
|
So the user sets their project workspace and then sets the name of the output location however since I am using a data type of Raster Dataset with an output direction, the parameter wants to use the current workspace set by the tool as the default location if a user just inputs a name. (1) Additionally the browser dialog which opens points to the last workspace a dataset was written to which can also be different. (2) I just want them both to point to the users selected workspace by default. (1) Unfortunately, I think the workspace setting is only local to the validate functions, you can't migrate it "up". So you need to do it this way:
# the first parameter [0] is the (input) workspace parameter
# to make things easy for the user, set this to default to the current workspace
# in the parameter properties dialog (or in the code if pyt toolbox)
# the second [1] is your output dataset.
def updateParameters(self):
if self.params[0].value and self.params[1].altered:
outFC = str(self.params[1].value)
import os
if os.path.dirname(outFC) == ""
self.params[1].value = os.path.join(self.params[0].value,outFC)
(2) Bad news, the workspace that appears in the popup when you click the folder is not the current workspace, it's either the home folder, or the last folder opened with an open dialog. This is a Windows UI standard I think, although it is annoying!
... View more
11-16-2012
10:07 AM
|
0
|
0
|
1957
|
|
POST
|
When I try to do the point density I get the "ERROR 010092: Invalid output extent" message. I've tried unsuccessfully to make adjustments in the environment but to no avail. I would look carefully at your point density arguments to make sure they are reasonable (and provide in the right units). Also make sure you are working in projected coordinates, not geographic (degrees). Although in theory you can project on the fly, for best results, I recommend projecting the data before you run the tool. If this doesn't help, what is your extent, and what are the arguments you are providing?
... View more
11-16-2012
09:54 AM
|
0
|
0
|
1761
|
|
POST
|
Thank you Curtis, that worked. I am new to ArcGIS, so I am just learning the concepts. No problem! Glad to help -- I wish someone had explained this to me. The help kind of misses how this works IMHO. I will share my blog post to the help authors (note, you can comment and suggest things in the online ArcGIS help web pages - this is a big help to everyone!)
... View more
11-15-2012
06:56 AM
|
0
|
0
|
1824
|
|
POST
|
I made a tool in Model Builder that uses "Iterate Feature Selection" and I'm trying to figure out if there is an equivalent I can use in Python. Have you considered setting up your model as a script tool (with parameters), importing the toolbox using arcpy.ImportToolbox, and running the model from your Python script? If you're more comfortable with ModelBuilder - why not let it do the tricky stuff?
arcpy.ImportToolbox("Mytools.tbx","Model1")
arcpy.MyModel_mytools(input,output)
The code to do this in Python would be complicated enough (especially if you are using several group by fields) that this may be a good approach for you. You could use the output of the Collect Values tool as an output parameter to pass the list of output datasets back to your python script.
... View more
11-14-2012
12:18 PM
|
0
|
0
|
1005
|
|
POST
|
Even when I save the layer to a layer file, the source names still persist. If you want to remove the source names, you need to copy out to a dataset. Saving to a layer will not unqualify field names, as a layer just points to the datasets - which have not changed. For example, if I do a join, this is what I get for a field list: arcpy.AddJoin(..)
Field Type Len
------------------------- ------- ---
Yellowsone_line.FID OID 4
Yellowsone_line.Shape Geometry 0
Yellowsone_line.ObjectID Integer 9
Yellowsone_line.FEATURE String 21
Yellowsone_line.NAME String 59
Yellowsone_line.STATE String 5
Yellowsone_line.MILES Double 12
Yellowstone_lakes.FID Integer 4
Yellowstone_lakes.ObjectID Integer 9
Yellowstone_lakes.FEATURE String 22
Yellowstone_lakes.NAME String 40
Yellowstone_lakes.STATE String 20
Yellowstone_lakes.SQMI Double 10
Now, if I copy this, qualifiedFieldNames comes into play: arcpy.env.qualifiedFieldNames = True arcpy.CopyFeatures_management("Yellowsone_line","e:\\work\\xxline.shp")
Field Type Len
---------- ---------- -----
FID OID 4
Shape Geometry 0
Yellowsone Integer 9
Yellowso_1 String 21
Yellowso_2 String 59
Yellowso_3 String 5
Yellowso_4 Double 14
Yellowston Integer 9
Yellowst_1 Integer 9
Yellowst_2 String 22
Yellowst_3 String 40
Yellowst_4 String 20
Yellowst_5 Double 12
arcpy.env.qualifiedFieldNames = False arcpy.CopyFeatures_management("Yellowsone_line","e:\\work\\xxline.shp")
Field Type Len
---------- ---------- -----
FID OID 4
Shape Geometry 0
ObjectID Integer 9
FEATURE String 21
NAME String 59
STATE String 5
MILES Double 14
FID_1 Integer 9
ObjectID_1 Integer 9
FEATURE_1 String 22
NAME_1 String 40
STATE_1 String 20
SQMI Double 12
... View more
11-14-2012
11:06 AM
|
0
|
0
|
1824
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|