POST
|
I was getting the 000211 Cannot create route event source error in ArcGIS Pro 2.9.3 and a coworker in ArcGIS 2.8.3. Cause: table contained multiple begin milepost and end milepost attributes with the same alias (e.g. BMP with alias BMP, BMP_1 with alias BMP, and EMP with alias EMP, EMP_1 with alias EMP). Note: I had coped SQL results into Excel (which had many columns named BMP and EMP), and then in Pro I copied the Excel table to my file geodatabase to create ObjectID values. The duplicate attributes were given _1 at the end, but the aliases remained the same as the original Excel column names. Solution: Once I deleted the attributes with the same aliases, the Make Route Event Layer tool worked! (I tried renaming the aliases so that they would be unique, but Pro didn't recognize the changes in the tool).
... View more
06-30-2022
10:55 AM
|
0
|
0
|
1676
|
POST
|
Thank you, Josh, Kara, and RViruet, I was able to get this to work, using SQL date function: params = {'where': 'EXTRACT(YEAR from CollisionDate) >= "2017"',
... View more
06-23-2022
03:16 PM
|
0
|
0
|
533
|
POST
|
I successfully used Python 3 to download data from a REST URL using the information from this link How To: Extract data from a map service using Python (esri.com). I need help setting up my where clause when using a Date field. Here is what worked when I used a non date field in my where clause: params = {'where': 'RoadNumber < "00200"', 'geometryType': 'esriGeometryEnvelope', 'spatialRel': 'esriSpatialRelIntersects', 'relationParam': '', 'outFields': '*', 'returnGeometry': 'true', 'geometryPrecision':'', 'outSR': '', 'returnIdsOnly': 'false', 'returnCountOnly': 'false', 'orderByFields': '', 'groupByFieldsForStatistics': '', 'returnZ': 'false', 'returnM': 'false', 'returnDistinctValues': 'false', 'f': 'pjson', 'token': token } These don't work in my where clause for a date: # Find today's date and calculate last 5 years today = date.today() thisyear = today.year last5years = thisyear - 5 last5yeardate_string = str(last5years) + "-01-01 + 00:00:00" params = {'where': 'CollisionDate >= last5yeardate_string', params = {'where': 'CollisionDate >= (datetime.datetime.now() - dateutil.relativedelta(years=5))',
... View more
06-23-2022
09:30 AM
|
0
|
4
|
594
|
POST
|
The Arcade expression below works in ArcGIS Online. How do I get the Arcade expression to work in ArcGIS Pro before publishing my map service map to be used in ArcGIS API for JavaScript? I get an error saying "Invalid expression. Error on line 2. Object not found $map)." I also tried $datastore instead of $map. When I use $datastore, do I need to list the entire path to the feature class? I am trying to find the max RatingDate for each RoadID, so the symbology displays the PSC for the most current rating date. var currentFeatureRoadID = $feature.RoadID var featuresSurfCond = FeatureSetByName($map,'Surface Condition', ['RoadID', 'RatingDate', 'PSC'], true); var featuresSurfCondFilter = Filter(featuresSurfCond, 'RoadID = @currentFeatureRoadID') var maxRatingDate = max(featuresSurfCondFilter, 'RatingDate') if ($feature.RatingDate == maxRatingDate) { return $feature.PSC }
... View more
12-20-2021
01:43 PM
|
0
|
1
|
2534
|
POST
|
I am using the identifyTask to find information on the features in my map services, and I am using the popupTemplate to view information on my GraphicsLayer. To create the GraphicsLayer, I read a table with x,y coordinates and plot the points. I want the popupTemplate to display without the identifyTask results overwriting it. How do I check whether the popupTemplate is open for a feature of the GraphicsLayer so that I can disable the identifyTask? Note: I have an action I want the user to be able to execute in the popupTemplate for my GraphicsLayer feature.
... View more
06-28-2021
03:19 PM
|
0
|
2
|
681
|
IDEA
|
When selecting by attribute in the attribute table, ArcMap would keep the query while the table was still open. ArcGIS Pro removes the query every time I close out of the query window to view the results. Please retain the query until closing the attribute table in ArcGIS Pro.
... View more
05-25-2021
11:33 AM
|
0
|
0
|
3682
|
POST
|
Thanks Manish, Here is my code implementing your solution. Note I formatted the date using getMonth() + 1, getDate() + 1, and getFullYear(): var tplRoadRestriction = {
// autocasts as new PopupTemplate()
title: "Road Name: {RoadName}",
outFields: ["*"],
content: myContent,
fieldInfos: [{
fieldName: "RoadNumber",
label: "Road Number"
}, {
fieldName: "FromDesc",
label: "From Desc:"
}, {
fieldName: "ToDesc",
label: "To Desc:"
}, {
fieldName: "FromMP",
label: "From Milepost:",
format: {
digitSeparator: true,
places: 2
}
}, {
fieldName: "ToMP",
label: "To Milepost:",
format: {
digitSeparator: true,
places: 2
}
}, {
fieldName: "District",
label: "District:"
}, {
fieldName: "DateOn",
label: "Date On:"
}, {
fieldName: "DateOff",
label: "Date Off:"
}, {
fieldName: "Restriction",
label: "Restriction:"
}]
};
function myContent(feature) {
var div = document.createElement("div");
var myDateOn = new Date(feature.graphic.attributes.DateOn);
var myDateOnFormat = (myDateOn.getMonth() + 1) + '/' + (parseInt(myDateOn.getDate() + 1)) + '/' + myDateOn.getFullYear();
var myDateOff = new Date(feature.graphic.attributes.DateOff);
// if NULL date, set to spaces
if (myDateOff.getFullYear() < 1970) {
var myDateOffFormat = "";
}
else {
myDateOffFormat = (myDateOff.getMonth() + 1) + '/' + (parseInt(myDateOff.getDate()) + 1) + '/' + myDateOff.getFullYear();
}
div.innerHTML =
"<br/><b>Road Number:</b> " + feature.graphic.attributes.RoadNumber +
"<br/><b>From Desc:</b> " + feature.graphic.attributes.FromDesc +
"<br/><b>To Desc:</b> " + feature.graphic.attributes.ToDesc +
"<br/><b>From Milepost:</b> " + feature.graphic.attributes.FromMP +
"<br/><b>To Milepost:</b> " + feature.graphic.attributes.ToMP +
"<br/><b>District:</b> " + feature.graphic.attributes.District +
"<br/><b>Date On:</b> " + myDateOnFormat +
"<br/><b>Date Off:</b> " + myDateOffFormat +
"<br/><b>Restriction:</b> " + feature.graphic.attributes.Restriction
;
return div;
} tplRoadRestriction using the code above: tplRoadRestriction using only the new Date(). Note how the Date On date is one day off, and the Date Off is NULL but shows as year 1899.
... View more
02-19-2021
11:56 AM
|
0
|
1
|
2139
|
POST
|
I am using ArcGIS API for JavaScript 4.13 and I cannot get the date formatted in my PopupTemplate. Attached are screenshots of what the popups look like when using date format and without. Here is the code: var tplRoadRestriction = {
// autocasts as new PopupTemplate()
title: "Road Name: {RoadName}",
content:
"<br/><b>Road Number:</b> {RoadNumber}" +
"<br/><b>From Desc:</b> {FromDesc}" +
"<br/><b>To Desc:</b> {ToDesc}" +
"<br/><b>From Milepost:</b> {FromMP}" +
"<br/><b>To Milepost:</b> {ToMP}" +
"<br/><b>District:</b> {District}" +
"<br/><b>Date On:</b> {DateOn}" +
"<br/><b>Date Off:</b> {DateOff}" +
"<br/><b>Restriction:</b> {Restriction}",
autoCloseEnabled: true
}; var tplRoadRestriction = new PopupTemplate({
// autocasts as new PopupTemplate()
title: "Road Name: {RoadName}",
outFields: ["*"],
content: [{
// It is also possible to set the fieldInfos outside of the content
// directly in the popupTemplate. If no fieldInfos is specifically set
// in the content, it defaults to whatever may be set within the popupTemplate.
type: "fields",
fieldInfos: [{
fieldName: "RoadNumber",
label: "Road Number"
}, {
fieldName: "FromDesc",
label: "From Desc:"
}, {
fieldName: "ToDesc",
label: "To Desc:"
}, {
fieldName: "FromMP",
label: "From Milepost:"
}, {
fieldName: "ToMP",
label: "To Milepost:"
}, {
fieldName: "District",
label: "District:"
}, {
fieldName: "DateOn",
label: "Date On:",
format: {
dateFormat: 'shortDateShortTime'
}
}, {
fieldName: "DateOff",
label: "Date Off:",
format: {
dateFormat: 'shortDateShortTime'
}
}, {
fieldName: "Restriction",
label: "Restriction:"
}]
}]
});
... View more
02-18-2021
03:38 PM
|
0
|
3
|
2198
|
POST
|
Never mind. I had a brain freeze. Here is what can clear the graphics when the popup is closed: watchUtils.whenFalse(view.popup, "visible", function () { view.graphics.removeAll(); });
... View more
07-24-2020
09:59 AM
|
0
|
0
|
416
|
POST
|
How do I clear graphics when I close my popup template from a queryTask result? I would expect the symbol to be associated with the "parcelResults" because that is where I set the symbol, but it didn't show in the map until I used the map.add(graphicsLayerParcel). function doQueryParcel(paramParcelID) { // Clear the results from a previous query graphicsLayerParcel.removeAll(); paramsQuery.where = "PID_NUM = '" + paramParcelID + "'"; // executes the query and calls getResultsParcel() once the promise is resolved // promiseRejected() is called if the promise is rejected qTaskParcel.execute(paramsQuery) .then(getResultsParcel) .catch(promiseRejected); } // end function doQueryParcel() function getResultsParcel(response) { map.add(response); // Loop through each of the results and assign a symbol and PopupTemplate // to each so they may be visualized on the map var parcelResults = response.features.map(function (feature) { //var parcelResults = arrayUtils.map(response.features, function (feature) { // Sets the symbol of each resulting feature feature.symbol = fillSymbolSingleParcel; feature.popupTemplate = tplParcel; return feature; }); graphicsLayerParcel.addMany(parcelResults); map.add(graphicsLayerParcel ); var parcelExtent = response.features[0].geometry.extent.clone().expand(2); // animate to the results after they are added to the map view.goTo(parcelExtent).then(function () { view.popup.open({ features: parcelResults, featureMenuOpen: true, updateLocationEnabled: true }); }); } // end function getResultsParcel()
... View more
07-22-2020
03:00 PM
|
0
|
1
|
452
|
POST
|
When a user changes a label dynamically, the Legend item for that layer disappears from the Legend and an error saying "unable to load /proxy/?<my map service URL>/legend status: 404" appears in the Console (when looking at the F12 Developer Tools pane). Here is my code snippet. What could be causing the legend error? code: labelClass = new LabelClass({ labelExpression: newLabel, /* such as [OwnerName] */ labelPlacement: lPlacement, /* such as 'always-horizontal' for polygon */ symbol: new TextSymbol() }); var drawingOptions = new LayerDrawingOptions(); drawingOptions.labelingInfo = [labelClass]; drawingOptions.showLabels = true; var options = []; options[lId] = drawingOptions; /* lId = the layer index */ myDynamicLayer.setLayerDrawingOptions(options); myDynamicLayer.setVisibleLayers(getVisibleLayers()); function getVisibleLayers() { visiblePoints = []; /* this function finds all the layers that are checked in the layer list and returns an array of layer indexes */ return visiblePoints; } Here are the values of the "options" when using the .setLayerDrawingOptions
... View more
07-12-2019
03:40 PM
|
0
|
1
|
390
|
POST
|
I recently upgraded to ArcGIS Desktop 10.7 and saved an MXD in version 10.7 that contains a join between a GIS layer (on SDE) and a view (on a SQL Server database). When publishing the 10.7 MXD version as a map service, the join to the view gets dropped. The work-around for now is to save the MXD as version 10.3 and publish the map service. Question: Is there another solution?
... View more
07-10-2019
10:21 AM
|
0
|
0
|
288
|
POST
|
Did you Enable Editing on your feature layer? Did you Share your feature layer in ArcGIS Online?
... View more
05-28-2019
12:59 PM
|
0
|
0
|
1549
|
POST
|
We use the measure tool to show intermediate segment values and then the total value. Has the setting of the single mouse click and the double mouse click changed? Has the setting of the mouse-move changed? The mouse events seem to be affected by the GeometryService changes or arcgisonline change that occurred last week. For example, when using our internal Geometry Service, or this URL: utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer, or this URL: tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer our code keeps returning values as though the mouse is still moving after double-clicking on the map to end the polyline measurement. For example, each mouse click adds "Segment". Each mouse-move displays both "Total Length" and "Current Length". A double-mouse click removes the "Total Length" and "Current Length" and then adds the final "Total Length". However, the problem is that after the double-mouse click, the first "Total Length" and "Current Length" stay and the two numbers keep changing randomly even though the mouse isn't moving. After a while (3 to 15 seconds), the random numbers stop. When using the URL tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer, The problem appears to start after the following lines of code are executed: map.graphics.clear(); undoManager.clearRedo(); undoManager.clearUndo(); When using the other two URLs, the problem may occur right away or after clearing the all the graphics. Note: I cleared my browser cache between tests. If I don't clear the cache, then once the problem starts it persists. A secondary problem: The double-mouse click registers as a single-mouse click, and adds an extra "Segment" line as show above. In the example above, I double-clicked on the map to end the line at Segment 3, but Segment 4 was added with a slightly higher length than segment 3. This code has been working for a long time, and is still using API version 3.16. Is this version still being supported, or has something changed?
... View more
03-27-2019
12:08 PM
|
0
|
1
|
337
|
Title | Kudos | Posted |
---|---|---|
1 | 01-27-2017 12:36 PM | |
1 | 03-11-2015 12:17 PM |
Online Status |
Offline
|
Date Last Visited |
06-30-2022
10:55 AM
|