texts: QGIS 3.0.1 does not launch with Ubuntu 16.04 LTS?

texts:
I just performed an upgrade on my Lubuntu 16.04 and upgrade QGIS to 3.0.1.
After the upgrade, however, qgis wouldn't launch, either from the command line or using the desktop icon. If I type

$ qgis

, it just returns silently without any error messages. The only thing that works is qgis --help.

$ ls -l $(which qgis)

shows:

-rwxr-xr-x 1 root root 411 Mar 24 10:34 /usr/bin/qgis

If I do sudo apt-get install qgis, I get:

qgis is already the newest version (1:3.0.1+24xenial-ubuntugis).

I have tried direct upgrade, removing qgis and then reinstall:

sudo apt-get remove libpq* qgis* python-qgis* grass* --purge
sudo apt-get autoremove --purge

, to no avail.

My apt source entries are:

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main
deb https://qgis.org/ubuntugis  xenial main

Has anyone experienced similar problems and know of a solution?


texts: Mapping points from Excel sheet with listed addresses using ArcGIS Pro

texts:
After I add the Excel sheet into ArcGIS Pro, how do I go about placing each address onto the map?
I may want to start off mapping the data just in California. This is from the National Register of Historic Places. Here's a link to the spreadsheet I want to use:
https://www.nps.gov/subjects/nationalregister/upload/national_register_listed_20200108.xlsx


texts: Rename Landsat bands across sensors in Google Earth Engine

texts:
I'm trying to rename bands with standardized names across different Landsat sensors. When I add layers using visualization parameters for the new standardized band names, I get errors like this: "Layer error: Image.visualize: No band named 'SWIR1'. Available band names: [B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, BQA].", even though it appears the bands were renamed properly when I inspect the console. Any ideas how to fix this? Here's a link to the code I'm using: https://code.earthengine.google.com/4d18d66c8b83cdbfe8121face2de964a
//Collection filter parameters
var subset = Map.getBounds(true)
var start = '2019-12-01'
var end = '2020-02-28'

var colFilter = ee.Filter.and(
ee.Filter.bounds(subset),
ee.Filter.date(start, end),
ee.Filter.lt('CLOUD_COVER', 70)
)

//Visualization parameters
var vis = {
  bands: ['SWIR1','NIR','Green'],
  min: 0,
  max: 0.5,
  gamma: [0.95, 1.1, 1]
};

// Assign a standard name to the sensor-specific bands.
var L8_BANDS = ['B2','B3','B4','B5','B6','B7','B10','BQA']; //Landsat 8 original names
var STD_NAMES = ['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2', 'Thermal', 'BQA']; //Standard band names
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA').select(L8_BANDS, STD_NAMES)// Rename bands

// Filter, sort, and print collection
var col = ee.ImageCollection(l8)
 .filter(colFilter)
 .sort('DATE_ACQUIRED')
print(col, 'Landsat Collection')

// Display each image in collection
function addImage(image) {
  var id = image.id;
  var iMage = ee.Image(image.id);
  Map.addLayer(iMage, vis, id);
}

// Use map on client-side
col.evaluate(function(col) {
  col.features.map(addImage);
});


texts: Standalone script creates unwanted directories

texts:
I use the following code to import the relevant modules and prepare for a standalone script for QGIS 3.14:
# Import modules
import sys
from qgis.core import QgsApplication
from qgis.analysis import QgsNativeAlgorithms
from qgis.PyQt.QtWidgets import QApplication

from os.path import expanduser
home = expanduser("~")

# Set a custom config path
QgsApplication( [], False, home + "/AppData/Local/Temp" )
QgsApplication.setPrefixPath("C:/Program Files/QGIS 3.14/apps/qgis", True)
app = QApplication([])
QgsApplication.initQgis()

# Prepare processing framework
sys.path.append( "C:/Program Files/QGIS 3.14/apps/qgis/python/plugins/" )

# Initialize the Processing plugin
import processing
from processing.core.Processing import Processing
Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

When I run this, a couple of directories (oauth2-cache, processing) and a database file (qgis-auth) are created in the same directory as the script.
Is it possible to avoid creating these instead of having to remove them myself?


texts:
I am trying to create folding marks in the QGIS-print composer. Basically they are just markers along a line - with the twist, that the spacing is not even. I want to avoid having to create several lines, because that would involve a lot of fiddling and wouldn't be as elegant.

So my idea is to create either a line or an arrow and use make_point(...) in order to create orthogonal dashes along that line/arrow. Sadly testruns didn't work, so the question is, whether I actually could use the geometry generator in this scenario, and if yes, which "coordinate system" I would have to use. So far I tried mm-based coordinates within the bbox of the line/arrow.


texts: Multiplying ee.image by a number in Google earth engine

texts:
I'm trying to process some Air surface temperature data to calculate temperature seasonality for 2013-2015. The formula I'm using is just the standard deviation of monthly temperature for each year X 100 (and then averaging my 3 years)

This is the code I'm using, but I think it is incorrect to use .multiply(100) because it's combining an ee.image with a java object? I'm not sure how to do it otherwise

var ASTmonthcollection2015 = ee.ImageCollection.fromImages([meanASTjan15, meanASTfeb15, meanASTmar15, meanASTapr15, meanASTmay15, meanASTjune15, meanASTjuly15, meanASTaug15, meanASTsep15, meanASToct15, meanASTnov15, meanASTdec15])

var AST2015seas = ASTmonthcollection2015.reduce(ee.Reducer.std_dev())

var AST2015seasclip = AST2015seas.clip(southafrica)
var AST2015seas10 = AST2015seasclip.multiply(100)


texts:
I have a grib2 file which I'm trying to import into PostGIS 2.0 Raster and process. Trouble is, I can't figure out what the SRID is supposed to be, or one close enough for government work. Running gdalinfo on the file gives me the output below. I've tried 3785 just as a shot in the dark, but when I transform the coordinates back to 4326 they don't match up. I really would like to work with 4326 in my code, especially since that's how people will be signing up for subscriptions and the like.

If I do something like

select st_value(rast, st_makepoint(-277757.789, 4547961.333)) from test_grib_table;

I get a result. (Note that that's the center point specified below.) But I can't figure out how to transform 4326 lat/long degree coords into this (unknown to me) SRS.

Gdalinfo output:

Driver: GRIB/GRIdded Binary (.grb)
Files: 130-2013.050614_000_TMPK.grib2
Size is 451, 337
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["Coordinate System imported from GRIB file",
        DATUM["unknown",
            SPHEROID["Sphere",6371229,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",25],
    PARAMETER["standard_parallel_2",25],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",265],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0]]
Origin = (-3332155.288903323933482,6830293.833488883450627)
Pixel Size = (13545.000000000000000,-13545.000000000000000)
Corner Coordinates:
Upper Left  (-3332155.289, 6830293.833) (139d51'22.04"W, 54d10'20.71"N)
Lower Left  (-3332155.289, 2265628.833) (126d 6'34.06"W, 16d 9'49.48"N)
Upper Right ( 2776639.711, 6830293.833) ( 57d12'21.76"W, 55d27'10.73"N)
Lower Right ( 2776639.711, 2265628.833) ( 68d56'16.73"W, 17d11'55.33"N)
Center      ( -277757.789, 4547961.333) ( 98d 8'30.73"W, 39d54'5.40"N)
Band 1 Block=451x1 Type=Float64, ColorInterp=Undefined
  Description = 2[m] HTGL="Specified height level above ground"
  Metadata:
    GRIB_UNIT=[K]
    GRIB_COMMENT=Temperature [K]
    GRIB_ELEMENT=TMP
    GRIB_SHORT_NAME=2-HTGL
    GRIB_REF_TIME=  1367848800 sec UTC
    GRIB_VALID_TIME=  1367848800 sec UTC
    GRIB_FORECAST_SECONDS=0 sec


texts: Is there a way of finding the average distance of selected features in a layer

texts: My problem is i have a layer with thousands of vectors in a layer. Using the 'select features by area' tool I have used the tool to select vectors within a 100m^2 area but I want to find the average length of the vector lines selected is there a way of finding the average of selected features in a layer


texts: Changing Style of Layer in GeoServer REST API (PHP)

texts:
I would like to change the layer's style via REST. My problem is very similar to Layer sets not enabled after change style via REST. and How to set default style of layer using rest api in Geoserver.

Running the following via curl works:

curl.exe -v -u user:password -XPUT -H "Content-type: text/xml"
-d "<layer><defaultStyle><name>poi</name></defaultStyle></layer>"
http://localhost:8080/geoserver/rest/layers/workspace:layer

Though, I'm building on top of GeoServerWrapper in PHP provided by IBM to interact with the GeoServer REST API so my code is as follows:

private function runApi($apiPath, $method = 'GET', $data = '', $contentType = 'text/xml') {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $this->serverUrl.'rest/'.$apiPath);
    curl_setopt($ch, CURLOPT_USERPWD, $this->username.":".$this->password);
    if ($method == 'POST') {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    } else if ($method == 'DELETE' || $method == 'PUT') {
        // return $method;
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    }

    if ($data != '') {
        curl_setopt($ch, CURLOPT_HTTPHEADER,
            array("Content-Type: $contentType",
            'Content-Length: '.strlen($data))
        );
    }

    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $rslt = curl_exec($ch);
    $info = curl_getinfo($ch);

    if ($info['http_code'] == 401) {
        return 'Access denied. Check login credentials.';
    } else {
        return $rslt;
    }
}

public function addStyleToLayer($layerName, $workspaceName, $styleName) {
    return $this->runApi('layers/'.urlencode($workspaceName).':'.urlencode($layerName).'', 'PUT', '<layer><defaultStyle><name>'.htmlentities($styleName, ENT_COMPAT).'</name></defaultStyle><enabled>true</enabled></layer>');
}

Specifying 'PUT' didn't work so I'm back to the drawing boards.

I'm sending these parameters to the GeoServer REST:

$.ajax({
               url: 'geoserverRestFinal.php',
               type: 'PUT',
               data: {
                'action': 'assignstyle',
                'username': $('#username').val(),
                'password': $('#password').val(),
                'workspace': $('#assignstyle_workspace').val(),
                'layer': $('#assignstyle_layer').val(),
                'stylename': $('#assignstyle_stylename').val()
               },
               success: function(ret) {
                $('#assignstyle_results').html(escape(ret).replace(/%(..)/g,"&#x$1;"));
               }
            });

From the 'action' parameter:

if (isset($_REQUEST['action'])) {
include "GeoserverWrapper.php";
$geoserver = new GeoserverWrapper('http://server:8080/geoserver/', $_REQUEST['username'], $_REQUEST['password']);

switch ($_REQUEST['action']) {
    case 'assignstyle':
        print_r($geoserver->addStyleToLayer($_REQUEST['layer'], $_REQUEST['workspace'], $_REQUEST['stylename']));
        break;
}

return;}

My jQuery Ajax call is sending my data as Form Data, not as Query Strs.

Current:

http://server/php/geoserverRestFinal.php

Form Data
    action:assignstyle
    username:user
    password:password
    workspace:geoportal
    layer:glocalidad
    stylename:point

Should be:

http://server/php/geoserverRestFinal.php?action=assignstyle&username=user&password=password&workspace=geoportal&layer=glocalidad&stylename=point

Looking into jQuery.params


texts: Combining high resolution and generalized hillshade rasters to produce enhanced shaded relief?

texts:
I often add LiDAR data to a map along with a shaded relief. Most of the time I have to generalize the LiDAR DEM depending on the scale of the map. Still, there is often too much detail and mountain ridges and valleys are not well pronounced.

I came across an article recently that describes the process of combining 2 hillshade models, one detailed and the other generalized. The resulting relief is very nice. I would like to produce such effect in my maps: assuming I have 2 hillshade (detailed and generalized) rasters, what is the best way of combining them to achieve such effect?


texts: QGIS 3.2 installation error on Ubuntu 16

texts:
I am installing QGIS, I added the repository and cleaned my machine of any QGIS Packages, I tried removing and reinstalling qgis-providers but the same issue occurred again (see error-message):

Setting up qgis-providers-common (1:3.2.3+24xenial-ubuntugis) ...
Setting up qgis-providers (1:3.2.3+24xenial-ubuntugis) ...
/usr/lib/qgis/crssync: symbol lookup error: /usr/lib/libqgis_core.so.3.2.3: undefined symbol: OGR_F_SetFieldNull
dpkg: error processing package qgis-providers (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up libjs-leaflet (1.0.3+dfsg-1~xenial0) ...
Setting up qgis-common (1:3.2.3+24xenial-ubuntugis) ...
dpkg: dependency problems prevent configuration of qgis:
 qgis depends on qgis-providers (= 1:3.2.3+24xenial-ubuntugis); however:
  Package qgis-providers is not configured yet.

dpkg: error processing package qgis (--configure):
 dependency problems - leaving unconfigured
Setting up qgis-plugin-grass-common (1:3.2.3+24xenial-ubuntugis) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                Setting up qgis-provider-grass (1:3.2.3+24xenial-ubuntugis) ...
dpkg: dependency problems prevent configuration of qgis-plugin-grass:
 qgis-plugin-grass depends on qgis (= 1:3.2.3+24xenial-ubuntugis); however:
  Package qgis is not configured yet.

dpkg: error processing package qgis-plugin-grass (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
 qgis-providers
 qgis
 qgis-plugin-grass
E: Sub-process /usr/bin/dpkg returned an error code (1)


texts: Oracle Spatial support QGIS 1.9-0-Master (Ubuntu)

texts:
I just installed QGIS 1.9.0-Master (Build 480) on a Ubuntu virtual machine. I am running/compiled against GDAL/OGR 1.9.2.

Why can't I add Oracle Spatial Layers as I am able to do using QGIS-Master for Windows?

Is this under development for Linux systems or may I missed some package during installation?


texts: Toolbox from 10.0 causes an ArcGis 10.1 crash

texts:
I'm trying to open a toolbox prepared in ArcGis 10.0 in ArcGis 10.1 but it crashes the entire application. No error message is shown.

Any ideas what might cause the problem? Or how to debug it?


texts: Qgis2web fails to display points with SVG markers

texts:
I made a map and put some points on it and I symbolized some points as svg markers from QGis library.Now, when I wanted to display or export the map with the gis2web plugin (openlayers option checked), I couldn't see the points. When I symbolized them as simple markers I saw them on the published map. What's happened?
I've used QGIS 2.6.1 and qgis2web 0.35.


texts: Merging SRTM rasters that include sea pixels in QGIS?

texts: I was trying to merge a bunch of SRTM rasters in QGIS as I've always done, but this time some of the rasters included large areas of pixels in the sea. The result is that only pixels near the shore are showing any visible contrast. Pixels on land are all white (no information there)(figure). However the individual SRTMs on land obviously have a lot of detail (figure of the original SRTMs before merging). If do as usual and merge only SRTMs which are on land the result is quite decent. How do I come around this? How do I merge all rasters, including the ones in the shore with a lot of pixels at sea?


texts: Postgres update with ST_Union error: more than one row returned by a subquery used as an expression

texts:
first of all im not a pro in pg requests, and sorry for my English level,
so all i want is to update a geom column in a table t1 (with a gid pk) with union of this column and another one from another table, to make it easy here is my code:

UPDATE t1 SET geom = (select ST_Union(geom,other_geom) from t1, t2 where t1.gid = t2.gid)

and it gaves me an error :

ERROR: more than one row returned by a subquery used as an expression
État SQL :21000


texts: GDalConfigure.cs is missing when I install GDal Core with NuGet in C# Visual Studio

texts:
According to this post:
How to Install GDal Bindings for C#
It says all I have to do to get GDal working is install with NuGet package, and then call ConfigureGdal(). So I did the basic steps, and it fails. Here is what I did:

  I create new .net CORE 2.0 solution.

  I go to Project -> Manage NuGet Packages.

  I install GDal Core 1.0.

I look at the Solution Explorer and find that GDalConfigure.cs did not get automatically created.

As such, if I try to call GdalConfiguration.ConfigureGdal(), I get an error because it doesn't exist.

Anyone got any ideas?


texts: Configure Portal for arcgis 10.4 and Web Adaptor 10.4

texts:
I am facing a issue related to configuration of Portal for ArcGIS 10.4 and ArcGIS Web Adaptor 10.4 (Java Platform) hosted on Oracle WebLogic 12c.

I am getting this error (screen shot below)

I am using a Server with following configuration:

OS: Window 2008 R2 Enterprise

WebServer: Oracle WebLogic 12c

Java: 1.8.0_92 (64bit)

I have installed ArcGIS Server 10.4, Web Adaptor 10.4, Portal for ArcGIS 10.4 and WebLogic 12c on same VM.

I can access portal on https://system_domain_name:7443/arcgis/home/ and web adaptor on https://system_domain_name/arcgis/webadaptor

IIS is stopped to free 80 and 443 ports and WebLogic is running on 80 and 443 port as esri documentation. I can see the web adaptor options

Even it gives the option to put my portal URL, Admin User name and password of admin user.


texts: Any public dataset of U.S Highways and on and off ramps?

texts: I am working on a student project in data engineering and need a database with U.S. Highways and their on and off ramps. I took a look at OpenStreetMap and couldn't figure out if the information I was looking for was there.


texts: QGIS & GeoTIFF clipping Error "-srcwin 5897 137 0 0 falls outside raster size of 11083x4158 or is otherwise illegal."

texts:
I'm trying to clip a GeoTIFF  file  and unfortunately I'm getting the following

Error "-srcwin 5897 137 0 0 falls outside raster size of 11083x4158 or is otherwise illegal."

From another post here I found out my projection was not set correctly. I did set the projection by clicking CRS status window at the bottom right and selecting Enable "on the fly" and WGS 84 and then apply. I'm  still getting the same error. Any idea how to fix that ?


texts: Why doesn't OpenLayers Plugin 1.3.6 show in Internet menu on Ubuntu 14?

texts:
I installed QGIS 2.8.1 on Ubuntu 14.04 LTS 64bit (from repository http://qgis.org/debian trusty)
I installed OpenLayers Plugin 1.3.6

It doesn't show in main menu (Internet) like on Mac
Do I miss something or is a problem with Ubuntu ?


texts:
I want to use a QField to collect data in the field. I need to draw some sketch and save it to the corresponding geometry (point in my case).
Is it possible to do that? Geopaparazzi is able but I don't figure out how can I do in QField.


texts: How to add header to the http response of Geoserver

texts: Add a specific header to the http response of Geoserver, to allow cross domains request and avoid XMLHttpRequest On Load error.


texts: Leaflet pointToLayer: having trouble generating custom icons

texts:
I've been liking Leaflet so far but have run into a snag.  I can't get it to produce custom icons based on an attribute. Instead I get the default blue points.  I've looked at several similar postings on the web but none have helped in resolving this problem.  I have five hurricane icons indicating strength, and I have a switch statement in my pointToLayer function that selects the appropriate icon.  In the debugger I can verify that throughout the execution of pointToLayer, all variables are defined and look reasonable. The version of Leaflet is 1.2.0.  Here is my code:

    $scope.addTrackMap = function() {
      let storm_id = $scope.selected_storm.toLowerCase();

      url = '/geoserver/proxy.cfm?service=wfs&version=2.11.2&request=GetFeature&typeNames=hurricane:hurricane_point&PROPERTYNAME=(point,strength)&CQL_FILTER=storm_id=%27'+storm_id+'%27%20and%20is_prediction=false&outputFormat=JSON'

      let WeatherIcon = L.Icon.extend({
          options: {
            iconSize:     [17, 17], // size of the icon
            iconAnchor:   [8, 8],   // point of the icon which will correspond to marker's location
            popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor
          }
      });

      let hurricaneIcon = new WeatherIcon({iconUrl: 'img/hurricane.png'});
      let stormIcon = new WeatherIcon({iconUrl: 'img/storm.png'});
      let depressionIcon = new WeatherIcon({iconUrl: 'img/depression.png'});
      let prestormIcon = new WeatherIcon({iconUrl: 'img/prestorm.png'});
      let poststormIcon = new WeatherIcon({iconUrl: 'img/poststorm.png'});

      $http.get(url)
      .then(function(response) {
        let gjTrack = response.data;

        let track = L.geoJSON(gjTrack, {
          pointToLayer: function(feature, LatLng) {
            var icon;
            switch (feature.properties.strength) {
              case 's': icon = stormIcon; break;
              case 'x': icon = prestormIcon; break;
              case 'm': icon = hurricaneIcon; break;
              case 'h': icon = hurricaneIcon; break;
              case 'd': icon = depressionIcon; break;
              case 'i': icon = poststormIcon; break;
            }
            return L.marker(LatLng, icon);
          }
        }).addTo($scope.G.map);
        $scope.G.tracks.push(track);
        L.marker([29.8, -95.4], {icon: stormIcon}).addTo($scope.G.map);
        L.marker([29.9, -95.4], {icon: prestormIcon}).addTo($scope.G.map);
        L.marker([29.9, -95.3], {icon: poststormIcon}).addTo($scope.G.map);
        L.marker([30.0, -95.3], {icon: hurricaneIcon}).addTo($scope.G.map);
        L.marker([30.0, -95.2], {icon: depressionIcon}).addTo($scope.G.map);
      });
    }

I am running this in combination with AngularJS hence the $scope references.  At the end I've added some debugging to verify that each of my icons are correctly formed.  The L.marker's are showing each icon properly.


texts:
In my react app, I'm seeing the following error in Chrome devtools:

Uncaught (in promise) RangeError: Invalid language tag: en-au;q=1

The error is also currently visible at the arcgis official site:
https://developers.arcgis.com/javascript/latest/sample-code/widgets-frameworks-react/index.html

This error seems to be related to the underlying dojo.js library that arcgis code is using.

I am not seeing in the arcgis react setup, how to set dojo config for non-custom builds.

Custom build docs:
https://developers.arcgis.com/javascript/latest/guide/using-npm/

Using the arcgis react code, how do I pass dojo config?

Screenshot of error (notice no widgets are rendered -- hence the white screen):

Arcgis official quickstart is throwing same error (see screenshot):


texts: QGIS: Use of a model output in the same model as a layer in the field calculator formula

texts:
I am trying to use field caluclator within a model. In this formula I want to reference the output (temporary layer) of another step of the same model (output objektfilter_strassen_wege, which is named strassenpolygone_flurstuecke). Since this layer is not loaded in QGIS, I get no result. If I save the correct layer after running through the model and have the model repeated, I get a result. But that's not my goal! I want to get it the first time. I enter the following into the field calculator:
aggregate(
 layer:= 'strassenpolygone_flurstuecke',
 aggregate:='concatenate',
 expression:=oid,
 concatenator:=', ',
 filter:=intersects($geometry, geometry(@parent))
 )

strassenpolygone_flurstuecke should be called differently as input, I suspect. So not layer:= but something else that suggests that it is a generated output. The second possibility that went through my head was to choose to save the layer strassenpolygone_flurstuecke instead of the temporary layer. But even if I do this using the model, I don't get any result.


texts: Saving symbology of all layers in mxd to enable quick reverting back to certain "look"?

texts: I am using ArcMap 10.2 and would like to set multiple variations of the layers symbologies.  In autocad this would be the equivalent of setting the layer state.


texts: Convert lat-long to geom using nodejs pg-promise?

texts:
I have a DB that is used as a read only postgis DB. I also have an input of lat & long to search within my db(in which obviously the points are saved in geom type - using nodejs pg-promise if it matters, but i guess it doesnt as i only need to use the correct sql query)

is there a way of easily requesting the closest node from my db to the input in the form of lat & long?


texts:
I am trying to delineate just the catchment area of some lakes, and am wondering the correct way to do this. I already have a filled DEM, along with a flow direction and a flow accumulation raster. Is there a way to accomplish this task without the use of pour points? Or do I have to use them. If that is the case, can a pour point be located in the middle of a lake (assuming that the middle of a lake is the highest area of flow accumulation). Whenever I do try to run this data, whether with or without a pour point, I get something that does not look completely right. The catchment area does not encompass the entire lake, and the actual watershed itself does not accurately represent the flow accumulation arrows. Am I doing something wrong, or is there a simple cause to my problem. Maybe if someone could take a quick second to step through the watershed toolset, that would be helpful.
 Am using ArcGIS 10 SP1, with Spatial Analyst, ArcView license.


texts:
Is there a cheat sheet that helps me remember where settings are hidden in ArcGIS Pro?
I am looking for a poster that I can hang next to my monitor.


texts:
I am using Leaflet to create a map of points (from geojson) that will open a picture and text under the picture. The text is centered, but I am having trouble centering the picture. This seems like something I should be able to do simply. Suggestions?

    var places = L.geoJson(CLusers, {
    pointToLayer: function (feature, latlng) {
            return L.marker(latlng, {icon: placesIcon})
            },
    onEachFeature: function (feature, layer) //functionality on click on feature
        {
        layer.bindPopup("

"
            + feature.properties.name
            + "
"
            + feature.properties.description, customOptions);
        }
    });

CSS styling:

    /* popup */
    .leaflet-popup {
          position:absolute;
          text-align:center;

      }
    .leaflet-popup-content-wrapper {
          padding:2px;

      }

     .leaflet-popup-content {
        max-width: 100%;
        max-height: 100%;
        overflow: auto;
        text-align:center;
        img-align: center;
    }


texts:
I try to make labels with several lines in the main map in QGIS. I tried the formula, just after but it shows me the first condition without doing the others.

IF ("sensitivity" = 'A3', 'A3:' || ceil ($ length), '') || IF ("sensitivity" = 'A4', 'A4:' || ceil ($ length), '') || IF ("sensitivity" = 'A2,' A2: '|| ceil ($ length),' ')

if I had to add a field the function would have worked, on the other hand when I put it in a label (see photo in attachments) it does not work (see photo)
he checks the first condition is stopped on it he does not look at the others (see photo)

ng


texts:
I need to layer stack two Landsat images from the dry season and the wet season.

Is the function 'composite' in earth engine going to give me the layer stacking?


texts: How to prevent user from deleting a feature?

texts:
How can I prevent the user from deleting a feature?

void m_editEvents_OnDeleteFeature(IObject obj)
        {
            // Code
        }


texts: arcpy: For loop to sequence Processing of two items in list using ArcPy?

texts:
I have multiple rasters, organized by years. I.e.
raster y1 = from year 1
raster y2 = from year 2, etc...).

All of rasters contain values 0-11, representing forest (0-6) and disturbance (7-11).
I would like to:

Identify the forest on scene in y1 (by Reclassify tool)
Use the forest from y1 to Extract by mask raster y2
Identify the forest on scene in y2 (by Reclassify tool)
Use the forest from y2 to Extract by mask raster y3
Identify the forest on scene in y3 (by Reclassify tool)
Use the forest from y3 to Extract by mask raster  y4

etc for every year

However, I can't imagine how can I automate this process? I tried to run for loop and advance the raster index value by one to move to following raster in a list of rasters. Instead I have created unfinite loop, where the for loop always start with the first raster in a list... Or should I use another type of loop?

My approach:

# Import system modules
import arcpy
from arcpy.sa import *

# Set environment settings
wd = "C:/Users/Projects/2017_deforest"
env.workspace = wd + "/raw/SAO"
arcpy.env.overwriteOutput = True

# Set local variables
rasters = arcpy.ListRasters("sao*", "IMG")
reclassField = "Value"
remap = RemapRange([[0,0, "NODATA"],
                    [1,6,1],  # forest in that year
                    [7,11, "NODATA"], # disturbance
                    [12,255, "NODATA"]])

# Check out the ArcGIS Spatial Analyst extension licence
arcpy.CheckOutExtension("Spatial")

# Execute Reclassify
for raster in rasters:

    # Identify forest in raster y1
    tempForest = Reclassify(raster, reclassField, remap, "NODATA")

     # Create list index to move to following raster in a list
    rasNumber = 1
    inRaster2 = rasters[rasNumber]

    # Execute Extract by mask
    outName = wd + "/outputSAO/" + inRaster2
    outExtractByMask = ExtractByMask(inRaster2, tempForest)

    # advance the index by one to move to another element in  a list
    rasNumber = rasNumber + 1

    # Save the output
     outExtractByMask.save(outName)

# Check in the ArcGIS Spatial Analyst extension license
arcpy.CheckInExtension("Spatial")


texts: turn back shapefile from pandas to geopandas

texts:
I have these shapefiles:

q=gpd.read_file(a.shp)
df=gpd.read_file(b.shp)
final = pd.merge(df, q, on=['FID_buffer'], how='inner')
#out= a certain directory
final.to_file(out)

  AttributeError: 'DataFrame' object has no attribute 'to_file'

I want after the join to export it back as shp

I tried with spatial join in geopandas but it said something with crs was wrong that's why I did with pandas but I can't export it.

final = gpd.sjoin(df, q, how="inner", op='intersects')

which gives:

AttributeError: 'DataFrame' object has no attribute 'crs'


texts: Modify original ColorTable in VRT & TIFF files

texts:
I'm looking to modify the original ColorTable, when georeferencing, PNG => gdal_translate + gdalwarp => TIFF.
gdal_translate -of VRT -a_srs EPSG:4326 ' + file_png + ' ' + file_vrt + ' -a_ullr ' + calc_ullr
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 ' + file_vrt + ' ' + file_tiff

If I open the VRT file and do the edit manually, the output TIFF file is correct.
The problem is that I have 524288 files ... so I would like to do the modification automatically, via gdal_translate, but I don't quite understand using the parameters of the command ...
• Original VRT & TIFF files
# VRT
  <VRTRasterBand dataType="Byte" band="1">
    <ColorInterp>Palette</ColorInterp>
    <ColorTable>
      <Entry c1="0" c2="0" c3="255" c4="255" />
      <Entry c1="255" c2="255" c3="255" c4="255" />
      <Entry c1="0" c2="0" c3="0" c4="255" />
        [...]
      <Entry c1="0" c2="0" c3="0" c4="255" />
    </ColorTable>
  </VRTRasterBand>

# TIFF
  Band 1 Block=63153x1 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 0,0,0,255
    1: 255,255,255,255
    2: 0,0,0,255
      [...]
  255: 0,0,0,255

• Modified VRT and TIFF files
# VRT
  <VRTRasterBand dataType="Byte" band="1">
    <ColorInterp>Palette</ColorInterp>
    <ColorTable>
      <Entry c1="0" c2="0" c3="255" c4="255" />
      <Entry c1="0" c2="255" c3="0" c4="255" />
      <Entry c1="255" c2="0" c3="0" c4="255" />
        [...]
      <Entry c1="255" c2="0" c3="0" c4="255" />
    </ColorTable>
  </VRTRasterBand>

# TIFF
  Band 1 Block=63153x1 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 0,0,255,255
    1: 0,255,0,255
    2: 255,0,0,255
      [...]
  255: 255,0,0,255

With what settings can I get the VRT & TIFF files the way I want?


texts: How to temporary disable map click event in OpenLayers

texts:
How can I disable map click event?
My idea is to disable it when I am positioned with mouse over my popup container. After I move mouse out of it, I want that event is enabled again. Something like this:

container=document.getElementById('popup')
container.addEventListener('mouseover',function(){
                 //disable map click event
}

container.addEventListener('mouseout,function(){
                 //enable it again
}

Is this possible?


texts: SharpMap's backgroundLayer on an intranet(no internet) (Windows)

texts:
I'm making windows C#(WPF) mapControl on intranet(no internet). (Windows Server)

I get OSM.pbf and mbtiles file.

Is this possible? Please, Look at this picture.

private void button6_Click(object sender, EventArgs e)
{
    TileAsyncLayer osmLayer = new TileAsyncLayer(KnownTileSources.Create(KnownTileSource.OpenStreetMap),
        "TileLayer - OSM");
    this.mapBox1.Map.BackgroundLayer.Clear();
    this.mapBox1.Map.BackgroundLayer.Add(osmLayer);
    this.mapBox1.Refresh();
}


texts: Removing overlapping polygon boundaries within same layer in QGIS

texts:
We are building mosaic datasets for 100's of rasters (Topo sheets). Used QGIS Tile_Index to get the raster_topo_sheet's extent as vector. But the issue is, overlaps near the edges of all the topo sheets. Instead of manually correcting these edges for footprint creation, can't we merge/delete one boundary and make it seamless ?

1) Tried "Eliminate selected polygons" in qgis with alternate polygons selected (Largest common boundary). But result was not as expected.

2) Tried "Dissolve tool" in QGIS. Removing overlapping/duplicate polygons in same layer using QGIS?. But same overlap exists.


texts: Identifying coordinate system for Jersey

texts:
I'm trying to plot some X,Y coordinates which should be located on Jersey (the British dependency, not the state).

The metadata that came with the points is as follows:

Coordinate System: Transverse_Mercator
False_Easting: 500000.000000
False_Northing: 0.000000
Central_Meridian: -3.000000
Scale_Factor: 0.999600
Latitude_Of_Origin: 0.000000
GCS_European_1950
Datum: D_European_1950
Prime Meridian: 0

An example coordinate is: 40844, 68194

However, when I try to put this into QGIS or ArcGIS, I end up with points near latlng 0,0. What am I doing wrong? How do I reference these points correctly, so I can plot them over a basemap?


texts: How to develop C++ standalone QGIS C++ Application

texts:
I want to integrate QGIS in QT\C++ application. I try to write basic C++ application to render map and build it using MSVC 2010.

class PostGisViewer: public QMainWindow
{
public:
    PostGisViewer(): QMainWindow()
    {
        QWidget *w = new QWidget();
        this->setCentralWidget(w);
        QgsMapCanvas *canvas = new QgsMapCanvas();
        canvas->useImageToRender(false);
        QVBoxLayout *layout = new QVBoxLayout(w);
        layout->addWidget(canvas);
        QgsDataSourceURI uri;
        uri.setConnection("127.0.0.1", "5432", "gis", "login", "pass", QgsDataSourceURI::SSLdisable);
        uri.setDataSource("public", "myedges", "the_geom", "");
        QgsVectorLayer layer(uri.uri(), "testLayer", "postgres");
        QgsMapLayerRegistry::instance()->addMapLayer(&layer);
        QgsRectangle r(-1.5, -0.6, 1, 1);
        canvas->setExtent(r);
        QgsMapCanvasLayer cl(&layer);
    }
};

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QgsApplication::setPrefixPath("C:/Program Files/QGIS Brighton/apps/qgis", true);
    QgsApplication::initQgis();
    PostGisViewer wnd;
    wnd.show();
    int retval = a.exec();
    QgsApplication::exitQgis();
    return retval;
}

But I can't build it because I haven't qgsconfig.h and lib files. Must I build QGIS from source to create needed libs and dlls and develop C++ QGIS applications?


texts: What does MODIS data reflectance values (MOD13Q1) mean?

texts:
Several publications suggest filtering MODIS data (in my case MOD13Q1) prior to use. They recommended to filter out pixels having blue reflectance more than 10%, but what 10% here means? is it 10% of the total possible value for blue reflectance or 10% or the total reflected over the whole spectrum?

Any advices?


texts:
AGI has a server product called STK Server that exposes REST services to perform satellite acquisition planning. However the cost is astronomical $200k+ (pun inteded). They also have STK components (DLLs) which will allow you to build the web services yourself but, this API is also expensive.

Does anyone know of any economical alternatives? Any actively maintained open source projects would be great.

I need either an API or web service (REST, SOAP, etc) which I can perform satellite feasibility analysis. For example: I give it a point, time, and satellites (or sensors) I'm interested in and it will give me the available ground swaths.

I found eo-sps-library, but it doesn't look like anyone is maintaining it.


texts: Distributing PyQGIS Plugin Locally with External Modules

texts:
I'm developing plugin with QGIS (3.4)'s in built python3 and plugin builder, I've also installed external python modules like opencv, PIL. The plugin will be used and stay in the company only.

Can we just copy the working folder (generated by pb_tool contains code and ui) with installed additional python packages, and ask the user to use plugin loader to load?

I've read Distributing QGIS plugin which depends on certain Python packages but my preference is end user's convenience, I don't want them to use pip install their own, and my plugin package size is not a problem.


texts: Heatmap processed on the whole layer / dataset

texts:
How can I process the geoserver heatmap on my whole database rather than on the displayed part of it?

What I want is to keep the same color for each place, everytime.
Here is an illustration of what I get currently.


texts: converting projections using dotspatial or proj4

texts:
how can i convert projections using either dotspatial or proj4?
i am making a program using sharpmap and dotspatial in VB.net
have to convert a EPSG 4030 into a Lambert conformal conic projection and back to WGS84 on the fly
also can i convert a system on the fly using a WKT?


texts: How Can I write Geopackage Layers with Abstract/Description/Metadata using QgsVectorFileWriter

texts:
How can I use the QgsVectorFileWriter to include metadata description for Geopackage layers in a python script?

I can set the layer name using:

options.layerName = "roads_layer"

what I want is something like:

options.description = 'This are the roads covering such and such, Dec 2019".

In QGIS you can right click, export layer to Geopackage and you get the option to set a Description.

Then in QGIS, you get the description showing in the Abstract (baring in mind my examples don't actually match):

I can see that the GDAL Geopackage definition means you can do this, I just haven't been able to find or understand how to do it.

https://gdal.org/drivers/vector/gpkg.html

Can anyone help please?

Code:

layObj.setAbstract("Test metadata Dec 2019") # this line doesn't translate to the geopackage table
options = QgsVectorFileWriter.SaveVectorOptions()
options.actionOnExistingFile = QgsVectorFileWriter.CreateOrOverwriteLayer
options.layerName = layname
writer = QgsVectorFileWriter.writeAsVectorFormat(layObj, geopP, options)


texts:
So I uploaded a csv from my local drive and set up the map, but I would like to update a column of data every day and re-upload the csv, but keep map settings.

The dataset is very simple: one column for country names and one with values.  Only the values change every day, not the country names

Any ideas?


texts: Polygon divider plugin for QGIS gives me "failed float divmod()" error

texts:
I'm trying to split a polygon shape file from an open data city .shp file. And Polygon Divider keeps giving me this error.
Even when I start a new project, and create a new layer to create a square polygon. When I try and then divide this square polygon it gives me the Failed Float divmod() error.
Any help or suggestions on why this is happening?


texts:
I try to resize Pixel segments exported from eCognition. The goal is to erode the segments for one pixel of the boarder.

So for example if the segment is 30px x 30px the result should be a new area with 28px x 28px. The Problem is that every Segment got an ID, so it should work for every single Segment especially when there are connected. I'm working with QGIS 2.12 and probably it is possible with the raster calculator right?

I found a solution in eCognition:


texts: Accessing QGIS element variables in Composer

texts:
Is there a way to access "other" composer element variables in QGIS?

I can "print" a variable in a text element by inputing for example: [% @project_title %], but is there a way to use the map_scale variable from a map element?

Anyting like: [% @map0(map_scale) %] ?


texts: Guessing which .qml goes with every layer of a project

texts:
I have a project in QGIS (v3.8) containing 25 layers with different simbology. This simbology I know it is associated to a specific .qml file that is in a folder of my user profile in QGIS.
Is there any way to know which .qml goes with every layer?
I have opened the properties of every layer but i don't see anywhere where I can look for it.


texts: Why do I have to reload this plugin every time, to make it work?

texts:
I'm not "fluent" in PyQGIS but thanks to some tutorials I managed to put togheter a plugin that acquires the clicked point's coordinates and saves a QRcode containing the link to google maps for that point.
The plugin works fine but it needs to be reloaded every time because when I swich to other tasks (like selecting elements) and then come back to the plugin my mouse pointer doesn't change shape to a cross as it should, so I think that there is some problem with the command QgsMapToolEmitPoint(canvas) .
This is a snippet
from pyproj import Proj, transform
from qgis.core import QgsProject, Qgis
from qgis.utils import iface
from qgis.gui import QgsMapToolEmitPoint
import qrcode
from pathlib import Path
epsg=32632

    def display_point( pointTool ):

        #print(epsg)

        inProj = Proj(init='epsg:%s'%epsg)
        outProj = Proj(init='epsg:4326')
        x1,y1 = pointTool[0],pointTool[1]
        x2,y2 = transform(inProj,outProj,x1,y1)

        #creates folder QR if doesn't exist
        Path(QgsProject.instance().readPath("./")+'/QR').mkdir(parents=True, exist_ok=True)

        img = qrcode.make('https://www.google.com/maps?q=%f,%f' %(y2,x2))
        img.save(QgsProject.instance().readPath("./")+'/QR/%f,%f.png' %(y2,x2))

        link = 'https://www.google.com/maps?q=%f,%f' %(y2,x2)
        path = QgsProject.instance().readPath("./")+'/QR'

        iface.messageBar().pushMessage('Link: %s ' %link, ' %s' %path, level=Qgis.Success, duration=10)

    canvas = iface.mapCanvas()

    # this QGIS tool emits a QgsPoint after each click on the map canvas
    pointTool = QgsMapToolEmitPoint(canvas)
    #left click runs display_point
    pointTool.canvasClicked.connect( display_point )

    canvas.setMapTool( pointTool )

Do I miss something that resets everything without reloading?


texts: Export mdb to gdb or make a merge between multiple mdb with same structure

texts:
I have more than 200 .mdb files with the same structure and I need integrate all in one .mdb but I don't know how, I found a tool that can do it but it works with .gdb formats only.

I could make an exportation one by one of all mdb database to integrate with the tool but it could take me time.

I think there has to be a better solution.

The result that I want is have a merge .shp or .gdb or .mdb (doesn't matter what file type ) with all the information of my 200 .mdb files.


texts:
I am having an issue trying to register a dataset, and being able to edit a featureclass within it.

I am new to SDE so please bear with my explanation.  I read online you cannot register a feature dataset that has a topology in it, which my feature dataset does.  So it is technically "unregistered"?  But when I am in Arcmap 10.1 it will not let me edit the feature class, most specifically the table associated with the feature, in this feature dataset, and when i open an editting session i get the warning that the layer is not versioned.

Am I missing a step that will allow me to edit this feature class within this unregistered dataset? Compressing is grayed out so I am not even able to do that.

Thanks in advance for the help.


texts: How to derive point height from contour data?

texts:
I got vector layer that represents height over sea level. Then, I also have different vector layers. Is there any good way of using QGiS or things related to calculate sea level for those points?

Edit:
Those points that are in different layers only have location. They are names of hills, rivers and so forth. What I need is to merge the info of those two layers. So I know how high over sea level the items are.

Edit two;
(Sorry not subject that I am strong in)
I got line vector layer. With line every 20m of elevation. Over all of Iceland. With about 60.000 points that I need to find hight over sea level on. I dont mind leting the computer work on this but not by hand :)


texts: How to load an image asset from a list of assets in the folder?

texts:
I have a folder in my Assets that contains 44 images.

I want to add them to the Map in sequence.  However I'm getting an error that I can only create an image that is a constant.

var image = ee.Image("users/JASPR/Lotes/La_Pampa/Parametros/MVTCatrilo38000") // This works fine.

var assetList = ee.List(ee.data.getList({'id':"users/JASPR/Lotes/La_Pampa/Parametros"}))

print(assetList) //List (44 elements)

var value = ee.Dictionary(assetList.get(3)) // get the third element
var myID = ee.String(value.get('id')) // get the id

print(myID) // "users/JASPR/Lotes/La_Pampa/Parametros/MVTCatrilo38000"

var image2 = ee.Image(myID) // Image (Error) Actual value for parameter 'id' must be a constant.

// Obviously, as a result of the error above, all that follows doesn't work.
print("image",image2)
Map.centerObject(image2)
Map.addLayer(image2)

When I replace the "myID" variable with the string:

"users/JASPR/Lotes/La_Pampa/Parametros/MVTCatrilo38000"

it loads the image perfectly.


texts:
I'm importing grayscale elevation images (bmp and jpeg) into a program I use for 3d CNC terrain carving. I've been downloading Hi-Res terrain corrected DEM files from ALOS PALSAR. I bring them into ER Viewer and export them as bmp files.

When I extrude the bmp the terrain is stepped, which  onscreen grayscale looks smooth and does not indicate.

What am I doing wrong here. It must be something I don't understand about raster files and the way they behave. I just want to have raster files that are smooth and not stepping. I'm calling it stepping as its not exactly like contour lines but it will be noticable when I come to carve these.


texts: An interactive, animated deliverable (i.e. in PDF)? How?

texts:
I'm wondering if it's possible to make something like this:

http://tipstrategies.com/geography-of-jobs/

But in the form of a deliverable? Like a PDF? I'd like to make something similar that I could email to people.
If yes, what skills/resources are needed to accomplish something like that?


texts: After calling projectRaster in R, missing right edge of world map when plotting with ggplot

texts:
I'm using projectRaster and rasterToPoints in R to get a dataframe with lat/lon coordinates for plotting in ggplot but I seem to be losing the right edge of the map (New Zealand). I'm not sure if this is an issue with my use of projectRaster or rasterToPoints or geom_raster

Here's my initial rasterLayer:

class       : RasterLayer
band        : 1  (of  4  bands)
dimensions  : 578, 943, 545054  (nrow, ncol, ncell)
resolution  : 46261.72, 46261.72  (x, y)
extent      : -20134202, 23490599, -9583413, 17155861  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

Which produces:

And here's my code to to project and convert to a dataframe:

wgs84 <- "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
+towgs84=0,0,0"
b.wgs <- projectRaster(dilmap, crs=CRS(wgs84))
b2.wgs <- rasterToPoints(b.wgs, spatial=TRUE)
b2.df <- as.data.frame(b2.wgs)

plot(b.wgs)

EDIT: Added plot of b.wgs


texts: Using FeatureClassToFeatureClass from list to concatenated list?

texts:
Have many feature classes in geodatabases and eventually want to run more complex processes on them. Having trouble with the basics - can anyone tell me what I am doing wrong with the following? If I use "print fcscopy" I get the list of output file names I want.. but the featureclass to featureclass gives following error.

#Code
import arcpy

arcpy.env.workspace = r"D:\_StuData\GIS\Projects\PersonalProjects\Product\test.gdb"
fcs = arcpy.ListFeatureClasses()
copy = 'copy'
fcscopy = [x + copy for x in fcs]
outpath = "D:\\_StuData\\GIS\\Projects\\PersonalProjects\\Product\\test.gdb"

arcpy.FeatureClassToFeatureClass_conversion(fcs, outpath, fcscopy)

Error

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

Testing

  >>> print fcs

  [u'Border', u'Building', u'Concrete', u'Grass', u'Gravel', u'Rocks', u'Roof']

  >>> print fcscopy

  [u'Bordercopy', u'Buildingcopy', u'Concretecopy', u'Grasscopy', u'Gravelcopy', u'Rockscopy', u'Roofcopy']


texts: Fill e.layer when firing events manually

texts:
(Asked on stackoverflow, but later found gis@stackexchange, and think it may be a more suitable place)

I am using a L.vectorGrid.protobuf layer (named as pbfLayer) to display vector tiles, and I want to trigger click events by pbfLayer.fileEvent('click', {latlng: <some coordinate>}). But if in this way the event argument e will only have properties latlng, target, and type, while if triggered manually by mouse clicking it will have more properties including layer.

Example:
https://jsfiddle.net/ziyuang/dfekwzhd/

Every time a click event is triggered, the console will print the event argument e. A screenshot of console output is as follow, if I first trigger an event manually by clicking and then by programming, using the same coordinate:

Is there a way to find and fill other properties of e, so that fireEvent can perfectly mimic a clicking?

(https://jsfiddle.net/ziyuang/dfekwzhd/4/):

I tried prosthetic-hand for mimicking mouse clicking but still not working. The code added is

var crs = L.CRS.EPSG3857;
var rambaut_lake_latlng = L.latLng(40.99842740667731,-74.16458129882814);
var rambaut_lake_point = crs.latLngToPoint(rambaut_lake_latlng , map.getZoom());
var southwest_point = crs.latLngToPoint(map.getBounds()._southWest, map.getZoom());
var x = rambaut_lake_point.x - southwest_point.x;
var y = map.getSize().y - (southwest_point.y - rambaut_lake_point.y);
console.log([x, y])

var hand = new Hand();
var finger = hand.growFinger('mouse');
finger.moveTo(x, y, 0).down().up();

Manually clicking will create a popup of "Rambaut Lake" but I don't see any popup on the page.

I finally get this done by using happen.
In my case, I have to

var canvas = document.elementFromPoint(left, top);
$(canvas).happen({type: 'click', clientX: left, clientY: top});

And neither $('#map').happen({type: 'click', clientX: left, clientY: top}) nor using jQuery's trigger on the found canvas works for me.


texts:
Two methods of selection in ArcMap that I thought would be the same are in fact not equal.  I created a 3 mile buffer around a single line feature (approx 6mi in length).  I'm working with parcels, as points, that should be within 3 miles of the line feature.
Method 1) Create buffer of 3 miles based on line.  Select by attribute > target = parcels > source = buffer > selection method = intersect.  This yielded 77374 parcels.
Method 2) Select by attribute > target = parcels > source = line > selection method = within a distance: 3 miles.  This yielded 77399 parcels.
The missing 25 parcels are found close to the boundary of the buffer along curves.
So, how does ArcMap build a buffer around a line?
Buffers around a point result in a curve with a single vertex.  The picture shows the vertices of the buffer.  The parts of the buffer that are made from the endpoints are a series of connected points about 1k feet apart instead of a curve.  Is there a way add curves or decrease spacing of vertices as environments in the tool?

I ended up buffering all the vertices in the line feature, dissolving them, union with original buffer, dissolve those.  Then selecting by intersection yields the correct count and has a difference in area of ~600k sqft.


texts: Split a line when it crosses a polygon in R

texts:
This should be a simple problem but I can't seem to find a solution.

I have a line which crosses several polygons and I want to split it into multiple lines at the intersection of each polygon using R. In ArcGIS the Union tool can achieve this but Union in R seems to work differently. I using sf but could also use sp if needed.

The image shows a single line (red), which crosses the two polygons and a gap between the polygons. The result should be three lines (red,green,blue).


texts: Extract longitude latitude and radius from POSTGIS column

texts:
I have entered the circle in the Geometry type column (name=shape) in my POSTGIS as following:

ST_Buffer(ST_MakePoint($longitude, $latitude)::geography, $radius)::geometry

Then I extracted the centre using:

ST_astext(ST_centroid(shape))

But it gave me a little different value than that of I entered previously.So Can anybody help me find my mistake.Also I need to extract the radius from above table.


texts: Possible to provide a MaxRecordCount in a esri/tasks/Query?

texts:
I see no mention of how to limit the number of results the server will return in esri/tasks/Query.  Is it not possible?

This query services seems to indicate it is not possible.


texts: How to fix error 000840 the value is not a raster dataset for Mosaic?

texts:
I'm trying to to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second raster to mosaic to the first raster with all of the default mosaic properties. My code to do this is pasted below, but after trying to run the code I receive the following error.

How do I fix this problem?

Runtime error  Traceback (most recent call last):   File "<string>", line 39, in <module>   File "c:\program files
(x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 13233, in Mosaic     raise e ExecuteError:
ERROR 000840: The value is not a Raster Dataset.

Code:

# Name: Batch mosaic
... # Description: Batch mosaic processes
...
... # Import system modules
... import arcpy
... from arcpy import env
... from arcpy.sa import *
... import math
...
... # Set environment settings
... env.workspace = "C:\Users\dtma224\Desktop\PhD\Paper 2\Timing\Subbasin Connectivity Flow Time"
...
... # Check the ArcGIS Spatial Analyst extension license
...
... arcpy.CheckOutExtension("Spatial")
...
... count = 1
...
... # Run for each raster in the directory
...
... while count < 2:
...
... # Execute times flow direction calculation
...
...     name1 = "Day72Subbasin" + str(count) + " Bin 1.tif"
...
...     Bin1 = Raster(name1)
...
...     name2 = "Day72Subbasin" + str(count) + " Bin 2.tif"
...
...     Bin2 = Raster(name2)
...
...
...     arcpy.Mosaic_management(Bin2, Bin1, "LAST", "FIRST", "", "","NONE", "0", "NONE")
...
...     count = count + 1
...


texts: Deleting values less than 0.31 in NDVI raster layer in QGIS

texts:
In my research I have a Ndvi raster layer, and I want to delete the values corresponding to bare soil, which are those minor of 0.31. Therefore, I will obtain a new raster layer with those values higher or equal to 0.31.
Could anybody help me with this?
I am using QGIS.


texts:
I'm trying to follow the instructions here to load a raster into a PostGIS database:

python raster2pgsql.py -s 4269 -I -r *.tif -F myschema.demelevation -o elev.sql

I understand that I replace * with the path to my raster, but I don't understand the part myschema.demelevation or elev.sql. Should I have my own schema for this file? And what does the elev.sql part mean?

I also read through the gdal PostGIS raster driver to try and understand this with more examples. Similarly, they suggest loading a raster katrina

python raster2pgsql.py -r /path/to/katrina.tif -t katrina -l 1 -k 64x64 -o katrina.sql -s 4326 -I -M

Using my current setup, I tried loading the katrina raster in:

    python2.6 ~/src/postgis-2.0.0SVN/raster/scripts/python/raster2pgsql.py -r ~/tmp/katrina.tif -t katrina -l 1 -k 64x64 -o katrina.sql -s 4326 -I -M

However, I got the following errors:

Traceback (most recent call last):
  File "/home/src/postgis-2.0.0SVN/raster/scripts/python/raster2pgsql.py", line 34, in <module>
    from osgeo import gdal
  File "/home/lib/python2.6/GDAL-1.8.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/home/lib/python2.6/GDAL-1.8.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /home/lib/python2.6/GDAL-1.8.1-py2.6-linux-i686.egg/osgeo/_gdal.so: undefined symbol: GDALSetRasterUnitType

I don't fully understand these errors mean; when I compiled gdal should I have specified an argument for GDALSetRasterUnitType ?

More generally, I'm having difficulty understanding why I am not specifying the database that I am trying to load this data into.

After following MerseViking's advice I ran:

python /usr/lib/postgresql/8.4/bin/raster2pgsql.py -r /home/celenius/Downloads/katrina.tif -t katrina -l 1 -k 64x64 -o katrina.sql -s 4326 -I -M

which returned the following output:

------------------------------------------------------------
 Summary of GDAL to PostGIS Raster processing:
------------------------------------------------------------
Number of processed raster files: 1 (/home/celenius/Downloads/katrina.tif)
List of generated tables (number of tiles):
1   katrina (256)

Then I ran:

psql -d test -f katrina.sql - U postgres -W

which returned the following:

    addrastercolumn
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 public.katrina.rast srid:4326 pixel_types:{8BUI,8BUI,8BUI} out_db:false regular_blocking:true nodata_values:NULL scale_x:'0.029325513196481' scale_y:'-0.029325513196481' blocksize_x:'64' blocksize_y:'64' extent:POLYGON((-100.014662756598 9.98533724340176,-100.014662756598 40.0146627565982,-69.9853372434018 40.0146627565982,-69.9853372434018 9.98533724340176,-100.014662756598 9.98533724340176))
(1 row)

(END)

This message and a blinking cursor appear on screen. I assume that it is loading into the database, but I'm not sure. The tif file is just 3MB - I had assumed that it would not take long to load a file of this size but the blinking cursor has already been on the screen for ~1 hour. Has this crashed or do I just need to wait a long time?
I have 4GB of RAM and a dual-processor of 2.5 GHz.


texts: How to access the attribute table of a TIF map in R?

texts:
I downloaded a map in TIF format that came with the following files: a2_LOt_12.tif.vat.cpg; a2_LOt_12_v170321.tfw; a2_LOt_12_v170321.tif; a2_LOt_12_v170321.tif.aux; a2_LOt_12_v170321.tif.ovr
a2_LOt_12_v170321.tif.vat.dbf; a2_LOt_12_v170321.tif (XML doc).
In ArcGIS the file opens fine and I can access the attribute table:

However, I am having a tough time opening that table in R. I expected "levels()" to work, but it returns "NULL":

r <- raster("a2_LOt_12_v170321.tif")
levels(r)

Is there another way to access that attribute table in R?


texts: Calculate Fields with Null Values using arcpy.da.UpdateCursor of ArcGIS for Desktop?

texts:
How do you calculate fields with null values?  I have multiple fields that may have null values, that aren't being calculated in the third field.

import arcpy
with arcpy.da.UpdateCursor(r"...gdb\test.gdb\test",["A", "B", "C"]) as cursor:
    for row in cursor:
        row[2] = row[0] + row[1]
        cursor.updateRow(row)

The result of that calculation is this error:

Traceback (most recent call last):
  File "C:\Users\Desktop\updatecursor2.py", line 4, in <module>
    row[2] = row[0] + row[1]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

The result of the script are the same results when I try to use the field calculator:

How do you use the data update cursor, or field calculator to calculate the sum of the values in a new field if you have null values?

I'm using ArcGIS 10.1 SP1 for Desktop.


texts: Mosaic DEM has large pixel when displayed in ArcMap?

texts: I created a mosaic dataset in ArcMap 10.2 from tiles of ASTER DEM's at 30m resolution. I am attaching the image of what my export looks like. You can see that there are extremely large, alternating pixels. These are apparent upon export to a pdf of tiff and also when you zoom way-in in data view in Arc. How can I fix this issue?


texts: Match features that are spatially similar with ArcGIS?

texts:
I'm hoping there might be a way to match features from one feature class to features of another feature class that are the most spatially similar. I have two datasets representing the same thing that were created by two different organizations.

Now I need to get information form each of their attribute tables and learn how they relate. I've seen 10.2 has Similarity Search that looks promising but I'm working with 10.1.

Any help would be great.


texts: Error Projecting Raster (.hdf) Using ArcPy

texts:
I want to project HDF files (MODIS images) to another coordinate system using ArcPy. The following is the code I wrote:

input_ras="N:\\mod16a2\\MOD16A2.A2001001.h24v05.006.2017068142418.hdf"

out_ras= "\test.tif"

# the coordinate system which is required
out_co="G:\\Rathore\\vic_auto7\\shape_proj.prj"

arcpy.ProjectRaster_management(in_raster=input_raster,out_raster=out_ras,out_coor_system=out_co)

This script produces the following error:

ExecuteError                              Traceback (most recent call last)
<ipython-input-95-0d17576ef2fe> in <module>()
 arcpy.ProjectRaster_management(in_raster=input_ras,out_raster="out_ras,out_coor_system=out_co)

C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py in ProjectRaster(in_raster, out_raster, out_coor_system, resampling_type, cell_size, geographic_transform, Registration_Point, in_coor_system)
   9700         return retval
   9701     except Exception as e:
-> 9702         raise e
   9703
   9704 @gptooldoc('RegisterRaster_management', None)

ExecuteError: Failed to execute. Parameters are not valid.
Undefined coordinate system for input dataset.
Failed to execute (ProjectRaster).

I checked the projection of input file and it is:

"PROJCS['Unknown_datum_based_upon_the_custom_spheroid_Sinusoidal',GEOGCS['GCS_Unknown_datum_based_upon_the_custom_spheroid',DATUM['D_Not_specified_based_on_custom_spheroid',SPHEROID['Custom_spheroid',6371007.181,0.0]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Sinusoidal'],PARAMETER['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',0.0],UNIT['Meter',1.0]]")


texts: How can I assess the accuracy of a reprojection?

texts: I'm reprojecting a set of measured GPS co-ordinates from WGS84 to OSGB36, using two methods: the pyproj.transform method, which uses PROJ.4, and a "homemade" method from here. The latter method is accurate enough, but I'd like to know how best to measure its accuracy compared to the PROJ.4-based transform (both with and without the OSTN02 datum shift).


texts: MapProxy Installation problem with PyProj

texts:
I'm testing MapProxy (1.12.0) on a Windows Machine and followed each step from the "Installation on Windows" docs.
I have a running virtualenv, used pip to install MapProxy and PyProj.

The command pip list shows

MapProxy   1.12.0
Pillow     6.2.0
pip        19.2.3
pyproj     2.4.2.post1
PyYAML     5.1.2
setuptools 41.4.0
Shapely    1.6.4.post2
wheel      0.33.6

A simple mapproxy-util --version fails with the following traceback:

(mapproxy_venv) \mymapproxy>mapproxy-util --version
Traceback (most recent call last):
  File "\python\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "\python\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "\mapproxy_venv\Scripts\mapproxy-util.exe\__main__.py", line
5, in <module>
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\util.py", l
ine 28, in <module>
    from mapproxy.script.conf.app import config_command
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\conf\app.py
", line 32, in <module>
    from .sources import sources
  File "\mapproxy_venv\lib\site-packages\mapproxy\script\conf\source
s.py", line 17, in <module>
    from mapproxy.srs import SRS
  File "\mapproxy_venv\lib\site-packages\mapproxy\srs.py", line 26,
in <module>
    from mapproxy.proj import Proj, transform, set_datapath
  File "\mapproxy_venv\lib\site-packages\mapproxy\proj.py", line 262
, in <module>
    raise ImportError('could not find libproj or pyproj')
ImportError: could not find libproj or pyproj

Any ideas what went wrong? PyProj import and functions are working, tested that in the python console.


texts: Is a Topology Edit Tool available "out of the box" for ArcGIS Engine 10? Or do I have to write one myself?


texts: How to use the GRASS GIS v.net.timetable tool in QGIS?

texts:
The GRASS GIS v.net.timetable tool needs the following input information:
(a) a vector layer with the network
(b) a vector layer of points (from - to)
(c) and the timetable.

The GRASS manual on the subject is very brief (developed for GRASS GIS users) and it is not so easy to deduce as the timetable format should be in QGIS.

Also, I'm not finding where to indicate the timetable path.

Has anyone used this tool and got results?


texts:
I am new to QGIS script-writing and am using the PyQGIS Cookbook documentation to create a script which will read in a list of csv files and load them as layers. I'll want to define the style of the layers and then display them in the QGIS canvas and still have the QGIS functionality for manually analyzing the results. I am confused by what the PyQGIS Cookbook defines as standalone vs custom scripts.  Standalone seems to be defined as "the" GUI is disabled, i.e., qgs = QgsApplication([], False) while Custom means "the" GUI is enabled, i.e., qgs = QgsApplication([], True).

Specifically, what GUI is inferred?

Are we talking about the QGIS GUI, e.g., the QGIS canvas?


texts: Show Features for multiple Layers (Geoserver/Leaflet)

texts:
It's my first web mapping app and I want to show features for multiple layers added to my map, I'm using Leaflet/Geoserver.

    var OpenStreetMap = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
    var WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}');

    var map = L.map('map', {
            layers: [OpenStreetMap], /// fond de base
            center: [30.412647, -9.579837],/// coordonnées
            zoom: 13    //// zoom par defaut
        });

    var baseLayers = {
        "Open Street Map": OpenStreetMap,
        "World Imagery": WorldImagery
    };

    var parcelle_layer = L.tileLayer.wms("http://localhost:8082/geoserver/test_layer/wms", {
        layers: 'test_layer:PARCELLE',
        format: 'image/png',
        transparent: true,
        version: '1.1.0',
        attribution: "myattribution"
    });
    var cadastr_layer = L.tileLayer.wms("http://localhost:8082/geoserver/test_layer/wms", {
        layers: 'test_layer:mappe_cadastrale',
        format: 'image/png',
        transparent: true,
        version: '1.1.0',
        attribution: "myattribution"
    });

    var overlays = {
        "PARCELLE": parcelle_layer,
        "mappe_cadastrale_": cadastr_layer,
        "Districts": district_layer,
        "Quartiers": quartier_layer,
    };
L.control.layers(baseLayers,overlays).addTo(map);

The problem I have is that I'm trying to get the name of the activated layer "lyr_active", for example when I select "parcelle_layer" I could get features for only this layer not for all layers when I click on map.

    map.addEventListener('click', onMapClick);
    popup = new L.Popup({maxWidth: 1000});
    function onMapClick(e) {
    var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' +         e.latlng.lng.toFixed(3) + ')';
    var BBOX =         map.getBounds()._southWest.lng+","+map.getBounds()._southWest.lat+","+map.getBounds()._northEast.lng+","
    +map.getBounds()._northEast.lat;
    var WIDTH= map.getSize().x;
    var HEIGHT = map.getSize().y;
    var X = map.layerPointToContainerPoint(e.layerPoint).x;
    var Y = map.layerPointToContainerPoint(e.layerPoint).y;
    var URL = 'http://localhost:8082/geoserver/test_layer/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS='+lyr_active+'&QUERY_LAYERS='+lyr_active+'&STYLES=&BBOX='+BBOX+'&FEATURE_COUNT=5&HEIGHT='+HEIGHT+'&WIDTH='+WIDTH+'&FORMAT=image%2Fpng&INFO_FORMAT=text%2fhtml&SRS=EPSG%3A4326&X='+X+'&Y='+Y;
    popup.setLatLng(e.latlng);
    popup.setContent("<iframe src='"+URL+"' width='450' height='500'                 frameborder='0'></iframe>");
    map.openPopup(popup);
    }


texts: Draw and GeometryFunction (OL5 - Typescript)

texts:
I'm trying to update my OL3 code (javascript) in OL5 (typescript) and I don't know how to fix this "GeometryFunction". Do you know how to build the GeometryFunction object?

var myDraw = new Draw({
  source: sourceVector,
  type: GeometryType.LINE_STRING,
  geometryFunction: myGeometryFunction,
  style: myStyle
});

var myGeometryFunction: GeometryFunction = function (coords: any[], geom: LineString) {
  if (!geom) {
    geom = new LineString([]);
  }
  geom.setCoordinates(coords);
  return geometry;
}

  Type '(coords: any[], geom: LineString) => LineString' is not assignable to type 'GeometryFunction'.

EDIT
I solved the compilation errors changing this part of the code, but I don't know if it is correct. Could this throws exceptions?

var myGeometryFunction: GeometryFunction = function (coords: any[], geom: SimpleGeometry | undefined) {
  if (!geom) {
    geom = new LineString([]);
  }
  geom.setCoordinates(coords);
  return <LineString>geom;
}


texts: How to print from arcpad without buying more Esri sofware?

texts:
I am running ArcPad 10 in windows 7 on a laptop and on a field unit consisting of an Ashtech MobileMapper 10 as a PDA talking to an SXBlue GPS.  This system provides the real time half meter (without post processing)  resolution I need for forestry and wetland science.  I can download data to Surfer for contouring applications but I can't print directly from Arcpad.

MapWindow  seemed to offer a solution but there's glitch in the latest release (4.8.6).  The glitch causes an apparent disparity between the numbers of lines in the dbf and shapefiles.  I don't see a way to load my project into the Esri cloud application and print from there.

Besides, I'd like to use this issue as an opportunity to learn an open source application and begin using it.


texts: Problem Loading Plug-Ins in QGIS 2.2 on Mac

texts:
I'm trying to load the 'processing' module in QGIS (2.2.0-Valmiera on Mac  OSX 10.8).  However, this module and others (e.g. GarminaCustomMap) re failing to load with a message:

ImportError: No module named osgeo

I recently upgraded to Python 3 and have a suspicion this may be causing the problem.  Is this likely to be the case and is there a workaround other than downgrading back to Python 2.7 ?

I'm using the pre-compiled version of QGIS and I've seen another post on this forum that indicates QGIS includes it's own version of Python, so perhaps the problem lies elsewhere?

Thanks


texts: Making spatial autocorrelation for two variables?

texts:
I am trying to find spatial correlation between two variables , and in my case i have two kind of data and they are : number of populations and number of schools , my goal is how to find a relation between those data using Moran indice or if you have any suggest to do such thing.

My data are like this


texts: QGIS raster calculator not keeping each pixel with 1 byte?

texts:
I have a raster where 1 pixel = 1 byte. I want to change every value different than zero to 1, transforming a gray scale into black & white. I think the expression should be:

"my_raster@1" > 0

The output format is GeoTIFF. It works, but the final size is four times bigger than the uncompressed GeoTIFF (each pixel is using a 32-bit integer, when it should use a 8-bit, as in the original).

How to solve this?

I also noted that the values became 1 and nan, instead of 1 and 0.

Why doesn't it save a compressed TIFF?


texts: Break shapefile into small chunks, import into Google Maps

texts:
I have a shapefile of tax parcels that is pretty large (250MB).  I want to bring this into Google Maps, so we can see when we cross from one tax parcel into another.  This is easy to see because GPS is enabled. I figured out the workflow with a small subset of the data to convert it to a KML, load it into Google MyMaps, which then allows me to see it in Google Maps on my computer or on a mobile device. However, Google only allows users to upload data in 5MB chunks at a time.

So my question is, can anyone recommend a good workflow to divide this large shapefile into small chunks for Google Maps?  If it helps, this layer is also hosted as a map service.


texts: GDAL and Python: How to "pad the extent" or otherwise handle band.ReadRaster() for area falling slightly outside the image bounds?

texts:
In a nutshell, I'm trying to create a bare-metal tiling utility using GDAL and Python. As you can see in the graphic below, which shows the perimeter of a raster and the OSM-structured tile index, some tiles overlap the raster's native extent. This prevents me from calling band.ReadRaster() on the image, as doing so throws an exception.

So I'm looking for a way to handle this. I have a couple ideas, but I'm not sure how to implement them; I'll go ahead and list them:

1) Somehow "Pad" the raster extent with alpha/NODATA values before running my script. Usually people want to crop collars, so I'm not real sure how to add a NODATA collar. And I'm not fond of this approach for two big reasons. First, I would need to remember to pad every image before tiling it this way. Second, each tile index will have a different footprint, meaning each iteration would need its own padded source raster. If I choose this route, though, should I just make a huge NODATA VRT for the full extent of the tile index, then gdal_merge it with my source raster? That sounds somewhat efficient, as I could just output another VRT and avoid waiting on a big render. But how would I actually make the NODATA VRT?? Calling ogrinfo would provide the extents, but then what?

2) Somehow pad on-the-fly in the script/runtime. This approach seems more elegant, but how can I handle band.ReadRaster() on an area that falls outside the image extent? Any tips/tricks?

Alternatively, is there something even better I haven't thought of?

Here's a graphic illustrating the problem. The tile index is in red, and you can see where the perimeter tiles extend beyond the source raster.


texts: Aggregate nearby points to develop equally sized regions in QGIS

texts:
I have a list of 4,500 points (lat, long, unique id, attribute). I also have a service territory which all of the points fall into. I would like to break the service territory (polygon) into 6 contiguous regions containing an equal number of points (each region should be a single polygon containing 750 points).

Is there a quick, efficient way to do this in QGIS?


texts:
What is the best route or place to get started with ArcObjects if one is not a developer and not aiming to become a developer?

I've been using gis professionally for a long time, almost two decades, arcinfo/arcgis for most of that; I'm pretty good. I'm learning software development, and even have a modestly successful small python application used in a public project; I'm not good! I don't want to become a full fledged software developer but I keep running into things I just can't do without programming (example). In the arcgis world this puts me pretty squarely in the python camp, which is fine by me since I like python, however python does not have straightforward access to ArcObjects. (Python and ArcObjects is possible, but it's an unsupported route. This question is about following a beaten path.)

I need to get started, but where? Arcgis help says to get started with the ESRI Developer Network but $1500/yr is definitely not in my budget, and sounds like using a sledge hammer to swat mosquitos. And which language .NET, Visual Basic, or Visual C++?

UPDATE: Thank you everyone for the wonderful answers. In light of them I realise
I unecessarily narrowed the scope of my question be pre-supposing "ArcObjects" is the direction I need to go in. A more open ended formulation is more along the lines of:

  I keep running into problems I just
  can't solve with arcgis and python
  alone. What else can I learn/use to
  solve problems like X? I've no
  interest or intention of becoming a
  software developer. I just need to do
  a couple things which aren't exposed
  to the arcgis python modules.


texts: Understanding data flow from mxd to map service?

texts:
In my project I publish map, feature and dynamic services. My task is :

Add tables or views from Oracle 12c DB to ArcMap, then assign symbology and scale.
Prepare and save final MXD, then publish it as map, feature and dynamic service.

Until now I understood that the data source of a map service is a MXD, and MXD has a database (.sde) connection. But sometimes the database connection of MXD gets broken and red exclamation appears against layers. But if I execute a query in REST service URL then I do see increased record counts than previous record count. Now if MXD database is broken then how are new records appearing through REST URL query? I think I am missing something here in back end process.


texts: Storing the distance between two shapefiles as an attribute in QGIS 3.0?

texts: I have this map of Mexico that is broken down into all of the municipalities. How would I create a variable that has the distance between each municipality and Mexico City?


texts:
I'm using GDAL/OGR to open shapefiles. Now i'm calling this method to open a dataset:

dataset = (GDALDataset *)GDALOpenEx(path.toStdString().c_str(), GDAL_OF_VECTOR, NULL,NULL, NULL);

I read in http://www.gdal.org/classGDALDataset.html#a9cb8585d0b3c16726b08e25bcc94274a that i can define option with NULL, or a NULL terminated list of strings the dataset open options using the papszOpenOptions var.

I don't undestand with the documentation how is this cons char* const*

must be declared.

Could some one help me?

I want set the Overview level in the open method.


texts: Unable to cast COM object (IMapServer --> IMapServerObjects)

texts:
I have just deployed an AGS-based application to our web server. This app worked great in development, but after deployment to the server I got the following error:

Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Carto.IMapServerObjects'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{651521F3-AAFF-42B9-8C2D-1980625A13BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

The C# code generating this error is:

IServerContext context = som.CreateServerContext(ConfigurationManager.AppSettings["mapService"], "MapServer");
IMapServer mapServer = (IMapServer)context.ServerObject;
IMapServerObjects serverObjects = (IMapServerObjects)mapServer;

For some reason, the IMapServer instance cannot be casted to IMapServerObjects. What could be wrong?


texts: Replicating ArcInfo Projection Default Values

texts:
I am working to replicate an ArcInfo AML processing script in Python and am running into issues precisely replicating the raster output. In brief, the AML script reprojects input data from a Lambert projection on a sphere to another projection. However, when the Python output is compared to the AML output, significant differences show up.
With some testing, I believe I have tracked down the issue replicating the projection definition in the AML processing. In the AML, the projection is defined as:
projection lambert
spheroid sphere
units meters
parameters
33 00 00 /* 1st std parallel
45 00 00 /* 2nd std parallel
-97 00 00 /* central meridian
40 00 00 /* latitude of origin
0 /* false easting
0 /* false northing

In Python, I am using:
PROJCS["Lambert_Conformal_Conic",
    GEOGCS["unnamed ellipse",
        DATUM["unknown",
            SPHEROID["unnamed",6370000,0]],
       PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",33],
    PARAMETER["standard_parallel_2",45],
    PARAMETER["latitude_of_origin",40],
    PARAMETER["central_meridian",-97],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
        UNIT["Meter",1.0]]

The only apparent differences could be the radius of the sphere or the degree definition, which are explicitly stated in the Python projection definition but appear to use a default in the AML. Does anyone know what these assumed default values would be in ArcInfo AML or have any other suggestion for addressing this issue?


texts: All layers disappear when zooming in ArcMap?

texts:
I just upgraded to ArcMap 10.6 from 10.3 and am running into this problem, and I'm seeing that all shapefiles (points, polygons both) disappear when I zoom closer than 1:7,000 and then reappear when I zoom out again.  At first I thought it was just one shapefile, but it seems it's happening to all shapefiles and on multiple projects, including ones that were okay in 10.3.  I tried:

Making sure there's no scale-dependent visibility on individual layers;
Clearing display cache;
Deleting spatial index;
Deleting .sbx and .sbn files for one of the shapefiles in question as suggested here (this caused the shapefile to fail to load); and
Restarting and rebooting.

Nothing worked and most solutions are for when it's happening to just one layer (e.g. Points disappear when zooming in a certain scale), whereas for me it's everything.

Any ideas?


texts:
I'm developing a website and I'm looking for a places api (that isn't google!)
one which can take a place parameter in any (or most) languages and return me values both in the language I've sent the request in, and in english accompanied by its coordinates.

Only one i'm familiar with right now is the google places api though I can't use it for legal reasons, they don't allow using that api unless its accompanied with their maps, and I'm using mapbox for this project, so no google places api for me.

any good known api that can deliver me both accurate info and is multi lingual ?


texts: How to interpret GPSDestBearing and GPSImgDirection?

texts:
I need to take some photos capturing the GPS coords and direction of camera. I'm using an iPhone 8+ and this is the relevant output I get from Acute Photo EXIF Viewer:

EXIF GPS Tags
GPSDestBearing:74041/49085
GPSDestBearingRef:M
GPSImgDirection:74041/49085
GPSImgDirectionRef:M

I have searched for about an hour to find a way to convert the bearing/direction into degrees, and every source said the numbers should be between 0-359.99 (i.e. degrees from N, clockwise). So what does 74041/49085 mean and how can it be converted into degrees?

I understand the Ref tags have M for Magnetic North. I need the direction using North the same way that Google Maps does, which is True North. Assuming I can get the direction as degrees from Magnetic North, how would I convert them to degrees from True North?


texts: Seeking current geostatistical analysis classes/events

texts:
I am interested in geostatistics.
I am not very programmatically inclined but have been following several lists with this theme.  One being the R filter on Stack Exchange where I get occasional digest emails of questions.
I find that there is an extremely intricate language associated with statistics in general.
I am interested in learning from a layperson point of view what some of this language means and how to apply it to everyday GIS.
Can you list any currrent sources for geostatistics knowledge/understanding?


texts: Dissolving shapefile but retaining a list of original attribute value in QGIS

texts:
How can I dissolve a polygon layer in QGIS based on a single attribute but keep all (or some) other attributes at the same time? This is how I want to retain fields:

There are at least two fields I want to retain the information from in the dissolved shapefile, one is a string, the other one is numerical.

I would like to dissolve the shapefile based on the field "Class", and I want to retain the information of columns "Object_ID" and "Signal_species"


texts: How to symbolize different information that's joined to a single plot in a shapefile

texts:
I am a student doing an industrial survey in Windhoek, Namibia.  We mapped different businesses and later did spatial analysis. Questionnaires were handed to different businesses and then that information was entered into an Excel sheet and joined to the erf shapefile using a field Erf_Number. I later found out that some businesses from malls and shopping centers are joined to a single erven/plot. How can one visualize them?

Meaning of erven or erf:

erf [ɜːf]
n pl erven [ˈɜːvən]
(Engineering / Civil Engineering) South African a plot of land, usually urban, marked off for building purposes
[Afrikaans]


texts: How to work with locators in ArcGIS 10.0

texts:
I wrote my locator class which grab features from my web service. I picked it up in the ArcMap and now I can perform a search in the geocoding toolbar.
The suprise for me is the way results of gocoding are showed: green point for the first feature which has been found. How can I see information about found features? Where can I find other features? Where is the database used by locator?
I can't find decent documentation about these issues. I use ArcGIS 10.0.


texts: Exporting 3GB ArcGIS Raster to KML without losing resolution?

texts:
I have a 3GB raster layer, and I'd like to export it to KML for use with Google Earth.

When I use the "Layer to KML" conversion tool in ArcMap, I end up with a low-resolution overlay: looks like one 2000x2000 pixel image (give or take). I've tried messing with the "layer output scale" parameter, but it isn't having any effect.


texts: Populating multiple dataframes with same map document using Python when map document is only placed on active dataframe?

texts:
I have a template that contains two individual data frames amongst other elements. I am using a python script to populate this template, and for one of the dataframes I am using a json string to populate it with a map using the following code:

# Get the requested map document
templateMxd = os.path.join(templatePath, Layout_Template + '.mxd')

# Convert the WebMap to a map document
result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd)
mxd = result.mapDocument

#Get Titleblock Elements
# Note: ConvertWebMapToMapDocument renames the active dataframe in the template_mxd to "Webmap"
DataFrame = arcpy.mapping.ListDataFrames(mxd, 'Webmap')[0]

#get Scale
Scale = int(arcpy.GetParameterAsText(2))
DataFrame.scale = Scale

Now I need to populate the second dataframe with the same data as in the first, however I am having issues. The conversion process from json string to map document renames the active dataframe and saves the result within this dataframe. However I cannot set two dataframes as active at the same time. I have also tried to replicate the code but using the second dataframe name instead of the first however the second dataframe is still remaining blank.

Does anyone have any ideas how you can have two dataframes within the same template both containing the same map document populated using a python script for arcmap?


texts:
I've encountered a little problem with my styles having an assigned workspace. For one, I've got to admit that I'm not really sure what good does it make to put a certain style inside a workspace. I just guessed that if that style was going to be used by layers in a workspace, I might aswell add that workspace to the style.

So far, so good. But yesterday I ran into a problem trying to add my WMS service's URL to a map viewer web app. Let me put you in situation.

Let's say I have L1 layer, in W1 workspace with a default style of S1, which is also assigned to W1. Even if so far I didn't have any problems, this particular webapp didn't want to load the L1 layer attached to that same W1 workspace and S1 style. Whenever it did a GetMap request, GeoServer would return a "S1 style not found" error.

So, I had a look at the request itself and I noticed that, while in all other requests the "STYLES" parameter was missing (actually it was set to "(...)&STYLES=&(...)"), in this request it was "STYLES=S1". In fact, if I removed that from the request it worked correctly. This, I'm guessing is because S1 was set as L1 layer's default style.

Surprisingly, considering a L2 layer inside W1 with S1 as style too, it worked perfectly. After a bit of messing around I decided to remove S1's attachment to W1 workspace and, yay!, it worked and I was able to visualize L1 layer. So yes, the problem is solved. Now, my question is...

What is the real purpose of adding a workspace to a style? Is it worth it in any aspect? Should I not worry at all about this and just remove the workspace from all my styles?

Thanks for your help and sorry if it was a little confusing :-)


texts: Saving LAZ files to different location from input (LAS) files?

texts:
All of the command line examples I'm seeing show how to create LAZ files in the same folder as the LAS files, e.g.:

C:\Folder\tools>laszip F:\Folder\LAS_points\*.las

Unfortunately, I don't have enough space in that directory to create and save LAZ files there. I need to save them elsewhere. How can I edit the command line to get the LAZ files to save to, say, G:\Folder\LAZ_points?


texts: How can I generate linear elevation raster?

texts:
I want to generate a raster for testing purposes. I'm using QGIS and I was hoping it would have the tools to do this but I couldn't find a way.

The raster should be 1001 m x 1001 m in size with each point being 1 m x 1 m. The center point should be 500m high and the surrounding points (including the diagonal points) should linearly descent until reaching 0m at the very edge of the pyramid (i.e. 1m descent per point).

This raster should be centered to geographic location 0.0, 0.0 in WGS84 datum.

I'm hoping there's a way to do this in QGIS but other (free) tools are welcome as well.


texts: Finding a boundary with a collection of lines and a point

texts: Given a collection of lines and a point how can I discover the closest boundary around the point. In the image below A represents a collection of disconnected lines and B is the boundary I want to discover. There may be lines that not connected or it might be that the point is not actually enclosed at all and so the operation should fail. I am looking for some algorithms I might consider. My initial thought was to find all intersections and then create a point cloud but I am not sure where I would go from there or if that would be the best way to go.


texts:
I have a spreadsheet data which only contain post code as location references. I want to map them to a point shapefile based on their postcodes. All I can think is to find a point data which have postcodes and coordinates on them, or a georeferenced postcode point data, and use join&relates to connect them with my spreadsheet but I don't know where to find such data.

Anyone have suggestions?


texts: Generate tiles when creating tile Layer on ArcGIS Enterprise Portal

texts:
I have a raster (TIFF) that I want to publish on my ArcGIS Enterprise Portal. To reach that aim, I followed these steps :

1)  Create SDDraft from TIFF in ArcGIS Pro project

2) Create SD file from the draft

3) Publish Tile Layer from SD file

import arcpy
from atmo.connect import *
from shutil import copyfile

import os

######################
#connexion au portail Cartothèque
arcgisPortal_arcpy_conn()

# Set output file names
dir = 'K:/WEB-SIG/PROD/URBAINE'
annee = '2018'
ville = 'LILLE'
outdir = dir + '/%s/%s' %(ville,annee)
print(outdir)

print('Publication des données pour ' + ville + ' et l\'année ' + annee)
service = ville + "_"+annee+"_PM25_moy"
print('Publication des données de ' + service)
sddraft_file = outdir + '\\' + service + '.sddraft'

##### ETAPE 1 - Création du fichier SDDraft depuis un projet ArcGIS Pro

# Reference map to publish
aprx = arcpy.mp.ArcGISProject(dir + r"/ARCGIS_projects/" + ville + '/' + ville + ".aprx")
map = aprx.listMaps("PM25_moy")[0]

# Create Tile Layer SharingDraft from map in ArcGisPro project
sharing_draft = map.getWebLayerSharingDraft("HOSTING_SERVER", "TILE", service)
print('Le brouillon de la WebLayer est créé.')

# Create Service Definition Draft file
sharing_draft.exportToSDDraft(sddraft_file)
print('Le fichier du brouillon du service de Définition est créé')

##### ETAPE 2 - Création du fichier SD (Service Definition) depuis le fichier SDDraft

# Create Service definition file
sd_file = outdir + '\\' + service + ".sd"
arcpy.StageService_server(sddraft_file, sd_file)
print('Le fichier de Service définition est créé')

##### ETAPE 3 - Publication de la couche de tuiles depuis le fichier SD

# Share to portal as Tile Layer
print("Uploading Service Definition...")
arcpy.UploadServiceDefinition_server(sd_file, "My Hosted Services")

print("Successfully Uploaded service.")

It works well, my Tile Layer is created, but the tiles are not generated.
I tried to publish them this way, with the gis package :

from arcgis.gis import GIS

# Envoi des requêtes de mise à jour de tuiles.
print("Lancement de la mise à jour des tuiles.")
#on vérifie que la TL existe
if portal.content.search("title: %s_%s_PM25_moy" % (ville,annee), "Map Image Layer") !=[]:
    layer = portal.content.search("title: %s_%s_PM25_moy" % (ville,annee), "Map Image Layer")[0]
    print(layer)
    mapImageLayer = mapping.MapImageLayer(layer.url, portal)
    mapImageLayer.manager.update_tiles()
    print('Update des tiles en cours')

But I do not find a function to generate the tiles, only to update them.

Does someone have an idea ?


texts: Refresh Database Connection in ArcCatalog

texts:
I have created a feature class in an Oracle 11g database connection with ArcCatalog 10.2 (without ArcSDE) and I can see the table in the database with Sql Developer without problems. But, if I drop this table with a sql statement in Sql Developer and then refresh the database connection in ArcCatalog, the feature class does not disappear (even if I create a new feature class with the same name, I have an Invalid name error because the name already exists).

I have tried the same scenario with a view, and there is no problem, ArcCatalog updates.

I could remove the feature class in ArcCatalog, but I need to use a stored procedure in the database to drop the table and after that refresh ArcCatalog.

Any ideas why ArcCatalog does not refresh?


texts: How to update constraints if the table name was changed?

texts: I modified the name of a Table in postGIS. But the constraints contains old table name. How can I change the constraints? Please help me.