texts: set definition expression based on slider values

texts:
Using the Esri JavaScript API I want to control the set.DefinitionExpression values based on a user controlled range slider.

The data is loaded from REST as ondemand using:

var POP_Total = new FeatureLayer("..../services/RPP_15/HEX_Confidence_Scores/MapServer/2", {
                  mode: FeatureLayer.MODE_ONDEMAND,
                  outFields: ["*"],
                  opacity: 0.5,
              });

I set a definition expression with:

POP_Total.setDefinitionExpression("POP_Total_Class >= 4 AND POP_Total_Class <= 5");

In the above case the returned values are hard coded to only display the values between 4 and 5. I wish to problematically change the values of the 4 and 5 with the values returned by the range slider.

The range slider is created with:

var sliderRules = new dijit.form.HorizontalRuleLabels({
                  minimum: 1,
                  maximum: 8,
                  labels: ["1", "2", "3", "4", "5", "6", "7", "8"],
                  labelStyle: "font-size:9px;color: #333",
                  style: "width:220px;height:30px;"
              }, "ruler");

              var rangeSlider = new dojox.form.HorizontalRangeSlider({
                  name: "rangeSlider",
                  value: [1, 8],
                  minimum: 1,
                  maximum: 8,
                  discreteValues: 8,
                  style: "width:220px;",
                  onChange: function (value) {
                      //alert('change occurred');
                  }
              }, "rangeSlider");


texts: Re-import custom functions without restarting QGIS

texts:
I have a python file (in [user]\.qgis2\python) with some functions that I'm working on. It's just a .py file with a bunch of def function_1, def function_2 etc. in it. On startup I import the .py file with all the functions from my_functions.py import * and then play around with them. at this stage I'm still getting lots of errors, so I go back to my python file in a text editor, make some changes and save the file.

How do I get these changes to be reflected within QGIS? I've tried re-importing the .py file but I get the same errors that I've just corrected, so the only way I've been able to use the modified functions is by restarting QGIS and then importing again.


texts: Python Add-In Combo Box Not Working Properly

texts:
I am trying to create a python add-in toolbar with a combo box that lists all of the [SITE_NUMBER] values in my "Site Inspection" polygon layer.  The user should be able to select a [SITE_NUMBER] value from the combo box and have the active map view zoom to the extent of the selected site.  The problem is that the toolbar doesn't behave consistently.  It works correctly if the "Site Inspection" layer is the only one in the MXD.  If there is another layer in the MXD then the combobox only works a single time and then stops working completely. I'm new to python and add-ins so I'm not sure where I'm going wrong.

import arcpy
import pythonaddins

class ComboBoxClass1(object):
"""Implementation for Inspection_Site_Zoom_addin.combobox (ComboBox)"""
def __init__(self):
    self.editable = True
    self.enabled = True
    self.dropdownWidth = '1234567'
    self.width = '1234567'

def onSelChange(self, selection):
    layer = arcpy.mapping.ListLayers(mxd, "Inspection Site", df)[0]
    arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", "SITE_NUMBER = '" + selection + "'")
    df.extent = layer.getSelectedExtent()
    arcpy.RefreshActiveView()

def onFocus(self, focused):
    global mxd
    mxd = arcpy.mapping.MapDocument('current')
    global df
    df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
    layer = arcpy.mapping.ListLayers(mxd, "Inspection Site", df)[0]
    arcpy.SelectLayerByAttribute_management(layer, "CLEAR_SELECTION")
    self.items = []
    values = [row[0] for row in arcpy.da.SearchCursor(layer, ["SITE_NUMBER"])]
    for uniqueVal in sorted(set(values)):
        self.items.append(uniqueVal)


texts: Getting the layer path into Print Composer?

texts:
I'm looking to get the file paths for the various layers into the QGIS print composer. This is so I can produce a block of copyright statements automatically as we use data from a wide range of sources that have different statements.

I've already tried using the layer variables, but it turns out that those don't get pulled through into Print Composer for some reason.


texts: Can GeoServer WPS accept external WMS as input?

texts:
I'm reading here:

http://suite.opengeo.org/docs/latest/processing/processes/formats.html#raster-inputs

that GeoServer can accept HTTP Requests as Input when a Raster is required.
Documentation states this raster must be "a WCS GetCoverage request or equivalent". (I know is NOT the official documentation but Boundless Server's one, still I feel it applies also to the Open-Source GeoServer)

I need to know if specifying a WMS (as an http URL) can do the job.. ..and hopefully an example.

The test I did with the default GeoServer's "WPS request builder" all failed complaining a proper Input was not found in the provided HTTP Request.


texts:
"symbols()" is no longer available in QGIS 3.0 and replaced by "QgsRenderContext& context" method, but I do not find the correct way to write this instruction.

from PyQt5.QtGui import *

lyr=iface.activeLayer()
symbols = lyr.renderer().symbols()
sym = symbols[0]
sym.setColor(QColor.fromRgb(255,0,0))

lyr.triggerRepaint()


texts: Spherical Mercator to Cylinder mercator?

texts:
Hello I want to create an overlay for google maps.
As far as I know google maps using Spherical Mercator, so the system where I read the maps use Mercator but is not specified which (spherical or cylinder) type it use.

When i create the images, i get some information in common. That means I have an offset. I want to try to solve this using cylinder mercator coordinates, but i don't know how can i transform google coordinates to Cylinder Mercator coordinates.

Thank you in advance.


texts: PostgreSQL connection doesn't show up in Data Source Manager

texts:
I have data for a PostgreSQL connection. After writing the data in QgsSettings.
The connection works but in the Data Source Manager under PostgreSQL connections is nothing documented. After I restart QGIS, the Data Source Manager shows me my connection.

qs = QgsSettings()
qs.beginGroup('/PostgreSQL/connections')
geo_data = "/"+ database_name

qs.setValue(geo_data +"/sslmode","SslDisable")
qs.setValue(geo_data +'/savePassword',"true")
qs.setValue(geo_data +'/saveUsername',"true")
qs.setValue(geo_data + '/username',"user")
qs.setValue(geo_data + '/password',"Password")
qs.setValue(geo_data + '/host',"Data Source")
qs.setValue(geo_data + '/database',"database")
qs.setValue(geo_data + '/port',"5432")

qs.sync()

I thought that the settings getting saved automatically and for safety, I also used the sync() function. Maybe someone has an idea of what is wrong.


texts: Spatial Join of Polygons to Polygon Grid with Shared Boundaries in ArcGIS Desktop?

texts:
I have polygons containing an attribute to be summed by a polygon grid. the polygons with the attribute always share borders with each grid cell and never extend outside any grid cell (the grid has been used to 'union' the polygons prior).

I am having trouble in ArcMap 10.x getting the 'spatial join' tool using the 'intersect' or 'have their center in' or 'within' match options to assign the sum of the attributes of polygons within each grid cell to an attribute of the grid cell. I think this may be because of share borders, though the 'select by location' tool using 'within' will select the desired polygons.

The layers are the same projection and in the same geodatabase.
Also have set the 'merge rule' parameter of the field to 'sum' in the 'spatial join' tool.

The only work-around I've found is to use 'spatial join' tool with the 'intersect' match option and a 'search radius' set to a negative such as -100 meters.


texts: Single building polygon ("Relation") with 2 building addresses in OpenStreetMap?

texts:
I often see in the "official" map at https://www.openstreetmap.org the following scenario:

Based on the basics of OSM Elements I wonder what's going on here?

It seems there are 2 nodes on the west side and between them 1 way, so I expect this single way to hold only 1 metadata tag.

When I try to debug it with some OSM data from "geofabrik" I encourage new issue: Ain't building numbers. {This is seems strange to me - Why 1 OSM has this data and other OSM not? I thought it's same data available to all under open source etc.}


texts: Setting map up to print to scale in QGIS?

texts:
I am having a problem trying to get maps to print to a specified scale.

Goal: to print a map to scale so that an engineer's scale (ruler) can be used to measure features on the printed map.

Problem: After setting the map scale to the desired scale and adding a scalebar linked to that map, the scale bar does not measure out correctly.

Here is an example of my issue:
The page size is 8.5 X 11 inches but scalebar does not measure correctly.  The scale bar unit is set to feet but the label multiplier is 0.083333 (1/12) and the number of right segments is 11 (for 11 inches), so it should display the full width of the page.

I have seen several other posts with the same issue, but none of them have been answered.

How can I get maps to print to a specified scale?

Here is a new map create after verifying printer settings are not set to 'fit to page', it has a line feature that is 500 ft in length but does not measure that on the printed map, from direct print, pdf or image.


texts:
I have a a diagram and have put it as the last layer in my project file, however it overlaps with my top layer.

Is there any way to make the diagrams underneath the other layers?

I can add a picture if my explanation lacked.

Edit- I am trying to get the black features, stars/circls/triangles above the population bubbles


texts: Map size, change the language of the legend plus get rid of the islands

texts:
I was able to build this map with data from the Eurostat

As I am working in Spanish, the legend should be in this language nevertheless, in the legend still appears two words in English (under and over) which I am not able to modify (honestly I do not know how to do it or where part of the code should I modify). The other issue is that the map is too small and I'd like to make it bigger and the islands showed are so far that make the map with a lot of blanks spaces. Is there any way to make this islands closer or omit them?

I also post the code if anyone wants to work with it.

library(rgdal)
library(RColorBrewer)
library(sp)
library(GISTools)
library(classInt)
library(maptools)
library(SmarterPoland)
library(reshape)
library(reshape2)

setwd("yourdirectory")

EU_NUTS <- readOGR(dsn = "yourdirectory/NUTS_2010_60M_SH/data", layer = "NUTS_RG_60M_2010")
plot(EU_NUTS)

proj4string(EU_NUTS)

EU_NUTS <- spTransform(EU_NUTS, CRS("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"))

plot(EU_NUTS)

EurostatTOC <- getEurostatTOC()

head(EurostatTOC)

data <- getEurostatRCV(kod = "demo_r_frate2")

unique(data$age)
unique(data$time)

sub_data <- subset(data, (age == "Y_GE50") & (time == "2016 "))

mapdata <- cast(data, geo ~ time + age)

head(mapdata)

head(EU_NUTS@data)

EU_NUTS@data = data.frame(EU_NUTS@data, mapdata[match(EU_NUTS@data[, "NUTS_ID"], mapdata[, "geo"]), ])

my_colours <- brewer.pal(5, "BuGn")

breaks <- classIntervals(EU_NUTS@data$X2016_TOTAL, n = 5, style = "fisher",  unique = TRUE)$brks

plot <- plot(EU_NUTS, col =my_colours[findInterval(EU_NUTS@data$X2016_TOTAL,  breaks, all.inside = TRUE)], axes = FALSE, border = NA)
CountryBorder <- EU_NUTS[EU_NUTS@data$STAT_LEVL_ == 0, ]
plot <- plot(CountryBorder, border = "#707070", add = TRUE)

plot <- legend(x = -6080915, y = 8730220, legend = leglabs(round(breaks, digits = 2), between = " a <"), fill = my_colours, bty = "n", cex = 0.7, title = "Tasa de fertilidad")
plot <- plot(EU_NUTS, col = my_colours[findInterval(EU_NUTS@data$X2016_TOTAL, breaks, all.inside = TRUE)], axes = FALSE, border = NA)
plot <- plot(CountryBorder, border = "#707070", add = TRUE)
plot <- legend(x = -6080915, y = 8730220, legend = leglabs(round(breaks,  digits = 2), between = " a <"), fill = my_colours, bty = "n", cex = 0.7, title =  "Tasa de fertilidad")
title("Tasa total de fertilidad en regiones EU NUTS-2\nNúmero de hijos por mujer en 2016")


texts: Do i need to list projection on map when using wgs84

texts: I have been creating maps using project CRS:WGS84 or ESPG:4326 when I export these maps (with grids listing the coordinates and suffix) I have just been writing on the map CRS:WGS84. Should I be writing the projection as well?


texts: Using ArcPy with ArcMap Layout View to ExportToTiff with geotags?

texts:
I feel like this should be a lot easier than it is, all I am trying to do is create a geotiff that contains spatial referencing from arcmap in an automated manner as I have thousands to create. Currently I have a script that is creating the exact map I need from the Data View. A mxd sets the dataframe area I require and I set the scale and center the map which then produced the tiff output

# Get the location of the output directory to save the exported map
outTIFFpath = arcpy.GetParameterAsText(9)

# Export the WebMap
arcpy.AddMessage("Exporting to TIFF")
arcpy.mapping.ExportToTIFF(mxd, outTIFFpath, resolution=150, color_mode="8-BIT_PALETTE")

Problem is the map produced does not contain a spatial reference, this is the last hurdle. If I try to add geoTIFF_tags=True then my script fails. I believe this all comes down to not being able to create a geotiff from the layout view. I have about 7000 of these I need to create.

I can do it manually from the Layout view using the following info and selecting Layout GeoTiff as I have a production mapping licence it seems to work fine when I try to do it from ArcMap.

How can I automate this selection of the Layout Geotiff as part of my script?

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0106000002tt000000.htm


texts: Projection declaration in dojox.geo.openlayers possible?

texts:
I am trying to integrate some maps of my own into the dojox charting demo and I had success in exporting a shapefile (externally, i.e. with my own parser) to the dojo JSON map format. The map is in epsg:3035 (LAEA/ETRS89) and it looks distorted in dojo. It might be either a problem with my parser or with dojo. Does the OpenLayers integration in dojox allow for the declaration of the projection like in a "real" OpenLayers map, like in this example:

map = new OpenLayers.Map("map", {
            controls: [
                //new OpenLayers.Control.KeyboardDefaults(),
                new OpenLayers.Control.MouseDefaults(),
                new OpenLayers.Control.LayerSwitcher(),
                new OpenLayers.Control.PanZoomBar()],
            maxExtent:
                new OpenLayers.Bounds(-20037508.34,-20037508.34,
                                       20037508.34, 20037508.34),
            numZoomLevels: 18,
            maxResolution: 156543,
            units: 'meters',
            projection: "EPSG:3035"} );

Or is it handled "as is" (e.g. lat/lon (epsg:4326)) which would mean, my parser is the problem?

I already searched the web for an answer but to no avail. Can you point me in the right direction?


texts: Creating polygon from perpendicular projection of light on wall on DEM using GRASS

texts:
Scenario:
I have

a DEM
a Polyline with elevation, representing a man made barrier like a levee or a giant wall.

Polyline will always be on top of DEM.
I want to get a polygon that represent all the areas that will be shaded if we were to project a perpendicular light along the wall.
Do we have tools in GRASS to achieve this?
Sketch:
I want the blue polygon.


texts: In arcgis we can set baselayer transparency according to use how to do same in qgis


texts: How can I load a very large raster (or portion of it) into R from an ArcGIS file geodatabase using R-Bridge (arcgisbinding)?

texts:
I have a large raster stored in an ArcGIS geodatabase (dimensions: 105,000x260,000) that I am trying to load in R. I have tried the following:
library(arcgisbinding)
arc.check_product()

gdb <- "location_of_geodatabase"
layer <-"name_of_layer"

o <- arc.open(paste0(gdb, layer))
arcraster <- arc.raster(o)
raster <- as.raster(arcraster)

But I get the error:
Error in matrix(no_data_val, nrow = nrow * ncol, ncol = length(bands)) :
  invalid 'nrow' value (too large or NA)
In addition: Warning message:
In nrow * ncol : NAs produced by integer overflow

I tried loading only a portion of the raster using the extent option for arc.raster(), but it resamples at a higher resolution keeping the dimensions the same. For example,
o <- arc.open(paste0(gdb, layer))

small_extent <- c(1384164 , 1536925 , 460645.2 , 647757)
arcraster <- arc.raster(o, extent=small_extent)

arcraster

type            : Raster
pixel_type      : F32 (32bit)
nrow            : 103000
ncol            : 265637
resample_type   : NearestNeighbor
cellsize        : 0.575071883824844, 1.81661923261566

I have read the documentation and I am not sure why this is happening. Any suggestions?


texts: Zonal Statistics As Table with Very Small Polygon

texts:
I was given one single band NDVI  raster and a shapefile with multiple very small polygons.

The raster has a resolution of 3m. On the other hand, the small polygons on the shapefile are square shaped with each side 2m long. Thus, any pixel in the raster is larger than the polygon on the shapefile.

I was told to extract the raster value of each polygon. After running the Zonal Statistics as Table I experienced the following issues -

When the small polygon completely falls into one single pixel as shown in the image below. Here the pixel has a value of 0.5. After zonal statistics, the value of the polygon is also shown as 0.5. This is completely fine.
Sometimes the small polygon falls into multiple pixels as shown in the image below. Suppose, the upper half of the polygon falls into a pixel with 0.3 value and the lower half falls into a pixel with 0.4 value. I was expecting that after the zonal statistics as table operation, I get a value of 0.35 (.5*.3+.5*.4). However, it does not provide any values for this polygon. The polygon that falls into multiple pixels does not even appears in the resulted table.

Is there any way of solving the second point? I am currently using ArcMap 10.5.


texts:
I am trying to replace legend item names in a Carto VL map. Using an example from the documentation which describes how to rename the "CARTO_VL_OTHERS" category, I was able to rename one of my legend items. For example:

colorLegendList +=
            `

                ${legend.key.replace("EN", "Endangered")}
\n`;

Which results in:

How would I rename the rest of the legend items as:

VU - Vulnerable
CR - Critically Endangered
LT - Least Threatened


texts: How to define the blank value of a field from shapefile to raster file based on GDAL_Rasterize？

texts:
I have tens of shapefiles and want to convert to raster based on CT field(as Fig.1).
However,CT fields of some polygons is blank,and these value is set to 0 when I use following gdal_rasterize code. I had assumed that -a_nodata parameter is set nodata is -2,but the output file has no -2.

My question is how to set the blank of CT value to a fixed value(for example -2) when using GDAL_Rasterize?

gdal_rasterize -a CT -l cis_SGRDREA_20160104T1800Z_pl_a -a_nodata -2 -init -1 cis_SGRDREA_20160104T1800Z_pl_a.shp G:\CIS_Sea_Ice_Chart_3573\2016\EA_Raster/cis_SGRDREA_20160104T1800Z_pl_a_CT.tif -tr 1000 1000 -ot Int16

                                        Fig.1


texts:
I'm trying to use the eVis plugin in QGIS 3.16.3 to display geotagged photos (as I have in the past without difficulty), but the plugin has totally disappeared. Not only can't I find it as an icon or under the Database menu, but it doesn't appear in the list of plugins (and yes, I am looking in the complete list of all plugins!).
Has it been moved somewhere I haven't come across or is it a bug?


texts: Alter Rectangle Polygon by Keyboard to Have Specified Dimensions (eg 1km x 1km)

texts:
Here is my current workflow.

Press "New Shapefile Layer" with "Geometry type": "Polygon"
Press "Toggle Editing"
Press "Add Rectangle from Center and a Point" then draw the rectangle to the current extend

Now I'd like to alter the current dimensions by keyboard to 1km by 1km for example. But I don't know how. Specifying the dimensions on creation of the polygon would also be totally fine as well.
How to create a polygon with specified dimensions? and How to create polygons with straight lines and right angles in QGIS? looked promising but actually don't give an answer.


texts: Reditied (New Question) :How to create (in QGIS) an "Other" value in the value map?

texts:
Before you read: my apologies for grammar mistakes, English is not my native writing language and the spellcheck can only help me so far. I am learning QGIS completely on my own and I am trying to follow the training manual but that van only get me so far.

Ok, so far I know how to create a value map with a list of value's to choose from with some attributes in the shapefile I can work in. This makes it easy for the person to add information to  green (were are working on a green database) objects such as author of the object. But I want to think a bit ahead by doing a little bit more than that. I know also to create a unique value list that can retyped. But I want to have a combination of both unique value and value map aka dropdown. Yeah I know you can add other values to a value map in value map edit menu. But considering that you this is gonna be linked to Qfield. I want to make it that way. Keep in mind the column that this setting must be created in is EMPTY. That means there are no current value's that can be set to Unique value's, and the value map is kind of already assigned.


texts: Using another imagery for reference of GCPs in PhotoMod software for DEM generation process?

texts: As I am novice to the Photomod software, I can only find the option to import GCPs (.csv or txt) or TIN to generate DEM. If I want to use another already Ortho-rectified image as a reference, how can I do that in PhotoMod?


texts: Map symbolization - style file: compute change for the Label?

texts:
Situation:

How to get the attributes/values of a field COD in an Attributes Table of a Feature Class (picture attached - attr_table) using another field COD_SYMB (which acts as a key-field) in that same attributes table?

In ArcMap, COD_SYMB is the field selected ---> Layer properties for the "Value Field" in the Symbology by categories (match to symbols in a style: picture attached - layer_prop). Code values for the symbology are loaded from a Style File created a priori (picture attached - style_file).

In the Style File ---> field/column "Name" contains the same values of those inserted previously in the field COD_SYMB so they can match.

In the Layer properties we have then: the field/column "Label" shows the attributes of COD_SYMB. And the field/column "Value" contains the color codes ---> COD_SYMB.
In terms of style symbolization, we need to compute a way (function/method) to replace the Label with COD_SYMB values by the field COD and its values.... In other words, when values/codes of field COD_SYMB are read, a method gets the correspondent values/codes in the field COD and returns them as Label field (picture attached - layer_prop - attr_tab - style_file relationship representation).

Any help?

I'm working on ArcGIS 10.3.

Note:

Is there a way to convert the Symbology by Style into UNIQUE_VALUES to apply this:

UniqueValuesSymbology—Help | ArcGIS for Desktop ---> desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/uniquevaluessymbology-class.htm
?

Pictures illustrating a minimal working example:


texts: Get elevation for multiple lon and lat using Earth Engine in Python

texts:
I'm new at Google Earth Engine and I need it for one simple task for research purposes,
I have a list of nodes like this
node1:[lon,lat]
node2:[lon,lat]
node3:[lon,lat]

I would like to get the elevation data for each long and lat
the output should be like this
dataframe
lon,lat,elev
lon,lat,elev
lon,lat,elev

Can anyone give a good answer for a similar problem ( I try to search for it and I didn't find any solution)
PS: I'm not interested in the slope of polygon I'm interested in specific points


texts: Seeking National Land Cover Vector Dataset?

texts:
I am looking for a National land cover vector dataset.

I tried to work with the National Land Cover Database 2011, downloaded the dataset but it was a picture file.


texts: QGIS error while opening properties programmatically of added layer

texts:
QGIS crashes when I try open properties of programmatically added vector layer, but when I save project and reload everything is ok. I use QGIS 3.10, but I tried also on 3.12. Only QGIS on Linux version 3.4 work fine.

My code:

def add_data_layer(self, name="edge.csv", isResult=False):
    path = os.path.join(self.path, name)
    if os.path.exists(path):
        print(path)
        url = QUrl.fromLocalFile(path)
        query = QUrlQuery()
        query.addQueryItem("delimiter", '|')
        query.addQueryItem("wktField", "wkt")
        url.setQuery(query)
        layer_csv = QgsVectorLayer(str(url.toEncoded())[2:-1], name, 'delimitedtext')
        layer_csv = self.set_layer_format(layer_csv, isResult)
        QgsProject.instance().addMapLayer(layer_csv)

def set_layer_format(self, layer, isResult=False):

    layer_settings = QgsPalLayerSettings()

    text_format = QgsTextFormat()
    text_format.setFont(QFont("Arial", 12))
    text_format.setSize(12)

    buffer_settings = QgsTextBufferSettings()
    buffer_settings.setEnabled(True)
    buffer_settings.setSize(0.10)
    buffer_settings.setColor(QColor("black"))
    text_format.setBuffer(buffer_settings)

    layer_settings.setFormat(text_format)
    layer_settings.fieldName = self.set_label(isResult)
    layer_settings.placement = 2
    layer_settings.enabled = True
    layer_settings.isExpression = True
    layer_settings = QgsVectorLayerSimpleLabeling(layer_settings)

    layer.setLabelsEnabled(True)
    layer.setLabeling(layer_settings)
    layer.triggerRepaint()

    return layer

Traceback:

QgsStyleProxyModel::QgsStyleProxyModel qgsstylemodel.cpp:860
QgsStyleItemsListWidget::setStyle qgsstyleitemslistwidget.cpp:134
QgsSymbolsListWidget::QgsSymbolsListWidget qgssymbolslistwidget.cpp:42
QgsSymbolSelectorWidget::layerChanged qgssymbolselectordialog.cpp:527
QMetaObject::activate :
QItemSelectionModel::setCurrentIndex :
QAbstractItemView::setCurrentIndex :
QgsSymbolSelectorWidget::QgsSymbolSelectorWidget qgssymbolselectordialog.cpp:306
QgsSingleSymbolRendererWidget::QgsSingleSymbolRendererWidget qgssinglesymbolrendererwidget.cpp:57
QgsSingleSymbolRendererWidget::create qgssinglesymbolrendererwidget.cpp:32
QgsRendererPropertiesDialog::rendererChanged qgsrendererpropertiesdialog.cpp:251
QMetaObject::activate :
QWidgetLineControl::`default constructor closure' :
QComboBox::setCurrentIndex :
QComboBox::setCurrentIndex :
QgsRendererPropertiesDialog::syncToLayer qgsrendererpropertiesdialog.cpp:387
QgsRendererPropertiesDialog::QgsRendererPropertiesDialog qgsrendererpropertiesdialog.cpp:122
QgsLayerStylingWidget::updateCurrentWidgetLayer qgslayerstylingwidget.cpp:419
QMetaObject::activate :
QListWidgetItem::`default constructor closure' :
QMetaObject::activate :
QItemSelectionModel::setCurrentIndex :
QListWidget::setCurrentRow :
QgsLayerStylingWidget::setLayer qgslayerstylingwidget.cpp:254
QMetaObject::activate :
QgsMapLayerComboBox::layerChanged moc_qgsmaplayercombobox.cpp:204
QMetaObject::activate :
QAbstractItemModel::endInsertRows :
QSortFilterProxyModel::insertRows :
QSortFilterProxyModel::sortRole :
QSortFilterProxyModel::`default constructor closure' :
QMetaObject::activate :
QAbstractItemModel::endInsertRows :
QgsMapLayerModel::addLayers qgsmaplayermodel.cpp:172
QMetaObject::activate :
QgsProject::layersAdded moc_qgsproject.cpp:1133
QMetaObject::activate :
QgsMapLayerStore::layersAdded moc_qgsmaplayerstore.cpp:314
QgsMapLayerStore::addMapLayers qgsmaplayerstore.cpp:99
QgsProject::addMapLayers qgsproject.cpp:3065
QgsProject::addMapLayer qgsproject.cpp:3103
meth_QgsProject_addMapLayer sip_corepart1.cpp:159821


texts:
I am fairly new to WorldWind and want to make WorldWind Server 1.5 server blue Marble Imagery to  worldwind 2.0. I am using WMSLayerManager applet to test my server.

Blue marble appears strange on worldwind 2.0. Please have a look at images.

Here is run down of what I did.
I have downloaded blueMarble data from NASA and ran following commands to convert pngs to gtifs.

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr -180 90 -90 0 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.A1.png world.topo.bathy.200412.3x21600x21600.A1.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr -180 0 -90 -90 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.A2.png world.topo.bathy.200412.3x21600x21600.A2.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr -90 90 0 0 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.B1.png world.topo.bathy.200412.3x21600x21600.B1.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr -90 0 0 -90 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.B2.png world.topo.bathy.200412.3x21600x21600.B2.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr 0 90 90 0 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.C1 .png world.topo.bathy.200412.3x21600x21600.C1 .gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr 0 0 90 -90 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.C2.png world.topo.bathy.200412.3x21600x21600.C2.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr 90 90 180 0 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.D1.png world.topo.bathy.200412.3x21600x21600.D1.gtif

gdal_translate -of gtiff -a_srs epsg:4326 -a_ullr 90 0 180 -90 -co tiled=yes -co compress=lzw world.topo.bathy.200412.3x21600x21600.D2.png world.topo.bathy.200412.3x21600x21600.D2.gtif

Here is Gdal info of world.topo.bathy.200412.3x21600x21600.A1.gtif

D:\BM>gdalinfo world.topo.bathy.200412.3x21600x10800.gtif
Driver: GTiff/GeoTIFF
Files: world.topo.bathy.200412.3x21600x10800.gtif
Size is 21600, 10800
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0,10800.0)
Upper Right (21600.0, 0.0)
Lower Right (21600.0,10800.0)
Center (10800.0, 5400.0)
Band 1 Block=21600x1 Type=Byte, ColorInterp=Red
Band 2 Block=21600x1 Type=Byte, ColorInterp=Green
Band 3 Block=21600x1 Type=Byte, ColorInterp=Blue

finally I added it to config file like:

<mapsource name="bmng200401" title="BlueMarbleNG 01/2004">
     <description keywords="NASA; Blue Marble; Global Imagery: 2004">Nasa's BlueMarbleNG, 2004GTIF</description>
     <root-dir>c:\Data\BlueMarble</root-dir>
     <class>gov.nasa.worldwind.servers.wms.generators.BlueMarbleNG500MGenerator</class>
     <property name="BlueMarble500M.defaultTime" value="200412"/>
     <property name="BlueMarble500M.namingscheme.prefix" value="world.topo.bathy" />
     <property name="BlueMarble500M.namingscheme.suffix" value="gtif" />
     <property name="gov.nasa.worldwind.avkey.LastUpdateKey" value="2009-03-24 10:55:00" />
</mapsource>

Who is the causing the problem? Is it **WMSLayerManager **, WMS Server or most probably the wrong projection.
I have also posted the same on http://forum.worldwindcentral.com/showthread.php?45461-BlueMarble-Projection-problem

What I am doing wrong. Can anyone please help me out.


texts: Possible to Call ArcPy Script From AddIn in ArcGIS 10.0?

texts: Is it possible to call an ArcPy script from a Java/.Net addin in ArcGIS 10.0?


texts:
I've just upgraded to QGIS Dufour and I am having some problems with the exportation of a simple track from .shp to .gpx and .kml format.
I imported from mi smartphone a .gpx track (SR WGS84 EPSG:4326), i converted it into .shp (EPSG:3857 in order to have it correctly projected over the google maps layer); I modified it and I finally need it to be exported into .gpx and .kml formats.
For .gpx: I did the "Save as", chose GPX format, set the RS to EPSG:4326, wrote "GPX_USE_EXTENSIONS=YES" in the Data Source field and "FORCE_GPX_TRACK=YES" in the Layer field. Qgis says it all went ok (and it loads the track in the viewer and it looks fine), but when I load the .gpx track into my gps device I only see a straight line into the sea.
For .kml: I did the "Save as", chose KML format, set the RS to EPSG:4326. Qgis says it all went ok, but when I load it in the viewer it looks just empty and in google earth I can see a huge red cross over Africa... and I was looking for a road in Sardinia.
Can anyone help me, please? Thanks a lot!


texts: Where are QGIS application setting file(s) stored?

texts:
I have some application settings (Windows/QGIS v2.0) that I would like to pass to other users (such as those settings defined under Settings menu>Options>Rendering tab).

In ArcGIS they are stored in a Normal.mxt file located:

  C:\Users\userName\AppData\Roaming\ESRI\Desktop10.2\ArcMap\Templates

I suspect in QGIS they may be stored in qgis.db located here:

  C:\Users\userName.qgis2

but I do not know for sure.

Where are these application settings file(s) stored?


texts: Deleting Relationship Class Programatically using ArcObjects?

texts:
I am having lots of trouble deleting the relationship that I create with this code. The last two lines below do not delete the relationship. I have tried many different things in an attempt to delete the relationship programmatically (to numerous to list) but i'm stuck pretty bad.

 Public Sub GetJoinTable2LayerCNT(ByVal pFLayer As IFeatureLayer, ByVal primaryKey As String, ByVal joinTable As ITable, ByVal foreignKey As String, ByVal relCardinality As esriRelCardinality)

  Dim dispTable As IDisplayTable = pFLayer
  Dim mrClassFactory As IMemoryRelationshipClassFactory = New MemoryRelationshipClassFactoryClass

  Dim relClass As IRelationshipClass = mrClassFactory.Open("TabletoLayer", dispTable.DisplayTable, primaryKey, joinTable, foreignKey, "Forwards", "Backwards", relCardinality)

  Dim distpRC As IDisplayRelationshipClass = pFLayer
 'display only matched rows
  distpRC.DisplayRelationshipClass(relClass, esriJoinType.esriLeftInnerJoin)

  Dim pDataset As IDataset
  pDataset = pFLayer.FeatureClass

  Dim pWK As IWorkspace
  pWK = pDataset.Workspace

  Dim pSelSet As ISelectionSet
  pSelSet = dispTable.SelectDisplayTable(Nothing, esriSelectionType.esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, pWK)

  _featurerowcnt = pSelSet.Count
  _tablerowcnt = joinTable.RowCount(Nothing)

 'remove relationship
  Dim relClassEdit As IRelationshipClassCollectionEdit = pFLayer
  relClassEdit.RemoveAllRelationshipClasses()


texts: When Executing Snap Tool, Automatically select feature when Multiple found

texts:
I currently have 50,000+ points that have to be snapped to lines in my fiber network. Issue is I do not have the time (or patience) to sit here and make the selection every time there are multiple objects within a meter. Is there a way to have it automatically select a feature and not interrupt the process by bringing up the dialog?
Possibly just select the closest feature and/or just select arbitrarily in the case of duplicate lines? I do not care at the moment if the incorrect line is selected for a small percentage, these will be QC'd at a later date.


texts: Getting extents of raster with GeoTransform

texts:
I'm trying to better understand GeoTransform. For getting the extents of a raster, I've seen solutions posted such as below. But doesn't this only account for perfectly square rasters? From my understanding it gets the upper left x and y geographical positions, gets the geographical distance covered by an individual pixel, and the amount of pixels.
import gdal
from gdalconst import GA_ReadOnly

data = gdal.Open('C:/Temp/myimage.tif', GA_ReadOnly)
geoTransform = data.GetGeoTransform()
minx = geoTransform[0]
maxy = geoTransform[3]
maxx = minx + geoTransform[1] * data.RasterXSize
miny = maxy + geoTransform[5] * data.RasterYSize
print [minx, miny, maxx, maxy]
data = None

upper_left = [minx, maxy]
bottom_left = [minx, miny]
upper_right = [maxx, maxy]
bottom_right = [maxx, miny]

If you were attempting to redraw the shape with this, it would only work for perfect squares right? If the lower left corner is shifted slightly further left from the top left, it wouldn't be accounted for?
When I do gdalinfo, I get the following results for corner coordinates:
Corner Coordinates:
Upper Left  (  248061.434, 4620818.949) ( 72d 1'39.76"W, 41d41'57.41"N)
Lower Left  (  248061.434, 4553370.949) ( 71d59'58.78"W, 41d 5'33.28"N)
Upper Right (  275337.434, 4620818.949) ( 71d42' 1.04"W, 41d42'26.81"N)
Lower Right (  275337.434, 4553370.949) ( 71d40'30.95"W, 41d 6' 2.06"N)
Center      (  261699.434, 4587094.949) ( 71d51' 2.32"W, 41d24' 0.34"N)


texts: ESRI world imagery raster layer not working in Python Console

texts:
Have been using the usual code in python console to use the world imagery layer as a base map and have been pretty happy with this, from IEQGIS page

qgis.utils.iface.addRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty+true","raster")

However, just stopped working...error msg below

It has been superseded by a plugin but can't find a way of getting this to work either. Any ideas why this does not work or which URL to put in the REST API?

Error message: Invalid Layer    GDAL provider: Cannot open GDAL dataset http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty+true: Invalid dataset dimensions : -2147483648 x -2147483648
Raster layer: Provider is not valid (provider: gdal, URI: http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty+true

Another more recent error:

GDAL provider: Cannot open GDAL dataset server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json: `server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json' does not exist in the file system, and is not recognised as a supported dataset name.
Raster layer: Provider is not valid (provider: gdal, URI: server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json


texts:
Does anybody know which CRS should be selected when georeferencing a Falklands map made in 1961? The map itself says only:

Grid: UTM Zone 21
Projection: Transverse Mercator
Spheroid: International
Meridian of Origin: 57° West of Greenwich
Latitude of Origin: Equator
Scale Factor at Origin: 0.9996
False Co-Ords of Origin: 500,000 m. Easting, 10,000,000 m. Northing

Another question is, what coordinate values are more suitable to georef this map? It has both 6/7-digit UTM coordinates and lat/lon values. However when I create control points with lat/lon values from the map corners I get 10 to 20 pixels error in every point, and the resulting map does not exactly match the overlaid OSM layer. Could this be due to incorrectly selected CRS? if not, what else could be tweaked here?


texts: Named map created with CartoDB Maps API not appearing in web interface dashboard

texts:
I am trying to learn how to use CartoDB and the CartoDB APIs - in particular the Maps API. I'm following along with the Named Maps Tutorial but I'm experiencing some confusion. When I create a named map using the Maps API it does not appear in the web interface. Here is the example MapConfig file that I'm using (called config.json):

{
  "version": "0.0.1",
  "name": "namedmap_tutorial",
  "auth": {
    "method": "open"
  },
  "layergroup": {
    "layers": [{
      "type": "cartodb",
      "options": {
        "cartocss_version": "2.1.1",
        "sql": "SELECT * FROM named_map_tutorial_table",
        "interactivity": ["cartodb_id", "name", "pop_max"]
      }
    }]
  }
}

It is a slightly abridged version of the example given in the tutorial (which I also tried using verbatim with identical results).

And here is the command I run to create the map:

curl \
-H 'Content-Type: application/json' \
-d '@MapConfig.json' \
-- \
"https://accountname.cartodb.com/api/v1/map/named?api_key=${CARTODB_API_KEY}"

After running the map creation command I get the following output:

{"template_id":"namedmap_tutorial"}

So it appears that the command executed successfully. As a sanity-check I run a command to list all named maps:

curl -s \
-- \
"https://accountname.cartodb.com/api/v1/map/named?api_key=${CARTODB_API_KEY}" \
| jq -r .template_ids[]

And sure enough, I get the following output:

namedmap_tutorial

Unfortunately when I go to the web interface I don't see the map appear in the dashboard. Why does my map not appear in the dashboard? How do I programmatically create maps in CartoDB?


texts:
I’m performing some habitat modeling for a certain species using resource selection functions to determine optimal variables for including as model parameters.  I am using OLS within ArcGIS for the regression analysis on variables trying to determine how the species selects for certain variables based on availability in the surrounding environment.

I have a series of known ‘presence’ and randomly generated ‘available’ sites; the response is binary with ‘presence’ as 1’s and ‘available’ as 0’s. I have 546 ‘presence’ points and 2730 ‘available’ points.

I have run OLS to produce a number of variable combinations that minimize the AIC.  However, once I go in and perform Spatial Autocorrelation (Moran’s Global), the results always indicate the data are clustered. My understanding is that if the Moran’s results indicate clustering, then the variable coefficients, etc. should not be trusted/consulted as it will over/under-predict in some portions of the model.  If that’s the case, how can I arrive at results that are not clustered?

Secondly, when performing OLS, I’m curious if there’s a specific way to remove variables that are either insignificant or highly correlated.  For example, if I run OLS on say 24 variable combinations, perhaps half are returned as significant, and the other half are indicated as insignificant.  In addition, some have very high VIF, while others are low.  My question is, when removing variables to optimize the variable combination, is it best to first remove variables by order of insignificance,  or is it best to eliminate variables with high VIF regardless of insignificance?  In my experience, I’m not sure that there is a ‘best’ method, but curious if others have any insight based on their experience.

Thanks in advance for any help.


texts: 'Split by Attribute' Tool is returning an empty attribute table for new records

texts:
I have point data (about 1000 points) in a .mdb.  One of the columns within the database is "State", and when I ran the "Split by Attribute" tool by state the new returned records were correctly split by state.

I then added a new column to the database, "Sample_Year" in which every point was assigned either 'Year 1', 'Year 2', 'Year 3', 'Year 4', or 'Year 5'.  When I ran the 'Split by Attribute' tool to split the points by "Sample_Year", 5 records were returned, correctly named ("Year 1', "Year 2...) but the attribute table for each record was empty and no points were actually plotted on my map.

Any ideas on what might be causing the empty return?

I believe I'm using the tool correctly as the first time I tried it with an existing column it worked correctly.  I've tried it on other existing columns since, and those all work too.  It's just this new column that I've created that returns empty attribute tables and no data.

I'm new to ArcGIS.


texts:
I have a vector layer of rectangles in QGIS 3 that I export as a .GeoJSON- file.

I want to change those geometries to new polygons with certain dimensions, for which I use Python. I then save those new geometries as first a pandas dataframe and then a .GeoJSON- file again, which I then want to open again in QGIS 3.

The problem is that the new layer is opened, but there is nothing to be seen on screen. The problem, I think, is in the formatting of the python-generated .geojson file. Here is a sample of one feature (the file contains about 2300 features):

{
  "type": "FeatureCollection",
  "name": "Test",
  "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" }},
  "features": [
    {
      "type": "Feature",
      "properties": {
        "ID": 0
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            6.334986208752899,
            50.62066998876687
          ],
          [
            6.334986208752899,
            50.59616998876687
          ],
          [
            6.2952362087528995,
            50.62066998876687
          ],
          [
            6.2952362087528995,
            50.59616998876687
          ]
        ]
      }
    },

After which the next feature comes, until the remaining blocks are closed with one ] and one }.

I am not too familiar with these types of formatting, is there something wrong with this for a vector layer of rectangles?


texts: QGIS Georeferencer tool not keeping inserted coordinate values

texts:
I'm currently giving a basic training course on QGIS and, on the last class, one of the students stumbled upon a problem I wasn't able to solve - nor can I find a reason for it.

We are using QGIS 2.10.1.

I was showing them how to use the Georeferencer and, whenever she introduces a control point and types in the corresponding coordinate, nothing happens in the GCP table - i.e., she adds the new control point, types in the coordinate, but the table fields "Dest. X" and "Dest. Y" remain with "0", no matter what we try. We also tried to edit those fields directly in the table, but they do not change their value.

I also attempted to install Qgis 2.8 on her machine, to see if that could be a solution, but the Georeferencer showed the same behavior.

She used exactly the same installer as the other students in class (and myself) and she was the only one with this problem. All computers in class are running Windows (mostly 8 and 8.1, but I think there is one machine running on Win 7, not sure right now) and from what I can recall, all the machines are 64-bit.

Does anyone have any idea what could be causing this?


texts: Geographically weighted regression for GPS tracking data?

texts:
The study I am working on has GPS locations at 4 hourly intervals of 5 lions in 3 National Parks over roughly 2 years in Namibia. I have been applying Geographically weighted regression analysis to the data. The study area is broken up into 11988 1 x 1km grid cells and for each grid cell I have calculated the frequency of lion occurrences. This count data I then log transformed to improve the skewness and kurtosis values of the data. The total number of grid cell with lion occurrences is 1460. For each grid cell in the study area I then calculated the distance to park boundary, distance to nearest settlement, distance to major road and distance to river. These are then the factors I then use as explanatory variables in the geographically weighted regression and the dependent variable is then the log transformed lion count.

Most of the literature I found using geographically weighted regression was usually for planned surveys with transects and systematic data collection, so if there is a survey point which has zero values it is included in the analysis.

Can I apply the same principal to the grid cells with zero value in the study area or should I be running the geographically weighted regression only on the grid cells which actually have lion readings as I did not confirm there is no lion activity in those grid cells which have zero GPS readings from the collar information?

I have run the GWR using all grid cells and lion only grid cells with a bandwidth of 125 neighbours, and the lion only analysis has a significant better AICc value.

If it is easier to include a table of my results I can do that too.


texts: Using a loop in a python expression to stack labels while avoiding zero value attributes

texts:
I have a number of point features in a map in ArcMap 10.6 that I would need to label based on information form three fields (Test1, Test2 and Test3) with numeric values. The labels from these 3 fields would have to be stacked. And each of these labels would have to appended with a date text. The format of the label would be something like this;

Some of the records in these fields contain zero values and so it would be required to loop through these fields and skip the zero values. That is not to have them displayed in the label. Currently I have the following scripts to work with;

-script to stack labels
-This does not skip through zero values

def FindLabel ([Test1] , [Test2] , [Test3]):
      return "05/10/2018" + " - " + [Test1] + "\r\n" + "05/10/2018" + " - " + [Test2] + "\r\n" + "05/10/2018" + " - " + [Test3]

-script to skip "0" values in the fields and  stacks the labels, however does not append text string to each attribute value.

def FindLabel ( [Test1] , [Test2] , [Test3] ):
  fields =  ([Test1] , [Test2] , [Test3])
  label = ""
  for field in fields:
    if field == "0":
      continue
    else:
      label = label + field + "\n"
  return label

Is there a way achieve this using a python label expression in ArcMap 10.6


texts: GDAL: GeoTIFF bands that represents surface classification into point cloud

texts:
I have a file originally in ECW format, after being able to convert it into GeoTIFF since then I can open it in QGIS, I can see the result as:

red band: buildings.
green band: vegetation.
blue band: water.
gray: terrain.

The idea that I have is to split that terrain into 3 files for each band. And convert each into a point cloud format, finally merge three of them into the final point cloud. Ideally I would like to keep the information for each point to which original band belonged just for a classification matter.
When I try to extract just one band with GDAL, I get the very same raster file with all the bands but in gray colors.
gdal_translate -b 1 input.tif output.tif

This are 3 images extracting each band plus the original, as you can see even though in two there are differences in pixel darkness, it is not what I expected.

What can I do for this workflow? How would you separate the color bands?
I'm using QGIS, GDAL and Cloud Compare.


texts: Equivalent of 'Left' function in Select_analysis

texts:
I tried to find the equivalent of Left fuction because it doesn't work in ArcGis. I found a post that suggested the word substring:

the query is:

WHERE (IAS.C_A)<>Left([C_A1],5)));

and I tried:

"('IAS.C_A')<>substring(['C_A1' from 1 for 5])"

in the function:

arcpy.Select_analysis(in_features=TW,out_feature_class='ac',
where_clause= "('IAS.C_A')<>substring(['C_A1' from 1 for 5]))";

but shows error in syntax.

ANSWER

"'IAS.C_A'<>'substring(C_A1, 1 ,5'")

For each part we add a single quote and a double one in the start and one in the end of the where clause.


texts:
I am using leaflet.js to allow web users to select a region. Valid regions are US states, Canadian providences, and world countries (except for US and Canada). I constructed a shapefile myself using Qgis and saved it as a geojson. I simplified the geometries as much as  I could.

The resulting shapefile is 400kb, but the geojson is over a megabyte. This is bigger than I would like. I need to reduce the network overhead involved in transferring this information.

What is the right way to do this? The options I can imagine are:

Serve the geojson file gzipped, unpack on the client.
Parse the shapefile on the client to geojson
Generate my own tiles from the shapefile and serve those

If anyone could tell me which option is the best (or none of the above) I would appreciate it!


texts: One invalid QGIS layer makes all layers not to work/be served

texts: When there is one layer that is invalid in QGIS project none of the layers are working: I mean if layer A is invalid and layer B is perfectly fine then WMS GetMap requests for layer B return 500 server error and in QGIS server logs I can see that B layer request fails because layer A is invalid. How to disable this behaviour of QGIS?


texts:
The "show expansion" option in the web interface, how do i invoke that from the command line. I am trying something like this...with "debugExpansion=true"...

http://:8888/Osm2poService?cmd=fr&source=486477&target=0&findShortestPath=false&ignoreRestrictions=false&ignoreOneWays=false&routerClassId=0&heuristicFactor=0.0&maxCost=1.0&debugExpansion=true&key=Key&value=Value&format=geojson

When I run this, I get a "ERR.1 No route found" return value. I want to get the convex hull that shows up in the web interface.


texts: How to change the particular letter color in text box using python

texts:
I need to highlight the particular letter in a text box using python.
  I am using the below code but it changes the entire text color in text
  box. Kindly suggest any other ideas.
         I am using both QlineEdit and QTextEdit objects.

 if self.dlgAttribute.ui.txtPartDesc3.text()!="":
    partDescValue = self.dlgAttribute.ui.txtPartDesc3.text()
    if not partDescValue in self.englishArray:
        font.setPointSize(11)
        self.dlgAttribute.ui.txtPartDesc3.setFont(font)
        self.dlgAttribute.ui.txtPartDesc3.setStyleSheet(_fromUtf8("color: rgb(255, 162, 0);\n"
        "background-color: rgb(41, 91, 170);\n"
        "font: 750 10pt \"Arial\";"))
    else:
        font.setPointSize(11)
        self.dlgAttribute.ui.txtPartDesc3.setFont(font)
        self.dlgAttribute.ui.txtPartDesc3.setStyleSheet(_fromUtf8("color: rgb(0,0,0);\n"
        "background-color: rgb(255, 255, 255);\n"
        "font: 750 10pt \"Arial\";"))
else:
    font.setPointSize(11)
    self.dlgAttribute.ui.txtPartDesc3.setFont(font)
    self.dlgAttribute.ui.txtPartDesc3.setStyleSheet(_fromUtf8("color: rgb(0,0,0);\n"
    "background-color: rgb(255, 255, 255);\n"
    "font: 750 10pt \"Arial\";"))


texts: Removing polygons based on size of polygons in Python without using ArcPy?

texts:
I am new to GIS. I want to remove some smaller polygons and only leave the polygons with a larger areas in Python scripts. Like this:

Here is the source files Shape files: buildings. I am thinking whether I can set a threshold for the size of the areas then remove them, but I don't know how to do this in Python.

Using the help by @Iridium , then I am able to compute the area of the polygons by this link Calculate area of polygons using OGR in python script

from osgeo import ogr

driver = ogr.GetDriverByName("ESRI Shapefile")
dataSource = driver.Open(shapefile_to_be_used 1)
layer = dataSource.GetLayer()
new_field = ogr.FieldDefn("Area", ogr.OFTReal)
new_field.SetWidth(32)
new_field.SetPrecision(2) #added line to set precision
layer.CreateField(new_field)

for feature in layer:
    geom = feature.GetGeometryRef()
    area = geom.GetArea()
    print (area)
    feature.SetField("Area", area)
    layer.SetFeature(feature)

dataSource = None

But how to filter out the polygons with small areas?


texts:
I have the following shapefile of a 10x10 degree latitude/longitude grid that I created in QGIS. I can read it into R using the rgdal package.

Grid<-readOGR(".","GridShapeFile")

It has the following attributes and structure.

summary(Grid)

Object of class SpatialPolygonsDataFrame
Coordinates:
   min max
x -180 190
y -100  90
Is projected: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]
Data attributes:
       ID             XMIN           XMAX           YMIN           YMAX
 Min.   :  0.0   Min.   :-180   Min.   :-170   Min.   :-100   Min.   :-90
 1st Qu.:175.5   1st Qu.: -90   1st Qu.: -80   1st Qu.: -60   1st Qu.:-50
 Median :351.0   Median :   0   Median :  10   Median : -10   Median :  0
 Mean   :351.0   Mean   :   0   Mean   :  10   Mean   : -10   Mean   :  0
 3rd Qu.:526.5   3rd Qu.:  90   3rd Qu.: 100   3rd Qu.:  40   3rd Qu.: 50
 Max.   :702.0   Max.   : 180   Max.   : 190   Max.   :  80   Max.   : 90

# An example row of the data
Grid[50,]
class       : SpatialPolygonsDataFrame
features    : 1
extent      : -60, -50, 70, 80  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84+towgs84=0,0,0
variables   : 5
names       : ID, XMIN, XMAX, YMIN, YMAX
min values  : 49,  -60,  -50,   70,   80
max values  : 49,  -60,  -50,   70,   80

I would like to learn how to create this same grid/shapefile entirely within R, rather than in QGIS, as well as grids of other sizes (1x1,5x5,etc.). The ultimate goal is to use over() in the sp package to overlay this grid onto another file of polygons and count the number of grids intersected by each polygon. I already know how to do this next step (I think), I just want to know how to generate the grid layer in R.


texts:
How do I get the output messages from ogr2ogr, when I call it from another windows application?

I have tried with standard "ogr2ogr.exe>log.txt", but it keeps writing to the console.


texts: How to find shortest paths between one destination and multiple origins in ArcGIS?

texts: I am working on landfill site analysis. I have a landfill site (point) in my data. I want to connect the landfill point with different locations(points) in my study area using shortest paths. I have tried new route and closest facility tools with no success. I am getting route between one destination and one origin only. Could somebody please help me to solve this problem?


texts:
Does anyone now how to add a group layer with Python in ArcGIS Desktop 10?

I can use arcpy.mapping.AddLayer but surely this is only for an actual layer as opposed to a group layer.

so far I have this

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.listdataframes(mxd, "layers")[0]
arcpy.mapping.AddLayer


texts:
Can I close the gap between these two polygons automatically, without using editing tools?

Is there a plug in to do this?


texts: How to use insert extension for more than one value

texts:
I am trying to insert 2 values into the 'extensionsofArcGIS' variable as you can see below, just not sure how to insert more than one at a time? I have tried a few different variations but still no luck..

extensionsofArcGIS = ['3D Analyst', 'Spatial Analyst', 'Geostatistical Analyst','Network Analyst', 'ArcScan']

extensionsofArcGIS.insert(1,'Terrain Editor')(2, 'Test')

extensionsofArcGIS.sort()

print extensionsofArcGIS


texts:
Is there a way to import a .qpt file to a CAD software?

Explaining:

I just finished a print composer for my project in QuantumGIS but I have a collegue that only works with AutoCAD, and he is the one who is going to do the follow up of this project.

So, I have to export my work so that he can use the same layout for the same client!

Can it be done? Or the only solution is to export as image and then do it "by hand"?
But what about the fonts/size of titles/legend, etc, etc...


texts: Python labeling Expression how to change font size?

texts:
I have a labeling expression using two attributes I want the first one to be size 14 and the second one to be on a new line and be size 8. This was my attempt so far:

"<FNT name='Arial' size='14'>" & [Sec_Unit_L] & "</FNT>" +  "\n" + "<FNT name='Arial' size='8'>" & [TWP_Label]  & "</FNT>"

I get the following error message


texts:
I think this is a general enough question to apply to more than just gdal_calc, but perhaps not.  When I run

gdal_calc.py -A map.tif --outfile=deforestation_00-10.tif --NoDataValue=0 --calc="A >= 7"

on a 38000 x 38000 62.5MB tif, the output is 1.37GB (and still 38000 x 38000).  I feel like i'm probably missing something big here, i.e. how tif data is stored.  [the same thing happens when I run it using the raster calculator in qGIS]  Thanks in advance.

Bonus points--anyone know how to include and/or logic in the --calc="..." in order to evaluate the following: (map@1 >= 7 AND map@1 <= 9) OR ((map@1 >= 10 AND map@1 <= 12) * 2)


texts: Adding Multiple JSON Layers to Leaflet Map

texts: I'm trying to put two different json files over a single map. One is drawn by zip code boundaries, the other is county. For some reason, I can't get my leaflet to work. IF someone can help point me to where the issue lies, that'll be great!


texts: Using ModelBuilder, how to define directory while using Python script?

texts:
I have a model (shown below) in which at the very end of it I run a Python script ('SumFieldInsertNew'). One issue I'm having is that I'm creating this model for an end-user that will have little to no knowledge of most things computer-wise. Ergo, I'm trying to make it as hassle-free and flexible as possible. My question is, I want the user to be able to name the file the script will run itself on, but am unsure of how to do something like this. So essentially, I want to make 'Empty FC' a parameter in which the user can decide what they want their file to be named. Then have the Python script directory code (where it's defining the feature class), know that whatever the user named it is conditional to it being able to run its processes.

My model runs as follows:

It establishes a connection to an Oracle dB
It creates a Query Layer based on the pre-filled 'Query' parameter
It creates an empty feature class (Empty FC) into a pre-filled GdB parameter
It then exectures the 'Copy Features' tool on the Query Layer and outputs the copy into the Empty FC
This newly populated feature class is then given a new field, called 'SUM_Quantity_Solid'
In which lastly, this new field is populated via the Python script 'SUM_FIELD_INSERT_NEW', which (as seen below), SUMs up a field and then inserts the values.

> import arcpy
>
> # Define the feature class
    fc = r'User_Defined_Path'
>
> # find the unique 'SEGMENT_LENGTH' values
    Slist = list() for row in arcpy.da.SearchCursor(fc, 'SEGMENT_LENGTH'):
>     # if the value isn't in the list then add it to the list
>     if not row[0] in Slist:
>         Slist.append(row[0])
>
> for Value in Slist:
>     # definition query to limit the rows in the cursor
>     DefQ = 'SEGMENT_LENGTH = ' + str(Value)
>
>     # Use a generator expression to populate a list from the 'QUANTITY_SOLID' field
>     b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID'),DefQ)
>
>     with arcpy.da.UpdateCursor(fc, ['QUANTITY_SOLID_SUM'],DefQ) as cursor:
>         for row in cursor:
>             row[0] = b
>             cursor.updateRow(row)

As referenced, I would like to be able to have

  fc = r'User_Defined_Path'

be what the user initially defined the 'EMPTY FC' filename parameter as.


texts: Label a layer by excluding specific features in QGIS

texts:
I would need to label a layer excluding specific features based on the value of an attribute, ie

I would not want to appear the labels like 'xxxxxx_FIUME_xxxxx' or 'FIUME_xxxxx' etc.
I tried using the rue-based option with an expression like "NOME" NOT LIKE '% [_]FIUME%' but without success (all features are found).
How can i solve the problem?


texts: Georeferencing NASA, NOAA, and Natural Earth Projections in QGIS

texts:
I'm new to QGIS. I'm currently using the newest version-- 3.10. I downloaded a raster projection (a tiff file) and vector data (SHP files of coastlines and rivers) from Natural Earth I to import as layers into QGIS. These opened correctly.

Then I downloaded several Plate Caree (WGS 84) projections from NASA Visible Earth and Natural Earth III. I could not find GeoTiff versions, so these are JPEGs. [On the Natural Earth III website it did have a folder with georeference data-- a text file and .tfw file.]  I've tried two methods for Georeferencing these:

Using the pulldown menus: Raster > Conversion > Translate (Convert Format).. I selected Plate Caree. It appeared to work correctly, but when I added the vector layer with rivers, the vector layer appears tiny compared to the Natural Earth layer.
I used the 'Georeferencer' plug-in. It took a long time, and I still was not sure if I had done it correctly. This time when I tried opening the Rivers Vector layer, I could not see that layer at all.

Is there a way to quickly and accurately georeference a world map that is in JPEG form if you know the CRS?

NASA and NOAA mainly use Plate Caree, so is there a way I can tell QGIS that is the map I am using, so it accept the CRS?


texts: Toggle between languages in ArcGIS Online

texts:
I'm making a tourist map for out municipality in ArcGIS Online. I would like to have it in 2 Languages (English and Norwegian). I have two separate layers for each Language Version.

Does anyone know if it is possible in ArcGIS online to set two buttons that will toggle between 2 Languages?

The way I have it now, is that I have set 2 separate widgets, one for English Version and one for Norwegian Version. The problem is, it doesn't really toggle between Languages. I still have to go in and switch off one layer before switching on the other.

Has anyone tried this before?


texts: Get geometry from OpenLayers.Control.WMSGetFeatureInfo JSON

texts:
I need to store the geometry of a certain feature with OpenLayers.Control.WMSGetFeatureInfo and I'm using these parameters to get it in JSON format

output:'features',
infoFormat:'application/json',
format: new OpenLayers.Format.JSON,

After I store the geometry from the JSON, I'm writing a WKT string with it to get something like.

"MULTIPOLYGON(((-8.098636886812224 39.016921320632704, -8.098572979051546 39.016543430309326,)))"

The problem is that I don't know why but the JSON geometry object is coming with a comma  between the LAT and LONG  like so:

 "MULTIPOLYGON(((-8.098636886812224,39.016921320632704, -8.098572979051546, 39.016543430309326)))"

What's the best way to get a correct WKT string from the event.features JSON Object or in alternative how to replace every other comma  with a blank space using a regular expression in JavaScript?

Replacing the first and keeping the second?


texts:
I have a surface representing a DEM and i would like to add it some thickness. If i simply duplicate the surface and translate it down by my thickness, i get non uniform thickness, ie thinner where the slopes are. I need constant thickness all along the surface.

I am thinking i need to perform some buffering/extrusion of the surface. I started working out some algorithm by dividing my mesh into triangles, taking the normal from the center and creating a new point at the thickness distance. I am a bit stuck on merging those points...

Is there a library/algorithm out there, preferrably in Java, that i could use to achieve the above?


texts: how to change color of all circlemarkers in leaflet.js

texts:
I have a leaflet map that has the data loaded as points, using:

 pointlayer = new L.GeoJSON(geojson, {
    pointToLayer: function (feature, latlng) {
        return L.circleMarker(latlng, geojsonMarkerOptions
        );
    }
});
pointlayer.addTo(mymap);

And the geojsonMarkerOptions are:

var geojsonMarkerOptions = {
    radius: 4,
    fillColor: "#0163FF",
    color: "#0163FF",
    weight: 2,
    opacity: 1,
    fillOpacity: 0.4,
};

What i would like is to change the circleMarker color and fillColor for every circleMarker on baselayerchange. I can get the baselayer change and change the label color just fine, but can't seem to figure out how to do the circleMarker.

mymap.on('baselayerchange', function(e) {
   if (e.name === "Basic") {
       $( ".my-labels" ).css( "color", "#0163FF" );
   } else if (e.name === "Satelite") {
       $( ".my-labels" ).css( "color", "#FEFF01" );
   }
});

I have tried to set a class for the markers, but i can't seem to call it. If I can't get any other solution, I'll have to clear my datalayer and reload it with the new color, but would rather not do that unless necessary.


texts:
I am trying to open a GeoJSONP file hosted in PostgGIS (GeoServer). Everything is ok, except one file that has 960 features and the following code do not open every features:

http://localhost:8080/geoserver/...
service=WFS&version=1.0.0&request=GetFeature&typeName=pqi_data%3Acentros_saude_4326&maxFeatures=50&outputFormat=text%2Fjavascript

So I thought that is related with the maxFeatures parameter which by default is 50. I changed to 1000 (because I have 960) but gives an error. So I find that the maximum value is 200. How can I increase this limit?
I try in GeoServer settings but nothing works.


texts:
I hope someone can help.

THE ISSUE:
I work for a company where 90% of the personnel work remotely.  The GIS department acts as a support tool authoring content for a variety of projects.  There is a need to create a workflow where employees can access basic base maps to view authored content on base maps without having to put in a request to the GIS department.  The hope is that someone can RDP to a computer or login via a website to access data and to capture basic elements of a geographic location (lat/long, geographic extent, etc) while viewing and printing authored content.

CURRENT WORKFLOW:
Employees put in a request via email to the GIS department.  This workflows creates a backlog.

QUESTION:
Is there a free solution that can be utilized out of the box with little or no required knowledge of programming code to set up the tool?

thanks
Jay


texts:
I have a qgis vector representing a country.

This country countains many houses.

I want to join together every 600 houses starting from the bottom to the top with python and qgis.

I have a field called number_of_houses.

In the picture you can see the map and the number of houses in each cell.


texts: Copying a Shapefile without affecting the original?

texts:
I have a layer in ArcMap 10.2 that is one big shape made up of five smaller shapes. I need to create a layer with only four of those shapes, for the purpose of showing the difference in areas when the fifth shape is not included.

I've noticed that a simple copy and paste of the original shapefile back into the Table of Contents is not a good idea as any changes I seem to make to the new layer also affect the original layer.  Is there a simple way to go about doing this? If it's relevant/useful I have the free version of XTools Pro.


texts: CSV with geometry column in JSON format to GeoDataFrame

texts:
I have a csv, that I want to open as a GPD, the problem is the geometry column "geo_shape"

I want to convert that column to the proper geometry format, could you help me?
The link to the csv file
https://datos.cdmx.gob.mx/dataset/04a1900a-0c2f-41ed-94dc-3d2d5bad4065/resource/03368e1e-f05e-4bea-ac17-58fc650f6fee/download/coloniascdmx.csv


texts:
I am trying to load dwg in GeoServer and show it in OpenLayers, so I saved the dwg as dxf with AutoCAD. Then I used QGIS to save the dxf as shapefile.

But when I am trying to load the shapefile with GeoServer it can't calculate the bounds, and if I am trying to manually put the bounds it doesn't display the shapefile layer.

This is the way to display dwg? I did something wrong? There is other way?


texts: How to split a vector into equal smaller parts in QGIS or similar?

texts:
i want to divide a shapefile with many tiles into a lot of smaller tiles.
I am searching for a smart solution, because manual edits are out of questions

Anyone can help or know a nice function?


texts: How can I create geometry in SQL2012 with custom SRID?

texts:
I want to create geometry using EPSG 2039 in mssql 2012.
This srid doesn't exist in sys.spatial_reference_systems

any idea how I can do it ?


texts: Finding high resolution DEM data for small area in Japan?

texts:
I'm working on an app to visualize terrain data in virtual reality for a small mountainous region in Japan (centered around Hakuba).  The freely available data I've found for this region (ASTER, SRTM for example) is limited to 30m in resolution.  The purpose of my project is to be able to explore navigation routes through the mountains, so 30m data is very limited in that it's difficult to see creeks, small cliffs, etc.  Even so, Google Earth (which I presume to be of around 30m resolution in this area though I don't know) is very useful.

I know that sub 5m resolution map data exists for some parts of the world, and I think that data at this resolution could be even more useful to me.  I've done some digging and sent a few inquiries, but the GIS world is new to me and I'm not sure if I'm talking to the right people or asking the right questions.  I'm willing to pay for the data, though as this is a personal project I wouldn't want to pay more than a few hundred dollars, and I have no idea what high res DEM data costs for such a small region.

Additionally, I'm not entirely sure if I want raster data or vector data.  My purpose is to generate a textured 3d mesh based on the data, so I suppose either would work.


texts: How to display geoprocessing service results in an ArcGIS Online Map?

texts:
I am implementing a python script that filters features in a feature service. For this I used the following lines of code:

import arcpy

# URL with service, where clause and field parameter
baseURL= "https://services2.arcgis.com/50d5wsDbZicDslDY/arcgis/rest/services/Gewerbefl%C3%A4chenkatalog/FeatureServer/1/query"
where = '1=1'
fields ='Ort, PLZ, Gesamtgroesse'

#The above variables construct the query
query = "?where={}&outFields={}&returnGeometry=true&f=json".format(where, fields)
fsURL = baseURL + query

fs = arcpy.FeatureSet()
fs.load(fsURL)

arcpy.CopyFeatures_management(fs, r"c:\test\test.gdb\result")

I want to publish this script as a geoprocessing service on an ArcGIS for Server 10.3 and use the service in ArcGIS Online.

How can I modify the script respectively what do I have to change in the script so that the result of this query is shown in an webmap in ArcGIS Online or in ArcMap?

I have heared that I could use arcpy.SetParameter() to create an output but in my tests this idea failed every time.

I know that I could use the "Filter Widget" in ArcGIS Online, but this widget is currently not very flexible regarding optional filterparameters and so my idea was to build my own tool.


texts: Least cost path creating unwanted straight lines

texts:
I’m very much a beginner with GIS and I’m stuck creating a least cost path.

Basically, I’m trying to highlight which river valleys would most likely be flooded in the event of a volcanic eruption producing a mudflow, which would usually follow the steepest path available.  I’m using a DEM as my cost surface raster.

As I understand it, I would have to reclassify the DEM before I use the cost distance tool and then the least cost path tool. However, as I want the LCP to follow the river valley, I would need to reclassify the DEM to have many breaks (or even use the unique values button) so that the river valley is still visible and not all merged into one. Right? Or does the DEM have to be reclassified into 9 subgroups? If so, I then lose the river valley outline and I’m not sure what to do from then on. (I’ve attached some screen shots to hopefully show this).

Then I come to my next problem… If I try reclassifying the DEM so that it has 100 equal breaks and then using the cost distance tool, (with a point feature at the volcano’s vent as the source data and the reclassified DEM as the cost raster) I get the expected cost distance raster and back link raster. I then input these into the LCP tool along with another point feature that I’ve randomly placed somewhere down slope of the volcano for the destination data, I get a path output, but it’s basically a straight line and doesn’t really follow any of the river valleys like I was hoping/you would expect?


texts:
I have single band raster files that I am trying to style using Singleband pseudocolour under the Layer Properties, Style settings, and a colour map textfile that I upload for styling. When I upload the colour map, it looks alright, in the order I want it to be

However, after I apply the style, and look back in the Properties, the order seems to be messed up

I know there are multiple 0 values for which I have determined a different colour, but I would like the lightest colour for all the 0 values. Is there any way to ensure the colour is displayed in the specified order from top to bottom?


texts: QGIS generate convex hull for common attributes that have many values

texts: If I have a points file where the points share common attributes, what's the best way to draw a convex hull around those common points using QGIS?


texts: CQL_filter parameter on WMS layer doesn't work

texts:
I am trying to filter my WMS layer using CQL_filter parameter as:

 wms_layer =  new OpenLayers.Layer.WMS( "Larisa","http://localhost/geoserver/gwc/service/wms",
            {
                layers: 'esot:clusternodes_',
                format:  "image/png",
                CQL_FILTER: 'cluster=1',
                transparent: true,
                version: "1.1.1"
            },
            {
                displayOutsideMaxExtent: false,
                projection: new OpenLayers.Projection("EPSG:900913")
            }
        );

 map.addLayer(wms_layer);

For some reason the filter doesn't work and all the layer is shown on the map.
I have checked the version and it must be correct. I use OpenLayers 2.12 and my GeoServer is 2.6.0.

I have tried to remove from the layer the workspace name ('esot') but then the layer fails completely to load.


texts: Interpolating point on each line from vertex in QGIS

texts:
How can I interpolate a point on each line from the vertex? I need to interpolate each vertex along the line for a certain distance. I need offset on all lines.
Standard QGIS tools shift incorrectly and the direction is lost. I think that the problem can only be solved using the geometry generator, function line_interpolate_point().

How can I generate interpolation across all lines?

I want to get these lines with arrows.


texts: Print composer and atlas feature on large dataset

texts:
This question could be very complicated, so I'll try to be as clear as I can.

I have a polygon (hundreds of cells) that has a quite rich attribute table (more than 30 fields).

Each field contains the value of a certain pollutant (As, Sn, V and so on). So the attribute table has this aspect:

I would like to create maps with graduated colors for each field. Something like that:

Now I have two questions:

Which is the best, simplest and quickest way to create a map for each pollutant (so, actually, for each field)?
In addition to the map, it could be very very good for me to add a plot to the map composer. This plot is based on the same pollutant of the map:

I can easily prepare the plot with R and put them in a directory with the same name of the pollutant. For example, if the map is classified on Al values, and Al is the name that compares in the attribute table, the plot will be named Al.png.

Is it possible to speed up this process using the Atlas of the print composer together with R?

Does anybody have some hint?


texts: Assigning symbol and colour to attributes using Arcade expression and ArcGIS Online

texts:
I would like to use an Arcade expression in ArcGIS Online web maps to assign a symbol and a colour to different attributes. For example, if the attribute value is 'yes': the symbol is round and has a green colour. And if the attribute value is 'no': Symbol is a square and has a red colour.
Is this possible in an Arcade expression?


texts: Get the mouse event value from another module

texts:
I have two simple classes, one calls another. One of the classes is QGIS map tool and only returns the position of the clicked event to the method which activates maptool. I don't know how to do this. The following is the structure I am trying to do.
These two classes are located in two different modules

class Class1:
    def __init__(self):
        """Constructor."""

    def get_location(self):
        canvas = iface.mapCanvas()
        clicked_points=canvas.setMapTool(Class2(self,canvas))
        print(clicked_points)
        iface.actionPan().trigger()

class Class2(QgsMapTool):
    def __init__(self,canvas):
        QgsMapTool.__init__(self, canvas)
        self.setCursor(Qt.CrossCursor)
        self.parent_class=parent_class

    def canvasReleaseEvent(self, event):
        return [event.pos().x(),event.pos().y()]


texts: Geoserver Datastore Property Update via REST API

texts:
I am trying to change the properties of an existing Geoserver data store via the REST API. I have created the data store from an existing folder of shapefiles. However, I need to change the "charset" and "Create spatial index if missing/outdated" properties but I cannot for the life of me figure out how to do it.

I have tried sending the following XML as a PUT request to the data store but it doesn't work:

<DataStore>
  <parameters>
    <Parameter>
      <name>create spatial index</name>
      <value>true</value>
    </Parameter>
    <Parameter>
      <name>charset</name>
      <value>ISO-8859-1</value>
    </Parameter>
  </parameters>
</DataStore>

REST:

http://localhost/geoserver/rest/workspaces/uk/datastores/roads.xml
PUT /geoserver/rest/workspaces/uk/datastores/roads.xml

Anyone have any ideas?

Thanks


texts: Distance to water from every non-water pixel using Google Earth Engine?

texts:
I have an MNDWI (Modified Normalised Difference Water Index) layer for an area of interest (aoi). I then identified water sources as pixels with MNDWI > 0 and created a water layer where a pixel either has a value of 0 (no water) or 1 (water). Now, I would like to calculate the distance from every 0 (no water) pixel to the nearest pixel with water (value = 1) and get an output raster where its values correspond to distances. Below, is my code for calculating MNDWI and the water layer.

First, get Sentinel imagery:

var S2 = ee.ImageCollection('COPERNICUS/S2')
    .filterDate("2018-08-16", "2018-09-12")
    .filterBounds(aoi);

var image = ee.Image(S2.sort('CLOUD_COVER', false).mosaic());

Then, calculate MNDWI and the water layer:

var image_mndwi = image.normalizedDifference(['B3','B8']);
var image_water = image_mndwi.gt(0)

Map.addLayer(image_water, {}, 'water')


texts: Creating join between feature class and table created with InMemoryWorkspaceFactory?

texts:
I'm trying to join a featureclass contained inside a pgdb with a table created with an InMemory Workspace.

The in-memory table contains results that I want to use to define symbology on the featureclass.

The creation of the table goes well, I'm able to see the calculated data, but the IRelationshipClass created returns no records. I tried to use multiple fields to join the data without success. I also added the created table to ArcMap to create the join directcly in ArcMap, without success. It passes all the validations, but returns no records.

I tried to join my inmemory table with a shapefile featureclass instead and it worked.

Here's a sample of code

            // Create an in-memory workspace factory.
            IWorkspaceFactoryPtr ipWorkspaceFactory(CLSID_InMemoryWorkspaceFactory);

            // Create a new in-memory workspace. This returns a name object.
            IWorkspaceNamePtr ipWorkspaceName;
            ipWorkspaceFactory->Create(NULL, L"ValeursCalculees", NULL, 0, &ipWorkspaceName);

            INamePtr ipName(ipWorkspaceName);

            // Open the workspace through the name object.
            IUnknownPtr ipWorkspaceUnk;
            ipName->Open(&ipWorkspaceUnk);
            IWorkspacePtr ipWorkspace(ipWorkspaceUnk);

            IFeatureWorkspacePtr ipMemoryFeatureWorkspace(ipWorkspace);

            IDatasetPtr ipFeatureClassDataset(ipFeatureClass);
            CComBSTR strNomFC;
            ipFeatureClassDataset->get_Name(&strNomFC);

            IFieldsEditPtr ipFieldsEdit(CLSID_Fields);

                      ... Field creation code ...

            ITablePtr ipTable;
            ipMemoryFeatureWorkspace->CreateTable("InMemoryTable", ipFieldsEdit, NULL, NULL, NULL, &ipTable);

                     ... Table Filling code ...

            //IRelQueryTable
            IFeatureWorkspacePtr ipFeatureWorkspace(CTools::GetWorkspaceFromFeatureClass(ipFeatureClass));
            IObjectClassPtr ipObjectClass(ipTable);

            IMemoryRelationshipClassFactoryPtr ipMemoryRelationshipClassFactory(CLSID_MemoryRelationshipClassFactory);
            IRelationshipClassPtr ipRelClass;
            HRESULT hr = ipMemoryRelationshipClassFactory->Open(L"Join", ipFeatureClass, L"Numero_AD", ipObjectClass, L"NumeroAD", L"forward", L"backward", esriRelCardinalityOneToMany, &ipRelClass);

            IDisplayRelationshipClassPtr ipDisplayRelationshipClass(ipFeatureLayer);
            ipDisplayRelationshipClass->DisplayRelationshipClass(ipRelClass, esriLeftOuterJoin);

            //Add the table to ArcMap
            IStandaloneTableCollectionPtr ipStandaloneTableCollection(CTools::GetMap(ipMxDocument));
            IStandaloneTablePtr ipStandaloneTable(CLSID_StandaloneTable);
            ipStandaloneTable->putref_Table(ipTable);
            hr = ipStandaloneTableCollection->AddStandaloneTable(ipStandaloneTable);
            ipMxDocument->UpdateContents();

Am-I trying to do something impossible?


texts: ArcGIS Online scene viewer not displaying features

texts:
I am creating a few online scenes using ArcGIS online. To this end I have several different feature files that were multipatches but are now exported as a web layer. The export was done using ArcGIS Pro 2.2.1. The total scene I am trying to open conforms to all limitations I know of, mainly being less than 2000 points.

There are two features, this one was created at the end of March and displays fine when opened in an online scene. This one was created today and will not open in an online scene. I made both of them in the same way so far as I can remember. I am looking for any advice as to what I have done differently and how I may correct my workflow, as I have several other features to convert.

UPDATES:

-The features that work, when viewed in a local online scene, do not display the option for a texture. The features that do not work, do display the option for a texture

-Both files can be opened and viewed in an online map, just not in a scene

SD file for the feature that does work is here. The SD file for the feature that does not work is here.


texts: Pros/Cons of using 'ellipsoidal' for calculating geometry in QGIS?

texts:
When I have found geometry attributes in the past, I've found my distances are often out by quite a lot unless I use an ellipsoidal CRS to calculate them. Why is this the case?

Should I be using ellipsoidal or is there something wrong with what I'm doing. What is the advantage/disadvantage of using 'ellipsoidal' on QGIS to calculate geometry attributes?


texts: ArcObjects: How to make non-feature-linked annotation features with a simple line callout that remains functional?

texts:
I would like to make simple line callout annotation that is not feature-linked but remains functional when it is manually moved, i.e. the anchor point remains on the feature while the text moves.  I have tried making graphic text elements with simple line callouts and loading them into an annotation feature; however, the text box and leader line are combined into a static graphic when loaded into annotation.  The leader line is no longer functional; the anchor point doesn't stay anchored.  How might I do this programmatically in ArcObjects?  Will this only work if I automatically generate annotation from the feature class I wish to annotate?

Any answers or insights would be greatly appreciated.  Thanks, all.


texts: ArcGIS Pro - Interpolating causes longitudinal extent to increase (i.e. range(-180,180) instead of range(165,178))

texts:
I tried both IDW and (Ordinary)Kriging interpolations, setting both processing extent and mask (in the environment pane) for the study area, which works initially, as can be seen with the Raster layer on the right image. However, looking at raster information and extent, there are more columns than there should be and the longitudinal range goes from range(165,178) to range(-180,180).
I have tried using shapefile boundaries provided in the "living atlas" and a 25m resolution DigitalElevationModel (DEM) as the processing extent and masking but it still did not help.
Is this a bug?


texts: Getting features by attribute using PyQgis?

texts:
How can I get a feature's geometry from selection by attribute?

For instance from a point layer I want to get the geometry by the field CODICE filter (CODICE = A001).

I tried with:

layer = QgsMapLayerRegistry.instance().mapLayersByName("My_layer")[0]
selection = layer.getFeatures(QgsFeatureRequest(QgsExpression("\"CODICE\" = 'A001'")))
geom = selection.geometry()

It doesn't work, and the python console error is:

  AttributeError: 'QgsFeatureIterator' object has no attribute 'geometry'


texts:
I'm using the R package 'rastervis' to create a number of multi-plot figures. I'm continually running into alignment issues which I believe are the result of rounding in the plot legends. For example, a plot in which values are rounded to 3 decimal places will be shifted compared to those rounded to just two decimal places. Similarly, if two plots are rounded to 2 d.p. but one has minus values, this will also change the alignment of the plot (presumably because the '-' sign is taking up space within the plot).

I have attached an image of this misalignment and ask whether there is a simple argument which I haven't invoked which will fix the problem. After many search attempts I've been unable to find a solution. I've included some very low-tech red lines on this diagram to show how the plots are misaligned given legends with varying numbers of characters:

I would (ideally) like all plots to be left justified and to be the same width. This would hopefully align the legends too. All of the misalignment I'm experiencing really needs to be pushed to the whitespace on the right of the plot.

Here is a very quickly photo-shopped mock up of the intended result. Note how all plots and legends are aligned with any differences in whitespace given to the right of the plot window. I've done nothing to this image except shift the plots manually either left or right by a few pixels such that they align(i.e. I haven't resized the individual plots, I've just moved them slightly).

Here is a minimum reproducible example. The misalignment isn't quite as severe as my real-world example shown in the images but it is still apparent.

library(raster)
library(rasterVis)

r1 <- raster(nrow=18, ncol=36)
r1[] <- runif(ncell(r1)) * 10
r2 <- raster(nrow=18, ncol=36)
r2[] <- runif(ncell(r1)) * 2.345
r3 <- raster(nrow=18, ncol=36)
r3[] <- runif(ncell(r1)) * -4

p1 <- levelplot(r1, margin=FALSE, xlab=NULL, ylab=NULL,scales=list(draw=FALSE))
p2 <- levelplot(r2, margin=FALSE, xlab=NULL, ylab=NULL,scales=list(draw=FALSE))
p3 <- levelplot(r3, margin=FALSE, xlab=NULL, ylab=NULL,scales=list(draw=FALSE))

print(p,  split=c(1, 1, 1, 3), more=TRUE)
print(p2, split=c(1, 2, 1, 3), more=TRUE)
print(p3, split=c(1, 3, 1, 3))


texts: Why are symbols not displaying after adding them via the Python Console?

texts:
Steps to reproduce:

Create a new project->Add new Shapefile Layer(Polygon)->Click on the newly added Layer->Toggle Editing->Using the 'Add Feature' Tool draw a polygon and save the layer

Open the python console->Run the following lines of code in the python console

from PyQt4.QtGUI import QColor

layer = iface.activeLayer()
symbol = QgsLineSymbolV2.createSimple({})
symbol.deleteSymbolLayer(0)
symbol_layer = QgsSimpleLineSymbolLayerV2(QColor('red'), 2.0)
symbol.appendSymbolLayer(symbol_layer.clone())
layer.rendererV2().setSymbol(symbol.clone())
layer.triggerRepaint()
iface.legendInterface().refreshLayerSymbology(layer)

After running the above code the polygon stops displaying. Is this a bug in QGIS 2.18 or am I missing something?


texts: Using ogrinfo how to extract number of columns and attribute population?

texts: Currently i'm using this DO ogrinfo -al -so to extract Projection, Feature count, Field_names for a bunch of files in batch mode. Is it possible to extract number of fields & how many fields are populated with attributes ? For eg, let us assume a point file which has 70 points and three fields - ID, Name,Type. For those 70 points i would like to extract information of how many "ID" field has values, "Name" field has values and "Type" field has values.


texts: Extract single points of interest from OSM when described both as nodes and ways

texts:
I extracted both nodes and ways from OpenStreetMap in PostgreSQL with Osmosis. I'm looking for all restaurants in a given area. The issue is that some of them are coded in OSM as nodes and others as ways.

How is it possible to have only one point when it is represented both as a node and a way?

The intuitive answer is to intersect the ways with the nodes. If a node is inside a way, they will both count as one. Otherwise, if there is only a node or only a way without nodes inside, it's fine.

The 'geometry' column in the 'ways' table does not contain information (it has something like a geometry, but all values are similar). Or maybe it is possible to use the 'nodes' table?

The fundamental question is: How is it possible to have a proper geometry column in PostgreSQL with Osmosis?


texts: Which Geodatabase version is holding how manyUNPOSTED outstanding Edits?

texts:
I have this generic versioned geodatabase question i.e.Which Geodatabase version is holding how many UNPOSTED outstanding Edits ?, which may be crucial to identify the query performance bottleneck in any versioned enterprise geodatabase having large number of editors.
I have posted this query multiple times  including Esri support however could not get satisfactory resolution.
Version for ArcSDE10.2.2 to 10.4


texts: Desktop client symbolozing a WMS layer by sending SLD to the WMS server?

texts:
Objective is simple: finding 'desktop software' (such as ArcGIS, QGIS, etc) that can load a WMS layer, and then send its own SLD to apply to the WMS server in order to get the WMS layer back with the end-user specified symbology. I haven't found any desktop client that can do that. Any clue?

I am looking for desktop software that can be easily used by non-developers. This software would created SLD, send it to the WMS server and then display the resulting WMS layer with the SLD applied.

I know QGIS 1.8.0 can load/save layers in SLD and that there are plugins expanding SLD capabilities, but I haven't found any way yet to change the symbology of a WMS layer from within QGIS. Thanks! -- Alex

Related questions (which don't answer my specific question):
How to style a WMS layer?
Is it possilbe to change SLD from client side?


texts: query to check srid of features in feature class?

texts:
What query should I use to check the SRID of the features in a feature class? The storage type of the feature class in st_geometry?

I tried the following query but no luck :

select top 1 [geomColumnName].STSrid
from [schema].[feature class];


texts:
when I　used the Harvest operation by the pycsw, and there was a Exception as the following picture：

Picture 1: The Response of Harvest Operation

Picture 2: The document default.cfg setting
so how do I solve this problem?


texts: Deriving separate polylines from coded points using ArcObjects (Figure inside)

texts:
I have a single point featureclass that represents the left and right sides of a landform (the points are coded as either 'right' or 'left'). Visually I can pick out and digitize two lines along these points, however, I need to do this automatically using ArcObjects or calls to geoprocessing functions in Arc10.

The figure below shows the two separate lines that I want to automatically select (in red).

It is not as easy as selecting by attribute (e.g. 'right') and using Point to Polyline since there is no guarantee that these points are collected in order - the output polylines often jump all over the place.

Using a bounding polygon (see figure again) I have attempted to:
1) Split the polygon into lines at its vertices.
2) Select by attribute on the points (e.g. 'right).
3) Select by location on the polylines where they intersect the selected points.

The issue with this is I end up with extra lines selected as the points at the top of each desired line intersect with the "top" and "bottom" lines of my polygon.

Am I overthinking this? I just need to select the two longest 'sides' of the irregular polygon. Eventually I need to batch process this task on many point featureclasses, so they may not be as clear-cut/spaced as the above example.

EDIT: My desired output is a polyline featureclass containing the two separate polylines coded as right and left, respectively.