texts: Using ArcObjects to search or to obtain count (IQueryFilter) from selection set?

texts:
This only appears to be an issue with Personal Geodatabases (MS Access back end)...  I need to search within an existing selection set to populate an ICursor.  My main objective is to test whether my IQueryFilter retrieves more that one record but there is no count property over the ISelectionSet using a QueryFilter just like there is over a feature class (IFeatureCLass:FeatureCount(IQueryFilter).  So in order to test whether my QueryFilter retrieves more than one record inside a selection set I am having to use the Search method  pFeatureSelection.SelectionSet.Search(pQueryFilter, True, selCursor)  using recycling cursor for speed then advancing to next row and again to next row to find out whether more that one row has been retrieved using my QueryFilter. (This feels awfully inefficient but works when not used over PGDB FC)

This works perfectly when used with file geodatabases and shapefiles (I customize the where clause accordingly based on the workspace type of the feature class) however when I do this over personal geodatabase the ISelectionSet:Search method fails. What is strange that it only fails after it has first succeeded many times prior. The queries I assign to the WhereClause of the query filter are very simple  (i.e.  "[MASTER_ID] = '56061-UNPAT-28'")

The error I am getting is "Error HRESULT E_FAIL has been returned from a call to a COM component." Err.number -2147467259

To reiterate, the very same code works fine when used with FGDB feature class and Shapefile, it's only on PGDB (Access) that it fails this way and only after it run for a while.

I ultimately need to obtain a count within a selection set that satisfies a simple query. If there is an alternate or more efficient way of doing this please share...


texts: Is it possible to "strip" unwanted/excess data from a shapefile?

texts:
So I have a dataset that contains a unique identifier, and a .dbf file that I need to join to my shapefile. This is the only field that I can do a join on.

The .dbf field is a 8-digit unique number, but the matching field in my shapefile has extra data both in front of and behind a number of rows. When I run the join, it understandably comes up blank as none of the rows match exactly.

If the problem was reversed, I would just strip the extra data from the .dbf file. Is there a way I can do that in Arc? (using vrs 10, if that matters).

Thank you!!


texts: overlay county shapefiles for 2 different years

texts:
I have county-level shapefile for South Caroline in 1880 and one for 1940.  I would like to overlay these two files so that they do the union and indicate the percentage of the land in 1880 that went to form counties in 1940.

For example, McCormick county formed in 1914.  Thus, it only appears in the 1940 shapefile.  It formed from Edgefield and Greenwood.  I want to know the percent of the land from Edgefield and Greenwood that went into forming McCormick.  For example, is it 20%, 26.4 percent or some other percent of Edgefield County land that was lost to form McCormick?

I think I should be using overlay, and then within overlay using union.

However, I do not know how to pick the tolerance.  How does that work?  In addition, I cannot at all interpret the results.  I cannot understand the columns being added and what they mean.

I am using ArcMap 10.1 within ArcGis.


texts: Generate a pyramid of tiles by 1/2 scaling a higher zoom level

texts:
Given a set of tiles covering a large area at a particular zoom level (These are online on someone's tile server and will need scraping, but let's assume these are on disk if it's easier. With TMS google style filenames)

...what is the easiest way to generate, by straightforward scaling down, a pyramid of tiles for lower zoom levels?  No need for reprojecting just 1/2 scaling.

I could write my own script to do this. Just stitch together four tiles and scale down the resulting image by half, to give you a single tile at the next zoom level. And repeat. It's almost easy enough for me to go ahead an do this, but I'm guessing it's been done before! What are the best existing tools and established approaches for doing this? It looks like I could use gdal2tiles given a single image file. I could create such a file by tile stitching e.g. with BigMap, but is there a tool (or params) which lets me skip that step?

Just to pique your interest in the question, let me tell you the fun thing I'm actually thinking of doing: The TIGER Edited Map is a really neat tool for OpenStreetMap contributors in the U.S., letting them see areas where the data has never been edited since the TIGER import (areas where more contributors are needed) but it's only generated by MapQuest from zoom level 8 and above.

It would be great (and quite easy hopefully) to generate a more zoomed out overview at zooms 7,6,5,4.  We'll be scaling the text of place names too which is a shame, but not really a big worry.


texts:
Apparently, I cannot close the csv file, so that it cannot be opened to be processed. How can I solve my problem?

I get a list (A)  from my calculations such that:

A = [[1.0,153.0016399,-27.6402685],[2.0,153.0783324,-27.4669576]]

I  want to save it as csv file in order to read it and create a shapefile from XY. Creating csv file is successful and it is saved correctly, however it can not be immediately used to create a shapefile. When I copy this csv file into another file, it works fine. I need to do it 1000 times so I cannot copy it each step. My csv file looks like:

ID,x,y
1.0,153.0016399,-27.6402685
2.0,153.0783324,-27.4669576

and here is my code:

import csv
import arcpy
def MakeXY(x):
    arcpy.env.workspace = "C:\\...\\"
    arcpy.env.overwriteOutput = True
    outWorkspace = "C:\\...\\"
    try:
        in_Table = x
        x_coords = "x"
        y_coords = "y"
        out_Layer_0 = "test"
        spRef = r"C:\\...\\Coordinate Systems\\WGS 1984.prj"

        # Make the XY event layer
        arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords, out_Layer_0, spRef)
        # Save to a layer file
        arcpy.FeatureClassToShapefile_conversion(out_Layer_0, outWorkspace)
    except Exception as err:
        print(err.args[0])
A = [[1.0,153.0016399,-27.6402685],[2.0,153.0783324,-27.4669576]]
A_header = ['ID','x','y']
writer = csv.writer(file(os.path.join('C:\\...\\', 'Mylist.csv'),'wb'))
writer.writerows([A_header])
writer.writerows(A)
f = open('C:\\...\\Mylist.csv')
f.close()
MakeXY('Mylist.csv')

and here is the error I get:

Failed to execute. Parameters are not valid.
ERROR 000728: Field x does not exist within table
ERROR 000728: Field y does not exist within table
WARNING 000725: Layer Name or Table View: Dataset test already exists.
Failed to execute (MakeXYEventLayer).


texts: Is it possible to set a number format e.g. percentage, currency, etc. of a numeric field to display in Identify Results panel?


texts: What method could I use to import *.ssf files from Trimble GPS as features to display in QGIS?


texts: Calculateg geo-hash index for bounding box

texts:
I have a set of aerial images and for each image, I have the four corner coordinates (let's say, (a1,b1), (a2,b2), (a3,b3), and (a4, b4). Thus, I know the bounding box for each image (please refer to the image below. the bounding box is in green color, while the image border is in blue color).

My objective is to store the images in a distributed database (e.g. HBase, Cassandra, Mongo) while preserving their spatial locality. So that, subsequently, I am able to perform point queries and range queries.
While there are techniques such as Hilbert Space-Filling curves to perform spatial indexing, I intend to index the bounding box of each image. So that bounding box becomes the spatial index.  This implementation provides an example of using geo-hash for point data. As my data are not point data, but 2-dimensional shapes (bounding boxes), I'd like to know a good Java (or Scala) solution, which enables the hashing of bounding boxes (for example, a library that can calculate a hash value given the coordinates of the bounding box, so that the spatial locality is preserved).
Alternative solutions, such as R-tree based indexing are also preferred. But to my knowledge, managing R-tree like data structure (a tree like data structure) in distributed environment is complex. Thus, I prefer Geo-Hash like solution.


texts: Exporting image from Google Earth Engine to ArcGIS

texts:
I'm using false colour images of Swir_Nir_Green, which are the bands of B11, B8, B3 in Sentinel-2. I want to export them from Google Earth Engine and use them in ArcGIS. Even though I'm doing exactly the same thing, the first (left) image is not what I want. The right image is the correct one. Does anyone knows why this happens?

var geometry = ee.Geometry.Polygon([[[5.549039555528434,52.56056893602342],
[5.538739872911247,52.493729732674105], [5.622510624864372,52.492475526046704],
[5.629377079942497,52.55931663656637] , [5.549039555528434,52.56056893602342]]]);

var image1 = ee.Image("COPERNICUS/S2_SR/20200316T104709_20200316T105222_T31UFU").select('B11',
'B8', 'B3').clip(geometry);
var image2 = ee.Image("COPERNICUS/S2_SR/20200303T103829_20200303T104450_T31UFU").select('B11',
'B8', 'B3').clip(geometry);

Export.image.toDrive({
image: image1,
description: "first",
scale:10,
fileFormat: "GeoTiff"
});

Export.image.toDrive({
image: image2,
description: "second",
scale:10,
fileFormat: "GeoTiff"
});


texts: Generate Near Table and keep all attributes

texts:
I am trying to calculate the angle and distance of points to surrounding polygons. The table is good and what I need but it doesn't maintain all records; the unique point and polygon IDs are not there. Is there a way to maintain those? I will need them for further calculations.

I'm using the "Generate Near Table" tool in ArcGIS 10. There are complete columns missing. I have a specific ID number assigned to each record and that column amongst others that I don't care about as much, didn't come with. The rows seem all there, I think, but not all columns. I can't join the near table with any data layer either to get that column back.


texts: Creating custom categorized symbology and coloring based on two fieldNames

texts:
I am developing a plugin in PyQGIS 3. Within this plugin, I want to change the symbology of a layer to categorized. I want to categorize based on the column Collecti_2 in PyQGIS 3. This step has been done in the first section of the code. However, when I want to give these produced categories a color based on the fieldName Color the results are colored shapefiles with a legend that contains only blue colors? This is my code:
#add National_BC_produced
layer = QgsVectorLayer(output_folder + 'National_BC_Joined3_' + str(year) + '.shp', "Collection_Systems_" + str(year), "ogr")
QgsProject.instance().addMapLayer(layer)
layer = QgsProject().instance().mapLayersByName('Collection_Systems_' +str(year))[0]

fieldName = 'Collecti_2'
fieldIndex = layer.fields().indexFromName(fieldName)
categories = []

for u in layer.uniqueValues(fieldIndex):
    symbol = QgsSymbol.defaultSymbol(layer.geometryType())
    category = QgsRendererCategory(u, symbol, str(u))
    categories.append(category)

renderer = QgsCategorizedSymbolRenderer(fieldName, categories)
style = QgsStyle().defaultStyle()

# The "magic" missing part
for index, category in enumerate(renderer.categories()):
    newSymbol = QgsFillSymbol()
    newSymbolLayer = newSymbol.symbolLayers()[0]
    data_defined = QgsProperty.fromField("Color")  # "color" is the name of the field
    newSymbolLayer.setDataDefinedProperty(QgsSymbolLayer.PropertyFillColor, data_defined)
    newSymbol.appendSymbolLayer(newSymbolLayer)
    renderer.updateCategorySymbol(index, newSymbol)

layer.setRenderer(renderer)
layer.triggerRepaint()

And these are the results:

How can I create a code which also gives the categories in the legend a same color?


texts: Fixing Edge Gaps in ML Classification of Mosaiced Landsat8 Imagery using ArcMap

texts:
I have mosaic-ed four Landsat8 images in ArcMap to cover an area over and west of Denver and Colorado Springs, Colorado:
LC08_L1TP_033032_20200406_20
LC08_L1TP_033033_20200406_20
LC08_L1TP_033033_20200429_20
LC08_L1TP_033032_20200429_20

The Mosaic appears to work well, but with a slight visible difference at the boundary between images from different dates.
When I run a Maximum Likelihood Classification on the mosaic (shown), the there is no classified output along what were the eastern and western edges bands of the pre-mosaic-ed images.  This is no problem for this project where it occurs at the westernmost and easternmost edges of my mosaic-ed image, but it results in an unclassified strip right down the near-middle of my classified output.
Any suggestions on how to fix this?


texts:
While using PostGis, we can query using EWKT format like:

SRID=4326;POINT(lon lat)

or use the functions defined by PostGis itself. For example:

ST_SetSRID( ST_MakePoint( lon , lat ) , 4326 )

I'm concerned if there are any kind of differences/preferences.

p.s. I'm sorry if it's a duplicate. I was unable to find any related threads.


texts: Arcobjects Assign projection transformation to layer file in VB.net

texts:
I want to be able to transform a layer from WGS1984 to OSGB1936. I created a tool that extracts layers from several folders on our company network folders, using check boxes that user clicks. One of the layers is in WGS1984 and when the tool brings it in, it does not transform very well. I know I need to transform it using OSGB_1936_To_WGS_1984_5. But I am not sure how to transform a layer file.

So far I have:

Private Sub CheckBox59_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox59.CheckedChanged
    If CheckBox59.Checked = True Then
        al.Add("C:\link\to\layer file\Map.lyr")
    End If
End Sub

The above adds the layer name to a array list then I use another sub to add layer to Arcmap. But how can I say "if the layer is Map.lyr then transform using
OSGB_1936_To_WGS_1984_5"

I found the code below originally written in c# and I converted into vb.net, it transforms points from WGS1984 to British National Grid, but how can I incorporate that into my layer file?

Private Shared Sub TestProjection()
    Dim factoryType As Type = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
    Dim obj As System.Object = Activator.CreateInstance(factoryType)
    Dim srf = TryCast(obj, ISpatialReferenceFactory3)

    Dim geoTrans = TryCast(srf.CreateGeoTransformation(CInt(esriSRGeoTransformationType.esriSRGeoTransformation_OSGB1936_To_WGS1984_5)), IGeoTransformation)

    Dim fromSpatialReference As ISpatialReference
    Dim toSpatialReference As ISpatialReference
    geoTrans.GetSpatialReferences(fromSpatialReference, toSpatialReference)

    Dim wgs84GCS = srf.CreateGeographicCoordinateSystem(CInt(esriSRGeoCSType.esriSRGeoCS_WGS1984))
    Dim bngPCS = srf.CreateProjectedCoordinateSystem(CInt(esriSRProjCSType.esriSRProjCS_BritishNationalGrid))
    If (wgs84GCS.FactoryCode <> toSpatialReference.FactoryCode) OrElse (bngPCS.GeographicCoordinateSystem.FactoryCode <> fromSpatialReference.FactoryCode) Then
        Throw New Exception("invalid geotransformation")
    End If

    Dim geometry As IGeometry5
    Dim point As IPoint = New PointClass()
    point.PutCoords(-3.159875, 51.465615)
    geometry = TryCast(point, IGeometry5)
    geometry.SpatialReference = wgs84GCS

    geometry.ProjectEx(bngPCS, esriTransformDirection.esriTransformReverse, geoTrans, False, 0.0, 0.0)
    point = TryCast(geometry, IPoint)
    Debug.Print("{0} {1}", point.X, point.Y)
End Sub


texts: How to select layer of .shp format by attribute using ArcPy?

texts:
I have to first load a vector layer (in .shp format) in arcmap and then it should select to specific attribute (the name of attribute is taken as input from user which i have done). and only selected attribute layer should be visible.

All this should be done using python.

So how can I do this?
I have done this code snippet

import arcgisscripting
import arcpy
gp = arcgisscripting.create(9.3)
gp.workspace = "E:\boundary"
sFile = "E:\boundary\sample.shp"
lyr = "layer"
gp.makefeatureLayer_management(sFile, lyr)
gp.toolbox = "management"
gp.SelectLayerByAttribute_management("layer", "NEW_SELECTION", " 'DNAME' = 'NAME' ")

#now zoom to selected feature
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()

but it is throwing an error
Runtime error  Traceback (most recent call last):   File "", line 7, in  ExecuteError: ERROR 000732: Input Features: Dataset E:oundary\sample.shp does not exist or is not supported.


texts: How to change visibility of a particular layer category in PyQGIS?

texts:
I've got one layer with its symbol MARKER, categorized by an expression in 4 colors. The colors depends on a value of a column. So from the TOC, I'm able to click and enable/disable, as they were different layers, and show one category a time.

From python script, I want to do the same, with a loop: show/hide in the map the different existing categories one each time (for printing separated the 4 jpg),

I tried to show the active layers, and categories aren't not showing as a proper layer. So, I thought that the proper layer was a group tree, but when I ask for QgsLayerTreeGroup always show no group.

How can I obtain categories for changing their visibility in the map?

root = QgsProject.instance().layerTreeRoot()
for child in root.children():
    if isinstance(child, QgsLayerTreeGroup):
       print "- group: " + child.name()
        if child.name() == "rara": #to check subgroups within test group
            print "rara"
            for subChild in child.children():
                print "child"
                if isinstance(subChild, QgsLayerTreeGroup):
                    subChild.name()
    else:
        print "no group: " + root.name()


texts:
Sorry for the inflammatory title, Yes, I know these cannot be added.

Problem: I have a vehicle that is reporting LL84, coordinates. It has a sensor that reports footprints of obstacles (LineString, Polygons, etc.) and the vertices are expressed as a meter/centimeter displacement from the sensor. I would like to use the GPS as the orgin, add a displacement to the sensor, and then offset the LineStrings and Polygons to result in vertices that are in LL84. Why? I want to plot them with Leaflet as a GeoJSON layer.

My initial thoughts are to convert the GPS LL84 to UTM, and then compute the absolute values for the vertices, then convert all the vertices back to LL84 (EPSG3857), Web Mercator, so that the Leaflet base maps work properly.

Is this the best way to do things?

Here are some of the constraints I am under

This is an add-on to existing code written in C#, DotNet, So I have
to use libraries such as DotSpatial
The displacements to the objects are going to be less than 100-200 meters, so it is unlikely to go into the next zone or band of UTM
However, if would be nice to deal with those cases, too, and that is looking to be messy
I would like as much accuracy as possible, so the less translation the better, it would also help to cut down time, (latency could be an issue)
I know that GeoJSON is supposed to support alternative CRS, but I don't think that Leaflet can handle things other than LL84 coordinates in the GeoJSON

Any better suggestions of approach, libraries, etc?


texts:
I took some points with a GPS, and I'm trying to convert from GCS to OSGB 1936 British National Grid in SAGAGIS. I'm working with a shapefile. To reproject the vector layer to the OSGB projection I have used Proj. 4 (Command Line Arguments, Shapes).

Once the vector layer is reprojected, I loaded a .tif image to check that the projected points lie in their correct places. I set its projection using Proj.4 --> Set Coordinate Reference System.

However, when I try to overlay layer with the image, and the shapefile with the re-projected data, I can't overlay properly, and only appear the layer with the gps points but not the image.

How can I overlay those two properly in order to check that the points are in the adequate place?


texts: Calling Google Earth Engine scripts using Python?

texts:
I have some scripts in the Earth Engine Code Editor.

Is it possible to call these scripts remotely using Python API?


texts: Open source solutions for Landsat-8 mosaicing and correction?

texts:
I am familiar with the major commercial remote sensing packages (ENVI, IDRISI ERDAS, etc), but I haven't previously had the opportunity to utilize open-source solutions.

I have a several new Landsat-8 images that I would like to mosaic for both simple display and analysis (land cover classification). Is there a go-to open source software for this, or are there many options? A tutorial would also be excellent.


texts: Why does ArcGIS Desktop 10 say "ArcInfo is not authorized" after saying "your software has been authorized"?

texts:
Here is my sequence of actions:

Install ArcGIS Desktop 10.0.0.2414
Start ArcGIS Administrator application
Click "Desktop"
"ArcInfo (Single Use)" option is automatically chosen and I am unable to change it to ArcView or ArcEditor. My code is supposed to be for Basic version though.
Click "Authorize Now..."
Select "I have installed my software and need to authorize it"
Select "Authorize with ESRI now using the Internet"
Enter address; organization, industry, specialization
Enter authorization number into ArcInfo Single Use field (ESUXXXXXXXXX).
Select "I do not want to authorize extensions at this time."
See "Authorizing software..." progress bar
See success message:
"Congratulations, your software has been authorized and is now ready for use."

Then I try to launch ArcInfo, ArcMap, ArcGlobe, ArcCatalog or ArcScene and all give me the following error: "ArcInfo is not authorized for use."

Do you know why this happening?
And what would you recommend me to do?


texts: How can I get a blurred Hillshade effect in QGIS?

texts: Does anyone know how to achieve this blurred hillshade effect in QGIS? This one was produced by a former colleague and I can't find a way to replicate it. More specifically, what I can't achieve is that blurry effect.


texts: Which interfaces/classes do I use to access the highlighted rows in an ArcMap attribute table?

texts:
I've tried to use various interfaces to access SelectionSet of table windows/tables but all I get back is the selected records (cyan).  I want the highlighted rows/features (yellow).

I would like to 1) programmatically specify the highlighted row/feature and 2) programmatically access the highlighted rows(s).

I saw some old examples on the old Esri forums where the yellow feature was manually being drawn on the map, but surely there's a way to access in ArcGIS 10?


texts: Node Table requried - Per node identyfication of what edges intersect here. (This are roads from open street map)

texts:
Having around 2000 rows with multiline string coordinates I am implementing code to see where they intersect.

0       MULTILINESTRING ((-2.50909 53.07879, -2.50867 ...
1       MULTILINESTRING ((-2.49312 53.06901, -2.49269 ...

code:

from shapely.geometry import *
import geopandas as gpd
import pandas as pd
import matplotlib.pyplot as plt

sample = gpd.read_file('cleaned_links_v2.geojson')
df = sample['geometry']
line_gdf = sample.iloc[0:2000]
ma = line_gdf.geometry.apply(lambda g: line_gdf.intersects(g))

ma

That code gives me a matrix where I have True or False weather 2 lines are intersecting with each other.

    0   1   2   3   4   5   6   7   8   9   ...     1990    1991    1992    1993    1994    1995    1996    1997    1998    1999
0   True    False   False   False   True    False   True    False   False   False   ...     False   False   False   False   False   False   False   False   False   False
1   False   True    False   False   False   False   False   False   False   False   ...     False   False   False   False   False   False   False   False   False   False
2   False   False   True    True    False   True    False   True    False   False   ...     False   False   False   False   False   False   False   False   False   False
3   False   False   True    True    False   False   False   False   False   False   ...     False   False   False   False   False   False   False   False   False   False
4   True    False   False   False   True    False   True    False   False   False   ...     False   False   False   False   False   False   False   False   False   False
...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...
1995    False   False   False   False   False   False   False   False   False   False   ...     False   False   False   False   True    True    False   False   False   False
1996    False   False   False   False   False   False   False   False   False   False   ...     False   False   False   False   False   False   True    False   False   True
1997    False   False   False   False   False   False   False   False   False   False   ...     False   False   False   False   False   False   False   True    True    False
1998    False   False   False   False   False   False   False   False   False   False   ...     False   False   False   False   False   False   False   True    True    True
1999    False   False   False   False   False   False   False   False   False   False   ...     False   False   False   False   False   False   True    False   True    True

I would like table where per Node (intersection) I got list of all edges that are intesecting here. Count of them would also be good.

something in any form of following:
    Node ID 1 |  Edge 1 | Edge 2 | Edge 7 | count = 3

I got now

import shapely

L1 = MultiLineString(df[2])
L2 = MultiLineString(df[2])
print(L1.intersection(L2))

So I can get coordinates of intersection


texts: Writing arcpy.ArcSDESQLExecute connection string for Oracle?

texts:
When using arcpy.ArcSDESQLExecute, I was trying to debug why a sql statement was not working and throwing an error. I thought the sde connection file that I was passing might be the problem because I was attempting to access an Oracle database that was not Esri spatially enabled. The documentation had a couple examples of passing database identification strings to create the connection versus using the sde file, but it was unclear, in particular for the set of strings to pass for an Oracle connection. Does anyone have an example for Oracle?

(FYI, The errors passed back from arcpy.ArcSDESQLExecute can be cryptic. I don't know why the database error message doesn't come back. For example, "AttributeError: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -37 \uf61c" )" seems to equate to "ORA-00942: table or view does not exist".)


texts:
I have slope values derived from a DEM which I reclassified into NoDATA and vaules which I need. Then I made a polygon from this raster.

I need to do intersection or something like that with the polygon shapefile of administrative units(towns) and I need to find out which town has potential for the building of a downhill course.(that's why i use slope > 10°) But I need to preserve the shape of the town polygons. When i use arcpy.Interscet its just geometry and the result was just common for both polygons. So maybe i dont need intersect but something similar.


texts: Advanced Digitizing Error CAD tools are not enabled for the current map layer

texts:
Using QGIS 2.8.4.
I want to use the Simplify function so turn on the Advanced Digitizing menu. The panel displays an error "CAD tools are not enabled for the current map layer" and the error message doesn't seem to seem to change with whatever map tool I choose.
I had a read of QGIS documentation and looked for other instances on the web, but can't figure out what to do. QGIS experience is fairly basic so may have overlooked something obvious. Can anyone provide some guidance on how to turn on and use the Advanced Digitizing menu?


texts: Is there any way to set a processing extent for QGIS:Voronoipolygon?

texts:
I was playing around with the QGIS:voronoipolygons command line function from QGIS and noticed that there was no option for setting the processing extent. This causes QGIS to pick the minimum extent i.e. the voronoi calculation stops at the south/north/west/easternmost points.

However, I need this boundary to extend beyond this point. For this I need to set the processing extent. Does anyone know if this is possible within Qgis?


texts: Merge adjacent polygons & concatenate attribute values (QGIS)

texts:
In QGIS 3.16.  I have a layer of 1000+ polygons, many of which are adjacent (touching, overlapping, or one completely inside another).  If all of the adjacent polygons are merged, I will end up with between 100 and 200 (larger) polygons.
I would like to accomplish this in a way that preserves all of the attributes for all polygons, for example:

For polygons being merged: values for attribute X are concatenated for the resulting polygon.  (Example: For attribute 'status', Polygon A has value "IC" and Polygon B has value "NC".   If these two polygons merge into Polygon AB, I would like the corresponding value of attribute 'status' to be "IC, NC".)

For polygons not being merged (i.e. isolated ones without an adjacent neighbor) there is no change to their attributes.

This seems like a fairly common task that it should be possible to accomplish, but my searches have been fruitless thus far.
I'd like to stay within QGIS if possible (I have never used PostGIS before).  If your answer involves SQL or Python, please consider that I am learning these now but an absolute beginner, so I will not understand code without context.


texts: How to calculate corner coordinates of static Google Map image using PHP?

texts: How can I calculate the corner coordinates of a static Google Map image, like the one fetched with this URL, using a little PHP script?


texts:
I use personal geodatabases to hold all the data for my projects (probably around 10-20 feature classes across 2-4 datasets on average).  I use the personal gdb because I like being able to hook into it through other MS Office products and use mail-merge for reports and access for pivot tables etc etc.  Also, ArcGIS 10.1, Windows 7, data located on a network drive.

Over the last few months I have been automating all my boring tasks using arcpy and am noticing some substantial bloat in my databases after I run certain tools (from a python toolbox, not esri stock tools).  For instance, this morning I ran the script that iterates through each polygon in a feature class, selects all the features that are inside of them, sums their [COUNT] fields and then uses CalculateField_management tool to write that sum to a field in the polygon attribute table.  There are roughly 2500 records in the polygon field, so about 2500 iterations, selecting 1-5 records from 6-7 feature classes during each iteration.  When the operation completed, my gdb had bloated up to 2.0 GB (yes, the magic 'now nothing will work' number).  After I ran a simple 'Compress Database' in arcCatalog the size dropped to 32MB.  That's a decrease of 98.5 percent, which seems egregiously huge.

So, my question is: Is that a normal amount of shrink/swell for a personal geodatabase or am I doing something wrong?  Further, if I am doing something wrong, what strategies can I employ to fix it?  Would there be significant performance benefits to using a file geodatabase instead of a personal?

Lastly, I am becoming increasingly aware that the bulk of what I am doing in arcpy could be more easily accomplished using SQL in a more robust database environment...  Is it time to take the plunge and start learning about PostgreSQL?


texts: Restrict WMSLayer (not map) extent with ArcGIS JavaScript API

texts:
Is there a way to restrict the rendering of a WMSLayer to a specified extent without restricting map panning and zooming? That is, I need the client to be able to pan outside the limits of the WMSLayer, in which case only the basemap should be displayed.

The WMS Server is external and outside of my control.

I would prefer to find a solution, if possible, that does not hide the WMSLayer completely. The users should be able to see the extent limits of the WMS Service.


texts: Difference between Make Feature Layer (Data Management) and using in_memory workspace?

texts:
I was wondering the difference is between Make Feature Layer (Data Management) and using an in_memory workspace?

To me, one can use either to do some steps in memory, instead of writing data to a location on disk or a network location, and expedite the process.


texts: Adding error message to parameter if seperate derived multivalue parameter is empty using ArcGIS tool validation?

texts:
I have three tool parameters;

an input point feature class,
a (multivalue) list of fields derived from the input feature class and
an output file location to export to Excel.

I have filtered the fields derived from the feature so only Short, Long, Float, Double, Text and Date types are accepted. I would like to set the tool validation so that if a point feature class is selected that doesn't contain any fields of said types, an error message will show by the input point feature class parameter. The below code shows where I am at currently however does not present an error message.

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

if self.params[0].altered and str(self.params[0].value) != "":
  if not self.params[1].value:
    self.params[0].setErrorMessage("The selected feature class does not have any fields. Please check and try again.")
  else:
    self.params[0].clearMessage()
return


texts: Using SQL Server 2008 with ArcGIS Server 10.5?

texts:
I can't publish data from SQL 2008 Server/Database to our ArcGIS Server 10.5.1. Actually, I can't even register that database at all. Error message is below.

Our ArcGIS Server, 10.5.1, has few other databases register to it, which are on 2016 SQL Server. I can publish data from it. The server has both Microsoft ODBC drivers, 13 and 11. I have installed driver 11 just now to see if it fixes the problem but it did not seem to do it.

Has anyone been able to register both,  2008 and 2016 SQL Server databases, and  publish from both?

How do I register 2008 SQL Database to the server?


texts:
I am using ArcMap 10.2.

I want to create a land information system, one of the features attribute data includes a citizen id field, it includes 11 digits, for preventing wrong value entering, i want to limit the digit number, so the operators can not enter more than 11 digit in the field of attribute table.


texts: Limiting the search widget results to a country in ArcGIS JS API 4.9

texts: I'm using the Search widget in the 4.9 version of the javascript API. Can I limit the results to a given country when using the default geocoding service?


texts: How to compile or find PHP MapScript (MapServer) latest version for Windows?

texts:
I had major performance difficulties with MapServer version 6.0.3 (MS4W 3.0.6) and need latest version of MapScript but I can't find it for Windows.

Anybody can help me to find latest compiled (binary) of MapScript(PHP) or compile it from source for Windows?


texts: Temporal analysis in GIS - Tool to identify the jump points

texts:
I'm searching for a tool that help to analysis spatial temporal data in GIS.

This is my problem:

I have a database with a set of 170 georeferenced ovitraps (traps to catch mosquitoes eggs) with the eggs values collected byweek.

The values of the eggs collected in each ovitrap, vary widely from one week to the next, according to the time of year. But these changes are not equal in all ovitraps, because they have different locations and so they are locate in different microclimates.

My aim is to identify in each week which are ovitraps that have the highest jump values.

To better understand how are my data, I leave down a image.

The rows are the ovitraps and the columns are the weeks.


texts: Clipping polygon precisely to raster (extent) using GDAL?

texts:
I need to clip a vector layer to the extent of a raster. It has to be very precise that's why I would not want to draw a polygon myself (and clip the two polygons). There seem to be some ways to clip a raster to a polygon but I have difficulties to find a solution to clip a polygon to a raster. I already tried to create a polygon out of my raster several times in ArcGIS and R, so I could clip the result. But every time it crashes because the raster is to big. There must be a simple way to solve this, and somehow I can just not see it at the moment.

How can I do this using GDAL?


texts:
I'm very confused by this one. I have run a polygon neighbors analysis in ArcGIS 10.2 and appended some data from another table to help me whittle down the neighbors list before my next action. So I have the following:

bn = "BLPUs_PolygonNeighbors"
arcpy.MakeTableView_management(bn, "Neighborscut")
arcpy.SelectLayerByAttribute_management("Neighborscut", "NEW_SELECTION", where2)
arcpy.SelectLayerByAttribute_management("Neighborscut", "SUBSET_SELECTION", where1)
arcpy.SelectLayerByAttribute_management("Neighborscut", "SUBSET_SELECTION", where3)
arcpy.Delete_management(bn)
arcpy.CopyRows_management("Neighborscut", "BLPUs_PolygonNeighbors")

But when I run this, it says ERROR 000733: Output Table: Same as input C:\Users\Ant\Documents\ArcGIS\ITN.gdb\BLPUs_PolygonNeighbors
Failed to execute (CopyRows).

Which seems to suggest it thinks "Neighborscut" is actually also called "BLPUs_PolygonNeighbors"

Any ideas??


texts:
I can't work out how to create a print layout directly from a map theme - even though the QGIS 3.10 manual says "All configured themes are also accessible in the print layout, allowing you to create different map items based on specific themes."
Anyone know how?


texts: Cut polylines at intersections in QGIS (or how many km road for each country)

texts:
I want to measure how many km a road stand on each country it intersect (i.e. how many km of the european road "E45" stand on Italy, Austria, Germany, and so on).

I have a polyline-shapefile with the "road" and a point-shapefile with the intersections of the "road" with the "nation-borders".

1) How I can cut automatically the road on each point?

2) How I can measure the distance on road between two consecutive point?

I'm trying to do it with QGIS.

Thanks,
ge.Ko


texts: Find most NW, NE, SW, & SE coordinates from a group of long/lats

texts:
I have a list of 900-1000 longitude/latitude coordinates. I know and can depend that these coordinates form a rough rectangle. Is there a formula to determine which coordinates are at the corners (NW, NE, SE, SW)?

Is it correct to say that:

the coordinate with the largest lat and smallest long is the most NW?

and thus

the smallest lat and largest long is the SE corner?
the smallest lat and smallest long is the SW corner?
the largest lat and largest long is the NE corner?

The points I am dealing with are gathered by a drone flying a rectangular  area approximately 100 sq meters. It crosses the entire included area of the rectangle in rows columns type fashion (snaking back and forth) and could start in the middle of the rectangle or at a corner or anywhere within the area.

Here is what I ended up with, if all corners are right angles you can look at lat/long in same if/then statement but if it is trapezoidal (non rect or square) you have to check the lat/long in separate if/thens

let NW = {
  name:"NW",
  lat:-90,
  long:180
};

let NE = {
  name:"NE",
  lat:-90,
  long:-180
};

let SW = {
  name:"SW",
  lat:90,
  long:180
};

let SE = {
  name:"SE",
  lat:90,
  long:-180
};

imggps.forEach((img)=>{

  // the coordinate with the largest
  // lat and smallest long is the most NW?
  if(img.lat > NW.lat){
    NW.lat = img.lat;
  }
  if(img.long < NW.long){
    NW.long = img.long;
  }

  // the largest lat and largest
  // long is the NE corner?
  if(img.lat > NE.lat){
    NE.lat = img.lat;
  }
  if(img.long > NE.long){
    NE.long = img.long;
  }

  // the smallest lat and smallest
  // long is the SW corner?
  if(img.lat < SW.lat){
    SW.lat = img.lat;
  }
  if(img.long < SW.long){
    SW.long = img.long;
  }

  // the smallest lat and largest
  // long is the SE corner?
  if(img.long > SE.long){
    SE.long = img.long;
  }
  if(img.lat < SE.lat){
    SE.lat = img.lat;
  }

});


texts:
Setting

For the purpose of a machine learning algorithm I'm tying to automatically scale images of arbitrary bitdepth to unit interval, i.e. I want to map pixels from [0,2x] to [0,1] simply by dividing all pixels by 2x. I want to do this without knowing anything about the pixelvalue distribution or statistics inside the image. The only thing that I know is the metadata. To open images I use gdal in python via

data = gdal.Open(path)

The images are given in .tif or .img format.

Problem

Typically 12bit images will be saved in a 16bit format, where pixel values above 4095 won't occure. Nevertheless the meta tag bitdepth will be 16bit.

Question

Is there any valid way to check whether an image is a true 16bit image or a 12bit image inside a 16bit image, without calculating the statistics? Is there any meta tag that serves this information?


texts: Exporting images day by day in a short way

texts: I have a question about the GEE. I need to export the Sentinel 5p images day by day. I don't know very well the GEE. I found how can plot the day of year chart but i also need the images.


texts: Interpreting the geom_way in the table created using osm2po

texts:
Possible Duplicate:
  Issues while plotting the results of pgRouting shortest path

I am trying to actually figure out what this column exactly represents and how to use that in my case. I created a network topology and persisted it to postgresql database using osm2po tool for a certain region. Now I am using pgrouting on it to find the shortest route. I am not sure how this column is used by qgis to display the route. It's just a bunch of number, how can I use it in my case?

I am actually using gpx format file to transfer the shortest path. How can I exploit this geometry and send that information in gpx so that it is displayed nicely.


texts: Setting raster cell value to null if below threshold value in ArcPy?

texts:
Why is my ArcPy script in ArcGIS 10.1 failing to set null cell values below three standard deviations beyond the mean?

import arcpy, sys, os

#Accept input and output raster
inRas = sys.argv[1]
outRas = sys.argv[2]

#Pull mean and standard deviation from input raster
meanie = arcpy.GetRasterProperties_management(inRas, "MEAN")
meanres = meanie.getOutput(0)
meanfloat = float(meanres)

stdev = arcpy.GetRasterProperties_management(inRas, "STD")
stdres = stdev.getOutput(0)
stdfloat = float(stdres)

#Calculate threshold value
threshold = meanfloat + (3 * stdfloat)
threstring = str(threshold)

#Create where clause
whereClause = "VALUE < " + threstring

#Test output
arcpy.AddMessage (whereClause)

#Run SetNull
outRas = arcpy.SetNull(inRas, inRas, whereClause)

This results in the following error:

Traceback (most recent call last):
File       "Z:<directory-redacted>\Nullify.py", line 27, in <module>
outRas = arcpy.SetNull(inRas, inRas, whereClause)
AttributeError: 'module' object has no attribute 'SetNull'

Failed to execute (Nullifiy).


texts: getFeatureInfo in OpenLayers using text/javascript returns unselectable popup

texts:
I am trying to make a getFeatureInfo request (OL4) and display a popup with data, that come from a geoserver layer.

Initially I did this:

map.on('click', function (evt) {
          var viewResolution = map.getView().getResolution();
          var coord = evt.coordinate;

            if (grid_layer.getVisible() && grid_layer.get('name') != 'Basemap') {
              var url = grid_layer.getSource().getGetFeatureInfoUrl(coord, viewResolution, 'EPSG:3857', {
                  'INFO_FORMAT': 'text/html',
                  'FEATURE_COUNT': '2',

              });

              if (url) {
                  $("#popup").css("display", "block");
                  popup_overlay.setPosition(coord);
                  content.innerHTML = '<iframe src="' + url + '" id="id_iframe" style="border:0px #BD8D46 dotted;" scrolling="auto" frameborder="no" align="center"></iframe>';
              }

            }
        });

I take care of the style using the *.ftl styling method on geoserver. This works more or less ok but it also creates a blank popup when I click anywhere on the map.

I checked online and I found some other solution, which I try to implement below:

map.on('click', function (evt) {
          var viewResolution = map.getView().getResolution();
          var coord = evt.coordinate;

            if (grid_layer.getVisible() && grid_layer.get('name') != 'Basemap') {
              var url = grid_layer.getSource().getGetFeatureInfoUrl(coord, viewResolution, 'EPSG:3857', {
                  'INFO_FORMAT': 'text/javascript',
                  'FEATURE_COUNT': '2',

              });

              if (url) {
                var parser = new ol.format.GeoJSON();
                console.log(parser)
                $.ajax({
                      url: url,
                      dataType: 'jsonp',
                      jsonpCallback: 'parseResponse'
                    }).then(function(response) {
                      var result = parser.readFeatures(response);
                      if (result.length) {
                        console.log(result)
                        var iso3 = [];
                        for (var i = 0, ii = result.length; i < ii; ++i) {
                          iso3.push(result[i].get('iso3_all'));
                        }

                        $("#popup").css("display", "block");
                        popup_overlay.setPosition(coord);
                        content.innerHTML = iso3.join(',');
                      }
                    });
              }
            }
        });

Although this solution seems to work initially, I can not actually select the content of my popup window. It's not selectable (not possible to copy paste it etc.)

For example in the below screenshot the text of the popup is is selectable:

I am not sure why this is happening and if its related with the CSS of the popup but I haven't changed something in relation to the first snippet. Also when I interact with the application (zoom and click), I get the following error. Maybe it somehow related.:

parseResponse is not a function


texts: Collecting direction of taken photo in ArcGIS for Collector?

texts: Just wanted to know if it is possible to collect the direction of taken photo in Collector ? Obviously, I would like to know which direction i'm facing (North, east south, west) when taking the photo. If not what is the workaround for this ?


texts: How to pythonically set a symbol as an ascii character (Font Marker) in QGIS

texts:
I need to set a point on a map as an ASCII symbol with python.

I'd like to do this in a rule based renderer.

something like:

rule.setSymbolAsFontMarker("✫")

So I'd have something like this in my existing code:

renderer = QgsRuleBasedRendererV2(symbol)
root_rule = renderer.rootRule()
rule = root_rule.children()[0].clone()
rule.setSymbolAsFontMarker("✫")
rule.setScaleMinDenom(70000)
rule.setScaleMaxDenom(1000000)
root_rule.appendChild(rule)
## delete the default rule
root_rule.removeChildAt(0)
## apply the renderer to the layer
layer.setRendererV2(renderer)

Any guidance is welcome!


texts: Geostatistics in SAGA: Strange variogram output

texts:
I'm verry new to geostatistic. I'm using variogram to visualize a data (available in .shp here). Then I got the data like this or from this link (updated zip files contains shp, shx, prj, mshp, dbf, cpg). The sensor value is in the column value (air pollution concentration).

The shapes look like "inverted" from the common variogram shape. Is it violating any law? Or is there another type of data that has variogram like that?
Update:
Steps

csv data contain lat, lon, physical value (eg temperature). the data is taken in the morning from several days
import to SAGA GIS, projecting to wgs72 to get meter unit
geoprocessing > spatial and geostatistics > variogram
scatter plot variance vs distance. there are also option of var. cum in the program


texts: How can you completely cover the surface of a raster with circles where the radius of the circle is the raster value at its centroid?

texts: This is more of an algorithmic/math problem, but I was wondering if someone could point me in the right direction. There's the common problem of covering a surface with circles of equal sizes, but what about UNEQUAL sizes? Where circle size depends on where it's placed? For example, let's say I want to cover California with circles, circle radius = elevation of where it's placed.


texts:
I have written many Python scripts using ArcPy in ArcGIS 10, and so far my only means of debugging is restricted to printing messages to the geoprocessing results window using arcpy.AddMessage().

Are there any other options out there, such as setting break points?

Jason's method works great. If you have a bug in your toolbox, such as validation, your IDE probably won't be able to pinpoint the problem because toolboxes are encoded. At least WING wasn't able to pinpoint it.


texts: Creating polyline segments by points in maximum distance to each other along another polyline using QGIS

texts:
I have

a polyline layer contains different roads
a point layer contains points along these roads with random distances between the points. The points are also listed randomly and not in order along these roads.

I want to connect with polylines the points along the roads which are close each other at a maximum (e.g. 35.0 m) or smaller distance. Any suggestion how to work these out?

The roads turn even to 180° at some points (as shown in the attached figure) and the distance between the roads can be smaller than 35.0 m.

My ultimate purpose is to get the road segments where the points are distant in maximum 35m.

I use QGIS version 3.10.1-A Coruña


texts: Opacity contrl for mapbox map with several layers

texts:
This is an example of how opacity can be changed for a Mapbox.JS map:
https://www.mapbox.com/mapbox.js/example/v1.0.0/opacity/

The example shows only one layer used.

With barely any experience in JavaScript, h*ow would I go about changing the opacity of the active base layer, if I have multiple of them?*

I have this now:

 L.control.layers({
    'Name of layer': L.tileLayer('/tiles1/z{z}/{y}/{x}.png').addTo(map),
    'Name of other layer': L.tileLayer('/tiles2/z{z}/{y}/{x}.png')
    }).addTo(map);

How to correctly set the variable to the selected layer?


texts: Splitting, disaggregating, breaking up a merged raster file

texts:
I am using ArcMap 10.4.1 but I am also more than familiar with QGIS.

I have a raster file (single band) from a merged grid on population statistics for Europe (please see image attached). The red cells represent on the scale 1000 x 1000 meters populated areas with a specific count, the black values represent 0 values. These are two separate raster files so far, however they're perfectly aligned meaning there are no overlaps.

I would like to compute the population potential for the grid, meaning the count of population in a certain area. Therefore, I need the 0 values also as 1000 x 1000 m raster file.

Currently, the 0 values are 1 grid with a 1000 x 1000 m resolution but no 1000 x 1000 m single tiles as I would need them.

Is there a way to "break up", "split-up" or "disaggregate" the 0 value raster file into individual cells of 1000 x 1000 m without creating an individual raster file for each cell?

The 'Split' tool does not create the output that I like, as it separates the raster into multiple files.


texts: How to display a image from Postgres database?

texts:
I have Images in bytea form in PostgreSQL/PostGIS database, I want to display them in a webpage using PHP - PostgreSQL.

I have a lot of examples that have worked out but I am not getting output from them...

Few codes I have used.

$conn = pg_connect("user = postgres password = nkr@123 host = localhost dbname = ARKREJ");

    $res = pg_query($conn, "SELECT photo FROM public.zdata_4326, public.zdata   WHERE zdata_4326.gid = zdata.gid AND zdata.gid = 1;");

        if (!$res) {
            echo "An error occured at result.\n";
            exit;
        }

        if($res) {
            $Row = pg_fetch_row($res, '0');

            $Object = pg_locreate($conn);
            header("Content-Type: image/jpg");
            $File = pg_loopen($conn, $Object, "r");
            pg_loreadall($File);
            }
        else {echo "The query failed!?! There is no row with id=1!";}

Another one

display.php

$conn = pg_connect("user = postgres password = nkr@123 host = localhost dbname = ARKREJ");

    if (!$conn) {
        echo "An error occured.\n";
        exit;
    }

    $temp = "C:/Program Files/OSGeo/MapGuide/Web/Apache2/htdocs/tmp.jpg";

    if (!$temp) {
        echo "An error occured at temp.\n";
        exit;
    }

    $result = pg_query($conn, "SELECT (photo, '$temp') FROM public.zdata_4326, public.zdata WHERE zdata_4326.gid = zdata.gid AND zdata.gid = 1;");

    if (!$result) {
        echo "An error occured at result.\n";
        exit;
    }

        if ($result)
            {
                While ($line = pg_fetch_array($result))
                {
                    $ctobj = $line["photo"];
                    echo "<IMG SRC = show.php> </br>";
                }
            }
        else {echo "File does not exists"; }

show.php

<?
header("Content-type: image/jpeg");
        $jpeg = fopen("C:/Program Files/OSGeo/MapGuide/Web/Apache2/htdocs/tmp.jpg", "r");

        $photo = fread($jpeg, filesize("C:/Program Files/OSGeo/MapGuide/Web/Apache2/htdocs/tmp.jpg"));

        echo pg_unescape_bytea($photo);
    ?>

Can anyone please help me from this?


texts: Displaying a graphic layer derived from an arcgis server geoprocessing task on a webapp map

texts:
I know this should be basic.... but I am trying to get an ouput from a arcgis server geoprocessing task of data type "GPFeatureRecordSetLayer" to be added into a map on a webapp. here is the code (the " in the http is to break the link):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

as far as I can tell it gets the results fine but for whatever reason the map.graphic.add(feature); line crashes the code.

the onTaskSuccess function is modeled after a tutorial found here:
https://developers.arcgis.com/javascript/jssamples/gp_viewshed.html


texts: Exporting Large (30 million row) Attribute Tables

texts:
I'm attempting to export an attribute table that contains 30 million rows (with 10 columns) to a .txt file. I've been able to export smaller portions of it (e.g. selecting and exporting the first 100 records), but the sheer number of rows slows the export process to a crawl or just crashes it.

Clarification: I have a raster that covers about 90% of Venus with ~4 km resolution, and I need to extract the latitude, longitude, and pixel value for each pixel. I thought the best way would be to use Raster to Point, then Add XY Coordinates, and export the table of the resulting shapefile. If there's a better way, I'd love to learn!

Using the ArcPy script described in the answers worked on a similar, but smaller shapefile (~10% of Venus, same resolution), but when run on the larger shapefile of 90% of Venus, the IDLE shell quit without warning after an hour of running. Any ideas of what caused/could prevent this?


texts: Remove overlaping vertices in lines - QGIS

texts:
I am currently working with data that has a huge amount of topological errors. These are lines that are closed, in the place where the beginning of the line meets the end, someone added more than 2 vertexes. That causes all problems. There are too many features to correct them manually.
I've tried clean, but it doesn't work as I expected. Is there any way to remove these overlaping vertices in lines and correct topology in QGIS or GRASS?


texts: Define polygons with structured data points

texts:
I am doing image processing and I get some scatter points (blue) now, filled with random points (red) on it.

I want to find the random points lay inside scatter blue circles. So I tired  with MATLAB but cannot do it successfully, as shows.

So my idea is first define all the polygons based on scatter points (hand-draw with black), then use  algorithm. Now I just cannot find a way to define these black polygons. Any suggestion?


texts: How to use create Space-Time Cube tool for street network?

texts:
I have a dataset that contains a street network (line geometry) and the number of related crashes incident (point geometry). To generate a Spatio-temporal dataset to detect space-time patterns, each row in the dataset is considered as a street on a day of the month (Street_id column e.g. 73 refers to the 7 street on the 3rd day of the month). Besides, the crash_number column stores number of crashes for each street in a day.

I want to create Space-Time Cube (https://pro.arcgis.com/en/pro-app/latest/tool-reference/space-time-pattern-mining/create-space-time-cube.htm) to detect Space-Time Pattern in my dataset.
This tool only accepts point data as input, but my dataset has line geometry (streets in a day of the month). Is there any idea for preparing my dataset to use this tool to explore space-time patterns?


texts: Storing shapefile inside geodatabase using ArcMap?

texts:
Is there any way one could store a shapefile inside a geodatabase?

I understand they are two databases from two different times but I recall seeing this done in the past and am curious about how one could replicate it.


texts: Converting DEM into areas of "flatness", with arbitrary fill/cut to area ratio?

texts:
I want to find areas of relative "flatness" in a DEM.

How can I find flat areas?

I want to find a neighbourhood of contiguous cells that have an elevation variance that is within a certain tolerance threshold.

I can use the ESRI suite of tools, or any open source GIS.


texts:
I'm using a geoserver and openlayers3 with html. I cannot find the way to obtain the child layers from a layer group. I have a layer group, and I show it in html perfectly, but what I want is to be able to access their children layer, in order to print a checkbox for each one to be able to choose if I want to hide or show each one. I don't know if it's possible, and if so, if I have to make a call using the geoserver to get the layers and then make the call to print them, or it is some method inside openlayer.

The code to print the layer group:

new ol.layer.Group({
    title: 'layer1_group',
    layers: [
      new ol.layer.Tile({
        title: 'layer1_group',
        source: new ol.source.TileWMS({
          url: 'http://testestest:8080/geoserver/geo.test/wms?service=WMS',
          params: {'LAYERS': 'layer_group_3layers'},
          serverType: 'geoserver',
          crossOrigin: null
        })
      })
    ]
  })

layer1_group: contains 3 sub layers. Those three are what I want to print separately.

So now I print only the layer group with the children all together, as the shown image:

And what I want is to print the children separate:


texts: [mapserver]: layer filtering with layerObj.setFilter()

texts:
I'm trying to filter a layer (using mapserver) backed by a Shapefile using layerObj.setFilter() but this doesn't seem to have any effect on the returned tile(s).

Sample code:

layerObj = mapserver.layerObj()
layerObj.setFilter("id = 1)

What am I doing wrong? Nothing blows up per say and mapserver produces tile(s) but they are the same set of tiles as if I had not applied the filter at all. Even applying the filter in the mapfile using FILTER "id = 1" also has no effect.

Here is a more detailed (in code) example of what I'm doing:

def index(self, *args, **kwargs):
    mapObj = mapscript.mapObj(self.mapfile)

    layers = [layer.strip().split(":", 1) for layer in kwargs["layers"].split(",")]

    # create layers
    for i, (layerType, layerName) in enumerate(layers):
        layerObj = mapObj.getLayerByName("raster" if layerType == "models" else "vector").clone()
        layerObj.name = "{0:s}:{1:s}".format(layerType, layerName)
        layerObj.data = str(self.models.join(layerName)) if layerType == "models" else str(self.regions.join(layerName))

        if "filter" in kwargs:
            layerObj.setFilter(kwargs.pop("filter"))

        mapObj.insertLayer(layerObj)

    owsReq = mapscript.OWSRequest()

    # add query string parameters into map request object
    for k, v in kwargs.items():
        owsReq.setParameter(k.upper(), v)

    # write mapserver results to buffer
    mapscript.msIO_installStdoutToBuffer()
    try:
        mapObj.OWSDispatch(owsReq)
    except:
        return SException(self.response, str(sys.exc_info()[1]))

    # adjust content-type
    self.response.headers["Content-Type"] = mapscript.msIO_stripStdoutBufferContentType()
    output = mapscript.msIO_getStdoutBufferBytes()
    self.response.headers["Content-Length"] = str(len(output))

    # output WMS image data
    return output


texts:
I tried to delete and redownload QGIS 3.8 and now I can not make new projects on QGIS because of this error message:

  Authentication System: DISABLED. Resources authenticating via the system can not be accessed.

Is there anyway to get rid of it the error message so I can work on projects in QGIS? I already have Python and GDAL installed from before.


texts: rasterio.open() giving parsedpath or unparsedpath error

texts:
I am using rasterio to get elevation values from a raster. I am using arcpy module and rasterio module and I have published this script as a geoprocessing service.
I am able to run it properly as a standalone script but when I try to run it as a geoprocessing service through rest endpoint, I get the below error

  ValueError: path must be a ParsedPath or UnparsedPath object.

Also when I restart this service, it runs properly for the first time, but the next time i run the service, it gives me the same error. The code block where I am getting the error is as follows:

 def findElevation(start_siteLon, start_siteLat, bearingAngle, distance, rasterData, **kwargs):
        rasterData = r"D:\PAN_India.tif"
        start_siteLon = round(start_siteLon, 6)
        start_siteLat = round(start_siteLat, 6)
        geoLocations = []

        try:
            bufferDistance = kwargs['bufferDistance']
        except KeyError:
            bufferDistance = 0.03

        try:
            if kwargs['distanceUnit'] == 'km':
                distance *= 1000
                bufferDistance *= 1000
        except KeyError:
            pass

        for dist in np.arange(0, (distance + 0.000001), bufferDistance):
            geoLocations.append(list(findPoint(start_siteLon, start_siteLat, bearingAngle, dist)))

        arcpy.AddMessage("GeoLocations: {0}".format(geoLocations))
        elevations = []

        ## Here I get the error after rasterio.open(rasterData):- ValueError:path must be a ParsedPath or UnparsedPath object.
        with rasterio.open(rasterData) as src:

            try:
                elevVals = src.sample(geoLocations)
                for values in elevVals:
                    elevations.append(values[0])
            except IndexError:
                return None

        try:
            if kwargs['outputElevationUnit'] == 'km':
                elevations = [i / 1000 for i in elevations]
        except KeyError:
            pass

        return elevations

I get the error at rasterio.open().

I have
python2.7
rasterio 1.0.23


texts: libnetcdf.so.4 error while installing qgis 1.6.0

texts:
I am trying to install Quantum GIS 1.6.0 from source on Ubuntu 10.10 64-bit OS. I have GRASS GIS 6.4.1svn installed on the machine. When I run 'make' I get the following error:

[ 34%] Built target qgis_analysis
Linking CXX executable qgis
/usr/bin/ld: warning: libnetcdf.so.4, needed by /usr/local/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libgdal.so: undefined reference to `nc_inq_vartype'
/usr/local/lib/libgdal.so: undefined reference to `nc_put_att_double'
/usr/local/lib/libgdal.so: undefined reference to `nc_strerror'
/usr/local/lib/libgdal.so: undefined reference to `nc_get_vara_uchar'
.
.
.
.
/usr/local/lib/libgdal.so: undefined reference to `nc_inq_varname'
/usr/local/lib/libgdal.so: undefined reference to `nc_open'
collect2: ld returned 1 exit status
make[2]: *** [src/app/qgis] Error 1
make[1]: *** [src/app/CMakeFiles/qgis.dir/all] Error 2
make: *** [all] Error 2

I am not able to solve it. Tried installing libnetcdf-dev and libnetcdf6 packages but it was of no help!


texts: How to use label classes, expressions, and annotations?

texts:
I've always found that when it comes to python, vector analysis, QGIS gives ArcGIS a run for its money, hell some of the qgis plugins exceed ArcGIS's performance by a few hours; however, I always have found that compared to ArcGIS, QGIS's labeling system lacks the expressions, sql, and detailed representation. I've tried mapnik, and it's nice, but still it seems to pretty up the problem rather than fix it.

How can I improve my own maps done on QGIS, especially with label classes, expressions, and annotations?
What needs to be done to enhance QGIS's labeling system in terms of someone writing a plugin or something similar?


texts: QGIS layers don't overlay after trying 'enable on the fly' and CRS settings

texts:
I know there are already many questions about this topic, but none of the answers helped me so far. I have two layers I want to overlay in QGIS. One of them is an Excell file with the coordinates of households in it. I changed it to .csv and projected it in QGIS with 'add deliminate text layer'. The other one are the outlines of the provinces of Dhulikhel municipality, Nepal. I got these from my colleague. I want to project the households in the provinces.

I would like to project these layers in WGS84 UTM zone 45N EPSG 32645.
The first layer is in this projection, the second one isn't, it is in a for me unknown 'Generated CRS'. I tried enable on the fly projection and than the save as option for the second layer. This however did not work. It seems to be something with the spatial reference system units.

I hope someone can help me. These are the properties of my layers:

Households:

General:
Storage type of this layer: Delimited text file
Source for this layer: file:///C:/Documents%20and%20Settings/Administrator/Desktop/GIS/Household_survey_results%20(6).csv?delimiter=,&delimiterType=plain&xField=Longitude&yField=Latitude
Geometry type of the features in this layer: Point
The number of features in this layer: 1681
Editing capabilities of this layer:
Extents:
In layer spatial reference system units : xMin,yMin 85.5281,27.6066 : xMax,yMax 85.5771,27.6372
Layer Spatial Reference System:
+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs

Provinces:

General:
Storage type of this layer: PGeo
Source for this layer: C:/Documents and Settings/Administrator/Desktop/GIS/Dhulikhel_Digital_Data/Administrative.mdb|layername=Ward_line
Geometry type of the features in this layer: Line
The number of features in this layer: 34
Editing capabilities of this layer: Fast Access to Features at ID
Extents:
In layer spatial reference system units : xMin,yMin 353921.13,3054982.59 : xMax,yMax 360199.97,3058637.05
Layer Spatial Reference System:
+proj=tmerc +lat_0=0 +lon_0=87 +k=0.9999 +x_0=500000 +y_0=0 +a=6377299.36559538 +b=6356098.359005156 +units=m +no_defs


texts: How to insert a feature using WFS-T based on a criteria?

texts:
I am pretty new to WFS/WFS-T and need help with some suggestions on how the following requirement can be implemented. We have a need to insert a feature into a PostGIS database based on the following condition.

The user provides a geometry along with other data to be inserted. But before doing so:

1.Check if there is any existing feature in the table whose geometry intersects with the one that is provided.
2.If there is any, throw an exception/error.
3.If successful, then insert record and return success message.

I read that OGC Filters can be used to query intersections, and WFS-T can be used to insert features, but I do not know how to implement query and an insert together. Can some one shed some light on how this can be done?


texts: How to export a layout in standalone script with QGIS 3?

texts:
I'm trying to automate map export from a QGIS project in a standalone Python script, without interface.
Many of the scripts founds are for QGIS 2.
For example the script written by Tim Sutton here.
Here the code:
# coding=utf-8

# A simple demonstration of to generate a PDF using a QGIS project
# and a QGIS layout template.
#
# This code is public domain, use if for any purpose you see fit.
# Tim Sutton 2015

import sys
from qgis.core import (
    QgsProject, QgsComposition, QgsApplication, QgsProviderRegistry)
from qgis.gui import QgsMapCanvas, QgsLayerTreeMapCanvasBridge
from PyQt4.QtCore import QFileInfo
from PyQt4.QtXml import QDomDocument

gui_flag = True
app = QgsApplication(sys.argv, gui_flag)

# Make sure QGIS_PREFIX_PATH is set in your env if needed!
app.initQgis()

# Probably you want to tweak this
project_path = 'project.qgs'

# and this
template_path = 'template.qpt'

def make_pdf():
    canvas = QgsMapCanvas()
    # Load our project
    QgsProject.instance().read(QFileInfo(project_path))
    bridge = QgsLayerTreeMapCanvasBridge(
        QgsProject.instance().layerTreeRoot(), canvas)
    bridge.setCanvasLayers()

    template_file = file(template_path)
    template_content = template_file.read()
    template_file.close()
    document = QDomDocument()
    document.setContent(template_content)
    composition = QgsComposition(canvas.mapSettings())
    # You can use this to replace any string like this [key]
    # in the template with a new value. e.g. to replace
    # [date] pass a map like this {'date': '1 Jan 2012'}
    substitution_map = {
        'DATE_TIME_START': 'foo',
        'DATE_TIME_END': 'bar'}
    composition.loadFromTemplate(document, substitution_map)
    # You must set the id in the template
    map_item = composition.getComposerItemById('map')
    map_item.setMapCanvas(canvas)
    map_item.zoomToExtent(canvas.extent())
    # You must set the id in the template
    legend_item = composition.getComposerItemById('legend')
    legend_item.updateLegend()
    composition.refreshItems()
    composition.exportAsPDF('report.pdf')
    QgsProject.instance().clear()

make_pdf()

QGIS 3 is now based on Python 3 and Qt 5 and I try to simply export a layout with a script without load / show the QGIS GUI.
Which script to use under QGIS 3?


texts:
hey people, i have the trouble with CI index in Erdas, when i am useing the image from landsat 5 tm with atmospheric correction it gives me the whole white picture in the results,

the formula CI=1-((red-blue)/(red+blue)) also i tryed to change R band with NIR, but......does not work at all

when i tryed to insert in the model the bands seperately the reslusts are the same, just white pic,

can anyone help with this type of issue?


texts: GLONASS Satellite Position Prediction using Almanac Data

texts:
GLONASS ICD has a section named "Algorithm of calculation of satellite motion parameters using almanac". It gives the formulas in order to calculate the position and velocity of the satellite. Unfortunately I cannot get the same results as in the given example, and I don't know why. Can you suggest any other documents, sample code or calculations about this problem?

There is a paper by Wang et al. called "Predicting GLONASS Satellite Orbit Based on an Almanac Conversion Algorithm for Controlled Ionosphere Scintillation Experiment Planning". In this paper the proposed algorithm converts GLONASS almanac to GPS almanac, and the procedure that is used for GPS position calculation can be applied. However, there are undefined parameters in the given algorithm, namely Dt^2, dt2, Ohm and Ohm_e (Figure 4). Does anyone have an idea about this?

Thanks in advance.


texts: Performing deep learning land cover classification using R?

texts:
I am really new to Deep Learning and, unfortunately, I can't find example codes on land cover classification other than this one where the author wrote a script in R for a large dataset.

The main reason that I am asking is because recently I found a few papers on Remote Sensing Image classification using Deep Learning and I was wondering if there were any R examples on that subject.

So, is there a code example, preferably a step-by-step, which I can use?

I found several git repos like Deep Neural Network with keras-R: Satellite-Image Classification that can do Deep Learning classification with R, BUTT, I am still looking for a simple multi-spectral image segmentation method. An example of that can be found at Unsupervised Image Segmentation with Spectral Clustering with R and I also found a similar question in Multispectral image segmentation for natural-resources applications using R for which the answer is "use something else other than R if you can".

If I find anything that works today I will be posting a working answer.


texts: Calculating Map Resolution Without Pre-Defined Scale Levels

texts:
I am trying to determine the formula necessary to calculate map resolution (change in lat,long per screen unit).  I am interested in only WGS84 coordinate space.

Every formula I have found thus far seems dependent on a map that has predefined zoom levels, i.e. a tiled map.  For example, the common formula I find is:

Map resolution = 156543.04 meters/pixel * cos(latitude) / (2 ^ zoomlevel)

How can I adjust this formula for a map without zoom levels?


texts: Exporting .tif from referenced mosaic dataset does not use functions in raster dataset

texts:
Very frustrating little issue in ArcGIS 10.1 -- I have a referenced mosaic dataset of terrain data that has a series of functions inserted (slope and several iterations of a statistics function to simplify and smooth the resulting mosaic).  When I export the project to a .ai file (OR even the data as a .tif), the resulting .ai or .tif file produces my slope image WITHOUT the functions (i.e. unsmoothed).

Anybody think of anything i might not have tried to make it work?  Why would it display the mosaic with the functions running on the screen, but not the graphics without it?


texts: Choosing string from dropdown list rather than typing it into Python script tool?

texts:
As you can see, in the above picture, I need to input the county name to finish the parameter setup. Can I change the last part from inputting string to choosing an item from a dropdown list? For example, there are five potential counties I will run the model, like A, B, C, D and E. I want to choose one of them from a drop-down list rather than type the input. I think the Data Type should be something else rather than the String, as shown in the below picture. Any suggestions?

I am using ArcGIS 10.3.1 Advance License.


texts: Labels overlaps and more spaces between letters in cesium

texts:
I have a geojson loaded in cesium and also i had added labels for the layer with below code

positions = entity.polygon.hierarchy['_value'].positions;

        //console.log(positions);
        center = Cesium.BoundingSphere.fromPoints(positions).center;
        Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(center, center);
        entity.position = new Cesium.ConstantPositionProperty(center);
        label = {
                            text: entity.properties.Name,
                            font : 'bold 10px Helvetica',
                            fillColor : Cesium.Color.BLACK,
                            outlineColor : Cesium.Color.WHITE,
                            outlineWidth : 5,
                            style : Cesium.LabelStyle.FILL_AND_OUTLINE,
                            verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
                            pixelOffset : new Cesium.Cartesian2(0, -9)

                        };
        entity.label = label;

I could see labels overlapping when zoomed out,more spaces between the letters and also some labels hidden inside the 3D building. Snapshot attached will make it clear. How this labels can be fixed?


texts: Very Simple ArcPy script using arcpy.SearchCursor and row.getValue

texts:
I am trying to run a very simple script to test the usage of arcpy.SearchCursor and row.getValue.

I want to do a very simple exercise: I have a table with some fields, and I want to print the values of one of the fields (e.g. fldname) for every record.

The script is the below:

import arcpy
IN_Table = "C:/ZZtest/test.mdb/table"
Field1="fldname"
cursor=arcpy.SearchCursor(IN_Table)
for row in cursor:
    printf=row.getValue(Field1)
    print(printf)
del row, cursor

When I am running this I have the error below:

Traceback (most recent call last):
  File "C:\ZZtest\ScriptName.py", line 28, in <module>
    printf=str(row.getValue(Field1))
  File "C:\Program Files (x86)\ArcGIS\Engine10.2\arcpy\arcpy\arcobjects\arcobjects.py", line 1048, in getValue
    return convertArcObjectToPythonObject(self._arc_object.GetValue(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function.

I tried to search for similar questions. But they all included more complicated scripts.

My ArcGIS version is 10.2.

The type of the "fldname" field is Integer.

Where is my mistake?


texts: Calculate ID based on ID from another field

texts:
I have a layer with single lines and I have added a unique ID for each line. I have extracted the vertices of these lines to a new point layer and now I want to add a new ID for every point but based on the ID of the line. This is an example of what I want.

Any idea about how to calculate field "ID_vert" with QGIS (preferably)?


texts: Number each value in each section due to other value

texts:
I'm working with map of plants in garden. This garden is divided into about 40 sections. Plants of one species have their number for example every Scots pine is 12 and every Common oak is 15 in field "Inventory".
I want to number every plant of each species on each section in column "RecNum", for example:

This tabel is "hand-made", how to do it automatically in field calculator?


texts:
I would like to expand sublayers when the map starts.

I set sublayers and expanded to true but do not see changes.

I wonder if I misplaced or used the incorrect code.

        layerControl: {
            include: true,
            id: 'layerControl',
            type: 'titlePane',
            path: 'gis/dijit/LayerControl',
            title: i18n.viewer.widgets.layerControl,
            iconClass: 'fa-th-list',
            open: true,
            position: 0,
            options: {
                map: true,
                layerControlLayerInfos: true,
                separated: false,
                vectorReorder: false,
                overlayReorder: false,
                sublayers: true,
                expanded: true,
            }


texts:
I have three location points with weather data. It's a 10-year composite of temperature values which means I only have three values for three locations for ten years. The distance between points is approximately 100 kilometers.

I want to interpolate these points to create a temperature map for the area. So, which method should I use and how?


texts: PostGIS Simplification on topogeometry does not respect topology?

texts:
I'm testing the code in the book "PostGIS in Action" (2nd ed) on Topology-based Simplification:

DROP TABLE IF EXISTS _temp_table; CREATE TABLE _temp_table AS
SELECT feat_name, ST_Simplify(topo,150) As topo_simp
FROM ch13.neighbourhoods;

This is supposed to produce a simplified polygon layer that respects topology. However, I am getting a simplified layer that breaks topology. In fact, the result is identical to the simplification after converting the topo field to geometry type:

...
SELECT feat_name, ST_Simplify(topo::geometry,150) As geom_simp
FROM ch13.neighbourhoods;

I double checked that the topo field is of the topogeometry type:

=> SELECT feat_name, topo FROM ch13.neighbourhoods LIMIT 1;

 feat_name |   topo
-----------+-----------
 James Bay | (2,1,1,3)
(1 row)

Am I missing something here, or does anyone else have a similar experience?

I am using PostGIS 2.5.1 under Ubuntu 18.04 LTS.


texts: Is it possible to show changes in database from geowebcache?

texts: Is it possible to show changes in database from geowebcache (used in conjunction with geoserver) which is showing cached data instead of reflecting changes?


texts:
Is there any in the year 2019 working plugin? I try QTiles but this make errors (https://github.com/nextgis/QTiles/issues/100). So I need an alternative that is working with QGIS 3.6
How I can produce tiles from maps I produce with QGIS? On Windows, if possible without any scripting.


texts:
I'm trying to install the libgdal1 package on Ubuntu 12.04, but the apt is returing this error:

  dpkg: error processing
  /var/cache/apt/archives/libgdal1_1.9.1-2~precise4_amd64.deb
  (--unpack):

  libgdal 1.9.1-1 trying to overwrite '/usr/lib/libgdal.so.1.16.1',
  which is also in package libgdal 1.9.1-1

I believe libgdal 1.9.1-1 is installed from OpenGeo Suite. How can I fix this problem?

QGIS and osm2pgl require the libgdal1 package.


texts:
with QGIS 2.10 it is not possible to merge vector layers with the "Processing-Saga" tool (merge layers). The following error log comes up:

Algorithmus Merge layers startet...
shapes_tools "Merge Layers" -INPUT "C:\Temp\convexhull2\hull2.shp,C:\Temp\convexhull2\hull3.shp,C:\Temp\convexhull2\hull4.shp" -SRCINFO -MATCH -MERGED "C:\Temp\processing\merge.shp"
C:\PROGRA~1\QGISPI~1\bin>set SAGA=C:/PROGRA~1/QGISPI~1/apps\saga
C:\PROGRA~1\QGISPI~1\bin>set SAGA_MLB=C:/PROGRA~1/QGISPI~1/apps\saga\modules
C:\PROGRA~1\QGISPI~1\bin>PATH=PATH;C:/PROGRA~1/QGISPI~1/apps\saga;C:/PROGRA~1/QGISPI~1/apps\saga\modules
C:\PROGRA~1\QGISPI~1\bin>saga_cmd shapes_tools "Merge Layers" -INPUT "C:\Temp\convexhull2\hull2.shp,C:\Temp\convexhull2\hull3.shp,C:\Temp\convexhull2\hull4.shp" -SRCINFO -MATCH -MERGED "C:\Temp\processing\merge.shp"
ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGISPI~1\apps\saga\dll\gdal_MrSID.dll
127: Die angegebene Prozedur wurde nicht gefunden.
ERROR 1: Can't load requested DLL: C:\PROGRA~1\QGISPI~1\apps\saga\dll\gdal_MrSID.dll
127: Die angegebene Prozedur wurde nicht gefunden.
library path: C:\PROGRA~1\QGISPI~1\apps\saga\modules\shapes_tools.dll
library name: Shapes - Tools
tool name : Merge Layers
author : V.Olaya (c) 2004
Load shapes: C:\Temp\convexhull2\hull2.shp,C:\Temp\convexhull2\hull3.shp,C:\Temp\convexhull2\hull4.shp...
Parameters
Layers: 1 object (hull4)
Merged Layer: Merged Layer
Add Source Information: yes
Match Fields by Name: yes
Error: Nothing to do! Merging needs more than one input data set.
Error: executing tool [Merge Layers]
C:\PROGRA~1\QGISPI~1\bin>exit


texts: How to avoid duplicated labels for multi-part features in qgis2web?

texts:
In QGIS, I have Label every part of multi-part features unchecked.

But when I use qgis2web-> create web map, I see there are duplicated labels for multi-part features.

My QGIS version is 2.16.3


texts: Exporting data driven pages with wms in arcmap

texts:
I use Arcmap 10.2.2.

I have a problem with export my map with data driven pages when I use a wms as a background layer. It seems that it can't render or download the background for the pages, only the one I am currently seeing. All other pages becomes white. Is there some way I can force arcmap to cache/download the wms for the other pages?


texts: Specifying shapefiles for clusters and subclusters using Folium's MarkerCluster

texts:
For example, I'd like to zoom from country, to states, to counties.

I don't see this option in the docs:

class folium.plugins.MarkerCluster(locations=None, popups=None, icons=None, name=None, overlay=True, control=True, show=True, icon_create_function=None, options=None, **kwargs)

But the Marker Cluster object does highlight contours when hovering over a cluster icon:


texts: Displaying multipoint features as polygon using QGIS

texts:
Is there an easy way to show/connect a group of points on a multipoint shapefile layer as if they were a polygon?

I'm collecting points for a plant study, and some of the points are gathered as a patch of plants. I'd like to symbolize individual plants and patches differently.


texts:
I tried to offset features from GeoJSON (2 way road) to make them visible on map (they are too close) but it creates "artifacts" - I guess at the start/end of each feature. There is no problem with the data without offset.

My not working fiddle: https://jsfiddle.net/rrq81rw9/27/

Original working fiddle: https://jsfiddle.net/tlohnes/rrq81rw9/

Leaflet offset: https://github.com/bbecquet/Leaflet.PolylineOffset


texts: Import shapefile in SQL Server (OGR2OGR)

texts:
I'm importing a shapefile into SQL Server '12 via the OGR2OGR tool and am getting a database connection error.

I followed the example from this article.

What I ran:

ogr2ogr -overwrite -f ESRI Shapefile "MSSQL:Server=.\MSSQLSERVER2012;database=ap;trusted_connection=yes" "C:\Users\johndoe\Desktop\myshapefile.shp"

The error:

SQL Server does not exist or access denied

I'm assuming I need to pass some type of credentials? and the server string is probably wrong where would it be located.

Question: Why am I getting this error?


texts: Special background layer not coloring in Kartograph map

texts:
I'm testing out Kartograph according to the documentation and a linked gist.

Both my US and non-US layers color correctly, but I can not get the special "sea" layer to fill.  I found an example here where similar syntax is filling, so I don't imagine it's a kartograph problem.

I also used the second "special" kartograph layer, graticules, to see whether it had anything to do with special layers.  These displayed fine, so I think I can rule out specialness, too.

Am I defining the attribute or calling the layer incorrectly?

File: world.json

{
   "layers": {
     "background": {"special": "sea", "fill": "#ff0000"},
     "land": { "src": "ne_110m_admin_0_countries_lakes.shp"},
     "the_us": { "src": "ne_110m_admin_1_states_provinces_lakes_shp.shp"},
     "mygraticule" : { "special": "graticule", "latitudes": 5, "longitudes": 5}
         },
"bounds": {
    "mode": "bbox",
    "data": [-150, 18, -50, 80]
          }
}

File: world.css

#background {
    fill: lightgreen;
    background-color: lightgreen;
}

#land {
    fill: #f1f1f1;
    opacity: 0.5;
}

#the_us {
    fill: #c1c1c1;
    opacity: 0.5;
}

#sea {
    fill: lightgreen;
}

Run with kartograph -s world.css world.json -o world.svg


texts: Calculate distance in kilometers between two points

texts:
I have a few questions regarding the calculation of the distance between 2 postal codes.
Take a look at the following code.

###
# load the different packages we need
###

require("rgdal")
require("maptools")
require("ggplot2")
require("plyr")
require("rgeos")

###
# load the shape file
###

belgium = readOGR(dsn="XXX", layer="NAME")
belgium.points = fortify(belgium, region="POSTCODE")
head(belgium.points)
tail(belgium.points)

This gives ;

      long      lat     id
1 151584.6 175068.7    1000
2 150829.0 174739.9    1000
3 150614.4 174580.1    1000
4 150178.8 174208.4    1000
5 149715.7 173823.0    1000
6 149126.5 173269.7    1000

      long      lat    id
51839 83871.46 215487.5 9992
51840 84519.46 215217.5 9992
51841 83925.51 214823.3 9992
51842 83578.20 214704.9 9992
51843 82796.53 215022.7 9992
51844 81811.86 214716.5 9992

What I now want to do is calculating the distance between the centroid of each postal code. The postal code is given by the variable id in the dataset belgium.points. Is the code below valid? Can I convert it to kilometers? (Please if you need additional info just ask me.

lat = sapply(split(belgium.points, belgium.points$id), function(x) mean(x$lat))/1000
long = sapply(split(belgium.points, belgium.points$id), function(x) mean(x$long))/1000
lat.dist = outer(lat,lat,function(lat1,lat2) (lat1-lat2)^2)
long.dist = outer(long,long,function(long1,long2) (long1-long2)^2)
spatial.dist = lat.dist + long.dist


texts: Multiple select by location in arcgis using arcpy

texts: I wanted to know whether there is there any way of selecting features by using select by location multiple through arcpy, like "SelectLayerByLocation_management".


texts: Making a join permanent using QGIS 3.16 with a shapefile and Excel spreadsheet

texts:
I have a point layer representing sites where data was collected. The data was edited and stored in an Excel spreadsheet (CSV). I needed the data to be joined to the sample sites. I followed the steps mentioned here:
Joining data from Excel to attribute table in QGIS without creating duplicates?
And it worked. However, when I attempted to load the same layer in a different project, the data from the spreadsheet was not there. It seems that the joined data was not permanently added to the attribute table of the shapefile. Is it possible to make these additions from the spreadsheet permanent to the shapefile?


texts: Calculating wall area facing outdoors from a building shapefile QGIS

texts:
I have a building shapefile (polygons) with the height of the buildings. Is there a way for estimating the wall area facing outdoors of a building? Note that I must differentiate the outdoor area from the interior area (the interior faces of contiguous polygons)
Update: I use QGIS and building height is uniform per building and is an attribute


texts: ArcSDE Geodatabase MS SQL Server restore of .bak file

texts:
If we have ArcSDE 9.3.1 running on MSSQL Server 2008 R2 Enterprise and we do a full backup of a geodatabase.  Then I try to restore the .bak file to a MSSQL Server 2008 R2 Express on a machine that doesn't have SDE installed, does this create a proper geodatabase?  What about the sde user in the previous geodatabase..does that need to be created prior?

We want to do some testing of converting an APDM geodatabase from Oracle to MSSQL Server but would like to do a lot of testing locally on a MSSQL Server Express.


texts: What is the default directory for qml-files in QGIS?


texts: How to change the color of red edit-polygon or purple snap-confirmation?

texts: I'm having trouble seeing the purple or pink snapping confirmation when drawing a polygon because the temporary polygon is red (QGIS 2.0.1). Also the vertices in edit mode are also red. I looked through the options, but couldn't find a place to change those colors.


texts: Refreshing image in attribute form based on classifier using QGIS

texts:
We have two tables:

road_signs (road sign points).
lut_road_signs (classifier of road signs), this table has a column sing_img (blob) in which the image of road signs is written in png format.

How to make it so that when editing the table road_signs (in Attribute Form) the image of the road sign is redrawn when choosing a different sign from the classifier?

GeoPackage with data and project can be downloaded from this link: https://drive.google.com/file/d/1WuO-IFdzE3B7S-_DVevKfyOWVUUhmvGA/view?usp=sharing, inside in geopackage we can find project and open it and see how to realise viewing image stored in blob database on dialog forms. Project name: road_sign_prj_1:


texts: How to fix "update of view in private qgis.db failed"?

texts: Would anyone know why I keep getting this error message after installing Valmiera from Durfour?


texts: Removing nodata value from raster images?

texts:
I'm doing urban change prediction in Land Change Modeler (TerrSet software), and i can't run Transition Sub-Model.

I don't know why, but I think it is because I have nodata value in Variable (slope image, elevation image, distance to roads) and I don't know how I can remove these values.

I tried in ArcGIS (reclass, copy raster).

Nodata value is -3,402823e+038


texts: Create a raster mask using another raster in QGIS

texts:
In Photoshop you can use a mask layer to filter an image using another image. A mask layer in Photoshop is a greyscale image attached to a layer that determines that layers transparency per pixel. White is fully opaque, black is fully transparent. This method can be used for example to filter a curvature layer by a slope layer.
Would it be possible to have the same result in QGIS using the raster calculator or other raster processing tools?
Update
Applying the following GDAL commands:
gdal_translate -of VRT -b 1 input.tif band1.vrt
gdalbuildvrt -separate out_with_mask.vrt band1.vrt your_mask.tif
gdal_translate -of GTiff -co alpha=YES out_with_alpha.vrt out_with_alpha.tif

and testing the obtained file I have:
Band 1 Block=1808x1 Type=Float32, ColorInterp=Gray

and
Band 2 Block=1808x1 Type=Float32, ColorInterp=Alpha

but I don't get the target file masking using transparency values based on the mask file, I just get a full transparency effect on the mask file:


texts: Printing MXD files name using ArcPy gives AssertionError: Invalid MXD filename?

texts:
I try to print all the MXD files name. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders there are MXD files. I work with this code:

import arcpy,os,sys,fnmatch
from arcpy import env

rootPath = r"G:\desktop\Project"
for root, dirs, files in os.walk(rootPath):
    env.workspace = root
    for mxdname in arcpy.ListFiles("*.mxd"):
        print root + '\\' + mxdname
        mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\\" + mxdname)
        print mxdname

It print all MXD files name in the main directory, but it don't print MXD files in the sub directory.
This the error:

>>>
G:\desktop\Project\landuse__4___20013.mxd
landuse__4___20013.mxd
G:\desktop\Project\landuse__5___20013.mxd
landuse__5___20013.mxd
G:\desktop\Project\project.mxd
project.mxd
G:\desktop\Project\k20000\landuse__1___20013.mxd

Traceback (most recent call last):
  File "G:\desktop\python.py", line 9, in <module>
  mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\\" + mxdname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\mixins.py", line 611, in __init__
   assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")
AssertionError: Invalid MXD filename.
>>>


texts:
I am having a raster file with runoff depth Q in mm which was obtained from SCS method.

I want to calculate hydro power potential at any location on my DEM.
In the formula Q is in m3/s but we are getting Q in mm from SCS method.
Is there any tool/script/software dealing this?
How to find Q in m3/sec from a raster having Q in mm  for hydro power calculations?

I am using arcgis (9.3 and 10).


texts: Label only selected features using QGIS?

texts:
Is it possible to make an expression that labels only the selected feature in QGIS? I tried it with this expression in the label tab:

attribute( $currentfeature, 'LAENGE' )

but it labels all and not only the selected:


texts: Creating a raster and setting extent in R

texts:
I am trying to create a raster with 922 columns and 444 rows at 0.06250-degree spatial resolution. However, after I set the following extent the resolution of the resulting raster comes out to be 0.06243221. It seems like the extent function is only reading the first 4 digits after the decimal for both xmn and xmx.

Here is a sample code I am trying:

r <- raster(ncol=922, nrow=444)

bb <- extent(235.40625,292.96875,25.15625, 52.84375)

extent(r) <- bb

r <- setExtent(r, bb)

I have also tried to only set the extent and resolution but then I only get 921 columns and 443 rows.

r <- raster()
bb <- extent(235.40625,292.96875,25.15625, 52.84375)
extent(r) <- bb
res(r) <-0.06250
r <- setExtent(r, bb)

Any thought?


texts: How to write docker-compose.yml after enabling postgis_raster for PostGIS Docker Image

texts:
I'm using the docker image of https://github.com/postgis/docker-postgis and it works fine with the commands below which is also defined in README file.
docker run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis and
docker run -it --link some-postgis:postgres --rm postgres \ sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
However, my task is encapsulating the raster datatype and this image doesn't include postgis_raster extension. So, I've modified the files for enabling the postgis_raster extension in the Alpine version of PostgreSQL 13.
initdb-postgis.sh
#!/bin/sh

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

# Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis IS_TEMPLATE true;
EOSQL

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB"; do
    echo "Loading PostGIS extensions into $DB"
    "${psql[@]}" --dbname="$DB" <<-'EOSQL'
        CREATE EXTENSION IF NOT EXISTS postgis;
        CREATE EXTENSION IF NOT EXISTS postgis_topology;
        CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
        CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
        CREATE EXTENSION IF NOT EXISTS postgis_raster;
EOSQL
done

update-postgis.sh
#!/bin/sh

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
    echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
    psql --dbname="$DB" -c "
        -- Upgrade PostGIS (includes raster)
        CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
        ALTER EXTENSION postgis  UPDATE TO '$POSTGIS_VERSION';
        -- Upgrade Topology
        CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
        ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
        -- Install Tiger dependencies in case not already installed
        CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
        -- Upgrade US Tiger Geocoder
        CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder VERSION '$POSTGIS_VERSION';
        ALTER EXTENSION postgis_tiger_geocoder UPDATE TO '$POSTGIS_VERSION';
        CREATE EXTENSION IF NOT EXISTS postgis_raster VERSION '$POSTGIS_VERSION';
        ALTER EXTENSION postgis_raster UPDATE TO '$POSTGIS_VERSION';
    "
done

You can also reach the files via https://github.com/berkesenturk/postgis_image_raster_enabled.
Finally, I think I need to add a docker-compose.yml but I didn't see any examples for how to do it for PostGIS. How should I create the docker-compose.yml file?


texts: What is the character limit on an Esri subtype description?

texts: I cannot find this documentation anywhere. Essentially want to know if too long of a subtype description can cause errors.