texts: Setting Scale Dependent Visibility for WMS in PyQGIS

texts:
This code imports 'MiniScale' mapping from my WMS

miniScale = 'crs=EPSG:27700&dpiMode=7&featureCount=10&format=image/jpeg&layers=9&styles=&url=http://192.000.0.00:0000/wms_service'
miniScaleLayer = QgsRasterLayer(miniScale, 'MiniScale', 'wms')
QgsMapLayerRegistry.instance().addMapLayer(miniScaleLayer)

Using similar code, I can add WMS feeds for all the other mapping types.

Of course, WMS feeds should appear and disappear as the user zooms in and out, and this is achieved via the scale dependent visibility.

How can I specify the scale dependent visibility for these layers? I can manually set this up via the layer's properties dialog, but it'd be great if these layers could be added in with the properties pre-set.


texts: Is it possible to draw labels behind other layers

texts:
According to my information, GeoServer always draws all labels at the end, over all other layers.  Can we configure a label so that it lies behind another layer for example with surface geometries?

So far our attempts have failed...


texts: Getting points from a particular section of point cloud data

texts:
I have a las file and I'm trying to analyze it using ArcGIS/ArcPy. Are there any built-in functions that I can use (maybe using a tool or las data property) to isolate a chunk of points? I want to be able to draw a polynomial on a section of my map and get an array of the points within the shape. It would help if anyone knew functions that could get individual points from a cloud.

I guess more specifically, how do you access the point feature class of a given las/lasd file?

I would like to have a solution that does not require a download.


texts:
I m trying to make QGIS plugin with plugin builder that compare 2 map scale with Input1 and Input2 as input scale and show recommendation after clicked recommendation button.

I wrote my code like this:

class conditionDialog(QtGui.QDialog):
    def __init__(self):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = Ui_condition()
        self.ui.setupUi(self)

        Recomend = self.ui.btnProc
        QtCore.QObject.connect(Recomend, QtCore.SIGNAL('clicked()'),self.Compare1)
        RecSec = self.ui.btnProc2
        QtCore.QObject.connect(RecSec, QtCore.SIGNAL('clicked()'),self.Compare2)
        Smpan = self.ui.btnSave
        QtCore.QObject.connect(Smpan, QtCore.SIGNAL('clicked()'),self.saveAs)

    def Compare1(self):
        input1 = self.ui.lineInput1.text()
        input2 = self.ui.lineInput2.text()
        compare = ''
        if input1 == input2:
            compare = 'Matching'
        else:
            compare = 'Not Matching'
        self.ui.textRec1.setPlainText(compare)

    def Compare2(self):
        dat1 = self.ui.lineCond1.text()
        dat2 = self.ui.lineCond2.text()
        hitung = ''
        if dat1 == dat2:
            hitung = 'Scale is Matching'
        elif dat1 >= dat2:
            hitung = 'Still can be used'
        else:
            hitung = 'Cannot be used'
        self.ui.textRec2.setPlainText(hitung)

    def _save(self, simpan):
        f = open( simpan, 'w' )
        f.write( 'Input 1 :' + "%s" % self.ui.lineInput1.text() )
        f.write( 'Input 2 :' + "%s" % self.ui.lineInput2.text() )
        f.write( 'Recomendation :' + (str(compare)+'\n' )
        f.write( 'Data 1 :' + "%s" % self.ui.lineCond1.text() )
        f.write( 'Data 2 :' + "%s" % self.ui.lineCond2.text() )
        f.close()
    def savefile(self):
        if self.simpan:
              self._save( "%s" % self.simpan )
        else:
              self.saveAs()

    def saveAs(self):
            tulis = QtGui.QFileDialog(self).getSaveFileName()
            if tulis !="":
                _filename = "%s" % tulis
                self._save( _filename )

What must I add to save it to pdf format?


texts:
I'm dealing with shapefiles projected in:

GEOGCS["GCS_WGS_1984",
    DATUM["WGS_1984",
        SPHEROID["WGS_84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.017453292519943295]]

And I am experiencing technical difficulties to calculate a distance in (kilo)meters between two features. I can only get this distance in degrees.
Here's my code:

def PointsOnLines(self, pointsLayer, linesLayer):
    """ Returns the number of points situated on lines+(line.width) """
    # pointsLayer: shapefile's layer with point geometries
    # linesLaye: shapefile's layer with line geometries

    nbFound = 0
    for i in range(pointsLayer.GetFeatureCount()):
        pointFeat = pointsLayer.GetNextFeature()
        pointGeo = pointFeat.GetGeometryRef()

        for j in range(linesLayer.GetFeatureCount()):
            lineFeat = linesLayer.GetNextFeature()
            try:
                lineGeo = lineFeat.GetGeometryRef()
                lineWidth = lineFeat.GetFieldAsDouble("WD1") # Gets the width of the line segment (meters)
            except:
                pass
            d = lineGeo.Distance(pointGeo) # Computes the shortest distance between the 2 geometries (degrees)
            # if d<lineWidth then point is on the line, nbFound+=1

Should I reproject the shapefile and calculate afterwards? Ans if so, which projection is best suitable (=>meters units)?
Note that I can't use this post because I don't even know the 2 points I'm currently working with.


texts:
I have a series of lines which I need to 'top and tail' to remove the first and last x meters as roughly illustrated below with buffers of 200 m.

library(geojsonio)
library(rgeos)
gurl <- "https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/leeds-cents.geojson"
cents <- topojson_read(gurl)
gurl <- "https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/line1.geojson"
l1 <- topojson_read(gurl)
l2 <- gDifference(l1, cents)
plot(l2)

Problem: It should only remove the beginning and end of the line and not chop it in two.

Edit: this is a more complex reproducible example

Reproducible example illustrating how to clip the lines:

library(geojsonio)
library(rgeos)
gurl <- "https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/leeds-cents.geojson"
cents <- topojson_read(gurl)
gurl <- "https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/leeds-lines.geojson"
routes <- topojson_read(gurl)

out <- gDifference(routes, cents)
plot(routes)
plot(out, col = "grey", add = T)

the problem with this is that it cuts some lines in half. So the question is how can I clip only at the beggining and the end of lines without chopping lines in two?


texts: Cutting many lines (as rivers) that are outside of a polygon in QGIS

texts:
I would like to extract only the vector lines, that represents rivers in my case, inside a polygon. I tried to use the intersection and clipping from QGIS, but couldn't do it.
Any help?


texts: Is it possible to move/shift an annotation to a new XY using Python?

texts: Real quick question, I was wondering if it is possible to move/shift an annotation to a new XY using Python.


texts: "Zoom to search result" function in qgis2web?

texts:
I'm a beginner in GIS and have almost no experience in coding but I'm slowly working my way through everything. Right now I'm trying to make an exported qgis2web map a bit more interesting by setting a function that when you search for an address you automatically zoom in to your search result (similar to google maps). The function does not exist in the qgis2web plugin but I bet I could modify a line of code so the map actually does this?

The map will be exported in Open Layers (Leaflet doesn't work, but that is a separate issue).

I have a map of my home town with a layer of points on all the relevant addresses and their coordinates.

This is my exported qgis2web project if it helps: https://we.tl/t-1YE2Cx72ZK


texts:
Currently passing a Geoserver cql_filter to leaflet with a form and button but getting an error of "ReferenceError: DWITHIN is not defined" returned back from the browser when clicking the button my function is attached to.

My function is in a seperate javascript file:

    //Pylon Search Button
    function updatePylons() {
            var pylonFilter = DWITHIN(geom,collectGeometries(queryCollection('Inyaninga_243-198:proposed_pylons_3857','geom',"id = '" + document.getElementById("Pylon").value + "'")),0.05,kilometers);
            return proposed_pylons.setParams({CQL_FILTER:pylonFilter});
    };

The form in the html:

<form>
    Pylons:<br>
    <input type="text" id="Pylon">
    <input type="number" id="distance">
    <input type="button" value="Filter" onclick="updatePylons()">

Anyone had any experience with this? The form parameters are meant to pass to the cql_filter as user input and then update when the button is clicked. However, the DWITHIN is not defined error occurs when clicking the button.


texts: buffering very short line segments with a flat end

texts:
I need to buffer a collection of line segments, with a flat shape (corners) at the line ends, as opposed to round. 99% of them work fine in ArcGIS, but some individual line segments are quite short (2-80cm long) and these fail (output is empty geometry) if the buffer widths I am creating is sufficiently large compared to the length of the line segment--some buffers are up to 30m wide. This appears to be a know issue with Arcgis: see this documentation. The result I am wanting is a very long, skinny rectangle with the long axis being the buffer distance x2 (e.g. a 30m buffer on both sides of the line segment).

I tried to do this in QGIS, as in this link, but I only seem to have access to v.buffer, not v.buffer.distance, which has more options for buffer end types. The client specifically wants flat ends on the buffers, not round.

This image shows what I'm trying to achieve. On the left is a short line segment. In the middle is the output I want: a buffer of 30m on either side of the line. This can be done in ArcGIS, but if the buffer width is too large, it creates empty output as I mentioned above. On the right is the buffer created by QGIS and v.buffer.distance. It does not seem to matter what options I choose, it always creates round buffers.

Any suggestions?


texts: Confirm presence of Slivers / gaps between geometries

texts:
Working on ArcGIS 10.7

I have a layer in which, when looking from a certain distance, some aligned white dots appear between two entities (in the image below, the black entity - a road - is formed by 2 parallel geometries, one for each lane):

When I zoom in, however, the white dots disappear. This makes me wonder if the dots are caused by topological errors or just by the software's plotting resolution. I have run "repair geometries" and the points are still there. The layer represented and the data frame both have the same CRS.

What would be an explanation of this / a way to check what it can be causing it?


texts: In PostgreSQL, how to get the polygon id that "intersects the most" in case it intersects multiple polygons?

texts:
So let's say I'm creating a polygon table taking attributes from multiple polygon tables. For argument's sake let's say one is a country polygon table and one is a mountain table

On my mountain table I have the Alps, and I want to give it the country in which the Alps is covered by the most

create table as select a.id, a.mountain, b.country
from mountaintable a, countrytable b
where st_intersects???

How to make it return the needed result?


texts: .prj (Srtext) to proj.4 for custom projection using local grid, error ' no translation for LOcal to proj.4 format is known'

texts:
I have to transform the local reference system with the following SRtext parameters:

PROJCS["Sagalassos Local Grid",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],
PROJECTION["Local"],PARAMETER["False_Easting",2500.0],
PARAMETER["False_Northing",2500.0],
PARAMETER["Scale_Factor",1.0],
PARAMETER["Azimuth",0.0],
PARAMETER["Longitude_Of_Center",30.5200246520608],
PARAMETER["Latitude_Of_Center",37.6767593942953],
UNIT["Meter",1.0]]');

If I try gdal to get the information, it gives me the error: No translation for LOcal to proj.4 format is known.


texts: How to work within ArcGIS image server export limits?

texts:
I need to clip out a region of an arcgis image service that is larger than the export limit. I'm not trying to defeat copy protection or anything of that nature. The data is from a service belonging to our organization, though beyond my admin control.

I could ask the admin to temporarily change the export limits, but for various reasons don't want to. (It would add to his already overloaded inbox, take longer, open up the server to abuse from all comers and thereby possibly bring it to it's knees, possibly not even work as a single export, etc.).

Has anyone developed a script or add on that could, for example, divide the area of interest extent into a tile grid of X by X cells at raster resolution, zoom to each, and export current extent for each?


texts: Changing codes in Subtypes of Geodatabase using ArcGIS Desktop?

texts:
I've created a subtype field in my attribute table, but now I want to change the codes.

How do I do that?

ArcCatalog doesn't enable editing my subtype.


texts: Change multiple polygons' area from square degrees to square meter in attribute table with QGIS

texts:
I imported an ESRI personal geodatabase vector file (.mdb file) into QGIS, when I open the attribute table, it seems the the shape_area unit is in square degree.
I changed the project properties to a projection rather than WGS84.
But the units remain in square degree.
Is there a method that can convert all the data shape_area unit to square meters, then I can save it easily as csv file with square meters instead of square degree?
And should one be clever to choose the correct projection to a country to get the true areas or is there a universal projection?
The file contains administrative divisions.


texts: SRID for New York City 2010 Census Shapefile

texts:
I pulled the New York City census tract PostGIS from Todd Schneider's work, but I am struggling to find the correct SRID.

  PROJCS["NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",984250.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-74.0],PARAMETER["Standard_Parallel_1",40.66666666666666],PARAMETER["Standard_Parallel_2",41.03333333333333],PARAMETER["Latitude_Of_Origin",40.16666666666666],UNIT["Foot_US",0.3048006096012192]]

When I upload the above contents of the PRJ file to prj2epsg as suggested by this SE question, for instance, it fails to find a match.


texts: not all OSM polygons downloading in QGIS

texts:
I have been trying to download all of the polygons contained within OSM for a particular extent of the city.

When I do this through > Vector > OpenStreetMap > Download Data, however, many polygons are left out.

For example, this is the result that I get:

However, when another person used downloaded data from the same extent, the result was much more complete (the green polygons are the ones that are missing from my download):

If we look at the data over an OSM map, we see that indeed those polygons that did not download for me do exist:

What am I missing?


texts: How to add a layer to Web AppBuilder at run-time

texts:
ArcGIS Server Web AppBuilder is intended to show layers which were first compiled into an ArcGIS Online web map:

  Data content for Web AppBuilder is defined and based on web maps

Is it possible to add a layer directly from ArcGIS Server using the unsupported Local Layer Widget, which allows feature, dynamic and tiled layers to be configured directly from their ArcGIS Server REST endpoints, but this needs to occur before the web app is published - the layer definitions are published with the app.

How can I allow the user to add a new layer to a map created by ArcGIS Server Web AppBuilder? The changes do not need to be persisted between sessions.

For example, is there an Add Data widget? Can I add the layer via URL parameters?


texts:
I am having trouble installing the QField Sync plugin to work with the great QField android app. and would like assistance doing so. The steps I have followed thus far are reproduced below.
(Using QGIS 2.18 via OSGEO4w installer on Windows 7)

When I attempt to install it through the Plugin Manager I get an error message telling me to install the "QGIS2compat" plugin:

http://i.imgur.com/ZilPcBg.png

I select "uninstall" plugin from this dialog.

Then I install the "QGIS2compat" plugin which seems to work properly:

However if I then attempt to install the "QField Sync" plugin afterwards (without restarting) I get the following message:

http://i.imgur.com/Ifi2rMM.png

So I uninstall and, after restarting QGIS (having installed "QGIS2compat" and not "QField Sync") and before QGIS loads fully I get the following error message and "Processing Toolbox" is disabled:

http://i.imgur.com/sajANgT.png

When I try to install the "QField Sync" plugin now, I get the same "UIC" error message as above but I leave it installed anyway and the Plugin Manager tells me that it is "broken" - I also can't find it in any of the Plugin panels/toolbars.

http://i.imgur.com/b1HQkfP.png

So I restart QGIS and get the following error messages in the Log from start up:

http://i.imgur.com/dUtBdAN.png

So I uninstall "QGIS2compat", restart QGIS, the "Processing toolbox" returns but I still have no "QFIELD Sync".

Can anyone help me to install "QField Sync" properly?

[EDIT: Further to the above, now using QGIS version 2.18.11 win7, following similar steps to above, I get the following error:

http://i.imgur.com/d20SKfQ.png]


texts:
I have been working on a vector-based spatial analysis in R using shapefiles.
I wish to use some environmental data that is downloadable, however it is only available in raster format (FLT & HDR files).

I have no experience of working with rasters. How can I work with these files and combine with the shapefiles for further analysis?


texts: Legend not scaling with the map in Mapinfo

texts: I have a problem with the legend designer, when I produce an A0 plot the legend does not scale up with the map.


texts: import error of qgis.core even though PYTHONPATH set up with system environment variable

texts:
I made the environment variables as described here: How2 Import
Though I still receive this error:

C:\>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import qgis.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\OSGeo4W64\apps\qgis\python\qgis\__init__.py", line 27, in      <module>
from qgis.core import QgsFeature, QgsGeometry
File "C:\OSGeo4W64\apps\qgis\python\qgis\core\__init__.py", line 30, in <module>
from qgis._core import *
ImportError: DLL load failed: Det angivne modul blev ikke fundet.
 >>>

This is my environment PYTHONPATH string:

 C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\include;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\python\qgis\core;C:\OSGeo4W64\apps\qgis\bin\qgis_core.dll;C:\OSGeo4W64\apps\qgis\bin;C:\Program Files\QGIS Essen\bin\qgis.bat;C:\OSGeo4W64\apps\Python27\Lib\site-packages;C:\OSGeo4W64\apps\qgis-rel-dev\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\qgis\python;C:\OSGeo4W64\apps\qgis-dev\bin

As I have checked, "qgis_core.dll" is located in "C:\OSGeo4W64\apps\qgis\bin" which is the first variable.

[Edit]
I installed Qgis 2.16 through OSGeo4W


texts: Capacitated Vehicle Routing Problem with Categories

texts:
My problem resembles the capacitated vehicle routing problem but there is an aspect to it to which I've been unable to find a solution in tools like ESRI's Network Analyst.

The problem is to find the optimal route(s) in a network to visit target locations belonging to different categories, all of which have a given number of locations that must be visited. The issue is selecting the set of targets from a much larger group of target candidates resulting in the optimal route. Starting location is fixed.

Here's another way to describe the problem. A vehicle has items belonging to different categories and all of the items must be delivered. There are many destination candidates each having demand for one item from one of the categories. The vehicle has relatively few items, hence all the demand can't be satisfied and we need to find the destinations to which all of the items can be delivered with minimal cost.

How would you esteemed GIS folks approach this task?

Many thanks!


texts: How do I import domains into a feature class from a table in ArcGIS 10.2.2?

texts:
I have a table in a geodatabse which contains coded domain values.

I also have a feature class in the same geodatabase where I'd like to load those domain values.

There are hundreds of codes so I want to automate this process.

I've looked at the docs for Table To Domain to no avail. The issue is that after I run Table To Domain and select to output to the geodatabase of interest, I don't know what to do next. The result of running the tool seems to be nothing.

Is there anyway to load the coded values from a table (or an excel spreadsheet) into the domains of a feature class? You can see a sample of my workflow below.


texts: Accuracy assesment of an automatic line digitizer!

texts:
I have a polyline map which I extracted automatically and I want to compare it with another polyline map which I extracted manually in order to evaluate the accuracy of the automatic method. (my study area is not on Earth so there is no ground truth). Generally accuracy assessments is based on a confusion matrix and classes, but I don't have any classes here, they are two series of lines, which I want to see how close is the automatic polyline results to the manual one! I have only position of the lines, I can extract their length, sinuosity, orientation.

Any suggestion for accuracy assessment in this case?


texts: JSAPI help with query returning results from feature layers with a specified named column

texts: I have a workflow that results in generating a report for certain features with a column name. Goal is to return only results from feature layers in my map service which have a specified column name. User clicks a location on the map service and the queryTask begins... I'm trying to move my coding format to AMD and am using JSAPI 3.7 with 10.2 map service. I've included a JSFiddle link for the intent on sharing the code. Hope that's okay and thanks in advance! JSFiddle Link


texts: Processing a Sqlite table in standalone QGIS application

texts:
I have been trying to use a single table of a Spatialite db in a standalone Python application. I have run it through the QGIS interface to find how it used the input pathway, which was: 'dbname=\'C:/path/to/inputs.sqlite\' table=\"inputs_table\" (geom) sql=' (full code below). However, using this command as part of the code produces an error saying that it cannot be found. I've had a look, but I cannot find any links that state how to use a spatialite table in this way. The table is definitely in the database.

The error is:

_core.QgsProcessingException: Unable to execute algorithm
Could not load source layer for INPUT: dbname='C:/path/to/inputs.sqlite' table="input_table" (geom) sql= not found

Full code used:

processing.run("qgis:heatmapkerneldensityestimation",
        { 'DECAY' : 0, 'INPUT' : 'dbname=\'C:/path/to/inputs.sqlite\' table=\"inputs_table\" (geom) sql=',
                        'KERNEL' : 0,
                        'OUTPUT' : 'C:/output.tif', 'OUTPUT_VALUE' : 0, 'PIXEL_SIZE' : 50, 'RADIUS' : 100,
                        'RADIUS_FIELD' : None, 'WEIGHT_FIELD' : None })


texts: Issue with vector grid and calculating area QGIS

texts:
I'm trying to determine the area of occurence from a large polygon superimposed onto 2km x 2km grids. The goal is to have a slightly coarser answer then a straight area of the original polygon as the final area calculated will be the sum of all the grids that touch the polygon multiplied by 4 square km.

I tried to do this by creating a vector grid of 2000m x 2000m and then clipped the vector grid with the original polygon to get a total number of grids. I then multiplied it by 4. But the issue I'm having is that the area of the grids is smaller then the original. This shouldn't be as all the small slivers of the grids on the exterior of the shape should be counted as full size.

Then I have 251889 attributes, which multiplied by 4 turns out to be smaller in area then the original underlying polygon.

I created the vector grid with the following set up. The grids are 2000m by 2000m.

I double checked this by adding an area field to the attribute table to check.

The whole underlying polygon is 1,019,761.79 km2. And the area of the sum of vector grids touching that polygon is 251889*4=1,007,556 km2.

Do the lines have thicknesses? Is that where the missing area has gone?


texts:
My version : PostgreSQL 8.4.1/PostGIS 1.4.0

I want to perform multiple spatial joins between a layer of polygons (geo_act.coop_world_country - 250 entities) and two point layers to count the numbers of points in each polygon.

The first join (ST_Intersects function) works with the following code:

SELECT t1.cntry_name
    ,COUNT(t2.shape) as "PoleCompet"
FROM geo_act.coop_world_country t1
LEFT JOIN geo_act.coop_partenariat_union_polecompet t2
    ON ST_Intersects(t1.shape, t2.shape)
GROUP BY t1.cntry_name
ORDER BY t1.cntry_name;

How do I add in my request a second ST_Intersects spatial join? This code does not work, the results are cumulative :

SELECT t1.cntry_name
    ,COUNT(t2.shape) as "PoleCompet"
    ,COUNT(t3.shape) as "Entreprise"
FROM geo_act.coop_world_country t1
LEFT JOIN geo_act.coop_partenariat_union_polecompet t2
    ON ST_Intersects(t1.shape, t2.shape)
LEFT JOIN geo_act.coop_partenariat_union_entreprises t3
    ON ST_Intersects(t1.shape, t3.shape)
GROUP BY t1.cntry_name
ORDER BY t1.cntry_name;


texts: Solving color correction of LISS IV Multispectral image

texts:
I have a LISS IV multispectral images (radiometric resolution of 10 bit per pixel) taken in different months 4 tile in January and 2 tiles taken in February.
While mosaicing, I got a different color for the image taken in February while other images taken in the month of January does fine. I tried color correction using histogram matching as well as an image dodging in ERDAS Imagine but not satisfied with the result. Attached is the screenshot of the image.
Is there any way to get past this problem?


texts: QGIS 2.2 Attribute editor layout "Drag and Drop designer" field does not exist in datasource

texts:
I am experimenting with a new feature available since version 2.2 "Relations" where foreign key relations from a database can be documented, so that the QGIS UI can (auto) generate its attribute editor layout in Master-Detail / Parent-Child forms. We are trying to style a layout for:

one Master/Parent Table (Properties [with geomety])
and a number of Detail/Child Tables:
Parcels [with geomety]
Rights
Actions
Documents

The relationships between these layers can be defined in Project:Project Properties:Relations. Note that all child layers/tables have a single column foreign key (called "bau_guid"), all refering to the single column primary key (also called "bau_guid").

When we select "Autogenerate" for the Attribute editor layout of the Master Table/Layer Properties, QGIS will automatically generate a UI with information of the Master (Properties) and the detail layers vertical master-detail layout which can be navigated

If you want to navigate master-detail-detail relations, space will become an issue in the layout, so you can also revert to Drag-and-Drop Layout, which will create Tab pages for all detail layers.

When a change is made to the layout (even if it concerns an attribute unrelated to relations), there is a problem with the DragAndDrop tabulated layout, an error message "Error: Field does not exist in datasource" appears in the place of the detail layer/relation.

Only when I remove all "relations" from the drag and drop definition and "drag and drop" them again and "in one go" it seems to work again, until the next time anything changes in the layout.

How can we solve / work around this error?


texts: Requesting only features within bbox from WFS

texts:
I'm trying to use PyQgis to query a WFS-service and return the items found within a certain bounding box.

When entering the following uri in the browser, it returns a xml with a limited set of results

uri = 'https://geoservices.informatievlaanderen.be/overdrachtdiensten/GRB/wfs?request=getFeature&srsname=EPSG:31370&typename=GRB:ADP&BBOX=183918,186419,184189,186632,EPSG:31370'

Using PyQgis I wish to load this into QGIS (3.4.3):

layer = QgsVectorLayer(uri, "WFS_Layer", "WFS")
print(layer.isValid())
project = QgsProject.instance()
project.addMapLayer(layer)

The layer which loads, loads all the data within my view extent, not just the data I requested in BBOX.
Afterwards I need to get some attributes of the loaded data, therefor I wish to limit the amount of data, as loading times easily get too high.

Is this a bug or am I doing something wrong?

EDIT:

Reading the link below, I think it's a chosen behaviour in the Qgis implementation. Is there any way to circumvent this?
https://issues.qgis.org/issues/8871

I also tried the solution provided in the question below, but had no luck.
Why doesn't QGIS show the results from a WFS BBOX from a Python script


texts:
Considering my program is generating a shapefile that has to be added to the "Layers" tab in QGIS interface. However, once the utility of the layer is completed, I need to remove the layer in the middle of the code. I want to remove only the active layer and not all.

To put it in easier words, is there an opposite to self.iface.addVectorLayer() ?


texts: High resolution SAR for Sea Surface Salinity near coasts (Sentinel 1)

texts:
Microwave remote sensing missions such as ESA's SMOS are used to compute variables such as soil moisture and sea surface salinity, using the dielectric constant. This is done on large spatial resolutions of +25km.

However, high resolution SAR data is now available from (e.g.) Sentinel 1. While Sentinel 1 data is widely used for determining soil moisture properties, I cannot find any applications in which it was used to determine salinity properties of (coastal-) waters.  Little to no literature can be found about this.

Am I missing any obvious reasons (maybe radar-related limitations) why this is not already done?


texts: QGIS3 application not there after installing

texts:
I installed QGIS3 on my computer at work. The installation was completed without errors. But there is no QGIS application on the computer. The folder exists though, and it also contains all the other files, just not the QGIS application itself. If I search for it or try to open a .qgz file, the application is not there.
I tried installing 3.4 and 3.8, also through "install as administrator", but I always get the same result.
The computer runs on Windows 7 with 32bit.
What can I do to solve this?
 [![enter image description here][1]][1]

Solved: I ran OSGeo4W.bat and entered "qgis".
QGIS still doesn't appear anywhere, but this way I can open it.


texts:
I am very new to Python and have no idea about how to write a python loop to do selections for ArcGIS. I already finished writing selection codes with different conditions. Is there anyone helping me revise my codes with a python loop?

import arcpy
arcpy.env.workspace = "D:/STAR/STARproject.gdb"
arcpy.MakeFeatureLayer_management('wqi_Conshp_clip27171','wqi_Conshp_clip27171')

#Select level 1 gridcode<=14.3
selection1 = '"gridcode"<=14.3'
arcpy.SelectLayerByAttribute_management('wqi_Conshp_clip27171','NEW_SELECTION',selection1)

arcpy.Statistics_analysis('wqi_Conshp_clip27171','stats27171wqi_Conlevel1',[["Shape_Area","sum"]])
#summarize the selected features
arcpy.AddField_management('stats27171wqi_Conlevel1','rate','DOUBLE')
arcpy.CalculateField_management('stats27171wqi_Conlevel1','rate','!SUM_Shape_Area!/{}'.format(Sum_Area27171),'PYTHON_9.3')
#Sum_Area27171 is a variable and already defined in the workspace

#select level 2 14.3<gridcode<=25.6

selection2 =  '"gridcode">14.3 AND "gridcode"<=28.6'
arcpy.SelectLayerByAttribute_management('wqi_Conshp_clip27171','NEW_SELECTION',selection2)

arcpy.Statistics_analysis('wqi_Conshp_clip27171','stats27171wqi_Conlevel2',[["Shape_Area","sum"]])

arcpy.AddField_management('stats27171wqi_Conlevel2','rate','DOUBLE')
arcpy.CalculateField_management('stats27171wqi_Conlevel2','rate','!SUM_Shape_Area!/{}'.format(Sum_Area27171),'PYTHON_9.3')

#select level 3 28.6<gridcode<=42.9

selection3 =  '"gridcode">28.6 AND "gridcode"<=42.9'
arcpy.SelectLayerByAttribute_management('wqi_Conshp_clip27171','NEW_SELECTION',selection3)
arcpy.Statistics_analysis('wqi_Conshp_clip27171','stats27171wqi_Conlevel3',[["Shape_Area","sum"]])

arcpy.AddField_management('stats27171wqi_Conlevel3','rate','DOUBLE')
arcpy.CalculateField_management('stats27171wqi_Conlevel3','rate','!SUM_Shape_Area!/{}'.format(Sum_Area27171),'PYTHON_9.3')

#select level 4 42.9<gridcode<=57.2

selection4 =  '"gridcode">42.9 AND "gridcode"<=57.2'
arcpy.SelectLayerByAttribute_management('wqi_Conshp_clip27171','NEW_SELECTION',selection4)

arcpy.Statistics_analysis('wqi_Conshp_clip27171','stats27171wqi_Conlevel4',[["Shape_Area","sum"]])

arcpy.AddField_management('stats27171wqi_Conlevel4','rate','DOUBLE')
arcpy.CalculateField_management('stats27171wqi_Conlevel4','rate','!SUM_Shape_Area!/{}'.format(Sum_Area27171),'PYTHON_9.3')

#merge these results
arcpy.Merge_management(['stats27171wqi_Conlevel1','stats27171wqi_Conlevel2','stats27171wqi_Conlevel3',
                    'stats27171wqi_Conlevel4'],'stats27171wqi_ConMerge')

As you can see, there are four conditions above. Actually, I have another three similar conditions. I am wondering how to combine these selections together with a loop in python to make the work as simple as possible.


texts: Points being reduced to grid upon becoming a Feature Class

texts:
I have multiple points in a state plane that were collected and are currently being stored in Lat/Long. When I display XY data from the table, it looks great. I then have a shapefile of those points, which still looks exactly like they were collected. Only upon the points entering the feature class do they end up reducing to a grid, and the points become assigned to their nearest point rather than the location in the table.
This happens no matter which way I try and insert the points into a GDB.
Is there a setting I have turned on or something?
I've turned plenty of tables into feature classes with no issues.
I've attached an image below showing the original shapefile and what it is converted into upon becoming a feature class in the GDB.


texts: Multiple GeoJSON filter based on properties in Leaflet by button -- work with only first Property

texts:
I am trying to filter my geoJSON layer (school) based on those properties:

Type ( primary - preparatory - high )
Time ( day - night - alltime  )
Gender ( male - female )

What I need :
After user choose the properties and click the filter button
school appear depend on the the properties.
But that happens:
Filter button works just with "Type ( primary - preparatory - high )"
and if I uncheck  other  properties  There is no effect
This photo for map and chekbox

All Code in
codepen : https://codepen.io/A_Abdelwahed/pen/BaKJEGy
jsfiddle : https://jsfiddle.net/Ahmed_Abdelwahed/0yxtoh8w/
HTML code for input
 School type

<input type='checkbox' name='fltschooltype' value='primary' checked>primary

<input type='checkbox' name='fltschooltype'  value='preparatory' checked>preparatory

<input type='checkbox' name='fltschooltype'  value='high' checked>high

 School time

<input type='checkbox' name='fltschooltime' value='day' checked>day

<input type='checkbox' name='fltschooltime'   value='night' checked>night

<input type='checkbox' name='fltschooltime'   value='all-time' checked>all time

 School gender

<input type='checkbox' name='fltschoolgender'   value='male' checked>male

<input type='checkbox' name='fltschoolgender'   value='female' checked>female

<button id="btnProjectFilter" >Filter</button>

Script code is
var schoolLayer = L.geoJson(schoolGeoJson, {
    pointToLayer: schoolMarker,
    filter: filterhotels
}).addTo(map);

function filterhotels(json) {
    var schooltypeFilter = [];
    $("input[name=fltschooltype]").each(function () {
        if (this.checked) {
            schooltypeFilter.push(this.value);
        }
    });
    $("input[name=fltschooltime]").each(function () {
        if (this.checked) {
            schooltypeFilter.push(this.value);
        }
    });

    $("input[name=fltschoolgender]").each(function () {
        if (this.checked) {
            schooltypeFilter.push(this.value);
        }
    });

    var att = json.properties;
    switch (att.Type) {
        case "primary":
            return (schooltypeFilter.indexOf('primary') >= 0);
            break;
        case "preparatory":
            return (schooltypeFilter.indexOf('preparatory') >= 0);
            break;
        case "high":
            return (schooltypeFilter.indexOf('high') >= 0);
            break;
    }

    var att = json.properties;
    switch (att.Time) {
        case "day":
            return (schooltypeFilter.indexOf('day') >= 0);
            break;
        case "night":
            return (schooltypeFilter.indexOf('night') >= 0);
            break;
        case "all-time":
            return (schooltypeFilter.indexOf('all-time') >= 0);
            break;
    }

    var att = json.properties;
    switch (att.Gender) {
        case "male":
            return (schooltypeFilter.indexOf('male') >= 0);
            break;
        case "female":
            return (schooltypeFilter.indexOf('female') >= 0);
            break;
    }
}
$("#btnProjectFilter").click(function () {
    schoolLayer.clearLayers();
    schoolLayer.addData(schoolGeoJson);

});


texts: How to get default parameter value for script tool from csv file?

texts:
I am fairly new to python scripting. I have just figured out how to read and write input parameters for a python script from a csv file. Now I am being asked to pre-populate the script tool dialog in toolbox with values from the csv, so that the user can see right away what the parameters are in the csv and does not have to browse to them. My hunch is that this might work with the tool validator class, but I don't even know how to start with that.
Has anybody tried something similar before? Any help would be appreciated. Thanks!

Update: I was able to solve the problem. Please see my code below.(Note: that there is also a CVSHelper class, that is not shown in this code)

source_csv_file_path = str("C:\\Tool_Sources.csv")
source_csv = CSVHelper(source_csv_file_path)
source_csv_data = source_csv.read_csv_dict()

class ToolValidator(object):
  """Class for validating a tool's parameter values and controlling
  the behavior of the tool's dialog."""

  def __init__(self):
    """Setup arcpy and the list of tool parameters."""
    self.params = arcpy.GetParameterInfo()
    #Group the following parameters in the dialog box
    self.params[0].category = "Defaults"
    self.params[1].category = "Defaults"
    self.params[2].category = "Defaults"
    self.params[3].category = "Defaults"
    self.params[4].category = "Defaults"

  def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""
    if not os.path.exists(str(source_csv)):
        self.params[0].value = str(source_csv_data[0]["Workspace"])
    self.params[1].value = str(source_csv_data[0]["feature class1"])
    self.params[2].value = str(source_csv_data[0]["feature class2"])
    self.params[3].value = str(source_csv_data[0]["feature class3"])
    self.params[4].value = str(source_csv_data[0]["SQL"])
    return

  def updateParameters(self):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parameter
    has been changed."""
    return

  def updateMessages(self):
    """Modify the messages created by internal validation for each tool
    parameter.  This method is called after internal validation."""
    return


texts: Filtering out class from high resolution map in lower resolution map?

texts:
I have a soil sealing fraction map (SSF) with a resolution of 30 meters and a high resolution land cover map (HRLC) with a resolution of 5 meters.
I would like to use the HRLC map to filter some classes out of my SSF.

What is the best way of aggregating the land cover map to a lower resolution in order to do this ?

Or is it better that I resample my SSF to 5 meter resolution, filter out the classes, and aggregate the map to 30 meters again ?

EDIT : I want to filter out roads by this technique. So my second option won't work without corrupting the pixels next to roads.


texts: Problems filtering using multiple parenthetical expressions in QGIS 2.18 OSX Yosemite

texts:
I'm not a QGIS power user but I've been using it for simple things for quite a while. I just updated from QGIS 2.14 to 2.18  yesterday in order to be able to edit field names. I'm now having some problems with filtering using multiple bracketed expressions that I don't think I had before, but it had been a little while.

For example, I'm trying to filter this parcel data shapefile by land use codes (which are an integer64 field, so they are numerical). The shapefile has 399212 records. When I apply the filter

("15USE">=1000 and "15USE"<=2900) or ("15USE" >= 7000 and "15USE"<=7900) or ("15USE"=8901)

shown below, it does not filter out any records:

Strangely, the exact same expression, copied and pasted into the Select by Expression Builder, selects a subset of the records (about 200,000 or so):

For what it's worth, the "isselected" function does not appear to serve as a workaround - I've never gotten it to work, despite reading about it on here:

What am I missing here? Did the filtering syntax change? I know that queries/filters have always been less sophisticated than selection expressions, but this is weird. Or am I (more likely) doing something wrong?

Mac OS X Yosemite; 2011 MacBook Pro, 8GB upgraded memory, 500 GB upgraded SSD; QGIS: 2.18


texts: Mapserver mapfile with multiple layers that pull from postgis only gives broken image

texts:
I'm trying to use this mapfile that I made:

MAP
  IMAGETYPE PNG
  EXTENT -90.000124 41.000032 -88.000044 42.000035
  SIZE 1600 800
  IMAGECOLOR 255 0 1

OUTPUTFORMAT
  NAME png
  DRIVER AGG/PNG
  MIMETYPE "image/png"
  IMAGEMODE RGBA
  EXTENSION "png"
  FORMATOPTION "GAMMA=0.75"
 TRANSPARENT ON
END

LAYER
  NAME poly
  STATUS OFF
  TYPE POLYGON
  CONNECTIONTYPE POSTGIS
  CONNECTION "host=127.0.0.1 dbname=matt user=postgres password=postgres"
  DATA "the_geom from g41088"
  OPACITY 50
    CLASS
      NAME g41088P
        STYLE
          COLOR 200 200 200
          OUTLINECOLOR 0 0 0
        END
    END
END

#LAYER
#  NAME line
#  STATUS OFF
#  TYPE LINE
#  CONNECTIONTYPE POSTGIS
#  CONNECTION "host=127.0.0.1 dbname=matt user=postgres password=postgres"
#  DATA "the_geom from g41088"
#   CLASS
#     NAME g41088L
#       STYLE
#         COLOR 0 0 0
#       END
#   END
#END
END

But it only works when I have the second layer commented out. I can't figure out for the life of me what's wrong with it. I'm trying to do the same thing that this tutorial is doing, but with PostGis support.


texts: I have a bit of a problem that I need help with. I am looking at a set of lat/long with a time stamp for the desired pickup or drop-off for passengers. There are multiple pick-ups and drop-offs within a service area that has these attributes. On top of that I need to be able to allow for picking up one passenger and then pickup another, while allowing for the shortest time-frame (distance to keep it simple) for drop-off at desired locations. In other words, there are multiple dropoff and pickup locations, and I want to maximize efficiency in scheduling these with the desired time, some flexibility (10min. + or -).  I am thinking that I would need to use pg_Routing (or similar) in QGIS or the Network analyst extension in arcgis, but I have limited experience in these and was wondering what the best approach might be to tackling such a task. Is this possible with these tools?


texts:
I'm using QGIS 3.8.2. I have a set of lines which represent a road network. However as I have taken different layers from different data sources the lines which represent the same road don't overlap. An example is given below:

This issue has turned out to be problematic for the analysis that I am supposed to do. Is there any way in which I can solve this problem so that lines representing the same road overlap.


texts:
Has anybody locate any kml, shp or gpx file with the complete European trail E4 ?

Lots of google search navigates me to nowhere ...


texts: (How) can I render the features of a DynamicMapServiceLayer?

texts:
I have a webmap that displays the contents of a dynamic map service.  For performance reasons I'm currently using FeatureLayers for the individual sublayers (they are all point layers with relatively few features).

However, this makes them show up in the legend as individual items, e.g.:

Layer 1
Layer 2
Layer 3
Layer 4
Layer 5

when I'd like to group them as they are in the original service:
Group 1

Layer 1
Layer 2

Group 2

Layer 3

Group 3

Layer 4
Layer 5

Is there a way to load a whole service as with DynamicMapServiceLayer, but use FeatureLayer rendering for the sublayers?


texts: R.Mapcalc giving only blank maps as result

texts: No matter what function I put in the r.mapcalc in the GRASS GUI I get a blank map full of null values. I even tried DEM+0 (I can see my DEM) and this also yielded a blank map.


texts: Connecting points with line in a specific sequence

texts:
I have 6 points in one layer as shown in the first image. I am trying to:

connect points with lines in a required sequence.
Save data of line connections (From_point and To_point) in the seperate layer.

For demo, I have manually connected the lines (green) and shown the sequence (red) with numbers in Image 1. The sequence of connecting lines should be as follows:

Sequence
From_point
To_point

1 (building1) to (Junction)
7b9f
aab4

2 (building2) to (Junction)
d052
aab4

3 (Junction) to (Breaker)
aab4
edb3

4 (Breaker) to (Station)
edb3
c037

5 (Sation)) to (MainSource)
c037
4d3c

Initial attempt with points to path:
I tried to achieve this Menu Processing / Toolbox / points to path and Points2One plugin but it does not maintain the required sequence of connections as shown in Image 2


texts: How to compare a TIN and IDW-derived raster DEM quantitatively?

texts:
I'm a student and got the assignment to compare a TIN with a height raster 'quantitatively' and I'm not quite sure how to proceed. I tried subtracting the one from the other but it doesn't seem to be possible without first turning the TIN into a raster, which kind of beats the point of the exercise.

So far I've worked on ArcGIS 10.4 but I also have QGIS and ArcGIS Pro at my disposal. Any suggestions?


texts:
I have an object 'building' which is represented into multiple feature classes (point, line ) in esri file geodatabase. Is there a way to copy an attribute in one class to an attribute of another class with FME

please have a look at the example below. I have drawn a red arrow indicating the attribute to be copied. Is it possible ? How ?


texts: I am running "Union" on two shapefile in QGIS, Its running very slow and taking weeks to process 1 lac records of each having size 100 mb each

texts:
I have two shapefiles both are having polygon geometry, I am running Union process in QGIS using Vector/geoprocessing/union tool and It's taking weeks to process only 1 lac data, I don't know what's the problem with the software, I went through the same process several times but nothing fruitful found I also unchecked Rendering but no impact seems.
Can anyone suggest me, how can I speed up the process while running Union process?

I am using QGIS version 2.18.2.

if anyone on this group had faced the similar issues and got the solution Please help me it's very critical situation for me now.


texts:
I'm trying to convert a shapefile of only line geometry (a street network) to a NetworkX graph to run some connectivity algorithms on it. I'm running into this issue:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/networkx/readwrite/nx_shp.py", line 69, in read_shp
for lyr in shp:
TypeError: 'NoneType' object is not iterable

It seems to be an issue with the ogr module the fcn requires, but I believe (?) I downloaded it, and it doesn't raise the exception error written in the source code. Any ideas?

EDIT: here's my code snippet:
    import networkx as nx

print 'nx imported'
G=nx.DiGraph()
G=nx.read_shp('shpfile.shp', \
              simplify = False)
print "running fine"

It gets stuck at the read_shp() and doesn't run the print command at the end to confirm it's running correctly.


texts: Finding the indices of the maximum values along the third dimension of an image in Earth Engine

texts: Assume that I have a 10-dimensional image in Earth Engine. What I want to know is that in which band, the maximum value of each pixel occurs. I'm actually looking for something like the "Numpy.argmax()" function in Python. How can I do this in Earth Engine using the JavaScript api?


texts: ImportError when trying to load otb (orfeo-toolbox) into QGIS Python Console

texts:
I would like to use the orfeo-toolbox via the QGIS Python Console, however, I don't seem to be able to import the otbApplication. I keep getting the following error:

import otbApplication
Traceback (most recent call last):
  File "C:\OTB\lib\python3\otbApplication.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\OSGEO4~1\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\OTB\lib\python3\otbApplication.py", line 17, in <module>
    _otbApplication = swig_import_helper()
  File "C:\OTB\lib\python3\otbApplication.py", line 16, in swig_import_helper
    return importlib.import_module('_otbApplication')
  File "C:\OSGEO4~1\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.

I am using a Windows 10 computer and QGIS 3.8.2. I downloaded OTB 6.6.1, cloned the qgis-otb-plugin, and configured the environment variables as described in the Orfeo Toolbox Cookbook and various other resources.

I can use the OTB tools in the QGIS GUI, but not import it into the QGIS Python Console.


texts: How to smooth a raster in a rectangular fashion using gaussian blur?

texts:
How do I adjust the code for the Gaussian Blur posted in the thread:

What raster smoothing/generalization tools are available?

to retain the resolution/gradients in the y direction and blur only in the x direction (rather than over a square area)?


texts: How can I use R-Tree to find points within a distance in Spatialite?

texts:
Create a table with 3D points:

create table points (coords pointz);
select CreateSpatialIndex('points', 'coords');

Insert 13k rows:

insert into points values (geometryfromtext('pointz(...)'))

Do

SELECT
    p.rowid, count(*)
FROM
    points p, points v
WHERE
    distance(v.coords, p.coords) < 1
GROUP BY
    p.rowid;

Will see an output of several (1..10) points per second (will take a few hours to process 13K points). EXPLAIN shows that the index is not used. A query with PTDistanceWithin function works the same way.

How can I use the spatial index? I checked if it's possible to use an MBR, but those functions are for 2D only.

added: here's a function reference, and all the functions I could use in usual case, work in 2D only!


texts: Batch Polygonize rasters into shp file using gdal_polygonize.py but no result?

texts:
I'm trying to use and recreate this code from Using GDAL polygonize from Python?

import subprocess, glob

script = "/usr/bin/gdal_polygonize.py"
for raster in glob.glob("/data/brent/GAUP/Jul21_17-Apr27_18_results/imp_malaybalay/comp/*.tif"):
    outshp = raster[:-4] + ".shp"
    subprocess.call(["python", script, raster, "-f", "shp", outshp])

The only difference is that I am specifying an ESRI shapefile format as an output vector type (the link above used GeoJSON instead).

After I run the code, there were no results in my output folder. Is there something I missed out?

I also tried this code. However, I don't have any idea on how to edit the code in a batch processing form.


texts: How can I programatically register a feature class as versioned

texts:
Is there a way to programatically register a feature class as versioned?

I'm able to register aFeatureDatasetwith the IVersionObject3 interface, but not an individual feature class.


texts:
I have a postgis table full of very small line segments. I would like to merge them according to an attribute in another field:

update line_table set the_geom = ST_LineMerge(the_geom);

but how do I do this according to the attribute so that all the small segments with name="west" are joined, and those with name="north" are all joined etc?


texts: Getting nearest point distance in ArcMap?

texts:
How do you calculate the nearest distance from one XY coordinate to another XY.

I'm using Arc Map 10

I went into Arc tool box -> proximity -> then I only have 2 buffering options.

But under buffer I do not see any "near features" option


texts: Finding percentage of forest area from raster file for given vector grid of 1000m?

texts:
I have a raster file and vector grid of 1000m.

Now i want to find percentage of forest area for each vector grid  of 1000m using QGIS.

I have tried Landscape Ecology -> Landscape Vector Overlay plugin but it is giving a memory error.

How can I find this using QGIS with any plugin?


texts: ArcGIS Routing service using two locations?

texts:
I was going through the routing example Simple Routing  which works on map click event. I am bale to replicate the same but instead of click I want the routing to take place using 2 different x,y.

Is there a reference or example for doing this with at least 2 hard coded points?


texts:
I've just signed up for a planet API explorer account, and after downloading my first image, I continuously receive a 429 response code when attempting to activate an item.

I'm using the activation script given here: https://developers.planet.com/docs/quickstart/downloading-imagery/#asset-activation

I'm requesting REOrthoTile item types. I've read the API returns 429 when you've exceeded your rate, however, I most definitely haven't exceeded any rate, as I only posted once today and still received a 429.

Is there any other reason I could be receiving a 429?


texts: What Xubuntu release is OSGeo-Live based on

texts:
Does anyone know where to find a list of parent Xubuntu releases for each OSGeo-Live version, and where there is a roadmap for future releases? I was able to find this out for OSGeo-Live 7.0 only by running it and querying the release from the command line:

user@osgeolive:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.3 LTS
Release:        12.04
Codename:       precise

Since OSGeo-Live 7.0 is less than one year old, I assume that the older version of Xubuntu means that as a rule the project only bases on LTSes. I'm asking because I'm considering when and whether to upgrade, and I wouldn't want to do so until OSGeo-Live is based on Xubuntu 14.04.


texts:
How to Create Polygon drop shadow in TileMill?

I need to create a drop shadow for my building polygon in TileMill.

Any ideas?


texts: ArcPy to Enable Database for use with Data Reviewer

texts:
Has anyone ever used ArcPy to Enable Data Reviewer? By this I mean add the necessary feature dataset and tables to an existing geodatabase in order for it to be considered a Reviewer workspace and store Data Reviewer results. The Sytax Provided by ESRI is such:
EnableDataReviewer_Reviewer (workspace, {spatial_reference}, {register_as_versioned}, {config_keyword})

I got the code from this location:
https://desktop.arcgis.com/en/desktop/latest/tools/data-reviewer-toolbox/enable-data-reviewer.htm

When I use it however, I am getting this error:
AttributeError: 'module' object has no attribute 'EnableDataReviewer_Reviewer'

I am using Arc 10.2.2, not sure if that has something to do with it. Please let me know if you have any thoughts


texts: Cannot install "Processing" plugin on MacOS + QGIS 2.9.3, fresh install

texts:
I have just installed a new MacBook Pro and QGIS, everything is fine but this strange error if I try updating or reinstalling the "Processing" plugin.

  The plugin is broken. Python said: cannot import name
  AlgorithmDecorator

The full error log is at https://gist.github.com/giacecco/43c6b206239bfaa16f97 .

This appears not to be a duplicate, although many other issues are on Stackexchange regarding this plugin.

Uninstalling also fails. No error messages are shown, but the plugin still shows in the "Installed" pane.


texts: Initiating pop-up before accessing .net out-of-the-box web map?

texts: I need to create a pop-up that initiates as soon as a user clicks on a web map, or accesses the link from another location. The map is an ArcGIS Server out-of-the-box .net app. It's for a disclaimer and just needs an accept and do not accept button. I could do it easily enough if it were Flex or Silverlight, but I'm at a loss here.


texts: When trying to find the nearest line to a point, how useful are nodes?

texts:
I am working with a dataset (OS Open Roads) which consists of lines and nodes in separate shapefiles.

The lines represent the roads themselves.

The nodes represent, for example, the end of a road, or a junction on that road.

I have a collection of points, and would like to find the nearest line (road) to each point.

In such a usecase it seems to me to me reasonable to ignore the nodes.

However, as I am new to GIS, I would like confirmation that I am not missing anything of significance in the node data?


texts: Linking layers using conditional spatial queries?

texts:
I am looking at a drainage scheme where there are blockages in the system. The blockages are one layer. I then have a layer containing the main risk areas within the area and another layer that contains all the pipes for that entire area.

The risk areas have named references in their own attribute table, and the pipes are named using an asset ID in theirs.

What I need to do is link the pipe asset IDs to the Risk areas name references, but only if there are blockages in that risk area.

What I am aiming to do is create a new layer where the attribute table contains the pipe asset IDs, with a corresponding risk area reference (if the pipe is within a risk area) but ONLY if blockages have been reported in that risk area, otherwise, I am not interested in that risk area.
Therefore I can copy the new layer attribute table into excel and have pipes assigned to their proper risk areas.

It is for very large datasets, hence my need to automate it.

I am using QGIS 2.14.3 Essentials

essentially I want to create a formula that works like;

=IF(risk area contains blockages, Find pipes within and make new layer assigning risk area to pipes, do nothing)


texts: How to designate unique destination table names in OSM import to PostGIS using ogr2ogr

texts:
I download country cuts of OSM from GeoFabrik.  When I import a country's PBF file into my PostGIS instance using ogr2ogr, it simply gives me a generically named set of tables (lines, points, multipolygons, etc).

Even if I rename the table, it does not change everything all the way down the database structure; so when I go to import a new country pbf file, it will give me:

ERROR 1: ERROR: relation "points_wkb_geometry_geom_idx" already exists

The ogr2ogr command I'm using is:

ogr2ogr -f PostgreSQL PG:"dbname='dbname' host='host' port='5432' user='username' password='password'" country-latest.osm.pbf -lco COLUMN_TYPES=other_tags=hstore --config OSM_MAX_TMPFILE_SIZE 1024

I have also tried the following using the -nln argument:

ogr2ogr -f PostgreSQL PG:"dbname='dbname' host='host' port='5432' user='username' password='password'" country-latest.osm.pbf -nln "country_name_osm_date_" -lco COLUMN_TYPES=other_tags=hstore --config OSM_MAX_TMPFILE_SIZE 1024

But this results in:

Warning 1: Layer creation options ignored since an existing layer is being appended to.

Additionally it gives me geometric type mismatches, and failed copy statements, which makes sense, since -nln I think is trying to write everything to one table, and a PBF file will yield multiple tables.

Doubtless this question has shown how bad my ogr2ogr-fu is. So, how can I designate a specific destination table name in the import statement to avoid future import conflicts?

Additional note: osm2pgsql has the ability to use --prefix argument as noted here: Define table name with osm2pgsql, however, I do not have osm2pgsql available to me and would like to accomplish this with ogr2ogr.


texts:
I need to develop a web-based application to manage areas inside a bigger area.

I already have the initial perimeter, and it has irregular borders like that:

.

I will need to tell the app to create a perimeter based only in a given area.

createPerimeter(1000); // create perimeter with 1000m2

That should create a perimeter with 1000m2 adjacent to the border and to any other existing area.

.

And so on. The above method should create adjacent areas until the end of the container area

.

I'm looking for a solution regardless the language or platform, directions to how to start it.
I believe POSTGIS has many functions that could help me, but I have not found a solution so far.

Regards.


texts: How to find overlapping polygons of two shapefiles - Python

texts:
I have a mkl file A and a shapefile B containing polygons, each one of them having a single feature: the name associated to the polygon.

I am looking for the polygons of A which are overlapped by polygons of B using Python. In particular, I would like to know which are the best and fastest libraries to solve issues like this.

I have read this question and the answer propose to add the geometries into a PostGIS db or to use shapely. Do you have any reference or working example from where I can learn how to properly solve this task?


texts:
I would like to calculate zonal histograms (number of raster cells of each type contained in a polygon) using the RQGIS3 package in R. The problem is that I can't seem to find the algorithm name for zonal histograms. For example, if I want zonal statistics, I might do something like:

args <- get_args_man(alg="qgis:zonalstatistics")
args$INPUT_RASTER <- someraster
args$INPUT_VECTOR <- somevector
args$output <- file.path(tempdir(), "out.shp")
out<- run_qgis(alg = "qgis:zonalstatistics", params = args,
        load_output = TRUE,
        show_output_paths = FALSE,
        qgis_env = qgis_env)

But for zonal histograms, I don't know the name of the algorithm to specify, or if I can do this at all from R (it is easily done from within QGIS 3.4).

If I run the following in the Python console in QGIS, I can't seem to find an algorithm name for zonal statistics:

for alg in QgsApplication.processingRegistry().algorithms():
        print(alg.id(), "->", alg.displayName())

Can I do zonal histograms from within R, using the RQGIS3 package?

My motivation is that I want to be able to generate various polygon grids in R and calculate the zonal histograms on the fly. I could do it in R (without QGIS, but QGIS seems much faster than the native R functions.


texts: How to read a WFS published through QGIS server with Leaflet

texts:
I would like to read a WFS published using QGIS server, with the plugin Leaflet-WFST but an error occurs when the plugin is trying to read the geometry.

Error :

  uncaught exception: unknown child element Point

Result of the WFS POST request:

<gml:boundedBy xmlns:gml="http://www.opengis.net/gml">
    <gml:Box srsName="EPSG:4326">
        <gml:coordinates cs="," ts=" ">-4.07446736,52.4326541
            -4.07446736,52.4326541</gml:coordinates>
    </gml:Box>
</gml:boundedBy>
<qgs:geometry xmlns:qgs="http://www.qgis.org/gml">
    <Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
        <coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">-4.07446736,52.4326541</coordinates>
    </Point>
</qgs:geometry>
<qgs:_URI xmlns:qgs="http://www.qgis.org/gml">uuid:858df484-a17e-45b0-b740-0639f530d946</qgs:_URI>
<qgs:SITE_DETAILS_OBSERVER xmlns:qgs="http://www.qgis.org/gml"/>
<qgs:crationdate xmlns:qgs="http://www.qgis.org/gml">2019-01-24T13:35:37</qgs:crationdate>
<qgs:diamtrunk xmlns:qgs="http://www.qgis.org/gml">20</qgs:diamtrunk>
<qgs:heighttrunkmesure xmlns:qgs="http://www.qgis.org/gml">1.3</qgs:heighttrunkmesure>
<qgs:species xmlns:qgs="http://www.qgis.org/gml">Pinus-sylvestris</qgs:species>
<qgs:circumference xmlns:qgs="http://www.qgis.org/gml">62.8318530717959</qgs:circumference>
<qgs:crownxaxis xmlns:qgs="http://www.qgis.org/gml">3</qgs:crownxaxis>
<qgs:crownyaxis xmlns:qgs="http://www.qgis.org/gml">1</qgs:crownyaxis>
<qgs:crownorientation xmlns:qgs="http://www.qgis.org/gml">20.67</qgs:crownorientation>.

Additional information:

Points came from a PostGIS database (postgresql 9.5 postgis 2.2) then publish using QGIS 2.18.16

The WFS can be read perfectly using a remote computer and QGis desktop

The GetCapabilities of the service: http://54.38.33.23/cgi-bin/qgis_mapserv.fcgi?SERVICE=WFS&version=1.0.0&REQUEST=GetCapabilities&MAP=/home/sebastien/odkResult/indTrees.qgs

Leaflet code:

var layer2=new L.WFS({
                url: 'http://54.38.33.23/cgi-bin/qgis_mapserv.fcgi?MAP=/home/sebastien/odkResult/mangroveTrees.qgs',
                //typeNS:"",
                geometryField:'geometry',
                typeName: 'ind_trees',
                crs: L.CRS.EPSG4326,
                style: {
                  color: 'red',
                  weight: 3
                }
            }).addTo(mymap)


texts: QGIS Print Composer Legend: Polygon symbol not closed

texts:
The legend of my map doesnt't match the symbology of my polygon layer, the polygons are not closed.
Here a screenshot of the layer windows:

And here one of the legend from the print composer:

If I increase the size of the outline of the layer symbols >0.5 , it looks like this in the print composer:

The first three items have increased outline witdh.

How can I avoid this - I need closed squares in the legend, but no thick outline...


texts: Is it possible (and how) to use the SAGA GIS 7.x modules in QGIS (as well as for GRASS GIS)?


texts: SQL in CARTO - round a function with two decimals in carto

texts:
I am try to round the expression below on carto but it  still returns no decimal places. The columns are 'number' type. I have also tried SELECT round( CAST(column as numeric), 2 ) suggested here but no decimals either.

SELECT name,

ROUND((COUNT(*) filter (where religion = 'Orthodox Christian')) *100/ (COUNT(*) ),2) as orth_chri

FROM dataset_1
GROUP BY name


texts: How to fix symbols/labels in a tiled WMS?

texts: I have a postgis stored dataset that is consumed in a qgis project and served on qgis server. I noticed however that symbols and labels of point features that overlap 2 tiles of the map are only rendered in the tile that actually contains the feature. Is there some kind of buffering option or a configuration option for rendering to fix this?


texts: How to achieve optimal accuracy with RINEX post-processing for Bad-Elf or Ublox GNSS L1-only receivers?

texts:
I have a Bad-Elf Surveyor (with what I’m pretty sure is a ublox Neo-7P module) and am experimenting with the kind of accuracy I can get from it by collecting raw data logs (RINEX) from the Bad-Elf app. I’ve figured out how to apply post-processing corrections using RTKLib’s RTKPost, which I’ve described at What will post-process differentially correct raw Bad-Elf Surveyor U-Blox NMEA/raw UBX?.

However.

The Bad-Elf page claims that optimal accuracy can be achieved by implementing GPS+PPP+SBAS. The ublox page says, “u‑blox’ PPP technology is made possible by stabilizing measurements of the distance between GNSS satellites and the receiver (pseudo‑ranges) using carrier phase tracking. Additional accuracy is achieved from ionospheric correctional data received from satellite‑based augmentation systems.” The NEO-7P product page says that “u‑blox has implemented PPP in its NEO‑7P GNSS module.” (Emphasis mine.)

The Bad-Elf statement seems to imply that optimal accuracy requires that data be collected while WAAS/SBAS corrections are being received and implemented by the receiver itself and subsequently post-processed using PPP (ephemera and clock inputs). The ublox page seems to suggest that should post-processing should be done with clock and ephemera files, and then the SBAS information used for ionosphere corrections. The 7P product description seems to suggest some sort of mysterious internal PPP algorithm correcting the position readings in the chip itself.

Does anyone know which, if any, of the above three concepts is correct?


texts:
I am trying to manually add zoning info to my map by referencing pdfs. Can anyone tell me the best way to go about this?

There are 12,000 lots.


texts: copy value if an attribute comparison match with another layers attribute is found in PyQGIS

texts:
Unfortunately, the two layers don't cover the same size of area and therefore don't have the same number of attributes. That's the reason I only saw the following attempt, instead of simply zip them. So until now I tried to find attribute value matches between two layers by running a for loop through one layer within a for loop through the other one, to be able to check with an if statement, if the two layers attribute values are identical or not...
It's not working correctly! And also not efficient enough, since I have to check all streets of an entire city (do I have something wrong? But I don't get an error message...?)

Or is there a more elegant way I don't know yet to complete and speed up this task?

here my code so far:

def addFeatures():
    polylines = QgsMapLayerRegistry.instance().mapLayersByName('polylines')[0]
    itlayer = QgsMapLayerRegistry.instance().mapLayersByName('itpoint')[0]
    tomaxspeed = itlayer.fieldNameIndex('tempo')
    tolanes = itlayer.fieldNameIndex('lanes')
    fspeed = polylines.fieldNameIndex('maxspeed')
    flanes = polylines.fieldNameIndex('lanes')
    itlayer.startEditing()
    for feat in itlayer.getFeatures():
        for ft in polylines.getFeatures():
            frommaxspeed = ft.attribute('maxspeed')
            fromlanes = ft.attribute('lanes')
            if ft.attribute('name') == feat.attribute('name'):
                if frommaxspeed:
                #print (maxspeed)
                    itlayer.changeAttributeValue(feat.id(), tomaxspeed, frommaxspeed)
                if fromlanes:
                    itlayer.changeAttributeValue(feat.id(), tolanes, fromlanes)
    itlayer.commitChanges()
    itlayer.updateFields()

fixed line 18 and it works now as it should (stupid failure). But still, the perfomance is terrible and QGIS is not reacting for about 15 min while executing this function.

Doesn't seem to me, that it should be like this!?

Therefore, does PyQGIS offer a different and more efficient way?


texts:
Sometimes in OpenLayers popup bubbles don't disappear or cannot be closed with the x button in the corner, because something went wrong either with the code or the handling of the script or probably both.

Is there any way of referencing those "lost" popups or a method such that  I can get my hands on those folks and make them disappear?


texts: Reordering fields (permanently) in file geodatabase using ArcGIS Desktop?

texts:
Using ArcGIS 10.0, is it possible to reorder the fields in a file geodatabase, and have the order persisted to the database?

We considered exporting to XML, and writing a parser to change the field order, then re-creating a new database from the XML. This seems like a laborious process.

Another idea is to import the existing field definitionss into Excel, re-order them, export to CSV, then write a Python script to create these fields in a new Geodatabase. Does a script like this exist, before we write it from scratch?

Unfortunately the ArcGIS Diagrammer doesn't seem to support field re-ordering.

Are there any scripts or hacks we could use to simplify this process?


texts:
I'm trying to convert a column in CartoDB from String to Date.
My dates are the following format:

2014-01-02T00:02:00
2014-01-02T08:05:00
...

I've tried to append +00:00, so they looks like:

2014-01-02T00:02:00+00:00
2014-01-02T08:05:00+00:00
...

matching CartoDB's own dates. However, when converting from String to Date the time is lost and they become:

2014-01-02T00:00:00+00:00
2014-01-02T00:00:00+00:00
...

What to do?


texts: QGIS Editing: move - both - nodes after Cut has been performed

texts:
I just ran into unexpected behavior while editing a polygon shapefile in QGIS 2.8.2.

Scenario:
A polygon:

Then I cut that polygon into two seperate poygons:

Then I use the Node Tool to move a vertex:

And that's my question. Why would this create a gap? This means that the Cut tool creates two edges, which is definitely not how it should be, as edges should always be shared, hence reducing the complexity of the dataset.

I have tried to select both vertices, but that does not work; only the one on top can be selected.

Is my only option to activate snapping and move both vertices individually or is there a tool or plugin that can do this?


texts: Divide each road to 30m long and assign unique id to all points in the segments

texts:
I have a big csv that contains this information of trip data for each point in 1s interval: lon, lat, timestamp and street_id.
My aim is to segment street to 30m long segments and assign a unique segment id to each point based on its position.
Here is an example of what my data looks like using df.head():
    timestamp           Lat           Lon           street_id
0   4/1/2014 0:11:00    40.7694320    -73.9544329   140
1   4/1/2014 0:17:00    40.7264327    -74.0343245   50

I'm using dask as follows to get the  data:
from dask.distributed import Client
client = Client()

df = dask.dataframe.read_csv(...)

I just don't know how to begin, I know I have to group by street_id then calculate the distance between each point and the beginning of the street, but I've failed to find how to find how to do so
The expected result should look like:
    timestamp           Lat           Lon           street_id    segment_id
0   4/1/2014 0:11:00    40.7693330    -73.9533349   140          5
1   4/1/2014 0:17:00    40.7263337    -74.0333345   50           1

Segment_id should be a unique identifier for each street segment of 30m long.


texts: geopandas error "minimums more than maximums"

texts:
I posted this question on stackoverflow here, but it seems that gis.stackexchange is the more appropriate platform.

I am trying to merge two geodataframes in geopandas (want to see which polygon each point is in).

The following code gets me an error ("RTreeError: Coordinates must not have minimums more than maximums").

I cannot find any explanation as to what this means and how to solve it. Any ideas?

import geopandas as gpd
from shapely.geometry import Point, mapping,shape
from geopandas import GeoDataFrame, read_file
#from geopandas.tools import overlay
from geopandas.tools import sjoin

print('Reading points...')
points=pd.read_csv(points_csv)
points['geometry'] = points.apply(lambda z: Point(z.Latitude, z.Longitude), axis=1)
PointsGeodataframe = gpd.GeoDataFrame(points)
print PointsGeodataframe.head()
print('Reading polygons...')
PolygonsGeodataframe = gpd.GeoDataFrame.from_file(china_shapefile+".shp")
print PolygonsGeodataframe.head()
print('Merging GeoDataframes...')
merged=sjoin(PointsGeodataframe, PolygonsGeodataframe, how='left', op='intersects')

#merged = PointsGeodataframe.merge(PolygonsGeodataframe, left_on='iso_alpha2', right_on='ISO2', how='left')
print(merged.head(5))

Link to data for reproduction:
Shapefile,
GPS points


texts: Could you suggest software to draw a cross section, companion to QGIS?

texts:
If you use GIS systems, what software do you turn to when there is a requirement to draw a cross section?

Ideally a workflow that includes QGIS. Typically there are some points which will coexist in the plan and section view. But often I find there is much more detail to be input in the section which is redundant to have in x y coordinate system.

Related to this question
Drawing cross section in QGIS?

but what is your experience?  Perhaps you do street plans and need to represent the road and verge profile from time to time.

Not Arc addons please.


texts:
I have a QGIS project of species presence/absence in European countries (TDWG data). That's 84 species against 63 countries. For each species I've used the exact same map layer, used Categorize to colour each country the same then ticked the countries to indicate presence.
I now wish to extract that data in some way in order to create an 84 x 63 matrix (in a spreadsheet)
The "Filter Legend by Map Content" helpfully shortens the list of countries that I've ticked (displayed in the Layers window.) Is there a means of selecting just those items so that I can output the country presence list to a CSV


texts: How to calculate percentages using QGIS field calculator expression?

texts:
I am new to QGIS. I am wanting to calculate a field using other fields and some operators.
Here is my expression:

case
When "RVM_CAT" =  'B' OR "RVM_CAT" = 'C' Then ("PC1" /100) * "RE_ha"
When "RVM_CAT" = 'R' Then ("PC1_1" /100) *  "RE_ha"
When "RVM_CAT" = 'X' AND "FPC2011"  = 'gr12' Then ("PC1_1" /100) *  "RE_ha"
ELSE 0
end

When it runs, it looks like its only calculating values when the PC1_1 value or the PC1 value is 100. If I take out the Else 0, its the same thing.
There are over 370,000 features
The PC fields are percentages that i need to use to calculate the percentage of area from the M column. The RVM_CAT column tells me if I use PC1 or PC1_1. So the answer for row 2 uses PC1_1 and is (50/100)*32.03. WHile the answer for row 3 uses PC1 and is 100/100)*254.73


texts: Getting number of rendered features per range with PyQGIS?

texts:
I would like to know how many features are rendered in my QgsGraduatedSymbolRendererV2 per range. I need to know also the exact range (lower and upper value).

I know how to get each range : QgsVectorLayer.render().ranges() but I can't get the feature count there.

I saw the function QgsVectorLayer.featureCount(QgsSymbolV2) but if I use the symbol that I got in QgsRendererRangeV2.symbol() it always returns 0. I used QgsVectorLayer.countSymbolFeatures() before, it returns True.

Can somebody explain if it's possible and how?


texts: Find number of features in ArcGIS MapServer layer

texts: Given an ArcGIS MapServer layer URL (eg https://gis.dallascityhall.com/wwwgis/rest/services/Sdc_public/Zoning/MapServer/15), how can I find (preferably in JSON format) the number of total features in the layer?


texts: How do I get a count of all the dead end streets?

texts: I'm working in ArcGis 10.1 - Advanced and I wanted to know how can I identify and get a  count of the number of dead end streets in my road network?


texts: Extended Public Header Block + Point Data Records in LAS 1.4 Point Format Number 6 File

texts:
I've received a couple of LAS 1.4 PDF# 6 files with extended Public Header Block Records + Point Data Records.

I noticed in the example “upgraded” LAS 1.4 file in the URL below, there were extended public header block + point data records.

https://rapidlasso.com/2016/01/10/create-proper-las-1-4-files-with-lastools-for-free/

The extended scan angle in my example file are significantly different than the min/max values in the standard header (assuming the extended_scan_angle is in 32bit int format)

e.g.
  scan_angle_rank   -30         29
..
  extended_scan_angle         -4999   4833

This was the same for the “upgraded” LAS 1.4 file in the URL above

e.g.
scan_angle_rank -24 24
..
extended_scan_angle -4000 4000

However I can't see these bigger scan angle values in lasinfo, Global Mapper Statistics, ArcGIS Las Dataset Statistics or pdal info.

I was wondering if anyone knew the implications of having these extended records?
Do I ignore these extended records as artefacts of file processing/conversion?


texts: Using ArcGIS definition query for dates?

texts:
My attribute table contains a Start date in m/dd/yyyy format.  I would like to build a query that only shows data from current month forward.

Does anyone know how to build a query or expression for this problem?


texts: QGIS explode lines from python script fails at alg.processAlgorithm

texts:
I've been trying to run QGIS procedures from python scripts via terminal on Ubuntu (ultimately I want to automate a process via cron).  The first task I have tried to script is the "explode lines" function.  In particular, I have input QGIS with a roads shapefile that I hope to split into smaller segments.

I've been following several stackexchange links to get to where I am, but can't seem to get the last step to work.  In the following bit of code, I get through the statement print("6") in the print statements, but fail correctly use alg.processAlgorithm(process).  There is no error provided and the code seemingly exits.

#!/usr/bin/env python
import sys
from qgis.core import *
import qgis.utils
from qgis.gui import *     # QgsMapCanvas
from PyQt4.QtGui import *
app = QApplication([])
QgsApplication.setPrefixPath("/usr", True)
QgsApplication.initQgis()

# Prepare processing framework
sys.path.append('/usr/share/qgis/python/plugins')
from processing.core.Processing import Processing
Processing.initialize()
from processing.tools import *
from processing.algs.Explode import *
from processing.core.SilentProgress import SilentProgress
progress = SilentProgress()

# Run the algorithm
print("1")
map = QgsMapCanvas()
print("2")
layerInput = QgsVectorLayer('/home/user/Downloads/input.shp', 'test', 'ogr')
print("3")
#map.setLayerSet([layerInput])
outLayer = '/home/user/out.shp'
print("4")
alg = Explode()
alg.setParameterValue('INPUT', layerInput)
print("5")
alg.setOutputValue('OUTPUT', outLayer)
print("6")
alg.processAlgorithm(progress)
print("7")
QgsApplication.exitQgis()
QApplication.exit()

Can anyone see what I've done incorrectly?  I've been using the following link for help:
How can I access `processing` with Python?


texts: Kmeans clustering in QGIS not displaying results in attribute table

texts: I'm new to QGIS and trying to cluster my points using the kmeans method from the attribute based clustering package. I am using latitude and longitude fields each with equal weights. I run the algorithm and it says "Done!" but when I go to my attribute table there the column that tells me the clusters isn't there. Am I missing something?


texts:
This question is somewhat involved, so please bear with me.
I am updating several plugins from QGIS 2 to 3. Most of them include accessing spatialite databases and creating layers from the various tables in the databases, both with and without geometries.  After making the necessary code changes to get the layers to load, I noticed that the General tab under Log Messages included the following warning for each of the layers created.

  WARNING Could not load styles from [path] (Query [SELECT statement])

I discovered that saving the default style to the database as follows made the warnings disappear (saving to Local Database did not fix the issue).

  Layer==>Properties==>Symbology==>Style==>Save as Default==>Datasource Database

However, this in turn produced another error and prompted this question.

THE REAL QUESTION:

The following code worked until saving the default style:

renderer = segments_layer.renderer()
root_rule = renderer.rootRule()  # This line fails
...
rule = root_rule.children()[0].clone()

It seems that saving the styles changed the renderer of the layer from QgsRuleBasedRenderer to QgsSingleSymbolRenderer, and the latter does not have a rootRule() attribute which is required in subsequent lines to function properly.

How can I have the best of both worlds, where I am not getting the WARNING messages and the code works as required?


texts: How to avoid a QGIS crash when it is appended a symbol layer in a symbol?

texts:
When I run the next code at the Python Console of QGIS with a line vector layer:

symbol1 = QgsLineSymbolV2.createSimple({'penstyle':'solid',
                                        'color':'black',
                                        'width':'3'
                                        })

symbol2 = QgsLineSymbolV2.createSimple({'penstyle':'dash',
                                        'color':'white',
                                        'width':'0',
                                        'customdash':'8;4',
                                        'use_custom_dash': '1'
                                        })

route = iface.activeLayer()
renderer = route.rendererV2()

type1 = symbol1.type()
type2 = symbol2.type()

print "Is Symbol Layer Compatible?", symbol1.isSymbolLayerCompatible(type2)

#Create Symbol Layers
symbol_layer1 = symbol1.symbolLayer(0)
symbol_layer2 = symbol2.symbolLayer(0)

#Append Symbol Layer 2 to symbol1 (now with two Symbol Layers)
symbol1.appendSymbolLayer(symbol_layer2)

renderer.setSymbol(symbol1)

route.triggerRepaint()
iface.legendInterface().refreshLayerSymbology(route)

I got the following result:

indicating that the symbol2 (QgsLineSymbolV2 class), as Symbol Layer (symbol_layer2 belongs to QgsLineSymbolLayerV2 class), it was correctly appending to symbol1. However, when this code is ran again, QGIS crashes and it closes all windows. This behavior doesn't appear if the symbol has only one Symbol Layer; when it is commented, at the first execution time, the line with this instruction:

symbol1.appendSymbolLayer(symbol_layer2)).

How can I prevent the second time QGIS crash when I am using a symbol with 2 or more Symbol Layers?


texts: Programatically add feature to Feature Layer with ArcGIS JavaScript API

texts:
I've so far been able to add a feature layer from an ArcGIS server, and I've also been able to add an editor widget which allows me to draw to feature with the mouse.  The added features are being correctly committed to the server, and are visible from other viewers as well as in the SDE database.  I have also been able to add the Editor toolbar and edit the existing polygon features.

However, I'm now looking for a way to add a feature without using the widget, just using JavaScript code.  The closest thing I found was http://forums.esri.com/Thread.asp?c=206&f=2274&t=271592 but it discusses .NET and doesn't look similar to the way something like that would be achieved in Javascript.  Where would the best starting point be for doing something like this?


texts: How do i get country boundary and names to show up in postgis backed mapnik rendered map?

texts:
I followed this to setup postgis server with planet-latest.osm. I used generate_xml.py to generate stylesheets. Using this style sheet with mapnik produces a world map with no country boundaries or country name on it. What is the best way to render tiles that looks similar to official tiles.openstreetmap.org tiles.

For example, for same zoom, x, y, this is what i get:

And this is what tile.openstreetmap.org has:


texts: CSV import to QGIS 2.18.00 - QGIS only shows 9 of 14 points

texts:
I'm trying to import a csv file into QGIS 2.18.00. The attributes and thus coordinates inside of QGIS are displayed just fine but QGIS only shows 9 of 14 imported points. I checked the coordinates with googlemaps, they work fine there. I exported the csv with python so I tried different delimiters and converted the coordinates to a string and integer, which shows the exact same results for all my approaches.

Screenshots:

( It says I cannot share more than two links so I had to cut out 2 screenshots which shows a) 9/14 points on the map and b) the complete attribute table inside of QGIS)

You can find the original CSV File here:
http://txt.do/dk57u


texts:
So, I have a GeoServer layer with point markers (POI) in several category such as ATMs, churches, government buildings, parks, etc.
Is there a way to filter this layer via URL parameters so I don't have to define a new layer for each category?
also, I am using openlayers-3 as the frontend interface.
To complete the question, I have a request URL like this:
http://localhost:8080/geoserver/gis_localhost/wms?service=WMS&version=1.1.0&request=GetMap&layers=gis_localhost:table_location&styles=&bbox=95.282956,5.517893,95.374536,5.60221&width=768&height=707&srs=EPSG:4326&format=application/openlayers

with the result similar to this:

where each of category is saved as category in postgis table_location.
Now I want to filter based on category, for example I want to use filter to only show police stations


texts: datetime to date in QGIS field calculator

texts:
I have a string column with a datetime in it, I want to drop the time and reformat the column to date format.
In field calculator I type:
to_date( (EndDate), 'yyyy/MM/dd')

This gives the following error:
Eval Error: Cannot convert '2020-07-15 15:12:55' to Date

How do I manage this?


texts: Use raster memory layer from QGIS processing result

texts:
I want to apply subsequent QGIS raster processing algorithms in a python script. I want to use memory layers for intermediate calculation results since I am only interested in the end result.

As described in a previous post, for vector layers this works fine when run in the Python console:

processing.runandload("qgis:intersection", layer1, layer2, "memory:myLayerName")

I can access the "memory:myLayerName" for subsequent calculations.

I'd expect a similar syntax for rasters, but I can't get this (or other functions where a raster is created as an output) to work:

processing.runandload("gdalogr:cliprasterbymasklayer", path_to_raster,
                      path_to_shape, "", False, False, "", "memory:OutputRaster")

I get an "Oooops! The following output layers could not be open" - error. The processing.log file shows:

'INFO|Sun Mar 01 2015 02:20:52|GDAL execution console output|ERROR 1:
TIFFOpen:memory:temp_layer: Permission denied'

When I replace the "memory:OutputRaster" with r"C:/path/to/out/raster.tif" the code runs. What am I doing wrong?


texts:
I am trying to convert sld to css style. The below code is have written SLD style for filter a word using PropertyIsLike

  <ogc:Filter>
      <ogc:PropertyIsLike wildCard="%" singleChar="_" escape="\">
      <ogc:PropertyName>name</ogc:PropertyName>
      <ogc:Literal>%police%</ogc:Literal>
      </ogc:PropertyIsLike>
  </ogc:Filter>

How to write the above SLD in CSS format?


texts: Why does ESRI Geodatabase Replica "Schema Compare" not identify changes?

texts:
I've made some schema changes (new fields to existing FCs), and would like to replicate the changes to the child.

While importing schema to the child database (which is the destination for a one-way replica from the parent), it shows a message saying No schema changes found for this replica pair

I did a previous schema change which had new fields and a couple of new FCs, and it worked fine. This time however, it is giving this message.

Any ideas?


texts: Create grid creates wrong grid using PyQGIS?

texts:
The yellow polygon is my working area that I draw. I have a small plugin. The user enter the row and column number than create a grid. This row and column number is used to find the Horizontal Spacing and Vertical Spacing because qgis:creategrid function wants them. xmin, ymin, xmax, ymax are derived from the working area polygon - layer.extent().xMinimum and others. At last  crs is derived from canvas, as well.

As it is seen, all neccassary values are entered. However, in this example, I entered 4 columns, 2 rows but it creates one more rows. It is true for my working area but I do not want to additional row. By the way, wrong additional grids place can change randomly (one more column, one more column and row etc.).

Derived paramters are true because I print the values in python console and use them to create grid, It works. Here is my code:

def createGrid(self, dx, dy, xmin, xmax, ymin, ymax, epsg, layer):
layerList = list(range(1, layer + 1))
for katman in layerList:
    parameters = {'TYPE': 2,
                  'EXTENT': '%f,%f,%f,%f' % (xmin, xmax, ymin, ymax),
                  'HSPACING': dx,
                  'VSPACING': dy,
                  'HOVERLAY': 0.0,
                  'VOVERLAY': 0.0,
                  'CRS': str(epsg),
                  'OUTPUT': QgsProcessingOutputLayerDefinition(
                      self._gv.karelajDir + "/Grid" + str(katman) + ".shp")}
    processing.run('qgis:creategrid', parameters)

    self.gridLayer = QgsVectorLayer(self._gv.karelajDir + "/Grid" + str(katman) + ".shp", "Grid" + str(katman),
                                    "ogr")
    QgsProject.instance().addMapLayer(self.gridLayer)

It creates grid amount of layer (entered by user).


texts: Polygon shapefile layer shows NoData for Identify in ArcGIS Desktop?

texts:
I have a soil survey polygon map with each polygon representing a soil type.

If I examine the attribute table of the layer, I can see what each polygon represents.

If I select a row in the attribute table it highlights the proper polygon on the map.

If I convert this layer to a raster, ArcMap colors each polygon according to it's correct soil type.

However, when I use Identify on one of these polygons it reports NoData and shows a blank table.

So it seems the attribute are not being reflected on the map itself.

Any idea of the cause and/or how to fix?


texts: In MapBasic, how do you place a user selected string from a FileOpenDlg() statement into an EditText field for use by a sub procedure?

texts:
I have created a custom menu that displays a dialog box when clicked on.  I have made the "Browse" button to call a FileOpenDlg() statement.  I want the file that the user selects to populate in the EditText space.  I would then like to have my app read that string and store it, so that it can be used in a sub procedure when the user clicks run.  Any suggestions?

For Example:
I want it to behave like a box that asks you to pick a file to upload.  The browse button is used to browse for the file, and I want the "run" button to behave like an "upload" button.  I was unable to post the picture on here of my dialog box, but that is the concept i am going for. Here is the code for the dialog box and the handler:

    Sub Leads
    Dialog
Title "Leads"
    Width 198 Height 80
Control StaticText
    Title "Select Leads File"
    Position 4, 16
Control EditText
    ID "2"
Control Button
    Title "Browse"
    Calling PickLeadsFile
    ID "22"
    Position 152, 15
Control StaticText
    Title "Run Leads Update?"
    Position 4, 52
Control OkButton
    Title "Run"
    ID "222"
    Position 74, 48
Control CancelButton
    Position 118, 48

    End Sub

    Sub PickLeadsFile
    Dim Leads_filename As String
Leads_filename = FileOpenDlg("C:\Users\dykesb01\Desktop\Test","","XLS","Open Leads File")
    Alter Control 2
    Title From Variable Leads_filename
    End Sub


texts:
This may seem like a very simple request, but does anyone have or know where I can get a shapefile of the ocean around the US? The only thing I can find within my ArcGIS BA is the ocean background, which doesn't do me much good when I'm trying to cover up heat map data.

If this is not possible can someone tell me how to convert a raster (heat map) to a shapefile?


texts:
I created a map using Qgis with some labels on it. I stylized the label text making it bold and changing the font size, but when I export the map using OL3, all the changes were lost.

There is a way to keep those changes? Which file do I need to modify to set the label text bold?

I'm using Qgis2web v.2.22.0