texts: How to add layer opacity slider in Openlayers 4 and qgis2web

texts:
I am using qgis2web to publish a webmap, and then modifying the code to add features that I want.  I am now adding a Tiled image from imagescale folders (e.g. \15 \16 \17 \18 and so forth).  Using the API ol.layer.Tile, I have inserted the tiled map into the layers.js file produced by qgis2web.

var lyr_OrthoImageSM1 = new ol.layer.Tile({
    opacity: 1,
    title: "OrthoImageSM",
    source: new ol.source.XYZ({
    url: "{z}/{x}/{y}.png",
    attributions: [new ol.Attribution({html: 'Maptiler'})],
    tilePixelRatio: 1.000000,
    })
});

... and add code for layer visibility (setVisible(true)) and add to the layersList variable.  This part works great.

The tiled image that comes from MapTiler, and the output from that package has an Opacity Slider at the top.  How do I get an opacity slider to work for my tiled image in Openlayers, as output by qgis2web?

From MapTiler, it looks as simple as an html line, but this isn't working for me because it's not pointing to my specific layer.

<input id="slider" type="range" min="0" max="1"
   step="0.1" value="1" oninput="layer.setOpacity(this.value)">


texts: Trying to convert latitude longitude values in UJIIndoorLoc dataset to degrees

texts:
I'm trying to convert the latitude and longitude values in UJIIndoorLoc dataset to degrees. The paper mentions that the data is in UTM from WGS84.

Here is an example of the values given:

LATITUDE: 4864837.920500003
LONGITUDE: -7360.497299999

Upon converting these I get values :

(lat: 43.76251700390833, lng: 2.6974029749144584)

But the result I should be getting should be near Universitat Jaume I in Spain (around 39.992845, -0.068439)

Can someone help me figure out the mapping please ?


texts: Buffering point with different distance toward N, E, S, W using ArcGIS for Desktop?

texts:
I want to create buffer polygon(with curved edges) from  points like this using ArcGIS for Desktop.

distance toward North from a point 5, toward South 1.5, toward west 1, toward East 2.

all this distance is attached as attribute in point in different fields.


texts: Holding onto row values while using cursors

texts: I'd like to be able to use an update cursor to go through rows in a table, holding onto the previous rows value, and comparing it to the current row value, to populate a new field with this value. Does anyone know if it is possible to carry values forward to the next iteration of a loop while using an update cursor and what would this look like in code?


texts: Ordering data in sequential order based on coordinates

texts:
I created a fishnet grid and need to give the individual polygons ID values based on their associated property names and location relative to each other.

I was able to achieve the above results with the following code that I adapted from a previously asked question.

rec=0

def autoIncrement(string_prefix):
    global rec
    pStart = 1 #adjust start value, if req'd
    pInterval = 1 #adjust interval value, if req'd
    if (rec == 0):
        rec = pStart
    else:
        rec = rec + pInterval
        return string_prefix + str(rec)

autoIncrement('AP')

However, I cant figure out how to relate it to the Y_Coordinates instead of the OBJECTID.


texts: Getting date of creation for feature using osm_id

texts:
I have download some OpenStreetMap data from Geofabrik GmbH. https://download.geofabrik.de/asia/india.html

I need to extract when was the first time each feature was created. E.g., for OSM_ID = 421427136, how could I extract the date when it was added to OSM? Optionally, also when it was last modified.

Any language / tools would be okay - but a python programming based answer would be great.


texts: Choosing several common attributes in shapefile merge (QGIS)

texts:
In QGIS 3.16: I have 2 non-overlapping polygon layers that I want to merge to one layer.  The two layers have associated attribute tables with 13 fields in common (same variable, same field type; different names in header however) and additionally, several fields each that are unique to that layer.
What I would like to do is merge the two layers in a way that

allows me to choose which common attribute fields can get collapsed to the same column (for example: merge field NUM_SITE from layer1 to field _02numsite from layer2;  merge field ORGANISME from layer1 to field _04organis from layer2);  and,
will add all non-common attribute fields to the resulting merged table as well (with Null/empty values for the features originally lacking those attributes).  And obviously,
I want to keep associated geometry.

Note: since the two layers have non-overlapping features, the number of features (lines) in the resulting merged table should in principle equal the number of features in layer1 + the number of features in layer2;  no features will be merged, i.e., no new information will be added to any line (other than 'Null' values in new columns).
As far as I can tell, I'm not looking for any type of table join (my attempt at 'join by attribute' seems not to include all features from both layers) but rather a type of shapefile merge that gives me options as far as attributes go.  I could perhaps just rename all of the headers and that might give me what I'm hoping for, but I was looking for a more systematic way if that exists.


texts:
I'm quite new to GIS data, and I currently have an issue where I have data on a specific variable coded in one set of geographic units and I need to convert it to another set of geographic units.  There is overlap between multiple units of the old geography to multiple units in the new geography.  What methods are available to reapportion the variable from the old geography into the new geography?  I'm aware of the spatial overlap method, but this really distorts my data in a way that isn't meaningful.  I'm working in R with shapefiles and SpatialPolygonsDataFrames.

If a concrete example helps, an analogous situation would be if I collected data from a survey of law enforcement agencies in the US that reported the number of guns confiscated during arrests.  Agencies would include state patrol, city police, the ATF, etc.  There is a an overlap in the jurisdictions of these agencies, some nested, some not.  How could I reapportion the survey results into a different geography, like US zip codes?  Using area overlap seems inappropriate in this situation, since the variable itself is dependent on more than just the jurisdiction area.

Related Question:
There is this question, however, the answer focuses only on area-style apportions.


texts: Is there a solution to glitches when deleting features from shapefiles on network drives?

texts:
We are a small GIS department of 4 folks working with a shapefile composed of points.  We have local installs (C:) of QGIS 2.8.1 on our work stations, which run Windows 7 x64.  The shapefile in question is installed on a network drive.

Lately we have noticed that, only sometimes, deleting a single point causes the attributes of the remaining points to be replaced with those of the next record in the feature set.  For example, say we have 3 points, all with a field called "Label."  The labels of the 3 points are as follows: FOO.1, FOO.2, FOO.3.  I want to delete FOO.1, so I do so using the tool in QGIS whose icon is a red trash can, either in the map canvas or in the attribute table of the layer.  The point "FOO.1" is deleted from the map and the attribute table, but now the point "FOO.2" has the attributes of the point "FOO.1," and moves to the location of the deleted point.  This glitch seems to cascade down the attribute table, affecting all subsequent points in the layer and moving attributes from one record to another.

In searching for similar glitches to this one, our team has discovered a documented bug from 6 years prior that seems to replicate our situation:

Delete feature bug

Unfortunately, the documentation doesn't seem to suggest a solution for those folks like us who store their layers on a drive separate from the one where QGIS is installed.

I was wondering if anyone else has come across this documented bug during their workflow, and if so, they have found sustainable ways to work around it.  We have come up with a temporary solution to fix the problem of "rolled back" attributes, that is, loading the table as a .csv file and manually fixing the unique IDS associated with the features to accommodate the deleted record.  However, this is not a long-term solution.

If the only solution turns out to be that we need to temporarily move our layers to our local drives and only edit them there, that'd be just fine, but we want to make sure there isn't some other simpler or more elegant solution.


texts: Carto zoom to areas in "link second layer"

texts:
I have a Carto map with two layers which I have linked using Carto's "Link Second Layer" analysis. I added a widget which lets me select the name of polygons and through this link, the map returns only the polygon selected by name and points (from the second layer) that fall inside it.

The issue is, I have data that extends all around the world. Currently, when I select a region the zoom does not change. Ideally, I'd want it to zoom to whatever polygon I've selected via the widget.

I found this:
http://bl.ocks.org/oriolbx/1e3755a44583058f4b95
but it seems that this is for maps embedded on a site, how can I apply this same thing to a map inside Carto that I can share through a URL?


texts: How to build a linear regression model and apply it on DEM in QGIS?

texts:
For various points in my landscape I have sampled their elevation (z) and information (i). Now I want to build a regression model (linear) to predict i from the elevation and apply it on my digital elevation model (DEM). My aim is to produce a continuous map of i.

Is there a way to do this in QGIS? The only way I can think of is to export the points to R (or Excel), build my linear regression model, export the equation and use it with the raster calculator.  Does anybody have a better idea?


texts: Set scale level of background map (QGIS)

texts:
Is there a way to set the scale of the background map in QGIS?
I'm importing a background map from MapQuest via the OpenLayers plugin. I'm creating an overview Map of a whole city, so it is not necessary (and even not wanted) to have named the small roads, which can't even be read when it is exported/printed on DIN A4.

Is there a way to tell QGIS it should take the view of the higher zoom level (where only motorways are labelled)?


texts: Slow PostGIS line intersection even with indexes

texts:
I have line data contained in different graphs. Querying data over multiple graphs and using st_intersects results in slow queries. All lines are represented as geometry(LineString).

I am querying multiple graphs together containing over 3 million lines, the table contains over 5 million lines.

Here is a sample query counting the data. This part of the query is used in more complex queries and is the biggest bottleneck. Following query filters around 63.000 lines from 3 mil.

select count(*) from graph_schema.graph_line as gline
where gline.graph_id in (26, 27)
and st_intersects(gline.line, st_geomfromtext('LINESTRING(1280 0, 0 720)'));

I have partial spatial indexes for each graph:

CREATE INDEX graph_line_line_idx<GRAPH_ID> ON graph_schema.graph_line USING GIST (line) WHERE graph_schema.graph_line.graph_id = <GRAPH_ID>;

And index on the foreign key of the graph_id

With this setup, I cannot make PostgreSQL use the spacial indexes when querying multiple graphs. The query takes 18 seconds.

Aggregate  (cost=1382969.26..1382969.27 rows=1 width=8) (actual time=18161.980..18161.980 rows=1 loops=1)
  ->  Seq Scan on graph_line gline  (cost=0.00..1381079.93 rows=755732 width=0) (actual time=35.923..18156.004 rows=63306 loops=1)
"        Filter: ((graph_id = ANY ('{26,27}'::integer[])) AND (line && '0102000000020000000000000000009440000000000000000000000000000000000000000000808640'::geometry) AND _st_intersects(line,     '0102000000020000000000000000009440000000000000000000000000000000000000000000808640'::geometry))"
        Rows Removed by Filter: 4898682
Planning time: 0.686 ms
Execution time: 18162.012 ms

So I tried to create an index for this specific query:

CREATE INDEX graph_line_line_geom_advanced ON graph_schema.graph_line USING GIST (line) WHERE graph_schema.graph_line.graph_id in (26, 27);

This makes PostgreSQL use the index, but the query is still slow - no real speedup.

Aggregate  (cost=782285.83..782285.84 rows=1 width=8) (actual time=17892.661..17892.661 rows=1 loops=1)
  ->  Bitmap Heap Scan on graph_line gline  (cost=106709.03..780375.43 rows=764159 width=0) (actual time=1109.125..17886.986 rows=63306 loops=1)
"        Recheck Cond: ((line && '0102000000020000000000000000009440000000000000000000000000000000000000000000808640'::geometry) AND (graph_id = ANY ('{26,27}'::integer[])))"
"        Filter: _st_intersects(line, '0102000000020000000000000000009440000000000000000000000000000000000000000000808640'::geometry)"
        Rows Removed by Filter: 3077146
        Heap Blocks: exact=44560
        ->  Bitmap Index Scan on graph_line_line_geom_advanced  (cost=0.00..106517.99 rows=2292477 width=0) (actual time=1098.754..1098.754 rows=3140452 loops=1)
              Index Cond: (line && '0102000000020000000000000000009440000000000000000000000000000000000000000000808640'::geometry)
Planning time: 0.693 ms
Execution time: 17893.234 ms

I also tried a different approach to query the data, but no difference.

select count(*) from graph_schema.graph_line as gline
join (SELECT st_geomfromtext('LINESTRING(1280 0, 0 720)') :: geometry AS line2) line2 on st_intersects(gline.line, line2)
where gline.graph_id in (26, 27);

Is there any way to greatly improve the query performance? Either by better usage of index, data representation or by preparing the data? Is the slow performance caused by st_geomfromtext?
I should also mention that the intersecting line can be changed by the user - so I cannot effectively prepare the data in advance.


texts:
I have a problem using Zonal statistics in python using ArcMap 10.4. This is a completely random error, and I have no idea what to do.
Some back ground is that I have been running a script doing batch processing work with zonal stats and extracting values etc. and it worked fine for various areas. All of a sudden the zonal statistics stopped working. There is no error, the program just ends abruptly.

I have tried to debug it in many ways (different environmental settings etc.) but here is the core of my problem:

A simple version of the program is as follow:

import os

import arcpy

from arcpy import env

from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")

from decimal import Decimal

location = "C:/Users/Me/"

shapefile = "C:/Users/Me/My_shapefile.shp"

raster = "//server_location/raster_location/raster_file.tif"

print "Start Zonal"

outZonalStatistics = ZonalStatistics(shapefile, "Valid_ID", raster, "MEAN", "DATA")

print "Done"

print "Saving"

outZonalStatistics.save(location + "mean_zonal")

print "Done"

Then the output is as follow:

>>> Start Zonal
>>> ================================ RESTART =================================
>>>

Thus the program just abruptly ends when Zonal Stats is being called.


texts: Using shutil.copyfile() to copy shapefiles from one folder to another using a text list

texts:
I am trying to copy shapefiles from one folder to another using a list of shapefile names saved in a txt file (shapefile name: BH_0231). I have the script below that works for copying one file type, but I can not figure out how to use it to copy all the associated files with a shapefile (.shp, .dbf, .prj etc.). I am wondering if I need to use the glob.glob() function, but I am not sure how.
# Script reads a list Contour names from a text file,
# verifies the tile exists,
# then copies the tile to a given location

import os
import shutil
import glob

# text file containing a single field of tile names
inpfile = open('C:\\Users\\natha\\OneDrive\\Desktop\\ContourSelectionProject\\ContourTiles.txt','r')

# index variable for line numbers (just for knowing how many tiles have been copied so far)
i = 1
for text_line in inpfile.readlines():
    # define file name
    filename = text_line[0:7]
    # define path to the contour tiles
    path = 'C:\\Users\\natha\\OneDrive\\Desktop\\ContourSelectionProject\\Contours\\' + filename
    if os.path.exists(path):
        new_path = 'C:\\Users\\natha\\OneDrive\\Desktop\\ContourSelectionProject\\Contours' + filename
        shutil.copyfile(path,new_path)
        print(str(i) + ' copied ' + filename)
        i += 1
    else:
        print( str(i) + path + ' MISSING')
        i += 1
inpfile.close()


texts: PyQGIS: Spatial Join: How do I correctly pass the parameters for qgis:joinbylocationsummary?

texts:
def joinSum(layer, j):
    output = 'memory:sel_{}'.format('test')
    params = {'INPUT': layer,
                'JOIN':j,
                "JOIN_FIELDS": ['area_gst'],
                "SUMMARIES": ['count','sum'],
                'PREDICATE' : [0],
                "DISCARD_NONMATCHING":True,
                'OUTPUT': output}
    result = processing.run('qgis:joinbylocationsummary', params)
    QgsProject.instance().addMapLayer(result['OUTPUT'])
    return result['OUTPUT']

I figured the parameters for SUMMARIES have to be passed as list containing strings that match these in the source code lines 150-152 however i get a "Incorrect parameter value for SUMMARIES" error. So how do I correctly pass those parameters ?

EDIT: Apparantly the parameters have to be passed on as integers but how do I know which number represents which summary?


texts:
I am encountering the following error message in QGIS when trying to install some dependencies for a plugin called GeoTrace:

IOError: [Errno socket error] [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I am using QGIS 2.18.15 64 bit on Windows. This error message appears in the stack trace and message log when I try to open GeoTrace in QGIS. GeoTrace uses Numpy, Matplotlib, mplstereonet, scikit-image. QGIS comes bundled with Numpy and Matplotlib.


texts: Loading geotiffs into PostGIS using raster2pgsql

texts:
I have an issue with loading some Ordnance Survey raster data into PostGIS. I have been using the following raster2pgsql command to load a tif that I have placed in my C:\Program Files\PostgreSQL\9.1\bin folder into PostGIS:

raster2pgsql -s 27700 -t 5000x5000 -I -C -M  *.tif  > os_strview.sql

I then execute the follwing psql command:

psql -h localhost -U postgres -d raster_test -f os_strview.sql

This works fine but when I tried to view the data in QGIS I could only see the raster_columns table in the selection box when trying to add a PostGIS layer.

I tried using the plugin Load raster to PostGIS instead. This works but my raster image had no colour. I then saw this post. I used the Raster > Convert > PCT to RGB technique to convert a single tif to a geotif.

Unfortunately though when running the psql command above I get this error message:

  C:\Program Files\PostgreSQL\9.1\bin>psql -h localhost -U postgres -d       raster_test
   -f os_strview.sql
  BEGIN
  psql:os_strview.sql:2: NOTICE:  CREATE TABLE will create implicit sequence "sx03
  nw-geo_rid_seq" for serial column "sx03nw-geo.rid"
  psql:os_strview.sql:2: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit
  index "sx03nw-geo_pkey" for table "sx03nw-geo"
  CREATE TABLE
  psql:os_strview.sql:3: ERROR:  could not load library "C:/Program Files/PostgreS
  QL/9.1/lib/rtpostgis-2.0.dll": Invalid access to memory location.

LINE 1: INSERT INTO "sx03nw-geo" ("rast") VALUES ('01000003000000000...
                                                  ^
ROLLBACK

I take it this has something to do with the size of the geotiff I'm trying to load into PostGIS - which is 71 MB!

Is there another method I should be trying? What is the limit on the size of a single image you can load into PostGIS?


texts: Memory issue? qgis python processing does not complete

texts:
I have a simple process to make some edits to all the contour files in a directory. It runs fine on the test of 100 odd files but in a directory with about 500 it stops after about 120 files.

Is there any way to release memory after each file is processed?

import processing, os, glob
path=r'F:\Input\Contours\25_cm'
outdir=r'F:\Output\Contours'
os.chdir(path)
for file in glob.glob("*.TAB"):
 filename=file[:-4]
 processing.runalg("modeler:contour_edits",filename+".tab",outdir+"\\contour_5m\\"+filename+"_5m.tab",outdir+"\\contour_25cm\\"+filename+".tab",outdir+"\\contour_1m\\"+filename+"_1m.tab")

UPDATED ---

import processing, os, glob, gc
gc.enable
path=r'F:\Douglas\Input\Contours\25_cm'
outdir=r'F:\Douglas\Output\Contours'
os.chdir(path)
for file in glob.glob("*.TAB"):
 filename=file[:-4]

 processing.runalg("modeler:contour_edits",filename+".tab",outdir+"\\contour_5m\\"+filename+"_5m.tab",outdir+"\\contour_25cm\\"+filename+".tab",outdir+"\\contour_1m\\"+filename+"_1m.tab")
 gc.collect()
 print filename

Output from console

  {u'OUTPUT_LAYER_ALGQGISFIELDCALCULATOR_1':
  'F:\Douglas\Output\Contours\contour_25cm\pt000443_contour.tab',
  u'OUTPUT_ALGQGISEXTRACTBYATTRIBUTE_2':
  'F:\Douglas\Output\Contours\contour_1m\pt000443_contour_1m.tab',
  u'OUTPUT_ALGQGISEXTRACTBYATTRIBUTE_1':
  'F:\Douglas\Output\Contours\contour_5m\pt000443_contour_5m.tab'}
  pt000443_contour 107 {u'OUTPUT_LAYER_ALGQGISFIELDCALCULATOR_1':
  'F:\Douglas\Output\Contours\contour_25cm\pt001062_contour.tab',
  u'OUTPUT_ALGQGISEXTRACTBYATTRIBUTE_2':
  'F:\Douglas\Output\Contours\contour_1m\pt001062_contour_1m.tab',
  u'OUTPUT_ALGQGISEXTRACTBYATTRIBUTE_1':
  'F:\Douglas\Output\Contours\contour_5m\pt001062_contour_5m.tab'}
  pt001062_contour 107 ... pt001063_contour 0 ... pt001064_contour 0 ...

When I split the files into batches of 30 in a directory and run this it works fine, when the batch is 50 it fails. If I run it without first restarting qgis (not just the python window) it processes the first 30 and may process some of the smaller files from the next 30 but not all of them. So I really think it is a memory issue???


texts: What is difference between BLOB and tile in GeoPackage?

texts:
I'm new to GeoPackage, but wrote some code that will read an image file into a buffer and I then insert that buffer into the GeoPackage as a BLOB.

The image files are GeoTIFFs which contain latitude, longitude, elevation data.

So, when reading through the requirements for GeoPackage, I see a required table that has a column for BLOB, but then I see a table that has a requirement for tiles.

What is the difference between them?

My BLOB is an area of a map and I do not know if a tile is the exact same thing.

The link from @user30184 is exactly what I needed from the start.  I had been to their website, but never saw the "spec" branch.


texts: Joining one field from multiple feature classes to another feature class

texts:
I've got 19 feature classes, with a single field in each one that I am interested in. I want to pull that field from each one (index 63 on each feature class), and join those fields to a single feature class (inDWR). In the workspace, I've got numerous fc's, and the 19 aforementioned feature classes all end with 'EVTP' in their file name. So, I've distilled a list accordingly (extractList):

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

env.workspace = 'C:\\LaPlata\\LaPlataFmTops.gdb'
inDWR = env.workspace + '\\DWR_ConstructedAbandonedReplaced'

tempList = arcpy.ListFeatureClasses() # This contains too many files, some of which I'm not interested in
extractList = []
for fc in tempList:
    if fc.endswith ('EVTP'):
        extractList.append(fc)
print (extractList) #contains only the fc's I'm interested in

for fc in extractList:
    fieldList = arcpy.ListFields(fc)
    joinField = fieldList[4] #this is == 'Permit', and is the join field for the input table and the fc
    fieldValue = fieldList[63] #field I want to join from each fc to inDWR
    arcpy.JoinField_management (inDWR, joinField, fc, joinField, fieldValue)

I keep getting this error:

Runtime error
Traceback (most recent call last):
  File "<string>", line 6, in <module> #This would be the arcpy.JoinField_management line
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 6593, in JoinField
    raise e
RuntimeError: Object: Error in executing tool


texts: How to resize layer using .prj (WKT) projection? (Geographic Coordinate System)

texts:
Briefly:

How to parametrize .prj WKT file so that I can perform 7 point tranformation (wiki). I know how false_easting and false_northing params work, but how can I adjust scale? I do not mean scale_factor'

That's the problem description:

I have transportation network (vector layer) saved in non-GIS environment (transport modeling software). Network consists of nodes (points) and polylines (road links). It's done mostly from random backgrounds, regardless any projection, coordinates, etc.

I need to set appropriate projection for the network.

I have accesss to .prj files (if I'm in an say WGS84 projection I can switch to any other projection)

So that's what I'm trying:
I try 7 point Helmert Transformation (http://proj.maptools.org/gen_parms.html). I use towgs84 transformation as a WKT param in .prj file, where I assume that rotation matrix is zero (can I do so?) and I calculate only delta_x, and delta_y, and scale param.

However it will not work. This is my .prj , params in TOWGS84 do not affect transformation:

PROJCS["UTM 17 (WGS84) in northern hemisphere.",
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563],
        TOWGS84[0,0,0,0,0,0,100000000000000000000000]],
    PRIMEM["Greenwich",0],
    UNIT["DMSH",0.0174532925199433],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],

PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0]]

So I tried to use false_norting and false_easting params, and those work good, and transform my network proprely, BUT:

It will not chcange scale of my network, only position. So how can I rescale my network using .prj file?

Thanks for any hints


texts: Installing CartoDB production environment in CentOS

texts:
By referring "Production deployment" section in https://gist.github.com/arjendk/6080388

I am trying to setup CartoDB in production environment using Apache with Passenger module. I setup proper startup scripts for CartoDB Windshaft, CartoDB SQL API apps and Redis. I have created a production database with rake.

Installed passenger using below commands:

yum install passenger
passenger-install-apache2-module

Then followed other steps from above document, and in ssl virtual host have the following content.

<VirtualHost *:443>

    ##This for central domain
    ServerName cartodb.mydomain.com
    ##This for all subdomains(users)
    ServerAlias *.cartodb.mydomain.com
    # !!! Be sure to point DocumentRoot to 'public'!
    DocumentRoot %SOME_LOCATION%/cartodb20/public
    RailsEnv production
    PassengerSpawnMethod direct

    #TODO later: SSL options

    SSLEngine on

    SSLCertificateFile %SOME_LOCATION%/localhost.crt
    SSLCertificateKeyFile %SOME_LOCATION%/localhost.key

 <Directory %SOME_LOCATION%/cartodb20/public>
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews
    </Directory>
</VirtualHost>

In CartoDB Windshaft/config/environment/production.js changed following

host: '',
,user_from_host: '^(.*)\\.cartodb\\.mydomain\\.com$'
,sqlapi: {
        protocol: 'https',
        domain: 'cartodb.mydomain.com',

In CartoDB SQL API/config/environment/production.js changed following

module.exports.user_from_host = '^(.*)\\.cartodb\\.mydomain\\.com$';
module.exports.node_host    = '';

Started CartoDB Windshaft, CartoDB SQL API apps, Redis using above setup scripts and resque manually.

When I tried accessing through cartodb.mydomain.com or prod.cartodb.mydomain.com,

I got passenger error message saying I have to bundle install --deployment, I run this inside  *%SOME_LOCATION%/cartodb20*

Now when I hit cartodb.mydomain.com or prod.cartodb.mydomain.com,  I get Error 500 page, that too non of the scripts in the page loaded.

Below the error I noticed in cartodb20/log/production.log

Processing by SessionsController#new as HTML
  Rendered sessions/new.html.erb within layouts/front_layout (101.4ms)
Completed 500 Internal Server Error in 279ms
[Rollbar] Reporting exception: cdb.js isn't precompiled
[Rollbar] Scheduling payload
[Rollbar] Sending payload
[Rollbar] Got unexpected status code from Rollbar api: 401
[Rollbar] Response: {
  "err": 1,
  "message": "unauthorized"
}
[Rollbar] Details: https://rollbar.com/instance/uuid?uuid=e3df1f34-deda-4f20-9c7f-0e9f90ef1e62 (only available if report was successful)
ActionView::Template::Error (cdb.js isn't precompiled):
    1: <%= content_for(:js) do %>
    2:   <%= javascript_include_tag :cdb, :application, :login %>
    3: <% end %>
    4:
    5: <section class="sessions shadow">
  app/helpers/application_helper.rb:97:in `javascript_include_tag'
  app/views/sessions/new.html.erb:2:in `block in _app_views_sessions_new_html_erb__1047976219462445650_23950283400360'
  app/views/sessions/new.html.erb:1:in `_app_views_sessions_new_html_erb__1047976219462445650_23950283400360'

I couldn't understand this issue, could someone help me on this? Thanks in advance.


texts:
I'm historically a user of MapInfo Professional but have recently started using FME and have been talked into now testing out a copy of QGIS.

The main problem I've come across is that the coordinate systems used in QGIS do not appear to match what is produced by the other two?

For example, setting both MapInfo Professional and FME to BNG seems to generate a CRS of:  +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=375,-111,431,0,0,0,0 +units=m +no_defs

This appears to differ form QGIS's interpretation of BNG which is;  +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs

I'm going to admit that I have no idea what the towgs84 parameter relates to but the differences appear to cause a few meters of discrepancy when looking at features on the ground.  Much as I like the simplicity of QGIS this could affect any decision to move forward with adopting the software in any capacity.

Could anybody provide me with a layman's explanation of what is going on?

Many thanks


texts: Debugging VB script in ArcGIS Field Calcultor?

texts:
I work in ArcMap and I would like to use Field Calcultor (VB script) but my script is not working. The message is:

  there was a failure during processing check the geoprocessing results
  window for details

I did it and it always said that I have syntax error but I don't know why. All of my fields are integer.

Here is the script:

Dim test

if [Field_1] > 50 then
test = 5
elseif [Field_1] = 50 then
test = 6
elseif [Field_1]  < 50 then
test = 7

end if


texts: Pull information from one shapefile and add it to the attribute table of another?

texts:
I'm trying to create a shapefile for one particular area in Germany. I have various shapefiles which store all the information that I need.  One of them is a 100m_Gitter_raster (a raster consisting of hectares) which is going to be the main shapefile that I want to work with. However, the individual raster points are missing information that I need. This is where the other Shapefiles come in handy. Those files cover bigger areas than the 100m_Gitter_raster and I now want to transfer the postal code to the 100m_Gitter_raster layer.

To help visualize my problem here is what I'm trying to do:

Imagine the green area is the postal code area whereas the little squares in between are part of the 100m_gitter_raster which I want to transfer the data to.

How can I have the 100m_gitter_raster pull that information from the postal code file and embed it into its own attribute table?

I have tried the Reference extension with the geomwithin function, however, this would just crash QGIS.


texts: Determining number of layers in .mpk file and then enumerating it using ArcGIS Runtime SDK for WPF?

texts:
I need to determine number of layers in a given .mpk file and then enumerate it using ArcGis Runtime SDK for WPF 10.2.

Can anyone provide me some link or code/snippet?


texts: QGIS: getting NULL values when using "Join Attributes by Location" of lines and polygons

texts:
I'm using QGIS 2.12.3-Lyon.

I have a polygon layer (~130k square polygons with some small overlaps) and I have imported a road network from OpenStreetMap (via Geofabrik, ~141k road segments) for my study area. I used the field calculator to assign a numeric category to each road type. Here is the code I used:

 CASE WHEN "type"  = 'motorway' OR  "type"  = 'motorway_link' OR  "type"  =  'trunk' THEN 5
 WHEN "type"  = 'trunk_link' OR  "type"  = 'primary' OR  "type"  =  'primary_link' OR  "type" = 'secondary' THEN 4
 WHEN "type"  = 'secondary_link' OR  "type"  = 'tertiary' OR  "type"  =  'unclassified' THEN 3
 WHEN "type"  = 'tertiary_link' OR  "type"  = 'residential' OR  "type"  =  'yes' THEN 2
 WHEN "type"  = 'track' OR  "type"  = 'service' OR  "type"  =  'living_street' THEN 1
 ELSE 0
 end

This resulted in an additional column specifying the road category. Now my goal is to check in each of my polygons (sort-of grid-cells) what is the maximum road category number from that list. I removed all columns except the road category from the roads layer. Then I converted both layers to the same CRS.

Next I went to Vector -> Data Management Tools -> Join Attributes by Location... and selected the polygon layer as Target and polygon layer as Join. Chose "take summary of intersecting features" and marked "Max". Also picked "Keep all records".

The resulting layer is a polygon layer identical to the polygon layer I had before, only with added columns of MAX and COUNT, both of which are filled entirely with NULL values.

What am I doing wrong?


texts: Create desktop map explorer application using QGIS?

texts: I need to create a map/data-explorer application that works offline (no internet connection), and I am trying to find out if anyone has developed desktop applications with QGIS similar to how one might develop an offline app using the ArcGIS Runtime SDKs?


texts: How to run BFAST Monitor over a FeatureCollection in GEE

texts:
I am working with BFAST Monitor in Google Earth Engine, and I would like to run the algorithm over a FeatureCollection containing individual points of interest. Like this:
var norway = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level0").filter(ee.Filter.eq('ADM0_NAME', "Norway"));
var myPoints = ee.FeatureCollection.randomPoints(norway, 10);

var engine = require('users/andreim/geeMonitor:monitor.js');

var roi =  myPoints;//ee.Geometry.Point(-60.00, -14.33);// region of interest as a Feature
var historyStart = "2000-01-01"; // The starting date of the stable period.
var historyEnd = "2018-12-31"; // The end date of the stable period.
var monitoringStart = "2019-01-01"; // The starting date of the monitoring period.
var monitoringEnd = "2020-01-01"; // End date of monitoring period.
var h = 0.25; //numeric scalar from interval (0,1) specifying the bandwidth relative to the sample size in MOSUM/ME monitoring processes
var period = 2; // maximum time, relative to the history period, that should be monitored. The default is 10 times the history period.
var alpha = 0.05; //Significance level of the monitoring (and ROC, if selected) procedure, i.e., probability of type I error.
var magnitudeThreshold = 0; //Threshold for magnitude level for which a change should be considered. Default is 0.
var harmonics = 1; //Order of the harmonic term.

var result = engine.bfastMonitor(roi,historyStart,historyEnd,monitoringStart,monitoringEnd,h,period,alpha,magnitudeThreshold,harmonics);

In mirror to this question about LandTrendr, I tried to apply a reducer over the result, like this:
var myReduced = result.reduceRegions({
  collection: myPoints,
  reducer: ee.Reducer.first(),
  scale: 30,
  tileScale : 16
});

But I got the error result.reduceRegions is not a function.
Is this a casting issue?

By using print(result); I found out that the object is composed of four image collections
By using print(typeof(result)); I found out that result does not have a native GEE type, as it just returns Object.

So, I tried to cast result to a list (ee.List(result)) or an ImageCollection (ee.ImageCollection(result)) to turn the object into something that I could work with, but it kept returning the same error ___ is not a function.
So, how do I run BFAST Monitor over a FeatureCollection?


texts:
I'm trying to create a search cursor that will list the cities in which the population is greater than 1,000,000. I was able to create a list of the cities and their populations, but unsure of the issue with my syntax.

this executed correctly:

import arcpy
import os

gdb = r'C:\Users\Stephanie\Documents\SPRING20\PGIS\project1\usa_cities.gdb'
feature_class = "largest_cities"

fc = os.path.join(gdb, feature_class)
fields = ['NAME', 'POP2017']
desc_list = []

with arcpy.da.SearchCursor(fc, '*') as cursor:
    for row in cursor:
        if row[2] != None:
            print("City: " + str(row[2]) + "     Population: " + str(row[9]))

  this is where my issue is

fields = ['NAME', 'POP2017']
desc_list = []

with arcpy.da.SearchCursor(fc, '*') as cursor:
    for row in cursor:
        if row[2] != None:
            print("City: " + str(row[2]) + "     Population: " + str(row[9]))
#Error:
  File "<ipython-input-46-956655ed0551>", line 6
    if '"POP2017" > 1000000'
                            ^
SyntaxError: invalid syntax


texts:
Does anyone knows - is it possible to style selected objects in Geoserver (using SLD) in different way than "normal" objects? For example: "normal" points from layer would be shown in blue, but selected (by clicking, queries etc.) in red.
I have searched through in Geoserver docs, SLD specification etc., but without satisfactory result.
The only traces of what I need can be found in "Definition and Implementation of an Active Web Map Service" article (by Nieves R. Brisaboa, Antonio Fariña, Miguel R. Luaces, David Trillo and Jose R.Viqueira).
I think that mentioned styling is not possible yet. Maybe CSS would help?


texts: What does Google Earth Engine's image.unmix() differentiate from other implementations?

texts:
I want to realize a project with spectrally unmixed Landsat imagery. However, I find no satisfying information on the respective GEE function, image.unmix().

I processed a few scenes with the exact same three endmembers both in GEE and with the help of RSToolbox package's mesma() function in R. The results differ largely, with mesma() looking quite more promising.
I cannot compare to the widely used ENVI function right now, but it seems that there is strong differences in implementations.

I am not even sure if they all three could classify as Multiple Endmember Spectral Mixture Analysis (MESMA) or if I'm comparing apples with oranges here.

The GEE help file linked at the top quotes:

  For more flexible methods, see the Array Transformations page

I fear, I don't quite understand what Array Transformations are capable of and how they are used. How would I build my own unmix() with these and would it enhance my results?

Can anybody could shed light on potential differences and the exact functionality of the GEE implementation?


texts: Cannot display images which are locally stored with SLD style

texts:
I'm trying to load some pictures into my map. They are supposed to be images which are in a local folder of my pc. This is my SLD file:

<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
    <NamedLayer>
        <Name/>
        <UserStyle>
            <Name>Leghe: grafico a torta</Name>
            <FeatureTypeStyle>
                <Rule>
                  <Title>Large</Title>
                    <ogc:Filter>
                            <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
                                <ogc:PropertyName>classificazione</ogc:PropertyName>
                                <ogc:Literal>servito tramite ns cliente</ogc:Literal>
                            </ogc:PropertyIsLike>
                    </ogc:Filter>
                    <MaxScaleDenominator>4000000</MaxScaleDenominator>
                    <PointSymbolizer>
                        <Graphic>
                            <ExternalGraphic>
                                <OnlineResource xlink:type="simple" xlink:href="cliente.png"/>
                                <Format>image.png</Format>
                            </ExternalGraphic>
                            <Size>
                                <ogc:Literal>70</ogc:Literal>
                            </Size>
                        </Graphic>
                    </PointSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

I have put both the sld file and the cliente.png in the Style Directory as said here http://girona-geoserver-workshop.readthedocs.org/en/latest/styling/styles.html but that's the result

what I'm doing wrong?? Please help me!!


texts: Sending GetFeature request to GeoServer WFS using POST starting from a JSON like data object

texts:
Looking at this older question, I'd like to know if it is possible to make a POST request to retrieve features from a GeoServer WFS starting from a JSON data object.
I have this data object which I'd like to transform in an XML GetFeature request suitable for GeoServer.
const featureRequest = {
  service: 'WFS',
  request: 'GetFeature',
  typename: foo:baz,
  outputFormat: 'application/json',
  srsname: 'EPSG:3857',
  maxFeatures: 50,
  CQL_FILTER: ''
};

And I'd like to use it to send request via POST method using Angular http client like so:
const baseUrl = environment.geoserverBaseUrl;
const httpOptions = {
  headers: new HttpHeaders({
    'Content-Type':  'application/xml'
  })
};
const response$ = this.http.post<FeatureCollection>(baseUrl, JSON.stringify(featureRequest), httpOptions)
  .pipe(catchError(this.handleError));
return response$;

The code above fails and the web console reads Backend returned code 200, body was: [object Object].
GeoServer logs:
org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)

I understand the problem should be that I need to format the request to a sort of XML OGC GetFeature request like (am I correct?). However, is there an easy way to do that (like with a file storing the structure where I can substitute the parameters I need to request?
I am using OpenLayers and I also tried the writeGetFeature() method using the filter option, but I found the filter to be too tricky to build when more than (saying) three parameters are involved in the query, and I'd like to go back to the good old plain CQL_FILTER.


texts:
The below code computes area elevation relationship by iteration algorithm. But when the interval sets to 0.5 shows same area values in a row(like the below picture).

code link: https://code.earthengine.google.com/d6fea46bec579534464dc7e9d58e4290
Map.centerObject(geometry);

var dem = ee.Image("JAXA/ALOS/AW3D30/V2_2").clip(geometry).select('AVE_DSM');

Map.addLayer(dem,[],'DEM',false);

var demMin = ee.Number(dem.reduceRegion(ee.Reducer.min(), geometry, 250).get('AVE_DSM')).float();
var demMax = ee.Number(dem.reduceRegion(ee.Reducer.mean(), geometry, 250).get('AVE_DSM')).float();

print('minElevation:',demMin);
print('maxElevation:',demMax);

//////////////////////////////// area elevation

var interval = ee.Number(0.5);

var waterlevel = ee.List.sequence(demMin,demMax,interval);

var calcArea = function(level,list){

  var inundated = dem.lte(ee.Number(level));

  var area = inundated.multiply(30.0).multiply(30.0);
  var totalarea = area.reduceRegion(ee.Reducer.sum(), geometry);

  return ee.List(list).add(totalarea.get('AVE_DSM'));
 };

var first = ee.List([]);

var AREA = ee.List(waterlevel.iterate(calcArea, first));

print('Area Estimated:',AREA)


texts: Add ring and Fill Ring error: could not add ring since the inserted Ring is not contained in a feature

texts:
I'm new to QGIS and am struggling a bit,
I'm using the 2.18 version on a Mac OSX Yosemite.
I'm trying to add a ring to create a geological map, I was successful for most of the map, but suddenly it does not allow me to do it any more. Both add ring and fill ring tools give me the same error

  could not add ring since the inserted Ring is not contained in a
  feature

The ring I want to create does not intersect with any other feature...
Any ideas on what this could be about and on how to solve the problem?


texts: I have a feature class with a large amount of points. My purpose is to randomly move these points to see what happens as a result. Are there specific tools or Python programming methods to accomplish this?


texts: Transforming geometry coordinates from SRID 4326 to SRID 3011

texts:
In SQLServer geometry field, I want to change the coordinates of geometry from one spatial reference system to another spatial reference system (from SRID 4326 to SRID 3011) by using ST_Transform. But the destination SRID 3011 is not available in sys.spatial_reference_systems table.

How I do this conversion? Is there any other way?


texts: Can I say WGS84 is more accurate than NAD83 in terms of their reference ellipsoids?

texts: Other than its application, can we say the reason of common adoption of WGS84 is due to its accuracy?


texts:
I need to convert a JPEG into a Geo-referenced TIF and generate tiles from it for overlaying them on Google Maps. The JPEG is available at ftp://ftp.bom.gov.au/anon/gen/radar_transparencies/IDE00035.background.jpg.  I do not the know its projection. But I came to know its four vertex coordinates to be: Upper Left  ( 114.05,  -7.73), Lower Left  ( 105.61, -46.27), Upper Right ( 152.95,  -7.8) & Lower Right ( 161.35, -46.2) from http://www.bom.gov.au/products/national_radar_sat.loop.shtml.

How do I identify the map projection in JPEG so that I generate a Geo-referenced TIF of correct project and proceed with generating tiles using gdal2tiles.py?


texts: Add Feature tool does not alow adding a polygon - just points

texts: I've installed QGIS version 2.18.2 and want to create a polygon but the add feature tool only allows me to create points which are not linked to create a polygon. Looking at tutorials online, the add feature toolbar is a small green polygon shape. On my version it is 3 green dots (see image below).


texts: Any plugin for converting web-based satellite imagery into ArcMap

texts:
I recently lost an Add-In toolbar that displayed imagery in ArcMap where I could assign projection to the data frame and my drawings on the satellite images would be "accurate" (vs drawing in a WGS projection where I need to be accurate to the half-acre).

I REALLY don't want to go through the pain of georeferencing every image I need at the correct scale/resolution just to get it into ArcMap, as I cover a lot of ground. Is there any plugin out there that can convert an image more easily into the correct projection WITHOUT using the georeferencing tool for every little piece of imagery, especially since the hi-res stuff I need/want to use is mostly in Landvis/Google Earth (that work off of snapshots, not downloading rasters).


texts: Invoke an HTTP request when AGOL features are edited?

texts:
Is it possible to automatically invoke an HTTP request when features are created/updated/deleted in an AGOL feature layer?
For example, when a feature is updated, generate an HTTP request with these parameters:

edit_type: update
objectid: 1
asset_id: 10
x: 1234.5678
y: 8765.4321
editdate: 2020-08-04

The HTTP request would be automatically invoked when a feature is edited.
In my case, the HTTP request will create a record in an external system (via POST).


texts:
I'm trying to script a reclassification using SAGA Grid_Tools-Reclassify Grid Values tool but I'm having the error: Reclassify Grid Values: could not initialize data objects.

I've tried different things:

With the SAGA GUI: works but I need to script it so it is not practical
With rqgis: Doesn't give me an error, but doesn't produce any files
With RSAGA: Gives me the could not initialize data objectserror
Directly in the Windows system console: Gives me the could not initialize data objectserror again.

I'll focus my question on the last try as it's a more direct connection to SAGA.  BTW, I'm using SAGA 2.3.2 64 bits on windows Server 2012 R2.

My system call is:

"C:\OSGeo4W64\apps\saga\saga_cmd.exe" -f=q grid_tools 15 -INPUT "C:\temp\depth_D500.tif" -METHOD "2" -RESULT "C:\temp\bldg_vuln_curves_SAGA_D500.tif" -RETAB "C:\temp\bldg_vuln_curves_SAGA.csv" -TOPERATOR "0"

And the result:

_____________________________________________

   #####   ##   #####    ##
  ###     ###  ##       ###
   ###   # ## ##  #### # ##
    ### ##### ##    # #####
 ##### #   ##  ##### #   ##
_____________________________________________

_____________________________________________
library path:   C:\OSGeo4W64\apps\saga\modules\grid_tools.dll
library name:   Grid - Tools
tool name   :   Reclassify Grid Values
author      :   Copyrights (c) 2005 by Volker Wichmann
_____________________________________________

Load table: C:\temp\bldg_vuln_curves_SAGA.csv...
okay

Parameters

Grids: No objects
Files: C:\temp\depth_D500.tif
Transformation: yes
Interpolation: B-Spline Interpolation

loading: C:\temp\depth_D500.tif

Driver: GTiff

Bands: 1

Rows: 3600

Columns: 3600

Transformation:

  x' = -89.000000 + x * 0.000278 + y * 0.000000

  y' = 55.000000 + x * 0.000000 + y * -0.000278

loading band [1/1]
Reclassify Grid Values: could not initialize data objects
Error: executing tool [Reclassify Grid Values]

It seems like SAGA can read the input raster and the classification table without any problems, but he can't write the files or something.  I suspected an administrative right issue but I have all the rights on that folder.  I also have plenty of storage place so that's not the problem either.  I've already had problem with SAGA writing tif files, so I've also tried changing the RESULT files to .sgrd and .sdat with no luck.

My files can be downloaded here:

raster

table

Any idea what the problem is?

Note: I've had better luck making the grass r.reclass tool work, however it doesn't handle well the floating values so it's not an option.


texts: Finding boundary coordinates of user current location with a given radius

texts:
I have my current lat and lng details

{
        "lat": 8.561032,
        "lng": 76.846333
}

And from this I need to build a boundary around me with given radius.
So How can I get the boundary coordinates for that?

I'm working with JavaScript - NodeJs


texts: Resize Chart inside a pop up in AGOL Dashboard

texts:
I am trying to fix pop-ups in my ArcGIS Online Dashboard that I am making.

I created the pop-up in a Web Map and everything looks fine:

However, when I use the Web Map in a dashboard, the popup is changed to include captions which makes the pie chart too small to read:

I cant seem to make any other changes in the web map, I am hoping that I missed a setting in the Dashboard configuration.


texts: Function editor can i use string-operators

texts:
In the Function editor I'm trying to edit a string something like:

from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')
def testfunc2(value1, value2, feature, parent):
    s =trim(value1 + value2)
    return s

I get the error:

Eval Error:
global name 'trim' is not defined

Can I use functions like trim, concat etc. in the Function editor?


texts: How to add more parameters to the sql file created by raster2pgsql

texts:
I'm using raster2pgsql to upload rasters to a postgres database
I execute the following command in cmd to create a sql that will add the raster

"C:/Program Files/PostgreSQL/9.5/bin/raster2pgsql" -s 32630 -a -f raster "Y:/Sen2R_Download/prueba_sergio/raster3/SCL/S2B2A_20180731_137_sen2r_SCL_10.tif" sentinel > Y:/Sen2R_Download/prueba_sergio/rastersql27.sql

This sql file will upload the raster to the field raster in the table sentinel
My doubt is if there is a way to add more parameters to upload to the database in the same table in other fields.
Because I want that the sql file created not only upload the raster but it upload a path and a company id in other fields of the table at the same time


texts: SceneLayer not loading in ArcGIS Runtime SDK for Android

texts:
I am trying to load a simple scene layer into a simple scene using the ArcGIS Runtime SDK for Android and it's not working. Here's a sample of my MainActivity.java file (based on the display-scene Android Runtime Sample):

public class MainActivity extends AppCompatActivity {

  private SceneView mSceneView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // create a scene and add a basemap to it
    ArcGISScene scene = new ArcGISScene();
    scene.setBasemap(Basemap.createImagery());

    ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer("https://services9.arcgis.com/u0ju0TmDBL8ozsto/ArcGIS/rest/services/Meander_Dam_WSL2/SceneServer/layers/0");
    scene.getOperationalLayers().add(sceneLayer);

    // create SceneView from layout
    mSceneView = (SceneView) findViewById(R.id.sceneView);
    mSceneView.setScene(scene);

    ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(
        getResources().getString(R.string.elevation_image_service));
    scene.getBaseSurface().getElevationSources().add(elevationSource);

    // add a camera and initial camera position
    Camera camera = new Camera(41.153, -80.7798, 300, -104, 0, 0); //Ohio dam
    mSceneView.setViewpointCamera(camera);
  }

  @Override
  protected void onPause() {
    super.onPause();
    // pause SceneView
    mSceneView.pause();
  }

  @Override
  protected void onResume() {
    super.onResume();
    // resume SceneView
    mSceneView.resume();
  }

  @Override protected void onDestroy() {
    super.onDestroy();
    // dispose SceneView
    mSceneView.dispose();
  }
}

The scene loads but my layer doesn't. I'm not having any problems loading this in the ArcGIS API for Javascript. What else do I need to do to get this working?


texts: QGIS can't load geometryless WFS tables published with QGIS Server

texts:
I created a QGIS 3.6 project on Windows Server 2016 x64 with two PostGIS layers:

Layer A: Points
Layer B: Datatable (No geometries)

and configured QGIS Server options on the project like this:

Now I open on another PC a QGIS Client on Windows 10 x64, click on add WFS layer and add both layers:

Layer A (Points) adds without problems.

Layer B (Datatble) is not added. I am getting the following error:

2019-06-20T13:27:15     CRITICAL    La capa no es válida : La capa pagingEnabled='true' srsname='EPSG:25830' typename='xxxx_aparcabicis_estado' url='http://xxxx/qgis/qgis_mapserv.fcgi.exe?map=D:%5CInstalado%5COSGeo4W64%5Capps%5Cqgis%5Cbin%5Cgis02%5Cgis02.qgs' version='auto' table="" sql= no es válida y no se puede añadir al mapa. Motivo:

translated to English it should something like:

2019-06-20T13:27:15     CRITICAL    Layer not valid : The layer pagingEnabled='true' srsname='EPSG:25830' typename='xxxx_aparcabicis_estado' url='http://xxxx/qgis/qgis_mapserv.fcgi.exe?map=D:%5CInstalado%5COSGeo4W64%5Capps%5Cqgis%5Cbin%5Cgis02%5Cgis02.qgs' version='auto' table="" sql= is not valid and cannot be added to the map. Reason:

I also get a warning on WFS message box (translated to English by me):

2019-06-20T13:27:15     WARNING    Analysis of DescribeFeatureType response failed for URL pagingEnabled='true' srsname='EPSG:25830' typename='xxxx_aparcabicis_estado' url='http://xxx/qgis/qgis_mapserv.fcgi.exe?map=D:%5CInstalado%5COSGeo4W64%5Capps%5Cqgis%5Cbin%5Cgis02%5Cgis02.qgs' version='auto' table="" sql=: Cannot find the features' attributes

I tried different things so far:

Manual request in browser - works
Force version to 1.0 / 1.1 / 2.0 in QGIS - no luck
Ignore axis orientation in QGIS - no luck

I am planning to migrate from QGIS 2.12 (which can load datatables correctly through WFS protocol) to QGIS 3, but this issue is a red line for me...and I'll have to stay in QGIS 2.12 against my will if this is not fixed or if there is not a workaround...in QGIS 2.12 I can add the datatable without issues...

EDIT 26.06.2019: I opened an issue on QGIS github repo and seems that Alessandro Passoti has fixed the bug and code has been merged to master. I will try it when next version is out!


texts: Area of Interest of focus map in ArcObjects.

texts:
I want to change the extent (area of interest of the view of the focus map) to the bounding box of the selected features. I use the code below ( I wrote lots of classes for my project and i'm using them in this code) I checked and I'm pretty sure that the envelope in the last line is correct and it represents the extent of selected features. but when i set the area of interest of the focus map to it, nothing happens and the view doesn't zoom to the selected area.
can anyone help?

    private void button4_Click(object sender, EventArgs e)
    {
        IMap map = mxdoc.FocusMap;
        gl.map = map;
        ILayer layer = gl.getSelectedLayer(comboBox1.SelectedItem.ToString());
        List<IFeature> features = new List<IFeature>();
        SF.featureLayer = layer as IFeatureLayer;
        features = SF.GetSelectedFeatures();
        Z.features = features;
        IEnvelope envelope = Z.ExtentOfSelected();
        map.AreaOfInterest = envelope;

    }


texts: Nearest neighbour analysis from existing Excel sheet

texts:
I learnt the Nearest Neighbor Analysis from QGIS Tutorials and Tips. The result of this analysis, see image below

I know that after running the distance to nearest hub analysis, it produces hub lines and when you open the attribute table of the hub lines, it shows where each point is mapped to. In my case, I already have an Excel sheet showing where each of the points is going to and I want to display them visually as it is already in the Excel sheet. How can I do this?


texts: arcpy.mapping.ExportToPDF causing symbols to separate from outlines?

texts:
I have a python script that runs through various data layers and then exports a final map to a PDF stored locally. In each map there are up to four different symbols. When I print to PDF, I see all of the symbols that are a circle come through fine, but when I print maps that contain triangle shaped symbols, the outline for the triangle is skewed from the symbol fill.  If I manually print to PDF from within ArcMap, this is a non-issue, this is only happening when I load my script and call the arcpy.mapping.ExportToPDF from within it.

I have already checked to see if the outline X/Y positions were off, but they're not, they're both set to 0.
I don't understand what's happening to the triangles that's not happening to the circle symbols in my maps. A comparison of the symbol properties between the two do not reveal anything obvious.
If I need to do this via python, is there anything I need to consider to prevent this issue, any options I need to use?


texts: Responsive Esri app: not sure how to collapse sidebar to button

texts:
Currently, I have a sidebar with text. How do I collapse it to a button when the screen size is below a certain pixel width? Here's the app on Code Pen: Click for App.
This sample code does what I would like to do, but rather with a side bar. Sample Code
I plugged this in to the JS, but nothing happened:
if (newVal === "large"){
 // clear the view's default UI components if
 // app is used on a mobile device
 view.ui.components = [];
}
});

I plugged this in to the CSS to see if I can get the sidebar to go away when the screen is less than 992 pixels, but nothing happened. I'm not sure if you can even call the sidebar element?
.esri-view-width-less-than-large .sidebar {
    display: none;
}

I figured I'd try because it does work with the zoom button:
.esri-view-width-less-than-large .esri-zoom .esri-widget--button {
    display: none;
}

Here's an older thread that collapses a sidebar into a button. But I'm not using Bootstrap, or even sure if I should. Bootstrap app


texts:
I have a set of GeoTIFF having photometric = palette, I need to convert it to a greyscale image without losing associated data values.
I need to do using Python or ArcGIS.

Changing the color could be done by setting the tiff tag to 1 (Luminance mode) using Python module PIL (Pillow):

from PIL import Image
im = Image.open("test_in.tif")
im.tag[262] = 1
im.save("test_out.tif")

The problem is that the generated file does not have any spatial ref., what should I do ?

Sample : image sample


texts: Getting selected feature and changing attribute incrementally in PyQGIS?

texts:
I am using QGIS 3.4.x and i need change attribute value, by order selection, for example:

I have 5 polygons,

| Order of selection   | Number     |
| Polygon 1............| set to 1...|
| Polygon 4............| set to 2...|
| Polygon 3............| set to 3...|

Here is my code:

capaA = iface.activeLayer()
features = capaA.selectedFeatures()
capaA.startEditing()
contador = 1
capaA.changeAttributeValue(f.id(), 5, contador)
capaA.commitChanges()


texts: Visualize smoke dispersion by interpolating point data

texts:
During the last weeks, I am trying to develop an application within my current working project, which aims to simulate smoke dispersion of fire incidents.

Software used: ArcGIS for Desktop/Server (version 10.2).

Description: my inputs are netCDF files containing data with concentration of airborne species in μg/m3. Available dimensions are time and altitude. Usually the values range from 0 to 500 including decimal digits. I am trying to figure out which method is the most appropriate to visualize point data to surface of this phenomenon. For example let’s suppose we want a raster which illustrates the smoke dispersion at a specific timestamp, for a specific altitude. I have tried several interpolation methods (IDW, Spline, Natural Neighbor and Kriging). I’d rather prefer to have an output of a smooth, real interpolation rather than an “eye-pleasing result”. Although for start, both ways are acceptable for me.

The problem is that, after using Kriging, some values of the resulting surface can be higher than the maximum of the input values (and lower than the minimum of the input values). Also the predicted values of intermediate points are not estimated properly. Is the Kriging interpolation the most appropriate method? If that’s the case, then should I have to parameterize semivariogram parameters such as nugget, partial sill, major range, in order to keep unchanged observed values as also unstretched predicted values after kriging interpolation? Can anyone help me define these parameters for the following sample data?
If anyone has another method on visualizing smoke dispersion I would like to know.

Sample data: I uploaded a working case in arcgis format (mxd + gdb + netcdf files included) in the following link: http://www.filedropper.com/casestudyfiles

General information and parameters used:

Coordinate System: WGS’ 84
Grid 250 x 260 (columns x rows)
Grid point distances (in decimal degrees):
Upper h: 0.0453645
Lower h: 0.047912
Upper x: 0.029341
Lower x: 0.0332265
Upper y: 0.0345845
Lower y: 0.034532
where:
x: horizontal distance
y: vertical distance
h: diagonal distance

Sample of concentration values descending:

[2.3348, 1.3012, 1.0288, 0.6168, …, 0.0084, 0, 0, 0, 0, …, 0]

Kriging parameters used:

Kriging Method Ordinary
Semivariogram model: Exponential
Output Cell Size: 3.58615417480469E-02
Search Radius Variable
Number of points: 8
Max Distance: 0.100


texts: Getting different json response for the same data from different cartodb accounts

texts:
I am using cartoDB database and making a web application. I have a data in my database which you can view it from here and its public https://farook.cartodb.com/tables/entire_data. The response of the query would be json. I have two accounts created in cartoDB database but the same data given in the above link is there in both the accounts. The problem is when i do query and get a json response, the json differs for the same data from two different accounts. You can view the json response of one account   where the order of the first row  is cartodb_id, the_geom, the_geom_webmercator, 2007_dec and so on.
and the json response for the same data from other account is also here
 where the order is cartodb_id, the_geom, the_geom_webmercator, region_name, 1990_january and so on. Why it behaves so? WHat would be the problem for different responses?


texts: How to sequence overlapping GeoJSON using bringtoFront and/or zindex?

texts:
I currently have multiple GeoJSON polygons that overlap. I want to be able to layer them so I can click a GeoJSons a popup menu for that specific polygon to popup. Additionally, I want to have a side menu that toggles between the GeoJSONs. I am a beginner and any guidance is helpful.

I have used both bringtoFront and zindex methods, although I’m not sure its correct. Toggling between different menu options disrupts the sequencing of the GeoJSON layering. How can I fix this?

Code for menu with bringtoFront: https://github.com/DanFinelli/overlapGeoJ/blob/master/test1_DesBarres_usingFrontmethod.html

Menu with zindex: Same location: /overlapGeoJ/blob/master/test1_DesBarres

Both look like this (notice side menu):

Alternatively, I tried using bringtoFront and eliminating the menu. This seems to work initially, although when I refresh the page, the layer sequence is occasionally out of order. Why is this happening / Is there a way to fix this? Ideally, I would be able to have the menu bar, but this method seems to work best right now.

No menu with bringtoFront: overlapGeoJ/blob/master/test1_DesBarres_allOne_noMenu_TESTTEST.html

This looks similar (minus style changes), but without the side menu.


texts: PostGIS: ST_Clip() throws non-noded intersection between LINESTRING

texts:
I have a polygon and a set of rasters. I'm trying to clip raster with polygon.

As you see, my rasters is divided into tiles. Any tiles that is contained by the polygon has ST_Overlaps(polygon, rast_geom_4326) = 'f', obviously. And it leads to non-noded intersection error.

But, I also have the same problem with this query:

SELECT ST_Clip(rast, ST_Transform(polygon, rast_geom_4326))
FROM landsat8
WHERE ST_Overlaps(polygon, rast_geom_4326)

Is there any function to dissolve the polygon with tiles, to get rid of "non-noded intersection between LINESTRING".
I've read a presentation about this error postgis-power.pdf. But, I can't find the solution for my problem.


texts: ElasticSearch behaving different between cities

texts:
I'm experiencing some very strange behavior from Elasticsearch. I am using geo_bounding_box to search the area visible in Google Maps. I have data in New York and San Fransisco. New York behaves as expected. San Fransisco does not, which is confusing me.

When searching in San Fransisco, I have to invert the longitude for east and west in order for data to be returned.

Searching in New York works just fine

// New York
"geo_bounding_box" : {
    "location.coordinates": {
        "top_right": [40.75595545633613,-73.85303608398436],
        "bottom_left": [40.64820096366504,-74.03156391601561]
    }
}

// San Fransisco (Normal)
"geo_bounding_box": {
    "location.coordinates": {
        "top_right": [37.79734048601642,-122.39438402099609],
        "bottom_left": [37.7692568462339,-122.4390159790039]
    }
}

// San Fransisco (Swapped)
"geo_bounding_box": {
    "location.coordinates": {
        "top_right": [37.79734048601642,-122.4390159790039],
        "bottom_left": [37.7692568462339,-122.39438402099609]
    }
}

As you can see, swapping the longitude values returns results but it does not make any sense because we are searching outside of the bounding box.

I am using elasticsearch Version: 1.4.4

[EDIT]
This is an example of geo data stored in the San Fransisco area

"location": {
    "coordinates": [37.7876027, -122.4215609],
    "type": "Point"
 }


texts: How to merge polygons that have the same values in one column in Geopandas?

texts:
I have an shp.
with these columns:

ind code area
1    12  200
1    12  100
1    12  23
2    30  223
2    30  112
3    29  234
4    20  232
5    23  211

I want to combine each polygon with the same value in the ind column as one.

what I think is needed is a merge operation but how should I do it? Also will the area be summed of the polygons that will be one? for example will we have one row of ind=1 that its area will be 323?

The examples with the merge are like this and involve two shp
's: how should I do with one shp?

# One GeoDataFrame of countries, one of Cities.
# Want to merge so we can get each city's country.
In [11]: countries.head()
Out[11]:
                                            geometry               country
0  POLYGON ((61.21081709172574 35.65007233330923,...           Afghanistan
1  (POLYGON ((16.32652835456705 -5.87747039146621...                Angola
2  POLYGON ((20.59024743010491 41.85540416113361,...               Albania
3  POLYGON ((51.57951867046327 24.24549713795111,...  United Arab Emirates
4  (POLYGON ((-65.50000000000003 -55.199999999999...             Argentina

In [12]: cities.head()
Out[12]:
           name                                     geometry
0  Vatican City  POINT (12.45338654497177 41.90328217996012)
1    San Marino    POINT (12.44177015780014 43.936095834768)
2         Vaduz  POINT (9.516669472907267 47.13372377429357)
3    Luxembourg  POINT (6.130002806227083 49.61166037912108)
4       Palikir  POINT (158.1499743237623 6.916643696007725)

# Execute spatial join
In [13]: cities_with_country = gpd.sjoin(cities, countries, how="inner", op='intersects')


texts: Custom tile server - how to create a layer using Mapnik and mod_tile using POSTGIS db

texts:
I have created a Ubuntu 14.04 tile server.
I loaded an OSM base map into the POSTGIS database and created a slippy-map using OpenLayers 3.9.
Then I loaded data of an overlay into the POSTGIS database and now I am trying to create a layer for it.

To create layers, the only solution with decent documentation seems to be Tilemill.
But to use Tilemill on my server I have to use "SSH connection forwarding", explained here.
I don't want to create a security leak into my server.

Are there any other options, with decent documentation, with which I can create custom layers for my map?

What I already 'know':

Create a simple map with Mapnik
Store shape files into the POSTGIS database
Use OpenLayers to display the layer

What I need to know:
I have a simple overlay (created with Mapnik):

This overlay has to be rendered into different tiles and have zoom levels, just like a OSM base map. I want to use this overlay and put it over an area on my OSM-tiled map.

What do I need to be able to create a layer that can be displayed with OpenLayers like:
url: '/overlay/{x}/{y}/{z}'?


texts: QGIS Field Calculator Results Removed When Saving Edits

texts: Mac OSX 10.6.8 QGIS 1.8.0 : Using the field calculator from the attribute table, the $area of each feature is shown nicely in the table until I try to save it, then all the values are replaced by NULL so are no longer available for use. Furthermore, if the column is left there and the field calculator asked to update it, all values remain NULL. Any fix?


texts: Change the look of GeoServer welcome page

texts: Does anyone know how to change the look of GeoServer welcome page? I need to know where to change it.


texts: How to convert file .shp to .tif using ogr or python or gdal

texts:
I need to convert files. I'm trying to use gdal_rasterize

gdal_rasterize -b 1 -burn 0 -l file file.shp work.tif

and the output is the following:

  ERROR 10: Pointer 'hDS' is NULL in 'GDALGetProjectionRef'. Warning 1:
  The input vector layer has a SRS, but the output raster dataset SRS is
  unknown. Ensure output raster dataset has the same SRS, otherwise
  results might be incorrect. Segmentation fault (core dumped)


texts: Publishing a layer with vector field in ArcGIS Server results in white map

texts:
I have a raster layer, rendered with the vector field method in the symbology tab showing the direction and magnitude of the flow of water after events of heavy rain. This works fine in ArcMap 10.6.1. I want to implement this in my WebGIS

However, when I publish my MapDocument in ArcGIS-Server as AGS and WMS the layer is not drawn. I get a blank map when adding the service to a new ArcMap-Document. Same goes for viewing the service in ArcGIS Online Map Viewer from the ArcGIS Server Manager.
ArcGIS-Server-protocols gives me severe warnings, "Failed to rename cache folder" and "Method failed.HRESULT = 0x80070057 : The parameter is incorrect. "

Publishing the same datasource(s) without rendering them as vector field, results in the same Error messages in ArcGIS server Manager. Still the layer is drawn, so I guess, these messages are not the real problem.
Is it even possible/intended to publish a layer with vector field as AGS/WMS?


texts: Export layer with symbology with open-source tool

texts:
Similar to ArcGIS's "Layers", and "Layer packages", are there any open-source analogs? If I have a PostGIS table opened in QGIS (or GRASS, etc.), can I export it WITH the data, as well as with a symbology definition, etc.

I want to send a layer to someone that they can open in Arc/QGIS/GRASS/etc. which will retain the symbology and labeling that I setup on my end. Can this be stored within a PostGIS table?

Thanks.


texts: How to style ways with CartoCSS depending on a relation property (OSM)

texts:
I'm using CartoCSS together with an OSM Postgres DB (hstore on).
I want to set the line color depending on the operator tag of relations (routes).
How can I do that?

Update

Thanks to Paul Norman for showing how to include tags only in hstore.
As Andre Joost points out, for the operator tag that's not necessary, because it's already included with the default osm2psql config.

Doing some more research, I could dig deeper into the problem and with some surprise found out that there's a divergence between the documentation on http://wiki.openstreetmap.org/wiki/Osm2pgsql/schema and my DB instance.

It says:
planet_osm_line:
This table contains all non-closed ways which were imported. Additional rows are created for ways which are members of type=route relations. ... The osm_id is the negative ID of the relation

While there are rows with negative osm_id's in the DB, I could not find such an entry for 2 randomly tested ways, e.g. for http://www.openstreetmap.org/way/280802857. As you can see, this way is a member of a relation (3731203) fulfilling the mentioned requirements.

Now I'm not sure if that's the source of my problem. I don't know if that osm2pgsql doc is up to date and I don't know if mapnik uses this DB entries with negative osm_id to evaluate relation tags. But I would guess so.

As a quick fix I manually added a column to the planet_osm_line table with the info I need. But I'd prefer to get rid of that hack asap.

Any hints how to proceed?


texts: Slanted raster along the line? Wind erosion model and windbreak effectivity

texts:
I'm working on wind erosion modelling and windbreak potential. Imagine windbreak, which has some values of optical porosity (in %) and this values determinates the effectivity of windbreak in specific part of windbreak. I want to compute this effectivity in some distance behind this windbreak and make a raster from it. That's not a problem, if the windbreak is oriented orthogonal and wind direction is upright on the windbreak (picture 1).

The main problem is when windbreak (line) do not lays oriented orthogonal and / or wind direction isn't upright on the windbreak (picture 2 and 3). I can't find any desription for module GDAL about this, specialy for SetGeoTransform function, where is 3rd and 5th argument define rotation of raster cells. My idea is that y axis cell rotation is usefull when windbreak (line) is not orhtogonal oriented, so whit this I can snap raster along the line, and x axis cell rotation can be used for turn a raster by the wind direction.

I hope that you can understand what I mean. Anyway I can explain more about this when it's necessary.

Here's my code what i have done.

import numpy
import os
import arcpy
from osgeo import gdal, gdal_array, osr

os.chdir("d:\wind")

# matrix contains values of optic porosity for windbreak, 6 horisontal layers, each layer 9 vertical values
porosity_matrix = numpy.matrix(
            [[96, 95, 96, 78, 95, 100, 93, 70, 74], [73, 57, 45, 42, 71, 80, 65, 43, 50],
            [47, 29, 32, 30, 31, 30, 29, 34, 35], [41, 48, 32, 40, 61, 52, 37, 53, 47],
            [28, 31, 28, 29, 57, 49, 36, 46, 34], [28, 48, 37, 24, 39, 27, 30, 24, 20]])

# definition of line coordinates, finds a first point of raster extent
arcpy.env.workspace = r"d:\wind"
layer = "windbreak.shp"
desc_layer = arcpy.Describe(layer).shapeFieldName
cur_layer = arcpy.SearchCursor(layer)
for x in cur_layer:
    obj = x.getValue(desc_layer)
    FP = obj.firstPoint
    LP = obj.lastPoint
coordFP = [FP.X, FP.Y] # coordinates of line's first point
coordLP = [LP.X, LP.Y] # coordinates of line's last point
coordDiference = [(coordFP[0] - coordLP[0]), (coordFP[1] - coordrLP[1])]
y_res = int(coordDiference[1]) / numpy.shape(prosity_matrix)[1] # definition of raster's cells y resolution (based on measured data)

# function for compute effectivity and make raster layer
def effectivity(in_matrix, row_number, ras_name):
    for i in range(9):
        Y = in_matrix[row_number, i]
        values_row = []
        for X in range(5, 405, 5): # X is a distance, 5m step
            Z = 46.1894 + 0.1709 * X - 0.0008 * X * X - 0.0004 * X * Y - 0.000094226 * Y * X # windbreak effectivity empiric equation
            Z100 = 100 - Z # Z is a effectivity of windbreak for one value of porosity
            if Z100 > 100:
                Z100 = 100
            values_row.append(Z100)
        if i == 0:
            out_matrix = numpy.matrix((values_row))
        else:
            matrix_temp = numpy.matrix((values_row))
            out_matrix = numpy.concatenate((out_matrix, matrix_temp))
    ## create raster
    name = str(ras_name) + ".tif"
    nrows, ncols = numpy.shape(out_matrix)
    xres, yres, xmin, ymax = (5, y_res, FP.X, FP.Y)
    # important part
    geotransform = (xmin, xres, 0, ymax, 0, -yres) # this is important for inclinate raster
    ras_name = gdal.GetDriverByName("GTiff").Create(name, ncols, nrows, 1, gdal.GDT_Float64)
    ras_name.SetGeoTransform(geotransform)
    # important part ends
    srs = osr.SpatialReference()
    srs.ImportFromEPSG(5514)
    ras_name.SetProjection(srs.ExportToWkt())
    ras_name.GetRasterBand(1).WriteArray(out_matrix)
    ras_name = None

# for every horisontal layer of optical porosity creates a raster
for q in range(6):
    name = "windbreak_" + str(q)
    effectivity(prosity_matrix, q, name)
    print "Created raster of effectivity no.: " + str(q)


texts: Replace ArcGIS service files while scripting into the server

texts:
I have an ArcGIS service into my Portal (10.3), also I have an script that replace directly into the database where those files are stored.

The problem is that when I run the script I see a blend of the past last layer with the new layer.

The output is

output = "C:/arcgisserver/directories/arcgissystem/arcgisinput/pronosticos/pronosticos_db.MapServer/extracted/v101/pronosticos.gdb"

The replacement is made with a simple clic

arcpy.Clip_analysis("gfs_precip_gis_48_"+ date + ".shp", clip, output + "/precipitacion_48horas")

Also I set arcpy.env.overwriteOutput = True


texts: Extract values from large rasterstack, R

texts:
I have a large rasterstack of about 500 objects. I want to sample easch object with the use of a SpatialPointDataframe and then export the results as file.csv. I have tried the following but within the SpatialPointDataframe I get a large matrix of the extracted values and I can not export it. It might be something basic, but I can not see it.

Any ideas how to solve this?

points$twsx<-extract(largerasterstack,points)
writeOGR(obj=points, dsn=".", layer="extracted", driver="ESRI Shapefile")

Error in writeOGR(obj = points, dsn = ".", layer = "extracted", driver = "ESRI Shapefile") :
  Can't convert columns of class: matrix; column names: twsx


texts: Using SRTM data, how to get the coordinates of the peaks visible from a location?

texts:
Using SRTM data and a coordinate-altitude database of the peaks, I want to get the coordinates of the visible peaks from my location. I want to make an application similar to this.

How is this possible?

I have to calculate the viewshed offline, because up in the mountains there is no internet connection. The view shed analysis could be done only with ArcGIS software or there is another API too? The application will be developed for IOS.


texts: Calculate line distances inside of polygons using ArcGIS for Desktop?

texts:
I'm working with two data sets:

NHD polyline stream layer for my entire state
HUC Watershed boundary Polygons for the entire state

I am looking for a way to calculate the total length of streams within each watershed boundary polygon, and would ideally like to have each polygon then attributed with the sum of stream miles within its boundary.

Can anyone help me?


texts: QGIS not always recognizing the field name from excel files

texts:
I'm importing multiple excel files into QGIS (version 2.18.7) by dragging and dropping them into QGIS. The excel files don't contain any coordinates but data that I need to join to vector layers.

My problem is, that sometimes, seemingly at random, QGIS chooses not to use the entries in the first row as the field names. Instead the attribute table labels the field field 1, field 2 and so on. I guess I could save all the excel files as CSV files but I'd prefer not to add an additional step.

Is there some setting or import method that I'm missing?


texts: How to modify widget config programmatically?

texts:
I have created custom widget in WAB developer edition V2.9.

I want to change value programmatically in widget config. On run time I am able to set value using below code but does not update in config file.

this.config.tempProperty = "Test" ;

If I refresh application then tempProperty still showing old value.

Is there any way to update widget config programatically?

Regards,

Prashant


texts: How to find distances between two points specified by attributes

texts:
In ArcGIS 10.3, I have a point dataset of Students with which college they study at. I need to find out can I run a network analysis on the entire dataset which will find the distance of each point to the facility stated in the 'College' attributes without running for each college individually?

I have a dataset of students and a separate dataset for the colleges they go to. I know I can do it by selecting each college individually however was wondering if there is a way to do it all at once?


texts: If two symbols in same QGIS layer are too close, show only one?

texts:
I have a shapefile layer with different underwater, over water and water surface stones. These are often too close to each other to be shown nicely on the print composer generated map.  I use svg symbols for the stones, and they are styled (svg for the stones are chosen) as categorized by a class id in the shapefile table.

How do I get QGIS to show only stones that are, for instance, more than 2mm or xx map units apart?


texts: Why does GeoServer SLD sometimes fail when copy/pasting sample code?

texts:
Sometimes I find that GeoServer SLD files fail to validate, even when copying code directly from the SLD Cookbook.

For example, I start with the polygon with styled label sample code, paste it into a new GeoServer style, validate it, and confirm that everything is fine.

Next I try to add the label halo code:

<Halo>
  <Radius>3</Radius>
  <Fill>
    <CssParameter name="fill">#FFFFFF</CssParameter>
  </Fill>
</Halo>

I can see that the halo is located just before the closing </TextSymbolizer> in the SLD Cookbook example, so I paste it just before the </TextSymbolizer> in my style:

  <Fill>
    <CssParameter name="fill">#000000</CssParameter>
  </Fill>
  <Halo>
    <Radius>3</Radius>
    <Fill>
      <CssParameter name="fill">#FFFFFF</CssParameter>
    </Fill>
  </Halo>
</TextSymbolizer>

This now fails to validate with the message:

  line 41: cvc-complex-type.2.4.a: Invalid content was found starting
  with element 'Halo'. One of
  '{"http://www.opengis.net/sld":VendorOption}' is expected.

This error message doesn't really help me. What is the cause of this problem and how can it be rectified?


texts:
I'm returning to the same question all over again. I'm dealing with electrical network and I'd like to build topology for all network lines in database so I can construct nodes and edges dynamicly for network calculations.

What I have is 2D geography for lines and plenty of different types of points that should together build topology. What I need is a proper way to build nodes and construct edges where endpoint touches other line (with tolerance) or two endpoints touch.  I've ended up writing SQL script that does that (uses lots of resources for 100.000 lines). I wonder if there is a better solution using topology?

For what I understand Topology-Geometry does not allow two edges to intersect, so this kind of topology is not useful for infrastructure/utility where conductors, pipelines or even roads cross each other but there is no "node".

So, is there Topology-Network for PostGIS implemented or there is no such thing yet? I remember I solved this problem in SpatiaLite back then for research purposes.


texts: fusion of different resolution satellite image?

texts:
I have two dataset

Worldview (38cm: pansharpened) - R,G,B
Planetscope (3m) - R,G,B,NIR

But, worldview image has only R,G,B, so I can't figure out spectral response for classification.
I think it's not pansharpening, but is any method to combine them with high resolution like worldview with NIR reflectance?


texts:
Hello GIS Stack Exchange,

I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem.

I'm also having some trouble debugging my code. Basically i keep getting the following error from the Solve_na function

"An error occured on line 72
ERROR 030092: VRP Solver failed due to invalid input.
Invalid input in the NA classes.
Failed to execute (Solve)."

It strikes me that even though there is an error, the depot and orders network analyst sublayers are well loaded with values from the input feature classes, while the routes network analyst sublayer does not load the values from its corresponding feature class. This implies that there must be a problem adding locations to the route from the corresponding route feature class that i created.

Here is the code below

import arcpy
from arcpy import env

try:
    arcpy.CheckOutExtension("Network")

    env.workspace = arcpy.GetParameterAsText(0)
    env.overwriteOutput = True

    inNetworkDataset = arcpy.GetParameterAsText(1)
    outNALayer = arcpy.GetParameterAsText(2)

    impedanceAttribute = "CABLE_COST"
    distanceAttribute = "Cable_Length"
    timeUntis = "Minutes"
    distanceUnits = arcpy.GetParameterAsText(3)
    inTurbines = arcpy.GetParameterAsText(4)
    inDepots = arcpy.GetParameterAsText(5)
    inRoutes = arcpy.GetParameterAsText(6)

    depotFieldMappings = "Name Name #;"
    routeFieldMappings = "Name Name #; StartDepotName StartDepotName #; EndDepotName EndDepotName #; StartDepotServiceTime StartDepotServiceTime #; EndDepotServiceTime EndDepotServiceTime #; EarliestStartTime EarliestStartTime #; LatestStartTime LatestStartTime #; Capacities Capacities #; FixedCost FixedCost #; CostPerUnitTime CostPerUnitTime #; CostPerUnitDistance CostPerUnitDistance #; OvertimeStartTime OvertimeStartTime #; CostPerUnitOvertime CostPerUnitOvertime #; MaxOrderCount MaxOrderCount #; MaxTotalTime MaxTotalTime #; MaxTotalTravelTime MaxTotalTravelTime #; MaxTotalDistance MaxTotalDistance #; SpecialtyNames SpecialtyNames #; AssignmentRule AssignmentRule #;"
    turbineFieldMappings = "Name NAME #; TimeWindowStart1 TimeWindowStart1 #; TimeWindowEnd1 TimeWindowEnd1 #; MaxViolationTime1 # 0"

    outLayerFile = "C:/data/output" + "/" + outNALayer + ".lyr"

    arcpy.MakeVehicleRoutingProblemLayer_na(inNetworkDataset,outNALayer,
                                            timeUntis,distanceAttribute,
                                            "Minutes", distanceUnits, "1/1/1900", "#", "Low","#",
                                            "NO_UTURNS", "#", "TRUE","","STRAIGHT_LINES")

    arcpy.AddLocations_na(outNALayer, "Depots", inDepots, depotFieldMappings,"")

    arcpy.AddLocations_na(outNALayer, "Routes", inRoutes, , "")

    arcpy.AddLocations_na(outNALayer, "Orders", inTurbines, turbineFieldMappings,"")

    arcpy.Solve_na(outNALayer)

    arcpy.SaveToLayerFile_management(outNALayer,outLayerFile,"RELATIVE")

    arcpy.AddMessage("Script completed successfully")

except Exception as e:

    import traceback, sys
    tb = sys.exc_info()[2]
    arcpy.AddMessage("An error occured on line %i" % tb.tb_lineno)
    arcpy.AddMessage(str(e))


texts:
The map below is produced in ArcGIS software using the multiple attribute visualization tool (a map based on two attributes the color represents different zones based on the zone attribute value and the size of the points indicates the observation in that zone based on observation attribute value of the layer), but what i want is to do the same thing in SLD.

I read the SLDCookbook but i didn't see an example for two attributes.

My first question is the possibility of doing this in SLD?

My second question is how to do it?

My third question is is it possible to do the same visualization in QGIS?


texts: ST_Union 'MIN' on rasters with result raster having DN values as raster table column value

texts:
I am new to working with rasters in PostGIS. Although I have spent couple of days trying to find solution for my problem, I couldn't seem to crack it without some help.

Here's my problem:
I have multiple overlapping rasters in a PostGIS table (about 500 records) with each raster size about 1200x1000 (30m res.) but varies since data is dumped from different sources. The table looks as follows:

-- Table "coverage_rast"

   id   |   rast
(bigint)| (raster)
--------------
   5489 | "02301ff..."
   5489 | "238000f..."
   5489 | "02301ff..."
   1234 | "238000f..."
   1234 | "02301ff..."
   4567 | "238000f..."
   4567 | "238000f..."

Each raster record represents a coverage with some DN values(ranging 0-100). When I perform CREATE TABLE sometable as SELECT ST_UNION(rast,1,'MIN') from coverage_rast; gives me resultant raster with minimum values as DN values at each grid cell and takes about 2 minutes of query time. Instead I want that the resultant raster should be such that the DN value at each grid cell should represent "id" of the raster which has minimum value at that location.

I tried using SELECT val,id FROM (SELECT ST_Value(rast, 1, geom) val,id FROM coverage_rast,(SELECT st_setsrid(ST_MakePoint(-80.85495, 35.21887),4326) geom)tbl
WHERE ST_Intersects(rast, geom)) as t1 ORDER BY val LIMIT 1 which gets the id and the minimum DN value at given location. Was thinking of extending this by creating a uniform grid of points spaced 30m apart and passing geom column and then creating a raster out of it, but this would be pretty slow and sloppy.

I am hoping to find a solution which can extend st_union to assign id value as DN of raster where existing DN value is minimum of all the overlapping rasters.


texts: Automatically adding Z-values from a DEM to an already created polygon

texts:
We have excavated a very large 5.000 year old fish fence, which was documented by photogrammetry, and is now being digitized. I started digitizing the orthophoto in QGIS and everything is cool. Now I've been ask to add Z-values to each of the corresponding polygons (pieces of wood). I then created a DEM of the model in Agisoft Photoscan Pro, and all the information is there.

Is there a way to to automatically transfer the Z-values from the DEM, to the overlaying polygon?


texts:
How can I remove the alphabets and show the numbers only in a label expression of a layer?

For example, I have a field with values: TK209, 01TKRW394, 045TK, 089EYZ46 and I want to display labels as: 209, 01394, 045, 08946 respectively.


texts:
I'm very new to QGIS and am just learning the intersect function. I have about 10 polygons that overlap (not perfectly) and one layer of about say 15 points. I want to know with which of the polygons each point intersects. The goal is to eventually have data that looks like:

TRUE/FALSE not needed. Any way to denote yes the point intersects with the polygon or no it does not will suffice.


texts: Iterating Fields in shapefile and exporting after interpolation geoprocessing?

texts:
I have two shapefiles to be used for interpolating data.

The first is a survey point with the following attributes:

The second is a boundary file (Polygon) with the corresponding descriptions as an attribute for the join:

Now I need to interpolate the data using a IDW interpolation looping through the point shapefile to interpolate each attribute field.

Where it gets tricky is that the point needs to be interpolated according to the extent that they lie in. For example below. The IDW interpolation has to only use the selected points and use the extent of the boundary (Selected).

Now I have built a model to do this if I split all the point to the corresponding boundary  and split the boundaries which works but this is a tedious task and im sure there is a easier way.

Here is the current model:


texts: "Direction/Length" Tool not working with Polygons in ArcMap 10.3

texts:
My "Direction/Length" right-click option is not working when trying to draw a polygon.

I start a shape by dropping a single vertex, right-clicking and choosing "Direction/Length".

I enter in the degrees, minutes, seconds, and length that I need and press Enter.

Nothing happens. I right-click a second time and repeat the process. This time a vertex is drawn where I want it. (Weird, but I go with it)

I repeat the process again for the next vertex, same thing: Nothing happens on the first try, but the second try it drops a vertex.

Only this time, this new vertex is broken off from the rest of the shape, and any prior vertices are also cut off and made independent points.

What is going on here? Each new vertex remains independent and does not form a shape.


texts: Fiona import error when updated to version 1.7

texts:
I would like to update scipy to version 0.19 as it has the nice calculate area of a convex hull method. When updating with conda, this updates fiona to version 1.7. Now I get an error trying to import fiona.

  ImportError:
  dlopen(/Users/phil/anaconda/lib/python2.7/site-packages/fiona/ogrext.so,
  2): Library not loaded: @rpath/libnetcdf.11.dylib   Referenced from:
  /Users/phil/anaconda/lib/libgdal.20.dylib   Reason: Incompatible
  library version: libgdal.20.dylib requires version 12.0.0 or later,
  but libnetcdf.11.dylib provides version 11.0.0

I have tried a number of fixes, for example here and have seen this regarding geopandas but none of these worked. Do I have to roll back to fiona 1.6 and scipy 0.18?


texts:
I am trying to call ZoomToLayer from my custom code (shown below).

ESRI.ArcGIS.esriSystem.UID pUID = new ESRI.ArcGIS.esriSystem.UID();
ICommandItem CmdItem;

//pUID.Value = "{18DF94D9-0F8A-11D2-94B1-080009EEBECB}";
pUID.Value = "esriArcMapUI.LayerContextMenuItems";
pUID.SubType = 7;

CmdItem = IApplication.Document.CommandBars.Find(pUID, true, false);

CmdItem.Execute();

Upon investigation I found that CommandItem.Action is throwing COMException:

'CmdItem.Action' threw an exception of type 'System.Runtime.InteropServices.COMException - This method cannot be called on built in commands.

I am trying to use it as a command and not tool...hence I cannot understand the exception.

Any ideas why it's happening?


texts: How can I use tiles in an ArcGIS .tpk file with Google Maps?

texts:
ArcGIS can export a map as server tiles as a compressed folder with the extension .tpk, as described in the  ArcGIS documentation.

However, it is not clear how I can get Google maps to read these files.

I have previously used a ruby script to generate tiles, but ArcGIS can generate them more rapidly. However, my application currently expects to find a set of .png tiles for each zoom level, e.g. for zoom level 3:

[user@server map]$ ls *-3.png
0-0-3.png  1-2-3.png  2-4-3.png  3-6-3.png  5-0-3.png  6-2-3.png  7-4-3.png
0-1-3.png  1-3-3.png  2-5-3.png  3-7-3.png  5-1-3.png  6-3-3.png  7-5-3.png
0-2-3.png  1-4-3.png  2-6-3.png  4-0-3.png  5-2-3.png  6-4-3.png  7-6-3.png
0-3-3.png  1-5-3.png  2-7-3.png  4-1-3.png  5-3-3.png  6-5-3.png  7-7-3.png
0-4-3.png  1-6-3.png  3-0-3.png  4-2-3.png  5-4-3.png  6-6-3.png
0-5-3.png  1-7-3.png  3-1-3.png  4-3-3.png  5-5-3.png  6-7-3.png
0-6-3.png  2-0-3.png  3-2-3.png  4-4-3.png  5-6-3.png  7-0-3.png
0-7-3.png  2-1-3.png  3-3-3.png  4-5-3.png  5-7-3.png  7-1-3.png
1-0-3.png  2-2-3.png  3-4-3.png  4-6-3.png  6-0-3.png  7-2-3.png
1-1-3.png  2-3-3.png  3-5-3.png  4-7-3.png  6-1-3.png  7-3-3.png

but it is not clear to me what the analagous representation of these files is in a .tpk layer. An example of my output is map_tiles.tpk


texts: Accessing ArcGIS Pro using ArcGIS Online public account?

texts:
When l try to log into ArcGIS Pro it does not accept because my ArcGIS Online account is a public account.

How can l fix this problem?


texts: Adding Label Classes to Polyline in MapInfo Pro

texts:
I want to add 2 label classes to one polyline shapefile using x,y coords.

I need to add the arrival time along the line from the start (x_start & y_start)
& the finishing time along the line from the end (X_end & y_end)

Can this be achieved through an expression?

I have created the desired output in QGIS and ArcGIS (see image below), but I need to replicate this in MapInfo if possible.