texts:
I am monitoring performance of one of our SOC machines. Attached below are the stats that I am getting. it does say request are succeded but I am not sure that it is entirely true. It must take at least sometime. I am looking for some help on how to interpret these results.

Are there any ESRI resources that describe what these numbers mean.

Thanks
jay

Service Usage Time:
    Total number of requests:    1
    Number of requests succeeded:    1
    Number of requests timed out:    0
    Avg usage time:   11.955999 Seconds
    Min usage time:   11.955999 Seconds
    Max usage time:   11.955999 Seconds
    Sum usage time:   11.955999 Seconds

Service Wait Time:
    Total number of requests:    1
    Number of requests succeeded:    1
    Number of requests failed:    0
    Number of requests timed out:    0
    Avg wait time:   0.000000 Seconds
    Min wait time:   0.000000 Seconds
    Max wait time:   0.000000 Seconds
    Sum wait time:   0.000000 Seconds

Service Creation Time:
    Total number of requests:    0
    Number of requests succeeded:    0
    Number of requests failed:    0
    Avg creation time:   0.000000 Seconds
    Min creation time:   0.000000 Seconds
    Max creation time:   0.000000 Seconds
    Sum creation time:   0.000000 Seconds


texts: How to automatically reload a layer every 30 seconds?

texts: I need to 'triggerRepaint()' a rasterLayer every 30 seconds, it's possible do it in QGIS? perhaps, a background process ui in python? create a watcher in python like QFileSystemWatcher


texts: Does ArcMap 10.2.1 no longer listen for DELETE key?

texts: We've noticed that in ArcMap 9.3 we could select a feature on the map (while editing of course) and just press the delete key on the keyboard to delete the feature.  ArcMap 10.2.1 does nothing when you press delete.  If we click the delete button (the X button on the toolbar) it will delete just fine.  Did ESRI take away the keyboard event listener?  Is there an option we aren't seeing?


texts: Displaying all features of datapoint QGIS

texts: I've got a SHP file with 6000 features and I would like to click on each point on the map and know what the features are for that specific point. It is a lizard database and doing this would tell me all species found at each particular location.


texts: Finding matching field values between two layers in QGIS?

texts: I have two attribute tables, 1 from a shapefile layer (left) and 1 from a csv layer (right). I would like to find values in the first column ("KEY" column in shapefile layer) that appears in the second column ("KEY_ID" column in the csv table layer). I will likely have them selected and exported as a separate csv file, containing only those IDs that appear in both columns.


texts: Displaying names of small streets in Mapbox Studio

texts:
I'm creating a custom map of the town I live in. It's intended to be used in static form (print/static imagery). The emphasis is on the visibility of street names and house numbers. The latter has been a non-issue throughout. The former...

There are some very small streets in the town. Frustratingly, no matter what settings I use, they only appear when the zoom level is way too high. If I scale that down then to, say, a block per A4 page, the street names will be too small. If I increase the font size, I'm forced to zoom even more for the names to appear, and that becomes a cycle.

There is actually room to fit those labels on those streets (sometimes when I zoom in just a little bit more, two identical labels appear at the same time -- and they fit). Is there a way to enforce that all street names are visible on the map? If not, which settings are my best bet?

If somebody knows of a Mapbox style I can download that fits my purpose, I'm all ears as well.


texts:
I have code that retrieve images from Landsat 5 , calculate NDVI , display the rasters and export it to my drive, giving names to th  rasters according to their ordinal number.
My problem is that I want the images to get their names according to the date. until now I did it manually but it takes time and also worried me because it seems like it retrieve the images not on chronologically order.
I thought that the solution should be creating a list from the dates but I am not sure how to do it.

this is my code-

/**
* Function to mask clouds based on the pixel_qa band of Landsat SR data.
* @param {ee.Image} image Input Landsat SR image
* @return {ee.Image} Cloudmasked Landsat image
*/
var cloudMaskL457 = function(image) {
  var qa = image.select('pixel_qa');
  // If the cloud bit (5) is set and the cloud confidence (7) is high
  // or the cloud shadow bit is set (3), then it's a bad pixel.
  var cloud = qa.bitwiseAnd(1 << 5)
                  .and(qa.bitwiseAnd(1 << 7))
                  .or(qa.bitwiseAnd(1 << 3));
  // Remove edge pixels that don't occur in all bands
  var mask2 = image.mask().reduce(ee.Reducer.min());
  return image.updateMask(cloud.not()).updateMask(mask2);
};

var dataset = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
                  .filterDate('1986-01-01', '2011-12-31')
                  .filterBounds(geometry)
                  .map(cloudMaskL457);

var visParams = {
  bands: ['B3', 'B2', 'B1'],
  min: 0,
  max: 3000,
  gamma: 1.4,
};
Map.centerObject(geometry,10);

// Get the number of images.
var count = dataset.size();
print('Count: ',count);
//print(clippedCol);
print(dataset,'dataset');

//clip the dataset according to the geometry
var clippedCol=dataset.map(function(im){
  return im.clip(geometry);
});

var listOfImages =(clippedCol.toList(clippedCol.size()));
// var Image1=ee.Image(listOfImages.get(0));
// var Image2=ee.Image(listOfImages.get(1));
// var Image3=ee.Image(listOfImages.get(2));
// var Image4=ee.Image(listOfImages.get(3));
// var Image5=ee.Image(listOfImages.get(5));
// var Image6=ee.Image(listOfImages.get(15));
// var Image7=ee.Image(listOfImages.get(19));
// Map.addLayer(Image1,visParams,'1');
// Map.addLayer(Image2,visParams,'2');
// Map.addLayer(Image3,visParams,'3');
// Map.addLayer(Image4,visParams,'4');
// Map.addLayer(Image5,visParams,'5');
// Map.addLayer(Image6,visParams,'6');
// Map.addLayer(Image7,visParams,'7');

//function to calculate NDVI in LANDSAT4
var addNDVI = function(image) {
  var NDVI = image.normalizedDifference(['B4', 'B3'])
  .rename('NDVI')
  .copyProperties(image,['system:time_start']);
  return image.addBands(NDVI);

};

//NDWI to the clipped image collection
var withNDVI = clippedCol.map(addNDVI).select('NDVI');

var NDVIcolor = {
  min: 0,
  max:1,
  palette: ['FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'],
};

var listOfImages =(withNDVI.toList(withNDVI.size()));

print(ui.Chart.image.series(withNDVI, geometry, ee.Reducer.mean(), 30));
print(ui.Chart.image.series(withNDVI, geometry, ee.Reducer.max(), 30));
print(ui.Chart.image.series(withNDVI, geometry, ee.Reducer.min(), 30));

var listOfNumbers = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27];

for (var i in listOfNumbers) {
  var image = ee.Image(listOfImages.get(listOfNumbers[i]));
  var toexport=image.visualize(NDVIcolor).addBands(image);

  // display and export
  Map.addLayer(image, NDVIcolor, i);
  Export.image.toDrive({
  image: toexport.toFloat(),
  description: i,
  scale:30,
  crs:'EPSG:4326',
  maxPixels:1310361348,
  region:geometry.geometry().bounds()

});

 }

My end goal is to:
1. understand why is the order not chronical
2. give each image name based on the acquisition date


texts: How to create a GeoDataFrame points grid from a numpy.mgrid?


texts: Draw d3 svg circles on openlayers 3 maps

texts:
I am new to openlayers and d3. I tried following example
http://openlayers.org/en/master/examples/d3.html

I see we need to add d3 features on a canvas and project it on an openlayers Vector layer. Issue is that I only have a csv of latitude and longitude so I really can't figure out how to create features out of that.

I tried something like the below, but could not make it render as a feature.

var svg = d3.select("#emap").insert("svg:svg")
             .attr("width", width).attr("height", height);

I am using D3 because data points are huge(about a million) and I need to show different density points at different zoom levels.


texts:
I recently started using Qgis python console for Qgis development. My first task is to load the layer and print its attributes.I firstly load a point layer using code

mylr = QgsVectorLayer("/home/ali/Python Work/work for centerline/","pnt.shp", "ogr")
iter = mylr.getFeatures()
for feature in iter:

geom = feature.geometry()
print "Feature ID %d: " % feature.id()

if geom.type() == QGis.Point:
    x = geom.asPoint()
    print "Point: " + str(x)
elif geom.type() == QGis.Line:
    x = geom.asPolyline()
    print "Line: %d points" % len(x)
elif geom.type() == QGis.Polygon:
    x = geom.asPolygon()
    numPts = 0
    for ring in x:
    numPts += len(ring)
    print "Polygon: %d rings with %d points" % (len(x), numPts)
else:
    print "Unknown"

attrs = feature.attributes()
print attrs

it printed the attributes of the layer pnt.shp.Then i changed the layer name

mylr = QgsVectorLayer("/home/ali/Python Work/work for centerline/","pgon.shp", "ogr")

all the following code was same.When i run the script it printed the attributes of the layer i loaded before pnt.shp.
Every time i run my script it always print the attributes of pnt.shp and do not load the current layer
Even if i change the veriables it always print the same layer attributes
Please help me to solve this problem


texts:
I have two files (.xyz) with point data from a terrain. I'd like to create contour lines of said terrain but in a smaller area (limited by a polygon). After importing the points in two layers, I merge them into one layer. Without any problems I'm now able to create contour lines using the contour plugin (version 2.0.8.).
But as mentioned before, I only want the contour lines in a specific area (also because of the file size). So I'm using the clipping tool provided by QGIS (vector-geoprocessing-clip) with the point layer as input and the polygon layer as overlay layer. That gives me a layer only with the points from that specific area. When I try to process the clipped layer I get the following error message:

Warning: Invalid geometry type for contouring - must be point
geometry.

Is anyone experiencing the same problem? I know that this problem didn't pop up with older versions, as i was able process the exact same data with the exact same procedure without any problems. I'm using the following version of QGIS:

I'm fully aware that there are multiple workarounds available such ase "select by location". But working with big data I find it easier to have the selected area directly saved into a file.


texts: QGIS to .DXF export: labels do not appear

texts:
I have been trying to export a shp layer in QGIS 2.18 to dxf with some labels using the export to DXF tool included in QGIS, but somehow, the labels won't appear on the export. I have tried changing font, symbology mode, symbology scale, encoding, etc. but still haven't found what is wrong!

I have run out of ideas, is there some option I may have forgotten or a parameter I need to activate?


texts: Custom Google Maps Drawing manager icons for all drawing tools, is it possible?

texts:
I've checked previously asked question, but it had no info.
I want to know if it is possible to change the icon(SVG file) for circle, polygon, rectangle, hand and Marker.
If yes, then how?


texts: Unable to replace a data source using lyr.replaceDataSource using variables

texts:
What I'm trying to do is collect two .csv links and two layer identifications from the user, geocode the addresses in the .csv, and then change the data source on the identified layer in an open map to the geocoded results.  The geocoding works fine, but replacing the data source doesn't work.  It results in no error messages either, so I am having great difficulty tracking down the problem.

Here is a snippet of code:

mapdoc = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mapdoc, "")[0]
lyrlist = arcpy.mapping.ListLayers(mapdoc, "*", df)
for lyr in lyrlist:
    if lyr.supports("DATASOURCE"):
        if lyr.dataSource == cup_lyr_file:
            lyr.replaceDataSource(where_to_save, "SHAPEFILE_WORKSPACE", cup_bname, "")
        elif lyr.dataSource == reg_lyr_file:
            lyr.replaceDataSource(where_to_save, "SHAPEFILE_WORKSPACE", reg_bname, "")

where_to_save is the workspace collected from the user as to where the geocoded files should be saved.  cup_bname and reg_bname are the baseNames of the geocoded shapefiles.

I am just now learning Python.  With no feedback at all from the program, I'm lost as to what could be wrong.


texts: QGIS CRS for small island based on transformation with large rotations and tm-projection

texts:
I am trying to create a CRS for QGIS based on a GPSsurvey and the related transformation and rotation parameters. Within OSGEO I defined a transformation and projection as follows:

cct +proj=pipeline +step +proj=cart +ellps=WGS84 +step +proj=helmert +convention=coordinate_frame +x=194.245 +y=-154.53 +z=102.676 +rx=351.5046 +ry=-701.841 +rz=251.9889 +s=6.296557 +exact +step +proj=cart +inv +ellps=intl +step +proj=tmerc +units=m +lat_0=17.63621319 +lon_0=-63.23752013 +x_0=4714.87 +y_0=1967.19 +k_0=1.0

If I import this string in QGIS in an adapted CRS, I get the proper transformation with test coordinates (N: 17.61578594 ° E: -63.25156367°) result in the proper local coordinate x=3215.43 m and y= -287.55 m)

However if a try to safe this CRS, QGIS replies that prof4 definition is not valid.

How should I proceed?


texts: add a feature in openlayers using lonlat from geolocation

texts:
I'm trying to add a feature in a openlayer's vector layer using the lonlat that came from the HTML5's geolocation API.

Combining tutorials for the geolocation and this demo I created the following code

<input type="button" value="Where Am I" onClick="loadDemo();" />

//this is outside the init() openlayers function. If i put it inside init(), will not work at all
function loadDemo() {
if(navigator.geolocation) {
document.getElementById("support").innerHTML = "I'll find you!";
navigator.geolocation.getCurrentPosition(updateLocation, handleLocationError, {timeout:100000});
} else {
document.getElementById("support").innerHTML = "Browser is so old";
}}

function updateLocation(position) {
var latitudeg = position.coords.latitude;
var longitudeg = position.coords.longitude;
var accuracy = position.coords.accuracy;
document.getElementById("latitude").innerHTML = latitudeg;//works
document.getElementById("longitude").innerHTML = longitudeg;//works
document.getElementById("accuracy").innerHTML = "This location is accurate within " +accuracy + " meters."//works
var lonLat = new OpenLayers.LonLat(longitudeg,latitudeg).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));//works
alert(lonLat);//works
var pointg = new OpenLayers.Geometry.Point(lonLat);
var feature_point_g = new OpenLayers.Feature.Vector(pointg);
alert(pointg.lat);//not working, returns undifined
alert(feature_point_g);//not working, returns [object Object]
pins.addFeatures([feature_point_g]);//not working
pins.refresh({force:true});//not working
}

As you can see, problem is , there is something wrong with creating the point and the feature. Honestly, I searched and checked and can't solve this. Can you see something I don't?

Thanks


texts:
I have two lists of raster (digital elevation model - DEM) layers by name. The first list of layers should be symbolized as follows:
symbology should be set to hillshade
layer rendering, blend mode should be set to soft light

and transparency, global opacity should be set to 30%

The second list of layers should be symbolized as follows:
symbology should be set to singleband pseudocolor
mode should be set to equal interval
and classes should be set to 5

Is there a way to apply all of these settings with PyQGIS code, since I need to set them manually every single time? I tried to do it myself but this task far surpasses my level of knowledge in PyQGIS.


texts:
I need help using the leaflet plugin geojson-vt. According to tutorials, like this one on http://bl.ocks.org/Sumbera/c67e5551b21c68dc8299, there should be a js file called geojson-vt-dev.js. When I download the zipfile from GitHub I get 6 different js files in the src folder: clip.js, convert.js, index.js, simplify.js, tile.js, wrap.js.

Can anyone help me figure out what I am doing wrong?

This page; http://www.paulcflynn.com/projection_picker.html is ultimately what I am trying to speed by using vector tiles. Loading the GeoJSONs straight in leaflet was fine, but now I need to add more vector files, which reduce performance significantly.


texts: Colour Gradient as background colour in textbox for map in QGIS

texts: I'm trying to make a map in QGIS which of course contains the title of the map within a textbox. As background colourscheme for this textbox, I want to use two colors with one color beginning at the far left side of the textbox and then gradually morphing into the other which will be located at the far right. Is this possible in QGIS?


texts: Making UPDATE for coordinate does not return the same value

texts:
Being totally new with PostGIS, I am trying to UPDATE one of my column on my table.

The column itself is called 'center_point' with type of GEOGRAPHY(Point,4326)

UPDATE cities
SET center_point = st_setsrid(st_makepoint(-6.28381815,106.804863491948),4326) WHERE id = 1;

Upon verifying the result:

SELECT id, st_asgeojson(shape) AS "geojson", st_asgeojson(center_point)
FROM cities WHERE id = 1;

I am getting a different output:

It says that the coordinate is -6.283... , 73.1951...
Where i am expecting it to be -6.283.... , 106.80486

Can anyone help me why the result is different?


texts:
Sorry if my question is a little bit weird.

I want to give all my team members a job title but I am not sure what to give the ones who are dealing with GeoServer and he is a web developer at the same time.

Also where can I find a description of GeoServer admin role?


texts: How to remove ArcGIS 10.0 Server Service and create a new one with the same name?

texts: I want to delete an ArcGIS 10.0 AGS Service and create a new one with the same name. AGS tells me that this is not possible because the Service already exists. I have however deleted the service and the msd and the AGS Cache, but it is still not allowed. What do I need to do so that I can do this?


texts: Google Earth Engine: Sum property values for region

texts:
I have run the code below, to find regions where data is available from my image collection, which This produces a feature collection per region and per variable (in this case SST and Salinity).
// select dates
var startDate = ee.Date('2016-04-01');
var endDate = ee.Date('2016-05-01');

var startyear = 2016; // for DHW make sure match date years above.
var endyear = 2016;

//SST
var sstCollection = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI').select('sst')
.filterDate(startDate, endDate)
.filterBounds(EEZ)
.map(function(image){return image.clip(EEZ)});

//Salinity
var salCollection = ee.ImageCollection('HYCOM/sea_temp_salinity').select('salinity_2')
    .filterDate(startDate, endDate)
    .filterBounds(EEZ)
    .map(function(image){return image.clip(EEZ)});

// get presence or absence of data for variable per region, use anyNonZero - where data =1, no data =0

//SST
var sst_mean = sstCollection.mean();
var sstCount_region = sst_mean.reduceRegions({
  reducer: ee.Reducer.anyNonZero(),
  collection: reefsEdit,
  scale: 30});

sstCount_region = sstCount_region.map(function(feature) {
  return feature.set('variable', 'SST');
});

// salinity
var sal_mean = salCollection.mean();
var salCount_region = sal_mean.reduceRegions({
  reducer: ee.Reducer.anyNonZero(),
  collection: reefsEdit,
  scale: 30});

salCount_region = salCount_region.map(function(feature) {
   return feature.set('variable', 'salinity');
 });

// add together the feature collections and export as csv

var VarImgCount = ee.FeatureCollection([sstCount_region, salCount_region]).flatten()

I'm trying to get a value per region that sums the property 'any' from this feature collection. But I can't figure out how. So in effect I'd just get one feature collection with the summed values for each region. Was looking at the .aggregate functions but they summarise the entire feature collection into one value, not one value per region, which is not quite what I'm after.  A link to my code can be found here.


texts:
I have sought and tried many tutorials and documents without success. I have arcgis desktop 10.2.2 installed. I have added a US map as a layer. Then I do the following hoping to display all (2000+) data points on the map as another layer.

Add data > select my csv (which contains 2000+ rows each with a longitude and latitude > display data > OK.

I am able to see all the data imported by right-click > open. But when I did the above sequence of selections, there is only one single dot displayed.

Example:

name class lat  lon
Stony 1 35.773444   -78.6305752
fowler zak 0 38.82349688    -77.61919194


texts: Labels with callout lines and save style for other data

texts:
I want to create a labeling with callout lines, therefore I use the geometry generator, like in this tutorial:
https://gist.github.com/kgjenkins/1af82a8ffdc3c99bb886e6cd9cdc298f

It works fine and I can create the labling which I want.

But now I want to store the style and use it for another dataset. I can load the style to another dataset, but the callout lines are gone and I can not move the labels.

Does anyone know what I have to do, to use the style information with the callout line for another dataset?


texts: I have been using 3.3 for some time and now I have Arcmap10 on the same computer. My problem is that I cannot pull up the Mr Sid files. 3.3 can't find them ,the id has the right info but no image of the mr sid file.What has happened.They worked together for some time and then one day nothing.error loading cannot make a theme.


texts: GeoServer cascaded WMS - Styles not working

texts:
I'm cascading (remote) WMS with GeoServer. I use Leaflet to display the layer "granser" that shows property boundaries in Sweden. The governmental version of this site can be found here: https://kso.etjanster.lantmateriet.se/?lang=en# (zoom in and the yellow boundaries will appear). The yellow styling is called "morkbakgrund" and is used for dark backgrounds, like the orthophoto.

According to the technical document for the WMS, two styles exist: "ljusbakgrund" and "morkbakgrund" for the layer "granser". https://www.lantmateriet.se/globalassets/kartor-och-geografisk-information/geodatatjanster/tb_fastighetsindelningvisning_v1.2.pdf (unfortunately in Swedish)

Question:

I am able to show the layer on my site as long as I'm not using any styles: parameter. Then it's displaying with the default style ("ljusbakgrund"). However, when I add styles: 'morkbakgrund' nothing shows. This is the code:

var wmsLayer = new L.TileLayer.WMS('https://my_url/wms/', {
    layers: 'granser',
    styles: 'morkbakgrund',
    format:'image/png',
    transparent:true
}).addTo(mymap);

Instead of returning PNG, I'm getting vnd.ogc.se_xml saying:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "https://my_url/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" >   <ServiceException code="StyleNotDefined">
      No such style: morkbakgrund
</ServiceException></ServiceExceptionReport>

If I open the WMS-layer in QGIS, I am able to select the styled layer "morkbakgrund" and display it on the map - so it does exist.

Is there anything at my side I'm doing wrong, or could it be a setting at the service providers side that is causing this trouble? Can I ask them to make any specific changes so that it works? They say they use Mapstore themselves, instead of GeoServer, but that shouldn't be a problem, right?

------ UPDATE ------

As pointed out in one of the comments I am in fact connecting to the host URL in QGIS and not my Geoserver URL. That is probably why it works in QGIS. In contact with the host of the WMS layer, they suggest to directly connect to their URL instead of via my Geoserver. The WMS however require basic authorization with username and password.

I used to add the credentials in Geoserver, but now when I shall connect without Geoserver, how can I add them without the obvious security problems of adding them in the url (which anyway don't work)?


texts: Seeking shapefiles for global border crossings?

texts:
I am trying to find a shapefile or set of shapefiles that contain global border crossings. Basically, what are the points of transit between one country and another.

Does anyone know if this data is available?

I am particularly interested in crossings in Sub Saharan Africa, like Zambia, Zimbabwe, Malawi, etc., and around Syria.

I have already checked the usual sources of shapefiles and no luck.


texts: How to Exclude Null or Zero Values from Graduated Colors Classification? ArcGIS 10.3

texts:
I have a layer that is classified using graduated colors. I have set it to a manual classification with 7 levels.

My 1st value of 0 is not needed anymore. How do I remove the 1st level of classification. So that my manualy classification starts at 0.000001 -1000000.000000? So that it looks something like....

I have tried to change my break values to start at 0.000001. But the scale still starts at 0.000000.

I have also tried to used the data exclusion to exclude NULLS and 0, and I am having the same issue, the value 0.000000 still remains.

Also, when right clicking the first level 0.000000 and selecting remove classes, the next level changes to 0.000000 - 10000000.000000..... which I do not want I want. I want the value 0.000000 to be excluded.

Any thoughts on how to exclude the 0.000000 value and have my scale start at 0.000001?


texts: Pansharpening of atmospheric corrected image

texts:
After applying any atmospheric correction on raw MS and Pan image we get the DN value between 0 and 1 as we know reflectance is unit less or just ratio of input irradiance and radiance after this atmospheric correction pan sharpened is possible?

Or

Should we first apply pan sharpened then spread pansharpened bands then apply atmospheric correction?


texts: How to make mosaic automatically from quadrocopter photos?

texts:
I have many aerial photos (not georeferenced) from a quadrocopter and I want to make a mosaic from them, but it takes so much time.

Could you help me with this problem or give me advice on programs which can do this operation automatically?


texts: Updating table from another table with function ST_CONTAINS in PostGIS

texts:
I tried to update an attribute 'solved' of a polygon table (table name: polygon) by using an attribute 'solved' of another point table (table name: point).

What I want to do is that if ALL the points in a polygon has 'yes' in attribute 'solved', then the corresponding polygon will also have 'yes' in it's attribute 'solved', otherwise the polygon attribute 'solved' should have the value 'No'.
There are only 3 types of value for the attribute 'solved' in the point table: 'Yes', 'No' or Null.
So what I think how to build my SQL now, in other words, if a polygon contains any point with value 'No' its attribute solved, or has no value I the attribute, the polygon should return 'No' if its attribute solved. Otherwise the polygon will have the value 'Yes' in the attribute.
So I wrote something like that but it is not working:
UPDATE polygon
IF ST_CONTAINS (point.geom, polygon.geom) AND (point.solved = 'No' OR point.solved is null)
SET solved = 'No'
ELSE
SET solved = 'Yes'
FROM point, polygon;
END IF;

I got this error

ERROR:  syntax error at or near "ST_CONTAINS"

Anyone has any clue what is wrong with that? Am I thinking correctly?
I know that this can be done easily in QGIS but I would like to figure it out since it will be part of my trigger when I update the point table.


texts: QGIS Processing Input CRS from Input Layer

texts:
I'm creating a Processing algorithm that requires the user to input several parameters including an input layer and an output CRS. At present, the tool defaults to SRID 4326. I'd like for the CRS parameter to default to whatever layer is selected as the input layer. Is this possible?

I don't see anything in processing.core. Would I have to get into the Qt internals and hook up an event handler for a change in the layer selection?

Current code:

self.addParameter(ParameterCrs(self.TARGET_CRS,
        self.tr('Target CRS'), 'EPSG:4326'))

Desired pseudo code:

self.addParameter(ParameterCrs(self.TARGET_CRS,
        self.tr('Target CRS'),
        processing.parameters.getCrsFromInputLayer(INPUT_LAYER)))


texts: How can I change OSRM server with leaflet-routing-machine

texts:
I am using leaflet-routing-machine with OSRM, How can I change OSRM server and do not use demo?
I have the same warning:
You are using OSRM's demo server. Please note that it is **NOT SUITABLE FOR PRODUCTION       USE**.
Refer to the demo server's usage policy: https://github.com/Project-OSRM/osrm-backend   /wiki/Api-usage-policy

To change, set the serviceUrl option.

Please do not report issues with this server to neither Leaflet Routing Machine or OSRM -   it's for
demo only, and will sometimes not be available, or work in unexpected ways.

Please set up your own OSRM server, or use a paid service provider for production.

Today, the routes have not showed and I have the same error in Firefox:
Routing error:
Object { message: "HTTP request failed: abort", url: "https://router.project-osrm.org/route   /v1/driving/-4.772748,3…38.013284?overview=false&alternatives=true&steps=true&hints=;", status:    -1, target: abort }

In Chrome:
 Access to XMLHttpRequest at 'https://router.project-osrm.org/route/v1/driving   /-4.772748,37.89155;-3.370496,38.013284?overview=false&alternatives=true&steps=true&hints=;'          from origin 'https://www.transeop.com' has been blocked by CORS policy: No 'Access-Control-      Allow-Origin' header is present on the requested resource.
 router.project-osrm.org/route/v1/driving/-4.772748,37.89155;-3.370496,38.013284?overview=false&alternatives=true&steps=true&hints=;:1 Failed to load resource: net::ERR_FAILED

It is my code:
    L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
      attribution: '&copy; OpenStreetMap contributors'
    }).addTo(map);

  let control = L.Routing.control({
  waypoints: [
    L.latLng(origin_latitude, origin_longitude),
    L.latLng(destination_latitude, destination_longitude)
  ],
  plan: L.Routing.plan([
    L.latLng(origin_latitude, origin_longitude),
    L.latLng(destination_latitude, destination_longitude)
  ], {
    createMarker: function(i, wp) {
      return L.marker(wp.latLng, {
        draggable: false
      });
    }
  }),
  addWaypoints: false,
  routeWhileDragging: false,
  draggableWaypoints : false,
  show: false,
}).addTo(map);


texts: embed OSM and Google Imagery in a WebGIS

texts:
I've tried to add a google "hybrid" layer as a base map layer in a webGIS...

The script is in js and is like this :

(I only post this part of the code)

        {
            _layer:new OpenLayers.Layer.OSM(
                "OpenSreetMap",
                "",{
                    icon:'images/earth.png',
                    projection:new OpenLayers.Projection("EPSG:900913"),
                    fractionalZoom:false,
                    isBaseLayer:true,
                    maxExtent:new OpenLayers.Bounds.fromString("-20037508.34,-20037508.34,20037508.34,20037508.34")

                })
        },
        {
            _layer:new OpenLayers.Layer.Google(
                "Google Hybrid",
                "",{
                    type: google.maps.MapTypeId.HYBRID,
                    icon:'images/earth.png'
                    projection:new OpenLayers.Projection("EPSG:900913"),
                    fractionalZoom:false,
                    isBaseLayer:true,
                    maxExtent:new OpenLayers.Bounds.fromString("-20037508.34,-20037508.34,20037508.34,20037508.34")

                })
        },

...

For the OSM part, it works perfectly, but not for the Google part...

Would you have some clue about that ?


texts: Export latitude/longitude coordinates of a R map plot into an external file

texts:
I have a simple map and like to export the used coordinates of latitude/longitude
into an external CSV file. Is this possible?

library('maps')
map(database='world',regions='germany')


texts:
Is a user with a valid ArcGIS Pro license allowed to use a map image which uses Esri basemaps (Oceans and terrain) in commercial print media?
If so, how should source be cited in the map?
If not, suggestions for how to provide necessary map media for magazine article?
Landsat imagery may be quite cloudy in the region of interest (Tierra del Fuego), and I need some sort of ocean bathymetry basemap as well.
I'm used to academic uses, and am unfamiliar with permissions for commercial uses.
Are there any examples of Esri map images in magazines / media?


texts: Clipping interpolated raster with shape of original point data-set

texts:
I have a point dataset with XYZ values.

I inserted this layer in QGIS 3.6 via layer > add layer > add delimited layer.

Then, I interpolated these points to a raster via interpolation > TIN interpolation.

However, now the data are interpolated over the whole domain, even in areas where no data are present in the original file. How can I clip out the interpolated raster with the original shape of the point dataset?

The xyz file can be downloaded from:

https://wetransfer.com/downloads/4ae4ce51072dceef93486314d161509920191021213532/48e4ee68c17269bd6f7a72c1384b3c9a20191021213532/60b04d

Interpolated raster:

Interpolated raster with original point dataset on top:


texts: NDWI generation from google earth engine

texts:
I want to generate the median composite image of ndwi images of several dates in google earth engine. How can I do that and how to shorten the code itelf?

var image5 = L5.filterDate('1987-01-01','2003-12-31').filterMetadata('CLOUD_COVER', 'less_than', 5)
.filterBounds(geometry)

var image8 = L8.filterDate('2013-01-01','2019-12-31').filterMetadata('CLOUD_COVER', 'less_than', 5)
.filterBounds(geometry)
var image5_set2 = L5.filterDate('2008-01-01','2012-12-31').filterMetadata('CLOUD_COVER', 'less_than', 5)
.filterBounds(geometry)
var collection = image5.merge(image5_set2).merge(image8)//sort('system:time_start');
print(collection)
// Export.table.toDrive(collection)
// Load an image.
var image1 = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_150044_19930211')
var image2 = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_150044_20170402')
var image3 = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_150044_19950321')
var image4 = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_150044_20180421')
var image5 = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_150044_20140205')
var image6 = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_150045_19960408')
var image7 = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_150045_19970411')
var image8 = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_150044_20190424')
.select(['B1','B2', 'B3', 'B4', 'B5', 'B6', 'B7']);

// Define the visualization parameters.
// var vizParams = {
//   bands: ['B4', 'B3', 'B2' ],
//   min: 300,
//   max: 1500,
//   gamma: [0.95, 1.1, 1]
// };

// // Center the map and display the image.
// Map.setCenter(69.704, 22.546, 10);
// Map.addLayer(image.clip(geometry), vizParams, 'false color composite');
// Export.image.toDrive({image:image,
// scale: 30,
// region: roi
// })
var green1 = image1.select('B2')
var nir1 = image1.select('B4')
var ndwi1 = green1.subtract(nir1).divide(green1.add(nir1));
var green2 = image2.select('B3')
var nir2 = image2.select('B5')
var ndwi2 = green2.subtract(nir2).divide(green2.add(nir2));
var green3 = image3.select('B2')
var nir3 = image3.select('B4')
var ndwi3 = green3.subtract(nir3).divide(green3.add(nir3));
var green4 = image4.select('B3')
var nir4 = image4.select('B5')
var ndwi4 = green4.subtract(nir4).divide(green4.add(nir4));
var green5 = image5.select('B3')
var nir5 = image5.select('B5')
var ndwi5 = green5.subtract(nir5).divide(green5.add(nir5));
var green6 = image6.select('B2')
var nir6 = image6.select('B4')
var ndwi6 = green6.subtract(nir6).divide(green6.add(nir6));
var green7 = image7.select('B2')
var nir7 = image7.select('B4')
var ndwi7 = green7.subtract(nir7).divide(green7.add(nir7));
var green8 = image.select('B3')
var nir8 = image.select('B5')
var ndwi8 = green8.subtract(nir8).divide(green8.add(nir8));

Map.addLayer(ndwi1.clip(geometry))
Map.addLayer(ndwi2.clip(geometry))
Map.addLayer(ndwi3.clip(geometry))
Map.addLayer(ndwi4.clip(geometry))
Map.addLayer(ndwi5.clip(geometry))
Map.addLayer(ndwi6.clip(geometry))
Map.addLayer(ndwi7.clip(geometry))
Map.addLayer(ndwi8.clip(geometry))


texts: How to merge 2 huge tables with only geometry in common without duplicates

texts:
I've got 2 tables with several millions of rows. Because of poor data management, they don't have any ids at all or anything that helps match them up except for the geom

I've tried doing

insert into table1(random_columns, geom )
select random_columns, geom  from table2 a where not exists (select b.geom from table1 c where b.geom = a.geom  )

Problem with this query was that it did not complete for 3 days!!!! So I had to cancel.

Both geom columns are indexed

Is there a better way of doing this?


texts: How to achieve Gradient Fills in ArcMap?

texts:
Does anyone know of a native way to achieve the gradient fills like the ones in the attached picture (map_1)?

The circular and rectangular fills that I see already in ArcGIS' symbology choices don't seem to take the whole polygon into consideration (map_2).

Is this type of thing done using another software package like Photoshop?


texts: Merging multiple non overlapping raster layers into one layer

texts:
I'm working in Qgis 2.14 and have received multiple raster files for the Height of a terrain that combined covers the entire terrain I’m interested in.

I would like to combine them. Because the specific areas sometime overlap between two Rasters calculations are difficult.

I have tried using the following tools :

Raster-> Miscellaneous-> Merge tool
Raster-> Miscellaneous-> Build Virtual Raster (Catalog)
Raster-> Miscellaneous-> Build overviews (Pyramids).

However, they all inform me that I either do not have the permission/rights to use these tools or the tools are not installed or have disappeared. Does anyone know is these tools belong to some plugin?
I have tried to look through the plugins but have not found them. However there are so many I could have missed it!

the top picture is the error message i get when i try to make a catalog of the Raster files.

I have tried to change the folder mentioned in the comments to the first answer but i get the message shown in the button picture.


texts: Using where clause in ClusterFeatureLayer

texts:
I am using the ClusterFeatureLayer (cluster-layer-js) and I am trying to use where clause. It works fine when I use it in initial request something like this:

clusterLayer = new ClusterFeatureLayer({
        "url": featureServiceCoinFindings,
        "distance": 95,
        "id": "clusters",
        "labelColor": "#fff",
        "resolution": map.extent.getWidth() / map.width,
        "singleTemplate": false,
        "disablePopup": true,
        "singleSymbol": defaultSym,
        "useDefaultSymbol": false,
        "zoomOnClick": true,
        "showSingles": true,
        "objectIdField": "OID",
        "where": "ID < 50",
        outFields: ["*"]
    });

But I want initially to load all features and then on button search to filter some of them. When I do something like this clusterLayer.where = "ID < 50"; on button click, the clusterLayer doesn't refresh and I still have all features shown in clusters on the map.


texts:
I am using ArcGIS 10.2 and new to this software. My question iss

I have time series wind speed data in netCDF form. I extract netCDF in raster form after that in table form. Now I need How to calculate average wind speed at a particular location (given longitude and latitude)?
how interpolate different locations wind speed?


texts: How to insert long/lat value in postgis database in the form of Point(x,y)?

texts:
I am having some trouble in inserting long/lat in the form of point. Currently, I have array of long/lat value and which I want to store into database in the form of point. However, I am unable to store it in the form of point and when I query as ST_AsText(geom), I simply get long/lat value not a point.

In the picture below, the bottom one is my output where point and long/lat are same but what I want to achieve is the top query output.

Insert code:

INSERT INTO point_route(ID, ROUTE_NAME, geom)
VALUES (1, 'point 1', ST_SetSRID(ST_makepoint(27.71595,  85.28364),900913));


texts: Creating ArcGIS terrains using ModelBuilder?

texts:
I'm trying create a terrain using ModelBuilder but with "Create Terrain" there is no where to specify SFTypes and when the model is run it give the error:

  The Terrain definition is incomplete or invalid

Can one create terrains in ModelBuilder?


texts:
The integrated batch processing tools from grass in QGIS are extremely usefull...at least in theory, in practice they are really underwhelming because most of the time they do not work for me, although single processing does the job.

For example: I have 36 single band GeoTIFF files with categorical data (15 classes; 0 thru 14). I want to reclassify each category into a new (double) value, thus using r.recode (r.reclassify only produces integers). The recode rules I provide in an external file look like that:

0:0:0.0
1:1:0.2
2:2:0.3
3:3:0.6
4:4:0.9
5:5:1.7
6:6:2.7
7:7:5.0
8:8:8.6
9:9:15.0
10:10:27.3
11:11:50.0
12:12:89.9
13:13:154.8
14:14:0.0
EOF

It works when using this with single execution, when using 'Execute as batch process', I get an error message 'NoneType' object has no attribute 'extent'. Any ideas what I'm doing wrong? When activating the batch processing, I only provide input file list, recode rules and outfile.


texts: Install QGIS on Ubuntu with GDAL built from source?

texts:
I am trying to install QGIS on Ubuntu 14.04. While I can easily install it via the package manager or apt-get, I find that QGIS, when installed, does not have Python support as expected. The symptoms of this include:

"Analysis Tools" are missing.
"Plugins" > "Python Console" results in nothing happening.
In "Plugin Manager" under "Settings" I see the message "The settings on this tab are only applicable for Python Plugins. No Python support detected, thus no settings available."

The reason I expect Python support to be included is because:

Python is installed (which python yields /usr/bin/python)
GDAL 1.11.0 was installed from source with Python support (After ./configure --with-python, I see SWIG Bindings: python in the output)
gdal is imported within Python just fine (e.g., import gdal works fine)

When I try to install QGIS, apt-get recommends gdal-bin (and gdal-python), which I don't want to install because I've already built GDAL from source with Python support. The same things happens if I try to install only python-qgis. Thus, I believe the problem is that the QGIS package cannot find GDAL, with its Python bindings, on my system. I have bypassed the installation of the gdal-bin package via:

sudo apt-get install --no-install-recommends qgis qgis-plugin-grass

This is what gets me to the conditions described in the bulleted list at the top (no Python support).

I've poked around on our StackExchange and not found anyone dealing specifically with the issue of aligning a QGIS package and GDAL built from source. I even tried building QGIS from source; although it recognized my GDAL installation I could not successfully finish the build. Any idea how I can get QGIS to recognize my current GDAL installation and its Python bindings?


texts: Visualizing vertical profiles from LiDAR point clouds in R?

texts:
I would like to visualize the vertical profiles of different LiDAR point clouds in different forest types. I have extracted the z-values from the LiDAR files with lidR and put them in a dataframe with 20 columns for each plot and ca. 200.000 rows.

I would like to create a jitter histogram to illustrate the differences between different forest types and their structure. However, I feel like I could do with less than 200.000 points per column.

Any suggestions how to reduce the points in a way that it preserves the overall trend?

I am not sure if I am free to share the data I am working on publicly, but since laz files are the same in their architecture, I guess it is still understandable if you have one laz file at hand.

Sample of my code:

# Import the required libraries
library(lidR)
library(data.table)
library(tidyverse)
library(rlas)

> #create list
las.list<-list.files(path = "~/LAZ", pattern ="*.laz", full.names=T,
> recursive=FALSE,  include.dirs = FALSE)

zlist=list()
##loop to extract z values from each LAZ file#########
for(i in las.list){
  lidar<-readLAS(i)
  lidarsingles <- lasfilterduplicates(lidar)
  z<-lidarsingles@data$Z
  zlist <- cbind(zlist,z)
 }

#add plot names
zdf<-as.data.frame(zlist)
plotnames<-c("AEW02", "AEW03", "AEW11", "AEW12", "AEW14", "AEW16", "AEW21" ,"AEW32", "AEW36" ,"AEW44" ,"HEW08" ,"HEW20" ,"HEW22", "HEW48", "SEW18" ,"SEW21", "SEW31" ,"SEW35",
             "SEW40", "SEW43")
id<-rownames(zdf)
colnames(zdf)<-plotnames
czdf<-cbind(id, zdf)

Up to this point, this gives me a data.frame where each column represents one plot and the data in each column are the height values of each point in the plot.

I would like to come up with a plot like this for each plot:

By now, I know that the amount of points might not be ultimately hindering, however, I struggling with arranging the data in a way where I have two variables that I can plot against like so:

# Boxplots of mpg by number of gears
# observations (points) are overlayed and jittered
qplot(plot, height, data=zdf, geom=c("boxplot", "jitter"),
   fill=plot, main="Height Distribution of Returns",
   xlab="Plotname", ylab="Height")


texts:
I have an attribute table with a lot of lines.

I want to classify them considering their length:

SHORT (from 0 to 50)
MEDIUM (from 50 to 150)
LONG (from 150 to 180)

How can I do avoiding to modify manually every 391 row?

This does not work:

Reclass(!Lenght!)

Code Block:
def Reclass(Lenght):
    if Lenght>= 0 and Lenght<= 30
        return "Short"
    elif Lenght> 30 and Lenght<= 90):
        return "Medium"
    elif Lenght> 90 and Lenght<= 180):
        return "Long"
    elif Lenght> 30):
        return "VeryLong"

Tried with

def lenght_cat(length,lenght_cat):
      if lenght> 0 and lenght< 14:
        return (length_cat*short)
      elif lenght> 14 and lenght< 20:
        return (length_cat*long)
      else:
        return None

but does not work unfortunately.


texts: Create a partial distance matrix in QGIS 3.4

texts:
I would like to calculate the straight distances between a series of points:
in the first layer (rows) there are the locations of the domicile of my respondents;
in the second layer (columns) there are the locations of supermarkets that each respondent said he/she attends.

For example, respondent 1 is associated to two supermarkets (it means he/she usually attends two supermarkets).
As for me it is relevant to know the distance between each respondent and the supermarkets he/she attends, I don't need to calculate the all distances between each respondent and each possible supermarket.
Is there a way to account this issue in the Distance Matrix available in QGIS? Alternatively, can I use another tool to make this calculation?
The drawback of the "complete" Distance Matrix is that it contains in my case lots of information and it is not very handy to consult.


texts: Defining convex-hull of (clouds of) points using R?

texts:
I have multiple (clouds of) points, and would like to take the outer envelope of these points. This will allow me to polygonize my points.

Using the convex-hull would help me, but in some cases, my shapes are not convex, and hence this convex-hull envelope contains large areas without any points. The question mark is a good example where one would not necessarily want a convex hull (from: link):

My questions are:

Is there a concept of non-convex hull? How is this called, and conceptualized? I guess that while it is easy to define a convex hull (it is unique), it is difficult to conceptualize a non-convex hull, as this won't necessarily be unique, so any definition will be harder/involve some free parameters.
What are the algorithms to implement this, ideally in R?


texts:
How to sort data after using uniquevalue from IDataStatistics? The problem is I am using ArcGIS 9.3 vb6.

Edit:

Thanks kenbuja for the code. It will be useful. In details what I am trying to is this.

join gdb table and feature table using IQueryDef
get uniquevalue of   a particular field and sort the field
Export all information in excel including the uniquevaluefield and other fields also.

This can be easily done in Access through SQL/querybuilder but unfortunately I am using 9.3 vb6. Using kenbuja'r code I can go upto task 2. But I lost other field information when use IDataStatistics.


texts: Vertically and Horizontally align the labels in multi-column QGIS legends

texts:
In QGIS 3.18 (and older versions) I noticed that the first item in a multi-column legend isn't aligned with the items in other columns. I have played with the settings in the Spacing column but can't find a way to fix it. They are all defined as Subgroups but have also tried to define the Title as a group (menu on right click when in the legend definition view)

Related to this, I've found some icons aren't aligned. There is no xy offset set on it

The only way I can see to fix it is by splitting the legend into columns. Is there an easier way?
UPDATE based on answer from Corentin Lemaitre
Issue 2 (Horizontal) is fixed by changing the patch size. But I can't fix issue 1 (Vertical) alignment using spacing...

If I reset everything to Default, we still have the issue.

Then with layer title Hidden

And with it set as Subgroup

In all cases you will see the text is out of vertical alignment in the first column but in the 2 and 3rd columns it is fine eventhough they are point and polygon respectively. Column 1 and 2 are point symbology.


texts: 3D marker symbol export problem (ArcGIS 10.2)

texts: I am trying to create a webscene.  I have a TIN and a point layer that is 3d enabled (point z).  I added a 3d symbol marker to the point layer in ArcScene .  When I use the "export to 3d web scene" tool in 3d Analyst, the TIN exports fine, but i get an error message for my point layer: "Layer: restricted symbology will be ignored".  Again, I read the manual on how to create a webscene and it mentions that the layer has to be 3d enabled (which I assume is the "point z" attribute) and that the symbology has to be a 3d marker symbol (where I am using the 3d residential style reference).   I did both (I think).


texts: Errors when converting MapInfo .tab to .dxf

texts:
I am trying to convert some MapInfo files to .dxf format using OGR2OGR using the following command:

OGR2OGR -f "DXF" "input.dxf" "output.TAB" -overwrite -skiperrors

When I run this I am getting a lot of errors which say "DXF layer does not support arbitrary field creation, field 'xref' not created".

Can you not attach data to records in DXF files?

I am also getting the error "No known way to write feature with geometry 'none'" and the same for "Multi Point".

Which geometry types can DXF support?

Update: In Mapbasic the Export command allows exporting to DXF, thereby negating the need to use OGR2OGR.


texts: Is there any way to create measure tool (area and length) using Ext JS 6, GeoExt 3 and Openlayers 4?

texts: I am building a web GIS application using Ext JS 6.0, GeoExt 3 and Openlayers 4.3.0. I want to make measure area and measure length buttons so when I activate button I can draw polygon or line and get area or length. Is there any way I can do this?


texts:
I'm working on a bunch of raster imagery using ArcGIS 10.6.

I have a several sub models consisting of iterations of raster files. Here's one of them, the other do the same but with different parameters:

And here's my full model.

The problem is, I can't connect the other value (ssh, sal, etc) into cell statistics.

Is it bug of cell statistics?


texts: Create a new column and update it with the results of a calculation in Carto

texts: My dataset in Carto has columns with subtotals and a column with total - I would like to create a new column with the calculated percentage in Carto - is there a way to do this?


texts: Arcpy - Updating fields using time.localtime()

texts:
My objective is to change the values under field "DATE_IMPOR" which are currently set at to the current time using time.localtime function. I'm having some problems getting there, above all one line appears to be most problematic "row.setValue("DATE_IMPOR", new_time)".

The field data type of "DATE_IMPOR" is Date, therefore it has to be Date format such as YYYY or YYYY/MM/DD or types supported.

In short, what I get is a Runtime Error.

Here is my script so far:

import arcpy
import time

#environnement de travail
arcpy.env.workspace = "D:/M1 Geomatique/Programmation II/Dossier"

cursor = arcpy.UpdateCursor("ZONE_INONDATION_SYNTHESE_67.shp", "DATE_IMPOR")

#Update cursor
try:
    for row in cursor:
        new_time = time.localtime()[0]
        row.setValue("DATE_IMPOR", new_time)
        cursor.updateRow()

except:
    arcpy.GetMessages()

*One note: I wasn't sure where it would be better to ask this question, therefore I have placed it here as well. Apologises for that.


texts: Using the alpha channel of a GeoTIFF in Geoserver

texts:
I want to publish a map as a WMS using GeoServer. The map consists of several layers each of which is a GeoTIFF containing RGB channels and an alpha channel. The images were edited in Photoshop and Georeferenced using ArcMap.

I can publish the GeoTIFFs but when I connect to the WMS in ArcMap, the transparency works very poorly or even not at all. When i load the source GeoTIFFs as layers everything works like a charm.

In the ResourceConfigurationPage of Geoserver i set the minRange of all bands to 0 and the maxRange to 255. I didn't change the layers style so it's still set to the standard "raster" SLD.

What do I need to do in order to get the transparency working properly?


texts:
I have two polygon vector layers one of which has more than 100,000 polygons. There are areas of overlap in the two vector layers however they have different attributes. In the final layer I want the attributes to come across from both the polygon layers especially where the polygons in the two layers overlap. I have to do further processing on this attribute intersect information hence it is critical.

I already know how to do this in R (using the union function as part of the raster package) because that's where I'm carrying out most of the post-processing of this data however it is extremely slow. Slow to the point that it continues to do the union even after 2 hours and which it crashes. In QGIS, it takes less than a couple of minutes but I want to run it as a routine process so want to avoid using QGIS.

I have since then tried to do this using ogr2ogr and I am not getting the desired result. For example, I have followed this particular thread and the result is not what I am after. What I am getting at the end is a massive shapefile with the attributes of the two layers combined into 1 but no mapping of the attributes where the intersection has occurred as such. It almost looks like the two shapefiles have been merged without any intersection occurring between them which is what I am after.

Isn't there a union function in ogr2ogr similar to the one in QGIS? Or can anyone suggest how I can expedite this union process in R?


texts:
A few month ago I was able to make a polygon map of population: http://supermap.hostei.com

Today I opened the same QGIS project and tried qgis2web again. The plugin interface had responding problems. Then, I tried to make the same map as before. The HTML, JS, and CSS files were generated successfully, but my Chrome browser crashed when opening the files. Firefox was able to display the map, but the navigation such as zooming, panning, and popups were very slow.

My shapefile has 7000 rows/features. I tried it with 200 rows now and it seems to be working smoothly. I also tried another dataset of US county polygons and got the same problem: http://vehiclethefts.netne.net/map1/

Do you know why this might be or any solution so that I am still be able to generate maps with 1000+ features?


texts: Field Calculator decimal places - how can I limit them?

texts: I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I can't seem to limit the number of decimal places so that I just have solid numbers. Right now I have 13 places after the decimal, I would like it to be 0.


texts: Merging non-contiguous polygons using Oracle Spatial union functions?

texts:
Is there any way of merging non contiguous polygons using the SDO_AGGR_UNION or a similar dissolve function?

When i run the below query in oracle sql developer i managed to convert geometry type from polygon(2003) to multipolygon(2007), but in a gis system some polygons are not included on preview.

select shape from (
select nationalcode as nt,SDO_AGGR_UNION(SDOAGGRTYPE(shape, 0.5)) as shape
from auadmunits where nationalcode = '1225' group by nationalcode) ;

I know that union is for adjacent shapes, but i am wondering if anyone else has faced this issue and has found an approach, not only handling oracle spatial.


texts: Control geoprocessing results related to default data values calculated for null inputs

texts:
I am looking for information on Default data values for the different data types in ArcGIS.  We are running a series of Overlay Route Events (Linear Referencing) tool operations.  If any of the values from the two input source tables are null then the values in result table are some default data value.  For example for Date field types that have null values in the input tables the values that getting populated in the Overlay operation result are '12/30/1899 0:00:00'.

This is happening in a file geodatabase at ArcMap 10.1 and Windows Server 2008.

Does anyone have information on default data values for data types specifically in reference to geoprocessing?  Any suggestions to get the null values to stay when the Overlay does it's calc?

Field properties say allow null is yes.

I received word from Esri that this is a known bug in the tool NIM081760. I'd be interested in hearing of any workarounds.


texts:
I have a german Windows and the problem is when I'm using sextante tools the log tells me that I have issues with the folder dokumente und einstellungen

  (C:\Programme\Quantum GIS Lisboa>saga_cmd grid_tools "Reclassify Grid
  Values" -INPUT "C:\Dokumente und
  Einstellungen\user\sextante\tempdata\1353407599.88104.sgrd" -METHOD 0
  -OLD 129 -NEW 0 -SOPERATOR 0 -MIN 0 -MAX 1 -RNEW 2 -ROPERATOR 0 -RETAB C:\Dokumente und
  Einstellungen\user\sextante\tempdata\1353407599.88105.txt -TOPERATOR 0
  -NODATAOPT       -NODATA 0 -OTHEROPT        -OTHERS 0 -RESULT "C:\Dokumente und
  Einstellungen\user\sextante\tempdata\sagareclassifygridvalues102.tif.sgrd"
  Unexpected parameter 'und')

Is it possible to change the temp folder location?


texts:
I'm new to QGIS 2.8 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour plugin and so on by:

creating a dll library by rewriting the python code to c++ after obtaining the plugins source code from github(with credits of course, will have to study Python since am more of c++ developer)

writing a wrapper around the code

If anyone has done one of the above can you tell me which one is better and where to start?

Edited: I've already develop a standalone application which can load multiple vectors and raster maps, calculate distance and area, display different svg icons on map and get pixel values of a point(elevation data) from the map. the only remaining parts that i want to develop is the above listed points.


texts:
I am new to ArcGIS and trying a few things..

I'm trying to read shapefile (which is supplied as an input) using C# and
I want to generate a PDF file which contains underlying metadata information (similar to the Identify tool) ?


texts: Converting lat/long to northing/easting given data from a .prj file

texts:
I have been given the a file containing a bunch of lat long coordinates along with this information that came from a ".prj" file alongside a ".shp" file:
GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
I need to convert the lat/long coordinates which I've parsed out of the ".shp" file to northing/easting coordinates, but I don't understand this data - I'm a software engineer with very little knowledge of GIS, and I'm unsure where to start, and as far as I can tell, the above WKT isn't enough to perform the conversion.
I have some other data which is already in northing/easting format, and I need to make sure the two are aligned. I'm using the NetTopologySuite.Proj4Net library.


texts: NDVI image value changes from -1 to 1 in ENVI to 0-255 in ArcGIS Desktop and ERDAS Imagine?

texts:
When i open NDVI image in ENVI, its value is still within the range (-1 to 1).

But when I open this NDVI image in ERDAS and ArcGIS Desktop, its value is 0-255.

What does it mean?

Is the NDVI image some problem?


texts: How Color Great Lakes Blue from GADM maps

texts:
I am using getData("GADM") to obtain map data for the US and Canada. Hudson's Bay and the Atlantic are transparent so I can add a blue background that shows through. However, all the Great Lakes have disappeared. Can I get them to be transparent as well to let the blue show through?

The data from GADM is detailed and the plotting of the maps is very slow in RStudio on my Mac. I have added code found here to speed up the plotting.

library(tidyverse)
library(raster)

# Convert the polygons into data frames so we can make lines
poly2df <- function(poly) {
  # Convert the polygons into data frames so we can make lines
  # Number of regions
  n_regions <- length(poly@polygons)

  # Get the coords into a data frame
  poly_df <- c()
  for(i in 1:n_regions) {
    # Number of polygons for first region
    n_poly <- length(poly@polygons[[i]]@Polygons)
    print(paste("There are",n_poly,"polygons"))
    # Create progress bar
    pb <- txtProgressBar(min = 0, max = n_poly, style = 3)
    for(j in 1:n_poly) {
      poly_df <- rbind(poly_df, NA,
                       poly@polygons[[i]]@Polygons[[j]]@coords)
      # Update progress bar
      setTxtProgressBar(pb, j)
    }
    close(pb)
    print(paste("Finished region",i,"of",n_regions))
  }
  poly_df <- data.frame(poly_df)
  names(poly_df) <- c('lon','lat')
  return(poly_df)
}

# Get the main polygons, will determine by area.
getSmallPolys <- function(poly, minarea = 0.01) {
  # Get the areas
  areas <- lapply(poly@polygons,
                  function(x) sapply(x@Polygons, function(y) y@area))

  # Quick summary of the areas
  print(quantile(unlist(areas)))

  # Which are the big polygons?
  bigpolys <- lapply(areas, function(x) which(x > minarea))
  length(unlist(bigpolys))

  # Get only the big polygons and extract them
  for(i in 1:length(bigpolys)){
    if(length(bigpolys[[i]]) >= 1 && bigpolys[[i]] >= 1){
      poly@polygons[[i]]@Polygons <- poly@polygons[[i]]@Polygons[bigpolys[[i]]]
      poly@polygons[[i]]@plotOrder <- 1:length(poly@polygons[[i]]@Polygons)
    }
  }
  return(poly)
}

provinces <- c("Ontario", "Manitoba", "Québec")

# Get ALL provincial boundaries as spatial polygons data frame
canada <- getData("GADM", country = "CAN", level = 1)
usa <- getData("GADM", country = "USA", level = 1)

# Narrow down to just the provinces of interest
ca.provinces <- canada[canada$NAME_1 %in% provinces,]

ca.provinces_small <- getSmallPolys(ca.provinces) %>%
  gSimplify(tol = 0.01, topologyPreserve = TRUE) %>%
  poly2df()

usa_small <- getSmallPolys(usa) %>%
  gSimplify(tol = 0.01, topologyPreserve = TRUE) %>%
  poly2df()

map_theme <- theme_void() +
  theme(
    panel.background = element_rect(fill = "steelblue")
  )

ggplot() +

  # Crop area
  coord_fixed(xlim = c(-95, -65),  ylim = c(41, 55), ratio = 1.6) +

  # Canada
  geom_polygon(data = ca.provinces_small,  aes(lon, lat),
               fill = "dark grey", size = 0.3, color = "black") +
  geom_polygon(data = usa_small,  aes(lon, lat),
               fill = "dark grey", size = 0.3, color = "black") +
  map_theme


texts: How to connect edges in a network even if they dont' exactly match spatially

texts:
I am using R with the following packages:
library(sf)
library(sfnetworks)
library(tibble)

I would like to create a sf network (spatial network) with some tolerance of distance between nodes
I Created these two lines :
 pts1 <-  matrix(1:4, ,2)
 ls1 <-  st_linestring(pts1)
 pts2 <-  matrix(31:34, ,2)
 pts2[1,1] <- 1.00005
 pts2[1,2] <- 3.00005
 ls2 <-  st_linestring(pts2)

And a network:
tibble(geometry = c(st_geometry(ls1),st_geometry(ls2))) %>%
  st_sf() %>%
  as_sfnetwork()

In this example I would like to connect both lines (here they are not because they don't share a common point), Is it possible to specify a tolerance regarding the distance between nodes?


texts: ipyleaflet with GEE in JupyterLab doesn't show layer

texts:
I'm trying to run the interactive map example for GEE community - Python API on JupyterLab (https://github.com/gee-community/ee-jupyter-contrib/blob/master/examples/getting-started/display-interactive-map.ipynb) .

I get only the osm basemap without the Sentinel-2 layer & I don't get any errors. I have installed folium, ipywidget, ipyleaflet.

What can be the problem? What am I missing?


texts: Rasterizing polygon grid in Python (geopandas & rasterio)

texts:
I am trying to rasterize a custom polygon grid with one or more columns. Preferably I'd like to create multi-band rasters from multiple GeoDataFrame columns (in polygon grid), but I have got stuck even with one layer.

Here's a script about creating some arbitrary polygon grid in geopandas. GeoDataFrame and then my attempt to rasterize it, largely following this answer

# Load libraries
import geopandas as gpd
import rasterio
import numpy as np
from rasterio import features
from rasterio.plot import show
from shapely.geometry import Polygon
import matplotlib.pyplot as plt

## Create a Demo Grid
xmin,ymin,xmax,ymax = 1,1,5,5
lenght = 1
wide = 1

cols = list(range(int(np.floor(xmin)), int(np.ceil(xmax)), wide))
rows = list(range(int(np.floor(ymin)), int(np.ceil(ymax)), lenght))
rows.reverse()

polygons = []
for x in cols:
    for y in rows:
        polygons.append( Polygon([(x,y), (x+wide, y), (x+wide, y-lenght), (x, y-lenght)]) )

g = gpd.GeoDataFrame({'geometry':polygons})

# Create a column to print out
g['id'] = g.index
g.plot(column = 'id')

Here is the output I would like to have as a raster:

To do that, I have tried:

# Create raster from a grid
out_fn = "raster.tif"

b = g.unary_union.bounds
width = int(b[2]-b[0])
heigth = int(b[3]-b[1])

out_shape = (heigth, width)
out_array = np.zeros(out_shape, dtype = 'uint8')

# Create a metadata directory
meta = {'driver': 'GTiff',
        'dtype': 'uint8',
        'nodata': 255,
        'width': width,
        'height': heigth,
        'count': 1,
        'crs': {'init': 'epsg:4326'} ,
        'tiled': False,
        'compress': 'lzw',
        'interleave': 'band'}

with rasterio.open(out_fn, 'w', **meta) as out:

    # Create a generator for geom and value pairs
    grid_cell = ((geom,value) for geom, value in zip(g.geometry, g.id))

    burned = features.rasterize(shapes=grid_cell, fill=0, out_shape = out_shape)
    print("Burned: \n", burned)
    out.write_band(1, burned)

# Read the output back in and check
r = rasterio.open(out_fn)
show(r)

Nevertheless, the output is not what I expected. Value and the coordinates are both erroneous.

I do not understand what happens to the zip object, which looks totally fine.

list(zip(g.geometry, g.id))
Out[7]:
[(<shapely.geometry.polygon.Polygon at 0x21ac459ecf8>, 0),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ee48>, 1),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ee80>, 2),
 (<shapely.geometry.polygon.Polygon at 0x21ac459eeb8>, 3),
 (<shapely.geometry.polygon.Polygon at 0x21ac459eef0>, 4),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ef28>, 5),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ef60>, 6),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ef98>, 7),
 (<shapely.geometry.polygon.Polygon at 0x21ac459efd0>, 8),
 (<shapely.geometry.polygon.Polygon at 0x21ac459ee10>, 9),
 (<shapely.geometry.polygon.Polygon at 0x21ac459eda0>, 10),
 (<shapely.geometry.polygon.Polygon at 0x21ac459edd8>, 11),
 (<shapely.geometry.polygon.Polygon at 0x21ac45a60f0>, 12),
 (<shapely.geometry.polygon.Polygon at 0x21ac45a6128>, 13),
 (<shapely.geometry.polygon.Polygon at 0x21ac45a6160>, 14),
 (<shapely.geometry.polygon.Polygon at 0x21ac45a6198>, 15)]

burned
Out[8]:
array([[ 0,  3,  7, 11],
       [ 0,  2,  6, 10],
       [ 0,  1,  5,  9],
       [ 0,  0,  4,  8]], dtype=uint8)

I have three main and one extra questions:

Where in the code I am doing the error(s)?
How should I properly define the metadata without a template raster?
Is there a way to rasterize multiple bands simultaneously (so n columns from the GeoDataFrame, not just one)?
why does the g.geometry column contain 5 coordinate pairs, first and last being the same, and not 4?


texts: Connecting two line ends in QGIS without resorting to other software

texts:
I have two adjacent (ends meet to make one line) polylines in QGIS. I need to properly connect the two ends of the two sections. I've tried the obvious (and less obvious too) but QGIS won't forget that they started out as two lines.

On this occasion my overall aim is to create a GPX track using a set of currently unconnected lines with meeting ends (i.e. unconnected in the data, but end to end geometrically). I guess that QGIS needs to understand how each line is meant to connect together - after all it would still be a valid GPX track with one section of line in the track, followed by another random section, and then a third, and so on.

Typically the issue is that QGIS does just this - so that the GPX track isn't one continuous line (I get separate 'trkseg' sections of track).

To (try to) make one track line I have:

used a python script to reverse any lines drawn in the wrong direction so that they all point the same way;
run the Topology Checker plugin to look for 'dangling ends'; and with snapping turned on dragged the offending ends apart and then brought them back together.
used 'merge features' to make the two (or more) lines into one.

and then saved as a GPX track. I've done these things repeatedly and in differing orders and with more than one set of data. It rarely works.

What does work is having taken the above steps - to save the data as a MapInfo TAB file, load it in MapInfo, use MapInfo's 'combine' command, save, re-open in QGIS, save back into a SHP file... then create the GPX track (which often works).

My interpretation of this is that QGIS is never correctly combining the lines into one - even though the endpoints of the lines are correctly orientated (one in the same place as the other).

Is there some hidden "permanently combine" feature which is stronger than "merge features"?

I've read (I think) that it might be possible to use GRASS to do this - but as I already have a solution using a different package I haven't pursued this. I was hoping for a simple solution.


texts: Shapefiles with phantom (deleted) features become corrupted when edited with LTR version (2.14.5)

texts:
We seem to have come across an issue whereby a Shapefile that has been created/edited with previous versions of QGIS and has phantom (deleted) features, as discussed/resolved in Bug Report 11007, now edited in the current LTR (v2.14.5) becomes totally corrupted upon saving edits.

Upon saving, some of the deleted features reappear, others disappear and attributes become totally jumbled and attached to different objects in the table.

I have tried opening the layer, enabling editing, adding a feature and saving edits, removing the layer from the project and then re-adding, but this DOES NOT 'pack' the table and clean out the deleted features. Nothing I have tried except the trusty old 'save-as' of the entire layer, cleans it and reduces the feature count to the correct number of features.
Without doing a save-as, if a new feature is deleted, or a node added to an existing feature (or an edit such as a cut or merge of features), then as soon as the edits are saved, a "_packed" version of the SHX and SHP is created and the shapefile that remains is corrupted.

Has anyone found a successful method to clean a shapefile without having to do a 'save-as' of every layer we have ever edited in QGIS?


texts: Inserting points into SQL Server using pymssql?

texts:
I am collecting X and Y values from a web service (Twitter) via a python script.  In the long run, this will run over a period of months and I intend on stopping at around the 6 million point mark.

The original coords im getting are geographic WGS84, but I will need to convert these to projected WGS Web Mercator.  Ill be later publishing this table to an ArcGIS Server map service and caching it.

This is a personal project to learn python with no deadline and was wondering if it would be a good idea to solely make use of the native spatial types from SQL Server?

My current untested plan:

CREATE a table with SSMS, with a GEOMETRY field setup (and some other attributes)
In my python script, make use of arcpy or pyproj to convert the lat/lons in WGS84 to WGS84 Web Mercator (or can I avoid this somehow and its all achievable with SQL?)
Make use of pymssql to INSERT records, and insert the points into the GEOMETRY field in the table.

My question is, what would be a good, simple and efficient approach to take a pair of lat/lons in WGS84, and then insert them into a SQL Server table making use of SQL Server spatial types and have a resulting points layer that is in WGS84 Web Mercator, so that I can render/query them in ArcGIS Desktop 10.1?

I do have access to arcpy/ArcSDE 10.1 if need be but was hoping to use this as an example of not requiring ArcSDE.


texts: Landsat 8 composite image using different resolutions?

texts:
I have created a composite image of Landsat 8 using bands 2 to 7 (blue, green, red, NIR and SWIR) using ArcGIS 10.1. For bands 2-4, I've pansharpened them to 15m spatial resolutions using the panchromatic band, while bands 5-7 are in 30m spatial resolutions.

Will the different spatial resolutions pose a problem when I perform image classification later on?


texts: Loop through multi-input list/selection?

texts:
I'm back with a script I've previously posted about that I'm constantly improving.

Below is a working script that is connected to a database with 52 feature classes on a server that, when having user specified inputs for a parish name and output folder, extracts features that were selected by location from that database.

What I'm trying to add is the optional parameter of being able to select which feature classes/layers to extract from, instead of extracting all 52. I figured I would create a multivalue list input and have it loop through that by adding an if statement for the optional list paramater but how can I get a list of the feature classes from the database so that the user can select from those and add them to a list as a single list parameter?

import arcpy
from arcpy import env

env.workspace = r'\\server\database.sde'

stateFeature = r'\\server\state.shp'
parish = arcpy.GetParameterAsText(0)
output = arcpy.GetParameterAsText(1)
nameField = "PARISH"

arcpy.CreateFileGDB_management(output, parish)

arcpy.Delete_management('SelectionStateLayer')
arcpy.Delete_management('lyr')

arcpy.MakeFeatureLayer_management(stateFeature, 'SelectionStateLayer', '"' +
str(nameField) + '" = ' + "'" + str(parish) + "'")

for fc in arcpy.ListFeatureClasses():

    if arcpy.Exists('lyr'):
        arcpy.Delete_management('lyr')

    arcpy.MakeFeatureLayer_management(fc, 'lyr')
    arcpy.SelectLayerByLocation_management('lyr', "WITHIN", 'SelectionStateLayer')

    outname = fc.replace(".","_")
    outpath = output + r'/' + parish + '.gdb' + r'\{0}'.format(outname)

    arcpy.CopyFeatures_management('lyr', outpath)

arcpy.Delete_management('lyr')

arcpy.env.workspace = output + r'/' + parish + '.gdb'

for fc in arcpy.ListFeatureClasses():

    if int(arcpy.GetCount_management(fc).getOutput(0)) == 0:
        arcpy.Delete_management(fc)
        arcpy.AddMessage('Deleted "{}" because it contains no features!'.format(fc))


texts:
I'm trying to display a layer on top of a WebGL Earth view inside an Asp.Net 5, MVC 6 website. I have no problem to do this in a desktop application, but I am totally unable to do it on the website.

I have all the data in a shapefile database, and access it with SharpMap. I create a SharpMap.Map object and provide a web method (GET) to fetch the image.

[Route("Zoo")]
public IActionResult Zoo(string service, string version, string request, int x, int y, int z)
{

    if (request == "GetMap")
    {
        Image image = MapRepository.Map.GetMap();

        return base.File(image.ToStream(ImageFormat.Png), "image/png");
    }
    else
    {
        // return capabilities
    }
}

However the image returned does not match the 3D globe on WebGL earth. Initially I wanted to create an WMS compliant service, but I couldn't find any working samples nor tips on how to do this.

Also, SharpMap is not updated for MVC6 and the only sample I could find won't work, since it's using the old HttpContext.

Maybe the whole approach is wrong, and I should be returning the polygons an let WebGL do the render... I'm not sure.

Currently I just need to display country borders and fill each country with a given color. If there's a better way than what I'm doing, I'd be happy to know!


texts: Distance of points in polygon to nearest polygon edge

texts:
I have a polygon shapefile with about a dozen polygons (Area.shp). I have an equation that calculates a value for points (or small areas) as a function of distance to the edge of these polygons. I would ultimately like to apply this function to all points within each of these polygons and sum them (within each polygon) to get a single value for the polygon.

It seems like one of those things that shouldn't be too difficult, but I can't seem to get a working solution. I had an idea of converting the shapefile to raster then raster to points then taking the distance of each point to the nearest polygon edge, then apply the equation. It seemed like a reasonable, if clunk solution but unfortunately, I get all sorts of errors during various conversions using ArcMap 10.

Does anyone have any suggestions on how to do this? I am happy to use ArcGIS, QGIS, GRASS, Python, or export to R or any other solution. I am a novice in all of these systems (except R) but am willing to use whatever works.

[UPDATE] Additional Information: When I was thinking of points, it was really as a way to approximate numerical integration. I have an equation where the number of animals within a particular patch of habitat (polygon) is a function of distance to the edge of the habitat (nearest edge of the polygon). The equation is a 4pt logistic function

N(i) = C + A/(1 + e^-(x-D)/B)

where all values are known (previously estimated) constants except x which is distance to the edge. N(i) is the number of animals in a small area, roughly 2 m^2. I'm interested in how the size and shape of habitat patches (polygons) affects the total N (sum of N(i) within a polygon) in a patch. I have a variety of patches identified from GIS layers as a single shape file with about a dozen polygons. For the purpose of this study, I can assume that no polygons overlap.


texts: ArcGIS Runtime SDK features not updating visually after edit

texts:
I've got all the logic for updating the features and making edits complete and works like a charm. My biggest issue is that I cant get the symbology to update after the edits are made. I have tried using the refresh method but that still is not working. I have to manually reset the map view to get it to refresh properly and that's extremely inconvenient.
private async void UpdateShapefile(ArcGISFeature feature)
{
    try
    {
        if (feature != null)
        {
            //await ((ArcGISFeature)feature).LoadAsync();
            feature.Attributes["Operator"] = OperatorPicker.SelectedItem.ToString();
            feature.Attributes["Date"] = DatePicker.Date;
            await RoadTable.UpdateFeatureAsync(feature);
            await RoadTable.ApplyEditsAsync();
            feature.Refresh();
        }
        else
        {
            return;
        }

    }
    catch (InvalidOperationException ex)
    {
        Debug.WriteLine(ex.ToString());
    }

}


texts: How to modify the columns to geometric points

texts: How make points geometric if already exist columns with data like column names are gps_latitued and gps_longititude  in mapping table


texts: Cannot find pythonwin on my ArcGIS 10.1?

texts:
What is the version for the Python in ArcGIS 10.1 and what is the build ? My laptop does not show having pythonwin in the folder under

C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin.

Is there something I need to re install or install the latest version or build for that software ?


texts: Publishing existing Mapbox Vector Tiles using GeoServer?

texts:
I am new to Geoserver so it's entirely possible I'm missing something obvious.
I have a large set of vector tiles created by another process in a complex workflow, and I would like to publish them as a service. I found this tutorial
but it mostly pertains to publishing vector tiles from existing layers and doesn't really touch upon my situation, where the vector tiles have been created for me.


texts:
I am trying something very simple, but strangely it doesn't work.
I need to zoom to the extent of coordinates.

THE FUNCTION:

  function zoomBE(search_result){
    var coordinates = [];
    for(var i = 0; i <search_result.length; i++){
      coordinates.push(search_result[i].geometry.coordinates);
    }
    var boundingExtent = ol.extent.boundingExtent(coordinates);
    view.fit(boundingExtent, map.getSize());
  }

I checked the boundingExtent and it is a valid array, like: [9.081426, 45.80251, 9.081426, 45.80251]

map.getSize() also returns valid.

What happens here is that it zooms to [0.0001, 0.0004].

Any ideas on what can be wrong? (OpenLayers version is 3.13.0)


texts: Resizing image resolution in ArcGIS Desktop?

texts:
I have NDVI images (250 m) and Soil map (1000 m).

How can I change the resolution from 1000 m to 250 m, so I can compare/work with them?


texts: How to use values such as 2014-03-31T15:00:33.000Z in QGIS Time Manager?

texts:
I´m trying to use the QGIS Time Manager plugin but I have a problem with my attribute columns.

Time Manager supports %Y-%m-%d %H:%M:%S format but my dataset uses the following format in the timestamp column

2014-03-31T15:00:33.000Z

How can I use the plugin?
Do I have to format my column ?


texts: Connect GeoServer to ESRI PostgreSQL database

texts:
I want to connect to an Enterprise geodatabase in PostgreSQL from GeoServer. The ESRI GDB is not running a SDE instance. Can I do a direct connection from GeoServer? What is the right way to put the connection values in GeoServer? Host, Instance?

I tried to connect using Postgis and Postgis JNDI connections and I didn't get to connect. I modified the context.xml following https://docs.geoserver.org/stable/en/user/tutorials/tomcat-jndi/tomcat-jndi.html

The postgres database hasn't got postgis extensión, Doesn't it mind to connect as Postgis?


texts: (Smooth) Isoline Extraction from TIN - Algorithms

texts:
Can anyone point me to a clear document or algorithm for extracting smooth isolines from a Triangular Irregular Network?  I've seen some examples using the jagged linear methods, but can't seem to find good documentation on how to do the process using a smoother method like Natural Neighbor / Radial Basis / Quadric / etc...

Thanks!


texts: Failure to copy domains ARC copy file geodatabase?

texts: I am  using ARC copy file geodatabase to convert my current file database to an earlier version. I have made all features visible in the table of contents and when I invoke the tool the  table of contents flash and it creates a named gdb in the correct location but it does not copy any domains. All domains are within my current gdb. I have checked file and folder access and they are all read / write and have done a simple feature copy and that works.


texts:
I'm not very sure if we can still connect GRASS with R. I was trying with my GRASS 7.8 and R 3.6.2 in both directions suggested in R statistics wiki.

I have installed and loaded rgrass7, but have difficulty running functions. Here is an example of my setting the GRASS environment:

initGRASS(gisBase = "C:/Program Files/GRASS GIS 7.8",
          home = getwd(),
          override = TRUE)

Error : XML content does not seem to be XML: ''
In addition: Warning message:
In system(cmd0, intern = TRUE) :
  running command 'g.proj.exe --interface-description' had status 5
Error in parseGRASS(cmd, legacyExec = legacyExec) : g.proj not parsed

I have the same problem starting R in GRASS either. I can type in rstudio in the GRASS command line to initiate R, but when I was trying to run any functions (e.g. execGRASS), I got the exact same error information.

Has anyone had the same problem before? I'm not sure what the error message means.


texts: Clipping polygons within a certain range

texts: I have a map consisting of polygons and a line. I need to a new shapefile of polygons that are to the west of the red line, and are between the northmost and the southmost ends of the line. How can I do it in QGIS?


texts: Configuring ArcGIS Pro Pop-up with same Image for every feature?

texts:
As a step to a better understanding of my options for configuring ArcGIS Pro Pop-ups with an Image, I have gotten as far as right-clicking on a layer, choosing Configure Pop-ups to open the Configure Pop-ups pane, and clicking the Image button to see an Image element on that pane:

I then click the pencil button to edit the Image pop-up element where I want to attach the same image from a URL to every feature.

To do that I thought it might be as simple as finding an image at Wikimedia Commons like https://commons.wikimedia.org/wiki/Ship#/media/File:DANA_2004_ubt.jpeg and copy/pasting that URL in as the Source URL:

but when I did that, and back arrowed to test it, the pop-up that appeared was as below:

How can I get this pop-up to show me the image that I tried to link in using that URL?


texts: How to get the area of two interesecting polygons divided into attributes on PostGIS

texts:
I am trying to calculate the area overlap two vector polygon layers.
I have the one based layer - soil map and I have second layer - plots.
The example below:

I would like to know how much area each class takes.
I created a few queries (one for each class) and I merged to my statistics table. But this solution is too time consuming.
create table class_I as (
select e.id, sum(st_area(st_intersection(g.geom,e.geom))) as area
from plots e, soils g
where st_intersects(g.geom,e.geom) and g.class='I'
group by e.go_id);

I am looking for a solution that allows me to calculate all classes at once.
I would like my output to look something like this:
plots || area_classI || area_classII || area_classIII
  1   ||     0       ||   52864,28   ||     0
  2   ||    128      ||      0       ||  258687,89


texts: Creating a new Feature Class (ArcCatalog)

texts:
I have ArcGIS 9.3 and when in ArcCatalog, when I R click to create a Feature Class (turn FC), it is greyed out.  Do you need a particular license or ArcEditor/Info to have it?

I went into the toolbox, and when I click the Turn Feature Class in the toolbox, it says i don't have the proper extension/license for it.

A little help here, please.

Thanks,
Zoran


texts: Text element not updating in arcpy.mapping?

texts:
I am trying to get a text element to input an address using the below code. It seems that the code picks up the right elements, is finding the text elements I want to change but isn't able to actually change the text element. I'm not getting any errors so I'm not sure why it's not working.

newmxd2 = arcpy.mapping.MapDocument(newmxd)
totalAddress = address + " " + street
for text in arcpy.mapping.ListLayoutElements(newmxd2, "TEXT_ELEMENT"):
    print(text.name)
    if text.name == "Address":
        test = text.text
        text.text = totalAddress
        print("Address has been changed from {0} to {1}.".format(test,totalAddress))
    if text.name == "WO":
        text.text = str(wo)
        print("Work order has been changed to {0}.".format(wo))
    else:
        print("Text and WO elements not found.")


texts: I lost selection and navigation tools from the GGIS 1.8 toolbar when I tried drag then to different place. I can't get them back anymore. Where they disappear? All these tools are checked but are still missing.


texts: Merging overlapping polygons with Dissolve?

texts:
I created a service area of multiple facilities and as a result I got a feature class with multiple overlapping polygons of the same value.

To merge all these polygons I tried to use Dissolve tool using "Travel Time" as a dissolve field, however the output of the Dissolve tool is represented in ArcMap as just a single polygon, even though attribute table looks like this ("ToBreak" is in minutes and correspond to "TravelTime"):

I tried to check/uncheck "Create multipart features" option, but result was always the same. Also when I switch the Dissolve output to hollow symbol, I can see boundaries of merged polygons. Am I missing something? How to merge overlapping polygons?


texts: QGIS map canvas: how to hide point of origin?

texts:
In the QGIS map canvas (main window), the point of origin of the coordinates is always shown as a small, blue square.
How to change the style of and hide this square?
I looked for the option in the menus View as well as Settings - options, without success.


texts: Display data of attribute table in different tabs

texts:
I have a Layer with polygons; for each polygon there are different datasets for the last 3 years. Every year some of the data changed, e.g. what was grown on the field, etc. It would be great if I had a tab for every year so I could switch between them and compare them. At the moment it is shown among each other and pretty chaotic.

I can split this dataset in single layers if it helps, so I can either have 1 Layer with all the data or 3 with different data. They all have the same attributes just with other values, only the id for all polygons representing the same area is the same.

The answer is not fitting for me because i have over 900.000 entrys in my attribute table for each year. Besides i want to add data over the years so i need to automate the process. My plan so far was that i can upgrade the database in postgis and just add it as a layer in qgis. I found something close to what i am looking for at irriSAT. I will post a picture here. The red polygons are the entrys i have. For each field i have different data. If i click the polygon i want some kind of tab with the data displayed shown up where i can select the different years. I know this is really specific but that would be perfect.

First picture would be my qgis display (the red outlining doesnt need to be displayed).

Second picture would be the window that opens if i click one of the polygons wich contains data. I dont need any of these fancy graphics just my plain data. It would be great if i could tab or select the year i want to show somewhere in this window


texts:
I need to rasterize a part of OSM map by coordinates. I found rather good algorithm, but can’t finish it. I have problems in STEP 3.

I described all algorithm here – may be someone have the same task.

STEP 1:
Create a polygon (box polygon) with cover of wanted part of map.

Function (or query):

INSERT INTO rast.box (box_geom)
VALUES (ST_GeomFromText('POLYGON ((30.200 59.920, 30.200 59.960, 30.260 59.960, 30.260 59.920, 30.200 59.920))',4326));

Order of creating points (corners coordinates): lowLeft->upperLeft->upperRight->lowRight->lowLeft. 5 points.

STEP 2:
Use ST_Overlaps and ST_Within to choose geometry objects inside box polygon. In my example -  polygons of buildings.
My Function:

INSERT INTO rast.over
SELECT g.geom
FROM rast.spb g, rast.box b
WHERE ST_Overlaps (g.geom, b. box_geom)=true
OR
ST_Within (g.geom, b. box_geom)=true
AND
b.id=1;

b.id is id of box polygon.

STEP 3: Use ST_AsRaster and ST_Union for rasterization all of objects and union in one.
I found posts about this theme (http://geospatialelucubrations.blogspot.ca/2014/05/a-guide-to-rasterization-of-vector.html, and this one is good too: postgis.17.x6.nabble.com/Rasterize-a-vector-td4997893, sorry I can post only 2 links), but I don’t understand some things:

Substep 3.1:    In first guide, the author used two tables – first named “forestcover”, second named “elevation”, but I have only one table with OSM geometries.
When he used ST_AsRaster, he used the second parameter:  raster ref (from http://postgis.net/docs/RT_ST_AsRaster.html).
Could you explain how can I use it?

Substep 3.2:
    My function:

CREATE TABLE rast.result  AS
SELECT ST_AsRaster(q, 100, 100, '4BUI')
FROM rast.over;

When I’m trying only to rasterize (without union) – it’s working. The table with special column is created. And I also find the result table with rows (I have 1700 geometry objects and I have 1700 rows with raster  type ).
But the rows are empty! Why?
I try to look from pgAdmin3.
And when I try to see this raster table in QGIS2.4 (through DB Manager), I have this Error:

  “Error, the table rast.airports contains tiles with different srid.
  This feature is not yet supported by the PostGIS Raster driver.
  Please, specify a table that contains only tiles with the same srid or
  provide a 'where' constraint to select just the tiles with the same
  value for srid”

I checked table in ST_SRID and all of rows are in the same srid (in 4326).

Substep 3.3:
    When I try to union the raster from the result table or from this function:

CREATE TABLE rast.result AS
SELECT
ST_Union(ST_AsRaster(q, 100, 100, '4BUI'))
FROM rast.over;

I have this Error in pgAdmin sql-console:

  rt_raster_from_two_rasters: The two rasters provided do not have the
  same alignment

May be the problem is with “alignment”? How can I fix it?

STEP 4: My last step should be to convert postgis raster to GEOtiff. And I’m going to use ST_AsTiff.

Please, help to solve these problems!


texts: Determine spatial average of several tiff files

texts:
I am relatively new to GIS.

I have a set of tiff files containing a raster each. I would like to average them, though their extents are slightly different. They each have their geospatial data recorded in their GeoTransform attribute. I am working in Python.

I have attempted to use GDAL to build a vrt and then average the resulting array, but I am given an error I cannot solve.

My attempt is based off this question here:
raster algebra in python with rasters of different extents

#Conglomerate tiff files into a vrt
os.system('gdalbuildvrt obs_avg.vrt %s'%('Obs_tiffs/*.tif'))

print '-----Attempting to open'
g = gdal.Open('obs_avg.vrt')
data = g.ReadAsArray()
mdata = np.ma.array(data, mask=(data==0))
mean = mdata.mean(axis=0)

#Checking output
print type(mean)
print data.shape
plt.imshow(mean)
plt.show()

However, I am given the following error:

0...10...20...30...40...50...60...70...80...90...100 - done.
gdalbuildvrt does not support positive NS resolution. Skipping outdir/Obs_tiffs/inputfile.tif

Which causes the vrt to not be created.

What is the cause of this error?


texts: Showing years 1995-2000 in "Select features using expression" in QGIS

texts:
I have an attribute table that shows states, years, and other specific things of that state in that year.  How do I create an expression (so I can export a shapefile with these selected features) that:

Selects a state
Selects only the years 1995-2000 of that state

"st" = 'CA' AND "yr" = '1995' AND "yr" = '1996' etc.

does not work...

Solution:

"st" = 'CA' AND "yr" = '1995' OR "yr" = '1996' OR "yr" = '1997'