texts:
Since yesterday the processing toolbox of QGIS 3.10.9 AND 3.14.15 won't open any tools. Originally, I wanted to use the select by location tool, but after trying no tool at all will open. It doesn't matter if I double click on it, execute or execute as batch. I have tried uninstalling it and reinstalling it, but it still doesn't work.
QGIS 2.14 however, does still work, but it is much slower and doesn't have all the features I will be needing. Is there someone who had a similar problem, and can help me out?


texts: Finding a point inside a polygon based on maximum value of a specific field

texts:
I have a Polygon Shapefile that represents US counties and a Point Shapefile that represents hospitals. The hospital attributes table includes fields like "Number of Beds", "Number of Patients" and "Number of Doctors". I want to find the data for the hospital which has the maximum number of doctors in each county.

Lets say these Points fall inside county xyz.

Hospital.....Beds....Patients...Doctors

1 ................ 20 ...... 200 .......... 10

2 ................ 12 ...... 300 .......... 5

3 ................ 15 ...... 100 .......... 13

My desired result should look like:

County.....Hospital.....Beds....Patients...Doctors

xyz ............3 ................ 15 ...... 100 .......... 13

Getting just maximum of Doctors is not what I need (or maximum of all fields).


texts: Relating a 1:M from CSV file to Shapefile and exporting?

texts:
I have a shapefile with 3 different statations, in addition to a CSV with time data and multiple records for each station, based on time.

Shapefile dbf:

ID    Station
1       A
2       B
3       C

CSV:

Station     V1      Year
  A         10      2000
  A         13      2001
  A         13      2002
  B         15      2000
  B         23      2001
  B         31      2002
  C         22      2000
  C         31      2001
  C         31      2002

Is there anyway to join to the CSV to the shapefile so I can display time based data?

I've tried the Make Query Table but this still doesn't add the spatial information to the CSV. I'm using ArcMap 10.5.


texts: MXDs don't open by double-clicking outside ArcMap, but do open from within ArcMap?

texts:
If I try to open any MXD by double-clicking it from Windows Explorer or ArcCatalog, ArcMap fails to open.

I can see in Task Manager that ArcGISFileHandler.exe briefly runs, then closes, but ArcMap.exe never opens. If I first open ArcMap, then load the MXD, it opens correctly. This happens with any MXD.

Is there anything I should check before reinstalling ArcGIS? Windows 7 and ArcGIS 10.2.1

Edit - I just noticed that double-clicking an *.sxd does work - the document is opened in ArcScene. Why would there be a difference between ArcMap and ArcScene? I would think that a problem in one program would also apply to the other.


texts: How to compute the bounding box of multiple layers in lat/long?

texts:
I am writing an application to performance test all kinds of map services, primarily AGS 9.x, AGS 10, and WMS 1.x.

Part of the application involves generating random bounding boxes for individual requests, within the service's full extent. This part is working fine for geographic and projected coordinate systems when the service's full extent is known (e.g. through an AGS service's fullExtent property).

My problem is with WMS: each layer in a GetCapabilities response can define its bounding area in >= 1 CRSs. Some parts of the application need to know if a service's CRS is geographic or projected, so in order to remove ambiguity in WMS I am always using the layer's LatLonBoundingBox which is always defined and in EPSG:4326. I then have to calculate a full service bounding box based on all layers that go into an individual request (which are randomised). This is where it gets tricky.

I am getting lost because for each lat / lon bounding box the LLx (lower left longitude) could be a larger or smaller number than the URx (upper right longitude), depending on which meridians it spans. Every time I start drawing square or circular diagrams I think I have an approach figured out, and then find a case that ruins it and my brain turns to mush.

I am going to keep thrashing at it until it works, and if I get a solution post it here, but I'm sure there has to be an accepted and fully tested approach which would make my life easier. I just can't find it right now.


texts: Placing contour line labels only beside polygons of another layer in ArcMap?

texts:
I have a dataframe in ArcMap with contour lines and a vector layer.

Now I want to place contour line labels only at places beside the polygons of the vector layer. How is that possible?

I already tried several combinations for the feature/lable weights but either the lable conflict with the polygons or they disappear behind them. The situation is the following:

The "1400" is placed nicely, but I want also the "1500" to appear besides the hatched polygon...can anyone help?


texts: Formula to convert xyz Cartesian to latitude / longitude using WGS84

texts:
I need formula to convert xyz Cartesian coordinates to latitude,longitude,altitude using WGS84 to use in VBA application

x,y,z coordinates will be normal points (lets say, user pick point in AutoCAD, Microstation software without any user coordinate system set) and these xyz coordinates to be converted to latitude, longitude, altitude using WGS84

So, I need nearest accurate formula for conversion?


texts:
I am creating BaseTool using ArcObjects with C#. The tool should reduce the polygon and move along the coordinate axis. I managed to reduce the polygon. When I want to use the PutCoords() function to offset a polygon, it will move very much to the bottom left corner. This happens with any parameter values for the PutCoords() function.
private void ExtendPolygon(ref IFeature pPolygonFt)
    {
        IMxDocument pDoc = m_application.Document as IMxDocument;
        IMap pMap = pDoc.Maps.get_Item(0);
        IArea pArea;
        pArea = pPolygonFt.Shape as IArea;
        IPoint Center = pArea.Centroid;
        Center.PutCoords(-1, -1);
        ITransform2D pTrans = pPolygonFt.Shape as ITransform2D;
        pTrans.Scale(Center, 0.5, 0.5);
        IEnvelope pPolyEnvelope = pPolygonFt.Extent;
        IFeatureLayer pFtLayer = pMap.get_Layer(1) as FeatureLayer;
        IFeatureClass pOutClass = pFtLayer.FeatureClass;
        IFeature ExtFt = pOutClass.CreateFeature();
        ExtFt.Shape = pPolygonFt.Shape;
        pArea = ExtFt.Shape as IArea;
        ExtFt.set_Value(2, pArea.Area);
        ExtFt.Store();
        pDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
        pMap.SelectFeature(pMap.get_Layer(1), ExtFt);
        pDoc.ActivatedView.Extent = pPolyEnvelope;
        pDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);
    }

I am use Visual Studio 2015, ArcMap 10.5, ArcObjects 10.5.
How can I fix this situation? Or how else can you shift the polygon along the coordinate axis?
When i use Move (-dx, -dy). the polygon is displaced a very large distance from the original position and not what I want. I enter different values, but nothing changes.


texts:
I searched this issue in other topics but only found outdated topics with previous versions of Ubuntu.
I'm using Ubuntu 18.04 in my laptop and I'm following the tutorial available at https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ and was going fine, except for the last step, which is the tile viewing.

I'm opening the "sample_leaflet.html" file inside folder /src/mod_tile/extra/ using Firefox Browser and it doesn't show tiles. It only shows tiles at lv 0 zoom, which is the same tile shown at http://localhost/hot/0/0/0.png repeated side by side.

My console show the rendering messages, as the tutorial said it would do.


texts: PyQgis Exporting Print Layout: "ERROR 6: The PNG driver does not support update access to existing datasets."

texts:
I am trying to export a .tif loaded into a pre-configured print layout template and further exported as .png

def openLayer(project, fp, basename, vector=True):
  layer = QgsVectorLayer(fp, basename) if vector else QgsRasterLayer(fp, basename)
  if not layer.isValid():
    print("Layer failed to load!")

  project.addMapLayer(layer)
  return layer

def openTemplate(layout, templatePath):
  template = open(templatePath, 'rt')
  content = template.read()
  template.close()
  doc = QDomDocument()
  doc.setContent(content)
  context = QgsReadWriteContext()
  if not layout.loadFromTemplate(doc, context):
    print('unable to load template: {}'.format(templatePath))

def export(layout, dest, filename):
  dest = os.path.join(dest, filename + '.png') #FIXME: set filetype in config
  export = QgsLayoutExporter(layout)
  export.exportToImage(dest, QgsLayoutExporter.ImageExportSettings())

# initialize
QGS = QgsApplication([], False)
QGS.initQgis()

# create project & layout
project = QgsProject()
layout = QgsPrintLayout(project)
layout.initializeDefaults()

# load layers
baseLayer = openLayer(project, r'C:\Users\X\Desktop\atlas\ar_base.tif', 'ar_base', vector=False)

# open template
openTemplate(layout, r'C:\Users\X\Desktop\atlas\test.qpt')

# export
print('exporting . . .')
export(layout, r'C:\Users\X\Desktop\atlas', 'test')

The snippet successfully creates a .png with the image inside. However I get the following error:

ERROR 6: The PNG driver does not support update access to existing datasets.

Would anyone know why that is? I wasn't able to find a concrete answer by searching unfortunately.

Thanks in advance!

EDIT:
seems related to the PNG GDAL driver. However, there is no updating within this process but simply creation.

I can suppress the error / warning via:

from osgeo import gdal
gdal.PushErrorHandler('CPLQuietErrorHandler')

But I rather not have to.


texts: How to change selection tolerance for WMS/WFS in QGIS?

texts:
Does anyone know if there is any equal function to the selection tolerance (ArcMap) in QGIS. I have a problem activating points in my WMS/WFS.
The "selection tolerance" function solves the problem in ArcMap (If I raise the pixel numbers there it works), but I would like to find a similar function in QGIS. Does any one know?


texts:
Further to Where do I find the legend for netCDF files in QGIS?, I have .nc and .asc files of crop area and production for maize, rice and wheat. It says here, about QGIS importing .asc files:

  QGIS has native support for this format.   ESRI grid (.asc) files can
  be directly opened in QGIS by selecting Layers >>> Add Raster Layer.
  The .asc file can also be dragged and dropped into the QGIS session, rather than using the Add Raster Layer option.

But when I do either, I get this error:

  .asc is not a supported raster data source.

which has been reported at Is .asc supported raster data source for QGIS?

I am using version 2.0.1-Dufour.


texts: How do I convert a screen position to geographic coordinates?

texts:
I'm looking for resources that explain how I should convert screen coordinates (the point that I pick on-screen) to geographic coordinates (lat / lon).

I want to build an application where, the simplified version, I can pick a point from an on-screen map and the geographic coordinates are passed to my database. I have a tile service that serves up raster tiles from a .MBTILES file, generated from OSM data stored in a Postgres databse. The client would likely be built with .NET, likely MVC for a web application or a WPF for a Windows desktop application.

I'm looking for concepts so I can do some additional research on my own in order to figure out what I need to do next. What are the best practices for doing this?


texts: Using Geoserver URL as variable in Leaflet

texts:
I'm trying to use a string variable within a image tag that then adds a symbol to the layer control in Leaflet.

I'm having trouble with the whole use of single/double quotes and concatenating the variable. Does anyone have experience of this issue.

var legendUrl = 'https://maps.dartmoor.gov.uk/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER='

overlays = {
" SSSI":'hta:sssi'
" TPO Areas":'general:tpo_area'

};


texts: Feature count of current features in Extent based on attribute?

texts:
I have one points layer in a cached map service, symbolised with a unique renderer on one field.
e.g. petrol stations, symbolised by the company who owns them.

I want to create a fairly basic application in the Esri Javascript API (or potentially with the Google Maps API, and this).

One of the main components I need to have on this application is a dynamic legend that shows a feature count for the current extent.
e.g.  Shell - 34, BP - 21, Texaco - 7, etc

Has anyone seen any code that could get me started on this or can provide some references/pseudocode on how one would go about this?


texts: Creating directory of shapefiles using gsconfig

texts:
I would like to use gsconfig-py3 1.0.8 Python library to create a store that can receive multiple shapefiles, i.e. "Directory of spatial files (shapefiles)" (as it is in geosever), then add multiple shapefiles to it.
I am able to create a store by using the create_featurestore from gsconfig, however it result in a single shapefile store.
from geoserver.catalog import Catalog
cat = Catalog(geoserver_uri + 'rest/', username="username", password="password")
data = r'../file.zip'
store = cat.create_featurestore("test", data, workspace=workspace)
cat.add_data_to_store(store, store.name, data, workspace)

If i try to add another shp it gives the error:

geoserver.catalog.ConflictingDataError: There is already a store named

When I use the create_datastore the store type is not even specified on GeoServer under Data - Stores - Type, while Data Type has an exclamation sign.
store = cat.create_datastore("test", workspace=workspace)
cat.add_data_to_store(store, store.name, data, workspace)

If I try to add a shapefile to it, I get:

geoserver.catalog.FailedRequestError: Error code (500) from GeoServer:
Store 'test' already exists in workspace


texts: Is it possible to change the style on a WMS layer using QGIS?

texts: Apologies from a QGIS beginner but I have added a WMS layer of polygons to fill in the gaps of an existing data set I have. the problem is that I want all of this data to have the same style (colour etc) and the WMS layer which comes up as orange cross hatching doesn't seeem to be able to be modified to a single colour for example. Is it actually possible to change the style of a WMS layer in a way that is possible for beginners?


texts: Concatenating two columns in ArcGIS 10.2.1: "no records within table"?

texts:
I am trying to merge two text columns (consisting of 2 digit and 3 digit numbers respectively) into one in ArcGIS 10.2.1 desktop version, but unable to do so. I have added a new field and kept it as text. On using arc toolbox > data management tools > calculate field, I am trying to merge the two columns into the newly created column.

Example:

I have the following two columns in the shapefile - Code1 (text, 10) and Code 2 (text, 10). I want to concatenate the values in these two columns in a new data field Key (text,11) that I have already created.

Code1 Code2  Key
015   21     21015
647   19     19647
213   05     05213

When I try to use field calculator I get the error no records within table. See below:


texts:
I am getting a unicode error while using a combination of an UpdateCursor and csv reader. I'm trying to fix field values that got messed up because ArcGIS didn't read the CSV properly when it imported the table. What is odd is that the script functions for several iterations of my loop for row in csvReader before my nested loop for i, fldName in enumerate (flds) fails. The code:

with open (cv, "rb") as csvFile:
    csvReader = csv.reader (csvFile)
    with arcpy.da.UpdateCursor (fc, flds) as uCurs:
        for row in csvReader:
            if first:
                first = False
                continue
            uCurs.next ()
            for i, fldName in enumerate (flds):
                #continue
                fldType = fldTypeDi [fldName]
                if fldType in ("Double", "Integer",
                               "Single", "SmallInteger"):
                    try: row [i] = float (row [i])
                    except:
                        if row [i] == "":
                            row [i] = None
                        else:
                            try:
                                row [i] = float (row [i].replace (",", ""))
                            except:
                                print "!!fail!!", flds [i], v, type (v)
                                failFlds.update ([(flds [i], type (v))])
                                row [i] = None

The error:

Traceback (most recent call last):
  File "C:/Users/e1b8/Desktop/E1B8/AC Inspection/fix fields.py", line 47, in <module>
    for i, fldName in enumerate (flds):
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 3: invalid start byte

Why would the script be trying to decode a unicode in the middle of a for loop? If I use the continue at the start of the script no errors result.


texts: Why are Images used as label not rendered correctly by GeoServer?

texts:
When I try to render the label (png image) through GeoServer as an image, its quality is getting affected i.e. the image is not rendered sharply.

Are there any settings that need to done in GeoServer or the SLD file to correct this?


texts: Why are layers not lining up with others with the same CRS?

texts:
I am creating a project on the UK and have downloaded various shapefiles. When I add a vector layer they are coming up as if they are not lining up. Some layers are nicely on top of each other with WRC84 and the others appear to be angled off and are away somewhere else and all have the same CRS....

what do i do?


texts:
I use an arrow as a symbol to follow lines, but in several cases, symbols are cut (when line features are too small or changing direction). Here is an example of the result on my Web site:

Here is my portion of code from my mapfile:

CLASS
    NAME "Water pipe"
    STYLE
        COLOR 0 0 0
        WIDTH 3
    END
    STYLE
        SYMBOL "wp_arrow"
        ANGLE AUTO
        SIZE 12
        INITIALGAP 20
    END
END

Any idea on how to prevent the symbols to be cut?


texts: Unable to deserialize entity which contains field with type org.postgresql.geometric.PGpath

texts:
I have an Entity which has a field named coordinates of type org.postgresql.geometric.PGpath :

public class Geometry
{
 ...

    @Column
    @NotNull
    private PGpath coordinates;

I am trying to build a JSONObject with some of these entities but I am getting the message:

could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize


texts: Building an online map - how hard can it be?

texts:
I am a complete coding/mapping novice and I have no experience whatsoever in this field. However, I have had a really promising business idea which would be based on an online map/website.

My plan was to build a prototype of my idea and gather a bit of revenue to prove that the idea would work. With that evidence and a sound business plan, I could then approach a bank/start-up fund/etc to help me commission a professional developer to build the full online map/website.

However, I've started to do some reading on the subject and it is all incredibily detailed. I know all you guys have vast amounts of knowledge/experience - am I kidding myself that I could build a prototype? Or do you think I'll be able to pick up enough knowledge?


texts: In hyperbola model of how GPS equations are solved, why do 3 satellites give only 2 hyperboloids and 4 satellites only 3?

texts:
The Hyperbola depiction of how the GPS equations are solved:

From several psuedoranges measured at the same time, we can calculate the (absolute) difference in the  distances between us and these GPS satellites. 2 satellites gives us 1 known difference in distance, and we can plot our position along the surface of a hyperboloid where all points at the surface have the same (absolute) diff in distance to the 2 satellites. From there we can add an other or several other additional satellites to make more hyperboloids which will create an intersection point at our (receiver) position.
We will need 3 hyperboloids to make one point of intersection.

Why will 3 satellites give us only 2 hyperboloids as opposed to 3?
(hyperboloids between satellites 1 + 2, 2 + 3, AND 1 + 3?)

And why will 4 satellites give us only 3 hyperboloids as opposed to 6?
(hyperboloids between satellites 1 + 2, 2 + 3, AND 3 + 4
AND 1 + 3, 2 + 4, 1 + 4 ?)

Formula taken from one of the answers under:
k satellites in general position do determine k(k-1)/2 hyperboloids

So, why do we need the 4th satellite, when it is not needed to make 3 hyperboloids?


texts:
I would like to upload some symbols into QGIS using version 2.14 (Essen). I would like to upload a PNG but it seems the only format available is XML.

Do you know if its possible to upload PNG's directy into QGIS? If not how to convert a PNG to XML without coding?

I tried on a website but QGIS can't read the data.


texts: PDAL removes color attribute from LiDAR point cloud?

texts:
I am trying pdal to perform a ground filtering on a point cloud (las file) with colors. I use the pcl option and this tutorial Identifying ground returns using ProgressiveMorphologicalFilter segmentation

pdal pcl -i input.las -o output.las -p sor-pmf.json --visualize -v4

However, the result I get is without colors. How can I prevent this from happening? I tried pdal info and there are no RGB values.


texts:
I need to add a historical map from a website into QGIS. I installed the QuickMapServices Plugin and I tried to make new XYZ connections, but nothing appeared.

The website is: https://mapire.eu/en/map/secondsurvey-hungary/?layers=osm%2C5&bbox=2108467.652103985%2C6019839.160187972%2C2134246.039893161%2C6027482.863016489

I tried some variations of the URL too.

How should I modify the URL?
 Is there another way to import somehow this historical map from the above-mentioned website?


texts: Converting from points to raster by making point at lower left corner of cell?

texts:
How do I convert from points to raster making the point the lower left corner of the cell?

I'm using ArcGIS 10.1.

The default for the "Convert Point to Raster" tool is to make the point the centroid of the resulting raster cell.


texts: How to use contours to create polygons around hills?

texts:
I have a shapefile with contours for a Brazilian state. The contours give me the elevation across that particular state.
My goal is to use the contours to identify hills.
Ultimately, I would like to create polygons around hills.
Initially, I thought about dividing the Brazilian state into small grids, calculate the mean elevation in the grid, and then identify hills by looking at the grids with high elevation. However, this approach does not seem to take into consideration the relative aspect of hills (they have higher elevation relative to other areas immediately next to it, but can still have lower altitude relative to areas on the other side of the state, for instance).
It seems that the contours are able to capture the presence of a hill relative to the elevation of the terrain in the surrounding areas: "Concentric circles indicate a hill. When contour lines form closed loops all together in the same area, this is a hill. The smallest loops are the higher elevations and the larger loops are downhill" (https://courses.lumenlearning.com/sanjac-earthscience/chapter/topographic-maps/#:~:text=Concentric%20circles%20indicate%20a%20hill,the%20larger%20loops%20are%20downhill.).
My goal is to find these "concentric circles" and draw a polygon around them.
My question is somewhat similar to these ones, however, I am hoping to perform the task using R (or QGIS, although with difficulty), as opposed to python or ArcGis:
How to find depressions (sinks) and hills based on contour line features
Identifying highs on DEM using ArcGIS Spatial Analyst?
I am extremely new to GIS and have never dealt with contours before, so I apologize if the question is too basic.


texts:
How can I anti-alias the edges of raster data like in the screenshot?

I tried gaussian blur, but that didn't work.


texts: Using `gdalwarp` to generate a binary mask?

texts:
Suppose I have a satellite image formatted as a .tif file and a .kml file that contains a series of polygons that define an area of interest in this image. Now I can run:

gdalwarp satellite.tif satellite_aoi.tif -cutline aoi.kml

This will extract a new .tif image that only has the area of interest specified by the .kml file.

Now instead, what I want to do is perform the same area cut out but for the output, I want the areas of interest to be a mask. That is, I want the output of those regions to be a constant white color and preferably an image with a single channel. Is it possible to do this with gdalwarp? I looked at the documentation and I could not find any command to do what I need.


texts: How to set up a plugin repository for QGIS?

texts:
I am working with  python plugins  for QGIS.I developed my plugin and created .zip file including my .ui,.py and resources files.In order to incooperate this plugin into QGIS i created .xml file plugins.xml as shown below:

<?xml version = '1.0' encoding = 'UTF-8'?>

    Example #1 testing
    0.1
    1.0
    ftp://softwarindia.com

<file_name>about.zip</file_name>
<author_name>aaaa</author_name>
     <download_url>ftp://softwarindia.com/abt/about.zip</download_url>
<uploaded_by>me</uploaded_by>
<create_date>2011-08-31</create_date>
<update_date>2011-09-11</update_date>

I uploaded my .zip file and .xml file  on ftp://softwarindia.com.
In qgis i went to 'fetch python plugins'-->repositories.Added repository as name:About and url:ftp://softwarindia.com/plugins/plugins.xml.but when i go to plugins nothing is displayed in it.

what can be the problem??


texts: ArcServer 10.1 - Publishing C# Executable as a Geoprocessing Service

texts:
I am trying to publish an arcobjects C# executable as a gpservice. We did this in 10.0 by adding it to a toolbox and hitting publish. Using ArcCatalog in 10.1 you must first run the script before you can 'Share as a Geoprocessing Service'.

I've run the GP tool successfully and have tried both 'Publish to Server' and 'Save as a Service Definition' file. It won't let me go any further though. It comes back with Script Syntax Error Line: 1 - which leads me to believe it is trying to parse the executable as a python script.

Does anyone know how to overcome this? And better yet is there any way to publish a GP service without running it first?


texts: How to determine the length of a KML line tracing

texts:
I have a KML file which contains a line feature representing the passage of an Optical Fiber connecting two cities. I can trace them nicely in QGIS and OpenStreetMap.

I would just like to know how I can determine its length.


texts: Code to open web browser crashes ArcMap when run from a Python add-in

texts:
I created an ArcMap Python add-in using ArcGIS 10.1 to open a webpage after the map is clicked. It opens the page but then ArcGIS crashes.

import arcpy
import pythonaddins
import webbrowser
class ToolClass2(object):
    """Implementation for TEST_addin.tool (Tool)"""
    def __init__(self):
        self.enabled = True
        self.cursor=3
    def onMouseDownMap(self, x, y, button, shift):

    mxd=arcpy.mapping.MapDocument("current")
    df = arcpy.mapping.ListDataFrames(mxd)[0]
    pt=arcpy.PointGeometry(arcpy.Point(x,y))
    pythonaddins.MessageBox("Long" + " " + str(x) + '\n'+ "Lat"+ " " + str(y), 'Coordinates', 0)
    path = 'http://pol.pictometry.com/en-us/php/default.php?lat=' +str(x) +'&lon=' + str(y)+'&v=p&o=n&type=or&level=n'
    webbrowser.open(path)
    pass


texts: What are the Differences Between TMS, XYZ & WMTS?

texts:
There are currently three different ways of Serving out Tiles:

TMS
WMTS
XYZ

I do know that XYZ is now the most popular one, and is used by services like Google, Mapbox, OSM and many others.

What is the Technical difference between the three?


texts: ArcPy Geocode Addresses works in ArcPy window but not in a standalone script

texts:
This issue sounds like a repeat of ArcPy function works in ArcMap Python window but not from standalone script? but I am receiving a different outcome so this is why I am posting here.

The following is a simple geocoding script that works if loaded in the arcpy window but not running outside of Arc software.  There is no error when running outside of Arc and it runs all the way through with a very low yield of geocoded features.

This is an issue with all Address Locators, Composite Locators and Custom Composite locators.  Currently using StreetMap Premium 2017 R2 as the source for the custom Composite_Parcel locator listed below.  The only difference between the Composite_Parcel and the standard USA_2017R2_TT_CompositeZip4 ESRI install is I changed the "Derive output geometry from display fields = No" to "Derive output geometry from display fields = Yes" in the USA_2017R2TT_PointAddress locator.

# Local variables:
tbl_WM_REPAIR_LEAKS_UAT_20190325113927 = "C\\ZZZZZ\\YYYYY\\XXXXXX\\\\Test Geocode\\Test Geocode.gdb\\tbl_UAT_20190325113927"
Composite_Parcels = "C:\\ZZZZZ\\YYYYY\\XXXXXX\\Composite_Parcels"
Geo_Model_Builder = "C:\\ZZZZZ\\YYYYY\\XXXXXX\\Test Geocode.gdb\\Geo_py_script_try_2"

# Process: Geocode Addresses
print 'Started Geocoding'
arcpy.GeocodeAddresses_geocoding(tbl_WM_REPAIR_LEAKS_UAT_20190325113927, Composite_Parcels,
                                 "Street AddrAdded VISIBLE NONE;City City VISIBLE NONE;State State VISIBLE NONE;ZIP <None> VISIBLE NONE;ZIP4 <None> VISIBLE NONE",
                                 Geo_Model_Builder, "STATIC")

If ran outside of Arc here is the breakdown by Loc_name:

Point Address: 285
Null: 2278

If loaded into arcpy window in Catalog or Maps here is the breakdown by Loc_name:

Point Address: 1830
Street Address: 525
StreetName: 84
Admin Places: 122
Null: 2

Software Specs:

Arc 10.4.1
Advanced License

Python:

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit
(Intel)] on win32

I've tried to edit performance Search timeout of the Address Locator from 1 second to 10 seconds but this did not change the results of the output.


texts: Draw borders 200m left and right of a line

texts:
I just installed QGIS for I'm trying to do the following.

I've made a layer from a GPX file. So the result is I see a line on a map. Now I want to add two 'boundaries'. I want to make a line 200 meters left and right of it, following the route of course.

Or

Make the route line 400 meter thick with a center line and a transparent color. I saw where I could edit the layer line but it doesn't seem to be able to do this

Does someone have a pointer on how to do this?

The goals is to then try and load the line with map back into e.g. a garmin device to take the route but stick in the boundaries


texts: Save multiple raster files as shapefiles

texts:
I am trying to reproject multiple raster layers and then save the resultant images as shapefiles. I seem to be getting an error this error - inherits(obj, "Spatial") is not TRUE. Below is the code.
outpath <- "output/path"

setwd("X:/input/patht")

files <- list.files(pattern=".tif")

outfiles <- paste0(outpath, files)

for(i in 1:length(files)) {

  r <-raster(files[i])

  newproj <- CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 ")

  rWGS <-  projectRaster(r, crs= newproj, res= 0.00012603363)

  rc1 <- writeOGR(rWGS, outfiles[i], driver="ESRI Shapefile", overwrite=TRUE)

}


texts: I am working on elevation data for an area in Sudan. Between Google Earth Pro and SRTM elevation data, which one is more reliable?


texts:
I'm looking to run an automation using MapInfo and Mapbasic.

What I want to achieve is to run through a MapInfo table on a row by row basis producing a map for each row within the table and then saving each map as a jpg image on the PC.  I would also like to label each map with a label in the table.  Each map ideally needs to fill the window appropriately as it runs through the query ideally maintaining the size of the map each time.

Is this possible?


texts: Add loading image until filtered layer is shown ol5

texts:
I am developing a portal in which I have created a rectangle buffer and the polygon within buffer is selected. Here is my code to filter layer

var polyStyle = new ol.style.Style({
    stroke: new ol.style.Stroke({
        color: 'green',
        width: 3
    }),
    text: new ol.style.Text({
                text:("abcd"),
                stroke: new ol.style.Stroke({
                color: 'red', width: 2
            }),
                font: font_size+'px Calibri,sans-serif',
            })
 });
  var select = new ol.interaction.Select({
     style: function(feature) {
                  polyStyle.getText().setText(feature.get('KHASRA_NO'));
                  return polyStyle;

     }
 });
  map.addInteraction(select);
 var selectedFeatures = select.getFeatures();

cadLayer = new ol.layer.Vector({

          visible: true,
          source: new ol.source.Vector({
            loader: function(extent) {
              $.ajax('http://localhost:8080/geoserver/wfs', {
                type: 'GET',
                data: {
                  service: 'WFS',
                  version: '1.1.0',
                  request: 'GetFeature',
                  typename: 'web_export:KHASRA_POLY1',
                   outputFormat: 'application/json',
                  srsname: 'EPSG:3857',
                  bbox: extent.join(',') + ',EPSG:3857'
                }
              }).done(function(response) {
                console.log("response "+response);
                         features = new ol.format.GeoJSON().readFeatures(response);

                         // extent_swe=vectorSource.getExtent();
                        features = features.filter(function(el) {
                              if (jstsGeom.contains(parser.read(el.getGeometry()))) {
                                return true;
                              }
                            });
                            console.log("features "+features);
                             select.getFeatures().extend(features);
                            // vectorSource.addFeatures(features);

              });
            },
            strategy: ol.loadingstrategy.all,
            projection: 'EPSG:3857'
          }),
           style: new ol.style.Style({
                                  stroke: new ol.style.Stroke({
                                    color: 'yellow',
                                    width: 1
                                  }),
                                   opacity: 1,
                                })
        });

            map.addLayer(cadLayer);

result image is

Now my problem is when layer is filtering it takes time to show result so that users don't know when result is shown.  I am thinking to add loading image so that user get to know result is coming.

How can I add loading image until result is shown.


texts: How to remove a vector QgsVectorLayer from QGIS python plugin

texts:
I managed to add QgsVectorLayer in QGIS through a python plugin, for example:

vl = self.iface.addVectorLayer(uri.uri(), layerName, self.dbConn.getProviderName())

But how can I remove it?


texts: Public site WMS bounding box seems wrong

texts:
I'm having an issue with several WMS feeds that i'm looking at, where their bounding box seems wrong.  I think i would assume the issue is with the provider, but there are multiple enough that i think that maybe the problem is with how i'm interpreting the data?

For example, take http://inspirepub.waterinfo.be/arcgis/services/risicokaarten/MapServer/WMSServer?SERVICE=WMS&REQUEST=Getcapabilities

if you look at the top level layer, the bounding box is:

<BoundingBox CRS="EPSG:4326" minx="50.638080" miny="2.539990" maxx="51.505965" maxy="5.936689"/>

which looks like the following image

which is the small grey box off the east coast of africa.  I have the same problem withe these other three sites, all independent of each other:

https://geoservices.informatievlaanderen.be/raadpleegdiensten/GRB/wms?SERVICE=WMS&REQUEST=Getcapabilities

https://mercator.vlaanderen.be/raadpleegdienstenmercatorpubliek/tn/tn:tn_refpt_awv/wms?SERVICE=WMS&REQUEST=Getcapabilities

http://geo.gent.be/geoserver/wms?SERVICE=WMS&REQUEST=Getcapabilities

These all have the '.be' domain so i assume they should be in, or at least near belgium.  Am i reading the data wrong here?  Or is there something else going on that i don't understand?


texts: What is the best way NDVI can be used for assessment of remediation level of ecosystem (after nuclear accident)?

texts:
I am thinking about ways to assess efficiency of various bioremediation methodologies and self-remediation of an ecosystem polluted with nuclear waste.

I would like to use NDVI as an assessment criterion, and I would like to know whats the best way of doing it.


texts: Pan sharpening Quickbird images in Python

texts:
I'm attempting to pan sharpen four band images in Python with a higher resolution panchromatic band image.

I have imported them using GDAL and converted them to numpy arrays for the purpose of classification. While I'm not looking to classify the images that are pan-sharpened, I am looking to use them for comparison and display purposes.

Is there a way to re-sample the band arrays using the panchromatic array,


texts: produce a grid of geographic coordinates within 1 mile of each other with QGIS or PostGIS

texts:
For a given county (bounded box, lets say), I need to get a network of gps points such that each point is 1 mile from its nearest neighbor point in each cardinal direction. The result of this initial calculation would be an array of gps coordinates, which if displayed on a map would look like the vertices on a piece of graph paper.

With the one mile radius requirement, this process is arduous by hand for reasonably sized areas..

I'm using an API that takes point data combined with a buffer radius value to find locations. The plan is to make the buffer radii something like 0.7 miles in order to ensure 100% saturation of a given area.


texts: I am trying to perform a viewshed analysis (using the visibility function), however the output only shows a very strange area for the visibility areas. It makes no sense that my point which is at a high elevated level would be only seeing things to its east. I am not sure what is wrong and I get weird outputs with several different point I try.


texts: Simple field calculator equation in ArcGIS 10.2.1 not working with python parser

texts:
I am trying to calculate a percentage in a field in a table. customers and total_customers are short integer fields.

arcpy.AddField_management(tableSepSel2, "percent", "DOUBLE")
arcpy.CalculateField_management(tableSepSel2, "percent", "!customers! / !total_customers!*100", "PYTHON_9.3")

I don't get any errors but all the values in the percent field are zero when most of them should not be zero.

If I go into ArcMap and use the field calculator with the Python parser, the same thing happens. However, when I choose the VBScript parser in ArcMap and redo the code using brackets it works fine.


texts: Transform height position from ECEF (EPSG:4978) to RH2000

texts:
I'm a novice regarding coordinate system and projections, and I'm trying to transform ECEF coordinates (projection adopted by Cesium) to the Sweref99 projection including the RH2000 height system (for example EPSG 5848). I'm using proj4js that recently received an update allowing geocentric conversions (here)
Doing the transformation extracts the correct northing and easting values, but the height value (what I was expecting to be in RH2000 format) is off by a couple of meters. I have seen this (Q&A), and it might not be the RH2000 height? What is actually returned, and how would I (can I) use this information to transform to RH2000 format?
My case uses the following data:
- EPSG:4978: 3440988 914941 5274065
   transforms to
- EPSG:5848: 143171.919 6225798.530 8.581

The elevated value is expected to be ~4 (meters).
As I'm a novice regarding this and I have a very limited understanding of what proj4js is doing, neither practically or theoretically. I have a hard time understanding what is happening.
Any help is appreciated.
Thanks in advance.
PS: Any pointers to 'light' reading of the basic understanding of coordinates systems and transformations would also be very appreciated.


texts: Mapbasic write and read csv into python tuple type structure

texts:
In mapbasic I need to read a csv into an array but arrange each row of the csv independently.

See the current result, code etc below.

I want it to be something like a python dictionary

([Bushfire_V Char (1) ;,Bushfire_V, Bushfire Hazard - Very High,    Bushfire_Hazard,OVL2_CAT,BHR_VPI], [Agri_Ovela Char (1) ;,  Agri_Ovela, Agricultural Land Class,Agricultural_Land_Classification_Class_A_and_B, OVL_CAT,NR])

Later on I need to pass some of these to other subroutines to run a process.

For example I need

planning_tab="Bushfire_Hazard"+".tab"
planning_layer="Bushfire_V"
planning_attrib="OVL2_CAT"
planning_val="BHR_VPI"

then on the next run

planning_tab="Agricultural_Land_Classification_Class_A_and_B"+."tab"
planning_layer="Agri_Ovela"
planning_attrib="OVL_CAT"
planning_val="NR"

Input CSV

Code base

Call ReadTextFileToArray(txtFile, myArray) '// populate array
For i = 1 to UBound(myArray)
 Print i+", "+myArray(i)
 Next    '// go to next element in array
Sub ReadTextFileToArray(ByVal txtFilePath as String, myArray() as String)

Dim i as Integer

    i = 1

    Open file txtFilePath for input as #1   '// open text file for input (to read) as #1
    Do Until EOF(1)             '// do until the end of file #1 is reached
        Redim myArray(i)        '// resize array to i
        Input #1, myArray(i)    '// read value from text file
        i = i + 1               '// increment i
    Loop                        '// return to Do Until...

End Sub

Result

1, Column
2, Cleaned
3, Friendly_Name
4, Related_Tab
5, Tab_Column
6, Value
7, Bushfire_V Char (1) ;
8, Bushfire_V
9, Bushfire Hazard - Very High
10, Bushfire_Hazard
11, OVL2_CAT
12, BHR_VPI
13, Bushfire_M Char (1) ;
14, Bushfire_M
15, Bushfire Hazard - Medium
16, Bushfire_Hazard
17, OVL2_CAT
18, BHR_MPI
19, Bushfire_H Char (1) ;
20, Bushfire_H
21, Bushfire Hazard - High
22, Bushfire_Hazard
23, OVL2_CAT
24, BHR_HPI
25, Acid_Low Char (1) ;
26, Acid_Low
27, Acid Sulfate Soil - Low Probability
28, Low_Probability_of_Acid_Sulfate_Soils
29, OVL2_CAT
30, PAS_A20
31, Acid_High Char (1) ;
32, Acid_High
33, Acid Sulfate Soil - High Probability
34, High_Probability_of_Acid_Sulfate_Soils
35, OVL2_CAT
36, PAS_A05
37, Agri_Ovela Char (1) ;
38, Agri_Ovela
39, Agricultural Land Class
40, Agricultural_Land_Classification_Class_A_and_B
41, OVL_CAT
42, NR
43,

How do I write it into an array, tuple (or whatever Mapbasic calls it) and read from it a row at a time?


texts: How to create a new column to store the length of a linestring in postgis?

texts:
I am working with pgRouting, following this nice guide：A Beginner’s Guide to pgRouting

I am now in this step：Calculating shortest routes, with these codes below

SELECT * FROM shortest_path('
SELECT gid AS id,
      start_id::int4 AS source,
      end_id::int4 AS target,
      shape_leng::float8 AS cost
FROM network',
1,
5110,
false,
false);

and my network table looks like this

apparently I have no column "shape_leng", so I need to create a new column in table network, and it is the length of every row.

But I don't know how I should type the ST_length code.

Can someone give me some advice？


texts: Why does FME reproject to wrong Coordinate system with TIFs?

texts:
I have a TIF Image in EPSG:31467 and need to reproject it to EPSG:25832 and convert to ECW format. I have to do this with FME2017 as ESRI does not write to ECW without the ECW licence. After transforming, I then load the image into ArcGIS 10.3.1 and see that the resulting image gets the coordinatensystem EPSG: 2632 (NUTM32) assigned to it. Where does this NUTM32 System come from?  If I do the same with a SHP from 31467 to 25832 it works fine and shows the right coordinatsystem in ArcGIS.

Why does this work differently for images?


texts: How to apply ArcGIS time slider on Multiple Data Frames at once?

texts:
Is there a way to use the Time Slider on multiple data frames simultaneously?

Example: My Dataframe 1 shows precipitation values over an area and DataFrame 2 shows corresponding temperature.. I want to be able to use the slider to advance both DFrames at once. Right now only the 'activated' dataframe is being changed with the slider..

Another example:

I have one main map and 4 inset maps with the same time-aware dataset (see image with main frame activated). I can only export the animation with one frame following time. I would like the end result to be sequential images.  Has ESRI evolved some way to control multiple frames, or can you suggest a method that would get the same result?


texts:
I am new to GIS.

From what I understand a GIS layer has one or more features (of some geometric shape like Point, Multipoint, Linestring, Multi linestring, Polygon, Multi polygon and so on). I have such a layer exported in a geojson as

  {"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3857"}},"type":"FeatureCollection","features":[{"type":"Feature","properties":{"FID":123,"TEXT":"fh","attaches":[]},"geometry":{"type":"Polygon","coordinates":[[[9716249,2699679.25],[9716249,2697386.25],[9718542,2697386.25],[9716249,2699679.25]]]}},{"type":"Feature","properties":{"FID":12345,"TEXT":"gsg","attaches":[]},"geometry":{"type":"Polygon","coordinates":[[[9718996,2701934.25],[9718095,2702668.75],[9719635,2699498],[9720694,2694714.75],[9721795,2698906.75],[9721278,2700393.75],[9718996,2701934.25]]]}},{"type":"Feature","properties":{"FID":123456,"TEXT":"xhd","attaches":[]},"geometry":{"type":"Polygon","coordinates":[[[9717095,2699714.5],[9717095,2697421.5],[9719388,2697421.5],[9717095,2699714.5]]]}}]}

What is wish to do is merge some overlapping features and make them as one. Say merge two overlapping polygons and make them as one polygon feature.

Are there any libraries/apis in Java to help me do the merging part?

I have exported this layer using the NextGIS android app.


texts:
I want to create a mosaic using multiple tiles. Firstly I've tried GDAL using gdalbuildvrt + gdal_translate commands.
Then I wanted to use Rasterio for creating mosaics. I've used rasterio.merge.merge function to do this.
The memory usage differs between the above-mentioned methods. Rasterio uses more memory compared with GDAL. Is there any workaround to use Rasterio for mosaicing with less memory?


texts: Opticks 4.11.0 (Ubuntu 64bit) - unable to load TIFF file

texts:
I am trying Opticks 4.11.0-1 - have official release opticks_4.11.0-1_amd64.deb but unlike in Windows I am totally unable to load Landsat 7 TIFF files. In Windows I can do this using auto importer. In linux it reports The dataset is empty" although I am able to load the same file on windows machine without problem.

The package looks to be OK in Muon Package Manager (so not corrupted), gdal is installed (I also have QGIS) and Opticks do not show any error message during startup.

Do you have any idea what could be problem?

thanks


texts: Getting more details by zooming in web-client?

texts:
today I've setup a qgis server and web client on my windows machine.
Here is my WebClient.

Now I'd like to test out everything.
I tried to zoom in to the map, but it just stops by 1:2257 . I need more details.

I've checked the Settings in the GlobalOptions.js

    var MapOptions = {
  projection: new OpenLayers.Projection(authid),
  units: "m",
//  maxScale:50,
//  minScale:4000000,
  numZoomLevels:ZOOM_LEVELS,
  fractionalZoom: !enableWmtsBaseLayers && !enableBGMaps,
  transitionEffect:"resize",
  controls: []

I've tried to uncomment the max-/minscale and changed the values, but nothing works.

I hope you can help me to configure my new QGIS web-client.

(for example, I want to let the user zoom from 1:40000 to 1:50 like here.)


texts:
A while ago I made a plugin for QGIS for myself.

This worked until version 2.18. Now I have version 3.0 and would like to use this plugin here too. But I get some error messages. I have been able to solve most of them fairly easily. Only I can not do this. Perhaps there is someone among you who can help me in this.

This is the code that I used before.

 def initGui(self):
    """Create menu entries and toolbar icons inside the QGIS GUI."""

    icon_path = ":/plugins/BFVWtools/"

    """Create the menu entrie Configuratie and toolbar icon inside the QGIS GUI."""
    self.add_action(icon_path + "/icon.png", text=self.tr(u'Configuratie'),
    callback=self.run, parent=self.iface.mainWindow())
    self.action = QAction( QIcon( os.path.dirname(os.path.realpath(__file__)) + "/icon.png" ), "Configuratie",
    self.iface.mainWindow() )
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)

The error message I get is the following

AttributeError: type object 'QObject' has no attribute 'connect'
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 345, in startPlugin
plugins[packageName].initGui()
  File "C:/Users/Automatisering/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BFVWtools\bfvw_tools.py", line 212, in initGui
QObject.connect(self.action, SIGNAL("triggered()"), self.run)
AttributeError: type object 'QObject' has no attribute 'connect'

Apparently there is no attribute 'Connect' in QObject

After your explanation, I have converted everything to PyQt5 and changed the connect to slot. The strange thing is that I now get all the entrys from the menu one after the other.


texts: Use zonal statistics for only some part of input shapefile

texts:
I have a district shapefile (districts have different size) and a raster file of precipitation (18 km grid square resolution). I want to calculate precipitation for each district which I did using zonal statistics using my district as my feature zone data, precipitation as my input raster and statistics type = mean.

I have another raster file (0.5 km resolution) which shows the distribution of cropland in my district shapefile i.e. a grid with cropland has a value of 1 and a grid without cropland has a value of 0. What I actually want to do is to calculate the mean rainfall of total cropland within a district and not for the entire district.

Could anyone suggest how to go about it?


texts: Setting up an own instance of Overpass API server

texts:
I need to use overpass-api server local, I found this link:
Overpass-Api-Install
but it says "Additional functionality like management of areas and the line diagram utils aren't covered yet",what does that mean?Can't I use opverpass-api local and request query?


texts:
I understand that the GeoServer can produce vector tiles in three formats: GeoJSON, TopoJSON, and MapBox Vector (MVT). Moreover vector tiles has many advantages in handling data such as reduced size and faster rendering. Could the Vector tiles be used for the netCDF data to improve the performance of the data rendering on the client side?

I observed that raster data could be triangulated and converted to vector tiles. In doing so, will the quality of the data been reduced?


texts: Enable PostGIS extension on Ubuntu 14.04.2

texts:
I have troubles enabling PostGIS extension on Ubuntu 14.04.2 and PostgreSQL 9.3. I have installed the packages with this step by step procedure.

PostgreSQL and pgAdminIII seem to be installed properly. I can launch pgAdminIII and the localhost default server exists. I add a new DB and type in CREATE EXTENSION postgis;. I get the following error:

ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/postgis.control": Aucun fichier ou dossier de ce type

Could anyone help?


texts: How to calculate GRASS covariance matrices in QGIS with r.covar?

texts:
I would like to calculate covariance matrices between different bands of the same raster in QGIS (2 or 3). I have found only one built-in processing tool capable of doing this, named r.covar from GRASS.

Unfortunately, in QGIS this tool is structured to only accept "entire" raster layers as input, while in GRASS it is indeed possible to calculate covariance matrices between bands of the same raster dataset.

I have tried to trick PyQGIS to accepting GDAL's bands as inputs, but it only accepts raster layers. Does anyone have a solution to this problem or perhaps a user script that does creates covariance and correlation matrices?

I would strongly prefer not to save each band as a separate file strictly for this problem.

Sample code:

import processing,gdal

rasterLayer = iface.activeLayer()
ds = gdal.Open("C:\\Multispectral_Clipped.tif")

outputRaster= "C:\\Output.html"
extent =rasterLayer.extent()

xmin = extent.xMinimum()
xmax = extent.xMaximum()
ymin = extent.yMinimum()
ymax = extent.yMaximum()

#Not working option
output=processing.runalg('grass7:r.covar', [ds.GetRasterBand(1),ds.GetRasterBand(2), ds.GetRasterBand(3)],True,"%f,%f,%f,%f" %(xmin, xmax, ymin, ymax),outputRaster,None)

#Working option
output=processing.runalg('grass7:r.covar', [rasterLayer],True,"%f,%f,%f,%f" %(xmin, xmax, ymin, ymax),outputRaster,None)

EDIT
I suspect my request above is not possible. So the question is then just how to run r.covar with multiple inputs in PyQGIS (QGIS 2.18)?

Even with having the line:

output=processing.runalg('grass7:r.covar', [rasterList],True,"%f,%f,%f,%f" %(xmin, xmax, ymin, ymax),outputHtml,outputRaw)

And the rasterList containing a Python list like so: ['C:\\band1.tiff', 'C:\\band2.tiff', 'C:\\band3.tiff']

I am getting a Wrong parameter value error. I've also tried loading them as QgsRasterLayer, like done here with the StringToRaster function, but got the same error.


texts: Do Network Services support Multimodal Networks (ArcGIS 10.1, Network Analyst Extension)?

texts:
Do Network Services support Multimodal Networks (ArcGIS 10.1)?

I'm assuming that multimodal networks are supported, but I am troubleshooting and just want to be sure.


texts:
When I do this:

// toolsView is the ToolbarControl
IToolbarMenu2 toolbarMenu = new ToolbarMenuClass();
toolbarMenu.Caption = "Top";
toolbarMenu.AddItem( new NewDocumentCommand( synchronizer ), 0, 0, false, esriCommandStyles.esriCommandStyleIconAndText );
toolbarMenu.AddItem( new OpenDocumentCommand( synchronizer ), 0, 1, false, esriCommandStyles.esriCommandStyleIconAndText );
toolbarMenu.AddItem( new SelectDocumentCommand( synchronizer ), 0, 2, false, esriCommandStyles.esriCommandStyleIconAndText );
toolbarMenu.SetHook( toolsView.Object );
toolsView.AddItem( toolbarMenu, 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconAndText );

The menu items show in the drop down but with thick dark lines between each item. When I use a class derived from IMenuDef then I don't get any lines between the items. Why are the dark lines appearing? What can I do to get rid of them? (I would prefer to use a IMenuDef derived class but I cannot because my tools and commands are not registered. (I'm not building them for distribution.))


texts: Identifying top and bottom 1% of raster cells to identify threshold value for symbology using ArcGIS Desktop

texts:
My question is similar to Identifying top 10% of raster cells using ArcGIS Desktop.
I have a Raster layer and want to identify the threshold value for top 1% and bottom 1% of the raster.  This is so I can change the symbology to show top 1% as one colour, and Bottom 1% as another.
The raster is a 32bit floating point file with a Max value of 2630.755126953125 and a Min value of -2737.8447265625
I am using ArcMap 10.61 Desktop
I have tried to use the formula indicated in the response below with no success.  I tried to test it with the 10% value (0.9) before trying it with 1% (0.99).  I end up with a blank raster.

radouxju answered Mar 3 '16 at 6:40
From your comment I understand
that you are not looking for percentile but a given percentage of your
range. You can use the raster calculator
Con("raster" >= (0.9 * ("raster".maximum - "raster".minimum) +
"raster".minimum), 1) of course 0.9 could be replaced by any value
(this is an example with 10%). Note that the results will be a raster
with 1 or Nodata, but you can also set a value instead of NoData if
you need.


texts: Ring self-intersection error when running Random Points

texts:
This error occurs on two rows of my shapefile:

  Feature (650) has invalid geometry. Please fix the geometry or change
  the Processing setting to the "Ignore invalid input features" option.
  Execution failed after 1.82 seconds

Is there a relatively easy way to fix?

On the image below the error message and the way my features look like are represented


texts: How to get the intersection of an array of polygons in BigQuery

texts:
I have a table with POLYGON geometries classified in groups of 2,3,4... features/rows. They can or cannot intersect between each other. This subsample of three features could be a good example:

The idea is to get a single row with the intersection geometry (highlighted in red). Bear in mind that the result could be a single polygon (as in the image) or a multipolygon, in case more than two combinations of geometries are intersecting. That's what I need to be recursive, because I do not really know how many geometries could be olverpping.
I would like to apply Big Query ST_Intersection function to an array of geometries.  I am trying to replicate this PostGIS function in BigQuery without success. I am not really familiar with UDF scripting in Big Query. This is the piece of code I need to fix:
create or replace function ST_IntersectionArray(geoms array <geography>) returns geometry as (
LOOP
  SET count = 0;
  SET tmpGeom = geoms[OFFSET(0)];
  IF count <= geoms.length THEN
    SET count = count + 1;
    SET tmpGeom = st_intersection(tmpGeom, geoms[OFFSET(count)]);
  ELSE
   SELECT tmpGeom
    BREAK;
  END IF;
END LOOP;
)

At the moment, the UI is complaining about the SET keyword wrongly positioned.


texts:
In ArcGIS there an option of "undo" button

I seek this option in order to return my steps if it necessary.

I try to find such option in the menu and didn't found any like it.

What can I do?


texts: Can't run pgRouting Layer plugin in QGIS 3.10.3

texts:
I was able to use osm2pgrouting tool successfully on Windows with PostgreSQL version 11.9 and pgRouting version 3.1.0. I successfully generated my "ways" file in a PostGIS conection in QGIS 3.10.3.Now I want to test a Dijkstra algorithm with the pgRouting Layer plugin, but I constantly get a Python error, as follows:
File "C:/Users/jorge/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pgRoutingLayer\pgRoutingLayer.py", line 1255, in openHelp
          db = self.actionsDb[dbname].connect()
         KeyError: ''

I am already connected to my postgres DB through DB Manager of QGIS but in my pgRouting Layer dialogue box, I am never "shown as connected" to my postgres DB as shown in following figure. I tried to press refresh button and drop down list many times but no use. I've also saved my user and password in my DB connection, but it haven't solved my problem.


texts: Get road polyline from road polyline buffer layer

texts:
I need to reverse the action of buffer tool. I had two polyline layers from two different sources with different attributes for a section of a city, that I needed to combine. In order to spatially combine those, I made created a buffer of one of those and then used that to spatially join. Now the joined attributes are in the buffer layer and I need to get the polylines for the that layers. I couldnt do the other way around ( join the features to the lines instead of the buffer) because of the characteristics of the layers.

Is there any way to convert buffer layer to road polyline layer? I tried spatially joining the buffer layer to the original road layer,but the files are large and the "memory not enough" error pops on.

or is there an any simpler way to merge attributes of two road polyline layers?


texts: Plotting points using AusMap plugin QGIS v3?

texts: I am trying to plot infrastructure points from the AusMap plugin but it does not align with my current CRS. The points are in GDA2020 - when I change my basemap to this it still does not align. I am struggling understanding CRS's in Australia!


texts:
I have just started using QGIS and im trying to create a DEM from laserdata using LAStools.
I have to split the laserdata since im not using a premium LAStools, but when i do i get these tears where the images dosent overlap/match up precise.

Does anyone know of this problem and how to solve it?


texts: How to count points within the current Print composer atlas feature in QGIS 2.8?

texts:
In the print composer when generating an atlas, does anyone know how to show he feature count per each atlas coverage feature?

For example, I have generated an atlas where each map is a different province (in Cambodia) containing a village point layer. When I click the sigma sign at the bottom of the legend for villages, the feature count will calculate the entire country's number of villages, not for the individual province's number of villages.

Does anyone know how to get a feature count in for the province showing in the atlas?


texts: How to "calculate" distance-to-ground of all 18 OSM zoom levels?

texts:
Assuming I'm building a 3D solution with the "world" being mapped to global geo-data supplied by OSM / Cloudmade... think http://www.webglearth.com but with completely different goals and use-cases. In fact we won't have a round sphere but only work off a "flat" (+ elevation later) surface/ground plane at all times.

Now assume further that we want to texture the "visible" fragments of the "ground" plane with OSM and/or Bing/MapQuest/Google aerial map tiles, the level of detail / zoom level to be chosen based on the "camera's" / viewer's "altitude" / distance-to-ground -- say in meters.

Knowing that 1. we only use OSM-equivalent tiles using exactly the same spherical mercator projection (which, from what I gather, is used by all the major map players ie. OSM, Google, Bing) and hence 2. always equivalent scale-distortions depending on latitude: how can I decide which zoom level to switch to when viewer altitude changes?

Of course the boundary cases are easy: zoom level 18 is to be used on-or-close-to-the-ground and zoom level 0 from "outer space". But the intermediate cases are a mystery to me when it comes to figuring out "from which altitude they had been taken if they were simple photos", so to speak.

I saw this page http://wiki.openstreetmap.org/wiki/Zoom_levels and some related pages but nowhere did I find an approximation on how to "map" a fictive altitude to a zoom level.


texts: I want to import images with a relative path to my QGIS Project. I followed this https://www.youtube.com/watch?v=JnQk0NRqCyM tutorial. So far, so good. Works fine. My problem is, that my QGIS-Project has to be portable, so it must work with relative paths to the images. The guy in the tutorial made it with absolute paths. My first idea was to just concat the relative path with my image name, like that: concat('/Bilder_Venues/', "Name") (Bilder_Venues is the folder my images are stored, a subfolder of my project folder). If I do so, it doesn't work anymore. If I use an absolute path like the Guy in the tutorial, it works ('concat('C:/Users/???/Desktop/???/Bilder_Venues', "Name"). Any ideas, how to make it work with relative paths? The option in the project properties to save paths as relative is activated.


texts: How to find intersections of lines less than 45° in FME

texts:
I'm trying to identify intersections of electrical transmission lines that are less than 45° in FME.  While, in theory, this doesn't seem like such a daunting task, in practice, it's proving quite difficult.

I can easily determine intersection points using the Intersector Transformer.  However, the problem I'm having is twofold:

I'm unable to accurately identify all crossings that are 45° or less using this method.  The Intersector Transformer provides a fme_node_angle attribute which contains the angle in degrees of the intersection.  However, I don't know how helpful this is.
There are cases when there are multiple lines running coincidentally and then diverge.  For example, in the below image, F1907 and F1908 follow the same path and then diverge:

The Intersector transformer identifies this point as an intersection, but it is not valid for my purposes.

What I really need is a way to identify "true" intersecting lines.  That is, the lines actually cross paths and the angle of intersection is less than 45°.  A valid intersection might look like this:

Other things to note:

There may be two lines running coincidentally which cross another line (or two lines).  This is potentially a valid crossing.
I have looked at the LineOnLine transformer, but this doesn't give me angles of intersection.

Hope this makes sense.


texts:
I am trying to dive into Python programming in QGIS. I want to write an expression in my layout that returns some values depending on the current atlas feature.

What I need first, is to get the same value as I can get with @atlas_pagename - then I will use that to query another table and get the data I need. I guess what I need to do is to create some kind of atlas object that follows the atlas in the current layout and then I should be able to read the information I need from that, but I have so far not managed to find anything about that in the manuals I've found.

I have found how to make a new layout or new atlas, but how can I dig into the current one? (Using QGIS 3.6.1)


texts: Is it possible to use a Multipatch to implement IFeatureRenderer.Draw in a custom renderer

texts:
I have a custom renderer which need to render modified geometry.  The input features are all coming in via the IFeatureCursor as polygon elements.   (This is similar to this example, though I'm not rendering points.)

I can easily render Polygons, Lines, and Points via either passing the new geometry into IFeatureDraw.Draw or calling IDisplay.DrawPolygon/IDisplay.DrawPoint/etc.

However, IDisplay does not provide a mechanism for drawing a multipatch, and passing this in as the geometry to IFeatureDraw.Draw results in nothing drawn to the screen.

Is there a way to directly "draw" a multipatch element (preferrably with texturing), within this method?


texts: Getting currentfeature's color in Expression Builder of QGIS?

texts:
In QGIS Expression builder. I want to obtain the color code of the current feature.

I mean:

My layer contains lines, each one is painted with a different color. Now I want to assign that color to its label. In label definition, in the color property's expressions builder, how could I obtain that attribute?

I tried:

attribute( $currentfeature, 'color')

But it is not working...


texts: Uncaught typeerror: undefined is not a function

texts:
Using some examples from internet, I found this code that shows WMSGetfeatureinfo

I don't know where's the problem:

Here goes my code:

<!DOCTYPE HTML>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>MB_OL</title>
<link rel="stylesheet" href="css/google.css">
<link rel="stylesheet" href="css/view_css.css">
<link rel="stylesheet" href="../openlayers/theme/default/style.css" type="text/css" />


texts: Automatically updating user-edited features in QGIS plugin

texts:
I am working on a plugin for QGIS (2.12).  It uses data stored in an Spatialite database.  When the user creates a new feature, the plugin should:

update the feature attribute table (the popup form is disabled)
update another (non-geometry) table in the database
if the polygon overlaps any existing polygons:

update the polygon geometry using the difference method

The modifications do not need any user input, and can happen in 'real-time' or following a commitChanges(), but the user should remain in (or be returned to) an editing session.

What is the best strategy for this? Should I use the provider, the vector layer functions, the iface.vectorLayerTools?

So far, I have not had much success.  I have a class that is created on the layer.editingStarted() signal that listens for changes to geometry.  It includes the following:

def __init__(self, iface, vlayer, db):
    self.vlayer = vlayer
    self.edit_buffer = vlayer.editBuffer()

def connect_signals
    self.edit_buffer.featureAdded.connect(self.feature_added)
    self.edit_buffer.geometryChanged.connect(self.geometry_changed)
    self.vlayer.beforeCommitChanges.connect(self.disconnect_eb_signals)
    self.vlayer.committedFeaturesAdded.connect(self.committed_add)

I first tried to use the edit buffer's featureAdded() signal e.g.

def feature_added(self, fid):
    self.vlayer.beginEditCommand('Update attributes')
    self.vlayer.changeAttributeValue(fid, 1, 'new_value')
    self.vlayer.endEditCommand()

Using the temporary fids given to the pre-commit features prevented making the changes to the other tables, which needed to reference them.  Also, this method caused QGIS to crash/segmentation fault if the Undo command was used (on Linux, and with Undo, Redo on Windows).

Is this a bug, or am I just approaching this in the wrong way?

I have also tried using the commitedFeaturesAdded() signal.  This solved the undo/redo issues and allowed me to update the attribute table directly in the database via SQL commands, after the feature was created with the final fid.  However, now when I try to change the geometry and check for intersection/overlap again I get stuck in a loop of newly committed features.

Finally, I tried calculating the modified geometry, exporting as Wkt and using GeomFromText to update the vlayer table directly.  In this case, the SQL is run without error, but the geometry doesn't seem to be updated.


texts:
I've been trying to invoke my first MB function to do some error handling and I keep getting an "Unrecognised command: OpenTab".

We have

Function OpenTab(ByVal TableName as String, ByVal sAlias as String) As Logical

OnError Goto NotOpen

Open Table TableName+".TAB" As sAlias Interactive
Print "Requested table:" + sAlias
OpenTab = TRUE
Exit Function

NotOpen:
OpenTab = FALSE
print "---------------------------------------"
print "Failed to open table "+TableName
print "---------------------------------------"
End Function

and

'Open Table "G:\GIS_Tables\Vector_Data\Administrative\Boundaries\DSC\Boundary_DSC" As Boundary_DSC Interactive
OpenTab ("G:\GIS_Tables\Vector_Data\Administrative\Boundaries\DSC\Boundary_DSC", Boundary_DSC)

The code is from Avoid MapBasic crash when unable to open file

What do I need to do to get this working?


texts: Understanding coordinates in Netherlands dataset?

texts:
I have data on specific addresses of companies in the Netherlands. The dataset also provides the coordinates but they look different from what I am used to see. I converted some of the addresses into the conventional coordinates and the difference is as below

y(from data),        x (from data),     x (from conversion), y (from conversion)

391550,              36169,            51.517316,           3.898328,

362102.741,           57704.823,         51.23535,            3.97432,

365154.862,           53111.293,         51.26986   ,         3.956236,

Can anyone help me as how to convert these (weird) coordinates into the conventional coordinate system. When I used the batch conversion, many addresses did not give the right coordinates and it is a very tedious job to convert the addresses manually. Manual address to coordinate conversion give the right coordinates.


texts: QGIS working with Qchainage using degrees instead of meters

texts:
i'm using Qchainage on a Polygon to Line layer, and in the input dialogue there's degrees instead of meters .. and i've used trial and error to find a suitable distance ... but the issue is that not all the created points are at the same distance from each other

my process goes as follows Creating a buffer >> polygon to line >> QChainage

is there a way to input meters ?


texts: What type of kernel density function does ArcMap use?

texts: I know that there are several types of kernel density functions, such as uniform, cosine, Gaussian, etc. I was just wondering which one the "Kernel Density" functionality in ArcMap 10's Spatial Analyst uses?


texts: Using the esriControls.ControlsSelectTool I select a text element that I have previously placed on the map. In code, how can I find this element on the map? I know I can iterate using the IGraphicsContainer but how can I tell that the element is the selected element?


texts: Creating world grid with fix number of row and columns without overlap using shapely and geopandas

texts:
I'm trying to build a grid over the world and cut it on an AOI.
The initial grid have non trivial properties.
It is a grid of squares in EPSG:4326. The dimension is not round, they simply cut the world horizontally into 2048 squares ( => 1024 vertically) or .17578125° per cell. The point [0,0] being the lower left corner of a cell.
I wrote a Python script that manages to create this kind of grid :
from shapely.geometry import Point
import geopandas as gpd
import decimal as d
from itertools import product
import numpy as np

# the size is based on the planet grid size
# the planet grid is composed of squared grid that split the world width in 2048 squares
diametre = 360/2048
radius = diametre/2

# compute the longitudes and latitudes for the whole world
longitudes = np.linspace(-180, 180, 2048)
latitudes = np.linspace(-90, 90, 1024)

# filter with the geometry bounds
min_lon, min_lat, max_lon, max_lat = aoi_gdf.total_bounds
longitudes = longitudes[(longitudes > (min_lon - radius)) & (longitudes < max_lon + radius)]
latitudes = latitudes[(latitudes > (min_lat - radius)) & (latitudes < max_lat + radius)]

# create the grid
points = []
for i, coords in enumerate(product(longitudes, latitudes)):

    x = d.Decimal(coords[0])
    y = d.Decimal(coords[1])

    points.append(Point(x, y))

# create a buffer grid in lat-long
grid = gpd.GeoDataFrame({'batch': batch, 'geometry':points}, crs='EPSG:4326') \
    .buffer(d.Decimal(diametre)) \
    .envelope \
    .intersection(aoi_shp_proj)

# filter empty geometries
grid = grid[np.invert(grid.is_empty)]

unfortunately when I watch my grid in QGIS I realized that the cells are actually overlaping. I also try without using the decimal lib but I end up with the same kind of problems (exact value of the Python float).
Is there a way to produce this kind of grid without creating ill shapes ?
EDIT
To show what I mean by ill shape. Here is the grid produce on Singapore :

And here is a zoom on the corner

The tiles are in fact not aligned and overlap


texts: Proper use of layer.invalidate() in Carto.js

texts:
According to the Carto.js documentation, layer.invalidate():

"Refreshes the data. If the data has been changed in the CARTO server those changes will be displayed. Nothing happens otherwise. Every time a parameter is changed in a sublayer, the layer is refreshed automatically, so there’s no need to call this method manually."

However, I'm wondering if I'm not using invalidate properly. I have changed data in the CARTO server (ie. table values), however calling layer.invalidate() doesn't refresh my map.

cartodb.createLayer(map, {
    user_name: 'user_name',
    type: 'cartodb',
    sublayers: [
        //Baselayer
        {
        type: "http",
        urlTemplate: 'http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png',
        subdomains: [ "a", "b", "c" ]
        },

        //Projects
        {
        sql: "SELECT * FROM ab",
        cartocss: '#ab {marker-fill: #15B14D;}',
        interactivity: ['name', 'description', 'source', 'contact', 'category'],
        },

        //Labels
        {
        type: "http",
        urlTemplate: 'http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png',
        subdomains: [ "a", "b", "c" ]
        },
        ],
    })
.addTo(map)
.done(function (layer){
    cartodb.vis.Vis.addInfowindow(map, layer, ['name', 'description', 'source', 'contact', 'category'],{
        infowindowTemplate: $('#infowindow_template').html(),
        templateType: 'mustache'});
    layer.invalidate();
    });


texts: Limiting overpass turbo query by postal_code and country

texts:
I'd like to limit a query (for highways) by postal_code and country (since the postal_codes are only unique on a national level).

Let's say that is my query:

area[postal_code="19300"]->.searchArea;
area.searchArea[name="Germany"];
way(area.searchArea)[highway][name];
(._;>;);
out;

http://overpass-turbo.eu/s/QeG

By that I get highways in Germany and in France.

I thought about something like

area.searchArea[name="Germany"].->searchArea2;
way(area.searchArea2)[highway][name];

But this doesn't work.

What would be the correct syntax?

Or how could I link something like

{{geocodeArea:Germany}}

to this kind of query?


texts: Editing added field in raster attribute table using ArcMap

texts:
I have a raster file in tiff format and this raster file has an attribute table already. What I want to do is to populate each original values with a new value and display the map with new underlying value.
Options:

I added a new field (CBD_kg_m3) to this attribute table, but I can not edit it. Is there a way that I edit it and select this column to display in map?
Maybe I can change the value of the original layer, but I still need to be able to edit the attribute table.


texts: In QGIS 2.2.0, while adding vector layer, 'ESRI FileGDB' option was missing under Source-Type, refer the attached screenshot.In this case, how can I attach a file GDB in QGIS 2.2.0?


texts: Filling a field with a random string from a list in QGIS

texts:
I need to fill a field with false string data from a given list randomly. There are rand and  randf functions generating random numbers. There is a similar (not identical) question: Updating attribute field with random string value. But it doesn't meet my need. Also, the answer in that post does not work as expected.
How can I fill the field with a random string from a list, preferably using existing functions?
Pseudo-expression I need: randstr(['A', 'B', 'C']).


texts: Mapscript_csharp issue with version 7.0.4

texts:
Processing a map file with use of mapscript_csharp.dll (version 7.0.1) and map contains a few WMS HTTP layers and some are local shapefiles.

After upgrading from Mapserver 7.0.1 to latest version 7.0.4 by copying necessary (e.g.cgi-bin) dll's to my application bin and correct versions of libmap/mapscript dll (concerning oracle)  I get an error when executing the map.draw() function (using the same map as with 7.0.1):

"drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed: libpng: bad parameters to zlib"
[System.ApplicationException]: {"drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed: libpng: bad parameters to zlib"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: -2146232832
InnerException: null
Message: "drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed: libpng: bad parameters to zlib"
Source: "mapscript_csharp"

If I remove the HTTP WMS layers from my map file it works.

Could someone explain what I am missing and/or what file could not be accessed?

If any other info needed, let me know.


texts:
I am having this issue where caching is missing one of the levels (level 13). I am trying to find out how to resolve this issue.

L9  -  1,155,581 - OK
L10 - 577,790 - OK
L11 - 288895 - OK
L12 - 144447, OK
L13 - 72223, MISSING, don’t show at all for some areas
L14 - 36111, OK
L15 - 18055, OK
L16 - 9027, OK
L17 - OK
L18 - OK

Thanks
Jay


texts: POSGAR CRS With Reversed X and Y coordinates

texts:
I've been working in the Argentine CRS of POSGAR (Specifically POSGAR 94/Argentina 2 EPSG:22182) frequently and have noticed on a number of occasions that coordinates are provided to me with the X coordinate being the north-south direction and the Y coordinate being the east-west direction.  I was told this was due to the specification of POSGAR being with X-Y defined this way, but using ArcMap, QGIS, etc. all of the standard software seem to interpret X as East-West and Y as North-South.

Obviously, I can just reverse the coordinates and it's not a big deal, but I was curious about the heritage of this system. I was wondering if anyone could point me to any references or knew if POSGAR was originally defined with the X and Y reversed?


texts: Loading a Shapefile in standalone PyQGIS script

texts:
I am writing a script to validate a shapefile.

Here my code:

#-*- coding: UTF-8 -*-

import os
from osgeo import ogr
from PyQt4.QtGui import *
from qgis.core import *
import sys

app = QApplication([])
QgsApplication.setPrefixPath("/usr/", True) # Adjust prefix path according to your installation (see note below)
QgsApplication.initQgis()

class validacaoVetorialMCV(QgsVectorLayer):
    """docstring for Arquivo"""
    def __init__(self, arquivo_shp):
        self.arquivo_shp = arquivo_shp

    def campo_not_null(self, arquivo_shp):

        #Fields to check
        for value in ('geometriaA', 'regime', 'tipoTrecho', 'tipoMassaD', 'tipoLocali', 'jurisdicao', 'administra', 'nivel_1', 'nivel_2', 'nivel_3'):
            idx = arquivo_shp.fieldNameIndex(value);
            values = arquivo_shp.uniqueValues(idx);

            if all(x for x in values) ==  False:
                return 'Registros nulos em %s do: %s' (value, %arquivo_shp.name());

#rootdir = raw_input('Caminho da pasta:')
rootdir = '/home/infra/PycharmProjects/untitled/projeto_desenvolvimento_script/folha_mi_1584_2'
extensions = ('.shp')

for subdir, dirs, files in os.walk(rootdir):
    for file in files:
        ext = os.path.splitext(file)[-1].lower()
        #Print all files which have .shp extension
        if ext in extensions:
            #print os.path.join(subdir, file)

            layer = QgsVectorLayer(os.path.join(rootdir, file), file, "ogr")

            #Check if layer was setting
            print layer.name()

            if not layer.isValid():
                print "Layer failed to load!"

            print validacaoVetorialMCV(layer).validar_normalizacao_campo(layer)

Why does my method "campo_not_null" not work?
Why did my layer failed to load?
Why were other extensions that are not .shp  (.gdb, timestamp) read?

Answer in python console:

mi_1584_2_cerrado.shp Layer failed to load! []
mi_1584_2_localidade.shp Layer failed to load! []
mi_1584_2_massa_dagua.shp Layer failed to load! []
mi_1584_2_trecho_massa_dagua.shp Layer failed to load! []
mi_1584_2_trecho_drenagem.shp Layer failed to load! []
mi_1584_2_trecho_rodoviario.shp Layer failed to load! []
timestamps Layer failed to load! []
gdb Layer failed to load! []


texts: QGIS locked into fullscreen mode on Ubuntu 12.04

texts:
No crash in this case, but I made the mistake of toggling to fullscreen mode on my netbook running Ubuntu 12.04. It's now impossible to escape this "No Menus" view, and it seems to have disabled the popout unity launcher as well. Steps I've already taken:

Alt-Tab to move to a different program, then back - QGIS remains in fullscreen
Alt-V, Ctrl-F and F11 get no response
I've unistalled QGIS, deleted the /.qgis/ profile data folder, and reinstalled. Still launches fullscreen

To add to the weirdness, it now launches - still in fullscreen - into a different workspace than the active one.

I realize this has the sound of a Unity problem, but it's just this program that has a malfunctioning UI.

Thanks to all the crew; this in no way changes my opinion of QGIS as an essential tool.


texts:
Since version 2.16, QGIS contains a magnifier tool.

The tool itself is great, but I would like to set the magnifier to as low as 1%. However, QGIS enforces a minimum value of 10%, I cannot set lower values through the UI.

Is the lower limit configurable somewhere, or can it be turned off?


texts: Pyqgis iterate over hundreds of thousands features, speed issue

texts:
I'm building a Qgis 2.18 plugin with python. I have to check if at least one geometry of a linestring vector layer (hundreds of features) intersect the geometries of other two linestring vector layers (hundreds of thousands features). I've written my algorithm, and it works but my problem is the time of execution of the algorithm.

I'm asking if there is a way to speed up a bit my code, maybe using other python data structures, modules or pyqgis functions that I haven't discover yet. I put all my features in a list for every layer to iterate over them.

A snippet of my code:

lay_to_check=  QgsVectorLayer( 'to_check.shp' "Layer to check" , "ogr" )
lay1 = QgsVectorLayer( 'lay1.shp', "LAY1" , "ogr" )
lay2 = QgsVectorLayer( 'lay2.shp', "LAY2" , "ogr" )

#create two lists of features of lay1 and lay2 that intersects the extent of the layer to check
ext = lay_to_check.extent()
g = lambda x:x.geometry().intersects(ext)

request_lay1= QgsFeatureRequest().setSubsetOfAttributes( [''], lay1.fields() )
list_lay1= filter( g, lay1.getFeatures(request_lay1) )

request_lay2 = QgsFeatureRequest().setSubsetOfAttributes( ['field2'], lay2.fields() )
list_lay2 = filter( g, lay2.getFeatures(request_lay2) )

#for every feature I control if intersect every feature of other two list
request = QgsFeatureRequest().setSubsetOfAttributes( [''], lay_to_check.fields() )
for feature in lay_to_check.getFeatures(request):

    control = []
    geom = feature.geometry()
    p = lambda x:x.geometry().intersects(geom)

    if list_lay1:
        list_int1 = filter( p, list_lay1 )
        if list_int1:
            control.append( True )
        else:
            control.append( False )

    if list_lay2:
         list_int2 = filter( p, list_lay2 )
         if list_int2:
             list_attribute = [ feature['field2'] for feat in list_int2 ]
             control.append( max(list_attribute) )
         else:
             control.append(0)

Any suggestion? I've read abuot Shapely or GeoPandas but I'm not sure if they'll help me.


texts:
I have created this JSFiddle OpenLayers map that toggles the layers visibility using the bootstrap-switch.

I am looking to achieve the same with leaflet but can't seem to get the equivalent of the setVisible command in Leaflet to work with the bootstrap-switch.

This JSfiddle also includes the Leaflet version that doesn't work.


texts: sen2cor L2A_Process not working, returns strange error

texts:
I am trying to perform the correction on some sentinel 2 imagery using sen2cor L2A_Process on the 10 m resolution. Script returns some strange error. Below is the full output:

Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.8.0, created: 2019.02.20, supporting Level-1C product version 14.2 - 14.5 started ...
Old product version 14.2 detected, - will be updated to 14.5
Processing baseline will also be updated
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]:  0.00 : Generating datastrip metadata
Syntax error in metadata, see report file for details.
Schema file: S2-PDGS-TAS-DI-PSD-V14.2_Schema/S2_PDI_Level-1C_Datastrip_Metadata.xsd
Details: Element 'Image_Display_Order': This element is not expected. Expected is ( Spectral_Information_List ).
Incorrect datastrip L1C xml format
Traceback (most recent call last):
  File "/xxxx/xxxx/xxxx/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 534, in <module>
    sys.exit(main())
  File "/xxxx/xxxx/xxxx/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 482, in main
    L2A_TILES = config.updateTiles()
  File "/xxxx/xxxx/xxxx/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 3669, in updateTiles
    if self.create_L2A_Tile():
  File "/xxxx/xxxx/xxxx/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 3694, in create_L2A_Tile
    self.getEntriesFromDatastrip()
  File "/xxxx/xxxx/xxxx/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 3635, in getEntriesFromDatastrip
    self.spacecraftName = di.SPACECRAFT_NAME.text
AttributeError: 'bool' object has no attribute 'SPACECRAFT_NAME'

I already found this answer to the same question: https://forum.step.esa.int/t/sen2cor-2-8-fails-on-product-from-early-2016-bool-object-has-no-attribute-spacecraft-name/16046 but none of the solutions works for me.
Does anyone here knows what's this about?

UPDATE: With the S2A_OPER_PRD_MSIL1C_PDMC_20160413T104446_R063_V20160412T071340_20160412T071340.zip product the process actually began to perform correction however there are two new issues. The first is:

...
Progress[%]: 2.43 : PID-4188, L2A_Tables: band TCI exported, elapsed time[s]: 10.348, total: 1:16:13.163633
Syntax error in metadata, see report file for details.
Schema file: S2-PDGS-TAS-DI-PSD-V14.5_Schema/S2_User_Product_Level-2A_Metadata.xsd
Details: Element '{https://psd-13.sentinel2.eo.esa.int/PSD/User_Product_Level-2A.xsd}Level-2A_User_Product': No matching global declaration available for the validation root.
Progress[%]: 2.44 : PID-4188, L2A_ProcessTile: processing with resolution 10 m, elapsed time[s]: 10.025, total: 1:16:23.188470
...

the process is not interrupted at this point. Later another error occurs that terminates the script:

...
Progress[%]: 4.26 : PID-4188, L2A_Tables: stop export, elapsed time[s]: 0.157, total: 2:13:20.462217
Syntax error in metadata, see report file for details.
Schema file: S2-PDGS-TAS-DI-PSD-V14.5_Schema/S2_User_Product_Level-2A_Metadata.xsd
Details: Element '{https://psd-13.sentinel2.eo.esa.int/PSD/User_Product_Level-2A.xsd}Level-2A_User_Product': No matching global declaration available for the validation root.
Progress[%]: 100.00 : Application terminated successfully.

The suggested report.xml states the same as above.


texts:
I am trying to create a raster stack / brick from a list of ncdf files with the dimensions 160x160x24x1).

r = stack(files)

This gives me a raster stack but without the 4th dimensions which is required in the output ncdf file even when the dimension is 1.

Currently I am creating an array and filling in the raster stack and writing the output file via the ncdf package.

data1 <- array(0,dim=c(160,160,1,dims-1))
data1[,,1,] <- as.array(r)

sm1 = var.def.ncdf(var,var, list(x,y,l,t), 1.e30)
ncout1 <- create.ncdf(paste (cmemvar,".nc", sep = "", collapse = NULL), sm1)
put.var.ncdf(ncout1, sm1, data1)
close.ncdf(ncout1)

However with a large amount of files this hits memory limitations. Is there any better way, at best directly with the raster package, to write the 4-dim ncdf?


texts: Convert OSM data to PostGIS polygons in .net?

texts:
I'm trying to obtain data from OSM and store it to a PostgreSQL + PostGIS database, with certain modifications to adapt to our tables.

Is there any built way to convert OSM relations/ways/nodes into npgsql geometries?

I have seen something about OSMSharp to treat OSM data in .Net, but, as far as I have seen, it doesn't help me too much with my case.

I think I won't have too much problem converting it manually(ex: two nodes within a way = line), but would be great to know if there is something that can help me to do it and have been tested already so the majority of edge cases work well.


texts: Drawing the DLS Grid for Alberta, Canada

texts: I have DLS grid data that I downloaded from http://www.altalis.com/products/property/ats.html (AltaLIS_ATS_V4.1_Coordinates data). But I don't know how to draw the grid on Google Maps. We have Meridian, Township, Range, Section and Quarter section. Could you please help me to solve this problem?


texts: Having trouble connecting QGIS with postgres database with postgis extension

texts:
I am working on Ubuntu Precise with postgresql version 9.3 and postgis 2.0.

After initially starting my postgres database and eventually getting permission errors that would prevent postgres from starting due to my modifying the pg_hba.conf file I followed a tutorial from ArchLinux ArchLinux postgres setupwhich stated to create a directory to house my database cluster. Previously I did not do so and had less trouble connecting to QGIS. I know postgres out of the box comes with a default database cluster, so I am wondering if I am attempting to connect to the wrong cluster?

I have config files in two different directories as a result of the tutorial I followed:
*with root user: /etc/postgresql/9.3/main
*under postgres (default auto-created linux user): /var/lib/postgres/data

In any case after making my modifications I also restarted my postgres server and every time I start my server I do so from etc/init.d/postgresql. If so, how exactly do I go about fixing that without breaking my postgres installation?

My error is connection refused, but my port(5432) is listening when I checked with telnet. I am trying to connect with the add Postgis layer GUI option in QGIS Dufour installed on a windows box.

*my pg_hba entry is host all all 0.0.0.0/0 md5
*local_addresses was set to * in postgresql.conf

When I tried to connect on my database server via its local in the postgres user I tried psql -h 127.0.0.1 -U postgres -d postgres

...and I got "could not connect to server, etc", which leads me to believe the loopback is failing because wildcard should allow localhost as well.

Are you supposed to be able to connect to the server on a local machine or...?
Do I have to change my iptables default settings?

*No particular errors on my postgresql installation stuck out.


texts:
I'm working on a map showing oil shipping.  Basically, I have a a series of nodes/line segments that make up the shipping network.  I've joined the sums of oil that traveled along each node, so can show how much oil is traveling over those nodes.

How can I show the directional breakdown along each node? In other words, I'm trying to show the split each segment by the direction of the oil on it, showing that with different colors and having the pen width adjust to the size of the flow in that direction.

Edit: Could this be done with two layers, one of which is given a data-defined offset based on the width of the other layer, such that they line up with eachother?

Multiple layer version:


texts: Geotools FeatureReader - Initial memory consumption problem

texts:
I am using a FeatureReader to access features from a PostGis source using the following code:

DataStore dataStore = DataStoreFinder.getDataStore(postgisParams);

Transaction transaction =  new DefaultTransaction();
Query query = new Query("MyTableName"); // DefaultQuery for GT 2.4.5!

FeatureReader reader = dataStore.getFeatureReader(query, transaction);

The table contains ~1.150.000 features. I updated the Geotools version from 2.4.5 to 18.2. I used Java VisualVM to record the memory consumption.

No memory issues using the old version (2.4.5):

Same code and newer GT version (18.2):

When having a look at the images above you can see that the FeatureReader using GT version 18.2 initially allocates ~800MB memory (for ~1.150.000 features) which is a lot more than ~50MB (using the older GT version 5.4.2).

To be more precise about the problem: The code is working in both versions. BUT the problem is the initial memory consumption when creating (and holding) the FeatureReader. I made the following observations:

The memory consumption is growing with the number of requested features.
The memory consumption decreases after features are read and the reader is closed (no GC problem).
In both cases the used FeatureReader class is  org.geotools.jdbc.JDBCFeatureReader

I do not want to load the features into memory. Is there a more performant way (regarding memory consumption) to use FeatureReader (or something equivalent) with newer versions of Geotools ?


texts:
I would like to use two layers (units, calls) over the streets base map.

I have a timer loop that runs every 30 seconds and I would like to clear the units layer, then add the new unit markers to the unit layer.

  var units = new Graphic();  // graphic with units
  var calls = new Graphic();  // graphic with calls

  map = new Map({
    basemap: "streets-navigation-vector"
  });

  view = new MapView({
    container: "viewDiv",
    map: map,
    zoom: 12,
    center: {
      latitude: 38.8935,
      longitude: -77.0487
    }
  });

  var unitsLayer = new GraphicsLayer({
    graphics: [units]
  });

  var callsLayer = new GraphicsLayer({
    graphics: [calls]
  });

  map.add(unitsLayer);
  map.add(callsLayer);

Question 1) How do I clear a layer of markers without effecting the other layers?
Question 2) How do I add a marker to the units layer at run time?


texts: Is there a way to tell the geodatabase version using Python?

texts:
I want to find out if either a file or personal geodatabase is 9.3, 10.0, 10.1, etc

Is there a way to do this using Python?


texts: How is metadata_xml column generated in GeoNode DB?

texts:
There is a metadata_xml column in the base_resourcebase table of GeoNode database. It contains XML document with metadata informations of the layer.

There are also other metadata columns in this table, such as title, abstract, license_id (foreign key), data_quality_statement. These informations are duplicit with the informations from XML.

How is the XML document in metadata_xml generated?
What is the XML document used for? Can it be omitted?

I'm asking this question because I need to transfer metadata from one GeoNode to another with the same layers. I thought it would be enough to update needed columns of base_resourcebase and layers_layer, joined using layers_layer.typename, but the XML document contains details I don't want to change, like fileIdentifier, or URLs.


texts:
I have a very specific problem. I am trying to build an offline map on leaflet, rhomobile(based on ruby) and OSM data.
The problem is that I am making now a offline layer images folder with the city data rendered and in average a big city is 200mb . In case that OSM data file is only 5mb .

What is the optimal way to do it less? Maybe geojson or something else?

I know for Tilemill you can export data to .mbtiles which is sqlite3 database, but the weight of the file is the same and even bigger ...
What you would suggest?


texts: I'm working in QGIS3.8.3 and am trying to use the Vertex Tool to add a vertex to a pre-existing polygon. I expect to be able to do this in an editing session by hovering over the segment in question and selecting an x, but no x appears and I'm only able to move existing vertices. What am I missing?