POST
|
Hi gentleman, I know this thread has been answered, but are you saying that I cannot add a Geoprocessing tool like Extract Data Task to AGOL anduse it as a GP service so that I can configure a flex application widget? I can publish a GP tool as a Tool package but just can't use it. Say it ain't so.:(
... View more
03-19-2014
02:10 PM
|
0
|
0
|
336
|
POST
|
Well Howdy Folks, I think I was trying to do to much. UVRenderer is for multiple attributes in one field or column, if Im not mistaken. I could get things to renderer but not display. So plan B, everybody has to have a plan b. I decided to query by date range from the most recent entry (date) and export out to file geodatabase and then load back into arc map and then use the simple renderer. Works much better and not much of a load from the query. So heres what I did... '/////////////////////////////START OF 30 OR LESS Dim feature10Layer As IFeatureLayer = New FeatureLayerClass feature10Layer.FeatureClass = feature10InspectClass feature10Layer.Name = "Treatments" feature10Layer.Visible = True Dim feature10InspectSelection As IFeatureSelection = TryCast(feature10Layer, IFeatureSelection) ' Dynamic Cast Dim query10Filter As IQueryFilter = New QueryFilterClass ' Dim Day10Filter As String = "WHERE [InspectionDate] in (SELECT max([InspectionDate]) FROM VECTOR.SDE.PolyInspection GROUP BY [SourceSiteID]) AND InspectionDate > Current_TimeStamp -30 and InspectionDate < Current_TimeStamp" Dim feat10Selection As IFeatureSelection = feature30Layer query10Filter.WhereClause = Day10Filter feat10Selection.SelectFeatures(query10Filter, esriSelectionResultEnum.esriSelectionResultNew, False) feat10Selection.SelectionChanged() Dim selection10Set As ISelectionSet = feat10Selection.SelectionSet Dim feat10Cursor As IFeatureCursor = Nothing selection10Set.Search(Nothing, True, feat10Cursor) Dim pIn10Workspace As IFeatureWorkspace pIn10Workspace = workspaceFactory.Open(propertySet, 0) pFeatureClass = pIn10Workspace.OpenFeatureClass("VECTOR.SDE.PolyInspection") pDataSet = pFeatureClass pDatasetName = pDataSet.FullName pathExport = "c:\GISDATA\Inspection" pOutWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory pOutWorkspace = pOutWorkspaceFactory.OpenFromFile(pathExport & "\Inspect.gdb", 0) pOutWorkspaceDataset = pOutWorkspace pOutWorkspaceName = pOutWorkspaceDataset.FullName pOutDatasetName = New FeatureClassName pOutDatasetName.Name = "Under30" pOutDatasetName.WorkspaceName = pOutWorkspaceName Try Dim pFeatWorkSpc As IFeatureWorkspace pFeatWorkSpc = pOutWorkspace Dim pfeatClass As IFeatureClass pfeatClass = pFeatWorkSpc.OpenFeatureClass("Under30") Dim pdaset As IDataset pdaset = pfeatClass pdaset.Delete() Catch exy As Exception ' if it doesnt exist then thats OK End Try 'Dim pExportOperation As IExportOperation pExportOperation = New ExportOperation pExportOperation.ExportFeatureClass(pDatasetName, query10Filter, selection10Set, Nothing, pOutDatasetName, 0) feat10Selection.Clear() pOutWorkspaceName = Nothing featSelection = Nothing pExportOperation = Nothing selectionSet = Nothing pFeatureClass = Nothing pDataSet = Nothing pDatasetName = Nothing '/////////////////////////////////////END OF THIRTY DAY OR LESS '//////////////////START 30 DAY OR LESS ' Use the IFeatureWorkspace interface to open a feature class. Dim featureGDBWorkspace As IFeatureWorkspace = CType(workspaceGDB, IFeatureWorkspace) Dim featureClass As IFeatureClass = featureGDBWorkspace.OpenFeatureClass("Under30") Dim p10Layer As IFeatureLayer = New FeatureLayerClass p10Layer.FeatureClass = featureClass p10Layer.Name = "Under30" p10Layer.Visible = True Dim pSimRend As ISimpleRenderer pSimRend = New SimpleRenderer Dim pGeoLay As IGeoFeatureLayer Dim PFS As ISimpleFillSymbol PFS = New SimpleFillSymbol With PFS .Style = esriSimpleFillStyle.esriSFSHollow Dim pcOL As IColor pcOL = New RgbColor Dim pLineSym As ILineSymbol = .Outline pLineSym.Width = 1.25 pcOL.RGB = RGB(0, 255, 0) pLineSym.Color = pcOL .Outline = pLineSym End With pGeoLay = p10Layer pSimRend.Label = "Under30" pSimRend.Symbol = PFS pGeoLay.Renderer = pSimRend activeView.FocusMap.AddLayer(p10Layer) p10Layer = Nothing pSimRend = Nothing pGeoLay = Nothing '///////////////////END OF 30 DAY OR LESS
... View more
04-23-2013
02:53 PM
|
0
|
0
|
210
|
POST
|
Hi Everyone, So lets say I want to symbolize one field that has date and time and break it down by Current_TimeStamp for > 90 days, 60 - 90 days etc. Then I would like to render each selection with a specific color, red, yellow, green. I can select for data range and set the symbols for each range but only the first draws the color. I pull the feature class from SDE and reference the FC three times for each selection, renderer and Geofeaturelayer. The renderer through a loop selects each date and symbolizes each record for each date range (YUK). I figured if I could set individual renderer's for selection I would be OK. Should I continue down this path? Should I try and export the selection to LYR file and import back into ArcMap for symbolization? A bit of confusion here. Heres my code VS 2010 ArcMAP V 10. Dim featureInspectLayer As IFeatureLayer = New FeatureLayerClass featureInspectLayer.FeatureClass = featureInspectClass featureInspectLayer.Name = "Inspections_>_90_Days" featureInspectLayer.Visible = True ' If activeView Is Nothing OrElse featureInspectLayer Is Nothing OrElse whereClause Is Nothing Then 'Return 'End If Dim featureInspectSelection As IFeatureSelection = TryCast(featureInspectLayer, IFeatureSelection) ' Dynamic Cast ' Set up the query Dim feature As ESRI.ArcGIS.Geodatabase.IFeature Dim queryFilter As IQueryFilter = New QueryFilterClass ' Dim Day90Filter As String = "WHERE [InspectionDate] in (SELECT max([InspectionDate]) FROM VECTOR.SDE.PolyInspection GROUP BY [SourceSiteID]) AND InspectionDate <= Current_TimeStamp - 90" queryFilter.WhereClause = Day90Filter Dim featSelection As IFeatureSelection = featureInspectLayer featSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, False) featSelection.SelectionChanged() Dim selectionSet As ISelectionSet = featSelection.SelectionSet Dim featCursor As IFeatureCursor = Nothing selectionSet.Search(Nothing, True, featCursor) Dim NineDay As IRgbColor NineDay = New RgbColor NineDay.Red = 255 NineDay.Green = 0 NineDay.Blue = 0 Dim symd As New SimpleFillSymbol symd.Style = esriSimpleFillStyle.esriSFSSolid symd.Outline.Width = 6 Dim uvRenderer As IUniqueValueRenderer = New UniqueValueRenderer uvRenderer.FieldCount = 1 uvRenderer.Field(0) = "InspectionDate" uvRenderer.DefaultSymbol = symd uvRenderer.UseDefaultSymbol = True Dim sym As ISimpleFillSymbol = Nothing feature = featCursor.NextFeature Do Until feature Is Nothing sym = New SimpleFillSymbol sym.Style = esriSimpleFillStyle.esriSFSSolid sym.Outline.Width = 6 sym.Outline.Color = NineDay sym.Color = NineDay uvRenderer.AddValue(feature.Value(feature.Fields.FindField("InspectionDate")), "", sym) feature = featCursor.NextFeature() Loop ' adds Inspection Feature layer activeView.FocusMap.AddLayer(featureInspectLayer) activeView.Extent = activeView.FullExtent activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing) mapDoc.ActiveView.ContentsChanged() featSelection.SelectionChanged() pMxDoc.UpdateContents() Dim geofeatureInspectLayer As IGeoFeatureLayer = featureInspectLayer geofeatureInspectLayer.Renderer = uvRenderer Thanks Folks
... View more
04-17-2013
03:29 PM
|
0
|
1
|
637
|
POST
|
Be new to VB.Net and Visual Studio, I remember when everything was esri.core and alot of the commands seemed much simpler. I am intrigued by your where clause in a string.format function, I will have to look at that later. Just trying to get up to speed after a bit of a layoff. Trying to figure out what SQL wants, what the VS will give you and the settings on the development box can be a little confusing especially when it comes to dates. Thanks again Mr. Gray
... View more
03-06-2013
05:24 AM
|
0
|
0
|
507
|
POST
|
This is classic vb string building. Your messagebox looks right because it concatenates the variables together. Does this work, add "'" (quote, single quote, quote) around your variables. Maybe it's + instead of &, been a long time since I VB'd anything. whereClause = "InspectionDate >= " & "'" & fromDate & "'" & " And InspectionDate <= " & "'" & toDate & "'" That does work. All I was missing was the (quote, single quote, quote) , this is what I tried before your response. 'whereClause = "InspectionDate > " & fromDate & " " & "00:00:00" & " " & "AND" & " " & "InspectionDate < " & toDate & " " & "00:00:00" & " " '" & "AND" & " " & "FieldTechnician" = "Tech" 'whereClause = "InspectionDate > '2012-09-04 07:50:41' AND InspectionDate < '2012-10-04 07:44:04'" ' 'whereClause = "InspectionDate > " & fromDate & " " & " AND " & " " & "InspectionDate < " & toDate 'whereClause = "InspectionDate > " & fromDate & " " & "and" & " " & "InspectionDate < " & toDate & "" whereClause = "InspectionDate >= " & "'" & fromDate & "'" & " And InspectionDate <= " & "'" & toDate & "'" 'whereClause = "InspectionDate < '2012-09-04 07:50:41'" 'whereClause = "InspectionDate > #" & fromDate & "# AND InspectionDate < #" & toDate & "#" ' whereClause = "InspectionDate BETWEEN " & fromDate & " And " & toDate & "" 'whereClause = "InspectionDate > " & fromDate & "00:00:00" " " & "AND" & " " & "InspectionDate < " & toDate & 18:00:00"" '" & "AND" & " " & "FieldTechnician" = "Tech""" The flat spot is starting to disappear. Thanks Much lesson learned.
... View more
03-05-2013
11:13 AM
|
0
|
0
|
507
|
POST
|
I think I got it. I set the variable to fromDate = frmTech1.FromDatePicker.Value.Date and fromDate is dimmed as Date. I perform the selection where clause as whereClause = "InspectionDate > " & fromDate & "" and it selected the values, all I need to do now is put multiple selections together. I previously just set the variable as value and nor as value.date. Im at a standstill here trying to figure out the whereclause. I have two variables toDate and fromDate both strings equal to frmtech1.toDatePicker.Value and frmTech1.fromDatePicker.value. My selection where clause is whereclause = "InspectionDate >= " & fromDate this works. If I try to append to the where clause like this whereClause = "InspectionDate >= " & fromDate & " And InspectionDate <= " & toDate it doesn't work. I put into MsgBox and got this "InspectionDate >= 2/11/2013 And InspectionDate <= 2/22/2013" looks good to me but doesn't work. I took it apart and tried just less than, whereclause = "InspectionDate <= & fromDate it doesn't work. Which leads me to believe its a problem with the < or <=. I checked the format of the datepicker and both are formatted the same. Sql server values from the select by attributes box is "InspectionDate < '2012-09-04 07:50:41'" this works and it also works if I choose to use just the date in the same format as the string variable 2/05/2013 without the time. I am befuddled here, I have a flat spot on my head where I have been beating it. Visual Studio 2008 Any help would be greatly appreciated.
... View more
03-05-2013
09:23 AM
|
0
|
0
|
1719
|
POST
|
I don't think that would work... I would think either you will get a type mismatch or the string returned by to the date picker will be whatever your locale is set which may or may not be wrong. There are two issues here, the conversion of the .net datetime type to string and the conversion from string to the sql server datetime (or date, datetime2) format in sql server. The .net tostring function is compiled when the .net code is compiled and executed on the local client at run time. The where clause is then passed as a string to a sql server database (local or on a server) which interprets and executes the sql where clause. In order to go from one the the other, you need a string in between to pass (whereclause.) The format of the string sql server needs will dictate what format the string you need to make from the .net datetime tostring function. Do you know the format the sql server needs to take in? Can you use a t-sql convert function in the where clause specifying the type of string (sql server's way of specifying the format)? I think I got it. I set the variable to fromDate = frmTech1.FromDatePicker.Value.Date and fromDate is dimmed as Date. I perform the selection where clause as whereClause = "InspectionDate > " & fromDate & "" and it selected the values, all I need to do now is put multiple selections together. I previously just set the variable as value and nor as value.date.
... View more
03-04-2013
10:02 AM
|
0
|
0
|
1719
|
POST
|
The only reason was to be in the same format as the date field. yyyy-MM-dd, hey, if I don't have to convert it to string and back to a date field great. I was using toDate = frmTech1.ToDatePicker.Value.ToString("yyyy-MM-dd"). So i shouldn't mess with format and leave it alone and sql server will format it correctly, is that what your saying? So it should be toDate = frmTech1.ToDatePicker.value and the where clause would be what exactly?
... View more
03-04-2013
09:04 AM
|
0
|
0
|
1719
|
POST
|
Sorry I didn't post that I was using VB.Net. Seems like every thing I'v read wants to convert the date to a string, and then when I convert back to date it takes the machine setting. So, when I do a custom format for datetimepicker as yyyy-MM-dd it shows in the form window as 2013-02-15 which is the date that I want to use for the whereclause. I have converted to string, parsed string for each value (year,day,month) and then converted back to date, but it shows as 2/15/2013 arrgg. I tried your link and have read it many times (hunting for cure) but it deals with strings. Must be missing something here. I am new to .net, old vba guy. I have tried globalization and the culture thing, but still no,luck. Can I still query sqlserver date field which is formatted like this yyyy-MM-dd hh:mm:ss. with a date like this mm/dd/yyyy? I could manually select with the values with just the date and not the hms, so I will have to reduce the humongous where clause, never really got there yet because of the date thing. Sorry for the rambling. Any help is greatly appreciated.
... View more
03-01-2013
02:35 PM
|
0
|
0
|
1719
|
POST
|
I have a form that has two datetimepicker's (From and To) I am trying to select dates from date time field. If I manually select dates with whereClause = "InspectionDate > '2012-09-04 07:50:41' AND InspectionDate < '2012-10-04 07:44:04'" it will work. If I pass the value from the date time picker it wants to reformat the date. I have tried to re-format the date with Dim tDate As String = frmTech1.ToDatePicker.Value.ToString("yyyy-MM-dd") which works but I cannot query table with a string. My where clause looks like this whereClause = "InspectionDate > " & vFrom & " " & "00:00:00" '& " " & "AND" & " " & "InspectionDate < " & vTo & " " & "00:00:00" & " " & "AND" & " " & "FieldTechnician" = "Tech" . How do I convert this string format (yyyy-MM-dd) back to a date? Cary Roberts , GISP CVMVCD
... View more
02-28-2013
08:25 AM
|
0
|
12
|
10426
|
POST
|
I have a model that exports service requests to a directory folder table (info table) by technician names. I should probably export it to a shapefile, but anyway whether it is a .DBF or INFO table how can I import or LOAD the file into route tool? My scenario is have a person grab the file each morning and LOAD into router to find the routes. I do not have Network Analyst extension. Any takers? Thanks Cary
... View more
12-07-2012
09:46 AM
|
0
|
1
|
417
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|