POST
|
I made this function for adding a string date field. Hope it helps someone: def addStringDate(gdbname,tablename,datefieldname):
arcpy.AddField_management(in_table=gdbname+"/"+tablename, field_name=datefieldname+"_STR", field_type="TEXT", field_precision="", field_scale="", field_length="10", field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")
arcpy.CalculateField_management(in_table=gdbname+"/"+tablename, field=datefieldname+"_STR", expression="arcpy.time.ParseDateTimeString( !"+datefieldname+"!).strftime('%Y%m%d')", expression_type="PYTHON", code_block="")
... View more
06-03-2019
07:27 AM
|
0
|
0
|
4574
|
POST
|
I just wanted to share this function I built for listing the contents of a GDB in ArcPy. First it will print out a list of features in a given GDB, then it'll print out any tables. Simple but useful. #lists contents of a GDB def DIRgdb(gdbInput😞 arcpy.env.workspace = gdbInput print "\nfeatures:" featuresInGDB = arcpy.ListFeatureClasses() for feature in featuresInGDB: print "\t- " + feature tablesInGDB = arcpy.ListTables() print "\nTables:" for table in tablesInGDB: print "\t- " + table
... View more
06-03-2019
07:20 AM
|
0
|
1
|
361
|
BLOG
|
Super cool! A perfect example of why pie charts are terrible obviously but cool nonetheless. I'm going to have a go.
... View more
08-01-2018
06:56 AM
|
0
|
0
|
2430
|
POST
|
There's a lot of talk here about people being too used to ArcMap. The way I see it that is not the problem. Pro is awful. It's unstable and missing important features. Some of the features that are present are so bad it's ridiculous (who wants to talk legends? The thing is the same could be said about ArcMap. It was falling behind and it was getting to the stage where it would never catch up with Quantum without an entire redesign. Yes the ESRI online stuff is awesome but if you want to do actual GIS then your best bet right now is a free application. Not an excellent state of affairs for ESRI! It's very lucky for them that most organisations won't touch open source with a 10ft barge pole. At the end of the day though ArcPro is currently in version 1 so what do you expect. It has seen significant improvements in the past couple of years but yes it is still a buggy unfinished mess and absolutely horrible to work with. I can understand why newbies might prefer the style at first glance and I'm sure those of use who were students in the ArcMap years have some stories of utter hatred to tell but believe me the advantage ends there unless you work in 3D which you probably don't. Personally I'm keeping my eye on it. I regularly attempt projects in it (I say attempt because it usually transpires that the feature I need is missing, half baked or broken) and I'll roll it out to the organisation when it's actually ready. Until then we're stuck on the antiquated and always lively ArcMap but make no mistake I can't wait for the day we can finally ditch it in favour of stable 64 bit goodness. We just need to get ESRI to listen to their users. This is something I think they've always had trouble with. Please don't forget the basics. GIS is more than pretty pictures. We need a basic suite of reliable software to work with and for the past 2 or 3 years or so I would say you don't have a product. At least not one that I would buy if we weren't so heavily invested. Yes the online stuff is cool. We see that but it's not the be all and end all for your users.
... View more
04-12-2017
03:27 AM
|
3
|
4
|
1325
|
DOC
|
Sorry I meant to post this on the Street view widget. Thanks though. Sent from my Samsung Galaxy smartphone.
... View more
03-16-2017
02:46 PM
|
0
|
0
|
3609
|
DOC
|
If someone has an old version and wouldn't mind sharing with me please can you contact me david_round87@hotmail.co.uk
... View more
03-16-2017
05:37 AM
|
0
|
0
|
5584
|
DOC
|
If someone has an old version and wouldn't mind sharing with me please can you contact me david_round87@hotmail.co.uk
... View more
03-16-2017
05:36 AM
|
0
|
0
|
3609
|
POST
|
Hi Luke, Just to let you know I'm not ignoring you. My times just been swallowed up with another project. I will test this out soon hopefully!
... View more
11-08-2016
03:16 AM
|
0
|
0
|
1040
|
POST
|
It all looks good to me. Maybe someone can spot the issue in the config file here. I know the builder is notoriously bad at writing this file. <ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Name>Select by Location</Name><AddInID>{e002960a-47b7-48cd-a903-93e51be400f7}</AddInID><Description>New Addin</Description><Version>0.1</Version><Image>Images\AddInDesktop32.png</Image><Author>Untitled</Author><Company>Untitled</Company><Date>10/24/2016</Date><Targets><Target name="Desktop" version="10.4" /></Targets><AddIn language="PYTHON" library="SelectbyLocation_addin.py" namespace="SelectbyLocation_addin"><ArcMap>
<Commands>
<Button caption="Select by Location" category="Select by Location" class="ButtonClass1" id="SelectbyLocation_addin.button" image="Images\SelectionSelectByLocation16.png" message="Select by Location" tip="Select by Location"><Help heading="Select by Location">Select by Location</Help></Button>
</Commands>
<Extensions>
</Extensions>
<Toolbars>
<Toolbar caption="select by location" category="Select by Location" id="SelectbyLocation_addin.toolbar" showInitially="true"><Items><Button refID="SelectbyLocation_addin.button" /></Items></Toolbar>
</Toolbars>
<Menus>
</Menus>
</ArcMap></AddIn></ESRI.Configuration>
... View more
11-03-2016
07:18 AM
|
0
|
3
|
1040
|
POST
|
Thanks. Unfortunately this just gives me >>>SelectByLocation( You may have helped my indirectly though. When I ran the tool afterwards with the python window open it said ButtonClass1 object is not callable. I'll go back and check my class definitions to see if this is the problem.
... View more
11-03-2016
07:14 AM
|
0
|
0
|
1040
|
POST
|
Hi, I'm having trouble adding a button using add-ins for a script tool that I made in ArcMap 10.4. I followed the instructions to the letter but I'm getting the error message "Failed to open tool [toolname] (mytoolbox.tbx). I don't understand why. I guess it's found the toolbox but won't run the tool. The code itself is very simple. It's just a reconstruction of the select by location tool to enable Geodesic selections (which really should be standard!) and the tool runs absolutely fine when I run it from the toolbox. The code to run the addin is a simple GPToolDialog call. Here's the code for the add-in: import arcpy import pythonaddins class ButtonClass1(object): """Implementation for SelectByLocation_addin.button (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): pythonaddins.GPToolDialog(r"C:\AddIns\SelectByLocation\Install\mytoolbox.tbx", "SelectByLocation") I have double, triple and quadruple checked the spelling, path name and locations of all the relevant files. Just for your info here's the code for the python tool itself but like I say there;'s no issue running it from the toolbox: import arcpy inputfeats=str(arcpy.GetParameter(0)) targetlay=str(arcpy.GetParameter(1)) selectmethod=arcpy.GetParameterAsText(2) distance=arcpy.GetParameterAsText(3) distancetype=arcpy.GetParameterAsText(4) distancemerge=distance+" "+distancetype selectiontype=arcpy.GetParameterAsText(5) inverstsel=arcpy.GetParameterAsText(6) arcpy.SelectLayerByLocation_management(arcpy.GetParameterAsText(0),overlap_type=selectmethod,select_features=targetlay,search_distance=distancemerge,selection_type=selectiontype,invert_spatial_relationship=inverstsel) If anyone can see what's wrong here I would very much appreciate any help with this. Apologies for the formatting by the way. This is my first post and I can't figure out how to do the script boxes.Time to bang my head against a brick wall!
... View more
10-25-2016
02:08 AM
|
0
|
8
|
2537
|
Title | Kudos | Posted |
---|---|---|
3 | 04-12-2017 03:27 AM |
Online Status |
Offline
|
Date Last Visited |
06-29-2023
01:22 PM
|