texts: Rounding numbers in a Python Label Expression

texts:
I'm having trouble rounding a percentage number using a label expression in Python. Just displaying the label as shown below is fine.

def FindLabel ( [Deaths], [PercentageDead] ):
    if ([Deaths]) == "0":
        return [Deaths]
    else:
        return [Deaths] + "\n" + [PercentageDead] + "%"

I tried implementing the example given on Arcgis online but as soon as I try to round off the extra digits in my percentage all of those features go blank on my map. No label is displayed whatsoever for those feature.

def FindLabel ( [Deaths], [PercentageDead] ):
    if ([Deaths]) == "0":
        return [Deaths]
    else:
        P = round(float([PercentageDead]), 5)
        return [Deaths] + "\n" + P + "%"

I've tried converting to a float or an int, and than converting it back to a string but nothing seems to work. If I try to manipulate that field whatsoever the expression will return nothing.

I just want to round off the digits to 5, how would I do that? I'd be willing to switch to Arcade if it would yield the same result.


texts: JSON pipeline in Python doesn't create any output file?

texts:
I have ground LiDAR point cloud with some noise points. I would like to use filter.statistics in PDAL (in Python 3.6) using JSON pipeline to filter the noise out.

json = """
{
  "pipeline":[
    "/9A-1B_subset15m.las",
    {
      "type":"filters.outlier",
      "method":"statistical",
      "mean_k":12,
      "multiplier":2.2
    },
    "/9A-1B_subset15m_c.las"
  ]
} """

import pdal
pipeline = pdal.Pipeline(json)
pipeline.validate()

The code runs without error but doesn't create any file. I wonder if anyone can help solving this?


texts: problem with "Con" conditional expression

texts:
I created a python script where I use Con (Spatial Analyst). Till now I passed the where clause value as value>1000 and it worked fine for me. But recently I found some raster on which Con statement does not work and says that the expression is not valid or something like that. Now I put space before and after > sign and the expression is now value > 1000. The weird thing is the script works fine now.

Con does not work when con expression is value>1000, for raster files that are big in size, but works fine when con expression is value > 1000, for my case, it was 50MB. Only putting two spaces solves the problem

Question:
I go through Con (Spatial Analyst) documentation. I do not find anything that can explain why is this happening. Can anybody explain Why is this weird thing happening?


texts: Pass the onMouseDownMap X, Y from a python addin to a toolbox script tool

texts:
Is it possible to pass the onMouseDownMap X, Y coordinates to a script tool launched using GPToolDialog?

The end goal is to have the user select the add-in tool, click the map to add a point, then pop up the script tool to attribute the point.

class LOMA_Point(object):
"""Implementation for Stormwater_addin.tool (Tool)"""
def __init__(self):
    self.enabled = True
    self.cursor = 3
    self.shape = 'NONE'
def onMouseDownMap(self, x, y, button, shift):
    message = 'Your mouse clicked:' + str(x) + ', ' + str(y)
    pythonaddins.MessageBox(message, 'My Coordinates')
    toolbox = r'Database Management Tools.tbx'
    pythonaddins.GPToolDialog(toolbox, 'AddLOMA')
    pass


texts: Counting number of cells which can see each cell in QGIS?

texts:
For each cell in a DEM I'd like to count the number of cells which can see it (i.e. direct line of sight).

Can anyone explain how to do this in QGIS?


texts: QGIS3 Python Export PNG after layout resize

texts:
I have maps being created that have nice colour banding on them for the contours.

I want to be able to export the legend for that colour banding as an image so it can be imported into another application.

My solution was to create a print layout containing the appropraite legend in it, then use the exportToImage function to save the file out.

This all seems to work, and the script reports success.. except no PNG file appears.  However if I manually press the Resize To Contents button on the layout, then the same exportToImage command works as expected.

This makes me think the layout size is somehow seen as 0,0 in size, and needs to have the output size defined.  I tired using what I think is the same resize function in python.  But there must be something else needs to be done as well.

I thought I got the same command sorted in my python below.. but clearly there is another step I'm missing somewhere. Hopefully an obvious one.

Here is the code I'm using with a couple of edits for clarity

##
## Begin Creating Print Layouts
##

project = QgsProject.instance()

#Create a new print layout
printLayout = QgsPrintLayout(project)
project.layoutManager().addLayout(printLayout)
printLayout.setName("Colour Band Legend")

#Get the list of all the pages in the layout
paperPages=QgsLayoutPageCollection(printLayout)

#Add a legend to the print layout
legend=QgsLayoutItemLegend(printLayout)
legend.setTitle("")
printLayout.addItem(legend)
legend.setAutoUpdateModel(False)
legItems=legend.model()

#some editing of the legend items.. skipped for brevity

#resize all the pages to fit around the now edited legend
paperPages.resizeToContents(QgsMargins(0,0,0,0),QgsUnitTypes.LayoutMillimeters)
printLayout.reloadSettings()

#Save the layout to a png file
legendExportPath="C:/Test.png"
print("Saving " + legendExportPath)

legendExporter=QgsLayoutExporter(printLayout)
imageSettings=legendExporter.ImageExportSettings()
imageSettings.cropToContents=True
imageSettings.dpi=300
imageSettings.pages=[0]
legendExporter.exportToImage(legendExportPath,imageSettings)


texts: qgis2web problem exporting with match project crs

texts:
I am trying to export a map that contains two layers (one is a duplicate of the other, but with different symbology). If I leave the box "Match Project CRS" unchecked, the map exports with no problem. If I check the box, however, I get a blank map - no features and no layers legend. The project is in USA_Contiguous_Albers_Equal_Area_Conic, EPSG102003. The layers, however are in

  USER:100026 - * Generated CRS (+proj=aea +lat_1=29.5 +lat_2=45.5
  +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs) - Projected.

I've attempted to export the layer (as shapefile) into EPSG102003, but when I reload it, it's still in the user CRS.

I suspect the layer CRS is at the root of the problem, but I can't figure out how to coerce it to save in the CRS I want.

QGIS 3.4.2, qgis2web 3.12.1, exporting as OpenLayers


texts: Current Leaf-off HiRes Orthophoto Alternatives to Pictometry

texts:
Our nonprofit organization has subscribed for several years to Pictometry's aerial orthoimagery. Where there is coverage (in most metro areas), the quality of the leaf-off imagery has justified the cost of the subscription ... until now.

Pictometry has announced a transition to a service now called CONNECTExplorer, and although it has some nice (minor) improvements, the manner in which the costs are calculated will cause our organization's subscription to go up between 5 - 10 fold. We like the imagery (and the customer service), but that sort of price increase is a deal-killer.

We've looked for alternatives, but so far, they have either not been leaf-off (NAIP, most govt programs, Bing, etc) or have not spanned the US (most county or state programs). It also helps to be able to easily see the image collection date.

For leaf-off, hi-res (6 or 12 inch/pixel) orthoimagery over much of the US that can be downloaded in georeferenced form, what other alternatives are there currently?


texts: Is it possible to display foreign tables (Oracle to PostGIS) in QGIS?

texts:
I have used oracle_fdw to create a foreign data wrapper in my PostgreSQL database to connect to my Oracle database and retrieve  foreign tables from the Oracle database into my Postgres database. This includes the geometry of the Oracle table.

When I save the foreign table as a "local" table and add a primary key and spatial index, I can add the local table to the map in QGIS, so I know that the geometry has been retrieved correctly.

However, when I try to put the foreign table directly into QGIS, I get "invalid layer and cannot be loaded". I'm sure that this is because I can't add  a spatial index or primary key to the foreign table.

Is there any way to show this foreign table in QGIS without the spatial index and primary key?


texts: Get a list of all symbols out of the QGIS Style Manger via PyQGIS

texts: I'am working on a plugin which is loading layers automatically. When the layers are loaded they should get categorized. I done it with svg files but i have more symbols in my Style Manager which I want to use for the categorization. Do anybody know how I can read all symbols out of the Style Manager? I use QGIS 3.0


texts:
I heard of Smart Cities with surveillance on the streets etc.
But what does it mean for GIS?
Does anyone have a good example?


texts:
I have clustering enabled on an OpenLayers map and have used code from the first answer in: Openlayers zoom in on cluster to zoom in on a cluster.

function onFeatureClick(event) {
    if (event.feature.cluster.length > 1) {
        // *** Change this so that the map zooms on cluster location ***
        map.setCenter(event.feature.geometry.getBounds().getCenterLonLat());
        map.zoomIn();
    } else {
        // popup code
    }
}

Q: Is it possible to zoom on the cluster location so that it stays in the same place? Right now the cluster gets centered on the map. In other words the cluster should not move when zoomed in.


texts: Creating new custom vector marker symbol for ArcMap?

texts:
I would like to create a set of custom marker symbols for environmental sampling locations. I need there to be "vector" marker symbols not picture symbols.  I've tried picture marker symbols and there are numerous drawing and exporting issues associated with this approach especially when using transparent colour. I believe I used a font creator in the past and drew a custom true type font but there seem to have been some issues with accessing the custom font from ArcMap as well as some font size problems.  Ideally, I would like to draw a vector graphic in Illustrator/ CorelDraw then somehow use this graphic as a marker symbol in ArcMap.

Can this be done?

Can someone describe the process of creating a custom "vector" marker symbol as well as accessing the symbol in ArcMap.  Vector graphic approach is preferred but a true type font approach is also fine.


texts: Dynamic updating of Events Layers created from XY Data in ArcGIS Desktop?

texts:
Are Events layers created from displaying XY Data in a table, updated dynamically when the table is updated? I have an Access db table that I am dumping data into, and I created an Events layer from that, but I have and will continue to update the table. I updated the table and created a new Events Layer to try and compare two event layers, but my data is too large to determine one way or another.

It appears that my tables are updating to reflect the changes from my Access db, but the Events Layer does not contain the update. Is it possible to have the Events layer update with the table?


texts: Resampling Sentinel-1 to Landsat 8 size and location

texts:
I am training a convolutional neural network to classify landcover and I would like to ingest both Landsat 8 and Sentinel-1 into my classifier.

Currently it is working reasonably well for Landsat 8 but I want to get Sentinel-1 data, ideally at the same resolution and pixel locations. Is there any library that already does this or can you think of a good approach ? I'm using rasterio in python for most of my raster processing.

I'm downloading my Sentinel-1 data from Sentinel-Hub.


texts: Adding field with filename when merging shapefiles with ogr2ogr?

texts:
I'm merging some shapefiles and I had some problems doing so inside QGIS, so i'm using ogr2ogr directly.
I'm doing this (in a batch):

ogr2ogr -overwrite %destination% %n1%
ogr2ogr -update -append %destination% %n2% -nln all_new
ogr2ogr -update -append %destination% %n3% -nln all_new
ogr2ogr -update -append %destination% %n4% -nln all_new

It works fine, but now I need to have in the resulting shapefile, a field with the names of the original shapefiles I merged.
Doesn't sound very difficult, but I'm not managing to do it.

Can anyone help?
Thank you!


texts: Displaying point/kernel density map in ArcScene?

texts:
I just finished making density maps of historic sites (point shapefile), both kernel and point density. Considering that what I want is just the density of the points so I put no population field in.

Now I want to present it in 3D, namely Arcscene. I found that there is no extrusion tab available. And most of the options in the Base Height Tab are grayed out shown in the picture below.

I already enabled Z-values for the point shapefile. So I am just wondering if I can show the density raster surface in ArcScene.

Edit: Density Map shown as below. Apparently the Z value I intend for would be the density value.


texts: How to increase resolution of DEM rasters?

texts: Thanks to the fine folks here at the GIS SE, I have managed to batch process a load of ASC files into raster hillshade TIFs. However, while they look fine on screen, when printed they are very pixellated - they are too low a resolution in the printing sense. Is there anyway I can increase the resolution so they print well?


texts: How to calculate miles of road in street network

texts:
I have a road network we use for our city. It has ever single road created and categorized.

What would I do if I wanted to calculate the total miles of roads in this network?


texts: Counting number of raster groups within buffer layer?

texts:
I am trying to count the number of times each category of a raster layer appears in a buffer square.  I have attached a picture to help explain.

In the picture example I would want the 'red group' to output 2 for that buffer, grey to output 2, green 2, orange 4 and brown either 4 or 5.  I need to do this for a few hundred sites so a technique where I can do all buffers at the same time would be good, even if this means only one raster group can be assigned a number at a time e.g. only output for 'red group' in each buffer.  I'm not sure if this is possible but I hope so.  Would I need to convert the raster layer first - I'm happy to do this is needed?

Not sure if it matters or not but none of my buffers overlap and some raster groups could be in more than one buffer as seen below.

I'm using ArcGIS - ArcMap 10.1. I should have all the licences as it's at University

This is the output that I can get


texts:
I currently want to create links between 2 features. Ie., I have 2 basins that flow out and I want to use a line/polyline to have a link out of them and both point to a common 3rd feature, indicating that both basins have flows to the 3rd feature (area).

Is there a way  I can do that or do I have to create a polyline feature class myself with the two endpoints being the location of the basin and the outflow area? If I do it this way, when I move my basin around, the polyline won't follow.  Is there a way I can make a LINK between the two?

Thanks and Regards


texts:
After reviewing this article: https://knowledge.safe.com/answers/50003/view.html

It is still unclear how to check to see if a feature class exists using FME. I was able to successfully read in the schema of the GDB, but what transformer is best applied to check the schema for a specific feature class name? How would the logic go?


texts: Calculate area in square meters from degrees?

texts:
I have a polygon shapefile in geographic coordinate system, I would like to calculate area in square meters in QGIS using Python.

Is there any formula or equation to do this?


texts:
I have a project relating to an analysis of a national geodetic network. The data I am working with is a 0.15m pixel size dsm as well as a vector file denoting each station forming part of the existing network.
I need to create a viewshed on each point. However the area of interest is an angle of 10 degrees above the horizontal. So essentially my query has to be similar to a viewshed but taking into consideration 80 degrees from nadir. The area of interest above each station will form a cone which will represent the needed clear view for satellite visibility from a gnss antenna.

Any idea of how to go about it in qgis


texts: Can ArcGIS recognize an incomplete date?

texts:
I have a string field that I want to convert into a date field. The problem is that some dates are incomplete (ex: "-/-/1967"; "1/2/-"). So is it possible to have in the same date field complete dates and others incomplete?

later edit:
To make the conversion I use Data management>fields>Convert Time Field tool and the format I type is d/M/yyyy. My programming experience is poor, but I can learn. :)


texts: ESRI Js api 4.2: FeatureLayer does not draw all features in extent

texts:
I'm upgrading a web application from ESRI js 3.19 to 4.2, but I'm experiencing problems with my FeatureLayers.

The data is coming from an ArcGIS Server 10.3 and the following restrictions are in place:
- maxRecordCount: 1000
- maxScale: 50000

When I add the FeatureLayer to my Map-Object (into a MapView) a very few features are displayed at random locations on the map. The same layer with the same settings in v3.19 is working like a charm.

Can someone please help me out?


texts: Finding endpoints or gaps in linestring?

texts:
I have a set of features of type linestring. I'm trying to polygonise the linestrings and assumed that they were closed (naive me :) ). Of course some were not closed and I'm trying to locate the gaps or the endpoints of the individual linestrings, so I can close them manually.

How can I locate the gap in or endpoints of an open linestring?

Available software: QGIS, FME, OpenJump, (ArcMap).


texts:
is there any possibility to use an Esri .lyr data in QGIS?

Maybe a tool to convert the file into a xml or sld?


texts: Leader lines to beginning and ending of polyline using maplex

texts: I have a polyline layer with the labels placed offset with a leader line going to the middle of the polyline. Is there some way to have a leader line go from the end of the line to the label then back to the beginning of the line using maplex? It would be nice to have it automated because I am dealing with a rather large dataset.


texts: Adding different types of marker on the map with using Leaflet.draw

texts:
I am using Leafletjs with Leaflet.draw to create an interactive map on my web.
But I need to enable different types of "marker". And then when creating them I need to identify them. I tried adding a title to each marker, but then I can't get it.
attempt 1:
https://jsfiddle.net/k9w2jf05/2/

L.DrawToolbar.include({
    getModeHandlers: function (map) {
        return [
            {
                enabled: true,
                handler: new L.Draw.Marker(map, { icon: new L.Icon.Default() }),
                title: 'Place restaurant marker'
            },
            {
                enabled: true,
                handler: new L.Draw.Marker(map, { icon: new L.Icon.Default() }),
                title: 'Place gas station marker',
                innerHTML: "sdadadds"
            },
            {
                enabled: true,
                handler: new L.Draw.Marker(map, { icon: new L.Icon.Default() }),
                title: 'Place hospital marker'
            }
        ];
    }
});

attempt 2:
https://jsfiddle.net/k9w2jf05/1/
var drawPluginOptions = {
  position: 'topright',
  draw: {
    polyline: false,
    polygon: false,
    circle: false, // Turns off this drawing tool
    rectangle: false,
    circlemarker: false,
    marker: {
    title: "soyel1",
      icon: new MyCustomMarker()
    }
  },
  edit: {
    featureGroup: editableLayers, //REQUIRED!!
    remove: false
  }
};

map.on('draw:created', function(e) {
  var type = e.layerType,
    layer = e.layer;

    /*if(layer.title == "Place hospital marker"){
        do this...
    }*/

  editableLayers.addLayer(layer);
});

I simply need different markers to appear on the bar, with different icons and detect when one or the other is clicked, and when one or the other is deleted. To have 1 of each on the map always.
How can I do that?


texts:
I have a map Here based on leaflet JS and the layers are geojson. I would like to get a table at on another div when I click on each layers.

How would I be able to do that?


texts: Keep the map straight with arcgis projections

texts:
I need to overlap DEM file with an historical map.
The historical map doesn't have georeferencing so I need to add some control points, but when I do this the map is distorted.
There is a way to distort only the DEM file so the historical map doesn't change?
Can I distort the DEM and keep the map as the original?
Here's an example:


texts:
I'm working with summer and winter hillshade values that were calculated in ArcGIS9.3 (but I'm now viewing them/working with them in ArcGIS10.2).

Hillshade values were calculated using the hillshade tool with 30m DEMs. Logically, I would assume that if two sample locations had the exact same winter hillshade values, they should also have the exact same summer hillshade values. However, the data doesn't match this thought process.

Can anyone offer a reason/situation where sites may have different summer hillshade values when their winter values are identical?


texts: Showing required bus stops in route using ArcMap

texts:
I have bus route shapefile and bus stops shapefile. I can also see in which route the bus stops are not present.
How can I highlight that in my map in ArcMap?


texts: Is it possible to convert a number column to a string one , changing '.' for ',' and maintaning two decimal places on QGIS ?


texts: Where does MapInfo store its Coordinate Systems?

texts: When choosing a projection in MapInfo, there is a large list of available coordinate systems. Where is the file that stores these and is it easily editable?


texts: Charts and Graphs that only display features in current extent

texts:
Using QGIS, QGIS Server, and Lizmap3/3Liz I am trying to make a pie chart that compares attributes but only of the features in the current extent. So when you pan around the webmap the graph changes based on the features in view. I know it can be done in the composer with attribute tables but how can it be accomplished using Lizmap and Dataviz from within the project?

The diagrams feature only works on single features. What I am trying to do is create a chart from the attributes of the features in view with a pie graph nested in a docker to show me, for an example, within the current view how many house holds are there and of those house holds what percentage makes more/less than $xx.xx. As you pan around your statistics will change based on area and how many homes with data are in the extent; and of course if you zoomed all the way out you would gets stats on everything in the view.


texts: Convert lat/lon points to gridded panel dataset?

texts:
Suppose I had a dataset that looked like df. Could someone show me how I would I summarize this panel dataset into a panel by km x km grids in R?

df <- expand.grid(decade = seq(1940, 2010, 10),
              country = c("Spain", "Italy"),
              stringsAsFactors = FALSE)

df$lat    <- 36   + (3 * runif(16))
df$lon    <- -5.5 + (2 * runif(16))
df$events <- sample(1:50, 16, TRUE)

I want to aggregate this data, not only into grids, but keep the time dimension as part of the end product. What I'd like to create is a data frame that will tell me how many total events happened by grid in decade 1950.


texts: QGIS Processing Plugin Generating Features with Attributes

texts:
I'm writing a QGIS processing plugin that creates a point feature layer. I'm able to add points to the feature layer just fine but the attributes I add don't show up in the Attribute Table after I run the plugin. The Attribute Table shows the correct fields but they're all empty. How do I populate the attribute table from my processing plugin?
Some snippets to give you an idea of what I have now (from my processAlgorithm method):
field_name = self.parameterAsString(parameters, self.FIELD_NAME_INPUT, context)
attrs = ['row', 'col', field_name]
out_fields = QgsFields()
# x and y indexes
out_fields.append(QgsField(name=attrs[0], type=QVariant.Int))
out_fields.append(QgsField(name=attrs[1], type=QVariant.Int))
out_fields.append(QgsField(name=attrs[2], type=QVariant.Double))

(self._sink, dest_id) = self.parameterAsSink(
       parameters,
       self.OUTPUT,
       context,
       fields=out_fields,
       geometryType=QgsWkbTypes.Point,
       crs=self._bound_box.crs())

attr_vals = np.array([[*coords, randint(1, 5)] for coords in self._defined_points])
# set output field values
for i in range(attr_vals.shape[0]):
    coords = tuple(attr_vals[i, 0:2])
    pin = self._defined_points[coords]
    feat = QgsFeature(id=i
    # this bit works fine
    feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(*pin.geoCoords())))
    self._sink.addFeature(feat)
    # the place where I'm trying to assign the attributes
    feat.setAttributes(list(attr_vals[i, :]))


texts:
I am currently running some tests with a large JSON data string. I suspect that there might be a character limit where you can add input parameters but I am not sure. Is there a character limit for a string in ArcMap? This is json data I pulled from a GeoProcesssing Server.
Here is what I am talking about:

https://imgur.com/a/5dArIqS


texts: Listing Printer names in a Python Toolbox in Arcgis 10.1?

texts:
Here's my code for my third parameter in my Python Toolbox.  When I run the toolbox and look at the list of printers, it only shows one of them.  My print command of 'printerName' lists all of them in a seperate script.  How can i get printerName to loop through all of the printers and put them in the list?  Is there a way to make a loop on one line?   Thanks

    # Third Parameter
    printer = arcpy.Parameter(
        displayName="Select a Printer",
        name="printer",
        datatype="String",
        parameterType="Required",
        direction="Input")

    for printerName in arcpy.mapping.ListPrinterNames():
        print printerName

    # Set a value list of Add or Remove
    printer.filter.type = "ValueList"
    printer.filter.list = [printerName]

Update 2

Here's the code for the third parameter that list the local printers:

    # Third Parameter
    printer = arcpy.Parameter(
        displayName="Select a Printer",
        name="printer",
        datatype="String",
        parameterType="Required",
        direction="Input")
    # Set a value list for the available local printers
    printer.filter.type = "ValueList"
    printer.filter.list = arcpy.mapping.ListPrinterNames()

This works and lists all of my local printers.  The problem is it can't print the looped MXDs.  It looks like python can't find them in the loop according to my arcpy.AddMessage().  Here's the code:

    # Get inputs
    InputMXD = parameters[0].valueAsText
    PDF_Folder = parameters[1].valueAsText
    printer = parameters[2].valueAsText

    # Set workspace as defined by user
    #env.workspace = PDF_Folder
    arcpy.env.workspace = r"c:/temp"

    #List Names for Inputs
    arcpy.AddMessage("PDF_Output: "+PDF_Folder)
    arcpy.AddMessage("Printer Name: "+printer)
    arcpy.AddMessage("MXDs before Loop: "+InputMXD)

    MXDList = arcpy.ListFiles(InputMXD)
    arcpy.AddMessage("After MXDList")
    arcpy.AddMessage(MXDList)
    for MXDPath in MXDList:
        arcpy.AddMessage("MXD Path: " + MXDPath)
        MXD = arcpy.mapping.MapDocument(MXDPath)
        arcpy.AddMessage("MXD: " + MXD)
        arcpy.mapping.PrintMap(MXD, printer)

It's showing the mxds before the loop, but it isn't printing them once the loop hits.  Any ideas?  It's showing "[]" when it should be showing what's in the "MXDList".


texts: How can I create a pdf map at a high resolution while still keeping the file size manageable?

texts:
I have numerous layers in shapefile format that contain a lot of data across a large area.

I am trying to create a .pdf file that shows all of the area and I want it to be in good quality, so that the detail is still there when zoomed in.

I tried to use the QGIS print compressor but it won't allow me to produce the best quality because the document is too big and opening it in high resolution results in an error.  Is there another way to make a .pdf from my map layers?


texts: Extracting values from soilgrid layers for xy coordinates in QGIS

texts:
I want to extract soil values for a list of x and y coordinates from Soilgrids layers in QGIS. I loaded some layers through the browser (WMS) as a test, and then selected the specific layer (e.g. Soil organic carbon content 15-30cm mean (dg/kg)). I then added my point coordinates and made sure the coordinate reference system was the same. I aimed to use the point sampling tool in QGIS, however, every time I try this I end up with empty values. I have used this tool many times before and it always worked for me.
Does anyone know why this happens or know a solution?
I have around 1800 datapoints over North America, for which I want all soil values, so doing it manually is not really an option.


texts: Getting QGIS go2streetview view to stay in locked browser window

texts:
In QGIS the go2streetview Plugin is there ready to go.  The icon displays and the window asks you to click on map and drag cursor to display Google Street View. When this is carried out nothing happens though in the browser window that is locked in.
However, if I click on the map and drag the cursor whilst holding down the control key, it works but opens up in a new browser window.
How do I get the view to stay in the locked browser window?


texts: Calculate spatial GINI coefficient for land use

texts:
I am interested in calculating an index of agricultural land inequality for Brazil. I'm thinking that a GINI coefficient would be a good approach given traditional uses of GINI. I have a data set for all municipalities in Brazil that consists of four columns for each municipality (rows): 1) number of family farms, 2) area occupied by small farm land use; 3) number of non-family farms; 4) area occupied by non-family farms.

What's I'm really hoping to attain is a value that can represent the relations between percent area occupied by non-family farms in comparison with family farms.

I can obtain the total area of the municipality from municipality shapefile, but I don't think it makes sense to have a simple ratio of non-family farm area/municipality area as there will be various other forms of land use.

Any suggestions on how to calculate a spatial GINI using this data set, or a different statistic that makes more sense?


texts: Can Esri ASCII Input files be Aligned with Track Heading in QGIS?

texts: Using QGIS to input Esri ASCII data files, I uploaded many small files, each file representing a second of data: 16 sensors X 25 lines. Each file uploaded creates a small rectangle on my larger map layer. The default MAP Orientation of Esri ascii files is with the Top edge of the rectangle facing North and Right/Left sides pointing Directly North. I want to ROTATE this MAP rectangle, during INPUT, so the Right/Left edges would be at an Angle to North.  Is there a command line option that allows this?


texts: Displaying only points within a polygon I created in QGIS?

texts:
Thank you in advance for any advice you might give me. I am new to qgis and believe what I'm asking is probably fairly basic. I am trying to map policing activity in NYC for two areas: one area in the Bronx and another in Manhattan.

I want to display ALL of the activity but only WITHIN a couple of square blocks that I am interested in (not the whole precinct - which I have a shapefile for with boundaries already set). My assumption, is that I create a polygon outlining the block areas I want.

But then, how do I attach those boundary coordinates to my csv database on police activity (that dataset has x y coordinates representing police activity)?

And then, how do I only display the activity within the boundaries rather than all of the activity that exists throughout NYC?

Thanks so much for any links, resources or explanations that might lead me to answering these questions


texts: Where can I find a shapefile of zoning for the city of Phoenix and other municipalities?  I would rather not have to geo-reference a picture and digitize over it, there must be some data already out there somewhere!


texts: Mangled table names and choice of geometry when there are multiple geometry columns

texts:
I have a PostGIS (2.4) table tt with multiple geometry columns, geom, geom1, geom2. When loaded into QGIS (3.0.1), the table is displayed with the table name plus a geometry column name, such as tt.geom1, and the mangled name is now different from the true table name in the database.

I tried to avoid the difference by placing the conventional geom column before the geom1 column. But  the same result is the same.

Is there a way to config QGIS to disable the mangling of table names?

-- EDIT --

It is a problem to me because the column chosen by QGIS (geom1) isn't the one I wanted to show/use as the geometry (It's geom instead). geom1 contains reference data not intended to be used as the main geometry. I don't seem to have control on which geometric column to use.

Now I need to be careful about having additional geometry columns in PostGIS because of the choices made in QGIS. Would be nice if I can somehow control it or disable it.


texts: List all EPSG projections to serve it on the client side

texts:
I am building web app that allows user to convert and reproject their spatial data and then download it. I am using flask and ogr2ogr to achieve this.
Now, I want to give users a list of EPSG projections so they can choose to transform data to desired projection. I was thinking to populate select element in the in the html page using javascript  so they can choose and then take input value to ogr2ogr function on the backend.
How can I get all available projection and serve it to user?


texts:
I am working with huge regions defined by polygons in the Pacific ocean.

Some polygons can be huge and spread from 140E to 180E and from 10N to 40N for example.
If I calculate the area of this polygon (A0) for example using the Cylindrical Equal Area (World), I get a value in square km.

However, If i split my main polygon in 2 smaller polygons and I calculate the areas of the 2 smaller polygons (A1 & A2) using the same projection, the sum of the 2 areas will be slighty higher than the area of the big unique polygon:

A1+A2>A0

I would expect to get A1+A2=A0...

I have checked the topology, tried to densify my polygons, checked the snapping of the vertices of my polygons but everything seems to be fine on these sides...

Why do I have such a difference?


texts:
I am trying to use the Viewshed Analysis plugin in QGIS to create what is sometimes known as an 'inverse viewshed' - essentially querying where I can see points from the ground, rather than where I can see the ground from points. (Same result as a viewshed, and usually the same GIS query, but just answering a different question.)

I have a raster DEM (ELEVATION RASTER), and a points shapefile (OBSERVATION POINTS) which contains a field denoting height above ground for each point.

My issue is that because I want to query which areas of the DEM my points are visible from, rather than the opposite way around, I want to set a viewer height on the ground of 2m (in effect adding 2m height to each sampled Z value point within my DEM).

I know this can be done in ArcGIS using OFFSETA / OFFSETB, but in the plugin in QGIS I only have the option to set the height of the observation points (which I have set to the field showing their height above ground).

Is there a simple way to do this?

Should I create an additional field in my points shapefile adding an additional 2m on to the current height above ground - resulting in an extra 2m on each point height but a 0m height on the ground - or will this give an erroneous result?

Should I create a new DTM 2m higher than the original?


texts: Function to generate a Centroid on the Largest Polygon

texts:
I am trying to create a function of a common sql routine I run.

Basically it returns the 1 centroid per polygon from a table of polygons (mixed geom types. Has both polygons and multipolygons).

My table is this:

  CREATE TABLE poly_and_multipoly (

  "id" SERIAL NOT NULL PRIMARY KEY,

  "name" char(1) NOT NULL,

  "the_geom" geometry NOT NULL

);

-- add data, A is a polygon, B is a multipolygon

INSERT INTO poly_and_multipoly (name, the_geom) VALUES (

    'A', 'POLYGON((7.7 3.8,7.7 5.8,9.0 5.8,7.7 3.8))'::geometry

    ), (

    'B',

    'MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))'::geometry

);

So far my function looks like this. I am stumbling a bit on the logic of putting my sql statements into the function. I know I need to do a

SELECT DISTINCT ON (id)

... based on the ...

ST_Area(the_geom)

...of the broken out Multipolygons created with...

SELECT id,
    ST_GeometryN(the_geom, generate_series(1, ST_NumGeometries(the_geom))) AS the_geom
FROM poly_and_multipoly ;

...but after that it starts getting a bit hazy (i.e. how to fit this in the function). Any thoughts?

       CREATE OR REPLACE FUNCTION make_it_center(id, the_geom)
    RETURNS geometry AS $$
    BEGIN
    -- Filter Polygons from Multipolygons
       IF (ST_GeometryType(the_geom) like 'ST_Polygon') then
       ST_PointOnSurface(the_geom)
    -- IF IT is a Multipolygon, Find the Largest Polygon, Return a Centroid
    -- of the largest polygon
       IF (ST_GeometryType(the_geom) like 'ST_MultiPolygon') then
...
       SELECT

       RETURN point;
    END;
    $$
    LANGUAGE plpgsql ;


texts: Users unable to access organisation Basemap Gallery in ArcGIS Online

texts:
I have created a group (call it "Basemaps") in my organisation account in ArcGIS Online and published a number of maps with a single layer defined as a basemap.  These maps are all hosted on ArcGIS Server 10.2.1.  All of these maps are shared both with the organisation and the "Basemaps" group.

I have then added a number of users to the "Basemaps" group.

I have also edited the Organisation settings in ArcGIS online to use the basemap gallery from the "Basemaps" group rather than the standard ESRI basemaps.

When I go to create a new map and click on the basemaps gallery, I see a drop-down with all the basemaps I have created.  If I click on these I am able to use them.

When any other user who has been added to the "Basemaps" group does the same, they see the basemaps I have created, but when they click on it they get an error telling them that the basemap is unavailable.

Any ideas what I might have missed?
Is there a setting in ArcGIS online which I need to change?
Or is there something at the ArcGIS Server end which I need to change?


texts: Removing Slivers/Holes From Polygons using ArcGIS for Desktop?

texts:
I have a village level shapefile. Using Dissolve_management, I collapse the villages to district level. I also use Multi_Part option to prevent multiple entries for same polygon and so the resulting file has one row for each district.

The issue is that the village file has very tiny gaps between villages. When I use Dissolve_management, these gaps/slivers/holes are appearing in the resulting District Polygons. Since there are hundreds of these districts and within each district there are multiple slivers, I want to automate the process of sliver removal from within the polygons.

Is there a way to remove these empty spaces/slivers from the larger district polygons?

I want these slivers to be part of the polygons they lie in.


texts: How to sum up multiple columns values into one single column

texts: I have one table containing many columns. Using field calculator, I want to create a new column containing (for each line) the sum of all columns values. Pretty dumb, but just cannot find the correct expression to do this sum...


texts: Installing Rasterio and GDAL API in a virtuallenv in Windows 10

texts:
Following rasterio installation guidelines (rasterio.readthedocs.io)
I downloaded the relevant wheel files from Cristoph's list (link)
and installed them successfully on my Windows 10 system. Yet I am failing to install them in my virtualenv I created using Pycharm. For sanity check, I tested I was able to install numpy with pip in the virtualenv.

$ pip install -U pip
$ pip install GDAL-1.11.2-cp27-none-win32.whl
$ pip install rasterio-0.24.0-cp27-none-win32.whl

Unfrutently the red error message is not very informative. I have checked the bases I know such as, the system, and python are 64, pip is linked to python 3.8. This is all I can think of. Below you can see a few of my steps.

Update:
It seems that setting up the virtual environment manual from the Command Prompt and not Pycharm paved the way to a successful GDFAL and Rasteiro installation.

Download virtualenv: C:\Users\t>pip install --user virtualenv
Create virtualenv: C:\Users\t\Downloads>python -m venv
Activate: C:\Users\t\Downloads>test_virtual_env_i\env\Scripts\activate

Then installing the respective downloaded GDAL wheel worked out of the box:

(env) C:\Users\t\Downloads>pip install GDAL-3.0.2-cp38-cp38-
win_amd64.whl
(env) C:\Users\esaiet\Downloads>pip install rasterio-1.1.1-cp38-cp38-win_amd64.whl

Before I can conclude the issue is resolved, the qyestion is what is the difference between the my virtualenv installation and Pycharm.


texts: Calculating variable buffers using slope between river and point 100' away using ArcGIS Pro?

texts:
I have a network of streams that I need to buffer based on a basic rule set. This buffer will depend on the slope.

The slope is determined by the looking at the difference in elevation between a given point on the river and a point 100 feet away on a line perpendicular to the river at that point,  in either direction.

Rules

If the slope is greater than 40% (as determined above) than the buffer shall be 200'
If the slope is less than or equal to 40% (as determined above) than the buffer shall be 100'

I have 2 slope layers.   One is a 30-meter raster and the other is a 0.5-meter raster.

Using ArcGIS Pro, I was able to create perpendicular transects of 200' so that they are 100' on each side of the river. I also was able to create points at the intersection, midpoint and the end of each line. Now I can sample the underlying elevation, calculate the slope and then bring the lines back in and attribute them with the slope. I don't know how I would proceed from here.

Is this the best method to obtain this variable buffer?   If it is a good method,  how might I go about creating a buffered polygon after determining the set of points that define my buffer distance?


texts: Are there tools to directly import QGIS projects into Tilemill?

texts: Now that there is a tool to convert an MXD to Tilemill, one must then wonder if the ability to open QGIS documents in Tilemill will ever exist.


texts: GeoServer does not display/preview pgRouting Layer

texts:
I am developing a routing application using GeoServer, PostgreSQL, HTML and JavaScript. To display the routing layer on the HTML webpage, I followed the instructions from this workshop. GeoServer does not preview the pgRouting layer. The Error message is: "Internal Error: Rendering Process failed".
I used the following query when I created the pgRouting SQL view inside geoserver:
    SELECT geom FROM pgr_fromAtoB('roads', %x1%, %y1%, %x2%, %y2%
  ) ORDER BY seq) AS route

This query uses the function pgr_fromAtoB. I Created this function in PostgreSQL as follows:
    IN edges_subset varchar,
    IN x1 double precision,
    IN y1 double precision,
    IN x2 double precision,
    IN y2 double precision,
    OUT seq INTEGER,
    OUT cost FLOAT,
    OUT name TEXT,
    OUT geom geometry,
    OUT heading FLOAT
)
RETURNS SETOF record AS
$BODY$

WITH
dijkstra AS (
    SELECT * FROM pgr_dijkstra(
        'SELECT gid as id, source, target, length AS cost FROM ' || $1,
        -- source
        (SELECT id FROM roads_vertices_pgr
            ORDER BY the_geom <-> ST_SetSRID(ST_Point(x1,y1),4326) LIMIT 1),
        -- target
        (SELECT id FROM roads_vertices_pgr
            ORDER BY the_geom <-> ST_SetSRID(ST_Point(x2,y2),4326) LIMIT 1),
        false) -- undirected
    ),
    with_geom AS (
        SELECT dijkstra.seq, dijkstra.cost, roads.name,
        CASE
            WHEN dijkstra.node = roads.source THEN geom
            ELSE ST_Reverse(geom)
        END AS route_geom
        FROM dijkstra JOIN roads
        ON (edge = gid) ORDER BY seq
    )
    SELECT *,
    ST_azimuth(ST_StartPoint(route_geom), ST_EndPoint(route_geom))
    FROM with_geom;
$BODY$
LANGUAGE 'sql';

I cannot figure out if the error is within the function I created or somewhere else. I ran the dijkstra algorithm on the roads shapefile inside PostgreSQL and it works fine. There is no projection or geometry issue either. Please, Can anyone suggest a solution to this??


texts:
So, it appears that I can rename a store name (both DataStores and CoverageStores) from the WebUI (v2.13.2 and 2.15.2) but I cannot do it via the REST API.

It returns a 403 error when I do this:
curl -v -u admin:password -XPUT -H "Content-type: application/xml" -d "my_new_store" http://geoserver:8080/geoserver/rest/workspaces/my_workspace/datastores/mystore.xml

As this (https://docs.geoserver.org/stable/en/user/rest/api/datastores.html) states, you cant do a rename:
 PUT that changes name of data store    returns 403.

So, how is the WebUI doing it? Is there any way, I can use that functionality.

And, the same question applies to renaming workspace as well.
Works in WebUI. Returns 403 in REST API.


texts: Summing values from multiple polygons per neighbourhood in QGIS?

texts:
I'm measuring different values of urban parks (groundwater recharge, CO2 sequestration etc.), assignning values to the park polygons as attributes of a layer. Now I would like tu sum them up to have an overall score per neighbourhood in another layer, something similar to the picture I attach.
I guess it should be something simple but I still can't find the way to do it.

I'm working with QGIS 2.18.


texts: How to fetch openlayers layers from pyqgis?

texts:
My objective is to fetch maps provided by openLayers, as in openLayers_plugin, from a stand alone python script. I would like to get it superposed to my shp file.

As can be read on http://www.qgis.org/fr/docs/pyqgis_developer_cookbook/loadlayer.html

layer = QgsVectorLayer(data_source, layer_name, provider_name)
if not layer.isValid():print "Layer failed to load!"

provide a good way for loading layer in a stand alone python script. And it's possible to do it as well for wfs data source, or other data source types.
I do it with shp files, and it works well, but what is the uri related to openLayers datas and maps  ?

I also tried to get openLayers_plugin ...

sys.path.append(r"C:\usr\python\plugins\openlayers_plugin")
qgis.utils.loadPlugin('openlayers')
qgis.utils.startPlugin('openlayers')
print qgis.utils.isPluginLoaded('openlayers') # return False

Is it possible to use openlayers plugin in stand alone pyqgis script ?
cf [ Can I use QGIS plugins in PyQGIS as a stand alone script without iface? ]
which is deprecated now. No it's not ?


texts: Using rendercomplete for vector layer in OpenLayers 5

texts:
I am interested to add a preloader on the web page, cause i'm loading on the map a 15mb vector, so when all layers are loaded on the map i will hide the preloader.

I have found the rendercomplete function in the API docs, how can i implement this?

something like

map.rendercomplete(function(){
//...
})

Vector:

var vector = new ol.layer.Vector({
    source: new ol.source.Vector({
    url: 'getjson.json',
    format: new ol.format.GeoJSON()
    }),style:style_simple
});

Map:

var map = new ol.Map({
  target: 'map',
  layers: [roadlayer,vector],
    controls: ol.control.defaults().extend([new ol.control.ScaleLine()]),
    view: new ol.View({
    center: ol.proj.fromLonLat([33.33386, 35.14710]),
    zoom: 14,
    maxZoom: 19
  })
});


texts: Classification and measurement of feature basing on scan

texts:
It`s not entirely a GIS question, however maybe somebody can help.

I need to automatically classify and then measure area of certain elements on image. That image is a scan of a thin wood slice and I need to classify vessels (so, in fact, holes in this slice).

Is it possible in QGIS, ArcGIS or IDRISI Selva to measure area of elements on scanned image while knowing the resolution of scan?

Example image:


texts: Postgis ST_Azimuth only returning a small range of angles

texts:
I have a puzzler with postgis and ST_Azimuth.

I have a table of points (taken from country borders, and run through the QChainage plugin). I want to find the azimuth from a fixed point (15.0,50.0) to each chainage point.

What I want to do is this;

create a circle centred on NULL island (0,0)
points form a circle of radius one degree
angles corresponding to azimuth.

Running this query gives me what I expect; angles are between 0 and 2*PI (with some outliers above this). I translate points so the center is moved to (0,0)

select
    st_azimuth(
        st_setsrid(
            st_makepoint(0,0),
            4326
        )
        ,
        ST_translate(geom,ST_x(geom)-15.0,ST_y(geom)-50.0)
    ) as azimuth

from
    qqq3lines
order by azimuth asc

To do this, I created a unit vector - a line from (0,0) to (0,1), and rotate it by the azimuth, then take the end point.

select
    st_asewkt(
        st_endpoint(
            st_rotate(
                -- unit vector, facing north
                st_makeline(
                    st_setsrid(st_makepoint(0,0),4326),
                    st_setsrid(st_makepoint(0,1),4326)
                ),
                -- rotate by azimuth between central point and this point
                st_azimuth(
                    st_setsrid(
                        st_makepoint(0,0),
                        4326
                    )
                    ,
                    ST_translate(geom,ST_x(geom)-15.0,ST_y(geom)-50.0)
                )
            )
        )
    ) as pt

from
    qqq3lines

But when I plot this in QGIS, I only seem to get a 'fan', a limited range of angles.
I was expecting a more complete circle.

The same things happen if I try to do this with custom QGIS python function in the field calculator, using the QGSPoint.azimuth(QGSPoint) method.

What am I doing wrong?


texts: Looking for a tool like (IDW) for raster

texts:
I am looking for a tool that gives the same outputs like the IDW, but for rasters instead of points. I have a Corine land cover raster layer in ArcMap 10.2 with different friction values, displaying habitat suitability for a particular animal species. Among others the layer includes open land and forests. I would like to display different friction values for open land, based on their distance to forest. What means that open land close to forest is better than open land further away from forest.
I could do that by creating several buffers around the forest raster cells and add these to the original layer, but I am wondering whether there is a tool, that could simplify this.


texts:
I have a code that calculates the sum of water recharge for a pixel for a 9 year period (This piece of code works fine, just thought I would show how it is made just in case.  The values range from 0 to 207379mm per 1km cell):

for variable in variables:
    env.workspace = "G:\\Faculty\\Mann\\GFDLA2_BCM\\Aggregated1080"             #   "G:/CA_270m_GFDLA2/Aggregated1080/"
    scenario = "_A2"    # "" for historical
    # limit to current variable
    relevant_tifnames = filter(lambda x: str(variable) in x,tifnames)
    print('FOR VARIABLE:'+str(variable))

    for year in base_year[0:1]:
        print('limiting to '+str(year)+' to '+ str((year+years_to_end)))  # limit to time period of interest
        relevant_tifnames_year = [v for v in relevant_tifnames if int(re.sub('[^0-9]','',v) or 0) >= year and int(re.sub('[^0-9]','',v) or 0) <= year+years_to_end ]
        period_sum = CellStatistics(relevant_tifnames_year, "SUM", "DATA")
        period_sum2 = Con(period_sum<0,0,period_sum)

I then want to summarize this data by water shed unit (hydo units range in size from 4108 cells to 25, with 190 units in all):

hydro_units  = Raster("G:\\Faculty\\Mann\\Share\\Environemental Factors\\Watersheds FRAP\\HydroUnit.tif")
# calc sum of recharge for each hydro uni
waterzone = ZonalStatistics(hydro_units  , "Value", period_sum2 , "SUM", "NODATA")

Sends back this error:

Failed to copy raster dataset ERROR 010240: Could not save raster dataset to G:\Faculty\Mann\GFDLA2_BCM\WaterAggregated1080\g_g5214 with output format GRID. Failed to execute (ZonalStatistics).

The same happens with "AVERAGE" or "MINIMUM" etc.

Any thoughts on why this is happening? At first I thought the "SUM" values where too large, but MINIMUM shouldn't have the same issue.   Any thoughts?


texts: How to define projection of a raster file in ecognition?

texts: I have a raster file with no spatial reference. How can I define a projection for the image in ecognition software for classification purposes?


texts: Openlayers filter strategy on wfs deactivate problem

texts:
I have a filter control which works nicely. However, when I try to reset/remove the filter, I don't get the original features back. The debugger shows my features array as still only being the reduced number of features, yet shows the filter strategy as being inactive.

I set up the strategy on layer instantiation like this:

this.strategies = {
    bbox: new OpenLayers.Strategy.BBOX(),
    filter: new OpenLayers.Strategy.Filter(),
};

// initialisation stuff here ...

layer = new OpenLayers.Layer.Vector(
    this.layerName, {
        projection: this.projection,
        strategies: [
            this.strategies.bbox,
            this.strategies.filter,
        ],
        protocol: protocol,
        styleMap: styleMap,
    }
);

I set the filter like this:

filter: function () {

    var olLayer = this.olLayer;
    var attribute = document.getElementById
        ( "layer-search-attribute" ).value;
    var value = document.getElementById( "layer-search-value" ).value;
    var type = OpenLayers.Filter.Comparison.LIKE;
    var filter = new OpenLayers.Filter.Comparison({
        type: type,
        property: attribute,
        value: value,
    });

    this.strategies.filter.activate();
    this.strategies.filter.setFilter( filter );
    olLayer.redraw();

    // back to the map page
    $.mobile.changePage( "#mappage" );
}, // end filter ()

And I remove it like this:

resetFilter: function () {
    console.log("Removing filter on:", this.layerName );
    var olLayer = this.olLayer;

    this.strategies.filter.deactivate();
    olLayer.redraw();

    // back to the map page
    $.mobile.changePage( "#mappage" );
}, // end resetFilter ()

I've also tried olLayer.refresh({ force: true }) without success.


texts:
I need to pass my longitudes and latitudes of origin and destination for a sql view in geoserver to get a WMS layer with the route.
I've performed in qgis to view and is working perfectly.

This is the view in geoserver:

This my code to add the layer on the map, I'm using leaflet.

function findRoute(){
 route = L.tileLayer.wms("http://localhost:8888/geoserver/pgrouting/wms", {
     layers: 'pgrouting',
     viewparams: [x1:paramOrigemLng;y1:paramOrigemLat;x2:paramDestino1Lng;y2:paramDestino1Lat]
    });
}

Can anyone give me an example of layer viewparams the key format: value with leaflet because I'm not hitting the syntax.
I'm doing as the link: http://docs.geoserver.org/stable/en/user/data/database/sqlview.html


texts: How to deal with popups for clusters in openlayers?

texts:
I have an openlayers map which generates points from an array as vector features, with popups for these features, which works fine. Since I have so many points on this map, I have started working with cluster strategy. I can get the popups working fine on the points using the cluster strategy, but only the nonclustered points. I can get the popup to show the info for the first point of the cluster, but what I want to be able to do is have the popup display the info for each feature in the cluster, possibly with pagination or arrows that will allow the user to go through each.

I have seen olwidget and i like the way it handles popups, but I can't seem to find any example of how to get it working with an existing map/layer, if possible.
Is there a solution? I would prefer to use olwidget because i like the fact that the popups are styled with css


texts: How to reproject to other projections than WGS84 or Webmercator?

texts:
I have an OpenLayers map with a vector layer to add points on. I'm using Google Maps as the base layer. After the point is added, I need to store the data in my database as lat/long and x/y. Can I transform the projection of the x/y points or convert the lat/long to x/y? The x/y that is on the point is in spherical mercator so it doesn't work for me.

Update:
I'm not having any trouble converting the x/y to lat/long. I want to convert the x/y that I have to a different projection. I'm not sure that's the right terminology, but I need to convert the x/y values.

Update:
The SRID I need is 3734. When I drop the point, the x/y is like:
x: -9058948.6891836
y: 5035248.6338434

But what I need looks more like:
x: 2282175.42
y: 545126.58

I'm also using PostGIS so if this is possible to do with PostGIS I'm open to that also.


texts: Reprojecting shapefile to raster projection

texts:
I need to rasterize my shapefile. This can only happen if both raster and shapefile are in same projection. I don't know if they are in same projection.

How do I compare the projection of these two files?

Vector layer

I converted my csv to shapefile using gdal and vrt file.

<OGRVRTDataSource>
    <OGRVRTLayer name="tomato">
        <SrcDataSource relativeToVRT="1">tomato.csv</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryField reportSrcColumn="false" encoding="PointFromColumns" x="longitude" y="latitude"/>
        <Field name="name" src="name" type="String" />
    </OGRVRTLayer>
</OGRVRTDataSource>

My csv was in format (name,longitude,latitude)

I got the projection of this shapefile using the following code.

layer = dataSource.GetLayerByIndex(0)
spatial_ref = layer.GetSpatialRef()
proj4 = spatial_ref.ExportToProj4()
print('Layer projection is: {proj4}\n'.format(proj4=proj4))

The layer projection turns out to be

Layer projection is: +proj=longlat +datum=WGS84 +no_defs

Raster layer

My raster layer is landsat 8 rgb color composite tiff file.
The projection of this tiff file is

proj = dataset.GetProjection()
print('Image projection:')
print(proj + '\n')

output :

PROJCS["WGS 84 / UTM zone 43N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32643"]]


texts:
We are hosting our feature service on Portal (version 10.6). The layer has 2 required fields (domain, non-nullable) and another field only used for symbology (domain, nullable). On the Portal web viewer, the edit window shows what we expect: the 2 required fields marked with an asterisk, and the other layer not required but still editable. However, when we view the map in Collector (version 20.2.1), all 3 fields show as required with an asterisk.
Has anyone seen anything similar or know of a work-around?


texts: ArcGIS Server tiled layer doesn't update on pan in OpenLayers

texts:
I'm trying to add an ArcGIS Server tiled/cached layer to OpenLayers. This is working using code modified from these samples.

The only problem is that when panning the map, the layer does not update to show data which was previously off the screen. In this example I've panned the map to the west, and the overlay data hasn't updated:

However, if I zoom (rather than pan) the layer does update. Do I need to explicitly call an update method on the layer when panning? Note that the first example script correctly updates after panning (but this is a basemap, not an overlay - does that make a difference?)

My sample code is available here. I need to hard-code the layerInfo parameters, rather than retrieving them at run-time (I obtained the values using ..../MapServer?f=json&pretty=true)

Thanks for any advice.

[EDIT: the layer does update when panning in Chrome or IE9, but not in FireFox or Opera.]

[EDIT2: if I switch the layer off then on in the moveend function, the layer correctly updates after panning in FireFox and Opera:

map.events.register("moveend", map, function() {
   var lyrs = map.getLayersByName("geology");
   if(lyrs.length > 0) {
      lyr = lyrs[0];
      lyr.setVisibility(false);
      lyr.setVisibility(true);
   }
});


texts: Assign global variable to field in related table

texts:
I'm able to get ESRI's ArcPad Login Form to assign a global variable to a field in the EDITFORM for Page1, but I actually want it to assign to a field in a related table (TABLEFORM), using an onload event.

The code below works to access the EDITFORM:

  Dim pForm
  Set pForm = ThisEvent.Object

  pForm.Pages("Page1").Controls("txtUser").Value =
  Application.UserProperties("LoggedInEmployee")

But I can't seem to find any documentation on how to access a related table using the same method.  This forum touches on my issue, but doesn't answer it.

Any help/advice would be great.


texts: Web-based map authoring with ArcGIS Server?

texts:
I am embarking on a project in which users will author, save, and share their own maps over the web. We will provide them with a large number of feature classes, but users will effectively author their own maps, map symbologies, etc.   Furthermore, they will create and edit their own feature classes, which they can both map and share with other users.

The model for AGS map services seems to be: author a map in ArcMap, save an MXD/MSD, publish. I'm struggling to understand how this can help us build a dynamic web mapping platform as described above. Can anyone offer some tips on how to go about it?


texts: Using rasterFromXYZ in R for QGIS under Krige-Baye

texts:
I am trying to run the script below in R for QGIS to produce a raster result.

Everything runs fine but the image is not produced since the command rasterFromXYZ encounters a mismatch of elements in the prediction locations and the predicted values.

How can I get the correct results?

    >MySript=group
    >rainfall= vector
    >output=output raster
    >require(sp)
    >require(geoR)
    >require(raster)
    >locss=pred_grid(c(35.06,35.7), c(-1.63,-1.0), by = 0.02)
    >data1=as.geodata(rainfall)
    >MC <- model.control(trend.d = "1st", trend.l = "1st", cov.model="matern",kappa = 1.5)
    >PC <- prior.control(phi.discrete = seq(0, 0.05, l = 40),phi.prior = "reciprocal", tausq.rel.prior = "unif",tausq.rel.discrete = seq(0, 0.005, l = 20))
    >OC <- output.control(n.post = length(locss[,1]), moments = T)
    >set.seed(268)
    >skb <- krige.bayes(data1, loc = locss,model = MC,prior = PC,output = OC)
    >output = rasterFromXYZ(cbind(locss, skb$predict))
    >image(output)

Results

>  output = rasterFromXYZ(cbind(locss, skb$predict))
>         Warning message:
>         In matrix(as.numeric(xyz), ncol = ncol(xyz), nrow = nrow(xyz)) :
>         NAs introduced by coercion


texts: How to make mapable geo data from a solid jpg/png

texts:
I have a bunch of hardiness zones, as you can see here: http://mangoly.herokuapp.com/workroom/googlemaps/zones/

They are solid colored PNG images. I know the geo coordinates of the bottom left hand corner of all the images (they are all in the same corner). I am able to add these to the Google Maps API as groundoverlays with no problem. However I would like to make these layers clickable. So my guess is I need to convert the images into some kind of vector/geo data format. Because since each image has white space, they are all stacked on top of each other. So when I click on a layer, it will think I am choosing top most image. I need to some how convert the image into a format that make google maps understand that I only care about the actual solid color and not the white space (polygons maybe?).

Any ideas?


texts: How to process topographic survey data in ArcGIS?

texts:
I am interested to find out how others process topographic survey data in ArcGIS. Often I am only given a text file or an Excel spreadsheet containing XYZ points and simple attribute information describing the type of the survey point (Tree line, Fence, Road, etc.).
Depending on the type of project I triangulate or interpolate to create a surface and then generate contours, etc.

I am not an AutoCAD user but several times I have seen data processed in AutoCAD and the results are better. It almost seems as if there was some additional information I am not getting in the "raw" files such as breaklines. I was pretty sure that breaklines also have to surveyed so perhaps I am not getting this data?

I've looked at the Survey Analyst extension but I believe it is mostly for those that maintain parcel data.

Here is an example of a file I usually receive (first 7 of about 300 lines):

1,5511228.9814,530805.7426,99.9952,FENCE
2,5511226.7724,530811.3644,99.9384,FENCE
3,5511227.5212,530810.4108,99.8974,ROAD
4,5511228.9384,530806.8423,99.9799,ROAD
5,5511233.1231,530808.9418,100.0096,ROAD
6,5511244.3647,530816.4054,100.0722,ROAD
7,5511251.4753,530825.3982,100.0103,ROAD


texts: Long trailing "firefronts" showing up on NASA's FIRMS map, looking a bit like rocket launches. Is this a known error?

texts:
I don't work in GIS, but I've recently become interested in satellite active fire monitoring, looking to correlate such data with the frequent pollution spikes we've been having in the city I live in. Today we had another of those spikes, so I checked the FIRMS site on a whim, and noticed this huge trail of supposed active fires originating from somewhere in Russia/Kazakhstan and stopping somewhere in my country. The path looks vaguely like a launch trajectory, or maybe a satellite's orbit.

I've only found one other mention of such an event on the Internet (as far as I could describe it properly), on r/conspiracy, where someone noticed a similar trajectory, also in Russia.

Anyone have any idea what this could be?


texts: Trying to use the %name% function in Model Builder to keep the original files name, but its not working

texts:
I am building a rather large model.  And I am trying to keep the files original name in the output file.  Example being.  Original File is called: Line.shp.  I want to dissolve Line.shp so in model builder I write the output dissolved files name as %Name%_dissolve.

However, I keep getting this error: ERROR 000354: The name contains invalid characters


texts: What CRS is used in historical maps on IEG-MAPS

texts:
Do anyone know what coordinate reference system is used in set of historical maps of Europe from Leibniz Institute of European History

Below sample map from set


texts: Viewing 3D XYZ vector file in QGIS with QGIS2threejs plugin

texts:
Anyone know how to view points (vector file) in 3D using QGIS2threeJS plugin? It seems to work for terrain models but is not simple to figure out 3d point cloud plotting.

See attached fig. I am plotting terrain model with points which contain a depth dimension and I cannot get them to plot below the surface of the terrain model. Also adjusting the size of points by an attribute did not seem to work.

Here is an example of some of the points in 3D that I want to visualize in QGIS.


texts:
I get an error when starting QGIS 3.
Then I type this into python console:

import matplotlib.pyplot as plt

See response below.
What is the problem?

Python Console
Use iface to access QGIS API interface or Type help(iface) for more info
Security warning: typing commands from an untrusted source can lead to data loss and/or leak
import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'matplotlib'

Something wrong with the installation?
Should I uninstall, delete everything and re-intall?


texts: Coord parameter not working in GeoServer SQL view WFS request

texts:
I try to use coords from two points collected in a JS file in order to send them to a WFS Geoserver request, connected to a SQL view which will create a buffer around the line composed of those two points.
My SQL view works fine with the default values in GeoServer, but I can't manage to have a request (with the exact same parameters values) working from the JS file.
Here is my JS code :
url1 = 'http://localhost:8080/geoserver/projetgeonum/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=projetgeonum%3A'
url2 = '&maxFeatures=50&outputFormat=application%2Fjson'
var dep_long = "7.14518"
var dep_lat = "43.99156"
var arr_long = "7.342542"
var arr_lat = "43.808902"
params = '&viewparams=dep_long:' + dep_long + ';dep_lat:' + dep_lat + ';arr_long:' + arr_long + ';arr_lat:' + arr_lat

Url building function for WFS request:
   function url_fun(type) {
        if (type == 'saison') {
            url = url1 + type + url2 + params
            console.log(url)
            return url
        } else if (type == 'milieu') {
            url = url1 + type + url2 + params + ';saison_code:' + user_saison
            return url
        } else if (type == 'sport') {
            url = url1 + type + url2 + params + ';saison_code:' + user_saison + ';milieu_code:' + user_milieu
            return url
        }
    }

Here is my SQL view:
SELECT DISTINCT saison, saison_code from sport_06
WHERE ST_Intersects(geom,
ST_Buffer(ST_Envelope(ST_GeomFromText('LINESTRING(%dep_long% %dep_lat%, %arr_long% %arr_lat%)', 4326)),0.01))

And here is the result of the preview in GeoServer, which is totally what I want:

Here is the url I build in the JS, with the parameters at the end:
http://localhost:8080/geoserver/projetgeonum/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=projetgeonum%3Asaison&maxFeatures=50&outputFormat=application%2Fjson&viewparams=dep_long:7.14518;dep_lat:43.99156;arr_long:7.342542;arr_lat:43.808902

And here is the error I get when trying to access this url (which syntax seems totally right for me):
<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
java.lang.RuntimeException: java.io.IOException java.io.IOExceptionInvalid value for parameter arr_long
</ServiceException>
</ServiceExceptionReport>

I tried first to use only one parameter in my SQL view, as ('LINESTRING(%coords%)', 4326), where I built the coords parameter such as 'float number float number, float number float number', but I let down this option as I didn't succeed to make GeoServer accept the comma in the middle, despite a backlash.
Any ideas?


texts: Standalone applications using QGIS and environment variables

texts:
I've tried going through IRC to see if people can help me out with this, but the medium seems a little clumsy for making any answers clear, so I'm going to try this instead.

I would like to program a standalone application using PyQGIS the way I can already program standalone applications using ArcPy.

PyQGIS itself is straightforward.  I have had no difficulty using running Python scripts within the QGIS console editor.  However, in order to use the Python bindings in a standalone script, I am advised I must change the environment settings using a batch script (I'm using Windows Vista at home, so we're talking batch scripting for Windows).  This has resulted in a mess on my end, as I don't really understand batch scripting, and I don't like the idea that I'm resetting an environment that needs to be a certain way for other applications I run.

I'm having difficulty understanding why the instructions for creating these settings are so unnecessarily complicated, and why they don't amount to one line of code saying "go to where the bindings are, make the libraries I want available for this program to use).  Certainly ArcPy doesn't require people to mess around with the computer's environmental settings, so I'm having difficulty understanding why PyQGIS does.  It seems to me people will simply give up rather than teach themselves Windows Batch Scripting Language.

Now, I notice that when I run a script in QGIS's console editor, it works.  Granted, it also makes the rest of QGIS unusable after the script runs, so I have to restart QGIS again afterwards, but the script works exactly as I programmed it to work.  But when I do so outside of the QGIS application, it does not.  The issue does not appear to be that I have failed to import some Python package automatically imported by the QGIS application (qgis.core and qgis.utils) - I have those import statements in my standalone script, along with all the other package imports the script requires.  This leads me to believe that the difference is that the QGIS application correctly sets external environment variables, but those variables are not set properly when I run it as a standalone script.

Additionally, when I run the script as a standalone script, it gets through all of the code without throwing an error; it simply does not do what the code commands.  When I run the script in the console editor, it does it all correctly.  When I run it as a standalone, it creates a window, then immediately destroys it, while throwing no errors.  So the intepreter understands everything I'm asking the script to do - it just won't do it.

Here is the script:

from PyQt4 import *
from PyQt4 import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from qgis.utils import *
import Tkinter
from Tkinter import *
import sys
import os

qgishome = "c:/OSGeo4W/apps/qgis/"
app = QgsApplication([], True)
QgsApplication.setPrefixPath(qgishome, True)
QgsApplication.initQgis()

canvas = QgsMapCanvas()
canvas.setCanvasColor(Qt.yellow)
canvas.enableAntiAliasing(True)
canvas.show()

layer = QgsVectorLayer(r"c:/GIS Data/fed308/cpc.shp", "Ridings", "ogr")
reg = QgsMapLayerRegistry.instance()
reg.addMapLayer(layer)
canvas.setExtent(layer.extent())
canvas.setLayerSet([QgsMapCanvasLayer(layer)])
QgsApplication.exitQgis()

Please...is there some way I can run this script outside of QGIS and have it work as it does within QGIS (ideally without shutting things down at the very end)?

QGIS is a wonderful program, and PyQGIS seems as intuitive as ArcPy does and would be a real advantage for an open source software to have - but if people have to go through all the hoops I have gone through already, and still not have standalone application access to PyQGIS libraries the way they do have access to ArcPy, it seems to me PyQGIS won't be of much use to people.  I hope I'm wrong and this is easier than it thus far has been.  Does anyone have a solution?


texts: QGIS distance matrix: wrong metric distance


texts: I have a WMS version 1.3.0 which I want to use in a WebMapping application. The problem is that this application requires WMS version 1.1.1. Is there any way or tool to translate it from 1.3.0 to 1.1.1, like generate WMS version 1.1.1 from WMS 1.3.0 (maybe through GeoServer or FME) ?


texts:
I am using QGIS 2.18.0 on Windows 10.

I have a set of observations (1,428 points) for a given species (presence only data). These data were generated from a convenience sampling (hunters, field observations by biologists, etc.) and thus they are subjected to strong spatial bias.

Experts tell me that I should build a sampling bias surface in order to account for that bias in my analyses (Maxent).

To do so, I need to select at least one variable which is highly correlated with the density of observations.

I have two such variables in mind, namely 1) a shapefile with all the roads in the study area, and 2) a raster of population density.

The rationale behind using variable 1 (roads) would be that, in general, hunters tend to get their prey near to roads. However, I am having a hard time finding a way around the analysis.

One alternative might be to generate a regular grid, measure the total length of roads and the number of observations within each cell. Then, I could extract those values and perform count regression to see if the association between counts and density of roads is statistically significant. If so, then I can use that layer as sampling bias surface.


texts: GRASS - Create 3d Raster map with time as vertical unit

texts:
I'm working with 2d climatic (annual max temperature) raster maps. I have 1961-1990 time period and I want to calculate 90th percentile of the climatic value within that period (so 30 maps) and inside a defined area (e.g. raster_area). I set raster_area as region, with g.region. Then I tried to use r.to.rast3 to create 3draster map: the command works, with no errors, but then when I use r3.univar to calculate 90th Percentile the output is wrong, something as all statistics equal to 16 (ssd, mean, median, max, min, 90th percentile).
So is there an option to set vertical resolution for 3d raster creation (and the resolution would be 1 year in my case, as I have annual maps for 1961-1990), so that I know that all settings are correct?
Also, but this is a different question, as I have to use the 90th Percentile in another formula (future WSDI: number of consecutive days with tmax > 90th P of historical) is there a way to extract that value and use it in r.mapcalc? I found a "grep" operator, but it seems not to work. Maybe I use it in a wrong way.


texts: Leaflet map.locate, very long response time

texts:
I'm using leafletknn to search the nearest geojson element from the user location. I add a map.locate method that zoom to the user location. The response time is longer than when I directly use it... why ?

var  gjLayer = L.geoJson(geoJsonData);

document.getElementById('button').onclick = function() {
    navigator.geolocation.getCurrentPosition(function(pos)
    {
        var res = leafletKnn(gjLayer).nearest(
            [pos.coords.longitude, pos.coords.latitude], 1);

        if (res.length) {
            document.getElementById('button').innerHTML =
                'The nearest element is at ' +
                res[0].layer.feature.properties.cityname;

            map.locate({setView: true});
        } else {
            document.getElementById('button').innerHTML = 'error';
        }
    });
};


texts: What are the licence limitations on the free Ordnance Survey (OS) data sets?

texts: The OS has some “free” map data, but what am I allowed to use it for?


texts: I have a polygon layer and each polygon has the MEAN elevation as an attribute. I want to write a python script to loop through each polygon and compare its elevation with its neighboring polygons. If a surrounded polygon has lower elevation, it should store the result in a table as (From-To).


texts: Redirect if Clicked on a Marker in CartoDB

texts:
How can the user be redirected if he clicks on a marker in CartoDB?

I have a dataset with the markers — the geometry and inside of the description-field the URL to redirect the user. I know I can redirect the user by calling on('featureClick') and then change the window.location … but how can I change the window.location to set it to the description-value of my dataset? I've tried with sql.execute but failed (Access-Control-Allow-Origin………). Any Ideas?

My Example: (not working)

      var d = layers[1].getSubLayer(2),
          d2 = layers[1].getSubLayer(3);

      d.setInteraction(true);
      d.infowindow.set({sanitizeTemplate:false});
      d.infowindow.set('template',$('#infowindow_template').html());

      d2.setInteraction(true);
      d2.on('featureClick', function(e, latlng, pos, data) {
        cartodb.log.log(data.url);
        //window.location = data.url;
      });

                 });


texts: Choosing GPS app to use for mapping bus routes?

texts:
I am looking for a GPS app for android to capture waypoints and lines. I'm going to map the route buses and the stop points.

Which GPS app is recommended for marking “points” and marking the “lines”?

I'll be using it with ArcGIS in Brazil, South America.


texts:
I tried to install OpenGeo community edition 3.0.1 in Ubuntu 12.04. In the installation instruction it is mentioned that this version is supported only "10.04 and above"(http://suite.opengeo.org/opengeo-docs/installation/linux/ubuntu/suite.html). But except the 10.04 there is no other version available in apt (http://apt.opengeo.org/suite/v3/ubuntu/dists/).

So is there any way to install OpenGeo 3 in Ubuntu 12.04 or later versions?


texts: How to save all layers in a MXD with arcpy

texts:
I'm using this code and it does not work. I simply want to save the layer after I repair the source/symbology/etc without manually clicking, save as layer file and overwriting the file.

import arcpy

def layer_save(mxd_path):
    mxd = arcpy.mapping.MapDocument(mxd_path)
    fcs = arcpy.mapping.ListLayers(mxd)
    for item in fcs:
        item.save()

if __name__ == '__main__':
    mxd_p = r"H:\Test\python_output\4test.mxd"
    layer_save(mxd_p)


texts: Linking table of data without primary key to layer?

texts:
I have a parcel layer with the following attributes :

OBJECTID
PARCELNO
PARCELNOOL
MAHDARID
MAHDARNO
MAHDARDATE
PARCELNAME
PLANID
PLANNO
PLANBLOCKI
SUBMUNICIP
DISTRICT
LANDMARKID
PARCELSUBT
LANDUSEAGR
LANDUSEADE
SHAPE

And I'm trying to link it (Relationship) with table of data (Transactions) that have these attributes :

totalPrice, area , planNo,parcelNo

I try to link the table with planNo and parcelNo in parcel layer but the problem they can be duplicated.

I am thinking additionally to the planNo and parcelNo to use the Area in transactions table with SHAPE from parcel layer.

Is it possible to get the area from the shape?


texts: ArcGIS - Flow directions in the 4 cardinal directions only (North, East, South and West)

texts:
I would like to know if there is a way to calculate the flow directions in the 4 cardinal directions only (North, East, South and West). Indeed, ArcGIS transfers the flows in the 8 directions, which I don't want.

Does anyone have any idea how to proceed?


texts: Is it possible to do a side by side install of ArcMap 10 & 10.1 using xp mode in windows 7?

texts:
My organization is running Arcgis 10.1 throughout the office. Staff currently is starting a project in which we need to use FEMA's HAZUS software. The problem is that HAZUS is only compatible with ArcGIS 10 SP 1&2. I was wondering if anyone here had attempted to do an install of 10.0 in Windows 7's xp mode virtualization. I have never used xp mode before and was wondering if it uses a separate drive partition from windows 7 or if this type of installation scenario is even possible.

If anyone has any experience with this type of scenario let me know how it went.


texts: Seed generate missing tiles for extra raster files in ImageMosaic using GeoServer

texts:
I would like GeoServer (via GeoWebCache) to update/generate tiles whenever a new raster file is added to a ImageMosaic store. I am testing the following procedure (unfortunately is not working):

Created a ImageMosaic store (points to a folder with the rasters)

Seeded the Tile Layer, all the tiles for all the zoom levels were created

Added a new raster to the ImageMosaic store

Updated the shapefile that GeoServer creates with a new polygon that covers the area of the added raster file (note that I also matched the "location" attribute). The shapefile is stored along with the raster files (same folder)

Used the "Seed - generate missing tiles" command expecting GeoServer will re-read the shapefile and hence generate the tiles for the new area, unfortunately GeoServer/GeoWebCache is not generating any tiles

What is wrong with the procedure described above?

I found some oddities with GeoServer while trying to generate the tiles:

After adding the extra raster, updating the shapefile, and refreshing the Store, the extra raster does show up in Layer Preview, but it doesn't when using the Tile Layers menu

When I use "Seed - generate missing tiles" (after updating the Bounding box), the task runs as if it was generating tiles but the number of PNGs/files/folders in the hard-drive doesn't change at all, it even gives the number of tiles completed...

When I open the WMS on QGIS all the rasters show but when zooming and panning the extra raster there are lags and delays (clearly because there aren't any pre-rendered tiles for the extra raster). The extra raster doesn't show up when using WMTS

I did truncate and then generate for the bounding box of the extra raster (as per @IanTurton's answer) but it didn't work either. No matter the bounding box coordinates I try the number of tiles never changes

If I chose "Reseed - regenerate all tiles", the task list will, again, show processes as if it was generating tiles, but the number of tiles in the hard-drive keeps the same


texts: How does the resolution of two raster images affect their correlation?

texts: My question is a bit theoretical. Imagine that I have two raster files (raster A and B). Raster A has grid cell size of 1 km and raster B has grid cell size of 100 m. I would like to like to estimate their correlation. I could use ‘Band Collection Statistic’ in ArcMap and check the results of the correlation matrix. ‘Band Collection Statistic’ uses the maximum cell size of the input raster files. Therefore, in this case, it would be 1 km from raster A. If the minimum cell size was used instead of the maximum (i.e. 100 m) and upsampling took place for raster A beforehand (to convert 1 km to 100 m resolution), how different would the correlation be? Is it going to increase, decrease, stay the same and why?


texts: I have two fields in my model, the first is a spatial join return for the township, the second is a spatical join to a city. If there is not city, then the field is left blank.  The column that has the city name, I wanted to use a if/then statment to fill in the blank columns with the township name, does anyone have any idea how I would write this or if this is even possible?


texts: Distort image to Mercator Projection view

texts:
i have an image that rendered from data i have on my DB. i need to convert this image, with Mercator Projection method, to distorted image that when i'll wrap a 3d sphere with it it'll looks realistic.

do anyone know what are the formulas i need to use to make the distorted image?

P.S. i'm using PHP with GD.

update:

  in which format is your original data?

my data is saved as XML, but we'll do here some optimizations after that so save it compressed with some binary algo.

the rendering process has already done and i already have the rendered image as 2d view but without the distortion that should be in images that under Mercator Projection.

to explain more about my needs, i attached link to album 2 photos i uploaded: '2dBefore.jpg' is an example images that show how it's looks like after the data rendering but before the Mercator Projection distortion, and '2dAfter.jpg' show how the image should be looks like after the Mercator Projection distortion

as i understood, the distortion being worse as much as your going north or south from the equator and i need to know how to do that with code (and not with Gimp as i did now)

I'll also explain you generally about my project:
it's a game that each user on it should locate on specific location against a planet (sphere).
in the game, there are 2 modes:
1. 2d mode - that show maps on 2d view with the users' data on it.
2. 3d mode - that show a sphere with the users' data on it.
it's like takes Google maps and Google earth together on the same application.
when a player zoom out/in he'll pass between the modes.

i already mapped the world by longitude and latitude and each user have his own coordinate, the rendering of the data on the 2d maps (using PHP and GD) working fine (I'm consider the world like that: http://www.dsscentral.info/dishtips/world105.gif) but in the 3d map i have some hard-times to understands how i should distort it, as you probably understand from the above.


texts:
I have two different point shapefiles and a road network. I have used closest facility to find shortest route between the two.

In the result section I have received only 143 lines; the remaining data was not processed. Please can anyone tell me the process how to get the total result.


texts: Iteratively Updating Just Bottom Row in Table using ArcPy?

texts:
I see lots of examples of updating a specific column down ALL rows of a table, for example:

with arcpy.da.UpdateCursor(Input_Layer, ['Column_1','Column_2']) as cursor:
    for row in cursor:
         row.setValue('Column_1', value1)
         row.setValue('Column_2', value2)

...but how do you update a specific field in JUST ONE row (specifically the bottom, currently blank row)?

Selecting specific row in attribute table using ArcPy (without iterating through whole table)? explains how to point to a specific row that already exists, but in my case the row/column I want to update is currently blank and has no other columns I can use to specify it.

My code will begin a loop, gather 3 numerical values (based on calculations from other columns in the table), and then store those 3 values in 3 (initially) blank "tally columns", but again, only in the first row .

The next time through the loop the three "tally columns" would be updated with the newly calculated values, but now only in row 2.

And then row 3, etc...

The following image shows my original table (green columns) plus the summary statistics that I wish to add (orange columns) by iterating through multiple uses of SelectLayerByAttribute_management and then UpdateCursor.

The image tries to capture a point during my repeated looping where SelectLayerByAttribute_management is fed the following values...

value1 = "01"
value2 = "030"
value3 = "003"

...for the following query.

query = '"{0}" = {1} AND "{2}" = {3} AND "{4}" = {5}'.format(column1, value1, column2, value2, column3, value3)

...and then updates the 3 "tally columns" in just the highlighted row you see in the orange section (which at that time is the newest row at the bottom).

Here's the Key:  Each time through the code will update the "tally columns" in only the bottom row (which is initially blank) .

How can I refer to that bottom, initially blank row?  Using an index?  For example, if I employed a counter variable, x, starting at 0 and then increased it by one (x+=1) each time through the loop, something like this would work?

with arcpy.da.UpdateCursor(Input_Layer, ['locator','area','sum']) as cursor:
    row[x].setValue('locator', value1)
    row[x].setValue('area', value2)
    row[x].setValue('sum', value2)

Or perhaps a Where Clause will be useful?  But in that case I would be interested in "the next row that is currently blank" and I don't know how to code that statement.


texts: Make rectangles from agricultural field sizes (ArcGIS 10)

texts:
I got a task to do as research assistant of which im not sure how to do..

I have a layer with field polygons of agricultural fields (pretty large scale).

I want to create rectangles for each field by using the field size information. The rectangles have to have a define width (each field the same width), so the size of the rectangle is only up to the length for the respective field and they have to be adjacent to each other. I hope it can be automated this far, that if the basis layer information (field size) changes also the rectangulars change.


texts:
I seem to be having a lot of trouble uploading Utah Trails onto my nuvi 50 GPS.  Is it not possible?  The Black hills national forest has a img file that is able to be loaded onto the GPS, but the maps I have for Utah, are in kmz.  I have converted them into a gpx, and QGIS tries to upload them, but it seems that the only thing that goes across is way points.  Do I need to convert it to an img files?  Is there a way to do this in QGIS or something else?

Thanks for any help, I am not sure how many hours I have spent spinning my wheels here.


texts: Function to reduce and export summary data using biome feature collection in Google Earth Engine

texts:
I want to be able to use a feature collection with continental biome classifications and reduced an NDVI trend I made for each biome on each continent. I know how to do this the very inefficient way, but is there a way to write a function that loops through all of the biomes in a single continent without me having to code it all out by hand?
This is what I have so far for one biome in one continent (I highly recommend looking at the script linked below):
var africa = continents.filter(ee.Filter.eq('CONTINENT','Africa'));
var asia = continents.filter(ee.Filter.eq('CONTINENT','Asia'));
var australia = continents.filter(ee.Filter.eq('CONTINENT','Australia'));
var europe = continents.filter(ee.Filter.eq('CONTINENT','Europe'));
var nam = continents.filter(ee.Filter.eq('CONTINENT','North America'));
var oceania = continents.filter(ee.Filter.eq('CONTINENT','Oceania'));
var sam = continents.filter(ee.Filter.eq('CONTINENT','South America'));

var cats = tnc.aggregate_array('WWF_MHTNAM');
var cats_list = ee.List(cats);
var biomes = cats_list.distinct()
print(biomes);

var tropical_coniferous_forests = tnc.filter(ee.Filter.eq('WWF_MHTNAM','Tropical and Subtropical Coniferous Forests'));
var africa_tropical_coniferous_forests_mean = fit_year_ndvi.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: africa,
  scale: 500,
  tileScale:8,
  maxPixels: 1e12
});
Export.table.toDrive({
  collection: ee.FeatureCollection([
    ee.Feature(null, africa_tropical_coniferous_forests_mean)
  ]),
  description: 'africa_tropical_coniferous_forests_mean',
  fileFormat: 'CSV',
  folder: 'africa_biome_trends'
});

Link to script: https://code.earthengine.google.com/d23a5acd90580b3771075e4457163538
Link to continents asset: https://code.earthengine.google.com/?asset=users/anna_odell/continents
Link to "tnc" asset: https://code.earthengine.google.com/?asset=users/anna_odell/tnc_terr_ecoregions


texts: Editing PostGIS layer from ArcGIS Desktop without Enterprise Geodatabase (ArcSDE)?

texts:
I have been working with QGIS/PostGIS for a while now, without problems, but now I have to change QGIS for ArcGIS Desktop 10.1.

I am having trouble adding a layer from PostgreSQL and being able to edit that layer. I want to work directly with the database, and if I change something in the map it should be reflected on the database.

Can I do this without a Geodatabase?


texts: Python geoprocessing output parameter as feature layer on arcgis javascript api?

texts:
How i can get result of this query in Arcgis Javascript Api??
or how i should publish the its services to work and send for me result??
i run this query and it works in ArcMap but when i publish  it , i receive  this  error

  '"Invalid return value: in_memory/Buffers2"'

as messages on Arcgis Javascript Api..

import arcpy
arcpy.env.workspace = "c:/ArcpyBook/data/TravisCounty"
streams = "Streams.shp"
distance = "2640 Feet"
bahman='in_memory/Buffers2'
arcpy.Buffer_analysis(streams,bahman,distance,'FULL','ROUND','ALL')
arcpy.SetParameterAsText(0,bahman)

tanks to your  answers
i already do this test  query  and it work fine for me

import arcpy
Input=arcpy.GetParameterAsText(0)
Input=Input+':: http://gis.stackexchange.com'
arcpy.AddMessage('Input is :'+Input)
arcpy.SetParameterAsText(1,Input)

next i add script in ArcMap  then run this script and publish  the result and  call services in Arcgis javascript api

indeed i want to do Geometric network analyze in my app that show results with Arcgis Javascript Api

in esri tutorials i find to do it with ModdelBuilder next run it and  then publish result.
in that tutorial set defalt parameter to

in_memory\{68225AF2-773D-4B79-BBD3-EE72DE8999E3}

i know 'in_memory' refrenced to inmemory workspace but do not undrestand this value '{68225AF2-773D-4B79-BBD3-EE72DE8999E3}'

is there any way to acomplish this steps only with python??
i want set input and outPut parameters in python script.i do not want set this parameters in ModelBuilder...


texts: Are there open source solutions for travel demand modelling?

texts:
I'm looking for open source tools for travel demand modelling (eg The four-step UTMS). Preferably in a GIS environment. That works well with Qgis, Grass and Postgis.

My question is not related to particular use case more research related.
My initial search had come up blank so I wanted confirmation.


texts: I am trying to download images using SRTM download, but then this error pops up after the download has been completed

texts:
2021-05-26T13:28:44     WARNING    Traceback (most recent call last):
  File "C:/Users/Paul Maritz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SRTM-Downloader\download.py", line 100, in reply_finished
  f = open(self.filename, 'wb')
  PermissionError: [Errno 13] Permission denied: 'C:/Users/Paul Maritz/Documents/Stelmi/QGIS/S26E028.SRTMGL1.hgt.zip'


texts: How to use the raster calculator in the processing modeler of QGIS

texts:
I am trying to create a easy way to do raster analysis by building a model for two way raster calculations. I have two raster layers that I want to combine into a single raster. For now I've done this manually by doing the raster calculation myself but for the future I want to be able to input these layers into a model without having to go through the trouble.

What is the proper annotation of this formula?

How I've tried it is not working.