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
|
642
|
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
|
701
|
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
|
4796
|
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
|
4796
|
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
|
5424
|
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
|
1361
|
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
|
1528
|
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
|
1016
|
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
|
1145
|
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
|
1654
|
POST
|
I tried, but no results. I have Displayed Results here: function displayResults(results) { resultsLayer.removeAll(); var features = results.features.map(function (graphic) { graphic.symbol = { type: "simple-marker", // autocasts as new SimpleMarkerSymbol() style: "diamond", size: 6.5, color: "darkorange" }; return graphic; }); } ...... Yes My layer is a point feature...
... View more
02-12-2019
10:04 PM
|
0
|
3
|
1406
|
POST
|
Hi Guys, I am new in Java Scrip and got some problems to resolve! I have written code using SQL Query and now i want to display Query result on a map, i have tried a lot but no result, i get fields and XY in response payload, but could not display on a map. Here is my code and help me please. Tanks in advance <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>My Test Map for SQL Query </title> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css"> <script src="https://js.arcgis.com/4.10/"></script> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/tasks/QueryTask", "esri/tasks/support/Query", "esri/geometry/geometryEngine", "esri/layers/GraphicsLayer", "esri/Graphic" ], function(Map, MapView, FeatureLayer, QueryTask, Query, geometryEngine, GraphicsLayer, Graphic ) { var HeadWork = "http://localhost:6080/arcgis/rest/services/Melioracia_Geo_201801251705/MapServer/0"; var featurelayerHW = new FeatureLayer({ url: HeadWork, outFields: ["*"], visible: false }); // Create graphics layer and symbol to use for displaying the results of query var resultsLayer = new GraphicsLayer(); var map = new Map({ basemap: "dark-gray", layers:[resultsLayer] }); var view = new MapView({ container: "viewDiv", map: map, extent: { // Extent Chemi rukistvis() xmin: 5278000, ymin: 5147000, xmax: 4377000, ymax: 5247784, spatialReference: 102100 } }); var queryTask = new QueryTask({ url: HeadWork }); var query = new Query(); query.returnGeometry = true; query.outFields = ["*"]; query.where = "Irrigation_System LIKE 'Dus Ru I.S.'"; //Returns features and graphics that satisfy the query. queryTask.execute(query).then(function(results){ console.log(results.features); }); // view and print the number of results to the DOM function displayResults(results) { resultsLayer.removeAll(); var features = results.features.map(function (graphic) { graphic.symbol = { type: "simple-marker", // autocasts as new SimpleMarkerSymbol() style: "diamond", size: 6.5, color: "darkorange" }; return graphic; }); } }); </script> </head> <body> <div id="viewDiv"></div> </body> </html>
... View more
02-12-2019
01:36 AM
|
0
|
5
|
1815
|
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-20-2024
08:19 AM
|