|
POST
|
I am trying to publish a GPService from a python script. I am having with the service connecting to SDE. I was having trouble so I added the Test Connection section to see what path was being used. It seems like it is not getting the connection info from the SDE file. The script runs fine in ArcMap and I have the SDE file in the same location on the server as it is my dev machine. Any ideas? "Error executing tool.: C:\arcgisserver\directories\arcgissystem\arcgisinput\GPTools\WildfireUpload.GPServer\extracted\v101\\ArcSDE.dbo.WILDFIREPERIM Table does not exist "
import arcpy, os, zipfile
from arcpy import env
#Setting the env workspace to be an SDE geodatabase
ws = env.workspace = "D:\\agsResources\\DataStoreSDEs\\GIS01(TEST Server).sde"
#Test Connection
if arcpy.Exists(ws + "\\ArcSDE.dbo.WILDFIREPERIM") == False:
arcpy.AddMessage("Table does not exist")
arcpy.AddError(ws + "\\ArcSDE.dbo.WILDFIREPERIM Table does not exist")
else:
arcpy.AddMessage("Table Exists")
infile = arcpy.GetParameterAsText(0)
#startdate = arcpy.GetParameterAsText(1)
outpath, outfileext = os.path.splitext(infile)
filename = outpath.split('\\')[-1]
try:
# unzip file
fireZip = zipfile.ZipFile(infile, 'r')
fireZip.extractall(outpath)
fireZip.close()
#arcpy.SetParameterAsText(1,outpath + "\\" + filename + ".shp")
shpPath = outpath + "\\" + filename + ".shp"
arcpy.AddMessage("Finished unzipping file.")
# Local variables:
WildFire_Table_Target = ws + "\\ArcSDE.dbo.WILDFIREPERIM"
# Create FieldMappings object and load the target dataset
#
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(WildFire_Table_Target)
inputfields = [field.name for field in arcpy.ListFields(shpPath) if not field.required]
for inputfield in inputfields:
# Iterate through each FieldMap in the FieldMappings
#
for i in range(fieldmappings.fieldCount):
fieldmap = fieldmappings.getFieldMap(i)
#arcpy.AddMessage(fieldmap.getInputFieldName(0))
# If the field name from the target dataset matches to a validated input field name
#
if fieldmap.getInputFieldName(0) == inputfield.replace("", ""):
# Add the input field to the FieldMap and replace the old FieldMap with the new
#
fieldmap.addInputField(shpPath, inputfield)
fieldmappings.replaceFieldMap(i, fieldmap)
break
# Process: Append
arcpy.Append_management(shpPath, WildFire_Table_Target, "NO_TEST", fieldmappings)
except Exception as e:
print e.message
arcpy.AddError(e.message)
... View more
06-07-2013
05:45 AM
|
0
|
6
|
5629
|
|
POST
|
I ran into the same issue so I did my best to re-create the animation. I also enhanced my symbols a bit by adding a labels when hovering.
<esri:MarkerSymbol x:Name="CustomStrobeMarkerSymbol">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Canvas>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Selected">
<Storyboard RepeatBehavior="1x">
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="6" Duration="00:00:00.5" />
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="6" Duration="00:00:00.5" />
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)" From="1" To="1" Duration="00:00:01" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unselected" />
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="labelOnHover"
Storyboard.TargetProperty="Visibility"
Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation From="0" To="1" Storyboard.TargetName="labelOnHover"
Storyboard.TargetProperty="Opacity"
Duration="0:0:.25" />
</Storyboard>
</VisualState>
<VisualState x:Name="Normal" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" RenderTransformOrigin="0.5,0.5" x:Name="ellipse" IsHitTestVisible="False">
<Ellipse.RenderTransform>
<ScaleTransform />
</Ellipse.RenderTransform>
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#8DFFFF00" />
<GradientStop Color="#8DFFFF00" Offset=".4" />
<GradientStop Color="#8DFF7600" Offset=".8" />
<GradientStop Color="#00FF7600" Offset="1" />
<!--<GradientStop Color="#00FF0000" Offset="1" />-->
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" Fill="#FFFF0000" x:Name="ellipse1" />
<Grid Margin="8,-8,0,0" x:Name="labelOnHover" Visibility="Collapsed"
HorizontalAlignment="Left" VerticalAlignment="Top" >
<!--Text halo using a white blurred text-->
<TextBlock Foreground="White" FontWeight="Bold" Text="{Binding Attributes[POLICY_NO]}" >
<TextBlock.Effect>
<BlurEffect Radius="5" />
</TextBlock.Effect>
</TextBlock>
<!--Text-->
<TextBlock Foreground="Black" FontWeight="Bold" Text="{Binding Attributes[POLICY_NO]}" />
</Grid>
</Canvas>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
... View more
06-05-2013
11:43 AM
|
0
|
0
|
554
|
|
POST
|
It appears to me that the order is based on the order in which the data for the pop-up is returned. Graphics layers appear to be the fastest and then the dynamic server layers are slower because they are waiting for the identify results to return. Again this is just my observation. If this is the case I am sure a custom pop up behaviour could be developed to accomodate the layer order.
... View more
06-05-2013
11:36 AM
|
0
|
0
|
799
|
|
POST
|
The single quote in your selected value looks supsect to me. I would imagine that the query string looks something like Where CommunityNameForParcel_English = ''Atria'. That would cause and error because the first 2 quotes closed eachother out and the rest of the line is invalid. Id would be very easy to use Fiddler to check the query being sent to see if this is the case.
... View more
06-04-2013
11:28 AM
|
0
|
0
|
1872
|
|
POST
|
I have a tool that if adding dynamic layers with layer definitions. These layers have pop-ups enabled. I have noticed that the pop-up shows info on features that are not on the map. I narrowed it down to the layer definition not be appended to the identify request. I am thinking this may be a bug or something that was overlooked in development. Any workarounds for this without trying to creating a new pop-up behavior?
... View more
06-04-2013
06:53 AM
|
0
|
0
|
772
|
|
POST
|
Thanks for the reply Pieta. Unfortunately your suggestions will not work for me. 1. I already manage many apps and to double the number would be to much upkeep. 2. We use IIS authentication and not passwords. The issue is all users are allowed to see the data but i need to limit the exporting of the data to certain individuals. 3. Export button is already moved. I am trying to find a way that would allow me to put it back in but be dynamic in that the button is active for only certain individuals.
... View more
05-06-2013
10:24 AM
|
0
|
0
|
714
|
|
POST
|
So my company does not want to allow data exports for all users due to the sensitivity of our data. There are certain individuals that can and should have this functionality enabled. I am trying to find a way via custom behavior that will validate the logged in users name and enable/disable the export tool as appropriate. My issue here is that I do not know how to reference the export tools that is comes with the Silverlight Viewer. I have no probelems with custom tools as i can do this in the in canExecute and I am also able to do this with the layout elements. Any ideas how to disable an add-in from another?
... View more
05-02-2013
06:02 AM
|
0
|
2
|
2199
|
|
POST
|
It looks like query layers are not supported by summary statistics in server 10.1. I also have a service based on a view and I notice that the layer has an attribute that is called "Supports Statistics" and is set to False. I have not been successfully in finding much documentation about supported layer types. I only found in the REst Server API that Layers and Tables are supported. I hope that there is either a feasible workaround or this will be enhanced in a future update.
... View more
05-01-2013
12:21 PM
|
0
|
0
|
1419
|
|
POST
|
I am still working on this but so far it looks like we are going to use DFS to sync certain data such ass a resources directory and a web directory. For the GIS services I have decided to publish my services in a different manner. I will be using a script to publish SD files which will publish/update services on both the hot and cold servers. Hope that helps.
... View more
04-30-2013
04:23 AM
|
0
|
0
|
669
|
|
POST
|
I have a few Viewer apps built that are consuming our internal services. These services host our GIS data which is stored in a SDE database in SQL Server. On my feature layers I have popups enabled and i am showing a couple key date/time fields. All of my times on the date are stored a 12:00AM as we needed to store the date with a time in he DB. The issue I am seeing is that the date/time is diplaying correctly in the popup but it the table the time portion is incorrect anywhere from various amounts of time. i though it was a time zone thing at first but noticed that on some points I had two times that were off by different amount. See attached example. Any assistance is appreciated. [ATTACH=CONFIG]22999[/ATTACH]
... View more
03-27-2013
08:50 AM
|
0
|
0
|
3086
|
|
POST
|
Hi Muneer, We still have permormance issues but at this point it is limited to when we are managing the server. Publishing and updating services from ArcMap is very slow. Also connecting to Server Manager is very slow. However, performance is not an issue for us when consuming serivces in our Web Maps or ArcMap. Also browsing the srvices directory is fine. We initially had perfomance issues that was resolved by changing the the domain account used to configure the server security. We initally used an admin's personal account which was a part of many nested groups. Changing this to the domain group used by the server sped things up considerably and is most likely because the number of groups this account is a memeber of is very limited (<5).
... View more
03-07-2013
07:32 AM
|
0
|
0
|
1973
|
|
POST
|
Bleroux�??: You are a big mendacious... You tell tattle... You are not going to help people in this blog, just Pull someone's leg... Otherwise help them. I was Following-up this forum 3 month ago and came to this bad conclusion of your terrible answers!:confused: Please don't clutter a thread with nonsense. I provide help as much as i can. I am not going to just do all the work for someone if they have an issue with something. I belive in working through my own issues in order to gain knowledge that will benefit me for the future. As you can see when this thread was started it was me that needed help. I did the research and was able to work through my issues to come up with a solution. I did not ask for someone to post a working solution that I could just take. Now please do us both a favor and stop following this thread.
... View more
03-07-2013
03:26 AM
|
1
|
0
|
1654
|
|
POST
|
Hi I tested your code, but it return this error: IndentationError: unindent does not match any outer indentation level (import_zip_91.py, line 40) What is appropriate indentation? Please help me more. Is it possible to send me your model or your code? Regards It is pretty simple at this point. You just need to make sure your indentation is correct on those lines that I posted last. Delete the white space before each line so they are not indented and then tab each line over 1 time. The only exception is "except Exception as e:": should not be indented at all.
... View more
02-26-2013
03:23 AM
|
0
|
0
|
2917
|
|
POST
|
I attached pyton script. please help me. The last few statements you have a incorrect. You need to use with the appropriate indentation.
# Process: Append
arcpy.Append_management(shpPath, WildFire_Table_Target, "NO_TEST", fieldmappings)
except Exception as e:
print e.message
arcpy.AddError(e.message)
... View more
02-25-2013
03:33 AM
|
0
|
0
|
2917
|
|
POST
|
You are going to have to post your code to this thread using code blocks. Without that I will not be able to properly view your code with the correct indenting.
... View more
02-22-2013
09:43 AM
|
0
|
0
|
2917
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-21-2026 06:15 AM | |
| 4 | 03-12-2025 11:01 AM | |
| 3 | 01-08-2025 09:26 AM | |
| 1 | 01-08-2025 07:19 AM | |
| 1 | 12-06-2024 04:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|