texts: Using Python to move Text Elements for creating multi-page PDF

texts:
I have a map document which contains several text elements that I have grouped and am able to programmatically update. These groups represent a page of data.

Now I'd like to export this data as a two-page PDF. Where Group 1 = page1 and Group 2  = page 2. I've been looking to data driven pages but can't get my head round if this is even possible.

I understand how to use Data Driven pages for changing map extents (Data Driven Pages and exporting PDF using Python) etc.. but not this specific issue of moving text element groups to and from the layout page, taking a snap-shot as the next page, and exporting as a map book.

Does anyone have experience with this making multi-page PDFs by moving text elements across the layout page? - I hope the image below indicates what I'm trying to do in ArcMap 10.2


texts: How to re-enable coded value domain descriptions?

texts:
I have got a Personal Geodatabase with a feature class and several coded value domains. Domains are assigned to some of the attributes of said feature class. Domains are correctly defined and match the field's attribute types. The attribute values are within the defined domains.

Somehow the coded value descriptions are no longer displayed and instead I can see the 'raw' attribute values. Which, of course, I don't want to see.

How do I tell ArcMap/ArcCatalog to display the domain descriptions instead of attribute values?


texts: How to do line based accuracy assessment with pyqgis

texts:
I would like to have a line based accuracy assessment between two line vector layers. For this it might an idea to create buffers around all lines of each layer and compute the % of overlay and % of difference. Before starting to code this, I wanted to check if there is anything already available that would do something similar.

I also thought about creating a buffer around all lines, then converting the vector layers to raster layers and applying r.kappa...

Any other ideas? =)


texts: Solar radiation analysis with ArcGIS Desktop 10.4

texts:
I'm not an expert in GIS, I learnt it recently, and I'm trying to improve my skills.

I'm trying to calculate the loss of solar radiation at a specific point due to surrounding topography.
I'm basically trying to understand how to do what is explained on ArcGIS help website: http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/modeling-solar-radiation.htm

I have also found this paper that achieves exactly what I would like to do: http://www.esri.com/news/arcuser/0309/files/solar.pdf

My issue is that I don't understand the process.

So far, I have managed to:

Generate a viewshed (from a point and a DEM): I've got a raster that shows me what area of the sky is not visible (a mountain range at the horizon).
Generate a skymap for diffuse radiation calculation: I've got a raster with time of the year and time of the day.
Generate a sunmap for the period I want to know, for direct radiation calculation.

In theory, I understand I have to overlay my viewshed raster with my skymap. The ratio will show me the loss of diffused radiation. Same for the sunmap for direct radiation.

But I have no idea how to do it. ArcGIS help about equations is too complicated for me, I would like to know how to do it in ArcGIS. I don't understand the values of my generated rasters, and I'm not sure they are sufficient to calculate what I want.

I would also like to be precise that I don't intend to calculate radiation for an area yet. Only for a point now, and the only outcome I want is a loss ratio for both diffuse and direct radiation.

Other question: once I have done it, how can I add scales and axis to the graph generated by ArcGIS? Is there a way to do it with ArcMap or it's a Photoshop thing?


texts: Dividing raster cell into smaller cells and evenly spreading values to new cells using ArcGIS Desktop

texts:
I need to divide/split raster cells into smaller cells (i.e. coarse to fine resolution) and then evenly assign values of the original cell to the finer cells. For example - focusing on a single cell for simplicity - I have a 5km x 5km cell with a value of say 100. I need to split that cell into 25 1km cells (5km x 5km) and evenly distribute the value of 100 across the 25 cells, meaning each 1km cell gets a value of 4 (100/25 = 4).

I am using ArcGIS Desktop 10.4.1.


texts: Creating polygon in empty space from other polygons in QGIS?

texts:
I have a vector file where I have made some polygons but between the polygons I have empty space.

This entire empty space I would like to make one whole polygon but until now I can't figure out the way to do it.


texts: Import raster data type from 'PostgreSQL bytea field' to raster layer in QGIS

texts:
I have a table with some images into Binary Data Types field of PostgreSQL (bytea). I want to import them into a QGIS layer but the program does not recognize the fields.
What I can do?


texts: Installing File Geodatabase (*.gdb) support in QGIS?

texts:
I have spent around 2 days to find the way to open GDB (Esri geodatabase) in QGIS (or any other open source software) but still without success.

I have downloaded the newest OSGeo4W installer and tried the setup - express desktop install - all packages, as well as advanced install incl gdal-filegdb.

Can you describe a more detailed procedure, including installation and how to open .gdb in QGIS (OSGeo4W installation)?


texts:
I have the task of inserting a polygon in a map with a specific size. My idea is to simply "draw" a polygon and keep on enhacing its size, until it reaches the size I actually want to be. Its basically an easy task, but i'm wondering if i could directly have the polygon in the size i want it to be. I went through the vector-tools, but nothing seemed to do the trick.
I'm using QGIS 2.18.3 (Las Palmas)


texts: Adding text as ICON in mapinfo in mapinfo buttons

texts:
It's a question with yes or no answer and if yes How? Is it possible to add text label as icon in mapinfo buttons.

Instead of :

Create buttonpad "sitestatusbutton" As
  ToggleButton
    ID 1011
  Icon MI_CURSOR_FINGER_LEFT <--------------------here
      Calling site_statusAction
      HelpMsg siteStatus(1)
Show

Something like:

Create buttonpad "sitestatusbutton" As
  ToggleButton
    ID 1011
  Icon "MYICON"&lt;-------------here
      Calling site_statusAction
      HelpMsg siteStatus(1)
Show</li>


texts: Complex polyline traversing with searchcursor

texts:
I have a very specific question about searchcursor traversing complex polyline.

My setup is: I imported public transport routes as a single polyline with length in meters. Along this polyline I want to place points with equal distance between them. For that I have found these tools:

one at How can i create points per 10 and 100 meters for several lines with ArcPy? on this site; and
Create Points From Lines at ArcGIS.com.

After creating a route from lines with unique start and end points the results from the toolboxes are the same (eventhough the polyline is still multipart, see comments). Now it is also consistent with Construct points editing tool.

Construct points tool shows before constructing the line directions as follows:

So, my question is how does the search cursor traverse through the polyline parts in red squares? (i have added the squares for clarity)


texts: How to calculate 90% confidence interval in a raster stack

texts:
I have a stack of grid files (23) in ASC format from a MODIS sensor and I need to calculate a 90% confidence interval, mean, min, etc, for each one in R, how can I do that? specially the interval.

## set working directory
FilesPath <- "C:/Users/Grettel/ "
setwd(FilesPath)
FileList <- list.files()

# Loop for all grids by julian days and create stats
for (i in  unique(substring(FileList,40,42))){

  print(as.character(paste(i,sep="")))

  JulianDay<-as.character(paste(i,sep=""))

  # Create output directory
  WriteFolder<-paste(FilesPath,"StatsGrids",sep="")
  dir.create(paste(WriteFolder))

  # list files by pattern of julian day
  FilesToRead<-list.files(pattern=paste("*",JulianDay,"*", sep=""))
  print(FilesToRead)

  # create raster stack
  FilesStack<-stack(FilesToRead)

  # mean files
  meanRaster<-mean(FilesStack)
  # min files
  minRaster<-min(FilesStack)
  # max files
  maxRaster<-max(FilesStack)
  # sd files
  sdRaster <-calc(FilesStack, fun = sd)

  # intervalo confianza
  #CIRaster <- ci(meanRaster, conf.level = 0.9)

  # write new asci into output folder
  writeRaster(meanRaster,
              filename=paste(WriteFolder,
                             "/Modis_2000_2014_mean_JulDay_",
                             JulianDay, sep=""),
              overwrite=T, "ascii")
}


texts: Creating Attribute table to calculate fragmentation with FRAGSTAT?

texts:
I created with a LS8 image Buffers with the size of 1/2/3km. For each buffer, which has 3 classes I want to analyize the fragmentation. For that fragstat require a GeoTIFF image with an Attribute table.

My Problem is that I have a GeoTIFF image without an attribute table.

How I can create one?


texts: Trying to preserve attributes using SearchCursor

texts:
I am writing a python script for ArcGIS.  I'm fairly new to this so I hope I'm not missing something very obvious.  I am having trouble preserving the attributes of a polyline feature class when converting its vertices to points inside a search cursor loop.  So far the workaround I've come up with is to run FeatureVerticesToPoints_management outside of the cursor, then join it to the cursor results inside the cursor:

arcpy.FeatureVerticesToPoints_management(selectFCP, tempPtName, "ALL")
with arcpy.da.SearchCursor(selectFCP, "SHAPE@") as cursor:
    for row in cursor:
        arcpy.FeatureVerticesToPoints_management(row, tempPoint, "ALL")
        arcpy.SpatialJoin_analysis(tempPoint, tempPtName, tempPtJoin, "", "KEEP_ALL", "", "ARE_IDENTICAL_TO")

The FeatureVerticesToPoints_management only succeeds inside the cursor if I use the "SHAPE@" field by itself, but then none of the other attributes I'm interested in show up in the output.  If I try to use all the fields ("*") or list other attributes with the SHAPE@ field (e.g. ["SHAPE@", "field1"]), it fails.  Any ideas? I hope that made sense... I don't mind using the workaround but it is redundant and it seems like there should be a way to do this inside the cursor loop.

I am trying to work with one feature at a time for a series of operations inside the search cursor loop, which is why I can't just do the vertex->point conversion for all the lines outside of the loop-- just FYI.

I am able to get this to work in the python window in ArcGIS but not when running my script.  I'm thinking that maybe the problem is that the name of the field I'm trying to preserve is a Field-type parameter I collect from the user prior to running the search cursor in the script.  Here is the code that works in ArcMap.  It works when I define the variable field as a simple string prior to running it:

with arcpy.da.SearchCursor("parcel_area_input", ["SHAPE@", field]) as cursor:
    for row in cursor:
        arcpy.FeatureVerticesToPoints_management(row[0], tempPoint, "ALL")
        arcpy.AddField_management(tempPoint, field, "TEXT", "", "", "240")
        arcpy.CalculateField_management(tempPoint, field, "row[1]", "PYTHON")
        arcpy.Append_management("tempPoint", "fixPointsTEST", "NO_TEST")

This keeps all the line attributes, and keeps them together with the right points (I realized doing a spatial join didn't always join the attributes to the right point). Running this same code (not using feature layer names, of course) from my script, where field is a user-selected parameter derived from the input feature class, all the attributes are the same for all of the points instead of matching the row from which the points were created.

Do I need to define or use the parameter differently in my script, or set it up differently in the script options?

Right now it is set at arcpy.GetParameterAsText in my script, and the data type in the script properties is a Field that is derived from the input.


texts: OSM: How often does OpenStreetMap update their building footprint data?

texts:
I was wondering if anyone knows how often OpenStreetMap updates their building footprint data.

I can pull the building data from the Nominatim API but it does not indicate when that footprint was identified. Further, I checked the OSM buildings wiki, but did not see any info on an update schedule or frequency.

It would be nice to know how long a gap there is between footprint extractions, so that we can understand how those footprints change over time.


texts:
I'm trying to reproduce the R rasterize function in python to streamline my code and am having issues with summing multiple points in the raster. Essentially I want to sum the value of my variable for every point in the grid I create. However currently it only appears to be returning the value of the first point in the grid it sees.

import rasterio
import geopandas as gpd

def create_raster_defined_res(geodataset, output, out_var, resolution):
    res = (resolution, resolution)
    bounds = geodataset.total_bounds
    kwargs = {
            'count': 1,
            'crs': geodataset.crs['init'],
            'bounds': bounds,
            'width': max(int(ceil((bounds[2] - bounds[0]) / float(res[0]))), 1),
            'height': max(int(ceil((bounds[3] - bounds[1]) / float(res[1]))), 1),
            'affine': Affine(res[0], 0, bounds[0], 0, -res[1], bounds[3]),
            'transform': (bounds[0], res[0], 0, bounds[3], 0, -res[1]),
            'compress': 'lzw',
            'driver': u'GTiff',
            'dtype': 'float64',
            #'nodata': -1e+308
    }

    with rasterio.open(output, 'w', **kwargs) as out:
        out_arr = np.empty([kwargs['height'],kwargs['width']])

        # this is where we create a generator of geom, value pairs to use in rasterizing
        shapes = ((geom,value) for geom, value in zip(geodataset['geometry'], geodataset[out_var]))

        burned = rasterize(shapes=shapes, fill=0, out=out_arr, transform=kwargs['affine'])
        out.write_band(1, burned)

create_raster_defined_res(geopandas_dataset, output_tiff, output_var, 2500)

Is there a way to add a parameter to sum the value of all the points that enter into the grid or tell it to add instead of just taking the value of the first point?


texts:
Is there any Python library that facilitates the creation of topologies? I would like to create topologies using an open and portable format such as TopoJSON or GML.

The main goal is to save space in detailed polygonal topologies, with borders defined only once and shared among adjacent polygons.

The Python GDAL/OGR library, for instance, does not seem to support topologies.

Edit: I am not interested at this stage on ESRI's ArcInfo topology, I rather work with TopoJSON or GML.  Also, in that thread that is supposedly a duplicate, there is this claim:

  There are no Python pure geospatial modules dealing with the ArcInfo
  topology


texts: Count the length of all polylines from one shapefile within the segments of polygon of another shapefile

texts:
I have polylines with counted lengths. And i have the polygon shapefile (fishnet). I want to calculate the sum af lengh of polylines and amount of lines that are within the border of each segment of polygon (fishnet).

How do I can to do it using ArcGIS Desktop 10.1?

By "Counted lengths" I mean that I used "calculate geometry" to obtain lengths. I want to use fishnet to make a spline. For this I need to fill the column "sum", for example. But I do not want to use a ruler to measure the lengths of each line within the border of each cell of fishnet.

So I want to make it automatically using two shapefiles: stream orders (polylines) and fishnet (polygon).

Than I will put information to the point shapefile and make a spline. I did it before but I used ruler instead of ArcMap tools.


texts: Can we add features to geoserver layer using REST

texts:
As in ArcGIS Online, can we add the features to GeoServer layer though REST API?

If yes, can you tell me where i can find the help on this?

Or can you tell me how I can write my own REST API to Geoserver to add/Update the feature to Geoserver layer?


texts: Smoothing results from scipy griddata interpolatioin

texts:
I am using the griddata interpolation package in scipy, and an extrapolation function pulled from fatiando:

import numpy as np
import scipy
from scipy.interpolate import griddata
import matplotlib.pyplot as plt

def extrapolate_nans(x, y, v):
    '''
    Extrapolate the NaNs or masked values in a grid INPLACE using nearest
    value.

    .. warning:: Replaces the NaN or masked values of the original array!

    Parameters:

    * x, y : 1D arrays
        Arrays with the x and y coordinates of the data points.
    * v : 1D array
        Array with the scalar value assigned to the data points.

    Returns:

    * v : 1D array
        The array with NaNs or masked values extrapolated.
    '''

    if np.ma.is_masked(v):
        nans = v.mask
    else:
        nans = np.isnan(v)
    notnans = np.logical_not(nans)
    v[nans] = scipy.interpolate.griddata((x[notnans], y[notnans]), v[notnans],
        (x[nans], y[nans]), method='nearest').ravel()
    return v

grid_x, grid_y = np.mgrid[0:1.5:50j, 0:1.2:50j]
points = np.random.rand(50, 2)
values = np.random.random_integers(1,10,50)

x = []
y = []
for i in points:
    x.append(i[0])
    y.append(i[1])
n = plt.Normalize(values.min(), values.max())

grid_z = griddata(points, values, (grid_x, grid_y), method='cubic')
extrapolate_nans(grid_x,grid_y,grid_z)
plt.contourf(grid_x,grid_y,grid_z)
plt.scatter(x,y,c=values)
plt.colorbar()

plt.show()

I think the results are decent, but the problem is that the extrapolated values have a distinct zigzag pattern:

How do I smooth these lines?  Or is there an alternative interpolation method in python that will generate smoother results?


texts: Cannot open shapefiles in ArcGIS Desktop 10.3

texts:
I have shapefiles and mxds that were working fine in 10.1.  I then downloaded version 10.3 ArcGIS Desktop Advanced.  Now when I open the mxd, all of the data links are broken.  when I open properties to reset the data source, I get an error: "***Error opening Feature Class".  I get the same error on a blank map and adding a shapefile.

I tried to preview the same shapefiles in arcCatalog - I get the same error plus an additional that says "number of shapes does not match number of table records"

Any ideas?  My final strategy will be to uninstall 10.3 and go back to the earlier version.

There are some shapefiles that will open in ArcMap, but not very many. I haven't figured out a pattern yet. I can open ALL of the shapefiles fine in QGIS.

I've never had 10.1 on this device - I had to move my license over. I am on a Surface Pro with Windows 8.1 and 64 bit.

I did initially download Pro - and then realized my license didn't cover that, so then downloaded Desktop 10.3. Perhaps something in Pro is interfering? Still, some data works and some does not. Does anyone know if there are any utilities needed to "upgrade" shapefiles to 10.3? Is there a format or support change?

I did a clean uninstall.  Installed 10.2.2 instead.  Same issues.  I tried using Jody Marca's Shapefile fixer without effect.  Also went through the entire list of ESRI suggestions:  Check Geo, Repair Geo, delete portions of shapefile, etc.  I did notice that there is a lock file from my old computer on some of the unopenable shapefiles.  Continuing to hunt.


texts: WMS layer not displaying in Leaflet Time Dimension

texts:
I have a postgis table which is uploaded in Geoserver as WMS. The table is of a road ,has timestamp and contains around 250 records at 5min interval. It looks like this in openlayers

Now i want to visualize these with the help of a time slider plugin given at http://apps.socib.es/Leaflet.TimeDimension/examples/example1.html.

The code is as shown below

var map = L.map('map', {
fullscreenControl: true,
timeDimension: true,
timeDimensionControl: true,
zoom: 12,
center: [30.30, 78.05]
});

var m_wms ="http://localhost:8080/geoserver/mayur/wms";
var roads = L.tileLayer.wms(m_wms, {
layers: 'test3',
format: 'image/png',
transparent: true,
colorscalerange: '-0.4,0.4',
abovemaxcolor: "extend",
belowmincolor: "extend",
numcolorbands: 100,
styles: 'boxfill/rainbow'
});

var proxy = 'server/proxy.php';
var road_time = L.timeDimension.layer.wms(roads, {
proxy: proxy,
updateTimeDimension: true,
});

var overlayMaps = {
"Road Traffic Information": road_time
};

var baseLayers = getCommonBaseLayers(map); // see baselayers.js
L.control.layers(baseLayers, overlayMaps).addTo(map);

road_time.addTo(map);

As it can be seen below that time in time slider is updated with the time in the wms link. But i cannot see the layer.
The output is as shown

I have checked and the projection is also correct, but somehow i cannot see the layer in the map.

All suggestions are welcome


texts:
I found this, under the topic How to iterate through layers of an MXD? answered by Midavalo

I wanto to know if its possible to change something in the second line, to iterate through all data frames in the mxd.
It has the option to choose wich df, changing the number inside the racket.

I'm asking that because i want to run a script in all my mxd, in a folder. But i have a lot of them, and some have 3, 4 or five df.

Example: The script gets error, if i choose to run it in [5] and the mxd doesnt have it. So the script stops.

mxd = arcpy.mapping.MapDocument("CURRENT")  # Uses your currently open MXD
df = arcpy.mapping.ListDataFrames(mxd, '')[0] # Chooses the first dataframe
for lyr in arcpy.mapping.ListLayers(mxd, '', df): # Loop through layers
    # Any tools you want to run on each layer go here


texts: How to add different NDVI layers of Landsat 8 data from 2014 to 2019 to a map in Google Earth Engine?

texts:
I am trying to calculate NDVI for each month and masking NDVI images with lte(0) filter to identify water bodies and show the timelapse between encroachment area of waterbodies in different years and calculate the encroachment area between each year. But I am not able to add all the NDVI images of different years to the map. Here is the link to my code:

https://code.earthengine.google.com/eac8b5f4b0d1e30fc853ffd8bdb8be96

Here is my code:

var start = ee.Date.fromYMD(2014,1,01);
var end = ee.Date.fromYMD(2019,12,31).advance(1,'month');
var date_range = ee.DateRange(start,end);
var S3Month = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate(date_range)
.filterBounds(roi)
.map(function(img){
   return img.clip(roi).select().addBands(img.normalizedDifference(['B5', 'B4']).lte(0))});
 print(S3Month);

 Map.addLayer(S3Month, {min:-1, max: 1}, 'mm')
 Map.centerObject(roi,10);
 var listOfImages = S3Month.toList(20).getInfo();
 for (var i = 0; i <listOfImages.length; i++) {
  var img = listOfImages[i];
  Map.addLayer(ee.Image(img.id),{},img.id);
}


texts: QGIS 3 can not set a relative path to Form UI file

texts:
I have created a custom form ui file, and everything is working fine if I pass the absolute path of my ui file to QGIS.

But I need to use the relative path, because I need to package the project file and ui file together and give it to end users.

The .ui file is located beside the project .qgs file, and I tried the relative path as in the attached image, but the QGIS doesn't load my custom form.
I'm using QGIS 3.10.0 on a linux machine.


texts: Execute a field calculation on just selected records from Processing Toolbox in QGIS 3?

texts:
When I try to do a field calculation from the Processing Toolbox in QGIS 3 it performs the calculation on all records instead of the selected records. Is there a way to have the calculation performed only on the selected records using the Processing Toolbox Field Calculator?

The field calculator from the menu bar includes an option to "Only update [X] selected records" but that is missing from the Processing Toolbox.

Here's the dialog box from the Processing Toolbox:

Here's from the menu bar (and the attribute table)

I'm ultimately setting this all up in the Graphical Modeler so if there's a work around that fits there, that's ok.


texts: Tracking which LiDAR data tiles have been delivered?

texts:
My company works with LiDAR data for large electrical transmissions systems (thousands of miles in one project).  We model the transmission lines and do analysis using CAD and GIS workflows.  We break the system into lines or circuits (1-150 miles each) in order to process the data in smaller units. The LiDAR data itself is broken up into blocks (less than 1sq mile). We always struggle with tracking which blocks have been delivered and which lines are ready for the next step in our workflow.

We are less concerned with signaling when a process is complete and more concerned with determining if all of the necessary raw LiDAR data has been delivered from our collection partner. I know there are all sorts of business intelligence software platforms out there for managing workflows and documents and other contents, but I'm curious if anyone knows of an existing platform for managing lots of raw input data related to the workflow.

Do you know of any software platforms out there designed for this particular task? How do they work?


texts: Creating a raster from overlapping shape files

texts:
I have several polygons in a shapefile that overlap, each polygon also has a value ‘weight’ with equals 1 to 10.

How would I create a raster image in GDAL that would add up all the overlapping areas on the polygons using the ‘weight’ field to make a sort of heat map?  So areas with no overlap would remain ‘white’ , but where polygons overlap they would have a grayscale value proportionate to the total overlap value of the overlapping ‘weight’ fields, in overlapping polygon sections?


texts: Use ArcPy in an existing Python virtual environment

texts:
I have an existing virtual environment created by virtualenv. My ArcGIS Desktop is 10.7 on a Windows 64 OS. The virtual environment is in the version of 3.9.4, and is isolated from the current ArcGIS Python environment (Python 2.7). It has a few custom libraries installed.
ArcGIS Desktop installation: C:\Program Files (x86)\ArcGIS\Desktop10.7
Python installation of ArcGIS Desktop 10.7: C:\Python27\ArcGIS10.7
ArcPy installation: C:\Program Files (x86)\ArcGIS\Desktop10.7\arcpy\arcpy
Python 3.9.4 virtual environment: C:\project\venv
Is it possible and if so, how can I use ArcPy in the existing virtual environment?


texts: Is it possible to apply transparency to graphic elements in an ArcMap layout?  I'm specifically refering to a neatline -- a box containing my legend, source info, scale bar, etc.


texts: ArcGIS Pro Dissolve Boundaries Summary Fields

texts:
I'm using the dissolve boundaries tool to merge adjacent polygons. I want to calculate summary statistics on several fields for each of the output polygons. However, when I specify a summary field the output always has the same value for every single polygon (as though the statistics were calculated for a single multi-part feature, even though I have unchecked the 'create multi-part' option).

Using dissolve instead of dissolve boundaries seems to do the same thing. Is there any way to get the tool do what I want without writing some custom script?

EDIT: Updated example screenshots w/ attribute tables as requested

Before dissolve boundaries: Here, my goal is to dissolve these six records into two polygons (NOT a multipart polygon), and calculate the mean value of the "Brghtns" field independently for each. For example, the two records highlighted in blue should be dissolved into a single polygon with a average "Brghtns" value of ~98.05, and the four unhighlighted records should form a second polygon with average "Brghtn" value of ~81.

After dissolve boundaries. The geometries have done exactly what I want, but "Mean_Brghtns" value is the same for both, and it has been calculated as the mean value for ALL input polys in the input layer.

Note: there are many more records in the input FC than the ones being displayed in the attribute table for this example, hence the odd value of -6.66E21


texts: Dynamically load symbols preview to plugin

texts:
I am working on plugin which combines two *.qml files into new one. Now I'm trying to generate something like "list" in plugin interface. What I have done so far is saving repeated in both files keys in list and their symbols previews as svg files in two different directories.

What I want to know is if there is a way to display previews of symbols in my plugin window (in something like list)?

The difficulty is that I don't know how many symbols previews will be in that list - it could be once 3 and another time 20. It must be dynamically loaded then.

Here is a figure how I want it to be (sorry for making it in paint, it's only to understand my idea better):

Anyone has same problem?


texts: How to get rid of master password in QGIS 3

texts:
Is there way to get rid of the current master password in QGIS 3?

I want to start from scratch with a new master password and new auth. database. When I clear or erase the auth db (even delete qgis_auth.db from file-system) the old (forgotten) password is used.

When I "clear cached master password" I get a confirmation message that the master pass has been cleared.

Then I hit "Input master password", but nothing happens (no input dialog). After second attempt I got a "Master password already set" message.


texts: Long delay when updating rows of a feature layer or modifying elements of a graphic layer using arcObjects in java

texts:
We are developing a simple AddIn for arcMap for the first time using arcObjects in java. The application consists basically on the following steps:

1. Obtain a Network layer which was loaded in arcMap
2. Construct a graph using the network layer to run graph algorithms on it
3. Construct and add a different layer which shows one line for each edge of the graph
4. When a new calculation is required by the user run the graph algorithm.
5. Refresh graphically the lines of the new layer according to the graph algorithm results

We are asking for your help because we have computation time problems with the step 5. There are more than 27000 lines or edges. To update the color of the lines representing edges we have tried the following strategies:

A. Create a Feature layer with polylines, adding a new numerical field with values between 0-10. Assign a ClassBreaksRenderer to this layer. When the user requires a new calculation the numerical field must be updated (27000 updates) so the renderer will use a different color for the lines of the feature layer.

B. Create a graphic layer with Line elements. Create a collection of Symbols (20 different colors from a ramp). When the user requires a new calculation a new symbol is assigned to the line Elements (27000 assignments) so they will be painted with new colors according to the calculation.

The process A takes almost 3 minutes and the process B takes almost 2 minutes. This is without using any type of parallelization.

Measuring the computation time for the method A the slow action is to update the rows of the FeatureClass (6 milliseconds per feature). I tried the update cursor and the search cursor with similar results.

Measuring the computation time for the method B the slow action is to assign the symbol to the Line element (5 milliseconds per element).

We think the problem is that there are many communications with the arcMap framework. So if you have any idea how this process can be speeded up it would be very helpful. We’d like this refreshing process can be performed as fast as possible… Maybe 10 seconds? Do you think it is possible?


texts: Adding data to attribute table based on other shapefiles within certain distance using ArcGIS Desktop?

texts:
I have 3 feature classes. 2 of them are different types of water bodies (1 for polygons and 1 for lines), the other feature class contains locations of storage tanks. In the storage tank feature class, I am trying populate a column in the attribute table called Waterbody. It is supposed to contain the names of water bodies that are within a 2 mile radius of the storage tank. (see below)

Each of the 2 feature classes of water bodies contain similar attributes which give the name of the waterbody.(see below)

I have made a buffer for the Storage Tanks feature class, with the radius set to 2 miles but I'm not sure how I should go about getting the data in the attribute table. See below for an idea of what I am working with.

The points are the storage tank locations, the green "circles" are the buffers and the lines and irregular shaped polygons are the water bodies.


texts: How to set QgsPropertyCollection via an dict

texts:
I've to set some layer properties from all loaded layers using QgsPropertyCollection, and I handle it with this code below(doesn't have the loop for all layers yet it's for the activelayer only):

pc = QgsPropertyCollection('qpc')
lyr_settings  = QgsPalLayerSettings()
txt_format = QgsTextFormat()

layer = iface.activeLayer()

fz = QgsProperty()
fs = QgsProperty()
fc = QgsProperty()
fls = QgsProperty()
fws = QgsProperty()
mla = QgsProperty()
oxy = QgsProperty()
pri = QgsProperty()
lr = QgsProperty()
px = QgsProperty()
py = QgsProperty()
fz.setField("sizetxt")
fs.setField("styletxt")
fc.setField("casetxt")
fls.setField("letterspacing")
fws.setField("wordspacing")
mla.setField("justtxt")
oxy.setField("offset_txt")
pri.setField("priority")
lr.setField("rotation")
px.setField("offsetx")
py.setField("offsety")
pc.setProperty(0, fz)
pc.setProperty(21, fs)
pc.setProperty(27, fc)
pc.setProperty(28, fls)
pc.setProperty(29, fws)
pc.setProperty(31, '/')
pc.setProperty(32, 0.8)
pc.setProperty(33, mla)
pc.setProperty(77, 0)
pc.setProperty(78, oxy)
pc.setProperty(87, pri)
pc.setProperty(96, lr)
pc.setProperty(9, px)
pc.setProperty(10, py)

txt_format.setFont(QFont("Xerox Sans Serif Narrow"))
txt_format.setSizeUnit(QgsUnitTypes.RenderPoints)
txt_format.setColor(QColor(0,0,0))

lyr_settings.setFormat(txt_format)
lyr_settings.setDataDefinedProperties(pc)
lyr_settings.enabled = True
lyr_settings.fieldName = "legenda"
lyr_settings = QgsVectorLayerSimpleLabeling(lyr_settings)

layer.setLabelsEnabled(True)
layer.setLabeling(lyr_settings)
layer.triggerRepaint()

As you see it's huge :(( ! So, I've tried things to shorten this code unsuccessfully. The last one its the code below using dicts to pass the parameters to QgsPropertyCollection, but doesn't work.

pc = QgsPropertyCollection('qpc')
lyr_settings  = QgsPalLayerSettings()
txt_format = QgsTextFormat()

sf = {'fz':"sizetxt", 'fs':"styletxt", 'fc':"casetxt", 'fls':"letterspacing", 'fws':"wordspacing", 'mla':"justtxt", 'oxy':"offset_txt", 'pri':"priority", 'lr':"rotation", 'px':"offsetx", 'py':"offsety"}
sp = {0:'fz', 21:'fs', 27:'fc', 28:'fls', 29:'fws', 31:'/', 32:0.8, 33:'mla', 77:0, 78:'oxy', 87:'pri', 96:'lr', 9:'px', 10:'py'}

for k, v in sf.items():
    k = QgsProperty()
    k.setField(str(v))

for k, v in sp.items():
    pc.setProperty(k, str(v))

txt_format.setFont(QFont("Xerox Sans Serif Narrow"))
txt_format.setSizeUnit(QgsUnitTypes.RenderPoints)
txt_format.setColor(QColor(0,0,0))

lyr_settings.setFormat(txt_format)
lyr_settings.setDataDefinedProperties(pc)
lyr_settings.enabled = True
lyr_settings.fieldName = "legend"
lyr_settings = QgsVectorLayerSimpleLabeling(lyr_settings)

layer.setLabelsEnabled(True)
layer.setLabeling(lyr_settings)
layer.triggerRepaint()

This code doesn't return any errors, but don't set the parameters like previous one. Anyone can help to find what is missing in the code?


texts: ArcMap Way to merge two shapefiles and take the average of their polygons that overlap?

texts:
So I have two shapefiles that show storm surge height values for two different areas. Nevertheless, they overlap for a good portion of their areas. When I merge them together, it seems that the polygons in the overlap area default to showing the maximum height.

Is there a way for them to instead average together so the overlap can be an average of polygons from the different shapefiles rather than the maximum values?


texts:
I am currently plotting points on a Open Street Map and using the Lat and Long of a point I know of seems to yield different positions on Google Maps and Open Street Map.

//The standard for lat/long projection
var projection = new OpenLayers.Projection("EPSG:4326");;

//Set the bounds of the map controls, etc
var mapOptions = {
    controls: [
        new OpenLayers.Control.Navigation(),
        new OpenLayers.Control.PanZoomBar(),
        new OpenLayers.Control.Attribution(),
        new OpenLayers.Control.LayerSwitcher()
    ]
};

var map = new OpenLayers.Map("OpenStreetMap", mapOptions);
map.addLayer(new OpenLayers.Layer.OSM());

var testPointLonLat = new OpenLayers.LonLat(-1.4629669, 53.3822659).transform(
    projection, // transform from WGS 1984 (EU Equivalent)
    map.getProjectionObject() // to Spherical Mercator
);
var testPointMarker = new OpenLayers.Marker(testPointLonLat);

//Create a markers layer to add
var markers = new OpenLayers.Layer.Markers("Markers");

markers.addMarker(testPointMarker);

//Add all the markers which will be loaded via ajax shortly
map.addLayer(markers);

//Centers the map around a particular lon/lat at a specified zoom level
var zoom = 13;
map.setCenter(basePointLonLat, zoom);

This code has been taken from Open Street Maps website as part of one of their examples.

This is the basis of which I use to set a point of a known Lat/Long on a Map, in this case London Eye. On Google using the Lat/Long of the exact location on their map, I plotted it against a Open Street Map. The exact same co-ordinates appear incorrectly in the middle of the river:

Google Version

Open Street Map Version

I cannot seem to see the reason as to why the points are incorrectly placed with a margin of error with the same LatLong co-ordinates. I have a lot of points otherwise plotted and all of them are incorrectly placed too high or in the sea at times.

Tried updating to OpenLayers 3, still the same problem, points are never consistently placed on the map.

To add to this I swapped out OpenStreetMap to Bing Maps and the Lat/Long still appears in the wrong place so I have to assume it is something to do with OpenLayers.


texts:
Using QGis 2.16.3, I'm trying to perform a multi stage raster calculation. Trying to do the whole calculation using brackets to subset parts causes a memory issue; however running a raster calculation on the output of a previous raster calculation results in all pixels incorrectly taking on the same value.

For example:

(0.56*"Band3@1")+2

Returns a .tif file with pixels ranging from 402.922 to 4863.86 whereas

0.56*"Band3@1"

saved as Band3_R.tif and then using a second raster calculation of

"Band3_R@1"+2

returns a .tif file with all pixels being 2.

It is the same regardless of what operation I attempt on the output (addition, subtraction, multiplication or division).

Can you run a raster calculation on the output of a raster calculation? If so, how?


texts: Compiling plugin for QGIS with pb_tool or Makefile, in windows?

texts:
I created my pluging with pluging builder, after compile the resources file, i test my pluging in QGIS 2.8.2. I modify the ui file in QtDesigner, but i don't know how to compile it in order to see the changes that i made in the ui file.

Can you help me?


texts: Importing raster to QGIS gives CRS undefined error

texts:
I make a raster file from LiDAR .las files in SAGA. The CRS of .las is Slovenian National Grid. Then, I export it as GeoTiff (Import/Export - GDAL/OGR - Export GeoTiff). When I import it into QGIS (Project CRS is Slovenian National Grid) I get error CRS was undefined - and it sets it up to Project CRS. Almost everything is fine - Raster correlates with satellite image. It is just that I get little skewed raster. For example, when I try to do map through qgis2web I get this black bands at top and bottom:

What am I doing wrong?


texts: Mapping distance of animal locations to water points in dry and wet season

texts:
I have shapefiles of location data for around 40 collared animals as well as a shapefile layer of water points. I want to find out how water affects the movement of the collared animals. I thought of calculating and comparing distances of individuals from water sources in the dry and in the wet season.
I found the "Near" analysis tool in ArcGIS Pro, which allowed me to calculate the distance between a point and its nearest neighbour.
How can I do the same as above, but take into account the topography of the area, which will influence the distance (I have a DEM for my area)?


texts: How do I alter the "slanted/tilted view" of my QGIS Project?

texts: Version 2.14.14 (Essen) - I originally had a flat/2D/birds-eye view of my layers (all ESRI Shapefiles/Vector Layers) - please see the first image attached ().  However, I altered something without realising/remembering and now my view of the layers is slanted/tilted - please see the second image ().  How can I alter the view back to the original 2D/birds-eye view?  Is it something to do with the coordinate system or projection of layers?  I do apologise if it's something really obvious.


texts: Mapping x, y pixel coordinates to latitude and longitudes on the WGS84 datum

texts:
Apologies in advance for the long question, I am fairly confused at this point and I figure if I show my thought process any flaws early on in the piece can be more easily pointed out.

I have a grid of 1000 by 1000 (origin is top left), on which I'm drawing a variety of polygons. I'm trying to convert the x, y locations of each of the vertices of these polygons programmatically to longitude and latitude for use in geojson.

Effectively, I want to map my grid around the globe.

I have run into a few problems, I suspect largely because I'm fairly inexperienced with GIS. I spent some time reading up on what I could, this explanation of map projections and coordinate systems was particularly helpful, and after reading it and other sources, I had the following plan.

With the bounds of -180 degrees to 180 degrees longitude, and 84 to -80 latitude, I should be able to convert arbitrary geographic coordinates to geocentric (x, y) and then scale those values to exist between 0 and 1000, and reverse the process to go the other way.

For the tools to do this, I decided upon pyproj, a wrapper around proj4 as

1) We use python
2) It seems fairly specific to the task at hand which is usually a good sign

From my reading, the bounds of longitude and latitude (in the utm projection, which is what I plan to use) are -180 to 180, and 84 to -80

from pyproj import proj

p = Proj(proj='utm', zone='56H', ellps='WGS84')

def x_and_y(lon, lat):
    x, y = p(lon, lat, errcheck=True)
    return (x, y)

I thought i'd use the following code to work out the x, y values of the lat and long boundaries, and use when scaling from 0-1000 to whatever the min and max x and ys would be.

This is where I run into a brick wall, effectively.

1) Using 0, 0 as lat and long gives me RuntimeError: latitude or longitude exceeded limits, is this expected?
2) Actually, a lot of values give me errors, i.e., if I do the following:

longs = range(-180, 181, 12)
lats = range(84, -81, -4)

#print longs
#print lats

for lon in longs:
    for lat in lats:
        print '%s  %s' % (lon, lat)
        print '%s  %s' % x_and_y(lon, lat)

I get errors from and including -108 degrees longitude through to and including 60 degrees longitude.

At this point I realised my understanding must be fundamentally flawed and decided to turn to you.

I guess I have the following questions:

1) Am I travelling down the right path here? If my goal is to map (x, y) coordinates onto a global map, is this the way to go?
1a) If I'm not, recommendations?
2) Clearly my understanding is flawed, can anyone see and explain where and why?
3) Are there any tutorials or code samples around for this kind of thing? The pyproj documentation is fairly limited.

Finally, if anyone has recommended reading for this kind of work in general, I'd love a pointer or two on where to start.

Thanks for your time!

PS: If this is better suited for stack overflow, please let me know.


texts: Extracting small numpy array from a bigger raster, by moving windows. Memory issues. ArcGIS

texts:
I'm trying to extract a small raster from a bigger one, just using python and numpy (I'm not allow to use any other software). This code just reads a from a big raster, extracts an smaller window, convert it to numpy array, convert it back to raster format and then save the small raster (Stepping stone to add more complexity later).  RasterToNumpyArray seems to work fine, because I'm able to extract just a small patch from a bigger raster (8G+). So I'm running two nested loops in order to create the moving window. The running windows sweeps the source raster in (5 x 3, columns x rows). The code runs fine with the first inner loop. It generates two small rasters perfectly, but by the next rows run, I've got memory issues (type exceptions.MemoryError)

My thought is that RasterToNumpyArray doesn't loads all the raster in memory (and I don't think it does, otherwise It couln't load an 8G raster into 2G ram).
My question is: what is causing the memory issues? How to solve them?

Some specs: Using ArcGIS 10.2, Operating system Microsoft Windows 7 16bit, 16G RAM, I don't know about SWAP RAM.

ps: When using DefineProjection in an empty raster (or more precisely: in a raster with all its cells null), throws an error. That's why I  used try/except within the nested loops.

This is a portion of the code:

  for rows in range (0,4):
      for columns in range (0,5):
          arcpy.AddMessage('> Attempt to extract raster [row]-[col]: [' + str(rows)+ ']-['+str(columns)+']...')
          try:
              small_raster_lower_left  = arcpy.Point(large_raster_extent.XMin + (columns * window_size * large_raster_cellsize_X),
                                                     large_raster_extent.YMin + (rows    * window_size * large_raster_cellsize_Y)
                                                     )

              arcpy.AddMessage('> Raster to Numpy...')
              numpy_array  = arcpy.RasterToNumPyArray(large_raster,
                                            small_raster_lower_left,
                                            window_size,
                                            window_size,
                                            nodata_to_value=-99999
                                            )

              arcpy.AddMessage('> small raster coordinates. X: {0}, Y: {1}'.format(small_raster_lower_left.X,small_raster_lower_left.Y))

              arcpy.AddMessage('> Numpy to raster...')
              small_raster = arcpy.NumPyArrayToRaster(numpy_array,
                                      small_raster_lower_left,
                                      large_raster_cellsize_X,
                                      large_raster_cellsize_Y,
                                      value_to_nodata = -99999
                                      )

              arcpy.DefineProjection_management(small_raster, large_raster_spatial_ref)
              small_raster_name = "small_dem_" + str(columns+rows*10)
              arcpy.AddMessage('> Success! Saving raster: ' + small_raster_name + '...')
              small_raster.save(small_raster_name)
              del numpy_array
              del small_raster

         except:
              arcpy.AddMessage('> Fault! Trying next window...')
              del numpy_array
              del small_raster


texts: What is Diffrent Between Version & Replica In ArcGIS Geodatabase

texts:
I know Versioning allows multiple editors to alter the same data in an enterprise or workgroup geodatabase without duplicating data and Geodatabase replica allows creates copies of data across two or more geodatabases such that changes to the data may be synchronized.

I am not really getting the point here! aren't they same? can someone please let me know what is exactly the use of Replica?


texts:
I need to download some Sentinel images from scihub-Copernicus to use them on an application.

Does anyone know how to obtain the sentinel raster for a region (I have the polygon coordinates) using cURL or Wget?


texts: Does QGIS 3.6.0 make use of GPUs in order to accomplish 2D tasks (rendering, zooming, panning...)?

texts: does anyone know whether last versions of QGIS (like last one, 3.6.0) make use of GPUs (either integrated or dedicated ones) in order to accomplish 2D tasks (rendering, zooming, panning...)? If it does, is GPU memory amount important for those tasks?


texts: How do I calculate a new field using existing fields?

texts:
I am trying to add a new field (float data type) and using existing fields to calculate the new field.

So far, I have:

import arcpy
path = 'pathname'  #in my code, this is actually the path name
arcpy.env.workspace = path

fclist = arcpy.ListFeatureClasses()
fc = fclist[1]

prop = 'PrYouth'  #name of new field
ftype = "FLOAT"  #Type of new field

thisField = arcpy.ListFields(fc, prop)
if len(thisField) == 0: #if length = 0 aka it does not exist yet, add field
    arcpy.AddField_management(fc, prop, ftype, "5", "4")  # 5 is precision, 4 is scale
else: #delete field then add new again
    arcpy.DeleteField_management(fc, prop)
    arcpy.AddField_management(fc, prop, ftype, "5", "4")  # 5 is precision, 4 is scale

with arcpy.da.UpdateCursor(fc, ['AGE_UNDER5','AGE_5_17','POP2000', prop]) as cursor:
    for row in cursor:
        kids = row[0] + row [1]
        row[3] = (kids/row[2])
        cursor.updateRow(row)

I am unable to update the precision and scale values for float. I've tried to specify using field_precision = 5 and field_scale = 4, but this doesn't seem to work.

Also, how do I get the new field to calculate for the proportion? Am I using the right syntax?

Currently, I am only able to add the field and fill the list with 0.


texts: I am using Maxent in R for performing species distribution modeling. My problem is that raster::predict() is very slow because of the resolution and extent of my environmental data. Is there a way to parallel process the prediction step to speed this up? At the current time it is running for days and this creates problems.


texts: Arcpy code to loop trace geometric network give out of memory error

texts:
I have a distribution of points on a geometric network.  I have code to select a point, run an upstream trace on the network, select intersecting polygon features, sum some attributes from those polygons, and write the summation to the selected point.

The problem with the trace geometric network tool is that it returns a group layer.   My stand-alone script approach (not shown) would not return this group layer to Python.  I can run the script in the Python window of an ArcGIS 10.5 project though.

My script generates the group layer and adds it to the table of contents. I exploit the trace to get a selection and calculate my summation.  Then I remove the trace group layer output and continue to the next point.  After a few thousand iterations ArcGIS offers up a message box with the text:

  TooboxEXT Out of Memory

If I do not rename the group layer output from the trace geometric tool each iteration arcpy returns an error that the group layer already exists even though I can watch it get removed from the table of contents.  This suggests that the arcpy mapping module is not actually removing the group layer or that something is getting stuck in memory.

My question:  How do I remove or delete the group layer so that I do not end up with an out-of-memory error?

Here is the code.

import sys
import traceback
import numpy
import arcpy

inNodes = r'Z:\GISpublic\GerryG\WaterResources\WRIA1Growth\WRIA1_Growth_Outputs.gdb\flags'
inSSHIAPsegCat = r'Z:\GISpublic\GerryG\WaterResources\WRIA1Growth\OtherSupportingData\joinedandsummed.shp'
inGeometricNetwork = r'Z:\GISpublic\GerryG\WaterResources\WRIA1Growth\WRIA1_Growth_Outputs.gdb\gfd\gfd_Net'
mxd = arcpy.mapping.MapDocument("CURRENT")
fieldList = arcpy.ListFields(inNodes)
fieldList2 = []
for field in fieldList:
    fieldList2.append(field.name)
if "sum_1_4" not in fieldList2:
    arcpy.AddField_management(inNodes, "sum_1_4", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
if "sum_1_6" not in fieldList2:
    arcpy.AddField_management(inNodes, "sum_1_6", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
inNodessLayer = arcpy.MakeFeatureLayer_management(inNodes)
inSSHIAPsegCatLayer = arcpy.MakeFeatureLayer_management(inSSHIAPsegCat)
watershedsFields = ['sum1_4', 'sum1_6']
nodesFields = ["SHAPE@", "sum_1_4","sum_1_6"]
counter = 0

with arcpy.da.UpdateCursor(inNodessLayer, nodesFields) as cursor:
    for row in cursor:
        if row[1] == -999 or row[1] >= 0 :
            pass
        else:
            tracelayers = "tracelayers"+str(counter)
            traceselect = tracelayers +"/Flowlines"
            arcpy.TraceGeometricNetwork_management(inGeometricNetwork, tracelayers, row[0], "FIND_UPSTREAM_ACCUMULATION", "", "", "", "", "", "NO_TRACE_ENDS", "NO_TRACE_INDETERMINATE_FLOW", "", "", "AS_IS", "", "", "", "AS_IS")
            arcpy.SelectLayerByLocation_management (inSSHIAPsegCatLayer, "INTERSECT", traceselect)
            field = arcpy.da.TableToNumPyArray (inSSHIAPsegCatLayer, 'sum1_4', skip_nulls=True)
            sum1_4 = field['sum1_4'].sum()
            field = arcpy.da.TableToNumPyArray (inSSHIAPsegCatLayer, 'sum1_6', skip_nulls=True)
            sum1_6 = field['sum1_6'].sum()
            row[1]= sum1_4
            row[2]= sum1_6
            cursor.updateRow(row)
            arcpy.SelectLayerByAttribute_management(inSSHIAPsegCatLayer, "CLEAR_SELECTION")
            print "remove trace now..."
            dfList = arcpy.mapping.ListDataFrames(mxd, "*")
            for df in dfList:
                for lyr in arcpy.mapping.ListLayers(mxd, "", df):
                    if lyr.isGroupLayer:
                        if lyr.name == tracelayers:
                            arcpy.mapping.RemoveLayer(df, lyr)
        counter +=1


texts: Add date dimesnsion to image mosiac in GeoServer

texts:
I am trying to follow the instructions for how to enable time dimension to image mosaic in GeoServer:

https://docs.geoserver.org/latest/en/user/tutorials/imagemosaic_timeseries/imagemosaic_timeseries.html

I added several times the data source but when I add the layer time dimension is not available.

I didn't find how to do this:

  To support time-series layers, GeoServer needs to be run in a web
  container that has the timezone properly configured. To set the time
  zone to be Coordinated Universal Time (UTC), add this switch when
  launching the java process:

  -Duser.timezone=GMT If using a shapefile as the mosaic index store (see next section), another java process option is needed to enable
  support for timestamps in shapefile stores:

  -Dorg.geotools.shapefile.datetime=true

This is an example of my image names:
T30SYJ_20190918T105029_10m_RGB.tif

And the code in indexer.properties:

Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date,elevation:Double
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)
TimeAttribute=ingestion
Caching=false
AbsolutePath=false

And the code in timeregex.properties:

regex=[0-9]{8}T[0-9]{9}Z(\?!.\*[0-9]{8}T[0-9]{9}Z.\*)


texts: In Geoserver, is Max Render time for WMS adjusted according to metatile size?

texts:
Simply put, is max render time the limit per tile or in total for any given render job?  I am trying to tune Geoserver and could not find an answer for this question in the documentation.

If I increase the metatile size, I am requesting bigger chunks of data and the total render time for a 4x4 or 8x8 metatile is naturally expected to be longer than a single tile (especially with the additional data request time factored in).  When I reduced my metatile size from 8x8 to 4x4, it seemed to cause Geoserver to bail out on some render jobs even quicker, which is not what I expected.  Does anybody have the definitive answer?


texts: Replacing arcpy.AddMessage() with open source?

texts:
I've recently inherited some old python scripts that contained ArcPy modules. I'm using version 10.0.

I am looking for an error messaging system that replaces arcpy.AddMessage()?


texts: Loading Data with shp2pgsql and "Syntax error at or near shp2pgsql"

texts:
I want to import a shapefile using shp2pgsql function in the psql shell on Mac. I have created a spatial database (example_gis). By refering to this guide, having connected to this database, when I used:

example_gis=# shp2pgsql -s 4326 tl_2015_us_county.shp tl_2015_us_county postgres > tl_2015_us_county.sql;

An error was returned:

"ERROR:  syntax error at or near "shp2pgsql""

What is the possible reason?


texts: Hovering of a shape with OpenLayers doesn't un-highlight the shape

texts:
So I've got a list of shapes (zipcodes) which I'm trying to display on an OpenLayers Google map.

They render fine. When I hover over them, the shape colour changes. Great! when i -leave- the shape, the colour doesn't revert back the original shape colour. Can someone help me out?

Here's my code..

1. Render each shape to the map.

// NOTE: shapeData is an array of objects.
function renderShapes(shapeData) {
    for (var i = 0; i <= shapeData.length; i++) {
        addShape(shapeData[i]);
    }
}

2. Add the shape.

function addShape(data) {
    if (!data) return;

    if (shapeLayer == null) {
        setupShapeLayer();
    }

    // Reference: http://dev.openlayers.org/docs/files/OpenLayers/Format-js.html#OpenLayers.Format.externalProjection
    // This reprojects the WKT from GPS to Google Maps format. Yes, external == the source.
    var format = new OpenLayers.Format.WKT({
        'externalProjection': new OpenLayers.Projection('EPSG:4326'),
        'internalProjection': map.baseLayer.projection
    });

    var feature = format.read(data.WellKnownText);
    shapeLayer.addFeatures(feature);

    var highlightControl = new OpenLayers.Control.SelectFeature(shapeLayer, {
        hover: true,
        highlightOnly: true,
        renderIntent: "temporary"
    });

    map.addControl(highlightControl);
    highlightControl.activate();
}

3. Create the layer where all the shapes will exist, in.

function setupShapeLayer() {
    shapeLayer = new OpenLayers.Layer.Vector(shapeLayerName, {
        styleMap: new OpenLayers.StyleMap({
            "deafult" : new OpenLayers.Style({
                strokeColor: '#999999',
                strokeOpacity: 1,
                strokeWidth: 1,
                fillColor: '#46461F',
                fillOpacity: 0.10
            }),
            "temporary" : new OpenLayers.Style({
                strokeColor: '#2d9908',
                strokeOpacity: 1,
                strokeWidth: 1,
                fillColor: '#3eb216',
                fillOpacity: 0.60
            })
        }),
        rendererOptions: { zIndexing: true }
    });

    map.addLayer(shapeLayer);
    shapeLayer.setZIndex(1);
}

As I said, the highlight works .. it goes from yellowish to green. but it doesn't revert back to the original default style. :(


texts: Google Earth does not display full ground overlay image

texts:
I have the problem that my ground overlays in Google Earth are cut off at the Northern half. But I cannot see any issue with the kml-file.

My kml file is this one:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">
<Folder>
    <name>test</name>
    <GroundOverlay>
      <Icon>
    <href>C:\exampleimage.jpg</href>
  </Icon>
      <LatLonBox>
        <north>79.7478237613</north>
        <south>75.5880958435</south>
        <east>26.0285037066</east>
        <west>2.8032291432</west>
        <rotation>0</rotation>
      </LatLonBox>
    </GroundOverlay>
</Folder>
</kml>

I doublechecked the coordinates and they are correct, from gdalinfo

Pixel Size = (0.001524268200000,-0.001524268200000)
Metadata:
  AREA_OR_POINT=Area
  Band_1=Sigma0_HH_db
Corner Coordinates:
Upper Left  (   2.8032291,  79.7478238) (  2d48'11.62"E, 79d44'52.17"N)
Lower Left  (   2.8032291,  75.5880958) (  2d48'11.62"E, 75d35'17.15"N)
Upper Right (  26.0285037,  79.7478238) ( 26d 1'42.61"E, 79d44'52.17"N)
Lower Right (  26.0285037,  75.5880958) ( 26d 1'42.61"E, 75d35'17.15"N)
Center      (  14.4158664,  77.6679598) ( 14d24'57.12"E, 77d40' 4.66"N)

But then you see in this image that the rotated square is cut off in the Northern Part at 78.36N even though the Northern edge is given with 79.75N:


texts: QGIS server ignores GetFeatureInfo request tolerance

texts:
I'm using getGetFeatureInfoUrl to retrieve features from a WMS layer. Tolerance is a server side parameter, QGIS server offers optional parameters to define the tolerance for point, line and polygon layers so I make this request:

var url = wmsSource.getGetFeatureInfoUrl(
    coordinates, viewResolution, viewProjection,
    {
        'INFO_FORMAT': 'text/xml',
        'FEATURE_COUNT': 100,
        'FI_LINE_TOLERANCE': 0,
        'FI_POINT_TOLERANCE': 0,
        'FI_POLYGON_TOLERANCE': 0
    }
);

The problem is that adding the tolerance parameters to the request doesn't make any change, the URL given back by Openlayers always contains the same extent and so involves a lot of neighbor features which shouldn't be included.

Is there any configuration to do on QGIS side or what else could happen that this parameters don't show any effect?


texts: Geologica data UDM(unusable data mask) have 8 bits per pixel

texts:
UNUSABLE DATA MASK FILE(UDM)

The unusable data mask file provides information on areas of unusable data within an image (e.g. cloud and
non-imaged areas).
The pixel size after orthorectification will be 50 m for RapidEye, Each bit in the 8-bit pixel identifies whether the corresponding part of
the product contains useful imagery:

Bit 0: Identifies whether the area contains blackfill.
Bit 1: Identifies whether the area is cloud covered.
Bit 2: Identifies whether the area contains missing (lost during downlink)or suspect (contains down- link errors)

and so all bits have their responsibilities.
I want to read the Bit 1 of a pixel in UDM file.


texts: QGIS 3.4.6 "Network access is disabled" on WiFi only

texts:
I get this error message when connecting to OWS from GeoServer in QGIS 3.4.6 LTR on Windows 10 on WiFi only.

  Failed to download capabilities:
  Download of capabilities failed: Network access is disabled.

As soon as LAN is plugged in, OWS connects immediately. QGIS 2.18.24 on same device connects to same OWS on WiFi without problem.

Has anyone seen this before / can suggest a resolution?


texts:
I see that others have problems similar to mine. Attempts to open Sentinel-2 data in SNAP by means of the *.xml file(s) fail.
When I pick the xml file from here, supposed to be metadata file,
the answer is: "No appropriate Product Reader found"

If I pick the xml file from the subdirectory “DATASTRIP/S2A_OPER_MSI_L1C_DS_SGS_...”, the answer is the same.

Is this due to error during downloading or dezipping? If so, how can this be avoided?


texts: How to "split" a single MULTILINESTRING into multiple MULTILINESTRINGs that intersect?

texts:
I'm trying to solve this problem using the R sf package, but I assume that an answer in PostGIS could also help me get to an answer in R.
Basically, I have a shapefile with the following columns: "Census area", "Street Name", and a MULTILINESTRING that represents the street segment within that "Census area" spatially. Usually, streets are straight lines that run across multiple "census areas", so I want to get rid of the "Census area" part and just collapse these "mini-street-segments" within Census areas into a single MULTILINESTRING for every single street.
In a world where there were no street name duplicates, this would be trivial. I'd just get all geometries that have the same street names and dissolve them into a single LINESTRING or MULTILINESTRING. In R sf/dplyr syntax:
df %>% group_by(street_name) %>% summarize()

However, we do have duplicate street names. We may have:

A street named C Street that crosses contiguous census areas 1, 2 and 3. This C Street could trivially be joined into a single, continuous MULTILINESTRING.
Another street also named C Street that crosses contiguous census areas 11, 12 and 13. This C Street could also trivially be joined into a single, continuous MULTILINESTRING.
But if I try joining ALL geometries that form C Street into a single MULTILINESTRING, we'd get a MULTILINESTRING with two line segments that don't intersect.

What I want to do is separate such a "non-contiguous" MULTILINESTRING into two or more MULTILINESTRINGS that represent the two or more C streets. How should I go about that?


texts: How to add support for FileGDB (Esri file gdb API) driver in fiona?

texts:
There has been a tons of questions on that but none of them solved my problem.

I have a machine with:

Windows 7 x64
Python 3.4.3 x64
gdal installed: gdalinfo --version --> GDAL 1.11.4, released 2016/01/25; gdal was installed from a wheel GDAL-1.11.4-cp34-none-win_amd64.whl from here

The GDAL is installed into C:\Python34\Lib\site-packages\osgeo. There I have a bunch of .exe files for gdal and ogr and .pyd files.

fiona installed: was installed from a wheel Fiona-1.6.3-cp34-none-win_amd64.whl, from the same website.

I am able to run this code and it executes successfully:

import gdal
import ogr
from gdalconst import *

shp = r"C:\Data\GIS\PTS.shp"
driver = ogr.GetDriverByName('ESRI Shapefile')

dataset = driver.Open(shp)
layer = dataset.GetLayer()
layer.GetFeatureCount()
schema = layer.schema
fields = [field.GetName() for field in schema]
feature = layer.GetNextFeature()

I am also able to get OGR formats: ogrinfo --formats prints a bunch of them in the Windows cmd (with no FileGDB there though).

I am able to run this code and it executes successfully:

import fiona
with fiona.drivers():
  with fiona.open(path=r'C:\Data\GIS\TemplateData.gdb', driver='OpenFileGDB') as source:
    print(source.meta)

However, this code won't run:

with fiona.drivers():
    with fiona.open(path=r'C:\Data\GIS\TemplateData.gdb', driver='FileGDB') as source:
        print(source.meta)

Because I don't have Esri File GDB compiled libraries which are required.

I have downloaded and unpacked FileGDB_API_VS2012_1_3.zip from the Esri downloads page. As I understood, there is no need to compile anything as the .dll is already there.

What is the correct procedure to register the dll of the Esri File GDB API to be able to use them in fiona in my environment?

UPDATE: (based on Luke's answer)

I have downloaded the File Geodatabase API 1.4 version for Windows (Visual Studio 2010) from the Esri downloads page. I copied the FileGDB_API_VS2010_1_4\bin64\FileGDBAPI.dll to the C:\Python34\Lib\site-packages\osgeo. Now I have two files in here, ogr_FileGDB.dll and FileGDBAPI.dll.

I have created a Windows variable GDAL_DRIVER_PATH : C:\Python34\Lib\site-packages\osgeo\gdalplugins. In the PATH variable, I don't have anything Python specific except the C:\Python34\Lib\site-packages\osgeo.

Now when running the ogrinfo --formats I get -> "FileGDB" (read/write) and am able to use the Python code for working with the FileGDB driver.


texts: Applying graduated color symbology using arcpy.mapping?

texts:
I am trying to apply a graduated color symbology from one layer to another. The script adds a layer to an mxd but foes not apply the symbology from the symbology layer.

Can someone tell me what I am doing wrong?

This did work a few days ago for other layers but is no longer working.

This is the script, path names modifiied

import arcpy

arcpy.env.workspace = r"C:\Workarea\BrandiS"

mxd = arcpy.mapping.MapDocument(r"C:\Workarea\BrandiS\SymbolTest.mxd")

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]

featureLayer = r"C:\Workarea\BrandiS\TestLayer.lyr"

addLayer = arcpy.mapping.Layer(featureLayer)
arcpy.mapping.AddLayer(df, addLayer, "TOP")

if addLayer.symbologyType == "GRADUATED_COLOR":
   addLayer.symbology.valueField = "Join_Count"

symbolLayer = r"C:\Workarea\BrandiS\SymbolLayer.lyr"

arcpy.mapping.UpdateLayer(df, addLayer, symbolLayer)

mxd.save()

del mxd, df, featureLayer, addLayer, symbolLayer


texts: Getting Run time error cannot open 'xxxx' from ArcPy?

texts:
I am trying to create a script to add values to a new field in a table based on the  text values of another field in the same table. Here is my code:

import os
import arcpy
from arcpy import env

arcpy.env.workspace = "c:/Myfiles/geodatabase"
updateFields = ["fieldname1","fieldname2"]

def updateweight(filename,fields):
  with arcpy.da.UpdateCursor(filename,fields) as cursor:
    for row in rows:
      if row[0] == "unrestricted":
        row[1] = 3
      elif row[0] == "restricted":
        row[1] = 2
      elif row[0] == "severely restricted":
        row[1] = 0
  Cursor.updateRow(row)
  del cursor

updateweight("shape_file_name", updateFields)

When I run this I get:

Run time error
File "<string>" line 1 in <module>
File "<string?" line 11 in updateweight cannot open 'shape_file_name'

I've tried including the .dbf file extension in the file name and also tried calling the assigning a variable to the filename and calling it that way.

I was unable to copy and paste the code directly because it is on a work machine in a secure environment, so there my be some typos in the code. I wrote it as a function so I can make it into a more generic tool once I've tested it.


texts: Extracting from attribute tables by arcpy

texts:
I'm having some trouble connecting ideas on how to solve a problem. What I have is a shapefile from which I have to extract from one field, which contains 3 types of attributes (BS, RS, BRN). For each of those attributes, I've created separate feature classes.

I short, attributes have to go to their specific designation e.g. BS values go to feature BS, RS values etc.

My first guess is that I have to use Cursors to do it, but in this case I have to use both Search and Insert and how would I do that?

Would it make sense a start such as this?

import arcpy

shape = "D:/M1 Geomatique/Programmation II/Dossier/ZONE_INONDATION_SYNTHESE_67.shp"
gdb = "D:/M1 Geomatique/Programmation II/Dossier/inondation.gdb"
field = "CODE_DEGRE" #field name from which to search data
entite1 = "rs"
entite2 = "bs"
entite3 = "brn"

rows = arcpy.InsertCursor(gdb)
cursor = arcpy.SearchCursor(shape)

Perform a loop start with a SearchCursor followed by an InsertCursor:
e.g.

with arcpy.da.SearchCursor(sourceFC,fieldnames) as sCur:
    with arcpy.da.InsertCursor(targetFC,fieldnames) as iCur:

Above is just an example I've picked up on stackexchange

How would you advise me to tackle this problem?


texts: Raster error calculating TWI with dynatopmodel

texts:
I am trying to calculate elevation, upslope and TWI from an ASTER DEM in R using dynatopmodel.
The build_layers function requires that the raster has a resolution of at least 30m and is in a projected coordinate system.
I have ensured that my raster fills these requirements
#read in raster
dem <- raster("XXX/.tif")

#define crs
crs(dem) <- "+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"

#check raster info
dem
class      : RasterLayer
dimensions : 3173, 4433, 14065909  (nrow, ncol, ncell)
resolution : 30, 30  (x, y)
extent     : 413646.1, 546636.1, 9372273, 9467463  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs
source     : XXX/muheza_30.tif
names      : muheza_30
values     : -32768, 32767  (min, max)

But when I try to construct the basic landscape layer for the dynatopmodel run, I receive this error:
top <- build_layers(dem, fill.sinks = FALSE)

Building upslope areas...
Error in upslope.area(dem, atb = TRUE, fill.sinks = fill.sinks, deg = deg) :
  Raster has differing x and y cell resolutions. Check that it is in a projected coordinate system (e.g. UTM) and use raster::projectRaster to reproject to one if not. Otherwise consider using raster::resample

I also tried to resample the raster as the error message suggests (despite it being in 30m already)
r <- raster(ext=extent(dem), res=30)
dem <- raster::resample(dem, r, method = "bilinear")

But I get the same error message when I try the build_layers function
Is there something which I am missing from the requirements, or am I interpreting the resolutions incorrectly?


texts:
I'm trying to use Geopandas and zonal statistic from rasterstats together.
I run this code
import geopandas as gpd
from rasterstats import zonal_stats

geodf = gpd.read_file("SHP/shape.shp")
zonal_stats(geodf,"raster.tif")

but I get this error:

ParseException: Unknown type: 'FID'
ParseException: Unexpected EOF parsing WKB
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2820, in run_code
exec code_obj in self.user_global_ns, self.user_ns
File "", line 1, in
zonal_stats(geodf,"raster.tif",stats='mean')
File "/usr/local/lib/python2.7/dist-packages/rasterstats/main.py", line 21, in zonal_stats
return list(gen_zonal_stats(*args, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/rasterstats/main.py", line 128, in gen_zonal_stats
for i, feat in enumerate(features_iter):
File "/usr/local/lib/python2.7/dist-packages/rasterstats/io.py", line 107, in
features_iter = (parse_feature(x) for x in obj)
File "/usr/local/lib/python2.7/dist-packages/rasterstats/io.py", line 70, in parse_feature
raise ValueError("Can't parse %s as a geojson Feature object" % obj)
ValueError: Can't parse FID as a geojson Feature object

The data frame looks like this:
    In[43]: geodf
    Out[42]:
         FID                                      geometry

    0     0  POLYGON ((7.662965420348624 45.05600185397847,...
    1     1  POLYGON ((7.665210146514162 45.05607590098681,...
    2     2  POLYGON ((7.663353281768154 45.05601113630467,...
    3     3  POLYGON ((7.660229137844505 45.0570570693801, ...
    4     4  POLYGON ((7.660047499767138 45.0572381357898, ...
    ....

Any suggestion how to solve this problem?


texts: ArcGIS Pro feature class anchor points lost when shared online

texts:
I have a simple ArcGIS Pro 2.2.3 project which features a few point items on a map. The feature class is displayed using markers and the anchor point in the Y dimension was set to -50% in order to assure that the lower tip of the marker was always pointing to the feature on the map no matter the zoom level.

This works well in ArcGIS Pro desktop, however, when the feature class is shared as a Web layer in ArcGIS Online, the anchor configuration is lost. All other characteristics of the feature class are kept (type of marker, color, etc.)

The following screen capture from ArcGIS Pro shows exactly to location of the feature just above the small lake.

The same feature class in ArcGIS Online shows a slightly different location because the anchor point of the marker is the center instead of being the lower tip of the marker.

The question is how is it possible to included the marker anchor points when publishing layers from ArcGIS Pro to ArcGIS Online ?


texts: Exporting .jpg files from data driven pages in Arcmap (name file is a text)

texts:
I am trying to export my Data Driven Pages to JPEG files named wiht an index layer field. I have used the code posted in other answer and it seems to work fine when the page names are numbers. However, what I have found is that I can not use it when my page name is a string (may contains alphabetical characters), i.e. it works fine with page numbers: 1, 2, 3... but does not work with page names 'page1', 'page2', 'page3'.

import arcpy, string

#Read input parameters from script tool
mxdPath = arcpy.GetParameterAsText(0)
pageList = string.split(arcpy.GetParameterAsText(3), ";")

#Reference the map and the data driven page object
mxd = arcpy.mapping.MapDocument(mxdPath)
ddp = mxd.dataDrivenPages
for eachPage in pageList:
    arcpy.AddMessage(str(eachPage))
    pageID = str(ddp.getPageIDFromName(str(eachPage.strip("'"))))
    ddp.currentPageID = int(pageID)
    arcpy.AddMessage(pageID)
    arcpy.mapping.ExportToJPEG(mxd,str(eachPage)+ ".jpg")

Any suggestions?


texts:
I am using the tool Feature Class to Feature Class to export polygons from a CAD File.  An example piece of data in CAD looks like this:

My problem is that I am unable to export any of the object data circled in blue.  The tool works fine, but I cannot get that data out of CAD into a shapefile, although the data under the General and Geometry tabs come out fine.  In the field mappings part of the tool, I cannot get any of those fields as an option for input field, which was my first thought.

I'm not very experienced with CAD and am unsure of the underlying data structure.

ArcGIS Desktop version is 10.3.  Cad is Civil 3D 2014


texts: Error cloning Conda env arcgispro-py3 on an ArcGIS Server

texts:
Whenever I try to clone the base package that comes with ArcGIS Server I get an error saying:

ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'defaults::notebook-5.7.8-py36_0'.
CondaError: Cannot link a source that does not exist. <USER>\AppData\Local\ESRI\conda\pkgs\notebook-5.7.8-py36_0\Lib\site-packages\notebook\i18n\zh_CN\LC_MESSAGES\nbjs.json

Can I install Anaconda onto the server and will this help fix the problem?


texts:
I want to print a leaflet map in PDF/Image formats and It will be contained,

WMS layers
Polygon, Markers, Polylines etc

I'm using a leaflet map with React Typescript. Related versions are,

react-leaflet - 2.7.0
react - 16.13.1
leaflet - 1.6.0

I tried https://leafletjs.com/plugins.html#printexport leaflet-easyprint and  leaflet.browser.print but didn't get a promising result.

https://www.npmjs.com/package/react-leaflet-easyprint

import { Map, withLeaflet} from "react-leaflet";

import PrintControlDefault from 'react-leaflet-easyprint';

const PrintControl = withLeaflet(PrintControlDefault as any);

 <Map>
    <PrintControl ref={printMapRef}
     position="topleft"
     sizeModes={['Current', 'A4Portrait', 'A4Landscape']}
     hideControlContainer={false} />
 </Map>

Typescript Error:

Type '{ ref: MutableRefObject; position: string; sizeModes: string[]; hideControlContainer: boolean; }' is not assignable to type 'IntrinsicAttributes & Omit<ContextProps, "leaflet"> & { children?: ReactNode; }'.
Property 'ref' does not exist on type 'IntrinsicAttributes & Omit<ContextProps, "leaflet"> & { children?: ReactNode; }'.

https://github.com/Igor-Vladyka/leaflet.browser.print

importLfrom"leaflet";
import { useLeaflet } from"react-leaflet";
const { map } = useLeaflet();

(L as any).control.browserPrint({
position:'topright'
}).addTo(map);

This works fine, but cannot print WMS layers.
Does anyone have an idea about any plugin or library which is match with above-mentioned conditions?


texts: Automated updates for fields in a metadata record?

texts:
At the moment I'm trying to write a process (in Python) to update a metadata record in GeoNetwork 3.10.2, which we have running on our intranet recently. Unfortunately, I'm unable to figure out how to do automated updates to specific properties of the record, such as the last update time and a dataset version id. I found /srv/eng/admin.console#/settings/csw-test that shows a list of what I'm able to do through the API, but so far I have been successful mostly in blowing up a few test records - I get a ISO date error which leaves the record void of metadata.
From what I tried, I have been unable to extract a working cURL command from the csw-test page to translate to Python code. From the network console I can extract some information, but it's not enough to replicate - even the blow-up behaviour. Also, it includes use of a cookie that I would like to get rid of in production.
From the REST API side, I am clueless on how to operate either the /{portal}/api/0.1/records/{metadataUuid}/editor or the /geonetwork/srv/eng/xml.metadata.update endpoints - I cannot find sufficient documentation on how to operate these.
So, let's say I want to update some fields the summary - how do I go about this?
Any pointers in posix cURL format or Python would be very, very helpful. Thanks in advance.
EDIT:
I've auto-generated the Python code for the /editor endpoint to try and figure out how this is supposed to work. Bootstrapping the code works using
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar
java -jar swagger-codegen-cli.jar generate -i https://your_geonetwork/srv/v2/api-docs -l python -o ./python_geonetwork_client

but the code itself results in authentication errors, using basic authentication methods.
EDIT2:
Unable to make a working GET call to {portal}/api/0.1/records/{metadata_uuid}/editor work in Postman, also due to access denied errors. Following https://geonetwork-opensource.org/manuals/trunk/en/api/the-geonetwork-api.html using basic authentication


texts: I have a CSV file with lat and long coordinates, is there a way I can convert it into a shapefile so as to generate a mobile network coverage map like the AT&T image I have attached.


texts: Calculating direction for points (lon/lat) in a perfect circle (shape) north of equator?

texts:
I have perfect circles in lon/lat on a OpenLayers map.

Near the Equator I locate each point on the circle using bearing-calculation for each point from circle-center. Meaning there are 360 bearings as there are 360 lon/lat points:

1.deg on circle = 1deg bearing/2.deg on circle = 2deg bearing....etc).

When I move a circle north of the Equator I'm not able to do this anymore due to the following explanation:
https://en.wikipedia.org/wiki/Bearing_(navigation):

How can I "locate" each point on the circle by calculation from the circle center when circles are "off equator". Bearing calculation is not a requirement, I just need to locate every point per degree in a circle?

Background:
First I thought this was a projection problem, however I now have discovered that it is a calculation problem as several of the points on the circle gets the same bearing:

Getting different resolution between horizontal/vertical directions, from lon/lat to openlayers map?
Implementing "conformal mapping" in OpenLayers?

Update 11.sept:
Attached is an example, i try to locate each point and draw a line between them. For each bearing (0-359) i use "Destination point given distance and bearing from start point" from this site: https://www.movable-type.co.uk/scripts/latlong.html where the center-point is the start point and distance is constant.

This does not work, obviously, as the bearing calculation is off away from Equator. How can I calculate correct bearing away from Equator?

Or any suggestions how to solve this by other means? Trigonometric, math or whatever? ( The map is not imporatant, but the final shape is... )


texts: Image classification for a study site falling over two adjacent Landsat 8 scenes using QGIS or ArcGIS Desktop

texts:
I will be using GRASS on OSX to classify Landsat 8 geotiff images to create a vegetation map for a study site that happens to fall over 2 separate Landsat scenes.

I seek advice about which route to take and I'm not able to find any other information about this elsewhere:

1.) Should I FIRST find a way to combine the 2 scenes together (which presumably would require combining the 2 scenes of each channel separately - would that be right?), and then cut out the small area covered by my study site and THEN start the classification process.

OR

2.) Should I conduct image classification on the 2 adjacent Landsat scenes separately and then combine right at the end? (Although I'm worried this will take much longer, not to mention use up more memory - the study site I am working with is only 1400 km2)


texts: Can't delete features from layer using QGIS' Python API

texts:
I've only recently started using QGIS and it's Python API.
Currently I've loaded two OpenStreetMap datasets. I would like to remove lines with from the second set where the name is already present in the first.
There is a catch: the first dataset uses a field called name1 while the second dataset uses a field called Name.

What I've tried so far is fairly naive and non-pythonic:

Store a list of all the values called name1 from the first dataset
Iterate through all the fields in the second dataset and if Name attribute is contained in the name1 values array above, call QgsVectorLayer's deleteFeature() passing the feature's id()

In code, the layer I want to delete from is called Cropped and the list of all values called name1 from the first dataset is called roads so what I tried looks like this:

Cropped.startEditing()
fields = Cropped.getFeatures()
for f in fields:
    name = f.attribute('Name')
    count = roads.count(name)
    if count > 0:
        print 'removing ',name,count
        Cropped.deleteFeature(f.id())
Cropped.commitChanges()

startEditing() and commitChanges() return True, but all Cropped.deleteFeature(f.id()) calls return False.

I've also spotted this existing post on How to delete selected features in Qgis using Python which seems to tackle the exact problem. I am using QGIS version 2.14.0-Essen so I have tried this, based on the answer:

with edit(Cropped):
    for fid in fids:
        Cropped.deleteFeature(fid)

Where fids is a list of field ids that match the condition above.
I get False for every single call.

Any hints/tips on what I'm doing wrong/missing ?


texts: Save polygon within shapefile as own shapefile

texts:
I have a shapefile of multiple watersheds, and I want to extract one of them to save as its own shapefile. I have no clue which package or command to use.

Can someone point me to a function within GeoPandas or another Python package?

import geopandas

shed = geopandas.read_file('CA_HUC12.shp')
shed.head()
OBJECTID    TNMID   LoadDate    GNIS_ID AreaAcres   AreaSqKm    States         Geometry
1       2012-10-15  0.0 21270.0 86.076712   CA  180300120503    Canoas Creek   POLYGON ((-120.1708092427523 36.07190695803973..
2       2012-10-15  0.0 32827.0 132.846273  CA  180600150201    Bear Creek     POLYGON ((-122.1102488777835 37.24771269698346...


texts: How to add Geoserver WFS to Leaflet JS Application

texts: I have a PostGIS database and have successfully consumed a table into GeoServer and published a WFS.  Are there REST endpoints available for these WFS' akin to ESRI's feature services?  How are parameters to be constructed?


texts: arcpy.da.UpdateCursor with sql_clause for artifically inverting cursor loops

texts:
Why is row not recognized within my update cursor?

The data is stored in a file geodatabase.
I am using ArcGIS Desktop version 10.1 ArcInfo License.

The screen shot shows the data "ORDER BY X ASC" with some values assigned.
Now I'm trying to reverse sort and continue adding values in the last column.

I know cursors don't work backwards, so I thought reversing the sort might be a good work around.

import arcpy
import itertools

fc = r"C:\Data\Workspace.gdb\MyFeatureClass"
sql_rev = (None, "ORDER BY X DESC")

inc = itertools.count(13,1)
expression = "{0} = 1 AND {1} = 1".format("Gpriority", "FlightID")
with arcpy.da.UpdateCursor(fc, ["FlightLnOrder", "X"], expression, sql_clause = sql_rev) as uCur:
    c = 1
    for row in uCur:
        c += 1
        if c == 2:
            row[0] = inc.next()
            c = 0
            uCur.updateRow(row)


texts: SQL and ArcGIS data querying: what's the difference?

texts: I am wondering if the language used by ArcGIS for data querying (e.g., search by attribute) is part of the SQL language, or to what extent there is a connection between the two (and where does it come from)?


texts: use edit widget to create optional picklist for a field in QGIS

texts:
Is there a way to set up a field to select from a picklist using the Value Relation or Value Map edit widget on a shapefile field in QGIS so that one will be able to pick from a list of items but not necessarily be restricted/constrained to using one of the items in the list (i.e., one can also enter an item/string that is not present in the picklist)?

The purpose is to provide users with a list of items to jog their memory when entering the data; however, I have no need or desire to constrain their entry.


texts: Geoprocessing Tools - I can't get Intersect/clip to work

texts:
I desperately need to intersect two layers, one of 32 large polygons (towns) the other of many smaller areas with those towns, so that I can classify and make calculations on the smaller areas sorted by town.

I'm using the latest 1.24.3 Lyon version of QGIS (upgraded from V.1.24.1 today). The two layers are here:

http://stubmandrel.co.uk/images/Bits_and_pieces/QGIS_Sample_Files.zip

As you can see I have tried exporting to WGS84 (the project CRS) to ensure that they are overlapping and visible, Topology checker says no errors.

I am opening both latyers, can visually see they overlap, choosing geoprocessing tools>intersect, selecting both files with 'use selection' unchecked, and selecting a suitable filename for the output, but although the new layer is created, its attribute table is empty.

I have a few layers where I can get the clip command to work, but intersect always seems to fail. Previously I have been able to use the geoprocessing tools - using the data attached to do other things.

Can anyone see a fault in my data of workflow?


texts: Couldn't load images on html on plugin processing (Linux and Windows)

texts:
Context

I develop a processing plugin for QGSI 2.18 and in design GUI with *.ui files (Qt4)

I can’t load PNG images with relative path in html defined in .ui files

Works with absolute path

It works with absolute path like this, but this is NOT portable :

I search to solve these constraints

use relative path to the plugin directory (Example for me : /home/me/.qgis/python/plugin/Chloe)
work on Linux and Windows.


texts:
Using Ubuntu 15.04, I'm trying to install GDAL/OGR.

I did:

[] sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
[] sudo apt-get update

However, I found this error message

W: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/vivid/main/binary-i386/Packages  404  Not Found

Actually, there is no package for Vivid (Ubuntu 15.04)
http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/

Does anybody know how to fix this issue?


texts: Limit data imported into PostGIS database?

texts:
I am building a web application in which members will be able to find other members in their area.  This is your typical "nearest neighbor" search which I'll perform using their latitude and longitude.  I'll do the geocoding  using one of these searches:

1. Search by street address + city + region + postal code + country
2. Search by postal code + country
3. Search by city + country

I plan to use OpenStreetMap data imported into a PostgreSQL 9.1 database using PostGIS 1.5.3.  I'll use Nominatim as my geocoder because my users can be anywhere in the world.  The problem is that I only have a small 8-CPU Debian 7 VPS server (on linode.com) with 1-GB of RAM while the compressed planet OSM file is around 30-GB.  I'm afraid I won't be able to load that much data with so little RAM.  And even if I can load it, it will take forever.  What I really need is a server with 16-GB of memory but they're very expensive and I'd only need a server that size to initialize my geocoding server and perhaps to do quarterly updates.

Here are my questions:

Which loader should I be using to put the data in an optimal format for the geocoding queries shown above?  I've loaded a small Illinois .pbf file using osm2pgsql but there is also Osmosis and Imposim.  I've read that Imposim is good if you have limited memory but I read that osm2pgsql might be best if I'm geocoding.
Can I reduce the loading time with one of these loaders by only loading those elements that are needed to perform the above geocoding queries?  If so, which elements are needed for the loader in question?  osm2pgsql mentions "import styles" while Imposim has a mapping file.
Would it perhaps be a good idea to spin up an Amazon EC2 or RDS server to download the planet file and load the data into a database and then back that data up, copy the backup over to my linode, and restore it there?  This would save me the cost of upgrading to a more powerful linode.

Thanks for your response!


texts: What could be the reason why QGIS3.10 long term release Coruna version crash in Win10 OS?

texts:
I have been working on some basic functions such as joining data and producing maps on Win10 using QGIS3.10 app. I am quite sure that the everything was still fine yesterday however, today the app start crashing all the time when I start working on the properties.
The data I have been working with is a CSV file edited by MS Excel with pivot table function, to be joined with .shp file


texts: Toolvalidator script is not working in ArcGIS Server

texts:
I have made a small GP tool in ArcMap, which is also having some validation code in tool validator class. And it is working fine as GP tool in ArcGIS desktop(Arcmap). But when i published the same tool as Geo-Processing service added as toolbox in ArcMap, it is not considering any validations.
Ex: Disable/Enable some textboxes.

What should i do to integrate these validations in GP service also?


texts:
I plan on building a web application using Geodjango. After installing PostgreSQL, PostGIS, OsGeo4W and psycopg. I changed my settings.py db to that of the PostGIS. Each time I run the commmad "python manage.py runserver" I get the error "api-ms-win-crt-heap-|1-1-0.dll is missing."

i have kb299261 installed and microsoft visual  C++ 2015 installed.

see screenshot below.


texts: How to extract the text encoding from a shapefile?

texts:
Is there any way to extract the encoding, like utf8, from a shapefile?

I want to be able to write a script that enables the user to import shapefiles without having to worry about which encoding the file. I'm using shp2pgsql but here I have to specify which encoding to import with...

I have a script that's written in SQL using gdal-tools. I would like to extend the script with either:

somehow extracting the encoding of the shapefile to be able to use shp2pgsql to import
or,
is there some way to magically say "import with the encoding that is set in the file"?

I'm no programmer at heart, mearly faking it with SQL...


texts: How do I insert rows into a spatial table within a geopackage file via a SQL INSERT statement?

texts:
I am attempting to insert rows into a spatial table within a geopackage file using DBeaver 5.1.1.

I receive an error from the triggers, referencing functions that don't exist: ST_IsEmpty.  Do I need to load these functions via a similar means to the spatialite load_extension? And does a library extension exist for geopackages?

SQL Error [1]: [SQLITE_ERROR] SQL error or missing database (no such function: ST_IsEmpty)
  [SQLITE_ERROR] SQL error or missing database (no such function: ST_IsEmpty)
  [SQLITE_ERROR] SQL error or missing database (no such function: ST_IsEmpty)


texts: Clip_Management seems to delete shapefile?

texts:
We have some python code that clips a very large shapefile for further processing.

We can see the process create all the output files, but then just as the process is finishing, they get deleted.

The only files left over are SBN, SBX, and XML files. What the heck is going on?

We can run the process just fine within ArcMap, but the python code seems to be messing something up.

Here's the code:

# Check out any necessary licenses
arcpy.CheckOutExtension("3D")

Sage4ac = "D:\\DPerret\\GIS\\Base_Data\\SagebrushData\\SageLeks\\Sagebursh.gdb\\Poly\\Sage4ac"

# Process: Clip Sage
arcpy.Clip_analysis(aoi, Sage4ac, tempPath + "sageclip.shp", "")


texts: Error in exporting table from Python API service account-- Asset does not exist or doesn't allow this operation

texts:
I am trying to export a table using the Python API and am getting the following error:

Asset 'my_asset_Path' does not exist or doesn't allow this operation

The exact same code works in both the code editor and the Python API when I authenticate using the client library but doesn't seem to work when I authenticate with a key from the Google Cloud Platform.
I am unable to give a reproducible example because I don't want to share my service account key but the general gist is this:
# Attempt export from service account
import ee
service_account = 'myserviceaccount@mybucket.iam.gserviceaccount.com'
credentials = ee.ServiceAccountCredentials(service_account, 'path/to/key/my_key.json')
ee.Initialize(credentials)

my_collection = ee.FeatureCollection('projects/earthengine-legacy/assets/users/seancliffcarter/occurrence_fromPY/rbt_NAS_duplicate')

## Do some stuff to my_collection ###

export = ee.batch.Export.table.toAsset(collection = my_collection,
                    description = 'rbt_spatially_thinned',
                    assetId = 'users/seancliffcarter/occurrence_fromPY/toy_export4')
export.start()

This fails with the following error code (also above):
'error_message': "Asset 'projects/earthengine-legacy/assets/users/seancliffcarter/occurrence_fromPY' does not exist or doesn't allow this operation."

However, when I do the same thing with the manual authentication, it works.
Is it possible to export intermediate assets from a service account?


texts: Setting parameters in Arcmap for dynamic python script

texts:
I have a simple python script that works when run from PythonWin, but when I try to make it dynamic to run inside ArcMap I keep receiving:
: ERROR 999999: Error executing function.
Failed to execute (CreateFeatureclass).
It must be something I am doing when setting the parameters from the script properties from within ArcMap.  I've created scripts with user input before, so for the life of me I can't figure out why it won't work.

import arcpy
import os

arcpy.env.overwriteOutput = True

path = arcpy.GetParameterAsText(0)
name = arcpy.GetParameterAsText(1)
type = "POINT"

m = "DISABLED"
z = "DISABLED"
prjFile = "C:/Program Files/ArcGIS/Desktop10.0/Coordinate Systems/Projected Coordinate Systems" + \
          "/State Plane/NAD 1983 (US Feet)/NAD 1983 StatePlane North Carolina FIPS 3200 (US Feet).prj"
reference = arcpy.SpatialReference(prjFile)

arcpy.CreateFeatureclass_management(path, name, type, "", m, z, reference)

When creating the parameters I have the first input as follows:
Data Type = workspace or feature dataset
type = required
direction = Input
Environment = workspace

The second input is:
Data Type = Featureclass....I've also tried Shapefile as well
Type = Required
Direction = Output


texts: How to prevent data scraping in a web map?

texts: I would like to use Leaflet or a Leaflet-like mobile-friendly library to produce a web map of points of interest, but I am concerned with how easy it is to just scrape the data from the javascript. Is there a way to prevent this?