|
POST
|
Toolbar/ToolbarItem have been from 3.0 after being depreciated at 2.3. So you will need to refactor your application to not use these objects in order to upgrade to 3.0 http://resources.arcgis.com/en/help/silverlight-api/concepts/index.html#//0166000000m9000000
... View more
07-05-2012
08:44 PM
|
0
|
0
|
498
|
|
POST
|
Joe, Thanks for the additional information. I decided to stick to the current thread only.So, I fired my all queries one after another.That's heavy operation but it worked. Sanjay, Glad it worked for you. It really is not a heavy operation because the Silverlight client application is not doing any of the work. Take a look at http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx. The ExecuteAsynch methods on a Task are basically wrappers for the WebClient::OpenReadAsych method that build the Url/Query String from the parameters provided. So all that happens on the Silverlight side is the sending of a message to the server. All the processing is done by the ArcGIS Server process (a SOC process running on the server) and the Silverlight application just waits around for the results to be sent back. -Joe
... View more
07-05-2012
05:26 AM
|
0
|
0
|
607
|
|
POST
|
if ( graphic.Geometry is Polygon ) { ..... } Joe, how to get coordinates for each side of polygon? I am drawing only a polygon. I want to get all coordinates of polygon. private void ShowPolyCoords(Graphic graphic) { var polygon = graphic.Geometry as Polygon; if ( polygon == null ) return; PointCollection points = polygon.Rings[0]; foreach (var point in points) { Debug.WriteLine("X: {0}, Y: {1}", point.X, point.Y); } }
... View more
07-04-2012
11:03 PM
|
1
|
0
|
1341
|
|
POST
|
A Graphic object has a Geometry property so what is described above is something like
if ( graphic.Geometry is Polygon )
{
.....
}
... View more
07-04-2012
09:15 AM
|
0
|
0
|
1341
|
|
POST
|
Kim, I appreciate the time you took setting t on my his up. I kind of jump between trying to run on the server and working desktop. I think I may try to reinstall python on my desktop and see what that does. I basically cannot seem to create a SearchCursor in any way, even just in the py window with an existing table. I have a related question. I think there is something I am just not grasping here. I do have the script successfully creating the path output table as a geoprocessing service. I did finally realize that my output variable should be index 3, as you note in your comments (was thinking output started at 0) So I have the table in my scratch workspace and I want to to just send that table back to the caller of the service as a result how does one go about doing that. I have tried different ways of defining the output parameter and calling both SetParameter or SetParamaterAsText. Always get that "Object error in setting parameter....'. I know there is something really fundamental I am just not getting my head around, could you possibly point me in the right direction? Cheers -Joe
... View more
07-04-2012
03:36 AM
|
0
|
0
|
1754
|
|
POST
|
Have you analyzed he upload speeds of your connection?
... View more
07-03-2012
09:16 PM
|
0
|
0
|
1216
|
|
POST
|
I am suspicious of your query to open the cursor. Is ObjectID a string? If not it needs to be cast to a string. What happens if the result is no records? Add some print statements to print out what is returned. I have never used the row variable in a cursor, always row.attribute, what does row return? Update and Insert cursors work differently and since you haven't added a new row it probably just does nothing. You also need to close the cursor but I suppose that you are relying on the local variables in the function. I would still explicitly 'del cursor' You may have more success by rearranging your whole script. I would avoid opening and reopening a cursor just to get one record. Maybe get all the values in one pass and put into a python dictionary? That would be much faster. Kimo, Thanks for the reply, perhaps my initial post was not clear this line throws the error ( global name 'gp_' in not defined) .
cursor = arcpy.SearchCursor(table, where)
It throws the error if the where clause is not in there and if I just pass the table in (but yes objectId is a string). The table is created in the exportCatalog method so perhaps it has something to do with trying to query a table that was just created. I cannot put in statements to see what is returned because it blows up on that call The purpose of the script is to retrieve only the one value (at this point), so it is not running multiple times to retrieve multiple values. I am quite inexperienced with python and geoprocessing so I am sure I am not doing this in the most efficient manner but right now I am just trying to get what seems a pretty straightforward script to work as a geopocessing task Cheers -Joe
... View more
07-03-2012
07:51 PM
|
0
|
0
|
1754
|
|
POST
|
Hi Joe, 1. I've decided to give up on preserving the last tool meanwhile so, at the moment, I don't need the QueryComplete event at the end. I do need to check, whether the Url of the active layer is equal to X or equal to None and if the answer is yes, do not execute the spatialQueryAction. Is that possible without writing my own spatialQuery? 2. Please send me the sample of a FeatureDataGrid and FeatureDataForm integrated into a DraggableWindow. I hope I don't nagg too much... So many thanks, Miri The RelatedEdt zip is an example of an app that has a DataGrid and DataForm working together and hosted in a DraggableWindow. There has been something wrong with ESRI's sample server for the last day so I have not finished a couple tiny spots. This was actually written to edit records in a related table. The user clicks on a point and if it has related data in the table the DataGrid is loaded. When a record in the Grid is selected the form is loaded so the record can be edited. There is an Add button to add a new record in the related table. I think it should be relatively straight forward to change to just edit the features not related records I also attached a custom DraggableWindow that does a minimize to just the title bar. It has a lot of stuff in there that is there as part of the application framework I have developed, so it won't work as is but maybe give some ideas of how to go about it. I also added some gee-wiz animation to the close. There is also something you may find interesting in that it can flip from LeftToRight to RightToLeft dynammically Hope that helps
... View more
07-03-2012
06:33 AM
|
0
|
0
|
811
|
|
POST
|
Apologizes for not posting a more complete code sample initially
import arcinfo
import arcpy
import sys
def main():
global mosaicDb
global pathtable
pathtable = '%SCRATCHWORKSPACE%/Scratch.gdb/Paths'
mosaicDb = '//sdm7/arcgis/Mosaics/imagery_datasets.gdb/'
inputmosaic = arcpy.GetParameterAsText(0)
objectid = arcpy.GetParameterAsText(1)
arcpy.AddMessage('Input Mosaic Dataset: ' + mosaicDb + inputmosaic)
arcpy.AddMessage('Search SourceObjectID: ' + objectid)
deletePathDb()
exportCatalog(inputmosaic)
fs = getMosaicRow(objectid, pathtable)
arcpy.SetParameter(0, fs)
def deletePathDb():
try:
arcpy.Delete_management(pathtable)
arcpy.AddMessage('table deleted successfully')
except:
#catch because will throw error if table not there
arcpy.AddMessage('Error attempting delete path table')
arcpy.AddMessage(arcpy.GetMessages())
def exportCatalog(name):
try:
fullname = '//sdm7/arcgis/Mosaics/imagery_datasets.gdb/' + name
arcpy.ExportRasterCatalogPaths_management(fullname, "ALL", pathtable)
except Exception as e:
arcpy.AddMessage("Error export catalog")
arcpy.AddMessage(arcpy.GetMessages())
def getMosaicRow(objectId, table):
where = 'SourceOID = ' + objectId
#this is line that explodes
cursor = arcpy.SearchCursor(table, where)
fs = None
for row in cursor:
fs = row
return fs
As I mentioned above, if I replace SearchCursor with UpdateCursor or InsertCursor it works without error, which is the thing that has my head spinning the most. I have certainly not consciously modified any of the core . I am using 10.0 with Python26 Thanks for you help
... View more
07-03-2012
12:32 AM
|
0
|
0
|
1754
|
|
POST
|
Anyone have any ideas about this? I basically cannot use a SearchCursor in any script, the same error occurs (as expected) in the Python window. Why would this only occur on a SearchCursor when everything else is working without issue.
... View more
07-02-2012
09:31 PM
|
0
|
0
|
1754
|
|
POST
|
Sanjay, While it is certainly possible to run the queries on multiple threads as andrew points out these are asynchronous operations so you will not achieve any performance improvements by doing so. As soon as one query launches the next will launch immediately and they will all be running on the server in a multi-threaded fashion, which is where the processing occurs. Just create an individual method for each query with its own QueryTask object and call each method in sequence, it will be a lot simpler and will perform identical to running each on its own thread. Good luck
... View more
07-02-2012
09:12 PM
|
0
|
0
|
607
|
|
POST
|
You just need top cast your geometry to a MapPoint which has the X, Y coordinates. Make sure you are in WGS 84 projection, if you are using Bing or AGS Online you will be in WebMercator. Look in the projection namespace for the classes that will project from one to the other. Also X is Longitude and Y is Latitude. In this part of the world X of mid 50's, Y of mid 20's is what you should expect. Apologizes if the VB is not correct, it has been a long time and this is done in a text editor, but I believe something like this Private Sub MyDrawObject_DrawComplete(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.DrawEventArgs) Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer) Dim graphic As New ESRI.ArcGIS.Client.Graphic() With { .Geometry = args.Geometry, .Symbol = _activeSymbol } graphicsLayer.Graphics.Add(graphic) Dim mapPoint As MapPoint = TryCast(args.Geometry, MapPoint) If mapPoint Is Not Nothing Then ''Write out the points, make sure to convert to WGS 84 if in Web Mercator End If End Sub
... View more
07-02-2012
07:54 PM
|
0
|
0
|
517
|
|
POST
|
Seems I was using the Silverlight 4 version of the Blend System.Windows.Interactions assembly. Doh :eek:
... View more
07-01-2012
11:08 PM
|
0
|
0
|
432
|
|
POST
|
Hi, I am trying to create a SearchCursor on a table which seems simple enough cursor = arcpy.SearchCursor(tablepath) This line of code though throws an error in _base.py: global name 'gp_' in not defined. I cannot seem to find any information on this error. I can create an UpdateCursor and an InsertCursor without error using the same tablepath variable. Is there something I am missing in this method call? I am using ArcGIS 10.0 Thanks -Joe
... View more
07-01-2012
02:20 AM
|
0
|
10
|
2326
|
|
POST
|
Hi Joe, 1. Now it is finally works. I wasn't aware of all these DataContext issues....I'm studing and programming at the same time so I miss things. I haven't tried the symbol yet but I'm sure it will work. Thanks a lot! Personally for me, understanding how DataContext works took a bit, it does open up a lot more in Silverlight once it makes sense 2. So sweet of you to write this code on action completion. The thing is that if there is so much code for it, I don't see the advantage of using it instead of QueryTask. Can you see any advantage? THe advantage and the nice thing about TriggerActions is it is a good way to separate business logic away from the UserControl code behind, really a design decision more than anything else 3. How do you know what is: Toda Raba? Falls in the things we learned before we were 13 category I guess.;). I spent one summer in your home back during high school and hope to visit again soon because I am working in the region right now 4. Do you have a tip/sample for wrapping DataGrid (or featureDataGrid) in a draggable/floatingWindow with close button? I saw some threads about it in the forum but couldn't find someting that attracted me. What I do is create a control that inherits from the DraggableWindow in the Template project and use that to implement that behavior. I find it a lot cleaner than trying to put everything in the MainPage. I actually have a sample of a FeatureDataGrid and FeatureDataForm integrated into a DraggableWindow I can post an example later Good Luck
... View more
06-30-2012
10:47 PM
|
0
|
0
|
811
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM | |
| 1 | 03-18-2025 12:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-04-2025
04:12 PM
|