texts: Disable Leaflet layer check box in a layer control w/ zoom

texts:
I would like to have layers listed in my layer control, but have their check boxes disabled when zoomed out beyond a certain level.

I am asking the same question that is found here, but with Leaflet instead of OpenLayers.

This is admittedly a "has this already been done" question. I could try to figure out if it can be translated easily from the OpenLayers example above, but maybe someone has accomplished this already?


texts: Algorithm to generate shapefile from point cloud

texts:
I have a dataset (OS CodePoint Open) which contains a latitude and longitude for every postcode in the UK, but no shapefile information on the postcode itself. (I know I can buy a the shapefiles from OS, but would prefer not to).

So essentially I have a point-cloud. Is there an alogorithm (or, ideally some Python code) which would allow me to generate polygons for each of the points? I'm sure there must be, but not knowing what search terms to use is leaving me a bit stumped. I know they wouldn't be as accurate as the real shapefile data from OS, but for the purposes of choropleths they would be fine.


texts: Creating contours based on polyline using ArcMap?

texts:
I would like to create a simple floodplain map. I have LiDAR data with 1 meter accuracy. I have clipped it to a small area of interest that my computer can handle processing the LiDAR. I want to create contours based on a specific river, where flooding is likely to occur. That way I can create map with intervals of 1 foot above river, 2 feet above river...etc. The problem is using the contour tool, you can't base them off a polyline, only a base elevation. This is not useful since as rivers descend, the "base" elevation will change. I am using ArcMap 10.6.

Is this possible to do?


texts: OpenLayers 2 increase timeout for WPS call

texts:
I am calling a WPS process with OpenLayers 2 (I know it is deprecated). I use the function OpenLayers.Request.POST and post an XML file. This works fine for "normal" requests. But I also need to call a process which needs at least 10 minutes to complete. But after ~ 5 minutes it seems that the connection is getting dropped and the request fails.

How can I increase this time limit in my JavaScript? Is this even possible or does the browser needs to be reconfigured for this?


texts:
I have been struggling for a few hours trying to transform SpatialDataFrame coordinates to another type. I have two objects from two different sources, I need to plot them together.

> class(Object1)
[1] "RasterLayer"
attr(,"package")
[1] "raster"

> head(coordinates(Object1))
            x        y
[1,] 13.35000 46.99917
[2,] 13.35083 46.99917
[3,] 13.35167 46.99917
[4,] 13.35250 46.99917
[5,] 13.35333 46.99917

> projection(Object1)
[1] "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=-5000000 +ellps=bessel +units=m +no_defs"
[6,] 13.35417 46.99917

> class(Object2)
[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"

> coordinates(Object2)
          [,1]     [,2]
7657  454777.5 119375.8
32166 539358.5 129256.9
49121 617992.2 151211.0

> projection(Object2)
[1] "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=-5000000 +ellps=bessel +units=m +no_defs"

If I try to plot them together, only the first Object is displayed.

library(tmap)
tm_shape(Object1) +tm_raster() +tm_shape(Object2) + tm_borders()

One might hope that this would work, but only in my dreams:

> coordinates(Object2) <- coordinates(Object2)/10000
Error in `coordinates<-`(`*tmp*`, value = c(45.4777468962329, 53.9358522795272,  :
  setting coordinates cannot be done on Spatial objects, where they have already been set

I know that I should use spTransform(), but simply I don't know how to correctly reference the transformation.


texts: Cloning existing map to another container using OpenLayers?

texts:
I have a map created using OpenLayers 4 ,i want to take a print out of the map , before taking the print , i want to see its preview , So I need to clone the map to another container without making any problem with parent map , so i ve tried all these ,

 let map2=this.createMapWithExistingView('previewmap',this.parentMap.getView());

createMapWithExistingView(t,v) {
    let mapObj = new olMap({
      layers: [

      ],
      target: t,
      controls: olControls.defaults({ attribution: false }),
      interactions: [
        new olDragPanInteraction(),
        new olMouseWheelZoomInteraction(),
        new dragrotateandzoom()
      ],
      view:v
    });
    return mapObj;
  }

but its not showing the map , only default zoom controls , when i clicked on zoom of preview map, zooming occurs on parent map.


texts: Is there a website that will guide me through for various kind of paper size to create a/ or several presentation for digital or hardcopy maps/ or poster with different fonts, display area, title and so on. I am more interesting in reading on what is the recommend for the font size and the paper size.


texts: Google Earth Engine: acos (arc cosine) does not produce any values

texts:
I want to generate a time series of degree days, where 30°C is my threshold of interest, using the daily era5 data. I am using this formula:

default case 1: tMax <= 30: gen dday30C = 0;
case 2: bound(=30°C) <= tMin;  replace dday`30C = tAvg - 30 if (30 <= tMin);
case 3: tMin < 30 < tMax;  gen tempSave = acos( (2*`b'-tMax-tMin)/(tMax-tMin) );
replace dday30C = ( (tAvg-30)*tempSave + (tMax-tMin)*sin(tempSave)/2 )/_pi  if ( (tMin < 30) & (30 < tMax) );

I started to write the code (Not finished yet) and I guess I do not do it in the most elegant manner as I generate a lot of help variables (DD_0-DD_5) (see my code below). But, my main problem is that when I use the acos() function (DD_5) to calculate arc cosine (see the formula above), I do not get any values. What do I do wrong?

 var dataset = ee.ImageCollection('ECMWF/ERA5/DAILY')
                  .filter(ee.Filter.date('2015-04-01', '2015-05-20'));
var landSurfaceTemperature =dataset.select('minimum_2m_air_temperature' , 'maximum_2m_air_temperature');

// Create a geometry representing an export region.
var regions = ee.FeatureCollection('users/barborasedova/gadm36_BFA_2')

//Translate into degree celsius

var tempCelsius = landSurfaceTemperature.map(function(image){
    var props = image.toDictionary(image.propertyNames());
  var Celsius = (image.subtract(273.15));
    var CelsiusMasks = Celsius.updateMask(Celsius.select('maximum_2m_air_temperature')).updateMask(Celsius.select('minimum_2m_air_temperature'));
  var meanCelsius = CelsiusMasks.reduce('mean').rename('meanTemp');
  var bound=ee.Number(30);
    var Tmin=CelsiusMasks.select('minimum_2m_air_temperature').rename('Tmin');
  var Tmax=CelsiusMasks.select('maximum_2m_air_temperature').rename('Tmax');
   // * case 2: bound <= tMin; qui replace dday`bLabel'C = tAvg - `b' if (`b' <= tMin);
  var DD_0 = meanCelsius.subtract(30).rename('DD_0');
  var DD_1=DD_0.where(Tmin.lt(30), 0).rename('DD_1');
  //* case 3: tMin < bound < tMax; qui gen tempSave = acos( (2*`b'-tMax-tMin)/(tMax-tMin) );
//qui replace dday`bLabel'C = ( (tAvg-`b')*tempSave + (tMax-tMin)*sin(tempSave)/2 )/_pi  if ( (tMin < `b') & (`b' < tMax) );
var DD_2= Tmax.subtract(Tmin).rename('DD_2');
var DD_3=bound.multiply(2);
var DD_4=((DD_2.multiply(-1)).add(DD_3)).divide(DD_2).rename('DD_4');
var DD_5=DD_4.acos().rename('DD_5');
// * default case 1: tMax <= bound;
//qui gen dday`bLabel'C = 0;
return ee.Image(Celsius.addBands([  DD_5   ]).setMulti(props));
});

var ts1 = ui.Chart.image.series({
  imageCollection: tempCelsius,
  region: regions,
  reducer: ee.Reducer.mean(),
  scale: 1000,
  xProperty: 'system:time_start'})
  .setOptions({
     title: 'LST 2015 Time Series',
     vAxis: {title: 'LST Celsius'}});

print(ts1);


texts: Has anyone got River Corridor Survey Symbols for MapInfo?


texts: What is happening with the centroids that are not on the road layer when you use the Shortest path (layer to point) from Network Analysis?

texts:
I am using QGIS 3.8.1 and I want to compute the shortest path of the centroids of any commune to Paris using the roman network. The centroids are the yellow points the road net is the green lines. There are a lot centroids that are not on the road network. The function Shortest path (layer to point) from Network Analysis
worked and I have the cost column with values for all the communes.

However, in case that the centroids are not on the road what does function take into consideration?

The final outcome (Cost column) is in layer units?


texts: Correlating Point Samples and MODIS SST in Google Earth Engine

texts:
I've got a dataset of ~60 points that we've taken during a series of oceanographic cruises where we were sampling, among other things, sea surface temperature. I'm interested in comparing these point samples to MODIS SST but I'm not sure exactly how to efficiently go about filtering MODIS by each point in my series in GEE. Is there a good way to find the closest MODIS image to my point sample date but not include it if it is outside of some date range?

I've got the basics but I'm not sure where to go from here:

var modis = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI')
var point_samples = ee.FeatureCollection('my collection of points')

var modis_filtered = modis
                  .filterDate('2018-08-01', '2018-8-15') // I want to filter by each point
                  .median();

var modisSST = modis_filtered.select(['sst']);


texts: How to display multiple points in a torque map with CartoDB

texts:
I would like to create a visualization with multiple points change size based on a certain value, right now I only have one (check it out) I need them all to change at the same time.

I see visualizations (like this one) and they have multiple points changing location at once.

I know that I am only allowed to add one torque layer to a map at a time in CartoDB.

How would I go about doing this?


texts: ArcGIS JavaScript 3.3 add ArcGIS REST API Queried Feature Layer URL as Layer

texts:
Using the Query Generator on an ArcGIS REST Feature Layer, I generated a URL that filters the data by a geometry extent ({xmin: -104, ymin: 35.6, xmax: -94.32, ymax: 41})

This returns Current River Conditions from 417 Gauge Stations from the NWS Observations Rest Service.

I want to take this queried layer and add it as a layer in an ArcGIS JavaScript 3.30 Application I am building. I was previously able to add the entire layer (no extent query) as a Feature Layer like so:

#--------------Flood Stages-------------
/*
1) Current Flood Stage Points for Texas with custom symbology and attribute info
*/
var currentFloodStg = new FeatureLayer("https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Observations/ahps_riv_gauges/MapServer/0", {
    copyright: "NOAA/NWS/NWC"
});
map.addLayer(currentFloodStg);

However it is a requirement that I filter down the number of points to a restricted area, I am aware that I can potentially query this Feature layer as a Graphics Layer, however considering I have the queried ArcGIS REST API URL, is there a way to add this as an interactive layer on the map through the URL produced by the Query Generator without needing to perform the queries using JavaScript?

I suppose I could adjust that URL to produce a GeoJSON/KMZ/JSON output, and then map that file type in accordance to how the ArcGIS JavaScript 3.30 API documentation dictates that particular data structure can be mapped as its own layer. If there is a simpler method I am all ears!


texts: Unable to catch exception in opening a shapefile geotoools

texts:
I am loading a shapefile where .shx file is missing I am getting the following error. I am unable to catch this exception please help me.

error log:

  Could not open the .shx file, continuing assuming the .shp file is not
  sparse java.io.FileNotFoundException: D:\shapes\123.shx (The system
  cannot find the file specified)   at
  java.io.RandomAccessFile.open(Native Method)  at
  java.io.RandomAccessFile.(RandomAccessFile.java:216)    at
  org.geotools.data.shapefile.ShpFiles.getReadChannel(ShpFiles.java:831)
    at
  org.geotools.data.shapefile.shp.IndexFile.(IndexFile.java:79)
    at
  org.geotools.data.shapefile.shp.ShapefileReader.(ShapefileReader.java:268)
    at
  org.geotools.data.shapefile.shp.ShapefileReader.(ShapefileReader.java:240)
    at
  org.geotools.data.shapefile.ShapefileDataStore.openShapeReader(ShapefileDataStore.java:599)
    at
  org.geotools.data.shapefile.ShapefileDataStore.readAttributes(ShapefileDataStore.java:826)
    at
  org.geotools.data.shapefile.ShapefileDataStore.getSchema(ShapefileDataStore.java:784)
    at
  org.geotools.data.AbstractFileDataStore.getFeatureSource(AbstractFileDataStore.java:77)

code:

public boolean openShapeFile() throws Exception {
     File dataFile = new File(fileName);
     dataStore = new ShapefileDataStore(dataFile.toURL());
     SimpleFeatureSource source = dataStore.getFeatureSource();
     final SimpleFeatureCollection featureCollection = source.getFeatures();
     shapeFeatureIterator = featureCollection.features();
     return true;
 }
 try {
     openShapeFile();
 } catch (Exception exep) {
     return false;
 }

complete code

public class test
{
    public static void main(String[] args)
    {
        try
        {
            File dataFile = new File("D:\\shapes\\123.shp");
            ShapefileDataStore dataStore = new ShapefileDataStore(dataFile.toURL());
            SimpleFeatureSource source = dataStore.getFeatureSource();
            final SimpleFeatureCollection featureCollection = source.getFeatures();
            SimpleFeatureIterator shapeFeatureIterator = featureCollection.features();
        }
        catch(Exception e)
        {
            System.out.println("ERROR" + e.getMessage());
        }
    }
}

I tried this code after deleting the 123.shx file but I was not able to catch the above exception because the control not at all coming to catch block.


texts: legend groups and layer position/order qgis 1.8

texts:
I'm tring to programmatically create layer sequence also using groups.
Simple python code:

layer = QgsVectorLayer("004cp000.shp", "004cp000", "ogr")
QgsMapLayerRegistry.instance().addMapLayer(layer)
legend = qgis.utils.iface.legendInterface()
index = legend.addGroup ("G1")
index = legend.addGroup ("G2",index)
legend.moveLayer (legend.layers()[0],index)

How it is possible to remove a nested group ?
qgis.utils.iface.legendInterface().removeGroup only works with top level groups.
How a layer can be moved into a nested group?
qgis.utils.iface.legendInterface().moveLayer only works with top level groups.
How can I move a layer before or after a another layer inside the same group?

After some research into QGis Source code I've discovered that it is not possible to move a layer into a sub group and also it is not possible to delete a soub group.

void QgsLegend::moveLayer( QgsMapLayer *ml, int groupIndex )
{
  if ( !ml )
    return;

  QgsLegendLayer *layer = findLegendLayer( ml->id() );
  if ( !layer )
    return;

  QgsLegendGroup *group = dynamic_cast<QgsLegendGroup*>( topLevelItem( groupIndex ) );
  if ( !group )
    return;

  insertItem( layer, group );

  emit itemMovedGroup( dynamic_cast<QgsLegendItem*>( layer ), groupIndex );
}

void QgsLegend::removeGroup( int groupIndex )
{
  QgsLegendGroup * lg = dynamic_cast<QgsLegendGroup *>( topLevelItem( groupIndex ) );
  if ( lg )
  {
    removeGroup( lg );
  }
}


texts: I need to project a number of reef sites onto the coastline of southwest Madagascar. I was hoping to use R for this as I find ArcGIS too big and clunky. I need to create a basemap for both the reefs and coastline. Is there anyway to 'trace' an existing map and input the coordinates into R since reef are rarely shown on world maps. How would I do this?


texts: How to improve the resolution of low cost GPS dongle?

texts:
I recently bought a BU-353 G-STAR IV GPS receiver (common low cost GPS receiver in market). The update frequency according to the data sheet is 1 Hz. I set a baud rate of 4800 first and then 9600. But the map shows new position only after walking for 15 to 20 meters. Is this the norm? Is this because my GPS receiver's accuracy is 15 to 20 meters? Can I do any thing to obtain the current GPS location every second? i.e Can I update the resolution of the GPS dongle?

I am wondering why even the GPS in my smart phone seems to be at a higher resolution! The map shows continuous waypoints.


texts:
I'm working with GeoExt and Openlayers and HTML, and I need to draw a line when the user clicks an HTML button. I created a Function Prueba, but nothing happens. If I want to add a control with my function, it works perfectly. Thanks for your help. Here is my js code:

Ext.Loader.setConfig({
    enabled: true,
    disableCaching: false,
    paths: {
        GeoExt:"GeoExt"
    }
});

Ext.require([
   'GeoExt.panel.Map'
]);

Ext.onReady(function() {
    var me = this,layers = [];
      var apiKey =   "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";

        //Mapa OpenLayer
        map = new OpenLayers.Map('map');

        //Mapas OpenLayer WMS:Web Map Service////
        var Wms = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0",{layers: 'basic'});
        var OpnSt= new OpenLayers.Layer.OSM.Mapnik("Mapa OpenStreet");

        //Mapas de Google/////
        var gphy = new OpenLayers.Layer.Google(
            "Google Fisico",
            {type: google.maps.MapTypeId.TERRAIN}
        );
        var gmap = new OpenLayers.Layer.Google(
            "Google Calles",
            {numZoomLevels: 20}
        );
        var ghyb = new OpenLayers.Layer.Google(
            "Google Hybrido",
            {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
        );
        var gsat = new OpenLayers.Layer.Google(
            "Google Satelite",
            {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
        );
        //Mapa Bing
        var bing =new OpenLayers.Layer.Bing({
            key: apiKey,
            type: "AerialWithLabels",
            name: "Bing Aereo + Texto",
            transitionEffect: 'resize'
        });

        var bingRoad = new OpenLayers.Layer.Bing({
            key: apiKey,
            type: "Road",
            // custom metadata parameter to request the new map style - only useful
            // before May 1st, 2011
            metadataParams: {
                mapVersion: "v1"
            },
            name: "Bing Caminos",
            transitionEffect: 'resize'
        });

     //Creamos el Panel Switcher
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.addControl(new OpenLayers.Control.ScaleLine());
    map.addControl(new OpenLayers.Control.MousePosition({prefix:'Longitud | Latitud: ', separator: ' | '}));
    //Agregamos los tipos de Mapas
    map.addLayers([OpnSt,gmap,gphy,ghyb,gsat,bing,bingRoad]);

    var mapPanel = Ext.create("GeoExt.panel.Map", {
        renderTo: "DivMap",
        layout: 'fit',
        border:false,
        width: "100%",
        height: "100%",
        map: map,
        zoom: 2

    });
});

function Prueba(){
    var vector = new OpenLayers.Layer.Vector("Lineas");
    map.addLayer(vector);
    var line= new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Path);
    map.addControl(line);
}

and here is my HTML code when user clicks:

<input type="checkbox"  value="line" onclick="Prueba()" name="type"/>


texts: How to find features in Openlayers VectorTiles

texts:
I use MVT vector tiles with Openlayers and everything works fine - but now I have a conceptual problem.

I need to make features selectable and searchable. The problem is that there is no way to retrieve all features from ol.source.VectorTile, as you could do with ol.source.Vector using getFeatures() method.

So what do people do in this case? The only way I see is to maintain a extra list with all the features loaded from GeoJSON. But then using MVT vector tiles doesn't make sense any more as it is redundant to maintain the same information twice.


texts:
I am working on my thesis project, whereby I am assessing the sediment volume changes of the Wadden Islands, The Netherlands, as they responded to sea level rise.
I have Polygon shape files of the relevant sediment I need. I need to calculate the distance travelled by the sediment (landwards) over several years (i.e. between 5500BC and 3850BC and so on until present day). See attached image - Purple is the sediment position in 3850BC and pink 5500BC.
Is there any way I can calculate the distance between these two polygons?


texts: How to add a raster legend with min/max values in QGIS 1.6?

texts:
I calculated/made NDVI with landsat data using ERDAS. Results of NDVI is in black and white map but I need it in colour to present the scale for NDVI with value of pixels in Map Composition. How to make the NDVI map in colour in ERDAS?

I made the coloured map of NDVI in QGIS but in Map Composition I can not put the legend of the map with value of pixels. Is there any way to put the legend with values of pixels in QGIS?

Thanks a lot in advance.


texts:
I am a new in R and GIS, so I kindly ask you on advice. I had a shp which I want to plot on google map.

The shpfile is here: http://www.filedropper.com/exercisestanddata

First I do this:

ogrInfo(dsn=in.dir,layer="exercise_standdata")

The result is:

Source: "C:/", layer: "exercise_standdata"
Driver: ESRI Shapefile; number of rows: 65
Feature type: wkbPolygon with 2 dimensions
Extent: (336536.2 6443835) - (338175.4 6445697)
CRS: +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs
LDID: 87
Number of fields: 9
        name type length typeName
1       AREA    0      9  Integer
2  PERIMETER    0      9  Integer
3    FORTYPE    0      9  Integer
4   TYPETEXT    4      9   String
5    StandID    0      4  Integer
6    landuse    0      4  Integer
7 SI_Species    4     10   String
8  Stand_age    0      4  Integer
9   Volu_pha    0      4  Integer

Than I read in the shp with the receipt that I recieved in the The shape does not fit the ggmap

sh <- readOGR(in.dir, layer = "exercise_standdata", p4s = "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs")

Than I do:

sh@proj4string # note projection details
sh2 <- spTransform(sh, CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +no_defs"))
sh2@proj4string

# Plotting with ggplot - first transform shapefile to data frame
library(ggplot2)
sh2.df <- fortify(sh2)

names(df)
# And plot
ggplot(data = sh2.df, aes(x = long, y = lat, group = group)) +
  geom_polygon(colour = "grey20", fill = "white", size = 0.6)

However, now this does not work. It seems to work for the y-axis but not for x-axis that should be positive sth between 15-20.

What I did wrong? Can it be some problem with the shp? Can someone explain the way how to transform the shp from any projection type to longlat format that can be used with ggmap?

After `readOGR` I got following warning
OGR data source with driver: ESRI Shapefile
Source: "C:/Users/matliz/Documents/Heureka/Projects/PlanWise/Data/Ostad", layer: "exercise_standdata"
with 65 features
It has 9 fields
Warning message:
In readOGR(in.dir, layer = "exercise_standdata", p4s = "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs") :
  p4s= argument given as: +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +units=m +no_defs
 and read as: +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m +no_defs
 read string overridden by given p4s= argument value


texts: What would prevent ESRI JSAPI AMD modules from being cached?

texts:
I am using AMD style in the ESRI Javascript API (along with the esri application boilerplate: https://github.com/Esri/application-boilerplate-js).

For some reason, the AMD modules from the js.arcgis.com CDN do not appear to be cached and I've been unable to determine why.  Local AMD modules are caching fine:

Request headers:

Remote Address:54.230.50.98:80
Request URL:http://js.arcgis.com/3.10/js/esri/dijit/InfoView.js
Request Method:GET
Status Code:200 OK
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:rclg0=en; __unam=f220af1-14499213906-3dc5afe-11; esri_auth=[removed by author]
Host:js.arcgis.com
Referer: [removed by author]
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36

I would suspect this is from the Cache-Control: max-age=0 header, but I have no idea what would be setting that and why.


texts: Data Driven Pages Optimization for the same FC referenced twice

texts:
I have a feature class that I am referencing twice in my map,

for "active" features that are "the subject" of the map page as a Feature Layer
second Feature Layer that is grayed out/"inactive" on the map.

Is it faster/more efficient for ArcMap to reference the same Feature Class twice or if I would see some improvement if I made a copy of the data in the same geodatabase since I'm making about 15,000 pages?

These two layers are being "filtered" based on the "Match" / "Doesn't Match" criteria in the page definitions queries.


texts: WMSGetFeatureInfo from two WMS layers with different parameters

texts:
I have a map with two layers, which can (and almost always do) overlap. These layers are WMS from GeoServer using SQL views (POSTGIS). They use the same query but with a different parameter.

My hover control uses WMSGetFeatureInfo to get information from both layers to display in a label. When I've done this in the past from different layers with different parameter names this is easy. Supply all parameters and all layers and it works.

However, I don't know how to handle the situation where I have two layers with the same parameter name (as they are from the same view), but different value. If I add both layers then I get the same label twice. If I add the parameter twice it uses the second one added.

In the hover control's beforegetfeatureinfo event listener I setup the layers using:

self.control.layers = self.getLayers();
self.control.vendorParams.VIEWPARAMS = self.getParams();

with those methods defined as:

//This will give me one of the two results
//The value does not depend on the layer used as they both have the same view
//It only seems to depend on the VIEWPARAMS
//If I supply both layers I get the same result twice
self.getLayers = function() {
    var layers = [];
    if (map.areaTypeLayer) {
        layers.push(map.areaTypeLayer);
    } else if (map.overlayLayer) {
        layers.push(map.overlayLayer);
    }
    return layers;
};

//Only the second typecode has any effect
self.getParams = function () {
    var params = 'typecode:' + map.areaTypeIdentifier;
    if (map.overlayTypeIdentifier) params += ';typecode:' + map.overlayTypeIdentifier;
    return params;
};

The only workaround I can think of requires a lot of duplication and I'd rather avoid it if possible. I could duplicate the layer in GeoServer and give one of them a different parameter name. Then my code can create each layer from a different GeoServer layer.

Is there a better way? Maybe a way the control can call WMSGetFeatureInfo twice and merge the information? Hover control code below in case required.

esd.map.controls.hoverOver = function (map) {
    var self = this;

    self.control = null;

    self.init = function () {
        self.control = new OpenLayers.Control.WMSGetFeatureInfo({
            url: esd.pathUtility.geoServerUrl + "/ESD/wms",
            infoFormat: 'application/json',
            output: 'features',
            format: new OpenLayers.Format.JSON,
            hover: true,
            queryVisible: true,
            autoActivate: true,
            vendorParams:
            {
                propertyName: 'label',
                VIEWPARAMS: null
            },
            eventListeners: {
                getfeatureinfo: function (event) {
                    var details = jQuery.parseJSON(event.text);
                    map.showAreaInfo(self.buildLabel(details));
                },

                beforegetfeatureinfo: function (event) {
                    map.showAreaInfo(null);
                    self.control.layers = self.getLayers();
                    self.control.vendorParams.VIEWPARAMS = self.getParams();
                }
            }
        });
    };

    self.getLayers = function() {
        var layers = [];
        if (map.areaTypeLayer) {
            layers.push(map.areaTypeLayer);
        } else if (map.overlayLayer) {
            layers.push(map.overlayLayer);
        }
        return layers;
    };

    self.getParams = function () {
        var params = 'typecode:' + map.areaTypeIdentifier;
        if (map.overlayTypeIdentifier) params += ';typecode:' + map.overlayTypeIdentifier;
        return params;
    };

    self.buildLabel = function(details) {
        if (!details || !details.features || !details.features.length) return null;
        var labels = [];
        for (var i = 0; i < details.features.length; i++) {
            labels.push({ label: details.features[i].properties.label});
        }
        return labels;
    }

    self.init();
    return self.control;
};


texts:
I've got two tables conatining geometry: 1 containing big polygon's (regions, srid=4326) and another containing smaller polygon's (pand, srid=28992, containg ~9.9milion rows)

By using one of the big polygons, I want to find all the smaller polygons withing the bigger polygon. In the end I want the result set to be grouped by a column. But now I just want to count the number of rows (=number of objects within the big region)

This is the query I use at the moment:

WITH regio AS (  SELECT ST_Transform(the_geom,28992) as the_geom
                 FROM public.regions WHERE gid = 622
              )
SELECT
   count(*) AS count
FROM public.smaller AS p
WHERE
    ST_Within ( p.geovlak,
                (SELECT the_geom FROM regio)
              )

But somehow this query takes ages to complete. This is the Queryplan:

Aggregate  (cost=3018553.41..3018553.42 rows=1 width=0)
  CTE regio
    ->  Index Scan using regions_prim_key_gid2 on regions  (cost=0.28..8.29 rows=1 width=1458)
          Index Cond: (gid = 622)
  InitPlan 2 (returns $1)
    ->  CTE Scan on regio  (cost=0.00..0.02 rows=1 width=32)
    ->  Seq Scan on smaller p  (cost=0.00..3010265.32 rows=3311910 width=0)
        Filter: st_within(geovlak, $1)

I'm no expert in reading these queryplans; but the second to last row says there are ~3.3 rows instead of the ~9.9. So there is already some filtering in place. But
1 - what filtering is this? And
2 - I can't figure out where the problem in this query lies.

When changing the count(*) to a * and limit the result to 10; the query takes 99seconds to run, so that's also not fast enough. I can understand it takes some time, but it is still running :(

Spatial indexes:

CREATE INDEX smaller_geom_idx
  ON smaller
  USING gist
  (geovlak);


texts: Has anyone figured out how to make Leaflet Sidebar v1 wider?

texts:
I am pouring through the CSS and SCSS and I can't seem to make the sidebar wider. I'm displaying tables on it of selected features on a map. I would like it to be at least twice as wide as it is now.

Does anyone have experience with this?

Tried:

<style>
body { margin:10; padding:0; }
#map { position: absolute; top:0; bottom:0; right:0; left:325;}
#properties{position: absolute; border: 2px solid black; top: 300}
#sidebar{width: 900px !important;}
</style>

var sidebar = L.control.sidebar('sidebar', {
                position: 'right',
                });
            map.addControl(sidebar);


texts: Using Advanced Python Calculator in QGIS Modeler

texts:
I'm trying to create a column with integer values based on a small function that basically uses conditional statements. In short, a reclassification. My attempt below:

def getValue(Etat):
    if Etat == 'Bon':
        value = 1
    elif Etat == 'Moyen':
        value = 2
    elif Etat == 'Mauvais':
        value = 3
    elif Etat == 'Ruine':
        value = 4

value = getValue(<Etat>)

While I do not get any errors, the problem is that the new field is not being updated with new values. My thoughts are that it can't find the original field: "Etat", the source.

How should I go about it? Also, what I don't understand how is going to make the updates to the field, surely something is missing.


texts:
I added the official QGIS repos to my installation of Debian Jessie using the instructions on the official QGIS page. As of now, there appears to be some packages missing from the repos that resolve dependencies required by the package.

The following is the output for the aptitude:

$ sudo apt-get install qgis python-qgis qgis-plugin-grass

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-qgis : Depends: libgdal1 (>= 1.8.0) but it is not installable
               Depends: libqgis2.0.1 but it is not going to be installed
 qgis : Depends: libgdal1 (>= 1.8.0) but it is not installable
        Depends: libqgis2.0.1 but it is not going to be installed
        Depends: qgis-providers (= 2.0.1-3+jessie1) but it is not going to be installed
 qgis-plugin-grass : Depends: libgdal1 (>= 1.8.0) but it is not installable
                     Depends: libqgis2.0.1 but it is not going to be installed
                     Depends: grass642 but it is not installable
E: Unable to correct problems, you have held broken packages.

For those of you curious about what my sources.list looks like:

deb http://ftp.us.debian.org/debian testing main contrib non-free
deb-src http://ftp.us.debian.org/debian testing main contrib non-free

deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

#QGIS
deb     http://qgis.org/debian jessie main
deb-src http://qgis.org/debian jessie main

The culprit appears to be libgdal1, does anyone have a solution for this outside of compiling all the dependencies by hand?


texts: Activating tool after cancel button is pressed in message box?

texts:
I am building a plugin in QGis and I want to activate the plugin icon again when user clicks cancel button in the message box.

def run(self, checked):
    if checked == True:
        # icon is active
        # do something
    if checked == False:
        # icon is deactive
        reply = QtGui.QMessageBox.question(self.iface.mainWindow(), 'Continue?',
             'message', QtGui.QMessageBox.Yes, QtGui.QMessageBox.Cancel)
        if reply == QtGui.QMessageBox.Yes:
            # do something
        if reply == QtGui.QMessageBox.Cancel:
            # set the tool icon active again
            # do nothing

Maybe my solution is not the best one.


texts:
I have a raster file with gridded population

raster26
class       : RasterLayer
dimensions  : 132, 140, 18480  (nrow, ncol, ncell)
resolution  : 699, 931  (x, y)
extent      : 2248290, 2346150, 4771604, 4894496  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs
+towgs84=0,0,0
data source : in memory
names       : gpw.v4.population.count.2015.country.totals_2015_USA
values      : -7.127474, 5090.825  (min, max)

and I have point data

PM25_p26
class       : SpatialPointsDataFrame
features    : 3350
extent      : 2259569, 2330188, 4782506, 4884012  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs
+towgs84=0,0,0
variables   : 4
names       : Annual_PM25_USGrid_2015_t,       Lon,      Lat,       SiteCode
min values  :                  3.423296, -71.12231, 41.15096,   212040868642
max values  :                 13.396204, -71.85846, 42.01835, NWPR1NOS-NWLON

I want to extract the population in those points within a 1kmx 1km resolution (both the raster and the points are 1kmX1km grid cells, but they are not overlap)

I used the extract function in the raster library

population_26 <- extract(raster26,
                            PM25_p26,
                            buffer=500, # 500m radius
                            fun=mean,na.rm=T,
                            sp = TRUE,
                            method='simple')

Is that correct? I get not reasonable numbers (too low) when I sum up all the gridded population


texts: Creating indexes with PostGIS using all CPU cores

texts:
I have to run a whole bunch of GIST index creation, on some tables containing lots of records (scale of many countries, OSM data):
CREATE INDEX CONCURRENTLY IF NOT EXISTS osm_footways_gist ON osm_footways USING GIST (geom);
....

(more info here: https://www.2ndquadrant.com/en/blog/create-index-concurrently/ )
The time needed to run them all is quite long, it can be up to several hours on a common desktop computer.
But I noticed that it uses only one single CPU core.
Would it be possible to run such index creation queries using all available CPU cores (or a predetermined number of them)?
202002192007 Edit
According to https://www.cybertec-postgresql.com/en/postgresql-parallel-create-index-for-better-performance/ I've tried this:
SET max_parallel_maintenance_workers TO 48;
SET maintenance_work_mem TO '128 GB';
ALTER TABLE osm_footways SET (parallel_workers = 48);
CREATE INDEX CONCURRENTLY IF NOT EXISTS osm_footways_gist ON osm_footways USING GIST (geom);
....

But still have 1 CPU core working.
Info:
>>> psql
# select Version();
                 version
---------------------------------------
 PostgreSQL 11.10 (Debian 11.10-1.pgdg90+1) on x86_64-pc-linux-gnu,
 compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)

# select postgis_version();
            postgis_version
---------------------------------------
 2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)

Dockerized.


texts: Analysing correlations between variables and points using ArcMap

texts:
I am trying to determine the correlation between sinkholes and a number of different variables. My sourced data is as follows:

Sinkhole Database: 6460 points
Fault Lines: Line files
Surface Streams: Line files
Karst Landscape: Polygon file
Depth of soil to bedrock: DEM

I am using ArcMap 10.1

Can anyone point me in the right direction as to how to analyse the correlations between each variable and the points?

I have set up buffers around the river and fault lines, and have extremely simplistic counts at each of the boundaries, but would prefer something slightly more data rich!


texts: Updating/modifying Network Dataset roads source in Enterprise Geodatabase (ArcSDE) using ArcPy?

texts:
I am trying to create a Python script that automate the update of roads source used in a network dataset stored in a Enterprise Geodatabase (SDE). In short, I want to truncate the roads feature class and append the new roads data into it without have to recreate the network dataset.

When I try to edit the roads feature class, I encounter an error because arcpy can't edit a feature class used by a network dataset outside an edit session.

I tried using an update cursor in an edit session but I get RuntimeError: workspace already in transaction mode

import arcpy, os, time
time1 = time.time()

ROADS_INPUT = os.path.join(r"\\dd734dd", "geo", "Geobase", "GEO03_ADDRESS.gdb", "GEO03_ADDRESS", "GEO03E08_ROADS")
WORKSPACE = os.path.join(r"\\dd734dd", "geo", "ArcGIS Server", "Connections", "Enterprise.sde")
ROADS_NA = os.path.join(r"\\dd734dd", "geo", "ArcGIS Server", "Connections", "Enterprise.sde", "NA", "ROADS_2018_04")

editSession = arcpy.da.Editor(WORKSPACE)
editSession.startEditing(False, True)
editSession.startOperation()

#truncating the NA roads table
with arcpy.da.UpdateCursor(ROADS_NA, field_names="*") as u_cursor:
    for row in u_cursor:
        cursor.deleteRow()

#inserting rows from input to NA roads
with arcpy.da.SearchCursor(ROADS_INPUT, field_names="*") as s_cursor:
    with arcpy.da.InsertCursor(ROADS_NA, field_names="*") as i_cursor:
        for row in s_cursor:
            i_cursor.insertRow(row)

editSession.stopOperation()
editSession.stopEditing(True)
time2 = time.time()
print "script took {:.3f} ms".format((time2-time1)*1000.0)

Is there a strategy I could try to achieve what I am trying to do?

Note: The network dataset is stored in Enterprise Geodatabase (SDE)

EDIT:

Using arcpy.DeleteFeatures_management() and arcpy.Append_management() instead of cursors results in error 99999 Objects in this class cannot be updated outside and edit session [Enterprise.ROADS_2018_04]

import arcpy, os, time
time1 = time.time()

ROADS_INPUT = os.path.join(r"\\dd734dd", "geo", "Geobase", "GEO03_ADDRESS.gdb", "GEO03_ADDRESS", "GEO03E08_ROADS")
WORKSPACE = os.path.join(r"\\dd734dd", "geo", "ArcGIS Server", "Connections", "Enterprise.sde")
ROADS_NA = os.path.join(r"\\dd734dd", "geo", "ArcGIS Server", "Connections", "Enterprise.sde", "NA", "ROADS_2018_04")

editSession = arcpy.da.Editor(WORKSPACE)
editSession.startEditing(False, True)
editSession.startOperation()

arcpy.DeleteFeatures_management(ROADS_NA)
arcpy.Append_management(ROADS_INPUT, ROADS_NA)

editSession.stopOperation()
editSession.stopEditing(True)
time2 = time.time()
print "script took {:.3f} ms".format((time2-time1)*1000.0)


texts: Keeping only maximal value of two overlapping polygon (along with initial value where they do not) using ModelBuilder?

texts:
I work with ArcGis 10.2.

I want to Combine (Union?) two Polygons FC of waterdepths, both having the same classification but not the same elements. I want to keep all the elements and all the initial values where the elements don't overlap and only the highest value where they do. I want to use a ModelBuilder to do this.

The issue could be resolved in raster but I have too many datasets of different hydrological orders, meaning the main rivers run across a third of Germany whereas the secondary ones are sometimes just small auxiliaries.

Has anyone has already done something like that?


texts: QGIS create atlas Overviewmap with a bufferzone for surrounding points around the atlasobject

texts:
My goal is to create a zone of visibilty around an atlasobject to show surrounding points and display them in a different style as they aren't the main focus just a little extra.
the bufferzone should be around 50 meters in diameter.


texts:
I want to know how to import a layer of polygons that I have exported from a database in postgis to txt format to my dataset. I have used the ST_GeomFromText function but it does not identify the geometry.

I have passed the geometry to geojson from postgis but continuous CARTO is not to identify me as a geometry in the dataset.
An example of the "coordenada" field would be:

{"type":"MultiPolygon","coordinates":[[[[443954.068437832,4474249.04503992],[443953.121781595,4474248.30754893],[443952.38433774,4474249.25416733],[443953.330941997,4474249.99165832],[443954.068437832,4474249.04503992]]]]}

I'm importing it from csv as the CARTO example:

name, geojson
"Null Island", "{" "type" ":" "Point" "," "coordinates" ": [0,0]}"


texts: Why is my custom QGIS repository not working in recent qgis-dev version?

texts:
I have a custom QGIS repository that worked well with my own plugins.xml on a private server. Yesterday I downloaded and installed the newest QGIS-DEV that now include some changes in the Python plugins manager and I can't make my custom plugins repository work on that version... I can create the repository that effectively see my plugins.xml file but the plugins defined inside that .xml files are not shown in the available plugins list as usual...

Is this new plugin manager version completed? Does it implement custom repository or is it a work in progress?

Thanks a lot

Etienne


texts: Which Address Locator types use which .cls files?

texts: I am attempting to edit the standards file used with ArcGIS 10's geocoding engine. Unfortunately, there are 17 files! As far as this website instructs, there should be an .lot file that tells me which locator type uses which .cls files for their lookup. For whatever reason, I can't find any such .lot file OR anything else that tells me what I need to know. Has anyone else cracked this puzzle yet?


texts: How can we convert CAD schematic diagrams to ArcGIS geodatabase

texts:
I have been working on an assignment where I am supposed to convert some CAD schematic diagrams to GIS features and load them to a Geo database.
Had it been a simple cad file (non schematic) I could do it using CADtoGeodatabase_conversion tool available in arcgis. However I am not sure if the same approach would work for the CAD schematic diagrams.
If anyone has tried it in the past or knows of any tool which could be helpful in this case then please let me know.


texts: QGIS Field Calculator Help Results Always NULL

texts: I have a shapefile which is points and I created the table to include the x and y coordinates, now I also need to have the coordinates in DMS and DDS so I have gone to the field calculator and use the function to_dms but the resultant column is always a NULL even in other functions and other shape files...I must be missing something....also see the result image the column was created but only with NULL results.....I really hope its a quick fix that i am missing something as I have been trying to resolve this for the last two days.


texts:
when trying to import a CSV from my hardtrive to my map-document using "add Data"-dialog I get the error "Selected element could not be added to map. Generic error" (or something similar, I am using german version, so actual message may vary). When doing the same via TableToTable_conversion-tool in GP I get the error 000732: Dataset 'myFile.csv' not existing or not supported. I also tried to create a file-GDB and import the table there, result is the same.

Here is my CSV-structure:

SID,UUID
1,DENW22AL60001dVy
1,DENW22AL30000FLl

I also tried with semicolons rather then single comma as delimiter, but can´t get it working.
Also notice that I only want a standalone-table rather then a featureclass. Therefor no coords are given within the file.

EDIT: As of Error:  000732: Dataset does not exist or is not supported this error may occur if the file-name itself is incorrect. So I did the proposed corrections for filenames (use forward-slashes, no spaces) but with no avail. Also since I chosed the file by the file-dialog rather then by typing its name I did not even expect this would do the trick (just for completeness).

I´m using ArcGIS 10.0 for Windows 7 (64Bit)


texts:
I'm attempting to add a weather map layer (a satellite image) to QGIS 3.4.4 using tiles from aerisweather.

The URL (with credentials) is

https://maps.aerisapi.com/OcY2Lrnvyk26SIjfqUluj_pz9Tq0uvH1iGKSwn7Q0Ae6yEflSDkdBQyrDJSkFn/flat-dk,water-depth,admin-cities-dk,satellite-infrared-color/{z}/{x}/{y}/current.png

I'm able to add the connection in XYZ tiles without any apparent error, but the result produces a blank preview and map.

Is there anything obvious here that I am doing wrong, or is this simply not viewable in QGIS?


texts: Saving Edits on a WFS layer by using OpenLayers

texts:
So with an app that I've produced by taking this into account, I've managed to create a web map with editing function using a WFS layer from Geoserver.

Problem is that, unlike in the working example,  the edits are not being saved properly, so every time the page gets refreshed, it seems that the edits become lost.

Weird thing is that every time I draw a line, in my Postgis database there are new entries being created, but the geometry is not being recorded. The delete button doesn't work as well

The portion that saves it to the WFS layer is:

var formatWFS = new ol.format.WFS();
var formatGML = new ol.format.GML({
featureNS: 'http://geoserver.org/bftchamber',
featureType: 'bft',
srsName: 'EPSG:27700'
});
var transactWFS = function(p,f) {
switch(p) {
case 'insert':
    node = formatWFS.writeTransaction([f],null,null,formatGML);
    break;
case 'update':
    node = formatWFS.writeTransaction(null,[f],null,formatGML);
    break;
case 'delete':
    node = formatWFS.writeTransaction(null,null,[f],formatGML);
    break;
}
s = new XMLSerializer();
str = s.serializeToString(node);
$.ajax('http://localhost:8080/geoserver/wfs',{
    type: 'POST',
    dataType: 'xml',
    processData: false,
    contentType: 'text/xml',
    data: str
    }).done();
}

Fiddle is here https://jsfiddle.net/Luffydude/ex06jr1e/7/

Also or some reason, my existing drawn line loads correctly in QGIS, but in the app it just loads in the middle of the ocean. In my code I've specified EPSG 27700 but seems that a different SRS is being used


texts: Associating one attribute to another in QGIS?

texts:
Suppose I have two attributes for the polygons on one layer representing buildings: one is number of floors and the other is building height, the latter equals to "number of floors" times 3 meters.

Is there a way to automatically update building height value if the number of floors is changed?


texts: GEE doesn't export my featurecollection as table with all the features

texts:
I have script in GEE which calculates for given geometry (reduceregions) the mean NDVI value for given period of time ans then suppose to export the table as CSV file when the polygon name is the columns ,the rows are the different dates and images, and the values are the mean NDVI value for each polygon for specific date.
For some reason, when I check my result featurecollection I have in each image one polygon, but when I export it I get only the dates without the polygon names and they dissapear so my final excel looks like this:

I'm also worried because seems like out of 5 polygons (A,B,C,D,E) it gets results only for B,C,D and little  but for A, and I don't know if it has to do with the export -missing-polygons-name-error.

here is a link to my script+geometry:

https://code.earthengine.google.com/705aa58c4d43a2da2c073845ee563559

My end goal: To export my "result featurecollection" with the names off al the polygons and their mean value.


texts: Accessing PostGIS geometry with psycopg2

texts:
I've a PostGIS database loaded with several tables filled with shapefiles. I'm using psycopg2 to access everything via python. I'm able to access the table names with the below query:

"""SELECT table_name
              FROM information_schema.tables
              WHERE table_schema = 'public'"""

which returns

('Sea Areas(PolyGrid)',)
('geography_columns',)
('geometry_columns',)
('spatial_ref_sys',)
('12NM(LineGrid)',)
('TimeZone(LineGrid)',)
('12NM_PolyGrid',)

But when i try and run a simple query like:

"""SELECT geom FROM 12NM_PolyGrid"""

it throws:

Error while connecting to PostgreSQL syntax error at or near "12"

I'm new to SQL so it could be simple error. Ultimately I would like to do a bounding box query like in this link. The results would then be placed in a geodataframe.


texts: How to smooth a classified raster layer in QGIS?

texts: In QGIS 3.0.2, I want to smooth a reclassified raster layer by r.neighbor tool. In this process I use average operation. The raster layer created from this tool is empty. I tested this process with maximum operation and the answer was correct. I tested average operation by both float and int type of raster layer but there was same empty layer as result.


texts:
I am trying to create biomass map using Kriging from ground sample point.

I have about 150 and 53 point plot for dense and sparse strata.

The data is not normal so I have transformed it.

After running the kriging, the predicted and the measured line does not look right, also the QQ plot between normal value and standardized error is not normally distributed?

What are the options to address this issue and how can I figure out which kind of kriging is best to calculate biomass?


texts: GDAL/OGR (Python) GetGeomType() method returns integer, what is the matching geom type?

texts:
When I use the GetGeomType() with GDAL/OGR it returns an integer. I want to know what geometry type each integer represents.

driver = ogr.GetDriverByName("FileGDB")
gdb = r"C:\Users\******\Documents\ArcGIS\Default.gdb"
ds = driver.Open(gdb, 0)
input_lyr_name = "Birmingham_Burglaries_2016"
lyr = ds.GetLayerByName(input_lyr_name)
# access the schema info
lyr_def = lyr.GetLayerDefn()

print lyr_def.GetGeomType()

Output: 1

I already know an alternative way to get the geometry type as below, but I am interested to match integers to the correct geometry type. Is there a list somewhere?

first_feat = lyr.GetFeature(1)
print first_feat.geometry().GetGeometryName()

Output: POINT

But this won't work on an empty dataset.


texts: How to do bivariate or multicriteria line symbolization in QGIS?

texts:
Bonjour,

je cherche à faire sur Qgis un tracé d'un itinéraire avec comme légende une couleur pour le type de route et la largeur du trait pour la fréquentation de cette route. J'ai vu qu'il était possible de faire des choses sur arcgis comme légende bivariée. Est-ce que ce que je cherche à faire est faisable sur Qgis???

Merci

I'm trying to use QGIS to trace out an itinerary with a legend using color for the type of route and line thickness for the amount of traffic on the route.  I have seen that it's possible to do things like this in ArcGIS with a bivariate legend.  Is what I'm trying to do possible with QGIS?


texts: Delete fields from a table based on Mean calculation using ArcPy

texts:
I have an attribute table with 100 columns (values are float and not NULL; more than 3000 rows). Using ArcGIS 10.6

I want to calculate the mean value of every field in a shapefile separately (like summary statistic works);
and use the resulting value for deleting the field: if the Mean value of the field lower than 0.6- delete the field from the table.

How can I use the Mean values of the fields in a for loop in order to delete the unnecessary fields from a table with python?


texts:
I've been using reconstruct line in Qgis 2.18 and it a wonderful plug-in to create line between selected point.

Now I'm on Qgis 3.4 and all I can find it plug in that add line everywhere (not only selected point).

Anybody knows of a plugin in that I can use that have the same principle than Reconstruct line, Get point then Create line?


texts: QGIS DB Manager - load as new layer not loading

texts:
After successfully running an SQL query on two tables and some results in 3 columns, I would really like to be able to display it in the canvas. Apparently, that function is not doing anything, not even as much as throwing an error so as to know if something is happening.

What should I do? Hopefully this screenshot will help.

*I'm using the DB manager because the SPIT plugin was not allowing me to import shapefiles.
*QGIS version 2.8.2 on Windows

After several attempts, I managed to create a table with my results, however it's not what I was aiming for.

create table results as (SELECT bati_1948.objectid gid48,bati_1971.objectid gid71,ST_Area(ST_Intersection(bati_1948.geom,bati_1971.geom))/ST_Area(bati_1971.geom) ratio FROM bati_1948 RIGHT JOIN bati_1971 ON ST_DWithin(bati_1948.geom,bati_1971.geom,5) WHERE bati_1948.objectid IS NULL OR ST_Area(ST_Intersection(bati_1948.geom,bati_1971.geom))/ST_Area(bati_1971.geom)<>1);

Would anyone know how could I turn this into a shapefile?


texts:
I just switched from QGIS 2.18 to version 3.0.3. In the earlier version, setting layer transparency was easily done with the "transparency" slider from the Layer properties->style tab. See image below:

The newer QGIS version, however, does not appear to display such a transparency bar, as seen in next image. Is there a simple way to change a layer transparency in this verion of QGIS?


texts: ArcGIS - World Imagery Map Service - Force Higher Resolution Imagery

texts:
I am using the ArcGIS world imagery map service in an ArcGlobe project. Based on the scale and perspective of my view, imagery updates between different resolutions.

Sometimes two resolutions are shown at once resulting in choppy imagery.

I can see that this Map Service is made up of many different resolutions that display at different zoom levels.

Is there a map service that will only show the more detailed imagery below? I believe this is the I-Cubed 15m data.

Is there a way to force arcGlobe to display the higher resolution imagery?


texts: Delete an object or polygon that has been selected in a layer using the Graphical Modeler?

texts: I wish to create a model in QGIS 3, that can delete a specific polygon that has been selected in a layer. Is it possible to do this? I go through a few different locations in a day and I don't wish to waste time manually deleting that polygon every time I open up a new location. I already have a model that selects the polygon via longitude and latitude, and I really just wish to add an algorithm on top of that, if that isn't possible create a new model entirely.


texts: I have just converted some British National Grid coordinates to degrees decimal, WGS 1984. I now want to do the same with a UK local authority shapefile which I have read into a couple of different programs and which doesn't make any sense to me. The only info in the shapefile is 'Geo_code'. I presume I need to convert the shapefile to the same notation system but I don't understand the format it is currently in. Unfortunately trying to convert the shapefile in ARC Tools gives an erro.


texts: Which Shapefile parts are necessary to convert to geojson?

texts:
Which of those files are needed, to be able to convert them to geojson without losing any information?

From what i know:

*.shp - contains coordinates for lines, points, and other geometries
*.prj - contains data about projection, that shapefile is using

I don't know what *.dbf and *.shx files are for. Do I need them to convert to geojson?


texts: When using OpenLayers plugins maps, can I have Longitude/Lattitude labelled on my grid when using the Map composer in QGIS?

texts: Using OpenLayers plugins maps, can I have Longitude/Latitude labelled on my grid when using the Map composer in QGIS?


texts: Can Ordnance Survey Ireland georeferenced 25" historical maps be downloaded?

texts: I'm using QGIS3 and want to download to use as a background layer an OSI 25" historic map.  It can be viewed in OSI's map viewer, and is georeferenced with the Irish Transverse Mercator grid.  Can the georeferenced file be downloaded?  If so, how do I go about it?


texts:
I would like to calculate the catchment areas of several points in a polygon. It means, I have a city, some POIs in the city and a lot of districts (the centroids). The POIs have different weighting due to the number of persons who use it, and the districts have variable population count. Now, I would like to have the nearest districts to every point separated, which has approximately the same count of people in the sum as the count of people, who use the certain POI.

Is it possible to make calculation like that with QGIS or R, or in worst case with ArcGIS? Or maybe with another tool?


texts:
I am trying to export coordinates of way that I found.
https://overpass-turbo.eu/s/17Ne
But when I click export/ as GeoJSON I don't get coordinates in downloaded file.
How can I do this?
Even though map is empty on overpass webpage, there are coordinates in Data sheet


texts: Use Survey123 Inbox to validate feature in a repeat

texts:
I'm using Survey123 to collect information on Fire Hydrants and their inspections.  The survey collects info on the actual hydrants (from feature service), and uses Inbox for crews to select the actual hydrant.  It works fine.
I have a repeat in the survey to collect info on inspections.  The repeat works fine.  However, when they perform a certain flow test they need to capture the ID of a second fire hydrant.  I'd like to use Inbox to validate that they're selecting an actual, existing fire hydrant (similar to how they selected the first one as described above).  I've successfully asked for them to identify a geopoint for the second hydrant, but I can't figure how to validate it against existing features.
I originally asked the question in the Survey123 Community, but haven't gotten any response.


texts:
I am having difficulty getting ERDAS or ENVI to correctly read and display cloud mask attributes from MOD 35 HDF files. They files are displayed as 0-255, whereas I expected  some kind of code 0, 1, 00, 01 etc indicating clear and cloud pixels.

I believe someone may have used this data before.


texts: How can I force TileCache to NOT render missing tiles (read only mode)?

texts:
I have a working disk TileCache that I do not want additional images to be rendered and saved to disk. Is it possible to force TileCache to a "read-only" mode? At the moment, I have set the folder permissions of the disk cache to read only as a temporary solution. This is the error I receive:

An error occurred: [Errno 13] Permission denied: '/tmp/tilecache/wms_layer1/07/000/000/037'
  File "/usr/lib/pymodules/python2.7/TileCache/Service.py", line 256, in modPythonHandler
    apacheReq.method,
  File "/usr/lib/pymodules/python2.7/TileCache/Service.py", line 208, in dispatchRequest
    return self.renderTile(tile, params.has_key('FORCE'))
  File "/usr/lib/pymodules/python2.7/TileCache/Service.py", line 139, in renderTile
    if (data): image = self.cache.set(tile, data)
  File "/usr/lib/pymodules/python2.7/TileCache/Caches/Disk.py", line 79, in set
    self.makedirs(dirname)
  File "/usr/lib/pymodules/python2.7/TileCache/Caches/Disk.py", line 33, in makedirs
    raise E

I am hoping that there is a way to hack TileCache to quietly ignore missed hits on the existing disk cache, so as not to attempt to render those missing tiles.


texts: How to avoid mixed language names in QGIS Cloud?

texts:
I have a project uploaded into QGIS Cloud. When I load it from the web browser, the German name of "United Kingdom" is displayed but all other places in the UK have their English names:

If I zoom in a little, the English name is used and I would to have this maintained without having to zoom in/out constantly.

Is this possible?


texts:
I have two vectors, one with points and another with the extent of a zone of interest:

I would like to interpolate a surface within that zone of interest. This is just a small example, with larger zones the computational overheard of interpolating across the whole region might not be acceptable.

According the the manual, v.surf.idw takes the current mask into account:

  If the user has a mask set, then interpolation is only done for those
  cells that fall within the mask.

Getting down to it, I first rasterise the zone map:

> v.to.rast input=zone output=zone_rst use='cat'
Reading areas...
 100%
Writing raster map...
 100%
v.to.rast complete.

As a pre-check, I check the rasterised map with Map Display:

I then apply this raster as the current mask and finally create the surface:

 > r.mask raster=zone_rst
All subsequent raster operations will be limited to the MASK area. Removing
or renaming raster map named 'MASK' will restore raster operations to
normal.
[Raster MASK present]
 > v.surf.idw input=points column='z' output=surface --verbose
16 records selected from table
16 points loaded
Interpolating raster map <surface> (136 rows, 132 columns)...
 100%
v.surf.idw complete.
[Raster MASK present]
> r.mask -r
Raster MASK removed

But the resulting surface spans across the entire region:

How can I force this module to use the mask?

Update: I previously filed an answer with what appeared to be a solution; however, I had just displayed the resulting surface with the mask still on, therefore only the surface section within the mask was visible.

I have now tried v.surf.idw with various different masks, both raster and vector, but they are always ignored. The surfaces produced by v.surf.idw always encompass the entire region. For instance, the following command sequence produces exactly the same result as above:

> r.mask vector=zone
Reading areas...
 100%
Writing raster map...
 100%
All subsequent raster operations will be limited to the MASK area. Removing
or renaming raster map named 'MASK' will restore raster operations to
normal.
[Raster MASK present]
> v.surf.idw input=points column='z' output=surface_msk_vec --verbose --overwrite
16 records selected from table
16 points loaded
Interpolating raster map <surface_msk_vec> (132 rows, 186 columns)...
 100%
v.surf.idw complete.
[Raster MASK present]
> r.mask -r
Raster MASK removed


texts: How to choose a shapefile interactively in R

texts:
I am writing a function in R where i want the user to choose a Esri shapefile from its destination folder. Since a shapefile is made of several files how can i select them. For a point feature class i used readShapePoints()

 data =  readShapePoints(file.choose())

OR

 data =  readShapePoints(choose.files())

Do i need to zip files which than can be selected? i dont know.
Kindly guide me.


texts: Problem in OpenLayers 3 with mapserver-cgi

texts:
I want to form a map using mapserver-cgi, but it does not fit the basemap (OSM).

msLayer = new ol.layer.Image({
   source: new ol.source.ImageWMS({
   url: 'http://localhost/cgi-bin/mapserv?mode=map&map=/var/www/trdem1.map',
   params: {
            'LAYERS': 'trdem_4326_ov20',
             'TRANSPARENT': 'true'
             },
             projection: 'EPSG:3857',
             type: 'mapserver'
            })
  });

mapserver-cgi actually creates an image

What am I doing wrong?


texts: Keeping package dependencies for QGIS master up-to-date

texts:
Not for the first time, QGIS has broken due to unsatisfied package dependencies.
This is not surprising, as I'm using the 1.9 Master version which is released nightly, and the package dependencies seem to update rapidly.

Most recently, for example, QGIS could not reinstall due to the following package dependencies.

Depends: libc6 (>= 2.14) but 2.15-0ubuntu10.3 is to be installed
      Depends: libgcc1 (>= 1:4.1.1) but 1:4.6.3-1ubuntu5 is to be installed
      Depends: libqt4-network (>= 4:4.5.3) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqt4-sql (>= 4:4.5.3) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqt4-svg (>= 4:4.5.3) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqt4-xml (>= 4:4.5.3) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqtcore4 (>= 4:4.8.0) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqtgui4 (>= 4:4.8.0) but 4:4.8.1-0ubuntu4.3 is to be installed
      Depends: libqtwebkit4 (>= 2.2~2011week36) but 2.2.1-1ubuntu4 is to be installed
      Depends: libspatialite3 (>= 3.0.0~beta20110817) but 3.1.0~rc2-2~precise1 is to be installed
      Depends: libsqlite3-0 (>= 3.5.9) but 3.7.9-2ubuntu1.1 is to be installed
      Depends: libstdc++6 (>= 4.6) but 4.6.3-1ubuntu5 is to be installed
      Depends: qgis-providers (= 1.9.0+git20121208+7841975~precise1) but 1.9.0+git20121208+7841975~precise1 is to be installed
      Depends: qgis-common (= 1.9.0+git20121208+7841975~precise1) but 1.9.0+git20121210+df2c1c5~precise1 is to be installed

The strange thing for me is that more up-to-date versions of the dependent packages already seem to be on my machine, based on the above warning.

I know the simple answer to this question is "use 1.8.0 if you cannot sort your dependencies out", and this is precisely what I've done for now - (see very useful answers here if you need to fix broken packages).

However, I really like using some of QGIS's new features such as the new labelling engine and would also like to contribute to the development process by submitting up-to-date bug reports.

So if anyone has faced similar issues and knows of a reliable way to keep abreast with all QGIS 1.9 dependencies, please let me know.


texts:
I want to run the command below over 100 images in a directory. The problem is that scale_1, scale_2 and scale_3 are currently obtained manually in the QGIS GUI under Layer->Layer Properties->Band rendering. How do I obtain scale_1, scale_2 and scale_3 automatically?

gdal_translate -ot Byte -b 1 -b 2 -b 3 -scale_1 98 854 -scale_2 196 1028 -scale_3 182 1102 -r cubic "20170729_182758_0f28_3B_AnalyticMS_SR.tif" "output.tif"


texts: OpenLayers - Zooming In / Out By Pinching Fingers On Mobile Devices

texts:
I am currently using OpenLayers on a project and noticed that when I pinch in (zoom out) or pinch out (zoom in) with my fingers while over the map, the browser zooms in / out on the page itself rather than the map.

On embedded Google Maps, pinching in / out would zoom out / in on the map itself.  I am assuming this has to do with the fact that Google uses an iFrame while OpenLayers builds a canvas on the current page.

Is there a way to zoom in / out on the map itself with OpenLayers?


texts: ArcGIS query layer shape=long integer and not geometry

texts:
I want to add a Query Layer in ArcMap to eventually publish WMS services. WMS services cannot be created with a selection layer so I though I would try the Query Layer variation. My problem is that I always get a table without geometry as my result. The SHAPE field does not have "geometry field" but instead a "long integer" field. I am using MSSQL2012 with ArcGIS 10.3.1. Geometry storage is sde binary.

Can anyone explain this?


texts: How do I create forms using Geodatabase's related tables in ArcPad Studio 10?

texts:
I have a Geodatabase with a Points table and number of related tables. The reason for the related tables is because of the large number of fields.  The relationships are reconginsed by ArcGIS and ArcPad Studio OK.
I'm trying to generate a number of forms based on this Geodatabase. A form is automatically created for me using the primary (points) table in ArcPad Studio, but the related tables are only shown in the Attribute tab.

I have tried to create a forum using the "Related Tables" button, thinking I could call this form using a button on the main form.  So on the main form I've placed a VBScript code to say frmChild.Show.  Where frmChild is based on the related tables. But this gives me an error saying Object doesn't support this action.

Any one have any idea what how I can create from using related tables and display them?

Thanks


texts: Batch changing of Raster Bands of Multiple Rasters in ArcGIS Desktop?

texts:
I have a ton of rasters in my ArcGIS project, each with 4 bands.
At the moment, I am changing the raster bands, one by one, for each file:

Red becomes Band 2
Green becomes Band 1

And I am setting the Stretch Type to Minimum-Maximum, like on this screenshot:

Problem is, it's like 300 Rasters and the manual job is just taking too long. I have checked the ArcGIS Toolbox and the help, but I have not found a way to do that as a batch job.

Marking all the rasters and change the properties for all of them all together does not work either.

Afterwards I want to set these settings from the Image Analysis for RGB Stretch for each of the rasters as well, but preferably not manually.

Unfortunately, I am just fresh at remote sensing and image analysis.

[edit]
Since it has been asked.
I am doing this because I need to visualize and enhance trees from satellite images. I got the images from this source: link.

With the above mentioned settings I could change the picture in the following way, which is exactly what I am aiming for:

To this:

After some more research, I have discovered the ArcGIS tool "Apply symbology from layer", but it changes me only the bands and the min-max stretch and not the settings in the "image analyzis" window and it takes forever. It's been running now since 7 hours and I am scared that it crashes.

The final and most ideal outcome is that I can convert the red (tree) areas into a shapefile. Unfortunately, I have not come across a solution for that yet either, so if anyone knows something about that, I will be eternally grateful!

And if anyone has a better way of doing all this, please come forward!


texts: How can I "select by attributes" based on membership in py dictionary?

texts:
I am trying to write a script in arcpy that checks to see if elevation values in a point file are found in a dictionary, and if they are to produce a new point file with just those entries. Sounds simple enough, but for some reason SelectByAttributes keeps returning the full dataset and not selecting properly. Further, this runs so slowly that I'm convinced there's a quicker way to do this, perhaps by making an array and writing a new point file with InsertCursor. Here's a snippet of my dysfunctional code:

import arcpy, collections
#transects_pts is a point shpfile with fields ID and elev
transect_pts = r'C:\transect_pts.shp'
inputRows = arcpy.SearchCursor(transect_pts,'','','ID; elev','ID')
layer = arcpy.MakeLayer_management(transects_pts,"tlayer")
#tdict is a default dict containing {ID: [elev1,elev2,elev3]}
for row in inputRows:
    for m in tdict:
        if row.elev in tdict[m]:
            arcpy.SelectLayerByAttribute_management(layer,"ADD_TO_SELECTION")
arcpy.CopyFeatures_management(layer,"new_transect_pts")

If anyone has some insight, or a better way to do this, please help me!


texts: How to set all pixels with value <= 0 to "nodata" in DEM raster?

texts:
I have a DEM raster with pixel values between about 3000 and -0.0003.
I need to set all pixel with a value of 0 and smaler (<=0) to "nodata" (for later raster calculations and to reduce the filesize).

It seems for me that this is a task for the raster calculator (set value of  pixels <=0 to "nodata") or a reclassification (set value of  pixels <=0 to "nodata" and keep all other values) but I dont know how.


texts:
I am creating a map of local authorities in Hampshire, UK and due to size, key numbering is the best option to clearly label.
The list, however, is not in an ideal location. Is there a way to relocate the list to another area of the map layout?


texts:
I have problem when trying to encode attribute values in latin1 using OGR GeoJSON driver. Accent char are not displayed correctly. Is the GeoJSON encoding is limited to UTF-8?

I can't find any info about this in specs. Can someone try to encode a GeoJSON in latin1 to see if it works?


texts: Need to iterate through subfolders and merge specific shapefiles into one

texts:
So, I have a folder with around 90 subfolders. Each of these subfolders represents a region in a country and they have the same internal structure. Now, I need two shapefiles from folder (let's call it /NEED/) and shapefiles need_one.shp and need_two.shp. These shapefiles are identical just in different folders (regions) and I want to merge them as one. So, the structure is like this - main_folder/region1/NEED/file_names.shp (for example the end could say need_one.shp or need_two.shp). And the next would be main_folder/region2/NEED/file_names.shp and so on.

with open("/main_folder/region1/NEED/need_one.shp", 'w') as file:
    for dir_, dirpath, filename in os.walk("/main_folder/"):
        file = os.path.join(dir_, filename)
        file.write("main_folder/Merged_Results/need_one.shp")

Now, this is what I have so far. Please be aware that I am still learning python and also using python3. I have created a virtual env for this and installed several needed packages. I know that I am missing a line or two of code and would really appreciate some help or guidance as to what is happening and what am I doing wrong.

When I run it, I get the following error:

TypeError: join() argument must be str or bytes, not 'list

The second version goes like this:

dirpath = "/main_folder/"
regexp = '.shp'
def iter_matching(dirpath, regexp):
    with open("/main_folder/region1/NEED/need_one", 'w') as file:
        for dir_, dirpath, filename in os.walk(dirpath):
            abspath = os.path.join(dir_, filename)
            if regexp.match(abspath):
                yield abspath
            file.write("/output_folder/need_one")

This runs but gives me no results.


texts: Can I prevent OpenLayers from losing my WFS-T feature edits?

texts:
Using openlayers (2.12) and drawing some vector features against a WFS-T interface (offered by geoserver).

Problem is, when I draw some geometries and pan a little bit too much, openlayers sends "wfs:GetFeature" message to WFS-T interface, and while doing this it resets all features I have drawn so far.

You can try this even using the public openlayers examples: http://openlayers.org/dev/examples/wfs-protocol-transactions.html

draw some features
pan / zoom around enough / too much before saving
the features you drew disappear

Any way to prevent this?


texts: Splitting hexagonal grid into segments and dissolving by location using ArcGIS Desktop?

texts:
I am creating a turnover map of species communities using R and ArcGIS 9.3.

As a summary, here are my main questions:

How can I split hexagonal polylines into six lines?
How can I dissolve identical lines into one line keeping the attributes from both?

Here is the long story:

I have an hexagonal grid as a polyline shapefile, in R I have calculated the Jaccard distance between each hexagon. The table looks like this:

hexid1 hexid2 jaccard
A      A      0
A      B      ab
A      C      ac
B      A      ba
B      B      0
B      C      bc
C      A      ca
C      B      cb
C      C      0

Each of the features in my shapefile has hexid as a field.

I think what I want to achieve is in several parts:

Split my polylines into lines that keep the hexid, this should give me for each polyline two lines that are in top of each other but with different hexid
Somehow "dissolve" the lines that are geographically the same and obtain an attribute table similar to:

hexid1 hexid2
A      B
A      C
B      A
B      C
C      A
C      B

Then for both the shapefile and my table I can create a field that concatenates both hexagones (hexid1_hexid2), that I can do it using R for the table and the "add field" function, plus the field calculator.
That field/column that I have just created would be used as the index to join the table to the shapefile

For the task 1 I have tried ET GeoWizard but it is limited to 100 and each hexagon is not divided in 6 lines, but in 24, plus I have a limit of doing 100 hexagons each time, which I would be glad to avoid, if possible.

I also don't know how to "dissolve" the split lines by distance, I guess the distance is 0, or I could use something like "falls entirely in" as they will be identical.

Maybe I am asking for too much, but I am really frustrated because I cannot access my notebooks from 5 years ago (they are in another country...).


texts: License issues of Google Elevation API usage

texts:
I would like to use Google Elevation API in a non-profit scientific research (river floodplain relief study). I have looked through the documentation, but my poor English leaves me no chances to understand if I am allowed to do this.

I just want to:

Parse Google DEM using Google Elevation API;
Store the received data locally in shp for future processing;

Received data will not be displayed anyway: I am going to use it only for the calculation of specific relief parameters.

I will appreciate for any clarification of this question, especially from Google employees :)


texts: Labelling with empty cells of attribute table in QGIS?

texts:
I'd like to label points in a vector layer. In my attribute table I have a .csv with a list of material for each position (it's the planning of marathon race). Some of the cells are empty, though there is no need for a road barrier ("Gitter") or a fireman ("Feuerwehr") in every position.

If I insert too many labels (ID + others), they aren't visible anymore in the map.

Do you know what could be the problem?

Is it because empty cells do not work?


texts: Examples of beautiful statewide maps that have a lot of layers (20+ layers)

texts:
I'm in the process of building a statewide map of all the transportation modes, waterways, and other information for a whooping total of 40 layers.

I was wondering if you have seen print maps that have many displayed layers in a professional and beautiful manner, and if you can share it, or at least provide some of the design aspects that made the map so "pretty".

My question is different from beautiful maps as I'm only interested in printing them and not putting them on the web


texts: Suitable font size for road network for A0 -A1 print size QGIS

texts:
I need to print big paper maps, Im using QGIS to design my maps.
But I would like to get advice on suitable front size for road names. With the map as big as A0 I can basically fit all text labels for every road.
Is the point size the same as font size in QGIS for labels? So that a font size 1 is 9 pixels big?


texts:
I want to use the WebApp Builder in QGIS 2.12.3
But I can not find the QGIS Web App Builder in my QGIS version 2.12.3

Like this one:
http://boundlessgeo.com/2015/06/building-openlayers-3-web-app-without-writing-code/

When I go to plugins it just shows the three options: Phyton console, manage / install plugins and InaSAFE.

I also tried to install all useful plugins like qgis2web GeoSuite and OpenLayers plugin.

Do I need to install the 2.8 version?


texts: Adding a layer in the layer control, remove conflicting layer

texts:
In leaflet I'm trying to get a function going that when a user clicks on a certain (image)layer in the layer control panel and it sees that a conflicting layer is on, it turns the conflicting layer off and also turns it off in the layer control panel,

map.on('overlayadd', function(e) {
  switch(e.layer){
    case s2: if(map.hasLayer(s3)){map.removeLayer(s3);}
      break;
    case s3: if(map.hasLayer(s2)){map.removeLayer(s2);}
      break;
      default: break;
}

var overlays = {

"A": s1,
"B": s5,
"C": s6,
"D": s2,
"E": s3,
"F": s4,
"G": s7,
};

L.control.layers(baseLayers,overlays,{collapsed:false}).addTo(map);


texts: Updating column in Field Calculator using values of another column?

texts:
I am very new to GIS, so I hope to get some help. I am using ArcGIS 10.2 for Desktop.

I want to create a new numeric column on my attribute table to store "seasons" in numbers.

For example, I want the "seasons" field to hold a numeric code (i.e. "summer" will be "1", "autumn" to be "2", "winter" to be "3" and "spring" to be "4").

How can I do this using the field calculator?


texts: Can't get gdal_merge Python script to run

texts:
I downloaded and installed GDAL.  I am using Python 27. I had to use the following commands at the IDLE Python GUI:

from osgeo import gdal,ogr
sys.path.append('C:\Program Files\GDAL')
import gdal_merge

I actually have C:\Program Files\GDAL listed first in my Path environmental system variables, so I don't know why I need to do the above.
Anyway, when I try to use this utility, I don't get an error, but it only opens the Python script for editing, and doesn't run the script.  I know that the documentation for gdal_merge states "NOTE: gdal_merge.py is a Python script, and will only work if GDAL was built with Python support." I did install GDAL with Python support, and can get some utilities to run correctly (like gdalwarp.exe) but have trouble running the python scripts.

How can I find out for sure if my installation of GDAL has Python support?


texts: PostGIS: Count number of vertices of lines and polygons in tables

texts:
I have 23 tables in a PostGIS schema which I need to count the number of vertices of. The tables are a mixture of lines and polygons so realised I need to use ST_NPoints(geom)

So I ran the following query

SELECT count(ST_NPoints(geom) FROM lines;

the result/count equals the number of features in that table and not the total number of vertices of all features in that table.

I must be missing something but cannot figure it out (must be monday morning ;))


texts: Using Arcpy or Modeler to add SPOT 6/7 Imagery to Mosaic Dataset?

texts:
I cannot get ArcPy to add images in subfolders.

When using ArcPy (sample code from ESRI website), I see that it finds the DIM file, but it does not import it into the mosaic dataset.

I can manually add each file one at time using the Add mosaic dataset tool, but that is extremely time consuming.

An example of my file directory would be

S:\Spot6Imagery\SPOT_6_2016\VOL_SPOT6\IMG_SPOt6_P

The scenes and dim would be located in the IMG_SPOT6_P folder.  I would like to add just the SPOT6Imagery directory and the tool import all images.


texts:
My script:
  <script src="https://unpkg.com/openlayers@4.4.2"></script>
  <script>
        var ETRS89Extent = [5.93, 34.76, 18.99, 47.1];
        proj4.defs('EPSG:6706', '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs');

        var ETRS89proj = new ol.proj.Projection({
            code: 'EPSG:6706',
            extent: ETRS89Extent
        });
        ol.proj.addProjection(ETRS89proj);
        var startResolution = ol.extent.getWidth(ETRS89Extent) / 1024;
        var resolutions = new Array(22);
        for (var i = 0, ii = resolutions.length; i < ii; ++i) {
            resolutions[i] = startResolution / Math.pow(2, i);
        }
        var tileGrid = new ol.tilegrid.TileGrid({
            extent: ETRS89Extent,
            resolutions: resolutions,
            tileSize: [1024, 1024]
        });
        alert(ol.proj.transform(ol.extent.getCenter(ETRS89Extent), ETRS89proj, 'EPSG:3857'));
    </script>

The result of alert is 1387040.8552841886,5002022.15162612
The same script with a newer version of openlayers
  <script src="https://openlayers.org/en/v5.3.0/build/ol.js"></script>
  <script>
        var ETRS89Extent = [5.93, 34.76, 18.99, 47.1];
        proj4.defs('EPSG:6706', '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs');

        var ETRS89proj = new ol.proj.Projection({
            code: 'EPSG:6706',
            extent: ETRS89Extent
        });
        ol.proj.addProjection(ETRS89proj);
        var startResolution = ol.extent.getWidth(ETRS89Extent) / 1024;
        var resolutions = new Array(22);
        for (var i = 0, ii = resolutions.length; i < ii; ++i) {
            resolutions[i] = startResolution / Math.pow(2, i);
        }
        var tileGrid = new ol.tilegrid.TileGrid({
            extent: ETRS89Extent,
            resolutions: resolutions,
            tileSize: [1024, 1024]
        });
        alert(ol.proj.transform(ol.extent.getCenter(ETRS89Extent), ETRS89proj, 'EPSG:3857'));
    </script>

The result of alert is 12.459999999,40.93
Why do I get two different coordinates? Is the function ol.proj.transform correct?


texts: Drawing a triangle with specific angle and arm lengths

texts: I have to draw a triangle with an angle of 37 degrees, with the 2 sides forming that angle being 250m. I cannot figure out how to do this in ArcMap without hand-drawing it. This seems relatively basic enough that there should be a way to do it automatically. I am on ArcMap 10.3


texts: Is it possible to have v.in.lidar without compiling GRASS?

texts:
I already have installed libLAS like this:

sudo apt-get install liblas-bin

And Ì have installed GRASS GIS 7 from the ubuntugis-unstable repository.

Is it possible v.in.lidar without compiling GRASS? I have tried to install it with:

g.extension extension=v.in.lidar

This gives the following error:

  URL 'http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.in.lidar' doesn't exist
  ERROR: GRASS Addons  not found

Is there any way to make this work? Or any other way to avoid to have to compile GRASS as a whole? I am not very familiar with the compilation process, and as the guide recommends, I am trying to keep things as simple as possible.


texts: Adding extent lines to overview maps in QGIS print composer

texts:
Is there a way of automatically adding lines to overview maps in QGIS 3+ print composer? I see here it is done manually, but since I have several overview maps and might want to shift their position, to also change lines manually would not be an option.
It sounds like a very basic feature, but the only post I could find is this one and it only says that this feature will be available in v2.6 but does not explain how to do it.


texts: Split a Polygon that Crosses International Date Line, ArcPy

texts:
I have a lots of existing data in WGS-1984 (too much to manually edit).  I need to split these lines and polygons by the international date line.

More projection information:
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

Sample Coordinates:
([170, 0], [-170, 0], [-170, 10], [170, 10], [170, 0])

Does anyone have any python code to do this?

For regular polygons like this square it would be easy to detect if the vertical line crossing -180 (anti-meridian), but most polygons aren't nice squares.  So if I could give a set of points and detect and split the polygon into a multipart polygon would be what I'm trying to do.


texts: Geoprocessing tools won't work with the WDPA (World Database of Protected Areas) database

texts:
I am trying to run spatial stats (% area of overlap of various datasets) with the World Database of Protected Areas marine shapefile. It's a global collection of marine protected areas, so it's a big polygon file. But I can't seem to do any geoprocessing with it. Clip, Merge, Dissolve... anything I try just runs for hours, never getting anywhere, and I eventually have to cancel it and restart ArcMap.

I've tried manually merging small subsets of polygons (by Edit>Merge), and it appears that particular polygons are causing the problem ("The Merge command could not be completed"), but I have no way I identifying the problem polygons (or why they are problems), and there seems to be many throughout the dataset of >14,000 polygons.

Has anybody worked with the WDPA dataset, and had issues using it in any geoprocessing? How do I make this great dataset useful to me?


texts: Data request to GeoServer: "Could not determine geoserver request from http request GET /geoserver/ows?service=WFS HTTP/1.1"

texts:
I am using ExtJS ajax to send a data request to geoserver (which is in another domain different from web server), codes are as follows:

Ext.Ajax.request({ //send data request
        url : '../proxy.py?url=' + dataUrl,
        method : 'GET',
        headers: {
            'Content-Type': 'application/json'
        },
        success : function(response, opts) {
            var eventData = Ext.decode(response.responseText); //decode into JSON

            //parse eventData
        },
        failure: function(response, opts){
            Ext.Msg.alert("Failure", "Failed to retrieve event, please check service connection at " + dataUrl);
        }
    });

since it relates to cross-domain issue, we employed a python proxy at web server, and put the GeoServer domain into the accessible list. If I put the request url in browser then I can get the JSON response; however by using ajax call in code, we got following error:

    <ows:Exception exceptionCode="MissingParameterValue" locator="request">
<ows:ExceptionText>Could not determine geoserver request from http request GET /geoserver/ows?service=WFS HTTP/1.1
    Accept-Encoding: identity&#xd;
    Host: XXXX&#xd;
    Connection: close&#xd;
    User-Agent: Python-urllib/2.5&#xd; &#xd;
    </ows:ExceptionText> </ows:Exception>

I searched online, somebody said it's an issue related with proxy and the request headers. however, no detailed solution is found yet. I hope someone here can help me out.

thanks a lot!

UPDATE:
using escape() to escape the request URL!


texts: I want to calculate the density of agricultural fields in every cell of a square grid 1x1km. I have the fields shapefile and I built up a grid (.shp) with the same extent using fishnet tool. I created an ID field for the grid and then I intersected with the fields shape in order to associate every field (or field part) to a specific grid cell. I then dissolved based on ID allowing for multipart feature, but instead of having only 1 polygon per ID I still have some. Maybe someone faced the same ArcGIS problem and knows how to solve it.


texts: ArcObjects: Custom GP tools: GPCompositeDataType and DataType

texts:
I got an issue with the parameter value's datatype returned when using composite type parameters. In my case, I create a composite of DEWorkspaceType and DEFeatureClassType:

IGPCompositeDataType gpCompositeDataType = new GPCompositeDataTypeClass();
gpCompositeDataType.AddDataType(new DEWorkspaceTypeClass());
gpCompositeDataType.AddDataType(new DEFeatureClassTypeClass());

No matter what I select in my tool, e.g .gdb, .shp etc, I get "DEWorkspaceType" in the unpacked IGPValue.DataType.

If I switch the sequence of the types, using DEFeatureClassTypeClass as the first datatype in the composite, I get DEFeatureClass as the parameter value type.. no matter what I select in the dialog.

Am I left with parsing/guessing the datatype in the string from IGPValue.GetAsText() ?

(version: 10.0 SP5)


texts:
I'm currently trying to build two lists containing folder names, in order to use their elements for geoprocessing tools later on. However I struggle with creating the lists. I'm using ArcGIS 10.3 (Python 2.7).

What I need:

C:\test contains multiple subfolders that I would like to put in the first list, i.e. C:\test\test1, C:\test\test2, etc. The first set of subfolders contains another set, i.e. C:\test\test1\xy1, C:\test\test1\xy2 etc. What I need is a list with the names, not the paths, to each of the first level subfolders as in firstlevelList = [test1, test2, test3] and secondlevelList = [xy1, xy2, xy3]. I then want to use the arcpy.MosaicToNewRaster_management function to process data in each of the secondlevelList separetely (sort of according to this question).

What I've tried:

import arcpy, os

workspace = r"C:\test"
arcpy.env.workspace = workspace
arcpy.env.scratchworkspace = workspace
arcpy.env.overwriteOutput = True

firstlevelList = []
firstlevelList.append(os.listdir(workspace))
## up to here, everything works very well, the list contains all the available subfolders in my workspace.

secondlevelList = []
for element in firstlevelList:
    newPath = """{0}\{1}""".format(workspace, element)
    secondlevelList.append(os.listdir(newPath))

## This creates the following error:
##Runtime error
##Traceback (most recent call last):
##  File "<string>", line 8, in <module>
##WindowsError: [Error 3] Das System kann den angegebenen Pfad nicht finden: "C:\\Users\\sutter\\Desktop\\GIS_temp\\test\\['test1', 'test2', 'test3']/*.*"

I understand that apparently I cannot use a list element to create a new path?
I then also tried to following, which worked for one element of the fistlevelList() but not for all of them... :

secondlevelList = []
i = 0
for element in firstlevelList:
     newPath = """{0}\{1}""".format(workspace, element[i])
     secondlevelList.append(os.listdir(newPath))
     i += 1

Am I using the os.listdir function the wrong way? My knowledge about the os.path / os.walk functions is rather limited but I guess they could also help? Would I be better off using the arcpy.ListFiles() function?

The aim of the script:
Finally I would like to create a mosaic for all rasters in the secondlevelList separately. Example: folder C:\test\test1\xy1 contains 3 rasters. They need to be mosaiced. Then the following folder needs to be processed C:\test\test1\xy2 etc. I wrote this code for doing this:

for tile in firstlevelList:
    for run in secondlevelList:
        zeitschrittRaster = arcpy.ListRasters("*", "TIF")
        arcpy.MosaicToNewRaster_management(zeitschrittRaster, Sammelordner, """{0}.tif""".format(run), "", "32_BIT_FLOAT", 10, 1, "MAXIMUM", "FIRST")


texts:
after looking at older posts and googling for a while i guess there is not vrp solver (multiple trucks).

there was DARP in pgr1.x but i can't see it in 2.x.

i found a lot of information on https://github.com/pgRouting/pgrouting/wiki/VRP-Algorithms


texts:
After applying constraints to the DEM I polygonised the raster (using GRASS r.to.vect.area)
The result is shown below with a lot of vector with resolution = [30 * 30]
Is there any solution to make fusion if the difference DN between entities is 10 m for example?


texts: Why is pooled geoprocessing service not available via the ArcGIS Rest API?

texts:
I'm using ArcGIS Server 10.0.

I've published a pooled asynchronous python geoprocessing service. It works correctly using the Rest API.

When I configure the service not to be pooled, I can't access it via the Rest API anymore. I get the following error:
Service 'myService' of type 'GPServer' does not exist or is inaccessible. Error code: 404.

Is this normal?

Below the Pooling tab of my service configuration:


texts: QGIS Export Color mapped GeoTIFF to GeoTiFF

texts:
I've loaded a GeoTiff in QGIS (Single Band), and applied a Color Mapping.  I can view it in the map canvas, but I would like to export the entire mapped GeoTiff as an appropriate 3 Band GeoTiff (i.e to R,G,B values 0-255).

I know that you can export the current view -- but this is too low-resolution, and I would like to retain the current resolution.

Is there a hook in the Python QGIS module that might enable?


texts:
Recently I have derived a correlation equation between biomass and canopy height using sample tree parameters from field. The equation is

       Biomass = 0.0001(Height)^ 2.895.

I tried to calculate the biomass using the height derived from my Canopy Height Model (CHM) using the following code,

     var Biomass = CHMfinal.exp(2.895).multiply(0.0001).rename('AGB')

where, CHMfinal is my height data

but this is not working and giving me an error saying

   'Too many (2) arguments to function: Image.exp(value)

   Computes the Euler's number e raised to the power of the input.

 Args:

    value (Image): The image to which the operation is applied.
      in <global>, line 274
      in <global>, line 276'

Can anyone say where I am doing wrong?