|
POST
|
I can't believe that this problem is stumping me, but stumped me it has. All I'm trying to do is use the field calculator to derive a difference between the numbers (double) in two columns. The numbers are all over the place; I can't do a subtraction, I'm just looking for the delta. There is an Abs() visual basic function, but I can't find any documentation on how it should work, or on whether it works the way that abs() in python does. If someone can explain which of the functions in Field Calculator I can use to derive a numerical difference, I'd appreciate it. I'm on ArcGIS Desktop 10.5 by the way.
... View more
02-22-2017
12:16 PM
|
0
|
9
|
11439
|
|
IDEA
|
I work with some amount of NITF data. NITF is commonly distributed as either *.nitf or *.ntf. ArcGIS Pro only recognizes *.ntf. ArcGIS Desktop allowed me to add a new raster type to account for different extensions of the same file format. I would like ArcGIS Pro to give me the ability to add in different extensions for known raster file types.
... View more
02-09-2017
08:03 AM
|
3
|
1
|
1205
|
|
POST
|
Michael, thanks, found the how-to for that. It'll work, sort of. I still consider this insufficient, because whenever one wants to add an enduring connection, one cannot merely add it, but has to reload and resave a separate template project, re-distribute it to a team, etc. I feel like the move away from the catalog workflow was sort of developed and decided upon in a vacuum. I hope some aspects of Catalog make a comeback in future point releases, and that this is just Esri's version of Windows 8's Metro interface.
... View more
02-03-2017
01:16 PM
|
1
|
2
|
3405
|
|
POST
|
We are slowly loading ArcGIS Pro on our office network - one thing every single person has asked is: How do we "permanently" add service or database connections that persist *across* projects? I understand what it means to work on a project basis. However, there are certain services that will apply for all projects done in a professional place of business; namely, an office's own enterprise geospatial database. Is it possible for this to be done?
... View more
02-03-2017
09:16 AM
|
3
|
8
|
4819
|
|
POST
|
I figured that this one would be pretty easy, but I'm having trouble finding it via google. How do I (with arcpy/python) get current map viewer center coordinates or corner coordinates? I'm constructing geospatial URL queries, and I want the tool to automatically send the viewer center point, or the 4 corner coordinates, as part of the URL payload.
... View more
11-10-2016
09:41 AM
|
0
|
3
|
2467
|
|
POST
|
Joshua, yes, that's correct. It looks like this: with arcpy.da.InsertCursor(pointFC, ['SHAPE@XY'] + fields) as prows: for feature in geojson['features']: geom = arcpy.AsShape(feature['geometry'], False) if geom.type == 'point': prows.insertRow([geom] + feature['properties'] for f in fields]) using the SHAPE@ token for line/poly types after that, etc..
... View more
10-18-2016
10:18 AM
|
0
|
1
|
3280
|
|
POST
|
Joshua, Unfortunately the service is not public. However I can give you an idea of the payload. It looks like this: { "type":"FeatureCollection", "totalFeatures":4000000, "features": [ { "type":"Feature", "id":(guid here) "geometry": { "type":"Point", "coordinates":[10.0000000000,11.0000000000] } ... and for "LineString" type, it reads "coordinates":[[10.0000000000,11.0000000000],[12.0000000000,13.0000000000],etc....] So in every. single. list item, I need to swap the lat/lons. I am barely getting out of novice python and am not very savvy when it comes to this. I am of course interested in doing this in the least costly way, so doing this prior to saving it as a series of feature classes is fine; I just figured there may be something very brief built into arcpy that might do this without much glue on an extant feature class. If this is not the case I'm looking for help either with a snippet of code or even pseudocode to help me think through the mechanics. It should be mentioned that currently I am ingesting this content as a .json file and then writing feature classes out of it. This content represents millions of rows, so I am not sure what would be quicker - opening an existing feature class, or re-writing the text document. Of course I am totally open to being shown better ways to do this!
... View more
10-17-2016
12:27 PM
|
0
|
7
|
3280
|
|
POST
|
I have a geoJSON service I'm querying that's being supplied by GeoServer. I have a python script that ingests this feed routinely and uses arcpy.AsShape to render the geoJSON as various feature classes (I am extracting points, lines and polygons). The problem is that the X/Ys in the service itself are backwards, even according to its own documentation. So my features are falling in all kinds of impossible locations. Is there a fast way in python to flip the X/Y geometry in feature classes, including the vertices of line and polygon types?
... View more
10-17-2016
07:54 AM
|
0
|
12
|
6505
|
|
POST
|
Joshua, sorry for the lateness of this reply but I figured I'd chime in and close the loop for anyone who may stumble on this question later. The way I fixed this was to basically check for file geodatabases first, feature datasets second, and feature classes last, extracting each to their own list. It is certainly inelegant but it gives me reliable results. So it looks a bit like... gdbList = [] fdList = [] for paths, subdirs, names in os.walk(workingPath): for subdir in subdirs: if subdir[-4:] == '.gdb': gdbName = os.path.join(paths, subdir) gdbList.append(gdbName) for fgdb in gdbList: walk = arcpy.da.Walk(fgdb, datatype="FeatureDataset") for fd in walk: if fd[0][-4:] not in '.gdb': fdList.append(fd[0]) Basically I'm building lists through brute-force string checking.
... View more
10-17-2016
07:48 AM
|
1
|
0
|
3645
|
|
POST
|
Sorry Joshua, I mis-typed there - I edited my response to make it more accurate. My issue is that even though I have da.Walk limited to a datatype="FeatureDataset", it doesn't list only feature datasets. It lists folders, geodatabases, AND feature datasets.
... View more
09-30-2016
09:31 AM
|
0
|
2
|
3645
|
|
POST
|
The problem with this is that each file geodatabase is in its own subdirectory. So when I use da.Walk and list dirs, it lists OS subdirectories and geodatabases in the results alongside the feature datasets. Please see my updated code and the updated output I've listed. At this point I'm just trying to figure out how to do copy management given the tuples I'm being returned.
... View more
09-30-2016
06:41 AM
|
0
|
4
|
3645
|
|
POST
|
Joshua, Yeah, so I'm actually using this in Spyder outside of ArcMap, just calling arcpy as another library so the python3 print statements work fine. I've updated the code a bit further to this: folder = "C:\\Temp\\Extracted"
gdbList = []
for paths, subdirs, names in os.walk(folder):
for subdir in subdirs:
for name in subdirs:
if name.endswith(".gdb"):
fullName = os.path.join(paths, name)
gdbList.append(fullName)
print("Appended {} to gdbList".format(fullName))
else:
fdList = []
for fgdb in gdbList:
walk = arcpy.da.Walk(fgdb, datatype="FeatureDataset")
for fd in walk:
fdList.append(fd)
else:
print(fdList) The problem now is that the feature dataset list (fdList) contains the full path including the geodatabase in the following format returned in a list of tuples. The way they are formatted is as follows: [(u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb', [u'Water_Network'], []), (u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb\\Water_Network', [], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb', [u'Electric_Network'], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb\\Electric_Network', [], []), (and so on.....) Again what I'm trying to do is to isolate the feature dataset here and use arcpy copy management to copy it all into a consolidated file geodatabase. I feel like I'm close but missing some glue here, because I can't iterate the copy_management through the fdList object yet. (edited for a more thorough example of the output)
... View more
09-29-2016
09:08 AM
|
0
|
9
|
3645
|
|
POST
|
Hi, so here's what I'm trying to do. I have a parent folder, which I'm calling my workspace. Under that folder are several subfolders, each containing one file geodatabase. Each file geodatabase contains unique feature datasets that I'm trying to merge into one final file geodatabase. I'm stuck at building the list of the feature datasets. Here's the code in question: folder = "C:\\Temp\\Extracted"
walk = arcpy.da.Walk(folder, datatype="FeatureDataset")
for dirpath, workspaces, datatypes in walk:
for datatype in datatypes:
print(datatype) This code yields *everything* in the subdirectory structure down to the feature dataset level. It lists all folder names, all file geodatabases at the .gdb level, and all feature datasets. What I'm trying to do is get a list back of *only* feature datasets. Can someone tell me where I'm going wrong?
... View more
09-29-2016
06:31 AM
|
0
|
13
|
6951
|
|
POST
|
Greg, yeah, it worked fine. Calling arcpy from anaconda worked just fine. However, when anaconda was registered as my default interpreter and included in my path, it broke a number of spatial statistics routines. What i've done in the meanwhile is uninstalled everything, reinstalled, and installed Anaconda without making it the default interpreter. I'm using a script from here: GitHub - JamesRamm/archook: Searches the system for arcgis and makes arcpy available to python (regardless of pythonpath… to basically go out and look for arcpy on each run.
... View more
02-12-2016
11:30 AM
|
1
|
0
|
2530
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 02-03-2025 01:29 PM | |
| 1 | 01-31-2019 11:15 AM | |
| 1 | 03-29-2022 12:18 PM | |
| 1 | 05-21-2024 12:32 PM | |
| 1 | 05-21-2024 01:03 PM |