texts: QGIS 3 - Change location of profile folder

texts:
My Windows user profile at work is stored on a network drive, which causes all kinds of trouble with QGIS. So I want to place it somewhere on my C:\ drive. I found out about --configpath, but that only works for QGIS 2 (I tried it and it doesn't work in QGIS 3 anymore. QGIS would always complain, like this:

Apparently there is now a user profile feature in QGIS3, which enables the creation of profiles in QGIS. Sadly, it wont let me change the directory in the "create new profile" dialogue.

So how can I change the location of my profile folder now in QGIS 3?

...and if it helps, the problem I'm trying to solve by doing this, is related to the Qgis plugin "dataPlotly". And that discussion went like this: Github


texts: I don't know how to filter the attribute table in qgis. I have 2 columns, DN and DN_1, both with values from Corine Land Cover (111,112, 223, etc). I try to select the rows that have the same value. For example. DN: 111, and DN_2: 111, to erase them, and have only values that are different on the same row. Is there a way to filter this?


texts: Unable to connect to SQL Server tables with 10.5 ArcMap but it works with 10.7

texts:
I have a requirement where I need to connect to the SQL Server which I have created using ArcCatalog 10.7.

I have a requirement where I need to now use 10.5 version. But when I attempt to connect to the tables I get the error Underlying DBMS with SQL Server 2016.

Does anyone know because I updated tables with latest version of ArcMap, could this cause this issue? It is quite frustrating that I can't use different versions of ArcMap with the database.


texts: How to put 3 ArcGIS feature classes together with SQL 2012 geometry with a view?

texts:
I made a pretty table view with the below sql but at the end I added the shape field and I got an error I cannot union like that with geometry?

SELECT        Type, HearingDate, SiteID AS 'ITEM'
FROM            myfirstfeatureclasshere
UNION
SELECT        'Zoning Board of Appeals' AS Type, HearingDate, CaseNo AS 'ITEM'
FROM            mysecondfeatureclasshere
UNION
SELECT        Type, HearingDate, ITEM
FROM            mythirdfeatureclasshere


texts:
I have a workspace where I am writer multiple databases to a new file geodatabase with many tables. If there is a spelling error in a value I do not want it to go through. The issue is I have about 20 fields with up to 30 values where there could be an error. For example, the DATUM field has to equal NAD27 or NAD83 NOT NAD 27 or NA D83..

Given I have many fields and many values, is there an easy way to direct these values != to the values I need. I just don't want to create a tester with 100+ lines where the value doesn't equal. Is there an easier way, one that would decrease the time to run the workspace. (It already takes 3-4 hours to run).


texts: Counting points out of polygon using QGIS?

texts:
I would like to count the amount of points that are out of the polygon because I need to sum them.

I know how to count how many points are inside but in need to find how many there are outside.


texts:
When I use this command :

> chm <- grid_canopy(gro, 1, pitfree(c(0,2,5,10,15), c(0,1), subcircle = 0.2))
Processing [-------------------------------------------]   0% (1/341) eta:  8mError: filename exists; use overwrite=TRUE

I have an error because the file exist. How can i add the overwrite argument to grid_canopy because when i use this command :

chm <- grid_canopy(gro, 1, pitfree(c(0,2,5,10,15), c(0,1), subcircle = 0.2, overwrite = TRUE)

I receive this error :

Error in grid_canopy(gro, 1, pitfree(c(0, 2, 5, 10, 15), c(0, 1), subcircle = 0.2),  :
unused argument (overwrite = TRUE)


texts: Evaluation of existing map cache servers

texts:
there are so many different caching servers around:

MapCache
MapProxy
GeoWebCach
TileCache
Tile-Server
and maybe more.

I just wondering that I cannot find an evaluation or feature comparison of them on the web. Does someone bench-mark or compared some of them?


texts: Coordinate reference system issue - Differences in CRS

texts:
At present I have both a shapefile and a CSV file (with coordinates).

When I upload my csv file to QGIS and map the coordinates it takes the following CRS - Selected CRS (EPSG:4326, WGS 84)

When I upload the shapefile - the map which my points should be placed on, the following CRS to shown.

Selected CRS (USER:100000,  * Generated CRS (+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +ellps=mod_airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +units=m +no_defs))

The issue is, when I try to join attributes by location, I get a null value - as I imagine the CRS are different. However, when I try to change my CRS to match, both taking (EPSG:4326, WGS 84). The shapefile is moved to some other area (coordinates change).

I have enabled on the fly so I'm not sure what the issue could be?


texts: Feature Count for Categorized Layers with the Atlas function of Print Layout in QGIS 3

texts:
In QGIS, is it possible to count the features of each class in a categorized layer where the features being counted are limited to those that are inside the current atlas feature?

I have tried turning on "Filter Legend by Map Content" combined with the filter expression intersects($geometry,@atlas_geometry), but the result remains the total feature count, and, is not restricted to the feature count of the atlas feature.

I am aware that I can count features within an atlas feature using a label, but, then it is not part of the legend.


texts: Can't export data from related table in Survey123

texts: I have created a survey that uses a feature service with a point layer and a related table. The survey is working fine, but when I try to export the data into an Excel spreadsheet, only the data from the point layer is exported. How can I extract the data from the related table?


texts:
I am using the configurable map viewer and I have fields in many of my layers that I want to use to link to documents with URLs.

Does anyone have any idea how I would do this out of the pop-up window?

I figure that I have to configure the identify.js file but I can't figure out how to accomplish what I want.


texts:
I have nine vector land use .shp and I had to make a cropland shapefile, but I thought of giving my study region polygon an attribute to be cropland, instead of digitizing it.

I forgot what function I had to use to overlay my landuse vectors file over this cropland vector file and to clip it in order to have empty spots (donuts) where the landuse files cover the cropland. Basically I want my study area to have empty spots within in the spots where other landuse vectors are over it.

I use ArcGIS Pro


texts: Using Python in the Field Calculator to select more than one data point

texts: I assume this is a basic Python coding question, but I have scoured the internet and spent several hours trying on my own. I have about 2000 cells in my FID_1_1 column that I need to select and code as "1" in another attribute column (exp100mWA). I have figured out how to do this with Python for 1 cell (27), but can't figure out how to do it for all of them. I have the list of numbers, but it doesn't like any way I try to code it, commas, spaces, ampersands, etc. Here's my field calculator box.


texts: How to calculate the distances to outlet along the flow path ?

texts:
I have created these raster files for a river basin:

DEM
Flow Direction
Flow Accumulation

I like to genereate a layer how it is shown in the picture below.

I need the values for the distances from each spring to the outlet along the flow path length.
By now I used Qgis 2.16.1 with Grass and Saga tools.
Moreover I figured out that maybe the r.stream.distance command is what I need, but it isn´t available in the toobox and i couldn´t add it.
I am a newcomer and happy about any explanation.


texts: Drawing polyline that grows as the car moves by taking data from MySql and PHP in Google API

texts:
I wanted to show the polyline on google Map as car moves with animation (like in this site: http://econym.org.uk/gmap/example_cartrip2.htm) by taking data from MySQL and PHP. For that i refered the code from Google API  tutorial Polyline. I have also taken data for this from my SQL which is as follow:
.html

function load() {
    var point;
                    var flightPlanCoordinates=new Array();
            var map = new google.maps.Map(document.getElementById("map"), {
                center: new google.maps.LatLng(18.33, 73.55),
                zoom: 7,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                mapTypeControl: false,
                mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
                 },
                navigationControl: true,
                navigationControlOptions: {
                    style: google.maps.NavigationControlStyle.SMALL
                }
            });

            downloadUrl("xmltry.php", function(data) {
        var xml = data.responseXML;

        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < markers.length; i++) {
            point = new google.maps.LatLng(
              parseFloat(markers[i].getAttribute("lat")),
              parseFloat(markers[i].getAttribute("lon")));
            flightPlanCoordinates[i]=point;
          }
          var flightPath = new google.maps.Polyline({
    path: flightPlanCoordinates,
    strokeColor: "#FF0000",
    strokeOpacity: 1.0,
    strokeWeight: 2
  });

  flightPath.setMap(map);

      });

        }

        function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };

      request.open('GET', url, true);
      request.send(null);
    }
    function doNothing() {}

.php file:

<?php
//require("phpsqlajax_dbinfo.php");
include 'common_db.inc';
// Start XML file, create parent node

$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);

// Opens a connection to a MySQL server

$connection=mysql_connect ("$dbserver", "$dbuser", "$dbpass");
if (!$connection) {  die('Not connected : ' . mysql_error());}

// Set the active MySQL database

$db_selected = mysql_select_db($dbname, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table

$query = "SELECT  `lat`, `lon` FROM current_location Where Device_ID='HGS1005'";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Iterate through the rows, adding XML nodes for each

while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  $node = $dom->createElement("marker");
  $newnode = $parnode->appendChild($node);
  $newnode->setAttribute("lat", $row['lat']);
  $newnode->setAttribute("lon", $row['lon']);
  }

echo $dom->saveXML();

?>

But now i wanted to show polyline with animation as show in 1st references site.Can any one suggest me some references or help me out in same.
I am getting this result which is correct but want animation in it as in http://econym.org.uk/gmap/example_cartrip2.htm

Hope this time my title and description part is understood.


texts: Restricting dataset types does not work correctly in a dataset iterator

texts:
I need to obtain a list of all the CAD drawings within a specified folder (and subfolders). I initially tried using a Files Iterator in ModelBuilder, but when I specified the extension, it prompted me to use the Dataset Iterator as the CAD extensions are recognised datasets.

After creating a test folder of four CAD files and a subfolder with one CAD file, I ran the model with a Collect Value to get the list of the full pathname for each file.

It ran for about a minute before "completing" the model without advancing to collect the values. As I had restricted the dataset type, this meant that it did not find any CAD files. I then removed the restriction and ran it again. This time it quickly returned the CAD files.

I then restricted the dataset type to FEATURE. It returned a list of the CAD files, when it should not have returned anything. Does the dataset iterator not recognise CAD files properly (whereas the files iterator does, and therefore does not allow me to use it)?


texts: Removing duplicate legend items in QGIS?

texts:
I work with several layers that share similar symbology partly. I'm trying to remove duplicate Symbology from the legend:

All the layer and their classification are in the map extent.
I try to use the filter legend
but with no result

How can i do it automatically, at once?


texts: Converting raster to TIN and large section did not convert properly?

texts:
I've got a DEM for a pretty large area and I need to create a TIN. I'm using 3D Analyst Tools > Conversion > Raster to TIN. The process runs without any error messages, but a large section of the TIN is pretty wonky.

Here's how it looks:

Here's a more zoomed in pic:

The TIN looks pretty good aside from this gigantic area with covered in bizarre stripes. I don't see anything wrong with the DEM, so I'm pretty confused. The southeast area is a hill, so the elevation increase in that direction isn't an error.
Any clues? I'm pretty unfamiliar with TIN creation in ArcGIS 10.


texts: How is Canada Vector Data (CanVec) hydrology data collected and updated?

texts:
Canada is vast and collecting any geographic data must be a monumental task. Natural Resources Canada provides a free access to a comprehensive Canada-wide topographic data now refereed to as CanVec (Canada Vector) data.  I often download and use CanVec datasets which are updated on yearly basis (current version 12 soon to be version 13) but I am curious how current thi data really is, namely hydrology.

How is this data captured and collected and how frequently are features such as waterbodies, wetlands updated?  I suspect image analysis using multispectral imagery but clearly some manual work is needed to enforce hydrological correctness. Is is even possible such data can be up to date?


texts:
I have created an Atlas. One of my layer contain height restriction for bridges.
I wish to create a label that show the lowest height restriction.

I need to get the height values from my table that are intersecting with the Atlas feature and query for the lowest value to be displayed in the label.
Any ideas how that would be possible?


texts: Where to get world-map images for use in webglearth

texts:
I am using webglearth for a 3D earth globe.
I already bought MapTiler, from the same makers.

Now I am struggling with finding different world-map-images with the right projection. I need either WGS 84 or Web-Mercator. I would also buy them.

So is there any sites that specialized in that and I'm just not finding?

Or how would any of you get customized / differently themed world-map-images for use as a texture?


texts: How to enlarge font of street names while printing in QGIS?

texts:
I have to print some Municipality shots and I use OpenStreetMaps or Google Maps but when I print the streets names are too little and is is not possible to read them. On screen names are perfectly legible and the size is right.
How can I solve?

I use OpenLayerPlugin v1.4.1


texts: Finding the CRS when it is missing from the GeoTIFF file

texts:
I have downloaded some GeoTIFF files from this site: https://cloud.ihme.washington.edu/index.php/s/Q5CGeazb4iNsDQA?path=%2FStunting%20Prevalence%20%5BGeoTIFF%5D

I need to convert these .tif files into .csv files that contain the stats in the .tif files as well as the geocoordinates. These GeoTIFF files do not include the CRS used to create them, however.

The CRS information is just missing however I try to look for it (using R, QGIS and Python...)

How can I figure out the CRS used to create these files?


texts: Raster calculator and Saga Raster calculator gives different output when multiplying rasters (QGIS)

texts:
I need to multiply 5 different raster to get my end product. However when I calculate it in the Raster Calculator the answer is double the amount I get when I calculate it in the Saga Raster Calculator. Why?
My formula in the Raster Calculator is:
"C_factor@1"*"K_factor@1"*"LS_factor@1"*"P_factor@1"*"R_factor@1"
I do the same in the SAGA Calculator: (only the names are different)
a*b*c*d*e


texts: Dividing Geographical region into equal sized grid and retrieving indexing position

texts:
I have GPS coordinates of human mobility in Beijing Area. I want to divide geographical space in to rectangular grid, for example 2 sq. km (delta), and access the indexing position of any point inside the grid. The cells need not be exactly equal size, approximation can work in my case.

I have geographical region with the following coordinates (latitude, longitudes) of bounding box.

Bottom Left  (x1,y1) = 39.77750000, 116.17944444
Top Left     (x1,y2) = 40.04722222, 116.17944444
Bottom Right (x2,y1) = 39.77750000, 116.58888889
Top Right    (x2,y2) = 40.04722222, 116.58888889

This is rectangular region of 30 km x 34 kms.
The solution in my mind is to take delta as 2km, increment latitude and longitude value by delta until upper bound reaches.
To access the index position of GPS point p, Let BL be the Bottom Left point of rectangular region

Row =    Distance [(p.lat,BL.long), (BL.lat, BL.long)] / delta
Column = Distance [(BL.lat,p.long), (BL.lat, BL.long)] / delta

Is there any easier way or supporting library to solve this problem? preferably in combination of row and columns (x,y), so that I can measure the closeness of grid cells by finding distance between two grid cells in Cartesian coordinates system. An example image and input dataset may give you clear idea of the description.

The input dataset in given in the link https://drive.google.com/file/d/1JjvS7igTmrtLA4E5Rs5D6tsdAXqzpYqX/view


texts: Service Areas Based on a time Raster Surface in ArcMap 10.1

texts:
I have a raster surface that defines for any cell, the cumulative time to reach a particular cell from the nearest health facility. This was generated using the path distance tool of spatial Analyst, ArcMap 10.1

I now need to create a service area around each health facility based on a cut off time of hour.

Which tool or combination of tools is capable of doing this in Arc Map 10.1


texts: How to set a label's buffer color in a mapfile?

texts:
I would like to set a white buffer around labels in a mapfile (Mapserver version 6.2.1). In the official documentation, I can't find a specific parameter for this... I have tried the SHADOWCOLOR and SHADOWSIZE parameters but if set with a OFFSET 0 0, the shadow is not visible (it has to be offsetted, which I don't want to).

Here is an extrat of my code, to be completed if you have ideas on this issue:

    CLASS
        NAME "myLayer"
        EXPRESSION ([code] = 1)
        STYLE
            SYMBOL "STD_circle"
            COLOR 0 255 0
        END
        LABEL
            FONT "vera"
            TYPE TRUETYPE
            SIZE 3
            COLOR 0 0 0
            BUFFER 2
        END
    END


texts: ArcGIS Online Dashboard: Embed URL Using Rich Text

texts:
Is it possible to embed a URL using "Rich Text" in ArcGIS Online Dashboards?

I want to have the text say "PLANNING AND ZONING DEPARTMENT" , and embed the URL so  users can directly access the city's planning department web page.

I have been trying a combination of these two templates with no success...

1.)  Example

2.)

<!DOCTYPE html>

Local Links

HTML Images is a link to a page on this website.

W3C is a link to a website on the World Wide Web.


texts: pyqt5-tools folder is missing when downloading Anaconda or Spyder

texts:
When using Qt Creator and Designer tutorials on the internet tell to first download Python (in my case Anaconda) then pip install pyqt5-tools with cmd.
When I download anaconda (also Spyder) that folder is simply missing. I can not find a substitution for that on the internet.
Why is the folder missing and where can I find it?


texts: What GIS software is required to export a GIS map as a hi-res raster image?

texts:
I am looking for some (preferably free) GIS software that will enable me to export multi-layered world maps (made up of shapefiles and KML files and so on...) as high resolution (21,000 pixels wide), single layered TIFF, JPEG or other raster format files, so that I can then edit them in Photoshop.

I am an artist, and new to GIS. I have recently started running the free MapWindow program on my computer. This has enabled me to start constructing some of the world maps that I'm looking for, though I can't seem to find a way of exporting them as images from that program.


texts:
Running the Polygonize tool in QGIS keeps generating the following error:

Processing algorithm…
Algorithm 'Polygonize (raster to vector)' starting…
Input parameters:
{ 'BAND' : 1, 'EIGHT_CONNECTEDNESS' : False, 'FIELD' : 'DN', 'INPUT' : 'C:/Users/Erik/Desktop/AgriSA/AgriSAshape.tif', 'OUTPUT' : 'C:/Users/Erik/Desktop/AgriSA/AgriSApol.gpkg' }

GDAL command:
python3 -m gdal_polygonize C:/Users/Erik/Desktop/AgriSA/AgriSAshape.tif C:/Users/Erik/Desktop/AgriSA/AgriSApol.gpkg -b 1 -f "GPKG" AgriSApol DN
GDAL command output:
Traceback (most recent call last):

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 85, in _run_code

exec(code, run_globals)

File "C:\PROGRA~1\QGIS3~1.4\bin\gdal_polygonize.py", line 36, in <module>

from osgeo import gdal

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\osgeo\__init__.py", line 21, in <module>

_gdal = swig_import_helper()

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper

_mod = imp.load_module('_gdal', fp, pathname, description)

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\imp.py", line 243, in load_module

return load_dynamic(name, filename, file)

File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\imp.py", line 343, in load_dynamic

return _load(spec)

ImportError: DLL load failed: Kan opgegeven procedure niet vinden.

Execution completed in 0.56 seconds
Results:
{'OUTPUT': 'C:/Users/Erik/Desktop/AgriSA/AgriSApol.gpkg'}

Loading resulting layers
The following layers were not correctly generated.

C:/Users/Erik/Desktop/AgriSA/AgriSApol.gpkg

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

log:

2019-07-16T09:28:32     INFO    python3 -m gdal_polygonize C:/Users/Erik/Desktop/AgriSA/subsistenceSAclip.tif C:/Users/Erik/AppData/Local/Temp/processing_65c11c5862ef4f1c88e5495ff73aeeba/2e6619d834b246e1a07916ba724274ad/OUTPUT.shp -b 1 -f "ESRI Shapefile" OUTPUT DN
2019-07-16T09:28:32     INFO    GDAL execution console output
             Traceback (most recent call last):

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 193, in _run_module_as_main

              "__main__", mod_spec)

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 85, in _run_code

              exec(code, run_globals)

              File "C:\PROGRA~1\QGIS3~1.4\bin\gdal_polygonize.py", line 36, in

              from osgeo import gdal

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\osgeo\__init__.py", line 21, in

              _gdal = swig_import_helper()

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper

              _mod = imp.load_module('_gdal', fp, pathname, description)

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\imp.py", line 243, in load_module

              return load_dynamic(name, filename, file)

              File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\imp.py", line 343, in load_dynamic

              return _load(spec)

             ImportError: DLL load failed: Kan opgegeven procedure niet vinden. [Cannot find requested procedure]

I have tried different versions of QGIS (2.x and 3.4) and different clips of the raster. Does anyone know where it could come from?


texts: I am trying to import a raster file (.flt) into GRASS. The raster file (.flt) was generated from HEC-RAS. The said raster format cannot be imported into GRASS (it shows the error "file not supported"). Is there a way to import the .flt into GRASS?


texts: Data-driven QGIS print composer label formatting?

texts:
In QGIS print composer I want to label a UTM grid with some specific attributes:

A full UTM grid reference for the labels nearest the corners of the map, rotated perpendicular to the map axis.
Abbreviated UTM grid references for other labels.

See the example below from a topographic map that uses this styling:

The abbreviated labels and superscript formatting seen can be handled with a bit of Python, for example in this question:

How to achieve Super or Subscript graticule labels in QGIS Composer windows

For the full or partial label part of this I feel it might be possible to do in a custom Python function if the bounds of the map were accessible in the label formatting context.

Is it possible to get the corresponding map's geometry when formatting a label?

For the rotation part of the question, I'd normally expect the label rotation value to have a data-driven option, but I don't see this in the print composer (maybe a feature request). A partial workaround would be to add a second grid with the appropriate rotation value but there is still a dependency on determining whether the label should be rotated or not.

I want to conditionally format the 8 labels nearest the rectangular map bounding box. The linked answer conditionally formats each 10km interval with a full UTM reference, and these intervals do not necessarily correlate well with the bounds of the map.


texts: Getting features from given geometry in map using ArcObjects with C#?

texts:
I am trying to get features from a given geometry (getting only layers ). This is not selection. The validate part I will be doing using configuration. But I am not able to get the features from the geometry.Even I thought to open an attribute table and check how many rows are there and if I can find the values for each row. But no luck. Here is what I did:
IFeatureClass pFeatureClass= null;
while ((pThisLayer = pEnumLayer.Next()) != null)
  {
 pThisFeatLayer = pThisLayer as IFeatureLayer;

 IFeatureCursor pFtCur = pThisFeatLayer.Search(spatialFilter, false);
 pTable = (ITable)pThisFeatLayer;
 pFeatureClass = pThisFeatLayer.FeatureClass;

 //pFields = (IFields)pFeatureClass;
  pFt = pFtCur.NextFeature();
  if (pThisFeatLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
  {
        continue;
  }
  if (pFt != null)
  {

      pCursor = pTable.Search(spatialFilter, false);
      pRow = pCursor.NextRow();
      while (pRow != null)
      {
        //string.IsNullOrEmpty(output);

        //output += pRow.get_Value(count).ToString() + "\n";
        MessageBox.Show(pFt.Class.AliasName.ToString()+ "  " +count.ToString());
        count++;
        pRow = pCursor.NextRow();

       }

  }

}

pFt = pFtCur.NextFeature(); statement instead of returning the next feature it returns the next layer. I also tried to get help from ESRI sites but those are down for maintenance.


texts: I'm trying to use some frames from Autocad (DXF / DWG) as a frame in Qgis (*.qpt??) but I don't know how to do it or if it's possible.


texts: Does GDALWarp not support writing MBTiles?

texts:
I'm trying to create MBTiles from GeoTIFF datasets (UTM33 projection). I have tried the following command

gdalwarp -of MBTiles -t_srs EPSG:3857 -co "QUALITY=80" tiffs\*.tif
dataset.mbtiles

The result is this error:

ERROR 6: Could not find an appropriate zoom level that matches raster pixel
size
Open GDAL Datasets:
1 N MBTiles      -1 65701x77489x3 C:\Data\Testdata\dataset.mbtiles

I also tried to warp each TIF to EPSG:3857 and then creating a .vrt first, and then the following command:

gdalwarp -of MBTiles -co "QUALITY=80" tiffs.vrt dataset.mbtiles

with the exact same result.

I'm completely unable to get it to work, even though the GDAL documentation for the MBTiles driver explicity says that it should work ("The driver implements the Create() and IWriteBlock() methods, so that arbitrary writing of raster blocks is possible, enabling the direct use of MBTiles as the output dataset of utilities such as gdalwarp.")

So the question is, am I missing something in my commands or is GDALWarp and MBTiles simply not supported in GDALWarp?


texts:
I tried to use Change Data Storage to change the bit depth of some rasters, but it doesn't work or gives me vague errors

I first tried to batch convert some rasters to unsigned 1 byte interger, I selected [1]unsigned 1 byte interger, 0 offset, scale of 1, load in QGIS? no, and obviously filled in the file names. It created some temp files for the calculations, but did not finish. It said "The following layers were not correctly generated. Converted Grid You can check the log messages to find more information about the execution of the algorithm"

I also tried to singly convert some rasters using the same tool and parameters. It created blank (no data) rasters, but did not give an error message

Anybody know the source of these errors?


texts: Fit Label to length of line feature at all scales

texts:
I have a shapefile with line features and an attribute table with placenames. Most lines are horizontal and they all represent label positions (orientation, length, location) on older, printed maps.

These placenames make the most sense if they are placed where they were on the actual plrinted map. I have been searching for a way to use the attributes to generate labeles that would mimic the printed version as much as possible, but have been unable to find a way to stretch (and keep them stretched as such on all scales) labels from one end of the line feature to the other.

I have attempted several combinations of Label settings, as well as expressions to determine the position, but most solutions seem to be missing the strecth to line length feature.


texts:
I have a TIFF file in the TM65 (Transverse Mercator) projection, and want to convert it to the OSGB (British National Grid) projection. I'm trying to do this in ArcGIS using the Project Raster tool.

I can select the input and output co-ordinate system fine, but it then asks me to choose a Geographic Transformation. It seems that I have to choose two - one to go from TM65 to WGS84, and then another to go from WGS84 to OSGB. My question is - which one should I choose? What are the differences between them? I have tried choosing some almost at random (and also tried matching them up - so I do TM65->WGS84_2 and then WGS84_2 to OSGB) and each time once the points are reprojected they are displaced from their true locations - the amount varies between fairly small (but large enough to be an issue) and quite large.

Is there any way I can get an accurate conversion between TM65 and OSGB? Am I using the wrong tool?


texts: Lightsquared GPS controversy: Where is the analysis?

texts:
GPS World reports that Lightsquared's network of 40,000 transmitters will interfere with GPS signals.

  Initial technical analyses have shown
  that the distant, low-powered GPS
  signals would receive substantial
  interference from high-powered,
  close-proximity transmissions from a
  network of ground stations. The
  consequences of disruption to the GPS
  signals are far reaching, likely to
  affect large portions of the
  population and the federal government.

Does anyone know what sort of "technical analyses" were done?

Update

There are many news articles mentioning a report to the FCC submitted recently by LightSquared.  There is a strong spatial dimension to this problem.  It appears GPS in rural areas will be harmed most - and will also benefit most from wireless broadband.  Why is it so hard to find maps illustrating the analyses?


texts: I don't find the mistake in my RandomForest-classification

texts:
I am trying to make a RF-classification of aerial-imagery to specify tree-species.
I extracted 3 bands and made a .csv file with columns:

band1  band2  band3  x  y  class

The band columns include the pixel-value of the point which I marked in ArcGIS and copied to the attribute-table.
x/y include the coordinates of the points.
class includes the class, such as forest, juniper...

The RF reads the .csv and classifies the bands it sees in the rasterstack.
The classifier gives back an image with the classes.

So I mark my code and run it:

A classifier-window shows up, and freezes.
5 Seconds later the console shows an error:

 Error in eval(expr, envir, enclos) : object 'band1' not found

The problem is unclear. The code is right, but the compiler reacts as if there was a typo when I run the code. But as far as I can see, there is no typo.
band1, like band2 and band3 are in the pointdata_sw_aug1.csv. It is the 1st column and has no space before or after it (" band1"). Therefore I uploaded the images.
Since my rasters are in tif-format, I recently changed the code because at first is was written by Aaron for img-files:

rlist=list.files(getwd(), pattern="img$", full.names=TRUE)

to

rlist=list.files(getwd(), pattern="tif$", full.names=TRUE)

The RandomForest-Package then opens a little "predict" window where it says that 31 steps are left.
It takes 5 seconds till it stops with an error-message:

  Error in eval(expr, envir, enclos) : object 'band1' not found

It doesn't go on.

This should work, but gives me an error:

require(sp)
require(rgdal)
require(raster)
require(randomForest)

# Set the working directory

setwd("D:/BA-Workspace/DOP_10/orthophotos_abcd/R/test_run_R")

# Create list of rasters

rlist=list.files(getwd(), pattern="tif$", full.names=TRUE)

# Create raster-stack

rasters = stack(rlist)

# Read Raster Training-Table *.csv

intable = read.csv("D:/BA-Workspace/DOP_10/orthophotos_abcd/R/test_run_R/pointdata_sw_aug1.csv")

# Assign Training-points from Columns

myrf = randomForest(factor(class) ~ band1 + band2 + band3 , data = intable, ntree = 2500)

# Run RandomForest classifier

predict(rasters, myrf, filename="outFileName.img", type="response",
    index=1, na.rm=TRUE, progress="window", overwrite=TRUE)

my .csv:

As far as I can see there are no mistakes.
Whats wrong here?

Error-message is this (copied from console):

require(sp)
require(rgdal)
require(raster)
require(randomForest)

 >setwd("D:/BA-Workspace/DOP_10/orthophotos_abcd/R/test_run_R")

> rlist=list.files(getwd(), pattern="tif$", full.names=TRUE)
>

> rasters = stack(rlist)
>
> intable = read.csv("D:/BA-Workspace/DOP_10/orthophotos_abcd/R/pointdata_sw_aug1.csv")
>
> myrf = randomForest(factor(class) ~ band1 + band2 + band3 , data = intable, ntree =     2500)
>
> predict(rasters, myrf, filename="outFileName.img", type="response",
+         index=1, na.rm=TRUE, progress="window", overwrite=TRUE)
**Error in eval(expr, envir, enclos) : object 'band1' not found**


texts:
i need to develop an Qt/C++ app, that contains dashboards and other info, but I also need the map tools that QGIS offers, but I am struggling to setup this app. I've searched for several instructions, but can't find anything that is up to date.
I somehow manage to make a buildabel app, but it crashes and i have no clue why
i added this to my .PRO file
## QGIS
INCLUDEPATH +=  "D:/Projetos/OSGeo4W/include"
INCLUDEPATH +=  "D:/Projetos/OSGeo4W/apps/qgis-dev/include"

LIBS += -L"D:/Projetos/OSGeo4W/apps/qgis-dev/lib" -lqgis_core -lqgis_gui

DEFINES += CORE_EXPORT=__declspec(dllimport)
DEFINES += GUI_EXPORT=__declspec(dllimport)
## QGIS

and this is my main
int main(int argc, char ** argv)
{

    // Start the Application
        QgsApplication app(argc, argv, true);

        QString myLayerPath         = "/home/timlinux/gisdata/brazil/BR_Cidades/";
        QString myLayerBaseName     = "Brasil_Cap";
        QString myProviderName      = "ogr";

        // create maplayer instances
        QgsVectorLayer * mypLayer = new QgsVectorLayer(myLayerPath, myLayerBaseName, myProviderName);

        QgsSingleSymbolRenderer *mypRenderer = new QgsSingleSymbolRenderer(QgsSymbol::defaultSymbol(mypLayer->geometryType()));
        QgsMapLayer* mapLayer = (QgsMapLayer *) mypLayer;
        QList <QgsMapLayer*> myLayerSet;
        mypLayer->setRenderer(mypRenderer);
        // add layer to the registry
        QgsProject::instance()->addMapLayer(mypLayer);

        // Add Layers to the Layer Set
        myLayerSet.append(mapLayer);

      // Create the Map Canvas
      QgsMapCanvas * mypMapCanvas = new QgsMapCanvas();
      mypMapCanvas->setExtent(mypLayer->extent());
      mypMapCanvas->enableAntiAliasing(true);
      mypMapCanvas->setCanvasColor(QColor(255, 255, 255));
      mypMapCanvas->freeze(false);

      // Set the Map Canvas Layer Set
      mypMapCanvas->setLayers(myLayerSet);
      mypMapCanvas->setVisible(true);
      mypMapCanvas->refresh();

      // Start the Application Event Loop
      return app.exec();

}

i built this main based off the answer to this question QT C++ application using QGIS API
but it didn't work for me.
Im trying to build it with qt5 msvc2017_64, QGIS 3.19 using Qt Creator.
I'm just starting to learn about GIS development.


texts: Monthly Sentinel-2A images in Google Earth Engine Code Editor

texts:
My goal is to get monthly Sentinel-2A imagens in Google Earth Engine Code Editor without need to change the date in the script, only using a scrollbar images fixed at monthly intervals for visualize one per month.

var sentinel_dry = ee.ImageCollection('COPERNICUS/S2').
 filterDate('2017-07-01', '2017-09-30').
 filterBounds(plot).
 sort('CLOUDY_PIXEL_PERCENTAGE', true).
 first();
var sentinel_dry = ee.Image(sentinel_dry);

var sentinel_wet = ee.ImageCollection('COPERNICUS/S2').
 filterDate('2016-10-01', '2016-12-31').
 filterBounds(plot).
 sort('CLOUDY_PIXEL_PERCENTAGE', true).
 first();
var sentinel_wet = ee.Image(sentinel_wet);


texts: Extracting GDAL Metadata field but using Geotools in Java with TIFF files

texts:
I am trying to extract Metadata field from a TIFF file using GeoTools in Java, since I can't use GDAL to achieve that on the deployment platform.

I downloaded a TIFF sample file and used gdalinfo command from shell, getting this output:

Driver: GTiff/GeoTIFF
Files: path\to\file_example_TIFF_1MB.tiff
Size is 650, 434
Metadata:
  TIFFTAG_DOCUMENTNAME=/home/user/Desktop/www/file ex/files/grafa/tiff/file_example_TIFF_1MB.tiff
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=72.009003
  TIFFTAG_YRESOLUTION=72.009003
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  434.0)
Upper Right (  650.0,    0.0)
Lower Right (  650.0,  434.0)
Center      (  325.0,  217.0)
Band 1 Block=650x64 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=650x64 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=650x64 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=650x64 Type=Byte, ColorInterp=Alpha

I was able to fetch every other field using GeoTools, but I can't retrieve the Metadata field.

Is there a way to do it?


texts: ArcGIS RunTime for .net Local server pattern

texts:
I'm completely new in RunTime and also in any kind of programming.

I'm working on an app for Windows tablets which needs to:

have aerials as a basemap
work in an offline environment
have editable feature class (adding lines in the field)
edits doesn't need to be sync when online (client doesn't have ArcGIS Server etc.)
edited feature class needs to be export to shp.

I'm not sure if Local Service pattern is a good choice?
I choose it because I'll need geoprocessing tool to be able to extract fc to shp.
Also our client will once a month provide updated data for people in the field. Because of  no option of sharing trough ArcGIS service, I've been thinking about sharing it through mpk. The newest mpk will always replace the old one.

Can anyone tell me which way is the best? I had a look at many samples but there are not really any for the local server pattern.


texts: Checking if thumbnail exists for specified file using ArcPy?

texts:
I have written a very simple tool that builds thumbnails for every map document in a folder : root_fld stands for root folder and rec tells if search must be recursive.

import arcpy
import os
import fnmatch
import glob

# getting list of mxds
if rec:
    # going recursive
    matches = []
    for root, dirnames, filenames in os.walk(root_fld):
        for filename in fnmatch.filter(filenames, '*.mxd'):
            matches.append(os.path.join(root, filename))
else:
    # going flat
    matches = glob.glob(os.path.join(root_fld, '*.mxd'))

# create thmb
for m in matches:
    mxd = arcpy.mapping.MapDocument(m)
    mxd.makeThumbnail()
    mxd.save()

Works fine but some thumbnails are a pain to create and i'd like my script to filter and ignore mxds that already have a thumbnail :

...
if not mxd.hasThumbnail():
    mxd.makeThumbnail()
    mxd.save()

According to MapDocument class documentation (http://resources.arcgis.com/fr/help/main/10.1/index.html#//00s30000000n000000), this property doesn't seem to exist. But maybe there's a workaround ?


texts: Uncaught TypeError: ol.control.Timeline is not a constructor

texts:
I have been trying to create a timeline in my openlayers map. However it shows that it is not a constructor. How to fix this? this is my code

var tline = new ol.control.Timeline({
  className: 'ol-pointer',
  graduation: 'day',
  minDate:new Date('2020/05/1'),
     maxDate:new Date('2020/06/1')
});
map.addControl(tline);

tline.addButton({
  className:'go',
  Title:'GO!',
  handleClick: function(){
    go();
  }
})


texts: Is WGS84 itself a Coordinate Reference System?

texts:
I was wondering the difference between WGS84 and EPSG:4326 (see this).

Can then WGS84 on its own be defined as a Coordinate Reference System?
Or is it just a datum so that a Coordinate System must be attached to it to fully define a CRS? (see e.g. this document, figure below Sec. 6.4.1)


texts: Problem intersecting shapefiles with OGR in Python

texts:
I'm trying to move from ArcPy for geoprocessing. After searching some posts, I found this solution using the GDAL/OGR Python bindings:

Intersect Shapefiles using Shapely

My code is the following:

import os
act_dir = os.path.dirname(os.path.abspath(__file__))
print act_dir

from osgeo import ogr

ogr.UseExceptions()
ogr_ds = ogr.Open(os.path.join(act_dir,r'data'), True)
SQL = """\
    SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.*, B.*
    FROM Central_America_24h A, municipios_simp_WGS84_dptos_n B
    WHERE ST_Intersects(A.geometry, B.geometry);
"""

layer = ogr_ds.ExecuteSQL(SQL, dialect='SQLITE')
# copy result back to datasource as a new shapefile
layer2 = ogr_ds.CopyLayer(layer, 'mylayer')
#save, close
layer = layer2 = ogr_ds = None

I have a folder called 'data', which contains the file 'Central_America_24h.shp' (point shapefile) and 'municipios_simp_WGS84_dptos_n.shp' (polygon shapefile). I want to intersect the points with the polygons and assign them their attributes. It seems the problem is when I try to save the result and I get the following error:

Traceback (most recent call last):
  File "D:\pyAnaconda\puntos_de_calor_test\puntos_calor_tes2t.py", line 39, in <module>
    layer2 = ogr_ds.CopyLayer(layer, 'mylayer')
  File "C:\Anaconda2\lib\site-packages\osgeo\ogr.py", line 815, in CopyLayer
    return _ogr.DataSource_CopyLayer(self, *args, **kwargs)
ValueError: Received a NULL pointer.

I have checked the documentation, but I don't know what I'm doing wrong:

OGRLayer * OGRDataSource::CopyLayer

Does anyone know what is causing the problem?


texts: Does the cross over the projection graphic indicate the origin of the projection? [QGIS]

texts: I am using a projection that I have defined from a WKT format, and not included in QGIS' default roster of projections. See below in the image. The origin of my projection is 40N and 100W. Why is the cross hair centring where it is? Or is this just a generic default that occurs when you define your own custom projection in Q?


texts: arcpy.Project_management gives ERROR 000210?

texts:
I want to use arcpy.Project_management to project my data.

I have....

arcpy.env.workspace = scratchGDB

fcList = arcpy.ListFeatureClasses()
for fc in fcList:
    print fc

>>>
lease90
lease180

When I add the projection I get 'ExecuteError: ERROR 000210: Cannot create output'....

arcpy.env.workspace = scratchGDB

fcList = arcpy.ListFeatureClasses()
for fc in fcList:
    print fc
    WGS84aux = arcpy.SpatialReference(3857)
    arcpy.Project_management(fc, fc+ '_WGS84aux', WGS84aux)

Suggestions?

UPDATE:

I added a feature class to feature class and commented the projection out for test purposes -- the feature class to feature class worked. However, project still does not work.

arcpy.env.workspace = scratchGDB

fcList = arcpy.ListFeatureClasses()
for fc in fcList:
    print fc
    WGS84aux = arcpy.SpatialReference(3857)
    arcpy.FeatureClassToFeatureClass_conversion(fc, scratchGDB, fc + '_test')
    ##arcpy.Project_management(fc, fc+ '_WGS84aux', WGS84aux)

I've also projected manually and it works - I am so lost.


texts: Mapzen / Tangram topojson building data alternatives

texts:
I'm using Vizicities to visualise 3d building data on a map. Vizicities uses Mapzen vector tiles:

http://tile.mapzen.com/mapzen/vector/v1/buildings/{z}/{x}/{y}.topojson?api_key=[key]

With Mapzen closing, I've been looking for alternatives, like Tangram, but it seems Tangram is also relying on Mapzen data.

Is there any alternative that provides vector tile building data in a topojson format that might replace Mapzen?


texts: Extracting data attributes from SpatialPolygonsDataframe and put into dataframe using R?

texts:
I want to extract all the data attributes from my SpatialPolygonsDataframe, including the ID of all polygons.

The reason I want to do this is the following. I have a SpatiaPolygonsDataframe (which I shall name countryPolygons) that consists of regions within a country, including the names of the regions as data attributes. I have another dataframe that consists of Individual IDs with their coordinates within that country (which I shall call individuals.df). My goal is to expand the dataframe with the individuals to include a column with the name of the region that they come from. So far, I did this:

country_and_individuals.over <- over(countryPolygons, individuals.df, returnList = TRUE)
country_and_individuals.df <- ldply(country_and_individuals.over, data.frame)

This gave me the dataframe country_and_individuals.df that consists of the columns .id (which I assume is the ID of the polygons) and the IDs of the individuals that he got from the individuals.df dataframe:

> head(country_and_individuals.df)
    .id  individual_ID
 1   0   5473277
 2   0   3054526
 3   0   3476794
 4   0   4456345
 5   0   1930378
 6   0   1345628

I reckon that if I had the .id in combination with the names of the regions that are included in the SpatialPolygonsDataframe countryPolygons under the name "NAME_2", I could merge that to country_and_individuals.df, and my goal would be achieved. How do I extract a dataframe with the columns .id and NAME_2 from the SpatialPolygonsDataframe countryPolygons?

Perhaps there is an easier way to achieve this goal (a dataframe with the individual IDs as one column and the region that they are from based on their coordinates as another column).


texts: Trilateration on a Sphere, given 2 points and 2 distances

texts:
Given the points:

A) N 38° 38.000 W 90° 20.000
B) N 38° 39.000 W 90° 21.000

(I can calculate the distance between the 2 using a spherical earth model as 7710 feet, though it's not particularly relevant.)

Given those points and 2 other distances, say 4,000 ft and 5,000 ft, how do a find the 2 points that are 4,000 feet from point A and 5,000 feet from point B (thus forming one triangle to the north east and one triangle to the south west.

Any help converting coordinate systems if I need to is appreciated as well, and extra credit if you can point me towards a .Net library, c# function or Java function.


texts:
How do I export layers as a dxf?

When I go to Layer > save selection as vector file the resulting dxf file is empty.


texts: In QGIS, How to add the database connection in DB Manager via Python

texts:
I am using QGIS 3.0.2

I want to add connection settings in DB Manager  via Python script. is it possible ? (I am interested in PostGIS and Oracle Spatial for now)

This script will save the connection setting (except the username and password) and the db manager will reflect the added connection in the respective list

Note: I can use psycopg2 or QGIS native lib but my requirements are to use the default already available tools only.


texts: Different origin problem while merging rasters

texts:
I have two dem files downloaded via the getData function in the raster package.
Here you can see the code:

I tried to make the example reproducible so there you have it.

library(raster)
dem_n1<-getData("SRTM",lon=26,lat=43)
dem_n2<-getData("SRTM",lon=31,lat=43)
demALL<-merge(dem_n1,dem_n2)

While attempting to perform the merge, the following error appears:

Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE,  :
  different origin


texts:
Is there a map projection that can accurately represent reality at a local area, i.e. when transforming the map could I choose an area that I care about accuracy and allow distortions elsewhere?

Like this map:
http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Tissot_indicatrix_world_map_equirectangular_proj.svg/450px-Tissot_indicatrix_world_map_equirectangular_proj.svg.png

I want to choose where the distortion happens.


texts:
I have a digital terrain model and a digital surface model which contain data in an Esri grid. The data in this files looks like this

ncols 1251
nrows 1001
xllcorner 742499.5
yllcorner 328999.5
cellsize 1.0
nodata_value 9999.00
-9999 -9999 5 2
-9999 20 100 36
3 8 35 10
32 42 50 6
88 75 27 9
13 5 1 -9999

See also: https://en.wikipedia.org/wiki/Esri_grid

What I would like to do now is to calculate the height of positions through substractions of the values from the DTM and DSM.

I imagine this quite easy, as long as I can convert the xllcorner value to coordinates like 15,34° N.

What I want to do finally is put in coordinates a user selects on map and return the height of objects at this point. I want to solve this with PHP, so I need a formular to convert the xllcorner and yllcorner values.

I'm new to this, so maybe I image this much easier than it is, but I'm thankful for hints.


texts: Create patterned polygon fill in ArcMap with random sized dots?

texts: I would like to create a polygon fill with a pattern of dots that are randomly sized (within a range). If this is possible in ArcMap 10.4 desktop, how should I go about this?


texts: Authentication issue: Earth Engine Python using ee.ServiceAccountCredentials()?

texts:
service_account = "cloud-service...iam.gserviceaccount.com"
key_path = 'cloud_credentials.json'
credentials = ee.ServiceAccountCredentials(service_account, key_path)

When running the code above, I get the following error message:

FileNotFoundError: [Errno 2] No such file or directory: '/data/gpfs/home/adrianom/.config/earthengine/credentials'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "extractByPolygon.py", line 8, in <module>
    import eefuncs.cloudmask as cm
  File "/data/gpfs/assoc/gears/scratch/adrianom/earthengine/Extraction/eefuncs/cloudmask.py", line 3, in <module>
    ee.Initialize()
  File "/usr/local/lib/python3.7/site-packages/ee/__init__.py", line 112, in Initialize
    credentials = data.get_persistent_credentials()
  File "/usr/local/lib/python3.7/site-packages/ee/data.py", line 241, in get_persistent_credentials
    'Please authorize access to your Earth Engine account by '
ee.ee_exception.EEException: Please authorize access to your Earth Engine account by running

earthengine authenticate

in your command line, and then retry.

I would like to avoid using earthengine authenticate and read from a file instead to run my python script, but I do not know what the problem is here. I can see it is trying to find my Earth Engine key file, but I thought that the .json file generated from my service account was enough. I also know that earthengine --ee_config is an option, but as I stated, I am running a python script that uses the ee module and this command does not tell the command prompt a default place to continuously look for a key file (right?).


texts:
I want to update enabled field of feature in an asp.net MVC application.
I have below code but it returned "No update session in progress" error
public string Test()
        {
            IWorkspace workSpace = SdeUtil.rtnWorkSpace(UserEnviromentSetting.UserName.ToUpper());
            IWorkspaceEdit workSpaceEdit = workSpace as IWorkspaceEdit;
            var featureWorkspace = workSpace as IFeatureWorkspace;
            IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("DISCNT_S");
            var feature = featureClass.GetFeature(4801);
            workSpaceEdit.StartEditing(true);
            workSpaceEdit.StartEditOperation();
            var enableInd = feature.Fields.FindField("ENABLED");
            feature.set_Value(enableInd, 0);
            feature.Store();
            workSpaceEdit.StopEditOperation();
            workSpaceEdit.StopEditing(true);
            return "s";
        }

Even if I use below code it returned "Objects in this class cannot be updated outside an edit session"
IWorkspace workSpace = SdeUtil.rtnWorkSpace(UserEnviromentSetting.UserName.ToUpper());
            IWorkspaceEdit workSpaceEdit = workSpace as IWorkspaceEdit;
            var featureWorkspace = workSpace as IFeatureWorkspace;
            IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("DISCNT_S");
            workSpaceEdit.StartEditing(true);
            workSpaceEdit.StartEditOperation();
            IQueryFilter filter = new QueryFilterClass();
            filter.WhereClause = "OBJECTID = 4801";
            var featureCursor = featureClass.Update(filter, false);
            var feature = featureCursor.NextFeature();
            if (feature != null)
            {
                var enableInd = feature.Fields.FindField("ENABLED");
                feature.set_Value(enableInd, 0);
                feature.Store();
            }
            workSpaceEdit.StopEditOperation();
            workSpaceEdit.StopEditing(true);
            return "s";

rtnWorkspace mthod is:
public static IWorkspace rtnWorkSpace(string versionName, string serviceName, string userName, string userPass)
        {
            string sSERVER = string.Empty;
            string sInstance = "sde:oracle11g";
            string sPassword = string.Format("{0}@{1}", userPass, serviceName);

            Type t = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
            System.Object obj = Activator.CreateInstance(t);
            IWorkspaceFactory2 oWorkspaceFactory = obj as IWorkspaceFactory2;

            IPropertySet oPropertySet = new PropertySetClass();
            oPropertySet.SetProperty("SERVER", sSERVER);
            oPropertySet.SetProperty("DATABASE", "");
            oPropertySet.SetProperty("INSTANCE", sInstance);
            oPropertySet.SetProperty("USER", userName);
            oPropertySet.SetProperty("PASSWORD", sPassword);

            if (!string.IsNullOrEmpty(versionName))
                oPropertySet.SetProperty("VERSION", "SDE." + versionName);

            IWorkspace worckSpace = oWorkspaceFactory.Open(oPropertySet, 0);
            IEnumDatasetName dsNames = worckSpace.get_DatasetNames(esriDatasetType.esriDTAny);
            return worckSpace;
        }


texts: Tutorials for Raster Processing in PostGRES

texts:
I am looking to learn how to process rasters in PG. I am looking for the complete idiots guide to. Looking into how to attack this I get lost down many rabbit holes that I cannot get out of. Is there a comprehensive tutorial that you might recommend that will teach me about callbackfunc's, window functions, and other need to know basics of advanced raster processing in PG?

I have found no tutorials online thus far. The best learning I have had on this topic to date is by following through the pieces of ST_MapAlgebra but true understanding of what it describes (after following down all the rabbit holes) is missing for me.


texts: Convert tile grid values from EPSG:3857 to EPSG:27700

texts:
Ordnance Survey have recently released an API for map tiles in the leisure series. Their tile set uses a grid based on EPSG:27700. This uses a standard zxy url
https://api.os.uk/maps/raster/v1/zxy/Leisure_27700/{z}/{x}/{y}.png?key=foobar
I want to access this using a codebase that is hardcoded to EPSG:3857 tilesets. Ideally without a complete rewrite.
I am pretty sure this is not possible as they use different tile matrix sets. Is there a way to transform the 3857 call into one that will work with the Ordnance Survey data set and warp the tiles on return?
For clarity, I am attempting to modify the OSM plugin shipped with Qt Location and do not want to write a completely new plugin as this is an experimental project.


texts: Can i change the color/font of map tool tip through arc objects for desktop application?

texts: I want to have custom format of tooltip of features on axmapcontrol.


texts: Error installing r.stream extension, GRASS GIS on MacOS

texts:
When I attempt to run:

g.extension r.stream.order

I get the following error:

Fetching <r.stream.order> from GRASS GIS Addons repository (be patient)...
Compiling...
clang: warning: no such sysroot directory:
'/Developer/SDKs/MacOSX10.9.sdk' [-Wmissing-sysroot]
In file included from io.c:1:
./io.h:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make: *** [OBJ.x86_64-apple-darwin18.5.0/io.o] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
(Tue Jul  2 09:53:36 2019) Command finished (0 sec)

When I attempt to install other extensions, it seems to work fine.

If anyone is familiar with this error on OSX, is there a solution to this problem?

I am running GRASS 7.6 on OSX 10.14 (have also tried GRASS 7.4, same issue).


texts: Not able to use previous fields for default values expression

texts:
I've got the following problem : I have different periods (selected with a drop-down menu, which is like "Paléolithique", "Mésolithique"... etc) and I'd like the fields "Année inf" and "Année sup" to be set to the default values of beginning and of end of each of these periods in my form.
However, I can't use the previous fields set in my form (the three following codes for "Année inf" have failed) :

CASE
WHEN "Période inf" like '%Paléo%' then -15000
WHEN "Période inf" like '%Epipal%' then -12000
WHEN "Période inf" like '%Mésol%' then -9500
WHEN "Période inf" like '%Néolitique ancien%' then -5500
WHEN "Période inf" like '%Néolitique moyen%' then -4800
WHEN "Période inf" like '%Néolitique final%' then -3500
WHEN "Période inf" like '%Bronze%' then -2200
WHEN "Période inf" like '%Hallstatt%' then -800
WHEN "Période inf" like '%La Tène%' then -450
WHEN "Période inf" like '%Antiquité%' then -27
WHEN "Période inf" like '%Moyen%' then 476
WHEN "Période inf" like '%moderne%' then 1492
else 1789
END

CASE
WHEN current_value('Période inf') like '%Paléo%' then -15000
WHEN current_value('Période inf') like '%Epipal%' then -12000
WHEN current_value('Période inf') like '%Mésol%' then -9500
WHEN current_value('Période inf') like '%Néolitique ancien%' then -5500
WHEN current_value('Période inf') like '%Néolitique moyen%' then -4800
WHEN current_value('Période inf') like '%Néolitique final%' then -3500
WHEN current_value('Période inf') like '%Bronze%' then -2200
WHEN current_value('Période inf') like '%Hallstatt%' then -800
WHEN current_value('Période inf') like '%La Tène%' then -450
WHEN current_value('Période inf') like '%Antiquité%' then -27
WHEN current_value('Période inf') like '%Moyen%' then 476
WHEN current_value('Période inf') like '%moderne%' then 1492
else 1789
END

CASE
WHEN attribute($current_feature, 'Période inf') like '%Paléo%' then -15000
WHEN attribute($current_feature, 'Période inf') like '%Epipal%' then -12000
WHEN attribute($current_feature, 'Période inf') like '%Mésol%' then -9500
WHEN attribute($current_feature, 'Période inf') like '%Néolitique ancien%' then -5500
WHEN attribute($current_feature, 'Période inf') like '%Néolitique moyen%' then -4800
WHEN attribute($current_feature, 'Période inf') like '%Néolitique final%' then -3500
WHEN attribute($current_feature, 'Période inf') like '%Bronze%' then -2200
WHEN attribute($current_feature, 'Période inf') like '%Hallstatt%' then -800
WHEN attribute($current_feature, 'Période inf') like '%La Tène%' then -450
WHEN attribute($current_feature, 'Période inf') like '%Antiquité%' then -27
WHEN attribute($current_feature, 'Période inf') like '%Moyen%' then 476
WHEN attribute($current_feature, 'Période inf') like '%moderne%' then 1492
else 1789
END

I'm wondering if I must use a python script but I don't know how to do.


texts: QGIS add PostGIS / Spatiallite rows as layers

texts:
I wish to be able to query PostGIS and Spatialite tables and add vectors from individual rows whose attributes meet criteria as multiple layers under a group or sub group instead of a single layer for a table or query.

The aim is to be able to list rows of a table under a group as 'individual layers' (representing 'individual rows') where each layer can be be turned on and off but also to which normal functionality in the layer panel applies when right clicking each layer - for example :
1. zoom to layer (ie to the extent of an individual vector)
2. copy or duplicate the layer
3. rename layer
4. set layer scale visibility
5. each individual layer can be exported


texts:
I am learning how to use ArcGIS and I am unsure how to assign appropriate buffer distance to each lake size classes for a homework assignment, please see the picture below. The goal is to place specific values in the newly created field that assign Buffdist to Size_Cls.

1= 50
2= 150
3= 500

I get to opening the Select by Attribute table, but any input I try gives:

An invalid SQL was used.

Does anyone have any suggestions or any place to redirect me to find how to solve my problem?


texts: Resource allocation to lidR LAScatalog process with SLURM bash script

texts:
I have a possibility to do processing on a super computer, where task managing and resource allocation are controlled by SLURM (Simple Linux Utility for Resource Management) batch job system. However, I have not found the right configurations how to utilize the allocated resources with lidR efficiently. I have tried to allocate 20 CPU's to one task in SLURM and specified  20 workers for a multisession with Future-package within R script. After running a process for a short while, using LAScatalog processing engine, CPU efficiency statistics suggested that with these settings only one of the CPU's was used. Slurm bash script presented below
#!/bin/bash
#SBATCH --job-name=pointsToRaster
#SBATCH --account=project_num
#SBATCH --time=00:05:00
#SBATCH --output=output_%j.txt
#SBATCH --error=error_%j.txt
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=20
#SBATCH --mem-per-cpu=15G
#SBATCH --partition=hugemem

#A 5 MINUTE LONG TEST RUN

#load module
module load r-env-singularity

# Bind threads to individual cores
export OMP_PROC_BIND=true

#Run script
srun --threads-per-core=1 singularity_wrapper exec Rscript --no-save pointClouds.R

This bash script allocates resources and executes script pointClouds.R. Script reads in 30 .las files, containing point clouds produced with SFM-MVS photogrammetric methods. File sizes vary between 1Gt to 5Gt, and they are missing ground classification. First step is to classify groud points. Script content presented below.
#load packages

library(sf)
library(sp)
library(raster)
library(rgdal)
library(lidR)
library(future)

####### SET COMPUTATIONAL CONFIGURATIONS ##########

#Set working directory
setwd(dir = "/scratch/project_num/lasFiles")
filePaths = list.files(pattern = "./*las")

# Parallelization settings:
plan(multisession, workers = 20L)

#Read unclassified point clouds to a LAS-catalog object
pointCat = readLAScatalog(filePaths)

#### CLASSIFY GROUND POINTS ############

#Progressive Morphological Filter-algorithm
opt_output_files(pointCat) = "./outputs/classified_{ORIGINALFILENAME}"

ws  = seq(3, 12, 3)
th  = seq(0.1, 1.5, length.out=length(ws))
groundClassified = lasground(pointCat, algorithm = pmf(ws, th))
rm(pointCat)

Tried changing the setting around determining 20 tasks per node and one CPU per task. This setting raised CPU utilization, but when looking at the "process outputs" -textfile, it shows that every part of the code was executed 20 times (i.e. every package was loaded 20 times). I am not sure are is the problem related to the bash or R-script.
Any help on how to correctly allocate resources with a SLURM bash script to achieve efficient parallel processing with lidR LAScatalog?


texts: Spectral signature of classified classes in Google Earth Engine

texts:
I wrote this code in Google Earth Engine to perform unsupervised classification. The code seems to work fine. I need to classify  conifer trees specifically between all other land covers and I need the spectral signatures of each class to  evaluate them and recognize conifers. Is there a way in GEE to calculate and plot the epectral signature of each class?
     // UNSUPERVISED classification of Conifers//
var input = ee.ImageCollection("COPERNICUS/S2_SR");

var geometry =
    /* color: #98ff00 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[7.582719257752308, 46.02568420992065],
          [7.582719257752308, 44.97372238809936],
          [9.228269435087903, 44.97372238809936],
          [9.228269435087903, 46.02568420992065]]], null, false);

input = input.filterBounds(geometry);

input = input.filterDate('2020-08-06','2020-08-08');

input = input.sort('CLOUD_COVER');

input = input.mosaic();

input = input.clip(geometry);
print(input);

Map.centerObject(geometry,9);

Map.addLayer(input,{min:-157.33,max:1421.15,bands:['B4','B3','B2']}, 'input image');

var training = input.sample({
  region: geometry,
  scale: 10,
  numPixels: 5000
});

var clusterer = ee.Clusterer.wekaKMeans(15).train(training);

var result =  input.cluster(clusterer);

Map.addLayer(result.randomVisualizer(), {}, 'Unsupervised Classified Image');

Export.image.toDrive({
  image: result,
  description: 'Unsupervised Classified Image',
  scale: 10,
  region: geometry
});


texts:
I am trying to output a PostgreSQL9.6 query to geojson as in this answer:

SELECT jsonb_build_object(
    'type',     'FeatureCollection',
    'features', jsonb_agg(feature)
)
FROM (
  SELECT jsonb_build_object(
    'type',       'Feature',
    'id',         gid,
    'geometry',   ST_AsGeoJSON(geom)::jsonb,
    'properties', to_jsonb(row) - 'gid' - 'geom'
  ) AS feature
  FROM (SELECT * FROM paris.plots LIMIT 100) row) features;

I get an error on geojsonlint.com that the polygons should follow teh counterclock-wise rule.
A comment under the answer notes that polygons should be forced to be forced to be reorderd counter-clock wise with ST_ForcePolygonCCW. Hence I updated my code to:

SELECT jsonb_build_object(
    'type',     'FeatureCollection',
    'features', jsonb_agg(feature)
)
FROM (
  SELECT jsonb_build_object(
    'type',       'Feature',
    'id',         gid,
    'geometry',   ST_AsGeoJSON(ST_ForcePolygonCCW(geom))::jsonb,
    'properties', to_jsonb(row) - 'gid' - 'geom'
  ) AS feature
  FROM (SELECT * FROM paris.plots LIMIT 100) row) features;

I get an error:

Kernel error: ERROR:  function st_forcepolygonccw(geometry) does not exist

But the function is listed in the Postgis references. Any idea?


texts: Export Layer to KML. Hyperlink in attribute field is inactive

texts:
I'm working on exporting layers from ArcMap 10.6 to KMLs for use in Google Earth Pro. There is a field in the ArcMap feature class that has a file path link to our network drive to an image. The links do not stay connected when converted to KML.
First image is what I see in ArcMap. A functioning file path.

This is the same file path in Google Earth Pro. The link is not active.

This is what I see in Google Earth Pro when I "Inspect" the file path.


texts: Using GDAL to get vertices of a multipolygon

texts:
I am successfully using GDAL to get the vertices of a polygon from a ShapeFile using .NET code.  This link showed me how to do that:

http://geoinformaticstutorial.blogspot.com/2012/10/accessing-vertices-from-polygon-with.html

However if the shape type is a multipolygon, then this process does not get any vertices.  How can I get the vertices of a multipolygon?


texts:
I'm looking for strategies to replicate the functionality available via ArcGIS' "Aggregate Polygons" tool. This is different from a straight dissolve on the polygons - the operation has to fill in gaps within a certain tolerance.

I'd be happy with a solution in either QGIS or PostGIS. I tried to work something out already with a convex hull but it doesn't quite get what I'm after so I'm at a loss. Any strategies you've come across?


texts: Spatialite in GeoDjango - "...they do not properly define db_type..."

texts:
I've started a new project and choose GeoDjango for it. Because I already developed with Django and sqlite as a DBMS and all worked perfectly fine for me, I found it a great option to use spatialite to make the first development steps and perhaps switch to PostGIS later on, when the app needs scaling.

Although the docs tell different I faced a couple of problems now bringing the spatialite datastore up to life.

First I created a new empty sqlite database file on the sqlite command line (because let django do that for me with syncdb resulted in an error where syncdb didn't hae the geometry_columns table to register my spatial table...so it's about creating the spatial repository first).

Second I ran spatialite database.db "SELECT InitSpatialMetaData();" to create the repository tables.

At least I ran python manage.py syncdb to create my model tables. It does a couple of thing, but ends up in the following error:

Operations to perform:
Synchronize unmigrated apps: gis
Apply all migrations: admin, contenttypes, walmap, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying sessions.0001_initial... OK
Applying walmap.0001_initial... OK
Applying walmap.0002_campsite_capacity...AddGeometryColumn: "duplicate column name: point"
OK
Applying walmap.0003_auto_20141126_1434...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
  :
  :
File "/home/juergen/Development/wal/env/local/lib/python2.7/site-packages/django/db/backends/schema.py", line 460, in alter_field
new_field,
ValueError: Cannot alter field walmap.Campsite.point into walmap.Campsite.point - they do not properly define db_type (are you using PostGIS 1.5 or badly-written custom fields?)

The model class just consists of an id field, a name, a slug, a Point Geometry and an int field for capacity, so nothing special here.

Any ideas about this issue?

EDIT:
SpatialLite is version 4.1.1

PROJ.4 is version 4.8.0

GEOS is version 3.4.2

Django version 1.7

python version 2.7.6


texts: Changing shapefile's field type using fiona?

texts:
I need to have a layer time-enabled for Esri application-making. Coming from the source, it has an int type column called year. I need to find a way to automate its conversion to date.

I first tried with Geopandas, but it gives a ValueError if I try and save to Shapefile with a datetime[ms] dtype:

ValueError: Invalid field type <class 'pandas.tslib.Timestamp'>

I know Fiona can handle date, time, and datetime field types though:

>>> fiona.FIELD_TYPES_MAP

{'date': fiona.rfc3339.FionaDateType,
 'datetime': fiona.rfc3339.FionaDateTimeType,
 'float': float,
 'int': int,
 'str': str,
 'time': fiona.rfc3339.FionaTimeType}

When I load it with Fiona I get:

{'geometry': 'Point',
 'properties': OrderedDict([('npri_id', 'int:9'),
              ('facility', 'str:80'),
              ('year', 'int:9'),
              ...])}

How would I go about changing it to date?


texts: GRASS GIS addon "extension not found"; could the problem be with the GRASS Addons server?

texts:
I'm using GRASS GIS Ver 7.2.2. When I enter command mode and type "g.extension r.hypso" I get the message:

Downloading precompiled GRASS Addons ...
ERROR: Extension  not found

This happens with all of the extensions I've tried to download (attempts over a 3-day period). I re-installed GRASS with no luck.

I am able to query the server's directories and get a list its contents but not successfully add an Addon to GRASS GIS.


texts: Plotting Postal Codes from .csv Files in QGIS

texts:
I have Canadian postal code data that I would like to plot.  This data is currently stored in a simple .csv file.  At the moment the only other data I have is FSA data from Statistics Canada.  Is there any way I can use this data, or is there other data I should have, to properly plot the postal codes from the .csv file onto a map of Canada?  There may be a very simple solution to this, since I am quite new to QGIS.

UPDATE: I found this site, which has free postal code data along with latitudes and longitudes.


texts:
I am new to cartodb and i don't understand how to populate a bootstrap table with my json data retreived using sql.execute:

sql.execute("SELECT sonde.the_geom,sonde.nom,sonde_data.time,sonde_data.cod,sonde_data.fluo FROM sonde, sonde_data WHERE sonde.nom = sonde_data.ref_id_nom AND sonde.cartodb_id = '"+selection+"' ORDER by time").done(function(data) {

for (i in data.rows){
                nom.push(data.rows[i].nom)
                fluo.push(data.rows[i].fluo)
                cod.push(data.rows[i].cod)
                time.push(data.rows[i].time)
            }

        console.log(data)
        //////////////TABLE//////////////
        $(function () {
        $('#table-javascript').bootstrapTable({
            //method: 'get',
            data: data,
            cache: false,
            height: 400,
            striped: true,
            pagination: true,
            pageSize: 50,
            pageList: [10, 25, 50, 100, 200],
            search: true,
            showColumns: true,
            showRefresh: true,
            minimumCountColumns: 2,
            clickToSelect: true,
            columns: [{
                field: 'data.nom',
                title: 'nom',
                align: 'center',
                valign: 'bottom',
                sortable: true
            }, {
                field: 'data.fluo',
                title: 'fluo',
                align: 'center',
                valign: 'middle',
                sortable: true,

            }, {
                field: 'data.cod',
                title: 'cod',
                align: 'center',
                valign: 'top',
                sortable: true

            }]
        });
        });

        })
        }
        );

enter code

I am unable to display my data into the table, i don't know how to call it...
Could someone give me the clue please?


texts: Saving .shp data with symbolization changes

texts: I changed the symbolization of my .shp data such that I classified it instead of one single symbol. Is there a way I can save the .shp that will keep the changes and when I load the layer in QGIS next time, it pops up with the changes made?


texts: Creating duplicate records based on overlapping polygons

texts:
I have a shapefile of all the counties in one state, I also have a shapefile of a grid map dividing the entire state into 1-mile grids. I need to come up with a list of which grids are in which county, a problem made difficult by the fact that many grids overlap multiple counties. There are 41,000 grids and 133 counties.

What would I like as an output is a shapefile where each grid (each record) has a county assigned to it with grids that overlap multiple counties being repeated as many times as necessary.

I am using ArcMap 10.2.1 with a basic license.


texts: How km column is computed in osm2po output table

texts:
I've generated hh_2po_4pgr table using osm2po utility. Now I want to add a few extra edges by hands because some important points are missing from source osm data. In order to do this I need to compute km column. But the problem is that I was unable to guess the function that they use to produce this value.

Example: For x1=28.7075708 y1=55.4504115 x2=28.6814325 y2=55.4514459 they've got km=1.6939924

I've tryed following postgis functions:
1) st_distance

select ST_Distance(ST_Transform('SRID=4326;POINT(55.4504115 28.7075708)'::geometry, 3857),
                   ST_Transform('SRID=4326;POINT(55.4514459 28.6814325)'::geometry, 3857))/1000

which gives distance 3.319061442480019 km.

2) st_distancesphere

select ST_Distancesphere(ST_Makepoint(55.4504115, 28.7075708), ST_Makepoint(55.4514459, 28.6814325))/1000

which gives distance 2.9082010619 km.

So none of those are used by osm2po


texts:
I am looking for a way in QGIS - preferably using the graphical modeller but console scripting will also do - to build a model that iterates through features of a given layer until a condition is met - a while loop.

Specifically, after manually selecting one feature, I need my model to automatically "select by location" all the features that touch the already selected ones until the sum of a given attribute of the selected features reaches X.

Maybe this image helps:


texts: Collecting features from multiple layers, with different attribute fields, in one layer using PyQGIS?

texts:
I am developing a plugin for Qgis. I have three layers that contain polygon geometries, and that need to be combined in one layer. During this process, I also collect all the attributes from the input features and write them into the output layer. However, the input layers have different attribute sets. The code, which I have written sets attributes to a feature based on the position of attributes, which vary for different input layers. So the question is:

How can I set the attributes to a QgsFeature in the output layer based on the name of the field that this attribute had in the input layer?

Here is the code that does the job now, but mixes the attribute values in the output layer:

# 1) Create a temporary output layer
output_layer = QgsVectorLayer("Polygon?crs=epsg:4326", "Combined polygons", "memory")

# 2) Create a list of layers. Layers are retrieved from the plugin dialog earlier in
#the code. There are more than two layers. Here, for simplicity, working with
#only two of them
input_layers= [(input1,"Polygons_before"),(input2, "Polygons_after")]
output_layer_provider = output_layer.dataProvider()

new_field_inserted=False # This will be used later for inserting a new field

# 3)Iterate through the input layers to combine them in one layer
for layer, name in input_layers:
     collected_features = []

     #Get the input layer attribute fields
     layer_attr = layer.dataProvider().fields().toList()

     #Add a new field for distinguishing features from different input
     # layers in the output layer.
     if new_field_inserted==False:
        new_field = QgsField("mask_type", QVariant.String, "text", 50)
        layer_attr.insert(1, new_field)
        new_field_inserted = True # Set this variable to True to avoid inserting the field miltiple times.

     #Add input attribute fields to output layer
     output_layer_provider.addAttributes(layer_attr)
     output_layer.updateFields()

     #Get the input features
     features = layer.getFeatures()

     #Collect input features in a list
     for feat in features:
         geom = feat.geometry()
         attr = feat.attributes()
         attr.insert(1,name)
         feature = QgsFeature()
         feature.setGeometry(geom)
         feature.setAttributes(attr)
         collected_features.append(feature)

      #Add collected features to the output layer
      output_layer_provider.addFeatures(collected_features)

 QgsProject.instance().addMapLayer(output_layer)


texts:
I have imported some OS MasterMap data into QGIS 3.2 and have labelled the Cartographic Text dataset. This dataset has a rotation field, populated with various angles of rotation depending where they are to be positioned with relation to roads and buildings. However, when I choose this column under Data Defined Placement, it seems to be rotating the labels in the wrong direction.

Is there a way to tell QGIS to treat the angles differently, as you can in ArcGIS (geographic or arithmetic)?


texts:
My purpose is to make a central line from a polygon.
For this I use the skeleton algorithm from a polygon, but I did not manage to get a line.

I draw the polygon.

I launch the program.

It doesn't work!


texts: ArcGIS Trace tool not honoring classic snapping?

texts:
I have just installed service Pack 3 for ArcGIS 10 Desktop. Normally I use the new snapping environment, so I am unsure whether this is a new issue with SP3 or if it has been the case the whole time.

I want to cut a polygon in layer 1 using a trace on overlapping polygons from layer 2. So to be sure I wasn't accidentally snapping to the wrong layer (as there are various other lines and points in the map), I turned on classic snapping and have only the edge in layer 2 selected.

The trace is still following other lines and edges, totally ignoring my classic snapping settings. Has anyone else come across this, or do you know if it is a bug?


texts: Is it possible to load a visualization created in the Carto Builder using Carto VL?

texts:
When using CARTO VL to load data from my Carto account I'm able to add Datasets to the map and interact with it.

Is there any way to add the whole map built in the Carto builder to a map? With all its layers?

I suppose I can load it as regular raster tiles, but I'd like to receive each layer (dataset) information so I can programatically add interaction to it. (I'm assuming it's not possible to have the programmed interaction working as we have when using CARTO.js)


texts: Mapbox Vector Tiles from Geoserver 2.11 in Mapbox GL JS

texts:
I am running Geoserver 2.11.0, have installed the vector tiles extension and enabled the application/x-protobuf,type=mapbox-vector tile format.

Requesting vector tiles from my server using OL3 works great using the format below

layers: [new ol.layer.VectorTile({
  style:simpleStyle,
  source: new ol.source.VectorTile({
    tilePixelRatio: 1, // oversampling when > 1
    tileGrid: ol.tilegrid.createXYZ({maxZoom: 19}),
    format: new ol.format.MVT(),
    url: 'http://SERVER_IP_ADDRESS:8080/geoserver/gwc/service/tms/1.0.0/blocks:midwestBlocks@EPSG%3A'+projection_epsg_no+'@pbf/{z}/{x}/{-y}.pbf'
  })
})

How could I add these MVT tiles to a MapBox GL JS application as a new layer? Trying like below does not work where my workspace is blocks and my layer is midwestBlocks. Console shows a 404 for these requests

map.addLayer({
    "id": "censusBlocks",
    "type": "line",
    "source": {
        type: 'vector',
        url: 'http://SERVER_IP_ADDRESS:8080/geoserver/gwc/service/tms/1.0.0/blocks/'
    },
    "source-layer": "midwestBlocks",
    "layout": {
        "line-join": "round",
        "line-cap": "round"
    },
    "paint": {
        "line-color": "#ff69b4",
        "line-width": 1
    }
});


texts: extraction of regions from segmented image in python

texts:
I have a land cover image and I segmented it. Since the images are large in size, I am uploading only a part of them. here is the original image's part :

here is the corresponding segmented image:

I used K-means clustering algorithm to achieve segmentation. Now I want to extract different regions marked with same intensity in the segmented image so as to classify it for the land cover.
Is it possible to extract different regions directly from the segmented image (if possible in the form of polygons) to classify them.

Please help me with a source/link or a way on how to do it or atleast begin with it. P.s I work on Python


texts: ArcMap MXD will open on one computer but not any others?

texts:
I have an MXD which I use on 10.2 at one office and it works fine, all layers there, no errors, data links fine.  The MXD lives on a shared LAN and is launched from there.

If that MXD is launched on the same LAN from another computer (also running 10.2) I get an error message that the file does not contain a valid arcmap document.

I have also tried copying the MXD and opening it locally on a different computer instead of across the LAN and get the same error.

I have also tried launching it from a 10.3 ArcMap install on a different computer but get the same error.  No matter which computer I try I can not get it to launch the MXD except on the initial computer.

I believe all these machines are running the same license level.

The text of the error message is:

Here is a link to dropbox with a zip of the MXD document:
https://www.dropbox.com/s/u2b5rjmhc93g7gc/TOC%20Current%20Template.zip?dl=0

Any ideas why this MXD is unhappy?


texts: How to find the shortest route between two points based on cost surface?

texts: I have two locations: (A) starting point and (B) designation. Also I have a slope raster. I want to find the cheapest path between these two locations based on the slope (it is more expensive to travel over steep slope). What tools in which order do I have to use in order to get that (either ArcGIS or Grass GIS)?


texts: How to process large size satellite images without loading the entire image into the memory?

texts: I am working with large size satellite images having size around 25 GB. My system is having 8 GB of RAM and gets entirely freezed after reading the image. What is the efficient way to process images having size more than the system RAM?


texts: ArcGIS API for JavaScript: How to filter layers when using Traffic Service

texts:
I'm using ArcGIS API for JavaScript v4.41 (https://developers.arcgis.com/javascript/)

I want to display a traffic layer on my map with live traffic but without the traffic incidents (red-amber dots). The documentation is found here: https://developers.arcgis.com/rest/network/api-reference/traffic-service.htm.
It says: "To work with the layers in the service, you need to specify the ids for the layers instead of the layer names.", but I cannot seem to figure out how to pass those layer ids to the service. The code I used to add the traffic layer is below.

Any help regarding this is appreciated. Thank you.

trafficLayer = new MapImageLayer({
      url: "http://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer",
      dpi: 48,
      imageFormat: "png32",
      refreshInterval: 5,
      useViewTime: false
    });

var map = new Map({
      basemap: "streets",
      layers: [trafficLayer]
    });


texts: What is the usefulness of the angle and direction of the sun parameters in hillshade?

texts: These parameters refer to the angle as of elevation and direction of the sun hypothetically to the hillshade but why does that must have any importance?


texts: How to identify misaligned corners in PLSS sections

texts:
Sometimes PLSS section corners do not align

How could I automate the detection of these corners and generate a new shapefile showing where this occurs? I have a shapefile of 147k section polygons that I would like to analyze.

I am on ArcGIS 10.1 and have Spatial Analyst and 3D analyst licenses.

Based on comments below, I know I could count the sides of polygons to detect some of these occurrences. This would not work in every case where corners are misaligned. Any other suggestions?

On a side note, why do the corners in PLSS sections not always align?


texts: Query to intersect polygons in PostGIS with points in MongoDB

texts:
Question:
Is it possible to intersect geometries from No-SQL and SQL databases?

Background:
I need to delete the polygons from a PostGIS database that intersects with points (Lat/Long) in a MongoDB.

Workaround:
I'm using an FME workbench to make this task, but I would like to do it using Dbeaver or other RMDBS based on a query. Is it possible?


texts: Using Geometry collections with Fiona to write output of Multipoints and Points?

texts:
I am getting the following error on this function:

ValueError: Record's geometry type does not match collection schema's geometry type: 'Point' != 'MultiPoint'

The problem is that I have multipoints mixed with regular points. When I try to write the outputs at I get a schema confusion problem

The record causing problems at 'output.write' is this one (note: that for a MultiPoint it only has one x,y):

{'geometry': {'type': 'MultiPoint', 'coordinates': [(13531245.475704141, 2886003.2689278126)]}, 'type': 'Feature', 'id': '0', 'properties': OrderedDict([(u'H20Status', u'Fair')])}

When I go:

                        if geom['type'] == 'MultiPoint':
                        # break Multipoints into points
                        # i.e. <class 'shapely.geometry.multipoint.MultiPoint'>

                            for pt in my_shape:
                                pt = self.move_point(pt, compare, dist)

'pt' becomes a 'Point':

POINT (13531245.47570414 2886003.268927813)

Then when I try to write it back to what it was (a Multipoint):

                    # write to outfile - WHERE EVERYTHING FAILS
                    output.write({'geometry':mapping(pt), 'properties': item['properties']})

I get this:

ValueError: Record's geometry type does not match collection schema's geometry type: 'Point' != 'MultiPoint'

If I try to re-write 'pt' to a 'MultiPoint' BEFORE the write operation (and again, this is a multipoint with ONE coordinate set) like so,

 mpoint = MultiPoint(pt)

I get this:

  File "C:\Python27\lib\site-packages\shapely\geometry\multipoint.py", line 143, in geos_multipoint_from_py
    assert len(array['shape']) == 2
AssertionError

*Full working code after help from @gene and @Vince *

def process_file(self, in_file, out_file, compare_file, dist):
    # open input file and compare file
    # loop over each
    with fiona.open(in_file, 'r') as input:
        meta = input.meta
        # The outFile has the same crs, schema as inFile
        with fiona.open(out_file, 'w', **meta) as output:
            with fiona.open(compare_file, 'r') as compare:
            # Read shapely geometries from file
            # Loop through all shapely objects
            # type(item) = 'dict'
                for item in input:
                    geom = item['geometry']
                    my_shape = shape(geom)

                    # check if it is a multipoint or point
                    if geom['type'] == 'MultiPoint':
                        # break Multipoints into points
                        # i.e. <class 'shapely.geometry.multipoint.MultiPoint'>

                        for pt in my_shape:
                            single_point = self.move_point(pt, compare, dist)
                            mpoint = MultiPoint([(single_point.x, single_point.y)])
                            mpoint_for_merge = shape(mapping(mpoint))
                            # write to outfile - WHERE EVERYTHING NOW WORKS
                            output.write({'geometry':mapping(mpoint_for_merge), 'properties': item['properties']})

                    elif geom['type'] == 'Point':
                        # return of move_point is a shapely geom
                        # i.e. <class 'shapely.geometry.point.Point'>
                        my_shape = self.move_point(my_shape, compare, dist)
                        # write to outfile
                        output.write({'geometry':mapping(my_shape), 'properties': item['properties']})

                    else:
                        raise ValueError('unhandled geometry type: ' + repr(geom.type))


texts: Using GeometricShapeFactory to create circle with radius in miles

texts:
I'm new in PostgreSQL/PostGIS and I have a problem and don't know how to solve it.
I'm using GeometricShapeFactory.createCircle() method in Java to get Polygon from central point (lat/long) and radius, which is in miles. As I understood, setSize() method expects radius as extent. So, how to convert it to miles? I suppose that is the reason why I got the huge circle on map.
Also, I'm using hibernate spatial in my project.

This is my piece of code, but it doesn't display correctly polygon:

private Polygon getPolygonFromCircle(Double radius, Double latitude, Double longitude) {
    GeometricShapeFactory shapeFactory = new GeometricShapeFactory();
    shapeFactory.setCentre(new Coordinate(latitude, longitude));
    shapeFactory.setSize(radius * 2);
    shapeFactory.setNumPoints(32);

    Polygon circlePolygon = shapeFactory.createCircle();
    circlePolygon.setSRID(4326);

    return circlePolygon;
}


texts: Check if a point is contained by any polygon stored in PostGis

texts:
I'm using PostGIS and I've created a table:
CREATE TABLE test (id SERIAL PRIMARY KEY, poly geometry(POLYGON));

Inserted a polygon:
INSERT INTO test(poly) VALUES(ST_GeomFromEWKT('SRID=4326;POLYGON((0.0 0.0, 0.0 10.0, 10.0 0.0, 10.0 10.0, 0.0 0.0))'));

Now I'd like to check if POINT(5 5) is within any of the polygons:
SELECT * FROM test WHERE ST_Contains(poly, ST_GeomFromEWKT('SRID=4326;POINT(5 5)'));
id | poly
----+------
(0 rows)

I don't understand where the problem is. Shouldn't it return the inserted polygon? There must be some trivial mistake in my statement.


texts: Showing realtime HEADING in ArcMap using GPS positioning toolbar?

texts:
How can I display a real-time GPS position in ArcMap 10.1 using the GPS toolbar?

We have it setup so position works fine. Just ArcMap refuses to interpret HEADING. So the real-time icon cannot rotate according to it.I checked ESRI documentation regarding real-time GPS of course.

Funny detail: None of the screenshots used by ESRI itself show a heading value in the window explanations. Always just 0.0 (which is at least more than the N/A I got). So maybe heading is an always buggy function anyways that just never got addressed?

I'll describe our setup briefly and add some screenshots for clarification.

We're on a vessel, doing offshore exploration. We use dive robots for this (ROVs). They get tracked pretty precise by underwater sonar vessel systems and their positioning is handled by a specific software (in our case: Fugro's Winfrog 3.1).

Being able to display the ROV in realtime in a "rich data context" as ArcMap allows, is important for us. So Winfrog now outputs a NMEA compatible string to ArcMap i.e. ESRI documentation says it is required format over network virtual COM132.

The string is indeed detected fine by ArcMap and  position, date and time come in fine, just HEADING does not. I attached screenshots of the Winfrog string config, the string setup in ArcMap and the position window in ArcMap, showing N/A for heading.

Regarding the various Winfrog config options: I'm very sure we tried all variations for the position string etc. in the past, currently cannot verify since I do not have access to the live system.

The string as configured by Winfrog comes in in sets of 3 rows like also shown on an attached screenshot (captured with Hyperterminal). I show two of such blocks. Small edits for this forum include masking of real lats/lons and the dashed line as visual separators for the string "blocks".

In real, string has numeric lat/longs and no dashed lines of course. Further find a version of that string naming the string elements instead of values, at least how I understand it.

String

Winfrog settings (string config)

ArcMap incoming connection

ArcMap position window, heading "N/A"


texts: Using where clause to select minimum value in Select_analysis tool of ArcPy?

texts:
I am trying to use the Select_analysis tool to select the minimum value from the input geodatabase feature class and export that to a new feature class via a where clause.  I think I'm getting tripped up on the SQL syntax.

Relevant code:

sql = "SELECT MIN([FIELD]) FROM FC"

arcpy.Select_analysis(input, output, sql)

My input and output are defined path variables elsewhere in the code.

I am using ArcGIS Desktop 10.6.


texts: Joining attributes from points to polygon

texts:
I am working with two shapefile, polygons and points. These shapefiles do not overlap and have different attribute values.

The point layer contains data that I want to join to the beginning and end of the polygon layer. Is it possible? (Example below)


texts: What does this style of line on Topographic maps indicate

texts:
If I was reading the purpose of this stackexchange site right, I could also ask general map questions. Not necessarily regarding software.

Anyways, I was wondering if someone could inform me what this blue line indicates on this topo map image. I understand the circular line with the ticks indicates a lower elevation, possible sinkhole-like, but I don't know what that blue line is.

Also, does that line with the Xs through it normally indicate a fence?

If it matters at all, this is a map image from an ESRI powered site.

EDIT: Here is a link http://www.kgis.org/KGISMaps/map.htm?map=topography&box=2540262:579354:2540837:579771


texts: Need tool for ArcMap to draw circle touching three points

texts:
I need tool for ArcMap 10.2.2 for Desktop to draw circle by (touching) three points.

I don't know where the center of this circle and this three points shoud be on the circle line.

I have such tool in other GIS software and can show on video how it works, if needed?