texts: Moving field from source feature to new feature

texts:
I am attempting to build a layer of perpendicular line segments from a point on a line to a line, but in the process, I would like to bring over the field data from the point layer.

I have a field in p_lyr called Miles. I would like to move that field value to the new layer, in a newly -created field in the new layer.

This is the script I have used so far:

from qgis.core import QgsProject

mapcanvas = iface.mapCanvas()

layers = mapcanvas.layers()

p_lyr = layers[0]
l_lyr = layers[1]

epsg = p_lyr.crs().postgisSrid()
uri = "LineString?crs=epsg:" + str(epsg) + "&field=id:integer""&field=distances:double(20,2)&index=yes"
dist = QgsVectorLayer(uri, 'PerpLine', 'memory')
QgsProject.instance().addMapLayer(dist)

prov = dist.dataProvider()

prov.addAttributes(p_lyr.fields())

lines_features = [line_feature for line_feature in l_lyr.getFeatures()]
points_features = [point_feature for point_feature in p_lyr.getFeatures()]

feats = []

for p in points_features:

    minDistPoint = min([l.geometry().closestSegmentWithContext( p.geometry().asPoint() ) for l in lines_features])[1]
    feat = QgsFeature()
    feat.setGeometry(QgsGeometry.fromPolylineXY([p.geometry().asPoint(), minDistPoint]))
    feat.setAttributes([points_features.index(p),feat.geometry().length()])
    feats.append(feat)

prov.addFeatures(feats)

This comes from a script listed here: Automated creation of perpendicular lines between a point layer and a line layer

I am using QGIS 3.12.


texts: Displaying black background pixels in RGB raster as transparent (QGIS)

texts:
I have the following RGB raster and would like to remove the black background (where R=0, G=0, B=0). I'm using QGIS.

The problem is that the raster itself also contains black pixels. Using the option of QGIS to make all RGB(0,0,0) pixels transparent is therefore not an option, since it will make some of the lines transparent as well. Are there any other options?


texts: Unable to test pgr_dijkstra algorithm in pgRouting 2.1.0

texts:
I am using PostgeSQL 9.5 and pgRouting 2.1.0. I am trying to test pgRouting tool in my postgres DB by following this tutorial pgRouting 2.0 for Quick Windows Guide. Although the tutorial assumes road transport network data of Vienna in GEOJSON format but due to unavailability of data at mentioned link, I used my own data and converted the ESRI shapefile (16,060 rows) to GEOJSON using QGIS. Then, I used QGIS DB Manager to import street.geojson file to my postgres "routing" DB. As per tutorial, I used following commands to add "source" and "target" columns as well as to create topology.

alter table public.street add column source integer;
alter table public.street add column target integer;
select pgr_createTopology('public.street', 0.0001, 'geom', 'id');

However, when I used following set of commands to test pgr_dijkstra algorithm:

SELECT seq, id1 AS node, id2 AS edge, cost, geom
FROM pgr_dijkstra(
  'SELECT id, source, target, st_length(geom) as cost FROM public.street',
  1, 3000, false, false
  ) as di
JOIN public.street pt
ON di.id2 = pt.id;

the query runs successfully but I am not getting any output.

Can anyone help me to understand what's wrong with my processing?

EDIT:

After running the query to identify the records, the results are as under:


texts: Creating updated field in ArcGIS for desktop?

texts:
This is my attribute table:

the field "hight" is short type.

the field "text" is string type.

I try to find how can i connect between those two field with python phrase (i know how to do it with python phrase) but whats importent to me is that if i change the field "hight", then the new field will update automaticlly.

I red Automatically updating column in feature class when another column is changed? but this isn't what i seek because it clumsy and long solution. I need a simple python\ Vb phrase to implement in the Field Calculator of the layer.


texts: Making a Map with a Legend as a .pdf Without a White Background

texts:
I have a shapefile of United States counties.  I also have an Excel file of the share of the black population in each county.  I'd like to make a map of this using GIS.  (Before you say that there are ways to do this outside of GIS, yes I realize that, but I would like to do this in GIS, so please let us not go there.)

I am not at all sure how to go about this.

Starting backwards:
First, I have my shapefile loaded.  I know I can save the shapefile as say a .jpg or .pdf under File -> Export Map and then change the Save as Type of .jpg or .pdf.  However, when I do so, I get some white in the background from GIS.  Is there a way to do this without getting the whtie in the background?

Second, how would I include a legend in the map?

Third, is there a way I can indicate different shades of one color to mean different things?  Like a dark blue is more than 2/3 black, light blue is between 1/3 and 2/3 and white is less than 1/3?

Fourth, how do I merge the data on the black population in?  I suppose worst case, I can type it in manually by hand.  But preferably I wouldn't have to.  Is there a way to rearrange the Excel file so that I can merge it in?  Like can I merge it in using the fips codes if both files have that?

I use ArcMap in ArcGIS 10.1.

I very much appreciate any help!


texts: How to create QLables along with QlineEdit dynamically in dialog window using PyQGIS

texts:
I am developing a plugin which allows the user to edit the features attribute information. I have a combo box from which user can select the layer name for which attributes are to be edited. I need to add field names of layer selected in combo box as labels along with empty line edit boxes. How this can be done?

layers = self.iface.legendInterface().layers()
    layer_list = []
    for layer in layers:
        layer_list.append(layer.name())
    self.dlg.comboBox.addItems(layer_list)
    selectedLayerIndex = self.dlg.comboBox.currentIndex()
    selectedLayer = layers[selectedLayerIndex]
    fields = selectedLayer.pendingFields()
    fieldnames = [field.name() for field in fields]

Something like this


texts: Removing FID as an option from ArcGIS Tool Validation Parameters

texts:
I am currently building a script tool which requires the user to select a sorting field from a list (built using a dependency on the featureclass). This Element is working fine, but I would like to remove the FID field as an option using the ToolValidator script

I already have an element of this validation working, which enables a sub field if the sorting field is chosen and builds a filter list

    def updateParameters(self):

        if self.params[1].value is not None:
          self.params[2].enabled = 1
        else:
          self.params[2].enabled = 0
          self.params[2].filter.list = ['Ascending', 'Descending']

However I can't seem to use updateParameters() to remove the FID field from the derived list of selectable fields

        return


texts: How to get the path of working folder instead of plugin installation folder?

texts:
So I am currently working on a onedrive folder for a plugin but all the paths I can return point to the plugin installation instead. For most of what I am doing it doesn't really matter and everything works fine, but I'm trying to write in My_log.txt and I want that file to be in the onedrive dir, not in the plugin dir.
I have tried many methods and I can't seem to find exactly what I need:

os.path.dirname(__file__)

returns the plugin path

resolve(), absolute()

do not return the path I want

I have also tried to create a mklink /J to create a hard link, except I need to point on a new folder and mine already exists. I have tried simply copying the missing files from the onedrive directory to the plugin directory to see if it would work and when i tried to deploy it didn't work:

So basically he deleted everything and tried afterwards to update with the newer files but since I was directly in the folder he deleted everything and couldn't find anything afterwards.

All I want is the path to the directory where I'm working rather than the plugin path so I can just write or if not created create then write in the file and nothing seems to work. Also, before anyone asks, my vector layers that I'm loading with the plugin will not be in the same directory and same goes for my output file, so I cannot get link from the layer.

Thank you!

EDIT: I want to be able to get this directory:

Instead of this directory:
C:\Users\Phil\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins


texts: data.frame and get_elev_points. Error in locations$elevation[idx_s[i]:idx_e[i]] <- unlist(resp$height) : replacement has length zero

texts:
I am trying to use the function get_elevation_points in a data frame, but keep getting the same error:

 > #get the API key : et an API Key from https://mapzen.com/developers. Since elevatr will search the environment for the appropriate key,

 > #it is suggested that you store this in your .Renviron file. To do this:
    >
    > require(sf)
      require(sp)
    >
    > cat("mapzen_key=mapzen-XXXXXXX\n", file =
    > file.path(normalizePath("~/"), ".Renviron"),
    >     append = TRUE) mydata <- st_as_sf(x = Coordinates_alt,
    >                         coords = c("Longitude", "Latitude"),
    >                         crs = "+proj=longlat +datum=WGS84")

    >

> coordinates(Coordinates_alt) <- cbind(Coordinates_alt$Longitude ,
> Coordinates_alt$Latitude) proj4string(Coordinates_alt) =
> CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")
>
> require(elevatr)
>
> prj_dd <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
>
> mydata1 <- SpatialPointsDataFrame(df, proj4string = CRS(prj_dd), data
> = df)
>
> head(mydata1)

    df_elev <- get_elev_point(mydata1, prj = prj_dd, src = "mapzen") df_elev <- get_elev_point(df, prj = prj_dd, src = "mapzen") Error in
    locations$elevation[idx_s[i]:idx_e[i]] <- unlist(resp$height) :
    replacement has length zero In addition: Warning message: src 'mapzen'
    is deprecated and will cease to function after 2018-01-31 due to
    shutdown of Mapzen; Use 'epqs' instead for US locations. Still
    searching for a global elevation service replacement.


texts:
I want to save number of vertices of every object from my line vector layer in attribute table. The code I have was able to:

Save in table correct number of vertices for layer with only Polylines.
Save in table correct number of vertices for layer with only MultiPolylines.

But it was useless when on the layer there were both MultiPolylines and Polylines (it was counting correct number of vertices (both for multi and poly) but it didn't add everything in proper order to table)

I wrote 'it was able' because suddenly (I changed nothing) error occurred:

line 12, in <module>
suma= sum (int (i) for i in  vertsMulti)
TypeError: 'int' object is not callable

and now it doesn't work for MultiPolylines. (Still works for Polylines)

So, my questions are:

Why the error occur, and how to handle it?

How to make the code adding to table number of vertices when there are both MultiPolylines and Polylines on the layer.

The code is:

from PyQt4.QtCore import *
layer = qgis.utils.iface.activeLayer()
feat = layer.getFeatures()
provider = layer.dataProvider()

a = []
b = []
for feature in feat:
    if feature.geometry().isMultipart():
       vertices = feature.geometry().asMultiPolyline()
       vertsMulti = [len(v) for v in vertices]
       suma = sum (int (i) for i in vertsMulti) # should sum number of vertices of every segment of MultiPolyline but ERROR happens
       a.append(suma)
    else:
       vertices = feature.geometry().asPolyline()
       n = len(vertices)
       b.append(n)

ab = b+a
field = QgsField("vert", QVariant.Int)
provider.addAttributes([field])
layer.updateFields()
idx = layer.fieldNameIndex('vert')

for vert in ab:
    new_values = {idx : int(vert)}
    provider.changeAttributeValues({ab.index(vert):new_values})
    print new_values

layer.updateFeature(feature)


texts: Creating a Geodesic Polyline Buffer in OpenLayers

texts:
I have a feeling that the answer is going to be 'You can't do that without some very complex coding' but I thought I'd go for it anyway.

I recently asked Creating Polyline Buffer in OpenLayers 2?, and it worked! Well, almost. In our mapping application Dorset Explorer we have a line measurement tool which works using Geodesic measurements. It had to be like this as non-geodesic resulted in massive errors (I measured it against the 100m running track at my old school and it returned 125m, which I know was wrong!). But simply setting geodesic to True in my OpenLayers measure code fixed this.

I now want to create polyline buffers of a user specified size in my OL Map. I have managed to get it to make a buffer using the answer to my first question, but the size is wrong. In the attached image I requested a 100m buffer around a polyline going from left to right (which is not visible). I then measured the size of the returned buffer (in red) and came up with the result 125 metres.

Not good. I wonder if anyone else out there has attempted to make Geodesic polyline buffers. Even a calculation that would allow the user to put in a 'Geodesic' length and return a 'non-geodesic' length for the buffering tool to use, but I can imagine that this is near impossible. It's driving me slightly nuts, it's so close to working but this rather major issue has stopped it. If you want any more info to help answer or point me in the right direction please let me know.


texts: Spatial Engine Connection Failed error with ArcGIS

texts:
I have a database on PostgreSQL 9.5 when I try to connect to the database in ArcGIS desktop I get this message in log:

  CAN'T OPEN INSTANCE: sde:postgresql. Spatial Engine Connection Failed
  (-51)

After that I have an error:

  ev.SQLstate = 42501 SDE DBMS Error: -25  ERROR:  must be owner of
  database base ev.SQLstate = 42P01 SDE DBMS Error: -37  ERROR:
  relation "sde.sde_layers" does not exist LINE 1: select count(*) from
  sde.sde_layers

  File pg_hba.conf changed and users have CONNECT privileges.

What is the problem?

I'm following Esri instruction.


texts: Difference between scale and grid in QGIS?

texts:
I am new in QGIS, and I can't quite figure out how grid and scale work. Should my "Project CRS" and my "Grid CRS" be the same or not?

I played around with settings and after some time and managed to get what I think is correct grid (based on some comparison on existing maps). But still, I'm not sure how to set it up on other maps I plan to make and Google isn't helping.

My problem is - my scale is now off. For example, I know that distance from Zagreb to Sisak is around 50km, and based on my map it says around 70/80. Some other examples are even more extreme. What is the problem? Why is my scale now working?

I georeferenced my image perfectly - it matches with the OpenStreetMap layer beneath perfectly - but my scale is still off. Projection is World Mercator.


texts: Plotting elevation maps from latitude, longitude, and elevation


texts:
Using QGIS 2.4 python console, I'm trying to display only a subset of a layer features.
I've managed to get the features both from the layer :

featuresIterator = layer.getFeatures(QgsFeatureRequest().setFilterExpression ( u'"field"=4'))

and from the dataProvider :

featuresIterator = layer.dataProvider().getFeatures(QgsFeatureRequest().setFilterExpression ( u'"field"=4'))

(I'm not sure to understand the difference).

What I want to achieve now is to display only these features. In the exact same way as one would do using the query builder from the GUI. I don't know whether this has to be managed at the level of render (which would render some features and not others), or at the level of the data provider (which would only provide the layer with a view on the data containing only the wanted subset), or somewhere in between.


texts:
I have two different colored CircleMarkers for two geojson layer. Is it possible to add a letter into those circles, without using divIcon?

This is where I give them the color.

function getColor(iconcategory) {
        return iconcategory == 'tram' ? 'black' :
            iconcategory == 'ubahn' ? 'purple' :
                'red';
    }

This is the popup.

        function forEachFeature(feature, layer) {

        var popupContent = "<b>" +
            feature.properties.name + "</b>" ;

        if (feature.properties && feature.properties.popupContent) {
            popupContent += feature.properties.popupContent;
        }
        layer.bindPopup(popupContent);
    };

This is the rest.

onEachFeature: forEachFeature,
                    pointToLayer: function (feature, latlng) {
                        return L.circleMarker(latlng, {
                            radius: 10,
                            opacity: .9,
                            color: getColor(feature.properties.iconcategory),
                            fillColor: getColor(feature.properties.iconcategory),
                            fillOpacity: 0.3,
                        //  html: feature.properties.iconcategory[0].toUpperCase(),
                        })
                            .bindTooltip(feature.properties.name);

The html tag from the divIcon isn't working. Is there any chance that I don't have to use the divIcon
And... is there any possibility to add a second circle to the circle or do I have to do this with a divIcon as well? I use the circlemarker, because it's easy and doesn't require a lot of code.


texts: Why is the Button code on the ArcGIS.com sample viewers so complicated?

texts:
I'm trying to modify one of the ArcGIS.com sample maps to add my own buttons, and I'm surprised at how complicated the HTML page is.

Here is the code for the simple "Details" button at the top left of the header:

        ?
        Details

<input type="button" dojoattachpoint="valueNode" tabindex="-1" class="dijitOffScreen" value="">

The image itself is specified in the CSS.

Is all that code really necessary, and is there an easier way to add a button (with tooltip) to the interface of an ArcGIS Server JavaScript API map?

I noted that the Toolbar sample doesn't show tooltips, hence my investigation of the ArcGIS.com samples.


texts: Intersecting FeatureCollections in turf.js?

texts:
I've been playing around with turf.js and I'd like to use turf.intersect to intersect two datasets. My raw data are two polygon shape files so I converted them to geojson. I then tried to use turf.intersect on the two geojson files but it fails as the geojson contain FeatureCollections while turf.intersect expects Polygons.

Is there a workaround to this?

Right now, I'm thinking of iterate over the polygons in the first geojson file one by one and then checking if it intersects with any of the polygons of the second geojson. I'd then just combine the results into another geojson file.

Is there a faster way?


texts: Is it possible to run a spatial query in QGIS 2.0 across multiple layers using a user-specified radius from a point?

texts:
I would like to be able to click on a point on a map to select all vector features (from multiple layers) within a specified radius of the point. Can anyone point me in the direction of how to do this please?

The Spatial Query plugin selects only features from 1 layer at a time, and the search radius is only attainable by creating a point, then creating a buffer polygon and using the buffer polygon as a reference feature. Therefore I would have to run this plugin for each layer I'd like to select from. I'm hoping there might be a more simple/less time consuming method.

Ideally I would like to be able to run this spatial query from shapefiles displayed in the QGIS 2.0 GUI, but if it's not possible, the shapefiles are eventually being exported to a PostgreSQL database, so some advice on how to run this type of spatial query from a PostgreSQL database would be really useful also, as I have very limited experience in using them.

Thanks.


texts: I've imported some values attached to x y coordinates and am trying to display them as charts. All has gone well apart from the values displayed on the charts won't appear in the legend. I've exported the x y feature class I created into a new shapefile but no luck.


texts:
I have a point layer and i need to connect all the points(4046) with each other. I tried it through python console from Arcgis but it gives me run time error.
Here is my code :

    import arcpy
cursor = arcpy.da.SearchCursor("vertex_final",['POINT_X','POINT_Y'])
outlines= r"C:\Users\stelitsa\Desktop\descriptive_data"
i = 0
while (i<4064):
 X1=row[i]
 Y1=row[i+1]
 print  X1, Y1
   for row in cursor:
    X2=row[0]
    Y2= row[1]
    if X1!=X2:
      arcpy.XYToLine_management(cursor,outlines,X1,Y1,X2,Y2,"GEODESIC","id")

And here is the error :

Runtime error
Traceback (most recent call last):
  File "", line 13, in
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 3063, in XYToLine
    raise e
RuntimeError: Object: Error in executing tool

This is the first time that I have used Python.


texts: Is getting wrong attribute values from a feature in qgis

texts:
I make two polylines features(in my example both consists of two points) with the add feature tool. Then I (with code) add some attribute values on the first feature, then changes the geometry of the second feature before I add values to the second values.

When I use layer.featureAtId() to get the second feature and then reads it, I get the values from the first feature.

I don't get this problem if I don't  change the geometry or if I commit the two new polylines before doing the mentioned operations.

In the attribute table it is correct. If I use layer.nextFeature(feat) to iterate through all the features I get the right value.

# creates two features with the add feature tool
layer = qgis.utils.iface.activeLayer()

#select the first feature with the select tool
featId1 = layer.selectedFeaturesIds()[0]

# add values  to the first feature
for i in range(5):
    layer.changeAttributeValue(featId1, i, (i*10))

#select the second feature with the select tool
featId2 = layer.selectedFeaturesIds()[0]

# changes the geometry of the second feature
newGeom = QgsGeometry.fromPolyline([QgsPoint(1,1), QgsPoint(2,2)])
layer.changeGeometry(featId2, newGeom)
qgis.utils.iface.mapCanvas().refresh ()

# add values  to the second feature
for i in range(5):
    layer.changeAttributeValue(featId2, i, (i*10 + 1000))

# get the second feature by using featureAtId...
feat = QgsFeature()
layer.featureAtId(featId2, feat, True, True)

# print values from the second feature
for i in range(5):
    print feat[i].toString()

# for some reason the attributeValues to the first feature get printed out.
# in the attribute table it looks correct.
# feat.geometry().asPolyline() seems to return the right geometry
# if I save edits after creating the two new features it works as it should

I used QGIS version 1.8.0-Lisboa and QGIS version 1.9.0-Master


texts:
I'm trying to write a script that deletes the rasters that have no information at all. Some people told me to use the try/except, using the statistics as a factor to determine if the information exist or not. But when I run the script in my model, it says it's complete, but the image with no information is still there! What am I doing wrong?

This is the script:

import arcpy
from arcpy import env
arcpy.env.workspace = arcpy.GetParameterAsText(0)
rasters = arcpy.ListRasters("*", "TIF")
for raster in rasters:
    try:
        arcpy.GetRasterProperties_management (raster, "MINIMUM", "")
    except:
        arcpy.Delete_management(raster,"")


texts:
I have a little problem when create atlas with QGIS but I'm new and I have a step by step explanation.

I have a shapefile with 2 columns a and b:

a     b
1     abc
2     cde
3     abc
4     efg
5     abc

I need create atlas with only b attributes, without double values. Any suggestions?

The atlas must be have 3 pages.

With "abc", "cde" and "efg" not 5 pages one for line.

I send you 2 pictures, what I mean lose some polygons. The first is the original shape, the second is the dissolved shape. You can see there aren't some polygons. I don't understand why.


texts: How to modify a Marker object's icon after it's been drawn?

texts:
I'm displaying gps track data (e.g. points in time, like the path a vehicle covered) and I need to allow the user to "play back" the track, by having the markers change color one at a time in sequence.  So imagine a sequence of yellow markers and then during playback I change the first one to a red marker, then the next one, etc.

I've done a prototype using point features because it seemed easier at the time to implement this with Points because I could do the following (pseudo code):

p = getpointFromLayer();  // get the yellow point from the layer
p.style = myRedStyle; // change it's style
p.layer.drawFeature(p); // redraw the feature using the red style

Now I'd like to re-do this functionality using Markers because Markers seem to generally be more flexible for other functionality, but I don't know whether it's possible to somehow change a specific marker's appearance.  Any ideas?


texts: Is it possible to deploy multiple ArcGIS Server Instances from one Virtual Machine?

texts: I would like to deploy between 4 and 5 ArcGIS Server 10.2.1 instances with different licenses on one machine.  Can this be accomplished by pointing the server to different ports via the web adaptor or another method?  I would also have other 3rd party applications on this physical machine with 1-3 virtual machines.  The ideal configuration would be a RAID with 32 Gigs of RAM on one physical machine.


texts: Drawing line with lon, lat, distance and azimuth?

texts:
I have table in PostGIS with lon, lat, distance and azimuth columns.
I want to make Geoserver draw a line through first point with given length and direction. I can turn lon and lat to geometry in PostGIS with ST_MakePoint command.

Is it possible to draw line using only SLD with first point and attribute values or do I need to calculate second point manually and turn it to geometry too?


texts: Trying to use "Difference" tool gives out "'QgsWKBTypes' is not defined" error

texts:
I am trying to separate two overlapping vector layers and find out the difference in QGIS 2.18. I have tried finding difference with layers with points and also with buffers. Both of them give following error:

global name 'QgsWKBTypes' is not defined See log for more details

I have searched the web for this but can't seem to find a solution.


texts: Is there really random distribution of points?

texts:
I'm just wondering if there is really such a thing as "random" in geography?

To me it always seems like everything has a reason:

examples:

vegetation does not just randomly grow
whether and climate changes have reasons and patterns
population is far from random
crime and other activities are not random (e.g. on roads)

etc.


texts:
I compiled this request to a WMS:

http://www.geoportal.tazv-luckau.de/arcgis/services/TAZV_Luckau/TWL_Luckau/mapserver/wmsserver?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&LAYERS=TRINKWASSERLEITUNG&STYLES=&CRS=EPSG:25832&BBOX=(814982.1936043955,5748389.886124328,815982.1936043955,5749389.886124328)&FORMAT=image/tiff&WIDTH=1000&HEIGHT=1000

As you can see, the result is stretched along the y-axis. What am i doing wrong?


texts: How to edit several layers simultaneously?

texts:
I have the land occupation of an area and a layer for each year : 2005-2006-2007-2008...2010.

These are polygons.

There are errors on layers which are common to all of them. For instance, there's a house and a big garden, and the whole thing is considered as one entity on every layer.

I would like to cut the polygons one time (and not edit the four layers round by round) and later give the land occupation on the polygon. It's a little bit boring to repeat this operation.

I thought about topology but there are other differences that make this approach very complicated (that the normal evolution of landscape) I've heard about relationship classes but it wasn't clear and it seemed to me that you can only work on 2 layers simultaneously.

Software doesn't matter. I can work on ArcGIS suite but I would prefer to work on Open Source Software.


texts: Adding time dimension to layer in GeoServer

texts:
I have a GeoServer installation that is used as a proxy in front of a THREDDS Data Server to be able to add additional metadata to WMS layers (which I haven't found any support for in THREDDS).

I have configured a GeoServer WMS store and added the the WMS GetCapabilities URL to the THREDDS server to the new WMS store. I have then added a layer from the new WMS store to the list of layers from GeoServer.

So far so good. GeoServer can now act as a proxy for the layer in THREDDS.

The problem comes when I try to enable Dimensions for the new layer. I go into edit mode for the layer and then click the "Dimensions" tab. I then enable the "Time" dimension and try to select the correct "Attribute". However no attributes are found in the list and I am not allowed save the new configuration since "Attribute" is a required value.

Any clue to what I can do to solve this problem is greatly appreciated.

When not accessing the layers via GeoServer the time dimension works fine.


texts: Combining ArcGIS API for JavaScript external files for faster performance?

texts:
I have a jQuery mobile application which runs 'ok' but I am looking at trying to speed up performance.

I ran the 'Audit' tool against it in Chrome's Developer Tools and one of the recommendations is to combine external javascript files

Is this possible?


texts: Patchy country polygon after converting ESRI shapefile to KML

texts:
My goal is to render the country boundary of Scotland in KML format so I can use it with Google Fusion Tables. I’ve so far managed to do this but with chunks of its surrounding islands missing, so what am I doing wrong? How do I render the FULL boundary in KML without missing chunks of it?

I’ve tried using SHP2KML to convert the original shapefiles but I
keep getting a render of Guinea instead!?
I’ve also used QGIS which I really like, especially as I don’t have
to backdate my machine to use it unlike SHP2KML, but it produces the
result below.
And I’ve used the converter.mygeodata.eu website which also produced the below result.

How can I render the full boundary of Scotland, and why are there missing chunks when I try to do it?

I've uploaded the original shapefile here.

My patchy Scottish polygon (close-up):


texts: QGIS 2.8.1 Consult a space object and to lead me to a specific folder

texts:
Folders display in QGIS clicking on an item.

I need you to click on a space object redirect me to a desired folder.

  Mostrar Carpetas en QGIS al hacer clic sobre un elemento. Deseo que me
  ayuden ya que es de mucha importancia. Necesito que al hacer click
  sobre un objeto espacial me redireccione a una carpeta deseada.

In the picture above I can only link a file and other achievement to take me to him, but I want to redirect me to the containing folder and not to the file.
The action you tried is as follows: this action does not run as the achievement desire
And to clarify have done the command in tiny, I mean, in the action field have placed "= ** explorer [%" Route "%] **"

I relied on this information, but what I want is to open the folder where the image is located. Http://mappinggis.com/2015/04/mostrar-imagenes-en-qgis-al-hacer-clic-sobre-un-elemento/

  En la imagen anterior solo puedo ligar una archivo y sí logro que me
  lleve a él, pero deseo que me redirija a la carpeta contenedora y no
  al archivo.  La acción que he intentado es la siguiente:!esta acción
  no la logro ejecutar tal como deseo Y para aclarar ya he hecho el
  comando en minúscula, me refiero, en el campo acción he colocado
  «=explorer[% "Ruta" %]» Agradezco sus colaboraciones y si me
  pueden explicar desde cero o tipo tutorial sería mejor para tener
  claros los pasos

  Me basé en esta información, pero lo que deseo es que me abra la
  carpeta en donde se encuentra la imagen.
  http://mappinggis.com/2015/04/mostrar-imagenes-en-qgis-al-hacer-clic-sobre-un-elemento/


texts:
I'm trying the TSP function with pgrouting with just a few of the many nodes obtained with osm2pgrouting (I also have the edges, of course).
I'm not an expert but once I run the query, it works and gives me a seemingly correct result. The point is that I actually want to check this query with DB manager on QGIS but I don't know how to do it: If I don't add the geometries, I get stuck here.
If I didn't get it wrong, I have to join the_geom column to the code I just wrote.
Could someone tell me what I need to write in order to see my work on QGIS?
This is what I wrote and I have to finish including the geometries:
select * from pgr_TSP(
    $$
    SELECT * FROM pgr_dijkstraCostMatrix(
    'SELECT gid as id, source, target, cost, reverse_cost FROM
    public.ways',
    (select array_agg(id) from public.ways_vertices_pgr where id in
    (729,203,314,579,621,85852,719)), directed := false)
    $$,
    start_id := 729,

    randomize := false
        );


texts: Excluding 'No Data' values from Elevation Profile

texts:
I have derived an Elevation Profile from SRTM DEM (1ArcSec) using a polyline in ArcGIS 10.3. As shown in the below figure, the line passes through pixels having No Data values. However, these areas have been plotted in the resultant Elevation Profile.

I am intending to exclude portion of line having No Data values from the graph without splitting my polyline so I could show gap over there shown on graph. What is the optimal way to achieve this objective?


texts: How to request paginated or filtered data from WFS 2.0?

texts:
I want to download a data set from a WFS 2.0 server via HTTP GET, with curl for instance.

$ curl -X GET http://example.com/wfs/?service=WFS&request=GetFeature
&version=2.0.0&typeNames=example:layer&srsName=urn:ogc:def:crs:EPSG::4326

The layer is served as GML and contains about 400,000 features. The server limits a response to 100,000 features. CQL is not supported. The GML file contains such a node with each feature:

<gml:Point gml:id="P416" ... >

As far as I understand this id cannot be used to apply paging via a &FILTER parameter.
How can I download the whole data set with curl - maybe with multiple downloads?


texts: What is a SQL Query to all values in a column with Select by Attribute in ArcGIS?

texts:
I would like to select all values for an attribute using select layer by attribute to use in model builder and hopefully save the expression for automation purposes.

If I have an attribute named COUNTY
how do I select all values for this attribute?

The end goal is to automate specific layer creation; while avoiding make feature layer and using the field info dialog box.

Select layer by attribute(would always be all values in an attribute)
Make Feature Layer from selected attributes
Apply symbol
Output database

I would like to use a SQL expression to select all rows in the county field.

*Edit
This is a work around to avoid having an array of check boxes in the field info from the make feature layer function.

So I would like to select all values in the COUNTY field and make a feature layer from county.  So my end attribute table would appear like:


texts: ArcGIS API for JS Error message: Uncaught SyntaxError: Unexpected token <

texts:
I had created a application using ArcGIS API for JS to geolocate features in the feature layer that is added to basemap. I have an external Javascript and css file that are referenced (called) to html file. When I tried to run the html from web server it is sending an error message (script.js:1 Uncaught SyntaxError: Unexpected token <) for first line of JS file.

I re-checked my scripts couple of times, but I couldn't find any mistake in it. Is there anything wrong with Javascript syntax? Please check the below scripts:

JS:

HTML

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>Geolocating parcels</title>
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.15/esri/css/esri.css">
    <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.15/dijit/themes/claro/claro.css">

    <link rel ="stylesheet" href ="styles.css">


texts: Creating "multiple layer selection" with Qt Designer

texts: I want to create a multiple selection box (like you can see when you click on the processing saga tool "Merge vector layers") with the Qt Designer.


texts: Classifying NDVI image using ArcGIS Desktop?

texts:
I am creating a variety of NDVI for different periods in time, so per season for four years. I used the raster calculator on arcgis but i keep getting different max and min values.

Do I need to make all the min-max values the same to be able to compare all the NDVI's and, if so, how do I do this?

I tried using the min-max function in stretch in the symbology tab of layer properties but this just makes all the values alter that everything turns green.


texts: Is there any option in QGIS to draw parallel lines that snap on the outside part of the line (adjacent lines) that are independent from scale?

texts:
I have to draw a map of a public bus transport network and i have a problem in the avenues where a lot of lines passes by.
My objective is to make a visual map where the lines in those avenues are parallel one from the other and with no space between them, in order to see all of them at the same time, regardless the scale.

I've tried snapping options, and parallel drawing (CAD tools), but the issue is that when i change the scale, the distance between lines change and they collide or separate one from the other, messing everything.

So my question is:

Is there any option to draw adjacent lines that stays adjacent independently of the scale of visualisation?

Note: I don't know if adjacent is used for what I mean, so here I copy an example of what I'm searching for:

This is what happens when I zoom in:

And when I zoom out:

EDIT: Here I share a situation of why the suggested solution wouldn't work for me. Three lines share the same street for a while, but then they separate into three different streets.

I can't use a single line with several symbolisation because all along the network, the lines split and join again (there are more than 15 bus lines).

The data contained in the attribute data doesn't help me, because it's only a layer full of lines, with no attribute other than some network information (number of buses/hour, passenger/hour, etc.).
(QGIS 2.8.6 working on Windows 7)


texts: QGIS python loop with QgsRasterCalculator


texts: Is it possible to color the cluster base on marker color?

texts:
So far, I've been able to generate the marker color base on query from my MySQL DB.

What I would like to attempt now is to cluster those markers with the dominant marker color.

For example, if I had marker1,2,3 with red color and 4,5 with green and marker6 with blue it would be generating a red cluster.

Logic for generating marker color:

            val[<?php echo $y;?>] = <?php echo $row1['amount'];?>;
            val[<?php echo $z;?>] = <?php echo $row2['amount'];?>;
            //compare
            if(val[<?php echo $y;?>] > val[<?php echo $z;?>])
            {
                image[<?php echo $x;?>]  = 'img/red.png';
            }
            else if(val[<?php echo $y;?>]< val[<?php echo $z;?>])
            {
                image[<?php echo $x;?>]  = 'img/green.png';
            }
            else
            {
                image[<?php echo $x;?>]  = 'img/blue.png';

            }

            bounds.extend(location[<?php echo $x;?>]);
            var marker = new google.maps.Marker({
                map: map,
                position: location[<?php echo $x;?>],
                icon:image[<?php echo $x;?>]
            });

Any idea how should I approach this?


texts:
I have a road feature class (in illustrations shown in gray color), each object in the attribute table has a "road_width" field with a numeric value, what width the road is. This feature class has over 1,300 places where there is a topology error, where the areas overlap. I exported the overlapping areas to a separate feature class (in the illustrations shown in red color)  I can't calculate the real road shape area because there are overlapping areas, so shape area doubles. What I want to do, I will show in the illustrations.

I want every overlapping area to be cut (removed) from a road object with a smaller value for the "road_width" attribute and attached to a road object with a higher value for the "road_width" attribute.
in the case shown in the illustration, the marked, overlapping area will be cut (removed) from the road object which has a value 5.5 for the "road_width" field and will be attached to the road object which has a value 6 for the "road_width" field.

In the event that the overlapping area is between road objects that have the same value for the "road_width" attribute, the overlapping area will be cut (removed) from any of these two objects and attached to any of these two objects.

Example:

I need a solution in ModelBuilder.


texts:
I have an Angular map app with a WMS layer initialized as following:

this.layer =
new ImageLayer({
  source: new ImageWMS({
    url: url,
    params: {LAYERS: this.getActiveLayers()},
    projection: proj
  })
});

this.map = new Map({
  target: 'map',
  layers: [this.layer],
  view: new View({
    projection: proj
  })
});

At some point I need to update the wms layer, so I create another ImageWMS with the new requirements

this.auxLayer =
new ImageLayer({
  source: new ImageWMS({
    url: url,
    params: {LAYERS: this.newLayers()},
    projection: proj
  })
});

How can I update the layer with the new auxLayer info?


texts: Update a WMS Connection list automatically

texts:
I'm working on QGIS 2.8

Is it possible to automatically update an XML document containing a list of WMS connection
and if that file can automatically follow my QGIS project file

For example, if I add a new WMS layer in my project, save my project and close it. I want the WMS XML file to be updated.


texts: Detecting cliffs higher than X meters from DEM

texts:
Using QGIS, and the 'Raster > Analysis > Slope' tool, I could easily detect cliffs from my DEM.
I can identify all cliffs, and can color areas where slope is above a certain threshold. Since they are all vertical, they all have the same slope, and I cannot distinguish small cliffs (10m) from high ones (60m).
Is there another tool that would allow me to detect high cliffs from a DEM? I'm happy to use PostGIS if that's necessary.


texts: Tablets with QGIS data collection in the field + image capture?

texts:
Situation:
– In a student project, we are building a cataster/registry of pollard trees.
– We have geolocations of many trees and now we want to collect data about these trees in the field.
– We want to use open source software and lowcost equipment: an efficient solution, basically.

What we have:
– We are using QGIS for analysis
– We have tablets running Windows 8.1 and QGIS
– Optionally we have external Bluetooth GPS sensors (but the tablets have internal GPS sensors as well)

What we are able to do:
– Use a customizes QGIS with an entry form in the field, to gather attribute data (got that already)

Questions, what we are lacking:
– Is there a good way to capture images of trees with the tablet camera in the field AND link them to tree data? Maybe a plugin or script or something?
– Is there a way to get the tablet internal GPS sensor working with Windows 8.1?


texts: Apollonius Graphs (Delaunay Graphs of Disks) in sfcgal or PostGIS?

texts:
I was wondering if there is support for Delaunay Graphs of Disks (a.k.a. Apollonius Graphs) in PostGIS/sfcgal?

A CGAL function seems to exist for this. But I can't seem to find it in the PostGIS ecosystem. (I haven't used SFCGAL much, except for having it installed from source with the latest PostGIS 2.5.)

I also found a figure in a related SO answer:

So, does a function for this generalized Delaunay Graph exist?

If not, could someone with the experience provide some pointers as to how to add it to a custom-build SFCGAL? Ideally, I'm looking for schematics of how SFCGAL interfaced a similar Delaunay function that I can try to follow to add the above linked CGAL function.

(I'm interested in obtaining the generalized Delaunay tessellation. Not sure if I used the terminology right).


texts:
I need a square polygon to clip layers to, in QGIS, a perfect square perhaps.
It needs to be a certain size. Anyone have any experience or any good ideas?


texts: Using Custom Aerial Raster Imagery with OpenLayers 3 or 4

texts:
Currently, openlayers supports bing maps, however this is not an ideal option for a commercial application. What would be ideal is to have the ability to host and serve ariel imagery like NASA blue marble at http://visibleearth.nasa.gov/view_cat.php?categoryID=1484

Is there a way to serve an open source aerial image as a basemap in an openlayers 3 or 4 application? How could this be accomplished in theory?

EDIT: I'd like to know more about hosting and serving the aerial map locally. There are examples of how to do this with OpenStreetMaps using Mod_tile, renderd, mapnik, osm2pgsql and a postgresql/postgis database on the switch to OSM website https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/

How would one go about replicating this process locally using just raster imagery like NASA blue marble at http://visibleearth.nasa.gov/view_cat.php?categoryID=1484 (Large file)


texts: Is there unit test frameworks available for MapBasic? I've been searching, but have not found anything.


texts: Connecting from QGIS to PostGIS database using OGR toolbox?

texts:
I am trying to write a script to import/append mutiple layers into an existing PostGIS database. I am trying to use the  GDAL/OGR toolbox algo "Import Vector into PostGIS database (new connection)".

Here's my code:

vl  =QgsVectorLayer("D:/Users/Ravi_narayanan/Documents/VDLF/test2.shp","test2","ogr")

processing.runalg('gdalogr:importvectorintopostgisdatabasenewconnection', vl, 3, vl.crs().authid(),vl.crs().authid(),vl.crs().authid(), "172.22.140.42", "5432", "ivy01", "YVI", "ivy01!", "TEST1", "new", "ID","ID", "geom", 0,"","","0,1,0,1",False,"","20000",False, True, False, False, True, False,False,False,"")

This gives me the following error:

GDAL execution console output
            FAILURE:

        Unable to open datasource `port=5432' with the following drivers.

The list of drivers contains PostgreSQL.
The connection to the database works fine using a standard PyQGIS uri object.

When i tried using the toolbox GUI. The GDAL/OGR console command is as follws:

ogr2ogr.exe -progress --config PG_USE_COPY YES -f PostgreSQL PG:" "host=172.22.149.42 port=5432 dbname=YVI password=ivy01! active_schema=TEST1 user=ivy01" " -lco DIM=2 D:\Users\Ravi_narayanan\Documents\VDLF\test4.shp test4 -overwrite -nlt POINT -lco GEOMETRY_NAME=geom -lco FID=id -nln new -spat 480030.5 6691467.0 484106.5 6696344.0 -nlt PROMOTE_TO_MULTI

There is a " "after PostgreSQL PG: instead of a " when compared with the GUI of Import with available connections.

i'm using QGIS 2.14.11 and the number of parameters is not the same as in the link JGH gave.

ALGORITHM: Import Vector into PostGIS database (new connection)
INPUT_LAYER <ParameterVector>
GTYPE <ParameterSelection>
A_SRS <ParameterCrs>
T_SRS <ParameterCrs>
S_SRS <ParameterCrs>
HOST <ParameterString>
PORT <ParameterString>
USER <ParameterString>
DBNAME <ParameterString>
PASSWORD <ParameterString>
SCHEMA <ParameterString>
TABLE <ParameterString>
PK <ParameterString>
PRIMARY_KEY <parameters from INPUT_LAYER>
GEOCOLUMN <ParameterString>
DIM <ParameterSelection>
SIMPLIFY <ParameterString>
SEGMENTIZE <ParameterString>
SPAT <ParameterExtent>
CLIP <ParameterBoolean>
WHERE <ParameterString>
GT <ParameterString>
OVERWRITE <ParameterBoolean>
APPEND <ParameterBoolean>
ADDFIELDS <ParameterBoolean>
LAUNDER <ParameterBoolean>
INDEX <ParameterBoolean>
SKIPFAILURES <ParameterBoolean>
PROMOTETOMULTI <ParameterBoolean>
PRECISION <ParameterBoolean>
OPTIONS <ParameterString


texts: QGIS: Life GPS and auto rotate canvas with two antennas and receivers?

texts:
I am using QGIS and life RTK-GNSS on agricultural machines to find the borders of my fields. In some situations I would have benefits if I could see the position of an antenna in front of my machine and also of an antenna at the equippment behind the tractor simultanously on the map. Is there a possibility to implement a second receiver and a second gps cursor on the map?
In QGIS 3.12 auto-rotate canvas to GPS bearing was published. Depending on the roughness of the soil and the shaking of the machine, the antenna in front of the machine may be kicked some inches to both sides of the path every 0.1s, when position and bearing data are generated by the receiver. Driving with a low speed the map then shakes around heavily in auto rotate mode. Using the line between those two antennas instead of the bearing from the NMEA data for finding the direction of movement of the machine would calm down the shaking of the map, I guess. How can I send that suggestion to the developers of QGIS?


texts: different maps for different zoom levels in openlayers?

texts:
I'm trying to create a mixture of maps that will load in depending on zoom level
However, it will only show as one map to the user, and depending on the zoom level, it will load in a different map

I really like open street map data when zoomed out, and skobbler maps when zoomed in, so would like to create this one combined map

I think from what i've read its possible, but all the examples i found refer to detail layers

any examples or pointing in the right direction would be appreaciated


texts: Intermittent exceptions in CopyRows_management

texts:
Occasionally, but frequently enough to be a pain, my script throws an error. The script runs fine most of the time but when it fails, I get this:

Traceback (most recent call last):
  File "XXX.py", line 493, in main
    arcpy.CopyRows_management(ABC, XYZ)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 13547, in CopyRows
    raise e
ExecuteError: ERROR 000224: Cannot insert features
Failed to execute (CopyRows).

where ABC is a feature class in SDE and XYZ is a feature class in the local scratch.gdb. The name of XYZ is derived from the date and time and, I believe, should never encounter an issue with locks at this stage of the script.

What can be causing this error and how do I fix it?

Update 2 - SDE is on the network. Data is copied from SDE to the local GDB and then processed. The results are sent back to SDE upon completion of various tasks.

Update 1 - The path to the scratch.gdb is created automatically by ArcMap and located in "C:\Users\XXXXXX\AppData\Local\Temp\scratch.gdb". Feature class names are similar to "z_JSdzG2G_xyz" where "z_" is a constant and helps to push these FCs to the bottom of the list, "JSdzG2G" is an encoded date and timestamp, and "_xyz" is a 3 - 6 character description of what's contained in the FC.


texts: How to fix the position of map in QGIS after save the file and don't change any colors in selected feauture polygons?

texts:
First I have opened a GeoJSON file in QGIS, gives the Labels name, the map is for the Aurangabad district (of India), and there are eight talukas.

I want to display the four talukas that are growing a bajra crop. So I have coloured the four talukas and using "Text Annotation" I have put some information for the four talukas.

Now, I am doing screen shot for that map, otherwise it map is go down, go up, Zoom in , Zoom out automatically and my title:  "Crop: Bajra"  was not accurate in the top.  So I need to take a screen shot, for displaying bajra crop grow for four talukas.

Please see the screen shot images...
(yellow four talukas image file)

So, when I save this map file, and open it in QGIS it will not show "yellow" colour for selected 4 talukas, same colour shows for all eight talukas and I need to set the position of map again.

So, my question is:

I  want to first fix the map position  at the middle, so map will be not zoom in, zoom out, go left, go right, fix at the position, so I can give the title at the top of the map "Crop: Bajra".
Using "Text Annotation" I will put my information for selected four talukas. And colour it for four talukas.

And once I save that file, that will not change any colour and not need to set map at the middle. Is this possible?


texts:
I am using new route analysis in ArcMap. I am trying to find shorthest route between multiple points.

Some of the Points are not on the route, see green example in the picture below.

I am trying to match points which are not on the roads with nearest route. Is there a way to do this with ArcMap ?


texts: No attribute table or values in QGIS 3.2 Grass toolbox plugin output files

texts:
Using the Grass toolbox within QGIS 3.2 (and previously 3.0) when I import any files and overlay them, then use the "View Output" option (button), the resulting file has the correct polygon areas overlayed but with no attribute data/values, except for a "cat" column.

(this is a usual method that I have used hundreds of times successfully with QGIS 2.x)

NB: I have checked to make sure that the advanced "Do not create attribute table" option when importing the files is not checked.

Grass 7.4.1 is installed (and seems to be working fine in QGIS 2.18.21)

How do I ensure that an attribute table will be created when I import, overlay and export files from the Grass plugin within QGIS 3.x?


texts: Unable use a Temporal Plot Tool in GRASS GIS

texts:
I installed GRASS GIS following the tutorial on the website for the Ubuntu 18.04 version. However, the Temporal Plot Tool function is not working, and is giving an error related to python.

Below is the error that is giving in the tool.

Unable to start Temporal Plot Tool

Motivo: The Temporal Plot Tool needs the "Matplotlib" (python-matploltib) package to be installed. Cannot load backend 'WXAgg' which requires the 'wx' interactive framework, as 'gtk3' is currently running

Traceback (most recent call last)
File "/usr/local/grass78/gui/wxpython/tplot/frame.py", line 36, in <module>
matplolib.use('WXAgg')
File "/home/luiz/.local/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py", line 296, in wrapper
return func(*args, **kwargs)
File "/home/luiz/.local/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper
return func(*args, **kwargs)
File "/home/luiz/.local/lib/python3.6/site-packages/matplotlib/_init_.py", line 1281 in use
plt.switch_backend(name)
File "/home/luiz/.local/lib/python3.6/site-packages/matplotlib/pyplot.py", line 237, in switch_backend
newbackend, required_framework, current_framework))
ImportError:Cannot load backend 'WXAgg' which requires the 'wx' interactive framework, as 'gtk3' is currently running

During handling odf the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/grass78/gui/wxpython/lmgr/frame.py", line 1930, in OnTplotTool
from tplot.frame import TplotFrame
File "/usr/local/grass78/gui/wxpython/tplot/frame.py", line 45, in
<module>
'(python-matplotlib) package to be installed. {0}').format(e))
ImportError: The Temporal Plot Tool needs the "matplotlib" (python-matplotlib) package to be installed Cannot load backend 'WXAgg' which requires the 'wx' interactive framework, as 'gtk3' is currently running

What should I do to solve this problem?


texts: How is margin of error reported on a map?

texts: When reporting estimates you should always include the margin of error. There are conventional ways of reporting margin of error in a table, text or graph. But, how do you report margin of error for data visualized on a map?


texts: How do I install a QGIS processing plugin headless for use with qgis_process?

texts:
I'm trying to use the UMEP for processing plugin in a docker container
https://plugins.qgis.org/plugins/processing_umep/
After extracting the plugin zip to the plugins directory, it appears in the list but is not "loaded".
[root@c4da1ff0ffde /]# qgis_process plugins
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
<string>:1: DeprecationWarning: setapi() is deprecated
/usr/lib/python3.9/site-packages/qgis/utils.py:792: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  mod = _builtin_import(name, globals, locals, fromlist, level)
Problem with GRASS installation: GRASS was not found or is not correctly installed
Problem with SAGA installation: SAGA was not found or is not correctly installed
Available plugins
(* indicates loaded plugins which implement Processing providers)

  processing_umep
* processing

This is my dockerfile

FROM lopsided/archlinux

RUN pacman -Syy && pacman --noconfirm -S qgis python-pip python-pandas python-scipy unzip

ENV QT_QPA_PLATFORM offscreen

RUN mkdir -p ~/.local/share/QGIS/QGIS3/profiles/default/QGIS && \
  echo "[PythonPlugins]\nprocessing=true\nprocessing_umap=true" > ~/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini && \
  curl https://plugins.qgis.org/plugins/processing_umep/version/0.5/download/ --output umep-processing.zip && \
  mkdir -p ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins && \
  unzip umep-processing.zip -d ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins && \
  rm umep-processing.zip


texts: Perform zonal statics with the Rcaller in FME-desktop

texts:
I am trying to use the Rcaller in FME to perform zonal statistics.

input: shapefile and a Geotiff

I read that the Rcaller reads the input data as a dataframe when it is imported into the Rcaller (R). So, I tried to convert the dataframes back to a shapefile (sp::SpatialPointsDataFrame) and a raster (raster::rasterFromXYZ).

However, I get an error,

  X and Y coordinates are missing

I cannot figure out how I could add the X & Y coordinates to the input dataframe, and I am wondering if it is even possible to use a shapefile and raster as input for the Rcaller?

Or does anybody else knows a better way to perform zonal statistics in FME?

Update:

I also got an answer from Safe:

  You can't load a raster/image directly into the RCaller data frame. You have >to read your raster directly in your R script. It would be similar to writing a >raster, as illustrated in this kriging example. Alternatively, you could covert >your raster to points using RasterCellCoercer / RasterToPointCoercer, but this >could be pretty slow depending on the size of your raster

link: https://knowledge.safe.com/questions/78108/perform-zonal-statics-with-the-rcaller.html


texts: How to set zero value of reflectance number of land using QGIS?

texts:
I try to get SST (Sea Surface Temperature) data from Landsat image using QGIS, but I don't know how to set zero value of reflectance in land area using QGIS.

Does anyone know of any method to set the zero value in land area?


texts: Predict the movement of an object on the map considering geodetic calculations in OpenLayers 3?

texts:
I need to represent the movement of an object (which has its own speed) but considering the geodedic calculations. I'm working with EPSG:3857 projection.

How can I do this?


texts:
What is the standard way to write a netcdf4? I'm using this guide http://netcdf4-python.googlecode.com/svn/trunk/docs/netCDF4-module.html but when I dump the output file with ncdump, I get the error:

*** ncdump: ncopen failed on <filename>.

My code:
We assume lat,lon and val already initialized with correct data.

#create a netCDF4 file
rootgrp = Dataset('test.nc', 'w', format='NETCDF4')
print rootgrp.data_model
#create a group
rootgrp.createGroup('forecasts')
#create dimensions
lat_dim = rootgrp.createDimension('lat', len(lat))
lon_dim = rootgrp.createDimension('lon', len(lon))
value_dim = rootgrp.createDimension('value', len(val))
time = rootgrp.createDimension('time', None)
#create variables
latitudes = rootgrp.createVariable('latitude','f4',('lat',))
longitudes = rootgrp.createVariable('longitude','f4',('lon',))
values = rootgrp.createVariable('value','f4',('value',))
times = rootgrp.createVariable('time','f8',('time',))
temp = rootgrp.createVariable('temp','f4',('lat','lon','value','time'))
print rootgrp.variables
#write attributes
rootgrp.description = 'none'
rootgrp.history = 'Created ' + history
rootgrp.source = 'geotiff2netcdf.py'
latitudes.units = 'degrees north'
longitudes.units = 'degrees east'
values.units = ''
temp.units = 'K'
times.units = 'hours since 0001-01-01 00:00:00.0'
times.calendar = 'gregorian'
#write data
latitudes[:] = lat
longitudes[:] = lon
values[:] = val
times[:] = t
print type(temp)
temp.setncatts({'lat':lat,'lon':lon,'value':val,'time':t})
print 'ncattrs LAT ',temp.getncattr('lat')
print 'ncattrs LON ',temp.getncattr('lon')
print 'ncattrs VALUE ',temp.getncattr('value')
print 'ncattrs TIME ',temp.getncattr('time')
#close file
rootgrp.close()

Any ideas?


texts: When a raster is clipped to a polygon with Python, why does it still take on the extent of the entire shapefile?

texts:
I am clipping a raster image to each polygon row in a shapefile in ArcMap 9.3 using the Clip tool (Data Management) in Python with Clipping Geometry set.  While the clipped raster successfully depicts the intersection of the raster and the polygon, the extent of the clipped raster is still that of the original raster.  Here is my code:

# Import system modules
import sys
import string
import os
import arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)
# Load required toolboxes...
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
# Designate a workspace
gp.workspace = "L:\Clip"  # Assign variables...
clipto = "test.shp"  # shapefile to clip to
clipit = "vfcm.tif" # features to be clipped

# Cursor time
rows = gp.SearchCursor(clipto)
row = rows.Next()

# clip management
while row:
    n = str(row.VAHU6) # assign a variable for the processing message based on a field
    clipgeo = row.Shape
    print "clipping to: " +n # tells what row was clipped
    # Clip_management <in_raster> <rectangle> <out_raster> {in_template_dataset}   {nodata_value} {NONE | ClippingGeometry}
    outputname = str(row.VAHU6) + "_c"
    extent=str(clipgeo.extent)
    gp.Clip_management(clipit, extent, outputname, clipgeo, "", ClippingGeometry)
    #update str if necessary
    print str(row.VAHU6)
    row=rows.next()

# reset the array...
del rows
del gp

Do you know why I am having this problem? When I run the tool in Model Builder, it works correctly.  This problem is evident both in the file size (which is 10x greater than when correctly clipped) and when I "zoom to layer" in ArcMap.  If you know how to adjust the code to work, I'd be very appreciative!

Thank you!

UPDATE: Even if I export one polygon from the shapefile manually, look up the extent in the source tab, and then type those coordinates directly into the extent in my code, it still doesn't clip properly.


texts:
I have managed to :

1) Create layers
2) Applied SLD Styles
3) Group the layers together and able to preview

What I have is this(layer preview):

I would now want to serve this layer via tiles. Something like what open street map does, an example would be, https://a.tile.openstreetmap.org/14/12917/8131.png as my mobile application will be getting the map tiles from this server itself.

How do I go about doing this? Leaflet?

Based on BradHards's Suggestion, I have installed geowebcache and am trying to serve tms /wtms with some problems.

This is my WMTS get capabilties file Link here, and TMS is here

<TileMap title="OSM layerGroup" srs="EPSG:900913" profile="global-mercator" href="http://10.18.144.176:8181/geowebcache/service/tms/1.0.0/OSM+layerGroup@EPSG%3A900913@png"/>
<TileMap title="OSM layerGroup" srs="EPSG:4326" profile="global-geodetic" href="http://10.18.144.176:8181/geowebcache/service/tms/1.0.0/OSM+layerGroup@EPSG%3A4326@png"/>

I have tried using TMS,
for example a working link in my local client produces something like this:
   http://localhost:8181/geowebcache/service/tms/1.0.0/osm_sgmy@EPSG%3A900913@png%22/1/1/1.png

using another test link would result in this:
    http://localhost:8181/geowebcache/service/tms/1.0.0/osm_sgmy@EPSG%3A900913@png%22/1/2/2.png

  Coverage [minx,miny,maxx,maxy] is [-1, 0, 2, 1, 1], index [x,y,z] is
  [2, 2, 1]

This is my geowebcache-core-context.xml file config snippet:

 <bean id="gwcWMSConfig" class="org.geowebcache.config.GetCapabilitiesConfiguration">
    <constructor-arg ref="gwcGridSetBroker">
    </constructor-arg>
    <!-- <constructor-arg value="http://10.18.144.176:8080/geoserver/osm/wms?service=WMS&amp;version=1.1.0&amp;request=GetCapabilities"> -->
     <constructor-arg value="http://10.18.144.176:8080/geoserver/osm_sgmy/wms?service=WMS&amp;version=1.1.0&amp;request=GetCapabilities">
      <description>The URL to the WMS GetCapabilities document, notice &amp; , port is normally 8080</description>
    </constructor-arg>
    <constructor-arg value="image/png">
      <description>The formats to support for all layers read for the above document</description>
    </constructor-arg>
    <constructor-arg value="3x3">
      <description>Metatiling factors, 3x3 is usually a good compromise for vector data</description>
    </constructor-arg>
    <constructor-arg value="map=/osgeo/mapserver/msautotest/world/world.map">
      <description>
          Vendor parameters, these are appended to every request sent to the backend.
          If you use MapServer you probably want to set this to "map=name". Leave the value attribute empty if you don't need
          to add any vendor specific parameter.
      </description>
    </constructor-arg>
    <constructor-arg value="false">
      <description>Whether to allow cached=false to specificed for certain requests</description>
    </constructor-arg>

    <property name="primaryConfig" ref="gwcXmlConfig">
      <description>The configuration object with the global defaults to use for new layers</description>
    </property>

In summary, I want to make my geoserver/geowebcache able to serve tiles in a X/Y/Z format like:

  http://mt{0-3}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}


texts: QGIS problem with UTM grid coordinates in map composer

texts: I'm trying to create a map just using an OSM open layer as a base with no other vector/raster data. When I go to map composer and add a grid to my map, I selected the UTM zone 51N (as it's in the Philippines) and used map units as the grid unit. But, when the coordinates show up, they don't seem to correspond to the map. Am I missing a step somewhere?


texts: map of europe in list of lat/long points

texts:
I'm looking for a list of lat/long coordinates which will describe all countries of europe. Ideally the list will also describe on which country each closed path belongs to. I'm imagining something along the lines:

 lat    long    cc  type
------ ------- ---- ----
55.05   -7.25   IE  EU27
55.18   -6.97   IE  EU27
55.25   -6.48   IE  EU27
55.22   -6.1    IE  EU27
55.05   -6      IE  EU27
54.83   -5.7    IE  EU27
54.63   -5.92   IE  EU27
...
55.23   -6.93   IE  EU27
55.05   -7.25   IE  EU27

58.63   -5      UK  EU27
58.55   -4.67   UK  EU27
58.45   -4.77   UK  EU27
58.58   -4.6    UK  EU27
58.45   -4.48   UK  EU27
58.6    -4.02   UK  EU27
58.63   -3.02   UK  EU27
58.37   -3.12   UK  EU27
57.85   -4.2    UK  EU27
57.85   -3.77   UK  EU27
57.6    -4.42   UK  EU27
57.6    -4.1    UK  EU27
...

Regarding accuracy, I'd be happy with anything over 5.000 points in total.

Where should I look at?

I will convert those coordinates to x/y using fromLatLngToContainerPixel of google maps and then draw the map using javascript.


texts: ArcGIS error with Python Toolbox that imports matplotlib?

texts:
Recently upgraded to 10.5 ArcGIS. Custom ArcPy Toolbox (pyt) shows the red-x error and will not load. Going to "Check Syntax.." results in this:

   File "[from custom ArcPy Tool .py file]"...
     import matplotlib.pyplot as plt
   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 129, in <module>
    from matplotlib.externals.six.moves.urllib.request import urlopen
   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 90, in __get__
    result = self._resolve()
   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 158, in _resolve
    module = _import_module(self.mod)
   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 80, in _import_module
    __import__(name)
   File "C:\Python27\ArcGISx6410.5\Lib\urllib2.py", line 94, in <module>
    import httplib
   File "C:\Python27\ArcGISx6410.5\Lib\httplib.py", line 72, in <module>
    import socket
   File "C:\Python27\ArcGISx6410.5\Lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

Maybe it's normal, but I do notice the stack trace goes from the 32-bit to 64-bit installs of python. 64-bit should be default I think as I installed background geoprocessing and have it enabled.

Seems to be specific to matplotlib as other custom PYTs load fine, but if I add import matplotlib they also run into same error. There is a matplotlib in the site-packages for 64-bit python. Just to be safe I upgraded it via pip to the latest.

Everything is version 10.5.1.7333, including Background Geoprocessing (64-bit). I did a repair install of ArcGIS 10.5 and Background Geoprocessing with no effect. All PYTHONPATH environment variables are pointing to 64-bit python.


texts:
I have a script which reload data from dbf file and create a new table in postgres database using geotools plugin.
My problem is when geotools reload fields name from the file it adds a new field fid to make it as a primary key(by default).

PS: my file fields does not contain a field name fid,
My fields are(field1, field2)

I dont want to use the default primary key, i want to set my custom one from the my fields list.
please find below my script which work perfectly except the primary key issue .
Could you please help me.

    public static void importDBFFileToPostgreSQL(Path filepath, String tablename) {
    DataStore pgDatastore = postgisDataStore.getInstance();
    DbaseFileReader dbaseFileReader = null;
    try {
        try (FileChannel in = FileChannel.open(filepath)) {
            dbaseFileReader = new DbaseFileReader(in, true, Charset.forName("ISO-8859-1"));
        }
        DbaseFileHeader header = dbaseFileReader.getHeader();
        List<AttributeDescriptor> attributes = buildAttributesFromDBFHeader(header);

        // create the feature type
        SimpleFeatureTypeBuilder simpleFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
        simpleFeatureTypeBuilder.setName(tablename);
        simpleFeatureTypeBuilder.addAll(attributes);

        SimpleFeatureType newtype = simpleFeatureTypeBuilder.buildFeatureType();
        pgDatastore.createSchema(newtype);
    }}


texts: Excellent app for OSM browsing on smartphone

texts:
I am looking for a decent app to browse OpenStreetMap on my Android smartphone in the offline mode. I have already bought OsmAnd+ and the Skobbler's OSM Navigation and Maps, and while their UIs are exactly at the opposite ends of the scale, neither offers some simple and important functionality.

OSM Navigation and Maps interface is beautiful (a map is a visual thing, so eye-pleasing is paramount for efficient use) and simple in comparison to what OsmAnd+ does. It makes the maps fast to render. Navigation is good. What is lacking dramatically is all the additional data present in OSM (POIs).

OsmAnd+ knows a lot more, but creates screens like this:

Each tiny street is drawn with two lines, and all remote shops and train stations are marked. At the same time, getting the information from the program is almost impossible. The street names are shown randomly. I cannot click a street and get information about it. I cannot ask the program to hide most of the things and keep just what I want.

So my question is: is an app I am searching for available? I want to be able to

see only relevant information (aka layers)
click an object to see its data


texts: PostGIS ST_Difference is returning overlapped areas

texts:
I´m using this SQL sentence to obtain the difference of two layers, exactly I understood that ST_Difference does, that is, it should return polygons that don´t overlap and the not overlapped area when two polygons partially overlap.

create table fitofisionomia_areas_antropizadas_5880_fix_biomass_eba as
select a.fid, st_difference(a.geom,b.geom) as geom
from fitofisionomia a
inner  join fitofisionomia_areas_naturais_5880_fix_biomass_eba b
on st_difference(a.geom,b.geom) is not null

This is a portion of layer a:

Add layer b...

Then the difference

As I´m just testing I´m using LIMIT, so maybe some "holes" were not identified, however, this big yellow polygon is an overlapped area. That´s the problem.


texts: How to easily label point values in ArcScene?

texts:
I would like to be able to quickly label point values in my scene.

I am aware of the fact that there is no out-of-the-box solution to label features in ArcScene similar to the one in ArcMap. (No doubt the 3D environment is presenting a lot of complexity to the programmers.)

I've worked with some (expensive) programs that were able to successfully and cleanly label feature in 3D environment but redrawing/refreshing was required to update the labels. (Gemcom GEMS)

I do not need my points to rotate correctly with the scene or anything as fancy as that however I am a little tired of placing text manually in the scene or in post-processing.

Does anyone know of a working solution?


texts: Differences in calculating area of a shape between QGIS and GeoPandas

texts:
I'm trying to understand how to calculate the correct area for a shape. I'm well aware from many of the searches that I need to select the right CRS to be able to calculate the right area, but my problem is that I'm not sure what the correct CRS should be for the area. For this is generally trust QGIS but I cannot reproduce the correct area in GeoPandas.
Let's say we have the following shape:
'POLYGON ((-2.164637332474595 5.256875328024387, -2.153937604215215 5.260153696182363, -2.124307587496931 5.135563662748329, -2.145707044015691 5.11342997445197, -2.155583716255119 5.083917200394721, -2.184390676953451 5.099493555735554, -2.164637332474595 5.256875328024387))' (in EPSG:4326)
If I calculate the area in QGIS (using the $area function) for the CRS EPSG:3857 I get the following:

I understand from the answers here that I can actually get the same area using a different function.
And then calculating the same area using geopandas using the following code:
import pandas as pd
import geopandas as gpd
from shapely import wkt
from fiona.crs import from_epsg

df = pd.DataFrame({'Point': ['Test'],
                   'Coordinates': ['POLYGON ((-2.164637332474595 5.256875328024387, -2.153937604215215 5.260153696182363, -2.124307587496931 5.135563662748329, -2.145707044015691 5.11342997445197, -2.155583716255119 5.083917200394721, -2.184390676953451 5.099493555735554, -2.164637332474595 5.256875328024387))']})

df['Coordinates'] = df['Coordinates'].apply(wkt.loads)

gdf = gpd.GeoDataFrame(df, geometry='Coordinates')
gdf.crs = from_epsg(4326)
gdf = gdf.to_crs(from_epsg(3857))
gdf['area'] = gdf['Coordinates'].area

The area that I now get is somehow 7.301224e+07, different from what we have in QGIS.
My understanding is that (due to the answer given here) the area in QGIS is actually correct due to the ellipsoidal settings in the project (I might not correctly understand the term though). My question is, how do I get the same result in GeoPandas?
In general, my more broad question would be, how can I make sure I always calculate the right area of a shape in hectares. Is there a straightforward way to do this in GeoPandas?


texts: Aggregate daily to monthly values for each pixel in google earth engine

texts:
I have an ImageCollection which is daily resolution for multiple years. For each year and month, I want to sum the pr band in the ee.ImageCollection such that I have a monthly value instead of daily.
// Define the polygon
var polygon = ee.Geometry.Polygon([114, 0.37, 114, 2.04, 112, 2.04, 112, 0.37]);

// Define the dataset
var NASA = ee.ImageCollection('NASA/NEX-GDDP');

// a function that takes a year and month and filters the `ImageCollection`
var filterYrMo = function(analysis, gcm, variable, y, m, imageCol) {

var imageColYr = imageCol
                .select(variable)
                .filter(ee.Filter.bounds(polygon))
                .filterMetadata('scenario', 'equals', analysis)
                .filterMetadata('model', 'equals', gcm)
                .filter(ee.Filter.calendarRange(y, y,'year'))
                .filter(ee.Filter.calendarRange(m, m,'month'));

 return imageColYr
};

// Using the function to select January, 2000
var test = filterYrMo('historical', 'CanESM2', 'tasmax', 2000, 1, NASA);
print(test)

test has 31 images or features (31 days of January) for year 2000 for the polygon. Each image is a day and I want to sum pr variables across the 31 days for each pixels to generate the monthly value for each pixel.
Is there a function that can do this in earth engine?


texts: Cell Statistics cutting off raster output at north, south, and west edges using ArcGIS Pro

texts:
I am trying to add five partially overlapping rasters using Cell Statistics in ArcGIS Pro 2.3.2 (Windows 7). The north, south, and west edges of the output raster are getting abruptly cut off, even though the input rasters extend to the edges of the grey outline (see red circled areas in image). All the input rasters are in the same projected coordinate system (CRTM05) and resolution (30m). I've tried rearranging the order of the input rasters in the Cell Statistics tool, in case that made a difference, but that didn't do anything. I have set the snap raster and mask to a raster of the entire study area, with the same resolution and coordinate system.
Why does it keep cutting off the edges?


texts: Checking if domain contains particular coded value using ArcPy?

texts:
How can I check if a domain contains a particular coded value?

How to check if domain already exists? shows how to verify whether a domain exists in a geodatabase.

However, I can't see how to check that a particular coded value exists, before I use arcpy.DeleteCodedValueFromDomain_management

A workaround is to use Domain To Table and read the table - is that the best option?

def removeFromDomain(domain,value):
try:
    #Check if the coded value exists. For this we need to export the domain to a table, and read the table
    if arcpy.Exists(workspace + os.sep + tempTbl):
        arcpy.Delete_management(workspace + os.sep + tempTbl)
    arcpy.DomainToTable_management(workspace + os.sep + GDB, domain, workspace + os.sep + tempTbl, "code", "descript")
    rows = arcpy.SearchCursor(workspace + os.sep + tempTbl)
    valueExists = False
    for row in rows:
        if row.getValue("code") == value:
            valueExists = True
    if valueExists:
        arcpy.DeleteCodedValueFromDomain_management(workspace + os.sep + GDB, domain, [value])
        print "Deleted coded value " + str(value) + " from domain " + str(domain)
    else:
        print "domain value " + str(value) + " does not exist on domain " + domain
    arcpy.Delete_management(workspace + os.sep + tempTbl)
except Exception, err:
    print err
    raise


texts: Output Mosaic Dataset seamline feature class removing overlapping areas?

texts: I have a mosaic dataset of 50+ images with large areas of overlap. I would like to create a feature class of the VISIBLE FOOTPRINTS of the dataset based on the mosaicking stacking order e.g. "NorthWest" or "By Attribute". I can generate a seamline with the "SOrder" attribute but what I want is a feature class of polygons with no areas of overlap showing just the footprints of the visible imagery.


texts: Option does not accept multiple answers?

texts:
I have been trying to import rasters and shapefiles into GRASS GIS 7.2.1 and get the responses:

ERROR: Option  does not accept multiple answers
ERROR: Option  does not accept multiple answers

I have taken out spaces and underscores from the filenames and put them in c:\data and still get this message. I note that when you use GRASS in QGIS 2.18 the filenames are put into quotes, but if you do that in GRASS GIS it doesn't recognize the files anymore.

I am using v.in.ogr for the shapefile and r.in.gdal for the raster. What is the problem?

The screenshots are below. If I do not enter "Name for output raster map" there is only an Import error.


texts: Leaflet geoJSON sublayers checked on off

texts:
I am trying to make my geoJSON sublayers enable for on/off. There are geoJSON layers filtered by property, what look like this:

    infill = L.geoJson(data2, {

    pointToLayer: function(feature, latlng) {

        return L.circleMarker(latlng, {
        radius:6,
        opacity: .5,
        //color: "#000",
        color:getColor(feature.properties.Type),
        fillColor: getColor(feature.properties.Type),
        fillOpacity: 0.8

        }).bindTooltip(feature.properties.Owner);
    },
        onEachFeature: function (feature, layer) {
        },
        filter: function(feature, layer) {
            return (feature.properties.Type == "Infill" );
        }
        })//.addTo(map);  //Note turned on to start map with Data, Checkbox has checked property.

     mdu = L.geoJson(data2, {

    pointToLayer: function(feature, latlng) {

        return L.circleMarker(latlng, {
        radius:6,
        opacity: .5,
        //color: "#000",
        color:getColor(feature.properties.Type),
        fillColor: getColor(feature.properties.Type),
        fillOpacity: 0.8

        }).bindTooltip(feature.properties.Owner);
       },
        onEachFeature: function (feature, layer) {
        },
        filter: function(feature, layer) {
            return (feature.properties.Type == "MDU" );
        }
        })//.addTo(map);

They consist of the bigger layer as it shown in the image below:

This result comes from this code:

   //major geoJSON layer#
     document.querySelector("input[name=vm]").addEventListener('change',
     function() { //checking the jobs in the sidebar layer 2 Virgin Media
     if(this.checked) map.addLayer(job2, infill, mdu)
     else map.removeLayer(job2, infill, mdu)
     if(this.checked) map.addLayer(featuresLayer2)
     else map.removeLayer(featuresLayer2)
    })
      //Infill - 1st sublayer
     document.querySelector("input[name=infill]").addEventListener('change',
      function() { //checking the jobs in the sidebar layer 1
      if(this.checked) map.addLayer(infill) //geoJson layer
      else map.removeLayer(infill)
      if(this.checked) map.addLayer(featuresLayer) //clustered geoJson layer
      else map.removeLayer(featuresLayer)
     })

    //MDU - 2nd sublayer
    document.querySelector("input[name=mdu]").addEventListener('change',
    function() { //checking the jobs in the sidebar layer 2 Virgin Media
    if(this.checked) map.addLayer(mdu)
    else map.removeLayer(mdu)
    if(this.checked) map.addLayer(featuresLayer2)
    else map.removeLayer(featuresLayer2)
    })

There are 2 sublayers Infill and MDU that belongs to major GeoJSOn layer.

Is it possible to make them distinguished (eligible to click on-off) when the major layer in ON and all them disabled, when the major layer is OFF?

The original examples comes from here:

http://www.gistechsolutions.com/leaflet/DEMO/sports/sports.html
selection layers from one geoJSON layer

http://www.gistechsolutions.com/leaflet/DEMO/sports/index.html

but unfortunately they are valid for major layers, whereas the dotted divisions are not a subject of selection.


texts: Extracting data from GeoMedia *.mdf database without using GeoMedia?

texts:
Is it possible to extract data from Geomedia .mdf without Geomedia?

Preferably with use of QGIS or ArcGIS for Desktop?


texts: Debugging Background Processing Error from ArcPy & Geoprocessing tools?

texts:
When I run a script in the background or Toolbox tools I will get a Background Processing Error. The script isn't the issue because it's happened several times today. When it does crash it will produce a "fatal error" message similar to the one that will close ArcMap. It closes the background processes but ArcMap stays open and no errors show up on the result messages. I've restarted ArcMap since it happened and it did not help.

Any suggestions?


texts: QGIS: Release file lock on file used in a processing algorithm at the end of script

texts: I am using runalg (qgis:joinattributesbylocation) on two QgsVectorLayer objects.  At the end of my script I'm trying to delete all the files created during the script.  I can delete everything except the .shp and .dbf files from the two input vector layers for the process algorithm above.  I remove all layers from the QgsMapRegistry before I try to delete the files. I've tried deleting all variables pointing to the layers, still doesn't work.  The file lock remains until I exit QGIS.  I tried the workaround posted here and it doesn't work for me, re-adding and removing the layers from the registry doesn't work.  I also created new layers with the same files, added those to the registry, and then remove those, still no luck.  The only way I can delete the files is to close QGIS.


texts: GDAL/Shapely how to use representative_point()

texts:
I am trying to create a single point inside each polygon of a dataset using shapely's representative_point() function. According to the documentation here it is called on a geometry object, so it should work similarly to calling Centroid() on a geometry object. However, when I try to do so I get:

AttributeError: 'Geometry' object has no attribute 'representative_point()'.

import shapely
...

    for bld in xrange(bld_layer.GetFeatureCount()):
        bld_feat = bld_layer.GetFeature(bld)
        bld_geom = bld_layer.GetGeometryRef()
        bld_point = bld_geom.representative_point()
        ...

UPDATE

Based on the comments and after more searching a combination of Fiona and Shapely (here) seems to work:

import fiona
from shapely.geometry import shape, mapping

src = r'C:\data\segments.shp'
out = r'C:\data\segments_points.shp'
data = fiona.open(src, 'r')
data_schema = data.schema
data_schema['geometry'] = 'Point'
with fiona.open(out, 'w', crs = data.crs, driver = data.driver, schema = data_schema) as dst:
    for f in data:
        point = shape(f['geometry']).representative_point()
        f['geometry'] = mapping(point)
        dst.write(f)


texts: All layers disappear after using OpenLayers

texts:
Not trying to do anything complicated here... I have a .csv with date/time and lat/long data. When I load it into QGis as a delimited text layer, everything appears fine at first:

But, when I try and use ANY of the openlayers plugins, it eats all my data. Now NONE of the datapoints I had before are visible, and removing OpenLayers from the legend doesn't seem to do anything. If I try and add in the layer again, it still remains invisible.

Anyone have any idea of what's happening here, or an alternative to the OpenLayers plugin?


texts: Why would an ArcGIS 10 Python custom tool fail without throwing a "failed to execute" or "completed script" message at the end?

texts:
I have written a custom tool in Python for ArcGIS that converts in batch SHP files to GML files.  It processes one file at a time in a folder, file, or ZIP file and then moves on to the next.  If the tool experiences an exception it states that an error happened and just continues to the next file.

What one of the users of the tool experienced after kicking it off overnight is that it ended in a strange way.  Usually when the tool ends (prematurely or not) it has a message at the end saying "failure to execute " or "completed script ".  This time, however, it did not (as the image below shows).

Is there a specific reason why the script would just end abruptly like this, like maybe the process just quit for some reason? I asked the user if the computer restarted or if he noticed if ArcCatalog closed and he said no.


texts: Writing ArcPy cursor results to text file?

texts:
I don't know how to write the result in a text file, can anyone help me?

import arcpy
rows = arcpy.SearchCursor("E:/Arcgis/lx.gdb/WuChangJieDaokou_onlyweight", "", "", "", "VEHICLEID A; TIME A")
currentState = ""
f=open('C:/Users/GWJ/Desktop/111.txt','w')
for row in rows:
   currentState = row.VEHICLEID
   f.write(row.VEHICLEID,row.NEAR_X,row.NEAR_Y,row.TIME)

  Runtime error
  Traceback (most recent call last):
    File "", line 7, in
  TypeError: function takes exactly 1 argument (4 given)

  Runtime error
  Traceback (most recent call last):
    File "", line 7, in
  TypeError: expected a character buffer object


texts: How can I store height info from GPS in QGIS?

texts:
I want to use QGIS as a tool for collecting GPS-Data in the field. One use case would be simple surevy tasks where I want to store the three dimensional position of points. QGIS is working fine on the Windows 8.1 Tablet-PC and it is getting NMEA Data from an external GPS-Receiver. The position is shown on the map and I can store points (and lines) but they only contain the two dimensional positional info - so the height information is lost.

How can I QGIS make store the height info?


texts: Animate polygon shapefile using QGIS time manager

texts:
I am looking for a way to use the QGIS plugin "Time Manager" to animate a polygon shapefile.
I have a polygon shapefile that has a field of population per year for each feature and I want the plugin to display the data year by year.

COUNTY_NAME / 2001_POP / 2002_POP / 2003_POP
Madison / 1500 / 2000 / 3000
Guilford / 1500 / 3000 / 4500

I have found tutorials that explains how to do it with a point layer, such as https://www.qgistutorials.com/en/docs/3/animating_time_series.html, but none with polygons.
Any idea?


texts: why when i use from mosaic to new raster the created raster has some pixels with 0 value

texts:
Why when i use from mosaic to new raster the created raster has some pixels with 0 value?
I have 2 map that each of them individually has a value (it is volume of run off for pixels) but when i mosaic them some of pixels -as you see in screen shot- have 0 value! i showed 0 values with purple color.


texts: Reprojecting PostgreSQL/PostGIS data as it streams in?

texts:
I have a postgres/postgis database.

I would like to reproject those data coming to me in 4326 to 32736.

For those tables with lat long info in wgs84 (4326) I have set the geom to 4326. Then I have copied the table and used transform to reproject to 32736.

CREATE TABLE household.a_household_utm AS SELECT * FROM household.a_household;

ALTER TABLE household.a_household_utm
    ALTER COLUMN geom TYPE geometry(Point,32736) USING ST_Transform(geom,32736);

This means that I will have to repeat this every time new data comes in if I want the dataset to be in 32736.

What is the best practice approach for re-projecting all data that is streaming in. Is a trigger function the best? I would re-project each new record on insert/update? I am not sure how I would do this.

You would set the projection of that record imported using the lat/long fields
then reproject it using ST_TRANSFORM

something like?

CREATE OR REPLACE FUNCTION hh_geom_lon_lat() RETURNS trigger AS
$$
BEGIN
  NEW.geom = ST_Transform(
    ST_GeomFromText('POINT(' || NEW.longitude || ' ' || NEW.latitude || ')', 4326),
  32736);
  RETURN NEW;
END;
$$
LANGUAGE plpgsql VOLATILE;

how would you set the table projection initially?


texts: Creating sum layers by summing field values from *.dbf files using ArcPy?

texts:
I have 490 consecutive daily rainfall shapefiles/.dbf files in a single directory. Each consists of a uniform even-spaced grid of 220 points having uniform pointIDs, number of records, field names and datatypes, and a field containing a daily recorded rainfall value (in inches) for each point/record.

I'm trying to read in the first 7 .dbf's from a list, read their rainfall values, sum them up for each record/point, create a new shapefile (ie. weeksum1.shp) having the same table structure as the daily files and containing weekly calculated sums for each record. Repeat for the next 7 .dbf's until 70 weeks (490/7) of data are created.

I've successfully done this by converting the shapefile's to raster, but I have to keep associated attributes for each point which I didn't foresee before spending a lot of time building scripts/models to work with rasters...

I am using ArcGIS 10 (ArcInfo) SP4 with all extensions, ArcPy, Excel 2007


texts: How can use date format with time zone from 8 AM to 8 AM data download?

texts:
How can use date format with time zone from 8 AM to 8 AM data download ?

var inidate = ee.Date.fromYMD(2020,03,17)
var enddate = ee.Date.fromYMD(2020,03,18)

enter code hereenter link here


texts: Process to georeference corners of vector file?

texts:
I am new to QGIS and trying to wrap my arms around it so please bear with me.

I have vector files (DXF) that I need to add back in the georeferencing.  They were edited with Illustrator so I loose all georeferencing when saved as a .DXF. Now I have matching images where I have the corner coordinates.  I would like to use those to put back into the dxf. Is this possible?

I am still reading up on QGIS but have not for a process other that "pixel-point" type referencing which will not work for my needs.

Is there a plug-in perhaps?

Thanks so much.


texts: Performing crop classification without training points (sampling)?

texts:
Just theoretical (and maybe very silly) question - Is it possible to do crop classification (supervised or unsupervised) from multi-spectral camera or SAR without direct nexus with training points or sampling areas?

For example, observing NVDI and trying to find some patterns related to phenological stages?


texts:
I am trying to create Geotiffs on QGIS. I have images(RGB) from a dji phantom 4 pro and images(raw) from a MAPIR ndvi camera. However the two cameras used are not linked.

I wanted to know if you have any tips on how to sync these images pre QGIS combining them into a geotiff for PIX4d?

I currently have more jpgs then mapir raw files.

Also in the MAPIR plugin when creating geotiff what camera should be selected?


texts: Which function for creating a POINT in PostGIS?

texts:
When defining a Point in PostGIS, when do you decide to use which of the following?

ST_SetSRID(ST_MakePoint(lon,lat),4326)
ST_SetSRID(ST_Point(long,lat),4326)
ST_SetSRID(ST_GeomFromText('POINT(lon lat)',4326)
ST_GeomFromEWKT('SRID=4326;POINT(lon lat)')

If its essentially a difference in performance, which will be the fastest?


texts: How to install PostGIS Manager and RT Sql Layer plugins in QGIS 2.4?

texts:
This might be a rather simple question, but both plugins are not visible in my QGIS menu. I'm running 2.4 on Ubuntu 14.04.
Thanks for every piece of advice.


texts: How can I add all the 4 corners as GCP in an image that I want to reproject?

texts:
I am working on a Modis - oceancolor image and I want to reproject it to wgs84. I have the upper left/right and lower left/right values from the metadata of the image and I want to add them all in the command line of gdal_translate or gdal_warp.
But in these two commands I can only add the upper left and lower right lat/long (x,y).

Do you have any idea how I can add all the corners of the image in the script?


texts: MODIS Reprojection Tool - setting projection parameters to UTM Zone South

texts: The MODIS Reprojection Tool (MRT) allows users to input a UTM zone in the projection parameters, yet it defaults to North (e.g., UTM Zone 20N). Is it possible to edit the projection parameters so that MRT will project data to UTM Zone 20S? - note: it does not allow you to enter N or S after the zone


texts: I downloaded Landsat 8 imagery from Earth Explorer for a particular area.  I tried to get it with no cloud cover, but it did not show any results.  The least amount of cloud cover that I could get was 40%.  Is there a way that I can remove the cloud cover in ArcGIS for Desktop 10.5?  I have seen script on how to do it but I cannot figure out how to do it in ArcMap.  Does anyone know how you can remove cloud cover from Landsat imagery in ArcMap?


texts: Returning feature class from Python toolbox

texts:
I am trying to return a feature class (my sample data is a polygon fc) from a Python toolbox and cannot find any information about what I have to set to get it to work. This runs successfully and gives me a record count of 917 but in ArcCatalog in the results window out: <empty> (and the icon looks like a table not a polygon feature class).

import arcpy

class Toolbox(object):
    def __init__(self):
        self.label='BasicOutput'
        self.alias='BasicOutput'
        self.description='BasicOutput'
        self.summary=self.description

        # List of tool classes associated with this toolbox
        self.tools=[BasicOutput]

class BasicOutput(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label='BasicOutput'
        self.description='BasicOutput'
        self.summary=self.description

    def getParameterInfo(self):
        ps=[
            arcpy.Parameter(
                displayName='out',
                name='out',
                datatype='GPFeatureRecordSetLayer',
                parameterType='Derived',
                direction='Output'),
            ]
        return ps

    def updateParameters(self,parameters): return
    def updateMessages(self,parameters): return

    def execute(self,parameters,messages):
        fs=arcpy.FeatureSet()
        fs.load(r'D:\customApps\PaddockGRASP\BasicOutput.gdb/Cadastre')
        arcpy.AddMessage('record count: %s'%arcpy.GetCount_management(fs))
        parameters[0].value=fs

I will then be publishing it as a GP service in ArcGis server, but can't even get it working in ArcCatalog! Using ArcGis 10.2.1.


texts: Layers not showing up together in ArcGIS even when in same coordinate system

texts:
I have two layers in my project and both are being set to same coordinate system. But still they both son't show up together. Can someone please help me out in this.

Projected Coordinate System:    NAD_1983_UTM_Zone_14N
Projection: Transverse_Mercator
False_Easting:  500000.00000000
False_Northing: 0.00000000
Central_Meridian:   -99.00000000
Scale_Factor:   0.99960000
Latitude_Of_Origin: 0.00000000
Linear Unit:    Meter

Geographic Coordinate System:   GCS_North_American_1983
Datum:  D_North_American_1983
Prime Meridian:     Greenwich
Angular Unit:   Degree