texts: Using Attribute Assistant to update field when value in another layer is updated?

texts:
I have been searching for an AA method that can update our CP system status field to "UP" in our gas main layer whenever a control point test location is created or modified on that gas main feature. The conditions would be that the control point would have to be created on the gas main, then populated with a control number from the gas main (this is done by the intersecting feature AA method). However, I am unable to find a way to change our CP system status field to "UP" in the gas main layer when said control point is created and populated with a control number.

So, I turned to the expression method in AA to try and accomplish this. I am decent at python expressions but have little experience writing VB expressions (required for this AA method) that could achieve such automation. Does anyone know a good VB expression that could update my CP system status field to "UP" when a control point is created and attributes modified? This would most likely be a conditional statement.


texts:
I am trying to run a simple createReplica on my feature service in arcpy or outside. Once it's complete I get a message showing the output location, however the output is blank and/or does not provide an output (i.e. FC in gdb or zipfile) like what is done by invoking
 https://services.arcgis.com/myservicelayer/ArcGIS/rest/services/service_1eb/FeatureServer/createReplica

Any idea's on how I can result something substantial? Overall goal is to retrieve attachments from AGOL feature service layer and drop into fgdb in my local directory. I would like to keep this a simple as possible, so pls no suggestions for python API, arcrest or restapi as I am new to python.

env.workspace = "S:/General-Offices-GO-02/CAD/GIS/Projects/AGOL2"

# Set local variables
in_data = "https://services1.arcgis.com/something/arcgis/rest/services/myservice/FeatureServer/createReplica"
replica_type = "ONE_WAY_REPLICA"
output_workspace = "C:/Temp/mygdb.gdb"
replica_name = "myRepName1"
access_type = "FULL"
initial_sender = "PARENT_DATA_SENDER"
expand = "USE_DEFAULTS"
reuse_schema = "DO_NOT_REUSE"
get_related = "GET_RELATED"
replica_geometry = "Form_1"
archiving = "DO_NOT_USE_ARCHIVING"

# Execute CreateReplica
arcpy.CreateReplica_management(in_data, replica_type, output_workspace, replica_name, access_type, initial_sender, expand, reuse_schema, get_related, replica_geometry, archiving)


texts: Orthophotoplan cannot be viewed in openlayers due to HTTPS

texts:
I have the following problem on the server:
I have a server configured on HTTPS for apache and a TOMCAT that keeps GeoServer configured HTTP and when I try to bring images from GeoServer to OpenLayers then I get error:

GET
https://terra-apps.com:10000/geoserver/ADMINISTRATIE/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&tiled=true&STYLES=&LAYERS=ADMINISTRATIE%3AORTO_GALBEANU&exceptions=application%2Fvnd.ogc.se_inimage&tilesOrigin=116269.96399989683%2C215882.49741375772&SRS=EPSG%3A3857&FORMAT_OPTIONS=dpi%3A124&WIDTH=2595&HEIGHT=1238&BBOX=3007984.681182022%2C5646695.129897605%2C3044049.060891119%2C5663900.410082522
net::ERR_SSL_PROTOCOL_ERROR

Here is the code I'm trying with:
new ol.layer.Group({
    'title': '> ORTOFOTOPLAN COMUNA/UAT',
    'layers': [

        new ol.layer.Image({
            // A layer must have a title to appear in the layerswitcher
            title: 'ORTO test',
            // Again set this layer as a base layer
            type: 'base',
            visible: false,
            source: new ol.source.ImageWMS({
                  url: 'http://terra-apps.com:10000/geoserver/ADMINISTRATIE/wms',
                  params: {'FORMAT': 'image/png',
                           'VERSION': '1.1.1',
                           tiled: true,
                        "STYLES": '',
                        "LAYERS": 'ADMINISTRATIE:ORTO_GALBEANU',
                        "exceptions": 'application/vnd.ogc.se_inimage',
                     tilesOrigin: 116269.96399989683 + "," + 215882.49741375772
                  },
                  serverType: 'geoserver'
            }),
        }),

       ]
    }),

I specify that the same code, the same procedure on localhost on my computer works perfectly :(
I am very beginner to configure a tomcat server to have ssl and I have not managed this other solutions if possible?


texts: Adding old FID to new feature class using ArcMap?

texts:
I have been tasked to relocate some assets, about 1000 preexisting point and line feature classes.  I will be collecting the correct GPS coordinates to realign all the assets but I'm not sure how to link the new coordinates to the old feature class FID.

I am new to GIS and I'm using ArcMap 10.6.


texts:
I need to add a WMTS to a mapping application that uses mapbox-webgl (this is a React App using react-map-gl).  There is no support for WMTS in mapbox-webgl but it seems like I should be able to do the math in the client to convert the map coordinates to a corresponding tile.

I can get the service GetCapabilities via fetch and have the map coordinates and zoom available via viewport.

Assuming I fetch the GetCapabilities on componentDidMount and set them to state.  How do I convert the map zoom and coordinates to a corresponding tileMatrix, Rox, and Column?

let zoom = this.state.viewport.zoom
let lat = this.state.viewport.latitude
let lon = this.state.viewport.longitude
let getCapabilities =  this.state.getCapabilities


texts: Getting only polygon boundaries from latitude and longitude

texts:
Problem Statement:

I am working on the project where machines are sending huge amount of lat/long data. Now I am drawing multiple days data on a map, it takes too much time to draw complete data on the map.
We are saving data in Influxdb.

My Propose Solution

My solution is to only draw empty polygons on the map. I want to calculate/get  boundaries of an area with latitude and longitude. I will save those boundaries lat/long in a separate table for fast rendering on the map. I will use those boundaries data to draw the polygon in google map.

Question

How to get red marked boundary of area, which is mentioned in below image. I would prefer a backend library so that my service can calculate these boundaries and save in Influxdb.


texts: Error and kernel dies with shapely/geos inside Jupyter notebook

texts:
I have a Python 2.7 script (code below) that scrapes data from a table on the web and draws a map. It runs fine from the command line using

$ python bears.py

When I run the identical script from inside a Jupyter notebook, the kernel dies (and apparently restarts) and I get this error:

ERROR:shapely.geos:Geometry must be a Point or LineString
ERROR:shapely.geos:Geometry must be a Point or LineString

I am on a MacBook Pro using OS X 10.9.5. My Python environment is the free Anaconda distribution.

I am new to cartopy/shapely/geos.

Script:

import re

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

import cartopy.crs as ccrs
import cartopy.io.shapereader as shpreader

import requests
from bs4 import BeautifulSoup, Tag

# scrape bear sightings data
BEAR_SIGHTINGS_URL = 'http://www.depdata.ct.gov/wildlife/sighting/bearsight.asp'
r = requests.get(BEAR_SIGHTINGS_URL)
soup = BeautifulSoup(r.content, "html.parser")

# extract time period covered by the bear sightings
date = '\d{1,2}/\d{1,2}/\d{4}'
pattern = date + ' to ' + date
result = re.search(pattern, str(soup))

# create dict of all 169 towns in Conn.
towns = {}
with open("towns.d") as t:
    for line in t:
        key = line.strip()
        towns[key] = 0

# extract sightings data and enter in towns dict.
# towns without any sightings are not listed on the state web page
# help from: stackoverflow.com/questions/16982253/
#     beautifulsoup-return-next-sibling-after-using-findalltext
bear_sightings = {}
for t in soup.find_all(width="75%", valign="middle", align="left"):
    twn = t.find('font').string.strip()
    for item in t.next_siblings:
        if isinstance(item, Tag):
            num = item.find('font').string.strip()
            towns[twn] = int(num)

# draw the map and colorbar
fig = plt.figure(figsize=(6, 6))
ax1 = fig.add_axes([0, 0, 1, 1], frameon=False, projection=ccrs.Mercator())
ax1.set_extent([-74, -71.5, 40.5, 42.25], ccrs.Geodetic())
ax1.outline_patch.set_visible(False)

ax2 = fig.add_axes([0.4, 0.33, 0.45, 0.03])

cmap = plt.cm.RdYlBu_r
bounds = np.linspace(0, 500, 11)
norm = mpl.colors.BoundaryNorm(bounds, cmap.N)

shape_file_name = 'townct_37800_0000_1984_s24_ctdep_1_shp/WGS84/townct_37800_0000_1984_s24_ctdep_1_shp_wgs84.shp'
towns_shp = shpreader.Reader(shape_file_name)
for this_town in towns_shp.records():
    raw_face_color = towns[this_town.attributes['TOWN']]
    ax1.add_geometries(this_town.geometry,
                       ccrs.PlateCarree(),
                       facecolor=cmap(raw_face_color))

cb = mpl.colorbar.ColorbarBase(ax2,
                               cmap=cmap,
                               norm=norm,
                               ticks=bounds,
                               spacing='uniform',
                               orientation='horizontal')
cb.set_label('Number of bear sightings')
cb.ax.tick_params(labelsize=7)

sup_title_string = 'test2 Black bear sightings in Connecticut\n %s' % result.group()
fig.suptitle(sup_title_string,fontsize=18)

#plt.show()
plt.savefig('bears.png', dpi=fig.dpi)


texts: Incorrect range for mosaic returned by calculate statistics

texts: Hoping someone can catch an error here-- I'm working towards a time anaimation of rasters contained in a mosaic. Most of the animation is blank however because most of the rasters contained are outside of the range of values given by calculate statistics. I have double-checked that the rasters really do have values outside of the range given, which should go inbetween 3100 - 6663 (see excel sheets). Instead I get a much smaller range--e.g. 3164 - 3269. One excel sheet highlights 20 consecutive rasters which show this smaller range as their max/mins. One thing I considered is the possibly that having Maximum Number of Items Downloadeable per Request = 20 (as seen in the mosaic properties) limits the number of rasters that are used in calculate statistics, however if I literally change this from 20 to 10,000 in the same window, I get the same smaller range. Any ideas?


texts: How to make QGIS place markers at greater distances evenly?

texts:
I am trying to get waterlines visualized with arrow lines, but when zoomed out I can't get them to be spacious enough.

So as you can see on the markerline settings, i set 100 pixels as an interval, but there are awkward clusters and even if i set it to 1000, they will not get more spacious (red dots).

I have the layer in edit mode so you can also see the vertex density (the red Xs).

Any ideas how to make the interval regular and more spacious?


texts: ArcGIS query specific character(s) in specific part of a field

texts:
Using ArcGIS 10.2.2, I have a string field in an SDE attribute table.  I need help creating a query to select all records that have a zero in the 6th and 7th character of the field (i.e 1995-0023A).  To help me better understand this type of query, I would also like to be able to see a query that selects records with a zero in just the 6th character of the field.  I can then use the "and" clause and duplicate it to select the 7th character as well.

I've tried variations of  "FIELD1" LIKE '%00_______' but it doesn't select records with the double zeroes in the correct place in the string.


texts: Yen's or Eppstein for path with intermediate destinations which are dangling nodes

texts:
I'm trying to find a shortest path algorithm (which does not need to be optimal) for a path with intermediate destinations. Consider the following case: One wants to go from A to Z and in between wants to visit B and C. For both, B and C, there are multilocal options,b1 and b2, and c1 and c2. Just to make it more practical, I want to go from my place (A) to a friends place (Z), but on my way I want to visit a supermarket (B), of which there are two in the area (b1 and b2), and I want to go to a pharmacy, of which there are also two in the area (c1 and c2). The order of whether I first visit the supermarket or the pharmacy does not matter, but I favor the shortest path to my friend. Accordingly, I need the shortest path from A to Z with an (close to) optimal ordering of the intermediate destinations B and C. I hope this is understandable.

Now, I first thought I may first calculate all shortest paths between a certain option of an intermediate destination (let's consider here b1) and the start node (A), the destination node (Z) and the nodes of the options of the other intermediate destination (c1 and c2). Accordingly I would calcuate a shortest path (e.g. with Dijkstra) between:

b1 - A

b1 - Z

b1 - c1

b1 - c2

The algorithm would do this also for b2, c1, and c2, would order it then and select the shortest path which would include one option of B and one of C. However, with increasing options and as such an increasing network the peformance would be low.
Therefore I thought to use the Yen's algorithm. This would lengthen the path between A and Z artificially, and I would include an iteration restriction (e.g. after calculating 100 paths, stop), then ordering the paths according to some priority. Accordingly, it should give out one shortest path between A and Z which would include at least one option (node) for B and one for C.
However, here find a challenge to use it for my network. Have a look at the first image.
The red nodes are dangling nodes, but these nodes are also options for intermediate destinations. When I understand the Yen's correctly, dangling edges would cause the algorithm to stop iterating before it achieves the destination, and as such,no path would include intermediate destinations which are within a dangling branch. Instead of stop iterating, the algorithm would need to go the danling branch backwards and iterate further until it reaches node Z. Have a look at the arrows of the second image , which show which path it would need to calculate. .
Those 'dead branches' need to be gone forwars AND backwards and, in the end, included in the path. Is this named to be a 'loop'?
I hadn't had a look at Eppstein yet, but I think it includes the possibility of having also loops in the path. But... is this a loop??
If someone out there has experience with Yen's or Eppstein I would be glad to hear his/her opinion on this case!
I also thought about merging the information of the nodes within the dead branch to the closest inbound node, or generate a new node on the closest, relevant edge. For example, in the first image, this would result in that the node a would get the information from node b, and the node c would get the information from the nodes d and e. However, I find this semioptimal as in some cases imprecise (example of such a case would be node e, as it is in a little distance from c).


texts: Raster time series smoothing package using R

texts:
Does somebody knows if exist a package in R specifically for raster time series smoothing?

I´m using aproachs like this one (using the equation suggested by Hamunyella et al., 2013)

for (i in 2:(length(stacklist)-1)){
r <-  raster(stacklist[i])
r1 <- raster(stacklist[i-1])
r3 <- raster(stacklist[i+1])
r2<-mean(r1,r3)
r[((r-r1)<(-0.01*r1)) & ((r-r3)<(-0.01*r3))]<-r2[((r-r1)<(-0.01*r1)) & ((r-r3)<(-0.01*r3))]
writeRaster(r,filename=paste(substr(stacklist[i], p1+1, (p1+7)),"_cropmLname.tif",sep=""),format="GTiff",overwrite=TRUE)
}

It is fast, But there is not any easiest way? For example for implement another kind of filter, like Savitzky-Golay, Double-Logistic filtering?


texts: QField - switch between multiple layer styles

texts:
In QField (1.4.4) demo project - Advanced Bee Farming Demo - there is an option to switch between layer styles (Diseases, Heatmap, Species). How to set up a project in QGis to enable this function in custom project?

Creating multiple styles per layer is not enough.


texts:
I have been working in this code but I am getting the following error:

Traceback (most recent call last): File "", line 1, in File "c:/users/miguel~1/appdata/local/temp/tmpdsyhqn.py", line 17, in processing.load(reproj["G:\pyQGIS\MIRAR EN MI ORDENADOR\nuevo.asc"]) KeyError: 'G:\pyQGIS\MIRAR EN MI ORDENADOR\nuevo.asc'

In QGIS, this error is printed with "\"in every path, even if I only write "\" in my paths of the code.

import processing
from processing.core.Processing import Processing
from qgis.core import *
from qgis.gui import *

#Processing.initialize()
#Processing.updateAlgsList()

raster = QgsRasterLayer("G:\\pyQGIS\MIRAR EN MI ORDENADOR\\MDT05-0559-H30-LIDAR.asc","MDT05")
print rasterLyr.isValid()
crs = QgsCoordinateReferenceSystem(25830, QgsCoordinateReferenceSystem.EpsgCrsId)
raster.setCrs(crs)
QgsMapLayerRegistry.instance().addMapLayers([rasterLyr])

#25830
reproj = processing.runalg("gdalogr:warpreproject", raster, "EPSG: 25830", "EPSG:4326", '0', 0, 0, 0, 0, 2, 1, 1, False, 1, False, "extraParam", "G:\\pyQGIS\\MIRAR EN MI ORDENADOR\\nuevo.asc")
processing.load(reproj["G:\\pyQGIS\\MIRAR EN MI ORDENADOR\\nuevo.asc"])

Can you tell me the code: print(repr(reproj)) which makes the following output?

{'OUTPUT': 'G:\\pyQGIS\\MIRAR_COMP\\nuevo.tif'}


texts: Unexpected results for area calculation on two datasets in Google Earth Engine

texts:
I'm seeing a very strange result using .pixelArea() on two different layers that should yield identical results.
Code within GEE is here, also reproduced below:

var states = ee.FeatureCollection("ft:1KU0yvyS5glqa5NmHHl9j9_v-12s_b5YA90qUn9Y");

var test1 = ee.Image("users/test1");
var test2 = ee.Image("users/test2");
test1 = test1.updateMask(test1.gt(0));
test1 = test1.updateMask(test1.lt(999));

var maskedArea = ee.Image.pixelArea().mask(test1);
var maskedArea2 = ee.Image.pixelArea().mask(test2);

print(maskedArea.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: states.filterMetadata('name','equals', 'California'), //geographic area you want summary stats for -- comment the whole line out if you want CONUS
  maxPixels: 10e13,
  scale: 30
}).get("area"));

print(maskedArea2.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: states.filterMetadata('name','equals', 'California'), //geographic area you want summary stats for -- comment the whole line out if you want CONUS
  maxPixels: 10e13,
  scale: 30
}).get("area"));

In test1, I uploaded an asset that included cells I didn't want to consider -- hence my use of .updateMask() to remove those cells (any cells with values >0 and <999)

In test2, I uploaded the same asset, except the removal of cells with values >0 and <999 had been done in ArcGIS beforehand (using the "Con" tool). This dataset was in USA Contiguous Albers Equal Area Conic (ESRI: 102003) projection, with a cell size of 30m.

I then calculate the area and get 127,179 for test1 and 145,685 for test2, as you'll see from running the code. What I would like to see is two identical numbers. I am not sure which one of these numbers is "correct", but strongly suspect it is the latter, since it is close to the ArcGIS zonal statistics result and previous findings by others, which I trust.

You can also see from the code link to GEE above that test1 & test2, if added to the map, are completely identical, so the removals of unwanted cells in both cases appear to have worked identically.

How is it possible that these area numbers are so different? (I looked at some other places around the country using similar data snippets & the difference is sometimes not so big, often as much as a factor of 2, on average about ~1.6x bigger -- always bigger in test2, the case where I removed unwanted cells within ArcGIS before uploading the asset).

Hard to imagine simplifying the problem any further, so I'm pretty stumped. I think it has something to do with test1 cells having floating-point values and test2 cells having only 1s and 0s. But, all non-zero cells in both tests are the same, so when used as a mask on ee.Image.pixelArea(), I would think it shouldn't make a difference -- the same parts of the .pixelArea() image should get pulled out.


texts: Error when trying to subset a vector to a dataframe

texts:
I'm not sure if I've used the correct terminology in my title, so please forgive me if that doesn't entirely make sense.

For the sake of reproducing my example, I've created a dummy example. As usual, I pulled the ESRI shapefile from GADM and am using Ethiopia (admin level 1) as an example. I'll describe my problem in terms of this Ethiopia example.

I have a shapefile of the regions of Ethiopia that has been fortified into a data frame. Each region corresponds to a number in the attribute ID_1. I have created a vector, x, of a string of numbers that I need to pull from the Ethiopia shapefile while maintaining all of the rest of the data. Here's my code:

setwd("D:/Mapping-R/Ethiopia")

library(rgdal)
library(ggplot2)
library(rgeos)
library(maptools)
library(plyr)

#read in shapefile
eth <- readOGR(dsn = "D:/Mapping-R/Ethiopia", layer = "ETH_adm1")

#fortify
eth@data$id <- rownames(eth@data)
eth.f <- fortify(eth, region = "id")
eth.df <- join(eth.f, eth@data, by = "id")

#create dummy vector
x <- 6:9

#try to subset data
test <- eth.df[eth.df$ID_1 == x,]

This final line of code gives me the error

  Warning message:
  In eth.df$ID_1 == x :
    longer object length is not a multiple of shorter object length

How do I go about performing this subset without an error? I'm still fairly new to R and subsetting, so I feel like there's probably a pretty easy solution, but I can't seem to nail the proper search terms to find an answer. In my real code, it's necessary that the numbers I need to pull (in the example, 6:9) are a named vector, so I'm not sure how to fix the problem.


texts: Getting FME to write features in order provided?

texts:
I have a simple model that just does a series of queries/data cleanups and then puts the data into a csv. Unfortunately it's being put into the CSV in a random order.

How can I get it to write in order?

Running this I get

But I need it to be Lot Plan, then Prop No, Land No, Street address and finally toilets.

Based on https://knowledge.safe.com/questions/40473/is-it-possible-to-make-a-transformer-wait-for-the.html I added a connection run time order but still get the same output.

I am using the current ver of FME desktop.

UPDATE:

Here's what worked.


texts: Does not open same CRS based TIFF file and shapefile at the same time in QGIS 3

texts:
I have two file a & b, first one is georeferenced singleband .tif file and other is .shp file with same CRS EPSG:32645. But at the time of opening, both file works fine separately, but at one window only one is shown, another one is not showing on window, but the name is shown on layers panel.

Name: outlinekmc.shp
Path G:.../outlinekmc.shp
Storage ESRI Shapefile
Geometry: Polygon (MultiPolygon)
CRS: EPSG:32645 - WGS 84 / UTM zone 45N - Projected
Extent: 627231.4324251519283280,2483317.2391181909479201 : 650253.3000616317149252,2503549.0619603917002678
Unit: meters
Feature: count 1

Name: kmc_main16.tif
Path: ...\kmc_main16.tif
CRS: EPSG:32645 - WGS 84 / UTM zone 45N - Projected
Extent: 88.2366249193618728,22.4461890856986592 : 88.4674844691701310,22.6346628055565056
Unit: meters
Width: 11122
Height: 9080
Data type: Byte - Eight bit unsigned integer
GDAL Driver Description: GTiff
GDAL Driver Metadata: GeoTIFF

How can I open the two layer one above another, as both the layers corresponding to same area?


texts:
I have a shapefile with the following format. These are storm tracks and each unique "Serial" represents one storm track.
import matplotlib.pyplot as plt
import geopandas as gpd

input = "lines.shp"
linesplot = gpd.read_file(input)
print(linesplot)

Serial  Year    Month   Day  Hour   Lat     Lon         geometry
2003002 2003    2       12   0      6.98    125.42      LINESTRING (124.61000 7.87000, 125.42000 6.98000)
2003002 2003    2       12   6      7.87    124.61      LINESTRING (122.98000 8.60000, 124.61000 7.87000
...     ...     ...     ...  ...    ...     ...         ...
2003155 2003    12      23   0      7.48    141.56      LINESTRING (140.62000 7.93000, 141.56000 7.48000)
2003155 2003    12      23   6      7.93    140.62      LINESTRING (138.91000 8.33000, 140.62000 7.93000)

I would like to create a track density map something similar to this figure here. In the density map, I would like to count the number of storm tracks passing through within each 1x1 degree grid cell over the entire domain.
--- Update ---
As suggested, I tried using a spatial join. I have also found this post where he did it with points.
I first created 1x1 grid cells
# create the cells in a loop
grid_cells = []
for x0 in np.arange(xmin, xmax+cell_size, cell_size ):
    for y0 in np.arange(ymin, ymax+cell_size, cell_size):
        # bounds
        x1 = x0-cell_size
        y1 = y0+cell_size
        grid_cells.append( shapely.geometry.box(x0, y0, x1, y1)  )
cell = geopandas.GeoDataFrame(grid_cells, columns=['geometry'],
                                 crs=crs)

and used merged = geopandas.sjoin(linesplot, cell, how='left', op='within')  to merge the dataframes
as suggested in the post,
# make a simple count variable that we can sum
merged['lines']=1
# Compute stats per grid cell -- aggregate lines to grid cells with dissolve
dissolve = merged.dissolve(by="index_right", aggfunc="count")
# put this into cell
cell.loc[dissolve.index, 'lines']=dissolve.lines.values
del dissolve

However, when plotting, I don't seem to get the right number of counts for each grid cell.
ax = cell.plot(column='lines', vmin=0, vmax=10, edgecolor="none")

the highlighted grid cells should have the same color as they have the same number of line count


texts: Need an Algorithm to Determining Polygon Borders

texts:
I'm currently writing a program in Java and I'm dealing with polygon objects.  I want to create a different color border between touching objects depending on their class (i.e. land, ocean, etc).  I need an algorithm for detecting which segments of my ocean border another ocean or land.

Right now I'm trying to do this by detecting which object share coordinates.  And creating a total count of each class, and whichever class has the highest count, that is what that segment is bordering.  It's too simple and doesn't work in about 40% of the cases, so I need something better.

Can any one recommend a different idea, or a source to look at?

Thanks in advance.


texts:
I have searched for a while, but have not found a suitable answer yet.
I have the following problem. When I execute the following query [1] via the overpass API, I get nodes as a result that don't have an address.
My question: Is it possible to query the address somehow too?

{
  "type": "node",
  "id": 271449962,
  "lat": 50.7261247,
  "lon": 7.1242361,
  "tags": {
    "amenity": "biergarten",
    "name": "Zum Blauen Affen",
    "wheelchair": "limited"
  }
}


texts: Convertion of multiple csv automatically to shp

texts:
I have more than two hundreds similar csv files with columns (x, y, value1, value2, objectName). I need to convert them automatically to shp files with x and y columns as the coordinates. Could you please advice how to do it quickly using Python scripting?

Thanx!


texts:
Is there a function to snap new or moved vectors to a (user-defined) grid on the map similar to the AutoCAD snapping-function without generation a point/line/polygon-grid over the whole region first?

Specifically, I want to create or move objects in 1 m increments (or multiple) on whole meters.


texts:
I have a workflow in FME in which I read some autocad files, do some transformations and output some shape files.
My question is how can I merge the shape files with the same geometry and type of attributes?
Is there a straight forward way to do this through FME?


texts: Can I process a single multispectral image with QGIS?

texts: I have images of weeds taken using RedEdge on a drone and want to process these to find a point of difference. I have reflectance panel images. Can QGIS do this for these "Single shots" rather than an ortho?


texts:
I want to plot a map weighted by prices. I got a data frame of latitudes, longitudes and prices:

> str(data)
'data.frame':   1253 obs. of  3 variables:
 $ lon  : num  11.2 11.1 11 11 11.3 ...
 $ lat  : num  49.6 49.4 49.3 49.4 49.3 ...
 $ price: num  1.4 1.37 1.4 1.36 1.4 ...

> head(data)
       lon      lat    price
1 11.21702 49.58926 1.395000
2 11.07774 49.37093 1.369000
3 11.04533 49.33787 1.397000
4 10.97310 49.43500 1.357333
5 11.34080 49.31650 1.399000
6 11.20708 49.36844 1.399000

My second step is to transform the data frame into a spatial data type:

coordinates(data) = ~lon+lat
proj4string(data) = CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")

And to plot it:

spplot(data, scales=list(draw=T), sp.layout=list("sp.points", data, pch=""), main="My Data")

(Should look like a small map of Germany)

At this point I got a plot with my points colored from black (lowest price) to yellow (highest price). But there is also a lot of white space in my plot. Now I want to fill the white space with assumptions, so it looks like a heatmap at the end.

I read some articles about "Kriging", but I'm not sure how to code this. I also read, that I need a raster. Therefore I tried the following lines according to this article How to make RASTER from irregular point data without interpolation:

s100 <- as.matrix(as.data.frame(data), ncol=3, byrow=TRUE)
e <- extent(s100[,1:2])
r <- raster(e, ncol=10, nrow=2)
x <- rasterize(s100[,1:2], r, fun='mean')


texts: Fixed Distance Buffer not Buffering Features with Holes

texts:
QGIS 2.18.5

I've created a viewshed over a hilly area and I would like to add a fixed distance buffer just to compensate for any underestimations from the viewshed plugin's result.

This is the result with a 100m buffer:

You can see the buffer does not work if the feature has holes in it. Some of the holes are quite large and if filled, will alter the viewshed drastically.

I've also tried the solution from this thread: Fixed buffers and interior buffers are not working for a polygon that contains a hole

However I get this result:

Any ideas how to fix this?


texts: Is there a way to use raw html with the markdown used in odyssey.js?

texts: I use odyssey.js in part of my Django site. The map part of it is all working fine but I need to add some <i-frame> elements. I'm not sure what flavour of markdown it is and can't figure out how to add any raw html. {% autoescape off %} stops the <> tags from being escaped but using |safe doesn't seem to have any effect.


texts: I am using grass algorithm  v.net.connect of the processing toolbox. It runs but does not produce any output. I don't know what I am doing wrong?


texts:
I've been searching the internet for a while now trying to look for a way to merge all the shapefiles from a directory (a folder) into a single shapefile. I found many solutions but none of them seem to work for one reason or the other. I've found solutions using ArcPy but those solutions are currently out of my reach as I do not own such software.

QGIS might say "Error: Algorithm not found" even though I followed various guides telling me how to fix that. Or it says "Error: wrong number of parameters" when I use algorithms like the processing.runalg(saga:mergelayers"...) one.

I suspect the problem is that the version I am using does not contain the processing algorithms I was suggested, but this is just a guess. I am currently using v2.14.0... a lot of the documentation guiding me seems to be referring to v2.6 or v2.8 but I can't download those.

Can someone help me merge shapefiles from a folder into a single shapefile, using PyQGIS v2.14.0?


texts: Group contiguous polygons by sum of values

texts:
I have a polygon layer of watersheds (N = 1950) for South Africa. Within each watershed is a value (number of people; POPULATION field). I need to find a way to automatically group contiguous watersheds so that when the summed values of a group of watersheds falls between 50 and 100, those watersheds are assigned a unique ID in a new attribute field called GROUP.

The code that I'm looking for would need to run through the entire polygon layer, essentially assigning ID's (i.e., groups) to each watershed in the layer. I'd imagine that in a polygon layer of 1950 watersheds, there would be ~300 unique groups.

Exactly the same question has been posted previously (Clustering polygons by sum of values) but unfortunately they never posted their code.


texts: How to zoom to layer using ArcGIS Javascript API

texts:
I tried to get the function "Zoom to Layer" done using the following code snippet. But it does not change anything. The layer is a feature service layer, and I can see the full extent object of the layer which is not null. Any idea?

tree.on("dblClick", function (item, node, event) {
  var layerId=item.id[0];
  var layer = map.getLayer(layerId);

   if (!layer)
   {
    return;
   }
   else
   {
    var lyrExt=layer.fullExtent;
    var gsvc=  esriConfig.defaults.geometryService;
    var outSR = new esri.SpatialReference({ wkid: 102100 });
    gsvc.project([lyrExt], outSR, function(newExt) {
    map.setExtent(newExt[0],true);
   }
});


texts: Calculate field value based on lat long. Have longitude values which are negative?

texts:
Very new to python, fairly experienced with ArcMap. I am trying to create an alphanumeric index based on point locations

My code string for the numeric part is here:

def calc(!LONG_x!):

    if !LONG_x! >= -113.90550 and !LONG_x! <= -113.90559:
        return "05"
    else:
        return "0"

I continue to get an error 000989 for syntax. What am I doing wrong?


texts:
I have some traffic data that I want to display with the Torque Cat in CartoDB. The data that I have contains daily traffic numbers from 300 stations on the main around Iceland for 1 year.

What I want to show is a map that contains a time slider so I can see the amount of traffic on each station at a given day for the whole year. The range off values for the traffic are 0~5000 cars/day. I want to split the traffic into 5 categories and display them as a bubble with different size and color:

>4000
3000-3999
2000-2999
1000-1999
500-999
<500

I'm not able to get these categories to display the way I want them. I only get the bubbles for the <500 category. Im guessing that the torque-aggregation-function has something to do with this. Can somebody help me?

    /** torque_cat visualization */

Map {
-torque-frame-count:365;
-torque-animation-duration:30;
-torque-time-attribute:"date";
-torque-aggregation-function:"round(avg(traffic))";
-torque-resolution:2;
-torque-data-aggregation:linear;
}

#final_test{
  comp-op: source-over;
  marker-fill-opacity: 0.9;
  marker-line-color: #FFF;
  marker-line-width: 1.5;
  marker-line-opacity: 1;
  marker-type: ellipse;
  marker-width: 6;
  //marker-fill: #FF9900;
}

#final_test[value>=4000] {
   marker-fill: #FFCC00;
   marker-width: 19.0;
}

#final_test[value<4000] {
   marker-fill: #229A00;
   marker-width: 17.0;
}

#final_test[value<3000] {
   marker-fill: #A53ED5;
   marker-width: 15.0;
}
#final_test[value<2000] {
   marker-fill: #5CA2D1;
   marker-width: 13.0;
}
#final_test[value<1000] {
   marker-fill: #F11810;
   marker-width: 11.0;
}
#final_test[value<500] {
   marker-fill: #5CA2D1;
   marker-width: 9.0;
}


texts: Problem with QGIS unable to access virtual drive

texts:
After a motherboard failure I have had to reinstall QGIS Dufour on a Windows 7 laptop. As I share data with a desktop machine I use LiveDrive briefcase as a virtual drive. With all versions of QGIS I have always been able to access LiveDrive which appears as a mapped drive M:
However, on this laptop, having installed PostgreSQL, PostGIS and Osgeo4W shell to be able to load MasterMap data using the Astun Loader Astun Loader I am now unable to access drive M: from QGIS, GRASS or SAGA. I did have some access issuses and I had use 'run as adminstrator' to get round it even though my account has administrator rights.
I have tried doing a complete reinstall of QGIS without success.

I don't know whether this a QGIS issue or not. Any suggestions to fix this are welcome.


texts: osmconvert --all-to-nodes returns same point count as the raw data has

texts:
According to this question Some OSM tags in polygons and some in points - how to bring them together I used osmconvert --all-to-nodes to extract the central points of all ways and relations.

I used a osm.pbf as input:

osmconvert osm.pbf --all-to-nodes -o=osm_node.pbf

...or with increasing id:

osmconvert osm.gpkg --all-to-nodes --object-type-offset=10^15  -o=osm_node.pbf

and translated the resulting osm_node.pbf to GPKG with ogr2ogr.

The result is:

The RAW osm_node.gpkg:

The "all-to-nodes" osm.pbf

The resulting GPKG should have a lot more nodes as the raw data has. But it hasn't...

What am I doing wrong?


texts: Edit existing polygons to include several new nodes

texts:
I want to define catchments which are quite large from vector contour data.  I normally start zoomed out to define the catchment generally as it is easier to see.  I then zoom in and refine the catchment.

Currently I add a new node then move it into position to refine the catchment.  However is there a way to add additional "runs" of new nodes between two existing nodes to expedite the process.

I am using QGIS, with my contour data being vector data comprising poly lines with an elevation attribute defining its level.


texts: Frequency of partially or fully overlapping lines

texts:
Let L be a set of line-segments (lines) in a two-dimensional (2D) Euclidean space that are randomly (say, using uniform random function) distributed, that is, some may overlap other(s). Overlapping could be on a point or a line segment (in this case it is partial or full overlapping). We aim to represent any frequency of overlapping lines in a reasonable way.

For those may think of rendering; it is not of our interest in this post.

To start, for example, our naive solution was to discretise all the lines into a grid, that is, aiming to generate a 2D raster map i.e., a matrix. In this way, we are able to count the number of visiting per cell for all lines in the set. The resulting map/matrix (as of our quick experiments) is promising.

{1} What is the closest topic (if exists) to the aim of our question?
The answers may help us for improving our search keywords.
{2} Any thoughts on better ideas or suggestions for improvement?


texts: Converting @layer_name tokens into Shapefile Attributes (Columns/Rows) using QGIS Expression Editor?

texts:
I'm a fairly novice Python user and I've been banging my head against this problem for a number of days now.

Assumptions I've made:

This is doable within QGIS, and does not need to be done externally
The QGIS Expression Editor is sufficient for this task
This task has not been accomplished already by an existing QGIS plugin/function

What I want:

To turn the value returned by the @layer_name QGIS variable into Columns/Rows for a shapefile layer's Attribute table using the data contained in @layer_name to create new columns in the shapefile's attribute table of Continent, Country, State, County, City, Neighborhood filled with the values from the split @layer_name.

Example:

@layer_name = "North America-United States-New York-Albany County-Albany-Downtown Albany"
(The values in the shapefile's filename are separated by the "-" character. The layout is regular, ie: From beginning to the first "-" is the Continent, between the second/third is Country, etc. This would create a column Continent filled with North America, a column Country filled with United States, etc.)

What I've tried:

left(@layer_name , strpos(@layer_name ,'-')-1)

(This returns the first thing I want, but I've not been able to figure out how to adjust this to be run step by step to get the other things)

What I have now:

from qgis.core import *
from qgis.gui import *
@qgsfunction(args="auto", group='Custom')
def splitfunc(value1):
    str.split(value1,'-')
    return(value1)

(This should store the split out values in a list, which is something)

Is this more appropriate for a QGIS Plugin than an Expression?

In a perfect world, this script would be able to be batch-run against many (point shapefile) layers to update them all with the new Column/Row data.

Program that accomplishes a similar goal (Clarification/Inspiration):
MP3Tag
does batch transformation of filename to metdata with tokens, allowing people to easily map parts of the filename to the various metadata fields. This is (to me) an identical process in concept, applied to a different type of data.


texts: Executing a voronoi polygon to a shapefile With Pycharm

texts:
I'm trying to get a voronoi polygon from points using Pycharm.
I've tried:

processing.runalg("qgis:voronoipolygons", file ,1, "C:\Voronoi.shp" )

but it doesn't work. It works in the python console in QGIS but not in Pycharm .

This is my code:

import shapefile

import ProcessingLog
import processing
import sys
from sets import Set

from qgis.core import QGis, QgsFeatureRequest, QgsFeature, QgsGeometry, QgsPoint

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputVector
import voronoi
from processing.gui.SilentProgress import SilentProgress
from processing.tools import dataobjects, vector

def runalg(alg, progress=None):

  if progress is None:
      progress = SilentProgress()
  try:
      alg.execute(progress)
      return True
  except GeoAlgorithmExecutionException as e:
      ProcessingLog.addToLog(sys.exc_info()[0], ProcessingLog.LOG_ERROR)
      progress.error(e.msg)
      return False

file = "C:\Armoire.shp"
r = shapefile.Reader("C:\Armoire.shp")
processing.runalg("qgis:voronoipolygons", file ,1, "C:\Voronoi.shp" )

The error is:

  QPixmap: Must construct a QApplication before a QPaintDevice


texts:
I am using Arcgis 10.2.2 and I need to extract the landcover variables, one by one, from one raster layer that have all the variables together. How can I do this?

And then, how do I joint this information with a vector shp with points? (For each point I need to know the value of the land cover variable).

Ok, and if I have buffers (a layer shp with buffers)? What I want is that for each one of my buffers, I will have the average for each one of the land cover characteristics.
buffer 1 - so I will have an average value/or a 0, for each one the characteristics
buffer 2
...


texts: Which spatial-reference system is used by the Haversine formula?

texts:
I've been reading Pro Spatial with SQL Server 2012.  It discusses the various spatial-reference systems (SRS) that can be used when defining a coordinate system.  According to the book, Google uses WGS 84.

Prior to my exposure the SQL Server's functionality (i.e. Geography data type), I've used the Haversine formula to calculate distances between two lat/lng pairs.  I'm assuming that it (the Haversine function) makes some assumptions about the Earth's geoid (perhaps the great-circle distance), which suggests that it is using a particular SRS.  Is this correct?  Could one make use of other SRS (at least ones that use lat/lng pairs) with the function just by changing the great-circle distance?

** edit **

Said another way, does the Haversine formula care is the coordinates are WGS84, NAD83, or another other geodetic datum?


texts: Is it possible to change widgets in QGIS when opening style-file with Python

texts:
When loading a QGIS-project using a Python-file and having the same name on both shp- and qml-file, just the symbology and labels are according to the style-file, but not the widgets.

I have tried 2 methods:

Use load.py to load a QGIS-project and add 1457_skrot.shp. 1457_skrot.qml is stored in the same folder as 1457_skrot.shp.

  python load_proj.py C:\kmfelt\shape\utm32\2017\1457_skrot.shp

Use test_style.py to load a QGIS-project and to add both the shp-file and the qml-file in the py-file.

  python test_style.py

Code within the test_style.py:

vfile = r"C:\\kmfelt\\shape\\utm32\\2017\\1457_skrot.shp"
vlayer_name = os.path.split(vfile)[1]
print vfile
print vlayer_name
vlayer = QgsVectorLayer(vfile, vlayer_name, "ogr")
if not vlayer.isValid():
    print "Vector layer "+vlayer+" failed to load!"
vlayer.loadNamedStyle('C:\\kmfelt\\shape\\utm32\\2017\\1457_skrot.qml')
vlayer.triggerRepaint()
QgsMapLayerRegistry.instance().addMapLayers([vlayer], True)

In both cases just the symbols (color, size) and labels are set according to the style-file. However, all the widgets are set to Text edit and NOT to the specific widgets set in the style-file.

But, if I load the style-file manually (click Style - Load Style), the widgets change:

Is it possible to achieve the same effect (including change in widgets) using Python? (I'm using QGIS 2.18.6.)


texts:
I'm using the latest version of OpenLayers in my map application, and I need disable all zoom functions and panning for users. Zoom, mouse zoom, double click zoom, and control buttons zoom need to be disabled.

How can I do that? I've made some searches but I've just found how to disable everything, and I need other interactions like single click on a feature.


texts: Leaflet Javascript: Layer Control Style in Internet Explorer Messed Up

texts:
Please see this link. Only in Internet Explorer the Layer's Control box/panel is expanded all the way across the screen. Here is the relevant code for the Layer's Control.

map = new L.Map("map",{
    center: [34.8, -82.0],
    zoom: 12,
    layers: [mapquestOSM, fireflies]
});

var baseLayers = {
    "MapQuest Streets": mapquestOSM,
    "MapQuest Aerial": mapquestOAM
};
var overlays = {
    "Fire Flies:": fireflies
};

layersControl = new L.Control.Layers(baseLayers, overlays, {
    collapsed: false
});

map.addControl(layersControl);


texts: Transfroming ArcGIS Model into QGIS Plugin

texts:
I have a model builder and it has proved to generate some results. I want to transform this model builder into QGIS Plugin, based on this Converting Model in Plug-in in QGIS.

I have followed the instruction such as:
(a) Exporting my model builder into Python Script
(b) creating the empty plugin (altwater_ev) using Plugin Builder, but I have a different 'basic files' of python file resulted in my plugin directory as shown here:

I hope I can build a plugin with the same interface with what the model builder appearance like this:


texts: Why is QGIS rounding off manually added decimal attributes?

texts: I am manually adding a decimal column in qgis and set the width and precision to one more than I actually need (Width: 5, Prec: 5)so the number comes out as 0.XXXXX, but when I save my eidts qgis is still rounding the decimal off at 3 places (0.XXX00).


texts: Both 1st and 2nd map insert layers render properly on Print Composer screen but not on PDF

texts: I am developing a local trail map in QGIS and I want to produce a PDF with a map insert. Map 0 has USGS layers with the hiking trails. I then add Map 1 at a larger scale with a new OSM layer as the insert. In Print Composer I see what I want - the larger Map 0 with the USGS and trail layers rendered, and the Map 1 OSM rendered insert. Perfect. I then lock all of the layers.  However, the PDF I export renders both Map 0 and Map 1 with the OSM layer. Not what I want. I am missing something as I believe I should be able to do this.


texts: Is it possible to import OpenLayers data to PostGIS?

texts:
I'm struggled with the following problem: I'd like to import an OpenLayers layer to PostGIS in order to have the layer information for each grid point in a table. I know how to create a layer from PostGIS tables to OpenLayers using GeoServer... but not the inverse way.

Please any help would be extremely appreciated


texts: Converting KML files to shapefiles ArcView license level of ArcGIS for Desktop?

texts:
I only have an ArcView 9.3 license at work. What's the best way to convert a large KML file to SHP format?

I tried the DNRGarmin tool to import, but the file was too large for that particular program.

I've also tried XTools and received an error right as the process was starting.

Does anyone have a reliable method?


texts: How are geocoding scores calculated in ArcGIS?

texts:
After a table of addresses is geocoded, ArGIS provides information about each geocoded address, among those the "match score" of the candidate to which the address was matched, which ranges from 0 to 100. According to their documentation "The match score is based on how well the locations found in the reference data match with the address data being searched."

It seems intuitive that 100 means an address with the exact name was found in the Address locator and 0 means no such address was found. However, I could not find any information about how exactly this score is calculated, particularly if values are somewhere between the extremes. I this known?

I found the pointer to this white paper in the answer to this question, but I could not find any information in that paper that would answer the question.


texts: How to populate new field according to string content of another field using VB script?

texts:
I want to populate a new field called Letting according to the string value found in another field. If 'ASP' or 'Q' is in field ExternalRE then I want 1 in Letting, everything else to be 0.

Here is my erroneous script:

dim x
if 'ASP' in [ExternalRe] then
  x = 1
if 'Q' in [ExternalRe] then
  x = 1
else x = 0
end if

Letting = x


texts: Problem accessing WFS 1.1.0 with Mapinfo

texts: I am new to all kinds of GIS software. Due to my project I need to open WFS site which needs a WFS standard 1.1.0. I tried to do it with MapInfo Professional 11.5, but it wont open it. I found a solution from the internet which told me to put ?request=getCapabilities&version=1.1.0 in the end of my WFS URL, but it gives me an error " Unable to get capabilities from the server " Do I have to download any add-ons to MapInfo 11.5? Or can anybody suggest me some other programs to get this link to work?


texts:
I'm having this issue when I try to use the Polygonise(raster to vector) tool in QGIS 3.4.3 (Madeira) on a Mac running Mojave:

File "/usr/local/opt/gdal2-python/bin/gdal_polygonize.py", line 36, in <module>

from osgeo import gdal

ImportError: No module named osgeo

Some others have discussed this before and with reference to this other thread "QGIS 3.0 error when start in MacOS High Sierra", I note that I don't seem to have the
/Python/3.6/site-packages
sub-branch in my

/Library/Frameworks/GEOS.framework/Versions/3B/
/Library/Frameworks/GDAL.framework/Versions/2.3/

directories. I definitely have Python 3.6 (and not 3.7) installed.

To try to fix, I've reinstalled Python 3.6.8 using the installer from Python.org and I've reinstalled QGIS 3.4.3. Following these reinstalls, I still don't have the directory branches mentioned above and the Polygonise tool still doesn't work.

My presumption is that the lack of these branches is causing the problem (but I could be wrong). Can anyone kindly suggest what I need to do to sort this out?


texts: Enforcing maximum distance with ST_ClusterWithin?

texts:
I have a set of location points and I want to find clusters within the set. This is fine. However, I don't want to get two points in the same cluster that are farther apart than the maximum distance, even if those points are close enough to other points in the set.

As a fairly trivial example, I have this query:

WITH
  testvals (geom) AS
    (SELECT unnest(ARRAY[
      ST_MakePoint(1, 1),
      ST_MakePoint(2, 1),
      ST_MakePoint(5, 1),
      ST_MakePoint(9, 1),
      ST_MakePoint(10, 1)])),
 clusters(geom) AS
   (SELECT
      ST_CollectionExtract(unnest(ST_ClusterWithin(geom, 4)), 1)
   FROM testvals)
select ST_astext(geom) from clusters;

This gives the result of

            st_astext
..................................
 MULTIPOINT(1 1,2 1,5 1,9 1,10 1)

But the point (1,1) and (10,1) are way more than 4 units away from each other, even if the distance can be bridged by walking to points that are 4 or less units away.

Is there a way to generate clusters with PostGIS that don't have points that are too far away from any other point in the cluster?


texts: Selecting all points inside polygon in PostGIS?


texts: Molusce crashes QGIS when starting the changes raster calculation

texts:
I am doing a simulation of land cover changes with Molusce 3.0.13 in QGIS 2.18.9.
I am using 2 Corine landmap uses (2006 and 2012, with minor changes on the area, 12 same categories in both), road distances, sewer distances and a population net. All rasters have the same resolution (10) and are Int32 and have the same nodata value of 99999. The CRS is EPSG:3912.
The plugin calculates me the Paerson's Correlation coefficients and the Area Changes table but it crashes after starting the "create changes map".
I was trying to troubleshoot a lot (ot change, .QGIS folder deletion, plugin reinstall, different clips, nodata values...), but I could not find any remedy. I just saw that the plugin crashes later if I add a different color palette, but not sure it's relevant.
I found this topic open on it's Github Issues page, but there are no replies...

Does anyone know what's wrong with my data / which library I miss /etc?


texts: How to save to KML or KML file using google maps. I can't find menu command like that. I'm working on China region.


texts: I have multiple marker in one layer OpenLayers.Layer.Marker and some times the marker overlap the other marker. My question is how do I bring the marker in front when its click? is there a setZ-index function or some like this in Openlayers?!


texts:
A raster has a cell size of 200 meters. What is the corresponding scale of the raster?

New to GIS, using ESRI, semester is almost over but this one question is confusing. I didn't think you could calculate the scale of the raster in that you are given cell size of 200 meters and to my knowledge, or lack there of, the corresponding scale would be whatever the data set is using or that you adjust the scale to.


texts:
I wish to generate highways network routings and travel times from trip pairs. The trip pairs are between the centroids of UK census Lower Super Output Areas. For each trip pair (perhaps 5,000 records in a dataset) I wish to generate a polyline indicating the quickest route using the UK highway network, and return the associated journey time.

I require the routing and travel time to take account of typical (or realtime?) observed traffic conditions, i.e. delay due to congestion and queuing at junctions.

I use Mapinfo as my GIS. In recent months I have begun to use QGIS as a complete novice. I do not readily have access to any of the ESRI suite.

I'm a fairly basic user of GIS so I'm looking for a solution that does not require proficiency in programming.

I have been investigating propriety products such as Mapinfo Drive or Routefinder from routeware.dk, though i've been unable determine whether these will take account of journey delay. I have also researched the use of a routing web service. This solution appears to require much proficiency in programming. Is this right?

Does anybody have experience of carrying out a similar function. I'd be grateful for any suggestions of how I can perform these analyses.

Thanks for reading, Tim


texts: How to use a Processing Algorithm in a expression function used in a Geometry Generator (Points Along Lines "on the fly")

texts:
I want to use the Processing Algorithm, pointsalonglines, in the expression function used in Geometry Generator.
This is because I want to create points "on the fly" along my line and in a equal distance.
The final reason why, is because I want to show the distance of a track every X meters or kilometers.
All is explained in this two links:
Hatching features in layer using QGIS
Anita Graser help me in this link:
https://anitagraser.com/movement-data-in-gis/#comment-21044


texts: My Google Earth "My Places" will no longer populate when I open Google Earth.  I still have access to the KML file.  Is there a way to repair or trouble shoot the KML file to salvage the data?  The KML file is approximately 350MB.


texts: Out of memory when running ModelBuilder?

texts:
I'm currently using ArcGIS 10.3.1 on a 64 bit windows 7 machine.

When I run the following model, every iteration adds about 20 consistent megabytes into the ArcMap sessions memory until it eventually runs out.

I've tried adding a 'delete' function for in_memory.  The output shows this works, but the 20 megabytes still keeps adding up.

It's the same thing that happens if you do several processes in ArcMap and eventually the memory gets used up, even if you're not storing extra datasets in the project.

Any ideas on how to eliminate this problem so the memory won't run out?

HERE'S THE OUTPUT REPORTING RESULTS:

  Executing (Iterate Field Values): IterateFieldValues
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\Kachess_Capacity_1015.gdb\IterationTable0316
  Iteration Double true false 0 Start Time: Wed Mar 30 06:24:39 2016
  Succeeded at Wed Mar 30 06:24:39 2016 (Elapsed Time: 0.19 seconds)
  Executing (Surface Volume): SurfaceVolume
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\TIN_KACDam_BORDatum_0316
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\Kachess_Capacity_Output_Files\KACDam.txt
  BELOW 2133.01 1 0 Start Time: Wed Mar 30 06:24:43 2016 Completed
  Surface Volume: 2D Area=117053561.15555  3D Area=132153865.43817
  Volume=19787611237.973 Succeeded at Wed Mar 30 06:25:02 2016 (Elapsed
  Time: 19.57 seconds) Executing (Delete): Delete in_memory Workspace
  Start Time: Wed Mar 30 06:25:12 2016 Succeeded at Wed Mar 30 06:25:12
  2016 (Elapsed Time: 0.01 seconds) Executing (Iterate Field Values):
  IterateFieldValues
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\Kachess_Capacity_1015.gdb\IterationTable0316
  Iteration Double true false 0 Start Time: Wed Mar 30 06:25:12 2016
  Succeeded at Wed Mar 30 06:25:12 2016 (Elapsed Time: 0.02 seconds)
  Executing (Surface Volume): SurfaceVolume
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\TIN_KACDam_BORDatum_0316
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\Kachess_Capacity_Output_Files\KACDam.txt
  BELOW 2133.02 1 0 Start Time: Wed Mar 30 06:25:14 2016 Completed
  Surface Volume: 2D Area=117057436.47809  3D Area=132158168.43332
  Volume=19788781792.957 Succeeded at Wed Mar 30 06:25:27 2016 (Elapsed
  Time: 12.63 seconds) Executing (Delete): Delete in_memory Workspace
  Start Time: Wed Mar 30 06:25:37 2016 Succeeded at Wed Mar 30 06:25:37
  2016 (Elapsed Time: 0.01 seconds) Executing (Iterate Field Values):
  IterateFieldValues
  C:\Projects\Yakima_Basin_Study_0410\KtoKPipeline_KachessInactive\Kachess_Capacity_Table_Contours\Kachess_Capacity_1015\Kachess_Capacity_1015.gdb\IterationTable0316
  Iteration Double true false 0 Start Time: Wed Mar 30 06:25:37 2016
  Succeeded at Wed Mar 30 06:25:37 2016 (Elapsed Time: 0.02 seconds)


texts: Pause OpenLayers interaction until pan complete

texts: I have an OpenLayers map with thousands of vectors and a tiled strategy for retrieving them. I rarely get above 15fps panning the map, which is undesirable. I notice a similar Google Maps application consistently gets 40fps. Based on profiling, it seems the Google map does better because it pauses interaction, feature creation and destruction, and animation during the pan, whereas the OpenLayers map continues to process these events. Is there a simple way to tell OpenLayers to focus on shifting the features and nothing else during a pan?


texts: How to decide possible areas for water retention using lidar

texts:
I have lidar imagery for a watershed and am trying to process it so that a landowner know if they can hold water on their property or where they can hole the water (this is the more important part).
I've tried some of the hydrology tools and I am not sure if I am using them right or if they are not working with my data.  I've tried the flow direction tool and that seems to work correcly but I have also tried the sink tool and the fill tool and I think that these are some of the tools that I want but Im not entirely sure if I'm using the right or exactly what they do and ESRI's description doesn't help me.  The Sink tool gives me a bunch of little dots, it doesn't tell me much unless I'm misinterpreting the data.

I have also tried the flow accumulation tool but that also didnt give me very useful results

If there are other ways of using these tools or other tools to use any advice and tips would be greatly appreciated.

Edit:I should mention that the whole area is relatively flat with minimal elevation change, the section of land that I am looking at (pictured below) has an elevation change of 0.5-1m from the NW to the SE (approximately) and that I want to be able to use this process for other pieces of property.


texts: QGIS crashing/failing when dissolving multiple shapefiles in a Python loop

texts:
I am using QGIS 2.10 (but I've also tried 2.8) to loop through all the shapefiles in a folder (those ending in .shp) and perform a dissolve function on each of them. However, when I run the following code in QGIS it crashes the program. If I run the code outside of QGIS, the QgsGeometryAnalyzer().dissolve function returns 'False'.

Strangely, the same processes work outside of a loop. For example, if I load a shapefile using the QgsVectorLayer function and perform a dissolve using the QgsGeometryAnalyzer().dissolve function everything operates correctly.

Is there something I'm missing here?

import os
from qgis.core import *
from qgis.analysis import *

files = os.listdir('C:/Temp')

for file in files:
    if file[-3:] == 'shp':
        layer = QgsVectorLayer(file, file[:-4], 'ogr')
        QgsGeometryAnalyzer().dissolve(layer, 'C:/Temp/Dissolved/' + file[:-4]+"_dissolved")

*Also, I should note that I've tried to do the same process with GRASS using the v.dissolve command. Unfortunately, this doesn't merge/dissolve polygons that are not overlapping. I need all of the polygons in a shapefile to become one multipart polygon.


texts: How to set up the layer order with Google Maps API?

texts: I'm developing a web mapping site (using google maps api 3.0 and javascript) that combines wms layers and ground overlays (uploaded rasters) that are displayed on top of google maps. The software is working well except that I'm having problems controlling the draw order of the layers. I would like to have the wms layer (the NRCS soils layer) displayed on top of the custom raster images, with the google maps as the base layer. Currently, the wms layer displays as expected on  top of the google maps layer, but is covered by the raster layer. The question is: does the google maps api allow control of the order that layers are displayed (in my case the vector layer on top of raster layer on top of google maps)? I have tried setting the zindex of the display order, but that has not worked (but I could easily be missing something).


texts: How to access WFS DATA through a proxy in QGIS?

texts:
I use QGIS 2.18.4 with an Osgeo4W install, W7 x64.

The code below works fine without a proxy :

import urllib
params = {
    'service': 'WFS',
    'version': '2.0.0',
    'request': 'GetFeature',
    'typename': 'regbio',
    'srsname': 'EPSG:2154'
}
uri = 'http://ws.carmencarto.fr/WFS/119/fxx_ref?' + urllib.unquote(urllib.urlencode(params))
vlayer = QgsVectorLayer(uri, 'ma couche wfs', 'WFS')
if not vlayer.isValid():
    print u"The layer %s is not valid" %vlayer.name()
idx = vlayer.dataProvider().fieldNameIndex('NOM_DOMAIN')
uv = vlayer.dataProvider().uniqueValues(idx)
uv.sort()
for i, item in enumerate(uv):
    print i, item

The result is :

0 alpin
1 atlantique
2 continental
3 mediterraneen

The problem I'm having is that I cannot get the same result when a proxy is used.

With a proxy, I use the code of this : https://stackoverflow.com/a/37757921
However, the retrieved data are the html code.

Now, I wish to have the same result as the first code, but through a proxy.


texts: Help, I have 10,000+ .shp files covering 3 UTM zones with unknown projections

texts:
I was handed a ton of property files with no projections attached but was told they are all in UTM zone 21S. Well once I merged them all together and projected them I realized that the data covers 3 UTM zones 20S, 21S, and 22S. So basically each property file could be one of 3 UTM zones. Is there a way to figure out what UTM zone each property file belongs too without checking each one at a time? I can python code if need be.

I'm using ArcMap 10.2

I tried that. Here is a more detailed explanation of my situation. These files were original downloaded by UTM zone. So all properties in UTM z 20S were downloaded together with a projection of UTM z 20S, all properties in UTM z 21S were downloaded together with a projection of UTM z 21S ect. The shape files I received didn't come with the .prj files and I have no way to obtain them. So when I project them all with the same coordinate system say UTM z 21S, they overlap, all of the property files from UTM z 20S and 22S are overlapping the correctly referenced properties of z 21S. The misplaced properties are located in the correct area within the UTM zone, just the wrong zone. Does that make sense?


texts:
I would like to a offline package to determine the country a person lives in from a text field in a database named locatoin. I started using CLAVIN which gives good results sometimes but surprisingly dosn't work on easy results. For example:

"Toronto, Canada"
"Fremantle, WA"

Both fail to return a result. I have deliberately skipped out the GeoParsing steps as I already know the text is an location. I am using the LuceneLocationResolver class, for example initialise the object:

LuceneLocationResolver locRes = new LuceneLocationResolver(file, 1, 10);

Create a location occurrence instance:

LocationOccurrence LocationOccurrence_instance = new LocationOccurrence("Toronto, Canada",0);

Add it to a list and try and resolve the location:

List<ResolvedLocation> result = locRes.resolveLocations(locations, false);

Am I using CLAVIN in the right way or is it just not up to scratch?

Backgroud: my main applicatoin is in Python but couldn't find anything that would do the job. So i'm using JPype to interact with CLAVIN using Python.


texts: Arcpy to get ArcGIS Application Data folder (My Toolboxes folder)

texts:
Is there a way (enviromental variable) in arcpy to get access to ArcGIS Desktop AppData (per user) folder. For example, I need to access this folder in 10.2:

C:\Users\MyUserName\AppData\Roaming\ESRI\Desktop10.2

Actually, from there I need to access "My Toolboxes" folder!

The reason is that When I upgrade my ArcGIS, I have to change all of my scripts to reflect the new path. Furthermore, if I run the script in another machine the script's path won't be valid.

I need to access this folder in a neat way and I don't want to use an absolute path. As this is a famous folder across the ArcGIS system, I expect an environmental variable for this folder or "My Toolboxes" Folder. Any thoughts?


texts: Changing "Datum Transformation" is QGIS by PyQGIS

texts:
Is it possible to change Datum Transformation in QGIS by QGIS?

For example add new Transformation or change actual.


texts: QgsMapCanvas canvasMoveEvent fails to update mouse position after calling zoomToFullExtent

texts:
I have a standalone PyQGis application that can load different types of GIS data including GeoJson. It uses QgsMapCanvas as map display, I have implemented the canvasMoveEvent to capture and display mouse' coordinate as it moves. This feature stops working after I load in a gis data file without projection and then calling zoomToFullExtent(). I stepped through the code and it seems it simply stopped sending current mouse position, hence the mouse's coordinate will not change in the interface.

If the gis data I load in has a good projection, then it will work fine.


texts: Loading multiple shapefiles from +1000 subfolders

texts:
I have a WATERBODY shapefile for each region within each province in Canada. The region subfolders also contain many other features that I do not need. I am trying to upload and merge all the WATERBODY shapefiles of Canada, without searching through each of the ~1000 subfolders. Rumour has it this is possible in the 'Load Them All' plugin for QGIS but I am using ArcMap 10.3.1.

I have no knowledge of Python coding and that seems to be the answer to similar questions from 2012 on forums. Is there an ArcMap equivalent? Is there an easier way than learning Python coding for this one step?


texts: How to change the style of a point when clicked?

texts:
Sorry for this common question.
I do succeed in changing the style of a polygon when clicked, like in this example.

But I don't succeed with points, with the same code.

select = new OpenLayers.Layer.Vector("Selection", {styleMap:
            new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])
});

When I click on an area, an http request is send to geoserver and returns an xml with the caracterics of each points. But it does not display it.


texts: Opening .gbdtable (.gbdtablx, .atx) files in QGIS

texts: I was given is folder of .gbdtable files that I cannot seem to add to QGIS. Eventually I need these files in .asc or .bmp format, and am using QGIS to accomplish that. I've seen info on the web about .gbd files from ArcGIS Desktop, but the folder I have contains only .gbdtable, .gbdtablx, .atx, .spx, and so on. Do I need these input layers to be in a different format? I've been trying to add these as layers, but QGIS says it is invalid.


texts: QGIS Change treeview categories in browser(2) panel

texts:
The main categories of the treeview in the browser panel seem to be hard coded. Is it possible to

1.) add, delete or rename categories (e.g. instead of "Project home" name it "Data")

2.) link "Home" to another directory (e.g. a subdirectory of c:\Users\)

I want to get rid of all the entries in the Home category which have nothing to do with GIS, and let it point to a subdirectory.


texts: QGIS clipping OpenStreetMap but still being able to run functions such as ORS Tools on the layer

texts:
I have struggled to find a solution to be able to clip an OpenStreetMap (OSM) raster layer but still run functions using plugins such as ORS Tools. I would like to clip OSM with an overlaying vector layer, but not for aesthetic purposes. I have seen solutions where you convert the OSM raster layer into an image, but this would get rid of information contained in the original layer.
With my clipped OSM layer I would like to be able to run a route analysis / network analysis of the roads in my study area. The reason for clipping the OSM is because there are certain stretches of roads that I want the plugins to avoid when calculating the shortest route.
Plugins for QGIS such as ORS Tools and TravelTime allow network analysis but I believe they do this (please correct me if I am wrong) by using road and route data through their own databases.
Is there a way I can clip an OSM layer (or something similar) in QGIS and then be able to calculate the shortest route between two points using only the roads on this newly clipped layer?
If you know of a solution for Esri I would be happy to give that a go too.


texts: Custom formatting coordinate grid using QGIS

texts:
I am custom formatting my coordinate grid.

Is there a way to change the following formula so that the output comes with a decimal and suffix?

substr(@grid_number, length(@grid_number) -6,5)

The following provides a suffix, but again I need this to be with less digits like above and a decimal:

abs(@grid_number )
|| ' °'
|| CASE
    WHEN  @grid_axis = 'x'
       THEN
         IF (@grid_number > 0, 'E' , 'W')
       ELSE
           IF (@grid_number > 0, 'N' , 'S')
       END

Perhaps there is a way to combine the two so that I can achieve a coordinate format like the following:

19.53'2°N


texts:
I have downloaded QGIS 2.99 version and successfully built on macOS using qt5.10 and cmake3.10.1 . I have built QGIS several times on linux/windows but this is my first time doing it on Mac.

I have built it successfully with my minor customisations on machine1 and able to run from the default build path. I wanted to take this build to another machine (machine2) and when run, it throws the error and always searches for the library path using absolute paths from machine1.

I have set DY_LD_LIBRARY_PAT but "/Users/machine2/Documents/QGIS/output/lib/" but when run it starts complaining on
"/Users/machine1/Documents/QGIS/output/lib/qgis_gui.framework/Versions/2.99/qgis_gui" is always looked as absolute path.

dyld: Library not loaded: /Users/machine1/Downloads/QGIS_New_Build/output/lib/libqgis_app.2.99.0.dylib
  Referenced from: /Users/machine1/Downloads/QGIS_New_Build/output1/bin/QGIS.app/Contents/MacOS/./QGIS
  Reason: no suitable image found.  Did find:

How do make the build in Mac so that these issues are eliminated and relatives paths are considered?


texts: Customizing Symbology Based on Time Slider for Time Frame in ArcGIS Online using Arcade?

texts:
We have a feature service for gates that have fields for when the gates will be under construction and closed. There are 2 date fields, one for the start of the closure and one for the end of the closure. Only a few gates are being upgraded so not all features have the field populated and they are not all closed for the same duration. For now I've been able to customize an expression solely based on the Now() function which is for the current time. We would like to be able to have the function based on when we have time enabled on the layer in AGOL so that as someone moves the temporal slider, if the time frame depicts when closures are, the color would change to show which points would be closed.

Is this even possible?

This is the current code which works, but only based on current time.

var started = $feature["Closure_Schedule_Start"]
var closed = $feature["Closure_Schedule_End"]
var present = Now()

If (present >= started && present <= closed) {
         return "Closed"
} else {
        return "Open"
}


texts:
I have downloaded a Sentinel image, what I histogram matched first with the following Orfeo codes (a cut the low and high 2 percentiles):

# Import the otb applications package
import otbApplication
# The following line creates an instance of the Convert application
Convert = otbApplication.Registry.CreateApplication("Convert")
# The following lines set all the application parameters:
Convert.SetParameterString("in", "d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04.jp2")
Convert.SetParameterString("out", "d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04_histcut.tif")
Convert.SetParameterString("hcp.high","2")
Convert.SetParameterString("hcp.low","2")
# The following line execute the application
Convert.ExecuteAndWriteOutput()

The result of the histogram seems good (notation: someway the minimum and maximum is 1 and 28000 without any pixel?)

After I rescaled the image to the domain 0-255:

# The following line creates an instance of the Rescale application
Rescale = otbApplication.Registry.CreateApplication("Rescale")
# The following lines set all the application parameters:
Rescale.SetParameterString("in", "d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04_histcut.tif")
Rescale.SetParameterString("out", "d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04_scaled.tif")
Rescale.SetParameterOutputImagePixelType("out", 1)
#Rescale.SetParameterFloat("ram", 512)
Rescale.SetParameterFloat("outmin", 0)
Rescale.SetParameterFloat("outmax", 255)
# The following line execute the application
Rescale.ExecuteAndWriteOutput()

And the result seems strange, there are stripes in the image. What can be the reason, how can I solve it?

The images were created in QGIS, with the default 2% - 98% Cumulative Min/Max cut.

Image dimensions: 10980 x 10980


texts: What is the easiest way to avoid shapefile columns being imported as PostGIS `numeric(p,s)` data type?

texts:
Considering the number of shapefiles I've imported to PostGIS (using shp2pgsql or ogr2ogr), I'm a little surprised I haven't come across this before. But I have a shapefile that has numeric columns with unnecessarily generous precision and scale settings, and instead of importing as int or double precision, they are importing as numeric(p,s).

The shapefile has several DBF columns defined as COLUMN1,N,10,0, and instead of importing as int they are importing as numeric(10,0). There are also some floating point columns which are defined to accommodate the maximum possible precision, e.g. COLUMN2,N,19,8 which instead of importing as double precision is imported as numeric(19,8).

I have a number of related questions about this behavior. First, regarding understanding why this is happening, is this behavior documented anywhere? I found some mailing list discussions, but nothing in documentation about what precision and scale will force the switch to the numeric data type.

Then, does anyone have suggestions for handling this that do not involve manually altering the column types in PostGIS after import? Approaches I can think of (but feel free to suggest others):

Is there any switch or setting in shp2pgsql or ogr2ogr which can override this behavior, similar to the -i switch that forces shp2pgsql to avoid creating bigint columns?
Is there a way to automate the cleanup after import? That is, does someone have ideas for a script that could find all the numeric columns in a table and force them to double precision or int?
Is there a way to automate altering the data types in the shapefile/DBF before import to reduce the precision enough to avoid importing as numeric?


texts: Assigning Z values (in attribute table) to shapefile geometery

texts:
I have polyline data (contour data),  the z value is in the attribute table.
The shapefile does not have the z_value set in the geometry. I am able to get point data to work, but when I do the same process, I end up with a midpoint for the line with an xyz value.
I need the line data to have a z value before I convert the shapefile (Feature class) to a DWG file for AutoCAD.
I use ArcMap (ArcView 10.0) with not extra extensions and QGIS so either software will be fine.


texts: Creating Quantile classes when reclassifying raster in QGIS?

texts:
I have a raster with a wide range of float values, and I'd like to reclassify it based on pixel distribution (Class 1 being bottom 25% of pixels, Class 4 being top 25% of pixels, etc).

I've been using the r.reclass (Grass) tool within the processing toolbox, and it allows for a 'reclass' text file to specify ranges. However, I'd like to automate this process within a model, so making a custom text file for each map isn't plausible.

Are there any other options for reclassifying based on pixel ranges?

So far, it seems that r.quant does not work, and r.quantile only outputs an html file, and not a usable txt file. r.recode may be an alternative to r.reclass, but it hasn't been working with the output from r.quantile. Still no solution.


texts: calculate st_distance between the point in km (m)

texts:
I try to calculate the distance between two geogprahical points, using st_distance. The points are stored in a data frame, but for simplicity, I take one pair of points to show the problem.
Here are the two points (an example of a pair of points):
a <-st_sfc(st_point(c(70.321117, 22.896517)))
b <-st_sfc(st_point(c(68.743738549303, 17.0129893190695)))
st_distance(a,b)
Which returns 6.09.
I understand this should be a distance in degrees, and to calculate the same in km I need to multiply by 111 km. But the distance seems to be too large (ca 666 km), compared to online calculators of great circle distance (I got 293 km).
Why is the difference so large? I do I calculate the distances in a wrong way?


texts:
I'm trying to remove duplicate features from PyQGIS. Manually I can do it by using "Edit -> Merge Selected Features" and then "Multipart to Singlepart" from fTools in QGIS, but can this functionality be reached from PyQGIS? Can't find anything about Merge in the API docs.

I tried using QgsGeometryAnalyzer.dissolve but it seems to keep the duplicate parts in the multipart features created. I hope someone can describe an easy way to accomplish what I'm after.

Regards,
Andreas


texts: What is the problem here. Google Earth Engine Error Python

texts:
Can't find out the problem here.
img = ee.ImageCollection('COPERNICUS/S1_GRD')\
    .filterDate('2020-02-01', '2020-02-28')\
    .filterBounds(area)\
    .select(["VH"])
mome = img.mean()
areac = mome.clip(area)
skinny = ee.Kernel.gaussian({
  radius: 10,
  sigma: 1,
})
filt = areac.convolve(skinny)

Error:
---------------------------------------------------------------------------
EEException                               Traceback (most recent call last)
<ipython-input-33-065f15fee587> in <module>()
      4 skinny = ee.Kernel.gaussian({
      5   radius: 10,
----> 6   sigma: 1,
      7 })
      8 filt = areac.convolve(skinny)

6 frames
/usr/local/lib/python3.6/dist-packages/ee/ee_number.py in __init__(self, number)
     40     else:
     41       raise ee_exception.EEException(
---> 42           'Invalid argument specified for ee.Number(): %s' % number)
     43
     44   @classmethod

EEException: Invalid argument specified for ee.Number(): {25: 10, 10: 1}


texts:
Could someone navigate me for using/calling GDAL stand-alone programs from Python? I have GDAL 2.3.2 and Python 3.7.
When I call gdal from python I can access to a limited number of functions including gdal.Warp() and gdal.Translate(). I can not however access 'gdal_edit' which I am currently interested to use. In the Git page of this function I did not find any information regarding access to this function either!


texts: How to get count of non-NA raster cells within polygon using R

texts:
I've been running into all sorts of issues using ArcGIS ZonalStats and thought R could be a great way. Saying that I'm fairly new to R, but got a coding background.

The situation is that I have several rasters and a polygon shapefile with many features of different sizes (though all features are bigger than a raster cell and the polygon features are aligned to the raster). I've figured out how to get the mean value for each polygon feature using the raster library with extract:

#load packages required
require(rgdal)
require(sp)
require(raster)
# ---Set the working directory-------
datdir <- "/test_data/"

#Read in grid of water depth
ras <- raster("test_data/raster/pl_sm_rp1000/w001001.adf")

#read in polygon shape file
proxNA <- shapefile("test_data/proxy/PL_proxy_WD_NA_test")

#calc mean depth per polygon feature
#unweighted - only assigns grid to district if centroid is in that district
proxNA$RP1000 <- extract(ras, proxNA, fun = mean, na.rm = TRUE, weights = FALSE)

#plot depth values
spplot(proxNA[,'RP1000'])

The issue I have is that I also need an area based ratio between the area of the polygon and all non NA cells in the same polygon. I know what the cell size of the raster is and I can get the area for each polygon, but the missing link is the count of all non-NA cells in each feature. I managed to get the cell number of all the cells in the polygon proxNA@data$Cnumb1000 <- cellFromPolygon(ras, proxNA)and I'm sure there is a way to get the actual value of the raster cell, which then requires a loop to get the number of all non-NA cells combined with a count, etc.
BUT, I'm sure there is a much better and quicker way to do that! If any of you has an idea or can point me in the right direction, I would be very grateful!


texts: Can I get geoserver to recognize 'rectangle' in SLD?

texts: Since geoexplorer is giving us problems, we have started using QGIS to style our layers and then put the sld in geoserver. The wellknownname for a square comes out as 'rectangle' from QGIS and geoserver doesn't recognize that. There is a team that has to do styles this way and would prefer to find a way around replacing rectangle with square every time they do a style. Can I get geoserver to recognize 'rectangle'?


texts:
So we have factories, bridges, boat launches and stations that are on our map by latitude and longitude data fed to us from Homeland Security.  In a good number of these situations an attack can come from the water even though the "point" where the attack can occur is on the land.

I used a process where once we find a point not on the water, we go through this process:

Convert the waterway raster to polygons
Save all polygons in an array of polygons
For the point to be relocated to the water I find the polygon that is nearest, cast that polygon to an IProximityOperator, then call ReturnNearestPoint.
Finally for debugging purposes we then call CheckCoincidence and we frequently get back a an indicator that the point STILL is not on the water.

Now the stranger part of this is we put the point (that is now Coincident) into a point array and call CostPathAsPolyline which then very nicely throws an exception that tells me diddly poop as to what is wrong with my point.  The exception basically states that "all point are at their maximum value in the grid" and naturally ESRI did not document this at all.  We assume this happens when either

The item is still not in the water (thus surrounded by NoData all around it)
OR the point is in a location that cannot reach the main point

In testing we make certain the latter is not the case by specifically putting points in an area such that all targets are reachable.  So if they get moved to the nearest point on the polygon, the CostPathAsPolyline should still work even if the point is on the outer edge of the polygon.

Does anyone have any insight as to why this exception would be thrown when the point is moved onto the waterway???


texts: PyQGIS: intersection of one node layer with two polygon layers

texts:
I´m new with the use of PyQGIS and I´m working in a problem applied to a water supply systems modelling, where I need to distribute the water demand in about 5000 nodes (network junctions).

I´m using PyQGIS to calculate the water demand in each node.

Regarding to the working layers:

A.  Junctions (Node layer): in this node layer I have to write in the “DEMAND” field, the result of the demand calculation.

B.  NodeArea: it is a polygon layer with a Vonoroi polygons with the area on influence of each node (Junction).

C.  NodePopulationDensity: it is a polygon layer with the different population densities in the different areas of the network.

The DEMAND result to be written in the Junctions layer will be the result of:

(Junction Demand, in A) = (Junction area, from B) x (Population Density, from C) x (per capita Water Demand, a constant).

Is there any easy way to intersect the A layer with the layers B and C, collect data from them, calculate and write the result in A?


texts: Process to gather raster cells under features

texts:
I need to gather individual raster cells underneath a feature in a featureclass as quickly as possible. It seems that most ArcObjects functions have problem with island polygons, multi-part polygons, etc... and I would like to try and correct this in my own function.

The Geoprocess PolygonToRaster is VERY fast, and I would like to "mimic" what that is doing. Does anyone know of what that geoprocess may be doing on the backend that I could hopefully tap into?


texts: How to split a polygon into multiple small parts by grid

texts:
we delineated a river basin in shape file and generated a line-featured shapefile using Hawths tools.

now our task is that we want to divide this basin into small polygons by gird in order to compute the area within the grid at the boundary. Does anyone know how to implement this using arcgis 9.3? Your help will be greatly appreciated.


texts: Clip all files from multiple subfolders using multiple polygons that have the same attribute

texts:
I'd like to ask for your help completing this code since I'm new to Python. I have two dataset folders one with subfolders containing shapefiles and the other with subfolders containing raster.
I'm trying to complete a loop that takes the polygons of the first subfolder that have in common the same attribute e.g. 'class' and uses them to make a clip on the first raster subfolder, repeating the loop for the second folder ec.., saving all the results in a new folder with the subfolders of its new cut raster. I tried using gdal but the output only returns the list of files ending with '.tiff'. How can I fix it? I'd really appreciate your help.

import os, fnmatch
import geopandas as gpd
import gdal

Workspace = 'F://...//rasters'
S2_path = os.path.join (Workspace)

for subdir, dirs, files in os.walk(S2_path):
    for file in files:
        filepath = subdir + os.sep + file
        if filepath.endswith(".tif"):
            print (filepath)

OutputFolder = 'F://...//output/'

for polygon in polygons:
    gdf=gpd.read_file('F://...//shapefile.shp')
    df1 = gdf[['class','geometry']]
    options = gdal.WarpOptions(cutlineDSName=df1,cropToCutline=True)
    outRaster = gdal.Warp(srcDSOrSrcDSTab=filepath,
                        destNameOrDestDS=OutputFolder + '_crop',
                        options=options)
    outRaster= None


texts: Viewshed Analysis - How to add OS Vectormap data to DTM?

texts:
I have run a viewshed analysis on a single point using a UK OS Terrain 5 DTM which has worked fine. I now need to perform the same analysis but with buildings and woodlands taken into account.

I've have OS Vectormap District data for both the buildings and the woodland areas which are shape files and want to add generic height values to each of these. Am I right in thinking that this is the process?

Add 'Height' attribute field of 5 to buildings and 15 woodland layers (Conservative values)
Convert both polygon layers to rasters
Use the raster calculator to add the two new rasters to the existing DTM (I'm not familiar with this so a step by step process would be very useful). When running this it's masking out the areas that are not woodland or buildings (presumably NoData areas). How do you assign a value of 0 to these NoData areas?
Run viewshed again using new DTM

One final question - how can I avoid the viewshed calculating 'on top' of those features? (i.e. the woodland and the buildings)


texts: How to debug failing Clip/Merge/Build Virtual Raster on OSX?

texts: I'm trying to use a number of raster functions in QGIS version 2.12.1 Lyon under OS X10.10.5 Yosemite and repeatedly get the message that "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program." Though I can use Georeferencer and many other functions happily, neither Merge, nor Clip, nor Build Virtual Raster work. I assume that this is something to do with the long-running problem of links on the Mac to Python, but none of the previous advice I've found seems to be relevant to my case. How do I get round the problem?


texts: Can't open ArcCatalog Database Connection SQL database Tables with field names greater than 31 characters

texts:
I am using SQLEXPRESS as a test environment.

I have a database connection in ArcCatalog to a SQL database.  Some tables in the SQL database have field names greater than 31 characters and these tables will not open in ArcCatalog.

Can the greater than 31 character SQL Field names be given aliases using Server Management studio and then re-connected to ArcCatalog or do the field names in the SQL database simply need to be shortened (which will be tough as it is owned by a 3rd party)?


texts:
I am doing an upgrade from OpenLayers 2 to Openlayers 3 and it seems to me that in OL3 there is no direct way to get a layer from map by its id. In OL2 it was like:

map.getLayer(id)

If we look in the OL3 API documentation and the ol.Map object, we would find only

map.getLayers()

which returns an ol.Collection. I could iterate through this collection with its forEach function and find the desired layer, but is this really the correct way? It seems a bit non-straightforward approach for such an essential and often needed purpose.


texts: Collect points (nodes) along the route via GraphHopper API in Python based on distance or real time tracking

texts:
I am currently working on the vehicle routing problem. I managed to find the shortest route between OD pair via GraphHopper API in Python. Besides, I managed to get the points along the route based on API attribute.
However, the distance between the points are not uniform (say every 100 meters or 500 meters). May I know is there way to do such settings to get points which are uniformly displaced along the route? If is related to the nodes stored in OSM, may I know what is the distance range between the nodes (in order for them to create the route)?
Another solution I am thinking is something similar to real-time tracking. Every 1 min, I check the location of the moving vehicle along the route. May I know is there any existing API (free) features?
Hope I clarify my problem.


texts: Is it possible to incorporate QGIS shapefile / polygon to XAMPP?

texts:
I want to make a website using XAMPP but it must include a map of our city. I used QGIS to produce a shapefile of our city. I also want to use MySQL / MariaDB as the database but I don't know how to connect the map with XAMPP's MySQL / MariaDB.

What I want to make is a map that changes its colors based on the number of instances the data is called in the database. Just like a hot spot analysis. I was able to do it in QGIS but I do know what to do where to start in incorporating the map with XAMPP.


texts:
I am storing all my features in mysql db and I am getting them with ajax and adding to the openlayers map.
Now I have to many features and it's taking a lot of time to get all of them and adding them, so I want to load only little bit from them and show all the rest with geoserver in a wms layer.
I found some plugins but nothing really worked, and I didn't find any example.
The features are stores in the database as a regular table not as spatial data, only have attributes and a col for WKT for the location.
Is there a way to add this features from mysql db to geoserver layer? Thx


texts: I have a point shapefile which was created from a text file in Excel using the delimited text layer plugin in QGIS. My problem is that I am getting a point shapefile but when I try to insert this in an India shapefile, the points do not overlay this shapefile. The projections are the same.


texts: Multithreaded DB connection for QGIS plugin

texts:
I am using QGIS 2.18.21 and PostgreSQL 9.6. on a Windows 8 machine.

I am trying to do processing of a certain database task in the background, and I want the user to be able to continue to work in the meantime.
The threaded class looks like:

class LoadCanvasStagingData(QThread):

def __init__(self, username, transaction_id, connection_string):
    QThread.__init__(self)
    self.username = username
    self.transaction_id = transaction_id
    self.selected_database = selected_database
    self.connection_string = connection_string

def run(self):
    # print ('\n\rsleeping')
    # time.sleep(0.05)
    # print ('done sleeping')

    con = psycopg2.connect(connection_string)
    cur = con.cursor()
    query = """ SELECT
                        *
                FROM qgis_validation_plugin.fetch_transaction(
                    '{0}'::CHARACTER VARYING,
                     ARRAY[{1}]::BIGINT[]
                 );
                    """.format(self.username, self.transaction_id)
    cur.execute(query)
    cur.close()
    con.commit()
    con.close()

It is called with:

 loadCanvasStagingData = LoadCanvasStagingData(self, self.username, self.transaction_id, self.connection_string)
 loadCanvasStagingData.finished.connect(self.refreshCanvas)
 loadCanvasStagingData.start()

It crashes on load about 75% of the times (with a .dmp file generation), seemingly unrelated to the data. But it does not crash at all if I uncomment the time.sleep.

Also, if I move the sleep thread to the bottom, it also does not seem to crash.

Does anyone know what might be going on?


texts: Precise, Multiple Copy and Paste of Polygons in QGIS

texts:
I need to layout parking spaces in QGIS. The spaces are diagonal.
Is there a way in QGIS to copy a given polygon "Y feet up" and "X feet over" say 10 times?
Example:

Need to take the initial polygon (yellow) and copy through the lot:
I'd like to specify:

Copy this polygon 6' up and 18' left 10 times
Add metadata to each copy such as spot number, reserved by, etc.


texts: GeoServer GeoTIFF rendering skips data between Greenwich and the Dateline

texts:
I've got a custom web application using OpenLayers3 running GeoServer (2.7.1) as a back-end.  I've added a world-wide temperature GeoTIFF as a test, and it renders in a strange way.

If I move the map to pan eastward, the GeoTIFF fully renders over the entire map.  If I move the map to pan westward, the image only covers half the world.  The full world coverage starts about half way across North America.

Has anyone seen this before?  What am I doing wrong that's causing this to happen?


texts:
Is there an equivalent to python .replace in mapbasic? Something like

search = search.replace(',', ' ')

I have found the search and replace tool for mapinfo and it works well but I need something simple to just replace all the ',' in a table with a space.

There are questions from 2007 saying this is not possible but has this changed? http://git.net/ml/mapinfo-l/2009-09/msg00107.html and https://groups.google.com/forum/#!topic/mapinfo-l/9QLqjsBTO_0

From one of my past questions I see we can find the ',' using

(InStr(1, SearchColumn, ",")

but how do I replace this character when found?

A line would be like "123, Main Street, GIS Town" and should become "123 Main Street GIS Town"

and it needs to be run in a table update command.

Update DCDB_Address Set Search = Search+" [Address]"