texts: Styling GeoJSON in leaflet based on properties

texts:
I'm new to Leaflet, Javascript and GIS Stackexchange.  I've been working through various tutorials to try and produce what I need but I'm missing something.

Essentially I would like to produce a leaflet map with a drop down selector that changes the styling and popups of my geoJSON based on different attributes.

Here is my code:

var map = new L.Map('map', { zoomControl:false });

    map.dragging.disable();
    map.touchZoom.disable();
    map.doubleClickZoom.disable();
    map.scrollWheelZoom.disable();
    map.boxZoom.disable();
    map.keyboard.disable();

    // Create control for dropdown selector

    var selector = L.control({
        position: 'topright'
    });

    // Add content to the control

    selector.onAdd = function(map) {

    //create div container

    var div = L.DomUtil.create('div', 'hazard_select');

    //create select element within container (with id, so it can be referred to later
    div.innerHTML = '<select id="hazard_select"><option value ="FL">River flood</option><option value ="EQ">Earthquake</option><option value ="DR">Water scarcity</option><option value ="CY">Cyclone</option><option value ="CF">Coastal flood</option><option value ="TS">Tsunami</option><option value ="VO">Volcano</option><option value ="LS">Landslide</option></select>';
      return div;

    };

    // Add the selector to the map
     selector.addTo(map);

    var geojson, style_change, hazard;

    // Define a style

    function restylemap(feature, hazard) {

      if (feature.properties.FL_SUB !== null) {
          return {
          weight: 1.2,
          color: '#0072bc',
          fillColor: '#08519c',
          lineJoin: 'bevel',
          opacity: 1.0,
          fillOpacity: 1.0
          };
      }
      else if (feature.properties.FL_NAT !== null) {
          return {
          weight: 1.2,
          color: '#659ad2',
          fillColor: '#3182bd',
          lineJoin: 'bevel',
          opacity: 1.0,
          fillOpacity: 1.0
          };
      }
      else if (feature.properties.FL_REG !== null) {
          return {
          weight: 1.2,
          color: '#659ad2',
          fillColor: '#6baed6',
          lineJoin: 'bevel',
          opacity: 1.0,
          fillOpacity: 1.0
          };
      }
      else {
          return {
          weight: 1,
          color: '#afafaf',
          fillColor: '#bdd7e7',
          lineJoin: 'bevel',
          opacity: 1.0,
          fillOpacity: 1.0
          };
      }

    }

    // Get json through jquery

    $.getJSON("js/dataholdings.geojson", function(data) {
    geojson = L.geoJson(data, {
      style: restylemap,
      onEachFeature: function (feature, layer) {
       layer.bindPopup("Name: " + feature.properties.ADM0_NAME);
      },

    });

    // Add event listeners

    style_change = L.DomUtil.get("hazard_select");
    L.DomEvent.addListener(style_change, 'click', function(e) {
      L.DomEvent.stopPropagation(e);
    });

    L.DomEvent.addListener(style_change, 'change', changeHandler);

    function changeHandler(e) {
      geojson = L.geoJson(data,
      restylemap(geojson,e.target.value)
      )
    }

    map.fitBounds(geojson.getBounds());
    geojson.addTo(map);
    });

This works to initially style the map, but not when the drop down is changed. I think the problem is with my changeHandler function, it passes on the Hazard ID to restylemap but then has the error "TypeError: undefined is not an object (evaluating 'feature.properties.FL_SUB')".  As hazard is replacing feature?

I wanted to pass the Hazard variable into the 'Feature.properties' somehow, is this possible? i.e (feature.properties[hazard]& '_REG' !== null).  Would this work?

Any advice gratefully received!


texts: Dynamic SLD styling - unique colours for linestrings

texts:
I have a postGIS table that looks like this:

(plus a 'track' geometry column, a linestring for the vessel's track)

sampling_interval | voyage_name |   start_time_utc    | id |      ship_name       | start_port | end_port  |           description           |   last_update_utc
------------------+-------------+---------------------+----+----------------------+------------+-----------+---------------------------------+---------------------
                5 | ss2011_e01  | 2011-02-25 23:15:35 | 73 | RV Southern Surveyor | Hobart     | Sydney    | Transit to drydock              | 2011-03-02 02:26:55
                5 | ss2011_v05  | 2011-09-21 06:36:20 | 74 | RV Southern Surveyor | Geraldton  | Geraldton | GA Hydrocarbons                 | 2011-10-17 23:02:25
                5 | ss2012_v01  | 2012-04-20 00:02:45 | 82 | RV Southern Surveyor | Brisbane   | Brisbane  | Sustained monitoring of the EAC | 2012-04-29 05:48:45
                5 | ss2012_t02  | 2012-05-02 03:01:35 | 86 | RV Southern Surveyor | Brisbane   | Lautoka   | Transit Brisbane Lautoka        | 2012-05-09 22:14:00

I have a WMS layer in geoserver pointing to this. What I would like to do is ensure that each vessel track is a distinguishable colour. New voyages are added to this table regularly; if at all possible I would rather not have to edit the SLD next time (and if I do have to edit it, it'd need to be scriptable).

Using a SLD with some logic in it to do this styling seems like the obvious approach, but from looking at the guides/docs, I'm not sure if this is possible (this is really my first exposure to SLDs).

Is this possible/sensible using SLDs? I'm open to other approaches, of course, if there is something that makes more sense. Any pointers appreciated - like I said, I'm very much a newbie with SLDs (but comfortable with postGIS/Geoserver/Java etc)


texts:
I want to use this Python script to check my D: for .mxd's and list them in a CSV, as I want to find which MXD is using a particular file, and this would help.

I don't know where to put the file path ect (d:) and what to change to make it work.

In my environment, what do I need to do to make it work?

import os
import csv
import arcpy

def ListMXDSources(path,extension):
  list_dir = []
  CountList = []
  MapList = []
  list_dir = os.listdir(path)
  count = 0
  for paths, dirctory, files in os.walk(path):
    for file in files:
        if file.endswith(.mxd): # eg: '.mxd'
          MapList.append(os.path.join(paths, file))
          print MapList
          for m in MapList:
                count += 1
                mxd = arcpy.mapping.MapDocument(m)
                ## --------- For each map list layers
                for lyr in arcpy.mapping.ListLayers(mxd):
                    with open("ListOfDataSources.csv", 'wb') as csvfile:
                        csvwriter = csv.writer(csvfile)
                        for dirpath, dirnames, filenames in arcpy.da.Walk(MapList):
                            for filename in filenames:
                                desc = arcpy.Describe(os.path.join(dirpath, filename))
                                csvwriter.writerow([desc.catalogPath, desc.name, desc.dataType])

#-------------Use below to call the function----------------#
ListMXDSources(path=r"ROOT FOLDER LOCATION",extension=".mxd")

I get this result

>     ['d:Untitled.mxd']
>     ['d:Untitled.mxd', 'd:arcpy\\ArcPy_and_ArcGIS_Second_Edition_Code\\Chapter_06\\MXDs\\BrokenLinks.mxd']
>     ['d:Untitled.mxd', 'd:arcpy\\ArcPy_and_ArcGIS_Second_Edition_Code\\Chapter_06\\MXDs\\BrokenLinks.mxd',
> 'd:arcpy\\ArcPy_and_ArcGIS_Second_Edition_Code\\Chapter_06\\MXDs\\MapDocument1.mxd']
>
>     Traceback (most recent call last):
>       File "D:\SearchMxdListCSV (2).py", line 31, in <module>
>         ListMXDSources(path=r"d:",extension=".mxd")
>       File "D:\SearchMxdListCSV (2).py", line 19, in ListMXDSources
>         mxd = arcpy.mapping.MapDocument(m)
>       File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\mixins.py", line 611,
> in __init__
>         assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")
>     AssertionError: Invalid MXD filename.


texts: Including maximum possible distance of route as restriction when using ArcGIS Network Analyst?

texts:
Using the network analyst of ArcGIS, I am trying to find the possible routes in my network from a determined starting/ending point which the maximum distance should not exceed 90 kilometers. I am using the network analyst to calculate it but I am having problems to set the restriction of maximum distance of 90 kilometers.

Can anyone help me with that?

The reason I am using this tool is that I also have weights associated with my roads. So each route calculated gives the sum of the weights of the roads in which the car pass by. So at the end I can find the route below 90 kilometers that gives me the highest sum of weights.


texts: Converting CSV to Shapefile using pyshp?

texts:
I have a python script which converts csv data to shapefiles. It converts but won't get angle from csv.

Can anyone help me?

The CSV data looks like this:

fid_nr;x;y;angle
1;55.474040000;13.020460000;90
2;55.474040000;13.020460000;90

And the Python script is:

import shapefile as shp
import csv
import os
import sys

fileToOpen = open('test.csv', "rb")

#Set up blank lists for data
fid_nr,x,y,angle=[],[],[],[]

#read data from csv file and store in lists
with open(fileToOpen, 'rb') as csvfile:
    print "File found and will be now converted"
    r = csv.reader(csvfile, delimiter=";")
    for i,row in enumerate(r):
        print row
        if i > 0: #skip header
            fid_nr.append(row[2])
            x.append(float(row[0]))
            y.append(float(row[1]))
            angle.append(row[3])

#Set up shapefile writer and create empty fields
w = shp.Writer(shp.POINT)
w.autoBalance = 1 #ensures gemoetry and attributes match
w.field("fid_nr","N")
w.field("x","F",10,8)
w.field("y","F",10,8)
w.field("angle","N")

#loop through the data and write the shapefile
for j,k in enumerate(x):
    w.point(k,y[j]) #write the geometry
    w.record(k,y[j],fid_nr[j],x[j],y[j],angle[j])
#Save shapefile
w.save("Resultat/" + out_file3)
print "Done!"


texts: PostGIS distance between multiple points

texts:
I have a data set in a PostGIS data base (table name is animals) with the following structure:

id (int, pk) | latitude (double) | longitude (double) | type (char) | geom (srid: 4326)

In the type-column there are currently values of 1 and 2, where 1 stands for, let's say, lions and 2 for zebras.

I've managed to calculate the distances between all points with

SELECT ST_Distance_Sphere(a.geom, b.geom)
FROM animals a, animals b
WHERE a.typ=' 1' AND b.typ=' 2';

However, I want to select all the attributes where the distance is smaller than 500 m. Something like

SELECT * FROM animals WHERE (ST_Distance_Sphere(a.geom, b.geom)
FROM animals a, animals b
WHERE a.typ=' 1' AND b.typ=' 2') < 500;


texts: File size increases significantly after re-projecting

texts:
I have processed some aerial imagery using mapsmadeeasy.com, and georeferenced the image using the web tool within MME. However, this is not a very accurate means of georefencing, and delivers a result in EPSG:4326, but our client would like the results projected in EPSG:2193, as we are in New Zealand.

Using the QGIS georefencer tool, i use local government imagery to georeference the imagery that we capture to accurately match the local government imagery.

This is where the problem occurs, the file we download from MapsMadeEasy is a 2.3GB .TiFF, but the resulting file is over 9GB when georeferenced in EPSG:2193.

What is the cause in this huge file size increase, and how can I avoid it?


texts: Can you search by the parcel number shown in the "What's Here" pop-up on Google Maps?

texts: When you right click on a location in Google Maps and select "What's Here", it usually provides an address and the coordinates.  However when I click inside a lot (e.g. on a farm) I often get a parcel number and no address (see screen shot below).  If you type those numbers back into Google Maps search bar, it doesn't find it.  Is there a way to input the parcel number into Google Maps so that it can find the location?


texts: Creating distance raster using road network ArcGIS

texts:
I'm working with three main layers in ArcGIS- geocoded dental office points, bus stops, and a road network. I would like create something similar to a three ring buffer that accounts for three distances from each bus stop, except using the road network instead of euclidean distance, similar to the attached graphic, which will allow me to see which geocoded offices fall within each of the three buffers. I have attempted the New Service areas tool within Network Analyst, but it doesn't seem to be doing the trick. Perhaps I'm using the tool incorrectly, or I'm using the wrong tool altogether.

(source: digital-geography.com)


texts:
I am trying to add a geodatabase (.gdb) vector layer into QGIS but I am running into an error. It says the .gdb file is not a valid or recognized data source.

I have spoken with the agency that maintains the file and they said it should work - it works fine on their end in ArcGIS Desktop. It's a version 9.3 .gdb file.

I have successfully opened and edited other .gdb files in QGIS. I use Directory --> OpenFileGDB. I am using QGIS version 2.18.15. What could be causing the problem now?

A link to download the GDB file is here: https://vgin.maps.arcgis.com/home/item.html?id=29627d7c051a47dc8ce71b4484531ab3

Here is a screenshot of the files within the .gdb file. Is something missing?


texts: Controlling the order in which layers are rendered in Mapzen's Tangram?

texts: Tangram uses a YAML mapping to define layers, which means that order is undefined. So, how do you control the order in which layers are rendered?


texts:
I am working with Landsat 8 data.  I have performed the necessary pre-processes that I want (atmospheric and topographic correction and pan-sharpening, using QGIS and ERDAS).  I am now working on removing clouds and cloud shadow.  I used the "Iso Cluster Unsupervised Classification" tool first.  I then manually color coated vegetation vs. cloud/shadow coverage (red and green).  I used the "reclassfy" tool to combine the two classes.

I am stuck with:
Now I want to make the cloud/shadow coverage value 0 and the vegetation value 1.  Then multiple that by my original pre-processed Landsat 8 image.  This way all the pixels with the cloud/shadow coverage will disappear, but make sure I keep the RGB bands from the original.  Any suggestions?

I have tried multiplying the cloud/shadow and vegetation data by the original in the raster calculator and I get an output with no clouds, but the RGB bands are no longer there.


texts: Using Set Z Value in QGIS Graphical Modeler - Modeler not passing elevations from field

texts:
I am trying to use the Set Z Value algorithm in QGIS Graphical Modeler. More specifically, I would like to set the elevations using values contained in a field in the input layer, but the elevations are not getting passed to the output.
I have tried connecting things as described in this post: Using Set Z-Values in QGIS Processing Modeler, but Modeler is not passing any elevations to the output.
I have created the [Vector Layer] and [Vector Field] inputs as shown in the post.
In the [Set Z value] algorithm dialog, I have tried:

setting the [Input layer] type to [Model Input] and the value to my [Vector Layer], and
setting the [Input Layer] type to [Value] and setting the value to the corresponding layer name.

When I run the model, it prompts me to select the appropriate elevation field, which I do. The model runs and produces a result, but the result is not elevated. Any thoughts?


texts: I want to transform x-coordinates into dddmm.mm. When I use an expression like to_dm($x, 'x', 2) I am getting something like in the screenshot. This is obviously not correct. What am I doing wrong?


texts:
Does Quick Maps plugin still work with QGIS 2.99 or is it no longer supported? I am unable to install from zip. Is there a new plugin that allows access to open source data/aerial imagery?

Error is below...

  An error occurred during execution of following code:
  pyplugin_installer.instance().installFromZipFile('C:\Users\geogjo\Downloads\quick_map_services-0.19.3.zip')

  File "", line 1
  SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

  Python version:
  3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]

  QGIS version:
  2.99.0-Master 'Master', 7cfbb6fb1c

  Python path:
  ['C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins\processing', 'C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python', 'C:/Users/geogjo/AppData/Roaming/QGIS/QGIS3\profiles\default/python', 'C:/Users/geogjo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins', 'C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python/plugins', 'C:\Program Files\QGIS 2.99\bin\python36.zip', 'C:\PROGRA~1\QGIS2~1.99\apps\Python36\DLLs', 'C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib', 'C:\Program Files\QGIS 2.99\bin', 'C:\PROGRA~1\QGIS2~1.99\apps\Python36', 'C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages', 'C:/Users/geogjo/AppData/Roaming/QGIS/QGIS3\profiles\default/python']

Josh


texts: Rule-based symbology based on related layer in QGIS

texts:
I'm working with QGIS
I have two layers:

Layer 1: has the id and geom columns (multypolygon layer)
Layer 2: has the id, gid and type columns (table layer).

The value gid of layer 2 is the foreign key and it is related with id of layer1, so for each id of layer 1 I have many gid of layer 2. I added the relation also in the Qgis project properties.

Now I need to do a rule-based symbology based on this relation 1:N.
In layer 1 I want to show a different colour based on Type column of layer2.
I suppose I have to do a rule-based for each Type but I don't know the expression to use.
I tried
relation_aggregate(relation:='gid_fk', aggregate:='array_agg'("Type", group_by:="Type", filter:="xxx"), expression:="Type") but probably it is not the solution and there is a syntax error.
I try to do a more specific example: layer1 with id=0 is a geometry, layer2 gid0-Type1 is an economic activity and in gid0-Type2 is a touristic accomodation. So I have more information related to one geometry. I was wondering if i can assign a rule-based symbology using the relation_aggregate or if I should create a virtual layer with overlapped geometry, in that case I would obtain 1:1 and no problem of symbology.


texts: What would a simple hillshade algorithm be?

texts:
I'm curious how GIS systems actually generate a hill-shade from input data like a raster DEM layer. I'd like to implement my own in software (mostly for fun/learning) but I want to start with a plausible algorithm so I don't waste an incredible amount of time.

Naively, I'd think you could scan the elevation data, calculate the slope from point to point in a given direction (say left to right), then color all of either the positive or negative slopes. If the min and max slopes in the elevation tile were known, it seems like it might also be nice to scale the color based on that.

Is that a plausible way to go about the problem?


texts: Unsupervised classification with kmeans in R

texts:
I have a time series of satellite images (5 bands) and want to classify them by kmeans in R.
My script is working fine (loop through my images, convert the images to data.frame, cluster them, and convert it back to a raster):

for (n in files) {
image <- stack(n)
image <- clip(image,subset)

###classify raster
image.df <- as.data.frame(image)
cluster.image <- kmeans(na.omit(image.df), 10, iter.max = 10, nstart = 25) ### kmeans, with 10 clusters

#add back NAs using the NAs in band 1 (identic NA positions in all bands), see http://stackoverflow.com/questions/12006366/add-back-nas-after-removing-them/12006502#12006502
image.df.factor <- rep(NA, length(image.df[,1]))
image.df.factor[!is.na(image.df[,1])] <- cluster.image$cluster

#create raster output
clusters <- raster(image)   ## create an empty raster with same extent than "image"
clusters <- setValues(clusters, image.df.factor) ## fill the empty raster with the class results
plot(clusters)
}

My problem is: I can't compare the classification results to each other because the cluster assignents differ from image to image. For example, "water" is in the first image cluster number 1, in the next 2 and in the third 10, making it impossible to compare the water results between the dates.

How can I fix the cluster assignment?

Can I specify a fixed starting point for all image (hoping that water is always detected first and thus classified as 1)?

And if yes, how?


texts: Arcpy make raster layer function does not produce right output

texts:
I am trying to extract bands within rasters:

import arcpy
arcpy.env.workspace = 'd:/Rstack'
raster_list = arcpy.ListRasters("*RADIOMETRY.tif", "TIF")
list1 = []
for i in raster_list:
    arcpy.MakeRasterLayer_management(i, "lyr", "1")
    list1.append("lyr")

list1 returns a list of strings which the loop does not seem to go through make raster layer function. Any other way to batch extract bands? Extract sub dataset tool does not support tif files.


texts:
I am trying to obtain a polygon from each group of points "G" but I obtain only one single polygon for all the points.
I grouped data by the G variable but it doesn't work.

library(sf)
library(tidyverse)

    data.frame(ID = 1:10,
               X = sample(1:10, 10),
               Y = sample(1:10, 10),
               G= c("a","a","a","a", "b","b","b","c","c","c")) %>%
    st_as_sf(coords = c("X", "Y")) %>%
    group_by(G) %>%
    st_union() %>%
    st_convex_hull() %>%
    plot()


texts: How can I convert ESRI personal geodatabase (.mdb) to shapefile using OGR in C#?

texts: I have to create a class in C# in which I would like to insert a function that converts an ESRI personal geodatabase, extracting that features it contains in shp using OGR. I looked at library documentation and I saw that ogr2ogr can do the job. It looks to me that this utility is based on the command line. How can I embed its functions in a C# script?


texts:
I have installed OSGeo live 7 - Xubuntu
I made a nice map using qgis and I have exported the project using RT mapserver exporter.
So I created a *.map file in home/user/documents/

How can I load this *.map file to localhost?


texts:
I am a new software developer who created an application at my work that continually displays content on the Google Earth desktop application using KML. My work now would like a mobile solution to my program where clients can view the app from any mobile device (mainly iOS and Android) as well as a computer.

I am looking for a viable alternative to the Google Earth API (which will be unsupported in December, 2015).I believe JavaFX has a 3D mapping library and I've read up a bit on NASA's World Wind SDK. Could anyone point me in the right direction or provide me with pros and cons of different options.


texts: What software to use for political analysis?

texts:
Years ago, in the 1990s, I used MapInfo to do political analysis, voting histories and trends and the like.

My knowledge is two decades old at this point, though. What are the tools I should be using today?

What I need to do is to find out how particular districts voted in the past, taking redistricting into account. Which means that I need to get old precinct data, allocate the vote to census blocks, and then reassemble the results by figuring out which new districts the blocks belong to. This will require direct database access, SQL queries, and the ability to draw boundaries and lasso the blocks within a polygon.

(I am a software developer, and can write code, but I'm on a short timeline and would prefer to avoid a big learning curve.)

Does Google Maps have the ability to do this?

Is there something online I can use?

Or do I have to spend a lot of money and buy something?


texts: Retrieving monthly rainfall averages for Feature Collection in Google Earth Engine?

texts:
I am trying to retrieve monthly rainfall averages for points stored in a feature collection. I have checked other posts with similar questions but I cannot seem to figure out how to adapt their solutions to my case. This is my code for the daily precipitation values.

How would I have to modify it to get monthly values?

var fg_points =
ee.FeatureCollection('ft:17ZWOtlTiq6ehKrp8KhmDhsxwP0lVKHaGYaJqo_Uj');
//generate point and dates
var start = ee.Date('1994-01-01');
var finish = ee.Date('2017-01-01');
var daily = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY')
.filterDate(start, finish);

var mapfunc = function(feat) {
  var geom = feat.geometry()
  var addProp = function(img, f) {
    var newf = ee.Feature(f)
    var date = img.date().format("MM_dd_YYYY")
    var value = img.reduceRegion(ee.Reducer.first(), geom,
    30).get('precipitation')
    return ee.Feature(ee.Algorithms.If(value,
                                   newf.set(date, ee.String(value)),
                                   newf.set(date, ee.String('No data'))))
  }
  var newfeat = ee.Feature(daily.iterate(addProp, feat))
  return newfeat
 };

 var newft = fg_points.map(mapfunc);

Export.table.toDrive(newft,
"PrecipitationHTL",
"PrecipitationHTL",
"PrecipitationHTL");


texts: My bathymetric sounder only exports to XYZ file want to input into GRASS

texts:
The export file has long, lat, elevation in a float format i.e. -70.8838319778442, 42.3222159164251, -14.6
The file is over 18 MB and each lat/long/elev is MOSTLY 1.5 meter apart and sometime maybe up to 5 meters.
I am brand new to GIS, like 8 hours old, how to input data into a GIS (Open Source only) and keeping the lat/long info to overlay perfectly on a nautical chart?


texts: Force a collection of unknown number of points to be a polygon

texts:
I am working with point clusters and want to create the rough shape of the cluster in the form of a polygon using ST_ConvexHull(). I'm having problems with single outliers though, as they don't convert to a polygon but to a POINT:

SELECT ST_AsText(ST_ConvexHull(ST_Collect(point))) ...

POLYGON((13.01741532 52.40118295,13.382100866593 52.516280103729, ...))
POINT(12.5 51.5)

Is there a way to force small geometries (single or double points) into a polygon? I want to simplify the subsequent processing by guaranteeing polygons; accuracy is not a high priority in this case, making a minimal triangle out of a single point is fine, even if not exact.


texts: Enabling/disabling Avoid Interception snapping functionality in Individual Layer Settings with PyQGIS

texts:
How is it possible to change the "Avoid Intersections" parameter with PyQGIS in QGIS 3.10?
I want to enable "avoid interceptions", so that in edit mode, when the new polygon overlaps the polygons of the active layer, the part where there is an overlap is automatically deleted (auto-complete editing of the polygon).
In QGIS 2.X the QgsProject().setSnapSettingsForLayer() function included the "Avoid Intersections" parameter but this is not included in the QgsSnappingConfig().IndividualLayerSettings() function in QGIS 3.10.
layer = qgis.utils.iface.activeLayer()

snap_config = QgsSnappingConfig()
snap_config.setEnabled(True)
snap_config.setType(QgsSnappingConfig.VertexAndSegment)
snap_config.setUnits(QgsTolerance.Pixels)
snap_config.setTolerance(10)
snap_config.setIntersectionSnapping(True)
snap_config.setMode(QgsSnappingConfig.SnappingMode.AdvancedConfiguration)

lyr_settings = QgsSnappingConfig.IndividualLayerSettings(
    True, QgsSnappingConfig.SnappingType.VertexAndSegment,
    10, QgsTolerance.Pixels)
snap_config.setIndividualLayerSettings(layer, lyr_settings)

QgsProject.instance().setSnappingConfig(snap_config)


texts: Interpret a kernel density map for pollutants

texts:
I currently have a grid of values (concentration in ug/m^3) for a certain pollutant. I then converted each grid to a point to use as an input to the Kernel density analysis tool in ArcGIS pro.

The map seems correct; however, I am not quite understanding the values of this output as seen in the figure below. It does not match the range of my data.

The maximum (from the original data was 34 ug/m^3). The data range is from 0 to 34 ug/m^3.

The settings I used are the following:

Hoping you guys could help out :) Thanks!


texts:
I've been having a problem with the extents of feature classes in our SDE here at work. Our database is divided into feature datasets that have various feature classes in them. The problem is as follows: The feature classes are all in GCS NAD 27. Sometimes, when using ArcMap and editing data (digitizing features and filling in the fields mainly), at some point, the extent of the feature class will change. The data source is still set correctly, and while the top and right extent are still correct, the bottom and left extent get changed to -400.00 dd. It's always the bottom and left extent that get changed as well, and it's not every feature class being edited, just one feature class at a time.

I can't think of anything in particular that I'm doing to cause this. There are a couple of us editing various features classes in the SDE at the same time, but we are always working in different feature class files.

The only thought I've had so far, and I haven't had time to test this out since I thought of it, was that adding a shapefile to the mxd that has an extent outside the feature class extent is causing the feature class extent to change.

It's possible to fix the extent by resetting the data source from a feature class that still has the correct extent, but I'd like to know why this is happening so that we can fix it permanently.


texts: WinError 32 error when trying to delete shapefiles with QGIS python

texts:
I've looked at some answers on here about deleting shapefiles with QGIS but I still seem to be running into errors. I am trying to delete shapefiles that have no attribute data in them (so 0 rows). My main issue is that I get:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:

I have tried using QgsVectorFileWriter.deleteShapeFile(f) but that leaves the .shp and .dbf behind.

I have also tried using os.remove for each individual file extension and that gives me the Win Error 32.

It seems like my files are still being used in QGIS. Does anyone know how to work around it?

Here is my full script:

clipped_soilpoly = get_data(clipped_folder, ".shp") # makes a list of all the .shps
for f in clipped_soilpoly:
    shapelayer = QgsVectorLayer(f,"clipped_poly")
    rowcount = shapelayer.featureCount()`

if rowcount < 1:

            print ("deleting " + f + " - does not intersect")

        #QgsVectorFileWriter.deleteShapeFile(f) <-- only deleting some of the file extensions

            split_path = os.path.splitext(f)[0]
            del f

        #delete .shp
            shp = split_path + ".shp"
            os.remove(shp)

        #delete .dbf
            dbf = split_path + ".dbf"
            os.remove(dbf)

        #delete .prj
            prj = split_path + ".prj"
            os.remove(prj)

        #delete .qpj
            qpj = split_path + ".qpj"
            os.remove(qpj)

        #delete .shx
            shx = split_path + ".shx"
            os.remove(shx)

        else:
            print ("keeping " + f)


texts: Will mongodb simplify geometry like PostGIS?

texts: I use the ST_Simplify() function in PostGIS, and am moving to a new geostack with mongodb. Does it have a comparable function?


texts: Was hoping I could just extract tiles into a local file system, point IIS at it and be done but I guess that is not the reality of Open Street Map.  I'm getting buried in all the possible ways of self-hosting OSM tiles but unable to find simple step-by-step instructions.  I've identified PostgreSQL, PostGIS, Mapnik as key players but can't get all the pieces together.  Any step-by-step instructions on creating a custom OSM tile server?


texts:
I have two point layers, one with telecom towers and another with secondary schools. I have used the NNJoin Plugin to find the nearest tower from each school, and calculated the distance between. The result is in a vector layer, with separate columns for the tower and school names.
How can one draw lines between the pairs of points?


texts: I created an Openlayers3 Bing map and then I converted to 3D view with Cesium. Is there a way to add a 3D Model on my 3D map?


texts: SQL Server, Given a linestring with M value, what is the location of this other M value

texts:
We are investigating migrating a prototype into SQL Server (azure).

We have LineStrings that also have M values. What we would like to do is given another M value find out what its geographical location is.

To aid your visualisation, here is a real-world example:

I have a linestring that represents a flight path. Because the flight goes up and down the distance the plane has actually moved is not the same as the total length of the linestring. We have calibrated M values as a part of the linestring but need to be able to plot on it where a given event occurred. All we know about this event is its M value.

SET @g = geometry::STGeomFromText('LINESTRING(1 0 NULL 0, 2 2 NULL 5, 1 4 NULL 9, 3 6 NULL 15)', 0);

Given something like the above, what is the lat and long of a point with an M value of 8?

*Note I am not sure if I have Nulled the Z or M value. The extra parameter we are considering here is the M only.


texts: QGIS Print Composer grid - curved latitude lines

texts:
QGIS 2.8.1

I am preparing a map of the North Atlantic and Arctic Regions in EPSG:3996 IBCAO North Polar Stereographic to display the geometries closer to their shape and size.

In Print Composer, I add a solid grid type in CRS EPSG:4326 to the map item. Interval units as Map units, Interval as 10 (degrees).

The problem is, that the latitude lines becomes a little jagged, and do not curve along the globe.

I've tried changed the CRS of the map to EPSG:3574 North Pole LAEA Atlantic, UTM and others. I have to stick to polar projections and include the North Pole - which often causes problems.

Usually it is a minor problem for everyday tasks, but this time it is a bit more serious as the map I prepare large and would be many years in the largest meeting room of the Government of Greenland, where ambassadors, presidents, kings and queens might drop by...

Question: Is there an issue ticket on this problem in QGIS Print Composer?

My workaround has been:

create a grid: Menu Vector -> Research Tools -> Vector Grid...: define extent to X Min=-180, X Max=180, Y Min=0.0 and Y Max=90 (I only needed from Equator and northwards.
Densify geomtries: menu Vector -> Geometry tools -> Densify Geometries...: Write the number of vertices to add (more than 1).

It is necessary to densify particularly the latitude lines as they "disappear" in reprojection OTF.

It might be needed to select only latitude lines and run the densify again with a larger number of vertices added.


texts: Using polygonizer to convert raster to shapefile in R

texts:
From https://ghsl.jrc.ec.europa.eu/download.php?ds=pop I have downloaded a .TIF file, that I am trying to convert into a .SHP file using R. I have loaded the file in R (as italy_raster and am trying to use the polygonizer function (as outlined here https://johnbaumgartner.wordpress.com/2012/07/26/getting-rasters-into-shape-from-r/ and here https://gist.github.com/Pakillo/c6b076eceb0ef5a70e3b).

However, when I use the function (after some time), I receive an error message:

polygonizer(italy_raster)

  Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding,
  use_iconv = use_iconv,  :    Cannot open data source

I've spent some time trying to figure out what might be the issue, but I am quite new to R and cannot figure it out.


texts:
I need to recursively document a bunch of Shapefiles using orginfo in many directories. For example,

$ tree -P *.shp
.
├── acfish2s
│   └── acfish2.shp
├── airports
│   ├── airport_runways.shp
│   └── airports.shp
├── aquifer_contactss
│   └── aquifer_contacts.shp
├── aquifer_polygonss
│   └── aquifer_polygons.shp
├── armoriess
│   └── armories.shp
├── ashab3s
│   └── ashab3.shp

I've found something that works for the first layer, but then dies with "FAILURE: Couldn't fetch requested layer".

from ~/airports
$ find ./* -type f -name \*.shp | xargs -0 /bin/GDAL/./ogrinfo.exe -ro -so -fields=YES -geom=SUMMARY $x ${x%.*}
INFO: Open of `airports.shp'
      using driver `ESRI Shapefile' successful.

Layer name: airports
Geometry: Point
Feature Count: 212
Extent: (341172.066500, 4778235.208900) - (656874.933400, 5237120.513500)
Layer SRS WKT:
PROJCS["NAD_1983_UTM_Zone_19N",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-69.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0]]
SITENUMBER: String (254.0)
<snip>
DOTID: Integer (10.0)
FAILURE: Couldn't fetch requested layer ./airport_runways.shp
./airports.shp
!

when I do it from a higher level, I get the following error

$ find ./* -type f -name \*.shp | xargs /bin/GDAL/./ogrinfo.exe -ro -so -fields=YES -geom=SUMMARY $x ${x%.*}
FAILURE:
Unable to open datasource `airports.shp' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
<snip>

I was thinking it was a BASH thing, but the stat command (mostly) works.

$ find ./* -type f -name \*.shp | xargs stat $x
stat: cannot stat `airports.shp': No such file or directory
  File: `./acfish2s/acfish2.shp'
  Size: 11428           Blocks: 12         IO Block: 65536  regular file
Device: b054e692h/2958354066d   Inode: 844424930137000  Links: 1
Access: (0644/-rw-r--r--)  Uid: (57187/john.zastrow)   Gid: (10513/Domain Users)
Access: 2005-03-18 10:38:56.000000000 -0500
Modify: 2005-03-18 10:38:56.000000000 -0500
Change: 2012-11-27 00:09:45.025730200 -0500
 Birth: 2012-11-27 00:09:44.967726900 -0500
  File: `./airports/airports.shp'
  Size: 6036            Blocks: 8          IO Block: 65536  regular file
Device: b054e692h/2958354066d   Inode: 844424930137006  Links: 1
Access: (0644/-rw-r--r--)  Uid: (57187/john.zastrow)   Gid: (10513/Domain Users)
Access: 2011-03-02 08:51:18.000000000 -0500
Modify: 2011-03-02 08:51:18.000000000 -0500
Change: 2012-11-27 00:09:45.365749700 -0500
 Birth: 2012-11-27 00:09:45.304746200 -0500
  File: `./airports/airport_runways.shp'
  Size: 32960           Blocks: 36         IO Block: 65536  regular file
Device: b054e692h/2958354066d   Inode: 281474976715722  Links: 1
Access: (0644/-rw-r--r--)  Uid: (57187/john.zastrow)   Gid: (10513/Domain Users)
Access: 2011-03-02 08:50:58.000000000 -0500
Modify: 2011-03-02 08:50:58.000000000 -0500
Change: 2012-11-27 00:09:48.799946100 -0500
 Birth: 2012-11-27 00:09:48.735942400 -0500


texts: Getting two lat-lon points in JSP to find shortest path on click of OpenLayers map?

texts:
I'm  using GeoServer, PostgreSQL and here OpenLayers. I'm trying to retrieve two lat-lon points (for point A and point B) on clicking of map. This code is working only to retrieve one lat-lon.

I want to use this for four (two lat-lon) points in JSP file, that I will use to find shortest path between that points.

So how can I perform this?

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
                defaultHandlerOptions: {
                    'single': true,
                    'double': false,
                    'pixelTolerance': 0,
                    'stopSingle': false,
                    'stopDouble': false
                },

                initialize: function(options) {
                    this.handlerOptions = OpenLayers.Util.extend(
                        {}, this.defaultHandlerOptions
                    );
                    OpenLayers.Control.prototype.initialize.apply(
                        this, arguments
                    );
                    this.handler = new OpenLayers.Handler.Click(
                        this, {
                            'click': this.trigger
                        }, this.handlerOptions
                    );
                },

                trigger: function(e) {
                    var lonlat = map.getLonLatFromPixel(e.xy);
                    var lat=lonlat.lat;
                    var lon=lonlat.lon;

                    //alert("You clicked near " + lonlat.lat + " N, " +
                      //                        + lonlat.lon + " E");
                    window.location.replace("atobNewForPath.jsp?lat="+lat+"&lon="+lon);

                }
            });

 var click = new OpenLayers.Control.Click();
            map.addControl(click);
            click.activate();

In body tag

<%
    double lat = Double.parseDouble(request.getParameter("lat"));
    double lon = Double.parseDouble(request.getParameter("lon"));

/*How to perform this one
    double lat2 = Double.parseDouble(request.getParameter("lat2"));
    double lon2 = Double.parseDouble(request.getParameter("lon2"));
    */

    out.println(lat);
    out.println(lon);

    }%>


texts: The best transformation definition for EPSG:5514 in QGIS

texts: Which transformation definition of EPSG:4326 to EPSG:5514 is the best in position accurancy in QGIS Seletect transform dialog?


texts: Polygon cartographic line templates dysfunctional

texts:
I have been exasperated by the simple task of symbolizing polygon boundaries with custom dashed lines.  I have a polygon representing property boundaries and I want dashed lines that are uniform-spaced with short line segments (to accommodate smaller line segments in actual polygon which is composed of variable-length line segments).  However, using the 'Cartographic Line Template' option to create these in the feature's symbology labyrinth of popup boxes is producing randomly askew line segments, where they should simply go from point A to Point B.
Note: I have tried this without the black border - JUST the red dashed lines - simple and bare bones parameters to boot.  Also using a template with interval = 1.  Same deal.

SYMBOLOGY

TEMPLATE

OUTPUT


texts: Troubleshooting slow IIS and hanging ArcGIS Server?

texts:
Our ArcGIS Server 10.0 SP 4 website has been hanging lately where everything gets delivered except the map. When I try and check the REST Endpoints they it hangs and then fails. When I stop the IIS, that takes 2-3 minutes to stop, which is not normal. Sometimes it takes 2 or 3 stop/starts of IIS to get the server back working again. I've made sure ArcGISWebServices is in Admin group as well as all necessary server groups.

I looked in the system log for the latest crash and it reads:

  @ 8:18 AM "A worker process with process id of '13516' serving
  application pool 'ArcGISApplicationsAppPool' has requested a recycle
  because the worker process reached its allowed processing time limit.

  @8:30 (approx when I began investigating the issue) "A worker process
  '7616' serving application pool 'ArcGISApplicationsAppPool' failed to
  stop a listener channel for protocol 'http' in the allotted time.  The
  data field contains the error number."

Any ideas on what I can do to further troubleshoot are appreciated.

Specs.
WinServer 2008
IIS 7
AGS 10 SP4


texts: Loading geojson via ajax in leaflet using bbox

texts:
I'm trying to load a geojson-layer from a postgis-database into Leaflet. I only want to fetch the data that is inside the visible bounding box of the map.
The geojson-data comes from a php-script that is fired every time, the bbox changes.

My code works so far, but the geojson-layer is multiplied each time. How can I avoid, to draw the features multiple times on my map.

map.on('dragend', function onDragEnd(){
$.ajax({
    type: "GET",
     url: "./mapdata/n2k_dh_geojson.php?bbox=" + map.getBounds().getWest() + "," + map.getBounds().getSouth() + "," + map.getBounds().getEast() + "," + map.getBounds().getNorth(),
    dataType: 'json',
    success: function (response) {
        n2k_dh_geojson = L.geoJson(response, {
            onEachFeature: function (feature, layer) {
            layer.bindPopup(feature.properties.sitename);
            }
        }).addTo(map);
    }
});
});

Maybe there is already an existing js-code to do that.

But beside leaflet-vector-layers from Jason Sandford (which isn't developped anymore and which doesn't deliver pure geojson) I didn't find anything, that works with point, line and polygon-layers.


texts: Can I configure the scale values in the scale selection box?

texts:
The scale selection box in QGIS 2.18.16 by default shows standard values as 1 in: 500, 1000, 2500, 5000 .. 1.000.000. This is good for metric scaled maps, but I am often working with old english Ordnance Survey Maps. Is there a way I can add the six inch (1:10.560), one inch (1:63.360), half inch (1:126.720) and quarter inch (1:253.440) ?  It would spare me a lot of digit typing :)

Is there a configuration setting for this ?


texts: Remove overlaps and no data areas from GeoTIFF display in Global Mapper

texts:
I have two GeoTIFF files that are in UTM projection. I am opening them in Global Mapper v17 and they are displaying like this:

My issue is that the "black" areas (which I presume are areas where there is no data) overlap other tiles that do have data. I thought maybe it was something to do with the UTM projection, but when I convert it to Geographic projection (which is ultimately what I want to do) the same thing happens:

I have looked through all the file opening, projection and configuration options in Global Mapper but there doesn't seem like there's an option to hide these black areas to prevent overlaps. If there is such an option, it's not immediately apparent to me.
Is there a way to hide these black areas? Even better, is there a way to "clip" these black areas so that when I convert the projection to Geographic, if I then export the files to new GeoTIFFs I'll get perfectly rectangular images with no black areas?


texts: Getting HRESULT E_FAIL error when trying to open database connection via connection file

texts:
I developed an Addin in AGP 2.5 where I am using connection files to open database connections at runtime. So far that worked perfect. The connection files are stored on a network drive, referenced in the Addin with absolute paths.
DatabaseConnectionFile connectionFileValidering = new DatabaseConnectionFile(new Uri(AppSettings.Default.sde_validation));
Now that I am doing some maintenance on the Addin I am running into the following error when trying to open the enterprise database:
Database test_db = new Database(connectionFileValidation);
I am getting the following error.
'Database test_db = new Database(connectionFileValidation)' threw an exception of type 'ArcGIS.Core.Data.GeodatabaseException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233088
HelpLink: null
InnerException: {"Error HRESULT E_FAIL has been returned from a call to a COM component."}
Message: "A geodatabase exception has occurred."
Source: "ArcGIS.Core"
StackTrace: " at ArcGIS.Core.Data.Database..ctor(DatabaseConnectionFile databaseConnectionFile)"
TargetSite: {Void .ctor(ArcGIS.Core.Data.DatabaseConnectionFile)}
With respect to the error message I found some stuff that is not related to ArcGIS, but did not help either.
Anybody here can point me the direction of a solution?


texts: Organization of the items that make up the layout / composer in QGIS 3.8

texts:
I'm making a map on compose. The amount of items was huge, difficult to organize.
I wonder if there is any way to create item groups, such as folders and sub folders. See figure.


texts: Heron 1.0.5 - can't use measurelength tool

texts:
When looking at the examples of Heron v1.0.5 it looks like I simply have to include a simple {type: "measurelength", options: {geodesic: true}} for the toolbar and an even more simple {type: "measurepanel"} for the bottombar. However, that doesn't work.

I am using a similar layout to the one in the FixedPanelLayout and I do have the same problem as it is prominent in the NoStatusBar example.

If you try to use the 'Measure length' tool in the latter link you will face the same error that I get in my application.

Does anybody know how to overcome the problem and have the measured length in the toolbar (bbar)?


texts: Quick way to produce polygons to cover variable precision lat / lon points?

texts:
I'm using the Smithsonian Global Volcanism Database and have a .csv lat lon points from it. It seems they are using decimal precision on their lat lon to give a rough idea of the size of the area that a volcanic center covers. For example, the enormous Phlegrean Fields are given as 37.1, 12.7 while a single volcano like Vesuvius is given as 40.821, 14.426. At least I think that's what they're trying to do (and yeah, I realize that would be a bad way to do things).

Anyway, what I want to do is create polygons that cover the entire area specified by the imprecise locations for each volcano. I mostly use QGIS and related open source tools and I could probably script this in QGIS python pretty easily, is there an existing tool I can use to do this instead?

EDIT: Note that often the latitude precision does not match the longitude precision. For example, Kurab volcano is given as 11.88, 41.208 .


texts:
I am trying to make a basic web map for my employer showing all past projects completed in the state. The map (via qgis2web plugin version 2.33.1, leaflet option) itself is created fine, but the data within the attribute table is not carrying over to the webmap, giving all of my attributes the value of "undefined". Dataset is not huge; I tried hiding all but one to see if that would work, but no luck.

The reason I am using leaflet is because my map would not show up at all in OpenLayers, so if anyone has advice there too I'm all ears!

Any ideas how I can fix this?


texts:
I have a an OL3 / geoserver application. Some of my WMS layers have cql_filter. I get the error in the title when trying to select features by doing request=GetFeature.
What I have to do is issue multiple requests to the geoserver because I have multiple layers that can be selected. I know I can combine multiple layers into one request and I do that. But some layers have a cql_filter on them already. So for those layers I have to combine existing cql with my intersect cql so my cql looks like this

cql_filter=INTERSECTS(the_geom, POLYGON((-13002818.055160686 7008876.412750409,-13002818.055160686 7060223.096732896,-12939904.85499688 7060223.096732896,-12939904.85499688 7008876.412750409,-13002818.055160686 7008876.412750409))) AND sdls_id IN (422805982,422805748,414024170,404469091,404365484)

There is no issue with my URL's they work and I get response 200 from the server but the ajax is throwing the error. And this error is totally random sometimes they all just work. I have feeling that the problem is with the ajax timing but am not sure how to fix it.


texts: Move Text Box automatically when using Data Driven Pages

texts:
I have a map series set up to use data driven pages. My problem is that I have a text box that uses dynamic text that overlaps with the boundary of the data driven feature (in this case, a town line). Is there a way (an option or setting) that I can use to make it not overlap with the data driven feature?
This is similar to this question: Move TEXT_ELEMENT using arcpy.mapping and data driven pages
but I don't want to set up a script for this one change to the map.


texts: Python scripting for feature classes (loop, sort, merge, and replace)

texts:
This is what I have to accomplish using a python script for ArcGIS 10.1:

Loop through all feature classes and first add a field, then write the name of the feature class into the added field.
Merge all the feature classes from 1. into one feature class called OSRS_ORN_NER.
Sort this feature class by HWY_NUM and replace OSRS_ORN_NER by the sorted one.

This is the code I have for that so far:

I think the first part of code is right, but I don't know if I did the second right or if I'm even on the right track for the last part. Also, how exactly would I run a python script in ArcGIS? Any help would be great!

code:

import arcpy, os

arcpy.env.workspace = r'W:\S&P\s&p techs\Emily\TownshipsDissolved\FinalDissolved.gdb'

# Looping through dissolved feature classes, adding 'Name' field and writing
# feature class name in the added field.

for fc in arcpy.ListFeatureClasses():
  arcpy.AddField_management(fc, "Name", "TEXT", field_length = 50)
  with arcpy.da.UpdateCursor(fc, "Name") as cursor:
    for row in cursor:
      row[0] = fc
      cursor.updateRow(row)

# Merging the multiple feature classes into one named OSRS_ORN_NER

list = []

for r in row:
  list.append(r)

arcpy.Merge_management(list, "W:\S&P\s&p techs\Emily\TownshipsDissolved\FinalDissolved.gdb\OSRS_ORN_NER")

# Sorting by HWY_NUM_PR and replacing OSRS_ORN_NER by the sorted feature class

Sort_management("OSRS_ORN_NER", "OSRS_ORN_NER_new", [["HWY_NUM_PR", "ASCENDING"]])


texts:
I just tried to use Dynamic Legends in ArcGIS Pro 1.2 and have not been able to find them in either the application or its documentation.

I expected to find them as something like an Only show classes that are visible in the current map extent checkbox on an Items tab in the Legend properties, like there is in ArcMap.

A GeoNet thread confirmed that they were absent from the first version (presumably 1.0).

Has anyone found them in ArcGIS Pro 1.2, or know when they are expected to be added?


texts: Removing last point in polygon geometry using ArcPy?

texts:
This polygon was created from a grid of 500 x 500 meters, then Union, Generalize and Dissolve was used to arrive at this geometry, the laspoint not help me, I just want to have points on each vertex.

How I can eliminate this point (lastpoint) that I can not enumerate my vertex.

I'm working with ArcGIS 10.1 and according to my workflow, it is performed as follows:

From a grid of 500 x 500 meters, I select an area and generated a polygon with arcpy.Union_analysis as shown in the graphs.
Using arcpy.Dissolve_management and arcpy.Generalize_edit, try to delete the intermediate points.
From this polygon Figure A, generated a Feature (point type). With arcpy.FeatureVerticesToPoints_management to label then using the ID field and deploy the polygon to see a result like Figure B. Sometimes it works without problems, sometimes it fails.

Thanks again to everyone for their comments and suggestions. Well, the first graph posted has a wrong result, and the second graph has a correct result, was only posted to show that sometimes it works and sometimes it does not and I do not know why. In fact, unnecessary points that show the outcome of this third graph, I can remove the very fast and easy way to "Start Editing" ArcGIS, but the fact is that I am creating automated processes with python, then put them as services in ArcGIS Server. I have tried using many methods like Dissolve, Generalize, SimplifyPolygon_cartography, geometry Modify, Repair Geometry, I tried to recreate the polygon convert to line UnsplitLine_management. The most important thing for me is to label the vertices of the polygon with the corresponding geometry (would like to use some expression), as not doing so, I convert the polygon to get points and the geometry of these points as a label.


texts: I am working on a project involving reforestation issues. I have my raster (showing a large community) and a polygon representing the specific area of study. I tried using the clip raster tool, but it is not giving me the expected results...the raster is still much larger than the polygon and the tool did not clip exactly to the area of study. I have attached a photo showing. Any ideas on how to fix this or another tool I should be using instead? Thanks in advance.


texts: How to transform XYZ raster from WGS84 to UTM ED50 Zone 34

texts:
I'm trying to convert an XYZ file from WGS84 (lat/long) to UTM ED50 zone 34. QGIS can load the file as a raster, but I can't see a way of changing the coordinate system or exporting the results as an XYZ file.

Is this possible in QGIS?


texts: raster statistics - regressions between raster data

texts:
I have two set of rasters, with data that should correlate...one are measured data, one are modelled data. The correlation is weak, however, when looked at with a normal regression analysis. I suspect that different parts of the base terrain need different modelling input, or that in some parts there is a shift between the correlating cells.

So now I try to visualize where these residuals are highest between my two rasters, and where the real outliers are and whether they are in similar terrain.

Is there any tool that would allow me to directly compare the rasters in GIS?

I run ArcGIS Desktop 9.3 with Spatial Analyst and Statistics, and also have QGIS and GRASS on my Linux-based machine.

What would be easiest?

I am not trying to do a full-on analysis, I am just trying to see where the odd data are and if there is a systematic spatial pattern behind them.


texts: QGIS Composer keep reference after reloading layers

texts:
I have written a plugin which loads a bunch of geojson data via REST for a specific region, which is selected by the user, afterwards generates some vector grids over the extend and styles all the layer by default.

I have also created some pre-defined composer templates. In one of those templates an atlas is generated with an overview map (like in this example: http://docs.qgis.org/2.8/de/docs/training_manual/forestry/forest_maps.html)

The problem I have is, that when the user starts with a fresh project and loads the data, in the Atlas print composer all the relations to the layers are lost (I guess because they are reloaded and so there are no reference to the print composer template anymore).

Is there a way to set this reference programmatically each time the data is loaded or can I set the refrence by the layer name or some layer tags?

The amount of layers is always the same.

EDIT:

I also have this problem with attribute data which comes via REST in a csv file and should prefill some text fields in the print composer.


texts: Hotspot Analysis QGIS Error: An error has occurred while executing Python code: ValueError: Illegal field requested in GetField()

texts:
I am doing a hotspot analysis for chicken spatial distribution in QGIS using Ubuntu. I have already installed the repositories used for hotspot analysis. However, an error occurred after I chose a layer and its attribute table. It says:

An error has occurred while executing Python code:

  ValueError: Illegal field requested in GetField()  Traceback (most
  recent call last):   File
  "/home/envisci/.qgis2/python/plugins/HotspotAnalysis/hotspot_analysis.py",
  line 565, in run
      u.append(geometry.GetField(C))   File "/usr/lib/python2.7/dist-packages/osgeo/ogr.py", line 4707, in
  GetField
      raise ValueError("Illegal field requested in GetField()") ValueError: Illegal field requested in GetField()

Python version: 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
QGIS version: 2.14.5-Essen Essen, exported

Python Path:

  /usr/share/qgis/python/plugins/processing /usr/share/qgis/python
  /home/envisci/.qgis2/python /home/envisci/.qgis2/python/plugins
  /usr/share/qgis/python/plugins /usr/lib/python2.7
  /usr/lib/python2.7/plat-x86_64-linux-gnu /usr/lib/python2.7/lib-tk
  /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload
  /home/envisci/.local/lib/python2.7/site-packages
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages/PILcompat
  /usr/lib/python2.7/dist-packages/gtk-2.0 /home/envisci/.qgis2//python
  /home/envisci/.qgis2/python/plugins/gearthview/ext-libs
  /home/envisci/.qgis2/python/plugins/DigitizingTools/tools
  /usr/share/qgis/python/plugins/fTools/tools
  /media/envisci/msguimalan/RA

How can I resolve this error?


texts:
I am using the LDOPE mask_sds tool to mask a MODIS image based on the quality flags for MOD13A3 NDVI.  The full command that I am using is:

mask_sds -of=mask.hdf -fill=-3000 -sds='1km monthly NDVI' -mask="MOD13A3.A2000336.h25v02.005.2007112105435.hdf,'1km monthly VI Quality',0-1==00,AND,*,*,11-13==001" -meta MOD13A3.A2000336.h25v02.005.2007112105435.hdf

I am getting the following error:

Cannot find the SDS '1km monthly VI Quality'
Ignoring input masking option MOD13A3.A2000336.h25v02.005.2007112105435.hdf,'1km monthly VI Quality',0-1==00,AND
Cannot open the input HDF file *
Cannot open the HDF file *
Ignoring input masking option *,*,11-13==001
usage:
    mask_sds -help [filename]

    mask_sds -of=<output filename> -sds=<SDSname1>[,<SDSname2>[,...]]>
    [-fill=<mask fill value>] -mask=<mask1>[,AND|OR,<mask2>[,...]] [-meta]
    filename
       where maskn=< filename>,<SDSname>,<bit_numbers operator bit_values>

It looks like it can not find the SDS (science data set) for the quality flag.  I have tried several variations of '1km monthly VI Quality', including without quotes.  This website lists SDS's for each MODIS product (I am using MOD13A3).

I would appreciate any suggestions.


texts: replacing dijit.ComboBox with dijit.Select results in error (ArcGIS Javascript API)

texts:
I am currently populating a Dojo ItemFileReadStore with the results of an ArcGIS query (Javascript 3.4 API), which is then passed to a Dijit COmboBox.
I am now having problems with the ComboBox in iOS (see http://grokbase.com/t/dojo/dojo-checkins/132kx1h9jj/dojo-toolkit-16730-combobox-long-drop-down-lists-broken-on-ios). It looks like a dijit.Form.Select might work (although not ideal, b/c there is no autoComplete or placeholders); It works fine on my iPhone for the dropdown lists that I hard-coded.  But I am getting an error that I believe is related to the ItemFileReadStore, and the results of my query are not being passed into the select dropdown menu.

In my HTML, I tried simply replacing ComboBox with Select:

    <select id="Select" dojotype="dijit.form.Select"
    value="" class="comboBoxClass"  onchange= "setName(this)"

My store is still set up the same way as I had before:

    var dataItems = {
    identifier : 'name',
    label : 'name',
    items : values
};

var menuStore = new dojo.data.ItemFileReadStore({
    data : dataItems,
    clearOnClose : true
});

...and the Select box is given the store's values the same as before:

    dijit.byId("menu").set("store", menuStore);

menuStore.fetch({
    onComplete : completed,
    onError : error,
    sort : sortAttributes
});

I added:

  dojo.require("dijit.form.Select");
  dojo.require("dojo.parser");

to my init file...

But I am getting this error in Firebug:

  dojo/parser::parse() error
  TypeError: _7.getLocalization(...) is undefined

In Chrome there is also an error with dojo/parser:

 message: "Cannot read property 'missingMessage' of undefined"

(I also tried swapping ComboBox with FilteringSelect, but the iOS problems are the same.)

Ideas?
note, this question is somewhat of an extension to an earlier question I had regarding specifically the iOS issue with the Dijit ComboBox (combobox GIS SE question)...I would happily, actually rather, still use the ComboBox if there is some way to make it work properly on an iPhone! but I can live with the Dijit.form.Select box if that is what I must do....)


texts: Calculate field: expression is not defined

texts:
I'm tyring to write a script the allow me to select a layer by location, then calculate a field of the selected feature. But I'm having issue with CalculateField_management.
Here part of the script:
farmsArea = r"pathFeature"
enclaves = r"pathFeature"

# Select  by location -->  farms within Enclaves
arcpy.SelectLayerByLocation_management(farmsArea, 'INTERSECT', enclaves, "", 'NEW_SELECTION')

# Calculate field "within enclaves = (here i have an issue, the name "yes" is not defined)
arcpy.CalculateField_management(farmsArea, 'within_enc', 'yes', 'PYTHON3')

# Switch selection and calculate "within enclaves = no"
arcpy.SelectLayerByAttribute_management(farmsArea, 'SWITCH_SELECTION')
arcpy.CalculateField_management(farmsArea, "'within_enc'", "no" )

# Clear selection
arcpy.SelectLayerByAttribute_management(farmsArea, 'CLEAR_SELECTION')

As error I have row 8 "name 'yes' is not defined"


texts: I would like to programmatically rotate a feature (or its associated geometry) in OpenLayers3. I know I can rotate the view, but I'd like to apply the rotation to the feature/geometry only.


texts:
I am getting the following error while compiling QGIS 2.18.3 in visual studio 2010. Apparently all is well when I compile QGIS 2.14. Is there something am missing?

277>  Building Custom Rule D:/home/QGISApp/QGIS64/python/pyplugin_installer/CMakeLists.txt
240>  qgsmaptooladdpart.cpp
277>  CMake does not need to re-run because D:\home\QGISApp\QGIS64\build64\python\pyplugin_installer\CMakeFiles\generate.stamp is up-to-date.
277>  Generating ui_qgsplugininstallerfetchingbase.py
277>  Traceback (most recent call last):
277>    File "D:\home\QGISApp\QGIS64\scripts\\pyuic-wrapper.py", line 26, in <module>
277>      import qgis.PyQt.uic.pyuic
277>    File "D:\home\QGISApp\QGIS64\build64\output\python\qgis\__init__.py", line 27, in <module>
277>      from qgis.core import QgsFeature, QgsGeometry
273>  Generating Code...
277>    File "D:\home\QGISApp\QGIS64\build64\output\python\qgis\core\__init__.py", line 30, in <module>
277>      from qgis._core import *
277>  ImportError: DLL load failed: The specified module could not be found.
277>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
277>Done executing task "CustomBuild" -- FAILED.
277>Done building target "CustomBuild" in project "pyplugin-installer.vcxproj" -- FAILED.
277>


texts: Unable to resize polygons/lines imported from Google Earth PRO Using KML Tools

texts: I imported all my files from Google Earth Pro into QGIS and I need to resize some of the polygons (after agricultural job is done, some of fields get bigger or smaller; from corn we go to soy etc.)  My problem is that I am not able to resize any of fields/polygons which are imported. If I create a new polygon than I am able to resize it.


texts:
In QGIS 1.6, can users set "on the fly projection" to be checked ON by default (at application launch)?  I know how to turn it on, but some users find they use it more often than not, and would like it to be enabled by default.

I have read this thread and it seems like there was discussion to add an "ON by default" option, but I could not find it in the Options settings.

Is there something I am missing or has this function not been implemented?


texts: OpenLayers create marker (feature with icon) from WKT

texts:
I have a point object WKT. Like this: POINT (25.04568 48.221548). Also I have an icon in my project folder.

My goal is to show on a map an icon that represents a feature. Can it be just a normal OpenLayers feature (if yes, then how can I define that it should represent and icon) or do I need to create an OpenLayers marker (somehow create LonLat from WKT)?


texts: What are the Server Hardware Needs for Using ArcGIS Desktop in a Citrix Environment?

texts:
We are currently ramping up our ArcGIS Desktop usage and capacity in a Citrix environment and I am wondering if there is some good documentation available regarding best practices for Citrix server hardware specifications, configuration, etc.

Our specific use case is 15-30 active ArcGIS Desktop users that spend about 60% of the time working on map products and 40% of the time working with geoprocessing tools to run vector-based analysis, etc. We are running ArcGIS 10.1 for the time being. No ArcScene or ArcGlobe work at this time, but occasionally some heavy analysis work and detailed mapping with complex Maplex labeling and several data frames that has the potential to bog down the server for individual users.

We are currently in preliminary roll-out using an old server and are looking to purchase a new server for increased performance. Our goal is to provide similar performance inside of Citrix as a user would expect from a decent workstation.

Below is what we are currently thinking of purchasing. We are also planning to buy a second one of these for failover purposes. We have read that running ArcGIS in a virtualized server environment is not a good practice, so this will be a dedicated physical server.

Processors: Dual Intel Xeon E5-2690 v2 (10 cores, 25M Cache, 3.00 GHz)
Memory: 64GB RAM
Hard Drives: 2x 600GB SAS/10k
Video Card: Currently unknown, any recommendations would be appreciated.

Below are links to existing documentation I have found, but I am looking for some specific hardware recommendations and potential pitfalls based on your personal experiences:

What are the best practices for running ArcGIS Desktop in a Citrix XenApp environment?
Citrix XenApp and Best Practices for ArcGIS

Below are my specific questions, I apologize that there is not just a single question in this post, but I felt that splitting them up would not give a complete picture of the situation.

Would a server similar to the above be appropriate for this usage case, or is it way too much or too little?
Is there a general guideline to follow regarding number/speed of processor cores per ArcGIS Desktop user?
Is there a general guideline to follow for amount of RAM to accommodate each user?
What standalone video card requirements are there to provide ArcGIS Desktop users a good experience (no 3D visualization required)?
What documentation is available to help determine server specifications and configuration for the specific case of running ArcGIS Desktop in Citrix?


texts: GDAL: gdallocationinfo of CGIAR mosaic elevation data

texts:
I have downloaded tiles from

http://srtm.csi.cgiar.org/srtmdata/ and unpacked the *.zip files into a directory. Then I ran, as has been suggested here: CGIAR SRTM to xyz using GRASS GIS, with sampling, the commands

#create mosaik (optionally reproject on the fly with -t_srs)
gdalwarp *.tif mosaik.tif
gdalbuildvrt srtm.vft mosaic.tif

After this, I can see the following:

Driver: VRT/Virtual Raster
Files: srtm.vft
       mosaic.tif
Size is 48001, 24001
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-10.000416206603404,55.000417150924136)
Pixel Size = (0.000833333333333,-0.000833333333333)
Corner Coordinates:
Upper Left  ( -10.0004162,  55.0004172) ( 10d 0' 1.50"W, 55d 0' 1.50"N)
Lower Left  ( -10.0004162,  34.9995838) ( 10d 0' 1.50"W, 34d59'58.50"N)
Upper Right (  30.0004171,  55.0004172) ( 30d 0' 1.50"E, 55d 0' 1.50"N)
Lower Right (  30.0004171,  34.9995838) ( 30d 0' 1.50"E, 34d59'58.50"N)
Center      (  10.0000005,  45.0000005) ( 10d 0' 0.00"E, 45d 0' 0.00"N)
Band 1 Block=128x128 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

when running gdalinfo srtm.vft.
Now, when I try to "query" the data, such as e.g.
gdallocationinfo srtm.vft <your x coord> <your y coord>,
with "appropriate" coordinates x and y, I get stuff like

Report:
  Location: (0P,18000L)
  Band 1:
    <LocationInfo><File>mosaic.tif</File></LocationInfo>
    Value: -32768

I tried different switches for gdallocationinfo, such as -wgs84 etc.,
to no avail.

My goal, as described in the related SE-question above, is to
have a file with x,y,z, where x,y is a "locus" in the selected area,
and z is the elevation of that locus. I also would like to sample the data
such that any two pairs of coordinates specify locations that are "sufficiently" apart (say, 300-500 km).

The question, therefore, is:
How exactly to query the above data (using gdallocationinfo or otherwise) to achieve my goal?

EDIT: I tried a different tool, gdal_translate: gdal_translate -of XYZ mosaik.tif geotiffas.xyz, after running gdalwarp *.tif mosaik.tif.
But goetiffas.xyz contains nodata values only, i.e. -32768, as the z-coordinates.


texts: Are GeoTIFF larger than 4 GB automatically "BigTIFFs"

texts: I'm reading up on graphic formats and noticed that I have several GeoTIFFs that are larger than the apparent limit on TIFF file size of 4 GB. Can someone explain what I am missing here? Do BigTIFFs have a different file extension?


texts: Is the ground level cross section of a normalised lidar dataset flat?

texts: If I normalise a lidar dataset I am (according to my thinking) simply subtracting the first return heights from the ground heights. Thus the resulting dataset will only contains the height above ground and a mountainous region would then appear flat when visualised as a cross section profile. Is this correct?


texts: Repairing link between shapefile and layer file?

texts:
every time I open the same lyr file I have to do data/repair data source (link to the shp file).

I tried to save/export that shp file again, and create the new layer file as well, but every time the same thing happens. The Arc does not remember the link between these two.

Moreover, when I define the data source and the shp file appears in Arc, I have to define the symboloy from scratch (via properties/symbology/import dialogue)

Any ideas how to permanently define the link between the shp and layer file in ArcGIS 10.2 for Desktop? (When drag lyr file to automatically link the shp file)


texts: Creating buffers using JSTS + ES6 modules not working

texts:
Creating a buffer from a Point or other Geometry objects in JSTS seems to be quite simple when reading the documentation, but still I can't produce a buffer from a Point in my React application.

Let me first tell that I'm using 'create-react-app' boilerplate generator and I have intalled JSTS like this:

  npm install --save jsts

Following this JSTS + ES6 example I came up with this code:

import extend from 'jsts/extend'
import GeoJSONReader from 'jsts/org/locationtech/jts/io/GeoJSONReader';
import GeoJSONWriter from 'jsts/org/locationtech/jts/io/GeoJSONWriter';
import Geometry from 'jsts/org/locationtech/jts/geom/Geometry';
import Coordinate from 'jsts/org/locationtech/jts/geom/Coordinate';
import {BufferOp} from 'jsts/org/locationtech/jts/operation/buffer';

// Add support for Geometry.buffer
extend(Geometry.prototype, {
    buffer: function () {
        return BufferOp.bufferOp(this, arguments);
    }
});

class Demo extends Component {

  bufferTest() {
    let reader = new GeoJSONReader();
    let writer = new GeoJSONWriter();

    let json = {
        "type": "Point",
        "coordinates": [
          -58.435420989990234,
          -34.60650846219738
        ]
      };

    let pt = reader.read(json);
    let buffered = pt.buffer(40); // Will crash
  }
}

export default Demo;

When I run this I get the following error:

  RuntimeException: inconsistency in rightmost processing

I have been all day trying one after another different ways my imagination could come up with, I also created individual Coordinate and Geometry objects and tried to buffer the geometry using using a BufferOp instance and many other things with no success...

If someone can throw some light in here I will be really thankful.


texts: Is it possible to view Mapillary photos on QGIS?

texts:
Mapillary (link) provide streetview-like photos of many areas. There is a plugin available for the Openstreetmap editor 'JOSM' which provides an interface to view the photos (which is sometimes more helpful than the Mapillary website's interface).

Is there any way to duplicate this on QGIS - to view Mapillary photos using QGIS?


texts: How to create alluvial diagrams for land use change analysis

texts: I have two landuse change maps and I'd like to create some alluvial diagrams to show change over time. This way I can tell what became what. Are there any tools in QGis or other GIS that can create such graph?


texts: PyQGIS atlas composer export to PNG with specific name

texts:
I want to use PyQGIS3 to export some map composer using atlas,In this task I want to export only one feature from atlas layers to PNG image with specific unique name file.
output='/home/username/Desktop/uniquename.png'
settings = QgsLayoutExporter.ImageExportSettings()
QgsLayoutExporter.exportToImage(myAtlas, output, 'png', settings)

and I get only the default name of file :
output_1.png

How can I change this name with my unique name export?
And I add this lines without and still not work :
#myAtlas.setFilenameExpression(output)
#myAtlas.setPageNameExpression('uniquename')
#myAtlas.filePath(output, 'png')


texts: Use OpenStreetMap in Basemapgallery - Manually

texts:
I don't know how to add the OpenStreetMap to the basemapgallery. I want to do this manually because when I use ShowARCGIS basemaps:true I get too many base maps that I don't use.

Here's my code:

function createBasemapGallery() {
//add the basemap gallery, in this case we'll display maps from ArcGIS.com including Bing maps
        var basemapGallery = new esri.dijit.BasemapGallery({
        showArcGISBasemaps: false,
        bingMapsKey: 'BingKey',
         map: map  }, "basemapGallery");

    var basemapRoad = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsRoad" })], id: "bmRoad", title: "Bing Maps Wegen", thumbnailUrl:"images/basemap_streets.jpg"

    });
 basemapGallery.add(basemapRoad);

var basemapAerial = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsAerial" })], id: "bmAerial", title: "Bing Maps Luchtbeelden", thumbnailUrl:"images/basemap_imagery.jpg"

    });
basemapGallery.add(basemapAerial);

 var basemapHybrid = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsHybrid" })], id: "bmHybrid", title: "Bing Maps Hybride", thumbnailUrl:"images/basemap_imagery_with_labels.png"

    });

 basemapGallery.add(basemapHybrid);

    var layer5 = new esri.dijit.BasemapLayer({ url:"http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" }); var basemap5 = new esri.dijit.Basemap({ layers:[layer5], title:"Lichtgrijs Canvas", thumbnailUrl:"images/light_gray.png" });
 basemapGallery.add(basemap5);

    var layer6 = new esri.dijit.BasemapLayer({ url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" }); var basemap6 = new esri.dijit.Basemap({ layers:[layer6], title:"Topografisch", thumbnailUrl:"images/basemap_topographic.jpg" });
 basemapGallery.add(basemap6);

    basemapGallery.startup();

    dojo.connect(basemapGallery, "onError", function(msg) {alert(msg)});

    }


texts: ArcPy cannot connect to ArcSDE for PostgreSQL with 32-bit version?

texts:
I recently setup an ArcSDE database in Postgres, and all seemed good. I am able to connect to it from both ArcMap and ArcCatalog, and work with the data as expected. Thus, I know I got the 32-bit Postgres drivers in the correct location and they are working.

However, I've been trying to get a python script running that needs to write to the SDE database. I have been executing the script using the 32-bit python installed with ArcGIS. I made a database connection in a folder available to the script, which I am using to connect to the database. When I run arcpy.Exists on that connection, it returns True, which is good. Except I cannot read or write any data in the database. (Side question: does this mean arcpy.Exists() on a database connection file only checks to see if the connection file exits, and not if the connection is valid/available?)

I setup a simple little test script:

import arcpy
import os

sde = r"C:\GIS\_SDEConnections\Edituser.sde"

print arcpy.Exists(sde)
print arcpy.Exists(os.path.join(sde, "AWDB"))  # this exists

arcpy.env.workspace = sde

print arcpy.ListFeatureClasses()  # there is one FC in the db
print arcpy.ListDatasets()  # there are two datasets in the db

And I get:

True
False
[]
[]

However, if I try to execute the script with the 64-bit python installed by the Background Geoprocessor, I can see the data in the database. That is, the test script returns:

True
True
[u'sde.sde.dd']
[u'sde.sde.AWDB', u'sde.sde.TestFeatures']

So at this point I figured that the problem lies with the 32-bit python. But here's the kicker: if I try to do these same operations in the python command line in ArcCatalog, I do not have any problems. And ArcCatalog is using the 32-bit python, the same python I tried to use initially.

So, does anyone have any ideas as to what could be the problem? I need to stick with the 32-bit python because of some dependencies. Simply using the 64-bit version is not currently an option.

I am using ArcGIS 10.2.2 and PostgreSQL 9.0.8 (I don't administer the server, so this is the Postgres version I'm stuck with for the moment).


texts: When adding properties to an image, no longer allowed to add to Map

texts:
If I create an image, that I add properties to, I can no longer add the image to the Map.  How can I add it, or how can I add properties so that it doesn't break?

var myPoint = ee.Geometry.Point([-64.9823, -36.4917]);

var myArea = myPoint.buffer(5000);

var myImage = ee.Image(1).clip(myArea);

Map.centerObject(myImage);
Map.addLayer(myImage); // This works fine.

var myImageWithProperties = myImage.setMulti({
  Name: "ones",
  ID: 1234
});

Map.addLayer(myImageWithProperties); // after adding properties


texts:
I tried this http://tereshenkov.wordpress.com/2010/08/16/map-identify-tool-in-arcgis-server/ but it doesn't work on ArcGIS Server 10.1 (.NET Web ADF) :-(
Application doesn’t use file MapIdentify.js. How to force the application to use this file and not default method from WebControls?


texts:
What is the Python script for shapefile to layer conversion? I tried the following...

import arcpy
from arcpy import env
env.workspace="working path"
arcpy.MakeFeatureLayer_conversion("source shapefile", "target name")


texts:
I am trying to use the raster-colorizer in Tilemill (v0.10.1) but it is giving me an error.
I did set in the advanced section the band to band="1". What else do I have to do in order to use raster-colorizer?


texts:
I have ArcGIS API for Python installed and when I use below line, am getting error as

  ModuleNotFoundError: No module named arcgis

from arcgis.gis import GIS

Please refer to Image


texts: Drawing markers and text on ArcGIS map, at fixed size, independent of zoom?

texts:
I'm writing a WPF application, in C#, using ArcObjects.

I have an ESRI.ArcGIS.Controls.AxMapControl on my form, and I'm trying to draw some graphics elements on top of it.

The map I'm developing with is a customer-provided mdf of the state of Georgia.

Over the top of this, I need to display some markers and some text. It's taken a while, but I've figured out how to do this, except that the image and the text scales with the map. If it looks good at one zoom, it's way too big or way too small at others.

What I'd like is for the marker and text to be placed at a lat/long, so that it moves as the map is panned, but at a fix size that doesn't change as the map is zoomed in and out.

I'd thought that setting ScaleText = false would solve this for the text, but it doesn't seem to, and I'm not seeing any method for doing this with markers.

My current attempt:

public void addMarker(IMap map, double x, double y, string text, string imagePath)
{
    var point = new PointClass() {X = x, Y = y};

    var pictureMarkerSymbol = new PictureMarkerSymbolClass
    {
        Size = 15,
        BitmapTransparencyColor = new RgbColorClass
        {
            Red = 0,
            Green = 0,
            Blue = 0
        }
    };

    pictureMarkerSymbol.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, imagePath);

    var markerElement = new MarkerElementClass
    {
        Symbol = pictureMarkerSymbol,
        Geometry = point
    };

    var textElement = new TextElementClass
    {
        Text = text,
        ScaleText = false,
        Symbol = new TextSymbolClass
        {
            XOffset = 40,
            Size = 10
        }
    };

    ((IElement) textElement).Geometry = point;

    (map as IGraphicsContainer)?.AddElement(((IElement)textElement), -1);
    (map as IGraphicsContainer)?.AddElement(((IElement)markerElement), 0);

    (map as IActiveView)?.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}

I recognize that the above is stylistically very different from the usual ESRI examples. I find the typical ESRI example almost unreadable. If you strip the more recent C# syntactic sugar from the above, you get the following, which should (and does, in my testing), behave identically:

public void addMarker(IMap map, double x, double y, string text, string imagePath)
{
    IPoint point = new PointClass();
    point.X = x;
    point.Y = y;

    IRgbColor rgbColorClass = new RgbColorClass();
    rgbColorClass.Red = 0;
    rgbColorClass.Green = 0;
    rgbColorClass.Blue = 0;

    IPictureMarkerSymbol pictureMarkerSymbol = new PictureMarkerSymbolClass();
    pictureMarkerSymbol.Size = 15;
    pictureMarkerSymbol.BitmapTransparencyColor = rgbColorClass;

    pictureMarkerSymbol.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, imagePath);

    IMarkerElement markerElement = new MarkerElementClass();
    markerElement.Symbol = pictureMarkerSymbol;

    IElement eMarkerElement = (IElement) markerElement;
    eMarkerElement.Geometry = point;

    var textSymbol = new TextSymbolClass();
    textSymbol.XOffset = 40;
    textSymbol.Size = 10;

    var textElement = new TextElementClass();
    textElement.Text = text;
    textElement.ScaleText = false;
    textElement.Symbol = textSymbol;

    IElement eTextElement = (IElement) textElement;
    eTextElement.Geometry = point;

    IGraphicsContainer gcMap = (IGraphicsContainer) map;
    gcMap.AddElement(eTextElement, -1);
    gcMap.AddElement(eMarkerElement, 0);

    IActiveView avMap = (IActiveView) map;
    avMap.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}

Anyone have any ideas how I can make this marker and text draw at a fixed size independent of zoom?


texts: Styling point displacement for 2 variables QGIS?

texts:
I have a dataset with multiple sampling events that I want to style by season (or "temporada" in my attribute table) and "EP Chinook". Data is from a csv file.

I styled with point displacement to show multiple sampling events.

Then I used categorized render settings to show different seasons, and used size scale fields to show "EP Chinook"

The problem I am running into is the points are way too big.

I have tried writing expressions to change the size but there is no geometry for diameter, which is what I want to show. Such as:

$area="EP Chinook"

but this just makes the size of the points stay the same.

I think the reason I am having problems with the points being so big is that the layer still needs to be written so that minimum values remain visible.

I am new to QGIS (about 2 months of self taught) and am coming off of a moderately novice background with ArcMap.

I think I have found another way to style my data that will be appropriate.
-different symbols for months
-graduated color scale for "EP Chinook"
-point displacement for multiple sampling events

However, this is a temporary fix; it would still be nice to label the points using the initial styling I asked about.


texts: Sum raster data visible from given point, by proportion of view

texts:
I am wondering if there is a tool that does the following (preferably in Arc but other options considered).

Simple example: what proportion of the view from a given point on the landscape is occupied by a given land use type?

You might think you could do this by computing a viewshed and using zonal statistics to sum the land use over the area of the viewshed.  However, this will give an answer as a proportion of land area, which will therefore be biased towards more distant land uses - if you can see a long way, you can see an enormous area even if it only occupies a small proportion of your view.  So as far as I can tell, the tools in Arc do not do the job.

More complex example: Sum the weights on a raster by proportion of view they occupy from a given point.  Essentially the same as the first example but now dealing with continuous values rather than 1 and 0 identifying the land use type.

More complex example yet:  Sum the weights on a raster by proportion of view they occupy for each point in the output raster.  Same as the first example but repeated for every point.


texts: CRS conversion of a point from Pulkovo 1952 (58) Stereo70 (ESPG 3844) TO: WGS84 (ESPG: 4326)

texts:
I have a shapefile loaded from delimited text with exact Northings and Eastings in the Romanian CRS (ESPG:3844). The layer CRS is correctly defined.

Meanwhile, my project CRS is WGS84 (ESPG 4329). OTF is enabled. The point plots on the wrong side of the road.

When I click on info for the layer and check derived location. The error is in the order of 10 or 15 meters.

If I do the conversion on the ESPG website I get the correct location (I know where the physical point is on the earth) and it matches. https://epsg.io/3844

What am I doing wrong? Why does the ESPG website give a different answer to QGIS? How can I get it to agree with the ESPG result and therefore plot correctly? I can't share the coordinates

QGIS version: 2.18.9


texts: Assign matrix values to raster when values do not align with raster rectangle? R

texts:
I'm trying to create a raster of distance to a single line feature (a 25 m contour line derived from an elevation raster). Since I want to run this in a loop and I have a ~15 million cells, I converted all cells to a shapefile of points ahead of time and saved it, so that I wouldn't need to convert the raster back to points every time I ran the loop. Only points in cells that had data (not NA) are in the shapefile (see grey areas in the picture). While all points are spaced 1 m apart, there are gaps in the point mesh due to NA's (white areas).
.

I used gDistance(), similar to this post, to find the distance between all of the points and the elevation contour line.

library(rgeos); library(raster); library(sf); library(spatial.tools)
elevation.ras = raster("elevation.tif", format = "GTiff")
non.ras = create_blank_raster(reference_raster = elevation.ras, return_filename = F, nlayers = 1) #generate raster with footprint of elevation raster
non.ras[elevation.ras < 25] = 1 #assign 1 to all cells below 25 m
non.ras[elevation.ras >=25] = 0 #assign 0 to all cells above or at 25 m
my.line = rasterToContour(non.ras, levels = 1) #generate line at the 1/0 interface
basepoints = shapefile("basepoints.shp") #takes 15 min, 15 million points

#create distance matrix for raster
dmar = gDistance(basepoints, my.line, byid=T) #takes 60 min

This results in a matrix of 1 row and 15 million columns. Now I need to convert the matrix back to a raster, but since the area with data (non-NA) is not a perfect rectangle, I'm not sure how to get the row values to correspond with their original place in the starting raster. A straightforward approach would be to create a point mesh that includes all of the NA values, but since it takes 60 min to process just the points with data, I'm hesitant to add several million more cells.

Is there a faster alternative to gDistance()? 60 min is a long run time. I have about 25 iterations to loop through, so I would definitely like to use a faster method. I'm using Windows 10, R 3.5. My machine is decently powerful but not top-of-the-line.


texts: Error 0x8004159D while loading data from PostGIS to ArcGIS Pro

texts:
I successfully connected to the PostgreSQL database, and I can see the tables/data. When I load one of the data (linestring data) it works well. But when I loaded the polygon data it prompted the error

Exception from HRESULT: 0x8004159D

What I did was dragging the spatial.public.adm_xxxx_ar as highlighted in the picture. what does this error mean? how do I load my polygon data?

This is how I imported the shapefile into the PostGIS database. I made sure that the SRID is WGS UTM zone 48S which has an EPSG code of 32748.


texts: How can I enable topological editing in QGIS 3

texts: How can I enable topological editing (create shared nodes on adjacent polygons or intersecting lines) and also activate the option to prevent polygon overlap (that when a new polygon is drawn, its portions that overlap on pre existing polygons is automatically removed) in QGIS version 3? In prior versions these setting were found in Settings->Snapping Options menu.


texts: Why does QGIS throw me an error on startup with processing.run?

texts:
I am trying to run python startup script for QGIS with the following code:
from qgis.core import *
from qgis.utils import iface
import os
from qgis import processing
project = QgsProject.instance()
project.read('/home/r89/projects/qgis_python/project/main.qgz')
path_to_shapefile = '/home/r89/projects/qgis_python/shapefiles/block1.shp'
block_layer = QgsVectorLayer(path_to_shapefile, "Block layer", "ogr")
project.addMapLayer(block_layer)
iface.setActiveLayer(block_layer)
iface.zoomToActiveLayer()
e = iface.mapCanvas().extent()
x_min = e.xMinimum()
x_max = e.xMaximum()
y_min = e.yMinimum()
y_max = e.yMaximum()
extent = str(x_min) + ',' + str(x_max) + ',' + str(y_min) + ',' + str(y_max) + ' ' + '[EPSG:4326]'
result = processing.run("qgis:tilesxyzmbtiles", {'EXTENT':extent,'ZOOM_MIN':1,'ZOOM_MAX':12, 'OUTPUT_FILE':'/home/r89/projects/qgis_python/output/main.mbtiles'})

os._exit(0)

QGIS throws me an error on start:
An error occurred during execution of following code:
spec.loader.exec_module(module)

Traceback (most recent call last):
  File "", line 1, in
  File "", line 783, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/home/r89/.local/share/QGIS/QGIS3/startup.py", line 18, in
    result = processing.run("qgis:tilesxyzmbtiles", {'EXTENT':extent,'ZOOM_MIN':1,'ZOOM_MAX':12, 'OUTPUT_FILE':'/home/r89/projects/qgis_python/output/main.mbtiles'})
AttributeError: module 'qgis.processing' has no attribute 'run'

Python version:
3.8.3 (default, May 17 2020, 18:15:42)
[GCC 10.1.0]

QGIS version:
3.12.3-București 'București', exported

Python path:
['/usr/share/qgis/python', '/home/r89/.local/share/QGIS/QGIS3/profiles/default/python', '/home/r89/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/r89/.local/lib/python3.8/site-packages', '/usr/lib/python3.8/site-packages', '/home/r89/.local/share/QGIS/QGIS3/profiles/default/python']

When I run this code in QGIS python console, it runs OK.
So, I think there could be a problem with processing module running from a startup script rather than from a QGIS app itself.
I have seen a question with similar error(module 'qgis.processing' has no attribute 'run') but it doesn`t seem to be helpful to me


texts: Remote sensing reflectance from Sentinel 2 in SNAP, ArcGIS or QGIS

texts:
I want to calculate "remote sensing reflectance" from Sentinel 2 image, which is  derived from "water leaving radiance reflectance" of a water surface, to extract information of Total Suspended Matter and CDOM in a water body.

From my understanding, I need to perform an atmospheric correction which provides the water leaving radiance reflectance.

Anyone knows how to do this in SNAP, ArcGIS or QGIS?


texts: Is it possible to get OSM basemap WMS for two different years ( 2000 and 2010 )