I would like to print computed values in a side bar using a Google Earth Engine app.  Currently the output is a dictionary for example if I want the feature name that has been clicked on:  var computeValues = function (coords) {    // select built-up area from map   var point = ee.Geometry.Point(coords.lon, coords.lat);    // select the polygon and colour red   var selected = bu.filterBounds(point);   var id = ee.String(selected.first().get('bua11cd'));    // display in side panel   bu_name.setValue(['location:', id]);  // Create panels to print values. var inspectorPanel = ui.Panel({style: {width: '30%'}}); var bu_name = ui.Label(); inspectorPanel.add(ui.Panel([bu_name], ui.Panel.Layout.flow('vertical')));   Returns this is the side panel:     location:,ee.String({ "type": "Invocation", "arguments": { "input": {   "type": "Invocation", "arguments": { "object": { "type": "Invocation",   "arguments": { "collection": { "type": "Invocation", "arguments": {   "collection": { "type": "Invocation", "arguments": { "tableId":   "users/philtown81/Builtup_Areas" }, "functionName":   "Collection.loadTable" }, "filter": { "type": "Invocation",   "arguments": { "leftField": ".all", "rightValue": { "type":   "Invocation", "arguments": { "geometry": { "type": "Point",   "coordinates": [ -0.4458729125976788, 51.7557470078457 ] } },   "functionName": "Feature" } }, "functionName": "Filter.intersects" }   }, "functionName": "Collection.filter" } }, "functionName":   "Collection.first" }, "property": "bua11cd" }, "functionName":   "Element.get" } }, "functionName": "String" })    is a link to a working example.
121944
I am working on a variable label in Google Earth Engine and noticed that the label as printed in the console is not the same as the label shown on the map. Why is that? Code below:  var aoi = ee.Geometry.Polygon([[[-106.75701284923326, 42.31332966408458],           [-106.75701284923326, 42.003856624775146],           [-106.31755972423326, 42.06913460511273]]]);  var chirpsSelect = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY")             .filterDate('1985-01-01','2018-01-01')             .filter(ee.Filter.dayOfYear(3,6))             .filterBounds(aoi)  var chirpsStartImage = ee.String(chirpsSelect.first().get('system:index')) var dateStartString = ((((chirpsStartImage.slice(6,8)).cat('/')).cat(chirpsStartImage.slice(4,6))).cat('/')).cat(chirpsStartImage.slice(2,4))   var sortChirpsSelect = chirpsSelect.sort('system:index',false)  var chirpsEndImage = ee.String(sortChirpsSelect.first().get('system:index')) var dateEndString = ((((chirpsEndImage.slice(6,8)).cat('/')).cat(chirpsEndImage.slice(4,6))).cat('/')).cat(chirpsEndImage.slice(2,4)) var dateTitle = ee.String((dateStartString.cat(' to ')).cat(dateEndString))  print(dateTitle)  var dateLabel = ui.Label({   value: dateTitle })  var panel = ui.Panel() panel.add(dateLabel) Map.add(panel)
105697
Is there any good, complete API for the GDAL Python bindings?  I am interpolating and rasterizing points with elevation data using the gdal.Grid() method;  output = gdal.Grid('outcome.tif','newpoints.vrt')     In its most basic sense, it's working perfectly. But now, I'd like to try the linear approach;  output = gdal.Grid('outcome.tif','newpoints.vrt', algorithm = 'linear:radius=0')     That does generate a new .tif file (512kb), but is just one big black image. Also, not all options seem to be accepted.. for the invdist:power=4 for example it also results in a useless image. What is going wrong, am I missing something? Below is the .vrt I'm using;  &lt;OGRVRTDataSource&gt; &lt;OGRVRTLayer name="newpoints"&gt;     &lt;SrcDataSource&gt;newpoints.csv&lt;/SrcDataSource&gt;     &lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;     &lt;GeometryField encoding="PointFromColumns" x="long" y="lat" z="depth"/&gt; &lt;/OGRVRTLayer&gt;       EDIT As a next example I used the gdal.GridOptions(), putting the parameters in that one. It is resulting in a correct file, but still ignores the options. How to actually pass the GridOptions onto the gdal.Grid() ?  edit I found this question also;   Is the linear interpolation just a bug in GDAL?  See my example workfiles;
65927
I am trying to zoom plot numbers.Plot numbers like 1 10-12 13/P road 20(A) 100&amp;102 and etc.I am able to zoom to all combination plot numbers except 1,2,3.when I pass such value its trowing error:  1 feature types requested, but found 2 view params specified  geoserver sql view is:  select * from plotboundary where nmindar='%nmindar%' and plno='%plno%'   default values and validation are  Name  | Default Value   | validation  nmidar| Hanagawadi I A  | ^[\w\d\s]+$  plno  |  100,102&amp;103    | ^[ A-Za-z0-9_ *@.\/#&amp;+-\,()-_]*$   ajax function:   $.ajax({             url: 'http://XX.168.1.XX:8089/geoserver/XX/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=XX:vwplot&amp;maxFeatures=5000&amp;outputFormat=text/javascript',             contentType: 'application/json',             dataType: 'jsonp',             jsonpCallback: "parseResponse",             data: {                 viewparams: "nmindar:" + nmindar + ";plno:" + plno             }   Can any one tell me how to pass value to viewparams in geoserver, value includes comma. For example as mentioned above "100,102&amp;103" is a single value(plot number).Here   comma is not a separator.
113163
\documentclass[margin=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes,calc} \begin{document} \begin{tikzpicture}  \foreach \x [evaluate=\x as \name using \x*20] in{0,0.05,0.1,0.15,...,5}    \node(\name)[regular polygon, regular polygon sides=12,inner sep=0pt,minimum size=\x cm]{};  \node at(1){test}; \end{tikzpicture} \end{document}   I get an error saying that there is no shape named "1". The loop works fine (if you add a "draw" option the 12-polygons show up) except for the evaluating part.  edit: I just discovered that 0.05*20 yields 1,00006 instead of 1, so it cannot find a node named 1. Why is that? How can I get 1 from 0,05*20?
107220
I have a map. the string is the label of a field of an object and the integer is the value that must go into this field of that object. But i don't know how to retrieve the API name of those fields from their labels. Please help!  Thanks in advance!
17923
I have an array in the form of 'int[][]' that represents the co-ordinates of a small grid. Each co-ordinate has been assigned its own value. eg array[0][4] = 28......  I have two questions. Firstly, how do I iterate through all the stored values. Secondly, I want to be able to input a value and have its specific co-ordinates in the grid returned. What would be the best way to approach this?  Thank you for any help!
91340
I need to obtain, for each feature of a layer, a dictionary with the attribute names and their values using PyQGIS. I can get all the attributes of the layer using indiv = QgsProject.instance().mapLayersByName('Individuos')[0]  for feature in features:     value = feature[field.name()]     attrs = feature.attributes()     print(attrs)  But what I need is to create a dictionary with field names as key and their value for each feature.
30924
I am using ArcMap 10.2 and I'm looking for a way to add  a table containing certain fields from select elements from a featureclass to my map. Ive tried the add table option from the attribute table, but it doesn't quite give what I want (the table must be editable to look a certain way).   Are there any options out there for 10.2 like arcpy.mapping.tableview or will upgrading to 10.3 so I can get access to the "graphic table element" function be best?
96879
How do I change the coordinate value of a vector layer (13293061,-572595) to 119.413,-5.13677 (vector data &amp; Google Earth do not match)?   If I output my data using Google Earth as background, the vector data does not match with the underlying google layer.   Printing the result to PDF also has this same problem.
19042
I have a large collection of points with X and Y coordinates in a projected coordinate reference system (EPSG:28992). I would like to compute a square buffer around it (say, 500 meters around the point), so I can crop this polygon with a raster layer (in TIFF format) and proceed with a further analysis with the values within the cropped windows.  I am aware that this is possible in , but for the sake of the workflow I am implementing, I prefer to have it entirely in the Python GDAL environment, so it becomes automatic. Since I know the X/Y coordinates and the size of the grid cells in the raster, I could add/subtract to the coordinates the desired buffer, but I wonder whether there is a less handcrafted version of this "square-buffer" operation, which is less prone to errors. Other Python libraries (e.g. shapely) would be fine for me as well.   Note that a band.GetRasterBand(1).ReadAsArray(X, Y, 5, 5) does not return the window around the point, but the window leaving the point in a corner.   For instance, the following code:  path_curr_lyr = r"path_to_tif_file" tif = gdal.Open(path_curr_lyr) dat = tif.GetRasterBand(1).ReadAsArray(9550, 9620, 1, 1) print(dat) sq_buf = tif.GetRasterBand(1).ReadAsArray(9550, 9620, 5, 5) print(sq_buf)   Accesses the raster grid cell X/Y (9550, 9620) and returning the value of forest coverage in that pixel, and the value of a window of width= 5 pixels.  &gt;&gt;&gt; [[44]] &gt;&gt;&gt; [[ 44  87  99  86  43]      [ 96  99  99  79  14]      [ 99  99  98  34   9]      [ 99  86  27  93  71]      [ 98  98 100  97  65]]    As you can see, this approach returns a window in which the "44" is not a central value, but one in the corner. I would like to have a procedure in which a window around the given grid cell coordinate is created.  Any advice on how to implement this?
35002
In arcgis, this can be easily done by using the Symbology tab in the properties.I need to achieve a similar effect in Geoserver. How can I do it?
13006
I am using ArcPy to export PDFs from my ArcGIS Server application. I want to move a TextElement in my layout view to the centroid of a selected feature. I can get the centroid of the feature, but that's in my projected coordinate system (PCS). I need to convert that point into inches in my layout view. elements = arcpy.mapping.ListLayoutElements(mapDoc, &quot;TEXT_ELEMENT&quot;)     for elem in elements:         if elem.name == &quot;SiteText&quot;:             elem.elementPositionX = center.X             elem.elementPositionY = center.Y  center.X and center.Y are in a projected coordinate system (PCS), not inches. I know it can be done with ArcObjects, as I've done it in desktop addins using C#. I need to do it from ArcPy and I don't see how. Any ideas?
19967
I make frequent use of |- and -| with computed points in diagrams, like so:  \coordinate (a) at (0,0); \foreach \x in (1,...,10) {     \coordinate (b) at ({whateverFunction(\x)},{whateverOtherFunction(\x)});     \draw (a) |- (b); %Straight line segment     \draw (b) -| (a); %Another straight line segment     \coordinate (a) at (b); }   To get plots like:   I would like to be able to label the midpoint of each line segment, but doing something like node[midway,above] {a} does not act like expected:    I want something like:    Why does midway not work, and what is a good workaround here?
74763
I am creating many boolean properties and want to be able to control the properties with a single worker function. The property name will be the logic driver. Is this possible? If so how? Or do I need to create a function for each property?  import bpy from bpy.props import BoolProperty  def worker_func(self, context):     r""" How to get the name of the envoked property"""     print (self.name) #??     """         if prop_a:             do stuff for prop_a         if prop_b:             do stuff for prop_b         if prop_c:             do stuff for prop_c      """  bpy.types.Scene.prop_a = BoolProperty( update = worker_func ) bpy.types.Scene.prop_b = BoolProperty( update = worker_func ) bpy.types.Scene.prop_c = BoolProperty( update = worker_func )  class HelloWorldPanel(bpy.types.Panel):     bl_label = "Hello"     bl_idname = "OBJECT_PT_hello"     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'      def draw(self, context):         layout = self.layout         layout.prop(context.scene, "prop_a", text="a")         layout.prop(context.scene, "prop_b", text="b")         layout.prop(context.scene, "prop_c", text="c")    def register():     bpy.utils.register_class(HelloWorldPanel)   def unregister():     bpy.utils.unregister_class(HelloWorldPanel)   if __name__ == "__main__":     register()   Thanks you very much. A.Kal
102242
I want to display popup with the data item, such as: name, coordinates, stationID, Attribute.  But my code has some problem that can't run.  &lt;html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head profile="http://gmpg.org/xfn/11"&gt;     &lt;link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"           integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="           crossorigin="" /&gt;     &lt;script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"             integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="             crossorigin=""&gt;&lt;/script&gt;     &lt;script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"&gt;&lt;/script&gt;     &lt;script src="https://code.jquery.com/jquery-2.1.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt;     &lt;div id="map" style="height: 500px; border: 1px solid #AAA;"&gt;&lt;/div&gt;     &lt;script&gt;          var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',             osmAttrib = '&amp;copy; &lt;a href="https://www.openstreetmap.org/copyright"&gt;OpenStreetMap&lt;/a&gt; contributors',             osm = L.tileLayer(osmUrl, { maxZoom: 20, attribution: osmAttrib });         var map = L.map('map').setView([24.151687694799833,120.64116954803465               ], 15).addLayer(osm);              //顯示地圖         L.control.scale().addTo(map);          $.getJSON("https://sta.ci.taiwan.gov.tw/STA_Rain/v1.0/Things?$expand=Locations&amp;$select=name,properties&amp;$count=true", function (data) {             var markerGroup = L.featureGroup();             data.value.forEach(function (itemData, itemInd) {                 var latLng = L.latLng(itemData.Locations[0].location.coordinates[1], itemData.Locations[0].location.coordinates[0]);                 var myMarker = L.marker(latLng).addTo(markerGroup);                 myMarker.bindPopup('ID: ' + itemData.properties.stationID + '&lt;br /&gt;Name: ' + itemData.properties.stationName);                    onEachFeature (itemData, layer) {                     layer.bindPopup("&lt;p&gt;&lt;/p&gt;"                         + itemData.name + "&lt;/p&gt;"                         + itemData.properties.Attribute +                         "&lt;/p&gt;Attribute: "                     );                 };             }).addTo(map);              markerGroup.addTo(map);             map.fitBounds(markerGroup.getBounds());                   });     &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;   This is my GeoJSON:  https://sta.ci.taiwan.gov.tw/STA_Rain/v1.0/Things?$expand=Locations&amp;$select=name,properties&amp;$count=true
21860
I'm trying to debug a Python script by placing a print("foo=" + foo) statement in my code.  But where does the output appear?     It doesn't appear on the Python Console, and it doesn't appear on the area that appears when you drag the lower edge of the infobar downwards (what is the name for this area? My script errors show up in red here.)
84926
I have this problem while running GNOME Maps ~$ gnome-maps  (org.gnome.Maps:10414): Gjs-WARNING **: 19:43:34.553: Some code called array.toString() on a Uint8Array instance. Previously this would have interpreted the bytes of the array as a string, but that is nonstandard. In the future this will return the bytes as comma-separated digits. For the time being, the old behavior has been preserved, but please fix your code anyway to explicitly call ByteArray.toString(array). (Note that array.toString() may have been called implicitly.) 0 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/osmTypes.js&quot;:32] 1 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/osmEditDialog.js&quot;:35] 2 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/osmEdit.js&quot;:25] 3 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/contextMenu.js&quot;:33] 4 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/mainWindow.js&quot;:33] 5 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/application.js&quot;:35] 6 &lt;TOP LEVEL&gt; [&quot;resource:///org/gnome/Maps/js/main.js&quot;:43] 7 start() [&quot;resource:///org/gnome/gjs/modules/package.js&quot;:209] 8 &lt;TOP LEVEL&gt; [&quot;/usr/bin/gnome-maps&quot;:2]   (org.gnome.Maps:10414): Gdk-WARNING **: 19:43:36.525: Native Windows taller than 65535 pixels are not supported Gdk-Message: 19:43:36.574: Error 71 (Protocol error) dispatching to Wayland display.  19:43:36.574 (This message has changed many times) What's this?