texts: Use Azure Data Lake as GeoServer storage

texts:
I've developed an application involving a GeoServer (2.17) instance deployed on an on-premise web server. The data consists of mosaics of GeoTIFF images stored on the web server file system.
Now I need to port the architecture on Azure platform. I need to persist my raster files on an Azure Data Lake Gen2 instance. I know that there are many possible solutions for the GeoServer deployment on Azure (VM, container, AppService, etc), but I can't find a way to connect GeoServer to the storage.
I think I can set up a virtual machine using Azure services to deploy GeoServer and duplicate raster files on the VM's file system but I'd like to connect Geoserver to Azure Data Lake directly.
I found that it is possible to read files from Amazon S3 buckets, but I didn't find a similar solution for Azure.
I also found this solution but it works with Azure Blob Storage that is different from Azure Data Lake.


texts: Tips editing/managing SLD files in geoserver

texts:
I have spent the complete day creating a single SLD file and tuning it, and I am on the one hand really pleased with the actual result, but really frustrated how cumbersome it is to edit and test SLD's using Geoserver web-interface.

In theory it is really simple: edit the SLD, "submit" and I scroll my layer-preview and see instant change.

But then my labels need to be shifted down a little, so I return to the styles view, search for my SLD, search the relevant label in my SLD (that tiny edit screen --what is it: 20 lines? is not really helping), save, and it starts all over again.

How do you edit/manage your SLD's?

For instance my particular SLD I created today has 1300 something lines, to describe 24 cases of drawing a point-symbolizer with a label, and to me this seems like a simple case.

I also have a lot of repetition for each rule, because the only thing that changes between the cases is the image I use, and the position of the label.

Are there any tools that help in editing/previewing SLD's? Can you actually edit the file directly? (damn, I did not try that, I assumed not because Geoserver needs to be "aware" it changed?).

Things I just thought of:

try to just edit the file in place using my favorite text-editor to see if that works
I just noticed that each SLD has a unique URL, that would save me the navigation to the SLD


texts: Is it possible to add python util scripts as shared libraries to esri geoprocessing toolbox?

texts:
We have GP tools in GP toolbox OurServices.tbx and some of them are written in Python. We access them via geoprocessing services. However some Python functions are just copy-pasted from one GP function script to another.

The question is: Is it possible to embed a Python script, say our_utils.py, into the toolbox file (tbx) so in all our Python tools we are able to access shared functions like this:

import our_utils
our_utils.sharedFunc()

We don't want pack shared functions as separate GP tools and then use ModelBuilder; this approach is too heavyweight for the issue.

Bounty edit 1 (2015-05-05)

I feel I have to give a bounty to someone participating here. At least three beautiful minds were attracted by it so I don't want my bounty going to dust.

I don't have ArcGIS at my fingerprints at the moment but I've spent 30 to 40 mins today checking if @mr.adams hacks can be extended to server installations (geoprocessing rest services). And, surprisingly, it worked with some additional hacks!

The hacks were: after packaging to .sd file (still a mystery for me how to pack more than one tool) rename that file to .zip and add libraries folders (import mylib => you must add mylib folder into zip). Then rename .zip back to .sd.

So my modest bounty goes to @mr.adams. I won't mark his answer as true answer; I still need to find a simpler way.

For pure Pythonistas @Farid_Cher gave an excellent .pyt template. I hope many copypasters will use it.


texts: Launch of osm2pgrouting: fe_sendauth: no password supplied

texts:
I am trying to launch the osm2pgrouting thru the command below and load data (file) into it, but i get the following message:

$ osm2pgrouting --f osnabrueck.osm --conf mapconfig.xml --dbname
routing --username postgres Execution starts at: Tue Jul 14 14:14:01
2020

       COMMAND LINE CONFIGURATION             *

Filename = osnabrueck.osm
Configuration file = mapconfig.xml
host = localhost
port = 5432
dbname = routing
username = postgres
schema=
prefix =
suffix =
Don't drop tables
Don't create indexes
Don't add OSM nodes

Testing database connection: routing fe_sendauth: no password supplied

What does the last line mean? How do I supply password to it?


texts: List all polygon vertices coordinates using geopandas

texts:
I'm trying to list all polygon vertices coordinates of a rectangle with four corners and a hole with four corners. I drew the vertices in this order:

import geopandas as gpd
#import matplotlib.pyplot as plt
import numpy as np

df = gpd.read_file('/home/bera/geodata/Rectangle_with_hole.shp')
g = [i for i in df.geometry]
x,y = g[0].exterior.coords.xy
coords = np.dstack((x,y)).tolist()

>>coords
[[[536176.3224485546, 6724565.633642049],
  [538863.5583380334, 6724580.120088892],
  [539022.9092533124, 6722189.856359706],
  [536201.6737305308, 6722124.66734891],
  [536176.3224485546, 6724565.633642049]]]

Only five coordinate pairs are listed. How can I list all?


texts: Creating drop down list to zoom into selected country for Leaflet maps?

texts:
Using leaflet control, how do I create a drop down menu which lists country names?

When selecting a country on this list, the map will zoom into the selected country on that map.

countriesLayer = L.geoJson(countries,
            {
                onEachFeature: countriesOnEachFeature
            }
        ).addTo(map);

This layer loads my countries onto the map from my geojson file.

var geoJsonFeatures = [];
function countriesOnEachFeature(feature, layer){
        if (feature.properties && feature.properties.Country){
            geoJsonFeatures.push(feature);
        }
}

And then I have a loaded array which holds my geojson data as objects in the array.

 var legend = L.control({position: 'bottomright'});
 legend.onAdd = function (map) {
    var div = L.DomUtil.create('div', 'info legend');
    var dropDownContent ='<select>';
    for (var i = 0; i < uniqueCountryArray.length; i++ ){
        dropDownContent += '<option value=' + "'" + uniqueCountryArray[i]["ISO3"] + "'>" + uniqueCountryArray[i]["Country"] + '</option>';
       }
        dropDownContent += '</select>';
        div.innerHTML = dropDownContent;
        div.firstChild.onmousedown = div.firstChild.ondblclick = L.DomEvent.stopPropagation;
        return div;
};

Next, I created the drop down list with it's ISO 3 code value attached to it.

$('select').change(function(){ //when user selects a country from the drop down list
            var selectedCountry = document.getElementById('ddVal').value;
            for (i=0 ; i < geoJsonFeatures.length; i++){//zooms to selected country on match
                if(selectedCountry == geoJsonFeatures[i].properties.ISO_3_CODE){
                    map.fitBounds(geoJsonFeatures[i].getBounds());
                }
            }
});

I get the ISO 3 code value from the select, compare it to the geoJson ISO 3 code in the array. When it matches, I want to use the object in the geoJson array to center it to the country selected on my Leaflet map.

I am certain that I am using the getBounds() function wrongly.


texts: Joining two or more overlapping buffers using MMQgis plugin?

texts:
I use MMQgis plugin to create buffers around points. Some of them overlapping and, to my analysis, i have to "dissolve" lines that cross this buffers. I use Vector -> Geoprocess -> Dissolve, and it was similar to what I wanted, if it were not for the fact that all attribute values have become just one!

Attribute table before dissolve:

Features after dissolve:

Table after dissolve:

How should I to proceed?


texts: Input image does not match with signature file in supervised classification

texts:
I have a issue in supervised classification on ERDAS IMAGINE. When ever I performed supervised classification it gives a warning message. It says:

iInput image does not match signature's image association.

I don't know why this message is given and output image is completely a single color.


texts: Openlayers shapefile polygons hover effect

texts: I have shapefile polygons. I'm using OpenLayers with OpenStreetMap tiles. Is it possible to create hover effect which will show up info window with some informations about that polygons? Is it the best to put it in some database maybe? Thank you.


texts: How to select WFS features by polygon in OpenLayers?

texts:
I need to be able to select features on a wfs layer using a polygon instead of a box. I was hoping this would be a standard option in the SelectFeature class. Too bad this isn't the case.

Any implementation suggestions?


texts: Editing specific portions of DEM using ArcGIS Desktop?

texts:
I currently have a DEM for an east coast city. Unfortunately, the elevation of an area containing a Dam is not accurate. I have the correct elevations as reported by the city. How would I go about editing the elevation values of a specific group of cells so that they accurately reflect the elevation difference of the dam?

For example, here is a portion of the DEM, where the point is the dam:

I need to find a way to select a subset of the nearby DEM cells and edit them so they are accurate with the dam heights.

How do I do this using ArcGIS Desktop?


texts:
I'm customizing Geonode through the geonode-project template. To override geonode templates it's ok, but now I need to override a template tag file.

I customized the 'SUPPORTED_CRS' in my_geonode/settings.py to list the EPSG codes that I want, but, in order to show their names instead of the codes, I need to override the object EPSG_CODE_MATCHES that is defined in the geonode/layers/templatetags/layer_tags.py

How can I override this?


texts:
I've created a two new PostgreSQL users; one that is supposed to have read-only privileges and another one that should have most privileges (admin-user). When I connect/log in to the new users in QGIS I can't see or access the tables though.

Since there is no difference in what I can access no matter which of these users I connect to, I probably missed out on something fundamental here. When connecting in QGIS with default PostgreSQL user (superuser) I get access to all tables. Here is my grants for the two users I created:

User_1

CREATE USER user_1 WITH PASSWORD 'xxxxx';

GRANT CONNECT ON DATABASE mydb TO user_1;
GRANT USAGE ON SCHEMA my_schema TO user_1;
GRANT SELECT ON ALL TABLES IN SCHEMA my_schema TO user_1;
GRANT SELECT, USAGE ON ALL SEQUENCES IN SCHEMA my_schema TO user_1;
ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema GRANT SELECT ON TABLES TO user_1;
ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema GRANT SELECT, USAGE ON SEQUENCES TO user_1;

User_2

CREATE USER user_2 WITH CREATEDB CREATEROLE CREATEUSER PASSWORD 'xxxxxx';

GRANT CONNECT ON DATABASE mydb TO user_2;
GRANT USAGE ON SCHEMA my_schema TO user_2;
GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA my_schema TO user_2;
GRANT ALL ON ALL SEQUENCES IN SCHEMA my_schema TO user_2;
ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON TABLES TO user_2;
ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema GRANT ALL ON SEQUENCES TO user_2;
ALTER USER user_2 WITH NOSUPERUSER;

I've read the documentation for PostgreSQL about grants but can't seem to find anything missing.

Any ideas why this doesn't result in any access to tables in QGIS for my new users?


texts: Issue working with Timemanager plugin of qgis

texts:
I am  trying to create an animation layer using a csv file, but the layer appears blank with small "time frame size".

Attached images have sample data I am plotting with 'hour4' as the time field.

The layer appears blank until I select 'Time Frame Size' as 1 year. Ideally it should work with  'Time Frame Size' = '1 day' as my data is at date level with date ranging from 2016-08-08 till 2016-08-23.


texts: RQGIS R package to use QGIS functions is not working: throwing Error, UnicodeEncodeError / Python?

texts:
I am currently using
R ver. 3.4.1 installed on C:\R\R-3.4.1,
installed and loaded Packages: RQGIS, sp, raster.
QGIS ver. 2.18.11 installed with OSGeo installer on C:\OSGeo4W64\apps\qgis.

In R I am trying to use the installed RQGIS package to enable QGIS functions via R as shown in the example of the packages GitHub page (https://github.com/jannes-m/RQGIS), I was following.

My environment is set to:

set_env()
$root
[1] "C:\\OSGeo4W64"
$qgis_prefix_path
[1] "C:\\OSGeo4W64\\apps\\qgis"
$python_plugins
[1] "C:\\OSGeo4W64\\apps\\qgis\\python\\plugins"

But unfortunately I always get errors at the following line of code:

library("RQGIS")
find_algorithms(search_term = "([Pp]olygon)(centroid)")

Error in py_str_impl(object) :
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 77807: ordinal not in range(128)
Error in py_call_impl(callable, dots$args, dots$keywords) :
  AttributeError: 'file' object has no attribute 'getvalue'

Detailed traceback:
  File "C:/R/library/reticulate/python\rpytools\output.py", line 14, in end_stdout_capture
    output = sys.stdout.getvalue()

I have already tried reinstalling QGIS, R and all depending packages for a couple of times.

Now I checked Spacedman's suggestions, see below.

For R:

> reticulate::py_config()
python:         C:\OSGeo4W64\bin\python.exe
libpython:      C:/OSGeo4W64/bin/python27.dll
pythonhome:     C:\OSGeo4W64\apps\Python27
version:        2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\OSGeo4W64\apps\Python27\lib\site-packages\numpy.
 numpy_version:  1.12.1
 python versions found:
 C:\OSGeo4W64\bin\python.exe
 C:\OSGEO4~1\bin\python.exe

And in QGIS I entered:

import sys
sys.executable

'C:\\OSGEO4~1\\bin\\qgis-bin.exe'

Unfortunately I still don't know how to get it up running correctly.


texts: PostGIS Optimization - Group spatially close entities physically on disk

texts:
I'm working on my first PostGIS database and was hoping to find some performance gains for live rendering.

I'm rendering a map directly from a PostGIS (9.1, 2.0) db that contains an import of OSM data (using imposm3). Most importantly, my roads table is about 30GB and it's rendering a bit slower than I would like. In the future, I'll be using generalized alternatives to the fully detailed roads table at higher zoom levels, but for now I just have it rendering at reasonably low zoom levels. I've already taken note of some PostGIS-specific tuning suggestions and these have made a nice impact on performance.

My question is if it would be feasible and worthwhile to reorganize how the entities in my roads table are stored on disk. For example, I would imagine that if I'm querying a neighborhood-sized area and the enclosed entities are on the same physical disk page, performance would be much better than if they were ordered based on OSM submission order (which I fear they are now). I'm wondering if there are any utilities or suggested means of reordering the entities on disk.

Alternatively, would I perhaps benefit from creating new smaller tables spatially split from the larger, 30GB table?

Thanks!

Edit:

Half out of stubbornness and half out of curiosity, I went ahead and ran the CLUSTER table ON hash_index and this ended up making my table's performance slightly worse. After doing quite a bit of searching and learning, I came to the realization that the first thing one should do every single time is EXPLAIN query. Ended up that there was some weirdness with the types and my queries weren't even using the index.

I'm adding this mostly as a PSA to anyone who might wind up here searching for the clustering solution: check that your indexes are correct and run explain to make sure they're being used.


texts: Mean Center/Median Center tool providing points mathematically centered but physically appearing in the wrong location

texts: To create population weights, I'm using the Mean and Median Center tool to find the center of our populations in census tracts. However, I've noticed that some of the points that are popping up are physically appearing in the census tract next to the census tract they should be in, resulting in two points in one tract when there should be just one. However, the attribute table does verify that they are belonging to a different census tract, just not physically displaying them in the different census tract. Has anyone run into this issue? Does anyone know how to fix it?


texts: I want to open hundreds of KML files in QGIS. And it keeps showing this window. It's troublesome to set importing choices for every layer for hundreds of times. Is there any other more convenient method to finish this?


texts:
I do have some data from raster files (timelines, 30m) which I would like to access by coordinate from a web interface. E.g. I know the coordinate and need the data from the corresponding raster file. I do NOT want to load the data in a PostGIS database.

I thought about dumping the data in JSON files (similar to raster image tiles) on a storage and then load the according file to the coordinate I have, similar to WMS tiles. But I am struggling to figure out a way how to "map" the coordinate to the right raster tile and what would be proper folder structure?

Is there any algorithm for this?


texts: I want to take a DEM and edit it using a tool in ArcMap where it will take all the areas above a certain elevation and lower them all to the elevation I choose. For example, I would want everything above 2000 ft to be changed to 2000 ft so that it is flat at those areas. Any ideas on a good tool to do this?


texts: PyQgis, styling vector layers in different canvas

texts:
I'm developing a QGIS plugin and I need some help with styling layers in different canvas objects.

In my dialog window I've got two QgsMapCanvas objects canvas1 and canvas2. Layers from registry are loaded to both objects (the same list of layers).

for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    # appending layer to list
canvas1.setLayerSet(list)
canvas2.setLayerSet(list)

Now in both canvas objects I've got the same map composition.
Next I want to change layer style only in canvas1. I've tried:

layers = canvas1.layers()
# get polygon layer
layer = layers[0]
# set properties
properties = {"color": "255,0,0", "outline_color": "255,0,255"}
s = QgsFillSymbolV2.createSimple(properties)
layer.setRendererV2( QgsSingleSymbolRendererV2(s))

But this layer style is changed in all of the canvas objects (canvas1, canvas2 and main canvas in Qgis).

How could I change styles for only one canvas in the most efficient way?


texts: Why does QGIS Profile from Line tool give me the same value for every point?

texts:
I'm trying to make an elevation profile with QGIS's Profile from Line plugin. But when I do, the resulting points all have the same value: -32,767. I'd like to know what I'm doing wrong.

My elevation data is from GeoBase.ca (at 1:50,000 scale). My route line is selected in yellow, below.

As an aside: my route covers two raster files, and I haven't figured out how to render them to the same elevation scale. The top of the map is coloured as low elevation because of mountains to the north. I don't think this is the source of my problem -- when I sample the elevation layers with the Identify Features tool, it reports the elevation changes that I'd expect.

Here are the options I used with the Profile from Line tool:

Profile from Line makes a new layer. Here is its attribute table. Note that all of the values are the same.

What should I do to get a valid elevation profile? Thanks.


texts: NameError when attempting to auto increment field with python script

texts:
I am getting the following error when trying to run my code and I am not sure why:

NameError: global name 'rec' is not defined

Here is my code:

field = "id_num"
rec=0
def autoIncrement():
    global rec
    pStart = 1
    pInterval = 1
    if (rec == 0):
        rec = pStart
    else:
        rec = rec + pInterval
    return rec

incrementCursor = arcpy.UpdateCursor(IDHex)
for row in incrementCursor:
    row.setValue(field, str(autoIncrement()))
    incrementCursor.updateRow(row)

del incrementCursor


texts: Bulk Snapping Points to Line Vertex in QGIS?

texts:
I have around 8000 point features that require snapping to the nearest line vertex.  Please see below image for reference.  I would like to do this in one go if possible.

Is there a tool in QGIS 3 that I can use to do this?

All the points are within around 1 meter of where they should be. I have tried using V.edit and V.clean but because I don't know what parameters need filling in/selected/checked boxes/etc. It never seems to work.


texts: How to change the order of a raster in order to create mosaic with MosaicPro (Erdas 9.2)?

texts: Is there a way to reorder the input files so I can control which ones are on top of the others?


texts: Displaying a legend for a centroid, simple marker with size overwrite?

texts:
I am new to QGIS and can't figure out how to display a legend for the dot size of a centroid, simple marker. The size of the dot is dependent on a value from a CSV linked to a layer map of Europe. I have two dots per country (different years). This is a snippet of the map:

Now what I need is to be able to display a legend for the size of the dots. It is showing me a legend in the "symbol size" menu:

I was able to create a legend while using graduated symbols. I also tried using graduated and then switch method to "size". However, even in a new project, the only option I get is color:

So this is not an option either. I'm using QGIS 3.8.

Edit: Conerning Josephs answer: I can't find this optione. I do have the advanced dropdown on certain levels, but not on all of them. Here with Screenshots:
First level:

Second level:

Third level:

Fourth level:


texts:
If I go to abroad as a tourist before I collect the visiting places on my Google Maps then export it to KML.

In abroad I don't use mobile Internet on the street (very expensive) but I would like to check the places during my way so I need an offline map where my interested places pins on it.

There is an application: Google My Maps but it only works online, is it?

Is there any application or solution where there is an offlineable map and I can import my collected pins kml-file to check the places in the visited city?


texts: Extract polygons closest to/coinciding with points?

texts: I have 2 shapefiles, a polygon and a point layer. I would like to perform an operation in which I extract the polygons that coincide or are closest to each point, and throw away the polygons which are far away from my points of interest. I tried doing an "Intersection" but it seems the Intersection tool in ArcGIS will not output polygons. Is there any other way to do this?


texts: Rename layer in gpkg using QGIS or PyQGIS?

texts:
I have a gpkg of several layers. How can I rename them in the gpkg as well as in the QGIS layers list?

Basically, I have layer foo in my QGIS project, whose source is filename.gpkg|layername=foo. I now want to call it bar.

It's easy (rightclick, rename) to change foo to bar in the QGIS project layer list. But it's still called foo inside the gpkg. I can't rename it inside the gpkg from the GeoPackage connection inside the QGIS browser: it lets me rightclick and choose rename, but OK is greyed out (presumably since it's in use).

As a workaround, I can rename it bar in the QGIS project layer list, export it from the QGIS project layer to a temporary gpkg (where it becomes named bar and foo is forgotten), import it from there as a duplicate to the right gpkg, use the changeDataSource plugin to point the project layer to the new name, and then clean up by deleting the old foo in the gpkg. And eventually vacuum the db.

But that's a hassle given I've set up a naming convention to use across projects, and now need to rename 20+ layers across several gpkg to reflect it (and so I and others can re-use those gpkgs in other projects).


texts: Python 2.7.12 not compatible with Django but still cannot be updated

texts: I have installed Python 3.6.4 on my computer. I am trying to set up Django but each time I try to use the command prompt, it tells me that the Python version am using is not compatible. When I check the Python version, it is Python 2.7.12. I haven't installed the latter but am wondering where it is coming from. I have deleted the Python27 folder but now my ArcMap is not working. How can I make the Python version 3.6.4 the one I'm using and still make my ArcMap work properly? I'm using Windows 7


texts:
I have a line layer that seemingly consists of a single feature. I then ran QGIS's Multipart to Singleparts algorithm (same result as Extract Nodes), so then the result consists of 27 line features:

The problem is that the line is not ordered, so when I'm trying to calculate distance along this path (whether the line layer is dissolved or not), the results end up wrong.

My current workaround is to buffer the layer (with dissolve all option) then running v.voronoi.skeleton. This works ('resetting' the line completely into one feature), but for some line inputs produces no result. Can anyone come up with a solution to re-order line segments in QGIS?

Using QGIS 2.18, open to a PyQGIS solution! I must run this solution on hundreds of layers, so preferably no plugins.


texts: Soil Adjusted Vegetation Index Values (MSAVI2) are Not Within Expected Range

texts:
I am using MSAVI2 (Modified Soil Adjusted Vegetation Index 2) to analyze different land cover classes for a study area in southern Africa.  The Land cover classes were taken from a Planet Labs RapidEye satellite image captured during the Rainy Season in early 2018 but the values don't make sense as they are above accepted limit of 1.0:

Mean MSAVI2 Values for Rainy Season:
Heavy Vegetation areas:  1.232
Light Vegetation areas:  1.086

MSAVI values should be in the range of -1.0 to +1.0, but these values are well beyond +1.0. I checked my calculations and they seem fine (no errors). Also I noticed that distribution of the values for all my Rainy Season image bands are not normally distributed but they all skew to the left.  For example the Red band has this left-skew:

Does MSAVI2 and similar vegetation index calculations require normally  distributted values? It seems that the moisture (rainy season) in the landscape is skewing the satellite reflectance values in this image.

I ran the same MSAVI2 calculation on a Dry Season image for the same area, and the values fall in the expected range:

Mean MSAVI2 values for Dry Season:
Heavy Vegetation areas:  0.81
Light Vegetation areas:  0.56

Also the dry season image has normally distributed values for all of the satellite image bands so I'm wondering if moisture from the rainy season is distorting the MSAVI 2 values.


texts:
I have clarified the original question, so some of the original answers (prior to March 17 2017) will not be relevant to what I was trying to ask...

How does one add a descriptor to each line of a stacked label?

As in the following extract:

I wish to add the "Thinning", "Species" and "Planting Year" text, along with the lines pointing to each of the stacked label levels (i.e. everything to the right of the green block).


texts: Cell declustering using open-source software

texts:
I want to perform cell declustering in a small point data set.

I have 9 observation points and I want to find the size of the region of influence for an observation, and afterwards use that as weight in analysis.

The only way, I could find is that one:

library('gstat')
library('sp')
data(meuse)
coordinates(meuse) = ~x + y
data(meuse.grid)
coordinates(meuse.grid) = ~x + y
gridded(meuse.grid) <- TRUE

zn.tp = krige(log(zinc) ~ 1, meuse, meuse.grid, nmax = 1)
image(zn.tp["var1.pred"])
points(meuse, pch = "+", cex = 0.65)
cc = coordinates(meuse)
library(tripack)
plot(voronoi.mosaic(cc[, 1], cc[, 2]), do.points = FALSE, add = TRUE)
title("Thiessen (or Voronoi) polygon interpolation of log(zinc)")

So, after preparing the data, I could create Thiessen (Voronoi) polygons. However, It works properly only when I made decision about the borders of my grid.

How I could perform cell declustering, that will also take care of creating the outer borders?

The only idea I could find was DECLUST function from gslib http://www.statios.com/help/declus.html . Could cell declustering be done in less difficult way?


texts: Pix4D Initial process merge looks exploded on one end

texts:
I have a 3700+ image project that has been merged from 9 separate projects. After the final merge, one end of the property looks like it exploded from the ground. If I click on the pixels they show up as images on the side window. Only the 1st initial process has been run, no point cloud or mesh has been created yet, nor have I reoptimized.

Suggestions?


texts: Is there a way in QGIS to extract the coordinates of the nearest point on a polygon from an input point layer? I am looking for the coordinates not the distance, as provided by NNJoin.


texts: Raster extraction doesn't show up under QGIS?

texts:
I need to apply the raster extraction tool in QGIS.
But the Raster extraction option does not show up under the RASTER tab.
I believe this is part of the rgdalTools plugin but I can't find this in the plugins download list.
Using QGIS 3.10.1 (Coruna)
Tips?


texts:
I want to display something on a world map.
I have these shapefiles http://thematicmapping.org/downloads/world_borders.php
I want my map to look something like this:

or

I am using QGis. Is that difficult to archive or do I 'simply' have to change the projection of the shapefile? I am lacking some theoretical knowledge and I do not know where to start searching...


texts:
I have assigned the elevation and the volume flow to each point at a river (with v.to.db and v.what.rast). Now I want to calculate the Elevation difference between each pair of points and then calculate the Hydropower between them by using P=density * Q * delta_h * g.
Here you can see an example of my Attribute Table (I know the differences are too small but it is only an example):

I don't know how to do this. Is there a way in GRASS or how can I realize that?

OK, I know how to Calculate the Hydropower with given Elevation difference (SQL Builder (Update) -> Field Calculator)).
It works fine to multiply different rows. But one step is in my opinion not feasible with that:
To Calculate the differences between Elevation as shown above (I cannot say something like: Elevation=i+1 - Elevation=i). Is there another Way?

Maybe to calculate it directly in GRASS and not in the Attribute table?


texts: Volume calculation using potree/three.js?

texts:
I am using Potree/three.js web viewer for visualisation of 3D cloud points. I would like to compute the volume inside the user defined polygon. Potree supports only drawing a cube in measure tool. However Potree supports area measurement by irregular polyon but not volume.

How do I compute the volume using the user defined polygon?


texts: Generating a distribution map without x and y from given raster-grid into given polygons

texts:
I am working on an archaeological map for an excavation. I have given polygons which represent my archaeological layers (SE). Over that I have an grid with 1mx1m from which I have my findings. Each of this gridsquares is identified like a chess board (a1;b1; ...) Also I have different types of material in my findings (ceramics, metal, bone,...). The point is the findings are located to the grid and the layer (SE) where it was found, but has no direct messurement in X and y. I now want to make a distribution map for each of the material groups and or with them all together on one layer. So I will have a map with multiple SEs shown with the amount of material found in each grid per SE.
By now I have drawn all my polygons for the SEs and I have cut them to fit each gridsqare, so that I have a polygon for SE 23 in B1 and C1. If there are more than one polygon from the same SE in one grid sqare I already have merged them to one, so that my single identifier is the combination of SE and Grid name. But when I am trying to connect the attribute table of my polygons and the CSV of my findings it does not work at all.
So can anyone give me a hint how to get the map described above?
I am using Q.GIS 3.12 Bucuresti.
As I wrote I have tried to do a new point layer with a point for each SE-part per square. But I cant do the integration of my findings. So I am asking how my Attributtable should look, when I have as ID the combination of SE and grid name and I have amount and weight per material from 8 different materialtypes which I want to display all together and per materialtype. –


texts: Leaflet map more performance with a svg image

texts:
I created a leaflet-application with phonegap containing a svg image as my "baselayer". The performance is okay when i zoom in via double tap. But when i zoom in via two-finger-zoom the image starts to stutter and the zoom animation is delayed.

My solution was to remove the svg when zooming and add it again when zoom is finished. This actually works but freezes the application for 1 second when adding the svg layer.

Is there a solution with good performance?


texts: How to suppress PyQGIS warnings and show only errors?

texts:
I have a standalone PyQGIS program which generates warnings as follows:

Warning 1: Value val of field field_name of feature n not successfully written. Possibly due to too larger number with respect to field width

I want to suppress these warnings to be able to see future errors since I have more than 1000 features and any warning/errors after the 1000th will not be displayed. Any idea how to do this?


texts: Seeking GIS Navigation App for High Accuracy Data?

texts:
Are there any mobile GIS applications that I can use to navigate to high accuracy data on android?

I would like to load layers - a .shp or .kml and use the map to navigate to points.
It needs to be able to work offline.


texts: Populating attributes while creating polygons in for-loop from CSV using PyQGIS

texts:
I have a working script that builds rectangles from a CSV using @Kadir Sahbaz's answer and @Ben W's answer
I'm wanting to pass non-geometry attributes as well. This runs and creates the fields but with NULL values:
srcFile = "D:\\Data\\filename.csv"

layer = QgsVectorLayer("Polygon?crs=EPSG:2193", "Polygons", "memory")
QgsProject.instance().addMapLayer(layer)

provider = layer.dataProvider()
provider.addAttributes([QgsField('ViewName',QVariant.String, '', 50, 0),
                        QgsField('FigName',QVariant.String, '', 10, 0)])
layer.updateFields()

with open(srcFile,'r') as infile:
    rect = infile.readlines()

for b in rect[1:]:
    parts = b.split(',')

    #### Coordinates coming from CSV ####
    xMin = float(parts[2])
    yMin = float(parts[3])
    xMax = float(parts[4])
    yMax = float(parts[5])

    rect = QgsRectangle(xMin, yMin, xMax, yMax)
    polygon = QgsGeometry.fromRect(rect)

    feature = QgsFeature()
    feature.setGeometry(polygon)

    provider.addFeatures([feature])

    fields = QgsFields()
    feature.setFields(fields)
    feature['ViewName'] = parts[0]
    feature['FigName'] = parts[-2]

    provider.addAttributes(fields)
    layer.updateFields()

I'm still getting NULL values. FWIW...if I run @Ben W's code, change the with statement to:
with edit(layer):
    print(parts[0],parts[-2])
    provider.addFeatures([feature])
    t = provider.changeAttributeValues({feature.id(): {f1: parts[0], f2: parts[-2]}})
    print(t)

The values from the CSV are appearing and .changeAttributeValues appears to running properly:


texts: Why forest coverage is same for some sites with varying canopy cover percentages and buffer radii using Google Earth Engine

texts:
//Define all coordinates
var pointList = [
  ee.Feature(ee.Geometry.Point(-82.964662, 8.78754421), {name: 'LasCruces'}),
  ee.Feature(ee.Geometry.Point(-82.833405, 8.9453785), {name: 'LasAlturas'}),
  ee.Feature(ee.Geometry.Point(-83.521707, 8.694056), {name: 'AguaBuena'}),
  ee.Feature(ee.Geometry.Point(-83.33052, 8.697707), {name: 'Saladero'}),
  ee.Feature(ee.Geometry.Point(-83.203795, 8.702278), {name: 'LaGamba'}),
  ee.Feature(ee.Geometry.Point(-83.662379, 8.685824), {name: 'Bromelias'}),
  ee.Feature(ee.Geometry.Point(-84.376866, 9.818762), {name: 'LaSelva'}),
  ee.Feature(ee.Geometry.Point(-83.485502, 8.714672), {name: 'Mirador'}),
  ee.Feature(ee.Geometry.Point(-83.672295, 8.691173), {name: 'Jinetes'}),
  ee.Feature(ee.Geometry.Point(-83.588293, 8.694951), {name: 'RanchoQuemada'}),
  ee.Feature(ee.Geometry.Point(-83.258253, 8.656794), {name: 'Dolphin'}),
  ee.Feature(ee.Geometry.Point(-83.06069, 8.603446), {name: 'GPTurn'}),
  ee.Feature(ee.Geometry.Point(-83.19873, 8.67821), {name: 'Golfito'}),
  ee.Feature(ee.Geometry.Point(-82.993605, 8.785756), {name: 'Romero2'}),
  ee.Feature(ee.Geometry.Point(-83.666655, 8.689647), {name: 'VistaDrake'}),
  ee.Feature(ee.Geometry.Point(-82.976395, 8.806548), {name: 'StaClara'}),
  ee.Feature(ee.Geometry.Point(-83.600086, 8.697011), {name: 'RinconRd'}),
  ee.Feature(ee.Geometry.Point(-83.519634, 8.562216), {name: 'LosPatos'}),
  ee.Feature(ee.Geometry.Point(-83.316672, 8.746735), {name: 'Osall'}),
  ee.Feature(ee.Geometry.Point(-83.518933, 8.702871), {name: 'Neotropica'}),
  ee.Feature(ee.Geometry.Point(-83.270145, 9.769966), {name: 'OsaRoad'}),
  ee.Feature(ee.Geometry.Point(-83.72393, 9.16715), {name: 'Uvita'})
];

var pointCollection = ee.FeatureCollection(pointList);

// Define a function of buffering to create circles around sites
var buffer_circles = function(feature) {
    var intermediate_buffer = feature.buffer(10000);  // buffer radius in meters
       return(intermediate_buffer); // Returns the circles
      };

// Apply function to map
var bounding_circles = pointCollection.map(buffer_circles);
    Map.centerObject(pointCollection); // Center map on sample points
    Map.addLayer(bounding_circles, {color: '#ff4c4c'}, "Buffering Circles");

//If cc is less than more/greater output for percent forest coverage will be yielded because the program counts forestry greater than that percentage
//Currently (70,6,6) couting forests which have a canopy cover of >70% and are connected to 6 other pixels with >70% canopy cover
var cc = ee.Number(60)
var pixels = ee.Number(6)
var lossPixels = ee.Number(6)

//gfc2010 : global forest change in 2010
var gfc2010 = ee.ImageCollection("GLCF/GLS_TCC")
  .filterDate("2010-01-01")
  .filterBounds(pointCollection)
  .mosaic()

var canopyCover = gfc2010.select(['tree_canopy_cover'])

var canopyCover10 = canopyCover.gte(cc).selfMask();

var contArea = canopyCover10.connectedPixelCount();
var minArea = contArea.gte(pixels).selfMask();

Map.addLayer(minArea, {
    palette: ['#899fed']
});

var forestArea = minArea.multiply(ee.Image.pixelArea());
var forestSize = forestArea.reduceRegions({
    reducer: ee.Reducer.sum(),
    collection: pointCollection,
    scale: 30
});

print(forestSize)

https://code.earthengine.google.com/1265692cb75f83d9d387a92728f4f47e
My main goal of this code is to calculate the forest coverage of each site for a given radius. My code's logic is to sum the pixels of forests with a canopy cover percentage greater than x% and that are connected to 6 other pixels that also have a canopy cover percentage greater than x% around a site.
Another problem I have is that some sites consistently have a forest coverage of 0. However, upon looking at Google Earth I see that there is quite a bit of forest, so I'm unsure as to why the program would return a value of 0.
I'm relatively new to GEE and js so I'm unsure if I'm overlooking a minor issue.


texts: How do I find the area of a polygon covered by points of a defined size? (QGIS 2.18)

texts:
I'm using point vectors to portray 264 marked trees in a stand using the 'Random points inside polygons' tool (it doesn't matter where they are). Each point is 4.5m across (the average single tree canopy).

How do I find the proportion of the area of the polygon covered by the points in order to work out the proportion of canopy to be removed? Either the area covered by red or the area covered by 264 4.5m points would do (as some trees are on the edge).


texts: Save a selected row into a new shapefile with arcpy

texts:
I have a shapefile with 100+ rows. What I like to do is to select each row and export all its data to a new shapefile. I tried using the arcpy.da.SearchCursor as follows:

with arcpy.da.SearchCursor(inputshape,"*",None) as cursor:
...     for row in cursor:
...         arcpy.FeatureClassToFeatureClass_conversion(row,pathToFolder,row[3] + ".shp")

Resulting in an error, arcpy displays following message:

  Runtime error
      Traceback (most recent call last):
      File "", line 3, in
      File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 1694, in
  FeatureClassToFeatureClass
      raise e
      RuntimeError: Object: Error in executing tool

I think first parameter in the FeatureClassTofeatureClass_conversion method ist wrong. Other Examples show that there has to be the @Shape field. the workflow I would like to automate is very simple: 1) Open the attribute table 2) select a row 3) Export selected data to a new shapefile.


texts:
I am using ArcGIS Desktop 10.4.1 and ArcGIS Collector.

I've tried to follow the answer given to my last question here about naming attachments from Collector. When I run the script, I get the error message:

Traceback (most recent call last):
  File "D:\extract.py", line 20, in <module>
    for row in cursor:
RuntimeError: A column was specified that does not exist

I see from other users that have this problem that the problem can be related to the naming of the column (that I haven't named it correctly), but I can't find out the right way.

This is my script as it stands now:

import arcpy, os
from collections import defaultdict

inFC = r'D:\Drammen.gdb\Drammen' # Feature Class
inTable = r'D:\Drammen.gdb\Drammen__ATTACH' # Attachment table
fileLocation = r'D:\Test' # Output location

# Get dictionary of ObjectID and associated field value
myFeatures = dict()
with arcpy.da.SearchCursor(inFC, ['OID@', 'Sefrakid']) as cursor:
    for row in cursor:
        myFeatures[row[0]] = row[1]

# Create dictionary to count usage of the field value (to increment files)
valueUsage = defaultdict(int)

# Loop through attachments, incrementing field value usage, and using that
# increment value in the filename
with arcpy.da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID', 'REL_OBJECTID']) as cursor:
    for row in cursor:
        if row[3] in myFeatures:
            attachment = row[0]
            fieldValue = myFeatures[row[3]] # Value of specified field in feature class
            valueUsage[fieldValue] += 1 # Increment value
            filename = "{0}_{1}".format(fieldValue, valueUsage[fieldValue]) # filename = FieldValue_1
            output = os.path.join(fileLocation, filename) # Create output filepath
            open(output, 'wb').write(attachment.tobytes()) # Output attachment to file

And this is the table from the FC (I want the column Sefrakid to be the name for the jpgs):

And this is how the ATTACH table looks:

I do notice that compared to Midavalos answer in my recent post, I do have some REL_GLOBALID which he doesn't. Maybe that has something to do with it?

I am (as you now know) very inexperienced with Python (or programming in general), so it's not easy for me to see obvious errors in the script.

Can anyone point me to where the mistake is?


texts: Algorithm to find polygons enclosing points

texts:
I'm trying to find an algorithm that can determine the smallest possible polygons to cover a number of points.

I know how to get the convex hull around all the points, but say that the points are located on different islands, is it possible to determine that there is a gap between different groups and get separate polygons for each group?


texts: ArcObjects - Export map to PDF - graphics not appearing

texts:
I'm having an issue with our ArcObjects code for exporting a map to PDF. There is a section of code that adds graphics on to the map (polygons, lines, text etc). This seems to work fine for the first map generated after the map service is started, but on subsequent prints the markup does not get displayed on the map. This code worked previously but no we've converted it to run as an SOE on ArcGIS Server 10.0.

The code in question:

        // IMap map, IGraphicElements graphicElements

        GraphicUtil.GetGraphicsContainer(map).DeleteAllElements(); // clear any previous markup

        _logger.Debug("Add graphic elements to container");
        IGraphicsContainer graphicsContainer = GetGraphicsContainer(map);
        graphicsContainer.Reset();
        for (int i = 0; i < graphicElements.Count; i++)
        {
            IElement element = graphicElements.get_Element(i) as IElement;
            _logger.Debug("Adding geometry type: " + element.Geometry.GeometryType.ToString());
            graphicsContainer.AddElement(element, 0);
        }

        ((IActiveView)map).PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

    ...

    public static IGraphicsContainer GetGraphicsContainer(IMap map)
    {
        return (IGraphicsContainer)map;
    }

If I take out the DeleteAllElements the markup stays on the map between requests but any new markup doesn't get added.
If I restart the map service, then it will add the markup on the next request, then not add anything after that.

In the ArcGIS Server logs I can see the following items which indicates nothing is being drawn, even though the graphic elements have been correctly added to the graphics container in the code (as far as I can tell)

INFO3   End of the graphics drawing.
INFO3   Graphic count: 0.
INFO3   Beginning of the graphics drawing.

Any suggestions would be much appreciated!


texts: Geoprocessing Service jobs fails with no errors

texts:
I have a geoprocessing arcpy script that seems to work fine through arcgis client.  I receive no publishing errors.  Whenever I submit a job to the geoprocessing service, it fails almost instantly.  The job details all look similar to the following:

Job Details: j0191703c856e42d2a5e3c830fc9a6175 (MarketAnalysis)
Job ID: j0191703c856e42d2a5e3c830fc9a6175

Job Status: esriJobFailed

Job Messages:

    esriJobMessageTypeInformative: Submitted.
    esriJobMessageTypeInformative: Executing...
    esriJobMessageTypeError: Failed.

The problem is that nothing shows up in any logs even with it set to debug.  I have some logging at the very start of my script and it appears to fail before that.  The best I can figure is that it fails before executing the script, but I can't verify that.  I don't knwo where else to look.  All that I can see is the status of 'esriJobMessageTypeError', but no cause as to why.

Has anyone seen this?  Does anyone know anyway to determine the problem?  Other geoprocessing services work, just not this one.


texts: Removing multiple fields in Arcpy with remove function

texts:
I am trying to delete several fields within a feature class using the .remove function but receive the following error when just testing the remove function in the arcpy module;

ERROR 001334: Cannot delete required field Shape

import arcpy
fc="X:\GIS_PROJECTS\Documentation\Test\UA_GDB_1.gdb\Urban"
fields = arcpy.ListFields("X:\GIS_PROJECTS\Documentation\Test\UA_GDB_1.gdb\Urban")

for field in fields:
    print field.name

FCfields = [f.name for f in arcpy.ListFields(fc)]
DontDeleteFields = ['UA_ID', 'NAME', 'LSAD', 'LSAD_DESC', 'Join_Number', 'DensitySQMI', 'GeoID2', 'F15Growth','Shape', 'F14Growth', 'GrowthAvg', 'ConFinance500', 'ConFinance400', 'ConFinance300']
fields2Delete = list(set(FCfields) - set(DontDeleteFields))
arcpy.DeleteField_management(fc, fields2Delete)


texts: Rule-based classifying (styling) by multiple fields in QGIS 2.18

texts:
I need to build an expression through which to achieve a rule-based classification by multiple fields.
The basic expression could be:
"Field 1" = 'Value a' AND "Field 2" = 'Value b' AND "Field 3" = 'Value c'
but I need to be able to write in the same rule n expression with the same structure but referring to different values of the same fields, ie

so that each class is composed of the set of elements (features) that satisfy the conditions of the single basic expression.
As a second possibility to obtain the same classification I considered the possibility of creating a new column whose values are obtained through a CASE WHEN / THEN expression that contains the same expressions described above, ie:

Can both be correct ways to solve the problem and what can be the correct syntax?


texts: ArcGIS Add XY data cannot specify x and y fields

texts:
I have imported numerous CSV files into ArcGIS before using the "Add XY Data" dialog box.  Sometimes I run into a problem where I can select the table, but then the drop-down menus to specify the X, Y, and Z fields are blank, where they would usually display a column header like "Longitude" (see picture below).

I'm running into this problem now.  The CSV table has a header row, but nothing shows up in the Add XY data dialog box field specification, so I cannot add the data to ArcGIS.  I've also tried importing the table and displaying as XY data, but the problem persists.  This has happened in ArcMap versions 10.2 and 10.3.

Any ideas why Arc can't find XY fields?  Could special characters in the table create this problem?

Here's a sample of the data:


texts: How can Ripley's K Function output in ModelBuilder be used as the search radius for Kernel Density analysis?

texts:
I am using ArcGIS 10.3.1 (Basic license).

The first part of the model takes point data, runs it through Ripley's K Function tool, sorts the data in descending order by the DiffK column, and then uses "Get the Field Value." At this point I have generated a single value that represents a distance. All that works well, but I am not having any luck getting that generated distance to be used as the input for the Kernel Density search radius (model parameter) later in the same model.

I have tried making a model parameter variable for the Kernel Density tool, but I cannot connect the search radius model parameter to the distance value.

Any thoughts on how to use a model-generated single value as input for a Kernel Density model parameter (search radius)?


texts: I installed Qgis 1.8 several months ago.  It's been working like a charm.  Earlier today, I decided to check out the latest nightly build.  Installed GDAL 1.10 (already had 1.9 installed) and SQLite 3.7.16 first, then the nightly build.  It's been running fine, however, I just tried to to some DEM raster analysis...which does not work at all.  I get an error message - "An error has occured while executing Python code".  Any advice?


texts: How to control road labels in Atlas QGIS 2.0?

texts:
I'm producing map books for our water assets. These books are taken out into the field by the workers so they can see where various 'things' are for the work they need to undertake.
There are over 200 pages of maps and I've been using the Atlas functionality and I love it.
But my problem is that my road name labels jump around a bit and when the PDF is produced, the road names tend to be truncated and close to the edge of the page.
My roads are made up of segments so in Properties, I have checked the box that 'merges connected lines to avoid duplicate labels'.
In Composer, if I manually move the map, I can see the labels jumping from one location to another. It's not too much of a problem in denser urban areas. But in rural areas where there are only one or two roads, it presents a problem if I don't have a road name or it is truncated.
How can I fix this?


texts:
I have been working with pyGTiff for a while and it works great. However my gis data does not have the same projection and extent. I saw that in the repository a  a jupyter notebook with a test example aligning data is provided.
Unfortunately the code throws this Error:

  NotImplementedError: You must build the supplementary C++ module to
  enable this method.

from pyGTiff import geotiff
import numpy as np
LS8 = geotiff('LC80200312014149LGN00/LC80200312014149LGN00_B5_subset.TIF')
NED = geotiff('nedwashtenaw.tif') #Align NED data with LS8 data
NEDn = LS8.intersect(NED,nodata=[0],resampleType=2)

The last line is the source of the error.
The Ipython notebook and example data can be found here

Environment:
Canopy Python 32bit,
GDAL 2.0.1,
pyGTIFF 1.0.3


texts: setStyle() function for GeoJSON features - Leaflet

texts:
Ok, since I already asked a very long question about this, but since it didn't get any new replies for a while, and not to get confused in details, I will keep this one simple the best way I can.

If I'm not mistaken, a setStyle function for a named, particular feature would be as follows:

var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
var rect = L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);

rect.setStyle({color: "#4B1BDE"});

...which would change the color from orange to blue. I'm also aware of the resetStyle() function that will revert the style to the original.

This is how I style my GeoJSON:

var everything = L.geoJson(myfile, {
    onEachFeature: function(feature){
        array_of_layers.addLayer(feature);
    },
    style: function(feature){
            switch(feature.properties.name){
            case "belgium": return belgium_style; break;
            case "bosnia": return bosnia_style; break;
            case "denmark": return denmark_style; break;
            case "great_britain": return britain_style; break;
            case "greece": return greece_style; break;
            case "italy": return italy_style; break;
            case "serbia": return serbia_style; break;
            case "spain": return spain_style; break;
            }
    }

});

What I want to do is to make just one country blue and the others gray, later in the code. It's a two-step thing, to paint all countries to gray, and then make one blue.

The first thing is, I need such a loop that would iterate over each feature and setStyle() for all countries to gray. Does it work if I just everything.setStyle({color: "#4B1BDE"}) or something?

The second thing is, (that's giving me sleepless nights) how do I select just one feature out of a group of GeoJSON polygons to work with? Just the country that I need to paint to blue.

If it was a matter of mouse hovering, I could place an event listener as are done in Leaflet tutorials. But regardless of user interaction, I want to set and reset the style by calling it with its name, as I did with the rectangle above.


texts: How to make the Temporal Controller pick up updated raster layer temporal properties

texts:
I want to use the temporal controller to create an animation of a time series of water depth rasters. Using pyqgis, I want to add the layers to my project and set the correct temporal properties for each layer, so I then only have to press play in the Temporal Controller. Adding the raster layers to QGIS and setting the temporal properties works just fine, but these properties are not picked up by the Temporal Controller until after I manually click Properties > Apply for each layer. In most use cases it will concern > 20 raster layers, so this is not very practical.
How do I tell the Temporal Controller to read the updated raster layer temporal properties?
Code snippet below. The input is a folder of .tif files (water depth, each at a specific time). They are named water_depth_{zero_padded_number}.tif.
QGIS version: 3.16.4
wd = 'C:/Users/leendert.vanwolfswin/Documents/temporal_experiments/'
tif_folder = os.path.join(wd, 'waterdepth_batch')
nr_time_steps = 5
time_steps = range(nr_time_steps)
result_layers = {}
start_datetime = QDateTime(2000, 1, 1, 0, 0, 0, Qt.LocalTime)
duration_s = 300
qml = os.path.join(wd, 'waterdepth.qml')
root = QgsProject.instance().layerTreeRoot()
layer_group = root.insertGroup(0, 'Water depth (temporal)')

for time_step in time_steps:
    tif_basename = 'water_depth_{}'.format(str(time_step).zfill(4))
    tif_fn = os.path.join(tif_folder, '{}.tif'.format(tif_basename))
    result_layers[time_step] = QgsRasterLayer(tif_fn, tif_basename)

    # add layer to project
    result_layers[time_step].loadNamedStyle(qml)
    project = QgsProject.instance()
    project.addMapLayer(result_layers[time_step], addToLegend=False)
    layer_group.insertLayer(-1, result_layers[time_step])

    result_layers[time_step].temporalProperties().setMode(QgsRasterLayerTemporalProperties.ModeFixedTemporalRange)
    start_time = start_datetime.addSecs(time_step*duration_s+1) # + 1 to avoid temporal overlap between the frames
    end_time = start_datetime.addSecs((time_step+1)*duration_s-1) # - 1 to avoid temporal overlap between the frames
    time_range = QgsDateTimeRange(start_time, end_time)
    result_layers[time_step].temporalProperties().setFixedTemporalRange(time_range)
    result_layers[time_step].temporalProperties().setIsActive(True)


texts: FeatureCollection (Error) Image.reduceRegions: Group input must come after weighted inputs

texts:
I was trying to find the area of each block by category in the band. There is one band and it has 18 categories. The feature collection is a collection of blocks described uniquely by code_2011.
var image1 = ee.Image ("image_name");
var andhra = ee.FeatureCollection("Feature_name");

var image2 = ee.Image.pixelArea().addBands(image1);

var result = image2.reduceRegions({
    collection: andhra.select(['2011_code']),
    reducer: ee.Reducer.sum().group({
    groupField: 0,
    groupName: 'code',
  }),
    scale: 50
  }).filter(ee.Filter.neq('sum', null)
  ).flatten();


texts: Eliminating interior lines of Polygon without Dissolve

texts: I am trying to find a way to create one polygon from separate polygons but I need to eliminate the interior lines without using the dissolve tool because I need to keep attribute fields. I tried using the autocomplete tool but that would take a very long time to go through every neighborhood in the city. Is there a way to create this outer boundary (tan polygon) from separate polygons (blue polygon) and eliminate the interior lines without the dissolve tool?


texts: Using if/else structure in Google Earth Engine

texts:
I wrote some simple code to test the if/else structure in GEE:

var flag = ee.Algorithms.IsEqual(1,5);
print(flag)
if (flag) {
 print("this is true");
} else {
 print("this is false");
}

the output was:

false;
this is true

Does anyone know how to adjust the above statement to be effective?


texts: Remove certain polygon from SpatialPolygonDataFrame

texts:
I am using R maptools library to parse the shapefile into a list of polygons. The function readShapeSpatial

shp <- readShapeSpatial("<path to my shapefile>")

gives me a SpatailPolygonDataFrame object. In my example, my SpatialPolygonsDataFrame has the following columns:

> names(shp)
[1] "AREA"       "PERIMETER"  "COMAREA_"   "COMAREA_ID" "AREA_NUMBE"
[6] "COMMUNITY"  "AREA_NUM_1" "SHAPE_AREA" "SHAPE_LEN

I know that I can remove certain polygons by their row.id, e.g.

shp.dropI  <- shp[-i, ]
shp.subset <- shp[i %in% c(1,2,3),]

Now I want to drop certain polygon(s) with a condition, say AREA > 10. How do I implement this elegantly? The only method I have now is to iterate through all rows and find corresponding row.id.


texts: What is a good world reference atlas with information for each country?

texts:
[I'm not sure if this is the right StackExchange site for this question, but it was the closest I could find to general geography.]

I love learning about the countries of the world, and my favorite book has been "World Reference Atlas: A-Z factfile and detailed mapping of all the world's nations," published by DK. It has 2-4 pages on each country in the world, with their map, history, and info about economy, population, etc. However, my version is the 1998 edition, and they haven't revised it since (I think). Is there a comparable book out there?


texts:
I am trying trying to build a web app using React. I have been using [this example][1].
I would like to have 2 maps aligned horizontally, Something that looks like [this way][2].
In the sandbox example, I am duplicating the line <Map center={mapCenter} /> in the index.js (line32, so line 32 and line 33 are now <Map center={mapCenter} />), then in the style.css I change the map's div width to 50%. .map { width: 100%; height: 100%; margin: 0px; }, but the result doesn't look like it is a 50% as the 2 map div are contained within 10% of my web page...I don't understand what is going on here.
Even with only one map, the 50% width is not displaying the map the way it should be.
I can't see what I am missing. Can anyone think of something?
[1]: https://codesandbox.io/s/jlxz359l9w?file=/src/index.js
[2]: https://developers.arcgis.com/javascript/latest/sample-code/views-synchronize/index.html


texts: Is this a safe way to enforce non overlapping polygons or can it cause data corruption?

texts:
In this answer and comments it is explained that it it possible to implement a non overlapping polygon constraint using exclude and a custom operator. This is using PostGIS and not the built in geometric types. I got the code below to run but am I making some horrible mistake that might lead to data corruption by doing this or is the code safe and correct?
CREATE OPERATOR &&&& (
    leftarg = postgis.geometry,
    rightarg = postgis.geometry,
    procedure = ST_Overlaps,
    commutator = &&&&
);

alter operator family gist_geometry_ops_2d using GIST add operator 100 &&&& (postgis.geometry,postgis.geometry);

create table Objects (
    id serial not null,
    geom postgis.geometry not null,
    an text not null,
    ac text not null,
    version integer not null,
    primary key (id,version),
    exclude using gist (ac with =,an with =,version with =,geom with &&&&)
);


texts: How to create a line with start and end points which are in another layer in QGIS?

texts:
In my map, there are lots of points in layer A. I want to make a line layer B and I want to make start & end points of lines snapping to points in layer A manually.

Can I use points of layer A as a coordinate attribute selection index for my line layer B?
Thank you.


texts: Does exist some plugin with it is possible to Splitting lines at a specified distance in Qgis?


texts: Reduce image collection to annual maximum in GEE

texts:
I want to control my NDVI trends with climate variables. Therefore I am using temperature, precipitation and soil moisture. But since my NDVI is in annual maximum I need to have the same format for the controlling. Therefore I try to calculate these annual max images for the climate bands. But when I then try to use these, the analysis is not working and giving me this error:
Error in map(ID=1): Element.getNumber: Unable to cast value to Number.
This is the code to calculate the annual max images.
//Calc annual max for TerraClimate for Temp, soil and prec
var annual_max_temp =  ee.ImageCollection(ee.List.sequence(1981, 2015).map(function (year){
  var date_start = ee.Date.fromYMD(year, 1, 1);
  var date_end = date_start.advance(1, "year");

  return(ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE')
        .select(['tmmx','soil', 'pr'])
        .filterDate(date_start, date_end)
          .max()
          .set({year: year, 'system:time_start':date_start})
          .set({year: year, 'system:time_end':date_end}));
}));

And here is the complete code:
https://code.earthengine.google.com/?scriptPath=users%2Fwelp1992%2FMaster%3ATemperature


texts: Interactive trigger for external image viewer?

texts:
Is it possible to navigate from point to point with a shortcut on the keyboard and interactively (tracking) display the embedded photos at the point locations in an external image viewer?

I could do so with the ACTION option, but I must navigate from point to point with the mouse pointer.

Is any tool available in QGIS or any python code capable of such thing?


texts: Applying colour ramp to DSM in ArcGIS using real elevation values as colour cut-offs?

texts:
I have a topo-bathymetric lidar DEM that I need to construct a CSR for in ArcGIS 10.3. I know how to make colour ramps and personalize them, but I'm wondering if it's possible to make a ramp based on certain elevation values.

I need everything from -20 m to 0 m elevation on the DEM (ie. the bathymetry) to be a colour ramp from dark blue (-20) to light blue (0 m), and then above 0 m (ie. the topography) to be a colour ramp from green through yellow to red. I need the blue to end at 0 m exactly. Any way to do this?


texts: Python - How to Get lat lon information from .asc file

texts:
I have a .asc climate data file at hand and want to explore it to extract some information.

Based on searching, some general read methods have been tried as, import it as python pandas or numpy structure to see its contents.

Here the result:

if read in using pandas:

df = pd.read_table(path + "\max1951_1.asc")
df
                  NCOLS   1068
0                 NROWS    510
1    XLLCORNER  -141.0000
2    YLLCORNER   41.00000
3    CELLSIZE   0.83333330E-01
4      NODATA_VALUE  -999.00
5                      -999.00
6                      -999.00

Using numpy:

ascii_grid = np.loadtxt(path + "\max1951_1.asc", skiprows=6)
ascii_grid
array([[-999., -999., -999., ..., -999., -999., -999.],
       [-999., -999., -999., ..., -999., -999., -999.],
       [-999., -999., -999., ..., -999., -999., -999.],
       ...,
       [-999., -999., -999., ..., -999., -999., -999.],
       [-999., -999., -999., ..., -999., -999., -999.],
       [-999., -999., -999., ..., -999., -999., -999.]])

I still doubt what is the best solution or packet working with this kind of ESRI ASCII Raster format, not sure if the above print already shows all the file's content or not. Besides, my question is, if I want to extract any specific gridded cell's lat and lon information, How can I do that?

if asc file naturally contain those information so I can simply use certain existed packet to extract that?
Or the only method is use coordinate to calculate and convert base on the  CELLSIZE and X,YLLCORNER.


texts: Geonetwork missing data for Service Contact, GetCapabilities CSW in Geonetwork 3.10.4

texts:
PROBLEM: A part of the "ServiceProvider" (Name, Position, Phone, Address, etc.) that is displayed in the GetCapabilities can not be completed from the Geonetwork administrator page.
Is it possible to make a request and update this data?
Is there any solution to add contact info iot set this part of data, and obtain it by such request http://localhost:8080/geonetwork/srv/eng/csw?request=GetCapabilities&service=CSW&acceptVersions=2.0.2&acceptFormats=application%2Fxml ?
According to instruction from:
https://geonetwork-opensource.org/manuals/trunk/en/administrator-guide/configuring-the-catalog/csw-configuration.html now I create some template via Admin console -> Metadata and template-> choose Geographic information -- Metadata (iso19139:2007) (iso19139)
Then in Contribute there are few templates, and of of them is Template for WMS service in ISO19139/119
Editing this I can edit Individual name, Provider name and e-mail howerwer there are still empty address, phone number etc.
According to instruction from:
https://geonetwork-opensource.org/manuals/trunk/en/administrator-guide/configuring-the-catalog/csw-configuration.html
I've to attached capabilities.xml file but I don't know where.
Any suggestions?


texts: Processing Model in a standalone PyQGIS script

texts:
I have the same problem as in
Why can't I use processing algorithms in a standalone PyQGIS script?

I know the question is not really up-to-date but does someone have an answer?

I've defined a Processing Model in QGIS 2.18 ('Las Palmas') and want to run it in a standalone PyQGIS-Script via command processing.runalg('modeler:[...]'). If I execute the script in the QGIS Python Console it works:

If I try to run the same code in a standalone script it fails with the message 'Algorithm not found'.

Can somebody help?


texts: Where are contained the coordinates in the TIGER data

texts:
I have downloaded a shapefile from:
https://www.census.gov/geo/maps-data/data/tiger-line.html

Specifically tl_2016_11001_edges for the District of Carolina, which has the following columns:

  [u'ARTPATH', u'COUNTYFP', u'DECKEDROAD', u'DIVROAD', u'EXTTYP', u'FEATCAT', u'FULLNAME', u'GCSEFLG', u'HYDROFLG', u'LFROMADD', u'LTOADD', u'MTFCC', u'OFFSETL', u'OFFSETR', u'OLFFLG', u'PASSFLG', u'PERSIST', u'RAILFLG', u'RFROMADD', u'ROADFLG', u'RTOADD', u'SMID', u'STATEFP', u'TFIDL', u'TFIDR', u'TLID', u'TNIDF', u'TNIDT', u'TTYP', u'ZIPL', u'ZIPR', 'geometry']

From that list, only the field geometry, which is a polygon, contains coordinates information. Does this mean that all the coordinates are estimated by the intersection of polygons? I see no lines nor single points with coordinates information.


texts: Is it possible to rotate the canvas in QGIS

texts:
Can the canvas be rotated so north is pointing in some other direction than defined by the projection? This question answers with respect to the composer, but not the canvas. There is a related 5 year old entry in the bug tracking database that's closed as unnecessary. Is that the current status, or is there a way to rotate the canvas in the newer versions?

Creating a new projection is really not the answer


texts: How to draw right arrow symbol in SLD for Geoserver?

texts:
I have the below part of SLD:

<sld:WellKnownName>ttf://Wingdings#0xE0</sld:WellKnownName>
<sld:Fill>
  <sld:CssParameter name="fill">#0000FF</sld:CssParameter>
  <sld:CssParameter name="fill-opacity">0.5</sld:CssParameter>
</sld:Fill>

But it does not work due to lack of Wingding fonts in host server. I am looking for alternative way of drawing right arrow. I tried below using HTML right arrow entity (→):

<sld:WellKnownName>&#x2192;</sld:WellKnownName>

But geoserver throws exception on that:
java.lang.IllegalArgumentException: The specified mark → was not found!


texts: Convert python from arcpy.da.SearchCursor to work in 10.0

texts:
I am using code such as

for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR):

# create inner buffer
polyBuff = row[0].buffer(buffNum * -1)

# create hull rectangle to establish a rotated area of interest
coordSplit = row[0].hullRectangle.split(' ')

# collect corner coordinates
coordList = arcpy.Array([arcpy.Point(coordSplit[0],coordSplit[1]),arcpy.Point(coordSplit[2],coordSplit[3]),arcpy.Point(coordSplit[4],coordSplit[5]),arcpy.Point(coordSplit[6],coordSplit[7]),arcpy.Point(coordSplit[0],coordSplit[1])])

# create lines from hull rectangle
currentLines = []
for pointNum in range(0,4):
    arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)])
    hullRecLine = arcpy.Polyline(arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)]))
    currentLines.append(hullRecLine)

# compare first and second line to determine if first line is short or long
firstLong = 0
if currentLines[0].length < currentLines[1].length:
    if shortboolean == 'true':
        firstLong = 0
    else:
        firstLong = 1
if currentLines[0].length > currentLines[1].length:
    if shortboolean == 'true':
        firstLong = 1
    else:
        firstLong = 0

# calculate number of points needed along short axis
numPoints = int(math.floor(currentLines[firstLong].length/lineSpaceNum))

# create and join points to create parallel lines

for point in range(0,numPoints+1):
    shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point)
    shortPoint2 = currentLines[firstLong + 2].positionAlongLine(currentLines[firstLong + 2].length - (lineSpaceNum*point))
    parallel = arcpy.Polyline(arcpy.Array([shortPoint1.centroid,shortPoint2.centroid]), SR)

    # intersect parallel lines with buffer
    parallelBuff = parallel.intersect(polyBuff,2)
    parallels.append(parallelBuff)

but this only works in ArcGIS 10.1 and newer. Is there a way to do the same thing but have it function in ArcGIS 10.0?


texts: Split geopandas DataFrame evenly by distance

texts:
Is it possible to split a geopandas DataFrame that contains LineStrings in evenly spaced segments?

I have a DataFrame loaded from a shapefile that contains the track of a railway. I want to project data on the track in a 100m resolution, but the LineStrings (per row in the DataFrame) from the original data are ugly spaced. So I want to "spatially resample".

I guess I have to start with union to make a MultiLine object with all LineStrings. And then split down along the track.


texts: Attribution for Bing maps in QGIS QuickMapServices?

texts: I've used a Bing map aerial in a report I'm writing for commercial services. I downloaded the Bing map aerial using the QuickMapServices plugin in QGIS. What attribution do I need to add to the map?


texts: Summarizing different (local) shapefiles/sources into one centralized database using ArcGIS for Desktop?

texts: Using ArcMap/ArcCatalog 10.2, is there a way, to summarize a huge number of widely spread shapefiles/sources (different servers, different hard drives etc.) into one centralized database, in order to be able to transfer this database as well as a corresponding mxd-file e.g. to a notebook or another computer without internet connection?


texts: Using QField in an Android emulator for Windows 10

texts: I would like to use the QField application in a free and user-friendly Android emulator for Windows 10. May you recommand one ?


texts: Inserting non-geographical .dwg files from AutoCAD to PostGIS database?

texts:
Here is the situation.

I'm a last year student in IT management. I'm realizing a web app that will import 2D .dwg files (building plans) into a database and make them visible through the web browsers.

In a second time, I'll add some tools to work with those plans.

To be clear, I know few about GIS and drawing tools. The .dwg files aren't mine. I've only followed a short tutorial of AutoCAD and GeoServer until now.

So I'm using:

BigSQL with:

PostgreSQL v 9.6
Postgis v 2.3.0
Pgadmin 4 v 1

Server:

GeoServer v 2.10.0

My questions are :

How should I import those .dwg files to my database (a PostgreSQL database with extension PostGIS) using GeoServer ?
And how can I get my data back and display it on a web page?

I've already converted the .dwg to a .shp + .shx + .dbf files (without .prj because of no lat/long properties I guess). And then... I'm stuck. I tried to do as in the tutorial of GeoServer: publishing a shapefile. But I can't visualize the layer I just created.

Any clue, or keys to help me?

I used PgShapeLoader to load my shapefiles into my database. Then I created a store on GeoServer from my newly created table. I published it and... It kind of works. I can see something with the data viewer of GeoServer. But it's still not my building plan. It appears to be only a little part of the plan which is repeated horizontally. I continue investigations and I'm still open to some help.

I discovered GDAL OGR and the command line tool ogr2ogr. It is exactly what I need. I can import dxf files directly in my PostGIS DB and use it in a PHP script. The command look like this :

ogr2ogr -f "PostgreSQL"
-nln _tableName_
PG:"host=_localhost_ port=_5432_ dbname=_mydb_ user=_me_ password=_mypassword_"
_source file path_

Fill in the options according to your configuration.
Make sure to settle correctly the PATH environment variable to use ogr2ogr.

There is other useful options like -append -overwrite -a_srs and -t_srs. ogr2ogr doc

I have others problems now.

I don't really understand the type of layer I need. The type of geometry... I have line as well as polygon and text etc. in my dxf file.

When I publish a layer with GeoServer, in the layer settings, the style is "generic". When I want to preview it with OpenLayers, it opens a dialog box that asks me to download a WMS file which looks to be an exception report.

I can change the layer style to "line" so that the layer can be previewed. But there is a bunch of things that are not displayed (text, color, linetype...).

There is another BIG problem.

GeoServer display one presentation space of my AutoCAD file (which one? Looks like it's the one I was in when I saved the file ???). There are elements specific to the presentation space and windows to the object space.

They have different scales. The preview display only the element specific to the presentation space (or the scale make that I can't see anything else).

I'm sure nobody understand what I write but it's very weird. Summary: problem with the layer's geometry type and scale.


texts: Replacement of QVariant and setAttributeMap in PyQGIS

texts:
I am updating a plugin for QGIS 1.8 to QGIS 2.x. I have the code below.

The setAttributeMap does not exist anymore. I have replaced it with fet.setAttributes and it seems to work.
When using  fet.setAttributes({0:QVariant(fid}), I get the error:

PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated.

I have tried to just remove the QVariant() and used fet.setAttributes({0:fid}), but then I get the error:

TypeError: QgsFeature.setAttributes(list-of-attributes): argument 1 has unexpected type 'dict'

The code worked well with 1.8, so what can I do to replace QVariant or setAttributeMap? I think it could be something with changing setAttributeMap to setAttributes

vl = QgsVectorLayer("MultiLineString", layerName, "memory")
pr = vl.dataProvider()
vl.startEditing()
pr.addAttributes([QgsField("id", QVariant.Int)])
fet = QgsFeature()
addRange = northRange * math.tan(abs(math.radians(bearing)))
noPoints = ((eastRange + addRange) / projEast) + 1
for i in range(0,int(math.ceil(noPoints)), 1):
    fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))
    fet.setAttributeMap({0:QVariant(fid)})
    pr.addFeatures( [ fet ] )
    fid = fid + 1
vl.commitChanges()
QgsMapLayerRegistry.instance().addMapLayer(vl)

I have change my code to:

vl = QgsVectorLayer("MultiLineString", layerName, "memory")
pr = vl.dataProvider()
vl.startEditing()
pr.addAttributes([QgsField("id", QVariant.Int)])
fet = QgsFeature()
fields = vl.pendingFields()
fet.setFields( fields, True )
addRange = northRange * math.tan(abs(math.radians(bearing)))
noPoints = ((eastRange + addRange) / projEast) + 1
for i in range(0,int(math.ceil(noPoints)), 1):
    fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))
    fet['id'] = fid
    pr.addFeatures( [ fet ] )
    fid = fid + 1
vl.commitChanges()
QgsMapLayerRegistry.instance().addMapLayer(vl)

but I still need to make an attribute named 'id' I guess before it works. If I use the setAttributes function it includes a QVariant which I am not allowed to do!

Or is it me who does not understand.

This is the final code, and it is working:

vl = QgsVectorLayer("MultiLineString", layerName, "memory")
vl.startEditing()
vl.addAttribute(QgsField("id", QVariant.Int))
fet = QgsFeature()
fields = vl.pendingFields()
fet.setFields( fields, True )
addRange = northRange * math.tan(abs(math.radians(bearing)))
noPoints = ((eastRange + addRange) / projEast) + 1
for i in range(0,int(math.ceil(noPoints)), 1):
    fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))
    fet['id'] = fid
    vl.addFeatures( [ fet ] )
    fid = fid + 1
vl.commitChanges()
QgsMapLayerRegistry.instance().addMapLayer(vl)


texts:
I want to create circles of diameter 20m in QGIS. I create a point and then use vector - geoprocessing tools - fixed distance buffer. My problem is that the size is crazy and worse, the shape is not a circle. My map units are metres and when I use a distance of 0.001 I get an oval 220 m high in north-south direction and 140 m wide in east-west direction.

I am using OSGB 1936 / British National Grid EPSG:27700. I have tried switching to another reference system and back again since in other cases this seems to make QGIS pay attention, but it has not helped in this case.


texts: Invalid Username When Developing a QGIS Plugin on Mac

texts:
On a fresh Mac OSX 10.8 install, I've installed Quantum GIS from Kingchaos binaries and it's running fine. I'm trying to develop a plugin for QGIS using Plugin Builder. The skel that Plugin Builder produces should work off-the-shelf, but it does not compile using the makefile. Somewhere python can't find (pyuic.py), and it searches for the /Users/kyngchaos/... path. This user does not exist on my system:(

Here are my ENVS on .profile:

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python
export DYLD_LIBRARY_PATH="/Applications/QGIS.app/Contents/MacOS/lib:/Applications/Qgis.app/Contents/Frameworks"
export PATH="/Applications/QGIS.app/Contents/MacOS/bin:$PATH"

Here is the ouptput of make:

Arthur@teste:make
pyuic4 -o ui_teste.py ui_teste.ui
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/kyngchaos/Applications/qgis-python27/Applications/QGIS.app/Contents/MacOS/../Resources/python/PyQt4/uic/pyuic.py': [Errno 2] No such file or directory
make: *** [ui_teste.py] Error 2

Thanks for reading.


texts:
If I get the coordinates of a polygon in qgis by

x = geom.asPolygon()

It rounds off the coordinate from i.e.

-27,200,334.86

to

-2.72003e+07

How can I avoid that?


texts: Matching point data with non-traditional coordinate system to shapefile with coordinate system?

texts:
I'm working with in-situ data collected from several field sites that must be converted into points that lie within a separate layer of polygons. These polygons are the boundaries of the different study areas, in which the points, representing trees, must go. I've successfully converted the in-situ data to points, but I'm having a lot of trouble making those points fall within the necessary polygons.

The issue is that the point data does not have a traditional coordinate system. We based our coordinate measurements off of a 30x30m plot, and the points correlate to a 30x30m grid. As a result, even if I ensure that the coordinate system matches, the points are very spread out in ArcMap - to the point where I can't drag and drop them to the correct spot on the polygons because they're impossible to find unless I zoom to the layer.

Is there a way for me to define a lat/long extent for the point layer that matches the lat/long extent for the polygons so that I can make the points within the boundary of their respective polygons?

I'm relatively new to ArcGIS.


texts: Spatialite 4.3 err: no such function: gpkgAddGeomtryColumn

texts:
I'm opening a GeoPackage made by QGIS 2.18.17 then closing it and opening it with:

spatialite_gui (spatialite lib loaded:4.3.0a)
DB Browser (SELECT load_extension('mod_spatialite');)

Spatialite libs 4.3.0 are loaded. (I made a SELECT spatialite_version())

Creating my own table is OK but when I want to append a geometry column, the command fails with the sentence:

no such function: gpkgAddGeomtryColumn:"SELECT gpkgAddGeomtryColumn('test','geom' ,'MULTIPOLYGON' ,1 ,0 ,3163);"

This function is listed in here in the section SQL functions implementing OGC GeoPackage compatibility

Does somebody knows why this function is not found?


texts: Creating set of equally spaced points along line using QChainage and exporting these as latitude and longitude coordinates in degrees?

texts:
In QGIS 2.2.0, how do I create a set of equally spaced points along a line using QChainage and export these as latitude and longitude coordinates in degrees? I am using the QChainage function in QGIS, but it is generating the following error:

An error has occured while executing Python code:

Traceback (most recent call last):
File "/Users/shafiquejamal/.qgis2/python/plugins/qchainage/qchainagedialog.py", line 126, in accept
selectedOnly)
File "/Users/shafiquejamal/.qgis2/python/plugins/qchainage/chainagetool.py", line 92, in points_along_line
features = create_points_at(startpoint, endpoint, distance, geom)
File "/Users/shafiquejamal/.qgis2/python/plugins/qchainage/chainagetool.py", line 43, in create_points_at
feature.setGeometry(point)
TypeError: QgsFeature.setGeometry(QgsGeometry): argument 1 has unexpected type 'NoneType'

I have consulted the following posts, but was unable to solve this issue:

Creating points along lines using QGIS?
How can I represent distance using the dashes or markers of a vector line?

This post directs me to QChainage, which I am trying to use.

http://nathanw.net/2012/08/05/generating-chainage-distance-nodes-in-qgis/

I don't know how to implement this solution; I tried to run the python code but it just produced a blank Canvas. It may be because I failed to select the lines, which I thought is done by making the layer with the line active.

Creating equidistant points in QGIS?

Again, I'm not sure how to implement the code in the above post.

Creating points in specified distance along line using QGIS？

This recommends Densify, which doesn't seem relevant to what I want to do. SEXTANTE is deprecated, and not available as a plugin in QGIS 2.2.0 (I think its functions are built in to QGIS 2.2.0).

http://wiki.tuflow.com/index.php?title=QGIS_Convert_Lines_to_Points

The MMQGIS option can do something similar, but it only gets the nodes; it does not produce equally spaced points.

I know this question has been asked and answered in other posts (most or all of which I think are listed above). The difference with my question is that I am getting this strange error when I try to use QChainage. I was able to use QChainage before and it worked, but now I am using it on layers that I generated by adding a buffer to a line, converting the buffer polygon to a line, and then removing parts of the line (see here: How do I plot a line on a map, or obtain the latitude and longitude coordinates of such a line, that is 120km north of the US-Canada border?). If you look at the line in the image below, you can see that the line is broken (it is several lines). Maybe this is the problem?

I am pasting below a picture of what the line looked like after I added a buffer and converted the polygons to lines, but before deleting parts of the line:

Here is a zoomed in view of the line, showing that it comprises line segments:


texts:
I want to create a flow map in QGIS.

I have a list of cities and I have to show how many people travel from one city to another. For example, 5 people traveled from Vantaa to Helsinki, 10 people traveled from Tampere to Helsinki, 50 people traveled from Joensuu to Helsinki etc,.
The flow strength (number of people) should be shown with different thickness lines, where 5 is the thinnest and 50 is the fattest.


texts: Refreshing VRT raster layer using PyQGIS

texts:
I'm working a lot with GDAL VRT raster layers in QGIS 3.14, often changing the file content while viewing the rasters in map canvas. When I zoom or refresh the canvas in QGIS 2.18, all modified VRT raster layers are refreshed as well. In QGIS 3.14 it looks like VRT layers are cached. I can refresh the virtual raster layers only with the help of the indispensible "changeDataSource" plugin.
What do I need to refresh a VRT layer with Python?


texts: How to add a legend for raster (GRID) layers in ESRI JS app

texts:
I have a grid in an MXD that I am publishing using ArcGIS Server 9.3.1.

In the TOC I have made a legend with labels against each of my 5 classifications.  I was expecting this to appear in my JS web app - but they never render.  Does anyone know how to make a raster legend to work with the ESRI JS API.

The code I am using is direct from the example pages - and it shows a legend for the basemap so I know the code is working to a certain extent:

//add the legend
        dojo.connect(map,'onLayersAddResult',function(results){
          var layerInfo = dojo.map(results, function(layer,index){
            return {layer:layer.layer,title:layer.layer.name};
          });
          if(layerInfo.length > 0){
            var legendDijit = new esri.dijit.Legend({
              map:map,
              layerInfos:layerInfo
            },"legendDiv");
            legendDijit.startup();
          }
        });

UPDATE - Begining to think that this is only available at v10.x.....


texts: How to use QGIS plugins functionality in standalone application

texts:
I'm new to QGIS 3 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour plugin and so on by:

creating a dll library by rewriting the python code to c++ after obtaining the plugins source code from github(with credits of course, will have to study Python since am more of c++ developer)
writing a wrapper around the code

If anyone have done one of the above please tell me which one is better and where to start.

Sorry for my poor English, as it's my second language.


texts: PyQGIS - ImportError when reloading Plugin

texts:
In QGIS 3.4, I created a plugin through Plugin Builder 3 and always reload it with Plugin Reloader when I make any changes.

When I reload my plugin I get the error:

  File: ".../python/plugins\myplugin\ _init__.py"line 17, in
                from .myplugin import MyModel
   ImportError: attempted relative import with no known parent package.

But, if i close QGIS 3.4 and reopen it, the plugin works perfectly with the changes made.

The plugin has no subfolders and is in this setup:

  myplugin
    ├── _init__.py
    ├── myplugin.py
    ├── myplugin_algorithm.py
    └── myplugin_provider.py

I would like to find a way to reload the plugin without restarting QGIS.


texts:
I've created a custom map from Adobe Illustrator vector (which has been saved for web in *.png and then converted to GeoTIFF via GDAL; then I've uploaded it to MapBox Studio webapp and created style with resulted tileset).

One problem in the end - tiles colors. For example (resulted .jpg from MapBox - on the left, source .png - one the right):

What do I need to do to get better quality of result tiles?

Is there any way to use vector tiles (the source is .ai file)?


texts: Append feature layer from one personal geodatabase to another using .Net

texts:
I currently have a client that still uses personal geodatabases (Access files). I currently have to open up ArcCatalog and manually append any FeatureLayers that are contained in the original personal geodatabase to the newly created one.

I now need a non ArcObjects/ArcView way of doing this. The FileGeodatabase API does not support personal geodatabases (as far as I know). You cannot use a common OleDb connection to the personal geodatabase and transfer the feature layer tables correctly (must use the ArcObjects OleDB provider which requires ArcObjects).

The above are the only things I have tried. Is there a way to transfer these personal geodatabase feature layers from one geodatabase to another, without a license for ArcView or ArcObjects? I am open for using the filegeodatabase api if there is a hackish way to do it, but I can't find one.

I prefer a .Net solution, but would be able to create a wrapper for a C++ one.

Update

I am currently looking at the GDAL OGR drivers to see if it is possible to use them and accomplish what I am trying to do. Has anyone used them to access personal geodatabases?


texts: ArcGIS Portal homepage altered without HTML change

texts:
After changing the region in REST services the carousel of images has stopped rotating, the white banner at the top has disappeared and icons at the bottom have shifted.  It seems like a page size setting for the homepage code has changed when the region changed.

I pasted the original backed up HTML back into the org setting and it did not have any effect.

Is this a JavaScript problem?


texts: How to overlay kml (polygon) on Google Maps?

texts:
how to overlay my kml(polygon) on google map? features of polygon are required to display different color according to values of one specific column in the attribute table,my kml will update everyday(everything is the same except values in the specific column are different), and user can query the column value of a specific date. I attempted to accomplish this using  fusion table but it failed because it need keys, for example, I upload the kml of 2014.9,4 and  2014.9.5, if i add a time picker control in my page, it cannot show different result of the two days because you need to know the keys. I am thinking if i could use kmllayer to accomplish this project. but i don't know how to specify the color according to the value and how to add a lengend to the map like this

this function can easily realized in fusion table. how can i do it using kmllayer?
the difficulties i meet in this project is :

where to upload my kml file? can i use java tomcat server as the kml container?
how can i query the column value of a specific date in kmllayer?
how to rendering kml layer like this (), layered cl


texts: Error in create list of the images new names

texts:
I have code that calculates NDVI and then give each image name based on the date.I want to create list after that that will contain the names-dates of each image, but I keep getting the following error message:

  timeStartsNDVI.size is not a function

it's important to mention that the code works and it display my images with th e new names but doesn't create the list I want.

This is the relevant code part:

var timeStartsNDVI =filterNDVI
  .distinct('system:time_start')
  .limit(23) // Take the first 5 images
  .aggregate_array('system:time_start');

timeStartsNDVI.evaluate(function (timeStarts, error) {
  //if (error) print('Error: ' + error);
  try {
    timeStarts.forEach(function (timeStart, i) {
      var image = filterNDVI
        .filterMetadata('system:time_start', 'equals', timeStart)
        .first();
      var toexport=image.visualize(NDVIcolor).addBands(image);
      Map.addLayer(image, NDVIcolor, new Date(timeStart).toISOString());
      //Export.image.toDrive({
        //image: toexport.toFloat(),
        //description: 'NDVI' + i,
        //scale:20,
        //crs:'EPSG:4326',
        //maxPixels:1310361348,
         // You didn't include the geometry in the script you shared.
         // I assumed it was an ee.Geometry() - if so, geometry.geometry().bounds() wouldn't work
        // region:geometry.geometry().bounds()
        //region:geometry.bounds()
      //});
    });
  } catch(e) {
    print('Error: ' + e);
  }
});

//HERE I GET THE ERROR
var list=timeStartsNDVI.size();

print(list);

I have read about this error but I ca't understand why GEE will nto understand this.

This is my full code:
https://code.earthengine.google.com/940fb97af1cd8a092e5a6e3448470d83

My end goal: to have list variable with al the images and their name (which is the date)

Edit: this is what I get when I print "timeStartsNDVI":


texts: AlterField_management not changing Field Name?

texts:
I am trying to change field name of shapefile using AlterField (Management) tool for multiple feature class and multiple field name (same in all fc)

import arcpy
from arcpy import env
env.workspace = r"C:\Users\To Fix.gdb"

for fc in arcpy.ListFeatureClasses("*"):
    try:
        arcpy.AlterField_management(fc, "Column_Lab","201701E","")
        arcpy.AlterField_management(fc, "_1","201701G","")
        arcpy.AlterField_management(fc, "_12","201702E","")
        arcpy.AlterField_management(fc, "_123","201702G","")
        arcpy.AlterField_management(fc, "_1234","201703E","")
        arcpy.AlterField_management(fc, "_12345","201703G","")
    except:
        pass

Nothing happens when I run the script. However when I use

arcpy.AlterField_management(fc, "Column_Lab","","201701E")

It changes the alias successfuly.

Using ArcGIS 10.2 Advance

Code adopted from
https://community.esri.com/thread/104033


texts:
I have approximately 1 million polygons that have been split by lines. However, this has caused one half of a polygon to be separated by approximately 50cm from its other half.

After doing a lot of attempts using a variety of methods I still have not come up with a reliable solution.

I would like to end up with individual features which have had the closest polygons merged together to create one feature. It probably needs to be based on a tolerance or buffer.

1) Using Union and SnapToGrid as explained by Paul Ramsey in another question
(Joining lots of small polygons to form larger polygon using PostGIS?)

 CREATE TABLE merged AS
 SELECT ST_Union(ST_SnapToGrid(the_geom,0.0001))
 FROM parishes
 GROUP BY county_name;

This did a great job of doing a union on the parts of each polygon, however, I was left with just one feature. So my 1 million polygons and been merged into a MultiPart. Is there a way to stop this from happening?

2) Using Topology
I then wondered if I might be able to use topology within PostGIS 2.0. I found this very difficult to implement as there are very few examples.

 -- Create a topology
SELECT CreateTopology('new_topology', 27700, 'geom'));

-- Add a layer
SELECT AddTopoGeometryColumn('new_topology', 'public', 'original_polygons', 'topogeom', 'MULTIPOLYGON');

This creates the edges and faces but how should I now use this to create a new polygon layer?

3) ST_Snap - it seems this will snap a geometry to another geometry. I could not get this to work as I was trying to snap to the same geometry. This may work though as I could snap the points on one side of the polygon to its matching set and then dissolve.

Are there any other options or advice on how to achieve what I am after?