texts: WMS GetFeatureInfo request returns nothing with GeoServer

texts:
I'm having trouble with a select feature example in GeoServer and OpenLayers. For some reason the request returns nothing.

Here's the stripped down version that produces this:

I have a small WMS layer(~100 parcels) with polygons, and address data that I am overlaying Google Maps with a projection. It displays correctly.

map = map(...); //standard map creation
gmap = ...; // standard street map creation
wmslayer = new OpenLayers.Layer.WMS(
            "Parcels",
            "http://192.168.0.205/geoserver/wms",
            {'layers': 'test:parcel', 'format':'image/png', 'transparent':'true'},
            {'opacity': 0.5, 'isBaseLayer': false, 'visibility' : false, 'zoomMin' : 15}
);

Then I create the click control...

infoControls =
           {
            click: new OpenLayers.Control.WMSGetFeatureInfo
            ({
                url: 'http://192.168.0.205/geoserver/wms',
                title: 'Get parcel data',
                layers: [wmslayer],
                queryVisible: true
            })
        };

Added the layers, add the control and activate it

map.addLayers([gmap, wmslayer]);
infoControls[0].events.register("getfeatureinfo", this, showInfo);
map.addControl(infoControls[0]);
infoControls.click.activate();

//show info callback
function showInfo(evt) {
    console.log(evt);
    alert(evt.text);
}

But when I click on the map inside I parcel, it gives the alert is blank, and so is the features in Firebug (from console.log(evt)).

The GET request in Firebug is red.

BBOX    -10845148.716676,5165071.048543,-10843335.725912,5166002.624825
FEATURE_COUNT   10
FORMAT  image/png
HEIGHT  390
INFO_FORMAT text/html
LAYERS  test:parcel
QUERY_LAYERS    test:parcel
REQUEST GetFeatureInfo
SERVICE WMS
SRS EPSG:900913
STYLES
VERSION 1.1.1
WIDTH   759
X   582
Y   246

Edit: The database is CRS is EPSG:4327 and projecting it to Google Mercator... Do I need to project the BBOX of the request back to EPSG:4327 before I send the WMS request? How can I do this?

Here is the GeoServer log of the request

2011-07-22 14:49:01,301 INFO [geoserver.wms] -
Request: getFeatureInfo
    GetMapRequest =
GetMap Request
 version: 1.1.1
 output format: image/png
 width height: 759,390
 bbox: ReferencedEnvelope[-1.0845637448332E7 : -1.0842011466804E7, 5164278.964868 : 5166142.117432]
 layers: test:parcel
 styles: polygon
    QueryLayers = [org.geoserver.wms.MapLayerInfo@a837896f]
    XPixel = 385
    YPixel = 144
    FeatureCount = 10
    InfoFormat = text/html
    Exceptions = application/vnd.ogc.se_xml
    Version = 1.1.1
    Request = GetFeatureInfo
    BaseUrl = http://192.168.0.205:8080/geoserver/
    Get = false
    RawKvp = {INFO_FORMAT=text/html, BBOX=-10845637.448332,5164278.964868,-10842011.466804,5166142.117432, QUERY_LAYERS=test:parcel, SERVICE=WMS, HEIGHT=390, REQUEST=GetFeatureInfo, STYLES=, WIDTH=759, FEATURE_COUNT=10, VERSION=1.1.1, FORMAT=image/png, LAYERS=test:parcel, Y=144, X=385, SRS=EPSG:900913}
    RequestCharset = null


texts: Increasing font size and change Icon using KML for Placemark under Google Earth Studio

texts:
I am having trouble increasing the size of the Placemark (font size, and icon size), and also using an alternative pushpin to mark the location. Below is a KML file I put together from looking at other examples. However, it does not work. It still only displays Baltimore, with the default yellow push pin, in the default font size - when I upload the file to Google Earth Studio as an overlay. Does anyone have any ideas what is wrong?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">

<Style id="myStyle">
  <IconStyle>
    <scale>1.3</scale>
    <Icon>
      <href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
    </Icon>
  </IconStyle>
</Style>

  <Placemark>
    <name>
        Baltimore
    </name>
    <styleUrl>#myStyle</styleUrl>
    <description>USA City</description>
    <styleUrl>#My_Style</styleUrl>
    <Point>
      <coordinates>-76.61218886467867,39.290384098082626</coordinates>
    </Point>
  </Placemark>
</kml>


texts: OpenLayers CQL filter gets info about NOT VISIBLE features

texts:
I have a WMS layer and a control WMSGetFeatureInfo.
If I apply a CQL Filter to the layer and I redraw it, the WMSGetFeatureInfo control continue querying also NOT VISIBLE features.
Why in your opinion?
How can I do to fix the problem?

EDIT

info = new OpenLayers.Control.WMSGetFeatureInfo({
 url: 'myserver:8080/geoserver/gis/wms';,
 title: 'Identify features by clicking',
 layers: [layer_1,layer_2,layer_3],
 infoFormat: 'application/vnd.ogc.gml',
 queryVisible: true
});

info.events.register("getfeatureinfo", this, callFunct);


texts: How to script shapefile editing with open source tools?

texts:
I would really like not to disturb anybody and find my answer by a Google search, but I don't really know where to start.

I have a .shp vector layer with several points on streets, each having a list of attributes (about 40K). I want to create a line between certain points.

For example: I at the corner of a street, one point has an attribute "East", the one facing it an attribute "West".
I want to streamline a process where (for example) every point with the attribute "West" from a particular street (included in the attribute) is connected to the corresponding "East" point.

In short, how to script modifications, based on attributes, on a .shp?

The output has to be a shapefile.

Could you please guide me to some relevant documentation please? I don't have ArcGIS.

Thanks a lot!


texts: R, Using a shapefile to extract values from a Landsat Image

texts:
Using the the shapefie "roi.shp" provided. Extract values from the
Landsat image and plot the spectral profiles of the different
materials i.e Water,Urban or built-up areas, roads, and vegetation.

I have the folowing piece of code:
##Load shape files
samp <- readOGR(paste0(layer="roi.shp")) ##roi.shp is a shapefile for a region of interest

##Generate point samples
ptsamp <- spsample(samp, 300, type='regular')

##Add land cover class
ptsamp$class <- over(ptsamp, samp)$class

# extract values with points
df <- extract(s, ptsamp)

# To see some of the reflectance values
head(df)

The following error is given on the
'ptsamp$class <- over(ptsamp, samp)$class' line
Error in validObject(.Object) : invalid class “SpatialPointsDataFrame” object: number of rows in data.frame and SpatialPoints don't match


texts:
Which GIS support DXF and/or DWG (preferably read&write)?

Update: Are there any open source GIS supporting these or similar CAD files?

Support of CAD files generally seems to be problematic. What are the biggest issues/problems concerning DXF/DWG support in GIS?


texts: ST_Clip not including pixels intersecting the border of a shapefile

texts:
I'm trying to clip a raster with a shapefile in PostGIS but want the clipped raster to include pixels that overlap the border of the shapefile which ST_Clip doesn't seem to be including.
Here is a screenshot of the shapefile loaded in QGIS:

This query returns the raster clipped using the boundary of the geometry (I'm not sure why it doesn't include the top section).
SELECT ST_AsTIFF(ST_Union(ST_Clip(r.rast, ST_Boundary(foo.area), true))) AS the_tiff
FROM (SELECT p.geom AS area FROM areas p WHERE p.orgname = '${name}') as foo
INNER JOIN ${rastTable} r ON ST_Intersects(r.rast, foo.area);

This query returns the raster clipped using the geometry (without wrapping it in ST_Boundary, notice that the boundary pixels are not included)
SELECT ST_AsTIFF(ST_Union(ST_Clip(r.rast, foo.area, true))) AS the_tiff
FROM (SELECT p.geom AS area FROM areas p WHERE p.orgname = '${name}') as foo
INNER JOIN ${rastTable} r ON ST_Intersects(r.rast, foo.area);

My goal is to have the union of these two rasters (both the interior intersections and the border intersections as I want to run statistics on them). I don't understand why ST_Clip doesn't include pixels in the raster intersecting with the border of the shapefile, is it supposed to? Do I really need to be taking the union or how should I write this query?
Basically, I want the rule to be if any part of the shapefile touches a raster pixel, then include the pixel.
Small update
I can get closer to the desired outcome using ST_buffer(foo.area, .01) but this seems like the wrong way to go about it (and still doesn't fix the upper curved section):


texts: Is there any way to create a symbol like on the screenshot in only one symbollayer in a PyQGIS-App (based on QGIS 2.8.6)? Or do I have to use multiple layers to create such a symbol?


texts: Issue with scaling factors for Landsat Collection 2 Level 2 data when calculating NDVI

texts:
I'm trying to calculate the NDVI for a scene, and I've downloaded Landsat 8 OLI/TIRS Collection 2 Level 2 data, which means it has already been processed to surface reflectance.
The scaling factors for Collection 2, however, are new, and include an "additive" factor in addition to a multiplication factor. Following the specification then, I multiplied all the cell values in my scene by 0.0000275 and subtracted 0.2. Here is a simplified example (I'm working in R and using the raster and terra libraries):
library(raster)
library(terra)
library(tidyverse)

# Getting the names of all the Surface reflectance band files
filenames <- paste0("landsat/LC08_L2SP_048026_20200805_20200916_02_T1/LC08_L2SP_048026_20200805_20200916_02_T1_SR_B", 1:7,".TIF")

# Loading them as a raster stack
aug20 <- terra::rast(filenames)

# Setting band names
names(aug20) <- c('ultra-blue', 'blue', 'green', 'red', 'NIR', 'SWIR1', 'SWIR2')

# Applying scaling factors (these operations are applied to every layer in the stack)
aug20 <- (aug20*0.0000275) - 0.2

I assumed that this manipulation should be enough but I ran into 2 pretty major issues. First, the resulting "surface reflectance" values have a range that far exceeds 0 and 1 on both sides:
# Summary of the stack, showing that all bands are beyond the 0 and 1 range
print(aug20)
> aug20
class       : SpatRaster
dimensions  : 8051, 7951, 7  (nrow, ncol, nlyr)
resolution  : 30, 30  (x, y)
extent      : 283485, 522015, 5292285, 5533815  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=10 +datum=WGS84 +units=m +no_defs
source      : spat_jvKP7k9AhCUT5B3.tif
names       : ultra-blue,       blue,      green,        red,        NIR,      SWIR1, ...
min values  : -0.1999725, -0.1999725, -0.1999725, -0.1999725, -0.1156025, -0.0204800, ...
max values  :   1.243200,   1.257198,   1.274935,   1.317257,   1.480910,   1.527193, ...

To account for this I tried to set everything greater than 1 to 1 and everything less than 0 to 0, but I'm not sure if this is appropriate since I don't know how to interpret these out of range values.
Second, and more importantly, when I try to calculate the NDVI, the results are completely wrong for some pixels. For example, some areas that I know to be water have "unscaled" values that are as low as 7300-7500 across all bands. The image shows a sample of pixel values inside this known water area using QGIS (this image is a true-colour composite):

The issue is that since the scaling factor involves both multiplication and subtraction, the resulting SR values end up being extremely small for all bands over water, which in turn means that calculating an NDVI ratio between then returns a REALLY high value which signals dense vegetation (for pixels that I know to be water!)
# Using the sample cell values from above as an example, applying the rescaling factor:
b5_scaled <- (7414*0.0000275) - 0.2
[1] 0.003885
b4_scaled <- (7273*0.0000275) - 0.2
[1] 0.0000075

# NDVI for this pixel (WAY too high for water):
(b5_scaled - b4_scaled)/(b5_scaled + b4_scaled)
[1] 0.9961464

This is a simplified example to illustrate where the issue is, but it is affecting the scene overall where an NDVI calculated on the "scaled" data totally obscures water while calculating it on the "unscaled" data manages to capture it just fine:
# Plot of unscaled NDVI (left)
plot((aug20_unscaled$NIR - aug20_unscaled$red) / (aug20_unscaled$NIR + aug20_unscaled$red))

# Plot of scaled (right)
plot((aug20_scaled$NIR - aug20_scaled$red) / (aug20_scaled$NIR + aug20_scaled$red))

I'm working with several tiles, and this seems to be an issue with all of them so I don't think it is a feature of just this single tile. I'm really not sure what to do. I will likely be reverting to just using Collection 1 data for the time being but I'd still really like to know if I'm just missing something obvious or there is another way to resolve this.


texts: Feature to Line on feature selections with ArcPy

texts:
I'm trying to collapse parallel polylines (dual carriageways in a shapefile of roads) to single centrelines.  I'm aware of cartography's dual lines to centerline tool, but I find Feature To Line (Data Management) slightly more reliable.  The challenge is that whichever function is used requires a large tolerance (e.g. 10m+) so must be applied to custom selections of data in order to avoid creating new artifacts between unrelated pairs - hence the need for custom selections, which as far as I can tell these functions can't handle.

Grateful for any advice from high ArcPy wizards on how best to approach this.  I'm pretty new to ArcPy so any advice on e.g. creating temporary layers to work with would be very helpful.  As a starting point please just assume a polylines shapefile.  The planned workflow is to rejoin these with the other road data once they've been collapsed.  Many thanks in advance.


texts:
I am trying to extract waterbody for Vietnam for last 5 years using S1 data in SNAP tool, however the backscatter coefficient value keeps on changing for the years.

Is there any way to Standardize the value?


texts: ESRI ArcGIS JSAPI 3.4 Defect when setting LODS on a map. How to fix?

texts:
I tend to get better help here then the ESRI forum so...

Using http://developers.arcgis.com/en/javascript/sandbox/sandbox.html I was able to create a simple application which demonstrates that if you set a non-trivial lods on a map the basemap will not behave correctly (try zooming beyond level 15).

Any workarounds?

<!DOCTYPE html>

  <title>Create a Map</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
  <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">
  <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">


texts: Filtered SimpleFeatureCollection really slow on Map and other operations

texts:
I'm working with a shapefile having about 85.000 features. I need to select some of these using a filter and then showing these on a map.
Now... If I draw the entire shapefile's features the creation of the map, the zooming and moving around is fast but if I select, even only 100, features from the SimpleFeatureSource, these steps are really slow.
Here is how I select, for example, the first 1000 features and then draw:

The execution stuks at Layer layer = new FeatureLayer (features, style);

and at  JMapFrame.showMap(map);

public static void main(String[] args) {
    File file = JFileDataStoreChooser.showOpenFile("shp", null);
     if (file == null) return;
 try{

        FileDataStore store = FileDataStoreFinder.getDataStore(file);
        SimpleFeatureSource featureSource = store.getFeatureSource();

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

        String[] selection = new String[1000];

        for(int i=0; i<selection.length; i++){

            selection[i] = i+"";

        }

        ArrayList<Filter> match = new ArrayList<Filter>();

        for (String name : selection) {
            Filter aMatch = ff.equal(ff.property("ID"), ff.literal(name), false);
            match.add(aMatch);
        }
        Filter filter = ff.or(match);

        SimpleFeatureCollection features = featureSource.getFeatures(filter);

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("Quickstart");

        Style style = SLD.createSimpleStyle(features.getSchema());

        Layer layer = new FeatureLayer(features, style);

        map.addLayer(layer);

        // Now display the map
        JMapFrame.showMap(map);

        }catch (Exception e)
        {
            e.printStackTrace();
}

Are there some faster way to do this?
......


texts:
I want to concatenate a row who have the same src_Refname value ! like in the picture

and get like this :

is there any easy way to do it ?

on using the tool described in the link, i try to copy (see the picture)

"NordCp" on "n"
"SudCp"  on "s"
"EstCp"  on "e"
"Ouest"  on "o"

but the tool works just for "EstCp" and for the others it gives me a emplty field !


texts: Accessing and using the QuickMapServices Plugin externally (outside of QGIS)

texts:
I would like to add a OSM Standard Basemap to my project through a python script running in PyCharm, outside of QGIS. Within QGIS, I use QuickMapServices and add an OSM Standard Map but I can not seem to find anywhere how to retrieve the information from this plugin. Ultimately, I would like to know some code from a script that adds a base map to my project. I have tried using the code below but it says it is valid. However, no map appears in my project.
    import glob
    import json
    import math
    import os
    import sys

    from qgis.core import *

    from PyQt5.QtGui import QColor
    from PyQt5.QtGui import QFont
    from qgis.core import QgsRasterLayer
    from qgis.core import QgsVectorLayer
    from qgis.core import QgsApplication
    from qgis.core import QgsProcessingFeedback
    from qgis.analysis import QgsNativeAlgorithms
    from qgis._gui import QgsMapCanvas

    os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = r'C:\OSGEO4W64\apps\Qt5\plugins'
    os.environ['PATH'] += r';C:\OSGEO4W64\apps\qgis\bin;C:\OSGEO4W64\apps\Qt5\bin'
    os.environ['PROJ_LIB'] = 'C:\\OSGeo4W64\\share\\proj'

    QgsApplication.setPrefixPath("C:/OSGeo4W64/bin/qgis-bin.exe", True)
    qgs = QgsApplication([], True)
    qgs.initQgis()

    sys.path.extend([r'C:\OSGEO4W64\apps\qgis\python',r'C:\OSGEO4W64\apps\Python37\lib\site-packages'])
    sys.path.append('C:/OSGeo4W64/apps/qgis/python/plugins')

    from qgis import processing
    from processing.core.Processing import Processing
    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

    # Write your code here to load some layers, use processing
    # algorithms, etc.
    DistInt = {}

    # Add Base Map
    urlWithParams = 'type=xyz&url=https://a.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0&crs=EPSG3857'
    rlayer2 = iface.addRasterLayer(urlWithParams, 'OpenStreetMap', 'wms')

    if rlayer2.isValid():
        QgsProject.instance().addMapLayer(rlayer2)
    else:
        print('invalid layer')


texts: Creating polygons from lines using ArcEditor/Standard level license of ArcGIS Desktop?

texts:
I am trying to create polygons from a line layer of lots and concessions (large blocks of land in rural areas).

The lines are mainly grid style as they intersect mostly at right angles.

I need to create polygons from these lines.

I tried it in QGIS and it did not work.

Any suggestions other than digitizing?

I'm using ArcEditor 10.


texts: gdal_warp with huge tif: integer overflow

texts:
I retrieved the SRTM 1" data and merged it in one huge tif. Now I want to warp it. It's working fine for low resolution (eg 5000, 1000, 500), but it doesn't for 90m resolution. I'm using this command:

gdalwarp -multi -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW -co PREDICTOR=2 -t_srs "+proj=merc +ellps=sphere +R=6378137 +a=6378137 +units=m" -r bilinear -tr 90 90 src.tif dst.tif

And Gdal crashes with the following error:

  Creating output file that is 445278P x 177313L. Processing input file
  raw.tif. 0ERROR 1: Integer overflow : nSrcXSize=1296001,
  nSrcYSize=417601

Is there something I can do, other than splitting my tif in several parts?

EDIT: I tried the solution proposed here: File size inflation normal with gdalwarp?

gdalwarp -tap -tr 30 30 -t_srs "+proj=merc +ellps=sphere +R=6378137 +a=6378137 +units=m" -of vrt raw.tif test.vrt
gdal_translate -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW test.vrt warp.tif
gdaldem hillshade -z 1 -compute_edges -co BIGTIFF=YES -co TILED=YES -co COMPRESS=JPEG warp.tif hillshade.tif

While it indeed solves the integer overflow error, here's the result:

When using  normal process (compressed gdalwarp + gdaldem hillshade), I get this (but I get the integer overflow error when running on my huge tif, here I ran it on a smaller file):

Is there a way to get the gdalwarp + gdal_translate + gdaldem solution to produce a result without the weird pattern?


texts: Write maximum value of layers attribute in qgis print composer

texts:
I am trying to automatically write the maximum (and minimum) value of a specific layers attribute (a date (or a number)) in qgis print composer.

I'm trying to do this for an automatically updated map and its title should automatically get the time range of events (for example "Earthquakes from 07/2016 to 09/2017"). Date of each event is stored in the attribute table of a layer (*.csv). Also each event has an ID starting by the oldest event (so max/min id would work as well).
(Goal of all this is that users only need to press "export pdf" and nothing else)

Was trying to combine "attribute", "maximum", "get_feature" and "layer_property" in query builder in different ways. While it was no problem to do in attribute tables  I wasnt able to figure out how it could work in print composer.
Minimum works pretty simple this way

attribute(get_feature('own.earthquakes','valid','1'),'event_date')

So far I unfortunately have no experience with phyton.

Any ideas about this?


texts: GRASS r.stream* modules failing to install in Ubuntu

texts:
I tried to install several r.stream* modules within GRASS GIS 7.0.4, running under Ubuntu 14.04. Specifically, after trying to install r.stream.order from g.extension, output console returns "undefined reference" errors in libgrass_vector.7.0.4.so. These are the first four, among many:

/usr/lib/grass70/lib/libgrass_vector.7.0.4.so:
undefined reference to `OGRGeometryTypeToName@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_vector.7.0.4.so:
undefined reference to `OGR_G_GetY@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_vector.7.0.4.so:
undefined reference to `OGR_F_SetGeometry@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_vector.7.0.4.so:
undefined reference to `OGR_G_GetGeometryType@GDAL_1.8'

I googled these messages but couldn't find helpful advise. What could be the problem?


texts:
I'm running ArcGIS 10.2.1 and I need a way to visualize the state tree for my versioned SQL 2012 database.

I've previously used the GDBT tools but there isn't an option available from ESRI that will install on a 10.2.* set up.

Does anyone have any suggestions?  I'm not a big fan of hacking my registry or uninstalling/re-installing my way back to 10.0 - So far those are the only options I've found for using GDBT.

I'm hoping there are some other utilities or extensions out there that will help me out.


texts: Projection 27700 in the OpenGeo Suite SDK GXP

texts:
I have some data stored as UK grid references, they display just slightly off alignment on the map after I followed the OpenGEo EXP tutorial using these settings (below) however when I change the EPSG to 27700 for UK grid reference, my map view loads with no layers, or tools visible.

I know it displays ok using 4326 however I thought It is best to follow good practice and amend the projection to the correct EPSG.

  // map and layers
map: {
    id: "mymap", // id needed to reference map in portalConfig above
    title: "Map",
    projection: "EPSG:4326",
    center: [358, 54],
    zoom: 6,

        layers: [{
        source: "ol",
        type: "OpenLayers.Layer.WMS",
        args: ["World map", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'}],
        group: "background"
},


texts: Is there a way to display Summary of numeric attributes from a  layer in the visible map extent, like ArcGIS Summary widget  ?


texts: I'm using OpenLayers 3.16 and trying to parse the GML I'm getting from a WFS source. It's parsing ok, well mostly, but OL is assuming it's in 2 dimensions, while actually it's in 3. Is there a way to force OL to read it in 3 dimensions?


texts: Specifying the parameters for processing function qgis:joinattributestable with PyQGIS-3

texts:
I would like to join a CSV and a vector layer, based on a field.

I know I can handle this with multiple lines like in first part of https://www.qgistutorials.com/en/docs/performing_table_joins_pyqgis.html .

However, in order to get things a bit shorter and clearer, I would like to use processing algorithm "qgis:joinattributestable".
Under Qgis2, processing.runandload('qgis:joinattributestable', shp, csv, shpField, csvField, None) would be the solution.

Now I'm under Qgis 3.8, I know I can use processing.runandLoad('', parameters).
My question then is : what are the keys of the values (shp, csv, shpField, csvField) that I have to feed parameters dictionnary with ? And also where can I fin this information next time ?  (https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vectorgeneral.html#join-attributes-by-field-value does not tell it if I'm right).


texts: How do I import a Microstation cell library as symbology in QGIS?

texts: I have a .cel file with (point) symbols. I want to import that as symbology in QGIS. QGIS accepts xml files for that. How do I either change the .cel file to xml? Or is there another way to import the symbols in QGIS?


texts:
I was asked to create a shortest path algorithm in java to use with OSRM.

I want to create a route between some points (normally more than 3). The first one, will be the starting point and also the last point (close route). Other point have to be the last before the last one and rest of points have to be ordered taking the shortest path between the first and the last before the first again.

I think this is no possible to do with TSP because TSP doesn't have a known first point and also it is not possible to determine if a point have to be visited in a concrete position. Is it possible?

So I think I should use dijkstra for that and create a route between the starting point and the last before the starting point, after that, add the starting point to the route.

Talking about Dijkstra with some friends, I was adviced about Dijkstra doesn't visit all points always, maybe some of them are left out the route.. .Is this true? Also I hear about Dijkstra doesn't create a route, it creates a tree... also, is it true?

Which algotirhm should I implement?

Thanks and sorry for brick ;)


texts:
I was wondering if anyone could help. I have a tab file in MapInfo consisting of just polylines. Each is meant to have its own reference number, however some are duplicated (e.g two lines occupying the same position with the same ID's) I can identify these with a query, but what I need to know is if it's possible to delete duplicates and leave one remaining (it doesn't matter which one as they are identical).

Thanks,
Alan

(ps. I also have access to QGIS if it is easier in that)


texts: Vector Geoprocesing Intersection not working in QGIS 3.0?

texts:
I have not been able to create an intersection layer in QGIS 3.0. The method has been working fine in QGIS 2.18. The method I have been using is to select Vector >> Geoprocessing tools >> Intersection. I then choose the Input layer and
Intersect layer from the dropdown menu, and click on Run. In QGIS 2.18 it works fine. In QGIS 3.0 I get the error:

  Traceback (most recent call last): File
  "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\processing\algs\qgis\Intersection.py",
  line 135, in processAlgorithm indexB =
  QgsSpatialIndex(sourceB.getFeatures(QgsFeatureRequest().setSubsetOfAttributes([]).setDestinationCrs(sourceA.sourceCrs(),
  context.transformContext())), feedback) Exception: unknown. Execution
  failed after 0.23 seconds

Is there is setting in QGIS 3.0 that I need to select?


texts: Symbology transfer from QGIS to ArcGIS Desktop

texts:
I am working with QGIS and ArcGIS Desktop 10.7.1 simultaneously.

Is there any way to transfer my symbologies and styles from QGIS to ArcGIS Desktop?

I could not find a way to do it so far.


texts: How can i calculate average slope and length of slope of a multiple field farm in Arcmap 10?

texts: I always calculate slope on farms i review with 2' contour lines.  Some fields are difficult since i need the average slope, but the field is rolling hills.  I usally take several slopes and take the average.  I want to have a way to do this in ArcMap 10.  Most farms have 6 - 10 fields and every field needs its individual slope (in degree) and slope length.


texts: What is the EPSG for the S-JTSK/05 system?

texts:
Preface: Some time ago the Czechoslovakian used the S-JTSK (Souřadnicový systém Jednotné trigonometrické sítě katastrální, lit. "Coordinate system for unified trigonometric cadastral networks") on the S-42/SK-42 Krasovski 1940 ellipsoid, through the Krovak transform.
After splitting to Czechia and Slovakia in 1993, modifications were added to this system (and the Krovak transform) in order to be more accurate in each country. These are JTSK03 for Slovakia, and S-JTSK/05 for the Czech Republic now.
Unfortunately, many sources and applications don't make this distinction, calling all three versions simply as "S-JTSK". It makes a lot of confusion.
Question: What EPSG should I use? I've tried all reference/coordinate systems in QGIS having JTSK or Krovak in their names but all of them were off by large. By that I mean hundreds of kilometres.
I have the following points from LPIS (Land Parcel Information System) that I try to match:
-818384.5723, -1014296.9815 (S-JTSK/05) => 50.245373328547686, 13.31661422185417 (WGS-84)
-528744.5675, -1176787.8436 (S-JTSK/05) => 49.11477804083318, 17.577094303962053 (WGS-84)
I have the conversion formulae so I can calculate the forward and reverse transform. Still, it would be nice to display the original data in GIS software.
Edit: As I was sure the Czech cadastre used CRS:2065, I've played with it in QGIS. Finally I've managed to get the points in <10 cms accuracy using EPSG:2065. I only had to remove the negative signs from the coordinates manually. One may change it in the PROJCS itself, by using PARAMETER["X_Scale",-1.0],PARAMETER["Y_Scale",-1.0].
Why not closing the question then? I still don't have a clean EPSG number that I can apply without modifications. Moreover, it uses Ferro as the prime meridian while my formulae are Greenwich-based. (The Remarks section of the EPSG:2065 page gives some insight on its reasons.)
The EPSG Geodetic Parameter Registry gives a nice list for the "S-JTSK/05" search - and big thumbs up for them as they distinguish the geodetic CRS, the projected CRS, the coordinate transform, etc. One can even check which EPSG is northing-easting, and which one is southing-westing.


texts:
I have a multi image tif with 7 bands and I try to use rastrio package to create a simple calculation.
I follow the docs but that not work for me.

any idea ?

here the code:

with rasterio.open('L7.tif') as src:
    #b1, b2, b3, b4, b5 = src.read()
    blue = src.read_band(1)
    green = src.read_band(2)
    red = src.read_band(3)
    nir = src.read_band(4)
    profile = src.profile
    profile.update(
        dtype=rasterio.float64,
        count=1,
        compress='lzw')

MI = numpy.zeros(blue.shape)
MI = (blue *green*red *nir  )

with rasterio.open('ndvi_python.tif', 'w', **profile) as dst:
    dst.write(NDMI.astype(rasterio.float64), 1)

error :

    blue = src.read_band(1)
AttributeError: 'DatasetReader' object has no attribute 'read_band'

if I try to :

with rasterio.open('L7.tif') as src:
    b1, b2, b3, b4, b5 = src.read()

then I take this error :

    b1, b2, b3, b4, b5 = src.read()
ValueError: need more than 1 value to unpack


texts: Error Multiple Define when loading base script

texts:
I have an existing google maps-driven project that I'm trying to rebuild using Esri's JS API. Whenever I add the script tags <script src="https://js.arcgis.com/4.0"></script> to my page, I get Error: multipleDefine.

The dojo module listed changes sometimes on page load, but usually it's the localization modules. Sometimes it's an SVG module, IIRC.
This is a project I inherited from a vendor, so I'm still getting to know it, but as far as I can tell, there's no Esri or Dojo currently in the page.
The error occurs with both 3.16 and 4.0.
The issue does not occur in a test page with nothing but the map I want to show.

How can I debug this error?

Error text (3.16):

init.js:31 Error: multipleDefine(…)
init.js:31 src: dojoLoader
init.js:31 info: Object {pid: "esri", mid: "esri/nls/jsapi_en-us", pack: Object, url: "http://js.arcgis.com/3.16/esri/nls/jsapi_en-us.js", executed: 0…}

Error text (4.0):

init.js:24 Error: multipleDefine(…)
init.js:24 src: dojoLoader
init.js:24 info: Object {pid: "dojo", mid: "dojo/nls/dojo_en-us", pack: Object, url: "http://js.arcgis.com/4.0/dojo/nls/dojo_en-us.js", executed: 0…}


texts:
Working from these instructions:

https://gdal.org/programs/gdal_translate.html#cmdoption-gdal-translate-gcp

I am trying to run the gdal_translate command, here is a sample of the command I run which is part of a group of commands to finally run gdal2tiles to creates tile images for google maps:

`gdal_translate -of VRT -a_srs EPSG:4326 -gcp 0 0 -180 90 63 -gcp 5472 0 180 90 63 -gcp 5472 3648 180 -90 63 DJI_0001.JPG output.vrt`

this is the switch I am having problems with (I think):

`-gcp <pixel> <line> <easting> <northing> [<elevation>]`

My questions:

<pixel> and <line> make up the x and y of a pixel point on the image? So 0,0 is the upper left of the image, and for this image which is 5472 px wide and 3648 pixels in height, that "point" 5472/3648 is lower right corner (?).
<easting> & <northing> in the example from docs is always -180, 180, -90, or 90. Is it possibly a number between -180 & 180 (inclusive) and -90 & 90 inclusive? how do I get that number from a longitude/latitude point?
The third optional parameter is elevation, is that in feet or is there a standard I should be converting to? The image has a field called GPSAltitude whose value is 63 for this image, this is from the EXIF data. Is there a standard for that value's unit (ft, meters, etc.)?


texts: Project a point onto a profile tool graph in QGIS

texts:
I'm using the Profile Tool add-on in QGIS to extract a profile of a raster data layer.

Along this profile there are a series of points which I'd like to project onto the Profile Tool graph so that I can see them in the graph.

Is this possible? I'm happy to use another add-on to achieve the same results if there's something that works better.


texts: Can't intersect and dissolve polygons in PyQgis

texts:
This is the code:

import processing

file1= QgsVectorLayer("/qgis_data/file1.shp",  "file1", "ogr")

file2= QgsVectorLayer("/qgis_data/file2.shp",  "file2", "ogr")
inte=processing.runAndLoadResults("saga:intersect", file1, file2)

But it gives:TypeError: argument of type 'QgsVectorLayer' is not iterable and if i skip it and proceed to the next part where I have to do a dissolve.

dissolved=QgsGeometryAnalyzer().dissolve(inte, "test_dissolved.shp", onlySelectedFeatures=False,
uniqueIdField=-1, p=None

it says:

NameError: name 'QgsGeometryAnalyzer' is not defined

(of course i have tried other variable since inte didn't exist- i used one of the files).

There are also functions that have changed in QGIS3 where I am working with and I have replaced as much as I could find on the internet. But these problems remain(the dissolve one for example has changed but can't find the new one).

Can you tell how to solve the problems and make the code work?


texts: Fixing broken path for renamed feature class in multiple .mxd's?

texts:
I have read up on the ESRI technical article here.

Basically I had a corrupt feature class that I rebuilt from a backup and renamed.  As I created more .mxd's with this renamed feature class, all .mxd's previous to the corruption now have broken sources.  I found a code snippet on the article for replacing a data source.  The problem is, I want to run this code on many .mxd's in a folder but this code only runs on single .mxd's. I have little python experience so I need some help here.

Side Note:  I am delivering these .mxd files along with the FGDB to a client.  I am batch running a script to enable relative links on all .mxd files.  Will this affect the code I need to run on fixing data sources?

In this code, MajorRoads is being renamed to Highways.

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
for lyr in arcpy.mapping.ListBrokenDataSources(mxd):
    if lyr.supports("DATASOURCE"):
        if lyr.dataSource == r"C:\Project\Data\Transportation.gdb\MajorRoads":
            lyr.replaceDataSource(r"C:\Project\Data\Transportation.gdb", "FILEGDB_WORKSPACE", "Highways")
            lyr.name = "Highways"
            mxd.saveACopy(r"C:\Project\Project2.mxd")
del mxd


texts:
My question follows from Splitting Streets to Create Polygons?

I was able to successfully convert a layer of linestrings to polygons based on line intersections with the query given in the answer.

SELECT (ST_Dump(ST_Polygonize(ST_Node(multi_geom)))).geom
FROM   (
  SELECT ST_Collect(<geom>) AS multi_geom
  FROM   <your_table>
  -- WHERE <condition>
  -- GROUP BY <attribute>
) q
;

However, I had a problem with ST_Collect and used ST_Union to create a single geometry of lines from the original linestrings. What I noticed was, St_Union is doing the same thing that St_Node does, St_Union creates a single geometry from lines splitting them at intersections. I simply call St_Dumps on the output from St_Union. This is the transformed query:

SELECT (ST_Dump(ST_Polygonize(q.geom))).geom geom FROM (SELECT ST_Union(geom) geom FROM streets

Are St_Union and St_Node (with regards to this specific operation) similar or is there any benefit from using one over the other?


texts: Allocating point attributes as default values for line layer

texts: I want to add points "ID" attribute as a default value for a line created between two points, for line layer fields "start_point" and "stop_point".


texts: Making Python Add-Ins for ArcMap after installing ArcGIS Pro prevents double-click running of makeaddin.py at Python 2.x?

texts:
I've been working quite a lot with Python Add-Ins over the past week or so in a Windows 7 SP1 configuration with ArcGIS 10.3.1 for Desktop and ArcGIS Pro 1.0.2 installed.  I also installed Python 3.4.1 that comes with ArcGIS Pro and two versions of Python were happily co-existing.

Every time I made changes to my Python script in the Install subfolder and then returned to the Python Add-In folder and double-clicked makeaddin.py I would see that my *.esriaddin file had been updated because its Date Modified changed in Windows Explorer.

Then I upgraded ArcGIS Pro to version 1.1 this morning, and the double-clicking of makeaddin.py ceased to update my *.esriaddin file.  I also noticed that right-clicking on a *.py and choosing Edit with IDLE now opened it with Python 3.4.1 (from ArcGIS Pro 1.1) instead of 2.7.8 (from ArcGIS 10.3.1 for Desktop).  I was able to get Edit with IDLE working the way I wanted it to by referring to Distinguishing Python version when using IDLE with ArcGIS Pro and ArcGIS 10.x for Desktop architecture?

However, double-clicking makeaddin.py still does not update my *.esriaddin file, so I know that something is astray with its file association.  As a workaround I am able to right-click on makeaddin.py, Edit with IDLE (which is using Python 2.7.8) and use F5 (Run | Run Module) to run it.  However, I am keen to get the double-click working again.

Does anyone have a sure-fire method to check and reset the ArcGIS installed version of Python that is run by double-clicking a *.py file?

That ArcGIS Pro installation changes Windows file associations for *.py files is documented but how to change them back is not:

  Windows uses file associations to associate a file extension with an
  executable. When executing a file, the last installation that modifies
  that file association wins, so if there are multiple versions of
  Python, the last version installed will be the one used when a .py
  file is double-clicked or called from a command prompt. Additionally,
  if a version of Python is uninstalled, the file associations for a .py
  will be removed.


texts:
I am going to add a wms layer to my existing map.I use this code:

public load_wms(ESRI.ArcGIS.Controls.AxMapControl mapcontrol) {

               // Create an WMSMapLayer Instance - this will be added to the map later

               IWMSGroupLayer wmsMapLayer = new WMSMapLayerClass();
               // create and configure wms connection name
               // this is used to store the connection properties

               IWMSConnectionName connName = new WMSConnectionNameClass();

                IPropertySet propSet = new PropertySetClass();
                propSet.SetProperty("URL", "http://173.244.165.194/geoserver/Land_Managment/wms?");
                connName.ConnectionProperties=propSet;

               // uses the name information to connect to the service
                  IDataLayer dataLayer = (IDataLayer)wmsMapLayer;
                  dataLayer.Connect((IName)connName);

               // get service description out of the layer
               // the service description contains inforamtion about the wms categories
               // and layers supported by the service

                IWMSServiceDescription serviceDesc = wmsMapLayer.WMSServiceDescription;
                IWMSLayerDescription groupDesc = serviceDesc.LayerDescription[0];

               // for each wms layer either add the stand-alone layer or
               // group layer to the WMSMapLayer which will be added to ArcMap
                for (int i = 0; i < groupDesc.LayerDescriptionCount - 1; i++)
                {
                    IWMSLayerDescription layerDesc = groupDesc.LayerDescription[i];

                  //  if (layerDesc.Title == WMSLayers.SelectedItem.ToString())//Checking if this is the selected layer
                   // {
                        // Configure the layer before adding it to the map
                        ILayer newLayer;
                        IWMSLayer newWMSLayer = wmsMapLayer.CreateWMSLayer(layerDesc);
                        newLayer = (ILayer)newWMSLayer;
                        wmsMapLayer.InsertLayer(newLayer, 0);
                        // add layer to Map

                        mapcontrol.AddLayer((ILayer)wmsMapLayer);
                        IActiveView activeview=(IActiveView)mapcontrol.ActiveView;
                        activeview.Refresh();

                  //  }

                }

But it does not draw anything
I can add it to openlayers but when I add it to ArcMap it does not drow anything..Can you help me fix it
I am on arcobjects 10.2.2 and arcmap 10.2.1 also


texts: Fixing Discontinuous Stream Networks using ArcMap

texts:
I am currently working on a project in ArcMap 10.6.1 involving urban sewershed delineation, however, I am stuck with a discontinuous stream network. I took a LiDAR DEM from NOAA and subjected it to standard archydro tools to create the stream network (direction, accumulation, then raster calculator to set the accumulation threshold) but am stuck on how to make the networks continuous. I have tried filling the DEM prior to this analysis with less desirable results.

My overall goal is to identify storm drainage inlets that can be used as pour points to create sewersheds for the neighborhood shown below.

How can I represent the stream networks?


texts: Using nviz module in GRASS through qgis error

texts:
I'm an new user to qgis/GRASS and I've run into a problem with the nviz module.

In trying to visualise a raster heat map created from vector contours in 3D using the nviz module in GRASS tools in qgis. I received the following error dialogue box:

Can't find usable tk.tcl in the following directories:
C:/OSGeo4W/apps/Python27/lib/tcl8.5/tk8.5
C:/OSGeo4W/apps/grass/GRASS-~1.2/etc/lib/tk8.5
C:/OSGeo4W/apps/grass/GRASS-~1.2/lib/tk8.5
C:/OSGeo4W/apps/grass/GRASS-~1.2/etc/library

I'm running QGIS 1.7.4 Wroclaw on Win7 32 bit and GRASS 6.4.2

I looked in these directories and both tcl8.5 and tk8.5 were missing. I did find tcl8.5.11 and tk8.5.11 on sourceforge. I'm now not sure how to proceed. Will these files fix my problem and how do I get them running and into the right directories?

Any help is greatly appreciated.


texts: The QGIS atlas defined with PyQGIS and a QPT template exports the same maps

texts:
I need to generate an atlas for each feature from a layer for reporting. There will be created a few maps. The centre of each map must be focused on each feature. In this task I use a predefined QPT template. In QGIS Composer Manager everything works perfectly. Then I save the QPT file as a template and I try to automate the process with a plugin using this function. It's based on this thread:  Programmatically load composer from template and generate atlas using pyQgis

    alayer=iface.activeLayer()
    # Add all layers in map canvas to render
    myMapRenderer = self.iface.mapCanvas().mapRenderer()

    # Load template from file
    myComposition = QgsComposition(myMapRenderer)
    template = 'atlas16.qpt'

    myFile = 'C://Users//maria//.qgis2//composer_templates//atlas16.qpt'
    myTemplateFile = file(myFile, 'rt')
    myTemplateContent = myTemplateFile.read()
    myTemplateFile.close()

    myDocument = QDomDocument()
    myDocument.setContent(myTemplateContent)
    myComposition.loadFromTemplate(myDocument)

    # Get map composition and define scale
    myAtlasMap = myComposition.getComposerMapById(0)

    # Setup Atlas
    myAtlas = QgsAtlasComposition(myComposition)
    myAtlas.setCoverageLayer(alayer)
    myAtlas.setComposerMap(myAtlasMap)
    myAtlas.setEnabled(True)
    myAtlas.setHideCoverage(False)

        # Generate atlas
    myAtlas.beginRender()
    for i in range(0, myAtlas.numFeatures()):
        myAtlas.prepareForFeature( i )
        jobs = "D://Krzysztof//Skrypty//Archiwum//"
        output_jpeg = jobs + str(i)+ "_BMS_plan.jpg"
        myImage = myComposition.printPageAsRaster(0)
        myImage.save(output_jpeg)
    myAtlas.endRender()

    if os.path.isfile(output_jpeg) is False:
        QMessageBox.warning(self.iface.mainWindow(), "Uh Oh!", "Something went wrong, no image exported!")
    self.dlg.close()

In the result I get some reports, but they look same -  so the focusing on points isn't performed.

I suspected that I might be caused by the extent which is present in the QPT file. Then I changed my function, so that the extent will be adjusted for each feature. However, at the end I got only empty reports.
The template content is as follows:

Does anyone know what might be wrong? Could you give any hints how a QPT template should be adjusted?


texts: How to set Symbol levels in renderer by PyQGIS

texts: I know that can use renderer.setUsingSymbolLevels(True) to enable the symbol levels, by how can I set the symbol level by PyQGIS? I have tried many methods, but none of them can implement this function. It is very important to have a friend who might help me to answer this question.


texts: I am new in using Bioclim datasets. I want to model future spread of Prosopis juliflora using landsat 30m. I want to add other datasets like temperature, ppt, elevation, soil moisture, pH, etc. Any idea what is the resolution of the Bioclim data is or whether it can be resampled to 30m?


texts: gdal_translate: Can I suppress the creation of auxiliary files?

texts:
Using this command (DOS window in Win7):

gdal_translate name.tif -of AAIGrid name.asc

Each conversion creates the desired name.asc file, but in addition a name.prj and a name.asc.aux.xml which I do not need. Eventually I have over 20000 of these extra files, all with identical content.

Q: Is there a switch that turns off the creation of these two auxiliary help files?

Version:

gdal_translate --long-usage gives (scrapping latter part):

Usage: gdal_translate [--help-general] [--long-usage]
       [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
             CInt16/CInt32/CFloat32/CFloat64}] [-strict]
       [-of format] [-b band] [-mask band] [-expand {gray|rgb|rgba}]
       [-outsize xsize[%]|0 ysize[%]|0] [-tr xres yres]
       [-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]
       [-unscale] [-scale[_bn] [src_min src_max [dst_min dst_max]]]* [-exponent[_bn] exp_val]*
       [-srcwin xoff yoff xsize ysize] [-epo] [-eco]
       [-projwin ulx uly lrx lry] [-projwin_srs srs_def]
       [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
       [-gcp pixel line easting northing [elevation]]*
       [-mo "META-TAG=VALUE"]* [-q] [-sds]
       [-co "NAME=VALUE"]* [-stats] [-norat]
       [-oo NAME=VALUE]*
       src_dataset dst_dataset

GDAL 2.1.2, released 2016/10/24

Have googled, but it's hard to find that one correct hit.


texts: Which Software can derive building footprints from imagery?

texts:
I'm looking for a software solution that can process large areas of imagery to produce building footprints.

For the area of interest, I can source either satellite stereo pairs or oblique imagery. I would like to output vector data of the building footprints, but it need not be highly detailed (rough polygons are fine), nor highly accurate (not all structures need to be recognized)


texts:
I am trying to set up a hyperlink in ArcMap that opens a specific file in a program we've developed.

Using the cmd C:>"C:\Program Files\program.exe" file in windows works fine, but how do I translate this into python script opening the cmd prompt and then running the command?


texts: How to determine which version of Grass if any is installed and available in pyQGIS?

texts:
Pretty simple question that an internet search (or a few guesses in python) cant answer:

How can one programmatically determine which if any version of GRASS is available in pyQGIS

Best I could come up with was to query processing.alglist("grass") into a variable and regex the result. Pretty much what I did in an adhoc  (by eye rather than regex) fashion to solve the immediate problem. But this seems silly.

An alternative idea was simply to run the desired algorithm, but that often returns nothing to the command line, as though it ran correctly. Making EAFP problematic.

Is there a simple way to query which if any version of GRASS is available?

As with @Joseph answer some information is available from grass...utils so:

grass = processing.algs.grass.Grass7Utils.GrassUtils
grass7 = processing.algs.grass7.Grass7Utils.Grass7Utils

However, I had an error with grass7.installedVersion() but grass7.getGrassVersion() worked.

I also note that there is grass7.isGrass7Installed and grass.isGrassInstalled but the results dont nessasarily match whats available if I open processing/toolbox.

For example in my QGIS2.8 Grass 6.4.0 is installed and available from processing/toolbox but grass.isinstalled returns false. In my QGIS2.18(with GRASS7) grass 7 is available from the processing/toolbox but the getversion returns both 6.4.0 and 7.0.0 for the respective version numbers and .isinstalled returns false for both.

The upshot is there appears to be multiple ways to determine the availabilty of an available grass version with little sychronicity to the reality of which version is actually available in the toolbox.

Perhaps my (windows) installed versions of QGIS are interfering with each other? I'll need to test this on my linux machine too.


texts: Does QGIS 3.10.2 change the line.xAt(0) function?

texts:
Is there a recent change to the way a LineStringZ nodes are referenced?

I am getting the error  Error 'QgsMultiLineString' object has no attribute 'xAt'. I have submitted it as a bug (#34094) but it is quite possible that I am doing something wrong.

When I print the .geometry() of the feature, it returns LineStringZ.

The sample code is-

layer = iface.activeLayer()
print(layer.name())
all_features = layer.getFeatures()

for linep in all_features:
    geom = linep.geometry()
    line = geom.constGet()
    print(geom)

    x0 = line.xAt(0)
    print(str(x0))

I can reproduce the error on several linestring data layers. When I go back to QGIS 3.8 the issue goes away.

UPDATE:

It appears that when I open the same shapefile that was created as a QgsLineString,  QGIS 3.10.1 sees its geometry as Line (LineString25D) but QGIS 3.10.2 and 3.10.3 see this as Geometry Line (MultiLineStringZ).  I do not know what to do to rectify this.


texts: Ordinary kriging with three dimensions in R

texts: I want to interpolate temperature for a surface defined by three coordinates: longitude, latitude and altitude. I know one option is to use universal kriging on two dimensions and use altitude as a regressor. ¿is there a way to perform ordinary kriging on three dimensions with the gstat package in R? ¿what option (3d ordinary kriging or 2d universal kriging) is likely to produce more accurate interpolation results?


texts: why does ESRI Maps For Office login window disappear and did not login?

texts:
I recently tried out the ESRI maps for office. After in installed it, i tried to login in excel. it was a success. I then proceed to try it out in PowerPoint.

However, when the sign in window appear and i entered the username and password and click sign in, the window just disappear and not signed in.

i could still see the sign in button in the ribbon instead of 'sign out' which would show if i have successfully login. i tried searching for similar issues but haven't found any.

I tried reinstalling but doesn't seem to fix the issue.

Does anyone know what is the cause of it and how to fix it?


texts:
I have been working on QGIS 3.10, I am using DEMs files that come originally from Lidar data, so they are large files with high resolution. I have been trying to create contours using the: Raster, Extraction, contour option. The problem is that my laptop crashes when I change the default elevation from 10 to 2. I originally thought that the problem could be related to memory. However, I upgraded the RAM memory and internal memory of my computer and it still crashes. The last time it went pretty bad and a blue screen appeared. I turn off my laptop and this error message appear after I turned on the laptop and I restarted Qgis:
ValueError: embedded null byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in
  File "C:/PROGRA~1/QGIS 3.10/apps/qgis-ltr/./python\qgis\utils.py", line 42, in
    import time
SystemError:  returned a result with an error set

Python version:
3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]

QGIS version:
3.10.7-A Coruña 'A Coruña', 7b4ca4c8d0

Python path:
['C:/PROGRA~1/QGIS 3.10/apps/qgis-ltr/./python', 'C:/Users/Gaby/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 'C:/Users/Gaby/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 'C:/PROGRA~1/QGIS 3.10/apps/qgis-ltr/./python/plugins', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\Scripts', 'C:\\Program Files\\QGIS 3.10\\bin\\python37.zip', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\DLLs', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\lib', 'C:\\Program Files\\QGIS 3.10\\bin', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\lib\\site-packages', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGIS 3.10\\apps\\Python37\\lib\\site-packages\\Pythonwin'] `

I also kept in my laptop the older and more stable version of QGIS 2.18 and I extracted contours of the same file....No problem at all.
Does anyone have had a similar problem regarding extracting contours?


texts: Why is Append_Management failing on just 2 (out of 9) table columns?

texts:
In Arc 10.2 I have a script tool that uses arcpy.Append_management() to transfer .csv data into a freshly truncated feature class table.  It works perfectly on all .csv tables except one in which it fails on just two particular columns.  Instead of seeing data these columns are "Null" all the way down.

The names of these columns are "Type" and "Subtype", and both are "Text" fields.

"Type" should have values such as:

  "Human-Land" and "Human-Marine"

"SubType" should have values like:

  "Sub-Surface Flow" and "Water Course"

Rather than supply code (for now) I'm going to zero in on a peculiarity I found in the field mapping variable.

I acquired the field mapping by running "FeatureClasstoFeatureClass", and here is what it gave me for these two fields:

...;Type_ "Type_" true true false 255 Text 0 0 ,First,#,Temp_Layer,Type_,-1,-1;SubType_ "SubType_" true true false 255 Text 0 0 ,First,#,Temp_Layer,SubType_,-1,-1;...

Why did it add an underscore "_" to the end of the field name?  None of the other field names have underscores added to them.  I tried using the field mapping as Arc gave it to me, and I've also tried it with those underscores deleted.  Both ways I still get those two fields filled in as "" all the way down.

Is this related to the problem?  If so, why is this happening and what is the fix?


texts: How to flash a JSAPI map graphic only when contained in map extent

texts:
Using ESRI JSAPI 3.7 I'm flashing a graphic that works fine when the graphic is located within the bounds of the map extent (is visible). However, when you move the map so the graphic is located out of the map extent and try to flash, it throws the following error: "0x800a139e - JavaScript runtime error: lang.hitch: scope["setStroke"] is null (scope="[object Window]")". Here's the function I'm using. Can someone suggest maybe a way to flash only if the graphic is located onscreen? Thanks in advance!

function animateGraphic(graphicFlash) {
                   setTimeout(lang.partial(function (animateMe) {
                       var shape = animateMe.getDojoShape();
                       fx.animateStroke({
                           shape: shape,
                           duration: 500,
                           color: { start: "yellow", end: [0,255,255] },
                           width: { start: 25, end: 15 }
                       }).play();
                   }, graphicFlash), 100);
               }


texts: "Couldn't load plugin mmqgis due to an error when calling its classFactory() method"

texts:
Couldn't load plugin mmqgis due to an error when calling its classFactory() method

  ImportError: No module named mmqgis_kml_export_form  Traceback (most
  recent call last):   File
  "C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python\qgis\utils.py", line
  306, in startPlugin
      plugins[packageName] = package.classFactory(iface)   File "C:/Users/Latha/.qgis2/python/plugins\mmqgis__init__.py", line 17, in
  classFactory
      from mmqgis_menu import mmqgis_menu   File "C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python\qgis\utils.py", line
  572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/Users/Latha/.qgis2/python/plugins\mmqgis\mmqgis_menu.py",
  line 19, in
      from mmqgis_dialogs import *   File "C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python\qgis\utils.py", line
  572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level)   File "C:/Users/Latha/.qgis2/python/plugins\mmqgis\mmqgis_dialogs.py",
  line 1800, in
      from mmqgis_kml_export_form import *   File "C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python\qgis\utils.py", line
  572, in _import
      mod = _builtin_import(name, globals, locals, fromlist, level) ImportError: No module named mmqgis_kml_export_form

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.14.7-Essen Essen, ed8807c

Python Path:
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python
C:/Users/Latha/.qgis2/python
C:/Users/Latha/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
c:\osgeo4~1\apps\python27\lib\site-packages\python_dateutil-2.1-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\bin\python27.zip
C:\PROGRA~1\QGIS2~1.14\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.14\bin
C:\PROGRA~1\QGIS2~1.14\apps\Python27
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\PIL
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/Latha/.qgis2//python
C:\Users\Latha.qgis2\python\plugins\gearthview\ext-libs
C:\Users\Latha.qgis2\python\plugins\mmqgis/forms

I dont know how to work with programming languages, so I am not sure of what the error is and how to correct it.

I happen to clear a lot of my temporary files yesterday and i am not sure if that is the reason as to why this error has cropped up. I am unable to open any project or vector or raster layers.

I tried uninstalling QGIS and reinstalling it. But, I get the same error message.


texts: Defining geometry type in QgsDataSourceUri

texts:
There is a PostgreSQL database containing some layers that have few types of geometry (multipolygons and linestrings). I need to distinguish these geometries in two separate layers.

My basic strings that make layer for QGIS are:

uri.setConnection('srs', '5432', 'db_name', 'postgres' , 'password')
for i, name in enumerate(sorted(list_of_layers)): # list containing elements like ['schema_name', 'layer_name']
    if name[1] in ['layer_with_geometry_collection']:
        uri.setDataSource(name[0], name[1], 'SP_GEOMETRY')
        vlayer=QgsVectorLayer (uri.uri(), name[1], "postgres")

Where do I need to set the geometry type?
If I check vlayer.wkbType(), it throws me 0.
Manual set uri.setWkbType() hadn't helped yet.


texts: FindLabel vbScript expression not working?

texts:
Below expression is not working

Function FindLabel ( [NameEnglish], [Remarks], [FacilityType] )
    namh = ""
    rems = ""
    fact = ""

    if not isnull (  [NameEnglish] )  then
        namh = [NameEnglish]
     elseif not isnull  (  [Remarks] ) or (([Remarks]) <> "")  then
        rems = [Remarks]
      elseif not isnull (  [FacilityType] ) then
        fact = [FacilityType]
    end if

    FindLabel = namh & " " & rems & " " & fact
End Function

I want to fulfill condition when Remarks is NULL & Remarks having "" means blank


texts: Layer vanishes when changing to categorized renderer

texts:
I’ve run into an issue with creating categorical maps in QGIS.

I’m creating a map of soil types of a 2500ha region. The shp file has the expected attribute table but was originally clipped from a much larger shp file.
As soon as I go into properties and change the symbology to categorized (or anything other than single symbol) the layer vanishes. Which is to say I cannot view the layer in the mapping window, but it still appears in the layers panel, and only returns when I change it back to single symbol.
I'm using 2.18.3

Has anyone else had this issue?


texts: I have developed a plugin for QGIS. It has two buttons and I have to add custom icons for it. How can I create custom icons for this?


texts: Using Bing Maps Quadkeys as Openlayers 3 Tile source

texts:
I have a number of tile sources which utilise Bing Maps' Quadkey system in an old Silverlight application and I would like to use them in a new Openlayers 3 map.

I have found several examples of functions which will convert these sources for Leaflet.js but the syntax is somewhat different for OL3 and reading through the API docs indicates that there is an ol.Tile.coord class but if I understand correctly this is an experimental feature and might require a custom build from the source code.

Can anyone provide an example of this type of conversion or indeed does anyone know if the latest (3.8.2) version of OL3 supports the quadkey method?

This is the Leaflet example:

var BingLayer = L.TileLayer.extend({
getTileUrl: function (tilePoint) {
    this._adjustTilePoint(tilePoint);
    return L.Util.template(this._url, {
        s: this._getSubdomain(tilePoint),
        q: this._quadKey(tilePoint.x, tilePoint.y, this._getZoomForUrl())
    });
},
_quadKey: function (x, y, z) {
    var quadKey = [];
    for (var i = z; i > 0; i--) {
        var digit = '0';
        var mask = 1 << (i - 1);
        if ((x & mask) != 0) {
        digit++;
        }
        if ((y & mask) != 0) {
            digit++;
            digit++;
        }
        quadKey.push(digit);
    }
    return quadKey.join('');
}
});

And this is the exisiting Silverlight code:

public override Uri GetUri(int x, int y, int zoomLevel, bool getPrintLink)
        {
            Uri uri = null;
            if (this.Covers(x, y, zoomLevel))
            {
                QuadKey qk = new QuadKey(x, y, zoomLevel);
                if (getPrintLink)
                {
                    uri = new Uri(this.CurrentHostURL + "/tiles/NL/" + zoomLevel.ToString() + "/" + qk.Key + ".ipic", UriKind.RelativeOrAbsolute);
                }
                else
                {
                    uri = new Uri("http://tileserver.satmap.com/NL/" + zoomLevel.ToString() + "/" + qk.Key + ".ipic", UriKind.RelativeOrAbsolute);
                }
            }
            return uri;
        }


texts: Converting local coordinates to UTM 36N by control points in QGIS?

texts:
Our project is generating local excavation data from a local grid which we eventually want to transform from the local coordinates to real world coordinates. In this case we want to convert/translate to UTM 36 N. We are measuring ground control points at several locations in the grid.

Is there any easy-to-use tool which would allow us to transform to UTM based on a table of GCP and Local Points?

We are generally using QGIS, but I have not found a valid option for our usecase, yet.


texts: Styling map and generating tiles for Mapnik and/or GeoServer?

texts:
I have almost 5 shapefile layers(contains point,line,polygon), now I want to style different layers, for example, different layers, different attributes of the same layer will rendered with different symbols, and some feature will only be rendered at a certain zoom and etc.

I wonder how do you do this  kind of job?

I know both mapnik and geoserver, however none of them have any GUI to do the symbol job.

Any other alternatives?


texts: Strange Custom Projection can't be transformed

texts:
I've got a a database of feature classes that were somehow transformed into a custom projection that I don't understand, and there does not seem to be a way to get back out of.   The projection data are below.   Three questions:

How did it get this way?
How can it be made into a standard projection?
Can you recover a file that was transformed out of this projection?

This is what the projection says:

NAD_1983_StatePlane_Ohio_South_FIPS_3402_Feet
Authority: Custom

Projection: Mercator_Auxiliary_Sphere
False_Easting: 0.0
False_Northing: 0.0
Central_Meridian: 0.0
Standard_Parallel_1: 60.0
Auxiliary_Sphere_Type: 0.0
Linear Unit: Foot_US (0.3048006096012192)

Geographic Coordinate System: GCS_WGS_1984
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_WGS_1984
  Spheroid: WGS_1984
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314245179
    Inverse Flattening: 298.257223563

What the heck is this?


texts: How to do I do this specific expression in QGIS?

texts:
I am trying to get a certain expression in QGIS right, but because I am quite new to QGIS expressions, I cannot quite get it right.

Basically I want another field, to have specific kind of text based on the value of the pre-existing field. In this case, when the height of a tree ("Height" field) has the following values, the following text will be displayed:

  <6 meters: >6 meters 3rd category
  between 6-12 meters: 2nd category
  >12 meters: 1st category

How exactly do I do this and what I am doing wrong here?

As for a side note, should I better do this using AutoFields plugin, so I am sure it happens automatically?


texts:
I am building a plugin based around PyQt5.QtChart

This line will not work as QGIS (3.8) appears to use its own python. It works fine in my python IDE. I have confirmed that QGIS is using a different version.

from PyQt5.QtChart import QChart,QChartView,QLineSeries

I tried installing PyQt5.QtChart within my plugin's local directory in a lib subdirectory but cannot get QGIS3 to load it. I've tried many combinations of import but none seem to load the QtChart.so file.

Pycharm is the IDE but I need this to work for other users


texts:
Is there a way to convert a DEM raster to a .las file using open source software and/or any tools that come along with a complete ESRI license?

I have been able to achieve this using the LAS Toolset shp2las tool from the UNC website, but this specific tool requires licensing. I have not be able to achieve this using the txt2las tool from the UNC website, though it does not require licensing.


texts: Process a raster with multiple geoprocessing tools in arcgis 10 using python - flow between processes

texts:
I'm writing a short python script that includes processing rasters with different geoprocessing tools in ArcGis 10, for example, the three processes below, is this best way to use multiple tools successively, i.e. create temporary rasters in the scratch workspace and then delete them all at the end of the script? By "best", I guess I mean is this the fastest/most efficient way to do this?

# calculate distance (inR is the input raster)
tmp1 = EucDistance(inR, "", "1000", "")

# convert to integer raster
tmp2 = Int(tmp1)

# Reclassify again
arcpy.CalculateStatistics_management(tmp2, "1", "1", "")
tmp3 = Reclassify(tmp2, "VALUE", "0 NODATA", "DATA")


texts: How to add SLD to a wms layer dynamically from javascript

texts: How to add SLD style which is written in String format  and stored in a 'var' variable of javascript and asign it to a WMS layer while creating it.


texts: When working In layout View how do you make side by side pages. Two pages on the same screen. I have seen this done once so I know it is possible. Both pages were set up 8.5 by 11. I know you can use multiple pages with DDP but I would like two on the same screen so that I can have two different titles and Legends.


texts:
I am trying to export a map from Google Earth to Cloud storage with Export.map.toCloudStorage:

Export.map.toCloudStorage({
    image: myMap.visualize(myMapVis),
    description: '123',
    bucket: 'bucket',
    path: '01',
    scale: 500
});

When the task is finished not all tiles are exported. If I zoom out to 0, then I see the whole layer, but when I zoom in a bit I only see some region. It feels like map reduce job that is producing a map was dropping results from some nodes. Does anyone had similar problem? Is it solvable?


texts:
I have any local tiles (seed via Mapproxy) of any local area. May I configure mapproxy that I can use a local tile directory on my computer as a source  and get the output then WMS ?
I've already configured mapproxy.yaml which has this lines:
services:

demo:
  wms:
    srs: ['EPSG:3857', 'EPSG:4326', 'EPSG:3395']
    # image_formats: ['image/jpeg', 'image/png']
    md:
      # metadata used in capabilities documents
      title: MapProxy WMS Proxy
      abstract: This is the fantastic MapProxy.
      online_resource: http://mapproxy.org/
      contact:
        person: Your Name Here
        position: Technical Director
        organization:
        address: Fakestreet 123
        city: Somewhere
        postcode: 12345
        country: Germany
        phone: +49(0)000-000000-0
        fax: +49(0)000-000000-0
        email: info@omniscale.de
      access_constraints:
        This service is intended for private and evaluation use only.
        The data is licensed as Creative Commons Attribution-Share Alike 2.0
        (http://creativecommons.org/licenses/by-sa/2.0/)
      fees: 'None'

layers:
  - name: Testing tiles
    title: Testing tiles
    sources: [osm_cached]
caches:
  osm_cached:
    grids: [gmaps_grid]
    sources: []
    cache:
     type: file
     directory_layout: tms

grids:
  gmaps_grid:
    tile_size: [256, 256]
    srs: EPSG:3857
    origin: nw

But cannot see the results, just empty page whout scrolling
Please explain should I use cache->directory_layoutORdirectory? If so how does it look?


texts: Summarizing entries by column using QGIS?

texts:
I have one field named (OBID) identificator of an municipal. Second field is ZAPOSL which indicates the number of employees in several stores in this municipal.

I wolud like to summarize all employees in each municipal.

Example: If the municipal ID is for example 55, QGIS should sum all ZAPOSL numbers which correspond to the OBID = 55.

See figure: OBID = 55: ZAPOSL: 2+0+18+4+8+0+4 = 36

ArcView knows that as Summarize and creates a new table with the result...


texts: Does the USDA SSURGO database have a web-based API that I can query?

texts:
Based on a previous question, Can I download the entire NRCS SSURGO database?, it appears that it is difficult to import the entire USDA SSURGO database.

The Web Soil Survey provides the ability to draw a polygon and then download data. But the polygon has to be fairly small, and there is a lot of pointing, clicking, and waiting to get the desired data. There is also a Geospatial data gateway  where it is possible download county-level data.

However, these do not meet my needs. This is what I want to do:

I start with the lat/lon coordinates of the corners of a rectangle
find the area of each soil type in the rectangle
find % clay, sand, silt, organic matter as a function of depth for each soil type

Is there a way that I can do this programatically?

(Solutions in R preferred, but any open-source solution will be useful)


texts: ArcSDE Enterprise geodatabase compress error

texts:
My organisation has ArcSDE enterprise geodatabase(ArcGIS 9.2) with MS SQL Server 2008 as DBMS.

When I compress the geodatabase I am getting the follwoing error

 Failed to compress the database.

 Underlying DBMS error [microsoft][ODBC Driver11 for SQL Server][SQL
 Server]Violation of PRIMARY KEY constraint'Value'. cannot insert dulpicate
 key in object'Value']

I ran the Diagnose versions table and then repair versions table but I still get the same compress error after executing repair.


texts: Extracting all information within polygons from separate feature classes (layers)?

texts:
I have a model with 2 layers. The first layer contain information about soil, vegetation etc in a large area. The second layer shows property boundaries within this large area.

Is it possible to create a model that finds all the information about soil and vegetation within the boundaries of each property?


texts: How to calculate the shortest path to pass on 7.000 UTM points?

texts:
Anyone can give me an advice how to calculate the shortest path with a lot of UTM points?
In total I have 7000 points, but it can be grouping 100 or 500.

I have knowledges about Java and Python for develope an script if it's necessary


texts: Adding points to QgsRubberBand polyline instead of giving list of points

texts:
canvas = iface.mapCanvas()
polyline = QgsRubberBand(canvas, False)  # False = not a polygon
points = [QgsPoint(1,1), QgsPoint(2,2), QgsPoint(3,3), QgsPoint(4,4)]
polyline.setToGeometry(QgsGeometry.fromPolyline(points), None)
polyline.setColor(QColor(255, 0, 0))
polyline.setWidth(3)

This is my sample code. I want to be able to append points to the line rather than updating my list and providing the same list again. Is there any way to do so?


texts: Adding Fields in an attribute table ArcGIS

texts:
I want to add new field each time my loop needs to add fields but the name of the field should be different, like increment of characters. But it always rises and exception error stating a field with same name has been created already and it creates only one field when the loop runs 3 times.

for j in range(3):
...     tab_field=arcpy.AddField_management("prob_table","day(x)","LONG")
...     for k in range(6):
...         for i in range(4):
...             a=arr_trans[k][i][j]
...             print(a)
...     x+=1

here x is defined as 0 initially before the starting of the loop. This is not the full code im working on but the necessary part of code which illustrates when a new field is to be created.

r=0
x=0
for j in range(3):
    c=0
    tab_field=arcpy.AddField_management("prob_table","day_{0}".format(x),"LONG")
    for k in range(6):
        for i in range(4):
            a=arr_trans[k][i][j]
            cursor=arcpy.updatecursor("prob_table","OID={}".format(c),fields="")
            for row in cursor:
                IR=row.getvalue("I_R")
                IN=row.getvalue("I_N")
                RR=row.getvalue("R_R")
                RN=row.getvalue("R_N")
                NR=row.getvalue("N_R")
                NN=row.getvalue("N_N")
                RW=row.getvalue("W_R")
                RD=row.getvalue("D_R")
                ND=row.getvalue("D_N")
                NW=row.getvalue("W_N")
                if(r==0):
                    if(a==0):
                        rain_prob=IR*RD
                        norain_prob=IN*ND
                        if(rain_prob>norain_prob):
                            row.setvalue("x",1)
                            updatecursor
                        else:
                            row.setvalue("x",0)
                            updatecursor
                    else:
                        rain_prob=IR*RW
                        norain_prob=IN*NW
                        if(rain_prob>norain_prob):
                            row.setvalue("x",1)
                        else:
                            row.setvalue("x",0)

the "x" denotes the place i need to give my field name which doesnt work by using format(x). the error i get is an execution error.


texts:
I have a shapefile of thousands of polygons.
I'm looking to loop through each polygon and create a raster of the shapefiles boundaries for each polygon.
I'm looking for each raster to have the value of 1 for the areas where the polygon exists and a value of 0 where it doesn't.
I've tried the below but the rasters are off both in terms of shape and crs.
eco_sys = gpd.read_file(all_habitats_path)
# eco_sys = eco_sys[eco_sys.EUNIScombD == 'A6.51']

eco_len = len(eco_sys.geometry)
eco_list = [1] * eco_len
rst = rasterio.open(cropped_rast_template)
transform, width, height = calculate_default_transform(
    rst.crs, ENV.get("jose_crs_str"), rst.width, rst.height, *rst.bounds
)
meta = rst.meta.copy()
meta.update({
    'compress': 'lzw',
    'crs': ENV.get("jose_crs_str"),
    'transform': transform,
    'width': width,
    'height': height,
    'nodata': -999
})
# eco_sys.geometry.values[0].buffer(0)
shapes = ((geom, value)
          for geom, value in zip(eco_sys.geometry, eco_list))

with rasterio.open('data/tmp/all_habs.tif', 'w+', **meta) as out:
    out_arr = out.read(1)
# combined_rasters = None

for idx, shape in enumerate(shapes):
    print(' idx, shape : ',  idx, shape)
    if idx != 11:
        burned = features.rasterize(
            shapes=shape, fill=0, default_value=1, out=out_arr, transform=out.transform)

        with rasterio.open('data/tmp/eco_sys/'+str(idx)+'.tif', 'w+', **meta) as dst:
            reproject(
                source=burned,
                destination=rasterio.band(dst, 1),
                src_transform=rst.transform,
                src_crs=rst.crs,
                dst_transform=transform,
                dst_crs=ENV.get("jose_crs_str"),
                resampling=Resampling.nearest,
                dst_nodata=-999)
            dst.write(burned, 1)


texts: Loading Postgis Layers in a desktop application using C#

texts:
I have layers in a postgis database that I can load in a MapWindows Control (ocx) using a npgsql connection and creating a shapefile using the geometry field in a Visual Studio .Net 2010 (C#) application, but this is really slow when the layer contains too many features.

I have seen that QGIS loads postgis layers very fast and I want to know if is possible to use the QGIS functionality in any way in a Forms Application using C#, like a DLL or an ocx control. I need to load postgis layers in a display control with legend and be able to change colors, symbology, labels, etc. Also, I need to save any changes in the layer to the postgis database.

Any help will be appreciated.

Thanks.

Update:

Unicoletti, thanks for your reply.

I don't see the way to use swig to open a postgis layer and show it in a windows forms. I was wondering if there is any way to encapsullate qgis functionality to do that.

I want to have a control in a form and programatically open a postgis layer on it and, later, manage the properties of that layer, line color, fill color, legends,... Right now I'm using MapWindows ocx but loading postgis layers is really slow, as it's made creating a shapefile and adding shapes to it one by one (using feature data objects).

If you know where to find a complete application example that loads a postgis layer using QGis functionality in c# or even in c++, it would be very appreciated.

Thanks, and sorry for my bad english.


texts: Republic of Ireland country boundary shapefiles

texts:
Does anyone know where I can get shapefiles for the country border of the Republic of Ireland?

Ideally I would like these to be in British National Grid (BNG) projection, as I have to show these on a map which includes Northern Ireland, England, Scotland and Wales.


texts: qgis:mergevectorlayers won't allow two layers for the second arg

texts:
I've been searching the web with no luck. This old exchange should be exactly what I need: Merging vector layers via python in QGIS 2.18.1

My code looks like this:

processing.tools.general.runalg("qgis:mergevectorlayers", importLayer + ";" + masterLayer, tempLayer)

But it gives the following error on execution:

TypeError: unsupported operand type(s) for +: 'QgsVectorLayer' and 'str'
Traceback (most recent call last):
File "C:/Users/visitor/.qgis2/python/plugins\DataImporter\ImporterMain.py", line 47, in run self.dialog.run(layer)
File "C:/Users/visitor/.qgis2/python/plugins\DataImporter\ImporterUIFunctions.py", line 66, in run
self.mergeLayersIntoTemp(layer, layer.masterLayer)
File "C:/Users/visitor/.qgis2/python/plugins\DataImporter\ImporterUIFunctions.py", line 141, in mergeLayersIntoTemp
processing.tools.general.runalg("qgis:mergevectorlayers", importLayer + ";" + masterLayer, tempLayer)
TypeError: unsupported operand type(s) for +: 'QgsVectorLayer' and 'str'

Both importLayer and masterLayer are QgsVectorLayer objects, so I can only conclude it dislikes adding the ; in this fashion.

How is one supposed to send the layers to be merged these days?

EDIT:

The full code

def mergeLayersIntoTemp(self, importLayer, masterName):
    masterLayer = Utils.getLayerByName(masterName)
    tempLayerName = masterName + "_temp"

    tempLayer = ""
    provider = ""
    if not Utils.getLayerByName(tempLayerName):
        tempLayer = QgsVectorLayer("Point?crs=epsg:4326&index=yes", tempLayerName, "memory")
        provider = tempLayer.dataProvider()
    else: # We already have a temp player of this name. Something's wrong.
        ctypes.windll.user32.MessageBoxW(0, u"Attempted to create duplicate temporary layer.", u"Error", 0x0|0x10)
        return

    tempLayer.startEditing()

    #for field in masterLayer.pendingFields():
        #name = field.name()
        #fieldType = field.typeName()
        #provider.addAttributes([QgsField(name, getattr(QVariant, fieldType))])

    tempLayer.commitChanges()
    QgsMapLayerRegistry.instance().addMapLayer(tempLayer)

    Processing.initialize()
    processing.tools.general.runalg("qgis:mergevectorlayers", [importLayer, masterLayer], tempLayer)

def getLayerByName(name):
    layers = QgsMapLayerRegistry.instance().mapLayersByName(name)
    if layers:
        return layers[0]

importLayer is passed through from the top, it's the layer selected when the tool is run. This is a plugin, not console.


texts:
I have the following script that reclassifies rasters and then combines them into one.  I am trying to clip the final raster to a shapefile I have.  All my research shows that I need to clip it to the extents of the shapefile (called a rectangle). My script is as follows;

import arcpy
from arcpy import env
from arcpy.sa import *

env.workspace = "C:\\Data"

arcpy.CheckOutExtension("Spatial")

outReclass1 = Reclassify("stream", "VALUE",
                     RemapValue([[1,0], ["NoData",1]]))
outReclass1.save("C:\\Data\\reclassStream")

outReclass2 = Reclassify("pond", "VALUE",
                     RemapValue([[1,0], ["NoData",1]]))
outReclass2.save("C:\\Data\\reclassPond")

outReclass3 = Reclassify("landuse", "VALUE",
                     RemapValue([[1,1], [2,2], [3,3], [4,4]]))
outReclass3.save("C:\\Data\\reclassLandUse")

outReclass4 = Reclassify("soils", "VALUE",
                     RemapValue([[1,3,1], [3,6,2], [6,9,3], [9,12,4], [12,15,5]]))
outReclass4.save("C:\\Data\\reclassSoils")

finalRaster = outReclass1 * outReclass2 * outReclass3 * outReclass4
finalRaster.save("C:\\Data\\riskarea")

arcpy.CheckInExtension("Spatial")

arcpy.Clip_management("riskarea", "440677.437, 4331200, 611070.062, 611070.062", "riskarea_clipped")

I am getting the following error;

line 30, in <module>
    arcpy.Clip_management("riskarea", "440677.437, 4331200, 611070.062, 611070.062", "riskarea_clipped")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py", line 15884, in Clip
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Rectangle: Dataset 440677.437, 4331200, 611070.062, 611070.062 does not exist or is not supported
ERROR 000472: Name of single band grid cannot have more than 13 characters
Failed to execute (Clip).


texts: QGIS, drawing entity with a magnetized knot

texts: I wanted to know if it was possible to draw with a magnetized knot, like Archi or Autocad ... !?


texts: How to translate from GeoJSON to GeoDataFrame

texts:
I want to convert GeoJSON into a GeoDataFrame, but it doesn't work.

GeoJSON is stored in a dictionary variable.

If you know of a solution, I would like to know how to solve this problem.
This is my code.
geojson={
    'type': 'Feature',
    'properties': {'name': 'building'},
    'geometry': {
        'type': 'Polygon',
        'coordinates': [
            [
                 [139.288478, 36.50807],
                 [139.288478, 36.508312],
                 [139.288778, 36.508312],
                 [139.288778, 36.50807],
                 [139.288478, 36.50807]
            ]
        ]
    }
}

gdf=geopandas.GeoDataFrame(geojson,geometry='geometry',crs="EPSG:4326")

but

TypeError: Input must be valid geometry objects: Polygon

I don't understand why Polygon is not a valid geometry object.


texts: I am trying to scale (up and down) feature(s), similar to ArcGIS where the first click specifies the scale reference point and the second click specifies the scale factor, but couldn't find a solution that works for Version 3..1 of QGIS, The Affinity command is not available and the vector transform plugin seems outdated. Thanks.


texts: GeoServer/GeoWebCache - showing raster layers depending on scale (zoom level)

texts:
I have a client application, "talking" to my GeoWebCache service (using TMS), showing a map. The map is built out or a few raster layers. I need to show only one of them a time - depending on the zoom level (scale), one of the layers should be shown - the rest not visible.

The client can use only one "link" to access the map - I cannot switch the layers on the client.

I created a group layer on GeoServer (2.1.4) built out of the two layers I am using (250k and StreetView from OS). I cannot see any way to specify that one of them should be seen when the scale is less then N and the other otherwise. I tried a style for raster layer, specifying opacity depending on the scale, but it does not seem to work. How is it done on GeoServer?

If it is doable on GeoWebCache level, that would be fine too. I successfully added the layers to geowebcache.xml file (I need the epsg:27700 projection, that is why the config was needed), but cannot find a way of saying "use this wms url when scale is less than N".

Any help will be much appreciated, thank you.

---- UPDATE after the answer - the solution ----

I have two styles created, called raster-0-50k and raster-50k-up. Here is the first one of them, which I applied to the layer at the bottom of the stack (the top one in the list of the group layer):

  <NamedLayer>
    <Name>raster-0-50k</Name>
    <UserStyle>
    <!-- Styles can have names, titles and abstracts -->
      <Title>Raster 0 to 50k</Title>
      <Abstract>Raster, showing scale 0 to 50000</Abstract>
      <!-- FeatureTypeStyles describe how to render different features -->
      <!-- A FeatureTypeStyle for rendering rasters -->
      <FeatureTypeStyle>
        <Rule>
          <Name>rule1</Name>
          <Title>Opaque Raster</Title>
          <Abstract>A raster with 100% opacity</Abstract>
          <MaxScaleDenominator>50000</MaxScaleDenominator>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>

the other style does exactly opposite - sets opacity to 1 for scale 50k and higher. In the group layer's list, I associated the two styles with my two layers.

It does work now :) Thank you.


texts: Is it possible to import a KML to the map? - ArcGIS API 3.27

texts:
I am trying to see if it is possible to upload a KML layer to display on the map. I have looked into using KMLLayer, but that requires a public URL to load in, and I can't use the file path of the file for security reasons (and because modern browsers change it to "c:\fakepath\file.kml" anyways for that very reason).

I tried to see if I can do client side conversion from KML to GeoJSON with gtran-kml and from GeoJSON to ArcGIS Geometry with arcgis-to-geojson-utils, but whenever I try to load the modules with require after installing them with npm, I keep on getting a module defined error in the console. I saw that it was trying to pull the module from the ArcGIS API. So I tried looking through the require.config file to see if it was set to the API, and it doesn't appear so. Using ./gtran-kml instead of gtran-kml went to the root URL, but still gave the same error being thrown by ArcGIS's init.js file. I don't know if this is an issue with npm, with not installing in the correct directory, with not calling modules correctly (I used var a = require('gtran-kml') then a.fnName to use it), or all three.

I'm still relatively new to working with JavaScript. So if anymore information is needed, please tell me.


texts: Why snapping doesn't work on Leaflet version 1.0.0 and newer?

texts:
On documentation of Leaflet.Draw, Snapping sample is not working with Leaflet 1.0 but it works with Leaflet 0.7

http://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#l-draw-polyline

Is it supposed to be works with different method?


texts:
My group is trying to optimize our GeoServer installation (2.16.0), specially focusing on raster data.

In different posts I've seen some conflicting information regarding the use of Native JAI and Native JAI ImageIO to improve raster performance. From my understanding Native JAI is not supported using JRE 11.

Is it still valid today (Nov 2019) the use of Native JAI to gain this performance?

Also apart from TileCaching are there other optimizations that we can use to serve our tiles faster?

GeoServer is running inside a docker container with Debian 9


texts: Issues with MakeFeatureLayer inside of for loop

texts:
I'm in the process of developing a script that will create individual shapefiles for schools, churches, and hospitals in El Salvador based off of OpenStreetMap data. For some reason, my loop is creating empty shapefiles rather than selecting the pre-existing shapefile points and moving them into their own shapefile.

import arcpy
import os
arcpy.env.workspace = "D:/GIS/Lesson3/Project3/Project3.gdb"
arcpy.env.overWriteOutput = True
outPath = "D:/GIS/Lesson3/Project3/Project3.gdb"
points = "OSMpoints"
countries = "CentralAmerica"
amenities = ['school','hospital','place_of_worship']
amenityLayers = []

country = 'EL Salvador'

stateSelectionString = '"NAME" = \'{}\''.format(country)

Delete any extra layers that might be hanging around and prevent code from executing

if arcpy.Exists("ElSalvadorLayer"):
  arcpy.Delete_management("ElSalvadorLayer")
if arcpy.Exists("amenitiesLayer"):
  arcpy.Delete_management("amenitiesLayer")

Create a feature layer that I can use to query my amenities with later

arcpy.MakeFeatureLayer_management(countries,"ElSalvadorLayer",\
                              stateSelectionString)

for amenity in amenities:
  amenitySelectionString = '"amenity" = \'{}\''.format(amenity)
  outShp = os.path.join(outPath,"{}".format(amenity))

  arcpy.MakeFeatureLayer_management(points,"amenitiesLayer",\
                                  amenitySelectionString)

getCount method used to test for whether any amenities have been selected, provides 3 0's to pywin interactive window each time.

  selectedAmenitiesCount = arcpy.GetCount_management("amenitiesLayer")
  amenitiesCount = int(selectedAmenitiesCount.getOutput(0))
  print amenitiesCount

  arcpy.SelectLayerByLocation_management("amenitiesLayer",\
                                       "WITHIN",\
                                       "ElSalvadorLayer")

  arcpy.CopyFeatures_management("amenitiesLayer",\
                              outShp)
  arcpy.Delete_management("amenitiesLayer")


texts: Measuring distance between points using QGIS

texts:
I have a layer with about 500 single points. Now I want to measure the distance between each of these points and one specified observation point.
I need the distance to show how far away from the observation point every of these points was located to build a table for detection probability.
I already tried lots of Plugins (Hub Distance, NNJoin, ...), but simply can't find a proper way to calculate what I need.


texts: How to copy closed loop lines into polygon feature class

texts: I'm trying to utilize line contour data to find the volumes of local depressions. To do this, I want to copy the closed loops formed by depression contours into a polygon feature class to find the area of the loops. I've done this several times in ArcGIS 10.0 successfully by selecting the contours I want to copy, then using "Ctrl+C" and "Ctrl+V". My organization just upgraded to 10.1 and the ability to copy from line data to polygon data doesn't seem to work. Is this ability no longer supported, or am I going about this the wrong way?


texts: Bezier curves on GPX path using turf.js but for iOS platform

texts: I'm interested in creating bezier curves on a path based on imported GPX data and understand how to implement turf.js for web. But how would I implement this for iOS? Specifically, if I am using a Mapbox hosted map in iOS, how do I apply the turf.js to enable that, or is there an alternative way of getting an OSM Mapbox or Leaflet map into iOS (and, importantly, for offline caching)?


texts: QGIS area calculation differs when on the fly CRS transformation enabled

texts:
When I open QGIS, add the layer, and calculate the areas of the shapefile via field calculator I get a different area than when I open QGIS and check "Enable on the fly CRS transformation" and calculate the area. This is despite making sure that the project and the layer have the same Coordinate system (same EPSG number). What am I doing wrong?

I have a shapefile with area calculations made with ArcGIS (not be me, the data was handed to me and I have no clue for which CRS the area was calculated with ArcGIS). The shapefile layer CRS is EPSG: 21781 (Switzerland). In QGIS, if I do not change the OTF settings and leave the project CRS as EPSG:4326 (WGS84) I get the same value as the ArcGIS area value. However, if I change the OTF before adding the layer to EPSG: 21781 I get different area values. As I understand this suggests that ArcGIS Area was calculated with the CRS EPSG: 4326.

First workflow:

open QGIS
project CRS: EPSG 4326
add layer
project CRS adapts automatically and is EPSG 21781 now
calculate $area with field calculator

Second workflow:

open QGIS
project CRS: EPSG 4326
Turn on OTF, set project CRS to EPSG 21781
add layer
calculate $area with field calculator

Step 5 of the first and second workflow DO NOT produce the same area.


texts:
I need to make a map with selectable layers. I am using ArcGis and so far I am able to create a map that has some selectable layers and most labels are selectable. The PDF looks like below:

But I need to figure out how to make the layers stay separately rather than in folder so that they look like this: