|
IDEA
|
This can be done with shapefiles using the ogr2ogr tool from GDAL/OGR. If combined with the Alter Field GP tool in a custom script this could produce the desired result within a file or enteprise geodatabase. It's a bit tricky to implement and would probably be susceptible to attrition. All the more reason to upvote this idea! I suppose one hesitation may be that some organizations' programs may interact with fields via an index value, not a column name.
... View more
06-22-2016
11:50 AM
|
1
|
0
|
1213
|
|
POST
|
Hi Theo, You may be able to ditch the double quotes around field names. Also, (as Darren Wiens mentioned), those could be text fields. You could use CAST to convert those values to integer. Micah
... View more
06-22-2016
09:27 AM
|
0
|
1
|
2989
|
|
POST
|
Hey Guillaume, I do agree with Blake's advice on specifying the paths using the 'r'. It may also be useful to specify an alias name in your toolbox properties. I've found importing toolboxes is much more consistent that way. Then, you can ditch the second parameter. Good luck. Micah
... View more
06-22-2016
09:22 AM
|
1
|
0
|
1922
|
|
POST
|
Ah, so all of the polygons in the image above are in the same feature class? Andrew's solution looks interesting and may work. Otherwise, you could do something like this: # import required modules
import arcpy, os
# export each feature into a standalone feature class using a search cursor and the Select GP tool
table = r"Path to your polygon feature class"
fields = ("OBJECTID")
output_workspace = r"path to scratch workspace"
with arcpy.da.SearchCursor(table, fields) as cursor:
for row in cursor:
exp = '"OBJECTID" = {0}'.format(row[0])
arcpy.Select_analysis(table, os.path.join(output_workspace, arcpy.Describe(table).baseName + "_" + str(row[0])), exp)
# create a python list of the feature classes which you just exported
arcpy.env.workspace = output_workspace
fcList = arcpy.ListFeatureClasses("[base name of your feature class]_*")
# perform the intersection using the list of feature classes which you created in the previous step
arcpy.Intersect_analysis(fcList, result_feature_class) Really, Esri should just roll the above solution into a new GP tool. Split (analysis) doesn't really do it. Let me know what ends up working for you! Micah
... View more
06-21-2016
10:37 AM
|
0
|
0
|
3668
|
|
POST
|
Hi Akshay, Intersect (Analysis Toolbox) should work for you. Micah
... View more
06-21-2016
10:05 AM
|
1
|
2
|
3668
|
|
POST
|
I hear ya! It would be nice to have an AGOL utility that would allow a user to submit a service and auto-register each of the feature layers therein (maybe something like this already exists???). Ten layers isn't so bad though - my coworker and I registered 80+ individual feature layers for our AGOL Open Data site. The whole thing took probably four hours. Micah
... View more
06-21-2016
08:35 AM
|
0
|
1
|
1831
|
|
POST
|
FWIW, I've often found arcpy's definition of "dataset" a little confusing. For example, the arcpy.Describe() "Dataset type" property will return any of these: However, when I use arcpy.ListDatasets() on a workspace with a bunch of tables and a single feature dataset, only the feature dataset is returned. I do agree with Joshua Bixby that arcpy.da.Walk() is the most consistent way to list everything (with the added benefit of being able to "drill down" into feature datasets). So to summarize, my concept (and please correct me if I am mistaken!) is that a "dataset" in ArcGIS is any of the things listed in the graphic above. Micah
... View more
06-20-2016
03:21 PM
|
0
|
5
|
6182
|
|
POST
|
So you have created empty feature classes in your personal geodatabase, and now want to load some features into them? For that, you would use Append (management). Feature Class To Feature Class will write an entire feature class to a given output location. It's just a little unclear what exactly you are going for. Here's a tip: before writing any code, start by writing a step-by-step explanation of what you want your script to do, in the simplest possible terms. I do that regularly and it helps me complete the script, and ask for help if I need it. Then, if you complete your process using individual geoprocessing tools, you can go to your results tab (Geoprocessing Menu -> Results), right-click a tool, and select 'Copy as Python snippet.' Then you can paste that into a script to see how the parameters work. Also, if you have ModelBuilder experience you can set up your process in ModelBuilder and then choose Export -> Export to Python Script. This may also help you understand how parameters and results of tools are handled (although the script often comes out a little hard to understand).
... View more
06-20-2016
02:54 PM
|
0
|
0
|
1013
|
|
POST
|
All I can think of would be to make a copy of the layer, apply proportional symbols on field B to the bottom copy, field A on the top copy, apply the same proportional symbol scale values to both copies, and try some type of offset to get the "edge-touching" effect. Please post if you figure it out! It's a cool concept that should be easier to implement.
... View more
06-17-2016
03:14 PM
|
0
|
0
|
692
|
|
POST
|
Hi Paul, If I understand what you are trying to do, then I think Append (management) and Rename (management) will get you there. However... Paul Hacker wrote: But now I need to copy INTO the new created F, G, and H Geodatabase Feature Class from another GDB that already has a F, G, and H Geodatabase Feature Classes that has data they want to show up on ALL of them. ...why not just copy the feature classes over, rather than creating a new (empty) feature class and loading data into it? That way you would get it done in fewer steps. Micah
... View more
06-17-2016
02:16 PM
|
0
|
0
|
1013
|
|
POST
|
Heya Paul, Congratulations on diving into Python! Yours is a classic example of why folks should learn Python and arcpy. You may wish to also check out the Save to Layer File GP tool. You could implement it like: import os, arcpy
arcpy.env.workspace = r'C:\gisdata\mdb\roads.mdb'
layerFileFolder = r'C:\gisdata\layerFiles'
for fc in arcpy.ListFeatureClasses():
arcpy.MakeFeatureLayer_management(fc, 'tempLayer')
arcpy.SaveToLayerFile_management('tempLayer', os.path.join(layerFileFolder, arcpy.Describe(fc).baseName + '.lyr')) Hope this helps! Happy scripting. Micah
... View more
06-17-2016
12:36 PM
|
0
|
0
|
1974
|
|
POST
|
Hi Ray, Are the layers all in the same service? There is an option to publish a service with the ability to Enabling dynamic layers on a map service in Manager—Documentation (10.3 and 10.3.1) | ArcGIS for Server. I think you can enable this in ArcGIS Server Manager. This might allow you to reorder the layers if they are part of the same service.
... View more
06-17-2016
12:19 PM
|
1
|
5
|
1831
|
|
POST
|
Hi Jacob. If your goal is just to convert the data from SDE to shapefile, I'd recommend Feature Class To Feature Class or Copy Features. Copy Features (management) can be used as well but lacks the field map controls and some of the other options Jake mentioned. This is important to consider due to the field length limitations of a shapefile (11 characters I believe). So, if you have lengthy field names in SDE they may be truncated in your shapefile. Copy (management) is fast, but can only write between the same format - so no converting from geodatabase to shapefile. Of course, if you need to visualize the data in ArcMap first, then "export data" from the TOC is fine. It just involves a bit of extra clicking! Micah
... View more
06-17-2016
12:10 PM
|
1
|
1
|
2099
|
|
POST
|
Greetings, Are there any consequences (geodatabase performance or other) to having domains "stack up" in a SQL Server-based SDE geodatabase? I noticed many unused domains in an SDE workspace when running a script that writes domain properties to a series of file geodatabase tables. The script is attached. A lot of them have the same base name followed by an underscore and then a number: In this particular enterprise geodatabase, there are 913 domains but only 93 of them are actually applied. So, is this ok? Or is there a compelling reason to clean up the unused domains and try to prevent them stacking up like this in the future. Thanks, Micah Geodatabase Enterprise GIS
... View more
08-06-2015
12:36 PM
|
0
|
2
|
4771
|
| 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
|