POST
|
I've got a small project that I'm working on that requires installation of the dropbox Python library, as the script needs to a write files to it. Ideally I'm going to deploy this to a number of users either via a toolbox or a Python add-in. The catch is that dropbox is not a standard module, and at Python 2.7.5, pip (which I would normally use to install new module) is not a standard module either. What I'm wondering is: 1/ how would I programatically go about installing a new module from inside a running script; or 2/ is there a way I can bundle the module either into my code, or as part of my code package ('bundle of files') so that the script can find and install the missing module? 3/ I posted a similar question on Reddit and it was suggested that I look at 'freezing' my code (effectively convert to an .exe) - but I'm unsure whether this will allow the script to interact with the toolbox to access parameters etc. Would compiling the code to a .pyc allow this to work? Any and all help gratefully received!
... View more
06-06-2016
02:50 AM
|
0
|
11
|
6302
|
POST
|
Less of a question, more of a bug report. I've been trying to export a map series using Python and DDP. The issue arises when I try and set map resolution when calling ddp.exportToPDF I'm using ArcGIS 10.2.2 and Python 2.7.5 64 bit. I've tried running this from IDLE command line, IDLE interpreter, and PythonWin interpreter This works: >>> mxd = arcpy.mapping.MapDocument(r"D:\FOP1518\HPBR1516-11_FOP1516_Hume_Availability\mxd\fop_availability_layout_ddp.mxd") >>> ddp = mxd.dataDrivenPages >>> ddp.exportToPDF(r"D:\FOP1518\HPBR1516-11_FOP1516_Hume_Availability\output\Murrindindi\BurnAvailability_Murrindindi_","ALL","","PDF_MULTIPLE_FILES_PAGE_NAME") But when I try and set output resolution to 250dpi, the interpreter crashes ddp.exportToPDF(r"D:\FOP1518\HPBR1516-11_FOP1516_Hume_Availability\output\mur_test\BurnAvailability_Murrindindi_","ALL","","PDF_MULTIPLE_FILES_PAGE_NAME",250) Has anyone else experienced this? Am I doing something blindingly obviously wrong? Thanks Anthony
... View more
02-01-2016
09:32 PM
|
1
|
0
|
1875
|
POST
|
Thanks Dan, I never knew that toolset existed. Is there a way to capture the area value and write it directly to a pre-existing field, rather than have it create a new field? The other option would be create the new field, copy the new field to the existing field, and then delete the new field I suppose.
... View more
11-03-2015
04:55 PM
|
0
|
3
|
1550
|
POST
|
Hi I have an arcpy process generates a summarised dataset for me from a source dataset. Due to the limitations of our corporate spatial library, the source data (and my summarised data) are geographic (GDA94). My summarised dataset has an AREA_HA field (area, hectares) and I would like to automatically populate that field as part of the summary process. I would like this calculation to be performed in the GDA94 VG94 projected coordinate system (shape@hectares doesn't provide the accuracy I need). I'm a little at a loss as to how to do this programatically. I've had a look at spatial references (arcpy.SpatialReference) but it doesn't seem to do what I am looking for. Can anyone advise how I would go about this? Thanks
... View more
11-03-2015
04:35 PM
|
0
|
5
|
4153
|
POST
|
Hello Leandro, thank you for your offer. I seem to have resolved the issue; I suspect there was a corruption in the original fgdb structure which was causing the error. I migrated my data to a new fgdb and redirected the script, and it completed as expected. The output was not what I was hoping for, but that is more to do with my script logic than anything else. I'll need to spend a few hours this weekend working on it. Thanks Anthony
... View more
01-29-2015
12:44 AM
|
0
|
0
|
483
|
POST
|
Have done just exactly that Rhett - created a new fgdb, moved the relevant data across and remapped the path names in the script. It *appears* to be running ok now, tested successfully on one tile, now attempting to run on the full set (want to make sure that it is iterating correctly between tiles). I've also added an additional step, as the process creates some fairly complex polygons - so I am repairing geometry on the source polygons before this process starts. What is most frustrating is that this is a big batch job and ideally needs to run overnight to complete. I especially came back into work last night to get it running and came back in this morning (on a Saturday, on a long weekend) to see that it had fallen over. Fingers and toes crossed...
... View more
01-23-2015
05:57 PM
|
0
|
0
|
483
|
POST
|
Good afternoon everyone I'm sure there is a very easy answer to this question, but I am banging my head against a wall, and I need outside assistance. I have written a script that iterates through some tiled data, manipulates it and writes the output (which should be a polygon) to a feature dataset within an fgdb. For some stupid reason, the output is not writing to the correct f/dataset but rather is writing it as a table to the fgdb. Confusingly, the table contains a 'shape' field. What is more frustrating is that this script has run perfectly on a number of occasions, and I have made no structural changes to it other than changing some workspace paths. What is even more frustrating is that it has run perfectly since the workspace paths have been changed, but is now falling over for no reason that I can see. The only possible cause I can think of is that the fgdb structure has become corrupted, as there is quite a bit of data written in and out as part of this process. The tool does compact the fgdb on every 5th iteration, which is nominally when about 750 meg of data has passed through, which seems to be the magic number for improving fgdb performance by compacting. Is there anything stupid that I have missed? Why would this be misbehaving so badly? It all seems quite arbitrary and I don't quite know why.
... View more
01-23-2015
05:33 PM
|
0
|
4
|
4332
|
POST
|
Hi Rebecca, the 'funniness' was more to do with the way our licence manager user groups are structured. I don't actually administer the manager myself, so I don't have a working knowledge of how it is constructed. The specific situation is that we have some INFO licences reserved for a particular group (works ok) and SA extensions reserved for the same group, plus another group, and there appears to be some conflict there, which I don't completely understand. As to the original question - at least now I know who has what extension checked out, so at least I have a fighting chance of getting an extension when I actually need it.
... View more
01-21-2015
03:47 PM
|
0
|
0
|
1150
|
POST
|
Hi Rebecca, that solution worked perfectly (once I found a copy of lmutil). There's a bit of funniness with the way our licences and groups are structured, but at least now I know who has what, and more importantly who I can harass to release an extension.
... View more
01-20-2015
10:33 PM
|
0
|
2
|
1150
|
POST
|
Thanks Melita, this pointed me in the right direction. What I was trying to create was pretty rough, and was more for on-screen analysis rather than cartographic neatness. I ended up finding a 16 colour wheel, and used MS Paint to pick out the RGB codes and then applied these to my colour ramp. Not the prettiest symbology I've ever made, but it gets the message across.
... View more
01-13-2015
04:49 PM
|
0
|
0
|
505
|
POST
|
As a post-script to this, trying to release the extension via Python was unsuccessful, and probably due to the extension information being stored in normal.mxt or similar. No solution yet but I haven't given up looking.
... View more
01-13-2015
04:46 PM
|
0
|
4
|
1150
|
POST
|
Hi I'm trying to write a script that needs to copy geometry from one FC to another, and also write some attributes. The way I see it is that an insert cursor on the dataset I'm writing to needs to be nested within a search cursor on the dataset I'm writing from. It's an iterative script that needs to sequentially work through features via an attribute value. I could use arcpy.Append_management for this, but if I can get the search/insert cursor nesting working, I think it will be a much neater solution for the job at hand. The crux of the code is: scur = arcpy.SearchCursor(fc) >>> for row in scur: ... icur = arcpy.InsertCursor(plm) ... irow = icur.newRow() ... irow.SHAPE = row.getValue("SHAPE") ... irow.MMTGEN = row.getValue("MMTGEN") ... irow.HANDLED = "Y" ... icur.insertRow(irow) ... del irow, icur ...which seems very logical to me, but it keeps falling over with generic error 99999. This is the first time I've used Insert Cursors, so I'm unsure if what I am proposing is possible, and if I've gone about this the right way. Can anyone provide some insight for me?
... View more
01-13-2015
04:45 PM
|
0
|
1
|
7160
|
POST
|
Good afternoon everyone. I'm trying to design a 16 color color-ramp, which is going to be used to symbolise aspect (derived from a DEM). Each of the 16 colours will represent a 'chunk' of the compass - ie N thru NNE, NNE thru NE etc. Here's where it gets tricky. I would like N and S to be the two keys to the scheme, with the ramp being graduated to indicate the closer to north or south that you get. However, I don't want the eastern and the western halves to be a mirror image - they should still be graduated / ramped to provide context, but through a different colour. Does this make sense - and can you point me to a online resource where I could get some RGB codes to build the symbology?
... View more
01-08-2015
07:22 PM
|
0
|
5
|
4504
|
POST
|
Thanks Steven - good information. The issue in my circumstance is that I don't have access to the LM, and the admin is reluctant to kick people off. We used to have a service that would publish licence usage (and users) to an intranet site, but for whatever reason that is broken. I've suggested that we reinstate this service, even just on a smaller scale. I suppose I'm thinking about the root cause of the issue - ie make users explicitly select the extension when they need it, rather than a user needing one (and not being able to access it) having to chase it down. A bit of digging around has found me the arcpy.CheckExtension and arcpy.CheckInExtension options - a brute force option would be to write a ArcGIS start-up script that executes a short .py script to release any extensions held. I am going to have a tinker with this today and see if it's possible. What I was hoping for was that there was a pre-existing option on starting up ArcGIS that would force release of any extensions, either by registry key or by flag on the .exe - eg arcmap.exe /release or similar. Anyway, I'll keep tinkering and see what works.
... View more
12-30-2014
02:36 PM
|
0
|
0
|
1150
|
POST
|
Hi I have a circumstance where our organisation only has a limited number of SA extensions available in our LM for a comparatively large number of users. It is not a commonly used extension for most of our Desktop users, but it is for our specialist users. When a extension is selected, it seems to stay persistent for subsequent uses of ArcGIS Desktop - which is really annoying, as someone may have selected the extension for a specific task, and then not released the extension, effectively locking it out for other users to access. After repeated sessions of trying to source an extension for core work, I've finally cracked today. There has to be an easier way. Is there a programmatic way to change this - ie extension automatically is released on exiting software or on startup or similar? I'm imagining that this may be controlled by a registry key or similar. Please help!
... View more
12-29-2014
05:13 PM
|
0
|
9
|
6174
|
Title | Kudos | Posted |
---|---|---|
1 | 10-30-2019 10:07 PM | |
1 | 12-01-2020 09:24 PM | |
1 | 01-09-2018 07:17 PM | |
1 | 06-08-2016 02:49 PM | |
1 | 07-03-2016 11:54 PM |
Online Status |
Offline
|
Date Last Visited |
12-01-2020
10:55 PM
|