texts: Convert .osm.pbf file to a raster (tif, asc or rst)

texts:
I downloaded the .osb.pbf file for my country, and I want to import it into Graphab.

To import it, I need to have a raster file as the documentation file mentions:

  The second window is for importing the landscape map. It must be a raster  le (*.tif, *.asc, *.rst) in which the value of each pixel corresponds to a category (land cover or other classi cation).

I tried searching how to convert .pbf into raster, but I couldn't find anything helpful.

Having the input file map.osb.pbf, how can I convert into tif, asc or rst so that I can use it in this app?

Related: Finding "terminal" cities on the map


texts: Comparing two tables, using PostgreSQL Intersect (on PostGIS geometry)

texts:
I am trying to compare two tables, that are suppose to be equal. One is a reference table (with the "correct" values) and the other is a test output. That is, they have same columns and columntypes. I then want to find the rows that are "identical".
I figured that PostgreSQL's' Intersect (or maybe its opposite, Except) would work here, since it selects rows that appear in both tables.

This works fine if I give it rows that are completely the same:

select 2, ST_Polygon(st_geomfromtext('LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)'), 4326)
intersect
select 2, ST_Polygon(st_geomfromtext('LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)'), 4326)

returns:

row 1: 2;0103000020E6100000010000000500000000000000000000000000000000000000000000000000F03F0000000000000000000000000000F03F000000000000F03F0000000000000000000000000000F03F00000000000000000000000000000000

However, if the start/end vertex is changed in the geometry column in one of the rows, it returns zero rows:

select 2, ST_Polygon(st_geomfromtext('LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)'), 4326)
intersect
select 2, ST_Polygon(st_geomfromtext('LINESTRING( 1 0, 1 1, 0 1, 0 0, 1 0)'), 4326)

That is, if i used ST_Equals on the geometries, it would return true. But in Intersect, this is not true.

Is there a smarter way to compare entire tables?


texts: Use arcpy.mapping.RemoveLayer to remove layers that are defined in list?

texts:
I can't seem to find anything as far as defining a list of layer names and then removing those layers from all mxds within a folder. This is the code I have worked up so far, but I have to cut and paste a new entry for each new layer name. Just getting into programming. I poached a lot of this and made it work for what I needed.

ArcGIS 10.3.1

Windows 10

This is my final product following everyone's advice.

#import modules
import os, arcpy

#provide project folder path
folderPath = "C:\Project Folder"
#define list of layers to be removed from mxd files as the name appears in table of contents
LayersToRemove = ['layer 1','layer 2']
for fileName in [x for x in os.listdir(folderPath) if os.path.splitext(x)[1] == ".mxd"]:
    fullPath = os.path.join(folderPath, fileName)
    if os.path.isfile(fullPath):
        mxd = arcpy.mapping.MapDocument(fullPath)
        print(fileName)
        for df in arcpy.mapping.ListDataFrames(mxd):
            for lyr in arcpy.mapping.ListLayers(mxd, "", df):
                if lyr.name in LayersToRemove:
                    arcpy.mapping.RemoveLayer(df, lyr)
                    print("     " + df.name + ": removed: " + lyr.name)
        #saves a copy of the map
        mxd.saveACopy("copy_" + fileName)
        del mxd


texts: Interpreting scale in Google Earth Engine (using Hansen data)?

texts:
I previously posted about this same problem as Iterating over years for features in feature collection using Google Earth Engine?

I realized recently that the results that I was getting based on the solution were actually incorrect as I had misread what the variables mean. In fact, it is impossible to get the 'gain' in trees per year so I'm not really sure what the values the code computed were.

Anyhow, I've rewritten the code, and it seems to work in theory, but I am having difficulty with one aspect of it. In particular, I understand that the resolution of the Hansen data is 30 meters per pixel. For this reason, I followed the tutorial for the data and tried to set scale: 30 in my image reduction. However, this causes the console to time out, even though I set maxPixels: 1e9.

When I increase the scale to 100 or greater, it works fine. However, I have been reading about scale here: https://developers.google.com/earth-engine/scale and I still don't have a clear idea what exactly it means for the interpretability of my results. Ideally, I am trying to use the data to be able to talk about square meters of loss in forest, as they do in the tutorial: https://developers.google.com/earth-engine/tutorial_forest_03

Is it okay for me to set scale to higher than scale:30, and what will that mean for interpreting the computation?


texts: Retrieving individual pixel height data given color table/relief data and color shaded relief map using C# and GDAL?

texts:
I am using C# GDAL/OGR/OSR bindings. I have a GeoTIFF file where each pixel is stored as a color in a Red, Green, and Blue raster band. I have a color table/color relief file (.csv) which I am able to import using OGR's CSV driver. This file stores a starting elevation, red, green, and blue value per line. The first line begins at -9000 meters and the last line ends at 21000 meters.

I know there is a command using gdaldem to use a color relief file in order to create a color shaded version of a DEM, but is the reverse possible? If it is, how  can you do this using the GDAL/OGR/OSR C# API? The reason it is necessary is that I need to convert each pixel's color value to a normalized value between 0 and 1. 0 represents the minimum elevation and 1 represents the maximum. Therefore, it is not strictly necessary to convert the color pixel to a raw elevation (in meters). The color can be normalized directly if possible.

It seems like the way to go about it would be to find the two elevations a color falls between and then use a reverse linear interpolation algorithm to determine the normalized point of the color between the two elevations, however right now  I can't figure out how that is possible. I think a color could fall within multiple ranges.

So, is this possible, or impossible as I imagine?


texts: Delineating zones based on number of polygons that are in overlay

texts:
I am working in urbanism and I have a number of polygons that represent perimeters where certain "programs of revaluation" have been carried out.

However, as can be seen on the map below, over time, these perimeters have overlapped. Now I would like to create a new map, expressing how many perimeters are overlapping where. So this would mean, asking QGIS to create new zones based on the number of overlapping original polygons.

How could I do this? I know about the existence of heat maps but I am not sure this is what I need? Do heat maps only seem to work on point layers?

I am working in QGIS 3.4.2 Madeira on a MacBook


texts: I have a satellite image. I want to sample all the trees and vectorize them at once

texts:
I have a satellite imagery. I want to vectorize all the trees at once by color sampling. How to do it?
I used Photoshop to sample the all the various color ranges of trees [Green] to distinguish between trees and built-up area. Can I use this technique as the Photoshop converted the trees in satellite image in one colour. As you can see in this image I sampled all the trees and converted to black colour to distinguish between trees and built-up area. Now can I select this color from this image and convert it to a VECTOR for Land use and Land cover map in QGIS.


texts:
I have read the following two posts related to my question; however, my problem is slightly different and I'm having a hard time solving it.

Finding if two polygons Intersect in python?
Getting intersection of circles using shapely?

I have an image with irregular shapes such as these:

Now, with this image, I'd like to be able to identify the separate blobs, even if they're adjoined. In particular, I want to count individual blobs that are tightly overlapping. Like for instance:
For instance, in that image, I want to be able to count 7 separate blobs. However, edge detection only counts 1. If I use some solidity cutoff (area of blob/area of convex hull), I'm able to count 2.

I'm not so concerned about the separate non-overlapping ones. But I'm having a really hard time detecting them using edge detection.  I tried using Opencv's Canny function and HoughesCircles function. Neither of them proved effective.

Any idea how to proceed?


texts: SQL Command to convert pgRouting result to GeoJSON

texts:
My goal is to produce a Web UI for pgRouting using this tutorial. I have already imported my data from an OSM pBF to PostGIS using osm2po. Using the pgRoutingLayer plugin for QGIS, I was able to figure out the SQL code to create routes using driving time as the cost.

SELECT ways.*, route.cost AS route_cost FROM ways JOIN (
    SELECT * FROM shortest_path(
    'SELECT gid AS id,
            source::int4 AS source,
            target::int4 AS target,
            cost::float8 AS cost,
            reverse_cost::float8 AS reverse_cost FROM ways',
            62,19169, True, True))
    AS route ON ways.gid= route.edge_id;

My next step is to convert this into GeoJSON as done in Part 1 of the tutorial. This is what seemed logical:

SELECT * INTO export
FROM ways.*, route.cost AS route_cost FROM ways JOIN (
    SELECT * FROM shortest_path(
    'SELECT gid AS id,
            source::int4 AS source,
            target::int4 AS target,
            cost::float8 AS cost,
            reverse_cost::float8 AS reverse_cost FROM ways',
            62,19169, True, True))
    AS route ON ways.gid= route.edge_id;
SELECT ST_AsGeoJSON(ST_UNION(the_geom)) AS geom_union
FROM export;

ERROR:  syntax error at or near ","
LINE 2:  FROM ways.*, route.cost AS route_cost FROM ways JOIN (
                    ^

but I can't get it to work. Honestly, I'm not very well acquainted with SQL, can someone point out my mistake?

edit: This seems to work, but does it do the same thing?

CREATE TEMPORARY TABLE route_result AS
SELECT ways.*, route.cost AS route_cost FROM ways JOIN (
    SELECT * FROM shortest_path(
    'SELECT gid AS id,
            source::int4 AS source,
            target::int4 AS target,
            cost::float8 AS cost,
            reverse_cost::float8 AS reverse_cost FROM ways',
            62,19169, True, True))
    AS route ON ways.gid= route.edge_id;
SELECT ST_AsGeoJSON(ST_UNION(the_geom)) AS geom_union
FROM route_result;


texts: How to get column names of layer (WMS) using OpenLayers?

texts:
Is it somehow possible to get layer's column name using OpenLayers? any example and documentation would be really useful?

Edit:
I have already tried WMS_describeLayer topp:states layer:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMS_DescribeLayerResponse
  SYSTEM 'http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_DescribeLayerResponse.dtd'>
<WMS_DescribeLayerResponse version="1.1.1">
    <LayerDescription
      name="topp:states"
      owsType="WFS"
      owsURL="http://localhost:8080/geoserver/wfs/WfsDispatcher?"
      wfs="http://localhost:8080/geoserver/wfs/WfsDispatcher?">
        <Query typeName="topp:states"/>
    </LayerDescription>
</WMS_DescribeLayerResponse>


texts: Suppress linear referencing M-values in FME

texts: I'm creating an FME workspace to copy a line feature class from an ArcSDE database to PostGIS. I've been getting the error Column has Z dimension but geometry does not. It turns out the "Z-dimension" is actually referring to M-values (for routing purposes). I don't need them in the target database so I'd like to just keep them out of the transformation for now. Does anyone know how to do this in FME? I don't see any settings in my reader or writer.


texts: Converting (Corine) land cover palette to RGB within Google Earth Engine

texts:
I'd like to export a Corine Land Cover (CLC) Map (i.e. an image from ee.ImageCollection("COPERNICUS/CORINE/V20/100m")) from Google Earth Engine go my Google Drive, forgoing the need to any external post-processing. Of course, land cover maps are natively provided as paletted images, i.e. every pixel contains just a single integer value indicating its class. For visualization purposes, however, one usually needs to convert these integer class values to RGB values. Inside GEE, this is either automatically done for standard datasets such as CLC, or can simply be done by defining a palette and using it as a parameter in Map.addLayer (option "palette"). But if you want to export the image and not manually assign a palette in, say, QGIS, you need to remap the integer class values to RGB triplets algorithmically. Is there a function to do this, either already pre-defined for CLC, or for arbitrary, to-be-defined palettes?

EDIT: I have already tried to use the ee.Image.visualize() function like below, but this has only given me a single constant color.

var CLC_palette = clc.get('landcover_class_palette');

var clc2 = clc.visualize({
  palette:CLC_palette,
  forceRgbOutput: true
})


texts:
I try to make «copyright» decoration in QGIS dynamic.
I have a surface layer «COMMUNE» with a "NAME" field.
I try to write an expression that allows me to display this "NAME" in the decoration, I manage to get the center with [%geom_to_wkt(  @map_extent_center) %]

but then I get lost between the get_feature and attribute().


texts: How to capture a rectangle within the Quantum GIS software?

texts: I want to use "capture polygon" function in QGIS software to draw the indoor office cubical which is a rectangle shape. But the "capture polygon" function is not able to draw a perfect rectangle shape. How to draw a rectangle feature in Qgis software when you are creating a feature?


texts:
I've performed hydrological analysis using r.watershed using GRASS and now I have some stream vectors for a large area. Next, I'm planning to taper these streams to varying width to make them appear more 'natural'.

Is there an easy way to taper huge amounts of drainage vectors?

I have Inkscape, GIMP, GRASS and QGIS at my disposal. I appreciate any help I can get, thanks.


texts: How to update attributes of a shapefile using list values?

texts:
I am using an update cursor to update the attributes of a shapefile using values from a list. It seems very easy, but I couldn't make it run correctly. When I run the following code, it updates all rows based on the final value in the list. Please suggest how to fix it.

cur1 = arcpy.UpdateCursor(fc)
for v in cur1:
    for s in list:
        val = s
        v.Val = val
        cur1.updateRow(v)


texts: Abbreviation dictionary for annotation feature class

texts:
I've been able to create and use an abbreviation dictionary using the Maplex labeling engine  easily enough; however, when I tried to recreate labeling using an annotation feature class in a geodatabase, no dictionaries show up to be selected. I was doing this mostly as an exercise and don't need to use an annotation feature class, but I was wondering if anyone else has experienced this and if it's just a glitch.

Edit: To clarify, I was attempting to create abbreviated labels in an annotation feature class using this process: Create new annotation feature class in Catalog > set up label and placement properties > Populate annotation feature class by selecting features in an attribute table > Right-click on layer, Selection > "Annotate Selected Features".

While setting up placement properties, I was unable to select any abbreviation dictionary, even though they were available when I labelled features simply through Label Manager in the Labeling toolbar.


texts: Turn a point feature into a line feature

texts:
How best can I take point items and turn their geometries into lines?
Eg. Each point item becomes a 5m line that starts from the original point geometry.


texts: Moving gdal raster references through functions

texts:
If I'm processing a lot of rasters, so far I've been creating files. Which I like doing in the sense it gives me confirmation that the intermediary steps are working correctly. However, after I'm done confirming, this seems inefficient.
I want to attempt to pass the references to the object rather than writing to file. Namely, some of these concepts confuse me:

If I have a list where I append a number of references to gdal raster datasets. I am then holding all of that in my memory. Does that mean 200 mb of rasters would be equivalent to 200 mb of space in my RAM?

You set gdal datasets to none after finishing with them in order to close them. When you are holding references to datasets in a list, and transferring them to another function, do you then set the list to None? Do you have to loop through the list at some point to set the dataset reference to None?

        list_of_datasets = []
        for file in files:
            raster_data = gdal.Open(file)
            cut_data = gdal.Translate("", raster_data, format="MEM", projWin=[minx,maxy,maxx,miny], outputSRS=out_srs)
            list_of_datasets.append(cut_data)
        another_function(list_of_datasets)


texts: SAGA in QGIS toolbox not using files from PostGIS database

texts:
I need to find the correct path to use tables and views from a PostGIS database in QGIS.
The database was populated importing shapefiles with QGIS DBmanager, and then other tables and views where produced with SQL sentences.
When I use algorithms involving interpolation or kriging from GRASS or SAGA, no one works. I'm using a projected file, and when apply the QGIS native algorithms works fine (idw).
The error shows some problem with the temporary .shp file created. So, my best guess is that the problem is with the usage of a database file.
I have already try using directly the file from the database, or exporting it with pgsql2shp, with PostGIS shapefile import/export manager, or with QGIS complement DBmanager. Same result.

I'm using QGIS 2.14 and 3.8, the same problem in both.
Windows 10, PostgreSQL 10, PostGIS bundle 2.4.4.


texts: I removed the "view" menu by mistake while coding in the python console using removeAction(). Now want to recover it  back. I tried commenting the code, didn't work. Is there any function to do it?


texts: Custom polygon style: outline with rectangular markers

texts:
I try to create a custom style in QGIS for some of my polygons I'm using. The border of the polygons should look like this:

I tried to create two dashed lines (with a offset for one and some spacing for both) to create two parallel lines. But at this point I already have some trouble finding the right values. Also, I have no idea to create the vertical lines. Any clues?


texts: Im trying to add a point cloud in "qgis2threejs". Im following this tutorial  https://www.youtube.com/watch?v=EtnzS1Lg0bs&ab_channel=HansvanderKwast but when i add the ept.json-file there is nothing to see in the 3D-window.If anyone has an idea for a possible solution, I would be very grateful.


texts: Optimize Tilemill export of project with contour-lines (and fix out of memory problems)

texts:
I have a project in Tilemill (based on OSM-Bright) that covers Europe and also displays Contour-Lines.
My problem is that the performance of Tilemill is pretty bad when displaying the contour lines and that the export (even only from a very small sample area) fails all the time with out-of-memory problems.

My contours are in a postgres DB imported by gdal_contour and the table looks like this (default gdal_contour result, but I added the is_100m column and indexed it):

CREATE TABLE "public"."cont" (
  "ogc_fid" INTEGER DEFAULT nextval('cont_ogc_fid_seq'::regclass) NOT NULL UNIQUE,
  "wkb_geometry" "public"."geometry",
  "id" NUMERIC( 8, 0 ),
  "height" NUMERIC( 12, 3 ),
  "is_100m" INTEGER DEFAULT '0',
 PRIMARY KEY ( "ogc_fid" )
 );
CREATE INDEX "cont_geom_idx" ON "public"."cont" USING gist( "wkb_geometry" );
CREATE INDEX "is_100m_idx" ON "public"."cont" USING btree( "is_100m" ASC NULLS LAST );

The is_100m column is used for displaying 100m lines. So in Tilemill I display them differently (a bit thicker and with labels).

Is there any problem with my indexes?

The machine I am running on has the following specs:

OS: Debian Jessie/Sid in a VM (Host Kernel: 2.6.32-5 (Debian oldstable))
RAM: Host 100GB, the VM tilemill is running on: 59GB
CPU: 2x Intel(R) Xeon(R) CPU X5650 (2.67GHz) -> 12 Cores.
tilemill: v0.10.1-305-gb69b633 (github)
nodejs: 0.10.29~dfsg-1 (Debian)
postres: 9.3.4


texts: Get results from using GRASS algorithms with the QGIS processing tool

texts:
I am trying to write a plugin in QGIS that uses at some point a GRASS algorithm : "v.split.length", accessible by using the processing class, and here is how I am using it :

processing.runalg("grass:v.split.length",layerToSplit,30.0, None, -1,None, 0, None)

Here is a short reminder on the parameters :

input <ParameterVector>
length <ParameterNumber>
GRASS_REGION_PARAMETER <ParameterExtent>
GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
GRASS_MIN_AREA_PARAMETER <ParameterNumber>
GRASS_OUTPUT_TYPE_PARAMETER <ParameterSelection>
output <OutputVector>

GRASS_OUTPUT_TYPE_PARAMETER(v.out.ogr output type)
    0 - auto
    1 - point
    2 - line
    3 - area

The problem is that when I launch this, it seems to work (there is a short delay showing that the algorithm is working) but when I open the output folder (which, in this case, is a temporary one), it is empty... (i tried saving the output in my folders, the same problem occurs)

I am not sure where my error comes from ... I tried changing the values of some of the parameters (Region, snap tolerance, min area) but nothing worked.

I found this when searching a solution, but in the end the person who faced the problem wasn't sure theirselves of what was the problem.


texts: Function to merge geojson and csv data in R

texts:
I have been using merge() to merge my geojson file with csv data in R. My codes are as follows:

map@data <- merge(map@data, csvdata, by.x="ID", by.y="ID")

However, after exporting the geojson file and rendering it, the wrong numbers are always allocated to the wrong polygons.

Since the polygons were rendered properly, I guessed that there must be an error in the merge. I then tried to merge the csv data with the .shp version of the map layer on QGIS, before exporting it as geojson. This did not create any problems, which led me to the conclusion that the merging of the csv data and the map is the problem.

Is merge() incompatible with geojson file types? If so, what function from which package can I use instead?


texts: Existing graphics in ArcGIS have limited functionality

texts:
I'm using ArcGIS (Desktop 10.2.2) and I have some graphic lines drawn over my data which I wish to modify. When I click on one with the Select Elements tool the line is selected (handles appear) but the Edit Vertices button on the Drawing toolbar remains greyed out. I also cannot move them (Select Elements cursor never changes to the cross-arrow when I mouse over the line), or delete or group them (those options in the context menu are greyed out).

It seems to be replicable in that if I create a new line (or copy and paste an old one) I can edit it, but if I close and reopen the map document the 'new' line then shows the same problem and cannot be edited. It's as if a save + close somehow "locks" the graphic.

What has happened to my graphic features to make them non-modifiable?


texts: Calculating frequency of polygon types overlapping coordinate point

texts:
I have shapefiles of sea ice coverage for multiple days of the year. At each time-point (day) the sea ice is split into different polygons which corresponds to different ice types (i.e. fast ice, consolidated ice, etc). I have four coordinate points and I would like to obtain the frequency or the counts of the different polygon types occurring at those specific coordinates along the whole year.
Is there a way to do this in QGIS?


texts: Programatically check for mouse click in PyQGIS?

texts:
I want to know how to check for a mouse click in QGIS. I am trying to write a python plugin and want to provide functionality similar to the "Select Single Feature" tool that already exists in QGIS.

I checked the QGIS api docs and found

QgsMapCanvas::CanvasProperties::mouseButtonDown

This sounds promising. I have a QgsMapCanvas object but I can't see how to access the mouseButtonDown attribute.

I am completely new to the QGIS API.


texts:
I have geoserver installation that is accessable on both, port 80 and port 8080.

Now, I try to install another instance of geoserver on a different server.

I can access it on port 8080, but not on port 80. I could not find out where to flip the switch to make it run on port 80 as well.

How do I do that?


texts: How to make sure every polygon is labeled in data driven pages?

texts:
as part of my job I have to label sections of pavement on road networks that can span for many miles and often take up several data driven pages that I have laid out at the scale required by our clients.

The problem is that since some of these segments span multiple pages, they are only labeled once. So what often happens is that it will be labeled in one DDP and not the other ones. I've asked people who have previously held my position and they say the best way they've found it so just manually create new annotations as you go through the DDP's.

Is there a setting of some sort that I can make every polygon and polyline in a DDP individually labeled or anything that would make this process a little less tedious?


texts: Insert Vertex into Polyline based on Point layer using arcpy

texts:
This is essentially the same question asked here that was not answered...

Using ArcGIS 10.1 Advanced

I have a point layer with points that represent the intersection of a driveway with a street centerline.  There is not always a vertex on the street centerline where the driveway intersects, so I am looking for a solution (preferably using arcpy) that loops through each point and inserts a vertex on the line that intersects with that point.  I do not want to use Split Line at Point method because I don't want to split the line. Looking for any ideas on how to accomplish this...


texts: QGIS 3: ALKIS vs Google Satellite arange Layer congruently

texts:
ist possible to move the google layer by offset to fit the (correct positioned) alkis layer? (Alkis: UTM Zone 32N)

I know I can change the projection, but I tried some without success.

My Project KBS/CRS is EPSG:25832.

I read some similar threads but none of some helped.

Regards

Edit: Image added

PS: I load google with this link "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" as "X Y Z Tiles" out of the browser-list.


texts: QGIS Python AttributeError: 'NoneType' object has no attribute 'processingRegistry'

texts:
I am executing a QGIS Desktop 3.8.3 Python 3 script.

from osgeo import ogr, gdal
from gdalconst import *
from qgis.core import *
import qgis.utils, sys
from qgis.gui import *
from PyQt5.QtGui import *
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QFileInfo
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
QgsApplication.setPrefixPath("C:/OSGeo4W64/apps/qgis", True)
QgsApplication([], True).initQgis()
sys.path.append('C:/OSGeo4W64/apps/qgis/python/plugins')
import processing
from processing.core.Processing import Processing
Processing.initialize()
from processing.tools import *

Everything is working fine until the line from processing.core.Processing import Processing.

But, when the line Processing.initialize() is running, I am getting an error :

Traceback (most recent call last):
  File "C:/OSGeo4W64/apps/qgis/python/plugins\processing\algs\qgis\QgisAlgorithmProvider.py", line 309, in load
QgsApplication.instance().processingRegistry().addParameterType(self.parameterTypeFieldsMapping)
AttributeError: 'NoneType' object has no attribute 'processingRegistry'
Press any key to continue . . .

How can I solve this issue?

Note that this issue only occurs in the latest version of QGIS (as on October 2019), that is QGIS Desktop 3.8.3. So, this is a particular issue related to QGIS and cannot be generalized as a software development issue.


texts:
Under layers in QGIS shapefile polygon layers always seem to be denoted by right angled polygons which translates to the map legend in Composer. Is there any way to change the outline to a more representative shape, i.e. lakes don't normally have right angles.

ArcGIS has a feature under the legend options to substitute the symbol being used in the layer with a preferred symbol, e.g. square to rounded or "blob" shaped. I'm after a similar feature in QGIS.

Thanks.


texts: Is it better to use a single layer with symbol classes or multiple layers with definition queries?

texts:
I use symbology classes to display my data most of the time. I think I have noticed a performance hit when using symbol classes on large datasets, although it might just be in my mind.

That got me to wondering is it more efficient to 1) symbolize a single layer by categories or 2) create copies of the layer with definition queries in-place and symbolize them as a single symbol.

Setting up definition queries and setting their symbology would take time but I would do it if it gained a performance boost overall.

Also, looking at the second to last point in Best practices for using layer definition queries... I saw:

  A definition query cannot be set on a system field while creating
  features

That would make me lean away from option 2 even if it does have better performance.


texts: How can I remove feature selection from my layeroverlay in mapguide API?

texts:
I can add feature to my layeroverlay on mapguide API, but I don't know how to remove it.
Can you help me find a method to remove a feature from a selection ?

This is how i add features to my layer :

MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
MgSelection mgSelection = new MgSelection(map);
mgSelection.AddFeatures(layer, featureReader, 0);
mgSelection.Save(resourceService, strMapName);
map.Save();


texts: Exporting image from Earth Engine results in black page and black TIFF file

texts:
Map.addLayer(geometry);
Map.centerObject(geometry, 3);

function maskL8sr(image) {
 // Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = (1 << 3);
 var cloudsBitMask = (1 << 5);
// Get the pixel QA band.
var qa = image.select('pixel_qa');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
             .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
return image.updateMask(mask);
}

var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
              .filterDate('2019-11-01', '2019-11-20')
              .map(maskL8sr);

var visParams = {
    bands: ['B4', 'B3', 'B2'],
    min: 0,
    max: 3000,
    gamma: 1.4,
};

Map.addLayer(collection.median(), visParams);

var output = collection.reduce(ee.Reducer.median());

var thumbnail = output.getThumbURL({
    region: geometry,
    crs:'EPSG:3857',
    bands: ['B4_median', 'B3_median', 'B2_median'],
    gamma: 1.4,
    format: 'jpg',
    });

    print(thumbnail);

Export.image.toDrive({
  image: output,
  description: 'landsat',
  scale: 30,
  region: geometry,
  crs:'EPSG:3857',
  });


texts: Running analysis code written in PostGIS from ArcGIS

texts:
I wrote some sql queries for PostGIS which does GIS processing, involving point/polygon feature and raster data for land covers.  I originally wrote it in ArcPy and arc tool box but performance was not good enough, moved to PostGIS.

Now I want to be able to use this tool from ArcGIS.  Is it doable, and where is description/documentation/example for doing it?  I searched ESRI websites for PostGIS, but they mention how to use data in database, and i couldn't easily find how do things like create schema, import data, populate table with new geometries/attributes etc.


texts: How to get only one biggest point in polygon?

texts:
I have polygon and point feature classes. Every polygon have 2 points inside them. For output I need only one point with highest value. I need incorporate this step in ModelBuilder.
I had idea about iterator, but I'm not sure about this since it might have problems with bigger feature classes and older hardware. So I'm looking a way around it.


texts: Installing GRASS >7.0 and its addons to use in R session

texts:
I am hoping to use the openSTARS package that relies on GRASS 7.0 within R. However, I do not understand how to proceed with the initial steps.
From: https://github.com/MiKatt/openSTARS

A functional installation of GRASS GIS (>=7.0) with installed add-ons
r.stream.basins, r.stream.distance, r.stream.order and r.hydrodem is
needed. These add-ons can be installed from within GRASS using the
console and g.extension or in the GUI under 'Settings'/'Addons
extensions'/'Install extensions from add-ons' under 'raster'.

Do I install GRASS as a stand-alone or do I install it from within R? How do I get to "GRASS using the console" (R's console or GRASS's console)?  The vignette is extremely detailed and well-laid out after these points but it assumes we understand GRASS so I'm stuck.


texts: QGIS 3.6 3D View: Data defined override (expression) button is missing

texts:
I am trying to create a 3D View in QGIS 3.6.0, but the buttons for data defined parameters (e.g., width or height) are missing in the Layer Properties dialog (see screenshow below)

I want to set the extrusion and width of my Line geometries according to feature attributes.

Can this be a bug, or am I missing something?


texts: How to have the same scale for two maps?

texts:
I'm using QGIS 2.8.1. I have one raster map with rainfall data with 1:3 scale when zoomed to layer.

There's another vector map with points which in scale 1:221,691 when zoomed to layer.

Both are having the same CRS which is WGS 84/UTM zone 44N EPSG:32644.
I want to use "Add grid values to points function" under Raster-Vector operations in the processing toolbox. But grid values appear as null for the points in the output attribute table. I think this because the scales are different. How can I solve this?


texts:
Is it possible to open LAS files within MapInfo?

If so, how is accomplished in MapInfo 10.0?


texts:
Does anybody know where there might be some good/current FEMA data?

I am interested specifically in the LOMA data for Florida.

I have found a WMS Service that is hosted by FEMA but I'm having trouble actually bringing it into ArcMap.


texts: Clipping Error 1: Cutline polygon is invalid

texts:
I used the sample files located at this URL to learn QGIS:
      https://qgis.org/downloads/data/.

I tried to clip SR_50M_alaska_nad.tif using a shapefile as a mask (alaska.shp). The problem is I got this error which states that:

  Ring Self-intersection at or near point .... Error 1: Cutline polygon
  is invalid.

How do I solve my problem using QGIS 2.18.9?


texts: Data provider does not support deleting features for PostGIS tables?

texts:
This is a follow-up question on how to Delete multiple features easily in QGIS?.

When hitting the delete button after selecting a set of features from a PostGIS table, QGIS reports an error:

  Provider does not support deletion: Data provider does not support deleting features.

This is with QGIS 3.0 and after enabling edit mode using the edit toolbar. Apparently, I can add a new feature but not allowed to delete it.

Is there a workaround on this to allow deleting PostGIS features interactively?


texts: Why is arcpy.ListUsers() not able to open SDE workspace?

texts:
I am working with ArcGIS Pro 2.1 and Python 3.6.2. and I am writing a script that involves the arcpy.ListUsers() function and whenever I run the code I receive the following error:

The SDE workspace can be accessed I have tried the arcpy.ListFeatureClasses() and the function did not fail or receive an error message; I am also able to open the connection in Catalog.

What can I do to get past this issue (this function is necessary for my script, so it cannot be removed)?

*Note: The arcpy.ListUsers() function fails whether it is ran in the script or on its own.

Here is the code that I have so far:

# import system modules
print("Importing system modules...")
import arcpy, os, shutil

# crete a temp folder to store a database connection
print("Checking for the temp directory...")
directory = r"P:\Python"
if not os.path.exists(directory):
    os.makedirs(directory)

# check for CGF database connection
print("Creating the database connection...")
if not arcpy.Exists(r"P:\Python\CGF_temp.sde"):
    # if non existent, create a connection
    arcpy.CreateDatabaseConnection_management(directory, "CGF_temp.sde", "SQL_SERVER", "###", "DATABASE_AUTH", "###",
                                          "###", "SAVE_USERNAME", "CGF")

# set workspace environments
# workspace must be a connection file to an ADMIN (sde) connection
print("Setting the workspace environments...")
arcpy.env.workspace = r"P:\Python\CGF_temp.sde"
arcpy.env.overwriteOutput = True
workspace = arcpy.env.workspace

# obtaining a list of connected users
print("Obtaining a list of connected users...")
users = arcpy.ListUsers("CGF_temp.sde")
print(users)


texts: How to sort the layer list in Multiple selection window?

texts:
Multiple selection window pops up when you want to select input layer(s) within Processing Tools.

The order of layers in Multiple selection window seems not corresponding to Layer Panel.

How to sort out the layer list in QGIS Multiple selection window?


texts: Custom style a particular road using CartoCSS/TileMill/OSM

texts:
For a particular city, I want to make the label for its main street labeled as prominently as Motorways. i.e. although this road would normally only be labeled from about zoom level 15 and up, I would like it to be visibly labeled from zoom level 12.

Is there a syntax I can use in TileMill's CartoCSS to allow me to custom adjust label properties for this particular road? Ideally it could be based on road name (e.g. "Mary Street") but pretty much any solution could work such as using its ID number, because we only have to do it once.


texts:
So obviously different applications would require different levels of accuracy, but I'm wondering if there's some standard threshold that the field typically determines to be "good" (or "good enough").

For example, if I'm trying to locate a tree in the woods, I'd probably need sub-meter accuracy or close to it in order to ever find that tree again. However, locating the crest of a mountain would likely only require accuracy to several meters b/c of it's conspicuousness in the landscape.

However, maybe in both applications some "generalized" accuracy threshold could be calculated as:

grain size of object * xx% of that grain size

So is there such a standard, or is it only up to the researcher to make that decision personally given the context?


texts:
Having this function that inserts locations in a database:

def insertLocation(cur, label, point):
    print label
    cur.execute("""
            SELECT label, centroid, point_cluster
            FROM locations
            WHERE label=%s
            """, (label, ))
    if cur.rowcount > 0:
        # Updates current location set of points and centroid
        _, centroid, point_cluster = cur.fetchone()
        centroid = ppygis.Geometry.read_ewkb(centroid)
        point_cluster = ppygis.Geometry.read_ewkb(point_cluster)

################ problem here! ####################
        point_cluster = pointsFromDb(point_cluster)

        centroid = computeCentroid(point_cluster)

        #point_cluster.points.append(ppygis.Point(point.latitude, point.longitude, point.elevation, srid=4326))

        cur.execute("""
                UPDATE locations
                SET centroid=%s, point_cluster=%s
                WHERE label=%s
                """, (centroid.write_ewkb(), point_cluster.write_ewkb(), label))

As you can see what I'm trying to achieve with the computeCentroid function is that for a set of points that represent the same location I can have the approximate location by calculating a mean of that cluster. So, I tried to create that computeCentroid function:

def computeCentroid(points):
    xs = map(lambda p: p[0], points)
    ys = map(lambda p: p[1], points)
    centroid = [np.mean(xs), np.mean(ys)]
    return centroid

How can I process my point_cluster in order to use this centroid function? That point cluster is a collection of linestrings but I can't seem to access them in order to calculate the centroid.

I'm trying this function in order to transform the cluster to be used by the centroid function:

def pointsFromDb(gis_points):
    gis_points = ppygis.Geometry.read_ewkb(gis_points).points
    print gis_points
    result = []
    for i, point in enumerate(gis_points):
        result.append(ppygis.Point(point.x, point.y, p.elevation, srid=4326))
    return result

But it says:

TypeError: must be convertible to a buffer, not LineString

Any ideas?


texts: Is there an IRC channel for ArcGIS or for GIS itself?

texts: Is there an IRC channel or chat where people can talk about GIS systems, or about ArcGIS?


texts: Find points that fall within a radius using Hibernate Spatial

texts:
I am using hibernate spatial and postgis and i want to find the points that fall within a certain radius. Using this SQL:

SELECT name FROM institution WHERE ST_DWithin(geom,ST_GeographyFromText('SRID=4326;POINT(36.9881 0)'), 5000)

I get the points within 5KM.

Using Hibernate Spatial i am doing

Criteria criteria = getCurrentSession().createCriteria(Institution.class, "i");
Geometry geometry = ....

criteria.add(SpatialRestrictions.distanceWithin("i.geom", geometry, distance));

But it does not return distance in Metres. What do I need to do?


texts: How to Add Network Analyst dll in My Web Mapping Application adf?

texts:
I'm a beginner in ArcGIS & I'm shooting blind really.  I want to add the Network Analyst tool box to find the shortest path in my project. I tried this solution:

I can't add Network Analyst dll to my web mapping application. I use ArcGIS 10 & Visual Studio 10 and I used web application adf to build my website. I tried the Network Analyst toolbox or networkanalyst.dll from developer kit folder but an error occurs:

  The dll not found.

Any help will be appreciated.


texts: Query Overpass API with geocodeArea returns error

texts:
I am trying to send a simple request to https://overpass-api.de/api/interpreter but I am getting a parser error.

{{geocodeArea:Oregon}}->.searchArea;
(
  nwr["waterway"="waterfall"](area.searchArea);
);
out center;

  Error: line 1: parse error: Unknown type "{"

  Error: line 1: parse error: An empty query is not allowed

  Error: line 1: parse error: ';' expected - '{' found.

Does the API not support the geocodeArea option? This exact code works on overpass turbo.


texts: Classifying text field 'B' using integer in field 'A'?

texts:
I wrote an if elif statement that will loop through records (field A) and populate a new field (field B) based on A's contents.

Field A name is 'CLASS'. Field B is 'class_desc'.

reclass(!class_desc!,!CLASS!)
def reclass(class_desc, CLASS):
 if CLASS == '100':
  return "100 - Agricultural"
 if CLASS == '105':
  return "105 - Agricultural Vacant Land (Productive)"
 elif CLASS == '110':
  return "110 - Livestock and Products"
 elif CLASS == '111':
  return "111 - Poultry and Poultry Products: eggs, chickens, turkeys, ducks and geese"
 elif CLASS == '112':

This 'completes successfully' but does not fill field B.

What am I doing wrong?

Obviously there is something fundamental that I cant get through my head about functions syntax.


texts:
I was successful in adding multiple fields but had trouble running multiple field calculations in a loop. Now what I want is loop through these existing fields listed in mult_fields variable and fill values in the fields newly created through the div_fields variable. I was hoping something like the following would work, rather than using search cursors.

import arcpy
from arcpy import env

# set the environments
arcpy.env.overwriteOutput = True
env.workspace = "C:\\WORKSPACE\\mm_agallocation.gdb"
inFeature = "myFeature"
div_fields = ("divpa_whea"  , "divpa_maiz", "divpa_barl", "divpa_sorg",
                  "divpa_sorg", "divpa_grou","divaa_whea", "divaa_maiz", "divaa_barl",
                  "divaa_sorg", "divaa_sorg", "divaa_grou")
for i in div_fields:
    arcpy.AddField_management(myFeature, i, "DOUBLE", "", "", "", "", "NULLABLE")

mult_fields = ("mpa_whea"  , "mpa_maiz", "mpa_barl", "mpa_sorg",
               "mpa_sorg", "mpa_grou","maa_whea","maa_maiz",
               "maa_barl", "maa_sorg", "maa_sorg", "maa_grou")

# all field names given in 'mult_fields' are already in "myFeature"
for i in div_fields:
    for k in mult_fields:
        expression = "!k! * !k!"
        arcpy.CalculateField_management(inFeature, i, expression, "PYTHON")

I however get the following error. I'd imagine it is the way I am specifying the expression that is giving me the error.

Traceback (most recent call last):
  File "<input>", line 6, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 2727, in CalculateField
    raise e
ExecuteError: ERROR 000539: Invalid field mult_fields
Failed to execute (CalculateField)


texts: Is it possible to reveal the relief parameters “slope inclination” and “slope exposure” by dint of ASTER GDEM?

texts:
I’m trying to find information in technical and scientific articles – is it possible to reveal the relief parameters “slope inclination” and “slope exposure” by dint of ASTER GDEM? Or we can define from it the only parameter of relief – the height above sea level?
I can’t find any articles that confirm this possibility, nor reject it.

If it’s possible, could you tell me the way to do it or the direction from which I can start searching for this information?


texts: Error when reprojecting raster (warp) QGIS

texts:
When trying to reproject a raster from degrees to meters in warp (QGIS) I receive the following error:

Processing algorithm…
Algorithm 'Warp (reproject)' starting…
Input parameters:
{ 'DATA_TYPE' : 0, 'EXTRA' : '', 'INPUT' : '/Users/annanilsson/Desktop/in_ref_annual.tif', 'MULTITHREADING' : False, 'NODATA' : None, 'OPTIONS' : '', 'OUTPUT' : '/var/folders/jv/g8xcbz2n4y109pdxsfr1hr080000gn/T/processing_387d8ccc215042b78b22f1546c4dd5c0/34324c65b826461a9a98f356bb1accdc/OUTPUT.tif', 'RESAMPLING' : 0, 'SOURCE_CRS' : None, 'TARGET_CRS' : QgsCoordinateReferenceSystem('EPSG:32635'), 'TARGET_EXTENT' : None, 'TARGET_EXTENT_CRS' : None, 'TARGET_RESOLUTION' : None }

GDAL command:
gdalwarp -t_srs EPSG:32635 -r near -of GTiff /Users/annanilsson/Desktop/in_ref_annual.tif /var/folders/jv/g8xcbz2n4y109pdxsfr1hr080000gn/T/processing_387d8ccc215042b78b22f1546c4dd5c0/34324c65b826461a9a98f356bb1accdc/OUTPUT.tif
GDAL command output:
/bin/sh: gdalwarp: command not found

Execution completed in 0.11 seconds
Results:
{'OUTPUT': '/var/folders/jv/g8xcbz2n4y109pdxsfr1hr080000gn/T/processing_387d8ccc215042b78b22f1546c4dd5c0/34324c65b826461a9a98f356bb1accdc/OUTPUT.tif'}

Loading resulting layers
The following layers were not correctly generated.

/var/folders/jv/g8xcbz2n4y109pdxsfr1hr080000gn/T/processing_387d8ccc215042b78b22f1546c4dd5c0/34324c65b826461a9a98f356bb1accdc/OUTPUT.tif

You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Any suggestions on what I might have done wrong?


texts: Austrian-hungarian map: Franzisco-Josephinische (3) Landesaufnahme - Legend

texts:
Currently I work with the Franzisco-Josephinische (3) Landesaufnahme (Austria-Hungary) map in area around Lake Neusiedel. There are some map sheets around Vienna with the scale of 1:12.500
In the legend there are different fonts for different objects (e.g. mountains, villages, cultures): https://commons.wikimedia.org/wiki/File:Abkürzungsverzeichnis,_Zeichenschlüssel_der_GKM.jpg

Within the map there are small area which are labeled with "H" and "W":

I exclude woods/Wälder for "W" because some area have never been woods.
I assume H: heather, commen grazing ground/Hutweide
and W: meadow/Wiese or grazing ground with one particualr owner.

Does anybody know the the meaning of H/W or know a reference?
(Sorry if wrong exchange, but most people working with maps are here)


texts:
I have edit tool(s) in ArcObjects (ArcGIS10.3).
The first tool is "Create a new Polygon' and following is the code:

Note: mpEditor is class member and Project is in Edit Mode

private void StartCreatePolygon()
{
 IEditTaskSearch pEditTaskSearch;
 IEditTask pEditTask;

  pEditTaskSearch = (IEditTaskSearch)mpEditor;
  pEditTask =     pEditTaskSearch.get_TaskByUniqueName("GarciaUI_CreateNewFeatureTask");

 if (pEditTask != null)
 {
   mpEditor.CurrentTask = pEditTask;
   SelectSketchTool();
 }
}

private void SelectSketchTool()
{
   //'Selects the default sketch tool
   UID pID = new UID();
   ICommandBars pCommandBars = mpApp.Document.CommandBars;
   ICommandItem pCommandItem;
   pID.Value = "esriEditor.SketchTool";
   pCommandItem = pCommandBars.Find(pID);
   if (pCommandItem != null)
   {
     pCommandItem.Execute();
   }
}

PROBLEM: When I finish Crating a new polygon and press "Save Edits" on the ArcGIS Edit tool bar, the 'esriEditor.SketchTool' disappears and normal 'Arrow' icon is activated.

Please help me that after save I keep the Sketch Tool ON.


texts: Creating new point based on distance of other points

texts:
I work in QGIS 2.14.

I have a point layer, and I want to add points to that layer basing on the distances between the "old" point and the "new" point.
I was doing it by creating buffors from each point, so far. But it is very time- and memory-wasting. Maybe there is a way to solve it in Modeler.
I want it to look like that:
I choose manually two (or three) points in my point layer, then I type the distances from each point to the new one and the name (and other atributes) of the new point. Result should be the new point in the place I want, added to that layer with atributes I wrote.


texts:
I know I'm probably missing something very basic, but I've been trying to join census block data together. The table contained within the block shapefile contains a field called GEOID10, which has concatenated the state, county, tract and block fields together.  I have downloaded a table from the american factfinder that contains the total population for each block from the 2010 census and it contains a field called Id2 which has the same concatenated field as GEOID10.  However, when I try to join the 2 together, ArcGIS won't give me Id2 as a field to base the join on when I choose GEOID10 as the field to use from the layer.  Any idea why this is?

I'm using ArcGIS 10.5


texts:
We are working with a geometry DB (Oracle) and use GDAL to download some data and apply changes to it.

Supposing that we were applying the following workflow:

  DB -> GeoJSON -> modified_GeoJSON

Is it possible to close the circle using GDAL to apply the geometry modifications to the table? I am imagining something similar to the download phase:

ogr2ogr -f OCI connection-string filename


texts: I need to import a raster layer into Potree viewer. I don't need to extrude raster by pointcloud. I only need a raster base layer. There is examples with Cesium, but it is too heavy for my task. Maybe I can convert Raster to .ply and import it to Potree?


texts: Changing class break schemes in QGIS to eliminate overlap?

texts:
When using Graduated Symbology in QGIS, by default the bounds seem to be overlapping.  For example, class 1 shows 0-100.000; class 2 shows 100.000-200.000; class 3 shows 200.000-300.000 where it appears as though the value 100 is captured in class 1 & 2; 200 is captured in class 2 & 3.

Is there a way to change the default class breaks so they are not overlapping (e.g. Class 1 = 0-100; class 2 = 101-200; class 3 = 201-300)?

I know in ArcGIS you can adjust the number of decimal points in the label.


texts: What is the best way to construct a SQL query that returns the block name for each bus point as it travels?

texts:
I have two datasets in postgres; 1) a bunch of points that represent bus locations 2) city block polygons.

Each bus has a unique ID and each block polygon has a field that has the block name in it.  As the bus moves throughout the day, what is the best way to construct a SQL query that returns the block name for each bus point as it travels.


texts:
I have Python code which is designed to take point shapefiles through the following workflow:

Merge points
Integrate points, such that any points within 1 m of each other
become one point
Create Feature layer, where points with z < 10 are selected
Buffer Points
Polygon to raster 1m resolution
Reclassify, where 1 - 9 = 1; NoData = 0

Each shapefile has approximately 250,000 to 350,000 points covering ~ 5x7 km.  Point data used as inputs represent tree locations.  Each point (i.e. tree) has an associated "z" value which represents crown radius and is used in the buffer process.  My intent is to use the final binary output in a separate process to produce a raster describing canopy cover.

I ran a test with four shapefiles and it produced a 700MB raster and took 35 minutes (i5 processor & 8GB RAM).  Seeing that I will need to run this process on 3500 shapefiles, I would appreciate any advice to streamline the process (see attached code).Generally speaking, what is the best way to deal with geoprocessing big data?  More specifically, are there any tweaks to the code or workflow that could help increase efficiency?

Edit:

Time (% of total) for geoprocessing tasks:

Merge = 7.6%
Integrate = 7.1%
Feature to Lyr = 0
Buffer = 8.8%
Poly to Raster = 74.8%
Reclassify = 1.6%

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

# Script arguments
temp4 = arcpy.GetParameterAsText(0)
if temp4 == '#' or not temp4:
    temp4 = "C:\\gdrive\\temp\\temp4" # provide a default value if unspecified

Reclassification = arcpy.GetParameterAsText(1)
if Reclassification == '#' or not Reclassification:
    Reclassification = "1 9 1;NODATA 0" # provide a default value if unspecified

Multiple_Value = arcpy.GetParameterAsText(2)
if Multiple_Value == '#' or not Multiple_Value:
    Multiple_Value = "C:\\t1.shp;C:\\t2.shp;C:\\t3.shp;C:\\t4.shp" # provide a default value if unspecified

# Local variables:
temp_shp = Multiple_Value
Output_Features = temp_shp
temp2_Layer = Output_Features
temp_Buffer = temp2_Layer
temp3 = temp_Buffer

# Process: Merge
arcpy.Merge_management(Multiple_Value, temp_shp, "x \"x\" true true false 19 Double 0 0 ,First,#,C:\\#########omitted to save space

# Process: Integrate
arcpy.Integrate_management("C:\\gdrive\\temp\\temp.shp #", "1 Meters")

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(temp_shp, temp2_Layer, "z <10", "", "x x VISIBLE NONE;y y VISIBLE NONE;z z VISIBLE NONE;Buffer Buffer VISIBLE NONE")

# Process: Buffer
arcpy.Buffer_analysis(temp2_Layer, temp_Buffer, "z", "FULL", "ROUND", "NONE", "")

# Process: Polygon to Raster
arcpy.PolygonToRaster_conversion(temp_Buffer, "BUFF_DIST", temp3, "CELL_CENTER", "NONE", "1")

# Process: Reclassify
arcpy.gp.Reclassify_sa(temp3, "Value", Reclassification, temp4, "DATA")


texts: Getting population by country using Google Earth Engine

texts:
I was trying to get the population by country by using GEE. I tried the following code:

// world population 2015
var pop = ee.Image("JRC/GHSL/P2016/POP_GPW_GLOBE_V1/2015");
print(pop);
Map.addLayer(pop,{},'Population');

//world boundaries
var bound = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017");
print(bound);
Map.addLayer(bound,{},'boundaries');

// Getting Pop-2015 By country
var popcountry = pop.reduceRegions({
  collection:bound,
  reducer: ee.Reducer.sum(),
  scale: 250,
  });
print(popcountry);
Map.addLayer(popcountry,{},'PopC');

The issues that I see are the followings:

I only get a global population about 1 billions instead of about 7 bn.;
Many countries are zeros;
I tried to use different boundaries (specifically GADM), but I can't get any results as it appears something like an internal error has ocurred.


texts:
In QGIS 3.4, after creating a plugin with plugin builder, compiling it with pb_tools, I still can't load it to QGIS. I keep getting the following error message:

  "Couldn't load plugin 'test_api' due to an error when calling its
  classFactory() method  ImportError: PyQt4 classes cannot be imported
  in QGIS 3.x. Use PyQt5 or the version independent qgis.PyQt import
  instead."

I've already tried to search for the answer here but no success.

Here is how my .bat file looks like

@ECHO OFF

set OSGEO4W_ROOT=C:\OSGeo4W64

set PATH=%OSGEO4W_ROOT%\bin;%PATH%
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
set PATH=%PATH%;C:\Program Files\7-Zip

@echo off
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
call "%OSGEO4W_ROOT%\bin\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\qgis-dev\bin;%OSGEO4W_ROOT%\apps\grass\grass-7.2.2\lib;%OSGEO4W_ROOT%\apps\grass\grass-7.2.2\bin;%PATH%

cd /d %~dp0

::start cmd

I guess the other setups are correct. What am I doing wrong?


texts:
I cannot create correct grids with PyQGIS. When I create grid with PyQGIS, the grid shape is not correct, i.e. rotated grid. But it's correct when I create it with QGIS > Vector > Research Tools > Create grid option. How can I obtain correct (not rotated) grid.
Here is the PyQGIScode:
crs = QgsProject().instance().crs().toWkt() # it is EPSG:3857
params = {'TYPE':3,
          'EXTENT':'0,10,0,10',
          'HSPACING':1,
          'VSPACING':1,
          'HOVERLAY':0,
          'VOVERLAY':0,
          'CRS':crs,
          'OUTPUT':'memory'}
out1 = processing.run('native:creategrid', params)

grid = QgsVectorLayer(out1['OUTPUT'], 'grid', 'ogr')
QgsProject().instance().addMapLayer(grid)

The green grid was created with PyQGIS.


texts: How can widgets be combined with Scenes in ArcGIS Portal?

texts: Specifically, I am hoping to use the time slider widget with Scene Viewer, which shows data on a globe display. Has anyone had any experience with this?


texts:
As a part of project scope we have to deliver to the Client digitized data sets – some houses and roads. Can we use Mapbox Satellite global imagery layer [1] under Professional plan [2] for feature digitizing?

https://www.mapbox.com/blog/mapbox-satellite/
https://www.mapbox.com/pricing/


texts: row.getValue() doesn't work but row[1] does

texts:
for some reason I can't get row.getValue to work properly... my script will only work if I use row[0] and get the value manually but I am sure the location/order of my fields will change from dataset to dataset.
This works:

    mylist = []
    with arcpy.da.UpdateCursor(FC, "*") as cursor:
        for row in cursor:
            if row[12] == value:
                mylist.append(row[2])

However this does not...

    fieldname = "Coolfield"
    mylist = []
    with arcpy.da.UpdateCursor(FC, "*") as cursor:
        for row in cursor:
            if row.getValue(fieldname) == value:
                mylist.append(row[2])

Any ideas?


texts: Google Maps Tiles Waiting for WMS Requests to Complete

texts:
We're using Geoserver WMS to render overlays on top of a google map (which works great), but upon first map load it appears that the base google map is waiting for the WMS requests to complete BEFORE rendering its own (google) tile. This means that while WMS overlays are loading, the base google map tile isn't there and we end up with a grey tile until it's done...rather than the normal google map tile without the overlay.

Example (Note: Black lines are just redacted labels...not relevant):

During panning/zooming we end up with the previous tile stuck until the WMS request has finished again (making it look pixelated). Understanding that the WMS tile may look this way because it hasn't loaded yet...but the base google map is also doing the same thing while the WMS request runs.

Example:

Once the WMS request finishes, the WMS tile and google map tile render normally and everything is fine.

Does anyone know how to tell google maps to NOT wait for the all WMS overlays to complete before rendering the base tiles?

We've tried modifying the googleMap.overlayMapTypes.setAt to ensure we've never using index 0 (which was a shot in the dark)...but otherwise, I can't seem to find any detail on this issue or how to work around. Perhaps I'm asking/searching the question the wrong way...

Anyone have any suggestions?

UPDATE:

After spending the day testing, it appears that this has something to do with the built in Google Maps ImageMapType. When we use the built in getTile method, this issue occurs. When we override the method and provide a standalone implementation it does not. Curiously, it seems that only the built in ImageMapType supports knowing when tiles are actually loaded. When we implement our own getTile method, tilesloaded/idle fires well before the WMS overlays are done rendering. This is not the case with the built in getTile method (unrelated to this issue but is a blocker for us just providing our own implementation and calling this one fixed).

So, in this implementation, we get grey tiles and pixelation.

// Extending google.maps.ImageMapType
public getTile(coord: google.maps.Point, zoom: number, ownerDocument: Document): Element {
    return super.getTile(coord, zoom, ownerDocument);
}

In this type of implementation we do not:

// Implementing google.maps.MapType
public getTile(coord: google.maps.Point, zoom: number, ownerDocument: Document): Element {
    var tile = ownerDocument.createElement('div');
    tile.style.height = "256px";
    tile.style.width = "256px";
    tile.style.opacity = "1";
    let url = this.options.getTileUrl(coord, zoom);
    let img = new Image();
    img.src = url;
    tile.appendChild(img);
    return tile;
}

Currently we're checking with Google support to see if they can shed any light. I'll keep this question updated.


texts: Converting Degree Minutes to decimal degrees using Excel formula?

texts:
I have location points collected from a garmin device stored in an excel sheet in Degree Minutes format --- W00208.172,N1046.977.

I am looking for an Excel formula to convert either to Decimal Degrees or Degrees Minutes seconds Format ?


texts: Setting SQL View Parameters (GeoServer) in QGIS

texts:
I've created a layer in GeoServer. The layer is based on a SQL view and is parametrized as described in the documentation. I can access the WFS in the browser with a URL something like the below:

http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=cite:mylayer&maxFeatures=50&outputFormat=application%2Fjson&viewparams=myuuid:2a18bb306af24e29a8f1a40f80229749;myyear:2016

(Note the viewparams part at the end of the query string.)

But I don't see a way to set these parameters in QGIS when I'm adding the layer. I can connect successfully and find my layer in the list, but there doesn't seem to be a way to configure these parameters:

How can I set these parameters? Does the Build query functionality allow me to via some mechanism I'm not aware of?


texts:
I am brand new to QGIS as my uni has shut down but we still need to do our coursework they have asked up to make a bathymetry map on QGIS. It is a very simple map of sounding data we have taken and all I am trying to do is add a contour and a grid and I keep getting error messages, can anyone help? Code below:

QGIS version: 3.8.3-Zanzibar
Qt version: 5.11.2
GDAL version: 2.4.2
GEOS version: 3.7.2-CAPI-1.11.2 b55d2125
PROJ version: Rel. 5.2.0, September 15th, 2018
Processing algorithm…
Algorithm 'Contour' starting…
Input parameters:
{ 'BAND' : 1, 'CREATE_3D' : False, 'FIELD_NAME' : 'ELEV', 'IGNORE_NODATA' : False, 'INPUT' : '/Users/Mim/Desktop/OS203/CW2/Bathymetric Survey Coursework-20200327/Final Bathymetry GeoTiff/PlymouthSound_1m_final.tif', 'INTERVAL' : 10, 'NODATA' : None, 'OFFSET' : 0, 'OPTIONS' : '', 'OUTPUT' : 'TEMPORARY_OUTPUT' }

GDAL command:
gdal_contour -b 1 -a ELEV -i 10.0 -f "ESRI Shapefile" "/Users/Mim/Desktop/OS203/CW2/Bathymetric Survey Coursework-20200327/Final Bathymetry GeoTiff/PlymouthSound_1m_final.tif" /var/folders/81/njbhr3dn3556brkh725_7_fm0000gn/T/processing_1b3ff932a52446e38b6da3b9147e595c/ec4a71fdc1d44220b082c3a61362c3b1/OUTPUT.shp
GDAL command output:
/bin/sh: gdal_contour: command not found

Execution completed in 0.10 seconds
Results:
{'OUTPUT': '/var/folders/81/njbhr3dn3556brkh725_7_fm0000gn/T/processing_1b3ff932a52446e38b6da3b9147e595c/ec4a71fdc1d44220b082c3a61362c3b1/OUTPUT.shp'}

Loading resulting layers
The following layers were not correctly generated.

/var/folders/81/njbhr3dn3556brkh725_7_fm0000gn/T/processing_1b3ff932a52446e38b6da3b9147e595c/ec4a71fdc1d44220b082c3a61362c3b1/OUTPUT.shp

You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.


texts: Using OS Layer styles in SLD format in QGIS 1.8

texts:
I've added OS Landform Parorama information in to QGIS 1.8, i've like to use the OS Layer Styles that are freely downloadable (http://www.ordnancesurvey.co.uk/business-and-government/help-and-support/products/styled-layer-descriptors.html) and come in .sld format.

When i try to load the .sld file through the properties> load styles, the only option i have is to load a .qml file which doesn't appear to be supported.

Is there something i can do to actually load the styles as required?

Nope, only the one option is available for me.

If as Dan says the QGIS styles are currently being worked on then i guess i'll just have to wait!


texts: interpreting Normalized Differentiated Bareness Index and Normalized Differentiated Impervious Surfaces Index?

texts:
I've tried looking for various sources to help me interpret NDBaI and NDISI indices but I've not found anything particularly helpful.

Does anyone know how to do it or have any literature that might prove helpful?

I need to know if the values range from -1 to 1 like in other LULC indices or is it different for these two and what might each range correspond to(in terms of LULC classes).


texts: What exactly are cap_style and join_style in shapely buffer function?

texts:
I was trying to make a function that modifies polygons removing narrow spaces inside (setting a minimum distance between a vertex and a segment that is not adjacent) and at the same time remove sharp edges (angles < 90). It is important that the resulting polygon doesn't have round edges. Something like this, the original shape is grey, while what I want is in red:

The use of the function buffer seems to be the answer.
Given a polygon Shape, I need to do something like
Shape.buffer(-h).buffer(h) to remove narrow spaces inside, and by using the variables cap_style, join_style and mitre_limit, it should be able to deal with the sharp edges.
The problem is that I have no clue of what these variables mean, the documentation is very confusing regarding this function, the descriptions and examples are ambiguous. For instance it is not clear to me the difference between cap_style and join_style, from experience, the last seems to be overriding the former. Changing cap_style while maintaining fixed join_style doesn't change the shape at all.
From experience too, mitre_ratio doesn't work while using join_style = 3.
In the end, I found out that
shape2 = shape.buffer(-0.2, join_style = 2, mitre_limit=2., cap_style=2)
shape3 = shape2.buffer(0.2, join_style = 2, mitre_limit=2., cap_style=1)

Almost works, if it wasn't for a very small difference between the original polygon and the modified one. Even though the distance parameter is exactly the same, the curves deviate somehow:

What is wrong with this solution? and what exactly are those parameters, and how are explicitly defined these methods?


texts: Add Oracle Spatial Vector Layer with QGIS 2.0 on Mac OSx

texts: I installed version 2.0 using the recommended mac installer (http://www.kyngchaos.com/software/qgis), and the installation went fine, but there is no option to add an oracle spatial layer (not in the layer dropdown, or the sidebar buttons). I assume this has to do with gdal configuration, but I'm not sure how to fix that. I have the oracle instant client installed, and I can connect to oracle with sqlplus. Has anyone been able to get the new support for oracle to work on a Mac?


texts: PostgreSQL and PostGIS install on RHEL server

texts: I am trying to install both PostgreSQL and the PostGIS extension onto my RedHat Linux server. I have been able to install PostgreSQL with the yum installation however I cannot install PostGIS this way and have come across several issues. I need to have both installed so I can reach the information from a webmap I'm trying to create.


texts: How to create empty polygon shapefiles with the same field names using python?

texts:
I'm new to python scripting in GIS and I have a list with species names, for every species in the list I want to create an empty polygon shapefile with the same fields inside the attribute. I read How to create a new Shapefile with the same attributes as an existing one? but for about 650 polygons its very difficult to get done by hand.

Ideally I would like to done this by using python.

Can anyone help me?


texts: Clip vector on Geoprocesing QGIS 2.18.13, global name 'features' is not defined

texts: I want to clip a vector polygon with a boundary vector polygon but the process is failing. I am getting the error, "global name 'features' is not defined See log for more details". I don't know what is causing this error.


texts:
I'm wondering if anyone can help me to understand if there is a way to convert an existing feature's geometry type? The reason for this is outlined in a previous question but basically when I drop a gpx file onto the map I need to convert certain 'routes' to shapes.

The API indicates that there is a setGeometry() function but I can't get it to work and there are no examples to draw from. Below are the methods I've tried so far.

feature.setGeometry(ol.geom.Polygon);
feature.setGeometry('Polygon');
feature.setGeometry(geometry, ol.geom.Polygon);
feature.values_.geometry = ol.geom.Polygon;
feature.getGeometry().setType('Polygon');

This might be a kludge but the only other alternative as far as I can tell is to  parse every gpx element manually which will involve essentially replicating all the existing code in order to catch this error.


texts: Finding nearest street name from selected point using ArcPy

texts:
There are two data layers with house numbers and street. My house numbers are point type, and my street layer with road names is line type. What I want to do in my project is to find  15 meters near the street and its name when I choose any of these door numbers.
For example, I click a point and run this code. Then it makes a table with streets 15 meters away from this point. However, it does not tell me which street is on that table. I need street names in that table. In other words, in this table and in this study, I want to learn the street names to which the point is close according to the distance given.
How can I do that?


texts: Select points from a table that exist in a custom polygon

texts:
We have a property search site where the user draws a polygon on a map and then the app displays all properties that fall within the polygon.

We have properties stored within a Postgres table that included the longitude and latitude values for each individual property (ie: Property.Id, Property.Longitude, Property.Latitude)

Example of the points of the polygon drawn by the user:

-83.39258193445859 42.5188864690573, -83.3550447440939 42.51981388191728, -83.34222679201048 42.50184518501131, -83.38033561769407 42.49526380665137, -83.41707115236205 42.505135614429214, -83.39155196619687 42.51896997517796, -83.39258193445859 42.5188864690573

How would I write a Postgres/PostGIS query that finds all records in my property table where the long/lat fall within the polygon coordinates displayed above?


texts: Remove areas of steep increase in a raster

texts:
I have DEM that is misaligned vertically. This misalignment is not uniform and changes across the raster. I want to correct it by comparing it to a more accurate DEM.
My methodology would be.

Create Difference Raster
Remove values >2m and below <2m (removed areas that have changed significantly between LiDAR acquisition)
Interpolate no-data values caused by step 2
Create points across raster at a set interval
Create Grid across raster
For each grid, find the average point height per grid to get the correction value for that location
Use correction raster to fix vertical allignment

The problem Is that there are areas of steep change caused by things like buildings. These areas will distort the mean values for step 6 and I would like to remove them from my difference raster.
The image below is the difference raster highlighting these anomolies where there is a steep increase.

I am looking for a way to automatically remove these anomalies and replace the values by interpolating from nearby cells. I am using QGIS but am open to using other open-source software.


texts: Mean distance among relocations of individuals in R

texts:
In R, I need to calculate the grand mean of distance between all the relocations of the same individual.
I have a dataset similar to this:

individual<-  c(a,b,a,b,a,c,a,b)
x<-c(167685,167945,167685,153985,167685,158675,167645,167667)
y<-c(9876548,9879248,9876838,9596548,9926548,9878578,9876548,9166548)

In which each "individual" represents a different animal, and x/y points represent locations where the animals were observed. Some individuals were relocated many times, while other individuals were only relocated once.

I'd need to calculate the mean distance between every observation and all the other observations of the same animal, iterating the process for every observation of the animal. Finally these distances should be averaged by getting a single value of "spread of relocations" for each individual. The animals which were observed only once should get "NA" in this variable.

In the output table, each row would summarize the spread of recaptures of an individual, like so:

individual  spread

a           34
b           56
c           NA


texts: Are there free software options to view dgn files?

texts: I need to view a large number of .dgn files without adding it to ArcMap, Microstation. So I need a free software solution to view the dgn files. I will only be viewing the files and will not need to edit them. Can any one suggest one?


texts: FME - Calculate distance of point along a line

texts:
I have created an FME workspace which inputs a pipeline as well as other linear features which cross it (waterways, roads, railways, fences, other pipelines, etc).  The output is a point file which contains the crossing type.  What I would like to do is calculate the distance along the pipe from the start of the pipeline for each intersection.  So, as you travel along the pipeline, the distance attribute will increase.

I'm thinking that I'll need to use some of the linear referencing tools like MeasureGenerator, MeasureExtractor, or something like that, but I'm not sure how to do so.

Does anyone have an idea of how to do this?


texts:
I am new to the whole QGIS platform but have worked out adding layers, shapefiles, polygons etc. and the rest of the simple stuff. But just now the polygon I am trying to add disappears when I right click at the end.

Weirder though is when I first right click it's as if I have clicked somewhere way off the canvas. I am confused as I have been doing this simply for the past couple weeks. No hassle.

I am working with QGIS 2.14.17.


texts: How to automatically align a line with a grid

texts:
I have a line layer (orange line in image below) that I need to snap/align with an underlying grid (light blue lines below). The desired result would be something like the purple line.
I have already tried rasterizing the line (using a snap raster that was shifted by half the grid resolution in both the x and y directions) and then re-vectorizing it, but that did not give satisfactory results in all cases (some of the resulting lines had loops, or were just missing entirely).
I also tried using the Snap tool in ArcGIS, but that only snapped the vertices of the line to grid, rather than forcing the edges of the line to coincide with the grid lines.
Is there a name for this technique or an algorithm that I've missed for this kind of processing? I'm not tied to any particular GIS software, just looking for an idea of the general process.


texts: Opening and Using .tif and .twf files in QGIS

texts: I have in the same folder .tif and .twf files with the same names. How should I open them in QGIS correctly? If I select add raster layer and add the .tif file, would that be enough? Would QGIS also consider the .twf file? And how can I understand if it is correctly geolocated?


texts: Map Package not accessible even though it's Public In ArcGIS Online

texts:
I have made my map package public but it still looks for a "sign in" in ArcGIS when I try it in any browser:

https://capeportal.maps.arcgis.com/home/item.html?id=9db9fc3ad0594fefa72798b71c0ff41e

Any suggestion?


texts: Google Earth Engine API: localhost refused to connect

texts:
I'm trying to implement this https://github.com/samsammurphy/gee-atmcorr-S2 in Google Earth Engine using Docker Toolbox for atmospheric correction.

I first install Datalab following the instruction on https://developers.google.com/earth-engine/python_install-datalab-local

Once that's done, it show me the path guope@DESKTOP-RST8AAG MINGW64 ~/workspace/datalab-ee

Then I pull the docker image using docker pull samsammurphy/ee-python3-jupyter-atmcorr:latest

Then I run docker run -i -t -p 8888:8888 samsammurphy/ee-python3-jupyter-atmcorr and it shows me root@5d7195f4dd85:/#, which means I'm in a virtual OS.

Then I authenticate my EE account and it shows Successfully saved authorization token.

Then I grab the source code git clone https://github.com/samsammurphy/gee-atmcorr-S2 and navigate to the folder cd gee-atmcorr-S2/jupyer_notebooks/.

However, when I copy/paste the URL into my browser, it says localhost refused to connect. Ideally, I think it should open the jupyter notebook with the script loaded.

Can anyone please tell me what the problem is and how to fix it?

root@88676ad61bbb:/gee-atmcorr-S2/jupyer_notebooks# jupyter-notebook sentinel2_atmospheric_correction.ipynb --ip='*' --port=8888 --allow-root
[W 10:25:15.109 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 10:25:15.128 NotebookApp] Serving notebooks from local directory: /gee-atmcorr-S2/jupyer_notebooks[I 10:25:15.129 NotebookApp] 0 active kernels
[I 10:25:15.129 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=...
[I 10:25:15.129 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 10:25:15.130 NotebookApp] No web browser found: could not locate runnable browser.
[C 10:25:15.131 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=...

Also noticed that the error No web browser found: could not locate runnable browser.


texts: Mapnik: Parameterize queries for PostGIS datasource?

texts:
My datasource is PostGIS, but I need to build the query on the fly based on user-supplied filters. Obviously I don't want to create an SQLI vulnerability, so I'd like to parameterize my query, e.g., "WHERE field1 = ? AND field2 = ?". I see no way to do that in the documentation.

Is this possible with MapniK?
How do the rest of you handle user-supplied filters? Is there a better way to approach the problem?


texts:
I'm getting the following error in Internet Explorer: " Object doesn't support property or method 'includes' "

The method 'includes' works fine in Chrome and Firefox but throws an error for each instance in IE.

This is an example of the code that is creating the error:

            var carmen56= new L.GeoJSON(null, {
            style: function (feature) {

                if (feature.properties.description.includes("Exclude")) {
                    return {
                        clickable: true,
                        weight: 1,
                        opacity: .80,
                        fillOpacity:  .55,
                        fillColor: '#55ff00',
                        color: '#000000'
                    };
                };
                if (feature.properties.description.includes("Include")) {
                    return {
                        clickable: true,
                        weight: 1,
                        opacity: .80,
                        fillOpacity:  .55,
                        fillColor: '#ffaa00', <!--Orange-->
                        color: '#000000'
                    };
                };

                if (feature.properties.description.includes("Tier 3")) {
                    return {
                        clickable: true,
                        weight: 1,
                        opacity: .80,
                        fillOpacity:  .55,
                        fillColor: '#ff0000',
                        color: '#ff0000'
                    };
                };


texts: Create profile graph over multiple rasters (ArcGIS 3D Analyst)

texts:
When having a raster which represents an array of values, for instance, elevation, I can generate a profile graph over a line I draw using the 3D Analyst toolbar.

A sample graph:

When generating a profile, you need to choose a 3D Analyst layer (elevation_1 in this case). I am looking for a way to generate one graph with two lines each of which would represent profile generated on another raster I have (precipitation_2). So, if I have a raster representing another condition (precipitation) with values going between 1600 and 2600, I would like to get such a graph. Where the red line is getting values from the precipitation raster and the black one is getting values from the elevation raster.

It can also be a single graphics line or two lines I draw on top of the rasters (a second line is just a copy of the first one in the figure, but I draw it with an offset for illustration purposes).

I have been playing around with the properties of the graphs, but it seems to be connected to the raster chosen when generating the profile.

Can I do it with 3D Analyst toolbar or any geoprocessing tool? I have to stay within the ArcGIS Desktop framework.


texts:
I am having 404 error into cartoDB installation. Need expert help to overcome the situations. http://104.238.134.159:3000/maps

I am using Ubuntu 12.04 64 bit Nachine


texts: Finding spatial difference between two vector layers with multiple features in each layer using QGIS

texts:
I am learning on the job with QGIS.
I have two state level vector layers with individual shapes for each county inside the state boundary. I am trying to identify the area differences between each county within the state layer between the two files. I've tried the following using shapefile and geojson format: I processed using the difference tool but this only gives me the difference between the state boundaries, rather than the difference between the overlapping counties inside the state boundary.
I would like the symmetrical difference between each of the counties, but this tool also only gives the difference around the external state boundary. The only unique field in common between the two layers would be the name, but there are some different spellings. There is the 'Split vector layer'under data management tools, but I would want to scale this up.
How can I get the polygon area differences between the individual counties?

@LuisPerez Thanks for the response, below is two images. The data is admin data from OSM, compared to another layer from the government. In the zoomed in image you can see the spatial differences, and my idea was to perform 2 differences from the vector-geoprocessing tools options, reversing the role of input/overlay in the process. I would then look at differing areas between corresponding features between both datasets


texts: Seeking ArcGIS TREND tool equivalent in R?

texts:
Arc features the TREND function with linear interpolation up to 12th order. Is there an equivalent approach in R (preferably) or python?

I'm trying to de-trend a raster surface using polynomial regression. Unfortunately, spatialEco::raster.deviation() is limited to 2nd order, and I'd ideally like to use 12th, so it isn't feasible here.

Edit: I've found a method that begins to approach my goal: the surf.ls function in R's spatial library. raster::rasterToPoints() gets you to the class you need for surf.ls. However, this method is still limited to 6th-order polynomials so I'm going to leave the question unresolved in the event that a more complete TREND equivalent exists.


texts: Selecting attributes or rows of polygons that intersect two attributes of overlaying polygon using ArcGIS Pro

texts:
I would like to highlight census tracts that overlap and touch two precincts. Most tracts are contained within a precinct, but a few touch more than one. I would like to highlight these.
I am using ArcGIS Pro.


texts: How can i add time series to FeatureLayer Arcgis

texts:
I converted shape file(geojson) to ArcGis Json via terraformer-arcgis-parser. It will render the map but how can i add a csv or json file to the FeatureLayer in order to use TimeSlider?
    let arcdata = ArcGIS.convert(dataSource);
    let layer = new FeatureLayer({
        fields: [
          {
            name: "ObjectID",
            alias: "ObjectID",
            type: "oid",
          },
          {
            name: "description",
            alias: "Description",
            type: "string",
          },
          {
            name: render_field,
            alias: render_field,
            type: "string",
          },
        ],
        objectIdField: "ObjectID",
        geometryType: geometry_type,
        spatialReference: { wkid: 4326 },
        source: arcdata,
        renderer: renderer,
        popupTemplate: {
          title: "{description}",
          content: [
            {
              type: "fields",
              fieldInfos: [
                {
                  fieldName: render_field,
                  label: render_field,
                },
              ],
            },
          ],
        },
        opacity: 0.7,
      });

My data want to add to layer(json)
{
    "data": [
        {
            "Period": "2008-03-01",
            "score@ID_1": 1.0,
            "score@ID_2": 3.0
        },
        {
            "Period": "2009-03-01",
            "score@ID_1": 5.0,
            "score@ID_2": 7.0
        },
    ...
 }

I use ArcGIS version 4.16


texts: How to create a circle vector layer with 12 sectors with Python and to save average value of underlying raster in each sector?

texts:
Hi I am writing a code with Python 2.7 using Arcpy 10.1 and I guess I am doing stuck with a silly problem that lies under my eyes. I have created a grid of points (with "Create fishnet" function) over a region where I have also raster data (for instance land cover or DEM). For each point I need to associate a circle in vector format (with center in each point) divided in "n" sectors of 1 km radius for example.
The goal is to calculate the mean value of all pixels of the land cover or of the DEM situated in each sector and to save them in the attribute table of the circles.

I found this very helpful post (How to create a circle vector layer with 12 sectors with Python/pyqgis?) but I am somehow stuck where I have to save the data in shapefile instead of geojson and to go further with the estimate of the mean values for each sector.

Here is part of the code take from the previous code:

# helper function to calculate point from relative polar coordinates (degrees)
def polar_point(origin_point, angle,  distance):
    return [origin_point.x + math.sin(math.radians(angle)) * distance, origin_point.y +math.cos(math.radians(angle)) * distance]

features = []

for x in xrange(0,int(sectors)):
    segment_vertices = []

    # first the center and first point
    segment_vertices.append(polar_point(center, x,y))
    segment_vertices.append(polar_point(center, start + x*sector_width,radius))

    # then the sector outline points
    for z in xrange(1, steps_per_sector):
        segment_vertices.append((polar_point(center, start + x * sector_width + z * step_angle_width,radius)))

    # then again the center point to finish the polygon
    segment_vertices.append(polar_point(center, start + x *  sector_width+sector_width,radius))
    segment_vertices.append(polar_point(center, x,y))

    # create feature
    features.append(geojson.Feature(geometry=Polygon(segment_vertices)))

# prepare geojson feature collection
res = geojson.FeatureCollection(features = features)

# write to file
f = open('sector.shp', 'w')
f.write(geojson.dumps(res))
f.close() }

Any piece of advice out there please?
Is any other approach maybe more practical/feasible? I was thinking also about "Euclidean direction" and "zonal Statistics", but it deals with many raster data and the calculation might be very long in case of large regions to analyze.

Best regards.


texts: Data Driven Pages with Movable Legend/Inset Map

texts:
I have created a script tool for ArcMap 10.3.1 that will move a legend around a data frame so as not to obscure a specified map layer when using data driven pages. However, I'm encountering an interesting problem when attempting to align the legend to the right edge of the data frame.

Here is the code I use to align the legend (the legend is anchored at the bottom left):

inset.elementPositionX = (DataFrame.elementPositionX +
   DataFrame.elementWidth) - inset.elementWidth

Now, this script works perfectly until I have the "Only show classes that are visible in the current map extent" box checked in the legend's properties. Having this checked causes the legend to resize as the program iterates through each page (depending on what is visible on the map), and when it does so it either leaves a gap or overruns the data frame edge.

The interesting thing is that while the "Only show classes that are visible in the current map extent" is checked on in the legend's properties, if I iterate through each page manually, running this little align snippet in the python window after changing pages, it works perfectly.

So, my question is: why does this not work while it's running in a script tool, but does when running manually? It's almost as if ArcMap isn't able to keep up with itself (if that even makes sense...)

Note* this tool was built to run on an open MXD, not outside of one.

To test try this:

Open an MXD, add two layers - one an index layer for DDP, and a second layer that is symbolized by categories. Make sure that not all categories show up in every DDP. Then, insert a legend, go to it's properties, check the "Only show classes that are visible in the current map extent" box. Then as you click through your DDPs, your legend should (unless all element descriptions are the same width) change shape.

Next, add this to the python window:

mxd = arcpy.mapping.MapDocument("Current")

SecondaryObject = "Legend"
inset = arcpy.mapping.ListLayoutElements(mxd, "", SecondaryObject)[0]

PrimeObject =  "Main View"
DataFrame = arcpy.mapping.ListDataFrames(mxd, PrimeObject)[0]

inset.elementPositionX = (DataFrame.elementPositionX + DataFrame.elementWidth) - inset.elementWidth

Next, iterate through your DDP to observe the snippet in action, working.

In the full version of the DDP with movable legend script, the align takes place after the DDP is switched to each new page. First the legend is moved back to it's starting position, and if the "intersect" function returns > 0 from there, it moves on to a new position:

for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
    #setup naming and path for output maps
    path = mxd.filePath
    bn = os.path.basename(path)[:-4]
    mxd.dataDrivenPages.currentPageID = pageNum

    insetDefaultX = inset.elementPositionX
    insetDefaultY = inset.elementPositionY

    #check defualt position for intersect
    intersect = checkIntersect(inset)

    if intersect == 0: #if it doesn't intersect, print the map
        arcpy.mapping.ExportToEPS(mxd, exportFolder + "\\" + bn + "_"+ str(pageNum) + ".eps", "Page_Layout",640,480,300,"BETTER","RGB",3,"ADAPTIVE","RASTERIZE_BITMAP",True,False)

    else: #intersect != 0: #move inset to SE corner
        inset.elementPositionX = (DataFrame.elementPositionX + DataFrame.elementWidth) - inset.elementWidth
        inset.elementPositionY = DataFrame.elementPositionY


texts: Measuring error of Spatial Analyst interpolation such as spline, nearest neighbor and kriging?

texts: I am planing to use interpolation method using spatial analyst tool and I found several methods like spline NN and kriging. I know I can do interpolation using geostatistical analyst but some interpolation methods do not available in geostatistical analyst like spline and NN, although the errors measurement can be obtained from geostatistical analyst. My question is how to get error results such as root mean square errors and both observed and predicted data of interpolation model using Spatial Analyst in ArcMap?


texts: Merge polygons from two different layers in QGIS

texts:
I have a layer with all buildings.
Then I made a layer with buildings of interest from my part.

The problem is that a building of interest is made out of several polygons, but I want it as one polygon.

As in the picture I would like to have the entire building as one polygon.
Is that possible? (I want the whole house in red)

I don't want this made for the entire layer, just the ones I find interesting.


texts: Creating fishnet grid with specified rotation angle in ArcGIS Desktop?

texts:
I'm working on this project and I need a grid with a certain rotation, at about 60 degrees, for example.

Starting from that I need to make a block of 20mx50m, and the last thing is that inside each block there must be a small set of sub-blocks.

The result is this:

Of course it's been done manually, but I was thinking of a way of making it done automatically because I must do 30 blocks like this one, maybe more, and it is consuming a lot of my time.


texts: Select Layer By Attribute: SQL Expression using ArcGIS ModelBuilder?

texts:
I am currently using ArcMap 10.3's ModelBuilder. Having created a feature class of 300 zones, I would like to filter these to the 15 zones above 200 hectares in size, the model is shown below:

I have tried to use the following SQL Code to achieve this, but it never has an effect when running the model.


texts: Can't get simple map to show up on my test site using CartoDB

texts:
So I'm trying to get a simple test-site setup but it's not working. Whenever I load the site I can very quickly see the controls flash on the screen then go away.

The when not doing local testing, the test-site is located at www.parkru.com/mapTest.html

<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
        <!--[if lte IE 8]>
          <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.ie.css" />
        <![endif]-->
        <script type = "text/javascript" src="static/jquery.min.js"></script>

        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
        <script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>

        <script>
            $(document).ready(function() {
                cartodb.createVis('map', 'http://willkara.cartodb.com/api/v2/viz/2dfc4142-674c-11e3-a9f5-5fd5763ac197/viz.json');
            });

        </script>

    </head>
    <body>
        <div id="map">

        </div>
    </body>
</html>


texts: GDAL WMS service won't accept HTTPS connections

texts:
We have a system that is using the GDAL C# wrappers to talk to a WMS server. This all works ok when using HTTP, but if we try and connect to the same server using HTTPS then the call to GDAL. Open fails and the message "https not supported or disabled in libCurl" is output in the debug log.  The HTTPS connection works OK with applications.
Looking online seems to indicate that libcurl doesn't like URLs with single quotes or spaces in them, but the URL we pass to GDAL has double-quotes.
It seems an obvious thing that GDAL would support HTTPS connections to WMS servers (or it does to me) so has anyone got this functionality working before, and if so, what's the secret?
We are using GDAL 1.11.0 and libCurl 7.18.


texts: Inserting JPEG or similar into ArcGIS map?

texts: I am trying to upload an image (jpeg or similar) into a map.  It can be on the layout view or data view.  I am using ArcMap 10.1.


texts: Editing a feature adds it to the "feature exclusion" list

texts:
Recently one of our editors found a strange issue with some feature classes in a particular feature dataset. When she moves a vertex and then clicks off the feature, the feature vanishes from the display. It can still be selected, identified, and seen in the attribute table, it's just not visible on the screen.

After some exploration, we noticed that the "invisible" features are getting added to the Feature Exclusion list (on the Layer Properties / Display tab) after they are added. When the "Restore All" button is pushed, the features magically reappear. There is extremely little information about Feature Exclusion available, unfortunately.

It's a relief to know why this is happening, and good that we have a workaround, but ideally we want to not force the editors to open layer properties to push a button each time they edit a polygon. Why are those features getting added to the excluded features list, and how can we prevent that from happening?

Possibly related (and discovered at the same time), the "Automatically save changes after each edit" option was checked in the editor. (This appears to be a 10.2 bug, and I am not sure if it's related to the Feature Exclusion behavior or not.)

The dataset is unversioned (since it is also used by a map viewer feature service). Database and ArcMap are both 10.2.1.