texts: Setting up Drop-Down list in Parameters of Python script tool?

texts:
I am trying to create a tool from a python script I have written that will take a list I have created and use it as a drop-down menu in the finished tool as one of the inputs (see attached image for example):

The list I am using is a large list that includes all the towns in the state of Vermont, and I generate it in the script from a table (see code below). I suspect my problem at the moment is just with setting the tool Properties to take this list and use it to create a drop-down list for the user. Here is the block of code that creates the list for use in the parameter - does anybody see any problems with this code-end of the tool?

import arcpy
arcpy.env.workspace = "Z:\\OPS\\TechnicalServices\\Culverts\\GetCulverts\\GetCulverts.gdb"
towns = "Database Connections\\GDB_GEN.sde\\GDB_Gen.VTRANS_ADMIN.townindex"
arcpy.MakeFeatureLayer_management(towns,"towns_lyr")

NameList = []
NameListArray = set()
rows = arcpy.SearchCursor("towns_lyr")
for row in rows:
    value = row.getValue("TOWNNAME")
if value not in NameListArray:
    NameList.append(value)
town = NameList

town = arcpy.GetParameterAsText(0)

Here is an image of the Tool properties as well, with the default validation code - do I need to alter this validation code?

I looked for info on altering this validation code, but I could not find info on using it for formatting drop-down lists.


texts: Coordinate Reference Systems errors or bugs?

texts:
I have an application that references a JAR file. In that JAR file, I have a method that creates a Coordinate Reference System using the CRS class. This class is Project_Point. When I run and test this class, everything works fine. But when I bring it into another application, I get errors with the CRS class.

   sourceWKT = sourceWKTArg;

    targetWKT = targetWKTArg;
   //crashes here with error Exception in thread "main" java.lang.NoSuchMethodError: org.geotools.referencing.CRS.getAuthorityFactory(Z)Lorg/opengis/referencing/crs/CRSAuthorityFactory;
    CRSAuthorityFactory factory =  CRS.getAuthorityFactory(true);

    //crashes here with errors about EPSG code not found
    sourceCRS = CRS.parseWKT(sourceWKT);
    sourceCRS = CRS.decode("EPSG:4326");

Again, when I run this code from the class, everything is fine.

Could this be happening because the application I'm trying to use this class in is version 2.2 of geotools and this class is written in 2.7? If so, whats a work around for this?

Thanks


texts: How to get Last ObjectID of feature class using ArcPy?

texts:
I have a feature class and I need to know the ObjectID of its last record.

What is the best way to find out last ObjectID?

Opening a search cursor and reading all the records is one way, but is there any other way?


texts: How to change raster pixel values inside a polygon

texts:
I use Arcgis desktop 10.4.1.
I also both have 3D and Spatial Analyst.
I want to change the pixel values inside the blue polygon in the picture above. It's a river, but for some reason the pixel values inside the red circle is higher than the rest. I want to change all pixel values inside the blue polygon to 120.12, but I can't find any workflow to do this.
Any ideas?


texts: Adding specific country's polygon into leaflet map layer

texts:
Currently in my project I have a base map layer taken from OpenMapStreet. On top of this I would like to have an additional layer which adds polygons of specific countries on top of the base map layer. I have a geoJson file of the world map which includes all the geometric coordinates to draw polygons for all the countries in the world and a json file, lets call it "cities.json" which looks something like this:

  [

  {
   "City": "Angers",
   "Country": "France",
   "ISO3": "FRA",
  },

  {
    "City": "Bar-le-Duc",
    "Country": "France",
    "ISO3": "FRA",
  },

  {
    "City": "Agawam",
    "Country": "United States of America",
    "ISO3": "USA",
  },

  {
    "City": "Albany County, NY",
    "Country": "United States of America",
    "ISO3": "USA",
  }

  ]

My objective is to check whether or not the country exists in cities.json before adding the country's polygon on to my geoJson layer for my leaflet map. So, as seen in the example, we have the country of France and the United States of America in the cities.json file, and so in the geoJson layer of my leaflet map, there will be a colored polygon over these two countries. How to achieve this outcome?


texts: Calculating Mean and Sum in QGIS Zonal Statistics?

texts:
When a polygon intersects more than one pixel, and each pixel within the polygon occupies a different area, does the mean take into account the area of each pixel and its correspondent value (i.e. weighted average)?

When I used Zonal statistics to determine the sum of precipitation in each sub-basin, the sum of precipitation for those sub-basins smaller than a pixel was lower than the value of each pixel that intersected the polygon (e.g. the sum of precipitation for the polygon was 50 while the value of precipitation of the pixels that intersected it was 300 and 150).

Does it consider the area of the pixel in the polygon to calculate the sum? (i.e. if only half of the pixel intersects the polygon, only half of its value is summed?)


texts: Are polygons stored clockwise or counterclockwise in a shapefile?

texts:
I'm working with polygon coordinates in QGIS using PyQGIS using ESRI shapefiles as input data.

Are the polygon vertices (I am referring only to the outer boundary in the case of polygons with holes) stored as clockwise or as counterclockwise in a shapefile or can be in mixed order?

Is the order always the same or can be different depending on the source of the data: digitizing, converting from other sources as *.csv files, etc.?


texts:
I wonder if it is possible to simply import .obj and .jpg (texture) files in QGIS and implement them in an existing map.

I found this answer QGIS, point clouds and photogrammetry but it isn´t exactly what I am looking for.

So my question is if there is an simple way to work in QGIS with .obj-files?


texts:
I'm quite new to Google Earth Engine and I think my issue might be quite easily resolved, but I've made these two codes as I'm having issues with each of them. I'm trying to export the landsat imagery, either the entire file or a subset within the bounds of roi. Here was my first attempt:
var roi =
    /* color: #d63000 */
    /* shown: false */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[-121.8802978515625, 44.437465346193136],
          [-121.8802978515625, 43.72323520263136],
          [-120.68828125, 43.72323520263136],
          [-120.68828125, 44.437465346193136]]], null, false),
    landsat = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");

// Filter Down the imagery
var imagery = landsat.filterDate('2016-04-30', '2016-05-02').filterBounds(roi)
  .sort('CLOUD_COVER', false);

//View the imagery
var visParams = {bands: ['B4', 'B3', 'B2'], min: 0, gamma: 1.4};
Map.addLayer(imagery, visParams, 'Bend Landsat');
Map.setCenter(-121.29, 44.0945, 13);

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: imagery.select('B10','B11'),
  description: 'imageToDriveExample',
  scale: 30,
  region: roi,
  maxPixels:1e11
});

I just get an error. This is my error:

Error: Image.clipToBoundsAndScale, argument 'input': Invalid type.
Expected: Image. Actual: ImageCollection.

How can I get this right?
This was my second technique. It works, but it does this weird thing where it exports the imagery as 4 separate files. I can mosaic them together, but they don't exactly look the same.
var roi =
    /* color: #d63000 */
    /* shown: false */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[-121.8802978515625, 44.437465346193136],
          [-121.8802978515625, 43.72323520263136],
          [-120.68828125, 43.72323520263136],
          [-120.68828125, 44.437465346193136]]], null, false),
    landsat = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");

var batch = require('users/fitoprincipe/geetools:batch');

// Filter Down the imagery
var imagery = landsat.filterDate('2016-04-30', '2016-05-02').filterBounds(roi)
  .sort('CLOUD_COVER', false);

//View the imagery
var visParams = {bands: ['B4', 'B3', 'B2'], min: 0, gamma: 1.4};
Map.addLayer(imagery, visParams, 'Bend Landsat');
Map.setCenter(-121.29, 44.0945, 13);

// Download imagery
batch.Download.ImageCollection.toDrive(imagery, 'Folder',
  {scale:15, region:roi.getInfo()[[[-121.8802978515625,43.72323520263136],[-120.68828125,43.72323520263136],[-120.68828125,44.437465346193136],[-121.8802978515625,44.437465346193136]]], type:'float'});

Is there any way for me to get it to my drive as one file?


texts:
I am familiar with ArcMap but I have had not really used ArcScene. (I'm on 9.4) I am want to create a house model to remodel and I am wondering if it would be easier to do in ArcScene or Google Sketchup?

In addition, I'm also wondering if I could create a 3D shapefile in ArcMap & then add to ArcScene? I did not see any options to dispaly a 3D shapefile in ArcScene.

Thanks for helping!


texts:
In ArcMap, I add a layer from ArcGIS web server projected in "Bessel 1841 Transverse Mercator".
Then I add new layer as a base map from ArcGIS online web server.

This is the result:

Shift is around 500 m, and I wonder what shell I do to make correction so that both layers align?

Reported projection for "Bessel 1841 Transverse Mercator" layer is:

PROJCS["Bessel_1841_Transverse_Mercator",
    GEOGCS["GCS_Bessel_1841",
        DATUM["D_Bessel_1841",
            SPHEROID["Bessel_1841",6377397.155,299.1528128]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",7500000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",21.0],
    PARAMETER["Scale_Factor",0.9999],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0]]

It's closest match is SR-ORG:7698 where it differs in "False_Easting" parameter.


texts:
I am quite new to the GIS world and I am trying to work with some DTED file from the SRTM project on QGIS. Unfortunately, when I add it as raster layer the program automatically shape it as a perfect 1:1 squared image. In order to be sure that the problem was not connected to the file used I checked it on MICRODEM where the resolution is showed correctly. This is quite a problem having to extract an actual 1:1 squared raster using specific coordinate but, due to this issue, the clipped raster has a wrong proportion.

I am not sure if there is an option to make QGIS shows the file with the original proportion or if it is maybe something else. If anyone has some suggestions or tool  I'd welcome it.


texts: Algorithm to calculate coverage + overlaps from a set of arcs

texts:
I have a shapefile containing arcs representing the path travelled by a truck spreading fertiliser onto a farm.

Let's say I know the spread width is 30m, i.e. the truck can spread fertiliser 15m either side of the vehicle.

I want to generate a set of polygons, which show:
1) The total area that received fertiliser
2) The areas of overlap, i.e. where two separate passes were too close together, such that some parts of the farm received twice the correct "dose" of fertiliser.

A naive approach is to just create the coverage polygons as buffers around the arcs. This works in the special case where the spread lines are distinct from each other.
However, the truck could conceivably travel around the farm in an ever-decreasing spiral, and a simple buffer would fail to show overlaps where two passes of the spiral were too close together (if the spiral is a single arc, I would end up with a single polygon with no overlapping parts).

If it's relevant, I'm using the TatukGIS VCL DK, but I'm really looking for an algorithm rather than a specific solution.

Some clarifications in response to the discussion so far:

1) I can't rely on the vector data having any particular metadata (e.g. GPS logs or spread rate). I allow the user to choose a layer and specify a spread width, then the report runs.

2) The purpose of the report is really to show the user how "skilled" the vehicle operator was, where "skilled" means "achieved the highest coverage with the lowest overlap".

3) I'm more comfortable in vector land than raster land, so will prefer vector-based solutions.

Thanks,

Darren.


texts: Understanding Neighborhood Majority Statistic in ArcGIS Desktop?

texts: Here both 12 and 13 are equal so would the neighborhood majority be null for this 3 by 3 neighborhood?


texts:
I am new to mapping and displaying data on maps. I was trying to display markers on a map where each marker represents a point of interest on my map.
Using leaflet it is quite straight forward  to add such markers.

My concern is what happens if I have many (lets say 400,000) such points spread (or actually clustered) around the world.

I was thinking that it would be nice if I could get the data from my server based on tiles,
i.e. if I could provide an API from my server that will return per tile (JSON) data and this data would be available for my to render on the map (or on the tile) using some form of "tileDataAdded" and "tileDataRemoved".

On the server side if the zoom level is too low I can just return the number of relevant points in the time (possibly with some average latlang) to allow some form of clustering display and if there is reasonable amount of data then it can be returned at its raw form.

Is there something like this that is already built or does my thinking that I should create some DataLayer class that implements ILayer makes some sense?


texts: Importing MXD to ArcGIS Pro programmatically?

texts:
I have a problem with importing an MXD file to ArcGIS Pro programatically. I try to do this by using the following arcpy.mp code:

import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\test\blank.aprx")
aprx.importDocument(r"C:\test.mxd)
aprx.saveACopy(r"C:\test\filled.aprx")

When I launch ArcGIS Pro and open the resulting project file, no items in Contents can be visible. I tried to load the MXD file programatically into opened ArcGIS Pro instance by using the Python frame - also no items are visible in Contents after loading. For a final test, I tried to load this MXD by using GUI - and this works perfectly, all layers are visible in Contents pane when loaded.

What am I doing wrong?


texts: How to convert a multipolygon to multilines with Python?

texts:
How can I convert MultiPolygon to Multiline?

I want to work with the boundary of multipolygon. In R I can just do :

as(my_multi_polygone, 'SpatialLines')

But I don't know how to do it in Python?


texts: Only read specific rows of a shapefile with GeoPandas / Fiona

texts:
I would like to read in only certain rows of a shapefile using GeoPandas. I've read approach for limiting columns of shapefile to read in, which I may use as well (Only read specific attribute columns of a shapefile with Geopandas / Fiona), but was looking for help translating this approach to limit the rows of shapefile being read in.

I think the answer is a simple modification of GeoDataFrame.from_features and a function using Fiona in linked questions on limiting columns of shapefile to read into GeoPandas.


texts: Setting a renderer that uses a function for a dynamic layer in ArcGIS JavaScript API

texts:
How can I, if possible, set a renderer for an ArcGISDynamicMapServiceLayer which uses a function to determine feature values instead of just attribute values?

When using the following code, the function specified never gets called. Instead, the value to be added last is used for every feature, which kind of seems like a bug to me. That is, the following, which I expected to render features using the default gray symbol only, instead renders all features red.

var map, mapService;
require(["esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/LayerDrawingOptions", "esri/renderers/UniqueValueRenderer", "esri/symbols/SimpleFillSymbol", "dojo/_base/Color", "dojo/domReady!"],
    function (Map, ArcGISDynamicMapServiceLayer, LayerDrawingOptions, UniqueValueRenderer, SimpleFillSymbol, Color) {

    var drawingOptions, optionsArray = [];

    map = new Map("mapDiv", {
        basemap: "osm",
        center: [0, 0],
        zoom: 5
    });

    mapService = new ArcGISDynamicMapServiceLayer(
        "http://x.x.x.x:6080/arcgis/rest/services/Service_Name/MapServer",
        {id: "test"});
    map.addLayers([mapService]);

    // The renderer displays polygons with a GRAY fill per default.
    var defaultSymbol = new SimpleFillSymbol().setColor(new Color("#999999"));
    // There are only two specified categories, using YELLOW and RED fill.
    var yellowSymbol = new SimpleFillSymbol().setColor(new Color("#ffff00"));
    var redSymbol = new SimpleFillSymbol().setColor(new Color("#ff0000"));

    var renderer = new UniqueValueRenderer(defaultSymbol, function (feature) {
        console.log("!");
        return "other";
    });

    renderer.addValue({value: "yellow",
        symbol: yellowSymbol,
        label: "Category One (Yellow)", description: ""});
    renderer.addValue({value: "red",
        symbol: redSymbol,
        label: "Category Two (Red)", description: ""});

    drawingOptions = new LayerDrawingOptions();
    drawingOptions.renderer = renderer;
    optionsArray[0] = drawingOptions;
    map.getLayer("test").setLayerDrawingOptions(optionsArray);
});

Following this sample, using a FeatureLayer instead and adding the renderer by calling layer.setRenderer(renderer);. produces the expected result but is not the answer to this question.


texts:
My problem is that it's not possible to install any plugin in my QGIS 2.18. When I install it I get this error:

Couldn't load plugin 'quick_map_services'
ImportError: No module named quick_map_services
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 308, in loadPlugin
    __import__(packageName)
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named quick_map_services

Here is QuickMapServices in example. But it behaves the same way with any other plugin from reposotory.

Besides Python 2.7 which is included into QGIS package I have Python 3.6 also...

How to make it working properly?


texts: What is the meaning of ' QC_val=0x...' in the cleanMODIS of the bfastSpatial package?

texts:
I am using the bfastSpatial package in R. One of the parameters that I have to set is the QC_val=0x 'a number'.
I do not understand what number I have to insert.
I am using MOD11A2 product (MODIS LST 8-day product).
I have read that QC values to KEEP in the data. But what I can not understand is what are the values. For example, the range of the values in the QC images that I use is [2-90].


texts:
I have been using python to turn a netcdf into a geotiff.
Once I have the geotiff, I am using gdalwarp to transfer it into the right projection. Then use gdal_translate to get the tif into a vrt file.

I then use the vrt with gdal2tiles.

The problem is, when I get my tiles, I end up with my NoData showing up as the bottom or top of my color ramp. In the image shown, I set NoData to be 0.

I have tried adding a color ramp two different ways, one with a color-relief using gdaldem. When I do that, I get a

Error : band 1 has no color table

from gdal_translate.
I have also used python to set the ColorTable.

All I want is for my NoData to be transparent. Any idea on how to do that?

EDIT: How I create my array, I then use osgeo to make the tif.

noData = array == fill_val
norm_array = array.copy()
norm_array[noData] = 0

I have tried many different options once I have the tif,

gdalwarp -overwrite -ts 1736 932 -s_srs EPSG:4326 -t_srs EPSG:3857 -srcnodata 0 -dstnodata 0 -dstalpha original.tif warpped.tif

I have also tried using the -a_nodata for gdal_translate and the -a option for gdal2tiler as well. None of that seems to be working.


texts: Show M values on mappoint /mouseover on a polyline - ArcGIS Server 10

texts:
I want to show the M values i.e the chainage of the road when I move my mouse over it.

I am using mappoint to show some static attributes but I also want to show the dynamic M values along the road when I mouse my mouse pointer over it..

Note: I am using Visual Studio 2010 with Silverlight API 2.2 and ArcGIS Silverlight 10

Please guide...


texts: How to find the mean of a given variable in NetCDF regardless of latitude and longitude?

texts:
I have extracted temperature t2m data from a NetCDF file for certain regions, and now I would like to find the overall mean temperature per timestamp for the given regions. The dimension of the NetCDF files is the following:
Dimensions:    (latitude: 197, longitude: 513, time: 108)
Coordinates:
  * longitude  (longitude) float64 -180.0 -179.8 -179.5 ... -52.5 -52.25 -52.0
  * latitude   (latitude) float64 90.0 89.75 89.5 89.25 ... 41.5 41.25 41.0
  * time       (time) datetime64[ns] 1970-01-01T01:00:00 ... 1970-01-05T12:00:00
Data variables:
    crs        int32 ...
    t2m        (time, latitude, longitude) float32 ...

I would like to find the overall mean temperature t2m for the region for each timestamp? Can it be done by cdo?


texts: Loading Spatialite extension via SQLite3 ODBC Driver?

texts:
I am having trouble getting the Spatialite extension to load as part of the SQLite3 ODBC driver.

What works [loading extension into SQLite Driver]:

I have software that is connected using the SQLite3 ODBC driver (http://www.ch-werner.de/sqliteodbc/).  I have previously loaded extensions into this driver without any problems.  A previous working example was a trigger that updated columns [using triggers] using some trig functions that are not part of base SQLite functionality - I built the *.so extension and pointed SQLite to it as part of the ODBC connection and everything worked fine - when I connect/export data from the software I got no issues.

What works [loading Spatialite extension into SQLite]:

If I use the SQLite shell I can load the Spatialite (or any other extension) using: select load_extension('libspatialite-2.dll');.  That works without fail.

What doesn't work:

However I cannot seem to get the Spatialite extension to load properly as part of the ODBC connection - and I am using a trigger that builds the geometry column of a Spatialite database based on the software providing only x and y values.  I get an error that says "Extension C:\windows\system32\libspatialite-2.dll did not load: the specified module could not be found".  I also tried the spatialite-4.dll and it doesn't work either.  The module and its requirements are located there and the environmental path has (always) been there.  If I do not load the extension then I will get an error when the trigger calls a function (makegeometry, makepoint or whatever you want) that is not part of the SQLite driver - it doesn't understand the function.

My hack workaround at this point are batch files that run what the trigger should do after the data has transferred from the software to the Spatialite database, but I'd prefer it to be a one-stop shop.

I haven't seen this much on the web, other than a Google Groups question (https://groups.google.com/forum/#!topic/spatialite-users/3ImfXm7cdpU) that didn't resolve the problem [I haven't tried to build the CppDB yet - I want to see if there is a more lazy straightforward solution].


texts: Interpolation and using time manager in ArcMap?

texts:
I have a dataset that is made of a set of points, each representing a sensor that measures air quality. The data has a location, value for emissions and time (one measurement per hour).

What I'm trying to do is visualize the area that is being measured by creating an interpolation (I was thinking of IDW) of the area for each time period. Then I would like to be able to use the time slider in ArcMap (or perhaps Qgis) to see the difference through time.

My question is how do I create an interpolation for each time period? By just applying the IDW tool on my dataset I seem to be getting a static image: I can't scroll through it using the time.


texts: How does ArcMap calculate the default cell size when rectifying a raster?

texts: When rectifying a raster, there is an option to enter a cell size. I was wondering how ArcMap calculates this default cell size, particularly in relation to the raster's resolution.


texts: Reading palsar k&c 50 data in GDAL or other open source application

texts:
I posted this inquiry in the grass-user list.

JAXA is providing free access to PALSAR 50m Orthorectified  K & C Mosaic.  According to the website, data are provided in:

  Data files (Raw format) and image files (PNG format)

However, I can't get GDAL to access the data (Raw format).  I've tested other sample PALSAR data and GDAL can easily access them using the PALSAR driver

I'm looking for open source apps that can read and export this data to the more common raster formats like geotiff, etc.

The header file is described in this pdf: http://www.eorc.jaxa.jp/ALOS/en/kc_mosaic/map/PALSAR_MSC_dsc.pdf

UPDATE:  I found a non-foss application that can directly read the kc_mosaic format.  It is called MapReady developed by the Alaska Satellite Facility.  It can convert to various image format including geotiff.

Another tool is the Next ESA SAR Toolbox (NEST).  However testing with NEST4C-1.1, the data format is not recognized.


texts: Is it possible to make a dictionary with 'multiple raster' variables?

texts:
Working in QGIS 2.14, I'm making a script to prepare images for remote sensing classifications. The user is prompted to enter multiple rasters for each band. I would like these rasters to be organized into a dictionary so each band can be prepared in loop.

##Prepare Band Images = name
##Band01 = multiple raster
##Band02 = multiple raster

dictionary = {
   "band01": Band01,
   "band02": Band02
}

for bandidx, bandfiles in dictionary.items():
   # Prepare band images

My issue is that the above script produces the following error message:

Is it possible to have a dictionary with 'multiple raster' variables in it? Alternatively, is there an easier way to make a list of 'multiple raster' variables?


texts: When should I use recycling = true with IFeatureClass.Update?

texts:
I am migrating .NET code from 9.3 to 10.1
The code is using
IFeatureClass.Update(queryfileter, true) where true is for recycling.

I know recycling should not be used when we do update, and actually it was permitted on 9.3 in spite of being undesirable, and it is totally prevented on 10.1

On 10.1 I did changed it to false.
But I got another issue.

but first let me ask my first question. If it is not permitted , then why you give it as an option in 10.1 when we open an update cursor?

Is it possible to use it in 10.1 with recycle being true? (and I am getting an error that you cannot update recyclable cursor).

and my second question.
After I changed it to false I got a different issue
I was able to successfully update the features.
It worked for all kind of update.
But it is hanging on one place, where I am selecting more that 100,000 rows at once.

The IFeatureClass.Update is hanging, without doing anything.
I put logging everywhere in the code, and it hangs exactly where I am submitting the select.

I want to ask if any one has any idea on how to do what I am doing on 10.1

P.S, I am maintaining very bad written and messy code, and what I need is just to migrate it to 10.1 with the less modification possible.

Thanks


texts: Constructing point at corner of layer extent using QGIS Modeler

texts:
I’m in the Modeler. My input is a polygon layer with a polygon (agricultural field) and a line layer with a line indicating a direction of travel within the field.
The field will be filled with parallel lines, but the main issue is to place the first line  at the right distance from the most extreme part of the field.
I guess I need to find one of the corners of the polygon layer extents, and relatively to that point create a point from which I will construct a line with the same length as the polygon and the same azimuth as the input line.
How do I make a point in, for example, the south/west corner of the layer extent, using the Modeler?
I guess I will be using the “geometry from expression” tool, but I don’t know the expressions


texts: Show hide features based on multiple attributte columns in layer

texts:
I have a delimited text layer with data from NMEA GGA sentences. The data will eventually go online on qgiscloud or similar, and I want to show and hide features based on multiple Attributes. I have one column with GPS quality (no correction signal, EGNOS and RTK) and one column with different GNSS-systems. Ideally it would be cool to be able to group on GNSS-system and be able to toggle on and off the Quality fields.

GNSS-System 1

RTK
EGNOS
No correction signal

GNSS-System 2

RTK
EGNOS
No correction signal

Any suggestions on how to accomplish this in QGIS?


texts: Spatial join multiple attributes from smaller polygons to the bigger one

texts:
I'm trying to join (to the rectangle) values from multiple polygons intersecting for this rectangle.

I've tried to use some Reference functions in Field Calculator like  geomintersects() but it joins only one value.

Is there some possibility to iterate somehow this function to add all intersecting polygon values to the target column?

For egzample: smaller polygons have numbers like 1,2,3... Is there option to add to the target rectangle layer values of all intersecting polygons separated by comma?

I think it is possible in Python but I have little experience in this..


texts: Multiple Google fusion table layers with queries using javascript

texts:
I am making a web mapping application using Google fusion tables and JavaScript. Earlier I had only one Layer on it, but now I have to put another layer. Both the layers have bunch of queries. I am following the online examples but it is not working. Below is my initial code before applying any queries. The first layer is coming but as soon as i put the function for second layer, the first layer disappears. Also the query result is produced as a JSON.

var tableid_1 = 3775xxx;
var tableid_2 = 4313xxx;
var layer_1, layer_2;
var queryUrlHead = 'http://www.google.com/fusiontables/api/query?sql=';
var queryUrlTail = '&jsonCallback=?';
var zoom = 7;
var latlng = new google.maps.LatLng(3xy.7996, -11x.1668);

function initialize() {

var myOptions = {
    zoom : zoom,
    center : latlng,
    mapTypeId : google.maps.MapTypeId.TERRAIN,
    mapTypeControl: true,
    mapTypeControlOptions: {
    style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
    position: google.maps.ControlPosition.TOP_LEFT
},
    scaleControl: true,
    scaleControlOptions: {
    position: google.maps.ControlPosition.BOTTOM_LEFT
},
};

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    // first layer//

layer_1 = new google.maps.FusionTablesLayer(tableid_1);

layer_1.setMap(map);
layer_1.enableMapTips({
        select: "'Name'",
        from: tableid_1,
        geometryColumn: 'Location',
        suppressMapTips: false,
        delay: 50,
        tolerance: 5
});
    addListeners();

layer_1.setQuery(qry);

var col_list = 'Name';

if(order_list && order_list !== 'Name') {
    query += " ORDER BY " + order_list;
}

var queryurl = encodeURI(queryUrlHead + qry + queryUrlTail);

$.ajax({
    type : "GET",
    url : queryurl,
    dataType : "jsonp",
    success : dataHandlerCallback,
    error : function() {
        alert("AJAX ERROR for " + queryurl);
    }
});
}


texts: QGIS Atlas Feature for multiple polygons with same attribute

texts:
I have a shapefile of city blocks in a given city. Each polygon represents an individual lot, but the attribute table includes a column called "sector", that denotes the zone of the city that the lots are in. There are multiple lots per sector, shown in different colors in picture below:

I would like to automate the generation of a map of the city blocks for each sector. It appears that the Atlas feature will do what I want, but from what I gather the Atlas feature will create a map for each polygon. How do I have the Atlas produce a map for all polygons that share the same attribute together, instead of individually?


texts: What type of interpolation to visualize metal detection survey data?

texts:
I have about 500,000 points collected in a linear grid pattern over a 1 km2 area.  The points were collected as part of a metal detection survey. Each point has X,Y and Coil Response mV (min -675.38 max 6104.25) values.

What type of interpolation should be used to visualize the results?


texts: How can I identify points that share similar attribute with polygon features based on the attribute & distance between the two?

texts: For Example; if both the point & polygon features have an ID field, I need to flag the points if they share the same ID as a neighboring polygon & are w/in 2000ft of each other.  I have tried a spatial join, but I am having problems choosing the correct parameters to identify the points correctly. I have already created buffers around the points for the distance, but I am unsure how to select by location based only on matching attributes. It's selecting ALL the buffers.


texts: Filling in attribute data in QGIS; entered data is erased when saved

texts: I have encountered a very frustrating issue for as long as I have used QGIS, across all versions I have used (up to 3.14). I believe it happens with shapefiles only but I have not verified the issue with all other vector formats. Here's what happens: I open a shapefile's attribute table, enter edit mode, begin entering text into the various text formatted attribute columns (i.e., going from NULL to a value of some sort), and either exit edit mode or click the save icon. More often than not, some or all of the text edits I just made simply disappear as if I never filled those cells in at all. After I save once, this issue does not persist, so my workaround is to save immediately after entering edit mode, whether or not I've made any edits, which seems to prompt QGIS to record edits properly. Being human I often forget to employ my workaround, and become quite frustrated when my hard work is (counterintuitively) erased when I click the save button. Has anyone else experienced this and is there an easy fix?


texts: shp2pgsql: not found on Debian 10 PostgreSQL 13

texts:
I have installed PostgreSQL 13 by using the following repository
deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main

and I have installed PostGIS using
apt install postgresql-13-postgis-3

However shp2pgsql is not installed on my machine. I thought about installing the postgis package by the following command
apt install postgis
However it tries to install packages related to PostgreSQL 12 instead of PostgreSQL 13 which is the version installed on my server
The following NEW packages will be installed:
  postgis postgis-doc postgresql-12 postgresql-12-postgis-3 postgresql-12-postgis-3-scripts postgresql-client-12

What do I need to do to get shp2pgsql installed?


texts: FME Desktop 2019.2 Geodatabase_SDE writer copies Dataset parameter from reader when I said not to

texts:
I'm using FME 2019.2, Geodatabase_SDE reader and writer with different connection files.

I have one database "Operations" with user1 and another database "Data_Sources" with user2. They both support geometric data used in ArcGIS. I try to read from Operations.user1.featureclass1, and write to Data_Sources.user2.featureclass2.

Operations.user1.featureclass1 is in a dataset "ops". I'm tryng to just write a standalone featureclass in Data_Sources, so i am leaving the Feature Dataset parameter as blank. However, seems that no matter what i try, the error keeps getting thrown that I can't do the operation because I'm not the database owner. And the log says it was trying to write Data_Sources.user2.featureclass2 to the Operations.Ops dataset.

The message is:

Geodatabase Writer: Creating feature class `User2.Featureclass2' in feature dataset 'Operations.User1.Ops'

An error occurred while attempting to create the feature class 'User2.Featureclass2'. The error number from ArcObjects is: '-2147220969'. The error message from ArcObjects is: {Must be the owner to perform this operation.}

A fatal error has occurred. Check the logfile above for details

I am able to read from Data_Sources and create a new featureclass in the same Data_Sources gdb using Geodatabase_SDE reader and writer.
Also, it seems to be ok when I use SDE30 legacy reader: I am able to create and write a featureclass in the other database, so this way I am able to achieve what I want. The issue is just when I read from the other database using Geodatabase_SDE. And unfortunately, the legacy reader isn't supported anymore, so I need to solve this using Geodatabase_SDE reader.

Why does this Geodatabase_SDE writer keep trying to write to a dataset (seems to be based on the source data) when I am trying to tell it not to?


texts: Using Spatial join for many to one relates in ArcGIS for Desktop?

texts:
I'm trying to do a spatial join that takes the attributes of multiple polygons and applies them to a single polygon in another layer. The data is currently in a geodatabase, but can be exported to shp if needed.

In the example below I want to end up with polygon 1 also having the attributes of the features that intersect it so A, B and C. The output doesn't have to remain as a single feature so the output layer would have features 1A, 1B and 1C.

I am using ArcGIS 10.1 for Desktop.

To clarify, the output would need to maintain the geometry of 1 for all 3 output features so that they have the same area and 3 different sets of attributes rather than splitting the feature into 3 parts.


texts: Spatial Join of two Feature Classes with a condition using ArcMap

texts:
I have two Point Feature Classes: the first contains manholes incl. the invert elevation the second file contains road gullies and their invert elevation. Both files have roughly 10,000 to 20,000 features.

Now I want to run a Spatial Join (ArcMap 10.5) to connect each road gully to the closest manhole that has an lower invert elevation than the gully. I'm familiar with Spatial Join, so getting the closest connection (2. Condition) is not a problem, but I'm not sure how to achieve that the connection is  made to the manhole that is lower then the road gully (1. Condition).

Update:
I think I might have found a solution, its super slow though. So what it does is Iterate through the rows of the Gullies, determine the Gully-Invert-Level (InvLvl) and use the InvLvl as condition to create a Feature Layer of the Manholes for Manholes that have an Invert Level < InvLvl (Expression: InvertLeve < %InvLvl%). Afterwards it simply does a Spatial Join (Closest) and saves each row as a feature. Based on the Collect Values Tool I merge those afterwards. I think the fact that each row gets saved separately makes this model pretty slow.

Any Ideas how this might work faster?


texts:
I've got one shapefile with bus lines and the sum of their passengers. Unfortunately, some lines are sharing some sections. I want to show exactly how many passengers are on theses sections, so I explode the lines to get a smaller interval. Now I want to sum the passengers on each section but I really don't know how. As I said, all the data is just in one shapefile.

I tried to merge but without any section without any success. Do you know how I can merge according to their location?

If that's not possible I tried also to make one shapefile for each bus and afterward I tried to clip it. Unfortunately, I'm also not able to clip and sum up the fields.

I just want to merge these three layers and sumarize the values from "Linie_Lo_3".


texts:
can I make a request so that I can customize the output tags.
    [out:json];
(
  area[name="Braunschweig"];
  ) ->.a;
(
  area[postal_code="38114"];
  ) ->.b;
way(area.a)(area.b)[name="Celler Heerstraße"];
out geom;

This query will return me all the tags that the "Celler Heerstraße" has. Another tag is to be added in the output. This should carry the place in which the street is located. If I ask for a street in "Braunschweig" as in the example, "Braunschweig" should be included as an attribute in the tags in the file. Is this possible?


texts: The dataset 'left_right_merge' at the bottom of my screen shot shows the dataset that I'm currently working with.  The NODE values indicate a single point feature, but is duplicated with many attributes.  I want to collapse the dataset so that it looks like the 'test_data_nodes' at the top of the screen shot.  How would I do this in python?


texts: How to define KML Name element when using QgsVectorFileWriter?

texts:
I am trying to use QgsVectorFileWriter to write a kml file from an active layer in QGIS, but cannot figure out how to define the KML Name element (called NameField in the QGIS save-as GUI) to correspond with a field in my shapefile, which is called "TYPE".

This code does not cause an error, but I cannot figure out how to define StringList to specify that the NameField column name is "Type":

QgsVectorFileWriter.writeAsVectorFormat(layer, kmlPointFile, "UTF-8", None, "KML", onlySelected = 0, datasourceOptions = StringList)


texts: How to SUM field, insert SUM into new field based on FIELD

texts:
This is a continuation of my previous question in an effort to build upon it.

  How to SUM field and then insert into NULL column?

Given the examples of my data below, I  would like to be able to SUM a column (QUANTITY_SOLID) based upon a field, such as 'SEGMENT_LENGTH', and have the cursor write the SUM into a new field pertaining only to that field that it belongs to. So, in my example, this would be useful because the amount of 'QUANTITY_SOLID' material being disseminated onto a road is broken up into 'SEGMENT_LENGTH' which is a road segment. My previous question allowed for me to calculate the total of 'QUANTITY_SOLID' but it was for all roads (or all roads that were in my specific query). In order to do some GIS analysis and show which roads received heavier application and overall larger quantity total, I want there to be a separate SUM for each 'SEGMENT_LENGTH'.

In general, I am not looking for someone to write the code for me or to necessarily solve this specific issue. My larger question, so I can learn for future coding, is how do I go about coding some sort of 'WHERE' clause in Python where I could be more flexible with my current script?

Thanks in advance for any help!

This is my previous code (Thanks to Aaron):

import arcpy

# Define the feature class
fc = r'C:\path\to\your\fc'

# Use a generator expression to populate a list from the 'QUANTITY_SOLID' field
b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID'))

with arcpy.da.UpdateCursor(fc, ['QUANTITY_SOLID_SUM']) as cursor:
    for row in cursor:
        row[0] = b
        cursor.updateRow(row)


texts: Converting PLUTO coordinate reference system in QGIS?

texts:
I am using New York's PLUTO lot data in QGIS for a project.

Right now, the shp file automatically imports with a custom CRS, allowing it to visually line up with a separate layer of subway entrances (with that subway layer using WGS84).

That all works fine visually, with both layers overlaying each other on my map.

However, when I attempt to do some analysis in python on my PLUTO features via print feature.geometry().centroid().asPoint() I find that instead of a lat/lon pair, I get a weird set of x/y coordinates with values in the hundreds of thousands.

I assume that this is related to some sort of "state plane" or "local plane" coordinate reference system.

What I would rather see is a set of coordinates closer to lat 40 and lon -73.

Is there any way to convert my PLUTO layer so it will act more like a WGS84 layer?

Here is the CRS that gets displayed in the "Layer Properties" dialogue box: Selected CRS (USER:100000, * Generated CRS (+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towsgs48=... (at which point the screen cuts off the extended text).

Simply using the "save as" dropdown on the layers palette to resave the layer as a WGS84 shapefile does not solve this problem. The new shapefile generated by that process still imports with a custom CRS, and analysis of that generated shapefile still returns coordinates like x:997248.532881, y:221815.926017. So this does not seem to be a duplicate of the flagged-as-duplicated problem.


texts:
Please help me add "Google Satellite" to my web map by following the code below:
Ext.onReady(function() {

   Ext.QuickTips.init();

        var bounds = new OpenLayers.Bounds(
                    -180,-90,180,90
                );

    var options = {
                  maxExtent: bounds,
                   // maxResolution:  0.222,
                    projection: "EPSG:4326",
                    allOverlays: true,
                    units: 'degrees',
                    //center: new OpenLayers.LonLat(23,77),
                    zoom: 5,
                    //controls:[new OpenLayers.Control.MouseDefaults()]
                };

                var map = new OpenLayers.Map('map');

                var OSM_base = new OpenLayers.Layer.WMS(
                    "OSM_base", "https://ows.terrestris.de/osm/service?",
                    {
                        LAYERS: 'OSM-WMS',                                             //  tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    { isBaseLayer: true,
                    displayInLayerSwitcher: true,}
                );

                var tasmania_water_bodies = new OpenLayers.Layer.WMS(
                    "tasmania_water_bodies", "http://localhost:8080/geoserver/wms",
                    {
                        LAYERS: 'topp:tasmania_water_bodies',
                        STYLES: '',
                        format: 'image/png',
                        //cql_filter: 'state_name == "BIHAR"',
                       tiled: true,
                        transparent: true
                      //  tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    {
                //  tileOptions: {maxGetUrlLength: 2048},
                    displayInLayerSwitcher: true,
                    isBaseLayer: false,
                    //singleTile: true,
                    transitionEffect: 'resize'
                    }
                );

                var tasmania_roads = new OpenLayers.Layer.WMS(
                    "tasmania_roads", "http://localhost:8080/geoserver/wms",
                    {
                        LAYERS: 'topp:tasmania_roads',
                        STYLES: '',
                        format: 'image/png',
                        //cql_filter: 'state_name == "BIHAR"',
                       tiled: true,
                        transparent: true
                      //  tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    {
                //  tileOptions: {maxGetUrlLength: 2048},
                    displayInLayerSwitcher: true,
                    isBaseLayer: false,
                    //singleTile: true,
                    transitionEffect: 'resize'
                    }
                );

            map.addLayers([OSM_base,tasmania_water_bodies, tasmania_roads]);


texts: Reduce Image Collection to Sum when Image do not always overlap in Google Earth Engine or rgee?

texts:
I am trying to generate a single image that is the sum of 16 images. Some of the pixels in the 16 individual images do not overlap with each other.
I have tried
ColG2 <- ee$ImageCollection(list(low13g2,high13g2,low14g2,high14g2,low15g2,
                                 high15g2,low16g2,high16g2,low17g2,high17g2,
                                 low18g2,high18g2,low19g2,high19g2,low20g2,
                                 high20g2))
ColG2$getInfo()
Map$addLayers(ColG2)
sG<-ColG2$reduce(ee$Reducer$sum())

sGvis <- list(
  min = 0,
  max = 80000,
  palette = mypalette,
  opacity=1,
  bands="band1_sum"
)

Map$addLayer(
  eeObject = sG,
  visParams = sGvis,
  name = "sum_g",legend=TRUE)

When I map ColG2, I see a map of all the layers. When I try to may sG, the map is blank. What am I doing wrong?


texts:
I've created a small API to wrap ArcEngine controls so I can customize them (my own toolbars, my icons, etc) and I'm having problem with the ControlsEditingSketchToolClass control.

I basically have a command pool that gets initialized against a AxMapControl and if it's a tool and set the tool to be the current map tool. If it's a command i just execute it.

Looks like it works fine for other commands and tools (pan, zoom, select all, unselect, select features) but not for Sketch Control. When I try to activate it, it is always disabled.

According to ESRI docs:

  The CLSID of this command is: {13B234E8-3B30-49CA-9967-4C76F7231AD6}.

  This command works with the ToolbarControl, PageLayoutControl and
  MapControl.

  If the ArcGIS Engine application using this command is initialized
  with an ArcGIS Engine Runtime license or an ArcView license, this
  command can be used to edit shapefiles and personal geodatabases.

  If the ArcGIS Engine application using this command is initialized
  with an ArcGIS Engine GeoDatabase Editing license, or ArcEditor or
  ArcInfo, this command can be used to edit data within an enterprise
  geodatabase.

The edit session is in place and it's using my map and my workspace for sure!

In my command pool I'm also sure that I call the OnCreate method using ICommandPoolEdit.CallOnCreate()

Here's the method I use for activating the tool/command:

    public virtual void Activate(IExecutionContext context)
    {
        System.Diagnostics.Debug.Assert(context != null);

        if (Checker != null)
            if (!Checker.HasPermission(context, this))
                throw new NotAllowedException("This command cannot be execute using this execution context");

        if (TargetType == typeof(AxMapControl))
        {
            var map = (AxMapControl)_registry.Hook;

            if (_innerCommand is ITool && _innerCommand.Enabled)
            // this tool is ALWAYS DISABLED
            {
                map.CurrentTool = ((ITool)_innerCommand);
                return;
            }

            if (_innerCommand is ICommand && _innerCommand.Enabled)
            {
                _innerCommand.OnClick();
                return;
            }
        }

        if (TargetType == typeof(AxPageLayoutControl))
        {
            var map = (AxPageLayoutControl)_registry.Hook;

            if (_innerCommand is ITool && _innerCommand.Enabled)
            {
                map.CurrentTool = ((ITool)_innerCommand);
                return;
            }

            if (_innerCommand is ICommand && _innerCommand.Enabled)
            {
                _innerCommand.OnClick();
                return;
            }
        }

        _stats.SessionUsageCount++;
    }

Any tips?


texts: calculate a similarity index between different scaled rasters

texts:
I am looking for a method in a R-Package to come up with an index value that represents the similarity and dissimilarity between multiple, different scaled, input rasters. These multiple input rasters could be: elevation, slope, rainfall, temperature, etc.

The multiple input rasters should be normalized/standardized. Then, using a certain method(?), generate one raster/map with values ranging between 1 (high similarity) and 0 (low similarity) between the multiple input rasters. I have been reading into methods, considering e.g. Principal Component Analysis (PCA) and Multivariate Environmental Similarity Surfaces (MESS), but could not come up with a solution to get what I want so far. Any tips on which method and R-package could perform the above?

EDIT: Let me provide some more context:
For my research, I need to place camera traps to monitor wildlife. But in order to make my research statistically robust, I would like to place camera's at locations that have similar conditions, such as similar yearly rainfall, temperature, elevation, slope, etc. (which probably means there will be some Multi-collinearity).

the output should then return an index value (between 0 and 1), where 0 = pixels with dissimilar conditions and 1 = most similar conditions (thus suitable for camera traps).

library(raster) # copied from RobertH
r <- raster(nrow=5, ncol=5)
set.seed(20181901)
s <- stack(lapply(1:5, function(i) setValues(r, runif(25, max=50))))

scalefun <- function(r) {
(r - minValue(r)) / (maxValue(r) - minValue(r))}

ss <- scalefun(s)
...some method on ss

If my request is not feasible, are other options then to perform a:

Unsupervised classification (on output ss), but then I would receive classes instead of an index value. (see example code below)?
Simply go criteria based, by selecting thresholds (e.g. Elevation > 100 & Elevation < 200)? But I prefer to not use that option..

Unsupervised classification (multi-collinearity not considered yet)

install.packages('RStoolbox')
library(RStoolbox)
test <- unsuperClass(ss, nSamples = 10000, nClasses = 5, nStarts = 30,
         nIter = 100, norm = F, clusterMap = T,
         algorithm = "Hartigan-Wong")
plot(test$map)


texts: How to transform a GeoTiff DEM to png tiles encoding elevation as RGB colors

texts:
I want to convert a GeoTiff DEM file, to PNG tiles where the elevation is encoded as RGB colors with a formula like that :

-10000 + ((color.r * 256 * 256 + color.g * 256 + color.b) * 0.1)

I know how to do the raster Geotiff to PNG tiles with Global Mapper or GDAL, but I don't know how to make to colourize the elevation with tri-linear interpolation like the formula.

I tried with Global Mapper and a grayscale shader between min an max elevation, but the elevation is as a consequence only encoded in 8bit, and it is not precise enough.

The same with gdaldem color-relief, the color configuration file only do linear interpolation between 2 elevations and colors so it is the same as a grayscale and result in 8bit precision. Or i would have to give a 255*255 long color configuration file to express the tri-linear interpolation as a linear interpolation.

I am not sure if gdal-translate can expand the elevation band as 3 band in RGB.

I am thinking of doing a python program to do it now, but before losing time I want to know if there is other options.


texts: Rasterizing multiple features using rasterio?

texts:
I am trying to apply the rasterio.features.rasterize function in order to obtain a zonal statistics from a vector file containing multiple vectors.

Despite my efforts, I have been unsuccessful in this task. All I can do is rasterize one single shapefile-feature-file per time.

Would anyone know how to properly rasterize multiple features using rasterio?

My ultimate goal would be an algorithm so that:

For each iteration, each vector feature would produce a single matriz mask in memory. This memory-matriz would then be applied over my raster data with same dimensions as that one. Zonal statistics as (mean, maximum, minimum, std, var) would then be inserted as new properties of each rasterized feature of my original vector (shapefile) file.


texts: Getting ERROR 000800 keyword used is not member of list of acceptable keywords from ArcPy?

texts:
I'm trying to use arcpy.AddFieldToAnalysisLayer_na using a network analysis layer

def fonction(network):
 in_network_dataset = network
 out_network_analysis_layer = "Best_Route"
 impedance_attribute = "length"
 field_name = "IIDTSTARCO"
 field_type = "LONG"

#I create my network analysis layer
 arcpy.MakeRouteLayer_na(in_network_dataset,out_network_analysis_layer,impedance_attribute)

#and then I want to add a field to PolylineBarriers sublayer

 arcpy.AddFieldToAnalysisLayer_na(out_network_analysis_layer, "PolylineBarriers", field_name, field_type)

When I run the script I get the following error:

ERROR 000800: The value is not a member of  Stops | Barriers | Routes | PolylineBarriers | PolygonBarriers

while "PolylineBarriers" is in the list


texts: How to Print from free version of CartoDB?

texts:
I am  trying to export the maps into a MS Word document and cannot find a way of doing it. Currently  I am having to screen print to Photoshop and then cut and paste into a document. The problem is the narrow viewable screen area limits what can be seen at once and the resolution of this method is poor.  Is there another way?

I am a complete novice so if you can offer me advice I would be most grateful but can you do it in simple terms.


texts: Proj4Leaflet create CRS scales/resolution from WMTS getCapacilities ScaleDenominator

texts:
I trying to set up the CRS scales/resolution for a map accordingly to the provided information of an WMTS getCapabilities request. At the moment I'm playing with the following service.

The service provides me with the following TileMatrix information:

<TileMatrix>
  <ows:Identifier>00</ows:Identifier>
  <ScaleDenominator>1889880.95238</ScaleDenominator>
  <TopLeftCorner>200000.0 6075000.0</TopLeftCorner>
  <TileWidth>256</TileWidth>
  <TileHeight>256</TileHeight>
  <MatrixWidth>3</MatrixWidth>
  <MatrixHeight>2</MatrixHeight>
</TileMatrix>
...

Based on an OpenLayers example from this source the resolutions should be:

[
   529.166666667,
   ...
]

I've created a fiddle that uses the resolutions specified in the example. Using these informations the map displays as expected. But how do I calculate the resolution based on the provided ScaleDenominator?


texts: Result of ST_Contains gives false positive

texts:
I am trying to figure out the state that Berlin is in. So now my query SELECT * FROM states WHERE ST_Contains(Geo, Point(13.383068, 52.530644)); return two results. One for Berlin which is correct, but also Brandenburg which is surrounding Berlin. See the attached graphics.
So it seems that ST_Contains does not account for the hole inside.

Currently the geospatial column is of datatype MulitPolygon.

Is there any other my-sql function that I can use to only find the correct state?


texts: Find distance from a point to linestring

texts:
I have table (shapetable) with my coastline shapefile loaded. I have another table (pointtable) with lat/long points. Wondering how would I go about writing a SQL query to find the distance between the lat/long points and the shapefile. The shapetable has a geography type attribute, from my reading it appears that geometry type linestrings  and geography are one and the same.

Appreciate the help

EDIT: Being relatively a newbie at this, I'm not using PostGIS. I am using SQL Server 2008. I imported the shapefile using a shape2sql utility. The table has a bunch of shapefile attributes and also the geography data type. If I understand this correctly, the geography binary data is nothing but linestring of geometry data type (I'd verify this by running a stgeoemtrytype() on the column)

I have another table with a bunch of lat/long. I want to implement a solution where by I want to get distance from the shapefile, using stdistance. One confusing part I found in going through a bunch of documents was that, given a geography data type, how could I find out the linestring coordinates.


texts: Setup attribute defined Hyperlinks in ArcGIS Online Pop-up

texts:
I have 2 fields Asset_Name and Website. Asset Name is just a text name and Website is a URL to the website. I am trying to setup a Pop-up that has a Hyperlink where the link text is from the Asset_Name field and the URL is from the Website field. When I set it up using the GUI with {Asset_Name} in the Text field and {Website} in the URL field the Pop-up still shows the URL as the Hyperlink Text. I also tried using HTML source code Website: {Asset_Name} with no change in the result.

This issue is some URLs are really long and make the pop-up crowded if not truncated somehow. Additionally, I would also like to find away to drop the hyperlink entirely if that specific feature doesn't have a listed website.


texts: Using ModelBuilder to iterate row and calculate field (code block)

texts:
I would like to use "iterate row selection in ModelBuilder" and for each row, I want to use the field calculator's code block to create a conditional statement that goes:
If field=0 then go to the next row.
if field=1, go back to the previous row and assign the field with a new value based on an equation, then stop.


texts:
I set up my own tile server starting with the switch2osm tutorial to which I added contour lines and hillshading. It is based on openstreetmap-carto which is obviously CartoCSS, but when I tried to find a way to edit the styling faster and easier I noticed that TileMill is pretty much abandoned and that most modern tools output JSON.

Is it worth sticking to CartoCSS, (if yes, please recommend a working editor), or shall I switch to the newer JSON based styling?


texts: Splitting One Polygon By Boundary of Another using QGIS?

texts:
I'm using QGIS 3.0 and attempting to calculate the number of people that fall within a buffer.  The population count is a field within my block group polygon layer.  I've attached a screenshot, the orange polygons are my block counts and the purple layer is my buffer.

At first, I created a point layer where each yellow point represented 50 people in a block group (visible in the pic below), then I randomly placed the points throughout the polygon.  I was going to just count how many dots fall within the purple polygon and multiply by 50, but my gut tells me this isn't a very accurate measure.  Or maybe it is, since population is not uniformly distributed to begin with.

I have a field in my block group layer that provides the surface area in square miles, the total population, and the population per square mile, so with all that info I should be able to more accurately clip my block group layer by the boundary extent of the purple buffer, and the output should give me only the number of people who fall within the purple.  I've tried a simply clip, but the output shows the same surface area & population as before the clip-the field info isn't updated.

I've also tried digitizing, converting the polygon to lines and digitizing to conform to the boundary of the purple buffer, but it seems like a messy and complicated process for a seemingly simple task.

Maybe I'm overcomplicating things..suggestions?


texts: Unable to open IWorkspace using IWorkspaceFactory with operating system authentication

texts:
I'm trying to open a workspace from the IWorkspaceFactory interface. Here's what I'm trying at the moment:

ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = (ESRI.ArcGIS.Carto.IFeatureLayer)pLayer;
ESRI.ArcGIS.Geodatabase.IFeatureClass oldFeatureClass = featureLayer.FeatureClass;

IPropertySet propertySet = new PropertySetClass();
propertySet.SetProperty("INSTANCE", newData.instance); //sde:sqlserver:(servername)
propertySet.SetProperty("DATABASE", newData.database); //(databasename)
propertySet.SetProperty("AUTHENTICATION_MODE", newData.autMode); //OSA
propertySet.SetProperty("VERSION", newData.version); //sde.DEFAULT

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);

IWorkspace workspace = workspaceFactory.Open(propertySet, 0);

For my properties I have also tried the following:

propertySet.SetProperty("SERVER", serverName);
propertySet.SetProperty("INSTANCE", "sde:sqlserver:(database)");
propertySet.SetProperty("DATABASE", "SDE");
propertySet.SetProperty("AUTHENTICATION_MODE", newData.autMode); //OSA
propertySet.SetProperty("VERSION", newData.version); //sde.DEFAULT

I know that the property settings are the issue as when I try using

propertySet.SetProperty("SERVERINSTANCE", serverName);

It shows the new connection dialog.

To give you an idea of my values, I consider Instance in this window to be the server name. I consider database to be the database name. This should give you an idea of what I'm setting my values as.

Is there a property value that I'm missing or a value that is incorrect?

Edit: Based on comment I have added a revised property set that brings up the database connection screen still, but everything is filled out. However, users can still edit the authentication type, which for some people may be confusing. I would like to just skip that screen and have it connect without any user input.

propertySet.SetProperty("SERVERINSTANCE", "(instance)\\(database)");
propertySet.SetProperty("DBCLIENT", "SQLServer");
propertySet.SetProperty("VERSION", newData.version); //sde.DEFAULT
propertySet.SetProperty("AUTHENTICATION_MODE", newData.autMode); //OSA

I have tried entering my Operating system authentication credentials under

propertySet.SetProperty("user", "username");
propertySet.SetProperty("password", "password");

However, this still shows the screen and the credentials aren't filled in on the form. (The screen I'm referring to is the database connection form screenshot above.)


texts: Call dot net library function from python in QGis

texts:
I have created one custom library (.dll) in Dot net. Now, i want to use that dll in my QGis plugin. How i can integrate that?

For an example i have one function in library which is used to read excel file and dump all the data in database. so from QGis plugin i will browse the excel file and using the library i will read excel data and dump data in my database. all the database related operation will be perform by library.


texts: Problems enabling the postgis_raster extension, postgis_raster.control seems to be missing

texts:
I am a student and to learn more about PostGIS. I installed it to my Raspberry Pi, so that I can remotely access it via my laptop. The installation worked with the exception of the raster module.
When I execute CREATE EXTENSION postgis_raster; I get the following Output:
SQL-ERROR [58P01]: ERROR: could not open extension control file
"/usr/share/postgresql/11/extension/postgis_raster.control": No such file or directory

This was rather unexpected since all the other extensions e.g. postgis_topology or postgis_sfcgal worked fine. The file is indeed not in the directory.
Here is a quick overview:
OS = Raspberry Pi OS
POSTGIS= 2.5.1 r17027
PGSQL= 110
GEOS= 3.7.1-CAPI-1.11.1 27a5e771
SFCGAL= 1.3.6
PROJ= Rel. 5.2.0
GDAL= GDAL 2.4.0
I enabled all the GDAL drivers SELECT short_name FROM ST_GDALDrivers();returns 144 drivers that are enabled. Also raster2pgsql is installed.
Am I missing something here? From what I understand since 2.0 ships with the raster extension disabled, how can I activate it?


texts: FME list index number as attribute value

texts: I have created list which has same road name but several separated segment. These has sorted using length of road lines (ListSorter). The list index inside () shows length order which road segment has the longest. I need to save this list index as attribute. How to make that?


texts:
The script below is slightly modified "Polyline example" from ArcGIS help http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000008000000

import arcpy
# next 3 lines are new
from arcpy import env
env.outputZFlag = "Enabled"
env.outputMFlag = "Enabled"

# A list of features and coordinate pairs
# 3rd presumably Z coordinate added to original pairs of XY
feature_info = [[[1, 2, 1], [2, 4, 2], [3, 7, 3]],
                [[6, 8, 4], [5, 7, 5], [7, 2, 6], [9, 5, 7]]]

# A list that will hold each of the Polyline objects
features = []

for feature in feature_info:
    # Create a Polyline object based on the array of points
    # Append to the list of Polyline objects
    features.append(
        arcpy.Polyline(
            arcpy.Array([arcpy.Point(*coords) for coords in feature])))

# Persist a copy of the Polyline objects using CopyFeatures
arcpy.CopyFeatures_management(features, "d:/scratch/polylines.shp")

I try to create 3D polyline and fail. Script creates polylineZ shapefile, but all features are flat with Z=0 at vertices. What is wrong here please?


texts: What is command to edit markup in Geocortex?

texts:
"DrawingToolsRegion" in a Geocortex Essentials 2.5 toolbar provides too many options for editing markup/drawings.  It is possible to construct a set of custom buttons that use the underlaying commands of the region -- AddMarkup, ClearMarkup, etc.  However the documentation has no information about a command to edit markup.

Is anyone familiar with the command I am looking for?

Or alternatively, is there an easy way to remove most of the markup shapes from the DrawingToolsRegion?

I am just trying to allow for rectangles and polygons to be used.  This is for Silverlight Viewer 2.5.


texts: QGIS turns very slow when adding plenty of style categories

texts:
I have a traffic signals layer that has 500 categories in its style config (one different svg for each signal type):

The problem is that as I add new categories QGIS Map turns slower and slower. After having all the categories added I can pan and zoom ok but from time to time (every 20 seconds aprox.) it gets stuck thinking for about 15 seconds...

If I delete categories and leave only 200 categories it also gets stuck but for 6-7 seconds...looks like it is something quite proportional; The more categories the slower the map.

I also tried distributing those 500 categories between 5 layers but the performance is very similar...

What is the cause of the problem?
Is there any workaround/solution?


texts: Iterating Loops in ModelBuilder of ArcMap 10.6.1?

texts:
I am trying to iterate through rows of a table, amass a list of distance values and then use those values as the Distance parameter in the Multiple Ring Buffer tool.

All of this works great, except 1 important detail: IT WON'T STOP LOOPING.

It goes through the tools fine. Generates the buffer output. Then starts looping again. I did each step by manually and it doesn't cause a problem. It is just that Iterate Row Selection will start the model over.

I looked into the properties of Iterate Feature Selection and model itself. The only thing I could find about controlling the interations was the tab below, but it is all grayed out.

Edited: I got the model to a point where it doesn't return errors. However, it iterates collecting the distance values. On the first iteration, it creates the buffer for -0.5. Then it starts the iteration over and overwrites the buffer feature class with a buffer for -0.5 and -0.65. Then it starts over and collects the values for -0.5, -0.65 and -0.84.  Then overwrites the buffer feature class with this new buffer feature class. And so on and so forth. Each time the CollectValues parameter increases by one. I want it to collect all of the values then put them into the Multiple Buffer tool. I am not sure why it  starts the iteration over. My model follows the examples ESRI gives for the tool.

Data:
 Distance
-0.50000
-0.65000
-0.84500
-1.09850
-1.42805
-1.85647
-2.41340
-3.13743
-4.07865
-5.30225
-6.89292
-8.96080
-11.64904
-15.14376
-19.68688


texts:
I am using the NetCDF4 library for Python but cannot find how to set the projection to WGS84.

import netCDF4 as nc

dsout = nc.Dataset(outfile, 'r')

time = dsout.createDimension('time', 0)
lat = dsout.createDimension('lat', rows)
lat = dsout.createVariable('lat', 'f4', ('lat',))
lat.standard_name = 'latitude'
lat.units = 'degrees_north'
lat.axis = "Y"
lat[:] = lats
lon = dsout.createDimension('lon', cols)
lon = dsout.createVariable('lon', 'f4', ('lon',))
lon.standard_name = 'longitude'
lon.units = 'degrees_east'
lon.axis = "X"
lon[:] = lons
times = dsout.createVariable('time', 'f4', ('time',))
times.standard_name = 'time'
times.long_name = 'time'
times.units = 'hours since 1970-01-01 00:00:00'
times.calendar = 'gregorian'
acc_precip = dsout.createVariable(
    'acc_precipitation_amount',
    'f4',
    ('time', 'lat', 'lon'),
    zlib=True,
    complevel=9,
    least_significant_digit=1,
    fill_value=-9999
)
acc_precip.standard_name = 'acc_precipitation_amount'
acc_precip.units = 'mm'


texts: Finding nearest point using point dataset using QGIS?

texts:
I have created Geocode for some area and I couldn't find accurate Geocode's for few address. so I want to find the nearest POI for non accurated locations using accurated geocodes as referece in QGIS. I dont have any Road network also. Without road network i wanted to find it spatially.

How do i do that?


texts: Why Does Jupyter/IPython Fail to load GDAL?

texts:
I've been trying to put together some Jupyter Notebooks which demonstrate some GDAL functionality but when I do from osgeo import gdal I get ImportError: DLL load failed: The specified procedure could not be found.

GDAL imports with no issues using my regular Python environment so I'm wondering what is preventing this import in the Jupyter environment.

I have verified, in both my Python environment and the Jupyter environment, that the sys.path items are similar and also that osego.__init__ successfully finds the _gdal.pyd file. The failure for Jupyter is when it tries to load this file using the imp module's load_dynamic function.

I have found a couple of related questions on this site and on Stack Overflow. This question remains unanswered, this one fails for a different reason, and this one from SO has some solutions for the Anaconda distrubtion.

I'm running Windows 10 with Python 3.7. and have yet to find an authoritative answer to this so would like to know if anybody has had the same issue and resolved it.

UPDATE

I have tested this on two install methods

GDAL 2.4 installed from GIS
Internals
and Jupyter installed via pip
Pipenv install of GDAL 2.4 and Jupyter

Method 1 results in the error described above, whilst method 2 works successfully.

In the site-packages\osgeo folder the pipenv-installed version includes the gdal204.dll file that _gdal.pyd loads. Using the GIS Internals installers this dll is in C:\Program Files\GDAL. This directory is on my PATH environment variable and the DLL search order on windows will look in the PATH directories. It therefore seems that Jupyter is not following this search order.


texts:
I would like to download some elevation data (DEM) from Ordnance Survey and then import it into something like Blender.

Ordnance Survey data comes in two flavours: GLM 3 and ERSI Shapefile.

How can I convert either of those formats to a format that is supported by Blender?


texts: Using feature's one-to-many statistics as graduated color symbology in ArcGIS Online application?

texts:
I've made a task oriented ArcGIS Online application that I like to improve: The application is about filling a numeric score field in a table for each row. Each row in the table is related to a feature service's layer row\feature.

How can I make the symbology of the related feature to be shown as a graduated color that is based on a statistic value (count, mean, sum etc.) of its related table rows?

I'm almost positive that the answer to this question can be achieved by using the ArcGIS Arcade new expression option, when used in the change style tab. The reason for this assumption, is I've already manged to so with the layer's pop-ups as specified here. So I think what I'm looking for now  is a syntax to represent this one-to-many relationship - something like this pseudocode:

  // return the average values of feature's related rows from a numeric score field Average($feature.relationships\0\NumericFieldNameFomRelatedTable)

--- Things I've tried ---

'Dive' quite deep in to the AGOL web map's interface.
Try to migrate it to ArcGIS Pro and somehow to fetch the pop-up's expression
find an alternative in web-appbuilder's widgets.

--- Thing's I need to go a little deeper ---

Arcade Expressions and You examples.
how to do this by python in ArcMap


texts: How to upload a shapefile to geoserver using cURL?

texts:
I need to automatically (using python) upload a shapefile into my geoserver.

I'm trying to do as described in here but i'm getting this error:

java.io.IOException: Wrong magic number, expected 9994, got 1347093252* Connection #0 to host localhost left intact

I'm sending this:

curl -u admin:geoserver -v -XPUT -H 'Content-type: application/zip' --data-binary @C:/x/test_data/localfile.zip http://localhost:8081/geoserver/rest/workspaces/test_VN/datastores/maisum/file.shp


texts: How worked with large shapefile using SharpMap?

texts: I use SharpMap for working with shapefile. Now shapefile is big and SharpMap take a long time to loading layers. Please tell me how I can speed up working with shapefile.


texts: The layer is not a valid layer and can not be added to the map - QGIS WFS

texts:
I created workspace, store and layer in Geoserver. Data source is SQL Server 2012. When I connected Geoserver WFS to QGIS, it worked. But when I tried to save changes to layer, it crashed with error "Can't commit changes" (something like that). I removed legend entry from QGIS, and tried to connect QGIS again, but now it is showing error the layer 'xxxxxx' is not a valid layer and can not be added to the map.
After recreating all on the Geoserver (workspace, store and layer), even with creating new database on MSSQL and pointing to it, it keeps showing me the same error. What is going on?


texts:
I have recently installed QGIS Server and Web Client 2 in the hopes of being able to share my map, that I made in QGIS, with some clients.

I've started my app with yarn and I'm now at a point where I can open the site on my local machine using the URL below:

localhost:8081

but when I try to access it from a remote computer in my network:

mycomputerIP:8081

I get an error saying that the connection has timed out.

There could be a problem with the Web Client
since I successfully called:

mycomputername/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

from the remote computer.

How can I access the website from a remote computer?


texts:
I am sending request to Arcgis Rest service and getting result as JSON object.

I want to zoom to this Ring array.

var extent = new OpenLayers.Bounds(extent.geometry.rings[0]);

I tried but did not work. I am new at OpenLayers.


texts: How to insert the result of ST_Intersection into another column when the result has multiple geometry types

texts:
In PostGIS I have three tables table1, table2 and table3 of same type:
CREATE TABLE tableX
(
    myid integer NOT NULL,
    wkb_geometry geometry(LineString,4326)
)

table1 and table2 are populated. I want to intersect the linestrings of table1 and table2 and insert the result into table3 like this:
insert into table3 (
    select
        table1.myid,
        ST_Intersection(table1.wkb_geometry, table2.wkb_geometry)
    from table1, table2
)

The result of ST_Intersection() is sometimes of type LineString and sometimes of type MultiLineString. Therefore I am getting an error:
ERROR:  Geometry type (MultiLineString) does not match column type (LineString)

And if I change the geometry type of table3 to MultiLineString I am getting the opposite error:
ERROR:  Geometry type (LineString) does not match column type (MultiLineString)

What is an elegant way to store the results of this intersection, but preserving the original information if the intersection was LineString or MultiLineString?
Is there no 'flexible' geometry type for columns which could hold results of both types?
( If possible I do not want to normalize the results with ST_Multi, because later I would need to decompose with ST_Dump )


texts: Transferring direction of polylines to another set of polylines in ArcGIS Desktop?

texts:
Is it possible to transfer a direction of polylines to another set of polylines?

I have a road network with "oneway" column in it. I do a series of operations on the network in ModelBuilder to prepare it for further analysis with Network Analyst (I am using ArcGIS 10.4).

However the direction of polylines is messed up (particularly after using "Unsplit"--"Feature to Line" tools).

Can I somehow extract the directions of initial lines and transfer it to result lines?

I can not do this manually, because the network is pretty large.

Maybe extract start-end points first, but how can I assign them to polylines as direction?

On the picture below: the red arrow is the original direction, the black arrow direction I get after using some tools in ModelBuilder.


texts:
I'm new to python and this is my script:

import arcpy,sys
input=sys.argv[1]
field=sys.argv[2]
try:
    cursor=arcpy.da.SearchCursor(input,field)
    getvalue=[row.getValue(field) for row in cursor]
    values=set(getvalue)
    print values
    del cursor
except:
    del cursor

When its trying to run cursor, the following error appeared:

Traceback (most recent call last):
  File "C:\Users\Erfan\Desktop\Script2.py", line 6, in <module>
    cursor=arcpy.da.SearchCursor(input,field)
RuntimeError: cannot open 'D:\gis\data\network'

By the way, I want to access a feature class inside a feature dataset in gdb.


texts: Multiple Together Several Fields, then Use Update Cursor

texts: Is it possible to preform multiplication on several fields of an attribute table together and then use an update cursor to assign the resulting value to a specific field?


texts:
I recently installed QGIS 3.2.2-Bonn on my 2014 Macbook pro running OSX 10.13.6 (17G65), however, I am unable to open the standalone browser tool that looks like this:

I am unable to open the browser tool because I cannot locate the standalone application. According to this website: QGIS Browser Tutorial

I should be able to locate the application in the following directory:

QGIS.app/Contents/MacOS/bin/QGIS Browser.app

but when I go to that path, there is no QGIS Browser.app file. All I see is this:

I downloaded and installed QGIS via the standard installer from the QGIS website:
Download QGIS

I'm just trying to open QGIS browser and instead where I expect the application to be located, it is not. Any ideas on this?


texts:
Hoping folks are tolerant of rank beginner questions.
I recently downloaded QGIS 3.12.3 running on a pc with windows 10.
I have my first project and map which looks good in print layout, but it looks very different when exported as a pdf or image file. For example way more fine (but unreadable) detail items showing up (like tiny city names and such). If I could just get an export that looked like what I see on my screen I'd be set.
Thanks


texts: Crop API Ordnance Survey map to working area size in QGIS

texts: I'm new to QGIS. I have downloaded the Leisure 27700 Ordnance Survey map.  But I want to crop it to just the area I am working on. How can I do this?


texts: Extend PostGIS polygon with 2 new points

texts:
I have a PostGIS polygon which has to be extended using two points like on the picture:
My original polygon is: POLYGON((10 20,10 10,20 10,20 20,10 20))
The points I would like to extend the polygon with: POINT ( 20 30 ) and POINT ( 10 30 )
It's very important that I would like to insert the Point2 as the first and the last point of the polygon. The Points1 should be in the last but one position. So the position of the new points is crucial.
What do you think, what is the best method to do this? Any suggestions?

UPDATE: I've find a solution, it works, but a little bit complicated:
SELECT ST_MakePolygon(ST_AddPoint(ST_AddPoint(ST_AddPoint(ST_RemovePoint(ST_ExteriorRing( ST_GeomFromText('POLYGON((10 20,10 10,20 10,20 20,10 20))')),
ST_NPoints(ST_GeomFromText('POLYGON((10 20,10 10,20 10,20 20,10 20))'))-1),ST_MakePoint(20,30)),ST_MakePoint(10,30),0),
    ST_MakePoint(10,30)));


texts: Adding lines and polygons on tablet with no right click button on the stylus

texts:
How do I end the digitizing of a line or polygon without a right click button on the stylus of a tablet.

If there is no built-in method I can create a button on a widget to either send a right-click action or some other code to complete the digitizing of the line.

I've no idea how to send a right click command in python. I've tried the following to add the feature but it adds a new feature instead of committing the partially digitized feature.

    layer = iface.activeLayer()
    feat = QgsFeature(layer.pendingFields())
    iface.openFeatureForm(layer, feat, False, True)


texts:
I am trying to open a JP2 file in QGIS and it fails, and I'd appreciate any advice to try and track down the cause of the issue, be it with my system or with the file itself.

The file is a HiRISE image of Gale Crater on Mars, and is available here: http://hirise-pds.lpl.arizona.edu/download/PDS/RDR/ESP/ORB_032400_032499/ESP_032436_1755/ESP_032436_1755_COLOR.JP2

On my ageing MacBook running QGIS 1.8.0 and GDAL 1.9.2 on Mac OS 10.7.5 the file does open in QGIS, but gdal can't deal with it...

$ gdalinfo ESP_032436_1755_COLOR.JP2
ERROR 4: `ESP_032436_1755_COLOR.JP2' not recognized as a supported file format.

I could use the file using QGIS on that machine, but I'd rather use my new laptop which runs GDAL 1.9.0 and QGIS 2.1.0-Master on Ubuntu 13.04 (I installed the Master version because of difficulties installing QGIS 1.8 on Ubuntu 13.04, perhaps the release of 2.0 will have fixed those issues).

On this machine if I try to open the file in QGIS it freezes for 2-3 minutes, then QGIS crashes and closes with no error messages. gdalinfo works a little...

$ gdalinfo ESP_032436_1755_COLOR.JP2
Driver: JPEG2000/JPEG-2000 part 1 (ISO/IEC 15444-1)
Files: ESP_032436_1755_COLOR.JP2
       ESP_032436_1755_COLOR.JP2.aux.xml
Size is 9679, 44908
Coordinate System is:
PROJCS["Equirectangular MARS",
    GEOGCS["GCS_MARS",
        DATUM["unknown",
            SPHEROID["unnamed",3396190,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Equirectangular"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",180],
    PARAMETER["standard_parallel_1",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-2523306.125000000000000,-268608.875000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)
Corner Coordinates:
Upper Left  (-2523306.125, -268608.875) (137d25'49.08"E,  4d31'53.74"S)
Lower Left  (-2523306.125, -279835.875) (137d25'49.08"E,  4d43'15.60"S)
Upper Right (-2520886.375, -268608.875) (137d28'16.04"E,  4d31'53.74"S)
Lower Right (-2520886.375, -279835.875) (137d28'16.04"E,  4d43'15.60"S)
Center      (-2522096.250, -274222.375) (137d27' 2.56"E,  4d37'34.67"S)
Killed

The system freezes for 2-3 minutes between the "Center" line and the "Killed" line. I've also tried using gdal_translate to convert the JP2 to a tif image, but with similar results.

Any ideas?


texts: Edit imported osm maps on GeoServer with iD or Potlatch 2

texts:
I have installed geoserver on Ubuntu and imported osm map data into it. Now I want to attach  a map editor(iD or potlatch 2) to this suite to edit maps but I have not a clue. Any help or documentation?
In the near future I will need to get change sets and also upload my changes to osm. Is it possible to do this?


texts: How to convert PNG files to GeoTIFF using Python

texts:
I have a big set of PNG files and EPSG:3006 coordinates of the edges of each file. (actually the coordinates of the edges are given in the file name, like this: 'image_666751_7023263_667007_7023519.png', so 666751, 7023263, 667007, 7023519 are the boundaries of the this image in EPSG:3006 )

How can I convert those PNG files to GeoTIFF files using Python so the TIFF files would contain the geo metadata.
I guess it can be done with Rasterio lib, but I'm not sure how exactly.


texts: ee.List to FeatureCollection to be exported as a CSV?

texts: I'm trying to find the method to convert an ee.List to a FeatureCollection in order to be exported as a CSV file.


texts: sf::st_read_db() considerably slower than postGIStools::get_postgis_query()

texts:
I have a large (extent not size) polygon layer of the German federal state borders on my PostgreSQL data base. There is also an index on the geom column.

CREATE INDEX germany_bld_geom_idx
  ON spatial_derived.germany_bld
  USING gist
  (geom);

Using the sf:: package to load the layer into R takes extremely long ~40s:

# bld = sf::st_read_db(con, table = c('spatial_derived', 'germany_bld'))
bld = sf::st_read_db(con, query = "SELECT * FROM spatial_derived.germany_bld", geom_column = 'geom')

Using the postGIStools:: package, it is done in ~0.5s:

bld = postGIStools::get_postgis_query(con, "SELECT * FROM spatial_derived.germany_bld", geom_name="geom")
bld = sf::st_as_sf(bld)

Up to now I've only seen advantages in using sf:: in R, however in this case other packages are faster. Is st_read_db() still in development? What causes this big difference?


texts: Copy and paste within same table with ModelBuilder?

texts:
I have created a new attribute in a shapefile in order to copy the same information existing in the attribute ObjectID.

Is it possible to copy and paste information from one attribute to another within the same table using ModelBuilder?

If not, is there any way using ModelBuilder, to copy information from an existing attribute to a new attribute within the same table?


texts: In the Vector Analysis Toolbox of QGIS 3.2 next to "Distance Matrix" I stumbled upon "Distance to nearest hub (points)". I have no idea what a "hub" is in this context. Can someone give an explanation of the term "hub" as it is being used in QGIS?


texts: Publishing Tools does not start in arcgis server 10.1

texts:
I'm trying to publish a service in arcgis server 10.1. In the last phase I encountered with this error:

I tried to start the server as described in the error message. I encountered with this error:

error log:

<Msg time="2015-03-05T10:10:08,11" type="SEVERE" code="6550" source="Admin" process="6900" thread="1" methodName="" machine="FARZIN-PC" user="" elapsed="">Failed to start the server machine 'FARZIN-PC'. Could not start application server within stipulated time.</Msg>
<Msg time="2015-03-05T10:10:08,29" type="SEVERE" code="7701" source="Admin" process="6900" thread="1" methodName="" machine="FARZIN-PC" user="" elapsed="">Failed to start app server. Failed to start the server machine 'FARZIN-PC'. Could not start application server within stipulated time.</Msg>

I did everything to solve the problem but I failed. What do I need to do? BTW "FARZIN-PC" is my computer name.


texts:
Obviously it's potentially a very powerful tool, but I'm curious as to what practical applications people are using it for?

Admittedly, this is a very broad question... The reason I ask is because while I personally am aware of a number of applications, I'm sure that others out there have thought of many other novel uses that might be interesting to share, and think about.

In addition, if you are using LANDSAT data yourself, what sort of workflow are you going through to get what you need from the data?


texts: Where can I get an archived copy of the ColorBrewer style file for ArcGIS 10?

texts:
ColorBrewer palettes are not available in ArcMap. There was ColorTool, a plugin for ArcGIS 9.x developed by National Cancer Institute, but as indicated in this question from 6 years ago, it was never upgraded to ArcGIS 10.

Answers to that question elicited the response to download the style file from http://codesharing.arcgis.com/?dbid=14403. However, this domain no longer appears to be maintained, and no style file is available for download.

Does anyone know of another source for this style file?

Edit: The nonexistent file is also linked to from http://www.gisuser.org.nz/tips-and-tricks, which conveniently explains, with screenshots, how to import the style file once you have it.


texts: Line style width property not being applied in QGIS 2.0.1

texts: I change the line width of my style and click apply, but the property does not seem to be applying to my line data.


texts:
Is it feasible converting the spatial property (SDO_GEOMETRY) of a table in Oracle as an unique index or spatial constraint for avoiding spatial duplicates?

I am working on point tables and I don't want having spatial duplicates, I mean two points for the same location.


texts: Download all coffe-shop locations in Italy from OSM. Stuck with Qgis, R and geofabrik

texts:
I wanted to download all café locations from OSM in Italy.
I tried various ways and one of them was in qgis. I used the awesome quickosm-plugin and did the following:

But it always fails with a timout error asking me to try it later or do a smaller query.
I also tried to download the entire pbf-file from geofabrik here:
https://download.geofabrik.de/europe/italy.html
load this into qgis and then somehow select the right rows. This however also did not work due to its size.
I then tried to use the osmdata and the osmextract packages in R. For both I don't get any results. With the osmdata-package I ran the following:
cafes = opq("Italy") %>%
  add_osm_feature(key = "amenity", value = "cafe") %>%
  osmdata_sf()

Which results in this
> cafes
Object of class 'osmdata' with:
                 $bbox : 32.1634093,-96.9079386,32.2066985,-96.8616477
        $overpass_call : The call submitted to the overpass API
                 $meta : metadata including timestamp and version numbers
           $osm_points : 'sf' Simple Features Collection with 0 points
            $osm_lines : NULL
         $osm_polygons : 'sf' Simple Features Collection with 0 polygons
       $osm_multilines : NULL
    $osm_multipolygons : NULL

And for the osmextract I used the following:
cafes = oe_get(
  "Italy",
  quiet = FALSE,
  query = "Select * from points where amenity  = 'cafe'"
)

Besides some potential errors in my understanding of the query (and in general of osm keys and features) I have no Idea on how to get to the cafe-data.
One last idea would be to download the pbf again and put it into postgis. This however scares me a little bit as the setup of my postgis is not really working.


texts: Seeking UNIX alternative for ArcMap Union with good performance?

texts:
I've been trying to create a union* of two shapefiles using a Unix-based approach. So far without success.

My two shapefiles can be found here.

The process using Union (analysis) takes approximately 10 minutes in ArcMap on my laptop and creates the desired result. I am looking for a Unix- or cloud-based alternative.

So far I've explored several options:

Geopandas on AWS EC2 instance (large instance). Fails to execute. Stuck after 20 min.
QGIS Doesn't handle invalid geometries that well. Also much slower.
PostGIS on AWS RDS approach:

The query for two similar shapefiles:

CREATE TABLE test.union_v12 AS
-- input data
with polys1 AS (
  SELECT
    t1.icepbasinid,
    t1.geom
  FROM
    y2018m10d01_rh_icep_basins_postgis_v01_v02 t1

),
polys2 AS (
  SELECT
    t1.aqid,
    t1.geom
  FROM
    y2018m11d14_rh_whymap_to_rds_v01_v01 t1
),
-- left and right unions
union1 AS (
  SELECT ST_UNION(geom) FROM polys1
),
union2 AS (
  SELECT ST_UNION(geom) FROM polys2
),
-- various combinations of intersections
pairs AS (
  SELECT icepbasinid, aqid, ST_INTERSECTION(a.geom, b.geom) geom FROM polys1 a, polys2 b WHERE ST_INTERSECTS(a.geom, b.geom)
  UNION ALL
  SELECT icepbasinid, NULL, ST_DIFFERENCE(geom, (SELECT * FROM union2)) geog FROM polys1
  UNION ALL
  SELECT NULL, aqid, ST_DIFFERENCE(geom, (SELECT * FROM union1)) geog FROM polys2
)
SELECT * FROM pairs WHERE NOT ST_IsEmpty(geom)

the query works for smaller shapefiles and it's now running for 50 minutes. This approach is not as fast as ArcMap. Also, the query was not so straight forward.

What would be a fast and reliable way to create a "union" (in the ArcMap sense of the word) of two relatively large shapefiles on a Unix platform? A code based approach (CLI / Python) is preferred.

*What ArcMap defines as a "union" is also known as an overlay, geospatial outer join or spatial OR join.


texts: how do I create a report with photos imported to my map?

texts:
How to create a report with geotagged photos printed after the map?

I imported the photos using the processing toolbox and then used an HTML code in the map tips so they pop up when the cursor scrolls over the image.

I want to generate a report with the map and then the thumbnails of the photos without having to add each image just automatically generate the thumbnails with a couple per page.

How to achieve it?


texts:
I´m using Qgis Version 3.16
I have the following problems:
One of my layer has several areas. Now I want to give every area a different style. I already found the function to give all areas the same style.
I had an idea today in the morning that I could multiply or copy the layer and edit in every layer one area and delete the rest.
That would make a lot of effort. Does somebody has an other idea to change the areas in the same layer?
In addition, I don't find the function which you can change the graduation of the scale bar. So no 100, 200, 300, 400 steps, instead 50 100 200 400 etc.


texts:
I am looking to obtain count of population by census tract. The ideal output would be Census Tract 1919.01 Population = 7,435.

Does anyone know of resources where I can get this information. I tried searching Census.Gov w/ no luck.