|
POST
|
I wonder if instead of trying to check if an edit session is going on, just check if a LOCK file is present for that workspace the file you are hoping to edit is in for the file in question. A file GDB creates a LOCK file of the same name regardless of whether it is being editted within an ArcMap Edit Session or using an Editor Object(FeatureClassName.ed.lock). Its not perfect since obviously more than one person can be accessing the dataset and create a lock on it, but at least you can check if the data is being editted at all. Just spitballing here.
... View more
03-09-2017
09:27 AM
|
0
|
0
|
2658
|
|
POST
|
Yea we ran into this question a couple weeks ago where the Map Document and the arcpy Editor object aren't aware of each others editting status and their isn't a way to pythonicly check if an edit session is going on in the map document without using ArcObjects. I pointed them to the below post but I'm not sure if they got anywhere with it or not. https://community.esri.com/thread/190456-arcpydaeditor-setup-for-tool http://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session
... View more
03-09-2017
08:56 AM
|
1
|
0
|
6107
|
|
POST
|
I thought about a good way to check and not add Null values to a label expression and here is a sample I used in ArcMap. def FindLabel ( [gasonsite], [featuredlabel], [poweronsite] 😞 fields = ([gasonsite] , [featuredlabel] , [poweronsite]) label = "" for field in fields: if field is None: continue else: label = label + field + "\n" return label If the value is Null, it add nothing to the label, it is has a value, add it to the label to be returned and add a carriage return. Please note all my fields I used were strings and if you are using other types you will need to use the str() to convert them prior to concatenating.
... View more
03-09-2017
08:42 AM
|
1
|
0
|
2990
|
|
POST
|
Actually it doing exactly what you are telling it to do. You said if it is a NULL label it a NULL which is nothing. To test if its working I tried having it return something if it was Null: def FindLabel ( [gasonsite] 😞 if [gasonsite] is None: return "Value is Null" I had dataset with some NULL values in a field and this expression successfully returned my string for the features that had NULL in that field. When I used the expression you used, it was blank like your probably was.
... View more
03-09-2017
08:32 AM
|
1
|
1
|
2990
|
|
POST
|
How are you trying to add the copied jpg to the map document(add data, arc catalog, windows explorer, etc.)? Also you keep mixing between TIF and JPEG in your original post, could you be a little more clear about what raster data type you are working with? Couple of help links: http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/auxiliary-files.htm http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/world-files-for-raster-datasets.htm
... View more
03-09-2017
08:22 AM
|
2
|
2
|
1946
|
|
POST
|
Hi Michael. I think your issue is that you are having it check again the string value "None" instead of a None object. Try checking it against the key word None instead of the string. http://stackoverflow.com/questions/3289601/null-object-in-python I suggest using the if ... is None format in the link for your syntax. Regards, Ian
... View more
03-09-2017
07:49 AM
|
2
|
0
|
2990
|
|
POST
|
Hi Victor, First off, for future reference when posting any sort of code on GeoNet, please use the code formatting so its easier for people to read. https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting?sr=search&searchId=9e68ebfd-5533-4144-baae-76132a8a7e07&searchIndex=0 From your post it is my understanding that you want your MXD and PDF file for the map to be saved to the same number directory that was created from your search cursor and matches page number attribute of your DDP, but the pdf keeps ending up a directory above the MXD file(Mapas finales instead of the correct number folder). I believe your issue would be in the fact that you are adding an extra directory to your filepath when creating your mxdNombre variable (mxdNombre = os.path.join(os.path.join(mxdSalida, str(pageName)),str(pageName)+".mxd")) whereas that extra folder path is not included when exporting the PDF (arcpy.mapping.ExportToPDF(mxd, os.path.join(mxdSalida, str(pageName) + ".pdf"))). If you added the extra os.path.join which joins the extra folder name to your PDF export, that should fix your problem. arcpy.mapping.ExportToPDF(mxd, os.path.join(os.path.join(mxdSalida, str(pageName)),str(pageName) + ".pdf")) Best wishes, Ian
... View more
03-09-2017
06:19 AM
|
0
|
0
|
1088
|
|
POST
|
Hi Yusuf, The only reason the layout view would need to refresh after each deletion is if you were running this code with the python interpreter in an actual map document. Why not run a standalone script that opens the map document in memory and deletes the cloned graphic elements. The only time the layout view changes when processing outside of a map document is when you tell the layout to refresh the active view or save the map.
... View more
03-07-2017
06:22 AM
|
0
|
1
|
1121
|
|
POST
|
There was never any additional follow-up from them, so no idea if it ever got resolved. I again extend my offer to look at a copy of the csv. Also I recommend converting the csv to a geodatabase table, it usually helps clear up a few things prior to the join.
... View more
03-03-2017
07:03 AM
|
0
|
6
|
4759
|
|
POST
|
They are planning to use SRTM data as the basis for construction purposes? That data is really coarse(1 value for a 25m x 25m area) and since all the elevation is integer instead of float you already have a fairly significant margin of error in the data(the actual value for a cell could have been 1249.49, but the sensor rounded to nearest integer), just based on how it was collected and stored(not to mention the SRTM in Eurasia has a mean height error of +/- .7m). I don't think the focal statistics would effect the data to such a degree that it would cause significant changes in whatever planning they are doing. I'm guessing they are needed the contours for some kind of cut/fill analysis, what program are they planning to do the planning in? Many CAD-type programs can handle DEMs and generate surface contours from them all on their own. Actually usually if I'm making contours from a DEM I prefer to created them in AutoCAD/Civil3D as opposed to ArcGIS(for small scale areas/coarser data, if I'm working over a large scale or very fine data I use Arc, since CAD doesn't handle large surfaces as well as ArcGIS). Dan_Patterson, curtvprice, got any additional comments? I was also thinking based on how coarse the original data is, would 5m contours even be "accurate" based on the large cell size?
... View more
02-23-2017
07:09 AM
|
1
|
5
|
3268
|
|
POST
|
The label and description properties of layers do not accept dynamic text(which in turn drive the legend labels). However, if you were able to convert the dynamic text to a basic string, you could do something of this nature. Can you post a screenshot of what your page title and legend looks like right now, and how you would want it to change? I don't use DDP at all, but what to know what you are trying to get as an output.
... View more
02-22-2017
08:58 AM
|
1
|
0
|
1759
|
|
POST
|
Hi Leslie, I tried using your data and creating contours directly from the SRTM DEM did generate alot of erroneous looking contours. I believe this can be attributed to mainly the fact that your elevation values are all integers, with no floating point. Therefore, it can create contours around the edge of several cells since they can easily have the same elevation. In order to make more cartographically pleasing contours, I ran the Focal Statistics Tool using a 3x3 window calculating a mean value for each cell. This obviously degrades the data from the original slightly, but does also create contours that are mcuh closer to the type of contours you are expecting. It also has the benefit of generating floating point elevation values(since we are averaging many integers), instead of the integer values that caused alot of our artifacts. In the below screenshot, the purple lines are the contours generated by the unsmoothed DEM, the light blue are the contours from the smoothed DEM. I hope this is what you were looking for, let me know if you have any further questions. Ian
... View more
02-22-2017
07:42 AM
|
1
|
7
|
3268
|
|
POST
|
I didn't write out a whole script tool to use, I just entered all the values in ArcMap's python window. Also interesting is when I opened and closed an editing session within the map document manually, it closed out my in memory editting session. Apparently their aren't many pythonic ways to get a map document to check if there is an edit session ongoing. Found a few other threads that could point you in the right direction, but I'm not sure using arcpy.da.Editor is going to do the trick by itself. http://gis.stackexchange.com/questions/61708/how-to-check-via-arcpy-if-arcmap-is-currently-in-an-edit-session-or-not If anyone else has some suggestions, I'm all ears.
... View more
02-17-2017
11:21 AM
|
1
|
0
|
827
|
|
POST
|
Ah just tested that in a map document. It opens an editting session in memory, but does not actually show the editting session within the map document itself. I can edit the attribute table manually of the feature but can't manually edit geometry. I thought the map document would recognize the edit session, but apparently not.
... View more
02-17-2017
10:54 AM
|
0
|
2
|
827
|
|
POST
|
Are the feature class you putting into the tool in the same workspace you are setting for the editting workspace? That would be necessary for you to be able to edit the features, since you are setting the workspace to be editted, not the feature itself. Any feature class in that workspace would be editable at that point. Any edits you want to make would have to be within the map document itself, unless you change some code to do it within the program. So right now all the code I wrote should do is use the current map document, subset a feature class based on an input field and value, zoom to it and start an editting session to allow edits on that feature(if it is in the workspace we set for editting). The user would then have to make the changes to the geometry and/or attributes, save and close the edit session within the map document. I'm guessing you were setting this up for basic GIS users to easily view and possibly edit a specific feature?
... View more
02-17-2017
10:15 AM
|
0
|
5
|
3091
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|