|
POST
|
Thank very you Anne, i did it. Merry Christmas and happy new Year.
... View more
12-24-2019
03:04 AM
|
1
|
0
|
1770
|
|
POST
|
Dear Anne, thank you, i use hitTest, but i wany to select multiple features on click. I saw o need clone, but i could not success do it.
... View more
12-23-2019
10:08 AM
|
0
|
2
|
1770
|
|
POST
|
Hi Guys, i have Polygon Feature class. I want to make selection for multiple feature ( i use "hitTest", but code i have does not work. I took code from here jsapi 4.0 popup: set highlight graphic on feature layer click? . I use simpleLineSymbol for graphicsLayer. Help me please. And if you can tell me how to unselect feature i do not need after selection. Here is my code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>GWP - მილი და სამისამართო ერთეული</title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } #info { background-color: black; opacity: 0.75; color: orange; font-size: 18pt; padding: 8px; visibility: hidden; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.13/esri/css/main.css"> <script src="https://js.arcgis.com/4.13"></script> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/renderers/UniqueValueRenderer", "esri/symbols/SimpleLineSymbol", "dojo/dom", "dojo/domReady!" ], function( Map, MapView, FeatureLayer, UniqueValueRenderer, SimpleLineSymbol, dom ) { const labelClass = { // autocasts as new LabelClass() symbol: { type: "text", // autocasts as new TextSymbol() color: "black", haloColor: "black", font: { // autocast as new Font() family: "Playfair Display", size: 12, weight: "bold" } }, labelPlacement: "always-horizontal", labelExpressionInfo: { expression: "$feature.g_dasaxeleba_ka" } }; var renderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "simple-fill", // autocasts as new SimpleFillSymbol() outline: { // makes the outlines of all features consistently light gray color: "red", width: 0.5 } } }; var linefeatureLayer = new FeatureLayer({ url:"http://xx.xx.xx.xx:6080/arcgis/rest/services/test/Tbilisi_wyalmomarageba_keti/MapServer/16", select: false }); var layer = new FeatureLayer({ url: "http://xx.xx.xx.xx:6080/arcgis/rest/services/test/samisamarTo/FeatureServer/0", outFields: ["*"], labelingInfo: [labelClass], renderer: renderer }); var map = new Map({ basemap: "dark-gray", layers: [layer, /*linefeatureLayer*/] }); var view = new MapView({ container: "viewDiv", map: map, center: [44.7502, 41.725524], zoom: 12 }); view.ui.add("info", "top-right"); // Set up a click event handler and retrieve the screen x, y coordinates view.on("click", function(event) { // the hitTest() checks to see if any graphics in the view // intersect the given screen x, y coordinates view.hitTest(event) .then(getGraphics); }); function getGraphics(response) { // the topmost graphic from the click location // and display select attribute values from the // graphic to the user var graphic = response.results[0].graphic; var attributes = graphic.attributes; var category = attributes.g_dasaxeleba_ka; var wind = attributes.kodi; var name = attributes.SE_ID_new; dom.byId("info").style.visibility = "visible"; dom.byId("name").innerHTML = name; dom.byId("category").innerHTML = "დასახელება: " + category; // symbolize all line segments with the given // storm name with the same symbol var renderer = new UniqueValueRenderer({ field: "SE_ID_new", defaultSymbol: layer.renderer.symbol || layer.renderer.defaultSymbol, uniqueValueInfos: [{ value: name, symbol: new SimpleLineSymbol({ color: "orange", width: 5, cap: "round", }) }] }); layer.renderer = renderer; } view.graphics.removeAll(); if (graphic) { var selectionGraphic = graphic.clone(); selectionGraphic.symbol = renderer; view.graphics.add(selectionGraphic); } }); </script> </head> <body> <div id="viewDiv"></div> <div id="info"> <span id="name"></span><br> <span id="category"></span><br> <span id="wind"></span> </div> </body> </html>
... View more
12-23-2019
05:43 AM
|
0
|
4
|
1896
|
|
POST
|
I use python add-in "onCreate new feature" and when i start editing and click to make new point deature it stucks.
... View more
11-26-2019
10:50 AM
|
0
|
1
|
1098
|
|
POST
|
Hi Guys, I have simple code in Arcpy to transfer attributes from one layer to another. It works for local gdb, but when i run it for SDE (It is versioned SDE connection) it stusks and do not import anything, i think it is problem of connection string i have, but i do not know how to change it. Here is a very useful code for transferring values between two layers, when one intersects to other, you can use it and help me for SDE connetion: mxd = arcpy.mapping.MapDocument("Current") Pointi = r'Database Connections\Connection to 10.0.151.30.sde\WaterTbilisi_GIS.DBO.kanalizacia\WaterTbilisi_GIS.DBO.canals' Poli = r'Database Connections\Connection to 10.0.151.30.sde\WaterTbilisi_GIS.DBO.samisamarTo_erTeulebi\WaterTbilisi_GIS.DBO.done_6' with arcpy.da.UpdateCursor(Pointi, ['SHAPE@','updateField']) as ucursor: for update_row in ucursor: with arcpy.da.SearchCursor(Poli, ['SHAPE@', 'TargetField']) as scursor: for search_row in scursor: if update_row[0].within(search_row[0]): update_row[1] = search_row[1] ucursor.updateRow(update_row)
... View more
11-26-2019
04:37 AM
|
0
|
3
|
1157
|
|
POST
|
Hi Joshua, I did it like this, but still updates only sing one value from polygon: with arcpy.da.SearchCursor("Poly","name") as cursor: ... for row_lsd in cursor: ... arcpy.SelectLayerByLocation_management("Points","INTERSECT","Poly","","NEW_SELECTION") ... with arcpy.da.UpdateCursor("Points",["name"])as cursor_a: ... for row_a in cursor_a: ... row_a[0]=row_lsd[0] ... cursor_a.updateRow(row_lsd)
... View more
11-26-2019
01:02 AM
|
0
|
0
|
6054
|
|
POST
|
Dear jeremy, Field (from which i want to move value into points layer) in polygon Layer('Poly' --- string) i have is called "NAMES" and in points Layer ('Points' --- ) is "NewName". I try also this code: Import arcpy with arcpy.da.SearchCursor("Poly","NAMES") as cursor: ... for row_lsd in cursor: ... arcpy.SelectLayerByLocation_management("Points","INTERSECT","Poly","","NEW_SELECTION") ... with arcpy.da.UpdateCursor("Points",["NewName"]) as cursor_a: ... for row_a in cursor_a: ... row_a[0]=row_lsd[0] ... cursor_a.updateRow(row_lsd) It makes update, but updates only one value from Polygon ('Poly'), E.G. i have two names - John and Mike, it update only Mike, even if points features is under John.
... View more
11-26-2019
12:57 AM
|
0
|
0
|
6054
|
|
POST
|
HI Guys, I have two layers, polygon (in code "Poly" and "Points") and point, i want to upload polygon layer attribute to point using intersect (like spatial join). E.g in polygon i have A and B features, i wont to update their values in point layer features attributes which under polygons. When i run my code it runs, but uploads only one value from polygon layer, when i have two values fro different features. Here is a code help me please: import arcpy >>> cur_pol = arcpy.da.SearchCursor("Poly","name") >>> for row_pol in cur_pol: ... arcpy.SelectLayerByLocation_management("Points","INTERSECT","Poly","","NEW_SELECTION") ... >>> for row in arcpy.da.SearchCursor("Points","my_field"): ... cursor = arcpy.UpdateCursor("Points") ... for row in cursor: ... row.SeniSvna = row_pol[0] ... cursor.updateRow(row) ...
... View more
11-22-2019
03:15 AM
|
0
|
9
|
6682
|
|
POST
|
Hi Guys, need a time, start working on Python Add-in, when finish i will share Code.
... View more
11-22-2019
03:03 AM
|
0
|
0
|
1945
|
|
POST
|
Hi Guys, I ma looking for JavaScript sample to split/cur polyline in ArcGis JavaScript API. I found one sample but it did not work for me. I tried to do something using Geometry but failed. If you have some code share Please. Thank you.
... View more
11-18-2019
11:16 PM
|
0
|
4
|
2112
|
|
POST
|
Hi guys, Can someone point me how to make search in two different layers using SQL query? I use these code for one layers and want to use same search for different layers, does not mattter search fields have same names or not. Thanks in advance //saZiebo sistema var HWUrl = "http://localhost:6080/arcgis/rest/services/Melioracia_Geo_201801251705/MapServer/3"; var queryZebna = dom.byId("query-Zebna"); // magistraluri arxi var HWLayer = new FeatureLayer({ url: HWUrl, outFields: ["*"], visible: false }); // GraphicsLayer for displaying results var resultsLayer = new GraphicsLayer({ title: "ძიების რეზულტატი" }); //rukis Seqmna var map = new Map({ basemap: "topo-vector", layers: [resultsLayer] }) var view = new MapView({ container: "viewDiv", map: map, extent: { // Extent Chemi rukistvis() xmin: 5278000, ymin: 5147000, xmax: 4377000, ymax: 5247784, spatialReference: 102100 } }); // Add a basemap toggle widget to toggle between basemaps var toggle = new BasemapToggle({ titleVisible: true, view: view, nextBasemap: "satellite" }); // Add widget to the top right corner of the view view.ui.add(toggle, "top-left"); on(queryZebna, "click", function() { queryMagistraluri() .then(displayResults); }); function queryMagistraluri() { var query = HWLayer.createQuery(); //query.returnGeometry = true; //query.outFields = ["*"]; let searchTerm = document.getElementById('searchInput').value; query.where = "სარწყავი_სისტემა LIKE N'%"+ searchTerm +"%'"; query.outSpatialReference = view.spatialReference; return HWLayer.queryFeatures(query) }
... View more
05-07-2019
01:45 AM
|
0
|
2
|
1558
|
|
POST
|
Thank you so much Robert As i guess it was a Query problem - query.where = "OBJECTID > 0", is there anything that i have to know for future use?
... View more
04-08-2019
06:32 AM
|
0
|
1
|
1688
|
|
POST
|
Hi people, I use ArcGIS JavaScript API 4.1 ( it was in ArcGIS JavaScript API 3.1 )and could not update this code in this version. Any ideas how to do it? Data responses, but autocomplete does not work: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Sample Code</title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } </style> <link rel="stylesheet" href="https://js.arcgis.com/3.10/js/esri/css/esri.css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <script src="https://js.arcgis.com/4.10/"></script> </style> <script> require(["esri/Map","esri/views/MapView", "esri/tasks/QueryTask","esri/tasks/support/Query","dojo/domReady!"], function (Map, MapView, QueryTask, Query) { var map; var map = new Map({ basemap: "topo-vector" }) var view = new MapView({ container: "viewDiv", map: map, extent: { // Extent Chemi rukistvis() xmin: 5278000, ymin: 5147000, xmax: 4377000, ymax: 5247784, spatialReference: 102100 } }); $(function () { var array = [] queryTask = new QueryTask("localhost:6080/arcgis/rest/services/Melioracia_Geo_201801251705/MapServer/3"); query = new Query(); query.returnGeometry = false; query.outFields = ["სარწყავი_სისტემა"]; query.where = "OBJECTID > 0"; queryTask.execute(query, showResults); function showResults(results) { // Collect the results var resultItems = []; var resultCount = results.features.length; for (var i = 0; i < resultCount; i++) { var featureAttributes = results.features[i].attributes; for (var attr in featureAttributes) { // Convert the attribute to a string. Null Values create an extra comma which stops the widget from functioning. tags = String(featureAttributes[attr]); // push the attributes tothe blank array resultItems.push(tags); } } // Sort the array sorted = resultItems.sort() // Remove Duplicates var uniqueNames = []; $.each(sorted, function (i, el) { if ($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); }); // Set the varrible array array = uniqueNames // This is your AutoComplete Widget var availableTags = array; // Reference the div id which you want the autocomplete list to appear (in this case tag) $("#tags").autocomplete({ // set the source as the availble tags above source: availableTags }); } }); }); </script> </head> <body> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags"> </div> <div id="map"></div> <div id="viewDiv"></div> </body> </html>
... View more
04-08-2019
12:18 AM
|
0
|
3
|
2197
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-22-2022 11:57 PM | |
| 1 | 08-31-2022 12:41 AM | |
| 1 | 08-23-2022 02:49 AM | |
| 1 | 05-10-2022 05:12 AM | |
| 1 | 01-13-2022 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2025
03:20 AM
|