texts: QGIS 3.8 Batch Processing file path using Caclulate by Expression has square brackets between strings

texts:
I am trying to run a batch process using QGIS 3.8. I want to have the name of the output file use part of the name of the input file. For example the input file is "Landuse_A.tif" and the output is "Degradation_A.tif".  Using the Calculate by Expression function in the output file I use the expression

"C:/Users/BP/Desktop/" || "Degradation" || regexp_substr( @landuse ,'(?:.(?!_))+$')||".tif"

This seems like it should work but puts brackets between my strings. The result is

  [C:/Users/BP/Desktop/][Degradation]_A[.tif]

and the file path is not recognized by the computer.

Are the brackets really messing things up or is it something else and if they are what can I do to remove them?


texts:
Considering I have a folder that contains multiple .gpx tracks, my objective is to show each of them in a single leaflet map. Then I would personalize thing like tooltips of each track, the color for each track, etc.

I already searched and found these libraries:

https://github.com/mapbox/leaflet-omnivore

https://github.com/mpetazzoni/leaflet-gpx

But they only let me load one track. Is there a way to load an entire folder?

If leaflet does not allow it, is there another option?

EDIT:

So I have the tracks folder on my backend/server side, so to read them at the frontend I need some way to get the data.

My backend runs using Flask, and I got an endpoint to list all the files:

class GPS_Tracks(Resource):
  def get(self):
      files =[]
      for f in os.listdir(files_directory):
        if f.endswith(".gpx"):
          files.append(f)
      files.sort()
      return files

It returns something like this:

[
    "2016-01-15 17-43-20.gpx",
    "2016-01-15 18-34-15.gpx",
    "2016-01-16 21-36-19.gpx",
    "2016-01-16 21-48-17.gpx",
    "2016-01-16 22-58-56.gpx",
...]

So my frontend does a request to that endpoint and gets the names of the files. But I need to still access the files.


texts: Creating bulk field aliases for several layers within same ArcSDE feature class using ArcPy?

texts: I have an ArcMap with ~200 layers from the same sde feature class.  After I finished adding all the layers it was brought to my attention that we need to add field alaises for the attribute table.  Does any one have a python script that will loop through all the layers in a map and add the aliases?


texts: PyQGIS script no longer works without giving errors

texts:
I am new to using PyQGIS.
I wrote the following script that initially worked, now instead it runs gdal_translate and then stops, doesn't run the raster calculator, without returning any errors.
If I change the output format of the raster calculator from .jp2 to .tif then it executes it.
Anyone have any idea why?
I'm using QGIS 3.16
import gdal
import gdalconst
import processing

#Inputs
S2_B2_10m = "D:\...\T32TLR_20201031T103201_B02_10m.jp2"
S2_B3_10m = "D:\...\T32TLR_20201031T103201_B03_10m.jp2"
S2_B5_20m = "D:\...\T32TLR_20201031T103201_B05_20m.jp2"

#Intermediary outputs
S2_B2_20m = "D:\...\T32TLR_20201031T103201_B02_20m.jp2"
S2_B3_20m = "D:\...\T32TLR_20201031T103201_B03_20m.jp2"

#Pre-processing
gdal.Translate(S2_B2_20m, S2_B2_10m, xRes=20, yRes=20, resampleAlg=gdalconst.GRA_Cubic)
gdal.Translate(S2_B3_20m, S2_B3_10m, xRes=20, yRes=20, resampleAlg=gdalconst.GRA_Cubic)

#Snow detection
NDSI = "D:\...\T32TLR_20201031T103201_NDSI.jp2"
parameters = {'INPUT_A' : S2_B2_20m,
        'INPUT_B' : S2_B5_20m,
        'BAND_A' : 1,
        'BAND_B' : 1,
        'FORMULA' : '((A-B)/(A+B))',
        'OUTPUT' : NDSI}

processing.runAndLoadResults('gdal:rastercalculator', parameters)


texts: OpenLayers 3: get the osm_id of the closesd point

texts:
Is there a way to get osm_id of the point that is closest to a given coordinate.

The idea is to click on map and get the osm_id

 map.on('click', function(event) {
      window.alert(event.coordinate);
 });


texts: Deleting multiple features easily in QGIS

texts:
I have a vector layer being rendered in QGIS.
I want to delete various features in the layer. I'm currently deleting each node by selecting the node through node tool and then pressing the delete button.
But I want to delete very large portions in the map. Using this method will cause a lot of time.
Is there any other method where I can draw a polygon around the feature which needs to get deleted and delete them easily?


texts: Copy Table Failing with ERROR 000732 in ArcPy?

texts:
Very new to Python. I am trying to copy between Feature Datasets, Feature Classes, and Tables between two GDBs. Here's my code:

The following attempt works when Irfan_FC is a feature class:

#Copy Feature Class [Works]
gp.CopyFeatures_management(r"C:\path\_FGB.gdb\Irfan_FC", r"C:\path\OUTPUT\db_output.gdb\Irfan_FC")

The attempt fails when IrfanTable1 is a table:

#Copy Table [Fails]
gp.CopyFeatures_management(r"C:\path\Irfan_Simple_Input_TBL.gdb\IrfanTable1", r"C:\path\OUTPUT\db_output.gdb\IrfanTable1"

ERROR 000732: Input Features: Dataset C:\AGOL_Backup\Data\Irfan_Simple_Input_TBL.gdb\IrfanTable1 does not exist or is not supported

Eventually, this code will copy from a flat GDB (no datasets) into a target GDB which will have datasets but right now I will be happy to copy just tables.


texts: How to produce a 'count' of points intersecting lines?

texts: Within ArcMap, I have a point dataset representing accident data, and a road dataset. My goal is to attribute the road dataset with a count of how many particular accidents occured on each road segment. I can't however figure out how to produce a count of point/line intersections. I have tried a spatial join using 'one to many', however this doesn't produce a count, just multiple lines for a road with more than one accident. I've also tried a intersect, however ArcMap has told me this is not possible.


texts: Migration from .gdb to .mdb - how to change automaticly all querys at MXD from " " to [ ]?

texts:
after migration from File Geodatabase (.gdb) to Personal Geodatabase (.mdb) - how to change automatically all field names at query definitions at the MXD from " " to [ ]

What's else is important when conducting such transition ? I'm using version 10.1 sp1 and I have a MXD with dozens layers and dozens of queries, also at the symbol classes of the labels there are even more SQL syntax to change.

Thanks in advance!


texts: What causes the Leaflet JS Providers error; Uncaught Error: No value provided for variable {time}

texts:
I am using leaflet providers and attempting to add the NASAGIBS.ViirsEarthAtNight2012 to my layer control, my other basemaps load fine; but this one doesn't and returns the following errors in the console.  What could cause this?

Code Sample;

$(document).ready(function() {

    var aLayerOne = L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
        attribution: '&copy; OpenStreetMap, Tiles courtesy of Humanitarian OpenStreetMap Team'
    });

    var aLayerTwo = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
        attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'

    });

    var NASAGIBS_ViirsEarthAtNight2012 = L.tileLayer('http://map1.vis.earthdata.nasa.gov/wmts-webmerc/VIIRS_CityLights_2012/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}',{
    attribution: 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.'
    });

    var map = L.map('myMap', {
        center: centerlatlng,
        zoom: 4,
        layers: [aLayerOne],
        //maxBounds: bounds

    });

     markers = L.markerClusterGroup();

    var points = L.geoJson(geojsonfeatures, {
        onEachFeature: function(feature, layer) {
            layer.bindPopup(feature.properties.Destinatio);
        }
    });
    markers.addLayer(points);

    var promise = $.getJSON('js/weatherstations.js');
    promise.then(
        function(response) {
            console.log('promise success handler', response);
            var geojsonLayer = new L.GeoJSON(response);
            geojsonLayer.addTo(map);
        },
        function(error) {
            console.log('promise error handler', error);
        }
    );

    // Add a Layers Control
    var baseMaps = {
        "Humanitarian Open Street Map": aLayerOne,
        "Esri Imagery": aLayerTwo,
        "Night Vision": NASAGIBS_ViirsEarthAtNight2012,
    };

    var overLays = {

        "Destinations": markers

Uncaught Error: No value provided for variable {time}(anonymous function) @ leaflet.js:6o.Util.template @ leaflet.js:6o.TileLayer.o.Class.extend.getTileUrl @ leaflet.js:7o.TileLayer.o.Class.extend._loadTile @ leaflet.js:7o.TileLayer.o.Class.extend._addTile @ leaflet.js:7o.TileLayer.o.Class.extend._addTilesFromCenterOut @ leaflet.js:7o.TileLayer.o.Class.extend._update @ leaflet.js:7s @ leaflet.js:6o.Mixin.Events.fireEvent @ leaflet.js:6o.Map.o.Class.extend.invalidateSize @ leaflet.js:6(anonymous function) @ leaflet.js:6o.Util.bind @ leaflet.js:6


texts: ArcPy ExtractValuesToPoints from raster with select by attribute

texts:
I'm trying to extract values from different rasters to a selection of points. So I try to iterate through each raster and for each extract the values and join, append them to a set of points, which are changing for each iteration. I do not understand why it does not work.
I figure I can't call the selection layer to copy it. Do you see any obvious mistakes?
I do not have the error messages but different happened, one being that the selected layer"sel_points_lyr" does not exist. I've tried to make feature layer and all different clumsy variants but I'm lost.
Here's the code:
"alpha" is a field name of the point FC on which I want to select points that match a part of the iterated raster name.
arcpy.env.workspace = r"C:\home\in_rasters.gdb"
# Workspace, variables
Points = r"C:\home\input_points.gdb\points"
tmp_workspace = r"C:\home\temp.gdb"
joined_fc = r"C:\home\results.gdb\points_all_joined"
sel_points_fc= r"C:\home\input_points.gdb\points_sel"

arcpy.env.overwriteOutput = True

listRa = arcpy.ListRasters("*","")
for raster in listRa:
    where_clause= "alpha= '" + str(raster[16:24])+ "'"
    sel_points_lyr= arcpy.SelectLayerByAttribute_management(Points, "NEW_SELECTION", where_clause)
    arcpy.CopyFeatures_management(sel_points_lyr, "sel_points_fc")
    tmp_points= os.path.join(tmp_workspace, 'points_tmp' +raster[16:24])
    ExtractValuesToPoints(sel_points_lyr, raster, tmp_points, None,"VALUE_ONLY")
    arcpy.Append_management(tmp_points, joined_fc, "TEST")


texts: Use QGIS expressions to create geometries: difference between geometry generator and geometry by expression

texts:
QGIS has a powerful expression machine that can be used (between other things) to create new geometries, based on existing layers. Basically, there are two options: Geometry generator and Geometry by expression. What is the difference between these two options?
Remark: this question is a case of

you’d like to document [a question] in public so others (including
yourself) can find it later

As I often answer questions that involve creating geometries using expressions, I always have to repeat some basics. I think it's better to have the relevant information in a separate post that can be referred to keep answers shorter. Feel free to add further answers with additional information.


texts: How to get a composer label by ID with Python in QGIS?

texts:
I have a script that was working, where I was able to grab a composer label by its ID and then update its text by doing the following:

labelTitle = myComposition.getComposerItemById('pageTitle')
labelTitle.setText('New Title')

But after updating to the latest version of QGIS, it looks like labelTitle is coming back as a QgsComposerItem type instead of QgsComposerLabel, so it is throwing the error 'QgsComposerItem' object has no attribute 'setText'

Is there a way to cast it as a label, or am I missing something? Or is there an entirely better way to accomplish this?


texts: What is the equivalent coordinates of returned extent and coordinate of ol4 dragbox

texts:
When I tried to console the result of dragbox coordinates it returns an 2d array.   What is the meaning of coordinates returned?

I need to get the points to use it in SQL and make a polygon.

Index 0 is minx and miny and what about the others?

dragBox.getGeometry().getCoordinates()
0:[13466767.761325281, 1601017.3688731098]
1:[13466767.761325281, 1601011.3225847394]
2:[13466776.737450918, 1601011.3225847394]
3:[13466776.737450918, 1601017.3688731098]
4:[13466767.761325281, 1601017.3688731098]


texts: MariaDB vs Postgres (POSTGIS) perfomance difference?

texts:
Has anyone used mariaDB for storing spatial data?
I am using postgis now.
My queries are mostly "finding peope within certain radius".
Happn app an app which shows you "the people you crossed path with in real life"  seems to be using MariaDB in their stack.Should I move to MariaDB for perfomance?


texts: How to convert JavaScript array into geoJSON data?

texts:
I want to upload txt, xls and csv files into leaflet. Firstly I am trying it for txt files. Js reads my txt as a js array. Now that I want to convert my js array into geoJSON. But I am confused here. I need some clue about which way should I follow.

$(function () {
        document.getElementById('file').onchange = function () {
            debugger;
            var file = this.files[0];
            var reader = new FileReader();
            reader.onload = function (progressEvent) {
                // Entire file
                console.log(this.result);
                // By lines
                var lines = this.result.split('\n');
                var list = [];
                for (var line = 0; line < lines.length; line++) {
                    list.push(lines[line]);
                }
            };
            reader.readAsText(file);
        };
    });


texts: Migrating data from ArcSDE to SQL Server Spatial Database

texts: I am looking for a process or a tool that would allow me to migrate data from an ESRI SDE Database to a SQL Spatial Database. This would include converting the ESRI geometry to SQL geometry types, as well as potentially having to convert ESRI domains to lookup tables. I have seen some tools out there that will take shapefiles and convert them to SQL spatial format and I have been successful in doing that but given the amount of data and how dynamic it has been, I would prefer to not have to convert my entire database into shapefiles first. Would it be easier to go from a File/Personal geodatabase?


texts:
I am really new to the OSM query language and I want to know how to find the relation id from the area id.

Here is the query that I made:

is_in(45.5697, 3.1572);
foreach(area._["boundary"~"(administrative|national_park)"];out ;>;out;);


texts: Arcpy search cursor and update cursor to write values from table A to table B

texts:
I'm a python beginner.

I`m working with ArcGIS 10.2.2 and IDLE Python 2.7.5

I have two tables, table A (top) and table B.

I need to read the attributes for the A-table fields for the selected record and write the fields and their attributes to all rows of the B table. I need the same attribute information for each row the fields.

I'm working with something like this

   with arcpy.da.UpdateCursor(fc2, field3) as cursor:
        for row in cursor:
            row[0] = 'Q'
            cursor.updateRow(row)
    with arcpy.da.UpdateCursor(fc2, field4) as ucursor:
        with arcpy.da.SearchCursor(fc2, field5) as scursor:
            for srow in scursor:
                sval = srow[0]
                urow = ucursor.next()
                urow[0] = "0" + sval.replace("-", "")
                ucursor.updateRow(urow)


texts: Loading Cloud Optimized GeoTIFF in ArcGIS Pro

texts:
Esri claim to support Cloud Optimized GeoTIFF (COG) this, but I can't find anything on the Esri site or elsewhere about how you actually do this.
My approach to date in QGIS has been Route 1 - add raster layer, select Protocol as the source type and then plug in the URL. I am using URLs from OpenAerialMap.
This works fine in QGIS.
Trying something similar in Pro:
Add Data -> Add from Path. Trying with and without the /vsicurl/ prefix yields nothing but errors.


texts: Why transforming .vrt to .tif considerably increases size of raster?

texts:
I have a .vrt file that references (i.e. was created based on) five .tif files (whose sizes are 1.3 MB, 2.7 MB, 330 MB, 4 MB and 2.7 MB). These files represent a Digital Elevation Model (DEM), where the third file is the most general file and the other 4 are refinements of the channel of the river draining the area.

I want to get a .tif file from the .vrt file, but when i do this i get a 4.5 GB file, which for me is excessively large compared to the original .tif files.

I double checked the pixel size and all files (including the .vrt and the output .tif) have the same resolution.
All of them have the same data type (Float 32).
All .tif files have the same coordinate system (EPSG 29193), but the .vrt file has a User defined projected CRS. The .vrt file was created using Ras Mapper from (HEC-RAS).

Does anyone know why exporting the .vrt file increases the file size so much?

and

What could i do to reduce/compress the output .tif file?

I exported the .vrt to .tif using QGIS 3.6 and would prefer to stick to this software to find a solution.

Am now trying to export the output .tif from the original .tifs, however, i still want to understand what may be the issue transforming .vrt to .tif.


texts: Getting number from QLineEdit and passing it to buffer function in PyQGIS?

texts:
I am developing a plugin which finds buffer. In that i am using lineedit for getting distance from the user and pass it to the buffer function. My current code throws an error "'QLineEdit' object has no attribute 'Value'. I had also attached my code for reference.

 def run(self):
    """Run method that performs all the real work"""
    # show the dialog
    self.dlg.show()
    # Clear the QcomboBox before loading layers
    self.dlg.Statecombo.clear()
    self.dlg.Citycombo.clear()
    self.dlg.DistancelineEdit.clear()
    layers = self.iface.mapCanvas().layers()
    for layer in layers:
        if layer.type() == QgsMapLayer.VectorLayer:
            idx = layer.dataProvider().fieldNameIndex( 'name_1' )  #this field contains state names
            uv = layer.dataProvider().uniqueValues( idx )

            """Adding the state names to the combo box"""
            for i in uv:
                if i:
                    self.dlg.Statecombo.addItem(str(i))

            QObject.connect(self.dlg.Statecombo, SIGNAL("currentIndexChanged(int)"), self.findTheCityNames)
            QObject.connect(self.dlg.Citycombo, SIGNAL("currentIndexChanged(int)"), self.calcDistance)

# Run the dialog event loop
    result = self.dlg.exec_()
    # See if OK was pressed
    #if result:
    if result:
        distance = self.dlg.DistancelineEdit.value()
        new_distance = distance
        number = self.dlg.number_buf.value()
        QgsGeometry.buffer(new_distance , 2)
        pass

def findTheCityNames(self):
    self.dlg.Citycombo.clear()
    ct = self.dlg.Statecombo.currentText()
    st = "name_1='"+ct+"'"
    exp = QgsExpression(st)
    fidAndVal = {}
    #QMessageBox.information(self.iface.mainWindow(), "info", st)

    layer = self.iface.activeLayer()

    iterFeat = layer.getFeatures()

    for f in iterFeat:
        val = exp.evaluate(f)
        if bool(val):
            attrs = f.attributes()
            idx = layer.fieldNameIndex('name')
            cityName = f.attributes()[idx]
            fidInt = f.id()
            fidAndVal[fidInt] = cityName

    for x in fidAndVal.keys():
        self.dlg.Citycombo.addItem(fidAndVal[x])

def calcDistance(self):
    pass


texts: Convex Hull operation not specific enough

texts:
I have yield data as point values, and I simply want to create the boundary around this layer. I have used the Minimum Bounding Geometry tool and selected Convex Hull to do this, however it maintains the corners as part of the polygon. Is there a way to automatically keep just the boundary of this file? Pictures below.

Here's the point file:

Here's what Convex Hull gives me:

And here's what I need to automate:


texts: SMOS time series and export to CSV in GEE

texts:
I'm new to Google Earth Engine.

I'm trying to create a time-series of SMOS for a point. I have selected the coordinates of the point and am now trying to export the table as a .csv.

My script so far is:

var collection = ee.ImageCollection("NASA_USDA/HSL/soil_moisture").select('ssm');

// Define a region of interest as a buffer around a point.
var geom = ee.Geometry.Point(40.44, 3.12).buffer(500);

// Create and print the chart.
print(ui.Chart.image.series(collection, geom, ee.Reducer.mean(), 30));

// Export the time-series as a csv.
Export.table.toDrive({collection: ssm, description: 'mandera',
  selectors: 'date, value', fileFormat: 'CSV'});

I know I'm very close to what I need but I can't seem to be able to figure out how to export the timeseries as a .csv file in my Drive. Also, how can I name the file so I find it once it's exported?

I have seen the answer to this:
Create time series and export it to csv GEE
But I think I might be missing a step...


texts: Making Qt designer form annotations show up in print composer?

texts:
Firstly, I am a QGIS novice, and even less so with QT Designer. I was able to figure out how to use QT Designer to make a QGIS Form Annotation. It sync's well with my data, but I have a problem with the form annotation showing up in QGIS Print Composer.

The Text, SVG, and HTML Annotations all show up in the print composer map, but the QT Designer form annotation does not. The first attached image shows the form annotation displays on the main QGIS screen along with the other three default annotation types. The second image show all except the QT Designer form annotation showing in QGIS print composer. I tried to research the issue online but have not come across any resolution.

Can anyone identify the problem and fix?

QGIS Main Screen

QGIS Print Composer


texts: How to remove a specific unique value with arcpy

texts:
using arcpy, i would like to remove,from 50 mxd files, a specific unique value called "residence a" (exist in 3 layers) from the table of content.

so i will get this result:

The value of "residence a" is "70" in the attribute table (in field named "YEUD")

When i use this code:

import arcpy,os,sys
from arcpy import env

env.workspace = r"C:\Project"
for mxdname in arcpy.ListFiles("*.mxd"):
    mxd = arcpy.mapping.MapDocument(r"C:\Project\\" + mxdname)
    df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
    lyr = arcpy.mapping.ListLayers(mxd, "*")[0]
    if lyr.symbologyType == "UNIQUE_VALUES":
        vals = lyr.symbology.classLabels
        for v in vals:
            if v == "residence a":
                print mxdname
                print lyr.name
                print ("1 in layer " + lyr.name)
                arcpy.mapping.RemoveLayer(df, v)
    mxd.save()
del mxd

i get en error:

>>>
Project -.mxd
mig1
1 in layer mig1

Traceback (most recent call last):
  File "C:/Users/yaron.KAYAMOT/Desktop/remove UNIQUE_VALUES in lyr.py", line 18, in    <module>
    arcpy.mapping.RemoveLayer(df, v)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\utils.py", line 182, in fn_
    return fn(*args, **kw)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\mapping.py", line 1845,     in RemoveLayer
    assert isinstance(remove_layer, Layer)
AssertionError
>>>

For disclosure, i asked this question in https://geonet.esri.com/thread/158715


texts: I calculated a trail up mountain using least cost path analysis. I converted the raster trail to a polyline using the raster to polyline. I then used the feature vertices to points (input being the polyline), and i then used the extract multivalues to points where my 2 rasters were slope and elevation for the trail points. SO what I have now is a points layer with unique ids that have slope and elevation data for each record. I can drape the points layer over my elevation DEM in ArcScene but I want to be able display the trail with a polyline over the DEM. I know you can convert points to line but the output is just one id for the line so I cannot accurately display the trail in a line.


texts: Selecting different colors for touching polygons in random color ramp in QGIS?

texts:
I am making a map of Africa in QGIS.
The colors selection is randomly, but I need to make sure there are no two similar colors for polygons that are touching each other lake Egypt and Sudan.

I have tried to change the setting in the color ramp selection, but it did not yield any results. Is there a way to set the setting so there will not be two similar colors one next to each other?


texts: How to Import another Py file to Qgis Plugin?

texts:
i tried to import another py file to Current plugin in qgis  but its showing No module named 'ProgressDialog'
both files in same directory
Plugin Code:
from qgis.PyQt.QtCore import (QSettings, QTranslator, QCoreApplication,Qt)
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QProgressBar,QDialog
from qgis.core import QgsProject,QgsVectorFileWriter,Qgis
from .resources import *
# Import the code for the dialog
from .SplitLayerByAttribute_dialog import SplitLayerByAttributeDialog
import os.path,itertools
import PrograssDialog

PrograssDialog.py:
from qgis.PyQt.QtWidgets import QDialog

class PrograssDialog():
    def ShowDialog(self):
        self.Pd=QDialog()
        self.Pd.show()

How to Import another Py file to Qgis Plugin ?


texts: Active Directory Permissions for ArcGIS Enterprise

texts:
I am trying to use our Windows Active Directory to update the Identity Store on ArcGIS Portal (v 10.7.1) and am having trouble getting it to work with a non-admin user.

When we try to update the identity store using the Windows Active directory as described in the ESRI documentation it fails and posts this error to the log:

   Could not connect to the identity store as one or more of the connection parameters is incorrect. Verify that you can connect to the identity store outside of ArcGIS Server using the same parameters.javax.naming.AuthenticationException:
    [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042A, comment:
    AcceptSecurityContext error, data 52e, v3839].
    AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042A, comment: AcceptSecurityContext error, data 52e, v3839]

We were successful in updating the identity store when using a user with domain admin credentials - but we're not willing to use those credentials in a production situation.

I am wondering if anyone else has encountered this problem while setting up their instance of ArcGIS Enterprise/Portal.  It appears to be an issue specific to the ESRI requirements for integrating Active Directory to Portal.  I am trying to determine the what permissions are required by ESRI so we can get the user configured properly.


texts: How to change attributes values in a memory layer?

texts:
i want to change attributes values in a memory layer.

I already asked a similar question but i'm re-stuck on the problem and don't find any solution to this basic need.

Here is what i'm doing so far :

from PyQt4.QtCore import *
from PyQt4.QtGui import *

vl_r=QgsVectorLayer('Polygon?crs=epsg:2154','population','memory')
pro_r = vl_r.dataProvider()

pro_r.addAttributes([QgsField("name", QVariant.String)])
pro_r.addAttributes([QgsField("pop", QVariant.Int)])

vl_r.updateFields()

QgsMapLayerRegistry.instance().addMapLayer(vl_r)

fet = QgsFeature()
dummy=pro_r.addFeatures([fet])

print(pro_r.capabilitiesString())

attrib={0:'hell',1:666}
dummy=vl_r.dataProvider().changeAttributeValues({fet.id():attrib})
print('Change values : ' + str(dummy))

The value returned by 'dummy' is always True but i never see any change in the attributes table.

When i use a 'normal' layer (stored on disk) the change is made and is immediately visible without any additional command.

What could i be missing ? My code is so simple that i can't see what i forgot ...

Could anybody give me a working sample of attributes change in a memory Layer ?


texts: Dynamic Rendering of tiles as per custom selected options

texts:
Cartida is one of the best Customize map providers.
https://www.cartida.com/global/map/

On Cartida, you can choose, whatever color of roads you want, whatever building color you want and so many other features. So, on each change of option, they call to a service, something like
https://maps.cartida.com/cartida/map?style=cartida&width=1205&height=850&bbox=8262171.608849932,3689647.5481946995,8292984.162073471,3711382.544244499&webmerclevel=12&boost=1&scalefactor=1.8179293857353394&colors=water:0x9BBCD9|land:0xffffff|objects:0x7a1f1f|buildings:0xffffff|background:0xFFFFFF&show=roads,road_details,water,landuse

How can I make a customizable map like this for my own area of interest? Let's say I have osm data for a city, and want to create a webapp that can provide such customization for layer on/off or color change etc.


texts: How to draw a shapefile over GeoTIFF geometry to a PNG

texts:
How I can to draw using GDAL in python or c a polygon shapefile shape.shp with a GeoTIFF as background background.tiff file?

Both files are in the same projection.

The result could be a PNG, JPEG or whatever.  To clarify I'm going to put screen shoots of the done with QGIS. First one is the shapefile, second the GeoTIFF, and finally the union.


texts:
I've been trying to draw maps using the d3.js library in a manner similar to that below.

<script>
        //Width and height
        var w = 500;
        var h = 300;

        //Define path generator
        var path = d3.geo.path();

        //Create SVG element
        var svg = d3.select("body").append("svg").attr({width:w, height: h});

        //Load in GeoJSON data
        d3.json("us.json", function(json) {

            //Bind data and create one path per GeoJSON feature
            svg.selectAll("path")
               .data(json.features)
               .enter()
               .append("path")
               .attr("d", path)
               .attr("fill","#666666");

        });

    </script>

All this stuff works absolutely FINE for the tutorial's US maps, the geojson he uses is spot on for this d3 library.

The steps I took to get my own dataset as I wanted UK's regional maps.

Download shape files from Ordnance Survey website
Attempt at converting files to geojson using sites such as mapshaper.org (worked, displays on their site
Using my own geojson files to draw the map.

Something draws, my file is in the right format but the whole map is drawn based on my fill colour. It's almost as if the coordinates are not correct. Naturally they won't be in the correct format.

Here is my shapefile open in mapshaper : http://i.imgur.com/lz40BDn.png

The GeoJson that works : filedropper.com/us
The GeoJson that doesn't work : filedropper.com/regionsgeo

I've attempted at using json parsers to compare the structures of both and they do seem very similar. With the exception that there are many more extra features on the regions json file but that seems to be something that mapshaper generates.

Does anyone have an idea why map isn't rendering as it should? Could it be something to do with the coordinates system my json is using compared to that required by d3.js? Have I missed some steps that I should have undertaken to convert the shapefiles?


texts: Rule-based labeling and the Data defined placement options are not working together (QGIS 2.12, 2.14)

texts:
After setting "Rule-based labeling" to my layer (new feature since QGIS 2.12), my data defined labeling is not working any more (see labeling tools on the right side):

Going back to "Show labels for this layer", it works fine (see labeling tools on the right side):


texts: Get lat-long of US cities and plot them on a map using matplotlib and basemap

texts:
I am hosting a conference and want to show a map of where the attendees have arrived from. I have an input file with the names of the cities. I would like to put a dot on each city, and have the size of the dot be proportional to the number of attendees. My input looks like this:
Chicago 10
Philadelphia 20
New York 5
San Francisco 25

I would like to do this with Python, which I believe means I should be using matplotlib and basemap. I have found sample code that has shapefiles for the US, but it's not clear to me how to get the lat/lon data US cities.
Do I have to implement this all from scratch?


texts: Assigning XS Cut Line Attributes like River/Reach Name, Stationing, Bank Lines, etc?

texts:
I'm working on a flood inundation project as my research study of my course. I am now assigning XS Cut Line Attribute (after constructing the XS Cut Lines) in HEC-Georas > RAS Geometry > XS Cut Lines Attribute > ALL  :: (All Cross-Section Tools). Upon the pop-up of the All Cross-Section Window it appears like the picture below.

But when I enter "OK" button, an error occurs

and I enter again, the error looks like this:

Here is the screenshot of my project.


texts: How can I solve 'Handle bad layers' error when using OpenStreetMap in Qgis?

texts:
I can easy download Portion of maps from OpenStreetMap, save them etc. Once I reopen the same map I get a message that says "Handle bad layers" for all the OSM files.

What I am doing wrong?


texts: request at the endpoint of the overpass-api? - with python

texts:
we have with Overpass API python wrapper a thin Python wrapper around the OpenStreetMap Overpass API [url]https://github.com/mvexel/overpass-api-python-wrapper[/url]

we have some Simple example:

import overpass
api = overpass.API()
response = api.Get('node["name"="Salt Lake City"]')

Note that we don't have to include any of the output meta statements. The wrapper will, well, wrap those. we will get our result as a dictionary, which represents the JSON output you would get from the Overpass API directly.

print [(feature['tags']['name'], feature['id']) for feature in response['elements']]
[(u'Salt Lake City', 150935219), (u'Salt Lake City', 585370637), (u'Salt Lake City', 1615721573)]

we an specify the format of the response. By default, we will get GeoJSON using the responseformat parameter.Alternatives are plain JSON (json) and OSM XML (xml), as ouput directly by the Overpass API.

response = api.Get('node["name"="Salt Lake City"]', responseformat="xml")

**question:**can we also get cvs - can we perform a request like below with the python wrapper to the endpoint of overpass turbo?

[out:csv(::id,::type,"name","addr:postcode","addr:city",
"addr:street","addr:housenumber","website"," contact:email=*")][timeout:30];
area[name="Madrid"]->.a;
( node(area.a)[amenity=hospital];
  way(area.a)[amenity=hospital];
  rel(area.a)[amenity=hospital];);
out;

well - how to use the above metioned overpass-turbo-request at the endpoint of the overpass-api?

The wrapper returns a dictionary, so if we want something like the CSV output we are looking for, we need to create that from the dictionary that the request outputs.

btw: {{geocodeArea:*}} is not a native Overpass syntax, we should use an area ID.

The request we could feed into the Get method would be something along the lines of:

area(3601744366)->.a;
(node(area.a)[amenity=hospital];
way(area.a)[amenity=hospital];);
(._;>;);


texts: Software program (or spreadsheet calculations) to find Borehole Deviation?

texts: I was given a bunch of surveyed borehole data (azimuth, depth, dip, geology, etc) and am required to calculate a deviation variable. Besides querying the data and averaging the surveyed borehole results, I was wondering if anyone had any specific calculations or recommended software programs in order to calculate a deviation variable and to visualize it in a 3D view around a planned borehole?


texts: FeatureCollection 'union' in Google Earth Engine doesn't consider all Features

texts:
Ultimately, what I am trying to do is calculate overlap between (1) polygons of a species' range and (2) polygons of Protected Areas. There can be multiple overlapping polygons for the range (e.g. breeding vs. non-breeding range), so I simply want to perform a union such that there is just one Feature made up of multiple polygon geometries (with no overlaps). I tried the following:

var spRange = ee.FeatureCollection('users/rasenior/Necrosyrtes_monachus');
var rangeUnion = ee.Feature(spRange.union().first());

But when this is mapped as follows:

Map.addLayer(spRange, {color: 'blue'}, 'original');
Map.addLayer(rangeUnion, {color: 'green'}, 'union');

It seems that the union is only a sliver of one tiny section of the overall range. Why?

Possibly related: I've encountered a lot of problems for this particular species, which I think might be due to the geometry becoming messy when I upload to GEE. Specifically, one of the features becomes a GeometryCollection, containing both LineStrings and Polygons. I have no idea why, nor how to remove the LineStrings (or convert them to Polygons?).

Script here:
https://code.earthengine.google.com/?scriptPath=users%2Frasenior%2Ftest%3AgetSpRange

UPDATE 1: it's nothing to do with the weird geometry. I have now resolved that issue (use 'users/rasenior/Necrosyrtes_monachus_fix') such that all geometries are Polygons or MultiPolygons. But, alas, a union of the FeatureCollection still results in the sliver seen in the screenshot.

UPDATE 2: now that the FeatureCollection is free of weird geometries I was able to export it as a shapefile to inspect in ArcGIS. The FeatureCollection is made up of four Features, and the green sliver in the screenshot corresponds to the fourth of these. I don't know why this is the only thing being returned by union. All I can say is that the fourth Feature is the only one with a Polygon geometry, whereas the other three Features have MultiPolygon geometries.


texts:
if i have obtain GPS coordinates as Latitude/Longitude, then i need to convert them to XY coordinates, i see this link

actually i need to get the Trilateration , in its equation i need the XY coordinates from GPS coordinates.

i need obvious and clear equation for conversion.

also how the conversion will be if i assume there is reference node !!

my application is :

i need to make Trilateration for sensor nodes and in the middle of the there is pc which get positions of nodes(depends on gps) then pc can calculate its position depend on Trilateration. So  Trilateration equation  use XY rather than lat/lon ?? can we use the pc as reference node to conversion.


texts: I'm trying to work with lots of layers and each one of them need a different click action but, with all my layers this code is starting to get confuse and messed up. I found out that in Open Layers 2 there was a way to add "on-click" action directly to a layer. It's possible to do the same with Open Layers 3? If it is, there's some example?


texts: Removing repeats in Chart symbology in ArcGIS Pro

texts:
I want use Chart Symbology for my dataset but there are repeats in the chart symbology when I export the map. Pics show what I want and see in Layout view VS the repeat pie charts after I export.
How do I avoid/remove them?


texts: Save camera positions 3D (Local Scene ArcGIS Online)

texts:
I have a relatively large local scene in ArcGIS Online where I use the slides to make it easy for others to switch between many alternatives, with its unique roads, constructions and terrain model.

But many of the users would like to save their own camera positions. (I'm using the Web AppBuilder.)

Is there any way to do this? In 2D view it is possible to save bookmarks, but not in 3D.


texts: Should I use a CMS for my web mapping application?

texts:
For my web mapping app, I am using GeoServer as server, PostGIS as spatial DB and OpenLayers on client side (as well as other JS libraries). The map is composed of base maps and vector layers. One of these vector layers is the "Public institutions" layer. For each category of institutions (Ministries, Tribunals...) there are persons (I called them "contributors") responsible for editing data (Tel, fax, location on map...) about these institutions. The contributors are managed by an admin who specify the privileges of each one of them. Some modifications of the contributors need to be validated by the admin (for example deleting an institution)...

So I thought maybe using a CMS would help. What do you think?

There are some CMS like Drupal that integrates OpenLayers, but it seems the project is still in development link to project page. Any alternative or experience to share?


texts:
I've been doing some research on using R to datamine twitter, but I haven't really found an answer or a decent tutorial for my question.

I'm interested in pulling tweets from twitter with a certain hashtag, within a certain timeframe, and plotting the location of those tweets on a map in either QGIS or ArcMap.

I know that tweets can have geolocation tied to them, but how do I extract this information in the first place?


texts: Can Gdal.Translate() return an object instead of writing a file?

texts:
I have some Python GDAL code I am using to convert a GeoTIFF file to PNG. The code uses the gdal.Translate() function which generates a new file each time I run it. However, I was wondering if there is a way to get the Python gdal.Translate() function to return a python object instead of writing a file? Ideally I would like to write to a numpy array or something, but any kind of internal object would be fine.

Here is some sample code I am using:

from osgeo import gdal

scale = '-scale min_val max_val'
options_list = [
    '-ot Byte',
    '-of JPEG',
    scale
]
options_string = " ".join(options_list)

gdal.Translate('test.jpg',
               'test.tif',
               options=options_string)

I looked over the documentation and source code to figure out how gdal.Translate() worked, but could not get past the TranslateInternal() function. I could not find a link through the source code past that.


texts: Adding point features by machine learning in QGIS 3.16

texts: I've got several georeferenced traditional maps and there are circles on it. (these are the studied points) So I want to add point features to the middle of the circles. I could do it manually, but I wonder 'bout that’s possible by machine learning and if it does how.


texts: Problems intersecting large polygon shapefiles in QGIS (V2.18.2)

texts:
I am using the BirdLife International .gdb file (polygons) of bird species distributions to try and make a species richness map across the Brazilian Amazon. To do this I have clipped the global distributions file to my study area. I have also created a hexagonal grid of my study area.

My method so far has been to intersect these two layers to split the distributions into the hexagonal grid cells. From this I am getting the polygon centroids and counting the number of points in each of the original hexagon cells. This has already worked for the IUCN mammal and amphibian shapefiles.

However, when I try to intersect the birdlife distribution layer with the hexagonal cells I get an invalid geometry error even though I have validated the geometries using the QGis Validate geometries tool, and removed invalid geometries.

  error invalid geometry detected in input layer A, feature 42

I have also tried checking the geometries in ArcMap10 and they appear to be valid. The problem also continued after deleting the features the error message highlighted.

Is there a method that would avoid this error or would solve this problem?


texts: How to use pgsql2shp when PostGIS extensions installed in a separate schema as geometry

texts:
I have the PostGIS extension (postgis functions and spatial_ref_sys table) added to a specific schema called postgis. I'm wanting to run the pgsql2shp utility with a select query on geometries stored in other schemas that do not have postgis functions available within their respective schemas.

Normally from psql I would first set the search path to contain both the postgis schema and the schema with the tables I'm querying on, but I'm having trouble figuring out how to do the same thing with the pgsql2shp utility. How would I go about setting a search path or having it look in multiple schemas so it picks up the postgis functions?

Example Query (field_polygons is in different_schema):

pgsql2shp -f shapefile -h localhost -u user -P password gisdb "SET search_path TO postgis, different_schema; SELECT the_geom FROM field_polygons WHERE id = 1"

Results in error:

ERROR:  function postgis_version() does not exist
LINE 1: SELECT postgis_version()


texts: Use ArcPy to identify annotation reference scale?

texts:
I would like to retrieve the value of an annotation feature class reference scale using ArcPy (under ArcGIS 10.1).

I cannot find where this property is stored (tried to access using the describe object, but it doesn't seem to be there).

The aim is an ArcPy-batched run of the "Append Annotation Tool". This tool holds the Reference Scale as one of the required parameters.

For one class, I can look it up (in the source class properties)
For many classes, I would rather batch the process with ArcPy i.e. Provide all annotations as input classes, and read the value of that reference scale for each of them, then reuse this value as a parameter in the Append process. The reference scale is easily accessed in programming, so I was hoping it is accessible one way or another via ArcPy.

What do you think?


texts: Rasterio RGB band combo results in black TIFF

texts:
I am trying to to compose a RGB .TIFF image using rasterio with bands that I've downloaded from sentinel-2 (via sentinelsat). The resulting image is black.

import rasterio

# Open Bands 4, 3 and 2 with Rasterio
R10 = 'S2B_MSIL2A_20190605T100039_N0212_R122_T33TTG_20190605T143319.SAFE/GRANULE/L2A_T33TTG_A011731_20190605T100530/IMG_DATA/R60m'
b4 = rasterio.open(R10+'/T33TTG_20190605T100039_B04_60m.jp2')
b3 = rasterio.open(R10+'/T33TTG_20190605T100039_B03_60m.jp2')
b2 = rasterio.open(R10+'/T33TTG_20190605T100039_B02_60m.jp2')

# Create an RGB image
with rasterio.open('RGB_large.tif','w',driver='GTiff', width=b4.width, height=b4.height,
              count=3,crs=b4.crs,transform=b4.transform, dtype=b4.dtypes[0]) as rgb:
    rgb.write(b2.read(1),1)
    rgb.write(b3.read(1),2)
    rgb.write(b4.read(1),3)
    rgb.close()


texts:
I recently updated my version of GDAL using the Homebrew package manager.  However, now whenever I use GDAL from within my terminal shell, I get the following error:

dyld: Library not loaded: /usr/local/lib/libspatialite.2.dylib
  Referenced from: /usr/local/bin/gdaladdo
  Reason: image not found
Trace/BPT trap: 5

GDAL commands that are made from within QGIS, however, still work.  (I'm assuming that a path needs to be updated, but have no idea how to proceed).


texts:
It is possible to get list/dictionary of "Recently used coordinate reference system" from QGIS by python?

Or get list of all "Coordinate reference systems of the world" also from QGIS by python.


texts:
When using Leaflet to visualize a large dataset (GeoJSON with 10,000 point features),  not surprisingly the browser crashes or hangs. A sub-sample of 1000 features from the same dataset works flawlessly. Unfortunately I can't share the dataset for others to try out.

Does anybody have better solutions for visualizing such large datasets? (ultimate aim is to scale this to 2 million features) I'm even willing to consider offline visualization frameworks in case browser based alternatives such as Polymaps or d3.js etc. are deemed incapable.

Edit: Forgot to mention, the user needs to be able to filter the dataset by attributes. So out of N features, only the matching n <= N features might need to be dynamically rendered.


texts: SearchCursor doesn't return entire SHAPE field, how do I copy a row containing a SHAPE field?

texts:
I imported a shapefile into a feature class using arcpy.CopyFeatures_management(). It works and when I look at the feature class in ArcMap and TOAD, I see all the data and the SHAPE field is populated with the data I expect to see (min/max values, a blob for the points, etc.). I can drag the feature class on the map and the entities appear where they should. Life is good!

When I try to copy the contents of the SHAPE field from the feature class, the resulting SHAPE field is a tuple containing only two properties that appears to be a single point of the shape (not min or max values but somewhere in the middle).

The issue seems to be the arcpy.da.searchcursor doesn't return the entire shape. If I enumerate the results of the searchCursor, all the SHAPE fields are a single tuple with what appears to be an X and Y value.

The question, how do I copy rows from a feature class and get the entire SHAPE field?

update 2:

I had a thought this might be resource or size related so I scaled back everything, including the fields returned and the number of rows returned. Even when returning only the SHAPE field and a few records, a single coordinate is returned.

with arcpy.da.SearchCursor("XXX", "SHAPE") as tmpSC:

update 1:

I was able to confirm the searchCursor is only returning a single point out of the entire SHAPE field using the following code. The database contains all the information from the shapefile but the searchCursor doesn't return everything. So, what is the fix?

arcpy.env.workspace = "XXX.sde"

retVal = []

with arcpy.da.SearchCursor("XXX", "*") as tmpSC:
    for row in tmpSC:
        retVal.append(row)

print "Stop! Inspect the results... "


texts:
I have large NJ state wide parcels layer that I dissolved down to 6 records. I now want to dissolve it down too 1 record.

6 record dissolve

my input into dissolve tool

result of dissolve

Why is the dissolve tool not dissolving my layer down to 1 record?

I am contemplating just throwing it into PostGIS and using the st_union function but from my experience that takes forever


texts: Nearest Neighbor Grouped Selection in QGIS

texts:
I have a list containing over 100,000 points in lat/long format which I have imported into qgis.

Now, what I am trying to do here is group all of these points into box groups and by that I essentially mean that I want to split up the map into bounding boxes.

My requirements are are follows:

no boxed group should have LESS THAN 100 and NO MORE THAN 200 points
no point should be located in more than one group
all points should be be based on their nearest neighbor

How could I achieve this through qgis?

I am assuming that one can pass some custom query code and save the results or the boxes created as a shapefile correct? Could someone please explain how this could be done and what the code would look like?

As mentioned, my objective is to have a bunch of square boxes displayed as a shapefile layer where within each box there are no less than 100 properties and no more than 200.


texts: Can I set up a PostGIS store/connection in GeoServer without user password for database?

texts:
When creating a PostGIS store in GeoServer, the guidelines I saw ask us to fill in database connection parameters including:

host, port, database, schema, username, and password.

This is a bit problematic for my system because the PostgreSQL database is set up in a passwordless manner. Users can only connect to localhost using their user names without passwords. No password is needed or will be created for security purposes.

When I tried to Add Store without giving the password (which does not exist), I got the following error.

In my case, the webservers, GeoServer and PostgreSQL/PostGIS are on the same machine . The psql client can connect to the server on localhost passwordlessly without a issue.

Is it possible to set up PostgreSQL and GeoServer in such a way that the GeoServer to PostgreSQL connection does not require passwords?


texts: Capturing Feature Dragging and Dropping, ArcEngine 10 .net 4

texts:
I am currently trying to implement something that captures the feature that i clicked on and dragging.

Basically i want to be able to "OnMouseUp" figure out the item I was dragging, so I can do some calculations on that feature.

Does anyone have an idea on how to do that?

Thanks and Regards,
Kevin


texts:
Is there a way to add data to a GEOTiff file in a loop? I can make one using WriteArray like so:

dataset.GetRasterBand(1).WriteArray(array)

But whenever I put it in a for loop it just overwrites the data that was already there. I want to be able to append data to the existing data. The files this needs to work with can be too large to fit into memory so we can't do it in a single pass.


texts:
I am trying to add a field to a specific number of feature classes, the names of the feature classes are Pumpcapacities_1, Pump capacities_2, Pump capacities_3.

Each one of these feature classes are located in the same geodatabase, my idea was to use arcpy.ListFeatureClasses("Pump*","Point") in order to select only the feature classes that start with Pump. But it's not working, each one of those feature classes are in a different feature dataset.

[![enter image description here][1]][1]

import arcpy
arcpy.env.workspace = r"C:\Users\mviera\Documents\CWADigitizeSchemaWorking.gdb"
Feature = arcpy.ListFeatureClasses("Pump*","Point")
for dataset in Feature
    arcpy.AddField_management(dataset, "INDPumpCapacity","TEXT",50,"","","IND Pump Capacity","NULLABLE","NON_REQUIRED")
    print dataset


texts: Keeping symbology properties when converting from CSV layer to shapefile in QGIS

texts:
Is it possible to keep specific symbology settings when converting from a CSV file to a shapefile in QGIS?
I've added categorised renderer settings within my CSV file layer and don't want to loose this.
I know this can be added again manually to the shapefile layer but I would like to avoid doing this.


texts: Substract two raster image and add the information to polygons in Qgis

texts:
I have a problem in Qgis. I have two elevation maps, both is raster. They are both DEM maps, one showing the topography without buildings, and one showing the topography with buildings. From these two DEM's I want to make a new DEM showing the height of the buildings.

I tried to use the raster calculator

But this just generates a layer where nothing is shown.

The new DEM should be used to add a new attribute to the polygons stating the mean elevation within each polygon, any help on that aspect as well?.


texts: Using pgr_drivingDistance with large ids

texts:
I have little experience with postgres and none with pgrouting.

I'm trying to use the pgr_drivingDistance function with Open Street Map data (generated through osm2po), but whenever I run my query:

SELECT pgr_drivingDistance('SELECT id, osm_source_id::int4 AS source, osm_target_id::int4 AS target, cost::float8 AS cost FROM nyc_2po_4pgr', 85, 2, false, false);

I get ERROR:  integer out of range—I assume because some of the osm_source_ids I'm getting in don't fit in an int4. Is that what's going on?

I'm using a small subsection of the OSM data, so I assume I could squash the source_ids/target_ids into an int4 range. How would I do that?

Alternatively, is there a way to make the pgr_drivingDistance work with the larger source/target ids?


texts: Keep OpenLayers 3 map from going past the dateline

texts:
I have an OL3 map that constantly repeats its self. I have contained the WMS layers, though the vector layers like to repeat. What is really important is keeping the user from panning into nowhere, i.e. Keeping the user from scrolling past the poles and dateline. I added an extent to the view but it still adds some map past the date line and poles. Any idea how to prevent this?

view: new ol.View({
        center: [0, 0],
        zoom: 8,
        minZoom:2,
        maxZoom: 13,
        extent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34]

    })

Is my current code

Edit: The solutions from previous questions are all OpenLayers 2. OpenLayers 3 is a completely different framework that shares virtually nothing outside of the name.


texts: Image collection and mosaic handling in google earth engine

texts:
I would like to know how to handle ee.Imagecollection output for mosaic.
I am trying to use AOI shapefile to identify the Landsat TM 5 imagery.

var start= ee.Date('1987-01-01');
var end  = ee.Date('1988-01-01');
var collection= ee.ImageCollection('LANDSAT/LT5')
    .filterBounds(fc)//fc is shapefile variable
    // .filterBounds(city)
    .filterDate(start, end)
    .aside(print)
    .sort('CLOUD_COVER',false);
 print ('ImageCollection', collection);

which results in

ImageCollection LANDSAT/LT5 (6 elements)
type: ImageCollection
id: LANDSAT/LT5
version: 1502218468957000
bands: []
features: List (6 elements)
properties: Object (17 properties)

then I use following function to mosaic it.

var customComposite = ee.Algorithms.Landsat.simpleComposite({
    collection: collection,
    percentile: 10,
    cloudScoreRange: 5
});

The output is single mosaic image, but how I can know which images were used for mosaic and How I can run mosaic on the all 6 elements?


texts: How do I apply a unique colour for each row of data within a layer? (QGIS 2.18)

texts: I was wondering how I would go about giving each row of data within a layer a unique colour, each row does have a unique ID but I can't figure out how to use this to achieve what I'm after without using the rule-based symbology and writing out a rule for each row.


texts: How to fix QGIS error "Entry Point could not be located"?

texts:
Today, after returning from vacations, I started my QGIS 1.7 and got this terrible message:

Help, anyone?


texts: What equations does ArcGIS use to calculate X,Y coordinates from latitude and longitude?

texts: I am using the  NAD 1983 2011 UTM Zone 13N system for my data in ArcGIS. I really want to know how the equations ArcGIS used to calculate the X and Y.


texts: Splitting polylines using regions with PostGIS

texts:
I was wondering if it is possible to split a polyline on polygon boundaries (regions) in PostGIS, the picture below is of what we have at the moment and showing where I need the polylines split:

Lets call the regions road_blocks and the lines road_cl

If you can copy the data from the road_block under the newly created polyline to the new polyline that would be a real bonus.


texts: Which ArcGIS SDK to use ArcSDE SDK, ArcGIS Runtime SDK, ArcObjects SDK?

texts:
I have a geodatabase on SQL Server 2008 R2 and ArcGIS 10.2.2 installed. Both are on my local computer.

I will interface to a Delphi Application and my aim is to query some records/fields line by line, not as a map layer directly.

I didnot find ArcObjects SDK and then installed runtime SDK for .NET. I investigated their samples in C# and I didnot find an entry point for an SQL Server database connection, query table data etc.
(Closest solution was an enterprise portal approach based on their WebGIS online url address)

I am sorry that I am new in ArcGIS products and confused now which SDK for ArcGIS 10.2.2 I should use and how to get it. ArcSDE SDK, ArcGIS Runtime SDK, ArcObjects SDK, which version?

It would be very helpful to get some ideas especially about which SDK and where to get free etc..


texts: Seeking software to pick up rectangular shape of basketball courts?

texts:
Is there any software/plugins for remote sensing or object orientated classification for my 3 band aerial image? I want the program to be able to pick up open air basketball courts or badminton courts (Unsupervised classification preferred).

I've tried using GRASS GIS Image classification method but did not get the results I hoped get as it was only good in identifying buildings.

I've also tried the SCP Plugin for QGIS but is not suitable for a 3 band image.


texts:
I have a few exercises to do and I can't do it at all. I am newbie to this field.
I use QGIS 3.4.

Exercise 1
What is the azimuth between the starting point and the Z place?
I must write the value in sexagesimal degrees to a maximum of one decimal place
I don't know what to do.

I have this data:

[X = 518613,71]
[Y = 275085,35]
[Dist_b =2304]
[Azimuth_b = 15]
[Dist_c = 66]
[Azimuth_c = 316]
[Dist_d = 74]

Unfortunately I can't add the image because it's too big. I tried to solve the exercise and it gave me 130.1 degrees. But I don't know if it's correct.


texts:
Does anyone know if it's possible to add a TIFFTAG when saving a tiff file (I'm using the C/libtiff interface) that will give a name to each band?

Some kind of per-band TIFFTAG_IMAGEDESCRIPTION is what I'm after. I checked the documentation but can't find anything - however, I have seen TIFFs saved with band names so I assume it's possible somehow.


texts: Integrating data edited in Offline mode in original dataset using ArcGIS Pro

texts:
I have a feature class with about 5.000 features in my ArcGIS Pro project.
Additionally, I use the Offline version of ArcGIS Pro and edit some of the data outside in the field.
Question: How can I integrate those edited features from the field within the original feature class?
Already tried: When I join the data, not the field values are updated, but the columns appended to the dataset, which is not the way I want it to be.


texts:
I uninstalled Qgis 2.18.16 osgeo4w deleting all related folders. When I installed the qgis 3.0.0 osgeo4w there were missing folders. For example one of the crucial folders missing was .qgis2 or maybe it's supposed to be .qgis3. I tried reinstalling again several times, the same results occurred.
Does somebody know how to fix the installation?


texts: Convert ArcGIS SVY21 X,Y coordinates to GPS lat long python only

texts:
I have X,Y coordinates of points in the following CSV Form:

     X              Y
  28052.96459,44641.90785

These follow the SVY21 Projection system, and the details of the coordinates are as follows:

Projected Coordinate System:    SVY21
Projection: Transverse_Mercator
False_Easting:  28001.64200000
False_Northing: 38744.57200000
Central_Meridian:   103.83333333
Scale_Factor:   1.00000000
Latitude_Of_Origin: 1.36666667
Linear Unit:    Meter

However, I'm using this for google maps, and require the GPS lat long instead. I do not have access to ArcGIS.

Is there a way I can convert the points to lat / long? Preferably using python and its packages.

I have tried the following library: https://github.com/cgcai/SVY21 and it gives very inaccurate results.


texts: Extracting values from array created with FeatureClassToNumPyArray and converted to DataFrame?

texts:
I cannot understand how to use the values in the arrays created with arcpy.FeaturesToNumPyArray.

I want to create an array and then convert them to a pandas DataFrame. So I created an array from FeaturesToNumPyArray and tried to extract "SHAPE@XY" values. But the problem is the values are stored in some kind of 2 dimensional arrays. I thought it would be easy to split them vertically with numpy.vsplit but Python tells that the array is not a 2 dimensional.

If possible I would like to covert all table values into a DataFrame, and then use for some calculations because I think that would be easy to calculate and easy to see the codes afterwards.

The codes are like this. The FeatureClass I used here are just points with X and Y coordinates plus few additional information. Points will be extracted via Python Script tool (ArcToolBox).

import arcpy
import numpy as np
import pandas as pd
shp = inPointShape
arr = arcpy.da.FeatureClassToNumPyArray(shp, ["SHAPE@XY"])
df = pd.DataFrame(arr, columns=["X","Y"])

This doesn't cause an error but no values are passed.

However, when I print the array (the SHAPE@XY) it shows as below.

  [([141.20304792,  39.71085087],) ([141.03026594,  39.69363465],)
   ([141.7986943 ,  39.29263103],) ([140.95115842,  39.23922211],)]

By avoiding "SHAPE@XY" and converting to DataFrame works fine as shown below. But I want to do this by including "SHAPE@XY" as well.

fieldNames = [f.name for f in arcpy.ListFields(shp)]
df = pd.DataFrame()
for i, item in enumerate(fieldNames):
    if item.upper() == "SHAPE":
        continue
    df[str(item)] = arr[str(item)]

Is there anyway to extract "SHAPE@XY"?


texts:
QGIS beginner problem. I can no longer create features with "Add Feature" in QGIS.

The info triangle message is

  "Transform error caught: forward transform of (0.000000, 0.000000)
  PROJ.4: +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=11
  +datum=WGS84 +units=m +no_defs Error: latitude or longitude exceeded limits"

Using Windows 7, 64 and QGIS 2.4.0

Project CRS: WGS84 / UTM Zone 11N, EPSG:32611, OTF enabled, filter blank.


texts:
I have (qgis 2.14.0 Essen).

I wanted to write an expression using 'select features using an expression' but the page did not show the 'field' part from which I can click on 'load all unique value'.

Does anyone know what I can do?

Attached is the srceenshot.


texts: Which are the best open source tools/solutions for digitizing road networks?

texts: I was thinking on tools/plugins for QGIS, but other good suggestions are welcome.


texts: Creating points from lines with length and rotation fields using script in QGIS?

texts:
I'm about to create a script wich creates points from lines on a specified layer with a length and a rotation field.

Geometry:

The point goes to the first vertex of the line

Attributes:

length filed: distance between the first and second vertex
rotate field: clockwise rotation angle from north

Here is the code: http://paste.ubuntu.com/8360617/

Something is wrong because sometimes it works and sometimes not. I can't find the error.
Please, can you check the code?
What am I doing wrong?

Addition 1:
With my test layers with 4-5 lines works fine, points are created with fields, but on working layers (1000+ lines) not working. No points created, no messages, no logs. Sometimes QGIS crashes and quits without any message.
QGIS: 2.4.0
OS: Ubuntu 14.04 LTS 64 bit, Windows 7 64 bit

Addition 2:
I've made these changes. Works well. Some cases i see this message:

  [Errno 9] Bad file descriptor See log for more details

at the log i see this error message:

  Uncaught error while executing algorithm Traceback (most recent call
  last): Traceback (most recent call last):   File
  "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py",
  line 217, in execute
      self.processAlgorithm(progress)   File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\script\ScriptAlgorithm.py",
  line 265, in processAlgorithm
      exec script in ns   File "", line 68, in  IOError: [Errno 9] Bad file descriptor

the current code is availabe here: http://paste.ubuntu.com/8364483/

Sample data: https://dl.dropboxusercontent.com/u/143148/temp/test.zip

lines: LEAG_VIZ_V
points: LEAG_VIZ

length field: HOSSZ
rotate field: GMrotation


texts: How to extract .tiff images of different sizes

texts:
I have some WMS maps that I need to export. They need to be roughly 1m resolution and the pixel count needs to be divisible evenly by 32. I can export them using "save as..."

but when exported the files come out as multiple -I can work with multiple- 2000px x 2000px at a 1 meter resolution.(Half way there).

Is there any way to set the export pixel count per tiff file?
Edit: There is only the wms. I tried the other way and the service I am using only offers wms.


texts: Determining the difference between two shapefiles

texts:
I have two shapefiles which contain data on the assessment of the quality of data collection in different areas.
data set 1 can be considered the most up to date and as such the template on which I wish to asses data set 2.
I am looking for way to compare the two data sets and highlight areas where the data quality does not match. The problem I have is that the second dataset does not have the same extent as the first and has a number of additional polygons so they are not alike. The template file for example might have a large area with quality 1 but in the second dataset there may be several smaller areas with data quality 2, 3, and 4 in the same area.
I have both QGIS and ArcGIS Pro at my disposal.


texts:
I am looking at classifying an image to identify crop types.

I am interested in masking out all other landcover classes except crop class in the band stack false colour composite image e.g. buildings, roads, water, cloud,... in QGIS.

How would I go about this?

(a) classify the image, convert classes from raster to vector and clip the raster image to the vegetation vector polygon

or

(b) mask out the pixels using band math where by the pixel values for the unwanted classes are equaled to 0

I think both of these should theoretically work (apart from risk of pixel misclassification in approach (a) and  an issue whereby the layer stack cannot be chosen as a source file in approach (b).


texts: Compare two rasters with raster overlay and replace cell value with variable

texts:
I want to compare 2 rasters and when there is a change from 2 to 1 create a new raster that replaces the cell where the change has been detected with the change variable.

## Finds Cells that have changes from 2 to 1
Test <- (rasterT1==2 & rasterT2==1)
Date <- Test
Date[Test == 1,] <- change

Essentially is if rasterT1 > rasterT2 then add the change value to that cell. With the new raster called year using raster overlay, however I'm not sure how this would be executed.

If you need any more details let me know.


texts: OpenLayers and Geoserver. Using multiple Servers for tiles

texts:
OpenLayers allows the wms layer to specify up to 4 servers to permit the browser to connect to a server multiple times

Has anyone had any experience in mapping those for servers to four Physical geoserver Instances. The Geoservers (v2.2.5) are sharing a common data directory, different cache directories for the Integrated GeoWebCache

Would it be reasonable to expect it to work ok? I believe the functionality is to point four different dns entries at the SAME Server, not Four DNS Entries to Four DIFERENT Servers sharing a common database.

The reason is we are trying to speed up tile delivery and the performance on the scenario of pointing 4 dns entries to one server is not what we would expect. We have done all the tuning on the Java side that we can find information on and want to see what impact this makes, if it is at all even possible. Platform is a public facing windows IIS7.7 and geoserver 2.2.5 on it own machine on a private network

We are also using a proxy that distributes the tile request to the Geoserver Instance on a private network. If we proceed, we could also use 4 proxy servers as the end points for the public Geoserver Request.

Comments and suggestions welcome.


texts: Trigger on link length and filling attribute table

texts:
I create linear geometry in QGIS 1.8.0 (geometry stored in PostGIS 2.0). Help create trigger functions:

in database should not be a lines less than 2 meters (linear geometry with length <2 meters should be corrected in the process of creating the geometry) - if I created linear feature with length <2 meters I receive message "feature "gid" have wrong length"
auto fill Length column in attribute table, when new linear objects added

For calculating length I use ST_Length_Spheroid(r.the_geom,'SPHEROID["WGS 84",6378137,298.257223563]') function.

So, example trigger function for intersecting polygons below:

CREATE OR REPLACE FUNCTION check_geom_overlap() RETURNS trigger AS $$
DECLARE
gid integer;
BEGIN
SELECT INTO gid c.gid
FROM town c WHERE c.gid <> NEW.gid AND ST_Overlaps(c.the_geom, NEW.the_geom);

IF gid IS NOT NULL THEN
RAISE EXCEPTION 'Modified feature % overlaps with feature %!', NEW.gid, gid;
END IF;
RETURN NEW;
END; $$ LANGUAGE 'plpgsql';

CREATE TRIGGER check_geom_overlap_trigger BEFORE INSERT OR UPDATE
ON town FOR EACH ROW EXECUTE PROCEDURE check_geom_overlap();

Thanks!


texts: Is QGIS 2.10 Pisa for Ubuntu/Windows already available?


texts: Python script parameters for Integer not working

texts:
I am using a Python library called arcpy_metadata that uses 2 datatype called max_scale and min_scale that take integers:

My code for that is just:

import arcpy, arcpy_metadata as md
....
min_scale = arcpy.GetParameterAsText(5)
max_scale = arcpy.GetParameterAsText(6)
....
metadata = md.MetadataEditor(file)
...
metadata. min_scale = min_scale
metadata.max_scale = max_scale

I am trying to turn this into a Python script in ArcMap toolbox. An example input for the max and min scale would 5000 and 150000000. Since there is no integer type and I don't really need decimals, I just entered double when configuring the parameters for the tool. I also set it as ``optional`.

When I run the tool however, I keep getting the following error. What am I doing wrong here?

RuntimeWarning: Input value must be of type Integer


texts:
I have a layer of street segments that are within a given distance of a fire station. Now I want to make a border around these street segments. If I use Buffer, it puts a buffer around each segment. If I use Convex Hull it makes a border around the street segments but does not follow the street segments but rather cuts across them. What I really need is an outside buffer of the street segments that follows the outermost street segments.

Is it possible in QGIS?

The image below shows the problem. The lines in green represent street segments that can be reached from a given point within 4 minutes. The yellow is 6 minutes and the blue is 8 minutes from the same point.

When I put a convex hull around the green segments (shown in purple), the hull includes some of the yellow segments because a convex hull is based on the smallest polygon that contains all of the lines. I see that a concave hull is what I really need, but QGIS does not support the concave hull.


texts: Using another shape database in QGIS Atlas

texts:
I have an Atlas where I would like to use values from another shape, to quantify the number of points and use this number to control font size.

The shape that is controlling Atlas has a sequence of dates, the other shapes are called using the command "date" = @ atlas_pagename, in one of these shapes it has point information that I would like to use to generate number of points, and from from this number the source grows or decreases.

I know I can use the table feature asking for another shape as a source, but as I want to control font size, I would like to know if it is possible to call field values from another shape for that


texts: Analysis electric network with pgRouting

texts:
Electric network is a kind of utility network in GIS. In this network we have a point layer that consist power stations and end users. Power stations called source and end users called sink. And also we have one or more line layer that consist power lines. (in the simplest case).

The direction of this network is from sources to sinks

My question is how to use pgRouting to identify the direct of this network? pgRouting has function called pgr_createTopology that builds a network topology based on the geometry information. When I call this function it fill source column and target column of my line layer. source and target show the direction of my network. But this direction is not based of source and sink.

In general can we define our own direction in specific network with pgRouting and not use its default direction?


texts: Setting Annotation Reference Scale to Zero

texts:
I am creating annotation layers for a dispatch map. I'm trying to format my annotation layer to draw dynamically, with the font size remaining consistent across all scales. I must use an annotation layer because they will draw faster, and for the same reason am trying to stay away from creating multiple annotation layers with different reference scales.

ESRI's help documents explain that setting the reference scale of an annotation layer to zero will create the effect I'm looking for, but also that annotation feature classes stored in a geodatabase cannot be set to zero reference scale.

Does anyone have any knowledge of how to get my reference scale to zero?


texts:
I am using CartDB Javascript.

How can we use the sub-layer methods, GetSQL () and SetSQL (), on Named Maps?

I believe that with Named Maps, we need to provide the API key. But I can't seem a way to do this with only CartoDB.JS.

I found setAuthToken () method but I'm not sure how to use that either.


texts: QGIS print composer incomplete PDF export

texts:
I'm trying to export a PDF of a map of northern Europe.

I load a high detail shp (https://www.naturalearthdata.com/downloads/10m-physical-vectors/)
Zoom to the area I want (British Isles, North Sea, parts of Norway)
Create a map in the print composer
Export to PDF

The resulting PDF file is missing the British Isles and smaller islands. This does not occur if I use a lesser detail shp (https://www.naturalearthdata.com/downloads/50m-physical-vectors/). I have also tried reducing the DPI settings (although that shouldn't matter for a vector) to no avail.

I'm using QGIS version 3.4.5-Madeira 64-bit on a Win10 64-bit machine. The problem also occurred when using QGIS 3.6.


texts: How to loop and calculate length of each segment on a line having 2 distinct layers of points and lines?

texts:
I have a layer of polyline and a layer of points. My objective is to calculate the length of each segment along my polyline.

I tried a code but it returns the length between points that are not even contained in points layer.The picture below shows exactly what i need.

from math import sqrt
import itertools

layer = iface.activeLayer()
features = layer.getFeatures()
lines = [feature.geometry().asPolyline() for feature in features]
k = 0

for points in lines:
    n = len(points)
    list = range(n)
    print "line" + str(k) + ", " + str(n) + " points"
    length_segments = [sqrt(points[i].sqrDist(points[j]))
           for i,j in itertools.combinations(list, 2)
           if (j - i) == 1]
    sum = 0

    for length in length_segments:
        i = length_segments.index(length)
        print "segment = %d, length = %.2f" % (i, length)
        sum += length

    print "sum = ", sum
    k += 1


texts: Generate color ramp scale for imported base map in QGIS

texts:
I have imported a bathymetric layer, showing depth variation around an archipelago, which I'm using as a basemap. I would like to create a scale bar for it, showing max and min recorded depths.
Is it possible to create a colour ramp that would correspond to the colours in the imported bathymetric layer?
I am using QGIS 3.14.


texts: How to draw rectangle to clip layers using python addin in ArcGIS 10.1?

texts:
I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any suggestions to correct it would be appreciative:

import arcpy
import pythonaddins

def __init__(self):
    self.enabled = True
    self.cursor = 1
    self.shape = 'Rectangle'

def onRectangle(self, rectangle_geometry):
    """Occurs when the rectangle is drawn and the mouse button is released.
    The rectangle is a extent object."""

    extent = rectangle_geometry

    ras1 = arcpy.Clip_management(r"C:/temp/ras",
                                extent.XMin extent.YMin extent.XMax extent.YMax,
                                ras1, "#", "#", "NONE")
    arcpy.RefreshActiveView()
    return ras1


texts: Why are selected features not highlighted in OSM layers?

texts:
I am experienced with GIS, but new to QGIS and open source data.

I recently opened an OpenStreetMap (osm) file in QGIS 1.8 (on Kubuntu 12.04). I found that when I selected a feature, there was no colour change to highlight it. I know it was selected because a "zoom to" took me straight back there.

When converted to a shapefile the selection feature highlighted as I would expect.

Is this a bug in handling osm files, or is it something to do with the structure of osm that I haven't understood?


texts: rendering issue when viewing polygons in mollweide projection

texts:
Arc10.3, windows

I am using and etopo bathymetry raster with various polygon, line, and point layers over it.  One of my polygons encompasses the north pole.  This polygon automatically created a line within it that runs to the north pole.  I have not been able to successfully remove this line using editor, and I am very familiar with editor so I have tried quite a few methods. The point that lies on the north pole that is insists on connecting to shows up as a red square in edit mode.

The real issue:

When I view the map at full extent, a polygon appears to circle the entire edge of the sphere.  If I keep the polygon layer filled, the whole map appears as the fill color.  When I zoom in enough that the north pole is not visible, this circle goes away.  Clearly the circle must correlated to the issue I am having with the north pole polygon.

Any ideas?


texts: Initiating offline product retrieval with wget for Scihub Copernicus

texts:
I need to download a big chunk of Sentinel-2 data which is stored in ESAs Long Term Archive (LTA). I've already added all the products to my cart, but I want to initiate the request for the offline products automatically every 31 minutes in order to save time and nerves.
I thought I could do it with wget but if I do:
~$ wget --content-disposition --continue --user="USERNAME" --password="PASSWORD" "https://scihub.copernicus.eu/dhus/odata/v1/Products('ID')/$value"

All I get is an index file which states, that the file is offline, without initiating the product retrieval.
How can I do this using wget?


texts: Is the column order returned by arcpy.ListFields() always the same?

texts:
I'm using arcpy.ListFields() to get a list of fields in my Feature Class. Based on my limited testing of several geodatabases and tables, the order of fields returned is the field order specified in the database.

Can I depend on ListFields() to return fields in the same order and therefore use a field's position in that list to consistently get the same field? For example, if the third field is "Name", can I use fields[2] to reliably obtain the "Name" field? Or, is it just coincidence that it's been working thus far?

The help page does not address this question.


texts:
I want to use the represent value from a field of a feature.
I tried something like this but I get no result:
valuerepresent = QgsListFieldFormatter().representValue(layer=currentMapLayer,
                                                        fieldIndex=fieldidx,
                                                        config={},
                                                        cache=None,
                                                        value=value)


texts: arcpy memory error while using ExportCAD_conversion

texts:
I try to convert CSV point data to DXF CAD data. CSV file has about 270,000 points. I searched this issue and it is because ArcGIS is 32bit, and Background Processing Tool 64bit software is required to enable 64bit processing for Python. But unfortunately I have Background Processing Tool for ArcGIS 10.5, my ArcGIS version is 10.5.1. From forums, another solution is seperating csv data and then using "APPEND_TO_EXISTING_FILES" in ExportCAD_conversion tool, so I assigned csv data to a Pandas dataframe, I chunked it to 5 dataframes and I converted 5 dataframes to csv. And I used the export tool within a function:

def export_DXF(csv_path):
    dxf_folder = "..\\Outputs\\DXF"
    dxf_path = "..\\Outputs\\DXF\\switch.DXF"
    gdb_path = "output_data.gdb"
    point_feature_class_dir = "\\switch"
    point_feature_class = "switch"
    if not os.path.exists(dxf_folder):
        os.makedirs(dxf_folder)
    spatial_ref = arcpy.Describe(get_input() + '\ELE_DD_SEPARATOR_POINT').spatialReference
    featureclass_path = 'output_data.gdb\\switch'
    directory_gdb = os.getcwd()
    print("Koordinat sistemi: ", spatial_ref.Name)
    if arcpy.Exists(gdb_path):
        arcpy.Delete_management(gdb_path)
        print ("gdb path has been deleted.")
    arcpy.CreateFileGDB_management(directory_gdb, gdb_path)
    if arcpy.Exists(featureclass_path):
        arcpy.Delete_management(featureclass_path)
    arcpy.MakeXYEventLayer_management(csv_path, 'Point_X', 'Point_Y', featureclass_path, spatial_ref, '#')
    arcpy.FeatureClassToFeatureClass_conversion(featureclass_path, gdb_path, point_feature_class)
    print ("CSV tablosundan Feature Class olusturma islemi tamamlandi.")
    arcpy.ExportCAD_conversion(gdb_path + point_feature_class_dir, 'DXF_R2013', dxf_path,
                               'Ignore_Filenames_in_Tables', 'APPEND_TO_EXISTING_FILES', '#')
    dosya_sil(csv_path)
    dosya_sil(dxf_path + ".xml")
    print "dxf dosya donusumu tamamlandi."

in a function within for loop:

a=0
path_array = [switch1.csv, switch2.csv, switch3.csv, switch4.csv, switch5.csv]
for i in path_array:
    a = a + 1
    csv_path=("..\\Outputs\\" + i)
    export_DXF(csv_path,a)

However, when I run the script, first it creates one DXF and file size is 90MB, in second loop it appends second DXF, the file size is 180MB and then it waits for a long time without any output. Is there any solution exporting huge CSV file to DXF?


texts:
I keep getting the error: Cannot add an object of type object as a layer.

It is regarding line 53 of the link below (code is also copied below, error: Map.addLayer(CF_solar, CF_solar, "CF_solar")). I think I need to process the overlay differently but having tried multiple options, I am hitting a wall. What am I doing wrong?

GEE script

// import geometry (point to zoom in to)
var home_coords = ee.Geometry.Point([-7.6, 54.4])
var region = home_coords.buffer(20000);

// load image stack for one year
var dataset = ee.ImageCollection("NASA/GLDAS/V20/NOAH/G025/T3H")
  .filterDate('2010-12-01', '2010-12-31')
  .filterBounds(home_coords)

// has keys type, id, version, bands, features, properties
//print(dataset);

// extract air temperature, SW radiation for one year
var AirTemperature = dataset.select('Tair_f_inst'); //.rename("T");
var Irradiation_ShortWave = dataset.select('SWdown_f_tavg');
var WindSpeed = dataset.select('Wind_f_inst');

// take composite (yearly mean) of irradiation and air temp and store in different bands of image
var T_G_comp = ee.Image(AirTemperature.mean().subtract(273.15))
    .addBands(ee.Image(Irradiation_ShortWave.mean()));

// ImageCollection, has same keys as above
//print(AirTemperature);

// Method for computing CFsolar mean
var CF = (
    '(1-beta*(c1 + c2*T + c3*G - T_ref) + gamma*log_10(G+1))*G/G_ref',
    {
      'beta': 0.0045,
      'c1': -3.75,
      'c2': 1.14,
      'c3': 0.0175,
      'T_ref': 25,
      'gamma': 0.1,
      'G_ref': 1000,
      'T': ee.Image(AirTemperature.mean().subtract(273.15)),
      'G': ee.Image(Irradiation_ShortWave.mean()),
    })

// use "print" to check any variables in the console
print(CF)

var T = {bands: "Tair_f_inst", min:-30, max: 688}
var G = {bands: "SWdown_f_tavg", min:-900, max: 999}
var CF_solar = {bands: "CF_solar", min: -999, max: 9310, palette: ["blue", "red", "orange", "yellow"]}

// Adding these layers is just doing a solid colour overlay.
Map.addLayer((AirTemperature.mean().subtract(273.15)), T, "T")
Map.addLayer((Irradiation_ShortWave.mean()), G, "G")

// Cannot add this type of object to a layer

Map.addLayer(CF_solar, CF_solar, "CF_solar")

// print graphs
//print(ui.Chart.image.doySeries(Irradiation_ShortWave, home_coords, ee.Reducer.mean(), 30));
//print(ui.Chart.image.doySeries(WindSpeed, home_coords, ee.Reducer.mean(), 30));


texts: Convert a polygon geopackage into a multi-polygon geopackage in QGIS

texts:
I have a series of polygons in a geopackage file of QGIS polygons. Is it possible to transfer the contents of this file to another geopackage that has multipolygons as vector data type?
I need to fix this error because I need to merge multiple polygons and I can't do it using the simple source "polygon" geopackage but I need a "multipolygon" geopackage.


texts:
I loaded DEM and point data and as a result I just got black raster (still black after calculation). If I click intervisibility I can't see it like if line data is not there. I tried changing meters, degrees and stuff but still nothing.

Does anyone know how I can get viewshed to work?


texts:
I have just started to use GDAL/OGR and I am trying to create a spatialite DB from OSM data. I am using a cut of the Swedish OSM data downloaded from Geofabrik in .osm format. I have used the following command line:

ogr2ogr -f "SQLite" SwedenOSM.sqlite sweden-latest.osm

This created a spatialite db but I also got the following error:
ERROR 1: Too many tags in relation 54224 this is repeated 12 times.

When I try to add the spatialite DB into QGIS 2.6 it doesn't recognise it as a proper DB.

Can some explain to me what is happening and how I go about solving it.


texts:
Last Thursday I created several places in Geonames (using the website UI). When I tried to retrieve these places using the API, I couldn't get them. In that moment I thought that perhaps the API database (is there something like that?) needed time in order to be updated with my new places.
Today I try to do the same thing and sometimes I get the correct response, and sometimes I get an empty response.

For example, I created the place Comuna 1 Norte, in Colombia. From the website I can see it. But from the API, sometimes I can retrieve it, and sometimes I can't.

http://api.geonames.org/searchJSON?name=Comuna%201%20Norte&country=CO&username=xxxx

What's going on?

Is there a problem with Geonames databases?

Do I have to wait more?


texts: how to create a new row with a counted points in postgis

texts: I have two tables in postgis (pgadmin). In one table there are points and in the other table there are polygons(provinces). The tables are both over the same location (Netherlands). I want to count the points who are in every province and I want to export them to a row in the polygon (maybe a new table). Summarized: I want from every province the points counted in a row.


texts: I am doing some topology testing using Grass in QGIS.  I am hoping to snap nodes to eliminate gaps between polygons.  When I use the v.clean.snap function in Grass it does not work on polygons. When I test it on lines it completes the tasks as I was hoping.  Does anyone know of a way to run v.clean.snap or a similar function in Grass on Polygons?  Attached are two screen grabs showing the errors as polygons, and the fix as a line.


texts: Convert SHD files to CLR or more modern color ramp format

texts:
I have a legacy SHD file (from Arc/Info) that contain color ramp information that I would like to use to symbolize a raster layer in ArcGIS Pro. I have access to an Arc/Info installation and am able to print the color values in the SHD file, but there are dozens of steps that I do not want to have to transcribe manually. Is there a way to export these files to a format that can be read into ArcGIS?

This question addresses the topic generally for symbols but in this case I am specifically interested in SHD files: Converting symbology from ArcInfo Workstation to ArcGIS Desktop?

An alternative, if no export capability exists directly, might be a method to automatically construct an ArcGIS Pro CLR file based on the text dump of the SHD file, so a method to do that would also answer my question.

Here is an example of the text dump from the SHD file (it continues for several dozen rows):


texts: Button to run Python Script on Custom Form Open QGIS

texts:
I'm very new to QGIS and Python (although years ago had some programming experience with C++), but have been muddling through with a fairly large project cataloging cemetery plots at the moment.

I currently have a custom form used for taking photos and cross referencing existing data, taking a photo and linking with physically surveyed plots.

What I'm hoping to do is take a few steps out of taking a photo and linking it with an existing record. What currently happens is, the user switches to the camera app, takes the photo, and then comes back into QGIS to search for the file and link to the record in the custom form.

What I would like to do is have a button in my custom form that when selected launces the camera app, and once closed automatically looks for the newest file in the camera directory. I have managed to achieve this to a certain extent in the python console with the following:

import os
import subprocess

subprocess.call(['notepad.exe'])
path="C:\\temp\\"
file_list=os.listdir(path)
dated_files = [(os.path.getctime(path + fn), os.path.basename(path + fn)) for fn in file_list]
dated_files.sort()
dated_files.reverse()
newest = dated_files[0][1]
return_string= path + newest

Obviously the notepad.exe call and path variable will be updated once on the data collection computer, but this seems to work for testing so far...

I am now struggling with how this would be put into the script for "Python Init Function" in QGIS so that it runs when a button box is pressed and then modifies the value within the form.


texts: Preventing North Arrow from jumping around in ArcPy?

texts:
I am using a python script, which opens an mxd, loads a feature class, exports the map to a png. That script produces a few hundreds of maps. After my update to 10.4 (maybe that is a coincidence) the north arrow changes the position. On some maps it is in the right position, sometimes a bit right or left from the correct position and sometimes not on the map at all. Is there any explanation for that? How can I prevent that from happening? My script is not touching the north arrow.

Ok, I could break down the code to 47 lines. It is still to much, but I don't know what else I can leave out. I have one mxd and one feature class with two fields. One field speciefies the species and one the Date. The script prints maps of all species at the first date than maps of all species at the second date a.s.o.

The scipt prints the first 48 maps (all 24 species at the first and second date) correct. After that the north arrow starts to move in a loop. It is never at the same position. After 22 more maps the north arrow has left the map completly. However, with another dataset, the values are 45 and 5 and the north arrow moves into another direction.

import arcpy,datetime,os
arcpy.env.overwriteoutput = True
mxd = r"C:/GIS/Project.mxd"
fc = r"X:/GIS/data.gdb/grid"
field = "Species"
datefield = "Season"
output = r"X/GIS/TEST"
printresulution = 150
def multiMap(mxd,fc,field,datefield,output,printresulution):
    mxd2 = mxd
    mxd = arcpy.mapping.MapDocument(mxd2)
    data_frame = arcpy.mapping.ListDataFrames(mxd)[0]
    layer = arcpy.mapping.Layer(fc)
    layername = layer.name
    specieslist = []
    datelist = []
    cursor = arcpy.SearchCursor(fc)
    for row in cursor:
        if row.getValue(field) not in specieslist:
            specieslist.append(row.getValue(field))
        if row.getValue(datefield) not in datelist:
            datelist.append(row.getValue(datefield))
    counter = 0
    for tag in range(0,len(datelist)):
        counter += 1
        for specie in range(0,len(specieslist)):
            where_clause =  "%s = '%s' AND %s = '%s'" % (field,specieslist[specie],datefield,datelist[tag])
            layer.definitionQuery = where_clause
            for lyr in arcpy.mapping.ListLayers(mxd, "Raster_grouplayer",arcpy.mapping.ListDataFrames(mxd)[0]):
                arcpy.mapping.AddLayerToGroup(arcpy.mapping.ListDataFrames(mxd)[0],lyr,layer,"TOP")
                mxd.save()
                layer.visible = True
                arcpy.RefreshTOC()
                arcpy.mapping.ExportToPNG(mxd, output + os.sep + specieslist[specie].replace(".","").replace(r"/","_").replace(",","_") + "_" + str(counter) + "_" + datelist[tag].replace(".","").replace("/","").replace(" ","_") + r".png",resolution=printresulution)
            mxd.save()
            del data_frame,mxd
            mxd = arcpy.mapping.MapDocument(mxd2)
            data_frame = arcpy.mapping.ListDataFrames(mxd)[0]
            layerlist = arcpy.mapping.ListLayers(mxd,"",data_frame)
            for element in layerlist:
                if element.name == layername:
                    arcpy.mapping.RemoveLayer(data_frame,element)
            mxd.save()
    mxd = arcpy.mapping.MapDocument(mxd2)
    mxd.save()
multiMap(mxd,fc,field,datefield,output,printresulution)

One more edit:
I don't really to save the mxd and maybe there is the mistake. However, I would like to keep the possibility to change the map and save these changes. That is why I kept it in the snippet.


texts: Cannot add ArcGIS service from a Linux based server in ArcMap (admin)

texts:
I have installed ArcGIS Server 10.2 on Ubuntu 13.04 (with few tricks which I would be happy to share) and got the server up and running to the extent that I can manage the server through the webinterface and even add it in ArcMap for accessing the maps.
My problem is that when I add the server for management, it asks for a hostname and when I enter the same name as it appears on the ArcGIS web interface (where the machines managed by the server is listed), ArcMap complains about not being able to find the machine with the given hostname.
Any ideas?