|
POST
|
Maybe write your in_memory feature class somewhere on disk: CopyFeatures_management would work. http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000035000000 Also, your error message is telling you that your input features, "select" are not found or supported. Better double check this to validate it exists and or has features.
... View more
06-26-2013
11:33 AM
|
0
|
0
|
1548
|
|
POST
|
I have no issue sharing -- it's not entirely my code to begin with. My thought is that I am not really writting orginal, although I start from scratch, libraries so much as I am mostly re-organizing and invoking/implementing things that have already been developed into a logical configuration that solves my (or my user's) particular needs. Take a "new" COM toolbar that I may build from scratch and delpoy it as an Extension: Really, I am just invoking all of the ArcObjects that make up ArcGIS --- I have not rebuilt a new ArcGIS, I am simply re-organizing things that solve a particular need that the default version of the software may not do well or efficient for a particular user or set of users. Same with Python libraries and Geoprocessor objects I may develop.
... View more
06-26-2013
04:25 AM
|
0
|
0
|
1815
|
|
POST
|
Thanks for the help. I have attached a jpeg of the HTML popup tool tab from properties on the feature service layer added to my desktop. I don't see any reference to "Show feature attachments as links". Maybe I am looking in the wrong place? Can you help. I think I may have missed the fact that you are dealing with a Feature Service -- my bad and I'm sorry to overlook that. I don't have access to working with Feature Services (yet), but I am under the impression that you should be able to do what you want and will have to look into it. Apologies for not having a direct answer and misunderstanding before! Hopefully someone can chime in with a proper answer.
... View more
06-25-2013
12:00 PM
|
0
|
0
|
4031
|
|
POST
|
I'm getting the code to work for onMouseDownMap, but while in layout view the value I'm getting back is still in page coordinates and not map coordinates ... unless I go to the data view. Then I get map coordinates. Is this how it's supposed to work, or is there a was to focus the data frame and get map coordinates. class Sel_Property(object):
"""Implementation for Notifications_addin.selectproperty (Tool)"""
def __init__(self):
self.enabled = True
self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" ...
def onMouseDownMap(self, x, y, button, shift):
pythonaddins.MessageBox("Your mouse clicked at " + str(x) + " , " + str(y),"My Coordinates:") David, While this is the reverse of what you want, I think it should be able to give you some ideas. I will need to do the same as you soon, but just havn't had the opportunity to do so just yet. I think you will need get the properties of the DataFrame to convert from page units to preferred projected coordinates. http://gis.stackexchange.com/questions/21514/convert-point-xy-to-page-units-xy-using-arcpy
... View more
06-25-2013
10:00 AM
|
0
|
0
|
1244
|
|
POST
|
I think I have tried everything you suggested. When I use the pop-up tool, I can see the attributes, but the jpg comes up as a window with the name of the jpg file with a small box with an X through it. I went into the HTML popup tab of the properties and checked the download attachment data checkbox (it was unchecked), but nothing changed. Any suggestions? I don't think that is correct. You want to check the box that says "Show feature attachments as links" when configuring the popup. Actually, I don't even see a download attachment data checkbox. fyi: if you are expecting the image to just appear immediately after you click a feature, it won't do what you expect. You will actually have to click the link in the popup and it will open the image in a new browser window. There is no support for attachments as images in the popup itself as far as I can tell.
... View more
06-24-2013
11:17 AM
|
0
|
0
|
4031
|
|
POST
|
James, thanks for the tips. HTML popup works just fine. This would work as a possible workaround, but I am still wondering why the same attachments cannot be seen via Attachment Manager in ArcMap. I forgot to mention in my other post that I am also experiencing the same issue with the identify dialog missing the attachements. Perhaps the identify dialog needs to have the actual FGDB with the attachments enabled (the related table and relationship class) and available? That's the behavior of what is happening anyway, not sure.
... View more
06-24-2013
05:25 AM
|
0
|
0
|
4031
|
|
POST
|
I published a feature class with attachments to ArcGIS online and added attachments (photographs--jpgs about 800 kb each) to a number of feature points. When I add the data to ArcGIS desktop standard (10.1) by dragging the published service into my map from Catalog, and select one of the points, the attachments are listed, but when I try to open them with Attachment Manager, nothing is visible. I also tried opening the online map using ArcGIS desktop from ArcGIS online (selected "Open in ArcGIS 10 for desktop"). Again I can select the same point, but the attachment cannot be viewed. The attachments can be viewed using map viewer in ArcGIS online. Does anyone have any suggestions about what the problem areas might be? Try using the HTML Popup in the standard tools toolbar in ArcMap 10.1 --- this will allow you to see the images if you have properly configured the popup in your AGS service.
... View more
06-24-2013
03:41 AM
|
0
|
0
|
4031
|
|
POST
|
Wow...this is pretty cool. I also vote for Richards answer. ^this x2! Voted -- thanks Richard!
... View more
06-19-2013
07:24 AM
|
0
|
0
|
3549
|
|
POST
|
I was working out the SQL portion and noticed that Caleb has an excellent solution! Thanks -- this is useful. Edit: here's what I was working on. I just incorporated the sql from Caleb's example...
def select_Even():
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name=='thelayernameintheTOC':
even = []
cursor = arcpy.SearchCursor(lyr)
for row in cursor:
if int(row.OBJECTID) % 2 == 0:
even.append(int(row.OBJECTID))
field = "OBJECTID"
even_sql = ' OR '.join('%s = %s' %(field,i) for i in even)
arcpy.SelectLayerByAttribute_management(lyr, 'NEW_SELECTION', even_sql)
else:
arcpy.AddMessage("layer not found")
select_Even()
... View more
06-19-2013
05:57 AM
|
0
|
0
|
3549
|
|
POST
|
Not sure about a full SQL statement (maybe post up what you have so far), but this python function will check if the value you pass in is even or odd...
def EvenOrOdd(val):
x = int(val)
if x % 2 == 0:
return "EVEN"
else:
return "ODD"
msg = EvenOrOdd(6)
print msg
... View more
06-19-2013
05:04 AM
|
0
|
0
|
3549
|
|
POST
|
I made some little changes and it works pretty well!!! Thank you very much. Let's see it then! I like knowing other methods too. j
... View more
06-19-2013
04:01 AM
|
0
|
0
|
2953
|
|
POST
|
Okay --- I tested this and it renames each raster in my raster catalog with a ".tif" extension to ".png"
import arcpy
import os, sys
rascat = r"C:\RasCat_05282013.gdb\May2013"
with arcpy.da.UpdateCursor(rascat, "Name") as updcursor:
for row in updcursor:
curname = row[0]
curname = curname.replace(".tif", ".png")
row[0] = str(curname)
updcursor.updateRow(row)
... View more
06-18-2013
05:38 AM
|
0
|
0
|
2953
|
|
POST
|
Have a look: [ATTACH=CONFIG]25331[/ATTACH] I can see the name in ArcCatalog but i can't find a way to work with it in python. Since the container in the Raster Catalog that maintains the individual rasters is a table, then maybe you can run an UpdateCursor on the table's field that holds the name of the rasters? Not sure and would have to test some things, but this snip lists out the individual raster names in one of my raster catalogs:
rascat = r"C:\RasCat_05282013.gdb\May2013"
with arcpy.da.SearchCursor(rascat, "Name") as cursor:
for row in cursor:
print("{0}".format(row[0]))
... View more
06-18-2013
05:25 AM
|
0
|
0
|
2953
|
|
POST
|
I could be incorrect but I was under the impression that rasters in a Raster Catalog are rows in a table (in a FGDB), stored in the Raster Column. That is, there is no file type like .png, .tif, etc... and searching for such files will turn up nothing because you "load" the cataog with those rasters, but the FGDB does not maintain them as individual .tif/.png files. Edit: if the rasters in the Raster Catalog are not "managed", then the catalog simply maintains links to individual rasters (.tif, .png's) on disk. In this case, you could specify the location/folder on disk, search for and replace the file extensions for each of the rasters. Is this what you need to to do? james
... View more
06-18-2013
04:35 AM
|
0
|
0
|
2953
|
|
POST
|
I found some of the probable offenders and cleaned things up a bit to eliminate the issue.
... View more
06-17-2013
11:19 AM
|
0
|
0
|
1081
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|