texts:
I want to add for my map measure tools. I added distance for line and square for polygon. Also i added erase for drawed element, but i  can't to clear measureTooltip. First I try do it with Overlay.clear(), but it results, that my popup destroy too. Second, I try remove html element through class, but don't have any reaction. Then I try do it like popup.hide()  window, but it's not effective. May be anybody have implemention for this task or you can modify my code.

lineDraw.on('drawstart', function(evt){
    sketch = evt.feature;
    var tooltipCoord = evt.coordinate;
    listener = sketch.getGeometry().on('change', function(evt) {
      var geom = evt.target;
      var output;
      output = formatLength((geom));
      tooltipCoord = geom.getLastCoordinate();
      measureTooltipElement.innerHTML = output;
      measureTooltip.setPosition(tooltipCoord);
    });
  }, this);

lineDraw.on('drawend', function(evt){
    measureTooltipElement.className = 'tooltip tooltip-static';
    measureTooltip.setOffset([0, -7]);
    sketch = null;
    measureTooltipElement = null;
    createMeasureTooltip();
    ol.Observable.unByKey(listener);
}, this);

***

$("#drawLine").click(function() {
    clearCustomInteractions();
    $(this).addClass('active');
    map.addInteraction(lineDraw);
});

$("#drawPoly").click(function() {
    clearCustomInteractions();
    $(this).addClass('active');
    map.addInteraction(polyDraw);
});

$("#erase").click(function() {
    clearCustomInteractions();
    $(this).addClass('active');
    map.addInteraction(erase);

    erase.getFeatures().on('change:length', function(e){
        if(e.target.getArray().length  !== 0) {
            drawLayer.getSource().removeFeature(e.target.item(0));
        }
    });

    return false;
});

***

function clearCustomInteractions(){
$("#bar").find('p').removeClass('active');
map.removeInteraction(lineDraw);
map.removeInteraction(polyDraw);
}

function createMeasureTooltip() {
// if (measureTooltipElement) {
// measureTooltipElement.parentNode.removeChild(measureTooltipElement);
//}
measureTooltipElement = document.createElement('div');
measureTooltipElement.className = 'tooltip tooltip-measure';

closer = document.createElement('a');
closer.href= '#';
closer.className = 'tooltip-closer tooltip-closer:after';
$(".tooltip").append($(closer));
measureTooltip = new ol.Overlay({
element: measureTooltipElement,
offset: [0, -15],
positioning: 'bottom-center'
});

map.addOverlay(measureTooltip);

}

closer.onclick = function() {
measureTooltip.style.display = 'none';
closer.blur();
return false;
};


texts: Getting list of coordinates for points in layer using QGIS?

texts:
I've got a layer in QGIS that is comprised of points. Its attribute table doesn't have (show) the corresponding x and y coordinates for each point. Is there a way for me to extract a list of coordinates for those points? (ideally into a CSV, but not required)

Also, for the exported list of coordinates (say, in a CSV file), how do I include the existing attribute table with it?

For your information, I am running QGIS on Mac OS X 10.6.7.


texts: How widely supported are nested FeatureCollections in GeoJSON?

texts:
I know that FeatureCollections inside FeatureCollections are not supported according to the GeoJSON spec, but I have seen multiple implementations that do support it. Are nested feature collections widely supported, and how do implementations that don't support them handle them?

Are nested attributes widely supported?


texts: How to perform mass-balance analysis with ArcHydro

texts:
I was wondering if there is any online manual/instruction for carrying out water mass balance analysis using ArcHydro?

I have searched for such information, and the closest thing I can find is a course outline from ESRI, which contains a section under Arc Hydro in action called

Mass-balance analysis; watershed delineation and characterization

But the course material itself is not available.

I was wondering if someone know how to do water mass-balance analysis with ArcHydro?

For disclosure, I know the very basics such as DEM editing, sinks filling, flow direction and accumulation; and I know some ArcGIS network analysis programming through ArcObjects/COM. What I am interested in knowing is the following

I have shapefiles for river center lines, and DEMs, administrative boundaries.

I also have monthly water level data for SOME gauge stations (but not for all segments of the river).

I want to figure out the amount of water that flows into and out of specific regions and administrative areas such as provinces.

Can I do this with ArcHydro? and How?


texts:
I looked at ArcGIS and python and I'm not quite ready for that as I'm on a schedule. I have a little experience but not at the level to pick it up quickly enough for my time frame.

The model runs well, I've munged the tables so the geocoder picks up all the fields properly. But I can't get it to save the results of each geocoding process to an individual file.  It just keeps overwriting the same file.

I tried connecting the name variable to the geocode addresses function but get this:

Which doesn't work.

Any suggestions how I can get this done?

If there's a simple edit in scripting outside of the ModelBuilder I can do that.


texts:
how to find length array (markers) in OpenLayers.Layer.Vector ?

var data = new OpenLayers.Layer.Vector("Data", {
    styleMap: styleMap,
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "./data/data.geojson",
        format: new OpenLayers.Format.GeoJSON({
            extractStyles: true,
            extractAttributes: true,
            maxDepth: 2
        })
    })
});


texts: Removing added layer using leaflet and Cartodb

texts:
I've added a layer to a map via Leaflet. It's actually a circle around a point. This gets added perfectly. I'd like for it to be removed when I click a certain button. Here's how I'm creating the circle. I'm adding it to a group, as there are instances where there are multiple circles and I'd like to remove them all at once.

    var five_mile = L.circle([latitude,longitude], 11046,{
    fillColor:'#1d5492',
  fillOpacity:'0.3',
  stroke:false,
  clickable:false
})
 map_object.addLayer(five_mile);
 assetLayerGroup.addLayer(five_mile);
 var layers = assetLayerGroup.getLayers();
  console.log(layers);

The console log shows me that there is layer data in the assetLayerGroup.

To remove the layer, I'm doing this:

$('#remove_cir').click(function() {
  assetLayerGroup.clearLayers();
});

#remove_cir is the ID for the button I click to remove the circles in the group. There are no errors thrown when I click this, but the circle isn't removed.

What am I missing?


texts: What is limit to physical number of raster TIFFS that can be placed in QGIS?

texts:
Can anyone please let me know if there is a limit to the physical number of raster TIFFS that can be placed in QGIS?

I am trying to bring in a large number of StreetView tiffs from the Ordnance Survey OpenData suite, but have reached a point where I get an error message.

I have imported 1,998 tiles without any problems. When I import the next single file, it doesn't geo-reference correctly. Then the next one brings up the following error message:

"/OS_OpenData/StreetView/no/no05nw.tif is not a supported raster data source"

I am running QGIS 2.12 Lyon on Mac OS X El Capitan (10.10.5). The GDAL version is 1.11.3-1. This also happened on the previous QGIS version (Pisa), so I upgraded today to see if that fixed it.


texts: Can I change the level of detail of shapefile with OGR?

texts:
I`m working in a project where I must display shapefiles. I'm using OGR to read the shapefile data and use QT to display it.

At this moment, I can display correctly shapefiles with around 2000 geometries but if I use bigger then my program performance is reduced.

I want reduce the number of geometries from my shapefile using the level of detail but I don't know is this is possible with OGR. For example, I have a shapefile with 12 million points and I want reduce it to 2000 point
keeping the details.

I read about use ogr2ogr executable, but this is very slow and I need reduce the shape in execution time.

How can I proceed?


texts: Stack rasters with different origin, dimensions and resolution in R

texts:
I have three raster files with the same extent and CRS, but with different origin, dimensions and resolution.

r1
class       : RasterLayer
dimensions  : 3020, 3043, 9189860  (nrow, ncol, ncell)
resolution  : 0.003446425, 0.003657477  (x, y)
extent      : -8.69165, 1.79582, 49.83774, 60.88332  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
names       : r1
values      : -0.272593, 5616  (min, max)

r2
class       : RasterLayer
dimensions  : 1221, 655, 799755  (nrow, ncol, ncell)
resolution  : 0.0160114, 0.009046339  (x, y)
extent      : -8.69165, 1.79582, 49.83774, 60.88332  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
names       : r2
values      : 0, 10  (min, max)

r3
class       : RasterLayer
dimensions  : 1326, 1259, 1669434  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent      : -8.69165, 1.79582, 49.83774, 60.88332  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
names       : r3
values      : -0.4956901, 8.6887  (min, max)

When I try to create a raster stack, I get the following error:

predictors<-stack(r1, r2, r3)
Error in compareRaster(x) : different number or columns

I tried to re-sample r1,r2 according to one raster, lets say r3 - but it did not work.

Any advice how to solve this issue?

The rasters can be downloaded here: https://www.dropbox.com/sh/zfbm05qwmsgp0lh/AAC7xGxSUuEyYeIQbqSqh1FPa?dl=0


texts: QGIS 3 has reworked tools for loading layers. Is there and easy way to load data from PostGIS views

texts:
QGIS 3 has a new "Data Source manager" and I was hoping that it gave a better mechanism to load layers from PostGIS views but it would appear that it is just a wrapper around the old stuff that was exposed in the tool bar. Worse still it no longer recognises the initial column as feature_id if it has unique values in the column which means one has to fiddle with the feature_id selection which is highly non intuitive.

Am I missing something?


texts: Creating polygon grid of triangles with R?

texts:
I wish to create a polygon grid such as the image below.

Is it possible to do with the st_voronoi from SF package using R?

I'm interested in a polygon grid.

Based on mdsummer comments, I want to clarify that I'm seeking just a spatial  triangles polygon grid so that I can perform geoprocessing tasks. It would be ideal that it would be denser at the center.


texts: how to calculate summary statistics and produce line plot for daily MODIS LST quality bands

texts:
I have a raster stack (numpy 3d array) of daily MODIS LST quality bands.  The quality bands have pixel values that correspond to the quality of the LST data in each pixel.  For example, 2 = no data received due to clouds, 3 = possible cloud contamination, 17 = low quality for other reason, etc.

I would like to create a line plot (x axis = proportion of pixels, y axis = day of year) that depicts the proportion of pixels within the MODIS tile that have a given quality value on any day of the year.  The line plot would have multiple lines, each representing a value in the quality band.  I would like to do this in Python, if possible.

As an example, lets say I have a 2d array, which would represent a MODIS tile for one day, with the following information:
     [[2,3,0], [17,3,0], [2,2,0]]

For this array I would need to calculate the proportion of pixels that correspond to each value, and then have the output in some form (table or csv file) that I could then plot.  I would then repeat this process for each day of the year.


texts: arcpy.da.UpdateCursor - How to update last column from Field Name List?

texts:
examples:

for field in arcpy.ListFields(fc):
    if field.name != 'Hi':
        arcpy.AddField_management(fc, 'Hi', 'FLOAT')
    else:
        print "kolona Hi vec postoji"

with arcpy.da.UpdateCursor(fc, (fieldNameList)) as cursor:

    for row in cursor:

                hi = sum(np.array([row[i]/(sum([row[i] for i in range(len(fieldNameList))])) for i in range(len(fieldNameList))])**2)
                row[14] = hi # row[LAST] = hi ?????

                cursor.updateRow(row)

    del row
    del cursor

That instead of row[14] use the last column of the defined list?
examples:

row[last] = hi


texts: How to enable an Atlas from python console

texts:
How can I enable the checkbox of atlas of print composer in QGIS 3.4.x, from python console.

Here a image:


texts: Resolving "timestamp invalid" during ArcGIS Pro install?

texts: Today, I downloaded and installed ESRI ArcGIS 10.3 For Desktop Advanced and then ArcGIS Pro 1.0. I assigned licenses, including a license for ArcGIS Pro, to account. I was able to authorize 10.3 and can launch that without a problem. I cannot, however, launch ArcGIS Pro. When I do, a message box appears with "timestamp invalid". No ESRI have been on this machine (clean windows install last weekend) Any thoughts about how to resolve this?


texts: KML to Shapefile losing Fields in ArcGIS for Desktop?

texts:
I am trying to convert KML File to shapefile, but all the fields are being deleted except the name.

How can I convert a KML/KMZ file to shapefile without losing the fields?


texts: Where can I find the freeware ST-Links PgMap?

texts:
I am trying to connect to a PostGIS database from ArcGIS Desktop 9.3.1
Some web-searching suggested that zigGIS would be useful. Unfortunately zigGIS has reached the end of life, and the author of zigGIS recommended the use of freeware PgMap here

Further research suggested that ST-Links has renamed PgMap to SpatialKit and is now charging for it.

Is the freeware version of PgMap still available to download? If so where?


texts: Setting GroundFilter parameters for low density point clouds?

texts:
I'd like to use the function GroundFilter on my dataset. However, the manual says that the default values of the parameters used by this function (g parameter, w parameter) are related to a high density point cloud (> 4pts/m2).

Do you know which values I have to choose for my low density dataset (0.5 pts/m2)?


texts: FME convert from OSM to SVG but preserve aspect ratio?

texts:
I need to apply "raster paint" over a OSM map. I am using FME to convert the OSM map to SVG, and then using the xara draw program to add the paint (roadways, stop lines, etc.) for a raster display.

The issue I have is that FME is stretching the SVG image. I don't see that in the FME 2015.1 data explorer. But I do see that in when I look at the SVG in Chrome. Any FME experts here?

(I already tried the SVG tag for preserve aspect ratio:
preserveAspectRatio="xMinYMin slice"

True Image:

Stretched Image:

Here is what some of the data looks like:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-flat.dtd"
>
<svg xmlns="http://www.w3.org/2000/svg"  viewBox="-3.59534e-005 -3.59534e-005 0.00294818 0.00381678"><g xmlns:fme="http://www.safe.com/fme" fill="none" stroke="black" stroke-width="0.000000359533915" preserveAspectRatio="xMinYMin slice" transform="translate(0,0.00374488) scale(1, -1)">
<g id="boundary" >
<path fme:id="-2096" fme:visible="true" fme:lane_boundary_type="solid_yellow" fme:type="lane_boundary" d="M 0.00267276,0.00303538 l -0.00014045,-0.000209472 -0.000138128,-0.000195737 -0.000145093,-0.000203464 -0.000106788,-0.000186295 "/>
<path fme:id="-2094" fme:visible="true" fme:lane_boundary_type="solid_yellow" fme:type="lane_boundary" d="M 0.00186222,0.00192878 l 9.55227e-005,-8.6277e-007 "/>
<path fme:id="-2092" fme:visible="true" fme:lane_boundary_type="solid_yellow" fme:type="lane_boundary" d="M 0.00181594,0.00192882 l -0.000128648,1.66573e-006 "/>
<path fme:id="-2090" fme:visible="true" fme:lane_boundary_type="solid_yellow" fme:type="lane_boundary" d="M 0.00202719,0.0030487 l 4.84211e-006,-0.000327528 6.96445e-006,-0.000366579 2.32148e-006,-0.000218918 2.32148e-006,-0.000115898 "/>

Here is a screen shot of the workspace. I am currently not doing any re-projection.

UPDATE

@Fezter and @Mapperz are correct. the problem was that I needed to re-project to spherical Mercator. I feel stupid. Can one of write up your solution as an answer so I can give you guys credits?


texts:
I have a shapefile data of buildings. I added it to GeoServer and serve it as a WMS layer. When I check my own maps in the browser my polygons of building appear black color and I want to change it's color.

What am I supposed to do ??


texts: How can I fix Print Composer errors due to huge file size?

texts:
I have put together a map using the British OS Strategi data set which is pretty densely detailed. It is surveyed at 1:250,000 and so contains roads down to track level, rivers, villages, railway lines - you name it. There's a lot of data.

When I try and export an image version of the map (at about 1m x 1m), I always get an 'Exception: bad allocation' error. This happens when I try to export as a raster image or PDF. I have tried printing to a PDF generator (CutePDF) but the same thing happens. The print spooler shows the file size at 1.6Gb.

I am running QGIS on a dual core 2ghz Windows 8 system with 4Gb of RAM. Is it just a case of the file being too big? Is there anything I can do? Or is there an alternative, free GIS package that would do a similar job?


texts: Interpolating VRT to Geotiff using gdal.Grid in Python creates null image

texts:
I have a set of points with X, and Y coordinates and associated Z values

POINT (-102.9071045 31.43453407 1871.930298)
POINT (-102.8339386 31.45111084 1856.14209)
POINT (-102.4687424 31.53144836 1869.777588)
POINT (-102.8522263 31.5140934 1852.520508)
POINT (-102.779068 31.53050041 1857.646606)
POINT (-102.7059631 31.54673767 1861.825195)

......
I am trying to create an interpolated surface of the Z values and save it as GeoTIFF. Here is the code I am using:
'''

# Interpolate Point data to a raster grid

import os
import gdal
from osgeo import ogr
ogr.UseExceptions()

os.chdir('F:\PythonTutorial')

csv_file = 'Example.csv'
vrt_fn = 'Test12.vrt'
lyr_name = 'Example'
out_tiff = 'test14.tif'

#create a .vrt file
with open(vrt_fn, 'w') as fn_vrt:
    fn_vrt.write('<OGRVRTDataSource>\n')
    fn_vrt.write('\t<OGRVRTLayer name="%s">\n' % lyr_name)
    fn_vrt.write('\t\t<SrcDataSource>%s.csv</SrcDataSource>\n' % lyr_name)
    fn_vrt.write('\t\t<SrcLayer>%s</SrcLayer>\n' % lyr_name)
    fn_vrt.write('\t\t<GeometryType>wkbPoint</GeometryType>\n')
    fn_vrt.write('\t\t\t<LayerSRS>WGS84</LayerSRS>\n')
    fn_vrt.write('\t\t<GeometryField encoding="PointFromColumns" srs="WGS84" x="Longitude" y="Latitude" z="CH4Concentration"/>\n')
    fn_vrt.write('\t</OGRVRTLayer>\n')
    fn_vrt.write('</OGRVRTDataSource>\n')

# print data on the screeen
inDataSource = ogr.Open(vrt_fn)
lyr = inDataSource.GetLayer(lyr_name)
for feat in lyr:
    geom = feat.GetGeometryRef()
    print(geom.ExportToWkt())

output = gdal.Grid(out_tiff, vrt_fn, algorithm = 'invdist:power=2.0:smoothing=1.0')

'''

The print data on the screen portion is added to check if the VRT file is being read - and it prints the point perfectly. However, the output image is null.

Can anyone help?


texts: Coordinate system choice in mapproxy demo

texts:
I have a question about the mapproxy demo page.

I added wmts and wms to the services config, so the demo page lists the configured layers in the WMS and the WMTS part.

services:
  #sets up how to make the source data available
  demo:
  wmts:
  wms:
    #srs sets the coordinate reference systems as which you want to make your data available. MapProxy reprojects the source data very well to these projections.
    srs: ['EPSG:3857','EPSG:900913']
    image_formats: ['image/jpeg', 'image/png']

But the problem here I have is that only the EPSG:900913 SRS is shown in the WMTS part. The WMS part shows a drop-down menu with the configured SRS. How can I achieve that under WMTS I can choose between all SRS as in WMS?
The same with the image formats. The WMTS part shows only png.

I use mapproxy 1.7.1.

UPDATE:
Meanwhile I have figured out that only the SRS and image format which are used in the cache are shown. If I change the SRS used for caching to another one, the SRS on the web site changes as well.


texts: How to calculate the mean distance between co-ordinates in QGIS

texts:
I have an assignment were I need to calculate the mean distance between coordinates. Effectively I am trying to find out what is the average distance in meters between buildings in a defined town boundary.

Does QGIS have a tool to do this? I'm using WGS 84 as the co-ordinates system for the both the project and the layer.


texts: Change line into multiple segments where they overlap with nodes and vertex (qgis)

texts: I have one (very) long line (e.g. line 2) I also have another line (line 3) which nodes are snapped with two vertexes of line 2. I want to break line 2 up in three segments. Is this possible by using qgis? Is there a way to do this automatically? (All the lines are on the same layer btw)


texts: Geometric Network error in File Geodatabase<Network Dataset

texts:
I need to create a geometric network in my network dataset which resides within my file geodatabase. I have been receiving the following error: Cannot create geometric network. The selected feature dataset does not contain any feature classes which can participate in a new geometric network.

This error should not come up because there are tons of functional feature classes in the network data set.

Any workarounds or solutions?


texts: Performing accuracy assessment using actual vs predicted values in ArcGIS Desktop?

texts:
I am intending to perform validation of the derived soil thickness raster to evaluation its accuracy in terms of RMSE. I already have actual and corresponding predicted values extracted from the model.

Can anyone help me to validate my soil thickness model>


texts: Extract Overlapping Polygon Data to Points

texts:
I have a polygon data set of corn yield collected by a combine. However, as the combine drove through the field, there was slight overlap between passes, leading to overlapping polygons within the same shapefile. I also have a point dataset of sampling sites within the field. Occasionally, these points fall on locations where two polygons are overlapping. At each point, I would like to extract the value from whichever polygon has the higher yield.

I've thought of two ways to do this:

If I can extract the values from both polygons to the attribute table, I can process the data in Matlab to get the maximum. However, most of the points are entirely contained within one polygon. I've tried doing a 'Join by spatial location' but because the polygons are in the same layer, it will only join one of the two records.
Create new polygons for all the overlapping areas and then use join to extract the data.This example from Grass seems to do what I want, but I don't know how to do the behind-the-scenes programming. Is there a built-in function of Arc that can do the same thing?

I am using ArcMap 10 with spatial analyst. There are hundreds of polygons overlapping, so I'd like to use some sort of automated extraction.


texts: How can I display a polygon layer after joining it with a point layer using the polygon geometry saved in the table of attributes?

texts: I joined a polygon layer to a point layer using a common field and then exported as a new layer. Just in case I first saved the geometry of the polygon layer (shape and area) in the table of attributes of the polygon layer. For some reason the resulting layer is not displayed at all in QGIS, not even at the wrong place. So I just want to tell QGIS to look for the polygon geometry in the common table of attributes so that the layer is displayed as polygons, not points.


texts:
I'm using the LayerMapping feature of Django (https://docs.djangoproject.com/en/1.11/ref/contrib/gis/layermapping/) but I can't get the polygon to import into the DB. I'm using a PostGIS DB. I'm basing my work from the above link and from http://www.paolocorti.net/2009/04/01/a-day-with-geodjango/

My model is:

from django.db import models
from django.contrib.gis.db import models

class HazardMessageDistricts(models.Model):
    # Outlines of districts that 311 info is available for
    districtName = models.CharField("District Name", max_length=250, null = True)
    # Spatial fields
    # Default CRS -> WGS84
    districts = models.PolygonField(null = True)
    objects = models.GeoManager()  # Required to conduct geographic queries

My script to import into the model is:

from django.contrib.gis.utils import LayerMapping
from django.db import models
from django.contrib.gis.db import models
from hazard_message_districts import HazardMessageDistricts

path = path_to_shapefile

mapping = {'districtName':'NameInShapeFile','districts':'Polygon'}
lm = LayerMapping(HazardMessageDistricts, path, mapping, transform=True, encoding='iso-8859-1')
lm.save(strict=True, verbose=True)

It's somewhat working as the NameInShapeFile is correctly passed into the DB but the geom field is left empty.


texts: How to export a map (satellite image, 3 bands) to Tiff without losing the resolution in Qgis.

texts: I manually improve the colour contrast of landsat images. The printing in pdf afterwards is OK, as it maintains the resolution due to the high dpi. Now I am interested to obtain a kmz/kml file of the satelite image for visualization in Google Earth. I have downloaded Maptiller which allows to load in tiff, and generate kmz. My problem, however, is that saving the map as tiff results in a maximum image size of 2.3MB, hence the resolution gets lost before the actual conversion to kmz. I used the garmincustommap plugin of Qgis, but same issue...Seems that the only straightforward way would be arcGis or globalmapper, which I do not have access to. Any suggestions?


texts: Append value(string) to multiple selected fields

texts: In my attributes table I want to insert a new value to a few selected items, and keep the old data inside the field. The table contains multiple columns (street name, length... and public transportation). I have selected a few roads and I need to update them by adding a new public transportation (,bus 332). How can i achieve this?


texts: I have a satellite image of one region. I perform interpolation on this image. However, I am not sure Satellite Image is continuous or discrete data.


texts:
I would like to extend a vector grid of 1x1 km to a neighborouring area. The best option for me would be to simply modify the existing layer

This grid has been first made in ArcGIS, but I use QGIS so I've just saved a new version under QGIS. I have managed to create a grid encompassing the 2 areas but the size of the cells is slightly different and that's a problem for my analysis. It's impossible to get the exact same size, since I'm using as CRS EPSG:4326 for which map units are in degrees (I can't change that) and my cell size is in km^2.

So far in similar questions I have only seen suggestions of creating a new grid including the new areas, but I didn't find anything about the possibility or impossibility to modify an existing vector grid.

In a nuthsell: is it possible to modify an existing vector grid and extend it?
using QGIS 2.18.2 (I'm happy to upgrade if that makes a difference)


texts: I have a shapefile of 1241 dam locations in Washington, if I open the attribute table I have only latitude and longitude.  I want to convert this to a raster with counts of the number of dams in each raster cell. I am using QGIS but could also use R.


texts: Restrict access to geoserver's web administration interface

texts: I am a bit worried because the web administration interface for my geoserver is open to everybody. Of course there is a password set, but I wonder if it is reasonable to block access to the padel from web?


texts: network based interpolation methods, which one could I use?

texts: I need to interpolate traffic data consisting in raw number of vehicles passing across certain points, where counters are. It is evident I haven't a uniform distribution of points and values about traffic. I would like to ask which methods I could use to interpolate this network deducing traffic for each location of the overall network. I tried to look on the most used desktop GIS (QGIS, ArcGIS) but it seems there is not a'ready made' solution at the moment. Is there an algorithm that I can implement in Python to achieve this result? Thanks!


texts: Associating data in a form with an SDE Layer

texts:
I was wondering if there was a way to associate/persist some data about an SDE featureclass when viewing via ArcCatalog.

I know you can have metadata - but I don't want to use that, and I'm pretty sure that won't work for what I'm planning.  I want to have a form that will show when you right click the layer, then you can fill in some details in a form and send that info to a nominated user via email or dump out to a text file.

So there is an issue of persistance here - I want users from various parts of the organisation to be able to view the extra info about the layer - so there must be something that SDE does to store info about a layer somewhere in the SDE tables.

If anyone can give some pointers/interfaces etc that would be great.


texts: Filter out Sentinel2 NDVI values below 0 in GEE

texts:
I am new to coding. I have made a tenday NDVI composite using Sentinel2 data, then selected random points and attached NDVI values for each tenday period. I would like to filter away NDVI values below 0. However I do not know how and where in my script to make the code.
var studyArea = ee.FeatureCollection(surveydata);
var surveyData = ee.FeatureCollection(surveydata);

// Load Sentinel-2 data.
var s2 = ee.ImageCollection('COPERNICUS/S2');

// Load cloud masking tool
var s2mask = require('users/fitoprincipe/geetools:cloud_masks').sentinel2;

// function to apply NDVI calculation to every image in collection
function addNDVI(image) {
  var NDVI = image.normalizedDifference(['B8', 'B4']).rename('NDVI');
  return image.addBands(NDVI);
}

//set a list of start dates
var startDate = '2020-05-01';
var endDate = '2020-09-30';
var interval = 10;
var increment = 'day';
var tendayDifference = ee.Date(startDate).advance(interval, increment).millis().subtract(ee.Date(startDate).millis());
var listMap = ee.List.sequence(ee.Date(startDate).millis(), ee.Date(endDate).millis(), tendayDifference);

//function to get a weekly composite
function gettendaySentinelComposite(date) {
  // Only include the NDVI
  var s2 = ee.ImageCollection('COPERNICUS/S2')
                      .filterBounds(studyArea)
                      .filterDate(date, date.advance(interval, increment))
                      .filterMetadata('CLOUDY_PIXEL_PERCENTAGE', 'less_than', 60)
                      .map(s2mask())
                      .map(addNDVI)
                      .select('NDVI');
  var composite = s2.max()
                      .set('system:time_start', date.millis(), 'dateYMD', date.format('YYYY-MM-dd'), 'numbImages', s2.size());
  return composite;
}

var ndvi_tenday = ee.ImageCollection.fromImages(listMap.map(function(dateMillis){
  var date = ee.Date(dateMillis)
  return gettendaySentinelComposite(date);
}));
print(ndvi_tenday);

var tempTimeSeries = ui.Chart.image.series({
      imageCollection: ndvi_tenday,
      region: studyArea,
      reducer: ee.Reducer.minMax(),
      scale: 100,
      xProperty: 'system:time_start'
    })
    .setChartType('ScatterChart')
    .setOptions({
    title: 'NDVI-over-time',
    vAxis: {
      title: 'NDVI'
    },
    lineWidth: 1,
    pointSize: 4,
    series: {
      0: {color: 'blue'},
      1: {color: 'red'},
      2: {color: 'green'}
    }
});
print(tempTimeSeries);

// Convert the object to an image with one band for each week
var ndvi_tenday = ee.ImageCollection(ndvi_tenday)
.toBands();

// Get a set of 1000 random points from within the survey region. A feature collection
// is returned. (1000 samples for each tenday period)
var ndvi_sample = ee.FeatureCollection.randomPoints({
  region: surveydata,
  points: 1000
});

// Sample the NDVI bands using the sample point feature collection.
var imgSamp = ndvi_tenday.sampleRegions({
  collection: ndvi_sample,
  scale: 100
});

// Export the image to your google drive
Export.table.toDrive({
        collection: imgSamp,
        description: 'NDVI_sample',
        folder: 'EE',
    fileNamePrefix: 'NDVI_sample',
    fileFormat: 'CSV'
    });```


texts: Add a hotlink to a published layer on the GeoServer

texts:
I have a points layer stored in PostGIS and published via WMS on the GeoServer.
There is a field in that table in which it refers to an image link (Each point has a different image/link).
I would like that when accessing the data of this layer this image would be opened in another browser tab or the same tab.
I use Mapstore to view the layers published on the GeoServer.
How can I do this?


texts: Create buffer based on the size of a line's length (QGIS)

texts:
I need to create a buffer around a point, witch has to be 1.3x bigger than the length of a given line.

I want to automate this process with graphical modeler or pyqgis. So the program should automatically read the line's length and create a buffer around this specific point.

[Edit]

This one process is going to repeat hundreds of times.
I will try to explain here all the steps that must be followed when the software runs the process only once:

1) The user must manually create a line and a point ( different shapefines and different tables). The line has the attribute length on its table.

2) The program should read the length of the line (created on step one) and create a buffer (with the radius 1.3x bigger then the line lenght) around the point (also created on step one).

So, these 2 steps consist one process. For each process, the user will create a new point and a new line. The line is only there to work like a rule. And the point is there to give the position for the buffer.


texts:
I want to do TIN Interpolation on a layer but when I fill all the fields with the right data (vector layer, interpolation attribute, extent etc) the algorithm does not run and shows me this message:
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS 3.14/apps/qgis/./python/plugins\processing\algs\qgis\TinInterpolation.py",
  line 188, in processAlgorithm writer.writeFile(feedback)
  Exception: unknown Execution failed after 0.08 seconds

My QGIS version is 3.14 and the layer I want to do the interpolation is a shapefile with contours, exported from Surfer as .shp file
Does anybody have an idea about it?


texts: Can I reorder the points in a GEOS LineString?

texts:
Using libgeos, when I buffer() a polygon and then getExteriorRing() [to make a slightly smaller outline copy of the polygon just inside the original], it seems that which point on the new geometry is the first/last point depends on more factors than I can control directly. When I do this repeatedly using different offsets to get multiple concentric copies of the original shape, the "starting" points on each subsequent shape are not all near each other as I had expected.

In the first specific case where I noticed this, an offset of 30 feet (and any offset between 30' and 60') resulted in a starting point near the right edge of the shape...but every offset that I tried above 60 feet resulted in a staring point at the leftmost point in the shape.

My initial though for how to deal with this goes something like:

find the point on the derived geometry that is closest to the first point in the original geometry
reorder the points in the derived geometry such that the point found in step 1 is the first (and last, these are closed) point
Rinse, repeat for each buffered copy

Step 1 seems like geos::operation::distance::DistanceOp::nearestPoints(). Step 2 eludes me. Maybe that's because I'm trying to do this the hard way and I just don't know the name of the easy way? Is there a way to reorder the points in a GEOS LineString?

I should note that which point is first is important here because I need to treat that point as special for purposes of display and "end of path" detection...and having them all at relatively the same spot on each copy avoids jarring behavior for the user.


texts:
I can set a "X,Y tolerance" or use default when I create a new feature class.

I can set a "X,Y tolerance" or use default when I create a new feature dataset.

I can set a "Cluster tolerance" or use default when I create a new topology within a dataset.

What are the differences, and what is affected if there are different settings (for example, I have a topology with a .0034 cluster tolerance in a dataset set to .00328 X,Y tolerance with feature classes of .00328 X,Y Tolerance settings).


texts: Can't find `mapproxy-util` after MapProxy installation

texts: I'm trying to install MapProxy on a Windows machine. My hope is that I can install it and test it on my own computer before moving it to a server. At the moment I can't seem to find mapproxy-util and to be honest I don't understand how I am supposed to call it. I have read the tutorial at mapproxy.org but if anyone knows of some other online tutorials that have been helpful I would really like to hear about it. Any advice is welcome.


texts: Converting GEOID18 elevation data to NAVD88

texts: Is there a way to convert vertical data from GEOID18 to NAVD88 (survey feet) (EPSG:6360)? .  Horizontal coordinates in NAD83-2011-EPSG:6570.


texts: Cannot get ArcGIS Server to provide an offline KMZ

texts:
I have been trying to find a way to get ArcGIS Server to provide me with a KMZ file that has all the data and symbolization information contained within it (no network links). This way the KMZ can be loaded, displayed and edited on a device that most likely will not have connectivity back the original ArcGIS Server.
Has anyone figured out a way to do this?


texts: Is my raster catalog managed or unmanaged?

texts:
According to the following post I can look in the field properties to find out if my raster catalog is managed or unmanaged.

http://blogs.esri.com/esri/arcgis/2012/02/15/is-my-raster-catalog-managed-or-unmanaged/

However, when I look, I do not have the property "Managed by GBD". I have both ArcGIS 10.0 and 10.3.1. How else can I find out which Raster Catalog I have?

Here you can see what is shown when I show the properties of the raster field.


texts: Can you style a polygon feature as invisible, and not be affected by the background colour

texts:
I have a spatial data set of a country (England), I am trying to use this dataset to shade out all parts of a background map apart from the country shape.

Using wms I can set the bgcolor to black, if I also set the style of the polygon to be transparent it simply means all I see is the black background colour, therefore as some kind of hack, I have set the polygon colour to a solid white.  Then when making the wms request I set the bgcolor to black and set the opacity to 0.5 which almost achieves what I need with the rest of the world being shaded and my country being visible, although washed out as it has a 0.5 opacity white style over it so this is not quite ideal:

Are there any ideas on how this can be better achieved, simply using the England shape data set that I already have.

For reference:

SLD:

<FeatureTypeStyle>
<Rule>
<Name>Rule 1</Name>
<Title>Invisible polygon</Title>
<Abstract></Abstract>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill">#FFFFFF</CssParameter>
    <CssParameter name="fill-opacity">1.0</CssParameter>
  </Fill>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

WMS:

new ol.layer.Image({
ref: 'england',
source: new ol.source.ImageWMS({
  url: '/ows?service=wms',
  serverType: 'geoserver',
  params: {
    'LAYERS': 'england_010k',
    'BGCOLOR': '0x000000',
    'TRANSPARENT': 'false'
  }
}),
visible: true,
opacity: '0.5'
})

Edit:

Trying Andrea's hint I got as far as (using destination-in):

With the layer code:

new ol.layer.Image({
ref: 'england',
source: new ol.source.ImageWMS({
  url: '/ows?service=wms',
  serverType: 'geoserver',
  params: {
    'LAYERS': 'england_010k'
  }
}),
visible: true,
opacity: '1'
})

...

var setBlendMode = function (evt) {
  evt.context.globalCompositeOperation = 'destination-in'
}
var resetBlendMode = function (evt) {
  evt.context.globalCompositeOperation = 'source-over'
}

options.layers[4].on('precompose', setBlendMode)
options.layers[4].on('postcompose', resetBlendMode)

But now the rest of the world is hidden, and I need it to be shaded.


texts:
I just installed QGIS 3.4 and the text in the status bar is way smaller than it used to be.

Is there a way of increasing the text size?

See comparison below:

QGIS 3.4

QGIS 3.2


texts:
this is fiddle Link.Feature doesn't show on map when it has been like this code :

 var featureVectorLayer = new ol.layer.Vector({
    source: featureClusterSource,
    style: new ol.style.Style({
        fill: new ol.style.Fill({
            color: 'rgba(255, 255, 255, 0.2)'
        }),
        stroke: new ol.style.Stroke({
            color: 'blue',
            width: 2
        }),
        image: new ol.style.Circle({
            radius: 7,
            fill: new ol.style.Fill({
                color: '#ffcc33'
            })
        })
    })
});

But i change source - featureClusterSource to featureVectorSource.it works well but in this time i don't get feature when i click feature on map .

 var featureVectorLayer = new ol.layer.Vector({
    source: featureVectorSource,
    style: new ol.style.Style({
        fill: new ol.style.Fill({
            color: 'rgba(255, 255, 255, 0.2)'
        }),
        stroke: new ol.style.Stroke({
            color: 'blue',
            width: 2
        }),
        image: new ol.style.Circle({
            radius: 7,
            fill: new ol.style.Fill({
                color: '#ffcc33'
            })
        })
    })
});

How do I show feature on map with featureClusterSource?


texts: QGIS 2.16 - Missing menu Vector > Research Tools > Vector Grid

texts:
I just upgraded to QGIS 2.16 on Xubuntu Ubuntu 14.04.4 and I'm missing the "Research Tools" under the Vector menu. I'm specifically looking for the Vector Grid option.

I didn't notice any error messages during the startup, or the error logs. Would anyone know how to resolve this?


texts: Modeling SQL Query to add statistical data to a geometry

texts:
Hello I have a problem modelling a SQL Query for the following problem:

I have two tables with geometries from Shapefile der Verwaltungsgrenzen (WGS84). Of interest for me are Kreise and Gemeinden, whereas a Gemeinde is always part of the bigger Kreis. Each Kreis has a unique id called rs which is exactly 5 chars long, where as the unique id of Gemeinden is 12 chars long and the first 5 chars are equal to a Kreis id.

For some Gemeinden in de_commuter_gemeinden I have statistical data as well as for most of the Kreise in de_commuter_kreise. These data describe how many commuters there are. The Table looks like this:

de_commuter_* (
  rs character varying(12 or 5) NOT NULL,
  name text,
  within integer,
  home integer,
  incoming integer,
  outgoing integer)

For each geometry with statistical data I have to create random points within the geometry. For the Gemeinden it is no problem, since the are a subset of a Kreis and I can select the geometry from the table de_shp_gemeinden.geom. But for the Kreise I have to subtract the already generated points as well as the geometry they were created in. My current SQL for this is:

SELECT
  k.rs, k.gen, st_difference(k.geom, (
    SELECT ST_Union(geom) AS geom
    FROM de_shp_gemeinden g, de_commuter_gemeinden c
    WHERE c.rs ~ ('^' || k.rs) AND c.rs = g.rs)
    ) AS geom
FROM de_shp_kreise k

Which looks like this

Now I need a smart way on calculating the statistical data for each Kreis, meaning get the data of commuters for the Kreis and subtracting all the data from it subset Gemeinden.

Could anyone point me in the right directions? If you need more info please ask.


texts:
I have a 2048x1024 PNG representing a WGS 84 projection of global data, where pixel 0,0 is lat 90 lon -180 and pixel 2047,1023 is (just shy of) lat -90 lon 180. When I add it as a raster layer in QGIS (specifying WGS 84 as the CRS) it's pulling in as pixel 0,0 = lat 0 lon 0 and pixel 2047,1023 = (nonsensical) lat -1023 lon 2047.

How can I fix this? I've messed around with the Raster menu a bit to see whether that helps, but didn't figure anything out. Perhaps I need to define a custom projection to translate and scale?


texts: Create new emissivity band for each image in image collection by if else in GEE

texts:
I want to create a new band (emissivity band) for each image in my image collection based on the NDVI values of each pixel (NDVI already is a band).
This means if the NDVI < 0.2 I want to give the pixel the value 0.97, if the NDVI value > 0.5 I want to give the pixel the value 0.98 and if 0.2 <= NDVI <= 0.5 I want to give the pixel a value according to the following formula: Fractional Vegetation X 0.004 + 0.986. Fractional Vegetation is also a band each image in my collection has.
So far I have the following code (based on those codes: Calculating LST from Landsat 8 in Google Earth Engine? and Writing code to add calculated image to display in Google Earth Engine?):
Map.addLayer(geometry);

//cloud mask
function maskL8sr(image) {
  // Bits 3 and 5 = cloud shadow and clouds
  var cloudShadowBitMask = (2.5 << 3);
  var cloudsBitMask = (1 << 5);
  // pixel QA band
  var qa = image.select('pixel_qa');
  // clear conditions if set to zero
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
                .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask)
  .copyProperties(image, ['system:time_start'])
}

var start = ee.Date('2013-05-01');

var finish = ee.Date('2013-10-01');

{
var col = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR")
.map(maskL8sr)
.filterDate(start, finish)
.filterBounds(geometry);
}

//calculate NDVI
function add_ndvi(img) {
  var ndvi = img.normalizedDifference(['B5', 'B4'])
  .rename('NDVI')
  .copyProperties(img, ['system:time_start']);
  return(img.addBands(ndvi));
}

var col_ndvi = col.map(add_ndvi);
print(col_ndvi, 'NDVI');

//From DN to at sensor temperature in Kelvin
function add_thermal(img) {
  var thermal = img.select('B10').multiply(0.1)
  .rename('THERMAL')
  .copyProperties(img, ['system:time_start']);
  return(img.addBands(thermal));
}

var col_thermal = col_ndvi.map(add_thermal);
print(col_thermal, 'BT_Kelvin');

// Combined reducer for min and max
var minMaxReducer = ee.Reducer.min().combine({
  reducer2: ee.Reducer.max(),
  sharedInputs: true
});

// Calculate regional min and max
var minmax = col_thermal.map(function(img) {
  var minMax =  img.reduceRegion(
    {reducer: minMaxReducer, bestEffort:true, scale: 30});
  return img.set({
    ndvi_min: minMax.get('NDVI_min'),
    ndvi_max: minMax.get('NDVI_max')
  });
});

// Filter min/max areas = null
var filtered = minmax
  .filterMetadata('ndvi_min', 'not_equals', null)
  .filterMetadata('ndvi_max', 'not_equals', null);

print(minmax, 'MINMAX');

// Calculate Fractional Vegetation
var fv =filtered.map(function (img) {
  var ndvi = img.select(['NDVI']);
  var max = img.getNumber('max');
  var min = img.getNumber('min');
  var fracveg = img.expression("(NDVI-min)/(max-min)", {
    "NDVI": img.select('NDVI'),
    "min" : img.getNumber('ndvi_min'),
    "max" : img.getNumber('ndvi_max'),
  })
  .rename('FV')
  .copyProperties(img, ['system:time_start']);
  return img.addBands(fracveg);
} );

print(fv, 'FV');

//Calculate Emissivity
function emissivity(img){
  var ndvi = img.select('NDVI');
  var soil = ee.Number(0.97);
  var veg = ee.Number (0.98);
  var a= ee.Number(0.004);
  var b= ee.Number(0.986);
  var fv_1 = img.select(['FV']);
  var EM=fv_1.multiply(a).add(b);
  var emis = ee.Image(ee.Algorithms.If(ndvi.lt(0.2), soil, (ee.Algorithms.If(ndvi.gt(0.5), veg, EM))))
  .rename('EM')
  .copyProperties(img, ['system:time_start']);
  return img.addBands(emis);
}

var col_EM= fv.map(emissivity);
print(col_EM, 'EM');

This is the error I get so far after fixing other errors:
ImageCollection (Error)
Error in map(ID=LC08_193026_20130506): Image.rename, argument 'input': Invalid type.
Expected type: Image<unknown bands>. Actual type: Float. Actual value: 0.97

Does anybody know how to fix this?


texts: calculate value using maximum value from different feature class

texts:
I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class.

fc2.bldg_id = max(fc1.bldg_id)+1

Can this be done using the advanced field calculator?
If so, what would my syntax look like?
Do the feature classes need to be in the same fgdb and feature dataset?


texts:
I create two feature classes by importing an already existing layers then I create a topology and I set the rule such that a point feature class must be covered by endpoints of the other line feature class and there was one error. When I tried to edit I received the error: start editing encountered one or more layers with error and can not continue this data is not editable.

Any ideas on how to fix this?


texts: Extracting elevation data using Google Earth?

texts:
How do I extract multiple elevation values for a particular area in Google-Earth all at once?

I've only been able to manually pick them one by one when I enter the long. and lat. for each point.


texts: Measure average distance between two lines with common endpoints

texts:
I have two shapefiles, each with a set of lines generated from start and end points. One shapefile has the straight lines generated from the XY To Line tool, while the other has lines generated from a least cost path tool in Python.

I am looking for a method to quantify the error or distance between them, something that attempts to capture the overall variation between the two lines, not just the greatest or shortest distance between them (The shortest distance would also be 0 as they have the same start and end points). I have considered closing them into polygons, then dividing the area by the straight-line distance to get an 'average polygon height'. I have also considered converting one set of lines into points and then averaging the distances generated from the Near tool for each line feature. However to do this I would have to delete the end points as they are essentially false '0' distances.

Are there other methods to compare these features? An important aspect to note is that sometimes the least cost path line crosses over the straight line so I would often have two polygons.


texts: How to get attribute values of another layer with QGIS expressions

texts:
The question: How is it possible to get the value of an attribute in another layer?
What is clear: When using QGIS expressions on a layer, it is possible to relate to features of another layer with get_feature(layer,attribute,value) (enter the value and get the first feature with this value) or get_feature_by_id(layer,feature_id) (you enter th id of the feature you want to get). Adding geometry(feature) gets the geometry.
The problem: I found no expression that allows to get the values of a certain field - like: enter the id of a feature and get the content of the field "value" - something like (pseudo-expression): attribute_value(feature). The idea is, by way of example, to have access to a point layer and get all the points where field "value" > 500.
This screenshot shows a successful connection (black line) from the start point of the red line to the point with the value = 1486. However, I want to get a connecting line from the start point of the line to all blue points with value > 500:

What I tried: I tested different combinations with aggregate(layer,aggregate,expression[,filter][,concatenator=''][,order_by]), however I was not able to get an aggregate of "value" in a numerical form, I always had to convert them to stings:

aggregate( 'points', aggregate:='concatenate', expression:="value", filter:= ("value" > 500), concatenator:=',') produces an error: Could not calculat aggregate for: value
The shorter version aggregate( 'points', 'concatenate', "value") produces an output of NULL
aggregate( 'points', 'concatenate', to_string ("value")) works, but produces a long string without delimeters, output looks like: 129594124217708841125620148663516710931369194910474691822123…' Adding concatenator:=',' does not help. But the main problem is that the values are converted to strings, so no way to use mathematical operators.
Update: the solution by MrXsquared helped me to create almost what I want, but if the values are not unique, it selects just the first feature. See this screenshot, I created the points with value > 500 as an additonal red points layer with geometry generator. There are two points with the value 513, but only one is created with the geometry generator , the other one not - in fact, the first one is rendered twice, as a duplicate. This is because get_feature () only gets the first feature that matches the input value.

This is the expression used:
collect_geometries (
    array_foreach (
        aggregate (
            'points',
            'array_agg',
            "value",
            "value">500
        ) ,
    geometry (
        get_feature (
            'points',
            'value',
            @element
        )
    )
    )
)

I'm quite stuck here, what do I miss?
I want to get the feature id of all features with "value">500:


texts: How to keep PyQt GUI alive while doing heavy calculation and updating Progress bar and logger

texts:
I have a GUI designed with PyQt, this GUI has a progress bar and a logger.
when the user clicks the Run button the GUI/QGIS will become "No responding"
the actions normally take 45minutes to 1hr
to make it easyi just put the concept I use in my program
class maindlg:
    def __init__(self):
        pass

    def __run(self):
        #this will be called when every user clicks the Run button
        heavyCalculation(self).heavyFunction()

    def updateProgressbar(self):
        #updates progress bar with some logic
        pass

    def logAction(self,value):
        # there is a log textbox  and with some logic this will write the logs
        pass

class heavyCalculation:
    def __init__(self,maindlg):
        self.maindlg=maindlg

        pass

    def heavyCalculation(self):
        #in Here I modify all layers, all geomerty and for each action I update progress bar and logger
        self.maindlg.updateProgressbar()
        self.maindlg.logAction('action xyz done!')

How can I keep GUI(progress bar and the logger) alive while I do the heavy calculation?
I have already tried QgsTask, but it doesn't work form me as in cookbook clearly mentions "must NEVER use any QgsVectorLayer, QgsProject or perform any GUI based operations"
I tried using threads but my knowledge isn't enough and QGIS Crashes when I am trying to update the logger and progress bar from the second Thread.
how this can be achieved in QGIS 3x
Ps. the heavy calculation code works well the only problem is the qgis and GUI are not responding while the code is being executed.


texts: Merging two rasters with different extents, taking the minimum value

texts:
I have two raster data sets:

a DTM that covers my desired extent
river bathymetry data that has the correct river depth data, but only an extent that covers the river itself, everything else is no data

I want to create an output raster that merges these two, using the bathymetry data if it is available, and the DTM data if it is not.

On the assumption that bathymetry data will have a lower value than the DTM data for a given cell, I have tried:

The "Mosaic to new Raster" tool with a mosaic operation of MINIMUM
The "Cell Statistics" tool, also using MINIMUM

Both of these result in an output raster that almost looks correct, but the extent does not match that of the DTM and the minimum and maximum values for the output raster do not match my expectations as the lowest value in either the DTM or the bathymetry data is -20, and the output raster goes to -50.

Am I doing something majorly wrong, or is there a better way to do this?


texts: Are there any free tools that can view and edit ArcGIS Map Packages?

texts:
I'm looking for a tool that can open ArcGIS Desktop 10 map packages (.mpk files) and allow in a simplified way for a third-party to add geology cross sections and well points.

Any suggestions?  It must be "free" and easy to use.


texts: Plotting a heat map onto background in python using kde?

texts:
I have a geodataframe with points within the united states. Each point has a geometry attribute as well as a value. I would like to plot a heat map based on these values on top the map of the united states using kdeplot. However, I'm not sure how gplt.kdeplot reads these data frames?

contiguous_usa = gpd.read_file(gplt.datasets.get_path('contiguous_usa'))
geometry = [Point(xy) for xy in zip(df.Lat, df.Long)]
crs = {'init': 'epsg:4326'}
gdf = GeoDataFrame(df["Gain1"], crs=crs, geometry=geometry)

ax = geoplot.kdeplot(
    gdf, clip=contiguous_usa.geometry,
    shade=True, cmap='Reds',
    projection=geoplot.crs.AlbersEqualArea())
geoplot.polyplot(contiguous_usa, ax=ax, zorder=1)

First five rows of my geodataframe looks something like this, column "Gain1" are the values I want to use for the heatmap.


texts: QGIS 3.x: How to recenter the NASA Blue Marble on the Pacific

texts:
I am working on a personal project that shows sailing routes of the pacific on the NASA Blue Marble imagery. But I am stuck...

How do I go about splitting and rearranging the NASA Blue Marble raster so that it is centered on the Pacific?


texts: Converting a large set of GRIB2 files to a spreadsheet format

texts:
I have a large set of .pgrbf.grb2 files downloaded from the Climate Prediction Center, and I need to run statistical analyses comparing them to data that was produced locally in .csv format. I'm not very familiar with the GRIB2 format, so I'm not really sure how to best go about this.

My dataset from the CPC consisted of ~250 separate files, so I'm trying to script something to easily process them all. (My .csv data was taken every hour and the CPC data is every six hours, so I'll need to ultimately remove most of my data, compare to the relevant CPC data, and then perform the analyses. Getting the CPC data into one large output file would therefore be superb.) I tried using wgrib2 in the below code, but it returns "FATAL ERROR: packing type 40 not supported" for each file (the script is written correctly; manually running wgrib2 <filename> -csv output returns the same error).

#!/bin/bash
FILES=GRIBFiles/*
CNT=0
for f in $FILES
do
    filename="${f##*/}"
    wgrib2 GRIBFiles/"$filename" -csv GRIBFiles/CSVFiles/$CNT.csv
    let "CNT++"
done

I'm also trying pygrib, but I'll be honest: I don't really understand what's going on in the documentation so I don't know how to get the data into a more usable format.

I'll be using various Python modules to conduct the statistical analyses, so as long as the format the data are converted to is general-use (Excel, CSV, etc.) then I'll be able to manipulate it for the statistics.


texts:
I have several replica File Geodatabase's on my server. I publish maps to be viewed by other departments in ArcReader. These ArcReader pmf's use the replica Geodatabase's on the server.

I need to update them from time to time, but the Geodatabase's are always locked during work hours. Usually I just update at night, but when someone needs something done right away, it's a pain to ask everyone to shut it down so I can update it.

Is there anyway to prevent the users, who are only reading the data in the Geodatabase's, from creating lock files in the Geodatabase's?

Can this be done by setting user permissions on the folder?

Can it be done with some sort of ESRI security measures?


texts: QGIS Interpolation on Curved Grid (River DEMs)

texts:
I have an very hard task I want to do in QGIS (or another open source GIS program).

I have point data for river bathymetry (depth). I have been creating digital elevation models of them using Grass and masking the river which makes them look gorgeous but I can tell that there are some issues, just logically. GRASS is interpolating in a North-South East-West Grid, which is not he direction the river runs in! The river meanders and turns and the bathymetry must be interpolated accordingly.

The goal would be to draw a line down the center of the river and use that as a guide for the interpolation (to interpolate outwards from the line). I have seen a nice lecture where a professor mathematically straightened the line using a datum and creating a "straightening" equation and then applying it. The interpolation was then done in the traditional way but at the end the river was re-curved. I did not 100% understand it.

Other things worth mentioning are that ideally this software would interpolate new cross sections (Can this be done in HEC-RAS?) I am pretty sure software such as Mike-11 or Mike-Something more advanced can do this but looking for an open source solution.

The questions are:

Does there exist a tool for this currently?

How could I go about creating a tool for this? (Python plugin)?


texts:
I am looking for an offline map that can import a large number (>50k) of POIs and overlay them onto the map.
It should provide at least some basic search functions, e.g. show POIs sorted by distance and filter POIs by type.
The app should be able to import files (gpx or csv), nice would be to import an entire folder hierarchy in one run so I don't have to load every single POI file individually. The app has to work offline, I am ok uploading the data through a server, but given the large number of points, I strongly prefer if I could just copy the POI folders onto my device.

This sounds very basic, but I haven't found anything suitable that even reaches the level of e.g. Basecamp + GPS.

As an example of what kind of map I'd be happy with: Here Maps is nice as an offline map, but I haven't found a way to import anything. BackCountry Navigator cannot deal with POIs at all.


texts:
I am using QGIS3.4 and I am running into an unexpected problem. I have received a gdb file, the file looks fine in WGS 84 projection. But when I use any other, the polygons seems to be cut strangely.

Does anyone know how to solve this without changing the vector file with a different world map.


texts:
I want to create a point geometry in ArcPad 10 VBScript, to make custom feature drawing. So I want to create point geometry, then

 record.shape = point

or

records.AddNew(point)

I want to create point, line and polygon geometries.

I searched a lot but I haven't found how to create geometry.

I don't know if there's another simple manner to do that.


texts: Calculating zones in multipart polygon feature using ArcGIS Desktop?

texts: I was wondering how you can give each zone a value based on how many overlaps there are from a multipart polygon feature. See the picture. If the circles don't overlap I would like the area to have an attribute of, eg P1, and if there are two circles that overlap I would like it to have the attribute P2 and so on...


texts: Dynamically creating lyr file in ArcPy (for use with group layer)?

texts:
I'm trying to create an mxd that can dynamically create and name group layers, and populate them with various feature layers.  I've seen some examples of how to do this, such as : Creating empty group layer within existing group layer using arcpy.mapping?

The basics seem to be: reference an empty layer file:

groupLayer = arcpy.mapping.Layer(r"D:\Test\GroupTest.lyr")

Add it to the map:

arcpy.mapping.AddLayer(df, groupLayer, "BOTTOM")
listedGroupLayer = arcpy.mapping.ListLayers(mxd, "GroupTest", df)[0]

Then add some layer to it:

addLayer = arcpy.mapping.layer(r"D\Test\Rivers.lyr")
arcpy.mapping.AddLayerToGroup(df, listedGroupLayer, addLayer, "BOTTOM")[0]

I'm getting stuck on the first step: I need to dynamically create an empty layer file (based off of group layer names in a spreadsheet), before referencing it.

Any examples of how to create an empty layer file (rather than reference one), within python?


texts: OGR to OGR looking for WFS to MSSQL code

texts:
I'm trying to get a WFS converting to MSSQL using Ogr2ogr.  I have used the following code but get an error of unable to open WFS source.

Here is my attempt.  Path/UID/Password are all correct.

: Set the environment to use the OGR libraries supplied with the MapManager3
SET MapManagerPATH=C:\Program Files\MapManager30
SET PATH=%MapManagerPATH%;%PATH%
SET GDAL_DATA=%MapManagerPATH%
SET GDAL_DRIVER_PATH=%MapManagerPATH%\gdalplugins
SET PROJ_LIB=%MapManagerPATH%\ProjLib

ogr2ogr -lco geom_name:geom -t_srs epsg:28350 -nln "service_dbyd_wfs" -f MSSQLSpatial "MSSQL:Server=SERVERNAME;database=DBNAME" "WFS:https://URL_etc/ows[?TYPENAME=TicketAccessJobs],UserID=USERID;UserPwd=USERPASSWORD"

pause


texts: How do you add a Trend Line to a Graph in ArcGIS?

texts: I can't seem to be able to get a trendline into my graph. what is the best possible way to get this done?


texts: How to detect touch events on mobile browsers with OpenLayers 3?

texts:
I am trying to display a popup on mouse hover over features from a WFS service. This works fine with web browsers. However , when I try to display the popups on touch in mobile browsers nothing is displayed. The pixels returned from the touch event are never accurate enough to get the correct feature.

My code goes as follows :

$(map.getViewport()).on('mousemove', function(evt) {
        var pixel = map.getEventPixel(evt.originalEvent);
        var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) {
                return feature;
        });

    });

The feature variable always returns null on touch events in mobile browsers. So is there a way to handle mobile touch events in Openlayers 3 ?


texts: How to install GMLAS driver, working for OGR command line tool?

texts: Normally I run my OGR SQL syntax within OSGeo4W shell. I want to try out the GMLAS driver, but can´t find a distribution where it´s installed. I´m on windows. How do I install the GMLAS driver, working with OGR command line tool?


texts: QGIS Server Capabilities Response doesn't contain any Layers (Fedora 15 64-bit)

texts:
I'm having similar issues running QGIS Mapserver under a fresh install of Fedora 15 (64-bit). The XML response from GetCapabilities will not show the individual layers inside the QGIS project, just the 'project' layer. All the layers show up just fine under QGIS (1.7.1). For some reason QGIS Mapserver isn't able to parse my project file or find the shapefiles the same way as QGIS does. Shapefiles are located in my HOME directory. The QGIS project file is in /var/www/wms as per the sample configuration file included in /etc/httpd/conf.d/gis-mapserver.conf

Shapefiles are readable by everyone, so is the project. By the way, everything works perfectly under a fresh install of Ubuntu 11.04 32-bit (QGIS 1.7.0 and QGIS-Mapserver 1.7.0) but for some reason I'm up against a brick wall when it comes to Fedora 15 (64-bit). httpd log files don't show anything out of the ordinary. I tried moving the shapefiles into /var/www/wms but Apache (httpd) didn't like that at all. Any ideas?

Here's the procedure I used under Fedora 15 (64-bit) to get where I am.  Further down is the procedure I used for Ubuntu 11.04 (32-bit) which worked.

$su -c 'yum update'
$su -c 'yum install httpd'
$su -c '/etc/init.d/httpd start'

Tested apache by going to localhost in firefox

got a Fedora test page . . .

$su -c 'yum install qgis qgis-python qgis-mapserver'

run qgis to test (installed qgis 1.7.1 and qgis-mapserver 1.7.1)

Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone

Followed instructions in README file located here:

/usr/share/doc/qgis-mapserver-1.7.1/qgis-mapserver-README.fedora

$cd /var/www
$su -c 'mkdir wms'
cd wms

copied a qgis project into the new wms folder

restarted httpd

$su -c '/etc/init.d/httpd restart'

http//localhost/wms/name_of_qgis_project?service=WMS&version=1.3.0&request=GetCapabilities

(The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post)

XML response shows only the 'project' layer and none of the shapefile layers inside the qgis project

If it helps anyone, here is the procedure I used to get QGIS Mapserver working on Ubuntu 11.04. I started from a fresh install and didn't compile anything from source.  This worked for me.

$sudo apt-get update
$sudo apt-get install nedit
$sudo nedit /etc/apt/sources.list

Added to the bottom of the /etc/apt/sources.list file:

deb     http://qgis.org/debian natty main
deb-src http://qgis.org/debian natty main

Then

$sudo gpg --keyserver keyserver.ubuntu.com --recv 1F9ADD375CA44993
$sudo gpg --export --armor 1F9ADD375CA44993 | sudo apt-key add -
$sudo apt-get update

Got an error message:

W: GPG error: http://qgis.org natty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2A22E8244865A03

$sudo apt-get install apache2 qgis libfcgi-dev libapache2-mod-fcgid qgis-mapserver

WARNING: The following packages cannot be authenticated! libqgis1.7.0 python-qgis-common python-qgis qgis-providers-common qgis-providers qgis-common qgis qgis-mapserver qgis-plugin-grass-common qgis-plugin-grass

(I installed these packages without verification)

Tested apache by going to localhost in firefox

It should say "It Works!"

Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone

Made a new folder inside /usr/lib/cgi-bin and copied one QGIS project into it, along with wms_metadata.xml and qgis_mapserv.fcgi

restarted apache

$sudo /etc/init.d/apache2 restart

Tested GetCapabilities

http//localhost/cgi-bin/new_folder_goes_here/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

(The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post)

Was able to add the WMS Layer from inside QGIS without any problem. However, I still cannot get it to load using ESRI ArcCatalog or ArcMap.


texts: Is ArcSDE available with ArcGIS Desktop license?

texts:
I have ArcGIS Desktop with the ArcInfo license level.

I want to know if I can configure ArcSDE, so that I can work with versioning of geodatabases?

The ArcInfo license level is now known as the Advanced license level (since ArcGIS 10.1 for Desktop).


texts: SQL Server 2008 Spatial Index Nearest Neighbour

texts:
I am trying to query geopoints for nearest neighbour, Whether I use spatial index or not, I always get similar times and it takes about 6 seconds. How can I speed this query up?

Here is my query:

Declare @param nvarchar(50);
set @param = 'POINT(32.489491 37.864724)'

Declare @paramGeom geometry = geometry::STPointFromText(@param, 4326);
Select top 1 MI_PRINX, MI_STYLE, TrafikIsigi, Demiryolu, UlkeSinir, ID, SP_GEOMETRY.STX AS Longitude, SP_GEOMETRY.STY AS Latitude, SP_GEOMETRY AS Geometry FROM dbo.NODE  (nolock)
WHERE NODE.SP_GEOMETRY.STDistance(@paramGeom) < 0.1
ORDER BY NODE.SP_GEOMETRY.STDistance(@paramGeom);

Here is my Index:

CREATE SPATIAL INDEX [IX_Spatial] ON [dbo].[NODE]
(
    [SP_GEOMETRY]
)USING  GEOMETRY_GRID
WITH (
BOUNDING_BOX =(25, 35, 46, 43), GRIDS =(LEVEL_1 = HIGH,LEVEL_2 = MEDIUM,LEVEL_3 = MEDIUM,LEVEL_4 = MEDIUM),
CELLS_PER_OBJECT = 64, PAD_INDEX  = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

Any help will be appreciated.


texts: How to enable Java Advanced Imaging in Geoserver for Mac OS?

texts:
I am trying to enable the JAI in Geoserver for my raster processing. I checked JAI and Image I/O is only available for Linux and Windows. Also, JAI comes pre shipped with every copy of Mac OS. I am using Mac OS, but my Geoserver shows that JAI is false. Why is it false? How can I enable JAI on Geoserver?

The following is the screenshot of my Geoserver:


texts: Failed to execute (RastertoPolygon) Syntax error at or near symbol SPACE

texts:
I'm converting series of raster to polygon using RastertoPolygon in arcpy.

#import the module
import arcpy
from arcpy.sa import *
from arcpy import env
arcpy.CheckOutExtension("Spatial")
env.overwriteOutput = True

#set the workspace
env.workspace = r"C:\thesis\for sampling\sampling_outputs\raster_per_biogeoregion"

#Get a list of rasters and convert to shapefile
for raster in arcpy.ListRasters("*Luzon_*.tif", "TIF"):
    print raster #check the presence of rasters
    arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY")
print "Finish converting all the rasters to polygon"

After several checks on the syntax, formatting, I've always been stuck with this error:

 Traceback (most recent call last):
 File "C:\Users\brentiebark\Dropbox\Python Scripts and          mxds\batch_convert_raster_to_polygon_simple.py", line 14, in <module>
arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY")
 File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\conversion.py", line 178, in RasterToPolygon
raise e
ExecuteError: ERROR 010328: Syntax error at or near symbol SPACE.
ERROR 010267: Syntax error in parsing grid expression.
Failed to execute (RasterToPolygon).

Are there things that I missed from this code?


texts: WebMapping Charts Overlap Issue LeafletJS

texts:
I am a beginner in webmapping development using LeafletJS and JS. I am the owner of the website built under LeafletJS.

I have faced some problems with charts overlapping. On the right top of the map there is an object info that actives on Click. However I am unable to click on the large scale charts covered by the small scale charts. To solve that, I created an object select with the following options that are the charts USAGES:
Berthing scale range (1-2499)
Harbour scale range (2500-4999)
Approach scale range (5000-34999)
Coastal scale range (35000-99999)
General scale range (100000-499999)
Overview scale range (500000-10000000)

I have a JSON file that contains the chart's scales as showed bellow:

  {"type":"FeatureCollection","features":[
  {"type":"Feature","properties":{"Numero":"802","Titulo":"Porto de
  Natal","Escala":8500,"zIndex":999,"Ano":2000,"Ediciao":8,"Datum":"WGS-84"
  {"type":"Feature","properties":{"Numero":"1","Titulo":"Brasil - Costa
  e Ilhas ao
  Largo","Escala":5600000,"zIndex":979,"Ano":2004,"Ediciao":5,"Datum":"WGS-84",

So, "ESCALA" stores the scale value and I am in need to relate or associate each USAGE (Berthing, Harbour, Approach, Coastal, General and Overview) with the scale value in the JSON in order to remove overlaping charts. For instance, when I select the Approach option in the select object, all the other charts (bouding box polygons) that have scale  value out of the Approach scale range would be removed from the map, and so on. This way I would be able to select all charts bouding boxes.

My object select code (top left of the page) is found below:

selector.onAdd = function (map) {
   var div = L.DomUtil.create('div', 'select');
   div.innerHTML = '<select id="sta_select"><option>(no selection)</option><option>Overview</option><option>General</option><option>Coastal</option><option>Approach</option><option>Harbour</option><option>Berthing</option></select>';
   Usagevals={1:"Overview",2:"General",3:"Coastal",4:"Approach",5:"Harbour",6:"Berthing"};

  return div;
};
selector.addTo(map);

I wonder if anyone could help me solving the chart's overlapping issue.


texts: Measuring loading times in QGIS using PyQGIS?

texts:
Is it possible to measure when QGIS starts and stops loading/rendering a layer?

I used something similar in OpenLayers before (loadstart and loadend event, http://dev.openlayers.org/examples/layerLoadMonitoring.html ) but haven't figured out yet how to do that in QGIS with pyQGIS.

I want to use it in order to measure which layers take long to load (geometry and attributes!).

I know that there is something that can be used outside of QGIS to benchmark loading times ( https://github.com/DMS-Aus/qgis2img ) but

a: the loading times of layers in QGIS were way longer than the values measured by the tool. I guess that tool doesn't read the attributes.

and

b: I would like to measure the loading times inside QGIS

I think that that there has to be something that already listenes to something like a loadstart and loadend signal as in the statusbar there is an indicator that is shown until the layer is loaded completely:


texts: Read and write kml file using ogr in python

texts:
My goal is to iterate over features in a given KML file and save each feature as a seperate KML file. I'm using python and it seems that ogr module can do it but I can't figure out how.
I am able to read a KML file into <class 'osgeo.ogr.DataSource'>  and <class 'osgeo.ogr.Layer'> simply using:

import ogr

fn = r'C:\Users\kml folder\terre.kml'
driver = ogr.GetDriverByName('KML')
dataSource = driver.Open(fn, 0)
layer = dataSource.GetLayer()

I am also able to iterate over the features in the layer but from here on I can't seem to find the right way to save each feature as a separate KML.


texts: Retrieving tool input with arcpy.GetParameterAsText(0) returns nulls in Python Toolbox

texts:
I have created a python toolbox arcgiscontroller.pyt:

class Toolbox(object):
def __init__(self):
    self.label = "ArcGisController"
    self.alias = ""
    self.tools = [AddUpdateFeatureClasses]

class AddUpdateFeatureClasses(object):
def __init__(self):
    self.label = "AddUpdateFeatureClasses"
    self.description = ""
    self.canRunInBackground = True

def getParameterInfo(self):
    param0 = arcpy.Parameter(displayName="Input Json", name="inJson", datatype="GPString", parameterType="Required", direction="Input")
    param1 = arcpy.Parameter(displayName="Output Json",name="outJson",datatype="GPString",parameterType="Derived",direction="Output")
    params = [param0, param1]
    return params

def execute(self, parameters, messages):
  import os
  # This can be removed once the arcgiscontroller is installed into the python path
  import sys
  sys.path.insert(0, r"C:\mypythonpath")
  from {mycustompackages} import ArcGisController
  if __name__ == "__main__":
    ArcGisController.run()
  return

In the called code (in ArcGisController.run():), I try to get the input json like this:

class ArcGisController(object):
    def __init__(self):
        *initialization stuff*
    def processInput(input):
        *do stuff*

    @staticmethod
    def run():
        # get input parameters
        inJson = arcpy.GetParameterAsText(0)
        processInput(inJson)
        return result

but the arcpy.GetParameterAsText call returns ' '.

Does anyone know what I can do to be able to retrieve the input json in the called code? The ArcGisController.run() code works fine when I manually create a toolbox, so I'm guessing that part is fine and the problem lies within my python tool code.

My goal is to automate the publishing of this GP tool.


texts: How to set Symbology On Create Feature Window using arcobjects?

texts:
programmatically I set the custom symbology for the layers. When i started the edit session programmatically, the create feature window did not show the respective symbology assigned to feature. pl see this screenshot.

See the Code:

'lay' is ifeaturelayer
Dim pLayer As ILayer = lay
Dim pRender As IUniqueValueRenderer
pRender = New UniqueValueRenderer
pRender = TryCast(lay.Renderer, IUniqueValueRenderer)

Dim templateArray As IArray = New Array
subTypeField = pRender.Field(0).ToString

For pp As Integer = 0 To pRender.ValueCount - 1
  Dim newEditTemplate As IEditTemplate = editTemplateFact.Create(pRender.Label(pRender.Value(pp)), pLayer)
  templateArray.Add(newEditTemplate)
Next

pEditor.RemoveAllTemplatesInMap(pMap)
pEditor.AddTemplates(templateArray)

Dim layerExtensions As ILayerExtensions
Dim editTemplateMgr As IEditTemplateManager = Nothing
layerExtensions = pLayer

For j As Integer = 0 To layerExtensions.ExtensionCount - 1
  Dim extension As Object = layerExtensions.Extension(j)
  If TypeOf extension Is IEditTemplateManager Then
    editTemplateMgr = extension
    Exit For
  End If
Next

If Not editTemplateMgr Is Nothing Then
  Dim pEditTemplate As IEditTemplate
  For pp As Integer = 0 To pRender.ValueCount - 1
    pEditTemplate = editTemplateMgr.EditTemplate(pp)
    pEditTemplate.SetDefaultValue(subTypeField, pRender.Label(pRender.Value(pp)).ToString, True)
  Next
End If


texts: Populate X and Y fields in SDE Point Data Using SQL trigger

texts: Here is my situation. I am running ESRI ArcGIS Server and Desktop 10.2 on SQL Server 2008 R2. I would like to populate the Latitude and Longitude fields from point data (Signs data collected using ESRI Collector App) when saving. I have guessed as using a SQL server trigger on the table, but to no avail as the STPointfromtext SQL code does not appear to derive the X and Y data from the geolocation of the point being created. So since the x and y data will not currently exist in the field and I am wanting it to populate it when a save occurs, does anyone have any thoughts on how this might be able to be accomplished? Would the SQL code listed actually work if formatted correctly? If this would not work, how would you go about getting this field populated without manually doing it each time?


texts:
We just installed Service Pack 5 to our ArcMap 10 software. This allowed us to build a composite address locator based on the new streetfile and address pointfile built by our area 911 authority.

The new locator works very well, but when I am manually rematching a recently geocoded file and try to use the "Pick Address From Map" tool, the record shows as matched in the table, the XY data is added, but there is no point on the map.

I geocoded the same data set with both our old and the new locator, then tried using the "Pick Address From Map" tool on each of the resulting shapefiles. I attempted to place the same unmatched record in each instance.  If I use our old locator to do the original geocoding the tool works just fine, which indicates that this is a locator-specific problem.

Again, in the shapefile resulting from our old locator the tool worked perfectly; in the shapefile resulting from the new locator the tool didn't work at all. I can't figure out why.

Does anyone have any suggestions as to why the tool would not work, or any idea how to repair it?


texts: How to add raster value with specific equation?

texts:
I am trying to develop a raster layer with the interference of streetlight in this example:

As you can see there are multiple buffer rings around a point layer. I actually want to transform this buffer into raster data that behaves like an inverse square law. the border of the buffer is when the luminosity equals the background light, this constant is given. for example 0.0708 lux.

The raster data in the buffer should behave like: L = L_0/d^2. L is the luminosity of a certain location, L_0 is the luminosity of point source and d is the distance in meters from the point source. Therefore, if the point source is 100 lux, then if you would create cellsize of 1 by 1 meter, 3 cellsizes away the cell value will be: 100/3^2 = 11.11 lux. then the end of the raster data, namely the border of the buffer should have the cell value of 0.0708 lux, the background light lux.

But that is not all, because there are buffers that overlap each other. I actually want to sum up these overlapping values with each other. Let's say the cell value 11.11 overlaps with the other buffer raster of value 20. than this cell value should become 31.11 lux. This value however should continue to behave like the inverse square law. This means that buffers overlapping will not be two identical perfect circles but are distorted since the intersection point would have a bigger distance before the luminosity of the cell equals the background light.

I am working in ArcGIS in ArcMap. I do not have the skill to use a python script for this unfortunately. I hope someone could help me with this problem.


texts:
I want to convert WGS_1984_UTM_ZONE_33N to EUREF89 NTM, which is official geodetic datum in Norway. I have not found EUREF89 NTM in ArcMap, but  I believe the European Terrestrial Reference System 1989 (ETRS89) is on the same datum.
So converting to (ETRS89) will be same thing?
I have done it already, but not sure if the coordinates in meters are correct?
How do I confirm it?


texts: QGIS 3.4, plugin builder, refresh layers

texts:
I created a very simple plugin with the plugin builder for GIS 3.4. Wihtout any GUI-Widget - by clicking the plugin  button I just want to save the edits from several layers at one time and start the edit mode again. That works fine. But in the end I want to refresh the map (what I can do by clicking seperatly the refresh button, but I would like to have this function in my plugin). I tried it like this (but the last row is not working):

def run(self):
    """Run method that performs all the real work"""
    layer_edit = [ 'neuer Baumpunkt', 'baeume_akt','kontrolle','schaeden_akt','massnahmen_akt']
    price = 6.0
    for layers in QgsProject.instance().mapLayers().values():
        if layers.name() in layer_edit:
            layers.commitChanges()
            layers.startEditing()
            layers.refresh()

But there is an AttributeError:'QgsVectorLayer' object has no attribute 'refresh' The same is with refreshAllLayers().
I'm only started working with python, so I'm a very beginner.

I tried what  Germán Carrillo suggested like this:

def run(self):
    """Run method that performs all the real work"""
    layer_edit = [ 'neuer Baumpunkt', 'baeume_akt','kontrolle','schaeden_akt','massnahmen_akt']
    price = 6.0
    for layers in QgsProject.instance().mapLayers().values():
        if layers.name() in layer_edit:
            layers.commitChanges()
            layers.startEditing()
    self.iface.mapCanvas().refresh()

But it doesn't work.

The beginning of my skript looks like this:

from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction
from qgis.core import QgsProject
# Initialize Qt resources from file resources.py
from .resources import *
# Import the code for the dialog
from .bk_save_dialog import BK_speichernDialog
import os.path

class BK_speichern:
"""QGIS Plugin Implementation."""

   def __init__(self, iface):
       """Constructor.

       :param iface: An interface instance that will be passed to this class
           which provides the hook by which you can manipulate the QGIS
           application at run time.
       :type iface: QgsInterface
       """
       # Save reference to the QGIS interface
       self.iface = iface
       # initialize plugin directory
       self.plugin_dir = os.path.dirname(__file__)
       # initialize locale
       locale = QSettings().value('locale/userLocale')[0:2]
       locale_path = os.path.join(
           self.plugin_dir,
           'i18n',
           'BK_speichern_{}.qm'.format(locale))

       if os.path.exists(locale_path):
           self.translator = QTranslator()
           self.translator.load(locale_path)
           QCoreApplication.installTranslator(self.translator)

       # Declare instance attributes
       self.actions = []
       self.menu = self.tr(u'&Baumkontrolle speichern')

       # Check if plugin was started the first time in current QGIS session
       # Must be set in initGui() to survive plugin reloads
       self.first_start = None


texts: Void fill is subsuming separate lakes into one

texts:
I would like to find the watersheds of several lakes that are very close.
When I use fill, a couple of the lakes fill into one.
Its important that these are separate watersheds. Many soil and snail samples were taken from each lake and were analyzed by a geologist/chemist. We would prefer not to lose this data.
Any suggestions on how to fix this fill issue and get the watershed for close lakes?
Here is the issue, I circle around the subsumed lakes my cursor:


texts: Creating random points in vectorized raster in ArcGIS for Desktop?

texts:
Im conducting an accraucy assessment of an NLCD map.  First, I wanted to create a few points in each land cover category in Arc, convert it to kml format, then pull it into Google Earth to make sure the land covers will be distinguishable.

Since the NLCD is a raster, I converted each individual land cover into a seperate vector.  However, when I use the Create Random Points tool under Data Management, the result is a ton of points covering the vectorized raster (even though I only specified 5).  What gives?

Is this because there are multiple polygons that were created within each vectorized raster layer?


texts: Is it possible to publish a geoprocessing services that uses a custom gptool on ArcGIS Server 10?

texts:
I have developed a custom GP tool in C# which does a bunch of processing on a given layer.

It works great in ArcMap on all machines that I have deployed it to. I created a model which uses this tool and want to publish it as a geoprocessing services. It worked without any problems on our testing machine (This was probably because the testing machine has Arcgis Desktop, as well as Server, & I published the service using the ArcCatalog on that machine itself).

Today I had to deploy it to our production server. This does not have ArcGIS Desktop. So I registered the DLL using ESRIRegasm on the server. But No matter what I do, I can't get a Geoprocessing service running using the custom tool. I tried placing the toolbox on the server and publishing it. It did get published, but when I conusmed it from ArcMAp, I got the error "ERROR 000816: The tool is not valid".

Over on ESRI forums, there have been just a few threads about this issue; And the only one which was marked as resolved, talked of registering the dll using the /codebase switch. (this was with ArcGIS 9.3.1)

Has anyone succesfully deployed a custom geoprocessing tool to a server, with ArcGIS server but not ArcGIS desktop?


texts: Getting error 000539 when calculating TWI?

texts:
I'm trying to calculate the twi from my area using LN((flowaccu+1)*900/Tan(sloperadian). My first result was wrong because my area is an endhoreic basin. So I made a flow accumulation raster based on a DEM where the collecting lake was cut out. This flow direction raster was true but the raster calculator refuses to do the last step. I refilled the lake in the flowaccu raster with the a slightly higer value than the original flowaccu raster (thus 40 000 000) so that there are no holes (NO more NoData values) and both the sloperadian raster and flowaccu raster are in the same projected coordinate system (WGS84 mercator auxilary sphere).I'm working in ArcMap 10.2 and also tried on 10.4 but the error message stays the same.
Ln((Raster(r"conflowacproj")+1*900/Tan(Raster(r"sloperadian")))

ERROR 000539: Error runing expression: rcexec()
Traceback (post recent call last)


texts:
I have a PostGIS dataset with around 3 million shapes. I only need to view about 1,500 of these shapes at any given time, but the shapes I need to see depends on which feature is selected in a different dataset.

My question is: what is the speed difference between filtering my large dataset within PostGIS and then serving it up to QGIS, vs loading the entire dataset into QGIS and then using the baked-in layer filtering? I'm running PostGIS 2 and QGIS 1.8.

I assume PostGIS is faster, but how much faster? I'd like a second opinion before I spend my time coding for one solution over the other. Thanks!


texts: Simplify the straight sections of (multi)Linestring in PostgreSQL/PostGIS leaving the curved sections untouched

texts:
I have (multi)linestrings containing upwards of 5000 points and I want to perform two simplifications possibly using Ramer Douglas Peucker or alternative methods in PostGIS. The (multi)linestrings consist of straight lines, 90 degree curves, 180 degree curves and loops (circles).

I understand that ST_simplify may remove the loops and possibly some of the bends depending on the tolerance set. I need to have a zoomed out version which can probably be done satisfactorily done with ST_simplify. However, on the zoomed in version, it is important to keep the loops, and curve points.

I would like to remove all the points from the straight segments (within a tolerance) which constitute 90% of the (multi)linestring and keep the points on the curve section.

How can I achieve this in PostGIS?


texts:
I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing.  To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal.  However, I would also like to create geoprocessing scripts outside of the ESRI Arcpy domain.  For example, if I want to clip a raster to a polygon, I would start with the following script from ESRI:

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster = "elevation"
inMaskData = "mask.shp"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute ExtractByMask
outExtractByMask = ExtractByMask(inRaster, inMaskData)

# Save the output
outExtractByMask.save("C:/sapyexamples/output/extractmask")

I'm not sure how I would accomplish the same task programmatically without Arcpy.  My questions for the serious programmers out there:  What collection of python tools do you use to accomplish tasks that ESRI users would accomplish with the Arcpy site package?  Where do I begin?


texts: How to make custom map layers on top of OSM base map?

texts:
I'm developing a mobile app in which I need to show a map with custom layers on top of that( some plants area, some rivers highlighted ).

Currently I'm scratching my head trying to figure out how the GIS tools work together.

What I want is something similar to what google map provides, it provides a way to create some simple custom layers(marks, polygon, lines) on top of google map, and those custom layers can be displayed on top of google map.

But due to China's GFW, google map service is not generally available to everyone. So I turn to other solutions, then I found OSM(openstreetmap), together with a bunch of other stuff: leaflet, tile provider, mapnkit, openlayers, mapbox ...

It just confuses me, what is the tool that I can use to create my custom map layers. And how should I put them together to show a base map with my custom layers in a mobile web app?


texts:
I am trying to do zonal stat in PostGIS with the following command.

SELECT
    (ST_SummaryStats(ST_Clip(agri_final_proj.rast, district.geom, TRUE))).*,
    district.district_1 AS district_1,
    district.geom AS geom
INTO
    regions_with_elevation
FROM
    agri_final_proj, district;

Here agri_final_proj is my raster and district is my vector file.
But when running the query I am facing this issue:

"ERROR:  lwgeom_intersection: GEOS Error: TopologyException: Input geom 1 is invalid: Ring Self-intersection at or near point 458031.90649999958 4166648.6541000009 at 458031.90649999958 4166648.6541000009"


texts: Creating Openlayers OverviewMap control with vector layer data display

texts:
I am creating an OverviewMap control in the map and want to see the content of a Vector layer in the overview map too.

        var mapOverviewOptions = {
            mapOptions: {
                projection: new OpenLayers.Projection("EPSG:900913"),
                displayProjection: new OpenLayers.Projection("EPSG:4326"),
            },
            layers: [baseOverviewLayer, myVectorLayer]

        };
        var ovMap = new OpenLayers.Control.OverviewMap(mapOverviewOptions);

This does not work. It only displays the world map background and does not display the vector data that gets rendered on the map.

Is it possible to display the vector layer data in the overview map?

I tried adding the vector layer to the map object that Overview Control creates,

ovMap.ovmap.addLayer(myVectorLayer)

but that does not help either.


texts:
I would like to use a geoprocess using the esri js api from inside a web worker, can this be achieved?

I didn't manage to pass the geoprocessor to the web worker because it seems that  you can't pass an object with methods to a web worker and i'm not managing to load the module in the web worker because the basic esri api need window to be defined.


texts: Leaflet pop-up does not work with Geojson data

texts:
I have a geojson file(Polygons).I want to display it on a leaflet map and when user clicks on a polygon, a popup with an information should be visible. The information is 'type'.  I am able to see the layer but no pop up window  appears when i click on any polygon.  here is the geojson sample:

{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
    }
  },
  "features": [{
    "type": "Feature",
    "properties": {
      "osm_id": "32741378",
      "name": "Azam Television",
      "type": "industrial"
    },
    "geometry": {
      "type": "Polygon",
      "coordinates": [
        [
          [39.2463013, -6.8431187],
          [39.2470392, -6.8427426],
          [39.2471654, -6.8429866],
          [39.2464274, -6.8433627],
          [39.2463013, -6.8431187]
        ]
      ]
    }
  }]
}

HTML code:

<!DOCTYPE html>

<meta charset="ISO-8859-1">
<title>leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />

PS: i am viewing in FireFox.


texts: Batch Script to merge tab fles in a directory

texts:
Very similar to this question Merging multiple .tab files? can someone please help me with a batch script for this?

Based on the answer in the above I have

#!/bin/bash
for i in *.tab;
do
ogr2ogr -update -append merge.tab i  -f “MapInfo File” -nln merge
done

but when I run it it fails with

FAILURE:
Unable to open datasource `i' with the following drivers.

and then lists the drivers


texts: Using Live GPS in QGIS - Speed and quality is not shown

texts:
I am using QGIS 3.10 together with a ArdusimpleRTK2B Board based on U-Blox ZED F9P processor and a Windows 10 based tablet computer.

Using a SAPOS correction service and having connected it via gpsd the board provides cm-precission NMEA Strings $GNGGA and $GNRMC.
The position of the cursor in the map exactly shows the position of the antenna.

But I wonder, why QGIS does not show values for speed, direction, quality,... in the GPS-Information Box?
What kind of NMEA-data does QGIS expect to show those properly?