|
POST
|
"I'm using Arcpy to iterate over the 5000 projection systems, plotting the XY points." Pardon!!, that's brave. If you find one that fits, go for it!
... View more
10-23-2018
08:13 AM
|
0
|
0
|
3630
|
|
POST
|
X-COORD Y-COORD 3150059.572 13865340.77 Dan is right. Are you sure that these numbers are not feet instead of metres? Where do you expect these coordinates to sit?
... View more
10-23-2018
01:12 AM
|
0
|
4
|
3630
|
|
POST
|
Without knowing anything about this digital shoreline analysis system, have you checked the table contents in field Date1? Correct the invalid entries (perhaps Null) might be the place to start.
... View more
10-09-2018
03:27 AM
|
0
|
1
|
6833
|
|
POST
|
(kind of the last man standing so having to do a whole bunch of things I haven't done previously!) Haven't we all Apologies, didn't notice the validate = False.
... View more
09-28-2018
02:34 AM
|
0
|
0
|
2266
|
|
POST
|
I am pretty sure that running a search cursor on the layer, then within the read loop apply a selection is going to work as a strategy.
... View more
09-28-2018
02:31 AM
|
0
|
0
|
2173
|
|
POST
|
It should take more than a few seconds to change the paths and save the mxd. Are you sure that oldpath & newpath are accessible from the machine?
... View more
09-28-2018
02:18 AM
|
1
|
0
|
2266
|
|
POST
|
So, unlike Dan... I rarely deal with shapefiles, but they do have their uses. If you are zipping the whole shapefile in the file explorer, you must be careful to include all the components... "Fred.shp", "Fred.shx", "Fred.prj", "Fred.dbf" as a minimum. There are other bits. Just select all files starting with "Fred", right click and send to a zipped file.
... View more
09-18-2018
08:50 AM
|
0
|
0
|
4430
|
|
POST
|
Well also see that the *.shp part of the shapefile is associated with some other program as well. Not sure that this really matters. What other program (not the file explorer) are you going to open / add a shapefile other than ArcMap or ArcCatalog?
... View more
09-18-2018
08:39 AM
|
0
|
4
|
4430
|
|
POST
|
Just checked with a date field in a feature class. When you read it in using arcpy.da.SearchCursor it looks like a datetime.datetime style date/time. ie it looks like this : >>> n1 = datetime.datetime.now()
>>> n1
datetime.datetime(2018, 9, 12, 13, 49, 33, 458000) And you can compare these directly. So, lets go with 1 dict for the whole table with fields of oid, mooringId, startdate, status Use Joshuas idea of constructing a dict with a list of oids per mooringId. See example below. I am sure the other contributors can think of some more elegant way. dict_tabledata = {}
dict_mooringID = {}
flds = ["OID@", "Mooring_Id", "Mooring_Licence_Start_Date", \
"Mooring_Licence_Status"]
# read the data into 2 dicts
with arcpy.da.SearchCursor(table, flds) as Cur:
for row in Cur:
oid = row[0]
mID = row[1]
dict_tabledata[oid] = row[1:]
if not mID in dict_mooringID:
dict_mooringID[mID] = [oid]
else:
dict_mooringID[mID].append(oid)
# get a dict of licences which are status = Current
dict_current = {}
for mID, oidList in dict_mooringID.items():
for oid in oidList:
status = dict_tabledata[oid][2]
if status == "Current":
dict_current[mID] = oid
# process the dicts to compare dates
for mID, currentOid in dict_current.items():
currentdate = dict_tabledata[currentOid][1]
for mooringID, oidList in dict_mooringID.items():
# if this oid is not the current one,
# check dates
for oid in oidList:
mooringDate = dict_tabledata[oid][1]
if oid != currentOid:
if mooringDate > currentDate:
print "Mooring {} Oid {} older than {}".format(
mooringID, currentOid, oid)
... View more
09-12-2018
05:18 AM
|
1
|
0
|
1571
|
|
POST
|
I have found that you can handle dictionaries with +2million records before you run out of memory. If that happens, then switch to the 64bit version of python. 64bit is installed when you install the back ground geoprocessing module for Desktop
... View more
09-12-2018
04:31 AM
|
0
|
0
|
1298
|
|
POST
|
Exercise 3a: Getting started with spatial ETL—Help | ArcGIS Desktop
... View more
09-11-2018
01:28 AM
|
0
|
0
|
935
|
|
POST
|
I think you will need 3d to do anything with multipatches. But not entirely sure. Normally one starts Data Interop through a spatial ETL tool inside a toolbox. Create a tool box, right click and select New....
... View more
09-11-2018
01:26 AM
|
0
|
1
|
935
|
|
POST
|
I would probably make 2 dictionaries. The first is the entire table with the OID as the key. The second would hold only that first occurrences of MooringID (key) and keep the OID as its data. Something like this : dict_tabledata = {}
dict_mooringID = {}
with arcpy.da.SearchCursor(table, ["OID@", "Mooring_Id", "other data columns"] as Cur:
for row in Cur:
oid = row[0]
mID = row[1]
dict_tabledata[oid] = row[1:]
if not mID in dict_mooringID:
dict_mooringID[mID] = oid Then you can loop through the dict_mooringID to get the oid in the main table and do what you need to do
... View more
09-11-2018
01:22 AM
|
1
|
1
|
1571
|
|
POST
|
That's the domain, not the extent. They probably are degrees. But it does look rather odd.
... View more
09-10-2018
04:43 AM
|
0
|
0
|
2206
|
|
POST
|
I have always created geometries with the positional arguments and with a spatial reference. Like arcpy.Polyline(array, sr, True) Not sure that the has_z formulation will work, well it doesn't for you. As regards the length, yes, vertical lines are zero length in plan view. If you want the 3d length you can calculate it or add it.
... View more
09-04-2018
04:35 AM
|
1
|
0
|
2581
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-08-2015 11:28 PM | |
| 1 | 12-20-2013 08:59 PM | |
| 1 | 05-14-2014 10:38 PM | |
| 1 | 12-16-2013 09:05 PM | |
| 1 | 05-31-2019 02:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|