texts: Changing raster cell values within polygon using QGIS GUI

texts:
How do I change the values of raster cells which are within a polygon, leaving all cell values outside the polygon unchanged?
I would like to subtract 1.5m from each raster cell value within the polygon, rather than make them all the same value.
I don't know how to use GRASS so I'm hoping there is a way to do it using the tools within the QGIS GUI, raster calculator, or processing toolbox. I'm using QGIS 2.0.


texts:
This issue has only been raised in the community once, two years ago, to the best of my knowledge. I think it's high time to raise the issue again!

readOGR, from the rgdal package, cannot handle multipoint shapefiles, even though they load fine in other GIS packages like QGIS. Of course, you can save the file as a single part object (see image below) in an external program, but ideally it would also be possible to do it in R.  Please see worked example below.

download.file("http://www.personal.leeds.ac.uk/~georl/egs/lnd-stations-multi.zip",
              "lnd-stations.zip") # download multi part polygon
unzip("lnd-stations.zip") # unzip
lndS <- readOGR(".", "lnd-stations", p4s = "+init=epsg:27700") # load

OGR data source with driver: ESRI Shapefile
Source: ".", layer: "lnd-stations"
with 2532 features and 27 fields
Feature type: wkbMultiPoint with 2 dimensions
Error in readOGR(".", "lnd-stations", p4s = "+init=epsg:27700") :
  Incompatible geometry: 4

After performing "Multipart to singleparts" in the QGIS Vector menu (illustrated above) and saving the file, it loads fine in R. Try it:

download.file("http://www.personal.leeds.ac.uk/~georl/egs/lnd-stns.zip",
              "lnd-stns.zip")
unzip("lnd-stns.zip")
lndS <- readOGR(".", "lnd-stns", p4s = "+init=epsg:27700")
plot(lndS)


texts: Is Clip (Data management) or Extract By Mask (Spatial Analyst) more efficient?

texts:
I'm trying to clip down an Orthophoto to a county boundary. I've been using the Extract By Mask Tool, but this process has been running for about 12 hours! It's gone through 2 cycles already, so I'm assuming this is each band. Can someone correct me if I'm wrong on that.

Would the Clip in Data Management work better (faster)? How would the accuracy be?

I've always tried to use Extract By Mask, but this is taking too long.


texts:
I'm totally new to the awesome PostGIS world, so sorry for the maybe silly question.

After a while I was able to install postgres and postgis on my computer (debian testing) and I was also able to create some databases.

Through the DB Manager of QGIS I have imported some shapefile into the database and that's ok.

But now, if I want to export the entire postgis db as a single file (like SpatiaLite does) how can I do that?
I mean, Spatialite creates a real file into a directory while postgis no (or at least I haven't found it).

Thanks guys and sorry for the simple question


texts: How to Read&Write .tiff images in java using GDAL library

texts:
I searched many sites to learn about this but I didn't find anything.

I need step by step process for reading .tiff monochromatic image in java using Gdal library.


texts:
The following query fails to find a point that is less than 3 meters from the buffered point:

SELECT NODE_ID FROM ZLEVEL
WHERE SDE.ST_INTERSECTS(
    ZLEVEL.SHAPE,
    SDE.ST_BUFFER(SDE.ST_POINT(527152.8261, 422964.9258, 31), 115.0)) = 1;

The point that can't be found has coordinates (527152.47980000, 422962.29100000). Changing its coordinates very slightly to (527153.47980000, 422963.29100000) causes it to be found by ST_INTERSECTS.

We have tried rebuilding the spatial index to no avail. Any thoughts? We are using ArcSDE 9.3.1 on Oracle 11g.

Edit:

SELECT SRID
FROM SDE.ST_GEOMETRY_COLUMNS
WHERE TABLE_NAME = 'ZLEVEL'

  SRID
------
    31

SELECT SDE.ST_SRID(SHAPE)
FROM ZLEVEL
WHERE ROWNUM = 1;

                 SDE.ST_SRID(SHAPE)
-----------------------------------
                                 31


texts:
I have setup overpass-api in my local machine (16gb ram,32 core,2399Mhz).
I send 100 threads each with one request like this:

(data=[out:json];node(around:10000,13.0894,80.2428)['amenity'];out count;)

The time taken is around 18-19 seconds for the last thread to finish, this seems to be very long since, the single query takes only less than 1 sec to finish.

Is there a default limit on concurrency in overpass-api?


texts:
I am new to GRASS and am trying to use it because I can't afford the Spatial Analyst extension in ArcGIS.

I am trying to remove all of the values in a NDVI raster less than some value to exclude shadows and bare soil before I calculate averages.  I have tried

NDVI_b = if(NDVI_a <= 0.1,null(),NDVI_a)

My understanding is that this statement means that a new map (NDVI_b) should be created where cell values <= 0.1 are replaced with null otherwise the value remains the same as in NDVI_a.  However all I'm getting is null value for all cells in my output raster.  Is there something fundamental that I'm missing?  I have tried using both the GUI Raster Map Calculator as well as the command console.


texts: Filtering LAS Dataset and using output for raster conversion?

texts:
I have problems with filtering LiDAR data within geoprocessing tools and python scripts. It simply doesn't work despite everyting looks correct. Filtering works only when I apply filter in properties of LAS dataset layer.

Here is an example of code which I'm using. I'm trying to filter only buildings class = 6. Sadly the result does not correspond to filter class values. In this example, result includes all classes unless I manualy filter LAS dataset in layer properties. Anyone had this problem?

# Process: Make LAS Dataset Layer
lasDatasetLayer = arcpy.MakeLasDatasetLayer_management(inputLasd, "LasDatasetLayer", 6, "", "false", "true", "true", "false", "")
# Process: LAS Dataset to Raster (2)
rasterFromLas = arcpy.LasDatasetToRaster_conversion(lasDatasetLayer, "rasterFromLas", "ELEVATION", "BINNING AVERAGE NONE", "FLOAT", "CELLSIZE", "1", "1")

I've read similar Q&As but they don't mention MakeLasDatasetLayer tool problems:

Specifying LAS dataset filters in ArcGIS ModelBuilder?
LAS dataset to raster with ground points only


texts:
I have a problem with a shapefile that until this morning was working perfectly fine.
When I zoom to layer, the shapefile is whole, everything normal. After 1 mouse scroll, the shapefile dissapears, leaving just 1 element visible (as in the printscreens). I have tried redownloading the shp, restarting QGIS, restarting the computer. Nothing worked.


texts: Image Visualization - Styled Layer Descriptors - Sentinel 2

texts:
I try user the Styled Layer Descriptors to SLDs ( https://developers.google.com/earth-engine/image_visualization ) for stretching pixel values to improve visualizations of continuous data in images Sentinel 2 but it doesn't work work. All pixels are converted to RGB (255, 255, 255), i.e., it is not stretching the data properly. Note that I am apply this visualization method to an image computed from the mean of an image collection.

Code Editor script

var geometry =ee.Geometry.Polygon(
        [[[-56.78706327291917, -15.151036486409632],
          [-56.78706327291917, -15.216641306791784],
          [-56.70672574850511, -15.216641306791784],
          [-56.70672574850511, -15.151036486409632]]], null, false);

Map.centerObject(geometry);

var s2 = ee.ImageCollection("COPERNICUS/S2")
  .filterMetadata('CLOUD_COVERAGE_ASSESSMENT', 'less_than', 20)
  .filterBounds(geometry)
  .filterDate("2019-01-01","2019-12-31")
  .select('B11','B8','B4');

print('S2',s2);

var mean_reduce = s2.reduce(ee.Reducer.mean()).toUint16();
print('Mean_reduce: ',mean_reduce);

var vis_params = {
    'min': 600,
    'max': 3200,
    'bands': "B11_mean,B8_mean,B4_mean",
    'gamma': [0.95, 1.1, 1],
    'region':geometry
};

Map.addLayer(mean_reduce.clip(geometry), vis_params, 'Sentinel 2');

var template_sld =
  '<RasterSymbolizer>' +
    '<ContrastEnhancement><_enhance_/></ContrastEnhancement>' +
    '<ChannelSelection>' +
      '<RedChannel>' +
        '<SourceChannelName>B11_mean</SourceChannelName>' +
      '</RedChannel>' +
      '<GreenChannel>' +
        '<SourceChannelName>B8_mean</SourceChannelName>' +
      '</GreenChannel>' +
      '<BlueChannel>' +
        '<SourceChannelName>B4_mean</SourceChannelName>' +
      '</BlueChannel>' +
    '</ChannelSelection>' +
  '</RasterSymbolizer>';

var equalize_sld  = template_sld.replace('_enhance_', 'Histogram');
var normalize_sld = template_sld.replace('_enhance_', 'Normalize');

Map.addLayer(mean_reduce.clip(geometry).sldStyle(normalize_sld), {}, 'Normalized' ,1);
Map.addLayer(mean_reduce.clip(geometry).sldStyle(equalize_sld) , {}, 'Equalized'  ,1);


texts: Obtaining NDVI data only for imagery within an imported polygon

texts:
I am trying to visualize NDVI for a specific boundary that I have imported from ArcMap.
When I filter the NAIP imagery by the boundary it works perfectly, but when I try and filter the MODIS by the boundary I only receive an output of the NDVI values for the entire dataset (world). This causes problems later on when I need to use the .map function to add the 'NDVI' band to the clipped Naip imagery.

Below is a segment of my code where geom references the imported polygon.

I am new to Google Earth Engine.

var geom = table2
var naip = ee.ImageCollection("USDA/NAIP/DOQQ")
  .filterDate('2011-07-03','2011-08-12')
  .filterBounds(geom);
Map.addLayer(naip);
var mod = ee.ImageCollection("MODIS/006/MOD13A2")
  .filterDate('2011-07-03','2011-08-12')
  .filterBounds(geom)
  .select('NDVI');
Map.addLayer(mod);


texts: Identify the degree , Minutes and seconds from coordinates

texts:
I have coordinates which has degree format, i want to convert it into decimal format,
For this i want to grab Degree , Minutes and seconds from coordinates.

Standard format is DDMMSS N / DDMMSS E , But i have one special type of  coordinates.

The coordinate is :

4729N00937E , 472027N0114441E , 472116N0114328E , 4729N00937E

I wan to convert it into decimal format ,  I want to use in Geojson.


texts: Majority filter (minimum mapping unit) in ArcGIS Desktop with larger window size?

texts:
I want to run the majority filter in ArcGIS Desktop with a window size of 4 or 5 i.e. greater than the default 3.

Is it possible, or is there some other command (or tool) which might help me achieve that?


texts: Error when trying to iterate over fields in PyQGIS3

texts:
In my script I'm getting the following error message and I don't understand why:

  AttributeError: 'dict' object has no attribute 'fields'  Traceback
  (most recent call last):   File
  "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Flae2Halt\Flae2Halt.py",
  line 313, in run
      self.Channel2()   File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Flae2Halt\Flae2Halt.py",
  line 284, in Channel2
      for field in channel1.fields(): AttributeError: 'dict' object has no attribute 'fields'

I have a vector layer and I'm trying to iterate over its fields. First I get the layer from this function:

def Channel1(self):
    channel = self.getChannel()
    param = {'INPUT': channel,
             'EXPRESSION':  "\"Zuordnung\" = 1 OR \"Zuordnung\" = 3",
             'OUTPUT': 'memory:'
            }
    channel1 = processing.run('native:extractbyexpression', param)
    return channel1

This function should return a QgisVectorLayer right?
Next to the function with the iteration:

def Channel2(self):
    channel1 = self.Channel1()
    fieldname = self.dlg.Channel_ID.currentText()
    fieldNameList = []
    for field in channel1.fields():
        if not (field.name == fieldname):
            fieldNameList.append(field.name)
    param = {'INPUT': channel1,
             'COLUMN': fieldNameList,
             'OUTPUT': 'memory:'}
    channel2 = processing.run('qgis:deletecolumn', param)
    QgsProject.instance().addMapLayer(channel2)
    return channel2

According to the official developer Cookbook for field in vlayer.fields() is the function to iterate over the fields of a layer.

Apparently "channel1" is not a QgsVectorLayer object after all or fields() is not working anymore in QGIS3.

Ahhh! I must have done a stupid error somewhere but I just don't see it.

I'm using QGIS 3.4


texts:
I am trying to create a political map of Morocco with regions, using ggplot2, but the scale seems to be wrong. This is the map:

And below is the code I used:
library(ggplot2)
library(ggspatial)

YK = map_data("world")

ggplot() +
  theme_bw() +
  geom_polygon(data = YK, aes(x=long, y = lat, group = group), color = 'black',
               fill = "cornsilk") +
  geom_polygon(data = latlong, aes(x = long, y = lat, group = group),
               color = 'black', fill = 'red3') +
  coord_sf(xlim = c(-20, 4), ylim = c(18, 38), expand = FALSE) +
  xlab("Longitude") + ylab("Latitude") +
  ggtitle("Kingdom of Morocco", subtitle = "(Administrative Division - Regions)") +
  theme(panel.grid.major =
          element_line(color = gray(0.5), linetype = "dashed", size = 0.5),
        panel.background = element_rect(fill = "aliceblue")
       ) +
  annotation_north_arrow(location = "tl", style = north_arrow_fancy_orienteering)+
  annotation_scale(location = "br", plot_unit = "km")


texts: I have a raster of 500m resolution based on MODIS sinusoidal projection, so I first converted it to WGS84. In order to create a 500m fishnet of the WGS84 raster in ArcGIS, I first converted the raster to points. Then, in the Fishnet tool, I entered 0.005 as cell height and width value to approximate a 500m grid polygon based on the approximation that 0.01° = 1.11 km. My area is in the Pacific North West in the US. Did I enter the correct(approximate) cell size value or is there a more accurate way to this?


texts: Efficient algorithms to split and join lines?

texts:
Referring to the Figure below:

How to efficiently join segments into lines?
How to efficiently break lines into segments?

The above will be applied million times.


texts: How to draw boundaries to separate clusters?

texts:
I have used the R Project for Statistical Computing to make a map of clusters based on latitude and longitude by using the k-mean clustering.

Is there any software I can use to import the clusters into a map and draw boundaries between the cluster to create regions?

Also, for further analysis, I have some more data points.

Is there any software which I can use to identify which regions the data points (lon, lat) belongs to?


texts: Why do pdf/image exports fail with OpenLayers Bing layers?

texts:
When I try to export a print composition it generates a 0kb file. Is not possible to open this file.

It happened the same with export as image option.

The print composition model is coming from a .qpt file created with QGIS 1.8.

The problem is not in the print composition created with QGIS 1.8. I have the same problem starting with a new composition. The print works regularly if I hide the two maps in the print composition. I can print all the elements that are not maps.

The maps are coming from OpenLayers plugin/bing

What shoud I check to solve it?


texts: SVG graphics fully black when opening it as SVG Marker in QGIS

texts:
I have an SVG graphic that should be placed in certain locations on my map in QGIS 2.18.

It is accessible via JSFiddle: SVG_Example
I can open it through Adobe Photoshop, Inkscape, Chrome, it even obeys Internet Explorer.
As for me, everything looks okay when I check my SVG element through Notepad++.
However, when I modify the point symbology through Layer Properties > Style > Single Symbol > SVG Marker I am getting a fully black icon, see the image below.
Any suggestions on how can I overcome this issue?


texts: Placing each record on separate page using ArcMap Report Designer?

texts:
I'm using the ArcMap Report Designer (ArcGIS 10.2.2) for the first time.  I need to generate a report where each database record appears on a separate page.

There is a "Page Break" Design Element.  But I can't find a way to put this at the end of the Detail area for a record.  I can get it close to the end; it creates a page break that puts a tiny portion of the record detail on the next page, followed by the next record.  This will work, but it's a bit ugly.

Is there a better way to do this?


texts: PGrouting number of results in pgr_dijkstraCostMatrix() not right

texts:
When running the pgr_dijkstraCostMatrix() on a PostGIS database with 41000 id's  I get only 144000 rows in the matrix. I would have expected much more.
What am I missing?

I parsed the OSM data with Osm2po, getting these fields:

The name of my db: ma_2po_4pgr

The SQL I used:

SELECT * FROM pgr_dijkstraCostMatrix(
    'SELECT id,  source, target, cost, reverse_cost FROM ma_2po_4pgr',
    (SELECT array_agg(id) FROM  ma_2po_4pgr )
);

The data looks like this;

I am on a win7 machine, using PostGIS 2.5.2 on PostgreSQL 11, pgRouting 2.6.2  .


texts: Making Y plane follow direction of building

texts:
Here is my current code:

var viewer = new Cesium.Viewer('cesiumContainer');
var redPlane = viewer.entities.add({
    name : 'Red plane with black outline',
    position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),
    plane : {
        plane : new Cesium.Plane(Cesium.Cartesian3.UNIT_Y, 0.0),
        dimensions : new Cesium.Cartesian2(400000.0, 300000.0),
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.BLACK

    }
});

viewer.zoomTo(viewer.entities);


texts: Finding three closest points in layer to each polygon in another layer using ArcGIS Desktop?

texts:
I am working with two layers in ArcMap 10.

One is a point layer and the other is a polygon layer. For each polygon I need to find the three closest points.

What is the best way to compile a list that gives each polygon and the three closest points?


texts: Creating tool for metadata standard for spatial data?

texts:
I am looking to develop a tool to make cadastral metadata in a particular scenario.

I would keep the ISO standards for meta in view of my development.

Any suggestions in creating the tool for Metadata?


texts: Assign a Value to a Customized Toolbar Item

texts:
I have developed a main toolbar that uses windows forms and arcobjects to write to sde databases.

I am trying to extend the functionality of the toolbar to point to two different databases dependent on which item on the tool bar they choose. Each item has the same process and steps associated with them.

Is there a way to pass a value when using the AddItem() command, similar to an onClick event?

    Public Sub New()

        AddItem("tlb_Champ") *I would like to pass the database path when they choose this item vs the item below
        BeginGroup()
        AddItem("tlb_Dommage")
        BeginGroup()
        AddItem("tlb_Seismic")

    End Sub


texts: Cannot create PostGIS extension with Ubuntu 18.04

texts:
I am a few days new to Linux Ubuntu and am in the process of setting up a PostGIS database to use in GeoDjango.

I am going to post all my commands that I have done so far

these are installed in order:

-------------------------------postgres------------------------
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install postgresql postgresql-contrib libpq-dev pgadmin4

sudo apt-get install postgis

-------------------------------geodjango------------------------

sudo apt-get install binutils libproj-dev gdal-bin
sudo apt-get install build-essential
sudo apt-get install gcc g++ clang make

--geos
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar xjf geos-3.4.2.tar.bz2
cd geos-3.4.2
export CXX="g++ -std=c++98"
./configure
make
sudo make install
cd ..

--proj 4
wget http://download.osgeo.org/proj/proj-4.9.1.tar.gz
wget http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz
tar xzf proj-4.9.1.tar.gz
cd proj-4.9.1/nad
tar xzf ../../proj-datumgrid-1.5.tar.gz
cd ..
./configure
make
sudo make install
cd ..

--gdal
wget http://download.osgeo.org/gdal/2.2.0/gdal-2.2.0.tar.gz
tar xzf gdal-2.2.0.tar.gz
cd gdal-2.2.0
./configure
make
sudo make install

now when I go into pgAdmin 4 and run create extension postgis i get this error

ERROR:  could not load library "/usr/lib/postgresql/10/lib/postgis-2.4.so": /usr/lib/liblwgeom-2.4.so.0: undefined symbol: GEOSVoronoiDiagram
SQL state: XX000

UPDATE

followed the directions in this link https://kitcharoenp.github.io/postgresql/postgis/2018/05/28/set_up_postgreSQL_postgis.html and still got the same error


texts:
I am trying to add the (amount of pixels of) NDWI and Clouds as bands to my image collection. The NDWI works out, but I get stuck when adding the Clouds. The error refers to an incompatible number of bands in the image, but I don´t know where exactly it refers to.

Any ideas?

Similarly I would like to add the cloudfunction to the chart.

Am I doing this right?

//-------FUNCTION NDWI-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

var date_start = ee.Date.fromYMD(2016,1,1);
var date_end = ee.Date.fromYMD(2018,12,31);
l8 = l8.filterBounds(aoi).filterDate(date_start,date_end);
var landsat8 = l8
var waterThreshold = 0;
var cloudThreshold = 0;

//-------WATERFUNCTION-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
var waterfunction = function(image){
//add the NDWI band to the image
var ndwi = image.normalizedDifference(['B3', 'B6']).rename('NDWI');
  //get pixels above the threshold
  var water01 = ndwi.gt(waterThreshold);
  //mask those pixels from the image
  image = image.updateMask(water01).addBands(ndwi);
  var area = ee.Image.pixelArea();
  var waterArea = water01.multiply(area).rename('waterArea');
  image = image.addBands(waterArea);
  var stats = waterArea.reduceRegion({
    reducer: ee.Reducer.sum(),
    geometry: aoi,
    scale: 30,
  });
  return image.set(stats);
};

var collection = landsat8.map(waterfunction);
print('NDWI',collection);

//-------CLOUDFUNCTION-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
var cloudfunction = function(image){
  //add the NDWI band to the image
  var cloud= image.select(['B4','B3','B2']).rename('Clouds');
  //get pixels above the threshold
  var cloud01 = cloud.gt(10500).lt(12000);
  //mask those pixels from the image
  image = image.updateMask(cloud01).addBands(cloud);
  var area = ee.Image.pixelArea();
  var cloudArea = cloud01.multiply(area).rename('cloudArea');
  image = image.addBands(cloudArea);
  var stats = cloudArea.reduceRegion({
    reducer: ee.Reducer.sum(),
    geometry: aoi,
    scale: 30,
  });
  return image.set(stats);
};

var collection = landsat8.map(cloudfunction);
print('NDWI + Clouds',collection);

var chart = ui.Chart.image.series({
  imageCollection: collection.select('waterArea','cloudArea'),
  region: aoi,
  reducer: ee.Reducer.sum(),
  scale: 30,
});

print(chart);


texts: Animation map in R error in Loading shapefile in R

texts:
I want to make an animation map in R.
I have tried several command lines but I get some errors, as follows:

> library(raster)
> s <- shapefile("//Users//Merry//Desktop//ro_judete_poligon//ro_judete_poligon")
Error in .local(x, ...) : file.exists(extension(x, ".shp")) is not TRUE

or this command

library(rgdal)
> ro_judete_poligon<-readOGR(dsn="C://Users//Merry//Desktop",layer="ro_judete_poligon.shp")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  :
  Cannot open data source

How can I get the shapefile in R?
I am confused.


texts: Filling a dictionary whose values are a list container

texts:
import arcpy, datetime
arcpy.env.overwriteOutput = True

# Number of days to subtract
tdelta = datetime.timedelta(days=21)

fiberCable = r'C:\Users\broadhurstn\Documents\ArcGIS\Default.gdb\FIBERCABLE'
conduit = r'C:\Users\broadhurstn\Documents\ArcGIS\Default.gdb\CONDUIT'
fibercableToConduit = r'C:\Users\broadhurstn\Documents\ArcGIS\Default.gdb\FibercableToConduit'
unc = r'\\Bvweb104draco\e\08_Scripts\referenceScripts\Conduit Export\ConduitExports.gdb\TampaConduit'

# Populate a dictionary that maps segment ID to the placed/planned date
segment_dates = defaultdict(list)
with arcpy.da.SearchCursor(fiberCable, ['segmentid', 'bv_cable_placed_planned']) as cursor:
    for row in cursor:
        segment_dates[row[0]].append(row[1])

# Populate a dictionary that maps conduit ID to a two-item list containing segment ID and placed/planned date
ftcs = {}
with arcpy.da.SearchCursor(fibercableToConduit, ['conduitipid', 'segmentid']) as cursor:
    for row in cursor:
        # Use .get() so that it won't fail if a segment ID isn't in the dictionary
        ftcs[row[0]] = [row[1], segment_dates.get(row[1])]

# Populate conduit 'bv_placed_est' field and subtract 21 days
with arcpy.da.UpdateCursor(unc, ['ipid', 'bv_placed_est']) as cursor:
    for row in cursor:
        ipid = row[0]
        for k,v in ftcs.items():
            if ipid == str(k):
                # tdelta will not work on null values
                if v[1] is not None:
                    row[1] = min(v[1]) - tdelta
                    cursor.updateRow(row)

The above code and below feature class table produce a dictionary that fills as follows:

{u'248bdd3a-a13c-44b4-b592-b64a843fb0bc': [u'{2AC71409-C59E-49E1-A35B-61CD19885A2A}', datetime.datetime(2020, 1, 14, 0, 0)]}

How do I add a multiple values to the dictionary keys using the below feature class table and have it choose the earliest date of the bunch?

Notice how the value in the dictionary matches "segment ID" in this feature class. I want to have the the SearchCursor look at the current dictionary, see if there is a value that matches the "SegmentID" field values and append the EARLIEST "Cable Placed Planned" to it's corresponding dictionary item as a second value. There could be multiple 'Cable Placed Planned' dates in the form of a value associated with a key.

Expected output for the first item:

{u'248bdd3a-a13c-44b4-b592-b64a843fb0bc': [u'{2AC71409-C59E-49E1-A35B-61CD19885A2A}', datetime.datetime(2016, 1, 14, 0, 0), datetime.datetime(2017, 12, 14, 0, 0), datetime.datetime(2019, 10, 28, 0, 0)}, etc...

The key could have 1 value, or 20 values associated with it and I need to sift through those values for the earliest date and append it to the conduit feature class field.

Working code above only takes a single value per key, but can't deal with instances when there are numerous values that need to be associated with a key.


texts:
I am generating some maps and animations with tmap, using tm_facets.
The default style shows rather ugly grey headers for each small map. How can I change the style of the header (position, font size/family, background colour)?

tm_shape(Europe) +
    tm_polygons("well_being", title="Well-Being Index") +
    tm_facets("part", free.coords=FALSE) +
tm_style_grey()

Similar code snippets are available in the R Vignette.


texts: Metric grid annotation truncation In QGIS Print Composer

texts:
I'm recreating a map using an old x/y meter grid.

I need to truncate the grid cooridinates annotations to the thousands. So that 200000 will be displayed as 200. 220000 as 220 etc.

Is there a way to do it automatically in QGIS?
I don't see any option to manually edit the annotation, besides changing decimals or text font.


texts:
Can somebody help me.
Trying to run Qgis PyQT app, but have an error in command line

C:\work\2q5>python program.py
C:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(472) : (QgsCoordinateReferenceSystem::loadFromDatabase) [0ms] failed : /resources/srs.db does not exist!
C:\src\qgis\src\gui\qgsmapcanvas.cpp(466) : (QgsMapCanvas::refresh) [15ms] CANVAS refresh - invalid settings -> nothing to do
C:\src\qgis\src\core\qgsproviderregistry.cpp(89) : (QgsProviderRegistry::init) [125ms] Checking  for provider plugins
C:\src\qgis\src\core\qgsmessagelog.cpp(33) : (QgsMessageLog::logMessage) [0ms] 2017-04-23T15:16:04 No Data Providers[1] No QGIS data provider plugins found in:

No vector layers can be loaded. Check your QGIS installation
C:\src\qgis\src\core\qgsproviderregistry.cpp(377) : (QgsProviderRegistry::provider) [0ms] Library name is
C:\src\qgis\src\core\qgsmessagelog.cpp(33) : (QgsMessageLog::logMessage) [16ms]
2017-04-23T15:16:04 [1] Failed to load : The shared library was not found.
C:\src\qgis\src\core\qgsvectorlayer.cpp(1499) : (QgsVectorLayer::setDataProvider) [62ms]  unable to get data provider

I set this enviroment vars like this

C:\work\2q5>set PATH=C:\OSGeo4W\apps\qgis-dev\bin;C:\OSGeo4W\apps\grass\grass-7.2.0\lib;C:\OSGeo4W\apps\grass\grass-7.2.0\bin;C:\OSGeo4W\apps\Python36;C:\OSGeo4W\apps\Python36\Scripts;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python27\Scripts;C:\OSGeo4W\bin;C:\Windows\system32;C:\Windows;C:\Windows\WBem
C:\work\2q5>set GDAL_DATA=C:\OSGeo4W\share\gdal
C:\work\2q5>set GDAL_DRIVER_PATH=C:\OSGeo4W\bin\gdalplugins
C:\work\2q5>set GDAL_FILENAME_IS_UTF8=YES
C:\work\2q5>set GEOTIFF_CSV=C:\OSGeo4W\share\epsg_csv
C:\work\2q5>set GISBASE=C:\OSGeo4W\apps\grass\grass-7.2.0
C:\work\2q5>set GRASS_PROJSHARE=C:\OSGeo4W\share\proj
C:\work\2q5>set GRASS_PYTHON=C:\OSGeo4W\bin\python.exe
C:\work\2q5>set OSGEO4W_ROOT=C:\OSGeo4W
C:\work\2q5>set PROJ_LIB=C:\OSGeo4W\share\proj
C:\work\2q5>set PYTHONHOME=C:\OSGeo4W\apps\Python36
C:\work\2q5>set QGIS_PREFIX_PATH=C:\OSGeo4W\apps\qgis-dev
C:\work\2q5>set QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis-dev\qtplugins;C:\OSGeo4W\apps\qt5\plugins

C:\work\2q5>set  QGIS_PROVIDER_FILE=C:\OSGeo4W\apps\qgis-dev\plugins

In the QGIS_PROVIDER_FILE directory i have grassprovider7.dll, ogrprovider.dll and else dll`s.
Starting command line from OSGeo4W Shell and rewriting this env vars.


texts: Why is feature.geometry() None in my user-defined expression function?

texts:
I'm trying the user-defined expression functions for QGIS, as listed on Nathans blog: http://nathanw.net/2012/11/10/user-defined-expression-functions-for-qgis/

I always get the feature.geometry() as None, when running the user expression in the expression builder updating a text column? This happens for all geometries like point, lines and polygons. The data format is ESRI Shape. The code is in an userfunctions.py referenced from startup.py.

Simplified example:

from qgis.utils import qgsfunction
from qgis.core import QGis

@qgsfunction(0, "Python")
def test(values, feature, parent):
    geom = feature.geometry()
    if geom is None:
        return 'geom is None'

    return 'geom is NOT None'

My text column is updated with the text: 'geom is None'. Why can I not reference the geometry of a feature?


texts: Merge single band and multi band color images

texts:
I have two color images (orthophotomaps). One is only 1-band with color map and second is with 3-bands.

How can I merge them with any FOSS tools or ArcGIS?


texts:
How do you automatically create adjacent polygons in QGIS whose size depends on an attribute of another layer?
I have a layer with community areas and the corresponding number of inhabitants and would like to automatically create polygons that always contain more or less the same number of inhabitants from the communities.

Below is a picture that hopefully helps to understand my question. I am looking for something similar like a cartogram tool. I want to create polygons of variable size depending on the amount of the attribute "EWZ" in a different layer. The polygons should take the size of polygons of the other layer until the sum of the attribute has a range of 5000 to 10000.


texts: Select point by number of overlapping features

texts:
I have this polygon layer converted to lines, and had the line nodes extracted using Extract nodes. The resulting point layer has several overlapping points because of common borders with adjacent features.

Most of the overlapping points are two points. I want to delete these points that have only 1 overlapping point and those that do not contain any overlapping points.

I was thinking of a workaround which is to select nodes that overlap three or more times so that I could invert select them, then delete the selection (which are the points having only 1 overlapping point or none at all).

How can I select these points that have three or more overlapping points?


texts: Labeling a Feature Class - how to force the label to use a particular field

texts: I am trying to make a map with the voter blocks labeled.  The label command uses the county identifier field.  Can I force it to label with the voting block field?


texts: rgb2pct.py increases size of file 20 fold!

texts:
I wanted to reduce the number of bands of a tif file from 3 to 1...

I used this command

rgb2pct.py -n 256 fnp_braunschweig.tif fnp_bs.tif

and it increased the size from 31mb to 778mb

I actually want to decrease the size of the file.

Why is this happening?


texts: Getting representation geometry created by rules (not manually overrided) using ArcObjects.net?

texts:
I have feature class with representation rules and now need to extract representation geometry from selected features.
If representation geometry is manually overrided, I can get it just using IRepresentation.Shape property:

IFeatureLayer layer = someLayerMethod();
IGeoFeatureLayer geoLayer = (IGeoFeatureLayer)layer;
IFeatureClass mapFeatureClass = layer.FeatureClass;

ICursor cursor = (ICursor)mapFeatureClass.Search(null, false);

IFeatureSelection selection = (IFeatureSelection)layer;
ISelectionSet selectionSet = selection.SelectionSet;

selectionSet.Search(null, false, out cursor);
IFeature mapFeature = (cursor as IFeatureCursor).NextFeature();

while (mapFeature != null)
{
    if (geoLayer.Renderer is IRepresentationRenderer)
    {
        IRepresentationClass repClass = (geoLayer.Renderer as IRepresentationRenderer).RepresentationClass;
        IRepresentation rep = repClass.GetRepresentation(mapFeature, mapContext);

        if (rep.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
            doSomeAction(rep.Shape); // <-- overrided geometry
    }
    mapFeature = (cursor as IFeatureCursor).NextFeature();
}

And if geometry is not overrided but changed by representation rules (Smooth, Donut, Simplify etc), IRepresentation.Shape property returns original feature geometry. Other shapes properties (ShapeCopy, ShapeEdit) also returns original geometry.

How can I get geometry that was created by representation rule using ArcObjects.NET?
Or may be there is some way in Arcpy?


texts: How to import QGIS layer definition files without losing value relation settings?

texts:
QGIS allows groups of layers to be saved as a 'layer definition file'.

Where one layer in that group references another - using a 'value relation' widget on its attribute form - these setting are broken once the layer definition file is imported into a new project.

Is there a workaround or alternative, bearing in mind that too many value relations are used to allow them all to be fixed individually by hand every time a layer definition file is imported?

.........

Use case/details:

Data is stored in a PostGIS database.

I have two complex QGIS projects, used as standard template projects by large teams. Each team has information it focuses on, but they also need to view the information from the second team. The projects are therefore fairly similar, but slightly differently organised. On updating the way that one of the projects works I need to update the second project accordingly.

There are two obvious ways to do this. The first is by saving groups of layers and importing as embedded projects. QGIS 3.4 currently seems to fail to work with these in a number of ways (losing settings around visibility in particular) so I abandoned this system. The second is to export/import groups of layers in a 'layer definition file'.

I use multiple 'value relation' widgets, with some simple data tables (also stored with the main data) providing the content for drop down lists on the main layers. These work well. It is important that the potential values for the drop down lists are stored within the database (not in the QGIS project).

Unfortunately the settings for the 'value relation' widgets don't correctly import along with the layer definition file (internal references in the file, between the layers, are broken - these could be corrected in a text editor, but such a process is laborious and error prone).

Is there a workaround or an alternative? Such a workaround should recognise that in my case updating things field by field is impractical due to the large number of such value relation widgets (referencing multiple, different layers), and that the values for the drop down boxes should still be stored in the main database and not in the QGIS project.


texts: Seeking decadal climate and ocean data for Europe

texts:
Where can I find 'decadal' climate and ocean data for Europe that I can download and use directly in ArcGIS Desktop?

Specifically, I am looking for mean annual temperature, sea surface temperature, and salinity raster data for the decades from 1960 onwards.


texts: SQLServer STArea issue with GEOMETRYCOLLECTION resulting in trillion's m2 area

texts:
I've come across a weird issue with SQL Server's handling of GEOMETRYCOLLECTION in a Geography data type  resulting in an area (square meters) in the trillion's of square meters. (checked on 2014, 2016, and 2019). This is not an issue with STGeomFromText as the same issue occurs when using STIntersects().
Example
Select 'POLYGON' Type,Geography::STGeomFromText('POLYGON ((145.396208 -16.499585999999994, 145.3962249999999 -16.499895000000112, 145.396208 -16.499586, 145.39623500000008 -16.499546999999922, 145.396208 -16.499585999999994))', 4326).STArea() Area
Union all
Select 'GEOMETRYCOLLECTION', Geography::STGeomFromText('GEOMETRYCOLLECTION (POLYGON ((145.396208 -16.499585999999994, 145.3962249999999 -16.499895000000112, 145.396208 -16.499586, 145.39623500000008 -16.499546999999922, 145.396208 -16.499585999999994)))', 4326).STArea()

Results in

Does anyone know if this has been reported as a bug to MS and if there is a plan to fix it?


texts: Creating OUTSIDE_ONLY buffer around polygon using R?

texts:
I would like to create buffers in polygons, surrounding my original polygon. However, I want to keep only the "outside polygon", not include also original polygon. In Buffer in ArcGIS I can just set function OUTSIDE_ONLY and I have my buffer zone only (http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Buffer%20(Analysis)).

However I didn't find a way how to make it in R? I've tried both, {rgeos} and {raster}. I know I can delete my original polygon later ({rgeos}), but is there a way how make it happen while creating buffers?

# stack overflow
library(rgeos)

# create polygon
p1 = readWKT("POLYGON((2 2,-2 2,-2 -2,2 -2,2 2))")
# create two buffers - one wth {raster}, one with {rgeos},
# both covers also original polygon !
b.r<-buffer(p1, width = 1, dissolve = T)
gb.r<-gBuffer(p1, width = 0.3, byid = T)

# keep only buffer
buff<- gDifference(b.r, p1)

# how can I create OUTSIDE_ONLY polygon without gDifference inter-step???


texts: How to add a Database Server in Catalog?

texts:
I have ArcSDE on an Oracle database and I want to add a database server connection to ArcCatalog, I've seen several sites but they don't say what I have to write down. Let me explain:

From the tree at the left I have several options, from hard drives, database connections to database servers and gis servers. When I right clic the Database servers option and choose add database server I get a dialog box asking me for a Database Server, so, what is what I have to write there?

I've tried with:

servername\user
servername\oracle11g
servername\ESRI_sde

Thanks.

And SDE Administration


texts: ArcGIS Javascript Measure Widget - Location tool shows repeating icons

texts:
I am using the measurement widget in my ArcGIS Javascript application, but am having issues with appearance of the Location Tool.  Everything works the way it should but for some reason when using the Location Tool, the mouse and green marker icons show up twice rather than once like in this sandbox (http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_measurement).  My widget ends up looking like this:

Does anyone know why this would be happening or how I can fix it?  I looked in my Firefox console's HTML tab to see that both icons do show up twice for some reason.


texts: Embedding QGIS Python Script in C++(Qt Creator)

texts:
Is there any way that I can embed and use QGIS Processing algorithm written in python on Qt Creator using C++. If so how can I share the layer and other instances created in C++ with the embedded Python script. E.g  generate a grid programmatically in Python

import processing
layer = canvas.layer(0)
cellsize = 1000
input = processing.getobject(layer.name())
centerx = (input.extent().xMinimum() + input.extent().xMaximum()) / 2
centery = (input.extent().yMinimum() + input.extent().yMaximum()) / 2
width = (input.extent().xMaximum() - input.extent().xMinimum())
height = (input.extent().yMaximum() - input.extent().yMinimum())
grid="/yourpath/grid.shp"
processing.runandload("qgis:creategrid", cellsize, cellsize, width, height, centerx, centery, 1, input.crs().authid(), grid)

How can I display the grid result drawn by the processing algorithm in the canvas created in c++.


texts: georeferenced JPEG images not intalling in QGIS correctly

texts:
I am trying do add georeferenced aerial images (jpg files) to my QGIS. They do not install properly. I either get a grey rectangle or bands of colour (mostly blue) that appear where the image should be.

Also, if I solve this problem, I then need to install all the images. Is there a quick way to insert multiple images from the host file?

Further info following comments:
I am using QGIS2.0.1
I have attached a screenshot of what the image looks like after adding to QGIS. A screenshot of the properties (style) layer.


texts: Determining if feature contained within layout when using Data Driven Pages with ArcPy?

texts:
I'm using polygons to drive my Data Driven Pages in ArcMap Standard 10.2.

I have a point feature that shares a common attribute with the driver polygon, and using the Page Definition, I am showing that point as well (and the point is really the main focus of the map, but ideally we want to show it relative to the polygon extent).

However, the point is not centered in the polygon, and i have a max scale set via python, so, sometimes the point is not shown on the layout due to the shape of the polygon.

I'm wondering if there is a way to identify when that point will not be within the layout extent, so I can mark it to fix manually (or some other way). I guess the overall question is is it possible to determine whether a point feature is contained in the data driven layout extent?

I am exporting my Data Driven maps via python script, so i should have all python functionality when exporting.


texts: Opening DTI Wind Speed .asc files in QGIS?

texts:
I have found some open source data of mean wind speeds for the UK at 10m, 25m and 45m. I've shared the zip folder to my dropbox which you can download at:

https://www.dropbox.com/sh/1sst2hh3x6y7csd/AAC5eQvNM7V-GP6qpwqDqtz8a?dl=0

My issue is that I have no idea how to view the .asc files in QGIS - I receive an error

  "...is not a valid or recognised data source"

I've tried taking the first line/header out of the files and saving them but I get the same error. Is it correct that these files will result in a raster output rather than a set of vectors?


texts: Is there a python function in QGIS to detect if the output file is saved to the hard disk?

texts:
I'm currently using QGIS 2.4 and writing some custom scripts on it. A proper script not only accomplishes its function, but also accepts user defined parameters and checks for possibilities of errors.

So far I couldn't find any information related to a built-in QGIS function or library that checks for error possibilities in the output (e.g. output file exists, no space on output disk, no writing permissions).

Currently I only need one function, to check if the output file is created or not. Is there any QGIS function to accomplish this task or should I rely on python's os library? It would be great if QGIS do has this functionality not only for an easy check, but also to parse the exact reason of the error.

I'm currently using processing.core.VectorWriter to save the output files.


texts:
I've tried to create several types of GeoServer layer stylings with basic labels, both in SLD and via the GeoServer CSS extension. Yet, not once have I managed to get the labels actually rendered. Everything else renders as it should.

I'm running GeoServer 2.11 on Centos 7 (had the same issue on GS 2.9 as well). Data's coming from PostgreSQL 9.2.15 (64-bit, UTF-8 encoded databases).

For instance trying to create a simple polygon style with attribute-based labels in CSS:

* {
  fill: #95C8C1;
  label: [field];
  font-fill: #000000;
  font-family: Arial;
  font-size: 7;
  font-style: normal;
  label-anchor: 0.5 0.5;
}

I've checked for all possible field name letter size matches vs. the data, and also non-field based labels, but nothing.

Similar styling in SLD, also does not render labels:

<StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>Polygon styling test</Name>
 <UserStyle>
  <FeatureTypeStyle>
    <Rule>
      <PolygonSymbolizer>
        <Fill>
          <CssParameter name="fill">#95C8C1</CssParameter>
        </Fill>
      </PolygonSymbolizer>
      <TextSymbolizer>
        <Label>
          <ogc:PropertyName>field</ogc:PropertyName>
        </Label>
        <Font>
          <CssParameter name="font-family">Arial</CssParameter>
          <CssParameter name="font-style">normal</CssParameter>
          <CssParameter name="font-size">7</CssParameter>
        </Font>
        <Fill>
          <CssParameter name="fill">#000000</CssParameter>
        </Fill>
      </TextSymbolizer>
    </Rule>
   </FeatureTypeStyle>
  </UserStyle>
 </NamedLayer>
</StyledLayerDescriptor>

I've tried fiddling around with GeoServer VendorOptions (ConflictResolution etc.), but those break my stylings completely and layers fail to display. Also enabled/disabled caching, reset options, emptied caches, tried different gutters, etc., but nothing.

The only hint I've encountered so far is in the GeoServer logs:

at java.lang.Thread.run(Thread.java:745)
ERROR [renderer.label] - Error adding label to the label cache
java.lang.NullPointerException

Any idea on what is the underlying reason for all this? Is Java getting Null values for the label for some reason?


texts: Using Arcade expression to obtain X and Y values from geometry of Map Service

texts:
I am trying to set up an expression for use in a pop-up in my portal web map in point feature class (image) service that was published referencing SDE Enterprise Feature Class.

When building the expressions I should be getting a value from

Geometry($feature).x

However when I test this expression I get an error that the member x cannot be called.  Same happens when trying x or y z or calling those methods on Point function.

  Execution Error:Runtime Error: Cannot call member method on null. x

The strange thing is that i remember this working but I wonder if the problem is that our data is now in an enterprise SDE rather that an image service published from the desktop from File Geodatabase. That seems to be the only difference, however documentation says that this should be working.

Similarly, I also cannot obtain values in Arcade from Length or Area functions although I do not get an error when I test those functions. Rather the value the test retrieves is 0

Length(Geometry($feature), 'meters')

  results in values: 0 when tested

  shows no (empty) values in the popup itsef

I can't see what the issue is and seek some insight / workaround.  I was excited to use Arcade expressions in popups instead of field values especially to get coordinates of points since those values unlike Area and Length have to be added as static calculated field = not a good solution.  Being able to obtain those values with Arcade would be nice.


texts: Drawings not visible after removeLayer method : leaflet

texts:
Introduction

As i am working on application which uses leaflet api. Live Here
Where first user enter '1' as input to load the image on map.

Then user can draw different shapes(fences) using bottom-left buttons.
The 'eraser' button is suppose to remove all layers from map regarding CurrentFeatureGroup.

Problem

When we click on 'eraser' button, all shapes will be removed from map having currentfeaturegroup.
But after removing when we draw some other shapes, these shapes are invisible, although i have checked the function working properly.
I don't have idea how these shapes are now invisible.

Script(which responsible to remove layers)

L.easyButton('<img src="/delete.png">', function () {
                    map.removeLayer(currentFeatureGroup);
                    $('.leaflet-container').css('cursor', '');
                }).addTo(map);

  Please consider removeLayer, not clearLayer.


texts: Why the isochrone is changing its shape?

texts: I am doing some isochrones using the OSM route plugin in QGIS, but if I am keeping my working space open for a few of hours, the shape of the isochrones is changing. I guess that from the RecursiveGrid mode, turns into TIN mode without me changing any setting. Does somebody know what is the reason behind this?


texts: Addition of rasters using raster calculator

texts:
I have five classes of rivers as different rasters.

I want to add them all in a new raster file using raster calculator. When I do this, it creates 16 types of classes, while I am expecting seven.

.

When the classes are combined in the raster calculator, it creates a new class on the final raster file. I want to create a map with a legend that gives me only the seven classes of each raster file.

What am I doing wrong?


texts: Seeking Software for Stitching Aerial Photographs?

texts:
I am looking for software that is capable of stitching together large number of aerial photographs. The photos are taken with a high quality DSLR from a small helicopter, they cover about 100 meters, they have a small amount of overlap, they also have location data stored in the exif header, are about 7 mb in size, and there are usually around 30000 of them. I was just wondering if anyone had any suggestions.

So far I have tried:

Autopano Giga 3 - no good results yet just some weird stitches
Palentier (yes I know it doesn't really stitch the photos) - Hard to use as I am lacking the direction info, and height above ground info in my exif headers. The height above ground can be calculated by subtracting the ground elevation from the elevation stored in the photo exif but all photos must have the same subtraction value and the terrain height varies greatly.
Agisoft Photoscan - Doesn't like the large amount of images, but I am currently trying it with smaller batches.


texts: Merge poly.shp line.shp & point.shp to single TAB file

texts:
I am trying to use QGIS to avoid using commercial tools like Alteryx or FME to merge spatial files together.  However i cant seem to find any way of just joining different files together when the geom types are not the same.

The expected output will have a single GEOMETRY field and a combination of all the fields from the input files (with lots of blanks obviously).  Equivalent to a SQL UNIONALL really.

Can this be done in QGIS?


texts: Creating a list using an attribute query with arcpy.da.SearchCursor

texts:
I have a shapefile of a river network containing the following fields: toJunction, fromJunction, Int_DAM (which indicates free-flowing status) and Strahler. I'm trying to create a list of the rows where Int_DAM = 'Downstream' using arcpy.da.SearchCursor. I'm getting an error that says:

RuntimeError: A column was specified that does not exist.

Here is the code as I have it:

Sel_list = []
fc = r"C:\Data\Free_Flowing_Rivers_Results\NHN_Canada_Stream_Order_by_Basin_160412.gdb\Datasets\NHN_HN_PrimaryDirectedNLFlow_07_Stream_Order"

fields = ['fromJunction', 'toJunction', 'Int_DAM', 'Strahler']
where_clause = '"Int_DAM"' + "=" + 'Downstream'

with arcpy.da.SearchCursor(fc, (fields), where_clause) as cursor:
    for row in cursor:
        Sel_list.append(row)

print Sel_list

I've double checked the file and the fields are definitely present. I'm pretty new to Python so I'm sure I'm missing something.


texts: How to convert Rotated Polar grid raster to Non Rotated Polar Raster?

texts: I have a RCM data which is in rotated Polar system , I want it to convert into non-rotated polar RCM. How can i do this things ? Please give some guidance


texts: Extracting several string values by attribute in QGIS graphical model

texts:
I am trying to extract several features by attribute within QGIS 3.12 graphical modeler. The values to extract shall be given by an input and not beeing predefined.

Currently I am using a string-input, but other types would be possible as well (e.g. enum, if that one fits better).

If I would do it manually, it would work like this: "FieldContainingAttributes" in ('Value1','Value2','Value3'). But how could this work in graphical modeler?

I've been trying to turn my input string into an array, then the array back into a string with leading and ending singlequotes and separated by comma like this:

@fieldcontainingattributes in ('''' || array_to_string(string_to_array(@listcontainingvalues,';'),''',''')  || '''')

but without success. Even though the expression '''' || array_to_string(string_to_array(@listcontainingvalues,';'),''',''')  || '''' returns 'Value1','Value2',Value3'. Which should build up the correct expression just like using it manually as above. So it seems like it is not taking this indirect input.

Also array_contains(string_to_array(@listcontainingvalues,';'),@fieldcontainingattributes) does not work. But when not using @parameters and instead typing fields or arrays manually, it does.

After many hours of testing I'm getting the feeling that could be a weird bug due to very strange behavior of the modeler. Sometimes connection lines are not drawn, sometimes they are. Sometimes I am getting the correct output when only typing e.g. @fieldcontainingattributes in fieldcalculator, sometimes im just getting no output. Once I even could make a workaround using fieldcalculator inbetween working, but could not reproduce it afterwards... Sidequestion: Can someone confirm such weird things?

To provide a better context:


texts:
Suppose I have a n*n raster, and I want to create k square blocks (k can be divided exactly by n*n ) for zonal analysis:

for example, when n = 4 and k = 4
a 4*4 raster is create with value

1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4

How can I do this in R?


texts: Getting empty output with Erase tool in ArcGIS Desktop?

texts:
I'm looking to isolate the parts of two hexagon feature classes that overlap:

I thought that I could use the Overlay > Erase tool to do this. The "input feature" would be the first image, and the "erase feature" would be the second image.
When I run the tool, I get an empty feature class (and the error message "empty output generated").
Both of my feature classes have identical coordinate systems. I also ran the Check Geometry tool on both of them and it did not return any results. Why is this not returning the triangle of overlapping feature classes that I would expect?
I'm using ArcGIS Desktop 10.6.1 on Windows 10.


texts: Which is better for measuring actual ground elevation, NED or SRTM?

texts: I know that NED DEM layers are created using mainly Lidar point clouds and that the SRTM derives its data from shuttle-based radar. I have both of these loaded into QGIS and can see that over my study area of the Tampa metro area the two layers differ quite substantially in some areas. I have read that the SRTM will sometimes read the tops of ground features like forests as the ground elevation. This would hurt my research because I am only interested in actual ground elevation. My issue with the NED is that it sometime appears to have a measurement that is below what I would expect the elevation to be, especially around the coast. Is either one of these elevation layers a better source for finding actual surface elevation?


texts: Automating Line Creation with Multiple Points

texts:
I have a feature class that has over 1500 points in it. I then need to create line segments from these points based on an ID number. For example points 1-6 have the ID 1, points 7-12 ID 2 etc.
Each point has an easting, northing and elevation and PointID that I want to keep as attributes in the polyline file.
Here is how my point data is structured

And I want my output to look like this, although continues with the rest of the point information associated with each line.

I want to be able to automate this with python, but am unsure about how to structure the code because there can be anywhere from 3-6 points associated with each ID that need to make a line. I currently do this manually and would love to be able to create the code.


texts: How to remove thin lines and small points from qgis raster

texts:
I want to digitize the roads of a raster map to vector format using QGIS and GDAL preferably. By using the Raster Calculator I have been able to extract the roads and contour-lines from the raster to another raster by selecting pixels of the right color. The problem now is that I don't want the contour-lines, just the roads. The difference here is that the contour-lines are much thinner than the roads.

I have been trying to use Sieve and Proximity without much luck. I think I want something similar to Shrink in ArcGIS or maybe use different settings. Here is my start image which has gone through Raster calculation and a Proximity filter.


texts: Make shapefile from raster-bounds in Python

texts:
I have a raster that I opened with rasterio. When I do raster.bounds I get
BoundingBox(left=399960.0, bottom=-3309780.0, right=609780.0, top=-3099960.0).
My question is now, if there is any simple way to make a shapefile of it?


texts: How to single out country data from a world data map?

texts:
Say that i have two "data sources";

A global map of average wind speeds,
A shape file (or similar information) of all country borders in the world.

How do i combine these two sources and extract the average wind speeds of a country?

The wind speed data is structured such that each lat-lon combination has an average wind speed:

Lat, Lon, AvgSpeed
-90, -180, 4.54
-90, -179, 4.55
-90, -178, 4.57
...

The output should be somewhat similar to the input, but with "an extra column" for country:

Lat, Lon, AvgSpeed, Country
-90, -180, 4.54, Country 1
-90, -179, 4.55, Country 1
-90, -178, 4.57, Country 2
...

I have Grass GIS, R and Python installed - but your answer need not be restricted to these software packages/programming languages.


texts: How to download the entire ASTER GDEMv2 dataset?

texts:
In October 2011, NASA released the new ASTER GDEM global dataset (30m) and I have been wanting to get my hands on it. The only problem is that it takes forever to download and I do not feel like drawing tiny little boxes for the entire world.

Is there are any place I can download the whole thing from?


texts: Applying field calculator for multiple layers at once

texts:
Is there a way to apply field calculator for multiple layers at once?

For instance, I have 80 layers as the picture shown below. If I want to apply $area for all the layers, is there a quicker way to do it except manually creating 'area' field?

this is how it looks after applying recommendation using pyqgis


texts:
I am trying to dump a set of point/multipoint rows with this query:

   SELECT a.gid, a.nid, a.uid, a.cod_reg, postgis.st_dump(geom)
   FROM table a

but I get this error

  ERROR:  relation "geometry_dump" does not exist

PostgreSQL 9.6 running on Debian/Linux and
Postgis 2.3

Same query works on another server with PostgreSQL 9.2 running on Debian/Linux and Postgis 2.0

Any hint?


texts: Drag and Drop onto ArcGIS Runtime WPF Map

texts:
I'm looking for advice on implementing drag & drop onto the WPF map control. My goal is to drag from a list of items, and drop on the map to create a new graphic/feature at the drop location.

The map has Drop and PreviewDrop events, but neither provide the map/mouse coordinates of the drop event. Am I missing something in the events? Both have DragEventArgs as the parameter.

All I really need is the mouse's map position when the drop happens. With that in mind, I also tried to get mouse move events, but they don't seem to carry any position either, only MouseEventArgs.

Any ideas? Am I missing something obvious?

Thanks!

P.S. ArcGIS Runtime 10.1.1, but I can upgrade to 10.2 if there is something that will help.


texts: Creating QGIS processing algorithm that works asynchronously?

texts:
I am writing a QGIS processing algorithm that reads rows including addresses from a CSV file. The addresses are geocoded one by one via external REST API and then a vector layer containing the point features corresponding each row is created. The layer is saved to a file and possibly also opened in the QGIS.

I am using QGIS 3.0 but if someone knows how this should be handled in QGIS 2.x that would also be helpful. I am planning to use the PyQt5.QtNetwork module for the REST API calls.

Is it possible to do the REST API calls asynchronously and when they all have finished then finish the processing algorithm?

If not, what is the proper way to handle this kind of process?


texts: Vectors layers wont merge - integer instead of integer 64 error. Refactor fails to change

texts:
I am merging a few vector files (all polygone) but an error keeps popping up:

  POP1997 (my attribute data) field in layer area_houston.shp (the layer i made) has different data type then in other layers (Integer64 instead of Integer)

I am using QGIS 3.10.

I tried refactor fields to change Integer64 to Integer but when I save the file it is again in Integer64...

Please advise!


texts: QGIS 3.4 Modeler: Select a band of a raster layer for processing

texts:
As model input data I select a raster stack with three bands. The first processing tool just needs specific bands of this stack which I like to select in the input dialog.

I create a 'Raster Layer' input that lets me select the layer. Then, I also create a 'Raster Band' input that has the 'Raster Layer' input as parent. In the GUI that is displayed as a drop-down menu and I can choose between the bands.

However, the model always takes the first band of the raster layer, no matter which band I select. The processes following the layer/band selection are connected to the selection of the layer, because there is no possibility of selecting the bands (see screenshot):

How can I make the processing tools to use a specific band of a layer?


texts: Is there a way to enumerate every block/square in a given area?

texts:
I have a list of 300 points of interests within 500m radius from a given point.

I need to automatically put numbers in every block/square and then list in which block/square each point of interest is located in. The attached image is just an example.

Is there a way to do that automatically without resorting to manual interventions (e.g drawing the numbers one by one).

UPDATE: I managed to obtain the blocks by using OSM roads shape files and the poligonize feature in QGIS and model buider.


texts: How to create `Workspace` without using `IWorkspaceFactory.Create`?

texts:
Can I create a Workspace without using IWorkspaceFactory.Create

I am trying to create a Workspace without specifying it's parent directory, is that possible ?


texts:
How can one pass a variable into a Mapfile using MapServer with p.mapper
I would like to learn how generate maps dynamically  having different extent, layers, default settings, etc.. by varying a variable in just one Mapfile.

This variable could have different values, e.g.
depending from user&password login.


texts: Mapbox GL JS: Displaying polygons from different coordinate systems / projections

texts:
I'm new to GIS and have access to OS MasterMap Topography Layer data (UK).
I've got it loaded into PostGIS and am querying the polygons that I'm interested in (buildings). My understanding is the coordinates are using EPSG:27700 (OS national grid). I'm converting these to 4326 using ST_Transform when retrieving them from the database.
I'm plotting them on a map using MapBox GL JS, however there are consistently out of alignment with the buildings on the base map.

Initially when I saw this, I just assumed it was a small difference in datasets, especially as the shapes are different.
However, when I use the OS vector tiles instead of the default tiles form Mapbox (using 3857 for the tiles as suggested in the OS demo) which are based on the OS MasterMap Topography layer (the same dataset that I'm using for my polygons), everything is still misaligned - but the shapes are correct.

I'm assuming my mistake is somewhere in converting between the different standards.
I've tried passing 3857 to my call to ST_Transform, but then the polygons don't render at all.
Looking at the MapBox documentation, when it comes to plotting points / polygons on the map, they're expecting coordinates based on WGS84 (4326): https://docs.mapbox.com/mapbox-gl-js/api/geography/#lnglat
However, their documentation also states that they use EPSG:3857: https://docs.mapbox.com/help/glossary/projection/
Can anyone help with what I'm doing wrong / not understanding?


texts: QGIS: Distance Matrix tool omitting some points in output table. (qGIS 2.10.1-Pisa)


texts: Setting color from color value in attribute table in QGIS?

texts:
I have a shapefile with colors (hex code) in the attribute table for each polygon.
How can I set color of each polygon according to the color value in the attribute table?


texts: Creating polar-stereographic projection of HDF data subset?

texts:
I have an HDF4 file.  I would like to create a geotif file containing a polar-stereographic projection of one of the HDF4 data sets.  I've tried using gdalwarp.  This works for some projection types, but it seems to need additional information (s_srs?):

gdalwarp -overwrite -t_srs '+proj=stere +lat_0=90 +lat_ts=90.0 +lon_0=0.0 +k=1.0 +x_0=0.0 +y_0=0.0 +ellps=GRS80 +units=m' 'HDF4_EOS:EOS_GRID:"MOD10CM.A2017244.006.2017275033743.hdf":MOD_CMG_Snow_5km:Snow_Spatial_QA' MOD10CM.gdal.psg.lat_true_90.tif

Creating output file that is 5692P x 5692L.
Processing HDF4_EOS:EOS_GRID:"MOD10CM.A2017244.006.2017275033743.hdf":MOD_CMG_Snow_5km:Snow_Spatial_QA [1/1] : 0Using internal nodata values (e.g. 255) for image HDF4_EOS:EOS_GRID:"MOD10CM.A2017244.006.2017275033743.hdf":MOD_CMG_Snow_5km:Snow_Spatial_QA.
Copying nodata values from source HDF4_EOS:EOS_GRID:"MOD10CM.A2017244.006.2017275033743.hdf":MOD_CMG_Snow_5km:Snow_Spatial_QA to destination MOD10CM.gdal.psg.lat_true_90.tif.
ERROR 1: Too many points (441 out of 441) failed to transform, unable to compute output bounds.
Warning 1: Unable to compute source region for output window 0,0,5692,5692, skipping.
...10...20...30...40...50...60...70...80...90...100 - done.

The file that is produced is empty.


texts: Install gdal extention in GeoServer2.12.1

texts:
I am trying to install the GDAL extension.I need to use ecw files in GeoServer.I want to see more rasters formats display.I was trying to follow this guide http://docs.geoserver.org/latest/en/user/data/raster/gdal.html, but it's not really clear for me.....
I have completed this steps

1)Download the GDAL extension for this version and extracted to
C:\Program Files (x86)\GeoServer 2.12.1\webapps\geoserver\WEB-INF\lib

2)Download the GDAL 'CRS definitions' for your imageio-ext version
create 'GDAL_DATA' as environment variable and populate it
C:\Program Files (x86)\GeoServer 2.12.1\GDAL_DATA

3) Download the native libraries for windows populate it
C:\Program Files (x86)\GeoServer 2.12.1\gdal-1.9.2-MSVC2010-x64

After that i am confuse how i will do?


texts: Show the rule-based style in the attribute table?

texts:
I need this for a university project and have been trying everything I could without success...

I had this shapefile from our region (LAZIO) where I could easily get out of it area values and from the IDs I was able to isolate the different kind of soil usages with the rule based style editor.

Now I need to work with the table to extrapolate aggregate various area values and other data (plantation type and such...).  I was thinking to export the table directly to Excel but the main problem now is my final step, I can't find a way to show in the attribute table the name of the rule based style and I need this to sort which area is from which layer when I'll export that so I can make some graphs...

any help in how to show the style name/id in the attribute table?

If not possible this way, how can I achieve that?


texts: Export classified Landsat 7 image - Google Earth Engine

texts:
I am trying to export images of MODIS landcover classifications and classified Landsat 7 images.

However, my codes only result in black images rather than what I see if I add the layers to the Map.

How do I correctly export those images to drive?

My current code is:

// Use the MCD12 land-cover as training data.
var modisLandcover = ee.Image('MODIS/051/MCD12Q1/2011_01_01')
  .select('Land_Cover_Type_1');

// A pallete to use for visualizing landcover images.
var landcoverPalette = [
    'aec3d4', // water
    '152106', '225129', '369b47', '30eb5b', '387242', // forest
    '6a2325', 'c3aa69', 'b76031', 'd9903d', '91af40',  // shrub, grass, savanah
    '111149', // wetlands
    '8dc33b', // croplands
    'cc0013', // urban
    '6ca80d', // crop mosaic
    'd7cdcc', // snow and ice
    'f7e084', // barren
    '6f6f6f'  // tundra
];

// A set of visualization parameters using the landcover palette.
var landcoverVisualization = {palette: landcoverPalette, min: 0, max: 17, format: 'png'};
// Center over our region of interest.
Map.centerObject(geometry, 9);
// Draw the MODIS landcover image.
Map.addLayer(modisLandcover, landcoverVisualization, 'MODIS landcover');

// Load and filter Landsat data.
var l7 = ee.ImageCollection('LANDSAT/LE07/C01/T1')
    .filterBounds(geometry)
    .filterDate('2011-01-01', '2012-01-01')
    .sort('CLOUD_COVER', false);            //sort by cloud cover ('false' indivcates descending )

// Draw the Landsat composite, visualizing true color bands.
var landsatComposite = ee.Algorithms.Landsat.simpleComposite({
  collection: l7,
  asFloat: true
});
Map.addLayer(landsatComposite, {min: 0, max: 0.3, bands: ['B3','B2','B1']}, 'Landsat composite');

// Make a training dataset by sampling the stacked images.
var training = modisLandcover.addBands(landsatComposite).sample({
  region: geometry,
  scale: 30,
  numPixels: 1000,
  seed: 0
});

// Train a classifier using the training data. USING CART() classifier
//var classifier = ee.Classifier.cart().train({
var classifier = ee.Classifier.randomForest(100).train({
  features: training,
  classProperty: 'Land_Cover_Type_1',
});

// Apply the classifier to the original composite.
var upsampled = landsatComposite.classify(classifier);
// Draw the upsampled landcover image.
Map.addLayer(upsampled, landcoverVisualization, 'Classified Image');

///////////////////////////////
// EXPORT LANDCVER DATA AND CLASSIIED IMAGE

Export.image.toDrive({
  image: modisLandcover.select('Land_Cover_Type_1'),
  description: '2011_classifiedMODIS',
  folder: "Syria",
  scale: 30,
  region: geometry
  });

Export.image.toDrive({
  image: landsatComposite,
  description: '2011_classifiedL7',
  folder: "Syria",
  scale: 30,
  region: geometry
  });

Export.image.toDrive({
  image: upsampled.select("classification"),
  description: '2011_classified',
  folder: "Syria",
  scale: 30,
  region: geometry
  });

  Export.image.toAsset({
  image: landsatComposite,
  description: '2011_classifiedL7A',
  scale: 30,
  region: geometry
  })

  Export.image.toAsset({
  image: modisLandcover.select('Land_Cover_Type_1'),
  description: '2011_classifiedMODISA',
  scale: 30,
  region: geometry
  });


texts:
I have a shp layer with an attribute table.

One field has the name Nid and the values are strings (e.g. “0150”, “0420”, “3462” …)
Now I want to select the rows in the table that match a given Nid value.

This works:

  qry = ' "Nid" = \'0150\' '

  arcpy.management.SelectLayerByAttribute(layer, "NEW_SELECTION", qry)

But I am really confused by this:

I know \ is the escape character and used so that 0150 is between two quotes. But why is Nid surrounded by double quotes and not using also \’ ? Note: I tried using \’ Nid\’  and also “0150” but I get errors  … I also found examples using  [Nid] = \'0150\'' in the web, but that also did not work.

My problem is that I have the values I want to match in the AreaID variable, so AreaID[1]=’0150’ and I am unable to put this in my query:

  qry = ' "Nid" = \'AreaID[1]\' '  - does not select anything

  qry = ' "Nid" = AreaID[1]'      -  gives an error

  qry = ' "Nid" = "AreaID[1]" '      -  gives an error

  qry = ' "Nid" = \"AreaID[1]\" '      -  gives an error

How does this work?


texts:
ArcGIS Pro 2.4.0 (trial version), up to date.
Win 10, up to date.

I'm new to GIS. I thought my task would be simple as I only have two layers: a shp file with many thousands of census tracts along with each tract's population count; and a tiny shp file from a municipality with neighborhood borders. And a base map. All I want to do is impose the border of a single hood onto the nation-wide census data tracts so that the census tracts falling partially or fully within the selected hood are selected via Select by Location.

But only a small number of the relationship options return any selected polygon at all, and the result is either too broad or too narrow. The selecting relationships are...

Intersect: result as expected except the number of polygons switches between 14 and 17. Multiple tracts that partially or fully are within hood borders are selected, along with surrounding tracts that touch the hood border.

Within: Just one tract selected, the borders of which appear to fall completely within the hood (when you zoom in really close).

Completely Within: same as Within.

Crossed by the Outline of: Very similar to intersect although one less polygon selected, I don't know why.

Have Their Center In: as expected. All but one of the expected tracts is selected, and that one tract does have a center outside hood borders.

Also possibly relevant is that neither of these return a result: Identical / Border Touches.

In all cases "New Selection" was chosen. All other relationships fail to select at all. I have played around with the Search Distance option as well but those results don't make sense to me either.

I have tried to find answers but didn't come up with much. I confirmed that both layers are feature class and neither had a spatial index so I created those. Otherwise I am stumped.

Any suggestions?


texts: How can we use SQL to update feature class attributes in a versioned geodatabase in ArcGIS Workgroup

texts:
ArcGIS Workgroup Edition 9.3.1, MS SQL 2005 Express

I have some attribute data that I want to periodically update with information from another RDBMS using SQL UPDATE commands.  The data is versioned and we were planning on creating a "sql-updates" version just for this purpose, since others have said that doing this in the default version is not a good practice.  Is this possible and what would be the general or best method of doing it?

One possibility would be using these stored procedures:  set_current_version, edit_version (1 - start session), run my updates, and edit_version (2 - close session).  I don't know if this is the correct way, and if delta tables get entries used for reconcilliation with the other versions.  Note that "sdetable" is not available with Workgroup edition.

Another possibliity would be creating a separate table for this data, then joining the data with the feature class data, which would allow direct SQL updates to the separate table.


texts: Automatically extract contours from scanned map

texts:
I want to extract contour lines from a scanned map. I success to georeferance and I make line shapefile and try to extract contour line manually. But there are too many lines in the map.

I install OBT toolbax in qgis. but my image is just image. No data in there. How can I extract contour? Are there some method to trace some line which have specific color?


texts: How to get a multi-attributes vector from an SRTM raster in QGIS?

texts:
I split an SRTM raster into 3 different raster files representing the altitude, the slope and the exposure, using QGIS DEM analysis tools.

How can I output a single vector file with the 3 attributes reunited on the same object, being a point or a 1 hectare polygon ?


texts: How do I implement outbound arcobjects interfaces in C#?

texts:
I would like to write a class in C# that implements one or more outbound interfaces, for example ILayerEvents and IActiveViewEvents.

Does anyone know how to do this with C#?

Update
Following @Chaz's response, I have tried this out.

class MyCustomLayer : BaseCustomLayer, ILayerEvents_Event
{
    public override bool Visible
    {
        get { return base.Visible;}
        set
        {
            base.Visible = value;
            if (this.VisibilityChanged != null)
                this.VisibilityChanged(value);
        }
    }
    public override void Draw(esriDrawPhase drawPhase, IDisplay Display, ITrackCancel trackCancel)
    {
        //throw new NotImplementedException();
    }
    public event ILayerEvents_VisibilityChangedEventHandler VisibilityChanged;
}

I expected that when the map sees that a layer being added implements ILayerEvents_Event, that it would wire events accordingly.  However, when I add my custom layer to the map this doesn't happen.  I wrote a test command that toggles ILayer.Visible but the checkbox in the TOC doesn't change ... this.VisibilityChanged is always null, indicating that there are no subscribers.  Or maybe I'm wrong in assuming the TOC somehow subscribes to this interface?

protected override void OnClick()
{
    MyCustomLayer l = null;
    for (int i = 0; i < ArcMap.Document.FocusMap.LayerCount; i++)
    {
        var layer = ArcMap.Document.FocusMap.get_Layer(i);
        if (layer is MyCustomLayer)
            l = layer as MyCustomLayer;
    }
    if (l != null)
        l.Visible = !l.Visible;
    else
    {
        l = new MyCustomLayer() { Name = "a custom layer" };
        ArcMap.Document.FocusMap.AddLayer(l);
    }
}


texts:
I have lat and lng I convert this in UTM coordinate system, I would like to add x meter in this UTM system, what is the best way ?
For example I have this UTM system and I want to move this system 2 meters Noth-East direction:

[East] => 340337.35
 [North] => 5307320.905
 [UTMZone] => 32T


texts: Deleting some observations in near table?

texts:
I created some near tables, with a max near distance of 8000m. It is extremely timely exporting these files to csv right now.

Is there a quick way in ArcGIS to delete observations that have a distance of more than 250m?


texts: How to use gdalwarp with negative and positive longitude?

texts:
I have a georeferenced image of Earth above the Pacific Ocean. Gdalinfo give me this :
 NC_GLOBAL#geospatial_lat_max=81.328201
 NC_GLOBAL#geospatial_lat_min=-81.328201
 NC_GLOBAL#geospatial_lon_max=-55.7005
 NC_GLOBAL#geospatial_lon_min=141.7005

Problem is lon_min > lon_max so I don't know how I can use the -te gdalwarp's option on an area with for example lon_min = 160 and lon_max = -120. I tried to exchange position in command line and I also tried to transform the 160° in -200° but it doesn't work.
gdalwarp -t_srs EPSG:4326 -te 160 -10 -120 10 sphere.tiff plani.tiff

Creating output file that is -5491P x 392L.
ERROR 1: Attempt to create -5491x392 dataset is illegal,sizes must be larger than zero.

I tried to transform my 160°E in 200°W and I get a picture cut at 180°W.
gdalwarp -t_srs EPSG:4326 -te -200 -10 -120 10 sphere.tiff plani.tiff

Finally I simply tried to exchange the -120 and 160 in command line but I obtain a weird image.
gdalwarp -t_srs EPSG:4326 -te -120 -10 160 10 sphere.tiff plani.tiff

Does anyone know how to get an image with these coordinates ?
Thanks,


texts: No Data in raster while Mosaic using ArcGIS

texts:
i have several tif files, which some of them have No data values.

when Mosaic  these files the ArcGIS replace the NoData value with black color RGB(0,0,0).

I want to keep the No data value in the Mosaiced result file

any Idea?


texts: Creating the minimum convex hull that contains certain percentage of points in QGIS

texts:
I'm working with QGIS 3.16 Hannover. I've got a point layer (shapefile) with 3,000 features and I want to create the smallest convex hull that contains 90% of those points. Well, ideally, I would like to obtain an onion peeling set of minimum-area polygons, containing an ascending percentage of points of the layer.
Is it possible to do so?


texts: Avoiding artefacts by pixel filtering in a raster

texts:
I have a DEM with a spatial resolution of 2 meters with a lot of areas with no data. I want to fill those gaps in order to use the whole DEM. I used the 'close gaps' tool in QGIS (it's a SAGA tool) after resampling (because I don't need a 2 meters resolution). I tried the various methods to close gaps that the software offers but I always have the same result.

For every image I get, I have some artefacts appearing (see image below in the red circle). I know that those artefacts are due to sparse pixels.

Picture number 1 is my raw DEM, number 2 is after resampling and closing gaps and number 3 is the same with after hillshading. The artefacts look like volcanoes.

My question is, do you know any filter that could remove those small pixels or if there is any way that I get a DEM without the artefacts ? So far I didn't get anything with the filters that I used ('Gaussian filter', 'Remove small pixel clumps'...).

Edit

Here is my data :
class       : RasterLayer
dimensions  : 7740, 7228, 55944720  (nrow, ncol, ncell)
resolution  : 2, 2  (x, y)
extent      : 312798, 327254, 5072488, 5087968  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : C:\Users\charlie.serrano\Desktop\Cartographie_risques\MNT_Alpes\Test\mnt_test.tif
names       : mnt_test
values      : 582.6512, 3323.351  (min, max)
No data values : nan

I have no error messages, the filter works to the end but nothing has been filtered.

My workflow is quite simple I load the raster into QGIS and then apply directly the filter on it before resempling it.

My aim is to fill the blank areas with data without big artefacts.


texts: Divide polygon based on points for even distribution

texts: If I have a point layer, how can I create a polygon that includes all of the points and divide that polygon into n sections in which each section contains an equal number of points? Preferably in QGIS, but other systems are acceptable.


texts:
I am using the Extract by Mask tool in ArcGIS. The tool is extracting all the cell that intersect the masking layer. Is there a process to mask only the cells that fall completely within the making layer ! That means cells which have some-part outside the masking layer should be excluded.
As per request by Hornbydd I have added this image. It looks like cells with approximately 50% or more overlap with the masking layer are selected in the process.


texts: Filter and display an ArcGIS ImageServer service by an attribute in an Desktop Addin

texts:
What I am trying to achieve is to either filter an existing ArcGIS imageserver service, or get the results of a query and display them. The reason I want to do this is that I have a huge mosaic dataset and I want to display individual Map-Sheets (cause sometimes they even overlap).

By using this code I manage to connect to the service, query the desired image and get its attributes.

      IImageServer3 imageServer3 = (IImageServer3)GetImageServer("http://xxx.xxx.x.xxx:6080/arcgis/services", "ServiceFolder/Sample Service", false);

                IQueryFilter attFilter = new ImageQueryFilterClass();
                attFilter.WhereClause = "Name = '0212043980'";

                int count = imageServer3.GetCatalogItemCount(attFilter);
                MessageBox.Show(count.ToString());

With this I download the desired image and then I add it as a layer.

       var fff = imageServer3.GetCatalogItemIDs(attFilter);
                System.Net.WebClient webClient = new System.Net.WebClient();

            IImageServerDownloadResults isDownloadResults = imageServer3.Download(fff,
                null, null);

            IImageServerDownloadResult isDownloadResult;
            string url, fileName;
            for (int i = 0; i < isDownloadResults.Count; i++)
            {
                isDownloadResult = isDownloadResults.get_Element(i);
                url = imageServer3.GetFile(isDownloadResult);
                fileName = "c:\\temp\\" + url.Substring(url.LastIndexOf("/") + 1);
                webClient.DownloadFile(url, fileName);
            }

But the thing is that I do not want to download the image (because most of the time the images are huge) I just want to display that single image it as a service.

I've done this in the past using the JavaScript web API, but I can't really understand if there is a way to do it on a desktop addin or not.

the reason I am doing this is that I want to create a custom user friendly search engine for a huge mosaic dataset


texts: Is there a way to write single bands raster from multi-band layer faster in r?

texts:
I have 1000 multi-layer rasters and have to export each separate layer to a tif.

Some friends recommended R to do the job. I used the following code:

library(raster)

namesVector<- c("layer1", "layer2", etc) #contain layer names

stack <- stack("multiLayerRaster.tif") #20 layers, total 2 GB

s <- unstack(stack)

for(i in seq_along(s)){writeRaster(s[[i]], file=namesVector[i])}

The code works fine, but it is very slow, it takes about 20 min to export layers from one multiLayerRaster.

Is there anyway to make the process faster?

Any advice is highly welcomed!


texts: Setting copyright of ArcGIS Server map service via ArcGIS REST API?

texts:
Knows someone a possibility to set the copyright of an ArcGIS Server Mapservice via REST API?

Didn't found a property in the JSON but in ArcGIS Server Manager you can change the value.

Also I found How To: Modify the copyright text of a hosted feature service in ArcGIS Online for doing that in ArcGIS Online so I couldn't believe that it is impossible for ArcGIS Server.


texts: Parameters for osm2po web service to route for walking

texts:
I have started the osm2po web service using the jar file. In the configuration file, I could see different parameters related to walking but not sure what each one does.

I am trying to call the web service through Python program and parse the response to get relevant data. So, far I was able to retrieve route between source and target. But I want to hit the web service and change the parameters to walking.

My URL looks like this,

http://localhost:8888/Osm2poService?cmd=fr&source=40.6413,-73.7781&target=40.7589,-73.9851&format=geojson

I have gone through the examples given in osm2po.de website where example URL is for points which can be reached with given time by a car

?cmd=fx&source=53.5,10.0&findShortestPath=false&maxCost=0.2&format=geojson


texts: Creating three polygons from two overlapping polygons in QGIS

texts:
I have a set of polygons, several of which overlap. I want to process them so that (in the simplest case) two overlapping polygons become three non-overlapping polygons.

I can split up the polygons using the the Intersection tool, but this leaves me with the two original (and still overlapping) polygons, plus two new polygons corresponding to the overlap of each of the originals.

It feels like this should be a common enough task that there would be a built-in tool for it, but if so I can't find it.


texts: What's the lat/long coordinates in atmcorr.gsfc.nasa.gov?

texts:
I want to get Atmospheric Correction Parameter Calculator using https://atmcorr.gsfc.nasa.gov/. in this site request latitude and longitude coordinates.
My question is what are these coordinates? Coordinates of weather station or mean of 4 coordinates corners Landsat image.


texts: How do I obtain the shape at a specific coordinate using NTS

texts:
I'm using the .NET NTS library and have the code together to load a KML file.  This gives me an instance of IGeometry.

Along with this data being loaded, I also have coordinates that I'd like to look up against it to see what shapes are at that point (usually will only be one).  After getting the shape(s), the KML I have also includes some additional feature information which I'd then like to be able to get the values from.

My understanding of these APIs is somewhat limited and I haven't been able to find any comprehensive examples of what I need to do once I have the data loaded.

var kml = await stream.ReadToEndAsync();
var reader = new GMLReader();

geometry = reader.Read(kml);

// ...now what?


texts: Points group automatically when adding delimited text layer

texts:
I'm using QGIS 3.10. I am working with an Excel table with records having coordinates. I'm adding a delimited text layer, that is shown as points. However, records with the same coordinates are shown as a single point instead of several ones. Is there a way to separate them?

In the image, the selected point has 3 records for the same locality (LOCALIDADE at the right panel).

I tried to use Point Cluster and Point Displacement, but these two are not what I was expecting... the first one shows how many points are overlapping, while the other one I didn't quite understood. But what would work for me was if instead of one point, it was three points, one overlapping the other, so one could easily see that there is three records at the same locality.


texts: How to load specific PostGIS features from a given table into QGIS?

texts:
I have a table in my database built like this:

contour_id / (INT) project_id / (INT) contour_lvl / (INT) contour_geom (MultiLineString Geom)

Each row in this table is a contour feature associated with a project.

How can I load into QGIS a specific set of features from this table (ex: using only project_id = 10 ?

It looks like I can only import the whole table, which is not useful for me.


texts: Convert shapefile into DXF file including Hebrew labels in QGIS 2.18

texts:
I try to convert this polygon shapefile into DXF including Hebrew labels (this is the QGIS screenshot):

The data source encoding is UTF8

I opened the dxf file in AutoCad - but there no features in the CAD file.

When export the shapefile in this way:

I don't understand what is my mistake.


texts: Wrong pixel sums within buffers in Esri ArcGIS 10.0

texts:
I have a raster of Zambia, 100m² resolution (about 650mb). Buffers (single) at 1,2,3,4,5,10,15,20,25,30,50 km.

I'm running "zonal statistics as table" in the model builder for all buffers (actually, the buffers are run in the model builder as well). How do I know the sums are wrong? Some of the larger buffers have smaller pixel sums than the smaller buffers. I've cut down the dataset so that there are about 150 points to buffer. I've run the problematic points/buffers individually and they returned identical results.
This might be related or suggest where the problem is coming from: When I tried to clip the buffers to the country outline (most of the problematic buffers are around the edges or where the points are in close proximity to each other). I get a Invalid Topology [Topoengine error.] message. How can I resolve this?


texts: Filter GeoJSON by attribute in Leaflet using a button

texts:
I have a GeoJSON point layer group styled as a circle marker; it has a color attribute which can be one of many values: white, black, blue, red etc.

I want to create a filter based on that attribute, so I created a Bootstrap button with a Dropdown for a selection of four attributes.

I tried the built-in filter as pointed in this question,

var redcolor = L.geoJson(colors, {filter: redFilter})

function redFilter(feature) {
  if (feature.properties.hue === "red") return true
}

and assigning it to its respective button using jQuery:

$("#red").click(function(event) {
    event.preventDefault();
    if(map.hasLayer(redcolor)) {
        $(this).removeClass('selected');
        map.removeLayer(redcolor);
    } else {
        map.addLayer(redcolor);
        $(this).addClass('selected');
   }
})

but I don't want to create a separate layer group; the filtering should happen in the original one.


texts:
Is it possible to download all tiles at all available zoom levels for an entire large city from Google Satellite view layer and if so how to do that through use of available open source software? I want to download all such tiles and serve them from my own geoserver and for offline viewing and testing.

This is for internal use and testing and not for publishing over the wider internet.


texts:
Using arcgis 4.2 trying to load a custom fillrenderer fails to produce any results on my map, if I try to load the layer straight from the service it will load but setting my own renderer fails to yield any results.

var statesRenderer = new SimpleFillSymbol({
                                            color: [ 51,51, 204, 0.9 ],
                                            style: "solid",
                                            outline: {                                                 color: "white",
                                                    width: 1
                                                  }
                                                });
         var resultsLabelLayer = new MapImageLayer({
                  url: url,
                   sublayers: [{
                                id: 1,
                                visible: true,
                                renderer: statesRenderer
                              }]
           });


texts: Using QgsVectorLayerProperties and associated classes in my own application

texts: I recently switched from QGIS version 2.6 to 2.14.3.  I was using the QgsVectorLayerProperties widget in my own application as it had extensive features implemented already.  Somewhere along the line though it looks like it was tied to QgisApp through use of QgisApp::instance in several of the app library widgets.  Is there an easy way to work around this or will I have to re implement all the widgets that call QgisApp::instance and pass them the map canvas?


texts: Why does QGIS 3.2 "native:extractvertices" algorithm not work properly in standalone script?

texts:
I execute standalone python code (almost identical to the code in the accepted answer):

The output file does not contain data, and I get this error message:

Warning 6: Normalized/laundered field name: 'vertex_index' to 'vertex_ind'
Warning 6: Normalized/laundered field name: 'vertex_part' to 'vertex_par'
Warning 6: Normalized/laundered field name: 'vertex_part_index' to 'vertex_p_1'

Process finished with exit code -1073741819 (0xC0000005)

Field name limitation is known shapefile issue, but why output file is empty and why I get exit code -1073741819 (0xC0000005)?

Here is input and output shapefiles:

________

What can cause this problem?

Here is the code:

import sys

from qgis.core import (
     QgsApplication,
     QgsProcessingFeedback,
     QgsVectorLayer
)
from qgis.analysis import QgsNativeAlgorithms

QgsApplication.setPrefixPath(r'C:\OSGeo4W64\apps\qgis', True)
qgs = QgsApplication([], False)
qgs.initQgis()

sys.path.append(r'C:\OSGeo4W64\apps\qgis\python\plugins')

import processing
from processing.core.Processing import Processing
Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

layer = QgsVectorLayer(r"G:\test\input.shp", 'my layer', 'ogr')
output = r"G:\test\output.shp"
params = {
    'INPUT': layer,
    'OUTPUT': output,
}
feedback = QgsProcessingFeedback()
res = processing.run("native:extractvertices", params, feedback=feedback)
print(res)


texts: Including several impedance in VRP solve with ArcPy?

texts:
Let's say the travel time as impedance is various in two directions of a two-way link "FT" and "TF", and also it varies by time-of-day. How can I introduce multiple impedance for solving a dynamic vehicle routing problem in Arcpy.

As I see, I can give a list separated by semicolon as accumulators, but they are not entered in analysis, and just are calculated as the properties of solved route.


texts:
I cliped images based on gdalwarp in cmd, the code is as following:

gdalwarp -q -cutline G:\2016.06.MOD\MOD02\5Clip\Clip_Image_Shp\Clip_Image.shp -tr 1000.0 1000.0 -of GTiff G:\2016.06.MOD\MOD02\3Resample_1000m_ProjectionC\20160628_1905_reflectance_georef_Resample_ProjectionC.tif G:\2016.06.MOD\MOD02\5Clip\20160628_1905_Clip.tif -crop_to_cutline

Now, I want to clip images based on gdalwarp in Spyder, but I don't know how to change the code in Spyder? Could you give me some advice?


texts: Quickly review all the features one by one in QGIS

texts:
I have about 400 features in a point dataset. I would like to (quickly) visually check their locations one by one on the map. For now, I open the attribute table alongside the map. I select the first row and use the Zoom to selected feature button. Then I manually select the 2nd row, and click the button again, and so on, and so on.
I was however wondering if there is a way/plugin/shortcut key/... to do that quicker in QGIS?


texts:
How do I calculate areas of an area shapefile in square meters (m²) or in acres (ha)?
I didn't find that functionality in the Vector Tools.


texts: How do you change the data type of a column for a synced table?

texts:
A synced table I setup against the 311 dataset at data.cityofnewyork.us works great!

However, the date columns come over as string, preventing me from doing date functions in queries, and from using the date columns in a Torque visualization.

I successfully issued an ALTER TABLE command to change the data type to date, but when the table is synced against source, the date columns revert back to string.