|
POST
|
Like Darren Wiens says you are at a spot where you would need to move to code to get where you want to go. I would just like to add to what he said with, if this is your first time working with code break it into small pieces. This will make it easier to understand what is happening and helps you keep track of what's working and what's not.
... View more
06-02-2015
11:04 AM
|
2
|
3
|
1888
|
|
POST
|
This article ArcGIS Desktop explains date fields it may help. I was able to use below to pull the date. def FindLabel ( [LASTUPDATE] ):
d = [LASTUPDATE]
a = d.split(" ")
return a[0]
... View more
06-02-2015
08:57 AM
|
1
|
0
|
1410
|
|
POST
|
When did you do the install? When you did the install did do a full install?
... View more
05-29-2015
04:15 PM
|
1
|
1
|
1193
|
|
POST
|
Yes you can make a python script into a model as Jeff Ward mentions. The steps can be found here ArcGIS Help 10.1
... View more
05-29-2015
11:28 AM
|
2
|
0
|
3702
|
|
POST
|
I can find feature class limits for a file geodatabase feature class here ArcGIS Desktop does any know where to find the information\limits for an in_memory feature class. I'm currently looking to find the maximum text field size, I would also like an overview of the limits of the in_memory feature class.
... View more
05-28-2015
08:18 AM
|
0
|
3
|
5199
|
|
POST
|
Nit sure what your trying to accomplish but you can use multiple functions in label expression. See the python version below. vbscript shouldn't be much different def FindLabel ( [OWNERNAME] ):
lab = labelOther([OWNERNAME])
return lab
def labelOther(x):
return x
... View more
05-28-2015
05:55 AM
|
1
|
0
|
1430
|
|
POST
|
You could do as Richard Fairhurst suggests or you could use the symbology tab then categories to symbolize by type and also use the display tab to set a little transparency so you could see overlapping polygons.
... View more
05-27-2015
07:06 AM
|
0
|
2
|
2647
|
|
POST
|
This article ArcGIS Help 10.1 will help with error catching and traceback for where the script fails. If you are backing up shapefiles or geodatabases i would simply rerun the script.
... View more
05-26-2015
04:05 PM
|
1
|
0
|
819
|
|
POST
|
Not sure what your trying to do. You may find this link helpful ArcGIS Help 10.1
... View more
05-26-2015
03:33 PM
|
0
|
3
|
819
|
|
POST
|
Have you checked the "id" field to ensure there are multiple matching values in that field?
... View more
05-25-2015
06:17 PM
|
0
|
0
|
1286
|
|
POST
|
I created this code in hopes of sharing. One of my friends has Windows 8 and Arc 10.2.2, I have Windows 7 and Arc 10.2.1, it works great for me but fails for him below is his error message and below that is the code. Attached is the ode and all the pieces needed to make it run. Any help would be appreciated. Error Message Failed script SimpleStreetIndex... Traceback (most recent call last): File "C:\Temp\WesStreetIndexer\StreetIndexCreator.py", line 91, in <module> field_map={'STNAME':fldName ,'PageName':gridField}) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\mapping.py", line 515, in ExportReport return report_source._arc_object.ExportReport(*gp_fixargs((report_layout_file, output_file, dataset_option, report_title, starting_page_number, page_range, report_definition_query, extent, field_map), True)) RuntimeError: Error in generating report Failed to execute (SimpleStreetIndex). Failed at Thu May 21 12:12:18 2015 (Elapsed Time: 1 minutes 0 seconds) Code # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Auhor Wes Miller
# Description:
# Selects streets that intersect with grid, creates a street index and exports to pdf
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy,os
arcpy.env.overwriteOutput = True
# Local variables:
InputStreets = arcpy.GetParameterAsText(0)
InputGrid = arcpy.GetParameterAsText(1)
fldName = arcpy.GetParameterAsText(2)
gridField = arcpy.GetParameterAsText(3)
indexdoc = arcpy.GetParameterAsText(4)
indexname = arcpy.GetParameterAsText(5)
indexLayout = arcpy.GetParameterAsText(6)
#StreetsthatIntersectGrid = "RoadSegment_Layer"
DissolvedStreets = "in_memory\\dissolveStreets"
Streets = "Streets_lyr"
Grid = "Grid_lyr"
outfc = "in_memory\\joinIndex"
# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(InputStreets, Streets)
arcpy.AddMessage("Streets layer made")
# Process: Make Feature Layer (2)
arcpy.MakeFeatureLayer_management(InputGrid, Grid)
arcpy.AddMessage("Grid layer made")
# Process: Select Layer By Location
arcpy.SelectLayerByLocation_management(Streets, "INTERSECT", Grid, "", "NEW_SELECTION")
arcpy.AddMessage("Streets selection layer made")
# Process: Dissolve
arcpy.AddMessage("Process: Dissolve")
arcpy.Dissolve_management(Streets, DissolvedStreets, fldName, "", "MULTI_PART", "DISSOLVE_LINES")
if indexname.find('.')<0:
arcpy.AddMessage("when you don't select a file type pdf is default")
indexname = indexname+'.pdf'
indexdoc = os.path.join(indexdoc,indexname)
hmpath = os.path.realpath(__file__)
h,t = os.path.split(hmpath)
mxdDoc = os.path.join(h,"StreetIndexCreatorMapDoc.mxd")
mxd = arcpy.mapping.MapDocument(mxdDoc)
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
# Create a new fieldmappings and add the two input feature classes.
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(DissolvedStreets)
fieldmappings.addTable(InputGrid)
jField = fieldmappings.findFieldMapIndex(gridField)
fieldmap = fieldmappings.getFieldMap(jField)
fieldmap.mergeRule = "join"
fieldmap.joinDelimiter = ","
fld_length = fieldmap.outputField
fld_length.length = 4000
if fieldmap.outputField.type.lower() != 'string':
fld_length.type = 'String'
fieldmap.outputField = fld_length
fieldmappings.replaceFieldMap(jField, fieldmap)
arcpy.AddMessage("Process: Spatial Join")
# Process: Spatial Join
arcpy.SpatialJoin_analysis(DissolvedStreets, InputGrid, outfc, "#", "#", fieldmappings)
addLayer = arcpy.mapping.Layer(outfc)
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
if indexLayout == "11 X 17 Landscape":
rpttemplate = os.path.join(h,"reporttemplate11X17.rlf")
else:
rpttemplate = os.path.join(h,"reporttemplate.rlf")
arcpy.AddMessage("Creating Report")
lyr = arcpy.mapping.ListLayers(mxd, "joinIndex", df)[0]
arcpy.mapping.ExportReport(lyr,
rpttemplate,
indexdoc,
report_title="Street Index",
field_map={'STNAME':fldName ,'PageName':gridField})
del mxd
... View more
05-22-2015
01:52 PM
|
0
|
0
|
4063
|
|
POST
|
I would like to see a module capable of creating a form
... View more
05-18-2015
07:11 AM
|
0
|
0
|
628
|
|
DOC
|
#Learning code
#Document everything
#Import needed modules
import random
#Create a function
def give_me_a_number(start,stop):
"""Get a number give me where you want to start and
where you want to stop"""
return random.randint(start,stop)
#Preset some variables
#I'm using 100 but in some cases you may need hundreds
project = give_me_a_number(0,100)
#Success is really a product of trying
success = 0
#Trying will lead to success
Keep_trying = 1
#Sometimes a little extra help is needed
Ask_for_help = 1
#Trying is not without side effects
trials_products = ("sweat","pull your hair out",
"search the internet","buy a book","get help")
tried = []
#Here's where the work happens :)
while project > success:
if success%2 != 0:
success += Ask_for_help
x = give_me_a_number(0,20)
if x == 0 or x < len(trials_products):
if x not in tried:
tried.append(x)
print "You",trials_products
if success == project:
print "You've caught a break"
break
success += Keep_trying
print "SUCCESS"
... View more
05-17-2015
11:48 AM
|
0
|
0
|
4139
|
|
POST
|
You could use the data driven pages tools to create a grid at the desired scale and then set up data driven pages in arcMap then you will be able to use the pages to move from grid to grid
... View more
05-14-2015
07:00 PM
|
1
|
1
|
1381
|
|
POST
|
Use Feature to Line or Feature to polygon tools from your tool box either of these will create a new file.
... View more
05-14-2015
06:07 PM
|
0
|
0
|
447
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 09-14-2015 01:29 PM | |
| 1 | 01-26-2016 10:18 AM | |
| 1 | 08-18-2015 06:01 AM | |
| 1 | 06-20-2016 12:34 PM | |
| 1 | 01-19-2016 06:13 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|