|
POST
|
Hi Greg, That makes it tricky. Correcting the casing on the source data might be more worthwhile in the long term, assuming you have control over the data and can do that. Either way, you'll need to parse the components of the FULLNAME value. Are these intersections? I was think that 'Nb' meant New Brunswick but I think it means Northbound. Assuming that's the case, your FULLNAME components would be (I think): Street Name ("Crete-Monee") Street Type ("Rd") Highway Name ("I 355") Highway Direction ("NB") Is that correct? Assuming your data is formatted consistently with the example you gave, it would be possible to parse those components and correct them in the source data. You could use an arcpy.da.Update cursor pretty effectively to do that. Some questions to consider: Do you want a hyphen for interstates? Are there other types of highways (non-interstates) in the data?
... View more
10-25-2016
12:20 PM
|
0
|
0
|
1441
|
|
POST
|
I think you're on the right track. Does your data only have a FULLNAME attribute or are the address components broken out in other attributes?
... View more
10-24-2016
11:46 AM
|
0
|
2
|
1441
|
|
POST
|
Hey Geoffrey, I would add that your DistrictFunction function collects DistrictConfig as an input parameter but doesn't actually use it anywhere in the function. If you need the functions run 21 one times with 21 different sets of parameters, you may with to store those parameters in a table. Each row would contain all the values required by your function. Then, read that table with an arcpy data access search cursor and run your function each time. Something along the lines of: def DistrictFunction(distfc, totalexpression, totalscline, statsfield, fields, TotalLong):
# your logic
# create variables for your parameter table and the fields in that table you will interact with
paramterTable = r"[Path to Parameter Table]"
fields = ("distfc", "totalexpression", "totalscline", "statsfield", "fields", "TotalLong")
# read the paramter table with a search cursor and run your function
with arcpy.da.SearchCursor(table, fields) as cursor:
for row in cursor:
DistrictFunction(row[0], row[1], row[2], row[3], row[4], row[5]) Good luck. Micah
... View more
10-24-2016
11:31 AM
|
0
|
1
|
4658
|
|
DOC
|
This is my first article published to ArcUser magazine. I'm honored to have it in the publication! Thanks to Monica Pratt and her team for all their hard work. Let me know what you think of the article in the comments, or feel free to email me.
... View more
10-24-2016
08:24 AM
|
5
|
2
|
2661
|
|
POST
|
Hi Kathryn, Expanding on that idea, you could consider pre-processing your block groups by erasing water and right of way polygons (if you can get them). Then, you could try to obtain address points or building footprints for your area. You could divide the block group population by number of buildings and assign each building that amount of people. It just depends on what data you have available and how sophisticated an estimate you want to go for. I'd recommend you set up your process in Python script or ModelBuilder so you can evaluate results and refine your estimate. Good luck! I did a similar project in my first GIS job and it was a lot of fun.
... View more
10-22-2016
04:41 PM
|
1
|
1
|
3922
|
|
POST
|
Hi Lano, That depends on what you will do with the data. The choice you make should be based in what characteristics you want to preserve and which you are ok with distorting between shape, area, distance, and direction. Texas is a big state - three UTM Zones and five state plane zones. You might want to see if the state of Texas provides any data to the public in a projected coordinate system and go with that. Good luck.
... View more
10-13-2016
07:23 AM
|
2
|
1
|
15223
|
|
POST
|
I've gotten stuck on Esri tutorials before. It's frustrating! One thought: are you using the right tutorial data? It looks like you are using data for an ArcGIS 10.0 tutorial: However, Python toolboxes are only supported starting at version 10.1. I'm not sure if this is the issue but maybe verify you are using the correct tutorial data. Also, I am still not clear on the purpose of this line: It looks like you are filtering a list of possible input features with different types of attribute columns? Seems a little odd, but again I am not very familiar with Python toolbox syntax and setup. Here's a final thought for you, Golden: the Esri documentation for Defining parameter data types in a Python toolbox, it looks like the proper syntax for a feature layer input would actually be: datatype = 'GPFeatureLayer' You might give it a try with that modified syntax. Good on you for taking on Python toolboxes! Here's some more info on Comparing custom and Python toolboxes. Micah
... View more
10-11-2016
09:31 AM
|
1
|
1
|
3060
|
|
POST
|
I tried several different solutions and this one worked for me! Thanks all.
... View more
10-07-2016
10:22 AM
|
0
|
0
|
1231
|
|
POST
|
Hey Golden, it seems like quite a challenge to me! Is this tutorial part of a class? A couple thoughts: Have you looked at regular custom script tools stored in a .tbx? I don't use Python Toolbox .pyts. I think it's a lot of extra lines of code and I generally get all I need from regular script tools where the parameter properties are all set up within the GUI. Also, if posting a lengthy script for others to scrutinize, it's worth the time spent on formatting, commenting, spacing out so folks can understand it better and get you some more worthwhile feedback. Best, Micah
... View more
10-06-2016
10:47 PM
|
1
|
3
|
3060
|
|
POST
|
Hello, It's annoying how Geonet's syntax highlighter widget doesn't indent anything. So, when you try to drag one of the polygon layers into the first parameter of your tool, what specifically happens? It won't accept it as an input? What happens if you delete or comment out line 37? I don't use Python toolboxes myself, and I have to say after seeing this post I feel good about that choice! Side question - what efficiency to folks get out of using Python toolboxes over regular old custom toolboxes? Good luck out there! Micah
... View more
10-04-2016
03:50 PM
|
1
|
1
|
3237
|
|
POST
|
Hmmm. Can you post the script that yielded this error? It looks like the error was caused by the lyr variable not being a valid input to the describe function.
... View more
10-03-2016
09:34 AM
|
1
|
1
|
927
|
|
POST
|
I'd try: #Set definition query to user set parameters
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.isFeatureLayer: #<---this bit will ensure you are trying to access the fields of only feature layers
fields = arcpy.Describe(lyr).fields
for f in fields:
if f.Name == "FEEDERID":
lyr.definitionQuery = """FEEDERID = """ + "'" + str(feederID) + "'"
... View more
09-30-2016
10:53 AM
|
1
|
3
|
2615
|
|
POST
|
I second Darren Wiens' assessment. From the looks of it you want a data access update cursor. Make sure to put the line cursor.updateRow(row) at the end of each iteration through the cursor. This will update the table with your specified values. Micah
... View more
09-30-2016
10:44 AM
|
2
|
0
|
967
|
|
POST
|
Gotcha! In that case, (assuming you are using Esri-hosted feature services) I'd: Create a local copy of feature service version 1 Migrate the data into your new schema (the one you published as feature service version 2) - this could be done with Append or your favorite data migration tool Publish the geodatabase that has the version 2 schema as a feature service Will that work?
... View more
09-28-2016
11:26 AM
|
0
|
1
|
1061
|
|
POST
|
Hi Jennifer, From your question it sounds like the key concept to understand is that in Collector, you are editing (collecting) point features in a feature service. This feature service is contained within a web map, which is the item you selected when you launched the Collector app on your smartphone or tablet. In order to get the same points you collected into a new Collector project, you just need to add the feature service you have edited thus far into a new web map, where it can be combined with other layers, etc. To do this, start by logging into ArcGIS Online in a web browser. Go to the group under which you found the web map in Collector. There, you should find a web map with the same name as the one you selected in Collector. Open that web map's properties, where you should find a list of layers. Click on the name of the layer that you edited with Collector the first time around. In your URL address bar, you should see a URL something like: https://www.[your organization].com/arcgis/rest/services/[folder name]/[editable layer name]/FeatureServer/0 Copy the text of the URL up to and including the word FeatureServer (don't copy anything after that). From there, you can go back to ArcGIS Online, click the "Map" tab on the top, and you will have a new web map. From the "Add" drop-down, select "Add Layer from the Web" and paste the URL you copied earlier. That should add the editable layer to your new web map. From there, you can configure this new web map however you like, save it, and share it with your group. You should see this map when you launch Collector (may need to refresh) and it will have all the data you collected previously in it! Hope this helps. Happy collecting. Micah
... View more
09-28-2016
10:54 AM
|
0
|
3
|
1061
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-13-2017 09:58 AM | |
| 1 | 10-27-2017 12:54 PM | |
| 1 | 10-13-2017 04:28 PM | |
| 5 | 08-14-2017 01:58 PM | |
| 1 | 10-16-2017 08:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-26-2021
03:16 PM
|