texts: Displaying annotation data from CSV file on qgsmapcanvas

texts:
I am developing a custom Qt application using QGIS(3.14) C++ API. I need to display the annotation layer on qgsmapcanvas.CSV files contains lat, long, and country name and comma as a delimiter. I followed PYQGIS developer  CookBook(used it in C++ manner) and tried to render it as a vector layer on qgsmapcanvas. But it saying invalid file.
1.URL for my CSV file is :
QString uri =  QString("C:/Users/Puneet/Desktop/annotation/COUNTRY.csvdelimiter=%1&xField=%2&yField=%3").arg(";").arg("latitude").arg("longitude");
2.vector layer formation:
QgsVectorLayer *layer = new QgsVectorLayer(uri, baseName , "delimitedtext");
what is going wrong in it ?


texts: Selecting Features within distance and direction using ArcPy?

texts:
Is there a way to select features in a layer by location based on their proximity to another feature and the direction? E.G., select all features within 10 meters north of current selection?

I am using ArcMap 10.3.1

I am selecting points, and I have scripting abilities.


texts:
I set up a model in ArcGIS 10.4.1 ModelBuilder to use the Eliminate tool. Searching around to do it led me to Select by Attributes in Model Builder and Eliminate in Arcpy, but it just wont work.

I'm doing the following:

Create a polygon shapefile
Calculate area for each feature
Make Feature Layer to select only features that are below a given size (this I found I have to do, since there is no tool for Select by Attribute)
Run Eliminate

This is a snapshot of the model I set up:

Each time, the model stops when trying to start Eliminate, saying:

Failed to execute. Parameters are not valid.
ERROR 000156: Input must be a feature class

The tool needs a feature class with a selection, so I think I'm missing something when trying to select the features.

I use an iterator to run this without letting the intermediate products load into ArcGIS.

Is it possible that this causes the problem, since ArcGIS is not aware of the layer?

SOLUTION: That was it. Must add Make Feature Layer without any parameter, followed by Select Layer By Attribute.


texts: Disable "Selected features only" in Proccessing Script

texts:
I wrote a Progressing algorithm using Python. The tool clips  DEM by a select polygon in the vector layer. If there is no selection, the tool gives an error. As the script runs anyway for the selected object, I would like to disable the "Selected feature only" option if it is possible.

Any idea if it is possible?


texts: What is the difference between IEditSketch and IEditSketch2? Also why there are same interfaces with the same name only with a difference "2" at the end of the interface's name ?


texts: Where to find coordinates of geographic centers of US counties?

texts: Where can I find a list of the latitude/longitude coordinates of the geographic centers (centroids) of each US county?


texts: Applying filter with the sf package not working

texts:
Question:
I have a sf-object in R and want to select a few polygons according to their location name. I would like to apply the dpylr approach using the filter function (analog to this example). However, this does not work and returns an error message.

Is this a bug, is there a problem with the data, or is something wrong with the code?

Example:

> wards %>%
+  filter(NAME_WARD == "Bumbuta")
Error in data.matrix(data) :
  (list) object cannot be coerced to type 'double'
In addition: Warning messages:
1: In data.matrix(data) : NAs introduced by coercion
2: In data.matrix(data) : NAs introduced by coercion
3: In data.matrix(data) : NAs introduced by coercion

Data:

> wards
Simple feature collection with 5 features and 6 fields
geometry type:  MULTIPOLYGON
dimension:      XY
bbox:           xmin: 35.82647 ymin: -4.968201 xmax: 36.3376 ymax: -4.55612
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs
   NAME_REG NAME_DIST NAME_WARD ID_REG ID_DIST ID_WARD                       geometry
1    Dodoma    Kondoa   Bumbuta     01    0101 0101011 MULTIPOLYGON (((35.93715495...
2    Dodoma    Kondoa      Pahi     01    0101 0101021 MULTIPOLYGON (((35.93456275...
3    Dodoma    Kondoa     Haubi     01    0101 0101041 MULTIPOLYGON (((35.92014452...
4    Dodoma    Kondoa   Kalamba     01    0101 0101051 MULTIPOLYGON (((35.88398049...
5    Dodoma    Kondoa   Kwadelo     01    0101 0101061 MULTIPOLYGON (((36.33663165...

> str(wards)
Classes ‘sf’ and 'data.frame':  5 obs. of  7 variables:
 $ NAME_REG : chr  "Dodoma" "Dodoma" "Dodoma" "Dodoma" ...
 $ NAME_DIST: chr  "Kondoa" "Kondoa" "Kondoa" "Kondoa" ...
 $ NAME_WARD: chr  "Bumbuta" "Pahi" "Haubi" "Kalamba" ...
 $ ID_REG   : chr  "01" "01" "01" "01" ...
 $ ID_DIST  : chr  "0101" "0101" "0101" "0101" ...
 $ ID_WARD  : chr  "0101011" "0101021" "0101041" "0101051" ...
 $ geometry :sfc_MULTIPOLYGON of length 5; first list element: List of 1
  ..$ :List of 1
  .. ..$ : num [1:200, 1:2] 35.9 35.9 35.9 35.9 35.9 ...
  ..- attr(*, "class")= chr  "XY" "MULTIPOLYGON" "sfg"
 - attr(*, "sf_column")= chr "geometry"
 - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA
  ..- attr(*, "names")= chr  "NAME_REG" "NAME_DIST" "NAME_WARD" "ID_REG" ...


texts:
I am trying to georeference an image in QGIS version 3.18. It did run on the first attempt but I wasn't happy with the (linear) transformation. Unlike previous threads it doesn't produce an error - just hangs with "Progress Indication Not responding". I have waited for over an our. The file it produces is only 3k.

I have deleted and retried numerous different GCP points and both tif and png images. The output resolution is unticked. I will paste the GCP table below but it looks OK to me?? I am using Polynomial 2 transform and nearest neighbor.


texts: Calculating land cover inside buffer zones using ArcGIS Desktop?

texts:
In one Shapefile I have created 1200 buffer zones Around coordinates. I created a field and calculated the buffer zones area in hectares.
Then I clipped different landcover layers to the buffer zones.
Now I want to calculate How many hectares of eg. Forest there are in Each buffer zone And afterwords the amount of felds, And so on.

The calculations shall be done in ModelBuilder.

Can anybody help?


texts: How come "Zoom to Polygon" always puts me in the middle of Nebraska?

texts:
This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that I'd recently populated, ArcMap takes me to a point in the middle of Nebraska.

That's at 1:2500. If I zoom out, it just appears as an X in the middle of Nebraska. It's nearly the same for any of the Polygons I choose, except there are a different configuration of rectangles within that picture. But it's always in the middle of Nebraska.

I can go into the attribute table using python to pull out the polygon information with the Polygon getPart() method, and it looks like this:

Out[132]: <Array [<Array [<Point (-123.070983887, 43.0001220703, #, #)>, <Point
(-123.070983887, 45.5001220703, #, #)>, <Point (-121.890991211, 45.5001220703, #
, #)>, <Point (-121.890991211, 43.0001220703, #, #)>, <Point (-123.070983887, 43
.0001220703, #, #)>]>]>

...which, based on the points, should be in Oregon. But if I double click on it, it takes me to Nebraska. The other problem is that the polygons should be spread across the country (near national parks) but I think they're all getting bunched into that little square in Nebraska.

Does anyone know why this might be happening? Is the array-within-array throwing it off?

I'm adding the code that I used to create and fill the feature class.
I created it with:

fcname = r'C:\Users\user\Documents\ArcGIS\parkpolys.shp'
output_fc = arcpy.CreateFeatureclass_management(os.path.dirname(fcname), os.path.basename(fcname), "Polygon")

And then filled it with:

def push_coords(coords):
    """Push a set of corner coords to featureclass record"""
    cursor = arcpy.InsertCursor(fcname)
    feat = cursor.newRow()
    print 'new row created'
    for corner in corners:
        point.X = corner[0]
        point.Y = corner[1]
        array.add(point)
    array.add(array.getObject(0))
    polygon = arcpy.Polygon(array)
    feat.shape = polygon
    cursor.insertRow(feat)
    array.removeAll()
    del feat
    del cursor

# Corners list format: ["lowerLeft", "lowerRight", "upperRight", "upperLeft"]
#new format: ["lowerLeft", "upperLeft", "upperRight", "lowerRight"]
cursor = arcpy.SearchCursor("gmaps")

for row in cursor:
    corners = [[row.getValue('xmax'), row.getValue('ymin')],
            [row.getValue('xmax'), row.getValue('ymax')],
            [row.getValue('xmin'), row.getValue('ymax')],
            [row.getValue('xmin'), row.getValue('ymin')]]
    push_coords(corners)


texts: Exporting drivingDistance results in pgRoutingLayer on QGIS 2.2.0?

texts:
Using @Underdark's pgRoutingLayer extension, I built a routable network and tested it with Dijksatra function, which worked perfectly.

Trying the next step toward an isochrone map, I tried the drivingDistance function. I get a map of the points correctly answering the query but the "export" button is disabled and I didn't find a way to at least get a table indicating the travelling cost for each point. It's a bit frustrating knowing the data are somewhere around (shown as red crosses on the map) but not being able to get them!

I'm running QGIS 2.2.0 on a Windows 64 system, PostgreSQL 9.1, PostgGIS pg91x64-2.0.6-1 and re-installed the pgRouting Layer extension from the extension manager of QGIS.


texts: Refactor fields missing fields after join

texts:
I just joined two attribute tables successfully with the join function in Layer Properties.

Two new fields have appeared in my original table.

I saved the table.

However these two fields don't show up when I open Refactor fields.

Therefore I have to "save as" the table to a new table with a different name. Then the two new fields do show up.

Is this a bug, or is this normal?

Could it be changed?


texts:
Using these instructions (there are several other examples to find, all look the same and all of them seem to work)
http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/sp-view.html
"Hand-writing your own Spatial VIEW"

I wanted to create a Spatialite View within Qgis. I tried it with DB-Manager and the QspatiaLite Plugin. I get the following error:

views_geometry_columns.read_only may not be NULL

Any suggestions, I don't really know where I could have made a mistake, as it used to be very simple to create a spatialite view.

I used the following code:

CREATE VIEW shape_2015 AS
SELECT komplex_nr_polyg as kompx_nr,
flaeche as flaeche,
polygone as polygone
FROM flaechen

INSERT INTO views_geometry_columns
    (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column)
  VALUES ('shape_2015', 'polygone', 'kompx_nr', 'flaechen', 'polygone');


texts:
I'm having the following problem in QGIS 2.12.0.
When I load a raster, this disappear when I pan or zoom in or out the image. If I try to do some actions three four times, it appears again. It seems there's no logic, just happen almost all the time the image is moved.
Anyone has an idea of what can be the problem?


texts: CartoDB changing number formats in infowindows

texts:
I am trying to show percentage data in the hover infowindow function.The percentages are being reflected as decimals since that is how the data was uploaded.

How can I tell CartoDB to multiply the values for this data column by 100 for when it is being shown in the infowindow without having to adjust the original data?


texts:
I have created a C# WPF (.NET Framework 4.6.1) application in Visual Studio 2017 and installed latest stable GDAL 2.4.2 from Nuget.

In the App.xaml I have added the GDAL configuration call:

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    GdalConfiguration.ConfigureGdal();
}

When I build the application I get the following error:

“error CS0103: The name 'GdalConfiguration' does not exist in the current
context”

I have located the GdalConfiguration.cs file in the subfolder

obj\Debug\NuGet\15f0ca2b5ecbe407152208e918cf2c4389b630a2\GDAL\2.4.2

and pressing F12 on GdalConfiguration.ConfigureGdal() opens up that specific file.

Question:

Do I have to do anything else to be able to use GDAL in my application?


texts: Visualizing geo count data points in gradual colors using ArcGIS desktop?

texts:
I have data looking like the following:

Latitude  Longitude  Class
35.773444  -78.6305752  0
38.82349688  -77.61919194  1
41.4985021  -81.7144364  1
39.9528  -75.2104  0

Longitude, latitude and classification columns. Attached is the simple map I have created in ArcGIS. But ultimately how I imagine to display the map includes the followings:

*** 1) States with more dots (red or green) will be enlarged in size comparing to States with less or no dots

*** 2) States with more green dots become more green, States with more red dots become more red

I have seen examples where the colors of each states are gradually different (for example: population size for each state), but the actual numbers (ie: State populations) are already recorded in the data file. As you can see in my original data file, it only has lat and lon data, I don't have numbers of dots per State in my data.


texts: Is there a plugin for batch conversion of raster data to vector on QGIS?

texts:
I know there is Polygonize but it's just not practical for me because it fails for batch process and there a  lot of files that I want to convert in one go.
I'm dealing with temperature data stored in .tiff format.


texts: Checking distribution of raster layer using ArcGIS Desktop

texts:
I am using ArcGIS Desktop.
How do I see if my layer has a normal distribution in order to standardize it?
I have calculated statistics, but have not been able to see how my data is distributed.


texts: Merging multiple SpatialPolygonDataFrames in R when number of columns do not match

texts:
I would like to merge multiple SpatialPolygonDataFrames into one.
For Belgium & the Netherlands this works OK using maptools' spRbind:

td <- tempdir()
bel <- getData("GADM", country="BEL", level=1, path=td)
nld <- getData("GADM", country="NLD", level=1, path=td)
row.names(nld) <- paste("nld", row.names(nld), sep="_")
row.names(bel) <- paste("bel", row.names(bel), sep="_")
library(maptools)
bel_nld <- spRbind(bel, nld)
plot(bel_nld)

However, in my case I would like to merge the province outlines for both Belgium & the Netherlands, ie

td <- tempdir()
bel <- getData("GADM", country="BEL", level=2, path=td)
nld <- getData("GADM", country="NLD", level=1, path=td)
row.names(nld) <- paste("nld", row.names(nld), sep="_")
row.names(bel) <- paste("bel", row.names(bel), sep="_")
library(maptools)
bel_nld <- spRbind(bel, nld)
plot(bel_nld)

but then I get the error message "Error in rbind(deparse.level, ...) :
  numbers of columns of arguments do not match"

Would anybody know how to resolve this, and obtain the provincial outlines of Belgium & the Netherlands in one SpatialPolygonDataFrame?


texts: .svg image is not loaded into webview in android

texts:
I'm using leaflet and trying to load .svg image on webview.

   `//Create the bounds and image to add.
    var imageUrl = mapData.plan.image;
    var imageBounds = [[mapData.plan.size_x, 0], [0, mapData.plan.size_y]];

    //Add the image overlay to the map
    overlay = L.imageOverlay(imageUrl, imageBounds,{interactive: true});
    overlay.addTo(map);`

The image is not loading


texts: How calculate distance of two points (between my location and previously my location) in JavaScript?

texts:
I am using JavaScript and geolocalisation but I want to calculate the distance between my previous location and new location.
How can I do this?


texts:
The problem I'm encountering is simple. I have a shape file of points (about 8 million). They have three XY pairs that I am attempting to create XY lines from for purposes of measuring distance. However, the tool repeatedly has crashed, bringing down whatever program was running it (Catalog or ArcMap). I am assuming this is not related to the issue of XY To Line crashing if it encounters a record that does not have both pairs of XY co-ordinates, as I cleaned those out. Is there a size limit issue, here? Of the 7.9 million records input, it gets to 7.3 before the entire program goes kaput.

For the purpose of clarity, let me describe the data setup. For each record in the table there is a point with an XY and two geocoded locations with XYs. So Point A Geocodes to Point B, and Point A geocodes to Point C. I have the XY locations of A, B, and C all on the same record, and am trying to glean the distance between their coordinates (A -> B), (A -> C), (B -> C).

Two questions:

1) Is there a better method in ArcMap 10 to measure the distance between two points than snatching the length from an XY to Line feature class?

2) Why would XY to Line be crashing at about 7.3 million records?


texts:
At my Sun Shadow Volume analysis I have the problem that not all of the shadow volumes reach the originating feature.

I get a field named "HUGS_FEATR" where it is indicated if the shadow hugs the feature or not.

But of course I need every shadow to "hug" the feature!

I´m using ArcGIS Desktop Advanced!

Any suggestions?

EDIT(1):
I found out that this problem just exists when I have a DEM as Base Height set. BUT this DEM is just a flat Raster with exactly 200 metres above sea level (1m x 1m). Without setting a Base Hight and just extruding the feature (building) the tool seems to work like a charm! Strange..


texts:
I tried to import .laz files with:

for mydom in $(ls *.laz) ; do r.in.pdal input=$mydom output=$(basename $mydom .laz) method=percentile pth=90; done

and got this error:

Traceback (most recent call last):
  File "/.grass7/addons/scripts/r.in.pdal", line 532, in <module>
    main()
  File "//.grass7/addons/scripts/r.in.pdal", line 464, in main
    command_pdal1.extend(['pipeline', '--input', tmp_file_json2])
UnboundLocalError: local variable 'tmp_file_json2' referenced before assignment


texts: Moving a shapefile point to specific coordinates

texts:
In QGIS is there a simple way to move a shapefile point in a shapefile point file to specific coordinates?

Without exporting the points to WKT changing the x,y values and then importing the WKT via delimited text.

I can move the point easily by hand through the Move Features button on the Digitizing toolbar and my current workaround is to import a simple KML file with the point and then by hand move the point feature of the shapefile on top of the KML point.


texts: Find maximum of the difference between each cell of a raster and its surrounding cells

texts:
I would like to do the following for each cell (let's call it cell_i) of a raster:

Define a neighboring region around cell_i (for instance, a region defined by the 8 surrounding cells of cell_i).
For each cell in the region defined in (1), find the difference between its value and the value of cell_i.
For all the differences computed in (2), find the minimum.
Store the minimum value from (3) in a new raster in the same spatial location as cell_i.

Are there existing tools that can do this?

If not, can you provide pointers on how to script this (ideally in ArcPy)?

I think that I have the algorithm down (for instance, I would know how to implement this if the raster was a matrix in matlab or 2D array in C#).

What are the commands needed, such as iterating through the original raster and saving values in a new raster?


texts: Geoserver sql view using an external sql query?

texts:
I am trying to figure out a way of producing a view of a layer in GeoServer, using an external SQL query.
By external I mean, for instance, a user defined query in a PHP from where all the parameters defined there would act as variables in the query.
By doing so, I would allow users of my web mapping application to select only what they intended to see.
Is this possible?
I am using PostgreSQL/PostGIS + GeoServer + OpenLayers and the front end webpage was developed using PHP.

EDIT 1 - I've been able to create the parametric view and pass a parameter value to the viewparams call successfully. However, when trying to pass a parameter as result of a variable value the layer polygons just wont load. I'm declaring a variable as var data = 10000000; and passing the variable to the viewparams as follows:  viewparams:'volume:data'. The wms layer polygons wont load, but the getfeatureinfo works as if the viewparams wasn't defined because when i click on the map, i get the featureinfo pop-up with the corresponding info.
Any ideas?


texts: Why is azimuth resolution worse than range resolution in Sentinel1 (SAR)

texts:
Why is the azimuth resolution in Sentinel (SAR sensor) worse than the range resolution?

The table in this link gives the resolution for SLC products aquired in the different aquisition modes.
In all of them the range resolution is better than the azimuth resolution.

Note: This question is totally different from my previous one, as the latter tackles the effects of the incidence angle on the ground resolution (range resolution + azimuth resolution), and this doesn't explain why sometimes the range resolution is better than the azimuth resolution.


texts: Visualizing year of forest loss in Hansen/UMD/Google Global Forest Change with QGIS?

texts:
I am trying to visualize the loss of forest cover for the year 2000-2012 with the Hansen database (http://earthenginepartners.appspot.com/science-2013-global-forest/download_v1.7.html).
However, after downloading the "yearloss" layer, I only see the data for 2000 and 2012.
.
How can I visualize the annual loss?


texts: Using nested iteration and models with ModelBuilder

texts:
I'm new to using ModelBuilder and have to do a nested iteration (for every month I have to iterate through 6 parameters). I am thinking of doing that by using nested models. One model doing the interation through monthes and then providing the current month as parameter to the submodel that iterates through the 6 parameters.

The linking of the models does not work correctly (boxes are not colored).

How can I make the current month value available to the submodel?

I just want the month parameter to be available in a function; I don't connect it to a function as input variable.


texts: Euclidean distance to point features results in empty output (no attributes)

texts:
I have a shapefile of points which contains attributes of data, I am trying to calculate Euclidean distance to the feature however the result contains no data. I also tried to clip the points to a boundary but the clip failed with an empty output also (empty output is in the error message). I also tried kernel density, when I run tool, it either fails or contains no output also. No idea why this is happening. Any suggestions?

This is the error message when I ran the kernal density (1 m cell size and 1000 m search radius). Area is quite small.
ERROR 010067: Error in executing grid expression.
Failed to execute (KernelDensity).


texts: No popup with OpenLayers on GetFeatureInfo to MapServer WMS

texts:
I've searched for answer for the last couple of days with no success.

When I click on an object on the screen I get this reply from the server:

http://localhost/cgi-bin/mapserv.exe?LAYERS=testpoint&QUERY_LAYERS=testpoint&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=517948%2C157505%2C535448%2C170005&FEATURE_COUNT=1&HEIGHT=500&WIDTH=700&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A27700&X=357&Y=241&MAP=%2FWorkTemp%2Ftest.map

Following this link returns the value for the object I just picked. I get no errors in the MapServer or OpenLayers log file.

OpenLayers code:

layer = new OpenLayers.Layer.WMS( "WMS data","http://localhost/cgi-bin/mapserv.exe?", {layers: 'testpoint' , map: '/WorkTemp/test.map', transparent: true},{isBaseLayer: false, opacity: 1, singleTile: true, visibility: true});

osMap.addLayer(layer);

info = new OpenLayers.Control.WMSGetFeatureInfo({
       url: 'http://localhost/cgi-bin/mapserv.exe?',
       title: 'Identify features by clicking',
       queryVisible: true,
       maxFeatures: 1,
       vendorParams: {
            map: '/WorkTemp/test.map'
       } ,
       info_format: 'text/html',
       layers: [layer],
       eventListeners: {
       getfeatureinfo: function(event) {
             if(event.features.length > 0) {
                     osMap.addPopup(new OpenLayers.Popup.FramedCloud(
                     "chicken",
                     osMap.getLonLatFromPixel(event.xy),
                     null,
                     event.text,
                     null,
                     true
                     ));
             }
       }
       }
});

osMap.addControl(info);
info.activate();

test.map layer

LAYER
  NAME "testpoint"
  TYPE POINT
  STATUS ON
  CONNECTIONTYPE OGR
  CONNECTION "MYSQL:test,host=localhost,user=root,password=xxxxxx,port=3306"
  DATA "SELECT SHAPE,test from testpoint"
  DUMP TRUE

    TEMPLATE "c:\WorkTemp\test_template.html"

  LABELITEM "test"
   PROJECTION
        "init=epsg:27700"
    END
  CLASS
    NAME "test"
    STYLE
      SYMBOL  'circle'
      SIZE 10
      COLOR 255 215 0
    END
    LABEL
     COLOR  0 0 0
     FONT arial
     TYPE truetype
     SIZE 8
     POSITION AUTO
     PARTIALS FALSE
     OUTLINECOLOR 255 255 255
    END
  END
END # layer

This appears to be the same problem that I'm having:- Use OpenLayers WMSGetFeatureInfo on Mapserver Layer?, but I have already set my WMS layer to be OpenLayers.Layer.WMS

I downloaded and installed OSGEO4W as my starting point. I'm calling http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js for my OpenLayers commands.

Any suggestions would be gratefully appreciated.


texts: Loading data in existing dataset in ArcGIS Online?

texts: In ArcGIS online (AGOL), is it possible to load data (shapefile or geodatabase) into an existing layer? The map layer is shared and editable.


texts:
I have tried various ways of making an action open on image on my Mac but no image shows up when the point is clicked. The best I got was when I made the field with the file path a "Photo" type. If I open the Attribute table, I can see a little thumbnail of the image. But I want to open the actual image in Preview.

I tried making the field type a "File Name" and assigning an "Open" action. This resulted in absolutely nothing happening when the point was clicked. I also tried making the field type a "Text Edit" and making the Action Type "Mac" and the Action open [%File Name%]. Again nothing happened. I checked on "Capture Output" and when I click a point, a box opens that says:
Starting open '[%File Name%]'...

Done
... but alas nothing opens. I tested the command in terminal and it opens the image.

I thought maybe it had to do with the absolute file path since the images are on an external hard drive at /Volumes/external-drive/images/2018_10_24.jpg. So I copied one to my current folder and changed the command to another column that just lists the individual file without the full path. Still nothing. I even unplugged the external hard drive to see if it gave an error when I ran the above action... same dialogue box with no image opening.

The tutorials on this seem so easy and straight forward, what am I missing here? Is there a permission I need to set on QGIS to let it run shell commands or something?


texts:
I have a SRTM dataset, Corine Land Cover and have already calculated aspect.

I want to know the relative proportions of exposition classes of certain landcover type.

My thought was to use zonal statistics, but I always get an error. I have tried to convert the aspect raster (floating point) to an integer already, but that seems to be not the right direction.

Anyone with an idea to get a solution?


texts: Batch updating point attributes based on values of underlying polygon using ArcGIS Desktop?

texts:
I have a points shapefile with a blank field. I want to populate this field with an attribute obtained from another underlying (polygon) shapefile. I can do this for a single record easily using select by location - in other words point y is located in area x, so the field updates itself with area x. The problem is that my shapefile has nearly half a million records and I need to do this often. I have no scripting experience at all.

Is there a simple batch method that will do this job?


texts:
Is there a way to use the Planarize Tool (Editing tool) in a ArcPy script.

I want to create a script for a question I posted and with the help of the community resolved that problem. Please see the link:

Populate cross street name at intersections

I would like to automate this process but using the Planarize tool is a necessity in the process.


texts: Flow direction and catchment area polygons for utility water pipes

texts:
I'm working on a project where I need to show which direction the water would flow from a water pipe in case there is a pipe burst.  I also need to show catchment polygons(area affected).  This was previously done by someone else and I'm doing it from a fresh start.  I've attached a screenshot showing a sampling of the previous work.  The blue/grey line is the water pipe, the red outline shows the polygons/area affected and the blue arrows show the flow direction.

I'm using ArcGIS Desktop 10.2 and Spatial Analyst.  I have access to contour line data as well as the water pipe data.  I've done a little bit of googling and have seen a lot of information on watersheds, however, I think this project is the opposite of watershed analysis where instead of showing drainage towards a water channel/pipe, I need to show drainage away from a water channel/pipe.  I'm quite familiar with ArcGIS Desktop but pretty green to Spatial Analyst.  I can perform watershed analysis using various tutorials online but as I said, I think my analysis requires showing the opposite of watershed analysis, I think.  I need some help being pointed in the right direction as far as steps/tools to use.


texts:
I want to split lines in my shapefile so i am using COGO tool to split lines. After splitting I want the length of these new split lines in the attribute table.
I have checked in many places but couldn't find anything regarding this topic.

so is there anyone who knows how to calculate the length of all the split lines and then store all of them in the attribute table.


texts:
in QGIS 2.18 I used the table manager plugin for renaming or removing columns in a table. This plugin doesn´t exist in QGIS 3.4.1.

Is there any other plugin or way to rename, remove or order columns in the attribute table of a vector layer?


texts: Multiply image collection by a list of numbers (pairwise)

texts:
I want to know how to multiply every single image of a collection against its respective coefficient allocated in a list. It means to multiply the image 5 with the element 5, image 6 with element 6, and so on...

This is part of my code:

// COLLECTION
    var sentinel2 = ee.ImageCollection('COPERNICUS/S2_SR')
    .filterBounds(aoi)
    .filterDate('2019-01-01', '2019-12-31')
    .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 30))
    .map(rescale).map(cloudMask)
    .select('B[1-7]');

// List of zenith angles
var zenith_list = ee.Array(sentinel2.aggregate_array('MEAN_SOLAR_ZENITH_ANGLE'))

// Apply equation:
// ((0.0000006)*(zenith^3)) - ((0.0002)*(zenith^2)) + ((0.0006)*zenith) + 0.9975
var pow3 = zenith_list.pow(3)
var pow2 = zenith_list.pow(2)
var part1 = pow3.multiply(6e-7)
var part2 = pow2.multiply(2e-4)
var part3 = zenith_list.multiply(6e-4)
var equation = part1.subtract(part2).add(part3).add(0.9975)

// Calculate the difference between the calculated reflectance proportion and the reference
var reference = ee.Number(0.7071);
var delta = equation.subtract(reference).abs()

This is the part that I don't know if I'm doing right:

// Normalize every band reflectance of the imagery
var normal = sentinel2.map(function(img){
    var image = ee.Image(img).multiply(delta)//.toFloat()
  return image.copyProperties(img, img.propertyNames());
})
print('Normalized Imagery:',normal)

Then I want to create a chart using the new image collection, but I'm getting the following error:

"Error generating chart: Input must be a scalar number."

// Create an image time series chart.
var chart = ui.Chart.image.series({
  imageCollection: ee.ImageCollection(normal),
  region: aoi,
  reducer: ee.Reducer.mean(),
  scale: 1000
});

print('Chart',chart)

This is the link of my code if you want to check it out: https://code.earthengine.google.com/98a1194fa641ed8a7dde0f2166424313

Thank you.

UPDATE:

Everything works well when I multiply the collection by a single number, instead of the list of numbers.

In the first case, the band data type produced is "double ∈". But, for the second case, the bands are "double, 1 dimension". I think that my list of numbers is an array, which is converting the data type of the image collection after the multiplication... how can I fix this?

SOLUTION:

I already came up with a solution to this issue. My list of numbers was an array-type one, so I added .toList() to convert it to a list-type. Then, I apply the following function to multiply each image by its respective factor in the list (this function was tweaked from the solution provided to the shared post by hami kelvin):

//Convert array to list
delta = delta.toList();

// Combine into a list of elements containing an image and a scaling factor.
var MAX_ELEMENTS = 1000;
var zippedList = sentinel2.toList(MAX_ELEMENTS).zip(delta);

// Map a function over the list to scale each image.
var scaledCollection = ee.ImageCollection.fromImages(
  zippedList.map(function (list) {
    list = ee.List(list);
    var img = ee.Image(_list.get(0));
    var scale = list.getNumber(1);
    var scaledImage = img.multiply(scale);
    scaledImage = scaledImage.double() // Set the data type, so the collection is consistent.
    return scaledImage.copyProperties(img, img.propertyNames());
  })
);

Note that I added .copyProperties to conserve the properties of every image in the collection after the computation and then create a chart.

Thanks to everyone that replied to this thread.


texts:
I have windows 7 64bit running ArcGIS Desktop 10.0 and fme 2014. On another server I have ArcSDE9.3. I want to create an SDE Reader in FME but am unsure about how to connect. At the moment SDE Geodatabases are not activated. Looking at this -
Link to FME Site
 - I need to connect to various SDE dlls etc and set environment variables and install the sde SDK. Is this really the only way to be able to connect to sde with fme?


texts: D3 javascript and GeoJSON: lines in Stockholm map very strange

texts:
All the code and shapefiles that I'm using are available in this GitHub repo.

I'm trying to draw a map of Stockholm with D3. The shapefile looks ok in QGIS:

However, drawing the GeoJSON produces something that looks like abstract art:.

Is my shapefile corrupted or am I doing something wrong otherwise?

The steps to produce my GeoJSON are as follows:

Open the Adm.shp file as layer in QGIS
Save the layer as GeoJSON
Drawing GeoJSON using D3 in stockholm.html

I have tried ogr2ogr on the command line as well with the same results.

EDIT

I did some operations on the coordinates, dividing lat by 1E4 and long by 1E5. The result looks a bit better (but far from the image that is seen in QGIS (probably an issue with the projection?)):


texts:
I followed the Cartodb Toggle Map View tutorial and I inserted the corresponding elements from my own map into the code and it's not working for some reason, all I see is a blank page. I've posted my code below, and here is the actual map in Cartodb. All I want to do is create two buttons that allow you to toggle between the two layers of data I've created in the map.

  <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />


texts:
I have two lines with xy values, but no z values. However, I have points with xyz values that intersect with the two lines (see attached image for vizualisation). How can I get the z values from the points to the lines?

I have tried spatial join (join one to many), but with around 400 points for each of the two lines this just results in feature classes with around 400 20km lines with different z values. I would like the lines to be split at each point and assigned a z value, but cannot use Split Line at Point as I only have the Basic licence. I use ArcGIS 10.3.1.


texts: Shortcut to show / hide the layers as per the sequence?

texts:
Does anyone know any shortcut to display / hide the layers as per the order? For example, F1 displays and hides layer 1, F2 displays and hides layer 2.
I found the shortcut to hide all the layers and hide the selected layer, but for what I want it does not work, because I need to edit layer 1 (shp) and toggle between displaying and hiding layer 2 (raster).
QGIS 2.18


texts: ArcObjects C#: How to add selected features to a Data Grid View

texts:
[![enter image description here][1]][1]I'm trying to write a C# .NET add-in for ArcMap and I need some help. I want to be able to select a set of features in an SDE and then click a button that would add the selected features' field to a data grid view. I have been able to have selected features be added to a list box with a button but I can't modify the code to be a data grid. Below is my code so far after I've set up the SDE workspace.

        IEnumFeature pEnumFeat = (IEnumFeature)Pmap.FeatureSelection;
        IFields fields;
        pEnumFeat.Reset();
        IEnumFeatureSetup enumFeatSetup = (IEnumFeatureSetup)pEnumFeat;
        enumFeatSetup.AllFields = true;
        try
        {
            IFeature pfeat = pEnumFeat.Next();

            while (pfeat != null)
            {
                fields = pfeat.Fields;
                int x = fields.FindField("NAME OF FIELD");
                list.Add(pfeat.get_Value(x).ToString());
                Debug.Print(pfeat.get_Value(x).ToString());

                if (pfeat.get_Value(x).ToString() != "")
                    LstBxWellList.Items.Add(pfeat.get_Value(x).ToString());

                pfeat = pEnumFeat.Next();
            }
        }
        catch (Exception exp)
        {
            MessageBox.Show(exp.Message);
            return;
        }


texts: We have QGIS installed and our users have roaming profiles. Some of the files which are  installed under the .qgis folder in the C:\Users\username directory can grow quite large. These large files will therefore roam around with the user when they log onto PC's. Are there any files which can be deleted in this location when the user logs off?


texts: Conditional statement using Long and Text fields with Python Parser of Calculate Field in ArcGIS Pro

texts:
I have 3 fields:

"ISL_Numero" - Long (values are '1', '2', '3', '4' etc.)
"Subtipo_IS" - Text (values are 'A', 'B', 'C' etc.)
"Ambiente_C" - Text (values I want to calculate)

An example of what I want:

If "ISL_Numero" is 1 and "Subtipo_IS" is A, I want "Ambiente_C" to be Mangue
If "ISL_Numero" is 1 and "Subtipo_IS" is B, I want "Ambiente_C" to be Praia
If "ISL_Numero" is 2 and "Subtipo_IS" is A, I want "Ambiente_C" to be Cascalho
And so on ...

I tried the following:
Reclass(!ISL_Numero!,!Subtipo_IS!)

def Reclass(ISLNumero,SubtipoIS):
    if ( ISL_Numero == 1 and Subtipo_IS == "A" ) :
        return "Mangue"
    elif ( ISL_Numero == 1 and Subtipo_IS == "B" ) :
        return "Praia"
    elif ( ISL_Numero == 2 and Subtipo_IS == "A" ) :
        return "Cascalho"
    else:
        return ""

The calculation runs with no errors but the "Ambiente_C" doesn't get calculated as expected, it remains blank.


texts: Pushing value from text input to search widget in ArcGIS API for JavaScript?

texts:
I am developing a surveying app that among other things, asks the user for their address/closest street intersection, and then later asks them add features around they're "neighborhood".

I would like the value they enter in the address text input to be pushed to the search widget onblur of the address input to avoid entering the same info twice.

I've tried just setting the value of the search widget form text to the text input value, and it changes the text visually but when I hit the search button it says "please enter a search term"

Anyone have any ideas on this, does what I'm asking even make sense?


texts: problem with the import of a gpx file in any program

texts:
I have difficulties to import one particular gpx file. I got it via email and it displays some tracks. 10 segments and 5500 waypoints.

i tried as follow:

QGIS, also with GPSBabel
Google Earth
Movescount (I see the tracks but movecscount does not reckognise the segments)
Garmin Basecamp
Textedit
gps-tracks.com; a portal for gps tracks for outdoor activist

Unfortunately, I have any information about how the file was created (which tracker, etc).

Do you have any ideas what I could try further?
In the link GPX Vieweer I was able to view the tracks but nothing more.

In this link, you'll find the file.


texts: "Extract by Mask" changing raster pixel values...or not?

texts:
I am using ArcMap 10.0 and am confused by my Extract by Mask output rasters.

I hope to eliminate the black background from three Landsat ER Mapper images so that I can mosaic them. Originally I attempted to do this using the Clip function in the Raster Processing submenu, but saw via the Pixel Inspector that it was changing the raster pixel values. I then decided to use the Extract by Mask feature in Spatial Analyst, using rasters created from the original images themselves as the masks, and changing the Environment settings beforehand to use the mask raster as the Snap Raster and the output extent, and the original raster as the cell size.

When the Extract to Mask is completed and the extracted raster is added to the map, I see in the TOC on the left that the minimum value is changed. Further inspection reveals that the raster histogram is in fact altered. However, when I compare the original and extracted rasters using the Pixel Inspector I see absolutely no difference, which Raster Calculator confirms when I subtract the original from the extracted raster. Furthermore, in the Attribute Table when I select the rows of the extracted raster that are below the minimum in the original raster (have no count) and find them in the map, I see that their values in the identical original and extracted raster are indeed below the minimum (see image).

I am stumped. I feel as if I am fundamentally misunderstanding something. Would anyone be so kind as to explain to me what is going on?


texts:
This code Using PyQt5 extracted from http://www.tutorialspoint.com does not work when I add it in a script in the console of QGIS 3.16. Can you enlighten me on this subject?
import sys
from PyQt5 import QtGui

def window():
    app = QtGui.QApplication(sys.argv)
    w = QtGui.QWidget()
    b = QtGui.QLabel(w)
    b.setText("Hello World!")
    w.setGeometry(100,100,200,50)
    b.move(50,20)
    w.setWindowTitle("PyQt")
    w.show()
    sys.exit(app.exec_())

    if __name__ == '__main__':
       window()


texts: How to delete selected rows using ArcPy?

texts: I want to delete all rows in a feature class but remain rows 1 to 5. In other hand I want to remain first five rows and delete others. I know that I have to use search cursor and update cursor but I couldn't use them. How can I delete the rows using ArcPy ?


texts: Getting error from ArcGIS Field calculator with vbScript?

texts:
I am trying to do the following in the field calculator in ArcGIS 10

if  [IncdStDir] = " " then [IncdStNo] &" " & [IncdStName] &" " & [IncdStSfx]

else  [IncdStNo] &" " & [IncdStDir]&" " & [IncdStName] &" " & [IncdStSfx]

end if

I keep getting an error when I try to run this. I am new to Vb.


texts: Shift country polygons to other world-regions in QGIS, adapting it's size corresponding to the true area

texts:
On the website  The true size of ..., you can shift the shape of countries to other world regions to see the true size (area) on a distorted map (mercator projection). Dragging Greenland over Africa is a classic example (see screenshot below).
Unfortunately, on the site I can't find any information about the procedure in the background - how it's done.
I'm wondering how the same result can be achieved using QGIS only. What I tried and what works as a workaround: Save a screenshot (like the one below), georeference this image (based on the background basemap, using control points in Africa: Juba, Kampala, Nairobi, Harare, Lusaka etc.) and than, on the georeferenced image, vectorize the shape of Greenland.
However, I would like to find a solution using QGIS only, without importing the data. How could this be achieved?

Edit:
What I tried 2.0 / An idea is to use the following procedure:

Set project CRS to Web-Mercator (EPSG:3857)

Re-project the same data (country polygons) to a Web-Mercator (EPSG:3857) and an equal area CRS, e.g. EPSG:8857 to have a layer in each of these CRS. I used the pre-installed basic world countries polygon layer in EPSG:4326 (type world to the coordinates field at the very bottom of the QGIS main window).

Use the icon Move feature from Advanced Digitizing Toolbar and move a feature from the equal area layer (see screenshot). This returns a "true size" version (but heavily distorted in shape) of the original polygon:

Yellow: layer in equal area projection, blue in Mercator - when shifted, the polygon from the equal area layer mainaints the "true size", but the original distortion, inherent in the projection, as well:

To keep the shape, you could do the same with the other layer (in Web-Mercator). The resulting polygon would preserve the shape, but be extremely distorted in size (Greenland almost the same size as Africa). At this point, the new Feature scaling tool (available since QGIS 3.18) could be used. However, how to set an appropriate scale factor? So I guess there must be better options to achieve that.
Again the blue layer is in Mercator: it preserves shape when shifted, but size is extremely blowed up as it is inherent to Mercator projection:


texts: Filter Landsat images base on cloud cover over a region of interest

texts:
My goal is to create an image collection that has 100% free cloud over a small region of interest, for example a lake.

This script filters landsat 8 images based on location and cloud cover:

var nocloudimages =  landsat8.filterBounds(ROI)
                     .filter(ee.Filter.lt('CLOUD_COVER', value))
                     .sort('system:time_start', true)

However, as we know, the 'CLOUD_COVER' accounted for the whole landsat 8 image percentage of cloud, not a particular Region of Interest (ROI) cloud cover.

Is there a method to achieve that?


texts:
I am analyzing a spatial panel dataset using the XSMLE package in Stata. My units are a subset of US states (11) and my panel is strongly balanced.

The package returns estimations for Main, Spatial, Variance, Direct and Indirect betas. Is there a resource someone can recommend explaining how to interpret these statistics? I've read the presentation that Belotti, Hughes and Mortari (2013) created on XSMLE, but they don't discuss why the estimations are presented in this fashion.
If a standard Hausman test indicates that an RE model is appropriate, does that results extend to a spatial panel?
What's the best way to assess high leverage observations when running a spatial panel? Should I just estimate a pooled OLS model and then calculate DFBETA and Cook's D or is there another approach?


texts: Automated count for attribute table elements

texts:
I need to extrapolate from an attribute table the number of elements divided for categories in an automated way (it's not possible to count them manually cause the number is quite huge, about 10000). In the attribute table there are accomodations (hotels, B&Bs, hostels, etc..) for every municipality of my province and I need to get the number of these accomodations for every municipality.

What is the best way to do so?


texts: Trying different fields when Maplex labelling?

texts:
Let's say, a road has the name "William-Bill-Gates-Road".

If the road is too short, the label can only be abbreviated by using a dictionary in Maplex.
Is it possible to make Maplex try several label fields, if one is not fitting?

Structure:

name | name_1 | name_2 | ...
William-Bill-Gates-Road | William-Bill-Gates-Rd. | W.-Bill-Gates-Rd. | W.-B.-Gates-Rd.


texts: Which small external GNSS-receivers are tested with QField?

texts:
I would like to use QField with a small external GNNS-receiver that I can connect to my smartphone or tablet via USB or Bluetooth (e.g. Trimble R1, ppm 10xx, Leica Zeno FLX 100). Since they are quite expensive, I want to make sure that the GNSS-receiver is compatible with QField before buying one. In the QField documentation it says that "QField supports connecting external GNSS antennas via bluetooth". In this talk, one of the developers of QField mentions that external receivers from Trimble and Emlid have been succesfully tested with QField. Receivers from other companies (e.g. Leica) seem to have problems connecting with QField (see Questions at 1:01:27min).
Does someone have experience with small external GNSS-receivers and QField or know of a list of successfully tested combinations?


texts: OpenLayers add a json layer to existing map on load

texts:
I am new to OpenLayers ... i have managed to build a layer with several features (draw tools, delete and save buttons).

When the user draws shapes on the image map and press Save, these are stored as a json String to filesystem/database.

Since a user desires to see or re-edit his drawing on the image i would like to fetch and re-draw this json String. My code is as follows:

function initialiseMap(){
    var options = {
        controls : [],
        maxExtent : new OpenLayers.Bounds(0.0, -72448.0, 142848.0, 0.0),
        maxResolution : 1024.000000,
        numZoomLevels : 10
    };

    map = new OpenLayers.Map(imageEditorID, options);

    imageLayer = new OpenLayers.Layer.TMS(imgURL, "", {
        url : '',
        serviceVersion : '.',
        layername : '.',
        alpha : true,
        type : 'png',
        getURL : overlay_getTileURL,
        transitionEffect: 'resize'
    });

    map.addLayer(imageLayer);
    var vlayer = new OpenLayers.Layer.Vector("Editable");
    var previousLayer = getJSONData(); //<<<--- HERE I CALL A FUNCTION TO FETCH STORED LAYER
    ....
    .... // create some tools for drawing & then provide save option ....
    ....
    var save = new OpenLayers.Control.Button({
            title: 'Save', text: 'Save',
            trigger: function(){
            var GEOJSON_PARSER = new OpenLayers.Format.GeoJSON();
            var vectorLayerAsJson = GEOJSON_PARSER.write(vlayer.features);
            sendJSONToServer([{name:'param', value:vectorLayerAsJson}]);
            }, 'displayClass': "olControlSaveFeatures"
    });
    ...
    ...

and the function i would like to built, fetch json String from an XHTML form:

function getJSONData(data) {
    var htmlstring = document.getElementById("A3702:imageEditor:getJSONData").value;
    .... ///<<<--- How am i going to add this json String as Layer on existing image?

Json String is something like:

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[43796,-32494],[43852,-30582],[41940,-30526],[41884,-32438],[43796,-32494]]]}}]}

How am i going to maybee parse (serialize/deserialize) json String and properly add it (like e.g. as GEOJson layer) to the map?


texts: Is there some trick to getting Whitebox GAT scripts to run the plugins?

texts:
I'm trying to get a small script to run using Whitebox's Scripter:

print("Running script")

# data path
whiteboxdp = "/Users/analytics/dem_catchment/sites/Southwold/whitebox_files/"

# set local working directory
pluginHost.setWorkingDirectory(whiteboxdp)

# Calculate dem fill
base_dem = whiteboxdp + "Southwold_lidar_dem_2m_full.dep"
filled_dem = whiteboxdp + "SW_filled.dep"
flatIncrement = "0.0001"
args = [base_dem, filled_dem, flatIncrement]

# does nothing that I can see, no processing or output
pluginHost.runPlugin("FillDepression", args, False, False)

print("Script finished")

When I execute/run the script I just instantly get:

Running script
Script finished

No errors or other warnings. No content generated.
I looked at the example by John Lindsay but I feel that I'm not using this correctly as it's not implementing any of the toolbox calls.

What am I doing wrong?


texts: Leaflet MarkerCluster and Esri Leaflet Cluster - custom marker data from feature data not count of markers in the cluster

texts:
Is it possible to sum the data from the feature data in a esri feature layour to display on a clustermarker. The default value is the count of the markers contained in the cluster, but I want it to display the sum of data from a featureLayer (feature.properties.somefeature) value instead?
cluster.getAllChildMarkers(); gives you an array of each feature in each marker, but how do you get a sum of just one of the values from each marker and display that as the value of the cluster marker?

Here is the pertinent code.

map.createPane('circlesIIOM');
////---- add Ill, Ind, Oh, Min ----////
  var covIIOM = L.esri.Cluster.featureLayer({
    url: 'https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases_US/FeatureServer/0',
    where: ("Province_State = 'Illinois' OR Province_State = 'Indiana' OR Province_State = 'Ohio' OR Province_State = 'Minnesota' OR Province_State = 'Iowa'"),

    onEachFeature: forEachIIOM,

    /////////////// CLUSTER ICONS

    spiderfyOnMaxZoom: false,
    removeOutsideVisibleBounds: true,
    disableClusteringAtZoom: 7,
    //// this function changes the icon acording to how many markers are in the cluster. this works ////
    iconCreateFunction: function (cluster) {
      var count = cluster.getChildCount();

///// I want to have the icons represent the sum of (feature.properties.Confirmed) from the feature layer for each marker ////
/// var theseMarkers = cluster.getAllChildMarkers(); //// -- this is the /// array of each marker in the cluster. If I console.log theseMarkers, it works. How to get the individual items out and sum them to display ?

/////////////////////////////////////////////////////////////////////////

     var digits = (count + '').length;

      return L.divIcon({
        html: count,
        className: 'cluster digits-' + digits,
        iconSize: null
              });
    },
/////////// end CLUSTER  //////////////////
    pointToLayer: function (feature, latlng) {

      return L.circleMarker(latlng, {
            opacity: 1,
            color: getSColor(feature.properties.Confirmed),
            weight: getSwieght(feature.properties.Confirmed),
            fillColor: getColor(feature.properties.Confirmed),
            fillOpacity: .3,//getFOp(feature.properties.Confirmed),
            radius: getRad(feature.properties.Confirmed),
            pane: 'circlesIIOM'
          });

        },
  })

I then add the pane to the rest of the map using a layer control


texts: Using GeoServer REST API and C# to create Layer Group

texts:
Following information at this link in the section on creation of layer groups, I've created the method(C#):
public bool AddToLayerGroup(string layerGroupName, string layerName)
        {
            try
            {
                string gUrl = GEOSERVER_HOST + "/rest/layergroups";
                WebRequest request = WebRequest.Create(gUrl);

                request.ContentType = "application/xml";
                request.Method = "POST";
                request.Credentials = new NetworkCredential(GEOSERVER_USER, GEOSERVER_PASSWD);

                byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes(GetAddToLayerGroupXml(layerGroupName, layerName));
                Stream requestStream = request.GetRequestStream();
                requestStream.Write(buffer, 0, buffer.Length);
                requestStream.Close();

                WebResponse response = request.GetResponse();

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }

When I run a unit test against this method, I get an Internal Server Error reported from GeoServer if I use POST HTTP method.
Now the layerGroupName and layerName used in the above method are already existing in GeoServer. What I want to achieve is provide a way to create a layer group if it doesn't exist, or just use an existing one. The layerName always already exists in GeoServer, as I'm using a separate method to create them.
Can anyone spot any problem with my code above. Or, suggest an alternative approach. cURL or Java or C# examples are welcome. Thanks in advance.
UPDATE:
From Tomcat logs, GeoServer complains that the layer group I've specified already exists. Is there away to add a layer to an existing layer group using the REST API?


texts: Get ISO 3166-2 Regions based on coordinates

texts: I am looking for a way to get the ISO 3166-2 subdivisions based on latitude and longitude. For example JFK airport has the coordinates 40.6413° N, 73.7781° W. and the ISO 3166-2 code is US-NY. Is there a database or a service to retrieve this data?


texts:
From QGIS I am running analysis on linestring geometry in PostGIS, and the result is updated geometry. I want to update the linestring only in editing mode of QGIS layer, so the user can decide whether to save or discard the change.

With WKT it works like this:

import psycopg2
pg_connection_string = "host=''..."
selected_layer = iface.activeLayer()
selected_features = selected_layer.selectedFeatures()
postgis_table_name = get_table_name_from_layer(selected_layer) # custom function
if postgis_table_name and selected_layer.isEditable() and len(selected_features) > 0:
    dbc = psycopg2.connect(pg_connection_string)
    with dbc:
        with dbc.cursor as db_cursor:
            for f in selected_features:
               gid = f.id()
               db_cursor.execute('with geom_update as (select ... from {0} where gid={1})'
                                 'select st_astext(geom) from geom_update'.format(postgis_table_name, gid))
               geom_wkt = db_cursor.fetchone()[0]
               f.setGeometry(QgsGeometry.fromWkt(geom_wkt))
               selected_layer.updateFeature(f)
            selected_layer.triggerRepaint()

The "absolute no way" problem with WKT is it changes the geometry (stripping decimal places), also it is not greatly efficient - not a concern in this particular case but...

Hence WKB format. I thought it is simple as:

               db_cursor.execute('with geom_update as (select ... from {0} where gid={1})'
                                 'select st_asbinary(geom) from geom_update'.format(postgis_table_name, gid))
               geom_wkb = db_cursor.fetchone()[0]
               f.setGeometry(QgsGeometry.fromWkb(geom_wkb))

But no, it is not. It does not work. I tried many variations with encode, decode, python conversion libraries, using sql without st_asbinary() as pure geom but nothing works.

Do you have any idea how to sort this out?


texts: Fixed Zoom Extend For Overview Map on ArcGIS Server JavaScript API 3.8

texts:
Can some one please let me know if it is possible to have the Map Overview with Fixed extend and none zoom in or out functions? I know this was not possible on v.3 but how about v3.8?

Thanks


texts: How do I set the working directory in QGIS?

texts:
I'm learning QGIS and lovin' it.  But one thing that annooys me a little is is that each time I want to save data, the default directory is the QGIS folder under Program Files.

How can I set this, globally, for all my data?


texts: Export georeferenced image into Google Earth

texts:
I have created a georeferenced image as instructed in this fine tutorial: http://qgis.spatialthoughts.com/2012/02/tutorial-georeferencing-topo-sheets.html

Now I would like to get this image into Google Earth, as an Image Overlay or such. Any tips?


texts: How to Format Description when writing Help for Python script tool?

texts:
I try to format the description in script tool but I don't know how it works so i don't manage to add a line break for example.

Does it works with HTML tags ?

When editing my script the description is :

ACTIONS : Pour toutes les images tif dans un dossier

Converti les image .tif en Polygon et les enregistre dans un autre dossier

LES INPUTS :
Le Dossier ...

But when opening the script window to execute, the description is as on the picture :

(without break lines)

Thanks

To Edit my script i use this :


texts: Understanding qgis.core import error: no module named qgis.core?

texts:
I searched all the same questions, and none of them works for me, so i decided to ask this question in addition to those:

I installed QGIS 2.18 via this downloaded setup 'QGIS-OSGeo4W-2.18.11-1-Setup-x86_64.exe'.

and my PATH system variables are :

  C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%PYTHONHOME%;%PYTHONHOME%\Scripts;C:\Program Files\QGIS 2.18\bin;%PATH%

my PATH user variables:

  C:\Users\ash\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\ash\AppData\Local\Programs\Python\Python36-32\

PYTHONHOME :

  C:\Program Files\QGIS 2.18\apps\Python27

PYTHONPATH :

  C:\Program Files\QGIS 2.18\apps\Python27\Lib

*** I use pycharm and my project interpreter is :

  Python 2.7.5 (C:\Program Files\QGIS 2.18\bin\python.exe

now if I import qgis.core it will give

  import error: no module named qgis.core

error in pycharm, but no errors in qgis python console!!!

What did I do wrong?


texts: Calculate Field with Python Parser an If statements?

texts: I don't know a whole lot about python and scripting, so I was hoping somebody could give me a couple pointers on fixing some code.  I am trying to calculate a "final results" attribute field.  The field type is numeric, because I want the values to either be a 1 (pass) or 0 (fail).  Below are two variations of the code I have tried, but they both give me errors.  The two fields I am trying to calculate from are both text fields, and the values for both are either "PASS" or "FAIL."


texts: r.watershed basins at coast / ocean lines

texts:
I am using r.watershed to create watershed basins using a 25*25m dem.

The problem I have is that basins are not always created at coast lines.
I am experimenting with the parameter "minimum size of exterior watershed basin", which controls the minimum number of pixels required to make a basin. If i set this value to say 1-50 I get basins created at coastlines but they are very narrow. If I choose a large value 400+ i get reasonable sized basins but they are are not always created at coasts.

Image - the yellow shaded area is a basin, but the area immeadiately to the left is not a basin.

Is there a way to get basins that cover all areas on the DEM? or is this the correct "behaviour"?


texts: Trilateration in 3D with signal strengths

texts:
I'm having a hard time getting my head around the maths to locate a target in 3D given a number of known points (4 or more) and a value that indicates the signal strength (range 0–100).

I've looked at the simpler answer in the 2D case but I'm unsure how to generalise the idea of normalising the signal strengths for the 3D case. It might even be that this answer is too simple for my requirements. I know that in my case the signal strength is proportional to distance-2 but do not know the propagation constant.

I've also seen this question, but it's not quite what I'm after as I want to use the signal strengths from a larger number of nodes to improve the estimate.


texts:
I'm trying to get values from a raster layer at positions defined in a vector layer.
I've tried with Point Sampling Tool plugin in QGIS but I'm getting many (but not all) Null values, so losing good samples.
I've read some answers here indicating that the problem of Null values is the useage of different CRS, but in my case all them seems (to me) to be the same: 4236

Just if anyone want to try, I'm using this vector data:
https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_001_ColdCorals2017_WMS/MapServer/0

And my goal is to sample their depths from emodnet (WMS, WMTS: https://ows.emodnet-bathymetry.eu/) or gebco (https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv) DTMs, but I'm able to get just some depths (for an area with coverage from both DTMs)

Could anyone give me any hint?


texts: How does ArcGIS calculate zonal statistics with multi-band rasters?

texts:
I am working back and forth between QGIS to ArcGIS for various tasks. So far, for my task, I have found similar tools and options between them. However, for my current task, to calculate the zonal-statistics between multi-band raster and a feature shapefile, the QGIS has option to select the band, but ArcGIS doesn't any option to choose the band. For the single band raster, their zonal statistics results are similar, but in multi-band raster their results are different (that is OK).

Therefore, I am interested to know how ArcGIS calculates the zonal summary out of multiple bands and combine them to one. Can anyone please shed some lights how Arc handles multiband internally and come up with single zonal-stat of multiple bands?


texts: ArcGIS Online Feature Service Exporting Polygons with Topology Errors

texts: I uploaded a file geodatabase containing towns for all of New England to ArcGIS Online and created a feature service. I ran a topology check in QGIS beforehand and detected no errors. After exporting the same data from ArcGIS Online to a new file geodatabase, I ran the topology check on the new file geodatabase and have thousands of gap errors. Does anyone know why ArcGIS Online isn't handling the data correctly or a workaround?


texts: Fiona Geometry Error 12L when opening geodatabase

texts:
I am trying to read a geodatabase using Fiona, but I keep coming across the error:

  fiona.errors.UnsupportedGeometryTypeError: 12L

Which I am very unsure why it is happening.

I've done the following background checks:

  fiona.supported_drivers:
  {'ESRI Shapefile': 'raw', 'OpenFileGDB': 'r', 'SUA': 'r', 'ARCGEN': 'r', 'GeoJSON': 'rw', 'GPKG': 'rw', 'Idrisi': 'r', 'GPX': 'raw', 'SEGY': 'r', 'BNA': 'raw', 'AeronavFAA': 'r', 'GPSTrackMaker': 'raw', 'DGN': 'raw', 'PCIDSK': 'r', 'MapInfo File': 'raw', 'DXF': 'raw'}

  Going_in = fiona.open(SourceDatabasePolygons) #this is the geodatabase
  print Going_in.meta

which gives:

  {'crs': {'init': u'epsg:28353'}, 'driver': u'OpenFileGDB', [//////OP
  omitted///////]', 'schema': {'geometry': 'MultiPolygon',[//////OP
  omitted///////]])}}

Multipolygon is listed as a possibly geometry type at Fiona docs.

When I open the database to check the data it does list the individual components as polygons (which are also supported).

I am completely at a loss as to why I can get it to work as I am attempting to get this segment of code to run:

  with fiona.open(SourceDatabasePolygons, layer=0) as Poly:
      with fiona.open(SourceDatabasePoints, layer=0) as F_Point:
              if shape(F_Point['geometry']).within(shape(Poly['geometry'])):
                  print "true"

Any ideas?


texts:
I am following this tutorial,

but i am not able to get the right username and password to import data. How do I know what the username password is? By default I see tomcat6 as database and username and no password in the textbox. As i am following the tutorial I changed it to username: postgis and password: postgres.

How do I know what my username and password is?

EDIT

Import the data in PostGIS, which requires PostGIS connection.

UPDATE

Ok so i got the user and passwd but when I am trying to add the shapefile using the Shape File to PostGIS Importer Plugin and having made connection successfully, I am getting this error when I am adding the shapefile.

Connecting: host=localhost port=5432 user=admin dbname=shpRepo password='**********'
Connection succeeded.
Connection: host=localhost port=5432 user=admin dbname=shpRepo password='**********'
Destination: public.AllQuebecSpecies
Source File: /home/smaranh/development/Biodiversity/biodiversity/shapefile/AllQuebecSpecies
Shapefile type: Point
Postgis type: POINT[2]
Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "public"."AllQuebecSpecies" (gid serial PRIMARY KEY,
"family" varchar(50),
"species" varchar(50));
SELECT AddGeometryColumn('public','AllQuebecSpecies','the_geom','-1"
Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist
LINE 7: SELECT AddGeometryColumn('public','AllQuebecSpecies','the_ge...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Shapefile import failed.

Can somebody tell me where am I going wrong?


texts: Is it at all possible to use a CQL_FILTER on a WMS service in ArcGIS? Ideally we'd be able to programatically change the CQL_FILTER parameter in the WMS URL.


texts:
I am trying to rescale my NDVI band (-1:1) to 0:255. I am trying to follow the approach in this post: Rescale raster in R , but I am getting NA values.
# my ndvi

ndvi

class      : RasterLayer
band       : 5  (of  5  bands)
dimensions : 10120, 15200, 153824000  (nrow, ncol, ncell)
resolution : 0.25, 0.25  (x, y)
extent     : 747400, 751200, 4309040, 4311570  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
source     : D:/a4_v21/airborne_imagery/Oliva_2019/GeoTIFF_025/0796_2-5_2019_NDVI.tif
names      : X0796_2.5_2019_NDVI.5
values     : -1, 0.8059701  (min, max)

I define the rescale function and I try to rescale the raster:
rescale <- function(x, x.min = NULL, x.max = NULL, new.min = 0, new.max = 1) {
  if(is.null(x.min)) x.min = min(x)
  if(is.null(x.max)) x.max = max(x)
  new.min + (x - x.min) * ((new.max - new.min) / (x.max - x.min))
}

ndvi <- rescale(ndvi, x.min=-1, x.max=1, new.min=0, new.max=255)

I get the following results:
class      : RasterLayer
dimensions : 10120, 15200, 153824000  (nrow, ncol, ncell)
resolution : 0.25, 0.25  (x, y)
extent     : 747400, 751200, 4309040, 4311570  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
source     : C:/Users/sergi/AppData/Local/Temp/Rtmpiu6LVs/raster/r_tmp_2021-01-23_222619_14736_96336.grd
names      : X0796_2.5_2019_NDVI.5
values     : NA, NA  (min, max)

How can I fix this error? I can't understand where the problem is.


texts:
QGIS 3.12.1 fails to export ArcGIS Map Server, and the exporting operation ends up with the error that is illustrated in the following screenshots, the TIFF result appears in black screen. For more clarification, please note the following screenshots.

What might be the issue here?

The Tiff could not be opened in QGis. In my case the export ends up with the following error.


texts: Draw lake isobaths having depth points and coast line

texts:
For some lakes, I have a line shapefile representing the coast line and some points with many information, among which depth (in meters). Is there a way to draw an isobath linking every point with the same depth, but following the coast line?
I work mainly with QGIS and GRASS and I have already tried the QGIS Contour plugin, but the result isn't good.
Here a couple of images of the dataset, the first showing only the coast line and the second showing coast line and points at 1.5 m depth.


texts: PyQGIS: Adding scope to an action - QSet?

texts:
I have got a QGIS plugin which creates a layer and add points to it, with those points being read from PDF files. I store the pathnames as attributes and as the final step would like to add an action to the layer so that when the user clicks on a point, the corresponding PDF is opened.

I have implemented the adding of the action like this:

newAct = QgsAction(QgsAction.OpenUrl,'Open report',"""[%concat("Path",'/',"Filename")%]""",False,False)
actionManager = vl.actions()
actionManager.addAction(newAct)

This works, as far as it goes. However, the Action button is disabled until the Action is manually edited to add a scope, since by default no scopes are defined.

It seems that I need to add a scope (e.g. 'Canvas') as the seventh QgsAction argument, something like this:

newAct = QgsAction(QgsAction.OpenUrl,'Open fix report',"""[%concat("Path",'/',"Filename")%]""",'',False,'',scope)

If the 'scope' variable is a string this doesn't work. I believe it needs to be a QSet() object and I think I know the required syntax in C, but not Python. How do I define 'scope' in Python such that it can be used with QgsAction()?

QGIS 3 ; PyQt5 ; Python 3.6.


texts: GeoServer map preview different than OpenLayers output?

texts:
I have a GeoTIFF with internal overviews, generated using gdaladdo and the -r mode. I published this GeoTIFF in GeoServer 2.6 and I can see the image fine in map preview.

However, when I load the image in our OpenLayers 2 application, the image quality is worse. It appears as though GeoServer Map Preview is using the GeoTIFF overviews that I created using Gdal and that OpenLayers 2 is generating a new overview, using another resampling algorithm.

The layer is loaded in our app by using straight OpenLayers.Layer.WMS
Is this even possible? Or am I imagining things?


texts:
I'd like to use specific colors for my Unique Values. I tried creating another layer. choosing the colors that I want, and using the ApplySymbologyFromLayer. I also updated my new layer to make sure it was classified as Unique Values. When I refresh my map, no colors are showing up, and the wrong Value Field is appearing when I manually look at symbology. Has anyone else had this problem? I get no error messages, and when I print the valueField and the symbologyType, the correct fields appear.

Here is my code -

color_layer=arcpy.mapping.ListLayers(mxd)[-6]
lyr=arcpy.mapping.ListLayers(mxd)[-1]
arcpy.mapping.UpdateLayer(df,lyr,color_layer,True)
lyr.symbology.valueField="color"
lyr.symbology.addAllValues()
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
arcpy.ApplySymbologyFromLayer_management(lyr, color_layer)
arcpy.RefreshActiveView()
arcpy.RefreshTOC()


texts: Actually, this is a continuation of a previous post entitled "Count the number of corners of a polygon". Although I managed to count the number of points (i.e. saying corners) of each polygon the problem is that even a polygon may be approximately rectangular actually has more than four points because of the digitization process i.e. sometimes an approximate straight line consists of more than 2 points. How can I ignore the intermediate additional points that are not really needed for my purpose? Thanks.


texts: I have coordinates in [lat, lon]. How can I convert them to the rasters "pixel" position [x, y]? I know raster top-left corner, scale and skew.


texts: Distance between 2 3D points(GPS+altitude) in PostGIS

texts:
I have 2 points, look like: (lat,lon,altitude in meters).
How can I get the distance between them?

I saw only ST_3DDistance(geometry g1, geometry g2);

But I don't know how to set points coordinates right way..
Because I have GPS + altitude also.

As suggested by Niklas

WITH geom_1 AS (
    SELECT ST_Transform(ST_SetSRID(ST_MakePoint(Lon, Lat), 4326),32637)
    ), point_3d AS (
    SELECT  ST_MakePoint(ST_X(st_transform),ST_Y(st_transform), 0) FROM geom_1
    ), static_points AS (SELECT geom FROM eco.static_points WHERE name='Moscow')
SELECT ST_3DDistance(st_makepoint, geom) FROM point_3d, static_points;


texts: I'm very new to QGIS. I want to make a shape seem seamless. As you can see on the following screenshot, there is a border on the waterarea depicted. I'd like to make this one disappear. I tried the technique explained here but it doesn't seem to work with my simple case :S


texts: Why is st_intersects giving bad results?

texts:
I am using PostgreSQL version 9.2.2 with PostGIS 2.0.2 (or just 2.0, not sure), and need to do simple queries to find points that intersect with a polygon.

The following test case returns only partial results for an unknown reason.  If the minimum longitude value of the polygon is changed from 0 to 1 to 2 to 5 to 20 (leaving the latitudes limits as they are), different numbers of the points are returned, even though all of the points fall into the polygon for all these values.

CREATE TABLE testing.tsttab
(
  lat real,
  lon real,
  tstpoint geography(Point,4326)
);

INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.1, 22.1, ST_GeographyFromText('POINT(22.1 36.1)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.2, 22.2, ST_GeographyFromText('POINT(22.2 36.2)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.3, 22.3, ST_GeographyFromText('POINT(22.3 36.3)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.4, 22.4, ST_GeographyFromText('POINT(22.4 36.4)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.5, 22.5, ST_GeographyFromText('POINT(22.5 36.5)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.6, 23.1, ST_GeographyFromText('POINT(23.1 36.6)'));
INSERT INTO testing.tsttab (lat, lon, tstpoint) values (36.7, 23.2, ST_GeographyFromText('POINT(23.2 36.7)'));

select * from testing.tsttab
where st_intersects(
st_geogfromtext('POLYGON((2 35, 2 37, 40 37, 40 35, 2 35))'),tstpoint);

If I convert to GEOMETRY rather than GEOGRAPHY, it performs correctly.  Am I mis-using something?


texts: GeoNetwork cannot harvest 'metadataUrl' from WMS 1.3 GetCapabilities

texts:
I am trying to harvest a WMS v1.3 layer from GeoServer v2.17
using GeoNetwork v3.4 & v3.10.
I'd like the GeoNetwork to read the URL from 'metaDataUrl' in WMS GetCapabilities response
i.e. I have ticked 'Import record for each layer using MetadataURL attributes' in the 'OGC Web Services' harvester
The geoserver does output 'metadataUrl' in its WMS 1.3 GetCapabilities response,
but the geonetwork does not recognise it:
<Layer queryable="1" opaque="0">
...
    <MetadataURL type="19139">
        <Format>text/xml</Format>
        <OnlineResource xlink:type="simple" xlink:href="https://geonetwork.blah.org/geonetwork/srv/api/records/12345_435454_234343_343_23/formatters/xml"/>
    </MetadataURL>

The logs say:
No metadataUrl attribute found for layer 'blah'
Failed to load metadata document for layer 'blah'. Error is: 'null'
What kind of 'metadataurl' XML does the GeoNetwork expect in GetCapabilities ?
Is there an example I can get hold of?


texts:
I'm new to GIS applications and trying to figure out what options I have for visualizing spatial query results that combine raster and vector data using OpenLayers/GeoExt/GeoServer/PostGIS.

A hypothetical query that could be created on a web client by a user might be: "give me all raster pixels with an index value of 1 that are within a distance of 120 meters of any river (line vector feature) and touching or inside a selected watershed (polygon vector feature)".

I think I have a good idea how I could write a where clause for a spatial SQL query such this, but it's not at all clear where I'm submitting this type of query from my JavaScript web client. Some PHP examples I've found seem to suggest that a server side process will have to submit the SQL query, presumably directly to the PostGIS database? Is this correct?

It's also not super clear how I can visualize mixed raster/vector query results. I've seen some purely vector examples that create a vector map layer in OpenLayers and when the vector features come back to the client, those features are simply pushed onto the vector map layer. Assuming a mixed vector+raster query is possible in PostGIS, should I be expecting to follow the same process (get vector features back, then add them to a vector OpenLayers layer) for visualization?

Lastly, does it even sound like I'm thinking along the right lines here or am I attempting to do something that is difficult or even impossible given the feature sets available in Open Source GIS tools these days?


texts: Using SVGMarker inplace of default symbol using in point vector layer

texts:
I am trying to use the SVGmarker symbol for displaying the point vector layer. I was able to change the default symbol for the point vector layer. but I am not getting an idea of using the SVGmarker symbol in place of the default symbol. I am using QGIS3 C++ APIs.Even any lead in python will be beneficial.
for example :
path for SVGmarker symbol:"C:\OSGeo4W64\apps\qgis-ltr-dev\svg\food\food_bar.svg"
code snipped for changing vector layer symbol:
    layer->startEditing();
    qDebug()<< "is editable " << layer->isEditable();
    QgsFeatureRenderer * layerRenderer= layer->renderer();
    QgsSingleSymbolRenderer *mSingleRenderer = QgsSingleSymbolRenderer::convertFromRenderer(layerRenderer);
    QgsMarkerSymbol* symbol = new  QgsMarkerSymbol();
    QgsStringMap mp;
    mp[QString("fill")]= QString("red");
    mp[QString("name")]= QString("food_bar.svg");
    mp[QString("size")]= QString("6");
    mp[QString("outline")]=QString("black");
    mp[QString("outline-width")]=QString("6.8");
    auto svgsymbol = QgsSvgMarkerSymbolLayer::create(mp);
    auto newsym=     symbol->createSimple(mp);
    mSingleRenderer->setSymbol(newsym);
    layer->setRenderer(mSingleRenderer);
    layer->triggerRepaint();
    layer->commitChanges();
    qDebug()<< "is editable after commiting  " << layer->isEditable();

In the above code, I am not able to provide a path of  food_bar.svg icon. color and size are getting changed. but the icon is not coming.


texts: Insert cursor for first row in unique value set arcpy

texts:
I really need some guidance on how to create a python script with arcpy to:

1) Search through a table for unique values in a field.

2) For the first row in each unique valueset, insert that row into a new empty table.

I have been trying to get this work with the da.SearchCursor and da.InsertCursor, but can't really get 2) to work..

The reason why I want to do this is that I have a table with two fields; "wellbore_name" is the ID for wells, "Units" are concatenated geological units for the specific well.
There are several rows for each unique ID, and I want an output table with as many rows as unique IDs. Since the units are concatenated I only need one row for each ID.

This is probably easy for someone fluent in cursors, but alas I am not. Hopefully someone out there can help me with this :-)


texts:
I have a trajectory given by GPS which I store as a ST_LineString() and I'd like to know the area covered by the line string. I know the "width" of the trajectory, but I'm not sure how to approach the problem.

I thought the following steps might do what I want.

break line string into an array of two-point segments (simple lines)
create a rectangle from the two-point-line and width
call st_unionaggr() over all rectangles to create one polygon and then call st_area() on it

So my question is: Is there an effective way to create a rectangle from given line and width? And if so, do you think this solution is viable or is there a more elegant way to do it?


texts:
I've been using the new Synced Table feature of CartoDB, and it's working great.

But some of the data I want to sync with is not public data. The data provider keeps it on S3, but requires authentication. Is there a way that I can use the sync tables if I have a password to access it? Can I plug that in to CartoDB somehow?


texts: Drawing outline of point cloud using QGIS?

texts:
I want to know if there is a plugin in QGIS, which will allow me to draw the outline a point cloud. I know there Points2One the plugin, but it makes an outline with all points, even with the data found in the middle of the point cloud.

I give you an example ;

x       y       ID      order
3.3     43.2625 353293  1
3.13334 43.3458 353293  2
3.21667 43.3458 353293  3
2.88334 43.4292 353293  4
2.96667 43.4292 353293  5
3.05    43.4292 353293  6
3.13334 43.4292 353293  7
2.71667 43.5125 353293  8
2.8     43.5125 353293  9
2.88334 43.5125 353293  10
2.96667 43.5125 353293  11
3.05    43.5125 353293  12
3.13334 43.5125 353293  13
2.88334 43.5958 353293  14
2.96667 43.5958 353293  15
3.05    43.5958 353293  16
3.13334 43.5958 353293  17
2.96667 43.6792 353293  18
3.05    43.6792 353293  19
3.13334 43.6792 353293  20
3.21667 43.6792 353293  21
3.05    43.7625 353293  22
3.13334 43.7625 353293  23
3.21667 43.7625 353293  24
3.13334 43.8458 353293  25
3.21667 43.8458 353293  26

With the tool suggested by @ArMoraer I can only draw a polygon with the outer points that are more extreme. The polygon has touched just 5 points (see map of Convex hull below) but normally it should pass on 20 points (all points of the contour).

Each point has a pixel, actually the outline should not touch the points but it must pass through the outer limit of these pixels. In the end I want to have an outline like this map (see map below : desired contour)


texts: How to create a fixed distance buffer with QGIS Nodebo 2.16.1

texts:
having opened the "variable distance buffer" window I can't set the radius. There is just no option but this actually is what I need to create a buffer with a specific radius.

Can anybody help me?


texts: Changing the attribute behind a legend without changing the symbology

texts: I have a geology layer with a very large legend that was painstakingly created based on a geological code.  I now have a new attribute which is a friendly description for each code and I would like the legend to use (or simply display) the description instead of the geological code.  How can I do this without recreating the legend by hand?


texts: Opening ArcCatalog to FGDB causes application to fall over

texts:
I have some python scripts I have written to create a lot of objects.  I write these, in code, to a couple of FGDB's.  If I happen to open ArcCatalog in one of these FGDB's, the application falls over, saying it cannot gain a lock on it.

Is there a way to stop it happening?

  arcgisscripting.ExecuteError: ERROR 000464: Cannot get exclusive
  schema lock.  Either being edited or in use by another application.


texts:
I have a point layer in QGIS 2.18.14. I have colored the points based on a category, using the YlOrRd color ramp. Now I am trying to change the outline of each point marker to be slightly darker than the fill color. I would do it by hand, but there are dozens of them. Is there a way to do this automatically?

I have tried applying a data-defined override to the outline of the simple marker using the expression "darker(@symbol_color, 200)" as presented in solutions to these questions:

Styling border to match fill in QGIS?

How to remove ghost lines around polygons in QGIS 2.12?

but it does not result in any change. In the expression window, the output preview shows that it's working, but the actual color of the outline just never changes. I tested the same method on a polygon layer (because both previous questions were talking about polygons, not points), and still got nothing. Any idea how I might do this better, or why the data defined override isn't working?


texts: Creating a tile server - what am I missing?

texts:
I have created a tile server using the instructions from here.

After creating this, I clicked the link in the bottom to continue creating my tile server for use.
I chose a library, Openlayers, to create a interactive map. But with Openlayers I am not requesting any tile from the tileserver?

I guess I am missing the step to communicate with the tile server? How to I place tile requests at my tileserver?
How to use the tileserver with Openlayers?


texts:
I have this query that search for the nearest 5 stations (5km at max) from the location that I'm selecting (com.id):

SELECT est.name as nombre, '5km' AS metodo FROM vectorial.meteorologicasccg est
JOIN vectorial.dpa_comuna com ON  com.id = :id
WHERE ST_Contains(ST_Buffer( ST_Centroid( com.thegeom ), 5000 ), st_transform( est.the_geom, 3857 ) )

It works ok. But, in case that I have no results, I will go for the nearest, and I'm trying to do it with this:

SELECT est.name as nombre, 'mascercano' AS metodo, ST_Distance( ST_Centroid( com.thegeom ), st_transform( est.the_geom, 3857 ) ) AS distancia
FROM vectorial.meteorologicasccg est
JOIN vectorial.dpa_comuna com ON  com.id = :id
ORDER BY ST_Distance( ST_Centroid( com.thegeom ), st_transform( est.the_geom, 3857 ) ) ASC LIMIT 1

But I got this error:

"Operation on two GEOMETRIES with different SRIDs"

I'm trying to replicate this:

I have this query, it calculates the minimum distance of the center of a 'radio' search ( a circunference) and some target. It works:

SELECT est.name as nombre, 'mascercano' AS metodo, ST_Distance( ST_Centroid( st_geometryfromtext('POINT(".$center[0]." ".$center[1].")', 3857) ), st_transform( est.the_geom, 3857 ) ) AS distancia
FROM vectorial.meteorologicasccg est ORDER BY ST_Distance( ST_Centroid( st_geometryfromtext('POINT(".$center[0]." ".$center[1].")', 3857) ), st_transform( est.the_geom, 3857 ) ) ASC LIMIT 1

This one use a different type of search, but it's working.

What I'm doing wrong in the query?

I'm very new to GIS.


texts: Error installing visibility analysis plugin

texts:
When I try to download and install the latest version of the visibility analysis plugin from both https://plugins.qgis.org/plugins/ViewshedAnalysis/ and http://www.zoran-cuckovic.from.hr/QGIS-visibility-analysis/ on either a PC running QGIS 3.2.3 or a Mac running 3.6.1 I get the following error message:

Couldn't load plugin 'QGIS-visibility-analysis-master' due to an error when calling its classFactory() method

ModuleNotFoundError: No module named 'viewshedanalysis'
Traceback (most recent call last):
  File "/Applications/QGIS3.6.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/[USER]/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/QGIS-visibility-analysis-master/__init__.py", line 52, in classFactory
    from viewshedanalysis import ViewshedAnalysis
  File "/Applications/QGIS3.6.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'viewshedanalysis'

Anyone know what's wrong?


texts: No custom widgets in Qt Designer for QGIS 3

texts: There are no custom widgets in my "Qt Designer with QGIS 3.0.3 custom widgets". Is it a bug or I should somehow manually enable them?


texts: What is the QGIS 2.2 print layout map extent CRS?


texts: How to use OpenLayers 3 with a WMS supplied by MapServer?

texts:
I'm not able to centralize my map in OpenLayers / MapServer , it appears at the top . The " center " do not work . Below my code to better analyze . I did not post the mapfile why I did an experiment with the same file in OpenLayers 2 and it worked right.

//Javascript
var perimetro = new ol.layer.Image({
  source: new ol.source.ImageWMS({
      url: 'http://localhost:8081/cgi-bin/mapserv.exe',
      params: {
          LAYERS  : 'perimetro' ,
          mode    : 'map',
          CRS     : 'EPSG:31982',
          map     : 'c:/ms4w/Apache/htdocs/openlayers/maps/arapoti.map',
          FORMAT  : 'image/png'
      },
      serverType  : 'mapserver',
      extent: [616080.773587 , 7327639.675000 , 622114.038913 , 7331307.325000]
  })
});

var bairros = new ol.layer.Image({
  source: new ol.source.ImageWMS({
      url: 'http://localhost:8081/cgi-bin/mapserv.exe',
      params: {
          LAYERS  : 'bairros' ,
          mode    : 'map',
          CRS     : 'EPSG:31982',
          map     : 'c:/ms4w/Apache/htdocs/openlayers/maps/arapoti.map',
          FORMAT  : 'image/png'
      },
      serverType  : 'mapserver',
      extent: [616080.773587 , 7327639.675000 , 622114.038913 , 7331307.325000]
  })
});

var map = new ol.Map({
    target: 'map',
    layers: [perimetro , bairros],
    projection : new ol.proj.Projection({
        code: 'EPSG:31982',
        units: 'm'
    }),
    view: new ol.View({
        center: [622114.038913 , 7331307.325000],
        zoom: 5
     });


texts: Calculating line centroids for 460,000 features in QGIS?

texts:
I have a large shapefile of lines, and want to run a mmqgis function (Plugins --> mmqgis --> Modify --> Convert Geometry Type.)

The problem is the file is very large and crashes the program. What options do I have?

Would running it as background python script work (and if so how do I find the commands for mmqgis function?)?

There are 460'000 features and i'm running a 3.40GHz i7 with 12GB of RAM. Is there a way of this not breaking down?


texts:
I have an AddIn (C# VS 2010) that depends on the selected items in the Attribute Window (This is the right-click on the Layer Attributes Table Window). When the user hits Start Editing I want to get a handle on the Currently open Attribute Window (or check if it is open) and automatically select the correct Layer. I know how to get the currently selected layer as shown below.

var puid = new UID {Value = "{E156D7E5-22AF-11D3-9F99-00C04F6BC78E}"};
IEnumLayer penumlayer = _mxDocument.ActiveView.FocusMap.get_Layers(puid, true);
penumlayer.Reset();
featureLayer = penumlayer.Next() as IFeatureLayer;

But I need to check if the Attribute Window is open and then I can auto select the Layer with some other code based on the DataSet Name.

I'm hoping that someone has a code snippet that will help me.


texts: Error when using ServerStyleGalleryClass (Arcobject)?

texts:
First, I used:

IStyleGallery styleGallery = new StyleGalleryClass();

I can run my program without error (on my computer). But this require using ESRI.ArcGIS.Framework (need install Arcgis Desktop). And, I can't use for my client computers.
So, I used ServerStyleGalleryClass, and I used "MakeServerStyleSet" utility to convert my style file into server style.

Then, I used below codes, but I got the error "Error HRESUT _EFAIL has been returned from a call to a COM component" (because after getting Items, styleItems is NULL)

        IStyleGallery styleGallery = new ServerStyleGalleryClass();

        IStyleGalleryStorage styleStor = (IStyleGalleryStorage)styleGallery;
        string startupPath = Environment.CurrentDirectory;

        string strFilePath = startupPath + "\\Data\\Styles\\SoDo.ServerStyle";
        styleStor.AddFile(strFilePath);

        IEnumStyleGalleryItem styleItems;

        styleItems = styleGallery.get_Items("Line Symbols", strFilePath, "Default");  // Return NULL value
        styleItems.Reset();
        IStyleGalleryItem styleGalleryItem = styleItems.Next();

Are there anyone know what's wrong ?

Thanks and regards,

Tai


texts: QGIS Invalid object name 'geometry_columns' QODBC3:Unable to execute statement

texts:
I was using Lisboa 1.8 with SQL Express and tables with geometry. Connections were working with 1.8 and are working with ArcGIS, so I know my tables and geometry are fine. I installed 2.4 Chugiak, mapped my SQL Server, test connection works fine, but now I get:

[Microsoft][ODBC SQL Server Driver][SQL Server]
Invalid object name 'geometry_columns'.
QODBC3:Unable to execute statement.

Can someone tell me what is going wrong all of a sudden? Thanks.


texts: how to create a cartodb layer via post request

texts:
I have a select query (really long) based on which I want to create a layer on google maps. I tried the same query in cartodbo map editor(online) it worked fine. But when I wrote a code to access the same data via javascript its failing with the error

http://myusername.cartodb.com/api/v1/map?stat_tag=API&lzma=3YCAiIBsXICAgICA…c3R1fHUC1tGnX6s9z1OH8TOP0X8G%2FnjsaKGG3A%3D%3D&callback=_cdbc_2758786579_1

here is my code

var mapOptions = {
            zoom: 8,
            center: new google.maps.LatLng(38.328732,-85.764771),
            mapTypeId: google.maps.MapTypeId.ROADMAP
          };
          map = new google.maps.Map(document.getElementById('map'),  mapOptions);

            cartodb.createLayer(map, {
              user_name: 'myusername',
              type: 'cartodb',
              sublayers: [{
                sql: "SELECT * FROM cartodb1 where zcta5ce10 in (" + zipList + ")",
                cartocss: '#cartodb1 {polygon-fill: #FF6600;polygon-opacity: 0.7;line-color: #FFF;line-width: 0.5;line-opacity: 1;}'}]
            })
            .addTo(map) // add the layer to our map which already contains 1 sublayer
            .done(function(layer) {
                console.log('Fine');
            })
            .error(function(e) {
                console.log(e);
            });

      }

where zip list is quite huge so I posted it separately here http://textuploader.com/ase80


texts: Unable to set ValueList for parameter in python tool in ArcGIS

texts:
I have a tool I am writing that takes in a multiple parameters. The last of these, Codenumber, I want to define to be 1,2,3 or 4. I am attempting to do this by use of a Value List. See below section of my code;

outFC_location = arcpy.GetParameterAsText(0)
end1_Easting = float(arcpy.GetParameterAsText(1))
end1_Northing = float(arcpy.GetParameterAsText(2))
end2_Easting = float(arcpy.GetParameterAsText(3))
end2_Northing = float(arcpy.GetParameterAsText(4))
fcName = (arcpy.GetParameterAsText(5))
Codenumber = arcpy.Parameter(
    displayName = "Code Number",
    datatype = "float"
    parameterType = "Required"
    direction = "Input"
    multiValue = False)

#Set a list of possible values for runway code.
Codenumber.filter.type = "Valuelist"
Codenumber.filter.list = ["1","2","3","4"]

In the script's properties, under "Parameters", I am unable to set "Value" as described here; https://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/value-list-filter.htm

The only fields I can see under "Parameters" are Display Name and Data Type. When running the tool, the input for Codenumber shows no list of inputs.

What is the error in my code or my approach?