|
POST
|
So, got this cracked. I was confused, I hadn't installed the 10.3.1 64bit BG stuff. I had an old 10.1 version instead. So, in the python cmd window, "import arcpy" worked, but not really. I tried doing this by hand, but couldn't see the tables inside the fgdb. So, once I had the correct BG 64bit stuff installed, all is well. And it is pretty fast, and it all goes into my big dictionary with 5,221,157 records. Although I can configure pyscripter on an external run to use the 64bit, it is a little hard to debug like that. But I can also run the script from 64bit IDLE, and interact with my variables etc. So I will probably just carry on like that.
... View more
03-17-2016
06:00 AM
|
1
|
0
|
6955
|
|
POST
|
I often use custom page sizes, generally a 16cm X 11cm page size with a frame 15X10 at origin 0.5, 0.5, so I have a margin to put the graticule labels around. This works well for me for input into powerpoint slides. But you must remember, when it comes to actually printing this to a physical piece of paper, there are a whole bunch of other options. Adobe, for instance, by default, scales whatever input page size to the page size of the output device. That messes up scales!
... View more
03-16-2016
10:17 AM
|
1
|
0
|
1473
|
|
POST
|
Sorry, but what are you viewing this behavior in? Is this in ArcMap? Once the layer name is edited in the TOC, that's what usually appears in the legend IMHO. Or is this in AGOL or somewhere else. Software version also please.
... View more
03-16-2016
10:07 AM
|
0
|
3
|
1846
|
|
POST
|
Joshua, thanks. That goes some way to explaining why sys.getsizeof(ob) doesn't really report the expanding size of my master dictionary. But I am probably muddying the waters here. How do I get the 64 bit python to work in this case? I am using PyScripter as my interpreter.
... View more
03-16-2016
10:04 AM
|
0
|
3
|
6955
|
|
POST
|
Thanks Wes, no I hadn't. But I don't think that is the answer to my problem. The nested dictionary approach is what I need. Those "x_table", "x_id" fields contain table names (now pointers to other parts of the nested dictionary). With this structure and the correct flow from one to another, I should be able to recursively rip through this at the speed of light.
... View more
03-16-2016
09:27 AM
|
0
|
0
|
6955
|
|
POST
|
I thought of asking this question over at SE, but those pro pythonistas will probably give me an answer I won't understand . I am trying to load (via arcpy.da.SearchCursor) a bunch of tables. They are all related to each other via a series of attribute ids. The project is actually about a telcomms problem, tracing a fibre route from end to end and all the bits of kit that go along the route. Unfortunately, there are rather a lot of records to load. My loading code below: tblInfoDict = {
"route" : ["routeid", "name"],
"routedetail" : ["routedetailid", "routeid", "x_table", "x_id", "num"],
"port" : ["portid", "x_table", "x_id", "num", "grp"],
"fibermngr" : ["fibermngrid", "name", "x_table", "x_id", "fibermngrtypeid"],
"building" : ["buildingid", "name", "gpslatitude", "gpslongitude"],
"strand" : ["strandid", "x_table", "x_id", "num", "bundle", "color"],
"span" : ["spanid", "spantypeid", "length", "locateid"],
"cable" : ["cableid", "spanid", "spantypeid"],
"enclosure" : ["enclosureid", "name", "x_table", "x_id", "enclosuretypeid"],
"access_point" : ["access_pointid", "name", "typ", "gpslatitude", "gpslongitude"],
"ductbank" : ["ductbankid", "name"],
"spantype" : ["spantypeid", "name"],
"innerduct" : ["innerductid", "ductbankid", "superductid"],
"superduct" : ["superductid", "ductbankid"]
}
# load a series of dictionaries
data_dict = {}
for tbl, flds in tblInfoDict.iteritems():
print "Reading {}".format(tbl)
t1 = time.time()
data_dict[tbl] = {}
temp_dict = {r[0] : r[1:] for r in arcpy.da.SearchCursor(tbl, flds)}
print "Size {}".format(sys.getsizeof(temp_dict))
data_dict[tbl].update(temp_dict)
del temp_dict
print "Total Size {}".format(sys.getsizeof(data_dict))
t2 = time.time()
print "Read took {:.2f} secs".format(t2 - t1) I inserted the sys.getsizeof(object) to try and get a handle on what I was consuming. The run window: >>>
Reading ductbank
Size 1573004
Total Size 140
Read took 1.33 secs
Reading access_point
Size 1573004
Total Size 140
Read took 0.62 secs
Reading spantype
Size 524
Total Size 140
Read took 0.10 secs
Reading superduct
Size 3145868
Total Size 140
Read took 1.24 secs
Reading enclosure
Size 393356
Total Size 140
Read took 0.27 secs
Reading strand
Size 50331788
Total Size 524
Read took 22.63 secs
Reading routedetail
Size 25165964
Total Size 524
Read took 7.39 secs
Reading building
Size 393356
Total Size 524
Read took 0.25 secs
Reading fibermngr
Size 393356
Total Size 524
Read took 0.22 secs
Reading span
Size 1573004
Total Size 524
Read took 0.43 secs
Reading cable
Size 1573004
Total Size 524
Read took 0.59 secs
Reading route
Size 1573004
Total Size 524
Read took 0.60 secs
Reading port
Size 25165964
Traceback (most recent call last):
File "C:\Data\ESRI-SA\DarkFibreAfrica\Vodacom\Python\ProcessDBTables.py", line 48, in <module>
data_dict[tbl].update(temp_dict)
MemoryError
>>> sys.version
'2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)]'
>>> So the output of sys.getsizeof(), when pointing at my intermediate temp_dict reports something real. But, the output for data_dict which is accumulating the data make no sense whatsoever. If anyone has insight into this, please explain. So, to get to my question. Could I run this script using the 64 bit version? And how? Would I be able to get the entire large dict into memory using the 64 bit python? Running this in v10.3.1 python 2.7.8
... View more
03-16-2016
08:33 AM
|
0
|
8
|
11615
|
|
POST
|
Or wrap your update cursor in something like this : # open an editor session
edit = arcpy.da.Editor(os.path.dirname(outputDiff)) # dirname of the fc is the db name
edit.startEditing(False, False) # check these setting for your environment
edit.startOperation()
# do the update loop
# stop editing
edit.stopOperation()
edit.stopEditing(True)
... View more
03-14-2016
12:02 AM
|
1
|
0
|
2519
|
|
POST
|
And the DNR Garmin utility is a great, free program for all things between Garmin and ArcGIS. Und der DNR Garmin -Dienstprogramm ist ein großes , kostenloses Programm für alle Dinge zwischen Garmin und ArcGIS . DNR Garmin Application: Minnesota DNR
... View more
03-08-2016
06:36 AM
|
0
|
0
|
4198
|
|
POST
|
The output from the tool is a feature, not just a table, with the desired coordinates, in whatever format added to the attribute table. Did you choose the correct input options? DMS Long / Lat in 2 separate columns?
... View more
03-07-2016
10:10 PM
|
1
|
0
|
4671
|
|
POST
|
Those dms text strings look well formatted so the convert coordinate notation tool would work on this data.
... View more
03-07-2016
01:48 AM
|
1
|
2
|
4675
|
|
POST
|
There will always be resampling when re-projecting a raster image. This is because of shape changes between one type of projection with another. As far as I understand it, the raster is "moved" into the new coordinates, and a pixel center point grid in the new coordinates laid on top. This then resamples the original by whatever method you have chosen. Usually, nearest neighbor for discreet data, or some form of interpolation for continuous data. This then means that if you have a histogram of the data distributions before and after, they will never be quite the same. Some data will always be changed, even if it is only by a small amount.
... View more
03-06-2016
10:30 PM
|
1
|
0
|
2414
|
|
POST
|
Changing the display units can, sort of, enable you to measure stuff, but its not very accurate imho. Besides, the question was about changing the coord sys from a meters based system to GCS.
... View more
02-26-2016
06:58 AM
|
0
|
0
|
27360
|
|
POST
|
See this helpful bit of code from Xander How to symbolize which features have attachments?
... View more
02-26-2016
04:10 AM
|
0
|
0
|
1374
|
|
POST
|
Sorry, but this is not the correct way to "change a coordinate system". Do NOT redefine the coordinate system to something it is not. 1. Use the project tool, to create a new feature in the coordinate system of choice (in your case GCS). or 2. Load the metres based data (I hope you know what this coord sys is, UTM perhaps) into ArcMap, then change the coordinate system of the data frame to a GCS based system. Then you can export the data in the CRS of the DF.
... View more
02-26-2016
04:06 AM
|
0
|
2
|
27360
|
|
POST
|
What I did was to use the definition query in the layer properties. With a definition like this : [DteExpires] > Date() AND [DteExpires] < (Date() + 180) With the symbology set to a red outline, this would show all licences which are expiring within the next 6 months (180 days). DteExpires is a datetime field.
... View more
02-25-2016
07:46 AM
|
1
|
0
|
752
|
| 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
|