POST
|
Yes, the data owner may eventually use some methods like you've suggested for scrubbing their data, but for now our initial task is to help them identify which records (and how many) have issues. Thanks
... View more
11-28-2018
06:28 AM
|
0
|
2
|
1787
|
POST
|
I thought I needed the 'continue' in there or it would 'stop' at the first error, but I now realize that's the point of try/except. There is currently no errors generated, it simply returns a text message of "Error" if an address record isn't parsed. I'd like to get an output of the actual record that cannot be parsed by usaddress.tag. So with that 'continue' removed I now have the following: import arcpy
from arcpy import env
import os
import usaddress
from collections import OrderedDict
# Get input table through parameter
table = arcpy.GetParameterAsText(0)
# Get the field containing the single-line addresses through parameter
infield = arcpy.GetParameterAsText(1)
# List of fields to be updated
fields = ["addr", "addrNum", "stNm", "zip"]
with arcpy.da.UpdateCursor(table, fields) as cursor:
for addr, addrNum, stNm, zip in cursor:
try:
parse = usaddress.tag(addr)[0]
addrNum = parse.get("AddressNumber", "")
stNm = parse.get("StreetName", "")
zip = parse.get("ZipCode", "")
cursor.updateRow([addr, addrNum, stNm, zip])
except Exception:
arcpy.AddMessage("Error") Which returns a message of "Error" for each of the two incorrect address records:
... View more
11-28-2018
06:25 AM
|
0
|
11
|
2572
|
POST
|
I'm using the usaddress library to split single-line addresses into their various components. Below is the functioning script that I'm using for testing: import arcpy
from arcpy import env
import os
import usaddress
from collections import OrderedDict
# Get input table through parameter
table = arcpy.GetParameterAsText(0)
# Get the field containing the single-line addresses through parameter
infield = arcpy.GetParameterAsText(1)
# List of fields to be updated
fields = ["addr", "addrNum", "stNm", "zip"]
with arcpy.da.UpdateCursor(table, fields) as cursor:
for addr, addrNum, stNm, zip in cursor:
try:
parse = usaddress.tag(addr)[0]
addrNum = parse.get("AddressNumber", "")
stNm = parse.get("StreetName", "")
zip = parse.get("ZipCode", "")
cursor.updateRow([addr, addrNum, stNm, zip])
continue
except Exception:
arcpy.AddMessage("Error") Here's what the testing input table looks like before: And after: My goal is to write the records that error out to a separate table. (Errors include situations where multiple areas of an address have the same label, like "5318 S 86 CT APT 3 APT 412, Omaha, NE 68137" - multiple APT entries, or "PO Box 291 PO BOX 291, Genoa, NE 68640" - multiple PO Box entries.) I've reviewed the examples in the error handling page, but they seem to be very focused on geoprocessing. Also, this is the first time I've used cursors in this manner, which prevents me from using something like the following: except Exception:
arcpy.AddMessage(str(row.getValue("OBJECTID")) + " Error") At least I can't figure it out so far. Any suggestions or bump in the right direction are greatly appreciated. Thanks Justin
... View more
11-27-2018
02:49 PM
|
1
|
18
|
4849
|
POST
|
This user is running ArcGIS Desktop v10.4.1, and the upgrade status of one of our .sde connections says "This 10.2.2 Geodatabase matches the ArcGIS release you are currently using, however, database internals such as stored procedures can be upgraded."
... View more
03-09-2018
10:16 AM
|
0
|
1
|
1282
|
POST
|
Yes, this user has multiple SDE connections and has been in/out of editing sessions testing multiple processes.
... View more
03-09-2018
08:47 AM
|
0
|
0
|
1282
|
POST
|
One of our user's machines reverts back from an Advanced concurrent use to a Basic concurrent use product level, almost daily. This requires me or another person with administrative privileges to run ArcGIS Administrator to switch it back to Advanced. Anyone else experience something like this? I'm certain it's user/machine-specific, but I don't know where to look/start. Thanks for any suggestions.
... View more
03-09-2018
06:46 AM
|
0
|
5
|
1397
|
POST
|
Thanks Jayanta. I was approaching this wrong. I was able to use dissolve and a join to get what I needed.
... View more
10-25-2017
11:04 AM
|
0
|
0
|
2426
|
POST
|
My organization requires North American Profile of ISO 19115 2003 metadata. Using this style in ArcCatalog I populated all the necessary information in a copy of my shapefile. I would like to simply import the 'static' metadata into a new copy of the .shp i have created. (The .shp schema are identical - they were created using the same process.) Using import tools do not work. I've even tried physically deleting the .shp.xml from the new.shp and replacing it with the 'good' .xml file in windows file explorer - but in the Description tab in ArcCatalog not everything shows up and I cannot edit it (not that I need to, but it's obviously behaving differently). What do I need to do in order to simply import preferred metadata content from a .xml into a newly created shapfile? Thanks - Justin
... View more
10-25-2017
09:31 AM
|
0
|
1
|
651
|
POST
|
Yesterday I posted this in the incorrect area instead of Python. I have a file gdb with a couple thousand features, a few hundred of which have duplicate attribute values. I want to merge these features with duplicate attribute values to become multipart lines. Because I'm working in a FGDB I cannot use a SQL query and the Find Identical helps me identify the records, but not much else. The source data is being created from linear referencing of SQL table data nightly, and I'll need to automate this select/merge as well. I need a nudge in the right direction. (I'll also need to do this to a point feature class, but I'm aware that's another set of problems with multipoint geometry.) Any help is appreciated. Thanks Justin
... View more
10-07-2017
09:44 AM
|
0
|
3
|
3262
|
POST
|
Thanks Joe. I've wanted to avoid adding a new field, and just use the selected, duplicates in a geoprocessing action. But, a new field may be what it takes.
... View more
10-06-2017
06:21 PM
|
0
|
0
|
2848
|
POST
|
Yes, thanks - i meant to put this in Python, not the API
... View more
10-06-2017
06:19 PM
|
0
|
0
|
2848
|
POST
|
I understand I cannot use a SQL query to select multiple records that have duplicate values within a FGDB (only personal or SDE). Does anyone have a workaround? My goal is to select features that have duplicate attribute values in a particular field and merge them together to create multipart polylines...then delete the original, separate features and replace them with the new, multipart features. (I have to do this for a point feature class as well, but I know that will take additional effort to create a multipoint feature class and integration with single point feature class is difficult.) Right now I'm stuck on go just trying to select the duplicate records. Thanks Justin
... View more
10-06-2017
09:16 AM
|
0
|
6
|
4400
|
POST
|
I have roughly 1,000 GeoMedia "GeoWorkspace" (.gws) files, each a specific map of a single location/area. We are considering getting away from GeoMedia. Is there a way to convert .gws to .mxd/.aprx so as to retain the cartographic layout work that has been invested in the GeoMedia .gws? My searches so far have yielded results mostly concerned with data conversion, not map content/layout. Thanks Justin
... View more
09-12-2017
01:42 PM
|
0
|
1
|
982
|
POST
|
I need to automate the creation of nearly 100 check-outs .gdbs. Each check-out will have a site-specific name and be limited to a geographic extent from boundary layers of the same name. Are there some existing tools that may get us started, or will this need to be a from-scratch effort? I put together a simple process with arcpy.CreateReplica_management to create a single output, but I'm trying to wrap my head around the rest of our requirements. Thanks for any help nudging me in the right direction. Justin
... View more
02-10-2017
09:57 AM
|
0
|
0
|
750
|
POST
|
Thanks again Darren. That nudged me in the correct direction and I have things running the way I need them to now. Greatly appreciated. Sincerely, Justin
... View more
12-02-2016
08:08 PM
|
0
|
0
|
1161
|
Title | Kudos | Posted |
---|---|---|
1 | 06-16-2021 01:50 PM | |
2 | 12-09-2020 12:51 PM | |
1 | 12-04-2018 01:23 PM | |
1 | 03-16-2016 02:52 PM | |
1 | 05-10-2019 10:54 AM |
Online Status |
Offline
|
Date Last Visited |
03-19-2025
06:04 PM
|