texts: Restoring attribute table order to original in QGIS?

texts: I've sorted my attribute table by clicking on one of the column headers. Now I'd like to undo the sort and go back to the original table order. Each row has a reference number down the left edge but you don't seem to be able to sort on this reference number.


texts:
I am new to arcgis for android. I practice using Geocode and reverse geocode. I use sample Place Search from Esri, but i also want to add Reverse Geocode in it so that after a user put in the address and search, we put a circle graphic on the map. And if a user tap on the circle, a toast should show the street name.
I have a void method called identityLocation(float x, float y). Inside that method i have:

Point aPoint = new Point(x,y);
Point mapPoint = (Point) GeometryEngine.project(aPoint, SpatialReference.create(4326), mapView.getSpatialReference());

How do return the Street name? I tried to use: locator.reverseGeocode(mapPoint, 5.0) but i was unable to.
Please help me. Thanks


texts: How to manipulate elevation colour ramp in Potree?

texts:
I would like to render bare earth LiDAR data with a colour ramp using natural colors instead of vibrant blues to yellow to red.

Does anyone know how to manipulate Potree to enable this?


texts:
I have a need to take all the streets belonging to a certain area (in OpenStreetMap) and split each street by each other and form polygons from the segments that result from the split operation. I do not know whether such a function exists in the GIS tools that are available or if the algorithm needs to be written.

If I should write the algorithm, what would be a good way to approach the problem?

If the street network looks like below, polygons like given in red needs to be created (only as an example, in fact all the intersections between streets should produce polygons like these)


texts: the basemap of QuickMapService changed when exported from print composer layout?

texts:
I was trying to export the layout, which was supposed to be like this:

However, the exported image became untidy and unclear because of many secondary information were added, such as those tiny road names or county names.

How do I print the image as it appears in print composer layout?

The basemap is Bing Map from plugin `QuickMapService’.


texts: Legends in CartoDB - Appearing in Map Editor but not in Shared Maps

texts:
I have created a couple of maps in CartoDB and while the legends display when I am editting the map - they will not display when I share the maps.

Why this might happen and what I can do to fix it?

It is happening across all of my maps.


texts: What is the Pick tool in ArcGIS's Spatial Analyst commonly used for?

texts: I have recently encountered the Pick tool in the Spatial Analyst of ArcGIS. I understand what the tool does; it creates an output raster using a list of input rasters and a 'position' raster which dictates for each grid cell in the output which input it should receive the value from. I've looked for questions on GIS.SE that mention the Pick tool and there don't seem to be any. Having used GIS for quite some time now, I can't think of a past scenario when this operation would have been useful to me. Even the ArcGIS help documentation, which is normally quite extensive, doesn't reveal a use-case for the tool. I'm very curious whether any of you have ever used this tool and if so what for? Is there some niche area that I am overlooking, e.g. some operation involving multi-spectral images, in which this is a common operation?


texts: Eliminating small polygons using ModelBuilder to iterate through feature classes?

texts:
I created four large polygon feature classes of surface slope classes from a grid of 6-foot cells covering half my county. In order to repair the geometry and eliminate small polygons I broke four polygon feature classes into 115 polygon feature classes.

Now I'd like to remove small polygons from each of these polygon feature classes because the small bits take up a lot of memory and aren't important at the scale of analyses I'll be doing.

I tried using ModelBuilder with a Feature Class Iterator to go through the polygon feature classes, but I could not figure out how to select the small polygons in the active feature class. In order to use the Eliminate tool, there has to be a selection of features to eliminate. The problem is there does not seem to be a way to use the iterator variable as an input to the Select by Attribute tool.

I'd sure appreciate if someone could point me in the right direction to get this process automated.

[Using ArcGIS 10.1 ArcInfo license on 64-bit Windows 7 workstation]


texts: Enter Credentials not responding on QGIS startup?

texts:
I am running QGIS 2.18.3
I was recently creating a project that contained WFS layers that required logon details.

Now whenever I try to start QGIS it brings up the following window that cannot be dismissed.

I have tried editing the registry to remove all the recent projects form the list.

I have uninstalled and reinstalled QGIS
but the problem persists.

Currently my QGIS is completely un-usable.


texts: Making one to many to many Attribute Relationships

texts:
I am making relationship between three tables in QGIS 3.8 version ("ACTIVE SITE","FUEL_TANK","REFUEL").
The primary key and the foreign key for the Tables are as follow

the primary keys are "ACTIVE SITE"::'SITE_NAME', "FUEL_TANK"::'FUEL_TANK_ID', and "REFUEL"::'REFUEL_ID'
the foreign keys are "FUEL_TANK"::'SITE_NAME' and "REFUEL"::'FUEL_TANK_ID'

I made the relationships as seen in the following image

in another word, I've linked the the "ACTIVE SITE" Table and "FUEL_TANK" Table with the foreign key 'SITE_NAME'. And linked the the "FUEL_TANK" Table and "REFUEL" Table with the foreign key 'FUEL_TANK_ID'.

the problem is when I add a new record in "REFUEL" Table the 'FUEL_TANK_ID' takes the 'SITE_NAME' from "FUEL_TANK" Table not the 'FUEL_TANK_ID'

Am I doing something wrong??

And if I had a field in the "REFUEL" Table named 'SITE_NAME' could it be filled automatically from the 'SITE_NAME' field in the "FUEL_TANK" Table?? is there a way to do that??


texts:
I use Python toolbox in arcgis, it is possible to add a multiple input file table?

And is possible to filter input files allowed by extension?


texts: Why to use Add Attachments (Data Management) and not Hyperlink field?

texts: Why should I use Add Attachments and not a hyperlinked field? What are the advantages in case of a lot of layers with a lot of attachments at the GDB? What are the best way to manage attachments for a large database that contain a lot pf layers with attachments (JPG, PDFs, DWGs) in term of the paths (pre stage before publishing to ArcGIS Server)?


texts:
I'm downloading .nc file from here: https://www.cpc.ncep.noaa.gov/products/CFSv2/dataInd3/glbPrecMon.nc
I want to convert .nc file to .tiff file. I used raster to read file its not working. It's showing like this
In .rasterObjectFromCDF(x, type = objecttype, band = band, ...): anom has more than 4 dimensions


texts:
I've been trying to automatically download Landsat scenes with espa-api ( https://github.com/USGS-EROS/espa-api)

However I'm having a big issue with this api right now, that is the long waiting time between ordering and having the data available for download, even for level 1 products, which shouldn't take so long (don't require any additional processing).

Does anybody have any tips regarding this issue? Is there any way to speed up this downloading time, at least for level1 products?

Any other useful landsat ingestion api would be useful as well. I've been using landsat-util but unfortunately the download api is broken right now with the Collection 1 updates.


texts: How to embed metadata into a spatialite layer in QGIS?

texts:
Example usage:
I have a spatialite layer which contain my fiber optic cable routes. In that layer there is a column named 'Cable types' with coded integer data: 1 for aerial cable, 2 for underground cable... Now I want to send the spatialite database to a colleague. Is there anyway to preserve the meaning (description) of cable types without having to send the QGIS style file for that layer?


texts: Is there a way to save a spatial join as .sqlite?

texts: I'm joining data from PostGIS and SpatiaLite databases in QGIS using the "Join attributes by location" (Vector -> Data management Tools) tool. However, this has a big limitation - I can only save the result as SHP files, which truncates my column names because of the 8 character limit. Is there any way to save to a different Format, or can I go another way (maybe a spatial join on the SpatiaLite database)?


texts: How to cover a number of points with disks?

texts:
I have to cover some points with disks. These disks are not of a fixed size, they have to constraints:

a maximum diameter, and
a maximum number of points covered.

I would like to minimize/optimize the number of disks centers.

A point can be covered by two disks, but counts for only one of them.
All points should be covered.

The maximum number of points would be approx 40 per disk, and points are houses: a distribution based on pockets, lines (along roads) and isolated. It is for a whole country, so approx a million of points.


texts: Pausing WMS layer auto refresh in OpenLayers 3?

texts:
I have an application which has to perform a HTTP request (which will handle some map transformations) before fetching WMS tiles from server.

Is there a way to pause TileWMS auto-refreshing after dragging the map?

Setting invisible or removing and adding the layer will work, but I don't want the layer to disappear while performing the HTTP request. I also tried setUrl('') but the layer will also disappear.

I also tried to read OpenLayers source code to define a property to be checked before performing the requests but I couldn't find in code where the requests are made.


texts:
I am using GeoTools 10.7 to generate a map with decorations in my Java application.
One of the feature I need in the map is to display ortholines both latitude and longitude. The lines will need to be updated when I zoom to maintain relatively constant gaps in pixels - for example, if the initial presentation shows lines are 10 degrees apart using 100 pixels.  When I zoom the map, 100 pixel gap should remain unchanged but update the lat or lon values.

There is an example at GeoTools web site "Vector grids", and I followed the "Line grids" example thinking the major and minor lines are displayed one at a time depending on my zoom level.

My attempt so far:

ReferencedEnvelope currentBounds = getCurrentExtent();
ReferencedEnvelope gridBounds = new ReferencedEnvelope(
        currentBounds.getMinX(),
        currentBounds.getMaxX(),
        currentBounds.getMinY(),
        currentBounds.getMaxY(), landCRS);

// Line definitions
lineDefs = Arrays.asList(
        new OrthoLineDef(LineOrientation.VERTICAL, 2, 5.0),
        new OrthoLineDef(LineOrientation.VERTICAL, 1, 1.0),
        new OrthoLineDef(LineOrientation.HORIZONTAL, 2, 5.0)
        new OrthoLineDef(LineOrientation.HORIZONTAL, 1, 1.0));

// Specify vertex spacing to get "densified" polygons
double vertexSpacing = 0.1;
OrthoLineFeatureBuilder olBuilder = new OrthoLineFeatureBuilder(OrthoLineFeatureBuilder.VALUE_ATTRIBUTE_NAME, CRS);
grid = Lines.createOrthoLines(gridBounds, lineDefs, vertexSpacing, olBuilder);

GeometryDescriptor geomDesc = grid.getSchema().getGeometryDescriptor();
geometryAttributeName = geomDesc.getLocalName();

Rule rule = sf.createRule();

// Text symbolizer
Fill fill1 = sf.createFill(ff.literal(new Color(255,255,255,100)));
AnchorPoint anchorPoint = sf.createAnchorPoint(ff.literal(0.5d), ff.literal(0d));
LabelPlacement labelPlacement = sf.createPointPlacement(anchorPoint, null, ff.literal(0));
TextSymbolizer text = sf.createTextSymbolizer();
text.setFont(sf.createFont(ff.literal("Arial"), ff.literal(false), ff.literal(false), ff.literal(10)));
text.setLabel(ff.property(OrthoLineFeatureBuilder.VALUE_ATTRIBUTE_NAME));
text.setFill(fill1);
text.setLabelPlacement(labelPlacement);
rule.symbolizers().add(text);

Rule rules[] = {rule, createRule(GeomType.LINE, new Color(255, 255, 255, 100), null)};
FeatureTypeStyle fts = sf.createFeatureTypeStyle(rules);
Style style = sf.createStyle();
style.featureTypeStyles().add(fts);

gridsLayer = new FeatureLayer(grid, style);

With this code, I only get the lines displayed at every 1 degree in both direction, and remains at 1 degree separation at any zoom level.  So when I zoom in, lines become far apart, and when I zoom out they get closer (obviously!)

Solved (hack or not) using DirectLayer.


texts: Microsoft Access mdb "is not a valid or recognized data source" in QGIS

texts: The answer to RyanDalton's question "Can QGIS read an ODBC connection?" explains how to establish a link in QGIS with an MS-Access table. Following his steps, I can establish an ODBC link (I successfully complete up to step 7), but when the .mdb is imported, I get an error that the file "is not a valid or recognized data source" in QGIS. I assumed QGIS would read each table as a non-spatial layer, as mentioned in the OGR_OGBC specs, but this is not happening. Can anyone tell me why the tables are not being read? Thanks in advance. I am using a 64-bit version of Windows with 32-bit QGIS and OGDB drivers.


texts:
How can I load a data file layer (e.g.: output2) that is an output of a process ('processing.run') so that it serves as the input layer for a second process ('processing.runAndLoadResults') in the same plugin without having to load the data source file path (e.g.: output2) directly? The input for the second process is currently loaded like this:
output_new = 'c:/PLUGINS1/Test_Output/Rasters/rasSAGA_Farm_Raster1.sdat'
The idea is so that the second process uses the output2 in my code for the input layer immediately after the first process ends.
Here is my code:
            if layer.type() == QgsMapLayer.RasterLayer and self.dlg.checkPixel.isChecked():

                num_cell = self.dlg.spinSize.value()

                # # get extension about the raster
                filename, file_extension = os.path.splitext(layer.source())
                output2 = self.folderName + "/Rasters/rasSAGA_" + layer.name() + ".sdat"
                output3 = self.folderName + "/Rasters/rasRES_" + layer.name() + file_extension

                # check file isn't opened and is writable
                version = 0
                while self.isFileOpened(output2):
                    output2 = self.folderName + "/Rasters/rasSAGA_" + layer.name() + "(" + str(
                        version) + ").sdat"
                    version += 1

                # check file isn't opened and is writable
                version = 0
                while self.isFileOpened(output3):
                    output3 = self.folderName + "/Rasters/rasRES_" + layer.name() + "(" + str(
                        version) + ")" + file_extension
                    version += 1

                processing.run('saga:resampling',
                               {"INPUT": output1, "KEEP_TYPE": True, "SCALE_UP": 0, "SCALE_DOWN": 0,
                                "TARGET_USER_SIZE": num_cell, "TARGET_USER_FITS": 1, "OUTPUT": output2})

                        # convert SAGA to GTiff (if displayed and checked)

                output_new = 'c:/PLUGINS1/Test_Output/Rasters/rasSAGA_Farm_Raster1.sdat'
                # output_new = 'c:/PLUGINS1/Test_Output/Rasters/rasSAGA_Farm_Raster2.sdat'

                processing.runAndLoadResults("gdal:translate", {"INPUT": output_new, "OUTPUT": output3})


texts: Inserting enclosed Street Names into street_name column of polygon in ArcGIS for Desktop?

texts:
I have a set of polygons in a feature class & there are streets layer with names within these polygons as shown in the attached image.

How to insert the enclosed Street Names into the street_name column of a polygon in ArcGIS for Desktop?


texts: Filter image collection with a month range for each year in Google Earth Engine?

texts:
I have used the codes below to calculate the total annual for the image collection based on Calendar Year. Now I want to calculate the sum again using a water year, from 8/1/2018 to 8/31/2019 as one year for example.

How do I make my own annual range filter in Google Earth Engine?

> // Set start and end of time series

var startYear = 1981;

var endYear = 2019;

var regions = "municipio";

// Create a list of years by generating a sequence from start and end years

var years = ee.List.sequence(startYear, endYear);

// Generate annual summed image mosaics

var annualPrecip = ee.ImageCollection.fromImages(
  years.map(function (year) {
    var annual = chirps
        .filter(ee.Filter.calendarRange(year, year, 'year'))
        .sum();
    return annual
        .set('year', year)
        .set('system:time_start', ee.Date.fromYMD(year, 1, 1).format("YYYY_MM_dd"));
}));


texts: Parameters start_id and end_id when calling http://localhost:8888/Osm2poService?cmd=ft&tsp=

texts: Good day! How to pass parameters start_id and end_id when calling  http://localhost:8888/Osm2poService?cmd=ft&tsp=1,2,3,4,5?


texts: Exporting feature collection in Google Earth Engine?

texts:
I am working out the area (in hectares) of a land cover class in the counties of California using google earth engine. So far, I have created a featurecollection that works, but when I try to use the export to table function I get the following error:

Error: Feature, argument 'metadata': Invalid type. Expected: Dictionary. Actual: FeatureCollection.

I don't mind if the export is CSV or SHP - whichever is easiest as I will then analyze my data in R/arcpy.

My code is as follows:

print('starting...');
// Load a FeatureCollection of US Counties.
var Counties = ee.FeatureCollection("TIGER/2016/Counties");

//Imports NLCD Land Cover Data
var LandCover = ee.Image('USGS/NLCD/NLCD2011')

var cali = Counties.filter(ee.Filter.eq('STATEFP','06'));
Map.addLayer(cali, {}, 'cali');

// Clip the image to the polygon geometry
var LandCover = LandCover.clip(cali);

// Extract the landcover band
var landcover = LandCover.select('landcover');
Map.addLayer(landcover, {}, 'landcover');

// create masks for each class, then covert into area by multiplying by pixel
// area and dividing by class #, then sum reduce over the counties
// then export each as a table (if you can aggregate into one table)
// https://gis.stackexchange.com/questions/230774/extracting-land-cover-type-in-google-earth-engine

var lc11 = landcover.eq(52);
var mask11 = landcover.mask(lc11);
var pixarea = ee.Image.pixelArea();

var pix2area11 = mask11.select('landcover').multiply(pixarea.select('area')).divide(520000);

Map.addLayer(pix2area11, {}, 'pix2area11');

pix2area11 = pix2area11.select('landcover');
var area11 = pix2area11.reduceRegions({
  collection: cali,
  reducer: ee.Reducer.sum(),
  scale: 30,
});
// Print the first feature, to illustrate the result.
print(ee.Feature(area11.first()));

// Translate feature collection to table with necessary identifiers

area11 = area11.select(['sum', 'COUNTYFP', 'STATEFP']);

print(area11);
Map.addLayer(area11, {}, 'area11');

// Make a feature without geometry and set the properties to the dictionary of area11.
var feature = ee.Feature(null, area11);

// Wrap the Feature in a FeatureCollection for export.
var featureCollection = ee.FeatureCollection([feature]);

// Export the FeatureCollection.
Export.table.toDrive({
  collection: featureCollection,
  description: 'area11',
  fileFormat: 'CSV'
});
// https://developers.google.com/earth-engine/exporting

print('done');


texts: Qgis TimeManager: InvalidTimeLayerError: invalid value 'cannot switch from manual field specification to automatic field numbering'


texts:
I can not understand the essence of the problem ...
There is a web page with openlayers 4, on it as a base layers I can choose Bing, OSM, Yandex and others:

        src = new ol.source.BingMaps({
        imagerySet: 'AerialWithLabels',//'AerialWithLabels',
        key: '---'
    });
    bases["bing"] = new ol.layer.Tile({
        name: 'bing',
        title: 'Bing Maps aerial',
        is_base_layer: true,
        visible: false,
        source: src
    });

    src = new ol.source.XYZ({
        url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png',
        visible: true
    });
    bases["tf"] = new ol.layer.Tile({
        name: 'tf',
        visible: false,
        source: src,
        is_base_layer: true
    });

    src = new ol.source.OSM();
    bases["osm"] = new ol.layer.Tile({
        name: 'osm',
        visible: false,
        source: src,
        is_base_layer: true
    });

With Yandex is more complicated:

        var yaex = [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244];
    proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
    ol.proj.get('EPSG:3395').setExtent(yaex);

    bases["yandex"] = new ol.layer.Tile({
        source: new ol.source.XYZ({
            url: 'http://vec0{1-4}.maps.yandex.net/tiles?l=map&x={x}&y={y}&z={z}',
            projection: 'EPSG:3395',
            tileGrid: ol.tilegrid.createXYZ({
                extent: yaex
            })
        }),
        visible: false,
        is_base_layer: true
    });

I create a map as usual:

        var map = new ol.Map({
        controls: ol.control.defaults({
            attribution: false
        }).extend([mousePositionControl]),
        target: 'map',
        layers: [],
        view: new ol.View({
            projection: 'EPSG:3857'
        })
    });

Everything works fine, I can switch the base layers, everything is correct.
Now I want to change the projection of the view to 4326:

view: new ol.View({
            projection: 'EPSG:4326'
        })

All the base layers are displayed correctly, but Yandex is not displayed.
Chrome says:

proj4-src.js:1836 Uncaught TypeError: Cannot read property 'x' of null
at transformer (proj4-src.js:1836)
at forward (proj4-src.js:1875)
at ol-debug.js:5515
at ol.reproj.Triangulation.transformInv_ (ol-debug.js:67660)
at new ol.reproj.Triangulation (ol-debug.js:67720)
at new ol.reproj.Tile (ol-debug.js:70840)
at ol.source.XYZ.ol.source.TileImage.getTile (ol-debug.js:72003)
at ol.renderer.canvas.TileLayer.prepareFrame (ol-debug.js:69282)
at ol.renderer.canvas.Map.renderFrame (ol-debug.js:23128)
at ol.Map.renderFrame_ (ol-debug.js:31812)

Look more:

   function transformer(from, to, coords) {
 var transformedArray;
 if (Array.isArray(coords)) {
   transformedArray = transform(from, to, coords);
   if (coords.length === 3) {
     return [transformedArray.x, transformedArray.y, transformedArray.z];
   }
   else {
     return [transformedArray.x, transformedArray.y];// <--- ERROR HERE
   }
 }
 else {
   return transform(from, to, coords);
 }

}

transformedArray is null. null it is equal because transform() is called for point [0, -90], and Yandex has the extent [-180,-85,180,85], i.e. point outside the Yandex extent. I thought because of this, but I looked at Bing and they also had the same extent [-180,-85,180,85] as in Yandex.
If I give Yandex a projection of 3857, then everything starts to be displayed, but the problem is that Yandex is then have offset.
In general, I do not understand why this happens.


texts: Converting *.dwg to *.shp using FME pyfme or fmeobjects in bulk?

texts:
I have many cad files with some important attributes, and I want deal with these vector data in ArcMap keeping attributes.

I want to convert this data to shapefiles in bulk.

I know FME software can do this, but I can't find way to do this in bulk.

I want to do this in the fme script language called pyfme so how can I use that?


texts: Qgis SAGA Upslope Area for several points automation

texts:
In the Upslope Area tool from SAGA it used to be possible to import the point file with multiple points and it would create several catchment/basins areas for those points. Now, it is only possible to MANUALLY enter coordinates for only 1 point. However, for a model we're building, we need to perform this analysis 24 times (as we have 24 different points) so we need to automate this process. I tried to use Run as Batch process + calculate by expression and get the XY coordinates from another layer, however, I run into the problem that I need to reference the XY coordinates that are stored in the other layer and looks like there isn't an easy way of doing so. Any suggestions on how to do that? Tried the geomwithin(targetLayer,targetField) from RefFunctions plugin but that produces empty result

so to resume, I have two questions:

How to calculate upslope areas for multiple points?
Is there a way to automatize it in the graphical modeler?


texts: How to use MapProxy to fill missing samples

texts:
I want to use Mapproxy resampling_method to fill missing samples when scaling. I don't know how to do that or if this is even possible?

I use AWS terrain tiles as data source:

sources:
  aws_elevation_tiles_source:
    type: tile
    grid: GLOBAL_WEBMERCATOR
    url: https://s3.amazonaws.com/elevation-tiles-prod/terrarium/%(z)s/%(x)s/%(y)s.png

Another (custom written) tile server myserver calculates a feature for each of this 256x256 tiles, which can be represented as a single pixel. The tile coordinates are corresponding.

layers:
  - name: my_layer
    title: My Feature
    sources: [my_cache]

caches:
  my_cache:
    sources: [my_source]
    grids: [my_grid]
    image:
      resampling_method: bicubic

sources:
  my_source:
    type: tile
    grid: my_grid
    url: http://myserver/tms/1.0.0/feature/EPSG3857/%(z)s/%(x)s/%(y)s.png
    transparent: true
    image:
      format: image/png

grids:
    my_grid:
        base: GLOBAL_WEBMERCATOR
        tile_size: [256, 256]

Approach A

Each tile is a 1x1 PNG. The calculated feature is at the center of each tile.

Approach B

Each tile is a 256x256 transparent PNG with an intransparent pixel at (127,127). The calculated feature is at the center of each tile.

Changing or removing the resampling_method option doesn't has any effect
(even if approach A looks like nearest neighborhood resampling).

I also tried to use grayscale samples, with the same effect.

What I want to have is a WMS server which shows the calculated features on a map and uses bicubic interpolation to fill the space between the samples.


texts: Is it possible in the QGIS GUI to copy/paste a layer's label style only between layers?

texts:
Is it possible in the QGIS GUI to copy/paste a layer's label style properties only between layers?

In QGIS (2.18.1, win7), while it is possible to copy a layer's entire style (symbology + label style properties) and then paste it to another layer (assuming geometry type is the same), it doesn't seem possible to only copy the layer's label style properties to then paste it to another layer (whether of the same geometry type or irrespective thereof).

According to my shortcut configurations, copying and pasting an entire style between layers is achieved by the very simple and handy: SHIFT-C --- SHIFT-V

Is there currently, or a way to configure, a function (that could similarly be turned into a QGIS GUI shortcut) to just copy/paste a layers' label style properties only (or conversely only the layers symbol style)?


texts:
Updating QGIS to the new version I have serious projection problems:
I am loading a shape-file from STATISTIK AUSTRIA (an offical authority in Austria) with the following projection:

  PROJCS["MGI / Austria Lambert", GEOGCS["MGI",
  DATUM["Militar-Geographische Institut", SPHEROID["Bessel 1841",
  6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]], TOWGS84[601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887], AUTHORITY["EPSG","6312"]], PRIMEM["Greenwich", 0.0,
  AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295],
  AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH],
  AUTHORITY["EPSG","4312"]], PROJECTION["Lambert_Conformal_Conic_2SP",
  AUTHORITY["EPSG","9802"]], PARAMETER["central_meridian",
  13.333333333333336], PARAMETER["latitude_of_origin", 47.5], PARAMETER["standard_parallel_1", 48.99999999999999],
  PARAMETER["false_easting", 400000.0], PARAMETER["false_northing",
  400000.0], PARAMETER["scale_factor", 1.0], PARAMETER["standard_parallel_2", 46.0], UNIT["m", 1.0],
  AXIS["Easting", EAST], AXIS["Northing", NORTH],
  AUTHORITY["EPSG","31287"]]

Loading the shape-file seems to work fine:

But when you make a pagelayout for a DIN A4 page you get this strange scale:

Setting the scale 1: 3 Million you get this:

I think QGIS uses weird/wrong Cartesian coordinates as my last screenshot suggests:

I installed QGIS with the standalone-installer on Windows 10.

Update: You can download the test-files (shp, prj) from this url:
https://data.statistik.gv.at/data/OGDEXT_NUTS_1_STATISTIK_AUSTRIA_NUTS3_20190101.zip

Update #2: screenshot "about":

Update #3: @gabriel-de-luca your workaround does not work for me:
Cartesian coordinates seem to look okay now, but ellipsoid coordinates are completly wrong, and adding a scale-bar in the page-layout is completly wrong too:

Update #4: Screenshot  Project Properties General:

Update #5: This weird behaviour does not occur under Ubuntu :

Update #6: A small screenshor recording of GQIS under Windows shows the strange behaviour. Look like the number of the kilometers becomes bigger, then smaller, than bigger again, ....

Update #7: Pan and Zoom does not help, a basemap (NE 1: 50 Mio) is show as a basemap:


texts: Combine two raster maps with transparency

texts:
I have two maps in geotiff format for exactly the same area with exactly the same geoinformation. The first one is a real land map, the second one is a satellite picture with clouds (rgba where alpha is somehow the degree/thickness of clouds).

How can I combine these two maps so that the clouds are visible on the land map dependend from their transparency channel?

I tried gdal_merge but it does not use the alpha channel from the second map, i.e. there is no transparency but clouds fully overlap the other map. If I just open both maps together in QGIS, it shows exactly what I want.


texts:
I have a couple of large sets of imagery I need to mosaic using GDAL. The sets are currently in tiff format with 18 tiles totaling about 20gb in size. I have attempted to mosaic using both the gdal_merge.py and gdalwarp utilities. The results are either a completely black raster or only white pixels where the image should be. Does anyone know how to prevent this from happening? Looking over the documentation I did not see any parameters that I thought would make a difference, but am I missing one?

I also attempted the same process with the same images in PNG format, and got the same results using this command:

gdal_merge.py -o mosaic.tif Baton_Rouge_01.png Baton_Rouge_02.png Baton_Rouge_03.png Baton_Rouge_04.png Baton_Rouge_05.png Baton_Rouge_06.png
Baton_Rouge_07.png Baton_Rouge_08.png Baton_Rouge_09.png Baton_Rouge_10.png Baton_Rouge_11.png Baton_Rouge_12.png Baton_Rouge_13.png Baton_Rouge_14.png
Baton_Rouge_15.png Baton_Rouge_16.png Baton_Rouge_17.png Baton_Rouge_18.png

Edit:

I am not using QGIS, I am attempting to complete this processing using the GDAL cmd line utilities. I tried the gdalbuildvrt utility then pulled the vrt into arcmap for viewing. The result looked like this:

Using this command:

gdalbuildvrt -input_file_list list.txt test.vrt

The white area should be RGB image.


texts:
I have been supplied with a MapInfo TAB file and when opened in MapInfo 15.2 (64bit) the layer is displayed along with a Thematic Theme Layer.

The symbology generated by the Thematic Theme no longer reflects the data within the browser. For example, a point which should be coloured red according to a particular column is displaying as blue.

How do I remove the Thematic Theme so it doesn't appear when opening the TAB file?


texts: Using multiple processing algorithms cause an 'attribute error'

texts:
I have two processing algorithms in my plugin code and I want to use the outputs of them into a new algorithm, like this:

buff = processing.runandload('qgis:fixeddistancebuffer', layers[self.pic], 10 + (10 * (int(self.dlg.lcdNumber_1.value())) / 100), 5, True, None)
# buff and buff2 are fine, they will add to canvas, no errors
buff2 = processing.runandload('qgis:fixeddistancebuffer', layers[self.pic], 30 + (30 * (int(self.dlg.lcdNumber_2.value())) / 100), 5, True, None)

and I want to use the two to a new algorithm like:

processing.runandload('qgis:difference', buff2['OUTPUT'], buff['OUTPUT'], None)

but it will give AttributeError: FixedDistanceBuffer instance has no attribute '__getitem__'what can i do?


texts:
I have Center point(Latitude,longitude) for a place and radius. How to draw a circle/polygon on an ArcGIS map using Latlong and radius(also need WKT string).
I am new to ArcGIS & do not have much idea about ArcGIS.


texts: ArcGIS Editor Attributes Dialog in ArcObjects?

texts:
Is there a way to update the Editor Attributes dialog to populate/refresh on ArcObject feature selection code?  The attributes dialog only seems to respond to a manual view selection or manual table selection.  Here is my current feature selection code:

Try

            Dim pFeatSelection As IFeatureSelection = Nothing
            Dim pFeatureLayer As IFeatureLayer
            Dim pQueryFilter As IQueryFilter
            Dim pSelSet As ISelectionSet
            Dim pFCur As IFeatureCursor = Nothing
            Dim player As ILayer
            Dim pEnumLayer As IEnumLayer

            m_App = CType(Hook, IApplication)
            m_MxDoc = CType(m_App.Document, IMxDocument)
            m_mxDocument = CType(m_App.Document, MxDocument)
            m_map = CType(m_MxDoc.FocusMap, Map)

            Dim pActiveView As IActiveView
            pActiveView = m_MxDoc.FocusMap

            m_map = m_MxDoc.ActiveView.FocusMap
            pEnumLayer = m_map.Layers

            Dim number As Int32 = InputBox("FID number")

            player = pEnumLayer.Next
            Do Until player Is Nothing
                If player.Name = "MyLayer" Then
                    pFeatureLayer = CType(player, IFeatureLayer)
                    pFeatSelection = CType(pFeatureLayer, IFeatureSelection)
                End If
                player = pEnumLayer.Next
            Loop

            pQueryFilter = New QueryFilter
            pQueryFilter.WhereClause = "FID = " & number

            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)

            pFeatSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultNew, False)
            ' Create a feature cursor of selected interstates.
            pSelSet = pFeatSelection.SelectionSet
            pSelSet.Search(Nothing, False, pFCur)
            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)

        Catch ex As Exception
            MessageBox.Show("Caught an unspecified error in the calling code: " & vbCrLf & ex.ToString)
        Finally


texts: How to find measure from geometry using PostGIS or GeoServer (Linear Referencing)

texts:
I'm using OpenLayers with GeoServer and PostGIS. I'm looking for a way to get measure from geometry. I mean if a user clicks on a feature as line route on the map (geometry), we can find it's measure or distance from begin origin of the route.

It is clear that sometimes, origin point of a route has a measure other than zero. On Esri ArcGIS we have this functionality using location information on Linear Referencing features.

Is there any way to find it using postGIS or GeoServer functionalities?


texts: Is it possible to create a KML to list the road names within a buffer?

texts: I often need to know the road names within a given buffer of a polygon. Is it possible to create a KML that would stick a push pin in the roads and list the name so I could see them all in a drop down menu? I am new to GIS data manipulation.


texts:
When I run qgis 1.8.0 on Linux and load a WMS layer from a remote server
I get messages (in terminal) saying

Warning: QNetworkDiskCache::prepare() unable to open temporary file

Downloading tiles from the WMS server was quite slow. So I wondered if
having a tile cache would help.

Is there some configuration variable I can set so that the QNetworkDiskCache
can open a temporary file? e.g. by specifying a location for temporary files?

Or can this warning safely be ignored?

Thanks, David


texts:
I'm trying to install the Profile Tool on QGIS 2.14 (newest version present in ubuntugis ppa) and i get this error:'No module named PyQt.QtCore'
I have installed the following packages:python3-pyqt4, python-qt4-dev, pyqt4-dev-tools, python-pyqt5, python3-pyqt5, pyqt5-dev, pyqt5-dev-tools
but the plugin is still not working.

Does anyone know how to fix this situation?


texts:
I have a problem with getting the ID of a newly created feature in the shapefile.

I have a datasource / datastore that reads and writes to a shapefile. I create a feature, add it to the store and commit transaction. The problem is, that as a result of my method I want to have my newly created feature in a geojson format. Everything is fine except the ID of the new feature which is "new0" instead of the FID that actually appears in the shapefile.

This is the piece of code I use to add feature to the store:

FeatureWriter<SimpleFeatureType, SimpleFeature> writer = // I get my writer here ...
SimpleFeature feature = writer.next();
feature.setAttributes(data);
writer.write();
writer.close();
transaction.commit();

The feature is created and stored in the shp. Only the problem remains with the FID of the appended feature. When I run exactly the same method for SDE datastore it works as expected.

I have seen this error on other forums. The posts were even asked quite long time ago and I hoped that this bug will be fixed in Geotools 13. Apparently it is not :(

Is there a way to fix it somehow ?

Before changing to Geotools 13 I used the version: 12.2.
There I made this listener class:

private static class CreatedFeatureListener implements FeatureListener {
    private Filter                                                  filter;
    private FeatureSource<? extends FeatureType, ? extends Feature> source;

    @Override
    public void changed(FeatureEvent featureEvent) {
        filter = featureEvent.getFilter();
        source = featureEvent.getFeatureSource();
    }

    public List<Feature> getAddedFeatures() throws IOException {
        List<Feature> result = new ArrayList<>();
        FeatureIterator<? extends Feature> iter = null;
        try {
            iter = source.getFeatures(filter).features();
            while (iter.hasNext()) {
                result.add(iter.next());
            }
        } finally {
            if (iter != null) {
                iter.close();
            }
        }
        return result;
    }
}

It allowed me to properly get the new feature with the proper ID.
Unfortunately after changing the version it stopped working. The event is not fired and I get NullPointerException when I call getAddedFeatures() method.


texts: Installing QGIS plugin called profile from line?

texts:
i am trying to install a new plugin called profile from line and then this error appear and i dont konow what to do.

Couldn't load plugin 'profilefromline' from ['C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/LourenÃ§o AmÃ©lia/.qgis//python', 'C:/Users/LourenÃ§o AmÃ©lia/.qgis//python/plugins', 'C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\bin\python27.zip', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\DLLs', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\plat-win', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\lib-tk', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\qgis\bin', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\PIL', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32\lib', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\Pythonwin', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\qgis\python\plugins\fTools\tools']

Traceback (most recent call last):
  File "C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 143, in loadPlugin
    import(packageName)
  File "C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 309, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named profilefromline

Python version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.8.0-Lisboa Lisboa, 6416f38

Python path: ['C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/Louren\xc3\xa7o Am\xc3\xa9lia/.qgis//python', 'C:/Users/Louren\xc3\xa7o Am\xc3\xa9lia/.qgis//python/plugins', 'C:/Users/LOUREN~1/DOCUME~1/NEWFOL~1/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\bin\python27.zip', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\DLLs', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\plat-win', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\lib-tk', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\qgis\bin', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\PIL', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\win32\lib', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\Pythonwin', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\LOUREN~1\DOCUME~1\NEWFOL~1\Quantum GIS Lisboa\apps\qgis\python\plugins\fTools\tools']


texts: Geocoding or adding region to imported Access table in MapInfo

texts:
I have imported an Access database of 500+ sites into MapInfo. I've managed to geocode all but 80 of them against other tables that have the sites as regions with the same ID number, and replaced the geocoded objects with regions.

What can I do about the 80+ sites that have not been geocoded and need a region manually assigning to them? Selecting and adding a region just creates a new record. There is no object to do 'clear map objects' as there would be if the record was geocoded.


texts: Top percentile in zonal statistics - ArcGIS

texts:
This is quite a simple question and I'm sure it's possible as I've seen it referenced in research articles (e.g. here, p.38). I have a raster with continuous values (0-1), and a vector dataset of a line. What I want as output is the 95th percentile of all cells intersecting the raster (the top 5 percentile is above this value).

So for example, if my raster is intersected by the line at 100 cells, I want the value of the 95th highest cell. Zonal statistics as table only seems to be able to output the median, mean, or maximum cell values. Is there any simple way to do this, in ArcGIS or arcpy?


texts: Is it not possible to transform a feature from one featuredataset into another with arcgis toolbox?

texts:
I am reprojecting datasets from the path1 to path2. The only difference is that the dataset is names differently and obviously has another coordinate system.

path1 = Datenbankverbindungen\VEKTOR.sde\GISVektor.DBO.Verkehr\GISVektor.DBO.VISPA_POINT
path2 = Datenbankverbindungen\VEKTOR.sde\GISVektor.DBO.Verkehr_ETRS\GISVektor.DBO.VISPA_POINT_ETRS
However, when the dataset has been successfully transformed with arctoolbox, the featureclass is saved outside the featuredataset and in the root directory of the database.

Is this normal?

yours,

Robert


texts: Is it possible to find the feature class name from a python label expression in ArcGIS?

texts:
Does anyone know how to find the path to a feature class within a label expression using ArcGIS?

I don’t need to simply display the path. My overall goal is to create a python function to display x,y coordinates directly from the Shape geometry, as shown in this  answer. But this code will fail if the user changes the layer name, so I want to make the code more robust by finding the path to the feature class.

I know it is possible to find the path from the selected layer from the code below. But this will of course display varying paths depending on what layer is selected.

import pythonaddins
def FindLabel ( [OBJECTID] ):
  mxd = arcpy.mapping.MapDocument("CURRENT")
  df = pythonaddins.GetSelectedTOCLayerOrDataFrame()
  return df.dataSource

I need something similar to  __file__ for arcpy/ArcGIS with reference to the dataset. Does such a thing exists or is there another solution I can use?


texts: Transforming Alaska and Hawaii to be next to USA with TurfJS?

texts:
I'm working on an app that contains a map; right now, the map just includes the Continental US, but it would be great if Alaska and Hawaii could be included as well.

So far, I've found shapefiles for the US from the Census Bureau, converted them to GeoJSON using ogr2ogr, and started modifying the files with TurfJS. Most of my experience is in raw WGS84 mapping without any transformations, so this process is new to me and I'm not entirely comfortable yet.

I looked through the TurfJS docs, and noticed that I could use some of their methods to find the rhumb bearings and distances necessary to move GeoJSONs around. However, this doesn't seem to work well, since the polygons for Alaska and Hawaii end up very distorted. Here's an example of what I'm running into:

This is the code I'm using, where geoJSON contains data for US states, alaska and hawaii correspond to their respective features inside of geoJSON:

// Rescale and translate Alaska
alaska = turf.transformScale(alaska, 0.6)
let alaskaCentroid = turf.centroid(alaska)
let alaskaTarget = turf.point([-140, 40])
let alaskaTranslateDistance = turf.rhumbDistance(alaskaCentroid, alaskaTarget)
let alaskaTranslateBearing = turf.rhumbBearing(alaskaCentroid, alaskaTarget)
alaska = turf.transformTranslate(alaska, alaskaTranslateDistance, alaskaTranslateBearing)
fs.writeFileSync(`${geoJSON.name}_alaska_adjusted.geojson`, JSON.stringify(alaska))
geoJSON.features[alaskaIndex] = alaska
// Translate Hawaii
hawaii = turf.transformScale(hawaii, 0.8)
let hawaiiCentroid = turf.centroid(hawaii)
let hawaiiTarget = turf.point([-130, 30])
let hawaiiTranslateDistance = turf.rhumbDistance(hawaiiCentroid, hawaiiTarget)
let hawaiiTranslateBearing = turf.rhumbBearing(hawaiiCentroid, hawaiiTarget)
hawaii = turf.transformTranslate(hawaii, hawaiiTranslateDistance, hawaiiTranslateBearing)
fs.writeFileSync(`${geoJSON.name}_hawaii_adjusted.geojson`, JSON.stringify(hawaii))
geoJSON.features[hawaiiIndex] = hawaii
// Save final file
fs.writeFileSync(`${geoJSON.name}_adjusted.geojson`, JSON.stringify(geoJSON))

It seems like there's some concept about projections/transformations that I'm missing here, but I've already looked around and I'm stumped at this point.

Why have I come to the conclusion that transforming Alaska and Hawaii is the best way to solve my problem?

The map is going to be plotting points in real time, but there won't be a scale/legend, so getting each state's shape to match what it looks like on a flat, Mercator map is important
Unfortunately, since I'm plotting lots of points on a map, I want to limit the number of transformations I need to do for each point, so a Lambert or Albers projection isn't practical; moreover, some users may wish to turn the Alaska/Hawaii feature off, and I'm not able to support two different projection options right now
Inset maps cause a huge performance hit, are more difficult to program for, and since I'm charged per map viewed, would triple my mapping bill (I'd say 97% of the points I'm plotting are outside Alaska and Hawaii, so it's not worth running IMO)


texts: After start editing, the editing toolbar remains inactive in QGIS

texts:
With respect to my previous question Disconnect editingStarted in PyQGIS , While doing some research for question, I found some details to stop editingStarted signal with following code.
layer=iface.activeLayer()
if layer.name()=="Fiber":
    layer.editingStarted.connect(lambda:first_method())
    layer.editingStopped.connect(lambda:first_method())
def first_method():
    if layer.isEditable():
        print("In first method")
   else:
       try:
           layer.editingStarted.disconnect()
       except:
           print("editingStarted signal is not disconnected")
       try:
           layer.editingStopped.disconnect()
       except:
           print("editingStopped signal is not disconnected")

Things are working fine for single layer, but if I have multiple layers in project and I start and stop editing for other layer and again start editing for my required layer then Qgis is not starting editing session for my required layer. Means even after start editing, the editing toolbar remains inactive. I am not able to click on Add feature button or even other editing buttons. Please suggest the workaround for this.


texts: Compare two rasters in R with the cell value from one replacing the cell value from another

texts:
I am trying to create a single raster from two rasters. The first raster is made up of all 0 values and the second is made up of the current date value (formatted in days from 001 to 365). The problem is using raster overlay I am struggling to get the result I am after. I can combine the to using the following without any issue:

zeroRaster <- overlay(changeDate, zeroRaster, fun=function(x,y){return(x+y)})

however when a specific cell changes multiple times the two dates are added together which is obviously incorrect (with the x+y function being to blame).

As I am struggling to explain I will try and visually represent what I am trying to achieve below:

Essentially I just want to replace any cell value in raster y with the new date value from raster x without performing any mathematical functions.


texts: Geospatial way to optimise cluster entropy calculation per LSOA (Polygon)

texts:
I've been trying to create the entropy data below after doing a spatial join of the LSOA codes to the pandas dataframe (starting with GeoPandas). My silly "for loop" way is super slow for 30000 LSOAs in England+Wales.
Maybe a geospatial (python or QGIS based etc) operation would be more appropriate rather than trying to find a groupby solution?
My dataset looks like this and Im trying to find the entropy per 'lsoa11cd' area (UK specific geospatial value representing an area/polygon).
The k_means_5 data indicate k = 5.
    test01[['k_means_5','lsoa11cd']].head(10)
    k_means_5   lsoa11cd
0   1   E01019240
1   1   E01019240
2   1   E01019238
3   1   E01019240
4   1   E01019240
5   1   E01019240
6   1   E01019316
7   1   E01019316
8   1   E01019316
9   1   E01019316

I can get the entropy with this super silly/lame (incorrect?) line but I would like to do it more efficiently as it will take 10 days to iterate with a for loop over the 'lsoa11cd' values.
len(test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5'])
51
test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5'].value_counts()
1    40
2     6
0     5
Name: k_means_5, dtype: int64
test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5'].value_counts()/len(test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5'])
1    0.784314
2    0.117647
0    0.098039
Name: k_means_5, dtype: float64

from scipy.stats import entropy
    test01.loc[test01['lsoa11cd'] == 'E01019238', 'entropy_k_means_5'] = entropy(test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5'].value_counts()/len(test01.loc[test01['lsoa11cd'] == 'E01019238']['k_means_5']), base=5)

I have tried a bit but of course the last step cant work with the shape of the objects I'm sending. Any expert advice?
g1 = test01.groupby('lsoa11cd')['k_means_5'].transform('count')
0          172
1          172
2           51
3          172
4          172
          ...
1758295     70
1758296     59
1758297     87
1758298     87
1758299    122
Name: k_means_5, Length: 1758300, dtype: int64

g2 = test01.groupby('lsoa11cd')['k_means_5'].value_counts()
lsoa11cd   k_means_5
E01000001  4                             17
           3                              9
E01000002  3                             24
           4                             22
E01000003  4                             13
                                         ..
W01001956  0                             42
           4                              3
W01001957  3                             23
           4                              9
W01001958  4                              9
Name: k_means_5, Length: 64908, dtype: int64

entropy( g2/g1, base=5) # NOP!


texts:
I have added to my OpenLayers-based app two layers. A google maps layer and another WMS layer.

physical = new OpenLayers.Layer.Google(
        "Physical View",
            {type: google.maps.MapTypeId.PHYSICAL,
                numZoomLevels: 21,
                MAX_ZOOM_LEVEL: 21,
                MIN_ZOOM_LEVEL: 6}
    );

ktl = new OpenLayers.Layer.WMS( "Ktl","http://gis.ktimanet.gr/wms/wmsopen/wmsserver.aspx",
        {
            layers: 'KTBASEMAP',
        },
        {
            //format: "image/png",
            //displayOutsideMaxExtent: false,
            projection: new OpenLayers.Projection("EPSG:900913"),
        }
    );

Both layers are displayed in my app but I face the following zoom-related problem.
When I see the google maps layer the zoom level is different than when I see the WMS layer. I have added two screenshots which illustrate what I describe above.

This is quite unexpected as I set the center and zoom of my map as:

map.setCenter (lonLat, 1);

Is it possible to change the default zoom of a layer?


texts: Drawing perpendicular lines at start and end of lines using ArcGIS Desktop?

texts:
I have some lines. I want to draw perpendicular lines at the start and end of the lines, on both sides of the lines.

Can somebody help me in Python?

I am using ArcGIS.


texts: How can I convert an excel file with x, y columns to a shapefile?

texts:
How can I convert an excel file with x, y columns to a point shapefile?

There are some somewhat optional requirements in addition to the correct creation of a shapefile:

Column types (as per Excel's format specifiers) should be retained (especially date types)
Column names should be taken from the header
I would like to do this from the command-line
If I can include heterogeneous spatial references for the points in a third column I would be very happy :)


texts: Vector tile formats -- vector MBTiles and MVF

texts: I'm trying to find out about vector tile formats.  There doesn't seem to be any documentation on vector MBTiles. ( https://github.com/mapbox/mbtiles-spec/issues/43 ).  Can I regard vector MBTiles as a competitor to Mapbox Vector Tiles ?  Or are they doing something different?


texts:
I want to start working on a web map at work to map some of our statistics by city.

I have an idea, but I'm not exactly sure where to start.

Are there any definitive resources that provide step by step guidance on how to do this?


texts: Display the data layer to info windows taken from GeoJSON

texts:
I have a problem for displaying data to info windows on the Google Maps Data layer. Here I use GeoJSON to load data. can anyone help me?

var map;
function initMap() {
  map = new google.maps.Map(document.getElementById('map'), {
    zoom: 4,
    center: {lat: -2.9365327, lng: 104.4950964}
  });

  map.data.loadGeoJson(
    'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_rivers_lake_centerlines.geojson');
  console.log( map.data);

 var ced = google.maps.event.addListener(map.data,'click',function(event) {
    console.log(event.feature.f)
    alert("Koordinat:lat: "+event.latLng.lat()+", lng: "+event.latLng.lng());
    alert(JSON.stringify(event.feature.f));
  });
}

At this moment I'm just can make data appear on alert method.

And I want to make the data show from info windows when that street was clicked.


texts: The project does not build. The command “esriRegasm.exe …” exited with code -1

texts:
I want to build the project to create a tool with ArcObjects in Visual Studio. I get this error:
The command "esriRegasm.exe "...Project1.dll" /p:Desktop /s" exited with code -1.

I use C#, Visual Studio 2015, ArcObjects 10.5, ArcMap 10.5.
To resolve this problem have been made:

tried to open the solution as an "Adminimtrator" not just a user;
run the esriRegAsm.exe command from the command line. I tried in two ways. The first, as in the error in Visual Studio. Nothing changes.

Аnd the second, as per the instructions on the help.arcgis website. I get such a fail:
Registration failed. The type initializer for 'Project1.Tool1' threw an exception.

tried to open the .csproj file, go to the end of the file, find the line esriRegAsm.exe, delete it and rebuild the project.

How to build a project? These steps do not help me. I still can't build the project.


texts: assign and move centroids to their polygons

texts: I m using QGIS 1.8 Lisboa. After calculating the centroids from a polygon shapefile, if some of them lie outside the polygon outlines, I'd like to move them on the polygon they came from. The criterion should be univocal as I must use them to extract coordinates to be used as the identification code of the polygon itself. Therefore, the procedure should output the same point location each time it runs for the same polygon (not a random position like the one given by "random points" function, that gives a new result each times it's ran).


texts: Ways of expressing geographic questions in machine readable form

texts: A core concept of GIS is answering questions about datasets.  From the point of view of a database; SQL with spatial extensions is a way of asking such questions.  What other ways can questions be expressed in a machine readable text based form?  What are the benefits of different approaches?


texts: Error using ST_Geometry Aggregate Function for Hive

texts:
I am using the ESRI framework that extends the Hive syntax to support spatial types and operations.

In particular, I am trying to use an aggregated geometry function, announced in this blog post in 2013.

What I would like to do, is to generate a bunch of buffers around some points, and then dissolve them using ST_Aggr_Union.

create table buffers as select ST_Aggr_Union(ST_Buffer(tweets.geom,0.5)) as geom from tweets join grid_cnt where ST_Contains(grid_cnt.geom,tweets.geom)=true and ptcnt>6;

The query fails with a Map Reduce error:

Hadoop job information for Stage-2: number of mappers: 0; number of reducers: 0
2015-01-21 12:55:21,758 Stage-2 map = 0%,  reduce = 0%
Ended Job = job_local1494455277_0007 with errors
Error during job, obtaining debugging information...
Job Tracking URL: http://localhost:8080/
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Stage-Stage-2:  HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

If I do the query without the ST_Aggr_Union function, it runs without problems.

Just to be sure, I also tried to reproduce the example in the blog post:

SELECT ST_AsText(ST_Aggr_Union(ST_Point(earthquakes.longitude, earthquakes.latitude)))
FROM earthquakes
JOIN counties_json counties
WHERE counties.name = ‘San Bernardino’
AND earthquakes.magnitude > 6
AND ST_Contains(counties.shape, ST_Point(earthquakes.longitude, earthquakes.latitude));

It fails, with the exact same error. Could it be a bug?


texts: Multiprocessing error in QGIS with Python on Windows?

texts:
I have this error when I try to use Manager() from python multiprocessing library.
(Just start QGIS open Python console and execute the two following lines)

>>> import multiprocessing
>>> mgr = multiprocessing.Manager()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\DEV\osgeo4w_dev\apps\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
    m.start()
  File "C:\DEV\osgeo4w_dev\apps\Python27\lib\multiprocessing\managers.py", line 524, in start
    self._process.start()
  File "C:\DEV\osgeo4w_dev\apps\Python27\lib\multiprocessing\process.py", line 130, in start
    self._popen = Popen(self)
  File "C:\DEV\osgeo4w_dev\apps\Python27\lib\multiprocessing\forking.py", line 252, in __init__
    cmd = get_command_line() + [rhandle]
  File "C:\DEV\osgeo4w_dev\apps\Python27\lib\multiprocessing\forking.py", line 339, in get_command_line
    if process.current_process()._identity==() and is_forking(sys.argv):
AttributeError: 'module' object has no attribute 'argv'
>>>

It happens in both 1.8 and 1.9 dev version on Windows. Of course everything is ok using QGIS on Linux!... :P

It seems something related to the main Python/QGis process startup and the way the library tries to start a new process.... but I can't figure out any workaround.

Any idea? (already posted this on qgis dev list but had no response...)


texts:
I used this code to read grib data
import os
import numpy as np
import pandas as pd
import xarray as xr

path = "gfsanl_4_2019101000.g2"
os.chdir(path)
ds = xr.open_dataset('gfs_4_20191010_0000_006.grb2', engine='cfgrib')

And the output as is follows,
DatasetBuildError: multiple values for unique key, try re-open the file with one of:
    filter_by_keys={'typeOfLevel': 'hybrid'}
    filter_by_keys={'typeOfLevel': 'atmosphere'}
    filter_by_keys={'typeOfLevel': 'surface'}
    filter_by_keys={'typeOfLevel': 'unknown'}
    filter_by_keys={'typeOfLevel': 'isobaricInPa'}
    filter_by_keys={'typeOfLevel': 'isobaricInhPa'}
    filter_by_keys={'typeOfLevel': 'meanSea'}
    filter_by_keys={'typeOfLevel': 'depthBelowLandLayer'}
    filter_by_keys={'typeOfLevel': 'heightAboveGround'}
    filter_by_keys={'typeOfLevel': 'nominalTop'}
    filter_by_keys={'typeOfLevel': 'heightAboveGroundLayer'}
    filter_by_keys={'typeOfLevel': 'tropopause'}
    filter_by_keys={'typeOfLevel': 'maxWind'}
    filter_by_keys={'typeOfLevel': 'heightAboveSea'}
    filter_by_keys={'typeOfLevel': 'isothermZero'}
    filter_by_keys={'typeOfLevel': 'pressureFromGroundLayer'}
    filter_by_keys={'typeOfLevel': 'sigmaLayer'}
    filter_by_keys={'typeOfLevel': 'sigma'}
    filter_by_keys={'typeOfLevel': 'potentialVorticity'}

I tried to use filter_by_keys and backend_kwargs arguments to define the keys but I failed. Can you advice any solution for this?


texts: Buffer miles in decimal degrees with fiona and shapely

texts:
I have a script where I parse geojson earthquake data from around the world and create the point locations of the earthquake incidents. The script works fine. The CRS is 4326 or wgs84/lat long. I am planning on creating certain distances in miles around the points based on their magnitudes. For testing and learning purposes I want to create a 50 mile buffer around each point. I am using fiona and shapely. I can post all my code if somebody asks, although it does not seem necessary

import fiona
import shapely
python code.....
crs = from_epsg(4326)
point = Point(float(i["geometry"]["coordinates"][0]),float(i["geometry"]["coordinates"][1]))
output.write({'properties':{'Place': place, 'Magnitude': mag, 'KM': km, 'Bearing': bear},'geometry': mapping(shape(point.buffer(5)))})

I have seen this post
Create a buffer in decimal degrees

but I do not want to call in arcpy for this analysis.

I am open to a custom Python conversion from miles to decimal degrees or even feet to decimal degrees.


texts: How to add features (attributes) from a CSV file without geometry to a polygon shapefile?

texts:
I would like to add attributes from a CSV file (that's one below )

to a polygon shapefile layer  (that's one)

in QGIS 2.10.

The problem is they have no corresponding fields which I could use for join.


texts: Is it possible to cancel a request for a KmlLayer, and load a different layer, before it is actually visible

texts:
Having asked for a google.maps.KmlLayer, and whilst waiting for it to load, is it possible to cancel the request?

Calling layer.setMap(null); seems to causes an error if the layer is not yet visible.

I would like to be able to cancel the request for the layer, then ask for a different layer.

Thanks,

I am using version 3 of the google maps api.


texts: Delete middle vertex of multiple 3-vertex polylines

texts: I have multiple polylines that have three vertices. I need to delete the middle vertices on all of them. Besides doing this one at a time, is there a way to do this with either a tool or python? I tried the Edit Vertices editing tools by dragging a box over vertices but you can only do that for multiple vertices of the same feature, not multiple features at a time.


texts: Open block option with buffer in terrascan

texts:
While opening .las/laz files using "Open block" option in Terrascan there is an option to enter buffer value but I need to save the buffer value as default setting.

Can anyone help me?


texts: Merging feature classes coming from submodel as fc_%n% into one table using ModelBuilder?

texts:
I'm trying to merge feature classes, that come from a submodel ("PFA_findBiggest") via inline variable substitution. They are saved in a GDB.

They all have different fields. I want to merge them into one big table according to a fishnet_FID, that they all carry.

Here you can see, I tried the merge function in order to merge them into a feature class, but this didn't work. It only ever 'merged' the first %n%, which of course is 0, and nothing else. So the output of Merge is identical to the first layer processed.

I guess it's because Merge doesn't know that more is coming. That's why I have put the "Collect Values"-Tool in between. It is set to the the output of the submodel, including the %n%.

Why is this not working?

I got it to work by placing the "Collect Values" Tool inside the submodel, as described. But it seems merge is not the right tool yet. It only adds the rows of each feature class together.

How do I use the FID that all feature classes have, to connect the data?

I tried Join Field instead of Merge, but ModelBuilder only lets me connect the output of Collect Values to Join Field as Precondition.

Or maybe there is a tool, that I can use after merge, to shrink the table according to the FID?


texts: Error while exporting plots results from cor function in a for loop over subfolders

texts:
I'm trying to plot the results from cor function that is running over multiple subfolders that contain TIF files. The process I have followed so far didn't work. It seems there is a problem while running the sampleRandom function but I cannot figure out what is the problem. Below is the code and then the error message
# define root folder
setwd("./Bajio")
# list of sulfoders
subf<-list.dirs(full.names=FALSE, recursive=FALSE)
# define outpath
outpath <- "./Bajio_mes"
#create output directory
dir.create(outpath)
# define the output names
outfiles <- paste0(outpath, subf)
# define the output format
extension(outfiles) <- 'jpeg'
#running the for loop
for(j in 1:length(subf)){
    print(subf[j])
    h <- list.files(path=subf[j], recursive=TRUE, full.names=TRUE,pattern='.tif')
    print(h)
    d <- brick(h)
    e <- cor(sampleRandom(d[],size= ncell(d) * 0.5 ), method = "pearson")
    f <- corrplot(e, method = "number",col= colorRampPalette(c("black","pink", "red"))(10))
    f<-jpeg(f,outfiles[j]
    }

After running the code I obtain the following:
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘sampleRandom’ for signature ‘"matrix"’

How can I solve this problem?


texts: Categorized Style : showing all possible values, not just the ones in use

texts:
I am new to QGIS and experimenting before rolling this out to my colleagues.
I have a shapefile with some codes, and i have a csv with those codes and other information that i need.
I have joined them, and that works fine - BUT is there a way to stylize the shapefile so that only records present in the shapefile show up in the layer manager and legend?

At present, my shapefile is nicely coloured by "description" but the layer props shows every single code/description in the CSV, not just the ones in use in the shapefile. In ESRI (for example) it would only show records with non-null values - I only have 4 or 5 codes in the shapefile, and, i mean, some of the values listed i know are not even polygons! But they are displayed, because the csv file has them.


texts: GeoServer (New Vector Data Source from PostGIS)

texts:
I have this error on GeoServer:

Error creating data store, check the parameters. Error message: Unable
to obtain connection: Cannot create PoolableConnectionFactory (The
authentication type 10 is not supported. Check that you have
configured the pg_hba.conf file to include the client's IP address or
subnet, and that it is using an authentication scheme supported by the
driver.)

How do I solve this error?


texts: Having problems creating VRT in QGIS from png files

texts:
This is similar to a question asked by someone else, re OS tiles, however, there is a difference! I am a bit of a amateur in GIS and python, but if I take it slow I can usually just about work it out!

This one though: I have a large amount(over 10k) of geo-refd png files which I have mosaicked in Arc, but also want to be able to access them in other programs such as QGIS over the web and within a private network using Geoserver - so I have tried creating VRT's with them, and sometimes it works, but sometimes it doesn't: it seems that on selecting over 200-odd png's, the vrt stops being created: is there a limit on the amount of rasters for a VRT, or can some-one give me some help please!! This is so frustrating ;o) The error message is:
"The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program."

and the code is:

    gdalbuildvrt -allow_projection_difference
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/SX.vrt"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/1.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/2.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/3.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/4.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/5.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/6.png"
    "F:/Historic Buildings/GIS/Data/Mapping/Landranger/Raster/15k/Data/SX/7.png"

with an additional +200 similarly addressed png's

I am using QGIS 1.8.0 Lisboa, on W7 64bit

Any help would be gratefully received


texts: Strange `path` data in ArcGIS JSON response

texts:
Our local government runs a MapServer with geo data about the county land, property parcels and such. They provide this data as a bulk download, but some layers are missing. I decided to extract a small piece from around my house to model the relief for home improvement purposes. Grabbed the JSON response from the MapServer and was surprised to see the following:
"geometry":
  {
    "paths":
      [
        [
          [-32788557.0,-4020983.0],[18.0,-18.0],[16.0,-20.0],[14.0,-29.0],[10.0,-5.0][1.0,-2.0],
           3.0,1.0],[2.0,-1.0],[10.0,5.0],[4.0,8.0],[-6.0,9.0],[0.0,4.0]
        ]
      ]
   }

This is obviously a small excerpt, but all the paths look the same: a coordinate pair with giant values as the first point and then a long series of pairs in low single/double digits. All integer (fraction is always 0).
Any idea what it is and how to convert it to something more understandable? I tried to load it into QGIS and despite that it automatically recognized the format the result is completely messed up. Some giant triangle covering the whole planet :-)
This data is elevation contours if that helps.
GeoJSON is not available there, they don't run servers to support it.
The header:
{
  "displayFieldName": "Type",
  "transform": {
    "originPosition": "upperLeft",
    "scale": [
      0.5971642835591084,
      0.5971642835591084
    ],
    "translate": [
      5975825.080599502,
      2086803.942522511
    ]
  },
  "fieldAliases": {
    "OBJECTID": "OBJECTID",
    "Elevation": "Elevation",
    "Type": "Type",
    "Shape_Length": "Shape_Length"
  },
  "geometryType": "esriGeometryPolyline",
  "spatialReference": {
    "wkid": 102100,
    "latestWkid": 3857
  },
  "fields": [
    {
      "name": "OBJECTID",
      "type": "esriFieldTypeOID",
      "alias": "OBJECTID"
    },
    {
      "name": "Elevation",
      "type": "esriFieldTypeDouble",
      "alias": "Elevation"
    },
    {
      "name": "Type",
      "type": "esriFieldTypeString",
      "alias": "Type",
      "length": 50
    },
    {
      "name": "Shape_Length",
      "type": "esriFieldTypeDouble",
      "alias": "Shape_Length"
    }
  ],
  "features": [
    {
      "attributes": {
        "OBJECTID": 352679,
        "Elevation": 917,
        "Type": "Basic",
        "Shape_Length": 8398.660869832049
      },
      "geometry": ...


texts: Writing Validation Scripts for Tools built with ModelBuilder?

texts:
I'm working within ArcToolbox. I understand how to create toolboxes and the scripts that accompany them. Most toolbox scripts have a validation script. (Right click tool -> Properties -> Validation tab).

I have created a tool using ModelBuilder that runs very similar to the Strip Map Index Features tool(Cartography Tools -> Data Driven Pages - > Strip Map Index Features). I have just added a few more fields to the attribute table.

Is it possible to include / create a validation script for tools built using ModelBuilder?


texts: Select one feature of multiple overlapping features (here polygons) on a Leaflet map

texts:
I have a map with multiple polygons rendered on it which can overlap eachother. I use leafletPip.pointInLayer(point, layer) from https://github.com/mapbox/leaflet-pip for determining which polygons do overlap. This happens in the processClick function. In the Vue object I create the map and my GeoJSON layer with the polygons. What I now want is following feature: if you click on a point on the map and this point is contained in multiple polygons, you have something like a selection tool, e.g. in a pop-up, to click on one of these polygons and trigger the .on('click') function only for this specific polygon. I searched all the Leaflet features but I could not find anything really useful. Right now, if you click on a point contained in multiple polygons, you only trigger the .on('click') for the polygon which spatially contains the others.

var mapVue = new Vue({
  parent: vue_broadcaster,
  el: '#map',
  data: {
    map: null,
    layer: null
  },
  created: function () {
   // Adding Leaflet map here
    var map = L.map('map').setView([51.959, 7.623], 14);
    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
      attribution: '&copy; OpenStreetMap contributors'
    }).addTo(map);
    this.$set('map', map);
    this.get_zones();
  },
  methods: {
    switch_zone: function (zoneid) {
      this.$dispatch('zoneSelected', zoneid)
    },
    get_zones: function () {
      this.$http.get('/api/zones/', function (data) {
      // Creation of the GeoJSON layer
        var geoZone = {
          "type": "FeatureCollection",
          "features": []
        };
        for (var i = 0; i < data['Zones'].length; i++) {
          geoZone.features.push({
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [[]]
            },
            "properties": {
              "name": ""
            }
          })
          geoZone.features[i].properties.name = data['Zones'][i]['Name'];
          for (var j = 0; j < data['Zones'][i]['Geometry']['Coordinates'].length; j++) {
            geoZone.features[i].geometry.coordinates[0].push([data['Zones'][i]['Geometry']['Coordinates'][j][1], data['Zones'][i]['Geometry']['Coordinates'][j][0]])
          }
          this.layer = new L.geoJson(geoZone)
            .bindPopup(data['Zones'][i]['Name'])
            .on('click', dispatchZoneID(data['Zones'][i]['Zone-id'], this))
            .on('click', function (e) {
              processClick(e.latlng.lat, e.latlng.lng)
            })
            .addTo(this.map)
        };
      })
    }
  }
});
// function for processing the clicks on the map
function processClick(lat, lng) {
  var info = '';
  var point = [lng, lat];
  var match = leafletPip.pointInLayer(point, mapVue.layer, false);
  if (match.length) {
    for (var i = 0; i < match.length; i++) {
      info +=
      "" + match[i].feature.properties.name + "
"
    }
  }
  if (info) {
    mapVue.map.openPopup(info, [lat, lng]);
  }
};
// not important for this one
function dispatchZoneID(id, vue) {
  return function () {
    vue.$dispatch('zoneSelected', id)
  }
};


texts: Clustering based on max distance between ALL points in QGIS

texts:
I'm working on a layer of thousands of points, some of points are very close together.

I want to group them into clusters according to the following rule:
"The distance between all points within each cluster must not exceed 500m".

I can do it  with symbology (distance : map units (500m)).

But how to assign a cluster to each point within the attribute table?


texts: Creating local coordinate system from orthorectified image from drone

texts:
My plan is to use a drone and pix4d to map an area and produce a top down image. I have some position data that is in its own reference frame / Coordinate system.

My question is what suggestions or tools are out there where I can take the image I created and map it to mimic my coordinate system to my position data.

Id like to have the map of my area, and a plot of the position data super imposed on top of it.


texts: Is it possible in QGIS to simplify a vector layer forcing orthogonality (only 90º angles)?

texts:
I have tried different simplyfying algorithms and options within them (QGIS native, SAGA, GRASS) but nothing has worked. I saw there is an "Orthogonalize" tool in 3.x versions, but from what I saw in the documentation (still working with 2.18), it doesn't really do the trick either. No coding experience here, but I'm willing to give it a try.
For now I want it just for visualization purposes (something like a pixelated effect), but I guess it could be useful to further customize these algorithms. The image below is an example of what I'd like to get at the end of the process. (By the way, I'm  aware that in some cases there won't be an actual simplification since the number of segments could be higher if a low threshold is set in "traditional" simplifying algorithms).


texts: Select only lines that touch both sides of polygon - PostGIS

texts: I want to select lines that only touch both sides of a polygon. Is there a function in postgis that can do this? See image below. I only want to select lines from the circle on the left where the line touches both sides of the polygon.


texts: gdal_translate GeoTIFF to KMZ results in transparent image

texts:
I know this has been asked before but I have tried just about every post I've found and nothing seems to work.
I have a GeoTIFF where areas outside the dataset have been set to nodata

When I open the GeoTIFF in QGIS the nodata areas are transparent

I tried:

gdal_translate -of KMLSUPEROVERLAY LVIS2_ABoVE2017_0706_R1803_075811.tif  alpha.kml

But that resulted in all my NoData areas showing up black

Then I tried:

gdal_translate -of KMLSUPEROVERLAY -a_nodata 0 alpha.tif alpha.kml -co format=png

As I understand JPEG does not support transparent background so I should use PNG.
But that resulted in no image at all (still zooms to the correct location)

The closest I could get was:

gdalwarp -srcnodata 0 -dstalpha LVIS2_ABoVE2017_0706_R1803_075811.tif LVIS_alpha.tif

Which did eliminate the black background in when I opened in ArcMap but resulted in a blank KMZ again when I tried gdal_translate

I also tried the -ot Byte thinking maybe its due to being Float32 but that didn't seem to work either

gdalinfo output:

Size is 2488, 2488
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (211.588427999999965,64.714126000000007)
Pixel Size = (0.000100000000000,-0.000100000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (     211.588,      64.714) (211d35'18.34"E, 64d42'50.85"N)
Lower Left  (     211.588,      64.465) (211d35'18.34"E, 64d27'55.17"N)
Upper Right (     211.837,      64.714) (211d50'14.02"E, 64d42'50.85"N)
Lower Right (     211.837,      64.465) (211d50'14.02"E, 64d27'55.17"N)
Center      (     211.713,      64.590) (211d42'46.18"E, 64d35'23.01"N)
Band 1 Block=2488x1 Type=Float32, ColorInterp=Gray
  Min=130.450 Max=313.650
  Minimum=130.450, Maximum=313.650, Mean=162.552, StdDev=50.426
  Overviews: 1244x1244, 622x622, 311x311, 156x156
  Metadata:
    STATISTICS_MAXIMUM=313.64999389648
    STATISTICS_MEAN=162.55166902341
    STATISTICS_MINIMUM=130.44999694824
    STATISTICS_STDDEV=50.425973702069

What could the problem be?

UPDATE: I tried setting the NoData value as I read on some posts:

  Min=130.450 Max=313.650
  Minimum=130.450, Maximum=313.650, Mean=162.552, StdDev=50.426
  NoData Value=0
  Metadata:
    STATISTICS_MAXIMUM=313.64999389648
    STATISTICS_MEAN=162.55166902341
    STATISTICS_MINIMUM=130.44999694824
    STATISTICS_STDDEV=50.425973702069

Also tried:

gdalbuildvrt $VRT $inFile -addalpha
gdal_translate -scale -ot Byte -mask 2 $VRT $outTIFF

and I found that when I opened the bands individually in ArcMap, -addalpha is masking the entire image. If I just open band 1 then everything views fine and it scaled properly to 0-255.

EDIT2:

I tried:

gdal_translate $inFile $out -a_nodata 0
gdalbuildvrt $VRT $inFile -srcnodata 0
gdal_translate -scale -ot Byte $VRT $TIFF

and this appears to work. I opened the resulting tiff in ArcMap and it looked like this.

However when I do:

gdal_translate -of KMLSUPEROVERLAY $TIFF $KML

the resulting KML is blank. It has an extent but nothing else and the file size is only 1KB.

What could be causing this?


texts: How can I export a List as a featureCollection in GEE?

texts:
I'd like to know how can I export as a featureCollection the List (line 31) of the following script:
https://code.earthengine.google.com/5f453a2f3cf39c4be49ac4f4df47ac08


texts: Refreshing QGIS project after updating MS Access Database?

texts:
I already connected the MS Access DB to QGIS via ODBC. Moreover, I applied the tool "create point layer from table" and I got all points from the DB (longitude/latitude coordinates) on my map. And after updating the DB I clicked the Refresh  Button in QGIS, but nothing happened.

Only after I break the odbc connection and create a new one, I see the results in QGIS.

Can I change this?Is it not working automated?


texts: Adding latitude and longitude to QGIS file without losing the current xy coordinates

texts:
I plan to convert a .dwg-file to QGIS. The coordinate system of the .dwg-file is set up in feet in the x and y directions from a point near the bottom center of the drawing. This coordinate system makes it easy to measure the size and distances between the various features in the drawing.
But after converting to QGIS, I would like to add latitude and longitude coordinates to the QGIS file so that the various features in the drawing can be located on the ground using a GPS app on a cell phone.
How can I add GPS coordinates to the QGIS file without having to give up the existing coordinate system in feet?


texts:
Why red outline is slurred ? I changed "outline widght" from 0,25 mm to 1,5 cm and problem is the same.
Black outline got same settings like red, only size is different.


texts: Geopackage: Table created with python doesn't show up in QGIS's DB manager

texts:
In my python script I want to create a table in a Geopackage that will hold new values to be joined on existing data later. Anyway for table creation I use this:

def creaTable(name,sqlcon):
    c = sqlcon.cursor()
    c.execute('''CREATE TABLE "{}"
             ("fid" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                "kgez" TEXT NOT NULL,
            "anz" INTEGER NOT NULL,
            "distEig" INTEGER NOT NULL)'''.format(name))
    c.execute('''CREATE TRIGGER "trigger_insert_feature_count_{0}"
        AFTER INSERT ON "{0}" BEGIN UPDATE gpkg_ogr_contents
        SET feature_count = feature_count + 1
        WHERE lower(table_name) = lower('{0}'); END '''.format(name))
    c.execute('''CREATE TRIGGER "trigger_delete_feature_count_{0}"
        AFTER DELETE ON "{0}" BEGIN UPDATE gpkg_ogr_contents
        SET feature_count = feature_count - 1
        WHERE lower(table_name) = lower('{0}'); END '''.format(name))
    sqlcon.commit()

The table and triggers are there when opened with some DB-browser however it wont show up in QGIS DB manager.

What am I missing out on? Or is there a simpler way to create a non spatial table for QGIS from scratch?


texts: OpenLayers refresh WMTS tiles when underlying data changes

texts:
I am visualizing features from geoserver with OpenLayers using WMTS; I allow users to delete features using WFS-T; after a feature is deleted I would like for it to be removed from the map; however, the feature remains, unless, I zoom into a level at which the feature had not previously been displayed.

I  have found a question about a similar issue here; however, that question is about OpenLayers 3; and did not have any solutions that worked for me. I have tried the following methods of refreshing the layer (and none of them worked):

wmtsLayer.dispatchChangeEvent();  // Method 1

wmtsLayer.getSource().dispatchChangeEvent();  // 2

wmtsLayer.getSource().updateParams({"time": Date.now()});  // 3

wmtsLayer.getSource().changed();  // 4

map.updateSize();  // 5

wmtsLayer.getSource().refresh();  // 6

// 7:
var source = wmtsLayer.getSource();
source.tileCache.expireCache({});
source.tileCache.clear();
source.refresh();

// 8 (deleting the layer and making a new one):
map.removeLayer(wmtsLayer);
fetch(WMTS_URL + "&time="+ new Date().getTime()).then(function(response) {
    return response.text();
}).then(function(text) {
    var result = parser.read(text);
    var options = optionsFromCapabilities(result, {
        layer: FULL_LAYER_NAME,
        matrixSet: SRS_NAME
    });

    wmtsLayer = new TileLayer({
        opacity: 1,
        source: new WMTS((options))
    });
    map.addLayer(wmtsLayer);
});

How do I get a WMTS tile to update when a change is made to the data (in my case, a feature is removed)?


texts: Why is "arcpy.GetParameterAsText" deleting Target Feature Class?

texts:
Originally I asked Why is this Python Script (using XYTabletoPoint) Deleting the target Feature Class?, but have since narrowed down the line that is deleting my target Feature Class.

Surprisingly, it turned out to be "arcpy.GetParameterAsText()".

To prove it to myself I changed the script file in the Source tab of the Tool Parameters Window to the following simplified script:

import arcpy

Target_FC = arcpy.GetParameterAsText(1)

Yes really, that's my entire script (for demonstration purposes of course).

After it runs I check the location of the Target Feature Class and sure enough it is gone.

Any ideas?


texts: Snapping points to line and calculating chainage using Open Source GIS

texts:
I have a line layer (representing a pipeline) and a points layer (representing valves) and I would like to calculate the chainage of the valves along the pipeline.

I assume that I would first need to 'snap' the points to the line in order to calculate chainage as they do not currently lie directly above the line. However I would need to use a bulk tool if possible as there are several hundred points and would take too long to do manually.

I wondered whether the LRS tool in QGIS could be used to derive chainage?

I am using QGIS 2.2, GRASS & Postgis.


texts: Extract value from shapefile in Google Earth Engine

texts:
I'm new in Google Earth Engine. I want to extract the value of NDVI for a series of MODIS images using a shapefile and after export the database.
This is my script:

var vect = ee.FeatureCollection("route of shapefile");
Map.addLayer(vect);
Map.centerObject(vect,4);

//Modis collection
var poly = ee.Geometry.Polygon([
      [[15.71 , 51.403], [20.687, 51.259], [19.918, 54.614],
      [16.007, 54.595]]]); //Interest area

var start = ee.Date('2015-03-01');
var finish = ee.Date('2018-06-01');

var modis_collection = ee.ImageCollection('MODIS/006/MOD13A1')
     .filterBounds(poly_vect)
     .filterDate(start,finish)
     .select ('NDVI');// select NDVI image

And now? I suppose I should use ee.reduce to extract the values?


texts: Projection conversion issues; Philippines to OSM

texts:
I am working with some roads and bus routes data in Philippines. The bus routes data is in Philippines Zone 4: ESPG 3124 projection. I am trying to match it to roads data to generate stops at intersections. For that I got a roads shapefile from Open Street Maps which was in EPSG 3857 projection.

The two files (roads and routes) don't align and I am guessing this is because of the difference in projection as shown below. Roads are in black and routes in colors with OSM as the basemap.

I have tried converting the Philippines projection to OSM (right click on the shapefile and "save as" the new projection) and converting  both to WSG84, but without success. Either one of the shapefiles disappear or the new projected seems to have no change.

What am I getting wrong here?


texts: Google Earth Engine map of GHSL filter year

texts:
I would like to know how could be possible to filer only one year of the dataset of GHSL?
var dataset = ee.Image('JRC/GHSL/P2016/BUILT_LDSMT_GLOBE_V1');
var builtUpMultitemporal = dataset.select('built');
var visParams = {
  min: 1.0,
  max: 6.0,
  palette: ['0c1d60', '000000', '448564', '70daa4', '83ffbf', 'ffffff'],
};
Map.setCenter(35.9498, 32.6164, 12);
Map.addLayer(builtUpMultitemporal, visParams, 'Built-Up Multitemporal');


texts:
My level is very basic in Python.

This is the python codeblock I have in ArcGIS Field Calculator:

def Reclass(THLB):
  if THLB == 0:
    return 0
  elif THLB == 1:
    return !Shape_Area!

This works fine if I have another value for elif..say 1. The field populates great. But I can't get the elif to return another field (area in this case).

What am I overlooking?

Both the shape area and field I'm populating are floats.


texts: Assigning score to raster based on cell overlap with other raster and field value

texts:
I have a set of rasters that I've assigned scores to individually (scored based predominantly on values of other fields). The scoring scale is the same for all rasters, but the factors that determine score value differ for each raster.

I'm trying to figure out the best method for assigning a score to one of the rasters, call it raster1.

If field1 (an attribute of raster 1) is < 70 and raster1 overlaps with raster2, then assign value x to raster1.

I'm not trying to make a new raster, I just want to identify cells of raster1 that overlap with raster2 and assign those cells a value, assuming they also meet the other parameter (above). Doing a raster overlay addition would identify overlapping cells, but I'm not sure how I would use that as an identifier effectively.


texts: QGIS Output Command Line Results on the Terminal

texts:
QGIS as a command line mode with limited fonctionnality.
The following code examples use QGIS 3.14 on Windows 10
For example to access QGIS version number, you can type:
C:\OSGeo4W64\bin\qgis-bin --version

It's working... But it displays nothing on the terminal...
To display something once can use
C:\OSGeo4W64\bin\qgis --version | more

With the answer on the terminal:
QGIS 3.14.0-Pi 'Pi' (9f7028fd23)

Or redirect the StdOut and StrErr to a file
C:\OSGeo4W64\bin\qgis --version > stdout.txt 2>stderr.txt

which is working but annoying...
Is there a clean way to make QGIS display the results on the terminal.
Note: The QGIS command line mode will be much more used in the coming years with the addition in 3.14 of a new command line mode to use QGIS processing algorithms in batch mode, it's called qgis_process. See QGIS 3.14 change log.  It is working well but behave the same as what is described above in terms of StdOut and StdErr redirection.


texts: Variable type for Value Table parameter in Modelbuilder?

texts:
I've created a python tool with a multivalue input box (parameter type: GPValueTable). The box is small and will contain long strings. I'm hoping to be able to add values to the input box with modelbuilder variables. I can't find a variable type which does this.

I tested String and it only updated the first box, leaving the rest of the row blank. I also tried clicking the Multivalue box when creating the string variable but I could not connect it to the input box afterwards. Record Set also did not work.

Is there a variable type which allows me to populate all needed values in a value table parameter? ArcGIS version 10.4.

The model:

The tool showing the multivalue box:

The python code for the parameter:

    calcs = arcpy.Parameter(
        displayName= "Update Field",
        name= "calcs",
        datatype= "GPValueTable",
        parameterType= "Required",
        direction= "Input")

    letters = string.ascii_uppercase [:numCol]
    calcs.parameterDependencies = ["table"]
    clmns = ["String", "Update Field"]
    clmns = [clmns] + [["String", "Calc Field '{}'".format (a)] for a in letters]
    clmns = clmns + [["String", "Logic Test"], ["String", "Equation"]]
    calcs.columns = clmns


texts: Trying to convert GPS LatLng Android coordinates to use in ArcGIS rest - esriMeters

texts:
I am getting the LAT and LNG position from Android.
Both values are of type double, in Degrees.

For example: NY, USA
Latitude: 40.7142700
Longitude: -74.0059700

Then I have a service ArcGIS REST.
It uses esriMeters.

How do I convert Lat Lng to esriMeters and back?

More information:

Spatial Reference: 32721  (32721)


texts: Showing labels on KML map in Google Maps?

texts:
I have converted my layer, that is (from shapefile to KML) in QGIS this is the way I read it in angular:

this.kmlLayerc1 = new google.maps.KmlLayer ({
  url: 'http://direccion/carpeta/nombre.kml',
  map: this.map
});

Now, in what can I show it with its attributes as it is shown in the image.

What I have tried to do is show it that way in Google Maps, just as it is showing it with all its attributes but showing it on the map only shows the polygons and the attributes do not.

This is the image.

Any suggestions to solve it?

I convert the file .shp to .kml because that way I can show it on the map

Example, this is mi file .kml:

I just want to show the sector name as in the image


texts: Google Earth Engine exported image looks different from map rendered on screen

texts:
I am creating a composite image of Landsat 8 OLI of Okinawa and want to export the true color image to my google drive as a tif file. I was able to successfully download it, but the image (img2) looks very different than what was rendered on my screen (img1). Could someone let me know what I might be doing wrong?

img1

img2

    function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = 1 << 3;
  var cloudsBitMask = 1 << 5;

  // Get the pixel QA band.
  var qa = image.select('pixel_qa');

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
      .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

  // Return the masked image, scaled to TOA reflectance, without the QA bands.
  return image.updateMask(mask).divide(10000)
      .select("B[0-9]*")
      .copyProperties(image, ["system:time_start"]);
}

// Map the function over one year of data.
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
    .filterDate('2017-01-01', '2018-09-09')
    .map(maskL8sr)

var composite = collection.median();

Map.setCenter(127.954828,26.495070);

// Display the results.
Map.addLayer(composite, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3});

// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([126.551513671875,26.03704188651584,128.86962890625,27.518015241965667]);

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: composite,
  description: 'OkinawaLandsat2018',
  scale: 30,
  region: geometry,
  fileFormat: 'GeoTIFF'
});


texts: Positioning Landsat 8 data in Google Earth

texts:
I have some (combined) Landsat 8 TIF files that I want to overlay in Google Earth Pro. I manually set the 4 corner lat/lon coordinates (Properties->Location) to the 8 CORNER_UL_LAT_PRODUCT, CORNER_UL_LON_PRODUCT,.. values found in the Landsat metadata file. However, the positioning is not quite right (see image).

Do I need different values? I don't think its a problem of rotation.


texts: Using the projection of a layer variable to project another in Model Builder in ArcGIS

texts: So in model builder I would like to have one input feature class projected to match the projection of another layer (a raster layer) that is a variable in the model. Can anyone help me achieve this?