texts: Replacing attribute in layer's attribute table using PyQGIS?

texts:
I am automating the process of putting data collected in the field for a city's sewer system into QGis. With this script, I am trying to transfer the "tc" (top of casting, it's an elevation value) value from my GPS layer to my Structures layer. The script should be using the tc value from a highlighted GPS point and giving the highlighted structure the same tc value. My problem is in the last section (starting with struc_layer.startEditing()), where I can't figure out how to use the changeAttributeValues method to replace the tc value. The code is not raising an error, but it also isn't changing the structure's tc value in the attribute table.

Is there something different I need to do since I'm trying to edit a dictionary inside the dictionary of my attribute table?

   #Saves Structure Layer
   registry = QgsProject.instance()
   struc_layer = registry.mapLayersByName('Structures')[0]

   #Saves GPS Layer
   gps_layer = registry.mapLayersByName('2019 SEASONAL MH06-25')[0]

   #Save TC value in Structure Layer as variable
   struc_selected_features = struc_layer.selectedFeatures()
   for i in struc_selected_features:
       struc_attrs = i.__geo_interface__
       print(struc_attrs)#Output: printed dictionary of the selected Structure
   point's attributes!
   struc_property_values = struc_attrs.get('properties') #saves properties
   struc_tc_value = struc_property_values.get('tc') #saves TC as a variable
   struc_id = struc_property_values.get('id')

   #Save TC value in GPS Layer as variable
   gps_selected_features = gps_layer.selectedFeatures()
   for i in gps_selected_features:
       gps_attrs = i.__geo_interface__
       print(gps_attrs)#Prints dictionary of the selected GPS point's
   attributes
   gps_property_values = gps_attrs.get('properties') #saves properties
   gps_tc_value = gps_property_values.get('field_4') #saves TC as a variable

   #Replaces structure's tc value with gps point's tc value
   struc_layer.startEditing()
   caps = struc_layer.dataProvider().capabilities()
   if caps & QgsVectorDataProvider.ChangeAttributeValues:
       for feature in struc_property_values:
           attr_value = {4 : gps_tc_value}  #tc is the 5th key in the properties dictionary
           struc_layer.dataProvider().changeAttributeValues({struc_id :
   attr_value})
   struc_layer.commitChanges()
   print(struc_attrs)


texts:
I've been trying to do a few things with an ArcGIS Online free account, but they're not working the same way as with my various subscription and Organisation accounts.

Is there a feature limitation list or feature comparison available online that outlines what can and can't be done with a free ArcGIS Online account?

I did find an old link that sounds like there once was a comparison available, however this link now just redirects to ArcGIS Online product page (which ironically has the tagline Mapping Without Limits), and I can't find any comparison charts or limitation lists there.

The old link was ArcGIS Online - Features - Comparison Table

Please note that this is the Personal/Free ArcGIS Online, and not the free Organisation trial.


texts: How to import PyQGIS to standalone Python on Linux virtual environment?

texts:
I have a standalone script, to which I'd like to use functionalities of PyQGIS. I am using virtual environment for the whole project. Because PyQGIS is not available via pip I am trying to find a workaround.
Of course, I looked into PyQGIS Cookbook where I found important info:

You need to tell your system where to search for QGIS libraries and appropriate Python modules if they are not in
a well-known location - otherwise Python will complain:
import qgis.core
ImportError: No module named qgis.core

This can be fixed by setting the PYTHONPATH environment variable. In the following commands, qgispath should be replaced with your actual QGIS installation path:
• on Linux: export PYTHONPATH=/qgispath/share/qgis/python
Now, the path to the PyQGIS modules is known, but they depend on the qgis_core and qgis_gui libraries
(the Python modules serve only as wrappers). The path to these libraries may be unknown to the operating system,
and then you will get an import error again (the message might vary depending on the system):
import qgis.core
ImportError: libqgis_core.so.3.2.0: cannot open shared object file: No such file or directory

Fix this by adding the directories where the QGIS libraries reside to the search path of the dynamic linker:
• on Linux: export LD_LIBRARY_PATH=/qgispath/lib

The problem is, either I do not know where my qgispath is (I tried multiple different paths within my filesystem) or I am doing something else entirely wrong.


texts: How can I make new QGIS projects use absolute path by default?

texts:
New QGIS projects are saved with relative path location for data sources by default.

If you want to use absolute path, each time a new project is created, this setting needs to be changed in the project properties dialog box.

How can I make absolute path the default behavior for new projects ?


texts: Use Spatial Adjustment text links in Rubbersheet geoprocessing

texts:
How can one use the displacement link table created for use in the interactive Spatial Adjustment toolbar with the Rubbersheet Features geoprocessing tool?

The toolbar method uses a text file of displacement links, following pattern of ID  Source X Y    Destination X Y:

1   905653.9545 728436.4238 905130.0745 727809.7597
2   914841.5615 724105.0236 914777.3853 723706.6229
3   865711.6414 722514.3278 865431.546  722264.887

The gp tool can only use a line feature class for the displacement links.

We have the input text table already. It was very expensive to create involving many hours by several people to generate some 3500 displacement links, so there's a strong incentive to leverage it!


texts: How to use DotSpatial to project/reproject shapefiles on the fly

texts: I would like to use DotSpatial to reproject shapefiles on the fly before loading them to GeoServer. I've been looking for tutorials on how to get started with this in vain. Any pointers on where I can start will be highly appreciated.


texts:
I want to union two shapes which are not touching each other using ArcObjects.

I do not want to perform small buffer on two shapes and union them. This is because when we apply buffer round buffer 0.002 it creates lot of additional vertices.

This is very much custom requirement. Please help me how to proceed on this.


texts:
Im trying to access a WFS where the feature count is limited at each extent (ie layer with 1000 feature with a limit of 100 for extent). Whether or not its to maintain performance or purely just being restrictive, It's preventing me from viewing/extracting the entire dataset at once.

Is there a potential work around? Im thinking of creating a script that will allow me extract features at a smaller scale using a fishnet and export the features at that extent to a temporary shapefile and move on, then removing duplicates features once completed. I am not sure if this is a good idea or terrible one.


texts: Different Leaflet fillcolors for different layers

texts:
I have a leaflet map set up with two layers and I want them to use different colorization functions to color the choropleth shapes.

My shapes are set up in layers like this:

var povertyLayer = L.geoJson(statesData,  {
          style: getStyle,
          onEachFeature: onEachFeature
      });

      var raceLayer = L.geoJson(statesData,  {
          style: getStyle2,
          onEachFeature: onEachFeature
      });

      var rLayer = L.layerGroup([raceLayer]);
      var povLayer = L.layerGroup([povertyLayer]);

They're styled by different functions:

 function getStyle(feature) {
          return {
              weight: 2,
              opacity: 0.2,
              color: '#333',
              fillOpacity: 0.7,
              fillColor: getColor(feature.properties.inpoverty)
          };
      }
      function getStyle2(feature) {
          return {
              weight: 2,
              opacity: 0.2,
              color: '#333',
              fillOpacity: 0.7,
              fillColor: getColor(feature.properties.ratio)
          };
      }

But they use the same accessor function to apply colorization to geojson features:

function getColor(d) {
        if (regionalDataset == 'inpoverty') {
           return d > 25 ? '#f4bd33' :
            d > 15 ? '#fac961' :
            d > 10 ? '#ffd78a' :
            d > 5 ? '#ffe5b3' :
            d > 0   ? '#fff2d9' :
            '#fff';
          } else {
        return d > 200 ? '#5E5989' :
            d > 150 ? 'rgb(110, 106, 150)' :
            d > 100 ? 'rgb(152, 149, 184)' :
            d > 50 ? 'rgb(189, 187, 215)' :
            d > 0   ? 'rgb(233, 232, 251)' :
            '#fff';
        }
      }

The layers are added and removed from an external button:

$('#regional-map-poverty')
        .on('click', function() { console.log('test1');
          d3.select(this).classed('select-regional-style-active',true);
          d3.select('#regional-map-race').classed('select-regional-style-active',false);

          regionalDataset = 'inpoverty';
          regionalDatasetTipText = '% live below the poverty line.'

           map.removeLayer(rLayer);
            map.addLayer(povLayer);
        });

When mousing over the shapes, the colorization on mouseover is different than the actual shapes are colored.

Mouseover code:

function mousemove(e) {
          var layer = e.target;

          popup.setLatLng(e.latlng);
          popup.setContent('
' + layer.feature.properties['GEO.displa'] + '
' +
              d3.round(layer.feature.properties[regionalDataset],1) + regionalDatasetTipText);

          if (!popup._map) popup.openOn(map);
          window.clearTimeout(closeTooltip);

          // highlight feature
          layer.setStyle({
              opacity: 0.7,
              fillOpacity:1
          });

          if (!L.Browser.ie && !L.Browser.opera) {
              layer.bringToFront();
          }
      }

      function mouseout(e) {

          var layer = e.target;

         layer.setStyle({
              opacity: 0.3,
              fillOpacity:.9
          });
         // raceLayer.resetStyle(e.target);

          closeTooltip = window.setTimeout(function() {
              map.closePopup();
          }, 300);
      }


texts: Setting RGB TIFF "zero" values to "NoData"

texts:
I am having a problem with getting my Landsat 8 RGB (bands 2-7) .tif background values (very small number but not zero) set to null.  I have tried the following tools:

Raster Calculator (image 2)

Set Null (image 3)

I have also gone to (Windows / image analysis), selected one of the files, added a function, and computed the "NoData" values.  Ran the function, and I still get the same result shown in image 1.  I tried using the value as well in Set Null and the Raster Calculator, no luck.


texts:
How can I convert WKB to WKT form?
I stored coordinates  in WKB but now I  want to display it using WKT form.


texts:
I'm trying to get a layer with all my Photolocations. The Importphotos plug-in doesn't work. It just generates a ZeroDivisionError.

line 338, in ok
    lat, lon = self.get_exif_location(tags, "lonlat")
line 492, in get_exif_location
    lat = self._convert_to_degress(gps_latitude)
line 471, in _convert_to_degress
    d = float(value.values[0].num) / float(value.values[0].den)
ZeroDivisionError: float division by zero.

How do you resolve this divide by zero error?

I am using QGIS 3.2.0 Bonn and Python 3.6.0

EDIT: I just tried Las Palmas with photo2shape and it works without any problems.


texts: Is their an equivalent of SpChFIDS for a spatial POINTS data frame?

texts:
This code:

seattle <- spChFIDs(seattle.shp,
                    paste("seattle.shp",
                          row.names(seattle.shp), sep="."))

Results in this error:

  Error in (function (classes, fdef, mtable)  :    unable to find an
  inherited method for function ‘spChFIDs’ for signature
  ‘"SpatialPointsDataFrame", "character"’

I have tried raster::union; sp::merge, and rgeos::gUnion. None of which achieve what I want: The analogue of an ArcGIS merge.

library(raster)
?raster::union
test<-union(phoenix.shp,seattle.shp)
#Error in as.vector(x) : no method for coercing this S4 class to a vector
#s4 class seems to have slots, accessed by the @ symbol.
#This has both polygons and a dataframe.
#all the R methods seems to deal with one or the other; not both.

library(sp)
?sp::merge #Merge a Spatial object having a data.frame (i.e. merging of non-spatial attributes).
test<-merge(phoenix.shp,seattle.shp) #only nets phoenix.
test$GEOID10
slotNames(test) #"data"        "coords.nrs"  "coords"      "bbox"        "proj4string"
test@data #1218+22 so just phoenix
test@coords #just phoenix.

library(rgeos)
?rgeos::gUnion
test<-gUnion(phoenix.shp,seattle.shp)
#So gUnion gives the topology, but not the dataframe.
#do I hae an ID I can join the datafrmae back with?
slotNames(test) #"coords"      "bbox"        "proj4string"
test@coords
plot(test)#both sets of points, no data.

If you need test data, download two counties worth from here


texts:
I'm trying to get a distance matrix though QGIS, I have two different point layers to run the distance matrix and have input and target layers correct, output matrix type is Linear(n*k x 3) Use only the nearest (k) target points.

Once saving the CSV file the results are not correct, for example a input point and target point has a distance of 149.5429 when the measured distance is actually 33.662
see below.

Southern Cross  Werribee    149.5428661
Flinders Street Werribee    149.5428661
North Melbourne Werribee    149.5428661
Footscray       Werribee    149.5428661
Sunshine        Werribee    149.5428661
Ginifer         Werribee    149.5428661

I've checked that the CRS is correct for both point layers and I am still getting this error.

Can somebody please help me through this.


texts: Selecting the minimum point in a polygon

texts: I am attempting to find the minimum point value within a polygon using ArcGIS 10.3. I have two datasets: 1) A series of polygons & 2) A series of points scattered about. After selecting a given polygon, I can use Select by Location where the polygon selects the points within it. From this, I would like to select the minimum value point within the selection. However, after running this [numeric column] =  (SELECT MIN([numeric column]) FROM [table]) code I get no results since the minimum value in the entirety of the numeric column is not contained within my selection. I do not know how to reference my current selection. I have tried the Select from Current Selection option, but that did not help.


texts:
I do not have a GIS background and was hoping that someone could point me in the right direction as to the best procedure / software to do the following.

Starting with a current LiDAR survey, I need to be able to compare an older survey (contours in a DWG) and create a composite surface that is the lower of the two at any point. These are both too large, and too close in elevation to deal with the triangulated surfaces in AutoCAD (which is my default right now). Also, moving forward I will have to continue to integrate new survey into this surface to maintain a "cleanup floor", which AutoCad does poorly, as it does not easily allow for just integrating the cut portion of any new survey.

My gut tells me there must be a simpler method to do this by converting them both into a uniform grid  (DEM is the convenient output from AutoCAD), and then comparing them in a GIS software but I have no idea which software to go to, or what the simplest methodology would be.


texts: Comparing getValue with map.layers[i].name?

texts:
As part of a xtype combo, I would like to know if the layer I choose in my simple data store (represented by this.getValue()) is present in the map layers. So if it does, A should occur, and B if it does not. The problem is that myLayer variable seems to be unrecognized, even though Opera Dragonify throws no error at all.

Where would be the error?

listeners: {
  'select': function(combo, record) {
    for(var i = 0; i < mapPanel.map.length; i++) {
      var myLayer = mapPanel.map.layers[i].name;
      if (myLayer == this.getValue()) {
        // do A here...
      } else {
        // do B here...
      }
    }
  }
}


texts: Delivering DEM layers with visualisation?

texts:
I'm not sure if it's right place to do that but I am in a strong need of getting some help.

I am creating maps with lake bathymetry and there will be a lot of them. My task is to proceed the data from an echosounder, create a DEM raster layer and finaly visualise the data in an appropiate style. My client wants me to send him my final DEM layers with visualisation. It means that he just want to:

download my data
open it in ArcGIS or QGIS
and finally he wants this data to be already visualised.

Does anybody have an idea if this is possible?

He told me that we can make it via ArcGIS online but I think that in ArcGIS online i can upload only shapefile to my content.


texts:
Please accept my appologies if this question is off-topic here; this is the closest match to the topic of my question.

I am looking for countries and states whose map is a polygon with a small number of sides. There are several such states in the USA, such as: Colorado (4 sides), Wyoming (4 sides), New Mexico (apparently 8 sides). But, looking at a map of the world, I could not find other countries or states that have small number of sides. My question is: what country or state, ouside the USA, has the smallest number of sides?


texts: Openlayers waits for base layer until loading other layers, is paralleled loading possible?

texts:
I am loading a base layer from OSM and a WMS layer from my local geoserver using the latest stable openlayers (2.13.1).

Performance is okay, but openlayers seems to wait for the base layer to load before loading anything from my WMS layer and sometimes the OSM layer is performing slower than I would like. I was wondering is there a way to get openlayers to load the WMS layer first or even both in parallel?

Also, I have been using openlayers 3 and the performance is much better, perhaps as it seems to load both layers at once.


texts:
I have configured a webviewer using Geoserver/Openlayers/Geoext and Heron-mc.

In the examples the overlays and baselayers automaticaly load when first starting the application.

I have changed the setup to meet my needs, but when I load the webpage containing the viewer the wms-layers do not load. Only when I pan, zoom or change layers the request is being made...

Does anyone have any idea what might be the problem?


texts: Drawing a circle of a given area in MapInfo

texts:
I would like to draw a circle in MapInfo exactly 0.9Ha in area.

I've done it by working out the corresponding radius should be, drawing a circle of arbitrary size, double clicking on it and then entering the radius. Is there a tool to do this?

If there isn't a tool for this then I'm going to make one, so I have another question: how do you programmatically get the geographic coordinates of a mouseclick?


texts: Finding Model/Tool name in custom Toolbox via ArcPy/Python?

texts:
We have a folder housing all custom Toolboxes/Models for our schema updates. We are attempting to automate these Toolboxes in upper environments. The initial problem is, I am unsure what Model name people are going to use.

How can I extract the Model name with Arcpy/Python then use this information with ap.GetParameterInfo?

The goal is to reset one required parameter in each environment.

Current failing code base:

import os
import arcpy as ap

_dir = r'D:\foo\bar' # folder with all the toolboxes

_lsdir = os.listdir(_dir)

for _tbx in _lsdir:
  _tb = ap.ImportToolbox("{0}\{1}".format(_dir, _tbx), "fakealias")
  print _tbx, _tb
  _p = ap.GetParameterInfo(_tb)
  for p in _p:
    print p.name, p.parameterType, p.value

Current Error output:

20190419_AddFC.tbx 'module 'fakealias' (built-in)'
AttributeError: Object: GetParameterInfo tool <module 'fakealias' (built-in)> not found.

I've successfully printed the ap.GetParameterInfo from a single Toolbox but only when hardcoding the Model name. This will not work long term.

Code formatting did not take on original publish.

This answered the initial question.

    import os
    import arcpy as ap

    _dir = r'D:\foo\bar' # folder with all the toolboxes

    _lsdir = os.listdir(_dir)

    for _tbx in _lsdir:
      _tb = ap.ImportToolbox("{0}\{1}".format(_dir, _tbx), "fakealias")
      print _tbx
      for _t in dir(_tb):
        if "__" not in _t:
          print _t
          _p = ap.GetParameterInfo(_t)
          for p in _p:
            print p.name, p.parameterType, p.value


texts: RPostgres: No applicable method for 'st_as_sfc' applied to an object of class "pq_geometry"

texts:
Setup

I am using sf::st_write() to load data into a PostGIS database. In order to do this, I first had to convert the geometry column of my dataframe from a character to a sfc vector.

df$geom <- st_as_sfc(df$geom)

Then, the entire df was converted into a sf object.

df <- st_as_sf(df)

Once I have an sf object, I then write my data to a PostGIS database.

# db connection object
con <- dbConnect(drv = RPostgres::Postgres()
    ,dbname = db
    ,host = host
    ,port = port
    ,password = pw
    ,user = user
    )

# write sf dataframe to db
st_write(dsn = con
    ,obj = df
    ,table = 'table_name'
    ,query = 'INSERT INTO table_name ON CONFLICT DO NOTHING;'
    ,layer_options = 'OVERWRITE=true'
    ,drop_table = FALSE
    ,try_drop = FALSE
    ,debug = TRUE
    ,append = TRUE
    )

Issue

The above code works fine, but problems arise once I use the st_read() function to pull data from my database.

df1 <- st_read(dsn = con
    ,geom_column = 'geom' # name of my geometry column
    ,table = 'table_name'
    ,query = 'SELECT * FROM table_name;'
    )

Error in st_sf(x, ..., agr = agr, sf_column_name = sf_column_name) :
  no simple features geometry column present

I tried calling dbReadTable() instead, but ran into related issues. I can read in the data, but I am unable to convert from a pq_geometry class to sfc.

df1 <- dbReadTable(conn = con
    ,name = 'table_name'
    )

df1$geom <- st_as_sfc(df1$geom)

Error in UseMethod("st_as_sfc") :
  no applicable method for 'st_as_sfc' applied to an object of class "pq_geometry"


texts: Using L.Control.Search and L.markerClusterGroup

texts:
I am trying to use L.Control.Search and L.markercluster to make a searchable cluster of ~4400 address points. I have tried two separate ways (based on examples I have found) but not yet been successful:

Attempt 1 loaded the address points twice, so the map is uselessly slow and illegible (full link)

    // load address points for address search
    $.getJSON("data/address_pts.geojson", function(data){
            var addressIcon = L.icon({
                iconUrl: "images/home.svg",
                iconSize: [60,50]
            });
            var addresses = L.geoJson(data,{
                    pointToLayer: function(feature,latlng){
                        var marker = L.marker(latlng,{icon:addressIcon});
                        marker.bindPopup(feature.properties.FULL_ADDRE);
                        return marker;
                    }
            });
            var clusters = L.markerClusterGroup();
            clusters.addLayer(addresses);
            map.addLayer(clusters);
    // add search
    map.addControl(new L.Control.Search({
            layer: addresses,
            textPlaceholder: 'Address...',
            propertyName: 'FULL_ADDRE'
        })
    );
    // end getJSON
    });

I wondered if this was some problem with $.getjson, so I tried L.geoJson.ajax extenstion as well:

var addresses = new L.GeoJSON.AJAX('data/address_pts.geoJson', {
      pointToLayer: function(feature, latlng) {
        return new L.CircleMarker(latlng, {radius: 6, fillOpactiy: 0.9});
        },
    });
    var addressCluster = new L.markerClusterGroup({
      disableClusteringAtZoom: 12
    }).addTo(map);
    address.on('data:loaded', function() {
      addressCluster.addLayer(addresses);
    });

    // feature search
    var search = new L.Control.Search({
      layer: addresses,
      initial: false,
      propertyName: 'FULL_ADDRE',
      circleLocation:false,
      collapsed:false,
      textPlaceholder:'Search Addresses',
      zoom:'12'});

    map.addControl(search);

This loads no data or points at all. I assume I was closer to the right track on Attempt #1, but I don't understand how to prevent duplicate loading of the address points.


texts: QGIS2WEB plugin leaflet option won't work

texts:
Using the airports tutorial I can export as openlayers and works fine. When i attempt to use leaflet export it causes the QGIS to become unresponsive and my system to run out of memory. When i look in the folder it has compiled a lot of the code and files. It seems to be hanging whilst trying to write the shapefile data to JSON as the below photo. Is this a known issue. I need a leaflet version as ultimately i want to use omnivore to pull data onto a map from a web hosted csv.

 .

EDIT: It also won't display the Leaflet map in the preview pane

I'm working on Mac OS 10.11.6 with the latest version of the plugin on QGIS:

Version | 2.18.2 | QGIS code branch | Release 2.18
-- | -- | -- | --
Compiled against Qt | 4.8.6 | Running against Qt | 4.8.6
Compiled against GDAL/OGR | 2.1.2 | Running against GDAL/OGR | 2.1.2
Compiled against GEOS | 3.5.1-CAPI-1.9.1 | Running against GEOS | 3.5.1-CAPI-1.9.1 r4246
PostgreSQL Client Version | 9.4.9 | SpatiaLite Version | 4.3.0a
QWT Version | 6.1.3 | PROJ.4 Version | 492
QScintilla2 Version | 2.9.1 |   |


texts: In Python, How to Encode and Decode Complex Data for a OWSLib WPS call to PyWPS-4?

texts:
In Python, how can I encode "complex" (vector) data for a WPS call that just echoes back the data, and decodes the data from the result. I was planning on using OWSLib on the client side and PyWPS-4 on the server side.

This what I have so far for the server:

import flask
import pywps

class EchoVector(pywps.Process):
    def __init__(self):
        inputs = [pywps.ComplexInput('message',
                                     'Input message',
                                     supported_formats=[pywps.Format('application/gml+xml')],
                                     mode=pywps.validator.mode.MODE.STRICT)]

        outputs = [pywps.ComplexOutput('response',
                                       'Output response',
                                       supported_formats=[pywps.Format('application/gml+xml')])]

        super(EchoVector, self).__init__(
            self._handler,
            identifier='echo_vector',
            title='Echo Vector Test',
            abstract='Returns the given vector',
            version='1.0.0.0',
            inputs=inputs,
            outputs=outputs,
            store_supported=True,
            status_supported=True
        )

    def _handler(self, request, response):
        response.outputs['response'].data = request.inputs['message'][0].data

        return response

app = flask.Flask(__name__)

wps_processes = [EchoVector()]

service = pywps.Service(wps_processes)

@app.route('/wps', methods=['GET', 'POST'])
def wps():
    return service

bind_host='127.0.0.1'
app.run(threaded=True,host=bind_host)

This is what I have so far for the client:

import owslib.wps
import collections

url = "http://127.0.0.1:5000/wps"
wps = owslib.wps.WebProcessingService(url, verbose=False, skip_caps=True)
wps.getcapabilities()

process_name = "echo_vector"
inputs = [("message", owslib.wps.GMLMultiPolygonFeatureCollection([[(-102.8184, 39.5273),
                                                                    (-102.8184, 37.418),
                                                                    (-101.2363, 37.418),
                                                                    (-101.2363, 39.5273),
                                                                    (-102.8184, 39.5273)]]))]

execution = wps.execute(process_name, inputs)

for output in execution.processOutputs:
    owslib.wps.printInputOutput(output)

I get am getting an "Invalid mimeType value text/xml for input message" exception.

This code is also available in this GitHub repository


texts: Representing Hydrographic survey in QGIS

texts:
I have a depth Layer (soundings) and I would like to represent the labels the same way as in a Hydrographic Map.
As you can see in the image bellow, we have this kind of representation in a hydrographic map.

How can I do it in QGIS?
Data Link: Sample


texts:
I wrote a python code that is used in different countries.
It process a shapefile DBF, that can be encoded in any of the local langage (or being provided by another foreign partner), or even in ascii.
Therefore, I can't make any assumption on the encoding of the DBF.
It happens that some caracters (eg. French accents) break my code.

Therefore, I would like to do something like:

codec=.....[the function I am looking for]
codec.encode(string, "utf-8")

Is there any function in ogr to get the Shapefile DBF encoding, or do I need some tricks to guess it?


texts: Using Iterate Feature Selection in ModelBuilder causes entire model to iterate?

texts:
I'm creating a fishnet on ModelBuilder, the extent of which is based on an Input raster.

The output of "Create Fishnet" is gone through an Intersect tool, and then is fed into an Iterate Feature Iterator. The output of the iterator is fed into a Clip tool, in order to make separate clipped images of the original image, based on the features of the Fishnet.

The problem is that after the first execution of Clip, the entire model is iterated from the beginning, instead of moving to clipping with the next feature. This does not happen if I use an Input feature class as feed to the Iterate Feature Selection (e.g., an existing shapefile and not with something that is created with the same model). I've also tried to use "Make Table View" between the Intersect and the Iterator, but the same thing happened.

Any idea as to the cause of this?


texts: Arcgis JS API WMS Layer zoom without basemap

texts:
I have an OGC WMS resource which I am adding to a map without any basemap. To view this resource I have to zoom in, so I have decided to set a center point and zoom to this point.

The problem is that instead of zooming in to the point I have set, it zooms out  because the map has -1 zoom value.

I would like to know if someone knows any way to avoid this and set a real zoom value to the map.


texts: Finding the Default version in a large linage tree

texts: I have a very large versioning linage tree. I am using the arcGIS 10.0 GDBT tool. How can I find the node with the default version?


texts: Match small polygons that are within a bigger polygon to collectively have the geometry of the bigger one

texts:
I have two layers: The green polygons (with detailed information on inhabitants in the attribute table) and the blue ones with blue boundary, which are housing blocks (with the shape needed). The red parts are those areas of the blocks that are not covered by green polygons.

I need the green polygons to completely cover the red area. However, each green polygon needs to cover "it's" red part in order to get the symbology right that is based on the info in the attribute table of the green features.

I tried to solve the problem using the Symmetrical Difference tool to identify/create the red parts as a starting point but they only share the attributes with the big, blue polygon. I cannot think of any other way. Doing it manually is not an option.


texts: Saving each feature symbology to a image using PyQGIS

texts:
I am attempting to write a plugin to export a LayerVector (Points) to images.
I need to get the symbology of each point to export as images (PNG).

My intention here is to create a new file containing the attributes of the LayerVector. I want to add one column 'icon_url' with the name of the image that will be used as symbology for the point.
The following code works for some symbologies, but some types the originalSymbolForFeature return None.

How to draw the visual representation used in QGIS and export it to a image?

import time;
layer = iface.mapCanvas().layers()[0]

clonedLayer = layer.clone()
layerRenderer = clonedLayer.renderer()
renderContext = QgsRenderContext()
renderContext.setUseAdvancedEffects(True)
renderContext.setFlags(QgsRenderContext.Flag.RenderBlocking | QgsRenderContext.Flag.Antialiasing)
imageList = list()
iconField = QgsField('icon_url', QVariant.String, 'text')
clonedLayer.startEditing()
res = clonedLayer.addAttribute(iconField)
clonedLayer.commitChanges()
clonedLayer.startEditing()
for feature in clonedLayer.getFeatures():
    layerRenderer.startRender(renderContext, clonedLayer.fields())
    symbol = layerRenderer.originalSymbolForFeature(feature, renderContext)
    layerRenderer.stopRender(renderContext)
    curImage = symbol.asImage(QSize(32, 32))
    try:
        imgIndex = imageList.index(curImage)
    except Exception as e:
        imageList.append(curImage)
        imgIndex = len(imageList) - 1
    feature.setAttribute("icon_url", './' + str(imgIndex) + ".png")
    clonedLayer.updateFeature(feature)

clonedLayer.commitChanges()
wgs_crs = QgsCoordinateReferenceSystem('EPSG:4326')
QgsVectorFileWriter.writeAsVectorFormat(clonedLayer, 'C:/Users/danilo/Downloads/symbol/myjson_danilo_.json',
                                                  'utf-8', wgs_crs, 'CSV', layerOptions=['GEOMETRY=AS_XY'])


texts: Is there a Tiny Well-Known Binary (TWKB) implementation in C#?

texts:
I am aware of https://github.com/TWKB/twkb.js and I'm looking at evaluating Tiny Well-Known Binary (TWKB) in a c# application.  I did some googling but came up empty.

Are there any efforts underway to implement this in c#?


texts: Identify intersecting angles for line features in ArcGIS

texts:
I have recently concluded a city-wide water utitlity GPS survey.
within a geometric network, I've moved the source (pre-GPS) point features to their GPS positions.
where the old data was satisfactorily connected to the network on water lines, the vertex in the water line moved with the gps point as desired to maintain schematic connectivity.

The problem I have is that since only the coincident vertex of the water line moves, we sometimes end up with sharp angles where the water lines tee together at network junctions (ideally they should be at 90 deg) since those endpoints are not affected by the move.
See screen shot below.

Part of the current work flow is to clean these up manually to make it look like the next screen shot.

This is a large and dense city, so rather than panning around every street to visually identify these targets for editing, is there a tool that can be used to identify intersecting angles so I can go right to trouble spots like these rather than looking over the whole project area?


texts:
I try to use the sample color in the "Select color" in order to change the color of polygon layer in the map canvas. i sample the color form image in Power Point - outside the QGIS system-2.12 version.

My problem is that the sign of the sample color tool   changed into the regular arrow sign of the windows operation system:

How can i sample colors outside the QGIS software- using the sample color of the QGIS?


texts: Easy way in PyQGIS to convert a distance from meters to coordinates?

texts:
I am attempting to clip DEM rasters (USGS, in WGS 84) into a set of tiles measuring 2.56km on a side, in QGIS, using python.

So far, it appears that gdal_translate is working for me, using a bounding box in latitude/longitude coordinates. My problem is that I need to know how to convert 2.56 km into the equivalent distance in latitude and longitude. Thus far I've been getting by in other applications using the following formula, found online here: http://fmepedia.safe.com/articles/How_To/Calculating-accurate-length-in-meters-for-lat-long-coordinate-systems

rLat = math.radians(mapCenterLat)
metersPerDegreeLat = 111132.92 - 559.82 * math.cos(2 * rLat) + 1.175 * math.cos(4 * rLat)
metersPerDegreeLong = 111412.84 * math.cos(rLat) - 93.5 * math.cos(3 * rLat)
degreesPerMeterLong = 1.0 / metersPerDegreeLong
degreesPerMeterLat = 1.0 / metersPerDegreeLat

It's black magic, but it seems like it's worked for me so far. However, in this instance when I plug in that equation, and multiply my resulting degreesPerMeter numbers times 2560, the resulting rectangle ends up being more like 3.45 km wide by 2.49 km high.

Clearly there must be a better way in QGIS to figure this out, without resorting to black magic, right?


texts: Interpolating LiDAR scattered ground data?

texts:
I wonder if someone can give me a hint on how to interpolate sparse data. I have a 1km by 1km tile located in a dense rain forest area.

Original LiDAR data are 37,395,021 points. I have played with them in several LiDAR processing programs (LAStools, MCC-LIDAR, Fusion, PDAL, to name a few) to get bare earth data.

Since the area covered has trees between 20-50m in height I have only 10% of the original data as ground points. For Instance, in one of my experiments I have 3,110,079 ground returns. The original data has a density of almost 27 points per square meter, while the ground data has 4 points per square meter. I have interpolated the data using SAGA Multilevel B-spline interpolation with a cell size of .5, 1 and 2m. I have also tried kriging, IDW, etc, and cannot obtain a smooth surface.

This is an example of the Multilevel B-spline interpolation showing ground points:

This is the same data using kriging:

Any ideas are welcome.


texts: Can you use Bing Maps in offline editing in the ArcGIS Collector app?

texts: Is it possible to use Bing Maps in the offline mode in the ArcGIS Collector app? In ArcGIS collector can I download the map, work offline and sync my edits when I'm using Bing aerials as my base map?  I know that this is possible when using ESRI published aerials and base maps but what about Bing Maps.  I have tested this and I don't have the option to download the map for offline use when using Bing Maps but I'm wondering if there is something I'm missing.  I already have the Bing Key registered and setup for use in my organizational account so that's not the issue.  Has anyone had success using Bing Maps offline?


texts: I would like to generate a raster file with a resolution of x (e.g. 0.00833 degrees) and a sequential numbering: e.g. from 1 to n where n is the number of pixels in the raster, such that each pixel has a unique id value. I would like to achieve this with Python.


texts: Replacing ArcPy with ArcGIS API for Python?

texts:
Today I found out about the ArcGIS API for Python. I was wondering if you could use this to (eventually) replace ArcPy?

Recently I have been doing analyses that require cloud based solutions. When using AWS, Docker and Jupyter it is very convenient to stick with a Unix based OS such as Ubuntu. However, the Unix alternatives for ArcGIS have their own limitations as well such as the always hard to install python bindings for the  GDAL library. ArcGIS for Python operates cross platform.

Perhaps there are the things I should and should not expect from the ArcGIS API for Python.

Perhaps Arcpy is going to disappear altogether.

API in action


texts:
How do i add icons beside my labels in qGIS?. i have a layer displayed with label

How do i add icons in their labels to look something like this?

I try to find it in label options but i cant find it. maybe you have the best solutions there.


texts: How to handle GDAL dataset error when accessing Arcgis Online world imagery data?

texts:
I would like to use the world imagery data set for loading base maps to my QGIS projects. Up until now, I have had no problem by typing the following command in the Python console:

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

Yet, now I am getting the following error message:

Any suggestions on how to solve this?

I am using QGIS version 2.8.2 and GDAL version 1.11.2


texts: Reflectance values from WorldView-1 images?

texts:
Most of the informations on WorldView images are related to the second and third version of the satellite. I own a WorldView-1 image (the black and white one) and I really need to find the reflectance values of the image pixels.

Is it possible even with single band (B/W) images?


texts: I know this is a weird question, but I would like to know if it is possible to construct a proj4 string so that I can use proj4 to convert from WGS84 to a "scaled" WGS84 system. For example with a scaling factor of 10000, the coordinates 52.123456, 12.525643 would become 521234.56, 125256.43.


texts: Mongo geoWithin problems reading from collection

texts:
I have a data set with geo points.

{ _id ...other fields... location: { type: "Point", coordinates: [0,0]}}

What I have been attempting to do is filter out and delete any documents that have points that are in water bodies. I downloaded and converted a shape file of the earth's water bodies and stored that in a separate collection in the same database.
I have been trying to use Mongo's geoWithin function, but am not able to get it to work for me when I specify the water body's polygon document. If I hard code a polygon it works, but I don't really want to type in all the earth's water polygons into my code...
This doesn't work:
var geo = {type: "Point", coordinates: [0,0]}
db.waterBodies.find({
    geo: {
        $geoWithin: {
            $geometry: {
                type: 'Polygon',
                coordinates: "$geometry.coordinates"
            }
        }
    }
}).count()

or this
var geo = {type: "Point", coordinates: [0,0]}
var poly = [[[0,0],[0,3],[3,0],[0,0]]]
db.data.find({
    geo: {
        $geoWithin: {
            $geometry: {
                type: 'Polygon',
                coordinates: "$poly"
            }
        }
    }
}).count()

It generates this error:

E  QUERY    [js] uncaught exception: Error: count failed: {
"ok" : 0,
"errmsg" : "Polygon coordinates must be an array",
"code" : 2,
"codeName" : "BadValue"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBQuery.prototype.count@src/mongo/shell/query.js:376:11
@(shell):1:1

This works and doesn't throw an error but requires hard coded values:
var geo = {type: "Point", coordinates: [0,0]}
db.data.find({
    geo: {
        $geoWithin: {
            $geometry: {
                type: 'Polygon',
                coordinates: [[[0,0],[0,3],[3,0],[0,0]]]
            }
        }
    }
}).count()

and this
db.data.find({
    'location.coordinates': {
        $geoWithin: {
            $geometry: {
                type: 'Polygon',
                coordinates: [[[0,0],[0,3],[3,0],[0,0]]]
            }
        }
    }
}).count()

I of coarse don't want the count but used that for testing purposes.
The simple answer for me would look something like this:
const polygons = await getPolygons(); //get all the polygons from the water body's collection

const filter = {
    'location.coordinates': { //the points I want to filter
        $geoWithin: { //could also be geoIntersects
            $geometry: {
                type: 'MultiPolygon',
                coordinates: polygons.geometry.coordinates //the water body polygons
            }
        }
    }
};

try {
    await db.collection(collection).deleteMany(filter);
} catch (e) {
    if (e instanceof MongoError) {
        Logger.info('Error deleting log');
        throw e;
    }
}

I would want to use multipolygon since there are many water bodies.
So far I have read everything I can find on google but nothing has worked for me. All the examples I have found hard code an array for the coordinates, but I don't want to do this.
Please help and let me know if there is a way to do this or to remove all points that are not found on land.
Thanks in advance.
cross posted at: https://stackoverflow.com/questions/63162823/mongo-geowithin-multipolygon-not-accepting-collection-reference


texts: Workforce for ArcGIS - Can't create Project

texts:
I'm new to Workforce. I can't seem to be able to create a project in Workforce. Any time I try to create a new project, the error below pops up:

"Unable to create project.
SSL Required SSL Required"


texts: Can I prevent features from being created outside an OpenLayers map?

texts:
In our app, we allow users to create features on maps. The boundaries of these features will later be converted into real-life latitude/longitude coordinates, but does not make sense if features are created outside the actual boundaries of the map.

In the above screenshot, I'd like to prevent the blue feature from being drawn so that its upper edge stays inside the actual map.

How could I do that? I couldn't find any reference to this in OpenLayers examples or documentation.

(Currently on 2.12-rc1)


texts: geoserver and its layer is pointing(base url) to other server(hosting server) not my domain url

texts:
i am using Geoserver 2.4.4.my geoserver url is http://links-map.com/geoserver/web/ but when i click to loging button of geoserver its url is changed http://vmx15978.hosting24.com.au:8080/geoserver/web/ means after pressing the loging button geosver pointing to my hosting server url i.e http://vmx15978.hosting24.com.au/

2.second issue is on layer preview when i see the the source path of layer by inspect element i fount the layer is also pointing to  my server url(http://vmx15978.hosting24.com.au/) not my domain url(http://links-map.com/).

why my geoserver is pointing to my hosting server(http://vmx15978.hosting24.com.au/)
 i am using dedicated server Centos 6.4  which url is http://vmx15978.hosting24.com.au/
 and Apache tomcat  server 7.0.42

i want my geosver on my domain path( http://links-map.com/geoserver/web/) all its thing layer preview ,other on the same url (http://links-map.com). not my hosting server url .

So please any body can suggest me where i can fix this problem how can i set GeoServer on http://links-map.com/

I am giving  the screen shot  url of this please see the screen shot http://links-map.com/error.png

Please suggest me.
        Thanks


texts: How to get all intersecting points to a given area and vice-versa in PostGIS?

texts:
I'm developing a project using PostGIS to hold spatial data where I have records that hold geometry point data and records that hold geometry area data. To solve my problem I'm looking for two queries that can take geographic shapes rather than geometric shapes as parameters.

For query A I need it to return all points that intersect with a given area.

For query B I need it to return all areas that intersect with a given point.


texts: How to Find points in a Kilometre radius

texts:
I am new to PostGIS and GeoData.

I need to find where the lightning has stroke by a period of time and kilometre radius based on a given location.

I have given lon/lat and my table is:

latitude numeric not null,
longitude numeric not null,
time timestamp(0),
geom(point,4326)

I do not know how to use within or radius query. I basically need to find how many points (lightning i have in a radius of a given location(lon/lat).

I am using PostGreSQL 9.2 and PostGIS 2.0.

Thank you.


texts: Creating surrounding polygons using QGIS?

texts:
For example: I created the small polygon (red), now I want to create the bigger polygon (green) surrounding the small (common boundary).

How to do this using QGIS 2.18.4 ?


texts: PostGIS to GeoJSON with GDAL: how to get lat/longs?

texts:
I'm trying to convert line features from PostGIS to GeoJSON files, as follows:

from psycopg2 import *
from subprocess import call

conn = connect(dbname='gis')
cur=conn.cursor()

cur.execute("SELECT distinct osm_id,route_name from planet_osm_line where route_name like '%Rail Trail' and network='rcn';")

for record in cur:
  print "%s" % record[1]
  call (["ogr2ogr", "-f", "GeoJSON", record[1] + ".json",  'PG:dbname=\'gis\'', "-sql", 'SELECT route_name,osm_id,tags::hstore->\'state\' as state,way from planet_osm_line where osm_id=%d' % record[0]])

That is, ultimately ogr2ogr gets called like this:

ogr2ogr -f GeoJSON blah.json "PG:dbname='gis'" -sql 'SELECT route_name,osm_id,tags::hstore->\'state\' as state,way from planet_osm_line where osm_id=-12345'

The GeoJSON files that get created have coordinates that look like this [ 16153119.78, -4561568.23 ]:

{ "type": "Feature", "properties": { "route_name": "Waverley Rail Trail", "osm_id": -64660, "state": null }, "geometry": { "type": "LineString", "coordinates": [ [ 16153119.78, -4561568.23 ], [ 16153117.1, -4561567.48 ], [ 16153114.81, -4561565.86 ], [ 16153113.24, -4561563.55 ], [ 16153112.64, -4561561.63 ], [ 16153112.64, -4561558.82 ], [ 16153113.6, -4561556.2 ], [ 16153115.39, -4561554.05 ], [ 16153117.82, -4561552.66 ], [ 16153119.98, -4561552.2 ], [ 16153122.76, -4561552.48 ], [ 16153125.28, -4561553.69 ], [ 16153127.35, -4561555.88 ], [ 16153128.43, -4561558.46 ], [ 16153128.62, -4561560.38 ], [ 16153128.08, -4561563.13 ], [ 16153126.64, -4561565.51 ], [ 16153124.47, -4561567.26 ], [ 16153121.82, -4561568.17 ], [ 16153119.78, -4561568.23 ] ] } }

Please forgive my ignorance, but what am I doing wrong here? I assume what is being written is some kind of projected value rather than the raw lat/long - so how do I get those?

I've tried using t_srs=ESPG:3857 but that didn't fix it.


texts:
I am relatively new to writing Python code so this is probably obvious to most of you but I am receiving the following error: NameError: name 'latest_edition' is not defined

> # Import system modules
import arcpy
import os

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

from arcpy.sa import *

#Set input and output locations
in_loc = "S://gisdata/maintained/software_versions"
print in_loc
out_loc = "S://gisdata/maintained/current/Platform_indices_test.gdb"
print out_loc

#Set workspace location
arcpy.env.workspace = in_loc

index_list =['aqi', 'css']

for ind in index_list:
  search_string = ind + "*_i.tif"
  print search_string
  raster_list = arcpy.ListRasters(search_string,"ALL")

  for i, obj in enumerate(raster_list):
    edition = int(obj[4:6] + obj[8:9])
    if edition > latest_edition:
      latest_edition = edition
      print latest_edition
      latest_raster = obj
  arcpy.CopyRaster_management(latest_raster,out_loc + "/" + latest_raster,"DEFAULTS","","","","","")


texts: How do I use pre-existing Lat/Long data in a SQLite table with QGIS?

texts:
I have an application that stores its data in a SQLite database. I can't modify the application or database to add geometry extensions, but it does already have latitude and longitude columns for each row of data it stores (stored in decimal format).

How do I tell QGIS to look at these columns to generate x,y points? If I dump the database to a CSV file, I just have to choose the X field and Y field for lat and long under "Point Coordinates" when adding the layer. I'm essentially looking for a way to do the same, but with a SQLite data source.

Here's how the SQLite data source looks when loaded in QGIS as a vector layer:

I'm trying to turn each of those rows into a point.


texts:
I'm trying to display concentrations of bank lending by postcode in QGIS 3.12.3 Bucaresti, using a Mac 10.15.5
I've successfully joined my attribute only table to my postcode vector layer, and all the data is displayed correctly and in the right place when I open attribute table of the vector layer.

I've then gone into symbology, hit the £ sign, and used to_int to convert the text Q string of the lending data to integers.

But all the graduated classes display 0 - 0, no matter what I do.

I can see that the data is in the layer and ranges from NULL, to 0, to 10'000s, to millions. What makes this even more frustrating is I've done this exact process on a number of other layers and had no problem.
Can anyone help enlighten what I'm missing or what I'm doing wrong here please?


texts: Equivalent of layer.redraw(true) in OpenLayers 3?

texts:
I have a geojson layer in my OL3 app which I want to redraw every 5 seconds (to show movement on map) .

How do I do it ? Couldn't find the equivalent of Layer.redraw().


texts: Manipulating Popups using ArcPy with ArcGIS Pro

texts:
I am using the ArcPy libary at the moment to manipulate data in layers.

It looks like ArcGIS Pro allows the user to use popups for each layer which allows selected data to be displayed in a popup once clicked.

I cannot find a way to access this feature with ArcPy.

ArcPy seems to be able to mimic most of ArcGIS Desktop functionality, but I cannot find a method or object to directly configure popups for each layer.

I am attempting to display charts on a given point once clicked on.


texts: How to display WFS Layer from Geoserver using OpenLayers

texts:
I'm new in Geoserver and OpenLayers Could you tell me how to display GML Layer from Geoserver using OpenLayers ??
I Would like to show the labels for each Feature


texts: Which statistical methods to compare the spatial distribution of two different variables in two raster maps?

texts:
I am working with two global raster maps using the R Software (original file: netCDF for map 1 and GeoTIFF for map 2), with a resolution of 5 min of arc.

Map 1 contains data on the share of the land in each grid-cell which is cultivated -i.e. cropland area in each grid-cell. Values range from 0 to 1.
Map 2 contains data on the livestock density in each grid-cell -i.e. number of animals in each grid-cell. values range from 0 to thousands.

My objective is to calculate/obtain an indicator of segregation of livestock production in comparison of crop production -i.e. an indicator of the spatial co-presence of livestock and crop production. My final aim could be to get a numerical indicator of e.g. how much crop production and livestock are co-present within a certain territory, as instance in each grid-cell. In other words, I am interested in getting a sort of indicator estimating the spatial distance between livestock and crop at a certain spatial scale. Finally, I would be interested in get a sort of "average" value of such indicator at Country level. My idea is to use this indicator in estimating the amount of livestock excreta that could be available at a Country scale (i.e. if the there is a high co-presence of livestock and crop production within a certain Country, this is reflected in a high availability of excreta for such crop production).

Which kind of statistical method or set of tools could be suitable to reach such result?

Here some information on how the two dataset were generated, which I retrieved from the original sources:

Map 1: The author used two different high-resolution (1-km) satellite based, global land cover classification data sets that are available for circa 2000, and applied a simple set of climatic parameters to mask obviously non-agriculture areas within the satellite datasets. Additional information can be found here http://www.earthstat.org/wp-content/uploads/METADATA_CroplandPastureArea2000.pdf
Map 2: The datased is an improvement of a previous dataset (Gridded Livestock of the World - GLW). The estimated densities were based on statistical relationships between observed densities within administrative units derived from survey and census data, and several explanatory variables, including a time-series of remotely sensed satellite data relating to climate and the environment, and other spatial data relating to demography, land cover and terrain. Reported sub-national statistics were thus spatially disaggregated and gaps where none were available filled with predictions to provide a complete global distribution map for each species. More information are available here: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0096084


texts: Adding OGC complaint WMS Aerial Images as Base Maps using arcgis javascript api

texts:
I have an WMS layer which is a cross domain resource and I wanted to embed those layers as basemap in my application using JavaScript api rather than using built in ArcGIS Basemaps.

WMS Layer is complaint with OGC WMS specification & it has 5 different layers of Aerial photography images.

If it is possible, can you add these layers a basemaps in my application. Can you please piont me in the right direction.


texts: OpenLayers rules and context, what is the difference?

texts:
OpenLayers.Style employs two properties, "rule" and "context" which accordingly contain an array of OpenLayers.Rule and a set of methods.

I have noticed that "context" can somehow substitute "rule". For example, in a case where there is a vector layer displaying temperatures as features, with "temp" in its properties for the values.

var temperatureStyle1 = new OpenLayers.Style({
    //common symbolizer styles
    fontFamily: "Arial",
    label: "${temp}",
    fontColor: "${coltem}",
    fontWeight: "bold"
    },
    {
    context: {
        coltem: function(feature) {
            var temperature=parseInt(feature.attributes.temp);
            var col="#000000";
            if(temperature>35) { col="#CF2900"; } //Hot
            if(temperature<0) { col="#0000FF"; } //Cold
            return col;
        }
    }
});

is somehow equivalent to

    var temperatureStyle2 = new OpenLayers.Style({
        //common symbolizer styles
        fontFamily: "Arial",
        label: "${temp}",
        //fontColor: "${coltem}", not really needed
        fontWeight: "bold"
        },
        {
        rules: [
            new OpenLayers.Rule({
                filter: new OpenLayers.Filter.Comparison({
                    type: new OpenLayers.Filter.Comparison.LESS_THAN,
                    property: "temp",
                    value: 0
                    }),
                symbolizer: { fontColor: "#0000FF" }
                }),
            new OpenLayers.Rule({
                filter: new OpenLayers.Filter.Comparison({
                    type: new OpenLayers.Filter.Comparison.GREATER_THAN,
                    property: "temp",
                    value: 35
                    }),
                symbolizer: { fontColor: "#CF2900" }
                }),
            new OpenLayers.Rule({
                elseFilter: true,
                symbolizer: { fontColor: "#000000" }
                })
            ]
        });

What are the benefits in each of these two approaches? I can only see that with "context" I can change only one style (of the symbolizer) at a time, while with "rules" I can redefine a whole symbolizer -- instead of making many context methods for each style doing the same comparison every time.

Is there anything more that I cannot see? What's the reason for the existence of the "context" object?


texts:
I would like to create a scale bar for a map displaying a coral atoll. Ideally, showing two different measurements with kilometers being on the top division and nautical miles on the bottom division of the scale bar.

I paused to think whether this is logical and decided that it may fit nicely because I am displaying a raised atoll with surrounding reef sites for monitoring purposes. Therefore, it may be important as areas of interest are within a water body and for say navigational purposes such as a skipper wanting to know the nautical miles to each site rather than kilometers (I know she/he could convert them by head).

Is this at all possible in QGIS? I have read that it can be done in ArcGIS http://support.esri.com/technical-article/000011784

Open to your views and suggestions.

What I am trying to achieve:


texts: Transparency to unique value in ArcGIS 10.3

texts:
I have this polygon layer and i try to set the transparency to 52% only to the c value:

but when i set to 52% transparency, all the values changed:

I can copy\paste the polygon and remove a,b values and then set the transparency to 52% , but i prefer not using this method.


texts: How to eliminate incorrect cell values after resampling discrete raster?

texts: After resampling a discrete raster I have floating point cell values at the catergory borders. Is there a tool similar to the GRASS tool r.neighbors that corrects these values to the most frequent values around this cell? NA should be ignored.


texts: Is there a 'mode' function in spatial join QGIS

texts: I am trying to find the most number of 'bands' (band A, B, C) in each postcode area. The 'bands' is represented in points and I would like to output into maps(polygons). Is there a way to do a spatial join (i.e. join attributes by location) and get it to calculate the mode (most times that reoccurs). Using QGIS 2.18.13


texts: Error when using IFeatureCursor to inquire feature

texts:
As you can see the other attributes are doing well, but the shape of the feature throw  an exception "Shape = "(pFeature).Shape" raises an exception of type "System.Runtime.InteropServices.COMException"". Why?

 a = axMapControl1.get_Layer(j) as ICompositeLayer;

 pfl = a.get_Layer(0) as IFeatureLayer;
 IFeatureClass pfeatureclass = pfl.FeatureClass;
 if (pfl != null)
 {
 IQueryFilter queryFilter = new QueryFilterClass
 {
  SubFields = "Id",
  WhereClause = "Id = " + pointid
 };

 pFeatureSelection = pfl as IFeatureSelection;
 pFeatureSelection.Clear();
 pFeatureSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, true);
 pSelectionSet = pFeatureSelection.SelectionSet;
 IFeatureCursor pFeatureCursor = pfl.Search(queryFilter, true);
 IFeature pFeature;
 pFeature = pFeatureCursor.NextFeature();


texts:
I try to turn of all the layers, using this code using ArcGIS 10.3.1:

import arcpy
from arcpy import env

env.workspace = r"G:\desktop\gis"
for mxd in arcpy.ListFiles("*.mxd"):
    mapdoc = arcpy.mapping.MapDocument\
         (r"G:\desktop\gis\\" + mxd)
    for lyr in arcpy.mapping.ListLayers(mapdoc):
        lyr.visible = False
    mapdoc.save()
del mxd

This code works great, but there are several maps with layers from this server:
http://www4.emap.co.il/ArcGIS/rest/services

and it make some error:

NameError: The attribute 'visible' is not supported on this instance of Layer.

How can I overcome this error?


texts: Is it possible to render & place public items such as mailboxes and fire hydrants in OpenStreetMap?


texts: Creating flood inundation map from watermark QGIS

texts:
I have a high water elevation for a location and I want to subtract this elevation by the DEM raster to achieve a water depth raster, and I am not sure how to go about this.

I am assuming a constant water elevation across this location and want to create a rough flood inundation map with the water depths at each point.


texts:
I'm trying to add tpers projection as a custom projection in QGIS 2.10.1

In the Custom crs dialog I'm adding the proj.4 text:

+proj=tpers +h=500000000 +lat_0=19 +lon_0=99 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m

And when I test with some North and East values, QGIS calculates some output coordinates. The thing is that, when I click done, QGIS complains that The proj4 definition of 'tpers' is not valid.

I've read this answer but I think that the tpers definition must be outdated since it produces error when I try to test it in the custom crs dialog.

The proj.4 string I'm using comes from here


texts:
I downloaded a DEM file (package, rather?) of the entire US from usgs.gov. It's 30GB and contains quite a few files.

Is it possible to import this to QGIS to overlay the data on my map?


texts:
I have spent the day attempting this to no avail...I am a bit of a newbie to QGIS, but please help!

I am trying to import the files at the bottom of: https://www.fscbiodiversity.uk/?q=QGISHabitatStyles

I am running 2.18 Las Palmas

They are all QML files - in QGIS I have created a new layer > properties, and want to match the new polygon with one of the styles. I have tried using the Style > load style process to no avail - the polygon changes to a style and refuses to match the style required.

Basically - how do I get all of the above styles to use as a palette (that opens every time) in QGIS?


texts:
Currently using COLLADA models in QGIS 2.14 and these appear to be black when I create a 3D model.

I am aware that on the tool it says it is experimental.

Is there a way that the textures of the COLLADA model can be displayed. I am currently exporting out of Sketchup.


texts:
Most Opensource tools are cross platform; however, some GIS tools such as ArcGIS are platform specific (windows only). What are some of the GIS tools that are usable on the mac?

EDIT

Although thank you for putting the basic apps in your answers, my question specifies that Most if not all of opensource tools are cross platform, I was really hoping to get more obscure libraries, packages, and programs that I didn't know about on OSX similar to dotspatial and sharpmap for windows


texts: How to hide/toggle legends with layer controls in Leaflet for R

texts:
In the package leaflet for R, you have the ability to toggle layers on and off with the addLayersControl() option. If you use legends for each individual layer, however, these layers are not toggled on and off with the layers control. Here's a quick reproducible example of what I'm working with:

library(raster)
library(leaflet)

#load in shapefiles, trim excess data
gtm <- getData('GADM', country = 'GTM', level = 0)
gtm <- gtm[, -c(2:68)]

mex <- getData('GADM', country = 'MEX', level = 0)
mex <- mex[, -c(2:68)]

leaflet() %>%
  addTiles() %>%
  addPolygons(data = gtm,
              fillColor = 'red',
              group = "gtm") %>%
  addLegend(color = "red",
            labels = gtm@data$OBJECTID) %>%
  addPolygons(data = mex,
              fillColor = 'blue',
              group = "mex") %>%
  addLegend(color = "blue",
            labels = mex@data$OBJECTID) %>%
  addLayersControl(overlayGroups = c("gtm", "mex"),
                   options = layersControlOptions(collapsed = F))][1]][1]

As you can see above, when I toggle the Mexico layer off, its legend remains. I've searched the question a bit, but all of the questions appear to be applicable to Leaflet.js rather than the R package. Is there any way to control the legends in Leaflet for R so that they can also toggle on and off?


texts: Military Grid Reference System Grid as Shapefile/FeatureClass

texts: Is it possible to create a Military Grid Reference System (MGRS) Grid for a complete grid zone at a given precision level, for example 10km, as a Shapefile/FeatureClass with ArcGIS 10.4?


texts: Equivalence of EPSG:3857 for MapInfo 9.5

texts:
I have a raster projected on EPSG:3857 with QGIS. I have image registration in Mapinfo but there is no projection for EPSG:3857.

Do you know the projection that I need to use?


texts: How the WMS services can be secured such that it can be accessed by Esri and non-Esri clients

texts:
I couldn't figure out if there is a method to secure WMS services such that it can be accessed by Esri and non-Esri clients.
Is there a code can I write it some where?


texts:
I'm trying to dissolve a shapefile according to a field using Python 2.7.10 and I don't want to use ArcPy.

Is there any way to do this using GDAL/OGR?


texts: QGIS alternatives to GDAL contours to polygons

texts:
I have Windows 7 running 3.10.2-A Coruña. The only success I have had in creating nested polygons from a raster dataset is using GDAL with -p to create polygons. However, I recently cancelled the process after it had been running for more than a day, as it seems to struggle with large datasets (around 50000 contour lines).
Ideally, I should be able to use lines to polygons (QGIS or SAGA), but the nested polygons are not shown. I have tried Dissolve on Z/ELEV, but only with partial success. v.clean in GRASS consistently fails, regardless of parameters chosen. I have tried checking geometry and topology, again with no success. What is frustrating is that contours created with GDAl cannot be converted to polygons using a separate process rather than the -p option.
Does anyone have a process that may work as well as GDAL -p, but a lot quicker/more efficiently?


texts: What's the most detailed level of location can I get only by knowing the ZIP code?

texts:
I am looking at APIs to get location information from ZIP codes. So far the most detailed level of location I could get was Country --> State --> City.

Does ZIP code also map to neighborhood / districts ?

I have seen some APIs that return lng lat coordinates for zip code, I guess I could geo-code the coord to find out the more specific area, but I don't know how fine grained it is


texts:
is there a change for HTML-Mouseover (I dont know the exact wording in english-version. German: Anzeigen, Kartenhinweis) between Version 2 and 3? The same code dont work in V3 ;(

 [%"field_2"%]

field_1 and field_2 is Path an filename:


texts: Many ELSE statement in Expression in QGIS (2.6)

texts:
is it possible to have more than one ELSE in the CASE WHEN statement in the Expression builder in QGIS?

For example:

CASE WHEN "population" > 5000
THEN 'big'
ELIF WHEN "population" > 1500
THEN 'medium'
ELSE 'small'
END

I know that this piece of code is totally wrong, but I'm not able to find an equivalent of ELIF..

Some ideas? Am I looking at the problem in the wrong way?!


texts: Extract pixel values by points and convert them to tables in Google Earth Engine ?, Problems when downloading the table

texts:
I am trying to extract the pixel by point values and convert them into a table in Google Earth Engine, when I run the script everything runs normally, however when I try to download the table I get the following error message

Error: Error in map(ID=000000000000000002ea): Image.date: Image '20190102T153619_20190102T153616_T18NUJ' does not have a 'system:time_start' property.

function maskS2clouds(image) {
var qa = image.select('QA60');

// Bits 10 and 11 are clouds and cirrus, respectively.
var cloudBitMask = 1 << 10;
var cirrusBitMask = 1 << 11;

// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
  .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

return image.updateMask(mask).divide(10000);}

var collection_S2 = ee.ImageCollection('COPERNICUS/S2_SR')
  .filterBounds(roi)
  .filterDate('2019-01-01', '2019-12-31')
  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
  .map(maskS2clouds)
  .map(function(img){
    var ndvi = img.normalizedDifference(['B8', 'B4']).rename('NDVI')
    img = img.addBands(ndvi)
    var ndwi = img.normalizedDifference(['B8', 'B12']).rename('NDWI')
    img = img.addBands(ndwi)
    var evi = img.expression('2.5*(nir-red)/(nir+(red*C)-(B*blue)+L)',
    {
      nir : img.select('B8'),
      red : img.select('B4'),
      blue : img.select('B2'),
      C : 7.5,
      B : 6,
      L : 1
    }).rename('EVI')
    img = img.addBands(evi)
    var savi = img.expression('((nir-red)/(nir+red+L))*(1+L)',
    {
      nir : img.select('B8'),
      red : img.select('B4'),
      L : 1
    }).rename('SAVI')
     img = img.addBands(savi)
    var arvi = img.expression('(nir-(2*red)-blue)/(nir+(2*red)+blue)',
    {
      nir : img.select('B8'),
      red : img.select('B4'),
      blue: img.select('B2')
    }).rename('ARVI')
    img = img.addBands(arvi)
    return img.select(['NDVI', 'NDWI', 'EVI', 'SAVI', 'ARVI'])
  });

  // función para mapear sobre FeatureCollection
  var mapfunc = function(feat) {
    // obtener geometría de entidad
    var geom = feat.geometry()
     // función para iterar sobre el ImageCollection anual
    // el objeto inicial para la iteración es la característica
    var addProp = function(img, f) {
      // cast Feature
      var newf = ee.Feature(f)
      // obtener la fecha como cadena
      var date = img.date().format()
      // extraer el primer valor
      var value = img.reduceRegion(ee.Reducer.first(), geom, 10)
      // si el valor es nulo, establezca los valores como una propiedad de
      //la característica. El nombre de la propiedad será la fecha
      return ee.Feature(ee.Algorithms.If(value,
                                         newf.set(date, ee.String(value)),
                                         newf.set(date, ee.String('No
                                         data'))))
    }
    var newfeat = ee.Feature(collection_S2.iterate(addProp, feat))
    return newfeat
  };

  var newft = poblacion.map(mapfunc);

  // Export
  Export.table.toDrive(newft,
  "export_Points",
  "export_Points",
  "export_Points");


texts: Needed either python or VB Script to write right indent

texts: Question : I have a field column that is has numbers with percent. The field properties are string and 50 in length. I ran it in an expression using round([T_Acres]/207 * 100,0) + "%" in VB script . It works; however there is one problem... it is to the left justified and I want to change that from left to right.


texts: I have an ArcGIS Online API that I would like to use as an input/store in my GeoServer so that I can publish a service from GeoServer. The format available thorough the API is GeoJSON. I can see that there is an option of adding a WFS as a vector data source but the service I have does not have any WFS or WMS capabilities on and has only GeoJSON output format.


texts: SDE 10.1 Layers Not Loading in ArcGIS Engine Application

texts:
I have an ArcGIS application that works great when loading layers from SDE 10.0 but fails when trying to load the layers when they're pointing to a SDE 10.1 server.

The only difference is the layer source in the MXD. When the layer points to the SDE 10.0 server, everything loads as expected. If I change the layer source to point to the exact same layer (name, rows, etc.; it was merely copied over from 10.0 to 10.1) in the SDE 10.1 server, a red exclamation point appears next to the layer name.

The SDE 10.1 layers are visible in ArcMap so this shouldn't be a port or instance issue
This isn't a licensing issue; I have the app set to exit if the license is invalid/unavailable

Is there something special I need to do to get an Engine application to communicate with an SDE 10.1 server?

Is this a service file issue? I tried adding a reference to the service name and port for the new server in the services file but it didn't seem to help, but 10.0 and 10.1 seem to do services/instances a little differently; perhaps I'm missing something.

UPDATE: The more I think about this, the more it seems to be a "direct connect" issue. Is it possible that I'm not connecting to SDE because things aren't set up right on the client? If so, how do I set up direct connect on an ArcGIS Engine client?


texts: Filtering a list of areas with MapServer

texts:
I have defined layer with filtering. I've used operator IN because I have list of values:

LAYER
  NAME "loc_mistnosti3"
  TYPE POLYGON
  ...
  FILTERITEM 'ID'
  FILTER ( [ID] IN %id% )
  VALIDATION
     "id" "[0-9]"
  END

URL address contains this list of values:

...layer=loc_mistnosti3&**id=180,214**&map_size...

but result is still:

  msCGILoadForm(): Web application error. Parameter 'id' value fails to validate.

Where is the problem?


texts: Create new database in shared drive Postgresql

texts: I have my postgresql/ postgis installed in the c drive but I am running out of space. Is it possible to create a new database in the shared drive and access it from local pgadmin?


texts:
Can't share my script as geoprocesing service. The warning message: 00068 Script Script contains broken project data source: CURRENT Here is the script:

# Import arcpy module
import arcpy
arcpy.env.workspace = "C:\Users\Jack\Desktop\GISBackup\Parcel.gdb"
arcpy.env.overwriteOutput = True

# Script arguments
Input_Feature_Class = arcpy.GetParameterAsText(0)
if  Input_Feature_Class == '#' or not Input_Feature_Class:
    Input_Feature_Class = Parcel_Selected

# Local variables:
SplitLines = arcpy.GetParameterAsText(1)
if  SplitLines == '#' or not SplitLines:
    SplitLines = "ParcelWithLabel"

# Process: Split Line At Vertices
arcpy.SplitLine_management(Input_Feature_Class, SplitLines)

# Process: Delete Identical
arcpy.DeleteIdentical_management(SplitLines, "shape", "", "0")

# Process: Show Labels
mxd = arcpy.mapping.MapDocument("CURRENT") #Map document reference
dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0]
addLayer = arcpy.mapping.Layer(SplitLines)
arcpy.mapping.AddLayer(dataFrame, addLayer)
layer = arcpy.mapping.ListLayers(mxd, "")[0]
if layer.supports("LABELCLASSES"):
    for lblclass in layer.labelClasses:
          lblclass.showClassLabels = True
          lblclass.expression = '"{}" & round([Shape_Length],2) & "{}"'.format("<FNT name='Arial' size='12'>" , "</FNT>")
layer.showLabels = True
arcpy.RefreshActiveView()


texts:
I am trying to get work the next function but i don't know if it is incomplete because the query SELECT * FROM pgr_nearest_node1('jaen',-3.75,37.779); does not provide any results.

Here is the function:(from pgr_fromAtoB):

CREATE OR REPLACE FUNCTION pgr_nearest_node1(IN tbl character varying, IN x1 double precision, IN y1 double precision, OUT id integer, OUT geom geometry)
  RETURNS SETOF record AS
    $BODY$
    DECLARE
            rec     record;

    BEGIN
        -- Find nearest node
        EXECUTE 'SELECT id::integer, the_geom FROM jaen_vertices_pgr
                ORDER BY the_geom <-> ST_GeometryFromText(''POINT('
                || x1 || ' ' || y1 || ')'',4326) LIMIT 3' INTO rec;

            -- Return record
                    id     := rec.id;
                    geom   := rec.the_geom;

    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE STRICT;


texts: How to compute a partial OD matrix over a network, given the origin and destination?

texts:
I have two point layers, one of origin and one of targets.

Every origin point refer to a specific target point.

I would like to compute the cost of the travel between every starting point and his target point, and then join the output table to the origin point layer to show origin points who are "badly affected".

I have tried to use the Qneat3 plugin, but it generates an OD-matrix for every couple of points in the origin and target layer.

I have also tried to use the destination's ID field as unique ID for the origin point, in order to be able to filter my output OD-matrix, but I'm then unable to perform the join between the table and the origin point layer.


texts: Can you point me to an example of a modern-day John Snow?

texts:
It's become pretty much a custom to start spatial epidemiology or medical geography textbook / lecture with an example of John Snow's cholera investigation in 1854 Soho.

He's definitely still remembered in the current literature and even appeared on top answer to a recent question on this site.

Could you give some recent examples where mapping, GIS or spatial analysis provided significant contribution to understanding and explaining an epidemiological issue?


texts:
I want to reclass small areas in QGIS 2.18, but it seems to fail calling the algorithm in GRASS GIS. The interesting lines from the Log of the tool:

...
C:\PROGRA~1\QGIS2~1.18\bin>g.region n=5478291.27701 s=5058891.27701 e=2350688.13497 w=1982088.13497 res=100.0

C:\PROGRA~1\QGIS2~1.18\bin>r.reclass.area input="tmp1521273631216" mode=lesser value="60" output="outpute5c09076262546938021350e8d68b972"
--overwrite  Der Befehl """" ist entweder falsch geschrieben oder  konnte nicht gefunden werden.

...

(It says that command """" is written wrong or not available)

Any ideas to fix that or to use another tool in QGIS for this task?


texts: Difference results from QGIS project on fly and gdalwarp for EPSG:4326 of Sentinel 2 UTM zone 32?

texts:
I always thought QGIS and gdalwarp should return same result for projecting a 2D Sentinel 2 image (e.g: T32UQD_20200421T102021_TCI_60m.jp2) from UTM 32 to EPSG:4326.

What I did was:

Open the .jp2 in QGis 2.14.9 with 'Enable on the fly CRS transformation'.
Warp the .jp2 to geotiff by gdalwarp:

gdalwarp T32UQD_20200421T102021_TCI_60m.jp2 -t_srs EPSG:4326 4.warped.tiff

But the output results from them look different significantly (on the left hand side with QGIS it looks rotated and on the right hand side with gdalwarp it looks aligned).

So, what should be the correct result?

gdalinfo T32UQD_20200421T102021_TCI_60m.jp2

Size is 1830, 1830
Coordinate System is:
PROJCS["WGS 84 / UTM zone 32N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AXIS["Latitude",NORTH],
        AXIS["Longitude",EAST],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",9],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","32632"]]
Origin = (699960.000000000000000,5900040.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  699960.000, 5900040.000) ( 11d59'40.71"E, 53d12'43.17"N)
Lower Left  (  699960.000, 5790240.000) ( 11d55'40.15"E, 52d13'34.41"N)
Upper Right (  809760.000, 5900040.000) ( 13d38' 3.06"E, 53d 9'33.92"N)
Lower Right (  809760.000, 5790240.000) ( 13d31'51.72"E, 52d10'31.74"N)
Center      (  754860.000, 5845140.000) ( 12d46'18.91"E, 52d41'45.89"N)

and warped by gdalwarp: 4.warped.tiff

Size is 2383, 1447
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"]]
Origin = (11.927820031375013,53.211992871316582)
Pixel Size = (0.000716123003772,-0.000716123003772)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  11.9278200,  53.2119929) ( 11d55'40.15"E, 53d12'43.17"N)
Lower Left  (  11.9278200,  52.1757629) ( 11d55'40.15"E, 52d10'32.75"N)
Upper Right (  13.6343411,  53.2119929) ( 13d38' 3.63"E, 53d12'43.17"N)
Lower Right (  13.6343411,  52.1757629) ( 13d38' 3.63"E, 52d10'32.75"N)
Center      (  12.7810806,  52.6938779) ( 12d46'51.89"E, 52d41'37.96"N)


texts: OpenLayers getGetFeatureInfoUrl in other projections

texts:
My data is in SRS EPSG:4326. My map (view/layers) are in the default EPSG:3857.

I want to just work in the data projection and would like to query a feature on map click with my data projection coordinates, but I only seem to get a value back if I use the view coordinates and projection. I don't want to force the map to be reprojected to EPSG:4326 by OpenLayers because it gets stretched.  I am using getGetFeatureInfoUrl to build the URL to call.

An AJAX call to this URL returns/finds a feature:

var viewResolution = map.getView().getResolution();
var coords = [-11131949.079327358,4865942.279503176];
var url = wmsSource.getGetFeatureInfoUrl(coords, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'application/json'});
/*
URL is now:

http://mymapserver/geoserver/myworkspace/wms?
SERVICE=WMS&
VERSION=1.1.1&
REQUEST=GetFeatureInfo&
FORMAT=image%2Fpng&
TRANSPARENT=true&
QUERY_LAYERS=myworkspace%3Amyfeature&
TILED=true&
STYLES=&
LAYERS=myworkspace%3Amyfeature&
INFO_FORMAT=application%2Fjson&
X=28&
Y=29&
WIDTH=256&
HEIGHT=256&
SRS=EPSG%3A3857&
BBOX=-11271098.442818949%2C3757032.814272983%2C-10018754.171394622%2C5009377.085697311&
*/

The code below does not find a feature, why?

var viewResolution = map.getView().getResolution();
// transform coordinates to EPSG:4326
var coords = ol.proj.transform([-11131949.079327358,4865942.279503176], 'EPSG:3857', 'EPSG:4326');
// coords now equals [-100,40]
var url = wmsSource.getGetFeatureInfoUrl(coords, viewResolution, 'EPSG:4326', {'INFO_FORMAT': 'application/json'});
/*
URL is now:

http://mympaserver/geoserver/myworkspace/wms?
SERVICE=WMS&
VERSION=1.1.1&
REQUEST=GetFeatureInfo&
FORMAT=image%2Fpng&
TRANSPARENT=true&
QUERY_LAYERS=myworkspace%3Amyfeature&
TILED=true&
STYLES=&
LAYERS=myworkspace%3Amyfeature&
INFO_FORMAT=application%2Fjson&
X=56&
Y=291&
WIDTH=256&
HEIGHT=256&
SRS=EPSG%3A4326&
BBOX=-180%2C90%2C180%2C450&
*/

Shouldn't the feature be found?

Do I need to somehow transform the resolution as well?

I am specifying the coordinate system as EPSG:4326. If the URL built by OpenLayers is incorrect, why?


texts: Aggregating georeferenced point data to conflicts site using R

texts:
I have a question with regard to joining to datasets.

On the one hand I have information about the location of a conflict regarding its lat/long, radius, and area and how it changes over time. Here is a small snap for the conflict with the ID 91 in Chad.

On the other hand, I have georeferenced data about different aid projects in Chad over the time. Here as well a small snap of the dataset:

My goal is to aggregate the aid data to the conflict regions to finally analyze the relationship over time.

I have been reading many comments in the community but am still totally lost regarding how I can join the data using R. Would you recommend to first transform the conflict data set into polygons or is that not necessary? I would already be very very happy about a small hint.


texts:
I am trying to update a vector layer attribute table using QThread.
i connect a pushbutton click with a slot to start the thread:

def EGSupdateAttributeTable(self):
    AttUpdateEGSThread = EGSUpdateAttThread(self.theLayerToEdit)
AttUpdateEGSThread.start()

and this is my thread class:

# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from qgis.utils import *
from qgis.core import *
from qgis.gui import *
import sys
import qgis.utils

#the update EGS Algorithme attribute table Class
class EGSUpdateAttThread(QtCore.QThread):
    def __init__(self,theLayerToEdit):
        QtCore.QThread.__init__(self)
        self.theLayerToEdit = theLayerToEdit
        self.LayerFeatureCount = self.theLayerToEdit.featureCount()
    def run(self):
        QtGui.QMessageBox.information(None, 'layer', str(self.LayerFeatureCount))
        #self.editScenarioDlg.ui.PrbUpdateAtt.show()
        provider = self.theLayerToEdit.dataProvider()
        #allAttrs = provider.attributeIndexes()
        Feature = QgsFeature()
        allAttrs = provider.attributeIndexes()
        provider.select(allAttrs)
        iFloodProt = provider.fieldNameIndex("FloodProt")
        indexStableClimate = provider.fieldNameIndex("StableClim")
        iUsableWat = provider.fieldNameIndex("usablewat")
        iACRE = provider.fieldNameIndex("ACRES")
        immwater = provider.fieldNameIndex("mmwater")
        iCN = provider.fieldNameIndex("CN")
        iCarbonFixe = provider.fieldNameIndex("CarbonFixe")
        iDenitrific = provider.fieldNameIndex("Denitrific")
        iWaterRetentionValue = self.editScenarioDlg.ui.leWaterRetValue.text().toInt()[0]
        iStableClimate = self.editScenarioDlg.ui.leDollByCarbonValue.text().toInt()[0]
        iUsableWater = self.editScenarioDlg.ui.leDollByNitrogenValue.text().toInt()[0]
        while provider.nextFeature(Feature):
            if len(Feature.attributeMap())>0:
                #QMessageBox.information(self.drawShapeDlg, 'attributetable' ,  str(Feature.attributeMap()))
                dACREVal =  Feature.attributeMap()[iACRE].toDouble()[0]
                immwaterVal =  Feature.attributeMap()[immwater].toInt()[0]
                #QMessageBox.information(self.drawShapeDlg, 'iWaterRetentionValue' ,  str(iWaterRetentionValue))
                dCNValue = Feature.attributeMap()[iCN].toDouble()[0]
                dCarbonFixeValue =  Feature.attributeMap()[iCarbonFixe].toDouble()[0]
                dDenitrificValue = Feature.attributeMap()[iDenitrific].toDouble()[0]
                dFloodProtVal = iWaterRetentionValue * (dACREVal * 43560) * immwaterVal *  0.00328084
                dStableClim = dCarbonFixeValue * iStableClimate
                dUsableWater = dDenitrificValue * iUsableWater

                self.theLayerToEdit.changeAttributeValue(Feature.id(), iFloodProt, QVariant(dFloodProtVal) )
                self.theLayerToEdit.changeAttributeValue(Feature.id(), indexStableClimate, QVariant(dStableClim))
                self.theLayerToEdit.changeAttributeValue(Feature.id(), iUsableWat, QVariant(dUsableWater))

i cannot identify the cause of this crash


texts: Geoserver H2 datastore trying to connect to old private IP and failing/timing-out

texts:
Restarted my ubuntu EC2 instance, which changed its' private IP

Tried to preview a geo-server image-mosaic layer which was using the H2 datastore

Kept on getting this exception -

org.h2.jdbc.JdbcSQLException: Exception opening port H2 TCP Server (tcp://old-ip:41023) (port may be in use), cause: timeout [90061-119]

where old-ip is the machine IP before the restart


texts: Vegetation removal from DEM before or after contour line extraction

texts:
I have a DEM from a terrassed olive grove (single trees apart from each other) and would like to get clean contour lines (without trees / bushes) from it using QGIS3.
Cleaning up all the contour lines manually seems daunting, so I hope there is a more automated process within QGIS3 or even before extracting contour lines...
What would be a sensible workflow starting with the DEM? Or do I need another software like Blender to "erase" the trees before extracting the contour lines in QGIS?


texts: QGIS 3 : Produce classification on field where multiple values can be stored (comma separated value)

texts:
To explain what I want to do the best is a simple example.
I have a layer with point for audio geolocated notes. The attribute "type" can store different values : "problem", "surface", "question", "to_osm" or combination of these values.
Now to do style the layer in QGIS I use a rule for each type :  "type" ILIKE '%problem%'.
After I have created each rules I could interact with notes and choose to see, only one or multiple types.

This solution work well for me since more than 2 years. It is a DIY patch that take time to do and could be easily broken (rename column). I think that this problem was common on GIS data representation.
Yesterday i have found out that solution to build style direct from data exist. With the Lizmap (a webgis solution based on QGIS server), the form filtering feature you are able to set a separator for a field containing multiple unique values. LINK and extract :

If you have specified a splitter text, for example , , Lizmap will find the unique values of the separated text values. For example the value of one feature culture, environment will be split into culture and environment with the splitter , . Selecting culture or environment in the form input will show this feature.

I am asking is there a better solution to do classification of a field with multiple values based on QGIS styling rules ?

PS : I have tried also other solutions based on data structure modification (i use it sometimes) :

create a column for each type and fill it with boolean : hard to maintain the styling and edit data
create relation n to n : hard to make it work and then share it with others
duplicate features for each types : hard to edit the rest of the data


texts: ArcGIS freezes when opening most toolboxes

texts:
I'm using ArcGIS 10.6.1 on Windows 10.

I work from home using a VPN to connect to my university's network. It's been nearly impossible to open any dialog boxes. For instance, I frequently use the Layer to KML tool, but the program hangs when I open it. The dialog box pops up, but then it never populates with any fields and I'm left with a white box. I have to shut down all of ArcMap and restart. No error messages or anything. I've left it running for a full half hour and it never resumes.

Here's what it looks like:

Even when I copy all the relevant files locally and do the same thing, it still freezes.


texts: Enabling service sharing in ArcGis Online?

texts:
I am an admin for my organization. I enabled both Allow Anonymous Access and Member can share content publicly under the security panel. I am trying to connect a webservice we host that is in an unsecured folder. Every time I try to change the sharing on the Map Image Layer I am presented with a blank option. I can't change old services sharing options either - even ones that I somehow managed to set as shared publicly before.

I am not sure what is broken in my configuration or if ESRI changed something.

My services come from server 10.4.1.


texts: Cleaning up layer by deleting features with only one overlapping vertex in QGIS

texts:
After applying r.thin and then r.to.vect to a raster image the resulting vector layer contains hundreds of small "branches" that are not supposed to be there:

I've tried selecting and deleting these mini branches using a $length field in the layer's attribute table but that also deleted short segments in the main contours I want to keep.

A solution would be to identify all short paths where nodes_to_points = 2 and number of intersecting vertices = 1 as this would leave out the paths that are part of the contour (and therefore have 2 intersecting vertices).

Does anybody know how to write this as an expression in the Field Calculator or can think of a better way to remove my unwanted artefacts?


texts:
I am looking for a set of 2d tree symbols style for a landscape plan.  I got an old one trees.avi that I can't import to 10.0.
Can anybody link me to one?


texts: How to calculate hot and cold spots using ArcGIS

texts:
I have to calculate the GiZScores to Dengue incidences in District wise.This should be done using ArcGIS software by using Getis Ord GIS tool. But the problem is that I have to use climatic factors (rainfall,temperature,humidity) weights matrix file as my "Conceptualization of Spatial Relationships". I want to know that how to make this weight matrix file. Can anyone explain the method to do this to me?
I have all the climatic data for each district, weather station locations (weather stations are not located in each district).


texts: HTML and SVG image annotation for QGIS image not displaying

texts:
I have installed the HTML/SVG annotation plugin with an image on my desktop that I'd like to use as the guinea pig. In the course of testing the plugin I've tried both HTML and SVG image formats but neither have worked when it comes to actually getting the image to display.

For the SVG annotation the annotation box is blank and for the HTML one it just lists the path with a bunch of small purple rectangles below it and the file path to the image above.

Does anyone have an idea as to what I'm doing wrong here?


texts:
I apologize if this question was already answered, but I found a lot of examples on how to set the QGIS maptool in a application from scratch, but not inside QGIS (in a plugin).

In the examples I found, the author creates a toolbar icon, an action and a custom QgsMapTool action.

What I want to do, is something (that I thought it was) more simple:
- I want to set the canvas maptool to be the QGIS native zoom in (QgsMapToolZoom); basically the same that happens, when the user clicks the zoom in icon on the QGIS toolbar;
Note that I don't want to zoom in like this:

canvas.zoomIn()

But I want to set the current mapTool to zoom in, and let the user zoom instead.

I implemented it as follows:

        canvas=self.eaf.iface.mapCanvas()

        zoomTool=QgsMapToolZoom(canvas, False)

        canvas.setMapTool(zoomTool)

However this fails. QGIS unsets the current maptool (lets say, for instance pan) and sets a void maptool (represented by an arrow cursor and no action)
I added this piece of code, after initializing the zoom tool:

        zoomTool=QgsMapToolZoom(canvas, False)

        act=zoomTool.action()
        print act

And found out that the action of the tool is empty (None).
I don't want to start an action, because I would like to use the native QGIS actions that are associated to the QGIS toolbar icons.
How can I access the native QGIS zoom action and force my maptool to use it?

Thanks in advance for your time


texts: Transform complex CAD (no blockreference) objects to line in CAD to GIS workflow

texts:
I have a CAD file with a lot of details in it. For example i have doors that are made up from like 50 very fine grained lines, including handle and opening radius.

I don't need this level of detail and would like to replace it with a single line representing the door.

In a generalised form my question is, is there a way to replace complex objects in a CAD to GIS workflow with simple geometries?

Added complexity arises from the fact that the orientation of the input object can change.

My ultimate goal is to replace the horizontal doors with simple lines.


texts:
I have a problem with my application and more precisely the pop up that appears empty.

controls.push(new OpenLayers.Control.WMSGetFeatureInfo({
    autoActivate: true,
    infoFormat: "application/vnd.ogc.gml",
    maxFeatures: 3,
    eventListeners: {
        "getfeatureinfo": function(e) {
            var items = [];
            Ext.each(e.features, function(feature) {
                items.push({
                    xtype: "propertygrid",
                    title: feature.fid,
                    source: feature.attributes
                });
            });
            new GeoExt.Popup({
                title: "Feature Info",
                width: 200,
                height: 200,
                layout: "accordion",
                map: app.mapPanel,
                location: e.xy,
                items: items
            }).show();
        }
    }
}));


texts:
I am trying to use Graphic Modeler to run viewsheds. As I can’t appear to use the Viewshed Analysis plugin tool in Graphic Modeler and I instead need to use the GRASS command r.viewshed.

I am struggling to understand how to use r.viewshed, particularly when trying to run simultaneous viewsheds from multiple points.

I hope to create a viewshed over a distance of 5 Km. for a number of random points (Between 50 and 150) all located within a shapefile and to represent a large area (Solar Park).

I have attached a screenshot of the settings I would normally use in the viewshed plugin tools.

This is how the output would normally look:

Any idea?


texts: How to connect a series of DEMs in ArcMap

texts:
I have a set of 4 DEMs for a study area however they don't overlap they only meet at the edges.

How do I collate the 4 into 1 DEM raster that I can then use to convert into contours and slope representation?