texts:
I was trying to create a FeatureLayer from the features returned from the ViewShed GP and I was successful at doing it. So when I click on the map, that featureSet is sent to the GP Tool and the return has all the features and I add it to the map as a FeatureLayer. Now I want to remove the layer when the user clicks again on the map, but strangely, the map.layerIds returns, ["layer0"], indicating only the basemap.

I am not sure how to remove the featureLayer? This is my code,

function init() {
    dojo.connect(map, "onClick", computeViewShed);
}

function computeViewShed(evt) {
    map.graphics.clear();
    map.removeLayer("finalLayer"); //finalLayer is the id that I assigned to the featureLayer that I am adding

    var pointSymbol = new esri.symbol.SimpleMarkerSymbol();
    pointSymbol.setSize(20);
    pointSymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 0]), 1));
    pointSymbol.setColor(new dojo.Color([0, 0, 255, 0.25]));

    var graphic = new esri.Graphic(evt.mapPoint, pointSymbol);
    map.graphics.add(graphic);

    var features = [];
    features.push(graphic);
    var featureSet = new esri.tasks.FeatureSet();
    featureSet.features = features;
    var vsDistance = new esri.tasks.LinearUnit();
    vsDistance.distance = 5;
    vsDistance.units = "esriMiles";
    var params = {
        "Input_Observation_Point": featureSet,
        "Viewshed_Distance": vsDistance
    };
    gp.execute(params, drawViewshed);
}

function drawViewshed(results, messages) {
    var polySymbol = new esri.symbol.SimpleFillSymbol();
    polySymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 0, 0.5]), 1));
    polySymbol.setColor(new dojo.Color([255, 127, 0, 0.7]));
    var features = results[0].value.features;
    var layerDefinition = {
        "geometryType": "esriGeometryPolygon",
        "fields": [{
            "name": "OBJECTID",
            "alias": "ID",
            "type": "esriFieldTypeOID"
        }, {
            "name": "grid_code",
            "alias": "Grid Number",
            "type": "esriFieldTypeString"
        }, {
            "name": "Shape_Area",
            "alias": "Area",
            "type": "esriFieldTypeNumber"
        }]

    }
    var featureCollection = {
        "layerDefinition": layerDefinition,
        "featureSet": {
            "features": features,
            "geometryType": "esriGeometryPolygon"
        }
    };
    //create a feature layer based on the feature collection
    featureLayer = new esri.layers.FeatureLayer(featureCollection, {
        id: 'finalLayer',
        mode: esri.layers.FeatureLayer.MODE_SNAPSHOT
    });
    map.addLayers([featureLayer]);
}


texts:
I'm trying to use Leaflet.TileLayer.MBTiles with npm. It installs fine but when I do:
import { Leaflet.TileLayer.MBTiles }

I get the following error:
ERROR in ./src/js/index.js 7:16
Module parse failed: Unexpected token (7:16)

I trying to use this with ES6 setup and structure. Lastly, do I implement this server side or client side - I'm using express as the backend. I cannot find any online documentation on how to implement this - does anyone know of any online tutorials of how to do this?


texts: Assigning ID to features with similar attributes

texts:
I have a polygon feature with three attribute columns. The values in each of the attribute columns are number coded. I want to generate an ID (fourth column) for the unique combination of the values of the attribute columns. Rows with similar attributes are assigned same ID

Attrib1 Attrib2 Attrib3    ID

1   1   33125
2   2   34020
1   2   60014
1   1   40290
3   1   55041
1   3   55047
2   3   56008
1   1   56026
3   3   56032
1   1   56035
1   1   57103

There are several thousands rows that it is time consuming to identify the unique combinations and assign ID manually.

Thanks in advance.


texts: ArcMap 10.1 point snap: Unable to snap to a point please help!

texts:
Very basic question sorry, missing some fundamentals.

Outline:
I have 4 points as a .shp also converted to .lyr that I brought in as a x/y table and converted.   I want to create a polygon as a separate shapefile that is defined by the 4 points - I have done this using the other option of entering the actual coordinates of the point in edit menu.

Current status:
I have added these files to to my geodatabase also in my project folder, tried many different things to make the snap to point work for these imported x,y points.  If I create a polygon and save as a shapefile, I can snap to that no problem.  The problems seems to be just with these imported x/y points.

Sure I a missing something very basic, any help would be much appreciated I am going round in circles.


texts: Creating Map Book with face to face pages showing before and after digitizations?

texts:
I want to create a mapbook that displays changes in river flows over time. I have one shapefile of my recent digitizations, as well as ones done prior. I was hoping to display them, new on the left and old on the right.

Does anyone know if this is possible?

I'm using ArcGIS 10.1 for Desktop.


texts: How to know the numbers of placemarks in a kml file without counting

texts: I have multiple kml files, each containing hundreds of placemarks. I suspect that I accidentally deleted a few placemarks. Since there are too many placemarks, it's not possible form me to count them altogether. So, is there any way to know the number of placemarks in a kml file?


texts: I want to get QGIS to update from a CSV file like in this How to update data from external table in real time? question, however I can't figure out what to put for "myLayer". How can I define the active QGIS layer in my code?


texts:
I want to load some points, whose lat-long values are saved in a .txt file over Google maps. The following is the code which I am using for the same. The Google map layer is successfully loaded if I keep lines 1-10 & 13-17. For loading the data points I am including 11-12 lines but I am not getting any output at all. I request you to please find the error and suggest how to do the same. "data.txt" contains the lat-long values with tab delimited present in my server.

1.
2.
3.<title>OpenLayers Example</title>
4.
5.
6.
7.

8.
16.
17.

When I am replacing above 11-12 lines with

11.var pois = new OpenLayers.Layer.Text( "My Points",
                { location:"./data.txt",
                  projection: map.displayProjection
                });
12.map.addLayer(pois);

Even then I am not able to get the output. I require some needful help from any one of you


texts:
i am new to pyqgis and using Script Runner to  test and see how it works.
I have written  code in my script, My script is correct.I am getting the below error . How to get rid of it ?

      user_script.run_script(self.iface)

      ## Heading ##AttributeError: 'module' object has no attribute
      'run_script'

Code in My script

     from PyQt4.QtCore import *
     from PyQt4.QtGui import *
     from qgis.core import *
     from qgis.gui import *

    def run_script(iface):
    layer = QgsVectorLayer('Point?crs=epsg:4326', 'MyPoint' ,'memory')
    pr = layer.dataProvider()
    pt = QgsFeature()
    point1 = QgsPoint(20,20)
    pt.setGeometry(QgsGeometry.fromPoint(point1))
    pr.addFeatures([pt])
    layer.updateExtents()
    QgsMapLayerRegistry.instance().addMapLayers([layer])


texts: How to create 3D globe view with OpenLayers?

texts:
I want to create 3D view. and I am using OpenLayers.

Is it Possible?


texts: Can't get Dijit layout to work in Javascript API (BorderContainer/ContentPane)

texts:
EDIT: Well this is probably a big part of the issue, it appears my parser is not working. How do I fix that?

I'm using the Javascript API 3.23. For whatever reason, when I create a BorderContainer and put content panes inside, the regions aren't respected, instead they just stack up on each other. I see a lot of old posts use notation like "dijit.layout.BorderContainer" instead of "dijit/layout/BorderContainer" - I am wondering if this is part of my problem? The dojo documentation I read uses slashes instead of periods, I figured the periods are a thing of the past but maybe not. One other thing I noticed was instead of region: 'left' or region: 'right', dojo documentation now states it is region: 'leading' or region: 'trailing' so I am pretty confused...

HTML:

            //stuff here

left

center

right

CSS:

html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: 'Lato', sans-serif;
}
#leading {
width: 500px;
border: 5px solid red;
}
#trailing {
width: 200px;
border: 5px solid blue;
}
#content {
height: 100%;
width: 100%;
}

JS require statement:

require([
"esri/map",
"esri/request",
"esri/arcgis/utils",
"esri/layers/FeatureLayer",
"esri/tasks/Geoprocessor",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/graphic",
"esri/renderers/UniqueValueRenderer",
"esri/renderers/SimpleRenderer",
"esri/Color",
"esri/InfoTemplate",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/dijit/Legend",
"esri/dijit/PopupTemplate",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/AccordionContainer",
"dijit/layout/AccordionPane",
"dojo/parser",
"dojo/query",
"dojo/dom",
"dojo/dom-construct",
"dojo/on",
"dojox/widget/Standby",
"dojo/domReady!"
],
function (
Map,
esriRequest,
arcgisUtils,
FeatureLayer,
Geoprocessor,
SimpleLineSymbol,
SimpleFillSymbol,
Graphic,
UniqueValueRenderer,
SimpleRenderer,
Color,
InfoTemplate,
Query,
QueryTask,
Legend,
parser,
PopupTemplate,
query,
dom,
domConstruct,
on,
Standby
) {
  parser.parse();

Yields this (don't worry about there being no map, I can make the map show up in the "center" region if I want):


texts: Parsing an input parameter to gdal:rastercalculator formula in QGIS 3.6 Python script

texts:
For training purposes I'm writing a QGIS 3.6 Python script. The script takes as inputs a raster layer and band, and three float numbers (refmult, refadd, sunel) and computes a simple formula:
((layer@band * refmult + refadd) / sin(sunel * 3.14159/180)

It seems passing the tree float numbers as parameters to the formula on gdal:rastercalculator is not as simple, since the result is a ful NaN raster (when I hardcode the float numbers on the code, the result is fine).

How to pass the input numbers to the formula?

Here is the full script:

from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterBand
from qgis.core import QgsProcessingParameterRasterLayer
from qgis.core import QgsProcessingParameterNumber
from qgis.core import QgsProcessingParameterRasterDestination
import processing

class RasterCalculator(QgsProcessingAlgorithm):

def initAlgorithm(self, config=None):
    self.addParameter(QgsProcessingParameterBand('band', 'band', parentLayerParameterName='rasterlayer', allowMultiple=False, defaultValue=None))
    self.addParameter(QgsProcessingParameterRasterLayer('rasterlayer', 'layer', defaultValue=None))
    self.addParameter(QgsProcessingParameterNumber('refadd', 'refadd', type=QgsProcessingParameterNumber.Double, defaultValue=-0.1))
    self.addParameter(QgsProcessingParameterNumber('refmult', 'refmult', type=QgsProcessingParameterNumber.Double, defaultValue=2E-5))
    self.addParameter(QgsProcessingParameterNumber('sunel', 'sunel', type=QgsProcessingParameterNumber.Double, defaultValue=60))
    self.addParameter(QgsProcessingParameterRasterDestination('Reflectance', 'reflectance', createByDefault=True, defaultValue=None))

def processAlgorithm(self, parameters, context, model_feedback):
    # Use a multi-step feedback, so that individual child algorithm progress reports are adjusted for the
    # overall progress through the model
    feedback = QgsProcessingMultiStepFeedback(1, model_feedback)
    results = {}
    outputs = {}

    # Raster calculator
    alg_params = {
        'BAND_A': 1,
        'BAND_B': None,
        'BAND_C': None,
        'BAND_D': None,
        'BAND_E': None,
        'BAND_F': None,
        'FORMULA': '(A* refmult +(refadd) ) /( sin(sunel * 3.14159/180  ) )',
        'INPUT_A': parameters['rasterlayer'],
        'INPUT_B': None,
        'INPUT_C': None,
        'INPUT_D': None,
        'INPUT_E': None,
        'INPUT_F': None,
        'NO_DATA': None,
        'OPTIONS': '',
        'RTYPE': 5,
        'OUTPUT': parameters['Reflectance']
    }
    outputs['RasterCalculator'] = processing.run('gdal:rastercalculator', alg_params, context=context, feedback=feedback, is_child_algorithm=True)
    results['Reflectance'] = outputs['RasterCalculator']['OUTPUT']
    return results

def name(self):
    return 'raster calculator'

def displayName(self):
    return 'raster calculator'

def group(self):
    return 'remote sensing'

def groupId(self):
    return 'remote sensing'

def createInstance(self):
    return RasterCalculator()


texts:
The website claims that touch gestures are supported for Android browsers.

I'm running 2.2 and have not been able to get touch gestures to work. What can be done to enable it?

This works for iPhone but not for Android browsers.

How would one go about making it possible to enable touch support on Android browser?

Here's a link you can try on your mobile Android browser:

http://help.arcgis.com/en/webapi/javascript/arcgis/demos/mobile/mobile_simplemap.html


texts: OSM tile server can not start up due to an error in OSMBright.xml

texts:
I followed the guide from osm in order to get a tile server running.
But I do get the following errors:

     An error occurred while loading the map layer 'default':
    Could not create datasource for type: ''  encountered during parsing of layer 'land-low' in Layer at line 117
    of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'renderd[6906]: An error occurred while loading the map
    layer 'default':
    Could not create datasource.
    Required parameter 'type' is missing  encountered during parsing of layer 'land-low' in
    Layer at line 117 of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'
    renderd[6906]:
    An error occurred while loading the map layer

 'default': Could not create datasource.
Required parameter 'type' is missing  encountered during parsing of layer 'land-low' in Layer at line 117 of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'

I checked several other solutions without success.

Why is type missing?it is definitely defined in osm-bright/osm-bright.osm2pgsql.mml

"file": "/usr/local/share/maps/style/osm-bright-master/shp/land-polygons-split-3857/land_polygons.shp",
        "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
        "type": "shape"

also defined in the OSMBright.xml

<Layer name="land-low"
  status="on"
  srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
    <StyleName>land-low</StyleName>
    <Datasource>
       <Parameter name="dbname"><![CDATA[osm]]></Parameter>
       <Parameter name="extent"><![CDATA[-20037508.34 -20037508.34 20037508.34 20037508.34]]></Parameter>
       <Parameter name="file"><![CDATA[/usr/local/share/maps/style/osm-bright-master/shp/simplified-land-polygons-complete-3857/simplified_land_polygons.shp]]></Parameter>
       <Parameter name="srs"><![CDATA[+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over]]></Parameter>
       <Parameter name="type"><![CDATA[shape]]></Parameter>
    </Datasource>
  </Layer>


texts: Difference between Copy Features and Feature Class to Feature Class tools?

texts:
I have a feature class within a feature dataset in a file geodatabase (FGDB), and I need a copy of it in another FGDB.

In ArcGIS 10.1, I've used the "Copy Features" tool, and it looks to be the same (according to the "Feature Compare" tool). Using the "Feature Class to Feature Class" tool, I receive the following messages from "Feature Compare":

Field: Field OBJECTID domain fixed is different (Base: false, Test: true).
Field: Field Shape domain fixed is different (Base: false, Test: true).

Does anyone have any insight on the differences between "Copy Features" and "Feature Class to Feature Class"? What do the messages from Feature Compare mean?


texts:
I'm trying to import a Sentienl 2 image into RStudio (Version 1.0.136) using rgdal (v. 1.2-5) package. However, it seems something is wrong. My OS is macOS Sierra v. 10.12.1

S2<- readGDAL("S2A_OPER_MSI_L1C_TL_SGS__20160916T153615_A006454_T34VCR_B12.jp2")
Error in .local(.Object, ...) :

I have checked gdalDrivers() and this is what I got:

64  JPEG JPEG JFIF  FALSE  TRUE     TRUE

I've checked already this link but didn't work for me
Open JPEG2000 (Sentinel 2) in R

I think I have to instal the jpeg2000 driver but not sure about how to do it.

Any idea about this issue?


texts: When using the random points tool in QGIS, how does the process treat fractional data?  Say for example, the data point I have for a particular polygon is 4.7, does QGIS put 4 or 5 points in the polygon?  Ultimately, I am wondering whether it rounds or truncates the data.


texts: Hand-written coordinates from a Garmin NUVI

texts:
I've been asked to map point data that was collected in the field by manually writing down the coordinate from a Garmin NUVI 1490 LMT.  They were put into a spreadsheet and sent my way which I was able to convert from DDM to DD in Excel.  I've tried a bunch of different ways to import the points into ArcGIS using Add XY data with the same result (see attached image of street centerlines and points).  The street centerine data is what I'm hoping they'll line up with (they're locations of street signs).

At first I suspected the projections I was using but after much experimentation I think it may be the conversion formula I used (found here: http://www.ozgrid.com/forum/showthread.php?t=155776).

Can anyone offer any advice as to where I've gone wrong and set me straignt?


texts:
I have a spreadsheet with X, Y coordinates but I can't work out which format they are:
X: 8582265.9675991 and Y: 239737.22394892
It should be roughly equal to these coordinates: 71.23'28"W 12.47'21"S (these are DMS).
I have tried converting UTM, and all others but I just end up in the Atlantic or near India.
I am aiming for Manu National Park, Peru.


texts: Import Sentinel-1 Image on GEE and clip it with geometry

texts:
I'm trying to create image collection from images of Sentinel-1.I have written a code that suppoose to create image collection, clip it with a given polygon and then count the number of images in the image collection.
The problems are-

It takes very long time to calculte, seems like it's very heavy, that compared to similar processes I have run with optical data from sentinel-2.
The result I get  is wrong- I got count of 34,793 images for period of two months for a little polygon in Thailand area.

What do I do wrong?
I have to mention that i'm new to Sentinel 1 and i'm trying to study it alone so if you have any reccomendation for good guides for how to use it in GEE for agriculture use it will be very helpful.

This is the code I hav written-

// Load the Sentinel-1 ImageCollection.
var sentinel= ee.ImageCollection('COPERNICUS/S1_GRD');

//filter by metadata properties

var imgVV=sentinel.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')).filter(ee.Filter.eq('instrumentMode', 'IW'))
.filterDate('2017-02-10','2017-04-01').map(function(im){
  return im.clip(geometry);});

// var clippedCol=imgVV.map(function(im){
//   return im.clip(geometry);
// });

var count = imgVV.size();
print('Count: ',count);


texts: Seeking methods for converting coordinate datum and format in Python?

texts:
Related to an earlier Q&A of Missing grid shift files for cs2cs.exe?, what are the various methods to convert coordinate datum and format in python?

(Windows Vista, python 3.4)

For example, given the coordinates WGS84 Decimal Degrees 39deg 12.3456min north by 120deg 12.3456min west, (epsg 4326)

translate the coordinates to NAD27 CONUS UTM zone 10 latitude band S  (epsg 26710, unless there's a better one?)

Speed is not important for this application.

The methods I'm aware of:

pyProj - a pain to install for Windows, if possible at all?  Attempting and researching this was enough of a pain that I bailed out and tried the next two options as an external system call from python, which seems fine since I'm not using very much of the proj capabilities:
cs2cs from OSGeo - does not come with the necessary grid shift files?
cs2cs from gisinternals.com - working correctly with advice from @user30184 at Missing grid shift files for cs2cs.exe?

Are there any other methods?


texts: Fill shapefile with data when the attribute tables do not have the same number of rows

texts:
I have an "empty" polygon shapefile. It only has one row in its attribute table.

I have one attribute table called "owf" I would like to join to the polygon. Unfortunately, when I join the two tables, only one row from the "owf" table will join to the polygon.

What am I doing wrong that is keeping me from adding the whole table to the polygon?

I am using ArcMap 10.3


texts: Select layer by attribute using SQL statement LEN() in ArcMap?

texts:
I want to query the length of a string column and thought to use:

LEN([ColumnName]) > 5

However, that doesn't work at all. I'm querying a table in a fGDB in ArcMap 10.1, hence the notation of [ColumnName].

Can someone help me?

The error message I'm getting from ArcGIS is that I'm using an invalid SQL statement.


texts: How to replace certain characters within a string with ArcPy?

texts:
I have a list of files where the last digits of the number all need to be changed in a new column.

Old Column    > New Column

c18154h1.jp2 > c1815420.jp2
c18154h2.jp2 > c1815421.jp2
c18154h3.jp2 > c1815422.jp2
c18154h4.jp2 > c1815423.jp2
c18154h5.jp2 > c1815424.jp2

I tried:

!FILE!.replace("h1", "20")

Only thing is there are files with 'H1' at the beginning of the name, and those files will be affected with this code. I need to make sure that ONLY the final characters change. So far I can't get the syntax right.
Any suggestions?


texts: Weighted Overlay final raster to indicate inputs

texts:
I have a weighted overlay that identifies the most important areas in a corridor scaled from 0 - 100. I would like to be able to click on a cell and be able to identify which input rasters contributed to the weighted overlay.

I think I should convert all inputs into weighted overlay to a value of 1, do a combine and then combine with the weighted overlay?

Any ideas?

I used Combine in my related question Cell statistics sum resulting cells to indicate original input rasters


texts:
I'm trying to label vector feature:

#############################
palyr = QgsPalLayerSettings()
layer = iface.activeLayer()
palyr.enabled = True
palyr.fieldName = 'Txt'
palyr.writeToLayer(layer)
layer.triggerRepaint()
############################

With this code I get an error:

'QgsPalLayerSettings' object has no attribute 'writeToLayer'

I'm working in Qgis 3.2.

Can someone help me with this.


texts: How to sum up all the single points in a state

texts: I am new to using ArcMap. I have a list of locations with lat/long. I'm wondering if it is possible for ArcGIS to compute the sum of the locations by state and then shade in the state depending on the total amount of locations.


texts: Points appear at different location when using google map overlay

texts:
I have used vector point from database and also polygon country vectors from database.Points appear with in this country vectors but as I switch to google earth map as base layer the points at smaller zoom level would appear outside boundary where as at other zoom level it would appear inside. I have tried to add projection too but in vain.Do I need to reproject google earth's base layer and How?

map = new OpenLayers.Map('map', {
                    controls: [
                        new OpenLayers.Control.Navigation(),
                        new OpenLayers.Control.PanZoomBar(),
                        new OpenLayers.Control.LayerSwitcher({'ascending':false}),
                        new OpenLayers.Control.ScaleLine(),
                        new OpenLayers.Control.MousePosition(),
                        new OpenLayers.Control.OverviewMap(),
                        new OpenLayers.Control.KeyboardDefaults()
                    ],
             projection: new OpenLayers.Projection("EPSG:900913"),
             displayProjection: new OpenLayers.Projection("EPSG:4326"),
             numZoomLevels: 21,
             maxExtent: new OpenLayers.Bounds(-20037508, -20037508,20037508, 20037508.34)

                });

                var border = new OpenLayers.Layer.WMS( "Border",
                url,
                {layers: 'GisData:BORDER'}
            );

                var dsBand = new OpenLayers.Layer.WMS( "District Band",
                url,
                {layers: 'GisData:BND'}
            );

                var Site1 = new OpenLayers.Layer.WMS( "Site 1",
                url,
                {layers: 'GisData:sites', transparent: "true",format: "image/png"}
            );
                dwnSite3G.setIsBaseLayer(false);

                var Site2 = new OpenLayers.Layer.WMS( "Site 2",
                url,
                {layers: 'GisData:sites2', transparent: "true",format: "image/png"}
            );

                var g_pmap = new OpenLayers.Layer.Google(
                "Google Physical",
                {type: G_PHYSICAL_MAP}
                );

                var gmap_gs = new OpenLayers.Layer.Google(
                    "Google Streets" // the default

                );

                var gmap_ghy  = new OpenLayers.Layer.Google(
                    "Google Hybrid",
                    {type: G_HYBRID_MAP}
                );

                var gmap_gsat = new OpenLayers.Layer.Google(
                    "Google Satellite",
                    {type: G_SATELLITE_MAP}
                )


texts: Literature on the appoximation of trajectory points with (smooth) curves

texts:
We are gathering trajectories of GPS points of moving objects (cars, bikes, etc.) and would like to compute approximate curves (that may self-intersect) that would represent those clouds of points. What I am looking is a literature lists (preferably textbooks if not, papers) that I need to familiarize myself in order to solve this problem.

Any comments?


texts:
I think my question is a duplicate of https://stackoverflow.com/questions/6525176/how-can-you-add-html-layers-to-polymaps but it seems better posted in GIS StackExchange.

I'm using the Polymaps JS library and have markers on a map. I've been able to add the title tool-tip to the markers by looking at examples.
Instead of a title/tool-tip, I would like a 'pop up' on the map. Probably better if it's when you click the marker image rather than rollover. I would like to be able to style the box that pops up.


texts: How to add graphics to map at lowest level?

texts:
I am able to create graphics and add them to the map, but they are getting added as the top-most layer.

The labels (if active) of another layer get hidden due to this. I want to know how to add graphics as the lowest layer in the active map.

EDIT 1: Here is the code which I am using to add graphics to the map

    Dim graphicsContainer As IGraphicsContainer
    graphicsContainer = GetRunningApplication(My.ArcMap.Application.Document.Title).FocusMap
    Dim elem As IElement
    Dim rgbcolor As IRgbColor
    Dim outlineRGBColor As IRgbColor

    elem = Nothing
    rgbcolor = New RgbColor

    If (g.GeometryType) = esriGeometryType.esriGeometryPoint Then
        ' Marker symbols
        Dim simpleMarkerSymbol As ISimpleMarkerSymbol
        simpleMarkerSymbol = New SimpleMarkerSymbol

        'set COlors
        rgbcolor.Blue = 255
        rgbcolor.Red = 0
        rgbcolor.Green = 0

        simpleMarkerSymbol.Color = rgbcolor
        simpleMarkerSymbol.Outline = True
        simpleMarkerSymbol.OutlineColor = rgbcolor 'outlineRGBColor
        If SymbolSize = 0 Then
            simpleMarkerSymbol.Size = 8
        Else
            simpleMarkerSymbol.Size = SymbolSize
        End If
        simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle

        Dim markerElement As IMarkerElement
        markerElement = New MarkerElement
        markerElement.Symbol = simpleMarkerSymbol
        elem = markerElement
    End If

    If g.GeometryType = esriGeometryType.esriGeometryPolyline Or g.GeometryType = esriGeometryType.esriGeometryLine Then
        '  Line elements
        Dim simpleLineSymbol As ISimpleLineSymbol
        simpleLineSymbol = New SimpleLineSymbol

        'set COlors
        rgbcolor.Blue = 0
        rgbcolor.Red = 255
        rgbcolor.Green = 0
        simpleLineSymbol.Color = rgbcolor
        simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid
        If SymbolSize <> 0 Then
            simpleLineSymbol.Width = SymbolSize
        Else
            simpleLineSymbol.Width = 2
        End If

        Dim le As ILineElement
        le = New LineElement
        le.Symbol = simpleLineSymbol
        elem = le  ' Explicit Cast
    End If

    If (g.GeometryType) = esriGeometryType.esriGeometryPolygon Then
        ' Polygon elements
        Dim simpleFillSymbol As ISimpleFillSymbol
        simpleFillSymbol = New SimpleFillSymbol

        'set COlors
        rgbcolor.Blue = 0
        rgbcolor.Red = 0
        rgbcolor.Green = 255
        simpleFillSymbol.Color = rgbcolor
        simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal
        Dim fillShapeElement As IFillShapeElement
        fillShapeElement = New PolygonElement
        fillShapeElement.Symbol = simpleFillSymbol
        elem = fillShapeElement
    End If


texts: Adding SQLite layers to ArcGIS Pro throws error "Exception from HRESULT: 0x80041538"

texts:
I have a SQLite database which I have just created in QGIS and I want to open it in ArcGIS Pro.

In Catalog I have added the database to the project but when I try to add layers to the map I get the error "Exception from HRESULT: 0x80041538".

I want to have a common source of data for QGIS and ArcGIS Pro if possible so using a different format is not ideal.


texts:
I am working with topology checker in QGIS 2.18 to check error overshoot, undershoot , but it show all error, so I got many difficult in fix error.
Is there any tool the same with topology checker to check error in QGIS?


texts: Mosaicing indexed colour rasters with independent colour tables

texts:
I have a large number of single band rasters that are colour indexed TIF files.  I want to mosaic them using GDAL (or similar non-proprietary software with a Python API I can call as part of a bigger script).

The images all represent the same sort of thing but the information is embedded in the colour tables for each image and not the raster pixel value as such (i.e. all the colour tables are independent).  So, sky-blue (say) always means the same thing but does not always have the same position in the different colour tables.

Mosaicing them is easy as a greyscale image, but then I lose the colour information which is vital.  I can't use the '-pct' switch in gdal_merge.py because that only grabs the first colour table and causes some or all of the other tiles in the mosaic to display incorrectly.

My gut feeling is that there is nothing for it but to convert all the images to three-band RGB (and consequently balooning the data volume) and mosaic the images with a possible post process step to create a new unified colour table and swap the mode back to single band indexed colour.

However, I'd value opinion and work-flow suggestions on this (the process must be automatable).  Is there a better way of doing it?

EDIT:
To be clear, I have no way of knowing  whether any particular tile contains the full range of colours represented by all the tiles together.


texts: Sort polygons from north to south in QGIS using 'graphical modeler'?

texts:
I'm building a model in 'graphical modeler' in QGIS 2.2.

I want my model to clip a polygon layer and give the polygons coordinates so that I could sort them geographically from north to south. After sorting them, I want to add a number to each polygon to be able to save the sorted order.

I have, with some help from this forum, been able to add coordinates to the polygons using the modeler. So far, everything is good.

My next step would be to get the polygons sorted from north to south. I have done these last few steps manually, sorting the polygons in the attribute table, added a column with "sorting number", and then saving the sorted order using MMQGIS - 'Modify' - 'Sort'.

Is it at all possible to do something similar inside the graphical modeler?
I'm going to do this mulitple times, so it would be a real timesaver to get as many steps as possible inside the modeler.


texts: Creating WMS layer with filter using GeoServer REST API

texts:
I'm trying to add a new layer to GeoServer using REST API.
Here is REST API docs:
https://docs.geoserver.org/latest/en/api/#/latest/en/api/1.0.0/wmslayers.yaml

Post request body:

    <?xml version="1.0" encoding="UTF-8"?>
<wmsLayer>
    <name>string</name>
    <nativeName>string</nativeName>
    <namespace>
        <name>string</name>
        <link>string</link>
    </namespace>
    <title>string</title>
    <abstract>string</abstract>
    <description>string</description>
    <keywords>
        <string>string</string>
    </keywords>
    <metadatalinks>
        <metadataLink>
            <type>string</type>
            <metadataType>string</metadataType>
            <content>string</content>
        </metadataLink>
    </metadatalinks>
    <dataLinks>
        <metadataLink>
            <type>string</type>
            <content>string</content>
        </metadataLink>
    </dataLinks>
    <nativeCRS>string</nativeCRS>
    <srs>string</srs>
    <nativeBoundingBox>
        <minx>0</minx>
        <maxx>0</maxx>
        <miny>0</miny>
        <maxy>0</maxy>
        <crs>string</crs>
    </nativeBoundingBox>
    <latLonBoundingBox>
        <minx>0</minx>
        <maxx>0</maxx>
        <miny>0</miny>
        <maxy>0</maxy>
        <crs>string</crs>
    </latLonBoundingBox>
    <projectionPolicy>FORCE_DECLARED</projectionPolicy>
    <enabled>true</enabled>
    <metadata>
        <@key>regionateStrategy</@key>
        <text>string</text>
    </metadata>
    <store>
        <@class>string</@class>
        <name>string</name>
        <href>string</href>
    </store>
</wmsLayer>

How to add CQL filter for layer the same as I can do with GeoServer web interface?


texts: Benefits of using GIS in business intelligence software?

texts:
Business intelligence softwares use a lot of data in order to create reports helping decision makers. Given that more and more GIS resources and services are available and that data can often be located in space, the geographic dimension of data can bring useful insights when analyzing data.

Rendering geocoded data on thematic maps is the simplest and most obvious application of using GIS in BI software. What are the other ways to benefit from GIS in business intelligence?  What kind of resources or methods could be used to improve the usefulness of maps when making business-specific decisions? What are the already existing products in this domain?


texts: Uploading CSV to asset re-arranges random data

texts:
I am trying to store randomly sampled data as an asset in GEE. When I randomly sample this data in another script it looks much like the attached .csv file (which is how I want it)
.
They key row is the 'classification row' which has values of either 1, 2, or 3 randomly arranged. However, if I export this in GEE directly to an asset, or download as a .csv and then upload as an asset, the data is re-arranged using the classification column, with all the 1's first, 2's second, and 3's third.
You can see I have tried adding an extra column called 'aaaa', which is just labelled 1,2,3,4 to try and overcome this, but I am still having no luck.
Where am I going wrong / does anyone have any bright ideas?


texts: Error while creating plugin using plugin builder in Ubuntu 15.04

texts: I am building a QGIS plugin using qgis plugin builder 2.10.1. I am using Ubuntu 15.04. I had selected (/usr/share/qgis/python/plugins) path for the plugin to store in plugin builder, Its raising an error "Directory not writable". Am new to QGIS development in Ubuntu.


texts:
when I have installed recently QGIS 2.8 and, since then, SAGA algorithms don't work. Apparently, the algorithm runs well (any error is showed while it is executing the algorithm), however,  there is not any result (shapefile or raster).

In the previous QGIS version (2.6), SAGA worked with any problem.

I've change the path of the SAGA folder to C:\Program Files\QGIS Wien\apps\saga.

In the info folder, in processing log window, appears this message:

Salida de la consola de ejecución de SAGA
C:\PROGRA~1\QGISWI~1\bin>set SAGA=C:/PROGRA~1/QGISVA~1/apps/saga
C:\PROGRA~1\QGISWI~1\bin>set SAGA_MLB=C:/PROGRA~1/QGISVA~1/apps/saga\modules
C:\PROGRA~1\QGISWI~1\bin>PATH=PATH;C:/PROGRA~1/QGISVA~1/apps/saga;C:/PROGRA~1/QGISVA~1/apps/saga\modules
C:\PROGRA~1\QGISWI~1\bin>saga_cmd shapes_polygons "Polygon Centroids" -POLYGONS "C:\VCT\process\stats\buffers\clkml2004_bff.shp" -METHOD          -CENTROIDS "C:\Users\JTRUJI~1\AppData\Local\Temp\processing\644eb73b5d8a4c31b265c7759a4fbd4e\CENTROIDS.shp"
"saga_cmd" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
C:\PROGRA~1\QGISWI~1\bin>exit

'saga_cmd' is not recognized as an internal or external command, operable program or batch file

When I made the installation I used the QGIS 2.8 Standalone Installer Version. Furthermore, I've downloaded the latest version of SAGA (2.1.4) and I've copied it in the same folder of the former version (deleting the previous one).

What is going on here?


texts: QGIS reclassification - calculate colors back into values

texts:
I have a raster layer in QGIS that is stored as a three color image. I want to do some analyses on it and would like to have it just as values 1,2,3 (and then I can leave the presentation to later)

The raster is red, yellow, green and the band values are

255,0,0
0,245,0
240,240,0

So I should be able to use either the red band or the yellow band to extract my information.

This could easily be coded as

value=redband.value
if value==255:
    return(3)
if value==240:
    return(2)
if value==0:
    return(1)

To return red yellow and green as 3,2 and 1 respectively.

But in the field calculator, I can only see how to do mathematical expressions. Is it possible to run a script in the field calculator or do I have to rewrite this as a python script to run in the python console?

(I know it possible to turn a raster with only three distinct values into a polygon layer, but due to the structur of the raster, the polygon gets quite unwieldy and the analysis I am going to do on this later requires a raster)


texts: I am working on a project where I want to automatize the workflow using the QGIS graphical modeler. The problem is that I want to use the Group Stats Plugin as a part of my model but can't integrate it as an algorithm in my modeler. Does anyone knows how can I use a plugin into the modeler ? Or is it even possible ?


texts: GDAL cannot read KML file that it just created

texts:
I'm using GDAL 2.2 standard C library within a Swift wrapper in an iOS app.  After creating a KML data source and populating it with data, GDAL is unable to open the KML file that it just created.  QGIS can open it just fine.
I create the file like this:
gdalDriver = GDALGetDriverByName("KML".cString(using: .utf8)) else {
    print("FAILED to get driver by name '\(driverName)")
    return nil
}

guard let ogrDS = GDALCreate(gdalDriver, url.path.cString(using: .utf8), 0, 0, 0, GDT_Unknown, nil) else { return nil }

This all works fine, and the file is created, I then populate it with features.  QGIS can open the KML file.  Then I try to open it with GDAL like this:
        let path = url.path
        if !FileManager.default.fileExists(atPath: path) {
            print("File for DS does not exist:  \(url.lastPathComponent)")
            return nil
        }

        var ogrDS = GDALOpenEx(path.cString(using: .utf8), UInt32(GDAL_OF_VECTOR|GDAL_OF_UPDATE|GDAL_OF_VERBOSE_ERROR), nil, nil, nil)
        if ogrDS == nil {
            ogrDS = GDALOpenEx(path.cString(using: .utf8), UInt32(GDAL_OF_VECTOR|GDAL_OF_READONLY|GDAL_OF_VERBOSE_ERROR), nil, nil, nil)
            if ogrDS == nil {
                let err = String.init(cString: CPLGetLastErrorMsg())
                print("FAILED to open existing datasource:  \(url.path)\nERROR:  \(err)")
                return nil
            } else {
                print("WARNING:  Read-only datasource:  \(url.lastPathComponent)")
            }
        }

However, this fails with the error:

ERROR 4: `/Users/blahblahblah/Documents/Waypoints.kml' not recognized as a supported file format.

How can I get GDAL to open the KML file that it just created?


texts: How can I create a shapefile from a .dwg file?

texts:
I'm working on extracting various weather data from a specified region for a project. I've obtained the map for the area and isolated my part specifically on AutoCAD. Now I have a .dwg file which contains the boundaries I want to work with in ArcMap.
I was wondering how I can convert this .dwg file into a .shp file to use it as a mask file, with the coordinates and geographic coordinate system, etc. included.


texts: Dynamic map sidebar with info from marker upon click

texts:
I am new to Leaflet, HTML, CSS and Java. I am using leaflets maps and I want to create a sidebar that is active when a marker is clicked or active when a clicked in the sidebar, so far I have had no luck at all. I have tried to do similar to this but I want defined markers lat and long http://jsfiddle.net/BPuQ9/8/ but have had no luck

I have a JSfiddle file here: https://jsfiddle.net/Niall2110/yphxqzu2/1/

<!DOCTYPE html>

    <title>Quick Start - Leaflet</title>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin=""/>


texts: Understanding theMap.on('click') event of Leaflet

texts:
I inherited code from another person and some of the lines are as follows:

       theMap.on('click', function(e) {
        minx = (e.latlng.lng - 0.0000001).toFixed(7);
        miny = (e.latlng.lat - 0.0000001).toFixed(7);
        maxx = e.latlng.lng.toFixed(7);
        maxy = e.latlng.lat.toFixed(7);

Does this mean that these display the coordinates of the map on a single click?


texts: "TypeError: Unable to draw graphic (geometry:null, symbol:null)" after adding tiled and feature layers

texts:
I'm seeing the following error when attempting to add a tiled and feature layer to the same map when using the ArcGIS Server JS API 3.1:

  TypeError: Unable to draw graphic (geometry:null, symbol:null): _c is
  undefined
  http://serverapi.arcgisonline.com/jsapi/arcgis/3.1compact/js/dojo/dojo/DeferredList.js
  Line 8

After defining the map and adding a basemap, I'm iterating through a list of JSON layer definitions, building each layer based on its definition, then adding it to the map. The pseudo code is:

dojo.connect(map, "onLoad", function {
   for layerDef in layerDefs:
      if layerDef.type == tiled:
         layer = buildTiledLayer
      if layerDef.type == feature:
         layer = buildFeatureLayer
      map.addLayer(layer)
}

If I add just the tiled layer, or just the feature layer, there are no problems - it's only when I add both together that I see the error message. Once the error message has shown, an infoWindow is not shown when clicking on the feature layer.

This forum post lead me to suspect the problem may be due to the timing of adding the layers - during debugging I found that if I remove the map.addLayer line, and instead push the layers into an array, I can manually enter map.addLayers(layerArray) in Firebug, once the map has finished loading. In this case, both layers add correctly.

Adding a FeatureLayer ARCGIS JavaScript API isn't relevant as I know the feature layer definition is correct - the feature layer adds without error if it's added without the tiled layer.

Similarly, I believe that the layers are correctly defined since each is loaded correctly without the other.

Does anyone have any advice as to why this error might be occurring, and how to resolve the error?

Thanks


texts:
I was curious if there is a way, or plugin to visualize a 3D polygon layer stack in QGIS (or another open source package). I have looked at NViz, but it only seems to work for rasters.

I have a building floor plan with Z info for each floor.  In ArcScene you can import the data and it will "stack" the layers in the Z axis.  I am hoping to be able to complete this in something other than ESRI.

Any help is appreciated...

Thanks....


texts:
While trying to import geopandas error occurs:

  Exception has occurred: OSError Could not find lib geos_c.dll
  or load any of its variants [].

I downloaded GDAL and fiona for Python 3.7 from this website https://www.lfd.uci.edu/~gohlke/pythonlibs/?fbclid=IwAR09Axx2Z6e7tMk8ITEeVePOSX4G6vhsyTNdSGjZfiozAb0Qj57xx6lrdMA#gdal

Then I did "pip install geopandas" and pip works but while importing geopandas in script it still doesn't work, even after installing OSGeo4W.
I'm using Windows 10.
What should I do to be able to use geopandas?


texts: Combine GeoJSON files into bigger shapes with external JSON to merge on


texts: Upload multiple tables from a single Geopackage file to PostgreSQL (PostGIS)

texts:
Context

I have a single GeoPackage file containing several layers (tables) with different geometry types that I want to push to a PostgreSQL (+PostGIS) database.
Each table in the GPKG has a unique geometry type.
But the geometry type varies between tables.

What I've tried so far

Here is a simple example with two layers in the GPKG file (containing POINT and LINESTRING geometries only, see figure 1), but the question can be extended to multiples situations with the same idea in mind.
It could be especially interesting to extend it to mixture of geometry types in a single GPKG layer or geometry collections, and to multiples geometry columns in a single table (even if they are of the same type).

Fig.1: Importing the GPKG file in QGIS shows two layers.

The content of the GPKG file looks something like that (I just decided to focus on the two first layers here, notice lines 12 and 13 are not yet implemented on my side, but I want them in the future):

$ ogrinfo multiple_vector_data.gpkg
INFO: Open of `multiple_vector_data.gpkg'
      using driver `GPKG' successful.
1: el_points (Point)
2: el_lines (Line String)
3: ec_project1_pts (Point)
4: ec_project1_lin (Line String)
5: ep_project2_ply (Polygon)
6: ep_project2_lin (Line String)
7: atc_buildings (Multi Polygon)
8: atc_contours (Multi Line String)
9: atc_centers (Multi Point)
10: atc_head_1 (Line String)
11: atc_head_2 (Multi Point)
12: atc_head_3 (Geometry Collection)
13: atc_head_4 (Geometry Collection)
14: ekp_1 (Line String)
15: ekp_2 (Point)
16: ekp_3 (Polygon)
17: ekp_4 (Polygon)
18: ekp_5 (Multi Polygon)
19: ekp_6 (Multi Polygon)
20: ekp_7 (Multi Polygon)

This command where I specify two target (PostGIS) tables with the -nln option fails miserably:

ogr2ogr -append --config OGR_TRUNCATE YES --config PG_USE_COPY YES \
-nlt PROMOTE_TO_MULTI \
-nln vector_data.el_lines \
-nln vector_data.el_points \
-f "PostgreSQL" PG:"host=localhost user=user dbname=my_database" \
-a_srs EPSG:4326 "${gpkgdir}/multiple_vector_data.gpkg"

by returning this error:

Warning 1: Geometry to be inserted is of type Multi Line String, whereas the layer geometry type is Multi Point.
Insertion is likely to fail
ERROR 1: COPY statement failed.
ERROR:  Geometry type (MultiLineString) does not match column type (MultiPoint)
CONTEXT:  COPY el_points, line 1222, column wkb_geometry: "010500...B30AFC8..."

ERROR 1: COPY statement failed.
ERROR:  Geometry type (MultiLineString) does not match column type (MultiPoint)
CONTEXT:  COPY el_points, line 1, column wkb_geometry: "010500...40390E1714..."

And if I revert the order of these options:

-nln vector_data.el_lines \
-nln vector_data.el_points \

to:

-nln vector_data.el_points \
-nln vector_data.el_lines \

The error is somewhat the opposite:

Warning 1: Geometry to be inserted is of type Multi Point, whereas the layer geometry type is Multi Line String.
Insertion is likely to fail
ERROR 1: COPY statement failed.
ERROR:  Geometry type (MultiPoint) does not match column type (MultiLineString)
CONTEXT:  COPY el_lines, line 1, column wkb_geometry: "010400...AFC854674740"

ERROR 1: COPY statement failed.
ERROR:  Geometry type (MultiPoint) does not match column type (MultiLineString)
CONTEXT:  COPY el_lines, line 1, column wkb_geometry: "010400...3DF5A3634740"

Question

How could I achieve that?
Could we specify a kind of layers reading order (if this makes sense)?
Or specifying a mapping between the GPKG layers and the PostGIS tables?

Related question

Uploading Geopackage contents to PostgreSQL

Environment

$ ogr2ogr --version
GDAL 2.4.0, released 2018/12/14

psql

select version();
"PostgreSQL 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit"

select postgis_version();
"2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"


texts:
I have created an overview map widget for my web app using arcGIS API for Javascript version 4.17. My overview map is separate from my main map as I don't want to bring in all the layers from my main map in the overview. I have basically followed the API documentation as a guide.
// Create Maps
var map = new Map({
    basemap: "streets-vector",
    layers: [GA_Layers, study_layer]
});

// Create another Map, to be used in the overview "view"
const overviewMap = new Map({
    basemap: "topo-vector"
});

 // Create Map Views. Add the map to a MapView
const view = new MapView({
    container: "viewDiv",
    map: map,
    //center: [-82.9001, 32.1656],
    //zoom: 8,
    //center: [-84.228, 30.903],
    center: [-83.9073, 30.8417], //thomas county center
    zoom: 9,
    highlightOptions: {
        color: "red"
    },
    popup: {
        //actions: [risk_snapshot],
        actions: [],
        dockEnabled: true,
        dockOptions: {
            buttonEnabled: true,
            breakpoint: false
        }
    }
});

// Create the MapView for overview map
var overView = new MapView({
    container: "overviewDiv",
    map: overviewMap,
    constraints: {
        rotationEnabled: false
    }
});

I then create some code to sync the overview map zoo, center, and scale to the main view map. However, this does not work.
overView.when(function () {
    view.when(function () {
        setup();
    });
});

function setup() {
    const extent3Dgraphic = new Graphic({
        geometry: null,
        symbol: {
            type: "simple-fill",
            color: [0, 0, 0, 0.5],
            outline: null
        }
    });
    overView.graphics.add(extent3Dgraphic);

    watchUtils.init(view, "extent", function (extent) {
        // Sync the overview map location
        // whenever the 3d view is stationary
        if (view.stationary) {
            overView
                .goTo({
                    center: view.center,
                    zoom: view.zoom,
                    scale:
                        view.scale *
                        2 *
                        Math.max(
                            view.width / overView.width,
                            view.height / overView.height
                        )
                })
                .catch(function (error) {
                    // ignore goto-interrupted errors
                    if (error.name !== "view:goto-interrupted") {
                        console.error(error);
                    }
                });
        }
        extent3Dgraphic.geometry = extent;
    });
}

Essentially, the overview map is not syncing with the main map and doesn't pan or zoom with it after launch. Any ideas as to what I am doing wrong here?


texts: Save a QGIS project as a "no-setup" package containing the project itself, all the layers loaded, and the layer styles?

texts:
In ArcMap, you can do this by saving it as a Map Package. When you open the package, the layers are loaded already and is styled the way you saved it. No setup nor finding of necessary files needed.
I'm transferring several project folders to a coworker and would like to package the main .qgz project file of each project since it will be used in a different computer.
I already tried the suggested plugins here but none saved the layers' styles as is. Is there an automatic function in QGIS to package all files in a project for transferability?


texts: Does JPEG 2000 (JP2) support transparency when created?

texts: I haven't been able to find any resources that can provide if in JPEG 2000 (JP2) transparency can be "built-in".


texts: How do Joins & Relates in layer file and Layer Properties work?

texts:
I'm using ArcMap 10.5. I set up symbology for a feature class based on joined attributes from a table in the same file geodatabase. I want to be able to apply the same set-up in different geodatabases (where all of the feature classes, attribute fields etc are exactly the same, it's just e.g. from a different date to the original one), that are kept on different servers accessed by different people.

I've saved a layer file with the symbology. If I right click on the layer file in ArcCatalog, I can easily change the data source to a different geodatabase and the data displays okay on my PC. However, when I look at the Joins & Relates tab in the Layer Properties, the joined table location is still the original location. This means that while the data displays okay for me, for anyone else who doesn't have access to the same server as me, the join will not work and the symbology won't display.

Does anyone know a way around this?

I can't find any guidance from Esri about how a Join in a Layer File works, and it's all a bit confusing. Ideally changing the layer source would change the join location source too. Basically I'm trying to make the process of applying symbology as simple as possible for our users.

Is there any way to (easily, for non-expert users) apply join settings and symbology at the same time?


texts: How to calculate the corner points of a grid if centre points are know

texts:
I am working with a file which has the coordinates in WGS84 format. From this file I have calculated the Cartesian coordinates using the following code:
import numpy as np
import pyproj
from netCDF4 import Dataset
_projections = {}

def unproject(z, l, x, y):
    if z not in _projections:
        _projections[z] = pyproj.Proj(proj='utm', zone=z, ellps='WGS84')
    if l < 'N':
        y -= 10000000
    lng, lat = _projections[z](x, y, inverse=True)
    return (lng, lat)

def calculate_grid_definition(in_path):
    """
    Calculate the latitude and longitude coordinates of the cell.

    :param in_path: Path to the file that contains all the information.
    :type in_path: str

    :return: Latitudes array, Longitudes array, Latitude interval, Longitude interval.
    :rtype: numpy.array, numpy.array, float, float
    """
    with Dataset(in_path) as f:
        utm_lat = f.variables['LAT'][:]
        utm_lon = f.variables['LON'][:]
        geolat = np.zeros((len(utm_lon), len(utm_lat)))
        geolon = np.zeros((len(utm_lon), len(utm_lat)))
        for x, u_lon in enumerate(utm_lon):
            for y, u_lat in enumerate(utm_lat):
                lon_now, lat_now = unproject(32, 'N', u_lon, u_lat)
                geolat[x, y] = lat_now
                geolon[x, y] = lon_now

        return geolat, geolon

inpfile = 'path/to/filename.nc'
geolat, geolon = calculate_grid_definition(inpfile)

Now I also want to calculate the corner points of the grid cells. Assuming a regular rectangular grid, it would be very simple with the following code:
def create_bounds(coordinates):
    interval_x = coordinates[1, :] - coordinates[0, :]
    interval_y = coordinates[:, 1] - coordinates[:, 0]
    interval_x = np.tile(interval_x, (len(interval_y), 1))
    interval_y = np.tile(interval_y, (interval_x.shape[-1], 1)).T

    coords_left = coordinates - interval_x / 2
    coords_right = coordinates + interval_x / 2
    coords_bottom = coordinates - interval_y / 2
    coords_top = coordinates + interval_y / 2

    bound_coords = np.dstack((coords_left, coords_top,
                              coords_right, coords_bottom))
    return bound_coords

lat_bnds = create_bounds(geolat)
lon_bnds = create_bounds(geolon)

But, this is not right because the grids are skewed and result in an overlap. Any leads?
For your information, you could download the original grid coordinates from this file. An alternative download link is here.


texts:
I am struggling to find a solution to add my two basemaps (Esri Imagery and OpenStreetMap) and one external GeoJSON to show up on the Layer Control panel in Leaflet.
Here is the block of code:

      <title>Test</title>
      <meta charset="UTF-8">
      <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
      <link rel="stylesheet" href="http://k4r573n.github.io/leaflet-control-osm-geocoder/Control.OSMGeocoder.css">
      <link rel="stylesheet" href="http://makinacorpus.github.io/Leaflet.FileLayer/Font-Awesome/css/font-awesome.min.css">

This code enables only the GeoJSON to appear, but not the basemaps.

I tried adapting several lines of code found in some examples, but with no result.


texts: Correcting the geometry of overlapping polygons in the same layer in QGIS

texts:
I have a shapefile with buildings defined as polygons. Some of them are partially overlapped. They are all in the same layer. I can identify the overlapping using the "Topology Checker" but I cannot solve the overlapping issue.
What I would like is to obtain separate polygons, without overlapping but contiguous.
I have this:

and I would like to have this:

I tried without success:

GRASS/v.clean - nothing changed
SAGA/vector polygon tools/intersect
SAGA/vector polygon tools/self intersection - they both break the the 2
polygons on 3 (2+intersected area).


texts: I have a .shp with all the street of an area. I also have all the gtfs of the public transportation of the area so I want to clean the gtfs data of the itinerary. The shape of all the itinerary are a bounch of point with the coordinates and some of this is in some building so i want to take all the shape's points and put on the street. I can use Grass or Gdal. Suggestions?


texts: Mapping .csv file using ArcGIS online with Python

texts:
I have .csv data in the format:
Longitude Latitude Threat
  -24         45     0.5
  -31         40     0.9
   .          .       .
   .          .       .

I want to visualize this data as a threat level heat map in Python. So far I have figured out how to get the csv data into my ArcGIS Online account with this:
import arcgis
from arcgis.gis import GIS
from arcgis.mapping import WebMap
import os

gis = GIS("https://www.arcgis.com", "USERNAME",
"PASSWORD")
data_path = (r"C:\Users\NAME\Desktop\Map")
csv_path = os.path.join(data_path, "mapUS2061FINAL.csv")
csv_properties={'title':'hwa2061',
            'description':'hwa2061',
            'tags':'arcgis, python'}

thumbnail_path = os.path.join(data_path, "hwa.png")

earthquake_csv_item =
   gis.content.add(item_properties=csv_properties,
   data=csv_path, thumbnail =thumbnail_path)

How would I visualize this csv data from Python on a map, and then save this map or the html code for the map to my computer?
I am new to GIS.
I put the .csv in a DataFrame and converted into a Feature Layer. It was successfully sent to ArcGIS but when I try and view the Feature Layer, I was stuck on a loading page which probably indicates that my data input was incorrect.
Here is what I tried:
import json
from IPython.display import display
import arcgis
from arcgis.gis import GIS
from arcgis.mapping import WebMap, WebScene
import pandas as pd

gis = GIS("https://www.arcgis.com", "USERNAME", "PASSWORD")
f = open("C:/Users/NAME/PycharmProjects/colors/Map/mapUS2061ADDADDADD.csv")
df = pd.read_csv(f)
print (df.head ())
x=gis.content.import_data(df)

y = dict(x.properties)
z = json.dumps({"featureCollection": {"layers": [y]}})
p = {'title': 'hwa2060#9',
                    'snippet':'hwa',
                    'description':'test ' + \
                    'dataframe object to a GIS item',
                    'text':z,
                    'type':'Feature Collection',
                    'tags': 'python'
                     }
h = gis.content.add(p)
display(h)

Python Output:
    X   y    Threat
0  -74  40   0.127
1 -114  47   0.000
2  -79  25   0.158
3  -89  43   0.109
4 -106  37   0.068
<Item title:"hwa2060#9" type:Feature Collection owner:USERNAME>

When I went to ArcGIS Online, the map did not show up. It was stuck loading.
I want to then put this feature layer on a map and export the html code from this map eventually.


texts: How do I create a shapefile of polygons from points in a spreadsheet?

texts:
I have a spreadsheet that has 100 different polygons listed with UTM coordinates for the 4 corners of each polygon.

I want to turn the spreadsheet into a shapefile with 100 unique objects, 1 for each polygon (ideally with the object ID as the polygon name from the spreadsheet).  I know I can use the convex hull(s) tool when I just have one polygon to create from a set of points, but I need to do this for a hundred (or thousand).


texts: Selecting lines by distance in a layer from a polyline in another layer using QGIS?

texts:
I have 2 layers containing polylines.

I'd like to establish the closest distance at any point along the line of one layer to the the lines on a different layer. My assumption is that the Nearest Neighbour Analysis doesn't do this.

What is the best way?


texts: Changing Number order in the same column in the ArcGIS Shapefile

texts:
I have two types of number in my shapefile/database in the same column as follows. The first one does not have any alphabetic character but second one has alphabetic characters.

(a) 26 25 21 0000 00200 0000
(b) 27 25 21 0050 00000 001A

There is one space between the blanks as it can be seen from the number. The number given are mismatched. Here, in the first example, the 21 should take the place of 26 and 26 should take the place of 21 and in second example, 21 should take place of 27 and vice-versa. For example, this is the output I am after:

(a) 2125260000002000000
(b) 212527005000000001A

How can I replace those numbers using the field calculator?


texts:
We're having issues embedding a visualization into http://unitedlayer.com/fastest-growing-san-francisco-companies

Previously, the embed code worked just fine. Once we pushed the map to the live site, we lost it entirely.

Any ideas?


texts: How do I intersect a point with a shape?

texts:
I have a table in Postgresql / PostGIS containing county geometries. This table was created by importing a shapefile. I verified the geometry was imported successfully by importing the table into QGIS to view the polygon positions and ensure everything was drawing correctly. So, now I have geometry in a table.

Now, I want to write a SQL query to return the polygon that a points intersects. For example, given a lat/lon of 35, 80 it should return the row for the county that contains the point at 35, 80.

The geometry is in the database with SRID EPSG:2810, "NAD83(HARN) / Minnesota North". The point is in WGS84 - typical coordinates taken from a GPS receiver.

How do I select the row that the point intersects with? The geometry in the GEOM column of type geometry.

Here's a query I started but it doesn't return any rows:

SELECT *
FROM county
WHERE ST_Intersects(
        geom,
        ST_GeometryFromText('SRID=4326;POINT(47.000000 -91.000000)')
        );


texts: Leaflet Customer Marker Changes Position with Scale

texts: I am using a customer marker to represent metro stops in my leaflet map. The problem is that the markers are changing their position every time I zoom in or out. When I finally zoom in to the last level they reach their specified position. How can I make them stay at the same place at all times like the default leaflet markers? The icon anchor option isn't working for me. Which option or property am I missing?


texts: Snap Points to the lines within specified offset

texts:
I have data of points which are within specific distance to roads e.g. 1m. Now i want to snap the points to the nearest lines which lie within specified distance to the lines

What is the best way to do this. Currently i am using postgis and have tried to make shortest line between point and line, extrapolate the line by the required distance and then snap the point to line end. So far i have not been able to extrapolate line in postgis. Please guide


texts: UpdateCursor doesn't give error until the next iteration ('NoneType' object is not iterable)

texts:
I have a string field within a GDB that does not accept all string values, giving a "The row contains a bad value" error. I have fixed the issue with InsertCursor (prompts user for new value), but can't with UpdateCursor.

The problem with UpdateCursor is that it does not actually give an error until the next iteration - at which point, any time I try to create a cursor object to the applicable table, I get a TypeError: 'NoneType' object is not iterable. Because of that, I cannot go back into the table and fix the value. (The type of the cursor is still an UpdateCursor object, but the error arises once I try to loop through it)

This is the code I originally had (I open an edit session earlier, for reference):

with arcpy.da.SearchCursor(pathDBF, fields_in) as cursorDBF:
    for rowDBF in cursorDBF:
        where = "{0} = '{1}'".format(name_field, rowDBF[nameIndex])
        with arcpy.da.UpdateCursor(pathGIS, fields_out, where_clause = where) as cursorGIS:
            for rowGIS in cursorGIS:
                while True:
                    try:
                        cursorGIS.updateRow(rowDBF)
                        break
                    except:
                        rowDBF = fixRow(rowDBF)

This is my currently working fix (create new cursor and test if it's iterable; if not, fix row and update again). This feels really convoluted to me and I'm hoping someone can help me find a better way.

for rowGIS in cursorGIS:
    while True:
        cursor.updateRow(rowDBF)
        try:
            with arcpy.da.UpdateCursor(pathGIS, table.fields_out, where_clause=where) as cursorNew:
                for newRow in cursorNew:
                    break
            break
        except:
            rowDBF = fixRow(rowDBF)


texts: How to keep spatial information after raster processing of satellite data in r

texts:
In R raster package i write an image in tiff format after certain raster processing but the spatial information is missing of new image. That's why i have to geo-reference the image again. How this can be avoided?
For example, i want to get relative normalization image of landsat data. The code is

library(landsat)
library(raster)
library(lmodel2)
library(rgdal)
a<-raster("D:/Paper/test/1997-137-b3.tif")
x<-as.matrix(a)
b<-raster("D:/Paper/test/2007-137-b3.tif")
y<-as.matrix(b)
z<-relnorm(master = x, tofix = y, nperm=100, method="MA")
RMA was not requested: it will not be computed.

image(z$newimage)
m<-raster(z$newimage)
writeRaster(m, filename="D:/Paper/test/2007-b3-rd.tif", format="GTiff", options="INTERLEAVE=BAND", overwrite=TRUE)

But after processing the file i write in raster format missing spatial information.


texts: I am looking for a direct long. to X lat to Y map of earth

texts:
Occasionally I like to drop raw coordinate data into excel and do a scatterplot. It comes out quite a bit like cylindrical projection but not quite. The distortion near the poles is a bit more pronounced.

What is This raw projection called and
Does anyone have a reasonable map of earth using this projection?

I promise not to publish using the ugly thing or corrupt young minds with it. I just would like it for my reference.


texts:
Hi I have a sequence of points in QGIS and each of them has its attributes. For my application, I may need to manually edit them by dragging them around in the canvas. It would be much easier for me if the points are shown as CONNECTED, for example, a line. Then I can easily drag and align them.

One thing I tried is connect them into a line using whatever plugins. However, after converting from point feature to line feature, I have lost all my attributes of the points. Because it is a line feature now with line attributes. (all points become the vertices of the line).

I geuss to keep all the attributes of my points, I need to keep them as point feature rather than a line feature, but just show them in canvas as connected. Is this possible in QGIS? Or any other solutions would be welcomed.


texts: ERROR 000539: Error running expression:rcexec ()

texts: I have got this error when tried to make slope less than 20 degree through Raster Calculator. One day before I installed Python 2.7.13 and after, this error appeared. When I delete the downloaded python, ArcGIS is not opening at all. Could it be the reason for the program not working properly?


texts: Is there a way to make an extruded polygon transparent. I've tried going to the properties and changing the transparency but the polygon still looks like a solid block. I have an extruded polygon and a lot of point features I would like to see through the extruded polygon.


texts: QGIS shapefile misaligns when adding to arcGIS Online

texts:
I have access to an ArcGIS Online account. I wanted to create a map with some polygons. So I've used QGIS to make the shapes, saved the layers, zipped them, and uploaded them to ArcGIS Online.

Two days ago my polygons uploaded great and aligned to the basemap perfectly. Using WGS 84 / Pseudo Mercator EPSG:3857 in QGIS worked like a charm (You can see how the shapes border the river very well).

Today I made some revisions to my shapes, including joining some data tables and moving some nodes around. Now when I upload the shapefiles (with the same CRS), everything is misaligned about a mile South of the river.

Here's an overlay if that helps:

In QGIS, these two layers overlay as expected. So, what happened?

Here's the results of my .prj file (broken into lines for readability). I have to admit, I have no idea what I'm looking at:

PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],
PARAMETER["central_meridian",0],PARAMETER["false_easting",0],
PARAMETER["false_northing",0],UNIT["Meter",1],
PARAMETER["standard_parallel_1",0.0]]


texts: Custom matplotlib discrete colormap with fixed values on raster

texts:
I've been using a color ramp with fixed values (0-255) corresponding to specific rgb color (discrete interpolation) for 8bit tifs in QGIS. I've used matplotlib to apply built in colormaps, but I'm trying to figure out how to create a matplotlib custom colormap to replicate the results I get from QGIS that uses this fixed scale.

Example fixed value color ramp

# QGIS Generated Color Map Export File
# val, r, g, b, a, label
INTERPOLATION:INTERPOLATED
133,178,178,178,255,1
138,0,120,120,255,2
142,0,190,190,255,3
... and so on

Any pointers on how to go about this? I was able to get fairly close with gdaldem color-relief but its interpolation is adjusting some of the values where it isn't quite as good as what QGIS is outputting... I'm assuming because its automatically using linear interpolation vs discrete


texts:
I tried adding a base map with Adding Base map, but the window where types of base maps are selected is blank.

I tried clearing the display cache but to no avail.
I was able to add base maps before with no problems, but recently it just stopped working.
I didn't update anything prior to this.

How can I fix this, so I can add base maps again?


texts: How to merge polygons not sharing same boundaries based on attribute with one expression in qgis

texts: I have a .shp file of a country in which I have NAME_1 as state/province name. NAME_2 as district name and NAME_3 as towns of the district. I want to merge the polygons based on NAME_2 for the whole country except 30 entries out of them. I tried dissolve tool of QGIS but it didn't helped. There is one more problem here is that NAME_2 can be repeated for more than one NAME_1. So I have to take care of this also. I am doing it manually one by one using merge selected features in QGIS. Could somebody show me a way for doing this as fast as possible.


texts: ArcMap Partial Refresh not working when Layout Graphics exist?

texts:
I'm experiencing strange behaviour in ArcMap v10.3.
Adding layout graphic elements to all 4 corners of our map will result in a full refresh every time a point feature is moved.

Things that I've noticed are:

If I delete the graphic elements, ArcMap will perform a partial refresh using the extents of the feature being moved, which in my case is a point feature with a tiny extent so the refresh is super fast.
If we only have 2 graphic elements (1 in corner, 1 in center), ArcMap will create a bounding box between these graphic elements and refresh that area, regardless of where my point feature is (ie. a partial refresh will occur around my point feature as well as the bounding box between the graphic elements)

Has anyone else come across and/or fixed this issue?


texts:
I have calculated drainage density for two watershed and need to make sense of the numbers. One watershed has a drainage density of 1.08 km/km2 (area=32 sq. km and total stream length=34.436 km). The second watershed has a drainage density of 1.23 km/km2 (area=20 sq. km and total stream length=24.586743 km).

Could someone explain if these numbers are high/low?

And what they mean in the real world?

I’ve been Googling these questions and have had no luck. Below is a map I have created showing areas of high density - this, along with calculating watershed DD, is the purpose of my study.


texts: Changing size of globe in Leaflet globe mini map?

texts:
This plugin fits all my needs but I can't figure out how to change the size of the globe in the example to 175px width and height.
https://github.com/chriswhong/leaflet-globeminimap

I tried this in the settings but it did not work:

var miniMap = new L.Control.GlobeMiniMap({
  position: 'bottomright',
  width: 175,
  height: 175,
  land:'#d9d9d9',
  water:'#e9eef9',
  marker:'#418fde',
  topojsonSrc : 'world.json'
}).addTo(map);


texts: Preserving 'Created By' field when appending data in ArcGIS enterprise geodatabase

texts:
I am updating the schema of an enterprise geodatabase. My plan is to create an xml document of the database schema, make my changes within the xml editor, and then create a new GDB with the new schema imported. After this I will import the new data by using append.

I know that I can preserve the GlobalID value by ensuring the environmental settings are as I wish. But, I am wondering if there is a way to preserve the original automated 'Created By' and 'Created Date' fields with the user that actually created the record and date that it was actually created. In the past, all of the records were updated with 'Administrator' and the date that the records were imported.


texts: Creating clusters based on attribute and proximity

texts:
In my map as you see below, I have my population by district.

I want to create 50 clusters with similiar sums of the population and by proximity. How I can achieve this?

For each cluster, I want the districts are next to each other (As you can see in yellow in the picture).


texts: How to return nearest point to input lat/long with distance?

texts:
I am trying to write a query with PostGIS that returns one row where the geometry of that row is the closest to an input point. I would also like to include the distance between these points in the result. And of course, I want it to run as quickly as possible. I have scoured the internets, but haven't quite found the solution to this specific problem.

Here is what I have so far, the query runs just fine, but the result is definitely not the closest record. (Note that geom is the name of the geometry column)

SELECT * FROM table
ORDER BY geom <-> st_setsrid(st_makepoint(-112,33),3857)
LIMIT 1;

I have also tried to use the following ORDER BY clause, but I get the same incorrect result:

ORDER BY ST_Distance(geom,ST_GeomFromText('POINT(-112 33)', 3857));

I need to fix this query so:

It returns the correct closest geom and associated row, and
Include the distance between the points with the result.

Any help is much appreciated!


texts:
The latest version 3.6 is installed, but the raster statistics for polygon doesn't work, also the directional statistical for layer doesn't work as well. ANY HELP

I received the following message,

The following layers were not correctly generated.D:/Finland/de.shpYou can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.


texts: Labelling left and right names on a line, in a .mss file?

texts:
I am currently working with project.mml and associated .mss files.  I am looking at replacing OSM admin labels with a secondary source and I am wondering how Carto does the labeling along the lines labeled by

#admin-text[zoom > 11] {
  text-name: "[name]";
  text-face-name: @book-fonts;
  text-fill: @admin-boundaries;
  text-halo-radius: @standard-halo-radius;
  text-halo-fill: @standard-halo-fill;
  text-placement: line;
  text-clip: true;
  text-vertical-alignment: middle;
  text-dy: -10;

My understanding (being new to this), text-dy is the offset, but I am wondering how it knows to display the labels correctly on the left or right side.  I assume that there are multiple OSM boundary lines overlapping and depending on the direction of the line then the label appears -10 offset.

The data that I want to use, has a left and a right name attribute.  Therefore I assume that I could add to separate labels, 1 for the left with a -10 offset and 1 for the right with a +10 offset in theory.

What are Carto or OSM left and right naming conventions?


texts: PostGIS points along a line aren't actually falling on the line

texts:
I have a line network and I am placing points at equal intervals along each line. These points will be used to cut the lines into segments. I have found a way to create the points along the lines:

CREATE TABLE split_pt as

WITH line AS
    (SELECT
        id,
        geom
    FROM line_table),
linemeasure AS
    (SELECT
        ST_AddMeasure(line.geom, 0, ST_Length(line.geom)) AS linem,
        generate_series(0, ST_Length(line.geom)::int, 160.9) AS i
    FROM line),
geometries AS (
    SELECT
        i,
        (ST_Dump(ST_GeometryN(ST_LocateAlong(linem, i), 1))).geom AS geom
    FROM linemeasure)

SELECT
    row_number() over() as id,
    i,
    ST_SetSRID(ST_MakePoint(ST_X(geom), ST_Y(geom)), 3857) AS geom
FROM geometries;

However, I have two problems:

I'm getting around 400 duplicate points
About 60% of the points are not actually on the line so running the subsequent ST_Split() with these points against the lines doesn't work in most instances.

I am looking for help to eliminate duplicate points and to ensure that the points I create in the above query will return True on ST_Intersects(). I'd like to be able to incorporate these two aspects in the the above query and not in subsequent steps, if possible.


texts: Line perpendicular to the maximum axis of an irregular polygon (sinkholes) QGIS 3

texts:
I am performing a morphometric analysis of dolines using QGIS 3. The analysis consists of determining the longest axis (the union of the two most distant points of the polygon) and the shortest axis which is the longest line perpendicular to the major axis and it is inside the polygon.

I could determine the major axis by the distance matrix, as they answered me in my previous question, but I have not been able to find the line perpendicular to this one.


texts: Changing flyout text in Layer panel in QGIS

texts: Is there a way of changing the text that is shown in the flyout when hovering over a layer name in the layer panel - where does that text come from?


texts: Ways to speed up Polygonizing of rasters/orthophotos (binary)?

texts:
From a orthophoto of the Wadden Sea, I want to create a polygon from a class of this TIFF/raster (binary) representing an oyster reef, calculate the area of the reef and form a polygon around the reef for further processing.
But since polygonizing this raster takes already so many hours I don't know what I can do.
Is there any way to speed up the process or decrease the size/information of the raster? Or other ideas? Should I decrease the original resolution of the orthophoto?
Size of the TIFF is 3.9 GB and pixel size is 1.86e-7,-1.87e-7

QGIS version: 3.16.4-Hannover
Ubuntu 18.04
64 GB Ram
Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
M.2-PCIe-NVMe-SSD-Disk, 512 GB


texts: Difference between registering with ArcSDE and registering with Geodatabase?

texts:
As I understand it :

Registering with ArcSDE: gives the possibility to ArcGIS to recognize spatial data stored in a database
Registering with Geodatabase: makes it possible for data to participate in Topology, NA, ... datasets

Is there any other differences?  Does one of those registrations include the other one? Are they different from one another?


texts: Wanting extract to produce sensible answers for NAs in R

texts:
So, I'm working on extracting values from multiple different rasters in R. However, some of our data is marine, some terrestrial. Some rasters cover both, but a few are ocean only or land only. At times, this leads to extract in the raster package throwing errors in unpredictable ways.

For example, if I throw a land point into the mix when extracting sea surface temperatures, I WANT an NA return value.  However, despite my best efforts, I still get the dreaded

Error in apply(x, 2, fun2) : dim(X) must have a positive length

error.

I don't get it consistently. Sometimes I get NA returns, which is what I want. But for some points...no.  Here's what I've done. Does anyone have any pointers on avoiding how this extraction breaks?

To try this example, grab the data from http://www.metoffice.gov.uk/hadobs/hadisst/data/HadISST_sst.nc.gz

library(raster)

hadsst <- raster::brick("./HadISST_sst.nc")

#A lat/long throwing errors
ull <- data.frame(site_lat = 37.6, site_long = 101.3)

#A function to make things safe
safe_mean <- function(x){
  if(sum(is.na(x))==length(x)) return(NA)
  if(sum(x == -1000, na.rm=T) == length(x)) return(NA)
  return(max(x, na.rm=T))

}

#Where it all goes wrong
hadsst_vals <- raster::extract(hadsst,
                               cbind(ull$site_long, ull$site_lat),
                               buffer=50000, fun=safe_mean, na.rm=FALSE)


texts:
I want to draw a grid map based on the temperature values in Leaflet.

Similar to the illustration below.

Input data: lat, lon, temperature values, cities' names

Parameters: the dimensions of the grid might be about 1-0.5 degree square.

At first, I thought plot markers(icon) 1 degree at a time is the best way, but I couldn't change the marker size from pixels.

What should I do? I wonder if I need GeoJSON for that?


texts: How can I find an OSGB six-digit code's bounding box?

texts:
How can I convert Ordnance Survey six-digit codes to the latlng bounding box of the related 1km grid square?

For example, NH0325: according to Wikipedia this means a 1km square whose south-west corner is 3 km east and 25 km north from the south-west corner of square NH.

Could anyone point me at some code for converting this code to its 1km grid square, ideally in Python?

I already have Paul Agapow's OSGB library - I think this returns the south-west corner of the grid square, in OSGB36 coordinates. I could potentially use this to find the north-east corner, but I don't know how.

I'm displaying the results on an WGS84 map, so it would be better to have the results in WGS84, if possible.

This is all far beyond my knowledge of map projections. Any suggestions very much appreciated.


texts: How to show labels for all polygons in a layer, even with 'NULL' values?

texts:
I have a polygon layer which contain information on property name, number of trees within the polygon, average height, and min- and max height values.

My problem is, I want to label each polygon with property name, number of trees, etc. I got that part to work, the labels looks the way I want them.
But, I have a number of properties which doesn't contain any trees.
When making labels, the properties without tree doesn't get labelled at all?

I would like labels on the properties without trees to show just the names of the properties.
Is this possible in QGIS 2.2?


texts: Creating Data Elevation Model from two sources

texts:
I have 2 Data Elevation Models ( Aster with 30 m resolution and a DEM obtained by stereo with 4 m resolution ).

Unfortunatly the DEM with high resolution contains a lot of no data value and some values with low accuracy. So, I want to use the two DEMs and extract one DEM with high accuracy. How can I do it ?


texts: What is "Current Status" (IMMCurrentStatus) in ArcFM Downstream Trace?

texts:
I'm trying to develop a custom downstream trace Addin for ArcGIS using .net (C#) Miner.Interop.Framework Assembly.

I'm using TraceDownstream Method from the ArcFM Desktop Developer Guide and following this example for guidance, since I'm very new in this.

By calling the Trace Downstream Function:

pElecTrace.TraceDownstream(pGN, pElecTraceSettings, pCurrentStatus,
                           179998,  ESRI.ArcGIS.Geodatabase.esriElementType.esriETJunction,
                           Miner.Interop.SetOfPhases.None,
                           Miner.Interop.mmDirectionInfo.establishBySourceSearch, 0,
                           ESRI.ArcGIS.Geodatabase.esriElementType.esriETEdge,
                           iJunctionBarriers,iEdgeBarriers, false,
                           out pJunctions, out pEdges);

I get The NullReferenceException (Object reference not set to an instance of an object)

My Assumption is that it is because I have declared

IMMCurrentStatus pCurrentStatus = null;

by following the mentioned Example. And It is the only Null Element in the called function.

Now the problem is that , I don't have any idea what "Current Status" really is. Neither could I find any explanation in the Documentation as to what Current Status really is or where can I retrieve its information from.


texts: Choosing efficient output format for spatial data in R

texts:
I'm assembling a moderately large spatial dataset as simple features in R (4.0.5).
Is there a good way to select the most performance-efficient output format/OGR driver to save my assembled data?
I'm interested in a general approach, but here are some particulars of my current case:

The data consists of multiple vector types plus non-spatial columns.
The spatial inputs include ESRI shapefiles, ESRI file geodatabases, and GeoJSON.
My purpose in writing the data is to read back into R for analysis.
My constraints are processing power and working memory, not disk space.

I'm looking for a general algorithm for selecting among the many available OGR formats.


texts: How to offset lines in QGIS that share the same origin and destination

texts:
I have a set of lines in QGIS that represent travel between destinations.

Some of these lines of travel overlap - for example, traveling from Rome to Paris, and then back to Rome, and then on to Prague.

My goal is to represent the travel in a non-overlapping way that gives me curved arrows that will start at the origin, flare out, and end at the destination point.  The return trip will do the same thing with an opposite offset.

I followed some basics in this post to prepare my data: How to graphically offset the boundary line of a polygon in QGIS?

But this post is talking about a constant offset of polygon data, and does not really address what I am trying to do.  However I have created a field in my line layer called offset that gives a value of 1 for any lines that need to be offset.  I can offset these, but they offset in a linear way, giving me parallel lines that do not touch the origin/destination.

I have also reviewed the post by @underdark here that talks about flow maps, however, I feel like I am trying to do something much more simple here; and anyway the formula does not work for my shapefile.  I feel like this should get me close but I am not an expert and need something that is a bit more generic for non-weighted data.  I am just trying to symbolize overlapping travel in a non-confusing way.

What I am looking for here is a geometry generator formula that can show me how to generically create offset curved lines (with arrows if possible) between an origin/destination pair.

UPDATE: Here is a graphic representing what I'm trying to do:


texts: From everywhere to everywhere in ArcGIS using Closest Facility did not solve all possible routes

texts: I am building from-everywhere-to-everywhere routes in ArcGIS Network Analyst using OpenStreetMap Data. I have 189 points that I want to connect with all possible other facilities. I ran this using the Closest Facility Tool in Network Analyst, by loading 189 facilities and 189 incidents, and trying to find 189 closest facilities for my incidents. Ideally, I should have 35532 routes, if excluding self-loop. However, after dissolving the network, fixing topology, snapping my facilities and incidents to the network data, allowing U-turns, increasing search radius to 1500m, I kept only having 18559 routes solved. Some of my incidents were only connected to one or two other facilities. What could have gone wrong?


texts: Create polygon center line with Python script

texts: Does anyone have a stand alone python script that will find the center line of a polygon and output as a separate feature class? I have a basic ArcMap license 10.6 (no extensions) and I would like to develop a modelbuilder tool to iterate several polygons, find their center lines and store the center lines as a separate feature class in another folder or GDB.


texts: Calculating spatial correlation between features from two separate layers in QGIS

texts:
I am trying to determine whether the presence of large numbers of active duty military troops in an area is spatially correlated with higher/lower levels of violent crime. That is, are the areas surrounding large military bases more/less violent, on average, than areas that are not near military bases?

I am working with the following two datasets:

(1) a set of point data of military bases in the continental US & their corresponding troop levels:

(2) a set of nationwide data on rates of violent crime by town/city:

I feel like I'm looking for some sort of gravity-based model where the "mass" function gives troop levels at each base. So a large troop presence would exert influence over a larger area, and would have a stronger effect near the center of mass (i.e. the point location in the GIS layer).

I am thinking that, conceptually, it would look something like this:

In this diagram X,Y,Z represent military bases. a,b,c,d each represent cities (each of which has a violence rate field in its attribute table).

The gradient around the bases represents the field of influence, which decreases exponentially with distance away from the base centroid. Larger troop presence equates to a larger radius of influence (with some maximum threshold distance), and also to a stronger influence nearby the center relative to the areas nearby a smaller base.

Each city will be assigned a score based on summing the magnitude of all of the "force" vectors from all surrounding bases whose influence radius they lay in. So for instance, in my diagram, City a would have a score of 0 since it lies outside of any base's radius. City b would only be influenced by base X. City c would only be influenced by Base Z, and its score would be lower than b, since X is a much larger base than Z. Finally, City d lies within the radius of both bases X and Y, it would receive a score based on summing the magnitude of influence from both bases. I would then see if there is a correlation between higher score for a city and higher rates of violence.

I've been looking into various gravity-based models (Huff Models, etc) but have been unable to find much as far as QGIS/Python, and am not quite sure how to implement what I described above ... Does anyone have suggestions for this? Have any of you done this type of analysis in other areas before?

So the TLDR is:

What statistical techniques could I use for this sort of question?
Are there any tools built-in to QGIS (or available as plugins) that can do this?
If there is nothing like this in QGIS, are there any Python libraries that can perform this sort of analysis?


texts: Exporting raster to rendered image using standalone script in QGIS?

texts:
Using standalone script I loaded a layer, and now I need to export it as an image. See code below:

 from qgis.core import *
 from qgis.utils import *
 from qgis.gui import *
 from PyQt4.QtGui import *
 from PyQt4.QtCore import *
 QgsApplication.setPrefixPath("C:\OSGeo4W\apps\qgis", True)
 qgs = QgsApplication([], True)
 qgs.initQgis()
 rasterpath = "E:/MODIS DATA/2016/15-10-2016/TIRUNELVELI.tif"
 lyr = QgsRasterLayer(rasterpath, "TIRUNELVELI")
 QgsMapLayerRegistry.instance().addMapLayer(lyr)

I checked the post QGis Save Raster as Rendered Image, but the code is executed using Python console. If I use the same code it shows an error:

  NoneType object has no attribute 'clone'.

Updated Code after Comment

from qgis.core import *
from qgis.utils import *
from qgis.gui import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
rasterpath = "E:/MODIS/TIRUNELVELI.tif"
layer = QgsRasterLayer(rasterpath, "TIRUNELVELI")
QgsMapLayerRegistry.instance().addMapLayer(layer)
uri = "E:/MODIS/newStyleqgis.qml"
layer.loadNamedStyle(uri)
extent = layer.extent()
width, height = layer.width(), layer.height()
renderer = layer.renderer()
provider=layer.dataProvider()
crs = layer.crs().toWkt()
pipe = QgsRasterPipe()
pipe.set(provider.clone())
pipe.set(renderer.clone())
file_writer = QgsRasterFileWriter('E:/MODIS/abcd.tif')
file_writer.writeRaster(pipe,
                       width,
                       height,
                       extent,
                       layer.crs())

updated but showing error as shown :


texts: Manipulating / modifying terrain data to model a new surface

texts:
Short question: How to (intuitively) modify/manipulate a terrain with QGIS or alternative Open Source Software?

The details: In order to build a habitat (ponds and depressions) for amphibians, a terrain needs to partly be digged out to a certain depth (relative to groundwater level) and in a certain shape. I have the original terrain surface, interpolated from XYZ Data. Further I have the outlines of the ponds as a polygon shape. Now I need to modify the elevation data to represent the future suface after the ponds are built. (The overall goal is to calculate the volume of extracted material between the original surface and the new one, but that is yet another step.)

Do you know of any tools or plugins in QGIS or an other free software that allows a rather intuitive method for manipulating terrain data? I was thinking of maybe something like the "Grid editor" in Surfer, but of course I am open for anything...

Image: original surface and position of ponds/depressions


texts: How to convert lat long into world region?

texts: I have a list of lat/lon points in a kml file which I would like to group into world regions. How can I use the World Borders Dataset or some other dataset to generate a "region" tag for each point?


texts:
For example, I have a netcdf file from WRF model, and its time zone is in UTM 00.
I want to change the time zone to UTM 08, how to achieve that?


texts: Will external antenna on handheld GPS improve location in a forest?

texts:
I want to improve the probable accuracy of waypoints that I collect during vegetation surveys on foot, where the canopy is overhead and continuous. My handheld receiver unit is a Garmin GPS 60 (consumer grade, position <15 metres 95% typical accuracy).

The unit accuracy is adequate for survey of open-sky areas. However, particularly in forest settings where canopy cover prevents satellite availability, will an external antenna mounted to a pole improve the accuracy? I am presuming the external antenna will see more satellites and improve accuracy that way. But is that true in practice?

The type of external antenna I have in mind are the small units that seem to be sold mainly for consumer automotive GPS use, like a Garmin GA25 MCX or Gilsson FME amplified antenna.


texts:
I have a GeoJSON with some points of interest that I would like to update to the Open Street Map project.
I cannot find documentation on Wiki to do so. Is it possible to import points to OSM from file?
Maybe I need to convert it into another format using ogr2ogr but I have no idea to start.