texts: Converting multiple File geodatabase (.gdb) into multiple Personal geodatabase (.mdb)

texts:
Individually I will Export the gdb to XML Workspace then import that into the personnel geodatabase and all Domains go over fine. But...

Let's Say I have several file geodatabase in a folder and Each of the file geodatabase has 1 feature dataset name "URS" and rest are feature classes. "URS" Feature dataset has several feature class as well.

The task for me is to convert Multiple file geodatabase into multiple Personnel geodatabase without including "URS" Feature datasets. If the Geodatabase don't have "URS" Feature dataset or any other feature classes then the python program will create an empty personnel geodatabase.

I am using pyscripter and below mentioned concept is not workin for a single geodatabase. How can I convert multiple File geodatabase (.gdb) into multiple Personal geodatabase (.mdb)?

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "I:\python\Multiplegdb"
print arcpy.env.workspace

# Set local variables
inFeatures = r'I:\python\Multiplegdb\ABC.gdb'
print inFeatures
outLocation = r'I:\python\Multiplegdb\ABC_Output.mdb'
print outLocation

# Execute TableToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)


texts: Grouping/identifying clusters within polygon data set via accumulation of area

texts:
I have a polygon feature class representing discontinuous fields often quite far apart but sometimes there are clusters of smaller sites, and I would like to identify these clusters based on accumulative area (therefore also including single large sites as groups). I’m using Arcmap 10.2.2, I’m looking to identify clusters in groups as shown in the picture below, selecting groups that accumulate a set area and ignoring small isolated sites:

I've tried using the grouping analysis tool but haven't been successfully in grouping it as above i.e. ignoring isolated small sized fields, and I'm not sure this method is taking into account the size of each site. I've also tried the aggregate polygon tool but this creates long chains of small sites and doesn't consider accumulation of area within groups.


texts: How to plot different style of faults using matplotlib?

texts:
I want to plot faults with different styles such as normal, revers and strike-slip. As any of them has their own styles in geological maps, I have to plot them with a unique symbols. Up until now I just plot them using the following code:

import pylab as plt

fault = [[]]

with open('strike_slip.dat') as f:

    for l in f:

        if l.strip() and '--' not in l and '#' not in l:

            val = l.split()

            fault[-1].append((float(val[0]),float(val[1])))

        if '---' in l:

            fault.append([])

ax = plt.subplot(111)

for i in fault:

    x = [_[0] for _ in i]
    y = [_[1] for _ in i]

    ax.plot(x,y,color='k')

ax.set_xlim(50,52)
ax.set_ylim(28,30)

plt.show()

and this this the result:

I want to plot some symbols to show different types of faults (normal, revers, strike-slip).


texts: Exporting QGIS project containing many points with qgis2web: reduce loading time

texts:
What I have:

QGIS 3.18 on Win 10 containing a project with:

OpenStreetMap basemap
Point layer (Geopackage, 5.1 MB), representing centroids of buildings of a city
Point layer set to scale based visibility (only visible when zoomed in for more than 1:5000, corresponds to canvas extent of ca. 1km*1km and smaller) - so normally, just a few hundred (at max. ca. 1400) points are visible due to small canvas extent.

Point layer consists of:

54.000 features, extent ca. 12*12 km
Attributes contain two fields: fid and an additional integer field

What I want to do:
I want to make the project available as WebMap with qgis2web plugin, ver. 3.16. This works fine for other projects.
What the problem is:
The exported map loads extremely slow and the browser becomes unresponsive. The same is true for the plugin's preview. I  get the warning:

A large number of features are present in the map. Generating the
preview may take some time.

I guess this is because it tries to load all 54.000 point features, even if only a small section of the whole extent is inside the current canvas extent. Scale based visibility apparently can't be converted by qgis2web plugin.
What I tried:
Changing the precision setting in the plugin, but with no success. I also looked to the other settings of the plugin (check the cluster checkbox for the point layer), but they don't resolve the problem.
I also tried splitting up the layer to several small layers, based on a grid. The problem persists. I guess that Leaflet/the Web site still tries to load all layers in the current canvas extent - so the site gets blocked before you even get the chance to zoom in.
The question:
How can this problem be solved so that I have a WebMap with OSM basemap + the point layer, loading in reasonable time (few seconds at max.)
Screenshots:


texts: Inaccurate output (missing features) while reading a shapefile into networkx

texts:
I am doing some work with networkx, which involves the conversion of a point and polyline shapefile into a graph with nodes and links. The documentation
about the read_shp() method states that it:

  Generates a networkx DiGraph from shapefiles. Point geometries are
  translated into nodes, lines into edges. Coordinate tuples are used as
  keys. Attributes are preserved, line geometries are simplified into
  start and end coordinates. Accepts a single shapefile or directory of
  many shapefiles.

My first observation is that the  method does not read all the features in the shapefiles e.g. there are over 31000 points in my nodes shapefile but the length of nodelist returns only 4991 as against 31760 nodes. I observed the same behaviour for the lines shapefile. I have a small code snippet below as an illustration.

import networkx as nx
G = nx.read_shp("Sample_nodes.shp", simplify=False)
print len(G.nodes())

#output: 4991 instead of 31760

Is there something I am missing?


texts: Creating prediction map by combining several rasters and vectors in ArcGIS Desktop?

texts:
I have three 'variables':

6000 GPS points that represent where my focal species (a carnivore) is present. Attached to these points is one value representing the activity level of the animal at the time (it ranges between 0 and 200, thus 0 being inactive and 200 being very active).
Slope (standard slope raster)
NDVI (also raster)

I ran a GLMM in R Studio, and the fixed effects show that as NDVI and Slope decrease, activity decreases. This is important because it may also help with an additional analysis to assess areas of risk for my other focal species (an herbivore that also happens to be a prey species of my focal carnivore).

I am curious that given such a relationship (between activity points, NDVI, and Slope) whether it is possible to map out  'hotspots of activity' throughout the landscape while accounting for NDVI and Slope as a means to create a 'risk map' or 'probability of activity map' (same thing in this context)

I have been reading about several methods including kriging, hotspot analysis, Residual trend mapping, etc. but I am afraid that I am still unsure whether either of these methods are the right way to go (probably because I am still relatively new when it comes to GIS).

Would anyone be able to provide some advice on how to carry on with this?


texts: Layer selectByExpression is Not select any feature even Expression is right why?

texts:
I am trying select the features by expression if i pass query as string its working but if pass variable is not return any result why.
WORKING CODE
InputFeatureLayer.selectByExpression("\"S_CODE\" = 'ORCHARD OR PLANTATION NOT WALLED' AND \"CATEGORY\" = 'ORCHARD'",QgsVectorLayer.SetSelection)
features=InputFeatureLayer.selectedFeatures()
print(len(features))

if i mention query like above its working fine but I created a query when I pass its throwing error whats wrong with this
CODE NOT WORKING
InputFeatureLayer=QgsVectorLayer(r'D:\Temp\Qgis\shp\qgis.shp',"qgis","ogr")
Spilt_fields=['S_CODE', 'CATEGORY']
for row in TotalFeatures:
  qry='"'
  for field in Spilt_fields:
     print(field)
     if qry!='"':
        qry+=" AND "
     qry+='\\"{0}\\" = \'{1}\''.format(str(field), str(row.attribute(field)))
  qry+='"'
  print(qry)#it printing "\"S_CODE\" = 'ORCHARD OR PLANTATION NOT WALLED' AND \"CATEGORY\" = 'ORCHARD'"
  InputFeatureLayer.selectByExpression(qry,QgsVectorLayer.SetSelection)
  features=InputFeatureLayer.selectedFeatures()
  print(len(features)) # it return 0

What is the issue with the query?


texts: How to get the svg element id on clicking in leaflet?

texts:
I'm new to Leaflet and I'm trying to place a SVG file on the Leaflet map. My basic requirement is to get the svg path id on clicking in particular SVG element,

I tried making the image overlay on leaflet but I am not able to make that clickable.

var imageUrl = 'test2.svg',
    imageBounds = [(IMAGE BOUNDS)];
L.imageOverlay(imageUrl, imageBounds).addTo(map);


texts: Connecting GetParameterAsText with Pick List?

texts:
I am sitting here already awhile and can't find an answer on my own.
I actually have pretty much the same Problem which was already asked (MultiValue-String to SQL Expressions).
But mine is more basic because of missing knowlegde.
I tried to use the codechunk out of the other Problem but when i run it the expected Pick-List is always without Values.
Some Basic Questions actually include missing comprehension of the functions.

multival = arcpy.GetParameterAsText(1)  # 'Store_1;Store_2;Store_3'
vals = multival.split(";")

where_stub = """"NAME" IN ({})"""
stores = ','.join(["'{}'".format(x) for x in vals])
where = where_stub.format(stores)

I actually don't know where the multivalcomes from and which Position its claimimg in the code. Maybe for a better understanding my task is to create a Route for a Pizza delivery with about 6 Stops. As data I got a file with 25 Stores which from I should pick various stores. To avoid a SQL-Expression I would like to have a Pick-List as in the other Problem shown (MultiValue-String to SQL Expressions).

My Code looks like this

# Import arcpy module
import arcpy
from arcpy import env

#workspace =  GetParameterAsText (0) ???
arcpy.CheckOutExtension("Network")

# Local variables:
in_network_dataset = "Transportation/Streets_ND"
outNALayerName = "BestRoute"

# Process: Make Route Layer
arcpy.MakeRouteLayer_na(in_network_dataset, outNALayerName, "TravelTime",
"FIND_BEST_ORDER", "PRESERVE_BOTH", "", "", "ALLOW_UTURNS",
"Oneway;RestrictedTurns", "", "", "", "")

# Process: Select
Stores = "Stores.shp"
Stores_Select = "Stores_Select_Output"
Expression = arcpy.GetParameterAsText(0)
vals = Expression.split(";")

where_stub = """"NAME" IN ({})"""
stores = ','.join(["'{}'".format(x) for x in vals])
Expression = where_stub.format(stores)

arcpy.Select_analysis(Stores, Stores_Select, Expression)

It will execute until the select-process but then it does not make a difference between my script and a totaly empty one...
Can Someone explain me how to get the Parameters into my Pick-List and maybe some Ground explanation so i understand what the Codechunk from (MultiValue-String to SQL Expressions) includes?

This is how my Parameter Panel looks:


texts: I downloaded the Worldclim variables, they are in extension .adf. I want to extract by mask using ArcGis, but when I do the process the new layer is not with the same information than orginal. In fact, I try to continue for transform my new layer in ASCII format to proceed in Maxent, but I get a table with extension .txt.


texts:
I am running QGIS 3.4.4 With GRASS 7.4.4 and I get an error while rasterizing a vector layer and I don't know why.
The same error pops up while using GDAL->Rasterize(vector to raster) and while using GRASS->v.to.rast.
"The following layers were not correctly generated. < ul>< li> C:/Users/Viktor/Desktop/yes.png< /li>< /ul>"
This happens when the option Open output file after running algorithm is checked, as when it is not, there are no errors but the file isn't created.

The start and end coordinates are not out of bounds. Output data type is (by default) Float32 and output format is .png (and I've tried Tiff as well but doesn't work). I have not touched the rest of the parameters.

However, one thing that should be noted is that the vectors come from a gdb folder that I drag-and-dropped into QGIS and it gave me the option to import layers so I did that. Could that be interfering with the renderer?

EDIT:
While thinking about the problem, I just realized I can just look at the Error Log and this is the problem....
ERROR 1: Wrong value for -outsize parameter.

         Usage: gdal_rasterize [-b band]* [-i] [-at]

          {[-burn value]* | [-a attribute_name] | [-3d]} [-add]

          [-l layername]* [-where expression] [-sql select_statement]

          [-dialect dialect] [-of format] [-a_srs srs_def] [-to "NAME=VALUE"]*

          [-co "NAME=VALUE"]* [-a_nodata value] [-init value]*

          [-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]

          [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/

          CInt16/CInt32/CFloat32/CFloat64}] [-optim {[AUTO]/VECTOR/RASTER}] [-q]

So I think this makes problem solving very much easier, I will try to find out myself but any further suggestions are welcome.


texts:
My configs:

# Rendering OpenStreetMap data with Mapnik; should use metaTiling to
# avoid labels across tile boundaries
[osm-map]
type=MapnikLayer
mapfile=/usr/home/sergeev/osm_mapnik/osm.xml
spherical_mercator=true
tms_type=google
metatile=yes
extent_type=loose

and

var map, layer;

        function init(){
            var options = {
                    resolutions: [156543.0339, 78271.51695, 39135.758475, 19567.8792375, 9783.93961875, 4891.969809375, 2445.9849046875, 1222.99245234375, 611.496226171875, 305.7481130859375, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.554628533935547, 4.777314266967774, 2.388657133483887, 1.1943285667419434, 0.5971642833709717, 0.29858214168548586],
                        numZoomLevels: 20,
                        maxExtent: new OpenLayers.Bounds(0.05917265625,0.1171263671875,0.0593009765625,0.11720234375),
                        projection: 'EPSG:900913'
            };

            map = new OpenLayers.Map( $('map'), options);
            layer = new OpenLayers.Layer.WMS( "VMap0",
                    "tilecache.cgi?", {layers: 'osm-map', format: 'image/png' } );
            map.addLayer(layer);
            map.addControl(new OpenLayers.Control.Permalink());
            if (!map.getCenter()) map.zoomToMaxExtent();
        }

my osm.xml is here: http://pastebin.com/f5EWUsTy

My problem:

I see the map, but i cant't move it: each zoom level is fixed. And the center of the map is somewhere in Africa, but i thought my xml is describing north of Russia. The image below is what i see:

So what should i do? (I'm totaly new to gis, so, please, be patient :)


texts: Setup QGIS with local plugin repository only

texts:
Is there a best practice how to setup QGIS without the official repository but only with a local repository?

The idea behind this is to setup a stable environment where local GIS-admins check plugins before they are added to the local repository.

We had some issues with plugins that made our QGIS installations unstable (for example https://github.com/vinayan/RectOvalDigitPlugin/issues/6 ). As reliablity of software is more important to our colleagues than the free choice between 800 plugins we want to preselect the plugins that are available for them.

At the end of the day it's probably not possible for the person who has to setup QGIS installations to prevent that users install some unwanted/unstable plugins as the plugin-directory and the QGIS2.ini has to be writable by the users but we still want to make our QGIS-working environment a bit more stable.

My ideas are:

Removing the local repository and making the "add" button invisible?
Blocking the official repository through the proxy?
using a Whitelist for allowed plugins and checking the installed plugins against the whitelist with a plugin installed in the QGIS-program folder?

Has anyone else made some experience with QGIS setups in a business IT infrastructure?


texts: QGIS automatically set transparency for (#000000) pixels and save *.qlr

texts:
Starting with FME, i convert some hundreds of geotiffs to jpeg2000. The jpeg2000 writer does not support nodata-values. Adding the data to QGIS gives me these black (#000000) areas when rasters are rotated. With raster>properties i can set a transparency for #000000 and save a layer definition (*.qlr) for that raster which can be loaded on demand with the desired transparency.

Question: Since I have to do this for hundreds of rasters, is there a way (i.e. Python, GraphicalModeler) to automatically set transparency for a raster and save it to a layer definition?


texts: Not able to render map from WMS to MapInfo using MapXtreme

texts:
I am trying to get the map from WMS which is hosted on GeoServer to the map. I am getting the layer of WMS but I am not able to display in the Map Screen. Here is my code to do so:

ICapabilities capablities = MapInfo.Wms.WmsClientUtilities.GetCapabilities("http://127.0.0.1:8080/geoserver/Jonathan/wms?", "1.1.1");
 MapInfo.Wms.WmsClient wmsClient = new MapInfo.Wms.WmsClient(capablities);
int chartCount = wmsClient.Capabilities.RootLayer.Layers.Count();
wmsClient.AddLayer(wmsClient.Capabilities.RootLayer.Layers[4].Title);
wmsClient.Srs = wmsClient.Capabilities.RootLayer.Layers[4].Bounds[0].Srs;
wmsClient.MimeType = wmsClient.MimeType;
wmsClient.BGColor = Color.White;

MapInfo.Data.TableInfoWms wmsTableInfo = new MapInfo.Data.TableInfoWms("MywmsTable", wmsClient);
Table wmsTable = Session.Current.Catalog.OpenTable(wmsTableInfo);
FeatureLayer featLyr = new FeatureLayer(wmsTable);
MapInfo.Mapping.Map map = MapInfo.Engine.Session.Current.MapFactory.CreateFromFile(@"C:\Program Files (x86)\MapInfo\Data\Introductory Data\World\WORLD.TAB", System.IntPtr.Zero, System.Drawing.Size.Empty);

map.Layers.Add(featLyr);

What I am doing wrong?


texts: How to create a line output from a buffer instead of a polygon?

texts:
I am looking to create a graduated line buffer like in the image attached.  I was wondering if there was a direct tool to do this?  I can do it in a few steps, but that may take too long.

I also tried using copy parallel, but it doesn't work as the lines get distorted and don't go the entire length from red line to red line.

Maybe there is a tool in spatial analyst that I am not familiar with.


texts: Mask out values in a raster based on standard deviation

texts: Does anyone know (in Modelbuilder or python) how I can remove any values of a raster that outside of the range of three standard deviations? I have a lot of rasters so it would be quicker than manually making a mask from reclassifying and then using SetNull.


texts: Setting Config Options for GDAL using Python

texts:
I am attempting to invoke the "SetConfigOption" function using the GDAL API to tweak GDAL's default settings to get additional information about GeoTiff.  I am specifying the Config Options below in conjunction with the 'gdalinfo' command to retrieve information about the vertical coordinate reference system (VERTCRS).  Running 'gdalinfo' on the GeoTiff as it is does not show the VERTCRS information, but the VERTCRS info. can obtained from the command line by typing/entering these Config Option commands individually before calling 'gdalinfo' on the GeoTiff.
Is there a way to use the "subprocess" function to seamlessly get the VERTCRS information?
Below is the code I am using, which prints the 'gdalinfo' output but does not capture the VERTCRS information as needed.
from osgeo import gdal, osr, ogr
import subprocess

gdal.SetConfigOption('GTIFF_REPORT_COMPD_CS','TRUE')
gdal.SetConfigOption('DTED_APPLY_PIXEL_IS_POINT', 'TRUE')
gdal.SetConfigOption('GTIFF_POINT_GEO_IGNORE', 'TRUE')
gdal.SetConfigOption('REPORT_COMPD_CS','TRUE')

cmd='gdalinfo C:\\users\\mikel\\GeoData\\DSM.tif'
print(subprocess.check_output(cmd))


texts: Which PyQGIS class is the layer properties menu?

texts:
I have a plugin which I want to add options to either the context menu when right clicking a layer at the Layers panel or the properties menu for that layer.
How can I call them from PyQGIS?
Can I add the options every time the plugin loads?
It feels like the properties menu should be qgis.gui.QgsLayerPropertiesWidget but it seems to be mapped by symbol layers and not map layers.
I can't find any class that seems to fit the right click context menu in the layer panel.
How can I do this?
EDIT 1
Luis Perez's answer was what i wanted.
I meanwhile found the way to add actions to the right click context menu, so posting this here for anyone else looking
def printSomething():
    print('Yay a new action!')

customAction = QAction('Print Something Nice')
customAction.triggered.connect(printSomething)
iface.addCustomActionForLayerType(customAction,'',qgis.core.QgsMapLayerType(0),True)

This will add the action Print Something Nice to all the Vector layers in your project.

This can be further customized by connecting the action to other signals instead of triggered, like hovered for instance.


texts: Zooming in close with mixed cached and dynamic services in ArcGIS flex

texts:
I have an application that uses a cached world basemap overlaid with more local and specific data coming from a dynamic map service. It works well for performance, but some users need to see some very detailed information in the dynamic map service.

Is there a technique to allow users to zoom in past the closest scale range of the cached service?


texts: How can I calculate point's coordinates based on bounding box and tap click on phone screen?

texts:
E.g. I have bounding box [94818.24, 116189.125] [94818.914, 116189.8] and point's coordinate on my screen [695, 1082].
So how can I get a coordinate in CRS=EPSG:99781


texts: Geoprocessing Service with Update/Insert Cursors caused multiple users to conflict?

texts:
I have a python script tool that I would like to publish as a geoprocessing service, but I'm not sure it'll work because this script uses multiple update and insert cursors to update database tables.

More than once instance of these cursors cannot occur to ensure data integrity, so I am wondering how to make it so only one person can run this geoprocessing service at a time?

I see there is a "pooling" parameter, but instance are per machine so if I'm understanding it right, and just using the below as an example, each user could have up to 2 instances of the geoprocessing service running. Even if I reduced the number to 1, that still could cause conflicts since instances are per user machine, not just one user.


texts: Clean topology of OpenStreetMap data in QGIS

texts:
I'm looking for a method in QGIS to clean the topology of a highway dataset from OpenStreetMap that contains bridges and tunnels.

I would like to break ways at every intersections which is represented by a node (more a vertex than a node since we speak of topology I think) but not where a way crosses another way without a common node ( which should involve a tunnel or bridge regarding the OpenStreetMap topology model).

Regarding what I have tested, it seams that v.clean can't do it and I can't find another method.

The best method I can think of is to filter bridges and tunnel before doing the v.clean but it is not perfect. Other method I have tested is to distinguish bridges and tunnels connected and disconnected to the network by playing with cross and touch spatial queries but it is not perfect too.

May be another way to explain my problem is : I'm looking for a method to clean topology of a network only on nodes.


texts: Trouble when append values from attribute table of shapefile

texts:
I need to record the values for all fields of a shapefile in a dictionary. When I run a loop that for the first index of list picked up values from attribute table correctly. The problem for the second index of loop is that it doesn't have the same behavior. The values of the next field (index of loop) doesn't pick up from the attribute table. In this way my dictionary has had only register correctly, as I expect.

What's the problem in my loop in the middle of script?

Follow the code:

import ogr
import os
import numpy as np

class CheckVector(object):

    def __init__(self, vector):

        #Setting vector file
        self.Shapefile = os.path.abspath(vector)

        # Name of file with extension
        self.basename = os.path.basename(self.Shapefile)

        # Name of file without extension
        self.name = os.path.splitext(self.basename)[0]

        #Reading attributes of shapefile
        self.dataSource = ogr.Open(self.Shapefile)
        self.daLayer = self.dataSource.GetLayer()
        self.layerDefinition = self.daLayer.GetLayerDefn()

    def value_field_domain_shapefile_mcv(self):

       #Open dictionary where put field's name and feature values of it
       all_value_field_shapefile = {}

        for field in FieldDomain().list_field_domained: #Loop into list of name field

            if field in self._reference_field_shapefile(): # Is name field is in shape continue

                # Builting list where put features values witout repetition.
                # The value should appear only one time in this list
                unique_value = []

                # !!!! Here where my code doesn't do what I expect !!!!

                for feature in self.daLayer:
                    unique_value.append(feature.GetField(field))

                unique_value = list(np.unique(unique_value))

                all_value_field_shapefile[field] = unique_value

#Here is return of all_value_field_shapefile
# 'nivel_3' and 'nivel_1' don't have any values however there are many of them in shapefile

{'nivel_2': [None, '-', 'Arbustiva', 'Decidual', 'Herb\xc3\xa1cea', 'Tipo biogeogr\xc3\xa1fico de Caati', 'Tipo biogeogr\xc3\xa1fico de Caatinga'],
'nivel_3': [],
'nivel_1': []
}


texts: Cluster analysis based on both location and attribute (seconds)?

texts:
I'm looking to create clusters both on spatial density, as well as an attribute (time, in seconds). Essentially, I am trying to figure out what areas are choke points in terms of time spent at certain intersections based on GPS data. So I've got XYs, as well as time in seconds spent at each location. The GPS points are taken at random intervals so I can't just query out the information I want beforehand.

Although creating clusters on spatial density works for 90% of my data, there are some instances where a GPS was stopped at a set of lights for a long time, but only happened a couple of times. I also want to identify those locations as well.

I seek any advice on either the analysis methodology, or specifics on how to cluster based on location and attribute.


texts: convert hachures (not only solid) from tiff or pdf to polygon shapes?

texts: Is there a possibility in QGIS to convert hachures from tiff or PDF to polygon shapes?


texts: Which value does raster merge chose in overlapping area?

texts: When using the 'Merge' tool in QGIS, which raster value does it choose when there are overlaps between the raster?


texts: Using geometry stored in SQL Server table instead of WKT as input to function

texts:
I am new to SQL Server,

I have a function called STVectorize that takes a geometry and breaks it down into its constituent vectors:

SELECT e.[id], e.[element_id], e.[subelement_id], e.[vector_id],
       e.[sx], e.[sy], e.[ex], e.[ey],
       e.length, geom.STAsText() as geomWKT
 FROM [dbo].[STVectorize] (geometry::STGeomFromText(
         'COMPOUNDCURVE ((2172514.83221109 255830.454793766 0 10000,2172513.51769371 255834.852536798 10004.59,2172260.0640846 256682.786431864 0 10889.5959),
          CIRCULARSTRING (2172260.0640846 256682.786431864 0 10889.5959,2172227.98611614 256834.458935502 0 0,2172221.11092693 256989.333969623 0 11200))', 2274)) as e

Output results for geomWKT:

LINESTRING (2172514.83221109 255830.454793766, 2172513.51769371 255834.852536798)
LINESTRING (2172513.51769371 255834.852536798, 2172260.0640846 256682.786431864)
CIRCULARSTRING (2172260.0640846 256682.786431864, 2172227.98611614 256834.458935502, 2172221.11092693 256989.333969623)

This is all well and good, but I would like the STVectorize function to operate on the geometry stored in a SQL Server table.  The table is called Ramp_A and the geometry column is called GeomCol1.

How would you modify the SQL statement to use the geometry in GeomCol1 rather than specify its WKT in geometry::STGeomFromText?

I would like to be able to use any geometry from any SQL Server table as input to this function, by specifying the table name and the geometry column name in the query.

After @jport's answer, I did a little digging and found this web page that explains how to use CROSS APPLY (scroll down to the section "Joining table and table valued function using CROSS APPLY")

SELECT A.author_name, B.id, B.book_name, B.price
FROM Author A
CROSS APPLY fnGetBooksByAuthorId(A.Id) B

Applying this (more or less) gives

SELECT e.[id], e.[element_id], e.[subelement_id], e.[vector_id],
       e.[sx], e.[sy], e.[ex], e.[ey],
       e.length, geom.STAsText() as geomWKT
 FROM Ramp_A a
CROSS APPLY [dbo].[STVectorize] (a.[GeomCol1]) e

Which is exactly what I was looking for.  It gives the exact same results as my original SQL statement with the WKT.  This also works on tables with multiple records and multiple geometries (I tried it with 2 records / 2 geometries).

The STVectorize function I have linked does not accept curved geometries.

You can get the full STVectorize function plus 195 other useful SQL Server functions related to geoprocessing, COGO, LRS and others by searching for SQL Server Spatial TSQL Stored Procedures.


texts: Is there any reason to use or know anything other than WGS 84 (SRID 4326) or Web Mercator (SRID 3857)?

texts: I'm new to GIS and learning about SRIDs. Are there still other relevant or commonly used SRIDs?


texts: Drawing polygons with Google Maps using local shape data

texts:
I am trying to draw a census tract on a Google map. It looks like Google Maps lets you draw polygons using longitude and latitude coordinates. However, the data that I have is not longitudes/latitudes.

The specific dataset I have looks like this. The "spatial reference" for this data is 3857. But after looking up this spatial reference on this page, I still am not quite sure how to go about drawing the shape to the map using longitudes/latitudes.

I assume that this sort of thing can be done with GIS software or command line tools, but I am more interested in code libraries or APIs that could make this possible. Also, if anyone knows of a better source of census tract shape data which is more compatible with Google Maps, that would be great too.


texts: Data defined override: What does "double coord [X,Y] as " look like?

texts:
I want to dynamically change the placement offset of a label's background polygon. The hover text from that menu entry tells me:

  Expected input: double coord [X,Y] as <= 0.0 =>

I have no clue what is meant by that and i am tired of messing around so could please someone replace appropriately the ? in the following expression:

CASE WHEN "HELP" > 9000 THEN ???? END

I am also about to deal with negative decimal numbers here.


texts:
I have downloaded SRTM 1 ArcSec and processed it to retrieve topographic attributes. Prior to this, I have used 'fill' tool in ArcGIS as a pre processing step. Following is snapshot of clipped DEM;

The resultant hillshade raster shows linear features/strips visible in the following tile;

Despite of removing sinks using 'fill' tool, these imperfections are resulted in unreliable derivatives from it like slope, aspect, curvature, TWi etc.
The following tile clearly indicates imperfections in derived 'Curvature' raster.

If any one has experienced same issues, can you let me know how to remove these imperfections in any GIS software?


texts:
Using Qgis 2.18, I am trying to load a CSV file with a column for latitude and one for longitude. The points in the CSV are for England. When I load the file, the shapefile is created, but there is a distortion (please have a look at the image)

I changed the CRS to the British Nation Grid, but the distortion still exists. Moreover when I load a British Grid polygon shapefile it is distorted as well (while when I load it in another project is fine) and at the same time points are not lying on the polygons (they are lost). "On the fly" is automatically enabled.

Do you have any idea?


texts: "Error HRESULT E_FAIL has been returned from a call to a COM component." during using geoprocessor by VB.net

texts:
I am also get a error shows like "Error HRESULT E_FAIL has been returned from a call to a COM component."  And the Exception snapshot shows the "stacktrace" is at "ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute". Can you help me to solve it?

The thing is that I can using the geoprocessor by C#, but can't using it by vb.net. Is it something wrong with the setting or .NET framework?
Also, the Com Exception is -2147467259!

Private Sub RunBuffer()

    Dim gp As IGeoProcessor2 = New GeoProcessor()
    gp.OverwriteOutput = True
    Dim sev As Object = Nothing

    Try
        Dim parameters As IVariantArray = New VarArray()
        gp.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
        gp.SetEnvironmentValue("workspace", "C:\gp\AirportsAndGolf\golf.gdb")

        parameters.Add("C:\gp\AirportsAndGolf\golf.gdb\Airports")
        parameters.Add("C:\gp\AirportsAndGolf\golf.gdb\Airports_buff2")
        parameters.Add("1000 meters")

        gp.Execute("Buffer_analysis", parameters, Nothing)

       Console.WriteLine(gp.GetMessages(sev))

    Catch ex As Exception
        ' Print generic exception messages.
        Console.WriteLine(ex.Message)
        ' Print geoprocessing execution error messages.
        Console.WriteLine(gp.GetMessages(sev))
    End Try

End Sub


texts: Stat_density_2d density plot seem to show too high density values for a small dataset

texts:
I'm working with a two-column data.frame with the columns containing x and y coordinates (Longitude, Latitude).
A simple way to visualize a density map is by using the 'stat_density_2d' function. When I run the code below on my data, I obtain large density values. To me, this density plot suggest that the densities are larger than the total number of observations, which does not make sense to me. I have provided a small subset of my data.
df <- structure(list(Lat = c(-24.1871741, -24.2069615, -24.2022726,
    -24.2016188, -24.2152107, -24.1939073, -24.1913561, -24.198409,
    -24.2088875, -24.2121186), Long = c(30.8839167, 30.8814249, 30.8788437,
    30.8903969, 30.8883906, 30.8784664, 30.870561, 30.8800543, 30.8818679,
    30.8914805)), row.names = c(NA, 10L), class = "data.frame")

ggplot(df, aes(Long, Lat)) +
    stat_density2d(geom="tile", aes(fill = ..density..), contour = FALSE) +
    geom_point(colour = "white")

Even with only ten data points, the plot suggests a density range between 500 and 2000 points. I don't believe the output is wrong, but I'm just wondering if some could explain to me why these values are so larger on such a small dataset. How should I interpreted the density values from the legend?


texts: Permanently add a python toolbox to ArcToolbox

texts:
I've written a python toolbox for my company containing several scripts to speed up various repetitive tasks. Each time we want to use it we have to open ArcToolbox, right click and select "Add Toolbox...", then find the toolbox. If the mxd had previously been saved with the toolbox open, it remains open as part of the mxd.

I've tried the right click > "Save Settings" > "To Default" option with no luck - toolbox is missing next time I open ArcMap.

Is there a way to open the python toolbox by default every time ArcMap is opened, regardless of which mxd is opened or who's logged on etc?


texts: Using Append tool to append address number values from one point feature class to another gives ERROR 001156

texts:
I am using ArcMap 10.6.
I am having a problem with the append tool, specifically when appending one field in my attribute table.  I am trying to append the address number field which is a text field with a field length of 6 using the address field from the input attribute table which is text field with a length of 5.  It keep getting this error message.
Does anyone have suggestion or workaround for this?


texts: It is possible to use satellite map on OpenScales?

texts:
It is possible to use satellite map on openscales, like that http://api.ign.fr/geoportail/api/doc/examples/geoportalFxMap_minimum.html
I'v seen a exemple :

<os:WMSC name="Nasa"
             url="http://openscales.org/geoserver/gwc/service/wms"
             layers="bluemarble"
             format="image/jpeg"
             maxExtent="-180,-90,180,90"/>

But it's show just an image of earth and when i zoom in, image lose quality !?
Is there any other solution !?


texts: What exactly does the MODIS Land Cover QA-Class "Backfilled label" mean?

texts:
This is about the MCD12Q1.006 product and more specifically code 8 of the QA band.

The description for it is:

  Backfilled label: Missing label from stabilization, filled with the
  pre-stabilized result.

There isn't any more info on this in the User Guide. And frankly I don't really know what this code is telling me.
I've also quickly searched the MODIS Land Cover Product ATBD. It's Quality Control section didn't offer any help whatsoever.
Finally I also had a quick look at the corresponding publication but didn't find any info on backfilling either.

Does anyone of you have any more info on what has to happen for a pixel to be flagged with this code?


texts:
I'm learning as I go , I can't figure out the correct script.
I have data in a column named Full_Name which has 3 words  ex:  Arnault Branch Rd  and I want to break it out to StreetName column to be just the first two words Arnault Branch. The Script I'm using is !Full_Name!.split(" ", 1)[0][]1


texts:
In the older versions of the ArcGIS JavaScript API, you could specify the position of the infoWindow using map.infoWindow.setFixedAnchor(esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT);

In version 3.11 this fails with TypeError: esri.dijit.InfoWindow is undefined

The help file for version 3.11 now says that setFixedAnchor is a string, so I tried map.infoWindow.setFixedAnchor("ANCHOR_UPPERRIGHT"); but this returns TypeError: map.infoWindow.setFixedAnchor is not a function

What is the correct syntax for using setFixedAnchor with an infoWindow in version 3.11 and above?

map.on("load", function(){
  map.infoWindow.resize(250,100); //this works
  map.infoWindow.setFixedAnchor("ANCHOR_UPPERRIGHT"); //this fails
});


texts: Printing out all symbols of a personal style file in ArcGIS?

texts:
I need an overview of all symbols saved in a style file. Maybe in form of a list, to see the symbol itself and the name of the symbol.
Is there a way to export/create such an overview?

I am using ArcGIS 10.2.

I found an old extension for 9.3 called Styledump, but which is sadly not working in 10.x.


texts: Is there any way to automatically update a shp layer in QGIS?

texts:
I work with a vectorial layer (shp) created from a a CSV file which periodically changes its content.

The issue I'm raising is the following: every time I perform changes in the CSV file, I have to recreate the shp layer from the CSV, with the subsequent need to do the categorization again and change the symbols and their size.

Needless to say, I have the 'watch' option ticked when I load the CSV file. Therefore, I can see the changes in the CSV layer when I press the refresh button. But the changes do not affect the shp layer. As you could imagine, this is a real waste of time and a real nuisance and I would like to automatise the process.

I have checked this question out and the answers suggest switching off the cache, but I honestly don't know where that option is.


texts: PostgreSQL owner/role administration for QGIS projects

texts: What's the best way to administrate PostgreSQL roles for QGIS projects? I've created a separte schema for each of my QGIS projects. Is it possible to revoke all privileges except "select" for finished projects?


texts: Find all circles that overlap with point

texts:
(I'm very new to (Post)GIS in general, and I couldn't find an existing answer to this (or just don't know the right terminology) -- sorry if it's already been asked & answered)

I have a bunch of company addresses, each with a Point and a range of operations (radius in m):

create table public.company_addresses (
  id bigserial not null,
  -- some more data
  range_of_operation int4 not null,
  "location" geometry(POINT, 4326) NULL,
);

CREATE INDEX company_addresses_location_index ON public.company_addresses USING gist (location);

Now I have some other Point (long,lat) and I want to find all the company addresses in which the circle from their Point + radius overlaps with that point.

I've been able to do this with:

select id from company_addresses ca where ST_DWithin(ca."location"::geography, st_setsrid(st_makepoint(long, lat), 4326), ca.range_of_operation);

I was wondering if this is the best way to do this? Should I store the data differently?


texts:
I'm looking for a way to transform geoJson (obtained from a query to potsgis) to mapbox vector format, serverside in nodejs, without using mapnik (I dont have access to the server and therefore cannot use mapnik, as it needs certain specific versions as seen here https://github.com/mapnik/node-mapnik/wiki/Troubleshooting)

Is there any libraries allowing to do that ?


texts: MapInfo 17.0.1. Problems with SQL queries for my database

texts:
I am writing to you with the following two problems I have with MapInfo at my workplace. Recently we have changed our Microsoft SQL-Server 2003, with MapInfo Spatialware, to a Microsoft SQL Server 2019. This has led to problems mostly with SQL queries which can not be loaded or can not be executed, because Mapinfo crashes.
My problem that I have is about the SQL queries that I have. We use them at my workplace to receive/filter/extract specific objects, for example roads, from our database for maps that we create. So here I refer to the SQL Query dialogbox which you can open in MapInfo, when you want to load something from your database.
If I want to execute a larger query to receive specific roads from our road database, as example with the size of round about 60 lines with CASE statements, MapInfo crashes. All of these queries worked before we switched our server with either MapInfo 12.5 or newer versions like MapInfo 17.0.
I have edited the syntax of the queries so that they can be used with the newer SQL version. The only thing I could imagine that the query is too complex or some kind of limit is reached and because of that MapInfo crashes.
Example for a query:
Select
n.SATZ_NUMMER,
CASE n.NR_Projekt_1 % 100
WHEN d.Wert THEN n.NR_Projekt_1/1000
ELSE
CASE n.NR_Projekt_2 % 100
WHEN d.Wert THEN n.NR_Projekt_2/1000
ELSE
CASE n.NR_Projekt_3 % 100
WHEN d.Wert THEN n.NR_Projekt_3/1000
END
END
END
AS BSTR_WB,
d.Dringlichkeit,
g.MI_PRINX,
g.SP_GEOMETRY
FROM
"BMVKarte-ng".dbo.NETZ_G g,  "BMVKarte-ng".dbo.Strecken n, "BMVKarte-ng".dbo.Dringlichkeit d
WHERE     (
(d.Dringlichkeit = 'WB')
    and
(n.SATZ_NUMMER = g.SATZ_NUMMER)
    and
        (
            (
                (n.NR_Projekt_1 > 200000)
                    and
                (n.NR_Projekt_1 < 300000)
                    and
                (n.NR_Projekt_1 % 100 = d.Wert)
            )
                or
            (
                (n.NR_Projekt_2 > 200000)
                    and
                (n.NR_Projekt_2 < 300000)
                    and
                (n.NR_Projekt_2 % 100 = d.Wert)
            )
                or
            (
                (n.NR_Projekt_3 > 200000)
                    and
                (n.NR_Projekt_3 < 300000)
                    and
                (n.NR_Projekt_3 % 100 = d.Wert)
            )
        )

)

Sorry that I was not able to describe certain steps in a better way, but unfortunately my MapInfo is in German…
I tried to conntact the MapInfo tech support via e-mail and phone, but I did not receive an anwser.


texts: Forcing input parameters in QGIS processing scripts?

texts: Is there any way to force input parameters (e.g. data provider, geometry type, field type) in processing scripts?


texts: Cloud mask for Landsat8 on Google Earth Engine

texts:
I'm creating a composite image, in order to create a timeseries. I've already created the composited image, but i am having difficulty masking the clouds of the composite image. I've followed the code from a page having similar problems, however when I run the code (after replacing all the l8_mayo to composite as that is the name of my composite var), I get the error code of composite.map not a function. This error does not come up when I run the exact same code from the previous answer. Can someone explain how to overcome this problem? Here is the page I used: Apply a cloud mask to a Landsat8 collection in Google Earth Engine - time series

here is my code and the link to my code:
https://code.earthengine.google.com/e42eaf1819e63e1d679e5db3f4c54e89

(point is the long, lat for Lake Manyara, Tanzania)

//load images for composite
var sr14= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(point)
.filterDate('2014-01-01','2014-03-01')
.select(['B4','B3','B2']);

// Temporally composite the images with a maximum value function.
var composite = sr14.max();
Map.setCenter(35.8244, -3.5799);
Map.addLayer(composite, {}, 'max value composite');

var getQABits = function(image, start, end, newName) {
// Compute the bits we need to extract.
var pattern = 0;
for (var i = start; i <= end; i++) {
   pattern += Math.pow(2, i);
}
// Return a single band image of the extracted QA bits, giving the band
// a new name.
return image.select([0], [newName])
              .bitwiseAnd(pattern)
              .rightShift(start);
};

// A function to mask out cloudy pixels.
var cloud_shadows = function(image) {
// Select the QA band.
var QA = image.select(['BQA']);
// Get the internal_cloud_algorithm_flag bit.
return getQABits(QA, 7,8, 'Cloud_shadows').eq(1);
// Return an image masking out cloudy areas.
};

// A function to mask out cloudy pixels.
var clouds = function(image) {
// Select the QA band.
var QA = image.select(['BQA']);
// Get the internal_cloud_algorithm_flag bit.
return getQABits(QA, 4,4, 'Cloud').eq(0);
// Return an image masking out cloudy areas.
};

var maskClouds = function(image) {
var cs = cloud_shadows(image);
var c = clouds(image);
image = image.updateMask(cs);
return image.updateMask(c);
};

var composite_free = composite.map(maskClouds);

Map.addLayer(composite_free, 'composite collection without clouds');


texts: Filter a layer and edit over that filter in QGIS 2.1.4.1

texts:
I'm new using QGIS,

I have a layer with the field called "districts"
Classified by district A, B, C, and D

I need to work with District C, I'm doing a filter from District C

But I can not enter the edit option because the layer is filtered.
I wanted to edit attribute table of this layer

Is there a way to work with a filtered layer?

The idea of filtering is because I need to see specifically where the points of district C are located

enter image description here

This is the complete layer

This is the filter

Now I want to edit on the filter the attributes table using the field calculator

But I do not have the option to edit the table either the field


texts:
I am saving all layers of my map to a geopackage. This works fine so far. Now I want to save my project into the same geopackage.  I select Project Save to Geopackage and now QGIS 3.8.3 (OS: windows 10) crashes.
What I am doing wrong?

Crash ID: d5e7e232839b5a6635b925b3cc3c6c55a1c54cfe

Stack Trace

QString::multiArg :
QString::arg :
QgsGeoPackageProjectStorage::writeProject qgsgeopackageprojectstorage.cpp:241
QgsProject::write qgsproject.cpp:1799
::operator() qgisapp.cpp:14525
QMetaObject::activate :
QAction::activate :
QMenu::actionGeometry :
QMenu::actionGeometry :
QMenu::mouseReleaseEvent :
QWidget::event :
QMenu::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:403
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:403
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
UserCallWinProcCheckWow :
DispatchMessageWorker :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main main.cpp:1567
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.8.3-Zanzibar
QGIS code revision: 685d8b15d2
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.4.1
Running against GDAL: 2.4.1

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.18362


texts: How to create C factor (RUSLE) map by using NDVI values?

texts: I have a basic knowledge of GIS and ArcGIS sofware and I need to generate C factor (cover management factor of RUSLE) by using NDVI values. I know there is an exp formula but I don't know the steps to create the map. How can I do this?


texts:
I have the following code (utilizing a script by Rodrigo Principe that implements Hollstein et al's 2016 Sentinel 2 cloud mask), which overall works quite well.

    var mask_all = function(image) {
      var hollstein_mask = cld.hollstein_S2(['shadow', 'cloud', 'cirrus'])(image)
      return hollstein_mask
    };

However, it leaves some white borders around clouds and some black borders around shadows. I'd like to get rid of these with a buffer. But no matter how long I bang away at it, I can't manage to convert the existing mask to a binary image, buffer that, and then use that to update the mask. Here is the best I can do, which doesn't crash but also does not appear to do anything at all:

    var buffer = function(image){
        var buffer_bad = image.select('cloud').neq(1)
                          .and(image.select('shadow').neq(1))
                          .and(image.select('cirrus').neq(1))
                          .focal_max({radius: 100, units: 'meters'})
        return image.updateMask(buffer_bad)
    }

What I'm trying to make happen there is to take the existing mask, nibble way at the edges by 100 meters, and then update the mask.

Here's the full snippet of relevant code for context:

var cld = require('users/fitoprincipe/geetools:cloud_masks')

var mask_all = function(image) {
  var hollstein_mask = cld.hollstein_S2(['shadow', 'cloud', 'cirrus'])(image)
  return hollstein_mask
};

var buffer = function(image){
    var buffer_bad = image.select('cloud').neq(1)
                      .and(image.select('shadow').neq(1))
                      .and(image.select('cirrus').neq(1))
                      .focal_max({radius: 100, units: 'meters'})
    return image.updateMask(buffer_bad)
}

var allclear = ee.ImageCollection('COPERNICUS/S2')
  // Pre-filter to get less cloudy granules over the ROI.
                  .filter(ee.Filter.calendarRange(1, 2, 'month'))
                  .filterBounds(ROI)
                  .map(mask_all)
                  .map(buffer)
                  .median();


texts: Is it possible to add more than one page to a QGIS print composer project? For example one sheet for the map and another sheet for the legend and some other information.


texts:
I have a GeoDataFrame which is a multipolygon and represents boundaries of a country:

0    MULTIPOLYGON (((10.10112 46.23346, 10.10099 46...

Its bounding box/extent is:

minx       miny      maxx       maxy
5.956063  45.817059  10.495112  47.808483

I would like to extend the bounding box using a parameter let's say ext = 1.4 so it will become:

minx       miny      maxx       maxy
8.338488  64.143881  14.693157  66.931876

I'm trying to extend it so when I display the raster, the layer is not cropped too tightly and I don't lose some of the information around it. When I try
data.bounds *= 1.4,
I get the following error:
AttributeError: can't set attribute. It seems like I can't modify the DataFrame directly. What's the proper way of extending the bounding box of a GeoDataFrame?


texts: GeoServer Date ftl showing time stamp rather than just the date

texts:
I had an issue with Geoserver showing my postgresql data in the US (MDY) format rather than the UK / European format (DMY). I fixed this by removing the comment #, and setting the language, to en_GB. In the tomcat6.conf file.

# You can change your tomcat locale here
#LANG="en_US"

The data now displays on my geoserver outputs as DMY, however HH:MM is also shown when i do a get feature request.

The postgresql field is Date, and Geoserver lists it as a Date in the layer information panel. However i have 00:00 after the date when i click for a GETfeature information request.

How would I stop 00:00 after the date?


texts: Reproject soil moisture product L3 from SMOS (SM_RE04_MIR_CLF33A) from Ease Grid 2 to other map projections

texts: I need to re project soil moisture product L3 (SM_RE04_MIR_CLF33A) (NC file) from Ease Grid 2 to other map projections. Is there any way to do that? What software can I use?


texts: Encoding GeoJSON to something other than 'UTF-8' from QGIS

texts:
I want to save the shp file as GeoJSON and encode it to system,
but my QGIS is disabled for selecting an encoder.

Adjusted the 'ignore shapefile incoding declaration' option, but it did not work.

I want GeoJSON to get Rhino 6. It does not recognize UTF-8. I don't necessarily have to encode to system.


texts: QGIS 2.12.1 - Problem with Size Assistant in „data defined override“ Button - Error message

texts:
While trying out the Size Assistant feature I encountered a problem.
I´m working with this csv Table:

I tried to resize the Point Size based on the field „Anzahl Objk“ and to do this I went to „Layer Properties“ – „Style“  clicked on the Data defined override Button next to the „Size field“ and selected „Size assistant“ at the bottom.
In the following window I changed the settings like this:

I clicked o.k. expecting to see values from 1 to 5 in the size of the yellow dot with the no „5“ next to it in the picture above. values from 6 up would then be in the size of the dot with the „10“ next to it.
After clicking o.k I got a red tinged button like this next to  the size field

And hoovering over it and in the description window it reports the following error:

If I click on Edit in the button menu I get to the expression builder where it reports the same error.

The points on the map don´t change at all.
Is there a way to get this to work easily the way I expect it to with this assistant by doing steps differently or do I have to enter or change an expression code somewhere?
Or do I completely misunderstand the dialog above and what it is supposed to do?


texts: Converting DWG to GDB and maintaining style with Data Interoperability in ArcGIS Pro?

texts:
I am attempting to Convert a DWG to a geodatabase for online publishing and use in collector.

The conversion itself is fine, however I am also attempting to maintain style, i.e. annotation, colour, etc.

I have exposed autocad_color but obviously this is a numeric value, rather than RGB or something ArcGIS Pro can work with. I have also attempted to expose fme_color but that will not appear as an attribute. What am I missing?


texts: Esri File GDB multi-user edit through QGIS

texts:
I have an Esri File GDB with relationship classes. I would like to import this GDB in PostgreSQL or MSSQL to enable multi-user edit through QGIS (dufour) tool.

What are the steps/procedures to follow?

Or is there any other way to achieve GDB multi-user edit without ArcSDE and Arc tools?


texts: how to use custom fonts in QGIS mapserver on Debian Linux

texts:
I've got a QGIS setup running, except for the custom fonts. They work just fine on my desktop machine (OS X), but they don't work on the server (Debian Linux).

I've got the .ttf files installed in the system, so that should work. I also found something online about a fonts.txt file, so I created that:

Merriweather    /usr/share/fonts/truetype/Merriweather-Regular.ttf
Kingthings Calligraphica    /usr/share/fonts/truetype/Kingthings_Calligraphica_2-webfont.ttf

but it doesn't seem to do anything. Unfortunately, documentation on this seems to be lacking. Has anyone got this working and can tell me how to correctly setup my fonts?


texts: Creating site with ArcGIS for Server gives Failed to create site. com.esri.arcgis.discovery.servicelib.AGSException?

texts: I installed ArcGIS for server 10.3 in windows 8 . everything is ok and service is running but when creating a site with manager wizard, the site encounter to the error "Failed to create the site. com.esri.arcgis.discovery.servicelib.AGSException" .How can i solve the problem ?


texts: How to run QGIS algorithms with selected features?

texts:
In the QGIS GUI, the select-by-location algorithm has a choice to only use the selected features from the INTERSECT layer. How can I do this (or use any other algorithm) in a python script for QGIS 3? I do not want to save temporal layer as mentioned in Run QGIS Model on selected features only?

I have been running this script but it does not use the selected features.

import processing
input_vlayer = 'Some path'
intersect_vlayer = 'Some path'

input_vlayer = iface.addVectorLayer(input_vlayer,  'input_vlayer', 'ogr')
intersect_vlayer = iface.addVectorLayer(intersect_vlayer,
                                       'intersect_vlayer', 'ogr')

# Pass the first 5 features
for i in range(5):

    # Select the features
    intersect_vlayer.select(i)
    # Set input params
    params = {'INPUT':input_vlayer,
              'PREDICATE':0,
              'INTERSECT':intersect_vlayer, # USE HERE THE SELECTED FEATURES
              'METHOD':0}
    result = processing.run("qgis:selectbylocation", params)

    # Remove the current selection and then pass to the next one
    intersect_vlayer.removeSelection()

Also, from QGIS select by location doesn't use selected features only they mentioned to enable [Processing] > [Options] > [General] > [Use only selected features]. However I can't see this option in my qgis version. I'm using Madeira 3.4.3


texts: How to create a Digital Elevation Model using GRASS

texts:
How to create a DEM starting from layers shapefile "contour lines" and "shares"?

Which module of GRASS do I need to use?


texts:
I have a table with polygons in EPSG 4326. These polygons are distributed all over the world, for example:

POLYGON((10.7324632658845 59.9253049236956,10.7331908150806 59.9244876816042,10.7342435821189 59.9247242537529,10.7335237442742 59.9255414900176,10.7324632658845 59.9253049236956))

Now I'd like to get the areas of these polygons in square meters. With ST_Area(the_geom) I get the area in square degrees, right? So I have to do something with ST_Transform. I got a good result for the above mentioned polygon with the following transformation:

ST_AREA(ST_Transform(ST_GeomFromText(the_geom,4326),31467))

However, the calculation (of course) fails when calculating the area of a polygon outside of the coverage of EPSG 31467 (Fatal error...).

Is there a "universal" area accurate projection for this purpose? Or do I have to check the location of every polygon and individually apply a suitable projection to calculate its area properly?


texts: Automatically calculating values for points that intersect with line

texts:
I am using QGIS 3.12.
I have two point layers and one line layer.
Each point layer consists of dots and each dot has an integer attribute value of random numbers.

The line is supposed to show a label where if the line intersects any points, it calculates and displays the sum of integer values for those points.

*note : the line should update the sum if I edit it to intersect more points with an integer value


texts: Why does Lat/Long differ depending on the coordinate system of the data?

texts: I obtained ETRS89 (ETRS_1989_ETRS-TM32;WKID: 3044 Authority: EPSG) data and I am using a Gauss-Krüger coordinate system (DHDN_3_Degree_Gauss_Zone_3;WKID: 31467 Authority: EPSG). Now I need to calculate the WGS84 Lat/Long coordinates. Using ArcGIS for Desktopts field calculator, I have the option to use the "Calculate Geometry" tool depending on the coordinate system of the data source (ETRS89) or the data frame (Gauss-Krüger). Depending on the choice, values differ by the third digit, which is an offset of approximately 200 m. I use the right transformation (DHDN_To_ETRS_1989_8_NTv2), the data is shown on the correct position, but the Lat/Long output using Gauss-Krüger is wrong. When I load the Lat/Long data again it is not on the correct position anymore. I am trying to understand that issue and also to solve that, if possible.


texts: Geoalchemy: insert 3D elements in PostGIS database

texts:
I have shp files that I would like to insert into a PostGIS database. I'm planning to use Geoalchemy2 and geopandas to do so. However, my data have the geometry types LINESTRING Z and POINT Z. As I don't know the geometry type of object, I used Geometry("GEOMETRY") dtype as parameter of my to_sql call.

I get the following error as a result:

  (psycopg2.DataError) Geometry has Z dimension but column does not

Here is a functioning code:

from geoalchemy2 import Geometry, WKTElement
import geopandas as gpd
import sqlalchemy

engine = sqlalchemy.create_engine('postgresql://username:password@host:port/username')

gdf = gpd.read_file("file.shp")
gdf['geom'] = gdf['geometry'].apply(lambda x: WKTElement(x.wkt))
gdf.drop('geometry', 1, inplace=True)
gdf.to_sql(
    "tablename",
    engine,
    if_exists='append',
    index=False,
    dtype={'geom': Geometry('Geometry', dimension=3)}
)

The dimension=3 parameter doesn't change anything.

I saw PostGIS Column has Z dimension but geometry does not, Geojson in postgis Geometry : Z dimension error and PostGIS error reads "Geometry has Z dimension but column does not" propositions but as I create the tables with the to_sql command, I cannot alter the fields. I tried to alter the column afterwards and to insert then the 3D elements (e.g. LINESTRING Z  (...)) and that did work.

Do you think I should:

Create the tables manually first by reading the columns?
Stop looking for Python shp import and use something else (shp2pgsql)?
Any other idea?


texts: How to iterate through only select attributes of a single field using ModelBuilder in ArcMap 10.1

texts:
The feature class that I am iterating with ModelBuilder is a polygon FC called "Alignment" in my model. My current solution to iterating through only certain attributes of a single field does not seem to be working. My initial thought when creating this model was that I would use "Iterate Feature Selection" to choose the field that I wanted to iterate and then use the "Null Value" option to specify the attributes in the field that I wanted to skip. This might still work with a syntactic correction but I do not like that this current model is based on exclusion rather than inclusion, below is a screen shot of how I have the tool set up.

I would prefer to have more of an inclusion set up (specify which attributes I do want included) rather than an exclusion set up (specify which attributes I dont want included). Does anyone know how I can alter my model to accomplish this?

Thanks,
kkaszas


texts: Convert SQL Server spatial table with unknown coordinate reference system to GeoJSON with ogr2ogr

texts:
I have a table in SQL Server with an STSrid of 0. I would like to convert this table to GeoJSON using ogr2ogr. The problem is, despite converting to EPSG:4326, the resulting coordinates are not valid (verified using GeoJSONLint). The GeoJSON file's crs key lists the coordinate reference system as the desired CRS84, but the feature coordinates are far too large.

A sample feature appears as such:

{ "type": "Feature", "properties": { "TR": "00028" }, "geometry": { "type": "Point", "coordinates": [ 447366.18450000137, -920054.45910000056 ] } }

The output coordinates as seen above are identical to the input:

select TR, Shape.STX, Shape.STY from [table] where TR = '00028'

results in:

00028   447366.184500001    -920054.459100001

I'm entering the following ogr2ogr command:

ogr2ogr -f "GeoJSON" "sqlexport.json" "MSSQL:server=[server];database=[db];trusted_connection=yes;" -sql "select TR, Shape from [table]" -a_srs "EPSG:4326"

Edit:
Despite SQL Server listing the STSrid as 0, ArcGIS reads it as GCS_North_American_1983:

Custom
Projection: Two_Point_Equidistant
False_Easting: 0.0
False_Northing: 0.0
Latitude_Of_1st_Point: 49.0
Latitude_Of_2nd_Point: 49.0
Longitude_Of_1st_Point: -110.0
Longitude_Of_2nd_Point: -77.0
Linear Unit: Meter (1.0)

Geographic Coordinate System: GCS_North_American_1983
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_North_American_1983
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314140356
    Inverse Flattening: 298.257222101

Despite this, if I change the ogr2ogr command to the following:

ogr2ogr -f "GeoJSON" "sqlexport.json" "MSSQL:server=[server];database=[db];trusted_connection=yes;" -sql "select TR, Shape from [table]" -s_srs "EPSG:4140" -t_srs "EPSG:4326"

The coordinates still remain unchanged.


texts: Best way to get osm.pbf data for a given extent?

texts:
I need to download/create a PBF file containing all osm data for several french urban areas. To select data, I have, for each urban area, the values of the attribute ref:INSEE for every city composing the area.

What could be the best method to do this?

I'm looking for an automatable method, for example by a script with a boundary filter as a parameter.

Geofabrik seems to have automatic tasks to do it for every regions, country and continent.

My environments are a windows local machine and a linux server.


texts: How to make subset from satellite images without getting empty border?

texts: I have Landsat 5-8 images, and after creating subset for the area of interest there is an empty border on the image as black part. How to remove it or how to create subset without it? Here is the view of the subset image after multiresolution segmentation that shows there were segmented the empty part of image, too (black part beside the image):


texts:
I am trying to calculate the convexhull for an entire table containing 3 200 000 records.
the_geom is of type POINT:

SELECT ST_ConvexHull(ST_Collect(the_geom)) FROM mytable;

After 1-2 seconds it fails with the following error:

ERROR:  out of memory
DETAIL:  Failed on request of size 134217728.

********** Error **********

ERROR: out of memory
SQL state: 53200
Detail: Failed on request of size 134217728.

I have tried removing the ST_Convexhull call and just called ST_Collect with the same result.

I am currently running this on PostGIS 1.5, PostgreSQL 9.1 on Windows 8. Is it likely running on Linux will somehow fix the problem?

I have tried to set the following values in postgresql.conf, but nothing seem to help:

shared_buffers = 1024MB
temp_buffers = 1024MB
work_mem = 1024MB
maintenance_work_mem = 1024MB

I have also tried using ST_MemCollect but it runs extremely slow.


texts:
How can I geocode a single address in python using arcgis 9.3?

I found http://webhelp.esri.com/arcgiSDEsktop/9.3/index.cfm?TopicName=Geocode_Addresses_%28Geocoding%29 - but this does a whole table, and I was forced to use a MDB file as the feature class and then inport and export from it.


texts: Selecting polygons from file 1 based on their location within file 2 using ArcMap

texts:
I'm working on a project right now where I want to find the census tracts within a particular traffic analysis district. I may just be blanking on it, but I'm working with two files. The first has census block/tract data, the second has the TAD data. I want to find all the polygons from file 1 that are contained within the each TAD polygon.
I'm just not finding recalling the ArcMap tool to use.


texts:
I'd like to write GML using Geotools. Unfortunately, I can't find documentation on a GML Writer (except for this one from 2006: http://docs.codehaus.org/display/GEOTOOLS/WFS+++GML+DataStore).

Could you point me at documentation/examples?


texts: Arcpy 10.2.1 Can't get full path from layer.dataSource

texts:
I have a stand alone script that I am simply trying to get a record count from a layer in an mxd.  I continue to get '-1' as the output with a layer that has 1200+ records. The data source is an SDE feature class within a feature dataset.  When I try to print the data source I only get the name of the feature dataset and the feature class. I think the issue is because of this? I need to have the complete path seeing as this script will be run by other people on their own machines. Here is the portion of the code that prints the data source and tries to get the count:

import arcpy
mxd_path = r'C:\Projects\Test2.mxd'
mxd = arcpy.mapping.MapDocument(mxd_path)
df  = arcpy.mapping.ListDataFrames(mxd)[0]
layer = arcpy.mapping.ListLayers(mxd, 'Test Boundary', df)[0]
print layer.dataSource
print int(arcpy.GetCount_management(layer.getOutput(0))

The first print statement returns

'/LAND.Boundaries/LAND.TestBoundary`

The second print statement returns

-1

The path and names of the mxd and layer are correct and exist. I think this is really weird that it won't include the sde connection file path with the layer.dataSource?  I haven't found other answers to this specific problem  I saw similar threads here

https://geonet.esri.com/thread/48767

However this only indicates using the describe with layer.dataSource.  if I try to run any arcpy/geoprocessing on the layer it says this is not a valid parameter.  For example I can't create a feature layer with MakeFeatureLayer_management with the layer returned in the stand alone script.  I can run it in the Python command window successfully but unfortunately need to solve it for the stand alone script per my situation.  Anyone seen this same issue of not returning the full path of the layer's data source?


texts: Visualization of tin-created DEMs in QGIS via threejs results in tall 'church-spiral-like' column?

texts:
I keep having this problem while doing a simple 3D visualization of my newly created DEM in QGIS via the threejs plugin.

I work in Balkan Zone 7 metric system and, when I try to visualise the DEM that I created from points (which were transformed in Balkan Zone 7) using the TIN interpolation method, I get a really, really tall 'church-spiral-like' column in my browser. I have to scroll all the way to the top just to see my visualization.

But, of course, if I change from metric to another CRS, I get flat terrain in my visualization while my threejs display's the following message:

The unit of current CRS is degrees, so the terrain may not appear well.

The problem doesn't seem to appear while working with free data like the ASTER GDEM or SRTM data for my country, no matter if they are set to WGS, Pseudo-Mercator or Balkan Zone 7, the topography and the terrain still appear well.


texts: Should slow refresh rate be expected while viewing 1000 points out of 100 million using ArcSDE/Oracle?

texts:
Is it normal to experience very slow refresh rate in ArcMap with 1000 points shown out of 100 million using ArcSDE/Oracle?

I’am testing a setup with ArcSDE/Oracle database to contain geographical data. One table contains 100 million and another table contains 70,000 polygons.

The refresh rate while viewing the polygon table in ArcMap is fast but very slow for the point table. I do not expect to be able to look at all the 100 million points at the same time, but thought it should be possible to use the “definition query” option to only work with a subset of the data (for instance the points with id between 1-1000).

The definition query works fine and only the points with id between 1 and 1000 are shown on the map, but the refresh rate is extremely slow for some areas. These areas are where points are located in the point table, as expected these points are not shown because of the definition query but then why is the refresh rate so slow when only 1000 points total are shown? When zoom to layer is used refresh takes 1 sec at scale 1:30,000 and 4 min at 1:500.000 with the same data shown. See http://youtu.be/b-9ubqHy7nM .

The network activity shows that the local computer only receives data for areas where the points are shown and the CPU is not stressed either so it is not because the local computer are doing anything.

It seems almost like there is no spatial index or there is something wrong with it, but this is not the case. In Oracles SQL Developer spatial queries for points within a certain polygon and for a certain id works very fast.

Is it possible that a setting somewhere in the setup causes the poor refresh rate in ArcMap or is this normal behavior for tables containing this amount of points?

I appreciate it if any of you guys can cast some light on what refresh rate I should expect.

UPDATE
Versions in use: ArcGIS 10.1, Oracle 11g, I’m a little unclear about the version of ArcSDE but the describe function  (arcpy.Describe(“DB_connection.sde").release) returns 3,0,0.
Feature Class Properties->Index under spatial index shows this


texts: Finding vertical datum for bathymetry layer?

texts:
I was given a layer that shows bathymetry, and I need to list the vertical datum for the it on the map.

Is this somewhere in the layer properties?

I only see datum. I don't know the source for the bathymetry layer.

How can I find the vertical datum?


texts: What is difference between version 2.10 & 2.14 in FileGDB driver support in QGIS? GDB version is 10.2.2

texts:
Problem is with QGIS Desktop 2.14.0.
 I need to edit a FileGDB in QGIS.

I have followed the instructions shown in this thread and have added the option "ESRI FileGDB".

But after I choose the folder and press open there is an error: "Invalid Data Source" ... is not a valid or recognized data source
.

The same error is encountered when I try to open a File GDB with Type OpenFileGDB.

But when I don't use OSGeo4W, and try to open the GBD with standard QGIS Desktop 2.14.0, there is no problem. The GDB is opened in read-only mode.

What is the problem? How can I edit features in a File GDB in QGIS?


texts: Dynamic Layer Name - Leaflet Layer Control

texts:
I would like to have the name of a layer used by Leaflets layer control feature come from a variable instead of a string and based on data from the layer. The example shown below uses the variable layerName.

Is this even possible since it is expecting a name value pair? Is there a work around?

var layerName = feature.properties.condition[0];

//layer control
var baseMaps = {
    "OpenStreetMap": OSM,
    "Aerial Imagery": MapQuestOpen_Aerial
};

var overlayMaps = {
    layerName: layer1,

};

L.control.layers(baseMaps, overlayMaps).addTo(map);


texts: How to set Google Maps search bar on the map generated with qgis2web plugin?

texts:
I have a Leaflet web map generated with qgis2web plugin in QGIS.

By default, there is one option in the plugin generating window to add an address search bar on the map. Unfortunately, that address bar uses OpenStreetMap data, which is not very accurate. Now, I want to change some part of code and place a Google Maps search instead.

Is that possible to do?


texts: Qgis-Replace file path in attribute table 'invalid Expression'

texts: I wan't to replace my filepath in the attribute table but I'm always getting an invalid expression. I already tried to double the backslashes but I didn't work out.


texts: OpenLayers WFS vector layer rules don't get applied

texts:
I have a script which applies rules to wfs.vectors.

The script works fine in Firefox and all the rules get applied, but somehow when I open the same file with the Internet Explorer 7 / 8 , only the first rule gets appended and the other ones don't get processed. I've searched around a lot and I really can't find an answer to this problem.

I've included links to screenshots of the error and also the code of my rules.

Firefox 3.6.13:

img835.imageshack.us/img835/1070/vectorff.jpg

Internet Explorer 7:

img818.imageshack.us/img818/9493/vectorie.jpg

<script type="text/javascript">
    var map;
    OpenLayers.ProxyHost = "/proxy.php?url=";
    function init(){
        map = new OpenLayers.Map("map_container", {
            maxExtent: new OpenLayers.Bounds(5, 50, 15, 56)
        });
        // create a new style and add rules
        var defStyle = new OpenLayers.Style({
            strokeWidth: 0
        });
        defStyle.addRules([
            new OpenLayers.Rule({
                symbolizer: {
                    fillColor: "#ffeecc"
                },
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.LESS_THAN,
                    property: "order07",
                    value: 04000
                })
            }),
            new OpenLayers.Rule({
                symbolizer: {
                    fillColor: "ffcc99"
                },
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.BETWEEN,
                    property: "order07",
                    lowerBoundary: 04000,
                    upperBoundary: 08000
                })
            }),
            new OpenLayers.Rule({
                symbolizer: {
                    fillColor: "ff9966"
                },
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.BETWEEN,
                    property: "order07",
                    lowerBoundary: 08000,
                    upperBoundary: 11000
                })
            }),
            new OpenLayers.Rule({
                symbolizer: {
                    fillColor: "ff6633"
                },
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.GREATER_THAN,
                    property: "order07",
                    value: 11000
                })
            })
        ]);
        var selStyle = new OpenLayers.Style({
            fillColor: "#ffaa00"
        });
        // combine styles in a style map
        var myStyleMap = new OpenLayers.StyleMap({
            "default": defStyle,
            "select": selStyle
        });
        // create a WFS layer with the style map
        var states = new OpenLayers.Layer.WFS(
            "Deutschland",
            "http://--------:8080/geoserver/wfs",
            {typename: "someName:someLayer"},
            {isBaseLayer: true, extractAttributes: true, styleMap: myStyleMap}
        );
        map.addLayers([states]);
        // create a select control
        var select = new OpenLayers.Control.SelectFeature(states, {
            hover: true
        });
        map.addControl(select);
        select.activate();
        // listen for feature selection and update stats
        states.events.on({"featureselected": function(evt) {
            var feature = evt.feature;
            $("state_name").innerHTML = feature.attributes.order07;
            $("state_pop").innerHTML = feature.attributes.name;
        }});
        map.zoomToMaxExtent();
    }
</script>

So as you can see there's nothing big with these rules. I hope someone can help with this problem, because I can't really see where the problem is coming from.

Could it be a deviant comma somewhere? even though I have searched for one throughout the code.


texts: Functions not available for tiff raster dataset in ArcMap?

texts:
I am using ArcMap (10.4.1) to work on a landcover dataset. The file format of the raster layer is "tif". However, for some reason, many of the functions in Arcmap are not available - for example, all selection tools are grayed out (see screenshot) and when I want to use the "Clip" tool I cannot select my layer as an input feature.
I assume it has something to do with the format of the raster layer, which is why I include a screenshot of the layer properties as well. I have searched google for almost an hour but not found a solution..


texts: Problem with expression syntax in Attribute Assistant

texts:
I am using Arc 10.3.1 and attribute assistant.  I would like the attribute assistant to autopopulate a field called [Supervisors] with a conditional statement depending upon the values of other fields.  So far I have gotten this expression to work

iif([SM_Zone] = "A" , "Greg"  ,"<Null>")

but I need more conditions added and when I add more conditions the expression fails. The expression that is failing is:

iif([SM_Zone]="A" & [REQUEST_TYPE] <> "PW (SM)-Right Of Way Weeds"),"Greg", iif([REQUEST_TYPE] = "PW (SM)-Right Of Way Weeds","Bill","Null")

also I would really like to craft the statement with this logic:

if ([SM_Zone] = "A" & [REQUEST_TYPE] LIKE "%RIGHT%"), "Bill" , "Greg")

ie: if the point is in zone A and the type has %RIGHT% in it then the supervisor is bill, else the supervisor is Greg.

Like I mentioned before I have gotten the simple statement to work but when I add other conditions it fails.  Could someone please point me in the correct direction or help identify what is causing the failure.


texts: Server Object Extension MultiPoint Input

texts:
I have soe which accepts {x:-112,y:35} as input parameter.
how can I modify the soe code so that I can pass more than one point as my input parameters like
{x:-112,y:35},{x:-113,36},{x:-113.5,y:34} and so on
Thanks!


texts: Adding WMS layer in existing map with ArcGISDynamicMapServiceLayer

texts:
We have an existing Silverlight application that loads a ArcGIS MapService and display it to the user. We want to add the ability to also add a WMS layer on top of the existing displayed map. I am not too familiar about WMS layers and the samples i found on ArcGIS are only loading ArcGIS WMS layers.

We have updated one of our ArcGIS map services and enabled the WMS capability.

How do i add the WMS layer to the map?

Would i access it the same as a ArcGISDynamicMapServiceLayer?

using a url like this? http://OurArcGISServer/arcgis/services/Map1/MapServer/WMSServer


texts: Making a spatial link to points within polygons in the field calculator in QGIS

texts:
I have a polygon shapefile of the counties in the UK and a separate point shapefile of project sites.

Within the project sites attribute table I would like to add a new virtual column with the name of the county that the point sits in determined by the polygon it is in. I have tried

aggregate( 'County and Unitary Authority',  'concatenate',
"county",  within( $geometry,  geometry(@parent) ))

but I know this is wrong. Which aggregate do I use instead of concatenate and is within the right filter to use?

I need a method like this with NO use of plugins or making new layers.

Also, does @parent literally mean @parent or does parent mean the name of the parent layer i.e. @County and Unitary Authority?


texts: Select features in a polygon that covered the most by features of another polygon layer QGIS

texts:
I am working in QGIS. I have 2 polygon layers,

One layer is the parcel polygons layer for a county called "Parcel"
The other layer is the building footprints polygon layer for the same county called "BuildingFootprint"

The building footprints features overlap multiple parcel polygons. I want to select the parcel polygons that the building footprint overlaps the most (majority). So for example, if I have two parcel polygon features overlapped by one building footprint feature, I want to select the parcel polygon that is covered by 90% of the building footprint feature and not select the parcel polygon feature that is covered by 10% of the building footprint.

Uncovering a way to select the parcel that is covered by majority of the building footprint will then allow me to join that particular parcel feature's number to the building footrpint feature's attribute table.


texts: WFS layer invalid in standalone python script

texts:
I have a project in 3.10.11 (ltr) loading a layer from a Geoscience Australia WFS. https://services.ga.gov.au/site_1/services/Geomorphology_Scale_Guide_WM/MapServer/WFSServer?request=GetCapabilities&service=WFS
In the python plugin console this layer is valid and has correct extents.

When reading this project into a standalone python script the layer is no longer valid and the extent has changed, which appears to be an error in interpreting the geometry.

from qgis.core import *
from qgis.gui import *
from gdal import *
from osgeo import *
import qgis.utils
import os
os.environ["PROJ_LIB"]='C:\\Program Files\\QGIS 3.10\\share\\proj;C:\\Program Files\\QGIS 3.10\\apps\\Python37\\lib\\site-packages\\pyproj\\proj_dir\\share\\proj'
QgsApplication.setPrefixPath("C:\\Program Files\\QGIS 3.10\\apps", True)
qgs = QgsApplication([], True)
qgs.initQgis()
project = QgsProject.instance()
project.read('D:\\temp\\Test.qgz')
layer = project.mapLayersByName('Guide 500K')[0]
layer.isValid()
layer.extent()


texts:
After having installed the plugin - Cartographic Line Generalization - I try to open the tool in the Plugins menu and receive the following error:

AttributeError: 'NoneType' object has no attribute 'wkbSize'
Traceback (most recent call last):
  File "/Users/alexander/.qgis2/python/plugins/CartoLineGen-master/cartolinegen.py", line 245, in count_vertices
    count = sum([feature.geometry().wkbSize() for feature in feat])/16
AttributeError: 'NoneType' object has no attribute 'wkbSize'

There is one geojson line layer in the layer table when this happens - what could be the issue ?


texts: Removing single raster from ArcGIS Raster catalog?

texts:
I have duplicate rasters in a raster catalog which I want to remove. There is no tool to remove single rasters.

Is there another way to do this without removing the entire raster catalog and reloading it?


texts: TileStache can't find spatial ref for vector layer

texts:
I have a query based vector layer in my TileStache configuration, and it's hitting this block of code

if layer.GetSpatialRef() is None and driver_name != 'SQLite':
    raise KnownUnknown('Couldn\'t get a layer from data source %s' % source_name)```

and failing, because the GetSpatialRef() is returning None. Is there a parameter that I am missing in my configuration? I've tried giving it projected=True and projected=False, with no change in results.

TileStache 1.49.10 on Ubuntu 14.04 with Mapnik 2.3 (not that Mapnik is even used for the vector provider) and PostGIS 2.1 (upgrading from postGIS 1.5.x).


texts: Determine why OpenLayers.Bounds containsLonLat() returns false

texts:
In this code, I'm loading a bunch of random points that are roughly in the contiguous USA. I've created a OpenLayers.Bounds object roughly corresponding to that extent.

When I select a point, I want to determine whether that point falls within those Bounds. If you load up this code, you'll see that clicking on a point in the USA should cause Bounds#containsLonLat to return true. But alas, no.

Why?

    var map, osm;
    var fromProj = new OpenLayers.Projection("EPSG:4326");
    var toProj = new OpenLayers.Projection("EPSG:900913");
    var center, pointsLayer, usaBounds;

    $(function() {
        var vector = new OpenLayers.Layer.Vector('vector');
        var boxes  = new OpenLayers.Layer.Vector( "Boxes", { style: {fillColor: '#000', fillOpacity: 0.1, strokeWidth: 0}} );

        map = new OpenLayers.Map("map", {});
        osm = new OpenLayers.Layer.OSM();
        center = new OpenLayers.LonLat(-98.5795, 39.8282).transform(fromProj, toProj);

        pointsLayer = new OpenLayers.Layer.Vector("Clients", {});
        var px, py;
        var pointFeatures = [];

        for(var i=0; i< 50; i++) {
            // 50 random points roughly in continental USA
            var latMin = 30; var latMax = 50; var longMin = -120; var longMax = -50;
            py = Math.floor(Math.random() * (latMax - latMin + 1) + latMin);
            px = Math.floor(Math.random() * (longMax - longMin + 1) + longMin);
            var pointGeometry = new OpenLayers.Geometry.Point(px, py).transform(fromProj, toProj);
            var pointFeature = new OpenLayers.Feature.Vector(pointGeometry);
            pointFeatures.push(pointFeature);
        }
        pointsLayer.addFeatures(pointFeatures);

        usaBounds = new OpenLayers.Bounds(-125, 50, -60, 20);
        usaBounds.transform(fromProj, toProj);
        var box = new OpenLayers.Feature.Vector(usaBounds.toGeometry());
        boxes.addFeatures(box);
        map.addLayers([osm,pointsLayer,boxes]);

        var selectControl = new OpenLayers.Control.SelectFeature(pointsLayer, {
            hover: false, clickout: true,
            onSelect: function(feature) {
                thisFeature = feature;
                ll = feature.geometry.getBounds().getCenterLonLat();
                px = map.getPixelFromLonLat(ll);
                    // ll.transform(fromProj, toProj);

                    console.log(usaBounds.toBBOX());

                    var containsLL = usaBounds.containsLonLat(ll);
    // >>>>>>>> THIS IS ALWAYS FALSE, BUT SHOULD BE TRUE
                    console.log("Contains LonLat: " + containsLL);

                    var containsPixel = usaBounds.containsPixel(px);
    // >>>>>>>> LIKEWISE, THIS IS ALWAYS FALSE, BUT SHOULD BE TRUE
                    console.log("Contains Pixel: " + containsPixel);
                }
            });
        map.addControl(selectControl);
        selectControl.activate();

        map.setCenter(center,3);

    }); // end JQR

</script>


texts:
I am looking to split a shapefile via a line. I am interested only in the feature that lies to the right of the line; exactly what ST_SplitRight does here.

Do any of you know of a way to do this in PostGIS? After spending a couple hours searching I haven't been able to find any sort of solution.


texts: How to create tiles from tiff file using python?

texts:
I'm trying to create python script that will batch create tiles from tiff file.
Using python gdal2tiles.py -s EPSG:4326 -z 11-17 -w none tif_4326.tif I get folder with png files, but this pngs is not georeferenced. When I load tiles in QGIS for verification, they are displayed in a completely different place. What am I doing wrong? And units-per-pixel="76.43702827148438" from tilemapresource.xml looks too big, is this pixel value correct?

$ gdalinfo ~/projects/tif_4326/11/1220/1212.png

Driver: PNG/Portable Network Graphics
Files: /home/roman/projects/tif_4326/11/1220/1212.png
Size is 256, 256
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  256.0)
Upper Right (  256.0,    0.0)
Lower Right (  256.0,  256.0)
Center      (  128.0,  128.0)
Band 1 Block=256x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=256x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=256x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=256x1 Type=Byte, ColorInterp=Alpha

Original file info:
$ gdalinfo tif_4326.tif

Driver: GTiff/GeoTIFF
Files: tif_4326.tif
Size is 11418, 7692
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (34.610612291795853,31.533709086005583)
Pixel Size = (0.000015441030299,-0.000015441030299)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=820
  TIFFTAG_YRESOLUTION=820
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  34.6106123,  31.5337091) ( 34d36'38.20"E, 31d32' 1.35"N)
Lower Left  (  34.6106123,  31.4149367) ( 34d36'38.20"E, 31d24'53.77"N)
Upper Right (  34.7869180,  31.5337091) ( 34d47'12.90"E, 31d32' 1.35"N)
Lower Right (  34.7869180,  31.4149367) ( 34d47'12.90"E, 31d24'53.77"N)
Center      (  34.6987651,  31.4743229) ( 34d41'55.55"E, 31d28'27.56"N)
Band 1 Block=11418x1 Type=Byte, ColorInterp=Red
Band 2 Block=11418x1 Type=Byte, ColorInterp=Green
Band 3 Block=11418x1 Type=Byte, ColorInterp=Blue

Info for tilemapresource.xml in root folder:

<TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
<Title>tif_4326.tif</Title>
<Abstract/>
<SRS>EPSG:900913</SRS>
<BoundingBox minx="34.61061229179586" miny="31.41493042161355" maxx="34.78692576493047" maxy="31.53370908600559"/>
<Origin x="34.61061229179586" y="31.41493042161355"/>
<TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
<TileSets profile="mercator">
<TileSet href="11" units-per-pixel="76.43702827148438" order="11"/>
<TileSet href="12" units-per-pixel="38.21851413574219" order="12"/>
<TileSet href="13" units-per-pixel="19.10925706787109" order="13"/>
<TileSet href="14" units-per-pixel="9.55462853393555" order="14"/>
<TileSet href="15" units-per-pixel="4.77731426696777" order="15"/>
<TileSet href="16" units-per-pixel="2.38865713348389" order="16"/>
<TileSet href="17" units-per-pixel="1.19432856674194" order="17"/>
</TileSets>
</TileMap>


texts: gdalwarp from within python script misbehaving

texts:
I'm trying to run gdalwarp from within a python script

    start = "gdalwarp -overwrite -ts 22 20 -r average -srcnodata 99 "
    input_file = filename[12:]
    output_file = "temp1.tif"
    print start + input_file + ' ' +output_file
    subprocess.call([r'%s %s output.tif' % (start, input_file)],  shell=True )

Where filename changes iteratively (i'm batch processing and this is the first step). However when i run the script i get for example:

ERROR 4: `200301.h11v09.tif' not recognised as a supported file format.

But when i run the code on 200301.h11v09.tif in terminal it works perfectly. I feel like it's something to do with python string substitution but don't know enough to figure out myself now.

Any ideas?


texts: Change label font in ArcGIS Online or Portal

texts: We are looking to change the font for labels in a webmap we have published to ArcGIS Portal, but there is no option to change the font. Is this not possible, or is it something we need to do with the layer before publishing it?


texts: No GDAL installers for latest versions of Python?

texts:
I usually install GDAL for Python using the files in GIS Internals. Since when installing packages through pip I was made aware that Python 2.7.16 is being deprecated next year, I went ahead and installed latest Python 3.7.3. When I wanted to go ahead and install GDAL I realized that MSC.1916 is not yet available in GIS internals so I had to go back to 3.6.6 - 64 bit (which is msc. 1900) in order to install GDAL.

Does anyone know when will the latest MSCs will be available or how often are the GDAL installers are updated in GIS Internals?

All the latest 3.6.x and 3.7.x Pythons are MSC. 1915 or 1916 so I could not used them for GDAL.


texts: Placing a predefined polygon at a specific lat+long

texts:
Been a while since I played with arcpy. I have a couple of hundred shapes to add to a FeatureClass.
I'm trying to find a way to "predefine" a polygon, like a square of 10m by 20m, and then "paste" that shape at the hundreds of lat/long co-ordinates I have.
It seems that I have to start from the specified lat/long, and calculate and draw the shape around that point.
Is there not a way to "paste" a shape?


texts: Should I always be using BIGTIFF=YES as default?

texts:
I sometimes write short scripts/work instructions for colleagues who are not very skilled at GDAL / programming in general.

To prevent any problems with the scripts, when merging/converting geotiffs with GDAL, I try to just use the BIGTIFF=YES option regardless of what file sizes would be used, so that an unexpected error does not confuse the user of the script.
Are there any drawbacks to doing this?

Why isn't BIGTIFF on by default, especially nowadays where >4 GB GeoTIFF files are quite common?


texts: Spatial Index warning from Spatial Query

texts:
I'm trying a spatial query using QGIS version 3.10 using a buffer layer and a set of species records. I wish to know how many species records fall within the buffer. When I perform the spatial query by going to Vector>Research Tools>Select by Location and fill in the input layer as species records, type as intersect and comparing features to buffer layer I get the following warning: 'no spatial index for input layer, performance will be severely degraded'.
I've added a spatial index to the layer and still get the same warning occurs.
Does anyone know what causes the initial warning?
Interestingly when I try on another laptop of the same spec with the same layers it works fine.
Is there something in the settings that could resolve this issue?