POST
|
[INDENT]Is there a way to change the geocoding options in python? I geocoded the file and the standard score is 85, well all the 84.19 scores work perfectly. I have not figured out how to set the score in python.[/INDENT]
... View more
02-07-2012
04:12 AM
|
0
|
2
|
330
|
POST
|
See told you those quotes are nasty.... Yeah it worked thanks! import arcpy
## Workspace ##
FIPS = "C:\\Users\\D2148\\Documents\\Maps\\FIPS"
#FIPSlist = ('001', '003', '005', '007', '009', '011', '013',
# '015', '017', '019', '021', '023', '025', '027',
# '029', '031', '033', '035', '037', '039', '041',
# '043', '045', '047', '049', '051', '053', '055',
# '057', '059', '061', '063', '065', '067', '069',
# '071', '073', '075', '077', '079', '081', '083',
# '085', '087', '089', '091', '093', '095', '097',
# '099', '101', '103', '105', '107', '109', '111',
#'113', '115', '117', '119', '121', '123', '125',
#'127')
FIPSlist = ('001', '003')
###### CLEAR SELECTION FIRST ########
for fip in FIPSlist:
## SQL for "Master_TAHI" ##
query = "FIPS_PARIS ='" + fip + "'"
## SQL for "All_roads_cityjoin" ##
query2 = "Parish_FIP ='" + fip + "'"
## Create FIPS###.dbf from Master_TAHI ##
arcpy.TableSelect_analysis("Master_TAHI", FIPS + "\\FIPS" + fip + ".dbf",query)
## Create AllRoadsParish###.shp from All_roads_cityjoin ##
arcpy.Select_analysis("All_roads_cityjoin",FIPS + "\\AllRoadsParish" + fip + ".shp",query2)
## Create Address Locator ##
Output_Address_Locator = "C:\\Users\\D2148\\Documents\\Maps\\FIPS\\add" + fip
arcpy.CreateAddressLocator_geocoding("US Address - Street Name", "AllRoadsParish" + fip + " 'Primary Table'", "'Feature ID' OBJECTID VISIBLE NONE;'Prefix Direction' PREFIX VISIBLE NONE;'Prefix Type' <None> VISIBLE NONE;'*Street Name' NAME VISIBLE NONE;'Suffix Type' Street_Cat VISIBLE NONE;'Suffix Direction' SUFFIX VISIBLE NONE;'Left City or Place' <None> VISIBLE NONE;'Right City or Place' <None> VISIBLE NONE;'Left ZIP Code' ZIPL VISIBLE NONE;'Right ZIP Code' ZIPR VISIBLE NONE;'Left State' STATE VISIBLE NONE;'Right State' STATE VISIBLE NONE;'Left Additional Field' Parish_FIP VISIBLE NONE;'Right Additional Field' Parish_FIP VISIBLE NONE", Output_Address_Locator, "")
Final Code
... View more
02-06-2012
09:59 AM
|
0
|
0
|
430
|
POST
|
well what I did was hardcode the "AllRoadsParish001 'Primary Table'" into the address locator script and it worked. But, if I put the "AllRoadsParish" + fip + "'Primary Table'" in there it will not
... View more
02-06-2012
09:50 AM
|
0
|
0
|
430
|
POST
|
I get this error now. Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000039: Not enough reference data tables for this style. I edited like you said and the .shp and .dbf were created correctly, just the create address locator didn't work.
... View more
02-06-2012
09:29 AM
|
0
|
0
|
430
|
POST
|
import arcpy ## Workspace ## FIPS = "C:\\Users\\D2148\\Documents\\Maps\\FIPS" #FIPSlist = ('001', '003', '005', '007', '009', '011', '013', # '015', '017', '019', '021', '023', '025', '027', # '029', '031', '033', '035', '037', '039', '041', # '043', '045', '047', '049', '051', '053', '055', # '057', '059', '061', '063', '065', '067', '069', # '071', '073', '075', '077', '079', '081', '083', # '085', '087', '089', '091', '093', '095', '097', # '099', '101', '103', '105', '107', '109', '111', #'113', '115', '117', '119', '121', '123', '125', #'127') FIPSlist = '001' ###### CLEAR SELECTION FIRST ######## for fip in FIPSlist: ## SQL for "Master_TAHI" ## query = "FIPS_PARIS ='" + fip + "'" ## SQL for "All_roads_cityjoin" ## query2 = "Parish_FIP ='" + fip + "'" ## Create FIPS###.dbf from Master_TAHI ## arcpy.TableSelect_analysis("Master_TAHI", FIPS + "\\FIPS" + fip + ".dbf",query) ## Create AllRoadsParish###.shp from All_roads_cityjoin ## arcpy.Select_analysis("All_roads_cityjoin",FIPS + "\\AllRoadsParish" + fip + ".shp",query2) ## Create Address Locator ## Output_Address_Locator = "C:\\Users\\D2148\\Documents\\Maps\\FIPS\\add" + fip arcpy.CreateAddressLocator_geocoding("US Address - Street Name", "AllRoadsParish" + fip 'Primary Table'", "'Feature ID' OBJECTID VISIBLE NONE;'Prefix Direction' PREFIX VISIBLE NONE;'Prefix Type' <None> VISIBLE NONE;'*Street Name' NAME VISIBLE NONE;'Suffix Type' Street_Cat VISIBLE NONE;'Suffix Direction' SUFFIX VISIBLE NONE;'Left City or Place' <None> VISIBLE NONE;'Right City or Place' <None> VISIBLE NONE;'Left ZIP Code' ZIPL VISIBLE NONE;'Right ZIP Code' ZIPR VISIBLE NONE;'Left State' STATE VISIBLE NONE;'Right State' STATE VISIBLE NONE;'Left Additional Field' Parish_FIP VISIBLE NONE;'Right Additional Field' Parish_FIP VISIBLE NONE", Output_Address_Locator, "") These stupid parentheses keep making me so mad.... Are there rules as how to place parentheses? I can't get this code to work, there is a syntax error on this part.
... View more
02-06-2012
05:30 AM
|
0
|
8
|
788
|
POST
|
import arcpy
import sys
import string
import os
from arcpy import env
Input = arcpy.GetParameterAsText(0)
Attribute = arcpy.GetParameterAsText(1)
Attributelist = Attribute.split(";")
sqlclause = arcpy.GetParameterAsText(2)
env.workspace = arcpy.GetParameterAsText(3)
for att in Attributelist:
query = sqlclause + "'" + att + "'"
arcpy.TableSelect_analysis(Input, Input + att + ".dbf", query)
Final Code
... View more
02-03-2012
10:55 AM
|
0
|
0
|
844
|
POST
|
Yeah I understand that. I am making a tool and want it to have user defined field and attributes. Not just attributes.
... View more
02-03-2012
10:35 AM
|
0
|
0
|
844
|
POST
|
Ok, I saved it under a new name and that seemed to have fixed that. Now, I can see how it is messing up with this error. [ATTACH=CONFIG]11690[/ATTACH] When I do a SQL expression like "FIPS_PARIS" = att or Attribute (calling from the previous parameter list) it literally looks for att or Attribute not 001 or 003
... View more
02-03-2012
09:50 AM
|
0
|
0
|
844
|
POST
|
[ATTACH=CONFIG]11685[/ATTACH][ATTACH=CONFIG]11684[/ATTACH] [ATTACH=CONFIG]11687[/ATTACH] [ATTACH=CONFIG]11688[/ATTACH] import arcpy
import sys
import string
import os
from arcpy import env
Input = arcpy.GetParameterAsText(0)
Attribute = arcpy.GetParameterAsText(1)
sqlclause = arcpy.GetParameterAsText(2)
env.workspace = arcpy.GetParameterAsText(3)
for att in Attribute:
arcpy.TableSelect_analysis(Input, Input + att + ".dbf", sqlclause)
These are copy and pasted exactly how I ran them
... View more
02-03-2012
09:34 AM
|
0
|
0
|
1787
|
POST
|
Yep sure did. As soon as I posted that I knew I missed it. I changed it a few minutes ago and that error went away and brought back a new. import arcpy
import sys
import string
import os
from arcpy import env
Input = arcpy.GetParameterAsText(0)
Attribute = arcpy.GetParameterAsText(1)
sqlclause = arcpy.GetParameterAsText(2)
env.workspace = arcpy.GetParameterAsText(3)
for att in Attribute:
arcpy.TableSelect_analysis(Input, Input + att + ".dbf", sqlclause)
<type 'exceptions.AttributeError'>: 'module' object has no attribute 'GetParameterAstext' Failed to execute (Selectsplit).
... View more
02-03-2012
09:20 AM
|
0
|
0
|
1787
|
POST
|
Thanks that got rid of that part. Now it just won't work. <class 'arcgisscripting.ExecuteError'>: ERROR 000210: Cannot create output C:\Users\D2148\Documents\Maps\FIPS\Master_TAHI0 Failed to execute (TableSelect). Failed to execute (Selectsplit).
... View more
02-03-2012
09:02 AM
|
0
|
0
|
1787
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|