texts: Clip by extent. FAILURE: No target dataset specified

texts:
I am using QGIS 3.10.2 and I am trying to clip a raster layer of the World just to capture Africa.
The raster layer was imported from ESRI (https://planet.qgis.org/planet/tag/world%20imagery/) with the following code in the Python console:

qgis.utils.iface.addRasterLayer("http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer?f=json&pretty=true","raster")

Now I click on Raster>Extraction>Cut by Extent, I select my Entry layer. I chose to select on Canvas the extent, draw a polygon and obtain the coordinates. Last, I select the output file. Here is what it looks like (sorry in Spanish)

I click execute and I get the following error:

Versión de QGIS: 3.10.2-A Coruña
Revisión del código de QGIS: d4cd3cfe5a
Versión de Qt: 5.11.2
Versión de GDAL: 3.0.3
Versión de GEOS: 3.8.0-CAPI-1.13.1
Versión de PROJ: Rel. 6.3.0, January 1st, 2020
Procesando algoritmo...
Algoritmo 'Cortar ráster por extensión' comenzando…
Input parameters:
{ 'DATA_TYPE' : 0, 'EXTRA' : '', 'INPUT' : 'http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer?f=json&pretty=true', 'NODATA' : None, 'OPTIONS' : '', 'OUTPUT' : 'C:/Users/Javier.DESKTOP-EEJENVF/Documents/fires/cut1.tif', 'PROJWIN' : '-21.94386249283079,56.234657100783124,-39.64277198356078,36.88988403966126 [EPSG:4326]' }

GDAL command:
gdal_translate -projwin -21.94386249283079 36.88988403966126 56.234657100783124 -39.64277198356078 -of GTiff http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer?f=json&pretty=true C:/Users/Javier.DESKTOP-EEJENVF/Documents/fires/cut1.tif
GDAL command output:

FAILURE: No target dataset specified.

Usage: gdal_translate [--help-general] [--long-usage]

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

CInt16/CInt32/CFloat32/CFloat64}] [-strict]

[-of format] [-b band] [-mask band] [-expand {gray|rgb|rgba}]

[-outsize xsize[%]|0 ysize[%]|0] [-tr xres yres]

[-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]

[-unscale] [-scale[_bn] [src_min src_max [dst_min dst_max]]]* [-exponent[_bn] exp_val]*

[-srcwin xoff yoff xsize ysize] [-epo] [-eco]

[-projwin ulx uly lrx lry] [-projwin_srs srs_def]

[-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]

[-a_scale value] [-a_offset value]

[-nogcp] [-gcp pixel line easting northing [elevation]]*

|-colorinterp{_bn} {red|green|blue|alpha|gray|undefined}]

|-colorinterp {red|green|blue|alpha|gray|undefined},...]

[-mo "META-TAG=VALUE"]* [-q] [-sds]

[-co "NAME=VALUE"]* [-stats] [-norat]

[-oo NAME=VALUE]*

src_dataset dst_dataset

"pretty" no se reconoce como un comando interno o externo,

programa o archivo por lotes ejecutable.

Execution completed in 0.30 seconds
Results:
{'OUTPUT': 'C:/Users/Alum.DESKTOP-EEJENVF/Documents/fires/cut1.tif'}

Apparently the problem is that I did not specify a target dataset.

Can anyone help me?


texts: LST MODIS harmonic fitting in Google Earth Engine - Predicting Future Scenarios?

texts:
I've been working on code for harmonic fitting of MODIS LST data. The code is working fine; however I would like to create future LST images in future dates by using the "fitting" band. Thus, I would like to know if is it possible to create predicted temperature images by using the fitted collection?

Code: Link to access the base code


texts:
I support a .NET application that has been compiled on a PC with ArcGIS 10.1 installed.  The application comprises a user interface and an ArcGIS desktop extension, plus an installer assembly that is called by Windows Installer to register the desktop extension during installation.

The problem I have is that the application won't run on a PC with ArcGIS 10.2 because the 10.1  ESRI assemblies are not found so it crashes. It seems that since v9.3 ESRI no longer supply publisher policy files any more to redirect the program at runtime to the latest versions.

I have managed to redirect the program to load the 10.2 assemblies by adding runtime assembly binding into the application's .exe.config.  However, this doesn't redirect the desktop extension and won't solve the problem with the installer looking for the 10.1 libraries when installing the application.

ESRI's solution seems to be to re-compile the application every time a new version of ArcGIS is released.  However, this means I would need to have a copy of every release of ArcGIS that the end users are using.  And I'd have to uninstall and re-install different versions every time I need to change the application code in order to re-compile it.

Does anyone have any suggestions?  Can the libraries be loaded dynamically at runtime to avoid looking for a specific version?  Is there any other solution?


texts:
Through tutorials I learned how to add a toolbutton to the plugins-toolbar via python. Now I wonder how to add a complete toolbar with toolbarbuttons via python.

Can anybody give some example-code?


texts:
What exactly is a .ssf file?
I am refering to the .ssf files used with Trimble GPS units.
I am aware that it is some sort of post processing correction file, but I do not know more than that.


texts: In need of WFS-T support in a WPF/Silverlight application

texts:
I want to build a wpf/silverlight mapping application that enables real-time visualization of features in a map, and that allow different users to add features (points, polygons) to the map. My initial thought is to use WFS-T for this purpose, but unfortunately, I cannot find any free/cheap SDK that provide support for WFS-T within WPF. My question is therefore:

Does anyone know about a free/cheap SDK that enable support for WFS-T within WPF applications?

p.s. there's no need to mention ArcGIS products as an alternative, I can't afford them.

Thank's for your attention.


texts: QGIS Print layout map coordinate works wierdly

texts: I set the coordinate as usual in QGIS, with coordinate grids. But the output has all the coordinates stacked at edges.


texts: Compression Algorithms output files larger than the originals. Why?

texts:
I'm currently attempting to write a script that will compress a few hundred .tif files.  I've tried two approaches, first I wrote a script in Python using CopyRaster_management() function and the second I wrote with GDAL using the gdal_translate() function.  However, in both cases, the files outputted from the script are larger than the originals and I do not know why.  The files in question are .tif scans that are uncompressed from .zip files.  The only case that works is when I run a JPEG compression in the ArcGIS environment which drastically reduces the size by ~80%.  Any ideas why this is?

My Python script is as follows:

import arcpy, os
arcpy.env.workspace = r“Z:\ScannedImages\LZWCompressInput”
rasList = arcpy.ListRasters()
outWs = r“Z:\ScannedImages\LZWCompressOutput”

arcpy.env.compression = “LZW″
for ras in rasList:
  arcpy.CopyRaster_management(ras, os.path.join(outWs, ras))

As for gdal, I run a command like this:

gdal_translate -co "COMPRESS=LZW" infile.tif outfile.tif


texts: Does QGIS work in Windows Embedded Handheld 6.5? I am planning to buy an outdoor mapping device, but I'm not sure if this OS supports QGIS.


texts:
I have polygon of trees, this polygon variates with the area of the branch of trees.
I would like to select by a classic hand/polygon selection an area on my canvas, but instead of selecting the whole polygon I need it to keep only what's inside the selection.
As you can see below (on cadastral parcels just to illustrate): I select with a polygon

But my result is out of that polygon.

I would need to only keep the part of the polygon I selected to later calculate the area of my selection.
I would like :

different step to do it
OR a macro to do it
OR python code to add in a qgis Plugin


texts: Arcpy & ARCGIS10: Make netCDFRasterlayer, error attribute not found

texts:
I am trying  to create a raster layer from a NetCDF File using Python.
If I am using the Arcgis 10 Python window it works without issues.
But executing the same script in Pythonxy gives the error:

  NetCDF: Attribute not found

What could be the problem? I'm just wondering because it works within the Arcgis working area but not outside.

Here's my python code:

import arcpy

inNetCDFFile = 'C:/Users/Babs/Dropbox/Masterarbeit/mpihm_cnrmb1nat_precip_monthly_1991_2000.nc'

variable = 'Precip'

XDimension = 'lon'
YDimension = 'lat'

outRasterLayer = 'Precip_2011'
bandDimension = ''
dimensionValue = ''
valueselectionmethod = ''

arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension, YDimension,
outRasterLayer, bandDimension, dimensionValue,valueselectionmethod)


texts: How to save polygons generated from raster extents to shapefile in R

texts:
I'm looping through a list of rasters, getting the bounding box for each from raster@extent, and storing the matrices representing each polygon in a list. I'd ultimately like to save to shapefile where there will be like 359 polygons like:

I'm having trouble understanding how to actually get these polygons into a form that they can be exported as a shapefile. I have tried, for instance:
for (i in 1:length(file_list)){

    im <- raster(file_list[i])
    min_x <- im@extent@xmin
    max_y <- im@extent@ymax
    max_x <- im@extent@xmax
    min_y <- im@extent@ymin

    x_coord <- c(min_x, max_x, max_x, min_x, min_x)
    y_coord <- c(max_y, max_y, min_y, min_y, max_y)
    xy_mat <- cbind(x_coord, y_coord)
    poly_list <- rbind(poly_list, list(xy_mat))

  }

  #create simple feature polygon
  poly_sf <- st_polygon(poly_list)

I'm unclear on where to go from here. Admittedly I'm not an R spatial ninja but I thought there would be a relatively straightforward way to get from coordinates representing polygons to a shapefile. I am able to add extent and CRS whenever that is called for. I'm not wed to sf, that's just the furthest I got.


texts: Auto populate field as concatenation of other fields

texts:
I'm searching for a way to automatically combine several field values entered in the feature edit dialogue, resulting in a new column comprised of the former values.

I have, say fields A, B and C that will be edited manually with the edit form, where i.e. 'A-text', 'B-text' and so on, are inserted. Field D should then automatically be filled with the concatenated string: 'A-text, something, B-text, something, C-text, something'.

Is a custom ui-file necessary for this? I found this promissing post How to automatically populate fields instantly? but was not able to adapt it for my purpose..


texts: Splitting line at all vertices in ArcGIS Desktop?

texts:
I need look through 3025 lines and split them at every vertex, then make points at the end of them and call them fittings. My coworkers would select 1 by 1 and hot key them.

Is there a better way?

These line are steel pipe and the point will be fittings that bends the pipe.


texts:
I have a confusion in creating vector layer.
I have source data in GeoJSON and in EPSG:3857 (my map view is already
in EPSG:3857).

Since it is in EPSG:3857, I thought it is not necessary to use any projection exp.

But vector is not displayed.

What I did:

 var vectorSourceCenter = new ol.source.Vector({
                features: features,
                //featureProjection: 'EPSG:3857'
                //projection: 'EPSG:3857'
   });

   var vectorCenterLayer = new ol.layer.Vector({
                source: vectorSourceCenter
   });

   map.addLayer(vectorCenterLayer );


texts:
I have a set of data in a Postgres database. Originally the data was point data that I converted to polygons with makegrid_2d from this post. Now I want to be able to rotate the polygons (around each polygons centroid). I tried to do it with several methods hence the result is the same as if I just rotate the features (separately) in QGIS like the ones down to the left:

I end up with new polygons overlapping and not covering the entire area.

Any suggestions on how to improve it?

EDIT1:
I release that I wasn't clear on what I wanted, I want to skew the polygons. Meaning that I want to change the polygons instead of having borders pointing (0-180deg resp 90-270deg) I want to "tilt" the polygon so its borders are pointing 20-200 resp 110-290deg. Does it make any sense?

I used st_astext(ST_Rotate(polygon,radians(20),ST_Centroid(ST_GeomFromText(ST_AsText(polygon))))) to rotate the polygons in the image.


texts: QGIS 2.10.1 - Categorized Style - Select and Deselct

texts:
I have a WFS layer that i have categorized in the style tab of the Layer properties.

This creates 50 or so categories that are now color coded which is exactly what i want.

How do i select 5 or 10 or all and toggle the visibility on and off ??


texts: Using TauDEM in QGIS 2.18.15 - error "mpiexex is not recognized..."

texts:
I am attempting to use TauDEM tools to model an existing watershed. I have installed the "TauDEM 5.3 Complete Windows Installer" mentioned on the download page (http://hydrology.usu.edu/taudem/taudem5/downloads.html). But when I attempt to run the "Pit Remove" command I get the message described in this thread:

https://tutel.me/c/gis/questions/164935/running+taudem+in+qgis

I've attempted to uninstall and check my file paths as the person who has answered the question suggested, but this hasn't fixed the problem. Has anyone else had any luck overcoming this problem?


texts: Installing ArcGIS for server 10.1 on linux server

texts:
I am trying to install ArcGIS for server 10.1 on my linux system. When I run "./startserver.sh" I get following error:

  ERROR: Unable to start Xvfb on any port in the range 6600 - 6619.

I have checked "xvfb_err.log" and this is the issue I found there:

  /root/arcgis/server//framework/runtime/xvfb/RHEL/Xvfb: error while
  loading shared libraries: libXfont.so.1: cannot open shared object
  file: No such file or directory

How can I fix the problem?


texts:
Want to do some testing with Sharepoint/MapIt.

Took an existing machine with ArcGIS Server 10 on Windows Server 2008 on.
Installed Sharepoint 3.0 SP2 on it with basic install/default options.
Can now hit Sharepoint with http:///default.aspx
Can no longer hit manager or REST = 404
Under wwwroot, the ArcGIS folder is still there

So whats happened and how can I get the two to work side by side?


texts: Dissolving polygons that intersects with line in Geometry Generator

texts:
I need help to understand what am I doing wrong in this expression. I have two layers, one with lines and one with polygons. I wished to achieve through Geometry Generator a dissolve of all the polygons that intersects with the line.
This is the code I'm using:
buffer (
    collect(
         intersects(
            geometry(
                get_feature(
                    'line', 'id', $id
                )
            ), $geometry
        )
    ), 0
)


texts: How to divide an ee.image into small images of size 256 x 256 x bandas?

texts: I have an huge image in a rectangle geometry and I want to divide this image into m images of size 256x256 with all its bands. If I merge all the images, I will get the original image and in order to get images with 256x256, some 256x256 images can have parts of another 256x256 image. How can I do this in the google earth engine?


texts: Slope calculations appear to be 90 degrees off in ArcGIS 3D Analyst?

texts:
Using 10.0 I've got a raster of a fairly flat area and i'm trying to calculate the slope.  Values for elevation are accurate and I am expecting slope values no more than 5 degrees over the raster.

After running the Slope (3D Analyst) I am getting slope values of 89 - 85 degrees and can't figure out why.

According to http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Calculating_slope the slope (θ) should be from the horizontal to the grade, but it looks like its being calculated from the zenith to the grade (90-θ off of what i'm expecting).

Any ideas on what I'm doing wrong?


texts: How to visualize a FeatureCollection in Google Earth Engine?

texts:
I have upload a kml file including main metropolitans in us as a fusion table, I can print the featurecollection but cann't visualize it in code editor.What's wrong with my code?

var fc = ee.FeatureCollection('ft:1Eii75QFBlQcYILLBFsU6zv9LhgJLa8FPHNGSZijQ')

Map.addLayer(fc, {}, 'metro');

print('fc',fc)


texts:
To be short: how can I average two (or more) GeoTIFF images?
Explaining: I'm working with coastal water turbidity, using NASA Worldview images. I can easily visualize them in Jupyter Lab (Windows 10) and separated the RGB bands, and averaged them individually. My doubt is how to build a new GeoTIFF from the averaged bands? and keeping the spatial properties (lat/lon)?
My goal is to have a sort of monthly averaged images, and the standard deviation as well...
So far I'm doing this to understand how to do. Later I'll make it more functional for a  large number of images:
import matplotlib.pyplot as plt
import rasterio
from rasterio.plot import show

im1 = r'snapshot-2020-09-22T00_00_00Z.tiff'
im2 = r'snapshot-2020-09-29T00_00_00Z.tiff'

img1 = rasterio.open(im1)
img2 = rasterio.open(im2)

# selecting and averaging a band
b11 = img1.read(1)
b12 = img2.read(1)

b1m = (b11 + b12)/2


texts: Arcpy getCount_Management doesn't match row count with Cursor

texts:
I have some troubles to understand the behaviour of my code below. Obviously, GetCount_Management doesn't match the rows in my layer selection.

This code is part of a long for loop. I have hidden the rest for clarity purposes.

#...

# tmpThi is a in_memory output of CreateThiessenPolygons_analysis
# evtSts is a pandas Serie containing the name of rainfall stations of interest

arcpy.MakeFeatureLayer_management(tmpThi, "thLyr") # creating a layer

evtStsNames = [name for name in evtSts] # creating a list of station of interest

# select the Thiessen polygons where station name 'Nom' is in the list
arcpy.SelectLayerByAttribute_management("thLyr", "NEW_SELECTION", ' "Nom" IN (\'' + '\',\''.join(evtStsNames) + '\')' )

rows = arcpy.SearchCursor("thLyr") # Counting selected features with Cursor
rowCount = 0
for row in rows:
    rowCount += 1

print len(evtStsNames), arcpy.GetCount_management("thLyr").getOutput(0), rowCount # This should print the same result

This print a lower GetCount_management as follow:

3 2 3
4 3 4
7 5 7
1 1 1
3 1 3
4 2 4
1 1 1
6 2 6
14 6 14
...

This is quite confusing to me.

It seems that if I store the Thiessen polygons not in "in_memory" getCount match rowCount. I am still trying to understand what really happens


texts: Joining an ArcGIS Enterprise Database to another SQL database

texts:
I'm curious if it is possible to join an ArcGIS enterprise database to a separate SQL Server. My intention is to have 1 unique attribute on the ArcGIS layer that can reference the row in the SQL table for the join.

Is this possible? I want to be able to drop points in ArcGIS portal, give them a job number and then have it pull the rest of the data associated with that job number into the ArcGIS layer table so I can utilize this data in some sort of datadriven setup.


texts:
I have to analyze 8 raster layers, 5 of them are 0.5 degree resolution and the other three are 0.05 degree resolution.

Firstly, should I resample the 5 to finer resolution (0.05 degree) and if possible how to do this.

Secondly, if it is better to resample the 3 to the resolution of the others (0.5), what tool do I use to do this without changing the values of the raster. The 3 fine resolution rasters are livestock count data.

I am using ArcGIS Desktop 10.2.


texts:
I'm using ArcGIS 10.3

I have a network dataset with GCS_WGS_1984 coordinate system

and a layer of districts of Costa Rica country with Unkonown Spatial Reference

TOOLS ta use "defined Projection" Input is where districts and coordinate system is GCS_WGS_1984

but the layers do not match

just as it was with a CRTM05 prj. to download

but does not match

I asked to make a transformation but do not know how


texts: SQL Server geometry vs. geography in Esri map service

texts:
We have a SQL Server 2008R2 database where point coordinates are stored as decimal degrees.
I want to create an Esri map service which shows those points.

As the point data is dynamic I decided to use query layer to the table with coordinates and convert coordinates to SQL Server spatial type on the fly.

I tested both spatial types - geometry and geography and both allow to display points in ArcMap. Both types use WGS84 coordinate system because coordinates are longitude and latitude, but map service is in Web Mercator (3857).

What is should be preffered type of SQL Server spatial type to use to display longitude and latitude on the fly in Esri map service?


texts: How can I create a hexbin layer using the SQL and CartoCSS parameters in cartodb.js?

texts:
CartoDB has a great hexbin visualization wizard baked into the client dashboard:

However, I like using cartodb.js to customize events and interactions; in particular, I'd like to make styles dependent on map zoom level. Recognizing that the hexbin visualization is a combination of SQL and CartoCSS parameter configuration, what are the ideal functions to pass to CartoDB to return hexes with cartodb.js?


texts:
Using pgRouting I wish to run an analysis from a location's nearest point on the network. This question seems to have been asked and discussed in several locations on the web including here and in the comments sections by Daniel Kastl here but I cannot find an actual written, implementable solution.

I understand that I need to:

locate the point on the closest edge in the network and
split the edge to create a node to run the analysis from

but I do not know how to implement this. Can I do this on the fly with an already built network? If so, could I have the implementable code?


texts: Use secured WMS service from ArcGIS in GeoServer

texts:
I need to add some WMS services from token protected ArcGIS server to GeoServer.

I added WMS store and in end of "Capabilities URL" I added token param &token=xxx and got layer list. After publishing in layer preview I am getting 499 error, because when GeoServer asks tiles from ArcGIS it is not using token.

Has anyone had a similar situation?


texts: How to use the CartoDb baselayers from ArcGIS Javascript API

texts:
I've been trying to make use of the CartoDB baseLayers (https://carto.com/location-data-services/basemaps/) in the ArcGis Javascript API v 4.0.

But I have not been able to get it working.

I believe it is correct to make use of the WebTileLayer, and with single domain access I attempted to add it like this:

var layer = new WebTileLayer("http://1.basemaps.cartocdn.com/light_all/{level}/{col}/{row}.png", {
    "id": "cartoDb",
    "copyright": '&copy; OpenStreetMap contributors, &copy; CARTO'
    });

What am I getting wrong?


texts: How to make the display of a satellite image the same across users?

texts:
I have a group of users counting objects in a satellite image. To keep viewing conditions the same I wish each user to have the same display (e.g., the same scale).

To do this, I have asked users to set the same scale when viewing the satellite image (e.g., 1:1,000) on their laptop. Despite this, the image display looks different between users. For some users, the image appears more "zoomed in" and for others more "zoomed out" compared to mine.

How can I ensure all users have the same scale when viewing a satellite image?

Technical Details:

Users have the same satellite image (0.5 m Worldview imagery) but different laptops and platforms (some users are using QGIS, others ArcGIS).


texts: ImportError: DLL load failed with error code when I try to import GDAL from the Python console

texts:
I've installed GDAL from the wheel files available here on Python 3.4. I'm using an old version of Python because one of the packages I need doesn't work yet on Python 3.6.

When I try to import gdal in Python with a simple from osgeo import gdal, I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\site-packages\osgeo\__init__.py", line 41, in <module>
    _gdal = swig_import_helper()
  File "C:\Python34\lib\site-packages\osgeo\__init__.py", line 37, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
  File "C:\Python34\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
ImportError: DLL load failed with error code -1073741795

I'm not sure this question is a duplicate of this question which suggests to install the pre-compiled GDAL from GIS internals.


texts: Leaflet: get layer in GeoJSON with pixel coordinates instead of lat long coordinates

texts:
In my Angular 7 project with ngx-leaflet and leaflet 1.4.0 and leaflet-draw 0.4.14 I want to export each drawn rectangle (and circle,...) to GeoJSON.

That works fine using

 public onDrawCreated(e: any) {
    const layerType = e.layerType;
    const layer = e.layer;
    const gj = layer.toGeoJSON();
// .... save gj
}

Now I also want to have the GeoJSON with pixel coordinates instead of the latlng coordinates as they come from the layer.

So I suppose I need to execute a project on all coordinates using

this.map.project(ltlng, this.map.getMaxZoom()).round();

However: this.map.project returns a point object not a latlng object.
I tried to apply this conversion on the _latlngs property of the layer object, but obviously it does not work.

Should I do the conversion on the GeoJSON object?
Any tips on how I can make this conversion work?


texts:
Is there any way to drag a marker from outside to the map using
  leaflet Api . Any suggestions plese help me?


texts:
I have 7 shapefiles over an agricultural area. All of them have the same attributes (province code, polygon code, crop, etc.). I want to combine them to have only 1 shapefile. I have used the "union" tool of QGIS. The result looks good but the attribute table of the output is not what I want.

This tool copy and paste each input attribute table so in the output table there area a lot of duplicates. Is there a way to have only one time the colums and then all the values?

As you can see in the image, attributes like "ID_RECINTO" are duplicated.


texts: Removing sliver polygons in ArcGIS Desktop?

texts:
I unioned 2 layers into 1 layer, and it created sliver polygons.

I used the elimination tool to merge them with neighboring polygons.

As as result, it merges all sliver polygons to only one polygon (selected in the picture).

What I need, is that, every sliver polygon to be added to its neighboring polygon.

How that could be achieved?

I am using ArcGIS Desktop 10.


texts:
I'm trying to plot bodies of water on my map and struggling with islands in ggplot2. I understand the right/left-hand rule for exterior/interior rings but there is still a problem going from island to island. The question is how do I plot a polygon with lots of holes/islands in ggplot2? I believe the trick is order, but what order?

Here is the MWE I have built to try and understand and fix the problem:

library(ggplot2)

ids <- letters[1]

# IDs and values to use for fill colour
values <- data.frame(
  id = ids,
  value = c(5)
)

# Example of good polygon and holes
good_positions <- data.frame(
  id = rep(ids, each = 5),
  #     shape        hole       hole       hole
  x = c(1,10,10,1,1, 2,2,3,3,2, 7,7,8,8,7, 5,5,6,6,5 ),
  y = c(1,1,10,10,1, 2,3,3,2,2, 7,8,8,7,7, 5,6,6,5,5)
)

# Example of good polygon and holes
bad_positions <- data.frame(
  id = rep(ids, each = 5),
  #     shape        hole       hole       hole
  x = c(1,10,10,1,1, 2,2,3,3,2, 7,7,8,8,7, 5,5,6,6,5 ),
  y = c(1,1,10,10,1, 2,3,3,2,2, 7,8,8,7,7, 3,4,4,3,3)
)

# Merge positions and values
good_datapoly <- merge(values, good_positions, by=c("id"))
bad_datapoly <- merge(values, bad_positions, by=c("id"))

# Plot polygons
good_plot <- ggplot(good_datapoly, aes(x=x, y=y)) +
  geom_polygon(aes(group=id, fill=factor(value))) +
  scale_fill_discrete("Key")

bad_plot <- ggplot(bad_datapoly, aes(x=x, y=y)) +
  geom_polygon(aes(group=id, fill=factor(value))) +
  scale_fill_discrete("Key")

good_plot
bad_plot


texts:
I would like to resample a number of rasters with a small cell size (i.e., 30 m) to a larger cell size (i.e., 100 m) using either ArcMap or ArcGIS Pro. My new, larger cells will each cover 3.33x3.33 of the original cells, but the resampling window for the different techniques is inappropriate and appears to be hard-coded into the geoprocessing tool.

Bilinear (continuous data): resamples the 4 cells nearest to the center of the new cell. This window is too small.
Cubic (continuous data): resamples the 16 cells nearest to the center of the new cell. This window is too large, and will result in an undesireable level of smoothing.
Majority (categorical data): ArcMap uses a 3x3 window and ArcGIS Pro uses a 4x4 window. One is a little too small, and one is a little too large, but they are both close enough to be OK.

Is there a way to specify a user-defined window (e.g., the 10 closest cells) for resampling continuous raster data?


texts: Field Calc to change one digit in a sequence Arcmap

texts:
I have an 11 digit ID in one field I'll call "Current_ID". I would like to create a new field named "New_Field" and populate it with same value except I need to change the value of the 4th digit from a 5 to a 4.

Example:
"Current_ID" = 1505000001
"New_Field" desired ID =  1504000001

Both field types are Double

400 records

How can this be done using Field Calc?


texts:
I made a model for spatial join and it is working properly but when I export as script and run in ArcPy it gave me error in spatial join. Here is the code
import arcpy

# Script arguments
Houses = arcpy.GetParameterAsText(0)
if Houses == '#' or not Houses:
    Houses = "Houses.shp" # provide a default value if unspecified

Sub_blocks = arcpy.GetParameterAsText(1)
if Sub_blocks == '#' or not Sub_blocks:
    Sub_blocks = "Sub_blocks.shp" # provide a default value if unspecified

Houses_sub_blocks_shp = arcpy.GetParameterAsText(2)
if Houses_sub_blocks_shp == '#' or not Houses_sub_blocks_shp:
    Houses_sub_blocks_shp = "E:\\MS\\2nd Semester\\python\\Data\\New data\\Houses_sub_blocks.shp" # provide a default value if unspecified

alternatives = arcpy.GetParameterAsText(3)
if alternatives == '#' or not alternatives:
    alternatives = "alternatives" # provide a default value if unspecified

C1_houses = arcpy.GetParameterAsText(4)
if C1_houses == '#' or not C1_houses:
    C1_houses = "alternatives" # provide a default value if unspecified

# Local variables:

# Process: Spatial Join
arcpy.SpatialJoin_analysis(Sub_blocks, Houses, Houses_sub_blocks_shp)

# Process: Join Field
arcpy.JoinField_management(alternatives, "FID", Houses_sub_blocks_shp, "FID", "Join_Count")

and the error is


texts: Add a Panoramio-like layer to ArcGIS Online map

texts: I am interested in integrating some type of Panoramio-like layer into a map on ArcGIS.com.  My objective is to be able to use the qualitative, place-based data offered by the photos with students who routinely use ArcGIS Online.  It appears that Panoramio will no longer be available.  Is there an alternative and can it be added to AGOL?


texts: QGIS union (one vector layer): side location conflict?

texts:
I occurred an error when using "union" tool (only one layer) in QGIS. I have a series of vector files, yet only one vector file fails to union with the error information. The error is:

  GEOS geoprocessing error: intersection failed. TopologyException: side
  location conflict at ...

I have tried "fix geometry", "check valid", and "v.clean" functions, but none of them works.

The vector file is at the following link: https://drive.google.com/file/d/1xF1qezlEtaktXvFSf01PB5QdUPhlQCdS/view?usp=sharing


texts:
How can I change the default password of geoserver admin from geoserver to something else?

I have tried two different things, but none worked. First thing I tried following the online documentation is to go to the data_dir at:

 /usr/local/lib/geoserver-2.5/data_dir/security

and I could only find

  <user enabled="true" name="admin" password="digest1:XXXX...">

in usergroup/default/users.xml. But I can't edit a digest.

The second thing I tried is to change the password from the web admin interface in the "Passwords" menu on the left panel. Although I can change the password, but it seems to be changing something called the master password. The password for admin remains the same.

I am using geoserver2.5 from osgeolive8.


texts: Making a delimited text file for my data in QGIS?

texts:
I am using QGIS 2.8 and I want to make a mesh file for dam break simulation. I am following a tutorial of BASEmesh for it. BASEmesh is QGIS plugin. My data is in form of dam dimensions, geometry and elevations.

Can anyone help me that how shall I create a delimited text file for it to put in delimited text layer?


texts: ArcMap 10.1 Create colored lines from one layer to another based on common field

texts: I joined a points layer to a polygon layer. How can I draw lines from a one-to-many polygon to points? I don't have Business Analyst extension so I don't think spider diagram is the right tool. Also, the polygon-to-points is not based on distance but is based on an attribute value in the polygon layer.


texts:
I've been looking for mapping software that will allow non-GIS-trained staff, or clients, to create their own maps. For example, CartoDB provides hosted mapping with a web interface that's reasonably straightforward. StatPlanet also aims at enabling end users to create their own maps and tweak them via a Flash program.

Both of these tools have good features, but also have some limitations. I would like to hear what other alternatives are out there. I'm especially looking for cross-platform ease of use, flexibility of coloring schemes (e.g. bi-polar progressions), and ease of importing custom data.


texts: Loading GeoDataFrame to PostGIS when GEOM column contains MULTILINESTRING and LINESTRING

texts:
How can I load GeoDataFrame (populated from shapefile) to PostGIS when GEOM column contains MULTILINESTRING and LINESTRING e.g.:

LINESTRING (14.2384666 46.6304714, 14.2386703 46.6304123)

MULTILINESTRING ((13.90433020000000042 46.61830880000000121, 13.90393929999999934 46.61873270000000247, 13.90390771785250124 46.61876445408692859),(13.90327032848085764 46.61940531353186401, 13.90327032848085587 46.61940531353186401))

I have tried with "to_sql" but I need to specify GEOM type and when I chose

'geom':Geometry('MULTILINESTRING', srid=4326)}

I got an error: ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'LineString'


texts: Naming features along line in ascending order

texts:
I want to name the features in a featureclass in ascending order alphabetically. I have a line with a direction and I want the one closest to the start to be A, the next closest B etc. When I get to a new line, I want it to start from A again.

I have tried to use the GP tool locate features along route, but it does not generate any output. Im using ArcMap 10.5, but have access to ArcGIS Pro as well.


texts: Refresh attribute table from Python in QGIS 2

texts:
Attributes values are changed in a Python plug-in (QGIS 2.14/18) when the user clicks on the canvas. The opened view of the attribute table of the changed feature does not show the changed value even if the reload table icon is selected, only if I close and reopen the attribute table. While the info tool show the new correct value.
How can I force the attribute table window to refresh?
The attribute is changed like this:

layer.startEditing()
layer.dataProvider().changeAttributeValues(...)
layer.commitChanges()


texts: Batch process RouteFinder tasks in MapInfo

texts:
I am running multiple network analysis processes in MapInfo using RouteFinder. Some of the datasets are large and the processes take a long time, so I would like to be able to set several to run consecutively over the weekend. I am a novice with MapBasic and generally use the viewer window to view code for various tasks and then copy chunks and string them together to produce what I want. However, when Routefinder start the MapBasic window stops displaying.

In this particular case, I want to run the same Nearest process using the same network settings and origin data, so the only thing changing each time would be the destination dataset. I'm guessing there is a simple way to set this up but haven't been able to work it out.


texts: Significance test for local Moran's I in R raster

texts:
Does anyone know how to produce the p-value and z-scores in order to do a significance test in the local Moran's I values obtained by the following code?

The input is a remote sensing image:

The produced by the code raster showing local Moran's I values is this:

library(raster)
library(classInt)
r <- raster('FIL1992_EL.tif')
r <- crop(r, extent(1900000, 2200000, 4500000, 4700000))  # central EL

m <- MoranLocal(r, w=matrix(c(1,1,1,
                              1,0,1,
                              1,1,1), 3,3))

zClass <- classIntervals(values(m), n=5, style="kmeans")
plot(m, breaks=zClass$brks, col=colorRampPalette(c("pink", "red4"))(5) )


texts: GRASS v.buffer.column and v.buffer.distance - Incomplete Output

texts:
I have tried .column and .distance buffers within QGIS and both are leaving me with incomplete results. Only a few of the features within my input file are actually being buffered.

I also have both "Make outside corners straight" and "Don't make caps at the ends of polylines" set to 'No'

Why is this occuring?


texts:
I am completely new to OpenLayers.

I created a GML using QGIS and would like to call data from it. It isn't stylized (specific icons per attribute). I would like to stylize/symbolize the data using HTML for my openlayers map.

I've created two rules, where one rule pulls an image if satisfying the first rule, and another image if it satisfies the other rule.

I've looked online as whatever I use for some reason is not working.

 var rule_lease = new OpenLayers.Rule({
    filter: new OpenLayers.Filter.Comparison({
        type: OpenLayers.Filter.Comparison.EQUAL_TO,
        property: "asset_type",
        value: "lease",
    }),
    symbolizer: {
        externalGraphic: "location_of_file1.png",
                graphicWidth: 40,
                graphicHeight: 40,
                graphicYOffset: -25,
                //rotation: "${angle}",
                fillOpacity: 0.75
    });
        var rule_crown = new OpenLayers.Rule({
    filter: new OpenLayers.Filter.Comparison({
        type: OpenLayers.Filter.Comparison.EQUAL_TO,
        property: "asset_type",
        value: "Crown-owned",
    }),
    symbolizer: {
        externalGraphic: "location_of_file2.png",
                graphicWidth: 40,
                graphicHeight: 40,
                graphicYOffset: -25,
                //rotation: "${angle}",
                fillOpacity: 0.75
    });

    style.addRules([rule_lease, rule_crown]);

    map.addLayer(vector);

If my rule is as written above (note that I haven't included a default style), how do I call a GML file for it read the data from? I know I got to include it before the rules, but I am unsure of the correct syntax. Does it look like this:

var vector = new OpenLayers.Layer.Vector("", {
    protocol: new OpenLayers.Protocol.HTTP({
        url: "location_of_gml.GML",
        format: new OpenLayers.Format.GML
    }),
    strategies: [new OpenLayers.Strategy.Fixed()],
    styleMap: new OpenLayers.StyleMap({

OR THIS:

 var layer = new OpenLayers.Layer.GML("Layer Name",
 "http://example.com/url/of/data.txt", { format: OpenLayers.Format.gml });
 map.addLayer(layer); map.zoomToMaxExtent();

I've tried both but I seem to be doing something wrong.


texts:
I am trying to understand how tile server handle requests.

I red about Mapnik which "creates" the map using OSM,

Does "creates" means that every request is rendered and returned? If yes what is the performance hit (global map)?

Or it means that Mapnik Creates all tiles needed on initialization and then serves the right one upon request?  if yes what is the total storage needed for all tiles(for global map)?

I am trying to find a way to build my own tile server (global map) while rendering it only once.


texts: Land cover data to create single colour polygons

texts:
I am trying to replicate the map here https://www.cdc.gov/yellowfever/maps/africa.html
I have downloaded land cover data, which is what the Northern countries are based on, from https://www.diva-gis.org/gdata, and used singleband psuedocolour in the symbology to achieve the look below.
However, I am not sure how to cover the entire area for those six countries yellow. Does anyone have any tips?


texts: Is there an analog to ArcGIS Area Solar Radiation in R?

texts: Is there a function in R to compute direct, diffuse, and global insolation based of DEM in R similar to Area Solar Radiation tool in ArcGIS?


texts: ogr2ogr from Postgres to GeoJSON missing crs key

texts:
I'm using ogr2ogr to convert some OSM data for Greenland (not really important for the question), from a PostGIS database to a file containing GeoJSON.

The problem is that the GeoJSON gets written without the crs attribute, even though I'm reprojecting to a non-4326 coordinate system (3189 to be specific). See below how I do this.

The srid of data in geometry column in the database table is 4326. I use the t_srs "epsg:3189" option to transform the coordinates, and this seems to work, i.e. the coordinates are not Lat/Lon.

Command used:

ogr2ogr -f "GeoJSON" greenland_coast.geojson \
  PG:"host=localhost user=xxx dbname=greenland_osm password=xxx" \
  -sql "select linestring from ways" -t_srs "epsg:3189"

Snippet of GeoJSON result:

Notice the missing crs attribute that should indicate that the coordinates are in EPSG:3189.

{
"type": "FeatureCollection",
"features": [
  { "type": "Feature",
    "properties": { },
    "geometry": {
      "type": "LineString",
       "coordinates": [
         [ -548886.066167875193059, 9361706.390365654602647 ], ...]
     }
  },
  ...
]}

The coordinates seem to have been transformed correctly, but there is no crs field telling a reader of the GeoJSON file that the coordinates are in epsg:3189

The GeoJSON spec states:

  If no crs member can be so acquired, the default CRS shall apply to
  the GeoJSON object ... The default CRS is a geographic coordinate
  reference system, using the WGS84 datum, and with longitude and
  latitude units of decimal degrees.

I assumed that since I'm reprojecting to a non-geographic coordinate system, a crs key-value pair would be written to the GeoJSON (indicating EPSG:3189 in my case).

My question

Which of the following statements is more true?

I'm using ogr2ogr wrong
My expectations of ogr2ogr are too high
There an error in the GeoJSON driver


texts: How to update geometry by snap to polygons in same layer

texts:
I try to snap automatically polygons to other polygons in the same table.
The following doesn't work.
update table w
set geometry = ST_Snap(geometry, w.geometry, 30)
where txt_grund='osm_primary';

By this nothing happens.
I have one table with polys about different themes. They have to be adjacent together and I want that the vertices snap each other. In the moment their is a difference arround 30 m between the polys.
I tried also to snap the vertices from polys from a different table and get many polys but not snapping:
select  c.gid, c.bio,
st_snap(c.geom, st_closestpoint(w.geometry, c.geom), st_distance(c.geom, st_closestpoint(w.geometry, c.geom))*1.0 ) as geom
from (select geometry from wtable) as w,
(select gid, bio, geom from ctable where pk_ident = '3941SW0896') as c

How to use postgis to snap the vertices?


texts: How to disable Windows 10 pop ups after processing in QGIS

texts:
Whenever I run any processing algorithm in QGIS, after it finishes I get Windows 10 pop-ups (notofications in lower-right corner) which says that the processing is finished. It is very annoying, particularly when I run very quick and simple algorithms, because it makes QGIS window out of focus and to get back to work I have to close the pop-up first.

How can I disable Windows 10 notifications for QGIS?


texts: Setting default units for Shape_Area to be Acres using ArcGIS Desktop

texts:
When I create a new feature layer polygon, how do I set the default in Shape_Area
to read out in Acres?


texts: Error in opening shapefile located on network

texts:
I have been able to successfully open a shapefile using Gdal when it is situated on my local machine. However, when I put the file on another machine on the network and try to open it, it fails.

There is no exception thrown which I can read through and explore. The operation simply returns null. Below is the code that I have used for both cases.

private const String LocalShapeFilePath = @"C:\FakePath\VectorData.shp"
private const String NetworkShapeFilePath = @"\\NetworkServer\FakePath\VectorData.shp"

//The line below works fine and dataLocal is not null
var dataLocal = Ogr.Open(LocalShapeFilePath, (int)Access.GA_ReadOnly);

//The line below fails to open the data source and dataNetwork is null
var dataNetwork = Ogr.Open(NetworkShapeFilePath, (int)Access.GA_ReadOnly);

Just to make an another attempt, instead of opening the file using Ogr.Open(), since I know that it is shapefile, I used drv.Open() with drv = Ogr.GetDriverByName("ESRI Shapefile");. The output is still the same. Local file opens while network based file is null.

Does anyone know what's the issue. Has it been encountered anywhere earlier before?

Kindly update the tags if they aren't ok.


texts: Creating a postgis database a GML application schema

texts: Is there any open Source tool(automated or semi-automated) that converts GML application schema to a POSTGIS database/table .Specifically I have a huge application schema containing many feature-collection which i would like to convert to postGIS database , through an automated process. Any pointers would be helpful.


texts:
I've heard that quadtrees (as used in spatial-indexing) can be implemented on top of the B-tree structure for non-spatial indexes.

For example, comments in a blog says:

  with R-trees you are building a disk-based, ideally transactional data
  structure from scratch, which is a big undertaking. With z order and
  Hilbert order, you just use any convenient b-tree

But I couldn't find details about how to implement a quad-tree as a B-tree.

Can anyone explain the main ideas here?


texts: Getting an error when generating an SDM with the R SDM package's ensemble function

texts:
I'm attempting to build a climatic species distirbution model using 3 separate techniques: glm, maxlike, and gam. I'm using the sdm package in R. After generating the model, I'm trying to use the ensemble() function to generate a weighted average of those three models based on the AUC statistic and then output that to a map I can plot.

sdmShp is a SpatialPointsDataFrame of presence-only points generated from GBIF data. CDTClimate is a clipped raster object of climate data imported from Worldclim.

library(sdm)

modelData <- sdmData(formula = PA ~ AnnMeanTemp+AnnPrecip, train = sdmShp, predictors = CDTClimate, bg=250)

model <- sdm(PA ~ AnnMeanTemp+AnnPrecip, data = modelData, methods=c("glm","maxlike", "gam"), replication = c('sub', 'boot'), test.percent = 30, n=5, modelSettings = list(ncore= "1L"))

map1 <- ensemble(model, newdata = CDTClimate, filename = "map1data.img", setting=list(method='weighted', stat='AUC'),
overwrite=TRUE)

The model runs fine, but when I attempt to use the ensemble function I get the following error:

Error in if (ncore < w$ncore) w$ncore <- ncore :
  missing value where TRUE/FALSE needed

I've tried adding a modelSettings parameter to the ensemble function similar to what I did for the sdm() function, but it didn't change anything. There doesn't appear to be any information in the documentation about using ncore in the ensemble function. What do I need to do to get this to work?


texts: How to fix the links clipped by an unconnected area in QGIS?

texts:
I'm trying to clip my target shapefile with a given example area.

The given example area looks like the following pic:

And there is a river separating two areas. However there are links connecting two area such as bridges on my target shapefile. After I use the geography tool-clipping on my target shapefile, those bridge links are deleted.

Is there a way for me to add those bridge links back to the result shapefile?


texts: How raster files are stored in databases?

texts:
When storing raster files in PostgreSQL only one row is created in the database, but the raster is a matrix so typically it must create rows and columns.

I want to understand how raster files are stored in databases?


texts: OpenLayers: Click event to display position shows Uncaught TypeError: Cannot call method 'getLonLatFromPixel'

texts:
I have created a map using openlayrs, and put a click event to display its position in screen, when i clicked got an error message like
Uncaught TypeError: Cannot call method 'getLonLatFromPixel' of undefined , another error like Uncaught TypeError: Cannot call method 'xy_to_ll' of undefined., I've tried OpenLayers.Control.Click but it shows some other errors, like e is undefined.

And I've another problem with openlayers google map, on setting the mapCenter wms,yahoo maps shows the exact location, but google won't. How to fix this.I have figured out one solution for this  to set sphericalMercator, but this doesn't fixes that problem

My code is given below:

//canvasId is the id of html element.
Mapper =
        {
            MapCanvas: null,
            position: null,
            MapperInit: function (canvasId) {
                /// <param name="canvasId" type="String">Id of the element on which the map is to be generated</param>

                this.MapCanvas = new OpenLayers.Map(canvasId, {
                    layers: [
                        new OpenLayers.Layer.Google("Google", { 'sphericalMercator': true,
                            'maxExtent': new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
                        }),
                        new OpenLayers.Layer.WMS("WMS","http://vmap0.tiles.osgeo.org/wms/vmap0", { layers: "basic" }),
                        new OpenLayers.Layer.Yahoo("Yahoo")
                        ]
                });
                //Adding controls to map

                this.MapCanvas.addControl(new OpenLayers.Control.LayerSwitcher());
                this.MapCanvas.addControl(new OpenLayers.Control.MousePosition());
                this.MapCanvas.addControl(new OpenLayers.Control.OverviewMap());
                this.MapCanvas.zoomToMaxExtent();

                //sets the map center
                this.MapCanvas.setCenter(new OpenLayers.LonLat( 77.5, 8.5), 5);

                this.MapCanvas.events.register("click", this.MapCanvas, function (e) {
                    console.log("Value of E => "+e.xy);
                    this.position = this.MapCanvas.getLonLatFromPixel(e.xy);
                    alert(this.position);
                });
            }
        };

Please help me to find what is wrong in my code.


texts: Reading the names of geodatabase file layers in Python

texts:
I'm looking at New York City's Projected Sea Level Rise dataset. This dataset states that it is:

  Geodatabase of projected sea level rise based on models released by New York City Panel on Climate Change (NPCC). Data includes the 10th, 25th, 50th, 75th and 90th percentile projections for the years 2020, 2050, 2080 and 2100.

I can read this into a GeoDataFrame using:

import geopandas as gpd
# Download from https://data.cityofnewyork.us/City-Government/Projected-Sea-Level-Rise/6an6-9htp directly...
data = gpd.read_file("NYCFutureHighTideWithSLR.gdb", driver='FileGDB', layer=0)

Here I am reading the 0th (first) layer in the database.

But what does that actually mean? I'm not sure what order the percentile-year layers were provided in by the city, so I'd like to, if possible, also read the names of the various layers.

However, I am unsure how to do so, or even if layer names is a feature of this data format at all. Does anyone know how to do this in Python, preferably by using new-school tools like fiona or geopandas?


texts: Georeferencing a historic map to a local custom coordinate system

texts:
I want to georeference a map (TIFF) from 1965 using the grid crosses as ground control points. The map is in the local coordinate system which I calculated and wrote a custom coordinate system for.
When I want to start the georeferencing it says transformation is not possible. I am afraid it doesn't work because of my custom coordinate reference system. If I use another system it "works" ( but then the map is wrong obviously).
DERIVEDPROJCRS["Milet lokal 2015 (Bendt)",
    BASEPROJCRS["WGS84 / UTM zone 35N",
        BASEGEOGCRS["WGS 84",
            DATUM["World Geodetic System 1984",
                ELLIPSOID["WGS 84",6378137,298.257223563,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]]],
        CONVERSION["UTM zone 35N",
            METHOD["Transverse Mercator",
                ID["EPSG",9807]],
            PARAMETER["Latitude of natural origin",0,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8801]],
            PARAMETER["Longitude of natural origin",27,
                ANGLEUNIT["degree",0.0174532925199433],
                ID["EPSG",8802]],
            PARAMETER["Scale factor at natural origin",0.9996,
                SCALEUNIT["unity",1],
                ID["EPSG",8805]],
            PARAMETER["False easting",500000,
                LENGTHUNIT["metre",1],
                ID["EPSG",8806]],
            PARAMETER["False northing",0,
                LENGTHUNIT["metre",1],
                ID["EPSG",8807]]]],
    DERIVINGCONVERSION["Affine",
        METHOD["Affine parametric transformation",
            ID["EPSG",9624]],
        PARAMETER["A0",-428178.87985533,
            LENGTHUNIT["metre",1],
            ID["EPSG",8623]],
        PARAMETER["A1",1.00014514665939,
            SCALEUNIT["coefficient",1],
            ID["EPSG",8624]],
        PARAMETER["A2",-0.0227055108057824,
            SCALEUNIT["coefficient",1],
            ID["EPSG",8625]],
        PARAMETER["B0",-4164309.21582976,
            LENGTHUNIT["metre",1],
            ID["EPSG",8639]],
        PARAMETER["B1",0.0227055108057824,
            SCALEUNIT["coefficient",1],
            ID["EPSG",8640]],
        PARAMETER["B2",1.00014514665939,
            SCALEUNIT["coefficient",1],
            ID["EPSG",8641]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]]]

Also my QGIS version 3.16 is not the problem. I tried with version 3.10.
Is there a way to georeference a TIFF to my custom coordinate system?


texts: Copy Enterprise Geodatabase to new SQL Server - will it work?

texts:
ArcGIS Desktop 10.4.1, ArcGIS Server 10.4.1, SQL Server Enterprise GDB

We need to make an exact copy of an Enterprise GDB (SQL Server) and move it to a new server.  Besides changing connection strings for the clients, is there anything that will need to be done?  All of the SDE functions, stored procs and tables will be moved also.

The ONLY thing that will change is the server name.
DBA will do a backup and restore it to the new server.
I am expecting it to work without any administrative tasks...


texts: "Error 999999: Error executing function - Attribute conversion error" when running RegisterWithGeodatabase

texts:
I am using ArcPy to run through all of the spatial views in an enterprise GDB, register them with the GDB, and assign domains to the registered view. It runs great for most of the views in the GDB, but 5 of our 35 views fail with the titular error.

I've tried several suggested fixes, including

Turned off background geoprocessing
Cleared temp folder C:\Users\\AppData\Local\Temp
Checked additional log files (e.g., C:\Users\\AppData\Local\ESRI): empty
Check for NULL geometries in underlying SQL tables: don't have any
Exported view to shapefile (Feature class to feature class): it's valid
We don't have any user-defined data types
Deleted and recreated view
CAST bit to smallint for "Repaired" column in CREATE VIEW statement

RDBMS - MSSQL, version 14.0.17289.0

SDE - SQL Server Enterprise Geodatabase, version 10.5.1

Attempting to register manually within ArcMap, here's an example input

And the fields used in this view

And the SQL data type definitions

View definition with CAST from bit to smallint


texts: MapBasic: expression does not evaluate to a column or table name

texts:
I want to create a new table using MapBasic to fill it later with log events. Those log will go in a new table created each year.

Here is my code (error occurs on row with Create Table):

' --- Log
Dim anneelog, pathlog as String

anneelog = Str$(Year(CurDate()))
pathlog = "D:\Partages\Automatisation\Centralisation_DB\log_" & anneelog & ".TAB"
Print anneelog
Print pathlog
Print PathToTableName$(pathlog)

if Not FileExists(pathlog) Then
    Create Table PathToTableName$(pathlog) (Procedure Char(30), PK_POS Integer, PK_enseignes Integer, Enseigne Char(30), Old_Enseigne Char(30), Adresse Char(100), CP Char(12),
    Country Char(20), Localite Char(50), Surface_IN Float, Secteur Char(30), Sous_Secteur Char(50), X Float, Y Float, User Char(30), Date_modif Date, Heure_modif Time)
    file pathlog TYPE NATIVE Charset "WindowsLatin1"
    Commit Table PathToTableName$(pathlog)
    Close Table PathToTableName$(pathlog)
End if


texts: Where is connection file used to connect ArcMap to ArcSDE?

texts:
In ArcMap 10.0, how do I find where the connection file is that is being used to connect to ArcSDE 10 on Sql Server 2008?

Some non administrative users are hooking up to SDE as the user 'sde' with db auth.  The users are passed around a few mxds and I am trying to find the connection file to delete it.

If the connection file is embedded in the mxd I suppose I could use python to comb the network and individual c drives finding all the mxd that connect up with db auth and sde user.

Is there a way to block this at the db level or some other?  Thanks.


texts: Export time-series MODIS 16 Day NDVI and EVI Data on Google Earth Engine

texts:
I want to extract every single MODIS 16 Day NDVI and EVI Data image on a particular area from 2000 to 2016. I was able to filter image collection but I do not know how to export every single image on the collection.

Here is my code:

// Area of interest

var AOI = ee.Geometry.Rectangle([93.8, -8.8, 109.9, 6.84]);

// Go to the center of the map

Map.centerObject(AOI, 4 )

// Find MOD13Q1.005 Vegetation Indices 16 Day Global 250 m

var modis = ee.ImageCollection('MODIS/MOD13Q1')

// Filter the collection

var image = ee.ImageCollection((modis).filterDate(ee.Date('2000-01-01'),ee.Date('2017-12-31')).filterBounds(AOI));

// NDVI dan EVI

var NDVI = image.select(['NDVI'])
var EVI = image.select(['EVI'])

//Print the image list on console

print(NDVI)
print(EVI)

//Load it into map

Map.addLayer(NDVI);

I know that my code is too long and not efficient, but it helps me to read and understand it.

Can you help me to write code to export every single NDVI and EVI image on my image collection?


texts:
I'm trying to create some tables on PostgreSQL with a Geometry field. For the Polygon and Point types it works but when I want to create a Line  o LSEG type I get an error.

If I do:

.....
geometry_field geometry(Polygon, 25829),

or

geometry_field geometry(Point, 25829),
.....

it works and the table it's created but when I try:

.....
geometry_field geometry(Line, 25829),

or

geometry_field geometry(LSEG, 25829),
.....

I get:

ERROR:  Invalid geometry type modifier: line or lseg

Looking at the Documentation the type exists so I don't know what I'm doing wrong.

Where is my mistake?

Edit:

I'm using a legacy system whith PostgreSQL 8.4 and PostGIS 1.5


texts: What is the best projection to use for this?

texts:
I have two vector layers of state and county boundaries that I would like to find the areas for each individual state/county. However, the CRS is set to NAD83 with EPSG:4269. Due to this, when I look at the Attribute Table, ALAND is waaay too big to make sense and there are no units. I think that these are in arcsecs, and someone recommended at What are units for calculated area in QGIS? that I change the CRS to UTM or Lambert.

Are there any recommendations for a CRS that would fit both the U.S. and counties shapefiles (they are overlaid so I don't want them to look offset)?


texts:
When I see Japan area though Google maps, I see yellowish boundaries. It seems like places where many people are gathered.

I see them in another countries in France

I wonder what data are these and where I can download them


texts: Custom labeling with same angle as rectangular object and specific position using QGIS?

texts:
Can the following be done in QGIS? It should be formula based without manual formatting as performed by my predecessor to get the following output.

So

Grave_No on right parallel to the y axis of the grave.
Name on top center parallel to the x axis of the grave.
Date of Death on bottom center parallel to the x axis of the grave.

I expect that we will need to copy the layer three times to apply custom labels for each of these situations

In MI
-I can't autorotate the labels and place them on the left/make sure the angle is the same as the grave. I know it can be done manually per label but this is far to much work.

In QGIS
- I can rotate the label but can't get them to always be on the left. I tried

and

I also need to make sure all three labels are shown.

In ArcMap
- In maplex, it seems as if we can only rotate point labels but I have a polygon shape. We can't use centroids as it will go out of the grave site.

So QGIS seems to get the closest...

Note 1. The name sometimes does not show but the Date of Death does, in other cases this is reversed. Both should be shown. 2. Some will have 2 or more people in the grave so the data will be there twice - so grave no will be E-062a and E-062b for example with 2 names and dates of death as well.

So can I do all the above in QGIS?


texts: Filter least cloudy image per each tile in GEE

texts: Is there a “quick" way in Google Earth Engine to show in an image collection (Sentinel 2) the least cloudy image per each path/row or tile (multiple tiles) for a given timeframe? So far I managed to filter but not to pick the selection of the best images.


texts: Using ogr2ogr to convert multiple GML files to a postgis table

texts:
I have a folder with 150 .gml (addressbase) files I need to upload to my postGIS/postgres database. After the first gml is uploaded, the rest will be appended to it to form a single table. However I don't know how to make ogr2ogr iterate through each file... currently I'm having to upload/append each cml induvidually.

My code to convert the first gml:

ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password" -lco SCHEMA=test_schema "D:\path to folder\File1.gml" -progress -lco OVERWRITE=YES

and my code to append each subsequent gml to the first:

ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password active_schema=test_schema" "D:\path to folder\File2.gml" -progress

This works fine but I don't want to do this another 148 times, changing File2 to File3 each time etc...

The GMLs contain point features. For use with postgis and qgis.


texts: Writing Data Driven Pages' scale into driving layer's attribute table with arcpy

texts:
I want to write a scale value that is changing for every Data Driven Page (since using map extent best-fit so that each polygon in the driving layer would be whole in "its" exported map) to the table of the driving layer, field "SCALE".

I found out I cannot use

     mxd.dataDrivenPages.pageRow.setValue ()

(returning run time error: ERROR 999999)
because Data Driven Pages pageRow cannot be used to write a value in (but might be in the future) See pageRow -  read only or can be modified?,

and so arcpy.da.UpdateCursor needs to be used instead (as arcpy.UpdateCursor is older version and way slower!).

THIS IS CURRENT CODE (you may have a look at what I tried below the two horizontal lines):

import arcpy, os
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
     mxd.dataDrivenPages.currentPageID = pageNum
     rad= mxd.dataDrivenPages.pageRow.getValue("KOO") #KOO is NameField
     #arcpy.mapping.ExportToJPEG(mxd, r"D:\PS" + os.sep + str(rad) + ".jpeg", resolution=400)
     sc=int(mxd.dataDrivenPages.dataFrame.scale)
     with arcpy.da.UpdateCursor(mxd.dataDrivenPages.indexLayer,"SCALE") as cursor:
         for row in cursor:
             row[0]=sc
             cursor.updateRow(row)

This one fills all rows (field SCALE) with the scale number of the current Data Driven Page. But what I want is to have the right value in SCALE field for every row (with current scale)

--------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------

As suggested by artwork21 I tried to use pageNum in cursor's where-clause.
It did not worked
("por" in codes is a new field in the table that contains the number same as pageNum
- I would like to avoid adding fields in atr. table, but at least tried):

strf=mxd.dataDrivenPages.pageRow.getValue("por")
with arcpy.da.UpdateCursor(mxd.dataDrivenPages.indexLayer,"SCALE","""pageNum=strf""") as cursor:
    for row in cursor:
        row[0]=sc
        cursor.updateRow(row)

-> This gave RuntimeError: A column was specified that does not exist. for row "for row in cursor:"

I tried to change the syntax in where-clause in "cursor line" but with no success
playing with str(pageNum), str(strf), """, " and ' using the code above
and also with writing where-clause outside the cursor and changing the syntax, examples:

strf=mxd.dataDrivenPages.pageRow.getValue("por")
whr= str(pageNum) + "=" + str(strf)
with arcpy.da.UpdateCursor(mxd.dataDrivenPages.indexLayer,"SCALE",whr) as cursor:
    for row in cursor:
        row[0]=sc
        cursor.updateRow(row)
#RuntimeError: ERROR 999999: Error executing function.

whr= "str(pageNum) + "=" + str(strf)"
#Runtime error SyntaxError: can't assign to literal

also tried

strf=mxd.dataDrivenPages.pageRow.getValue("por")
with arcpy.da.UpdateCursor(mxd.dataDrivenPages.indexLayer,"SCALE") as cursor:
    for row in cursor:
        if pageNum==strf:
            row[0]=sc
        cursor.updateRow(row)

or changing the 4th line to

if str(pageNum)==str(strf)

both ended up with: script ran, no cell in atr. table filled

I already knew those talking about query expressions/SQL in ArcGIS help: 1, 2, 3, but none of them talking about variables...
Trying to find a way searching in pages concerning variables specially with cursors at https://gis.stackexchange.com/ or https://community.esri.com/ meantioning different ways in answers, still none of them worked for me...


texts: Split polygons by area/percentage with QGIS 3.x

texts:
Is there a function in QGIS 3.6 Noosa that allows me to split polygons with given area or percentage? There is a plugin for QGIS 2. "split polygons" that seems to have exactly what I'm looking for, but it doesn't work with QGIS 3.

So, is there a build-in feature in QGIS 3, that has the same capabilities?


texts:
I do not understand why Esri has two products serving similar purpose.

Why one should have ArcGIS Server and why one should choose ArcGIS Online?


texts: Matching river direction with DTM using ArcGIS for Desktop?

texts:
I have rivers that some times they do not match their real direction based on the DTM, and they need to be flipped.

Is there any way to automatically match river direction based on the DTM in ArcGIS or any other software?

Output needs to be a shapefile, polyline.


texts: Proj4s.js Library Transformation Accuracy Documentation

texts: I am using proj4s.js for transforming between coordinate systems for a GIS web application. Is there any documentation out there on transformations accuracy provided by the library?


texts: Bring a single point forward for display

texts:
I am attempting to display various shellfish species on a map. The shellfish layer is organized so that the species display in the desired order on the legend. However, the result is that one point is blocked by another, circled in red below. I can't change the symbology or the order of the legend. Is there a way to select an individual point and bring it to the front?

I'm using ArcGIS 10.3 btw. My first idea is to create the legend to look exactly how I need and then convert it to a graphic. After which I can change the order of the species within the layer without it effecting the legend. My other idea is to add the layer in the second time, only display the category that is being covered, and place this on top of the first layer. I suppose either will work but is there a better way to solve this problem?


texts: Converting the shapefile of google drive to geometry of GEE in Colab

texts:
I uploaded district's shapefile into google drive, and then read it from google drive using the below method:
import geopandas as gpd
shapefile = gpd.read_file("shapefile.shp")

But I want to convert it as geometry object of GEE, so that I can call the clip function of Image of GEE, how can I do?


texts: Via Topologie Checker I'm able to find dangles, but there is no way to select them to edit or remove. Is there an other way to find and select?


texts: Populating a Dojo widget with country names based on an ESRI hosted layer

texts:
Wow, Javascript is not that easy - can someone help me make a simple breakthrough just to understand some basic concepts.

Does anyone know how to populate a filteringSelect Dojo dijit with the names of countries from:

http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/6

I have the following code to make a featureLayer:

countryLayer = new esri.layers.FeatureLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/6",{
                          mode:esri.layers.FeatureLayer.MODE_SELECTION,
                          setMaxAllowableOffset:maxOffset(map,1),
                          outFields:["NAME"]
                        });

I think the next step is to somehow loop through all the country names and populate the dijit - but I'm struggling with this.

I have my HTML for the dijit something like this, but I'm not even sure if thats right:

<div dojotype="dijit.layout.ContentPane" title="Test" >
            <input id="filteringSelect" jsid="filteringSelect" data-dojo-type="dijit.form.FilteringSelect" data-dojo-props="
                                                placeHolder:'Country',
                                                store:countryStore,
                                                searchAttr:'NAME',
                                                name:'NAME'">
        </div>


texts: QGIS DB Manager won't connect to PostGIS database, but connection "successful" in browser

texts:
I have created a spatial database in PGAdmin 4 using PostgreSQL 11. When I connect to the database in QGIS, the connection is successful in browser, but when I go to the DB Manager, it says that I am not connected and I get the error below. I am using the local host Port 5432.

An error has occurred while executing Python code:

TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_model.py", line 444, in rowCount
    self._refreshIndex(parent, True)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_model.py", line 493, in _refreshIndex
    if item.populate():
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_model.py", line 170, in populate
    if not connection.connect():
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\plugin.py", line 104, in connect
    return self.connectToUri(uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\plugin.py", line 109, in connectToUri
    self.db = self.databasesFactory(self, uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\plugin.py", line 68, in databasesFactory
    return PGDatabase(connection, uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\plugin.py", line 112, in __init__
    Database.__init__(self, connection, uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\plugin.py", line 218, in __init__
    self.connector = self.connectorsFactory(uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\plugin.py", line 115, in connectorsFactory
    return PostGisDBConnector(uri)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\connector.py", line 108, in __init__
    self._checkGeometryColumnsTable()
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\db_manager\db_plugins\postgis\connector.py", line 168, in _checkGeometryColumnsTable
    self.has_geometry_columns_access = priv[0]
TypeError: 'NoneType' object is not subscriptable

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version: 3.4.2-Madeira Madeira, 22034aa070


texts: Python script runs in ArcCatalog and ArcToolbox, but not in PyScripter

texts:
I have a script that imports a custom toolbox, copies data from an sde to a file/personal gdb, removes custom feature class extensions, etc. The script runs fine in Catalog, but I receive the following error in PyScripter:

Traceback (most recent call last):
  File "C:\Clients\Custom.py", line 45, in <module>
    arcpy.UpdateMDB(gisIn, wsOut)
AttributeError: 'module' object has no attribute 'UpdateMDB'

UpdateMDB is a toolbox tool and the portion of the problem script that copies data to a file or personal gdb. The tool runs great in Toolbox. On a co-worker's machine, arcpy.UpdateMDB runs correctly in the same script, but throws an error on mine. I've also seen references for arcpy.Update_tools and arcpy.UpdateMDB_Company_Tools in help documents, but these also throw an error.

In the problematic script, I'm importing my custom toolbox like this:

tbx = r'C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Company Tools.tbx'

I'm running ArcGIS 10.2.2 on a 32-bit computer. We do a lot of testing in PyScripter, so I'm trying to figure this one out. It seems like it could be an easy fix - any ideas?


texts: How to evaluate raster calculator expressions from the console?

texts:
How can I execute from the console an expression that should be used with the raster calculator?

I'm searching for something like this:

qgis.someRasterCalcClass.evaluate("boh@1 + boh@2", "outputfile.tif")


texts: How to remove negative values from RasterLayer in R

texts: I am processing Landsat 8 images to detect water quality parameters in R. I am using NDWI to masking the images. The raster layer I obtained from NDWI has negative values which I wanted to remove. Can anyone help me to do this?


texts: Is there OpenLayers event when reaching bounds?

texts:
I have an app using OpenLayers and OpenStreetMap tiles.
There are more zoom levels for the capital and less zoom levels for the entire country.

Let's say the user is in the capital, in his car, in traffic, with localisation active. The app is showing the map at the maximum zoom level. Them map is following him like a GPS, keeping current position in the center and marking it with a graphic symbol.

When the car reaches the bounds of the city the map have no tiles and show pink color. I need to change the zoom level before the pink missing tiles appears.

I can calculate an area inside the bounds of the capital and when the current position is inside this area the app will zoom out to the maximum zoom level available for the country.

The same problem exists when panning map with the finger.
I thought to restrictExtend to the capital but then the user will be captive inside and the single chance to see the country again is to zoom out.

Do you know an algorithm or an OL function/event to help me find the best solution?


texts: How to ensure proper labeling from QGIS 2.18 to Google Maps layer?

texts:
I am having trouble with a misplaced label for my field in Google Maps after I imported the .kml file which was converted from a .shp file in QGIS 2.18.  The file contains the ward districts for my township and, as you see marked in the image below, the label for Ward 1 is duplicated (presumably due to its larger geographic area) and misplaced in the Ward 2 area.

Without using the Google Maps API or any programming, is it possible to correct this kind of mislabeling or do I have to accept the auto-labeling feature that comes with Google Maps as is?  Similar to a previous question, I did save my vector layer properly in QGIS as described in the answer and then set my label option in Google Maps.  I just don't have any control over where my labels appear on the map.


texts: How to calculate distance of gauging station to outlet point in watershed?

texts:
I have a gauging station point with elevation. Also have a watershed generated for the same area. I just want to know how to calculate the distance along the flowpath from the station to the outlet(point)

The green point being the gauging station with an elevation of 100m and the red one being the outlet.


texts: Aggregating properties over features, and handling null using Google Earth Engine?

texts:
I have a FeatureCollection where I would like to take the mean of multiples properties for each feature.

I did not find so far an elegant way to do this, currently I am using using the map function, mapping over each feature a number operation like:  var1.add(var).divide(2).

Is there a more elegant way to aggregate over properties in a featureCollection? The problem with my solution is that I can't handle null values, which unfortunately happen often in my dataset. Indeed, using the add() function will fail in that case, see example below.

Code: https://code.earthengine.google.com/9944b02bc720859307811571fcc3cb0e

 var features = ee.FeatureCollection([
  ee.Feature(null, {var1: 1, var2: 2}),
  ee.Feature(null, {var1: 2, var2: 3}),
  ee.Feature(null, {var1: 1, var2: null})]);

print(features)

/// mean
var getMean = function(feature) {
  var var1 = ee.Number(feature.get('var1'));
  var var2 = ee.Number(feature.get('var2'));

  return feature.set({mean: var1.add(var2).divide(5)});
}

// Works:
var test_agg = features.limit(2).map(getMean);
print(test_agg)

// Does not work:
var test_agg2 = features.map(getMean);
print(test_agg2)


texts: How to add new raster store and publish for ECW fromat in GeoServer 2.4-RC2?

texts:
I am using GeoServer 2.4 RC2 and Tomcat7 on windows xp OS. I have extracted the gdal-data.zip (2.4.0) and geoserver-2.4-SNAPSHOT-gdal-plugin into Tomcat 7.0\webapps\geoserver\WEB-INF\lib. Now Geoserver shows ECW in raster data source list.

Then I did the following;

My ECW file path is G:\ECW\DB010_7500.ECW.

I gave Data Source Name as ECW (folder name). Then I clicked the save button but nothing happened. I navigated to Layers->Add a new resource, I can see site: ECW in dropdown list. But there is no effect when I select it from dropdown list.

So I am not able to publish it. I don't know these steps are right way to publish ECW image on Geoserver. Please suggest me to do this.


texts: QGIS plugin - checkbox un-checked by default

texts: Does anyone know how to set a checkbox to un-checked by default in a QGIS plugin? Is it done within the UI script for the plugin and can it be achieved within Qt Designer?


texts: How setup python path in my ide to recognize QGIS API

texts: I'm using Intellij with python plugin. Classpath for python contains $QGIS/apps/qgis/python but my ide not recognize eg. QgsVectorLayer. Any additional entry is required?


texts: Why are these WMS/WFS layers not appearing in QGIS?

texts:
WFS and WMS layers are not appearing when connecting to servers.  I am using QGIS 2.0 and am attempting to connect to:
http://www.arcgis.com/home/item.html?id=a0ae91856e3c450996d42d53474a1cad

The layers appear in the layer window but no data appears.


texts: Retaining original thematic colors in a USA source shapefile

texts:
Possible Duplicate:
  Adding Layerfiles (.lyr) to Qgis

New to QGIS and need a lot of help!  I am using QGIS with MAC - I have downloaded a USA thematic map but when I open it in my system it changes the colours.  I need the original colours! There are over 30 categories and they are very difficult to match, so manually changing them is not an option. How can I retain the original colours?  The downloaded zip file includes a .shp, .dbf, .sbn, .prj, .sbx, .lyr, .xml as well as a .kml file.
Thank you any help you can provide


texts: Add attribute of type Date to shapefile using OGR

texts:
can anyone tell me how to add an attribute of type Date during a shapefile creation?

For Integer works fine using the following code:

Layer1.CreateField(ogr.FieldDefn('NumberIndv', ogr.OFTInteger))

The same for String and Real, changing the type to ogr.OFTString or ogr.OFTReal.

What should I use for Date type?


texts: Why isn't my python script writing to a text file?

texts:
Overall objective: Open up an MXD object, copy an SDE feature class to a local GDB, then run a validation check on the data. Check is to see if there's a front and back photo for each marker point (if there is, some do not have secondary photos).

I want to output the results to a text file. I've tried altering where the line breaks happen, but nothing is written aside from the "validation started at" line and the line meant to be a header "OBJECT_ID....MARKER_ID....Missing Photo Name".  I added "txtFile.close()" even though I thought 'with' statements were supposed to handle that on cleanup. Any idea why my output isn't being written to a text file?

My script:

##PART ONE###

import os, arcpy, time, sys, datetime, timeit
from time import clock, strftime, gmtime
from arcpy import env

#Start Timer
start = time.clock()

mxd = arcpy.mapping.MapDocument(r"C:\TempGIS\PhotoCheck\PHOTO_CHECK.mxd")

arcpy.env.overwriteOutput = True

out = r'C:\TempGIS\PhotoCheck\PhotoCheck_SDE_Copy.gdb\Dataset1'

nm = "MARKER_PT"

for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.supports("DATASOURCE"):
        ds = lyr.dataSource
        nm = "MARKER_PT"
        print str(nm) + " is being copied"
        arcpy.FeatureClassToFeatureClass_conversion(ds, out, nm)
        print str(nm) + " has been copied to the standalone GDB."

###PART TWO###

print "Checking " + str(nm) + " ...."

nm = out + "\\" + "MARKER_PT"
uCur = arcpy.UpdateCursor(nm)
hs = uCur.next()

#Next Section
while hs:
    OID = str(hs.getValue("OBJECTID"))
    gsID = str(hs.getValue("MARKER_ID"))
    siteID = str(hs.getValue("SITE_ID"))
    fPhoto = str(hs.getValue("FRONT_IMG"))
    rPhoto = str(hs.getValue("REAR_IMG"))
    fPhotoURL = str(hs.getValue("FRONT_IMG_URL"))
    rPhotoURL = str(hs.getValue("REAR_IMG_URL"))
    Active = str(hs.getValue("ACTIVE"))
    with open(r"C:\TempGIS\PhotoCheck\MissingPhotosList.txt", "w") as txtFile:
        txtFile.write("This validation started at: " + str(datetime.datetime.now().date()) + '\n')
        txtFile.write("OBJECT_ID" + "       " + "MARKER_ID" + "         "+ "MISSING PHOTO NAME" + '\n')
        if Active == '1':
            try:
                if len(fPhoto) > 4 and len(fPhotoURL) > 4:
                    if os.path.isfile(fPhotoURL) is False:
                        txtFile.write(OID + "               " + gsID + "            " + fPhoto + '\n')
                        print str(fPhoto) + " is missing!"
                if len(rPhoto) > 4 and len(rPhotoURL) > 4:
                    if os.path.isfile(rPhotoURL) is False:
                        txtFile.write(OID + "               " + gsID + "            " + rPhoto + '\n')
                        print str(rPhoto) + " is missing!"
            except:
                "Looks like all photos are accounted for!"
        hs = uCur.next()

del uCur, mxd, nm, hs, out

#Stop Timer
end = time.clock()
elapsed = end - start
print "~~~~~ ***** Photo Validation script has finished! ***** ~~~~~"
print "Time taken to finish this script (Hrs:Min:Sec)---> " + strftime("%H:"+"%M:"+"%S", gmtime(elapsed))

#End Script

Printing to the IDLE window works perfectly and I've found the ones listed are actually missing, but my text file remains empty except for the first two lines.


texts: Calculating mean of image collection and how does Google Earth Engine use pixels without data

texts:
I have 5 years of Landsat data that I stacked into an Image Collection. If I calculated the mean of that Image Collection, and a pixel does not have data for one or more of the years, is that pixel ignored in the calculation?
Additionally, I have a dataset of crop yields. If I check if the crop yield is less than the mean of the Image Collection and assign it a number, but a pixel does not have data for that year, is that pixel just not included in the calculation or is it represented by a 0 and therefore would be counted as less than?
//Create Image Stack
var ColG = ee.ImageCollection.fromImages([ee.Image(GY13_adj),
      ee.Image(GY14_adj),ee.Image(GY15_adj),ee.Image(GY16_adj),
      ee.Image(GY17_adj),ee.Image(GY18_adj),ee.Image(GY19_adj),ee.Image(GY20_adj)]);

var ColS = ee.ImageCollection.fromImages([ee.Image(SY13_adj),
      ee.Image(SY14_adj),ee.Image(SY15_adj),ee.Image(SY16_adj),
      ee.Image(SY17_adj),ee.Image(SY18_adj),ee.Image(SY19_adj),ee.Image(SY20_adj)]);

//#Mean/median of all years for each pixel
var mG = ColG.mean();
var mS = ColS.mean();
//mG<-ColG.reduce(ee.Reducer.mean());
//mS<-ColG.reduce(ee.Reducer.mean());

//#Grain
var y13 = GY13_adj;
var reclass13 = ee.Image(1).where(y13.gte(mG),1000).where(y13.lt(mG),100);


texts: Registered folder with ArcGIS for Server 10.2, will changes to data in folder go live on Server/REST?

texts: I've registered a folder that contains a .gdb with some feature classes with ArcGIS Server 10.2 and exposed the data (read privileges) to the ArcGIS Server domain user account.  I'm using these feature classes in a published map service.  If I alter an attribute or the geometry of one of the feature classes (in arcmap on my local) and save the changes, will those changes go live in REST Services?


texts: Connecting a PostgreSQL database in ArcGIS Pro gives instance/server machine error

texts:
I am trying to connect an PostgreSQL database made using pgAdmin 4 in ArcGIS Pro 2.0.1. PostgreSQL version is 10.0.

I tried several methods of connecting and how easy it is in QGIS I cannot find the reason why it doesn't work in ArcGIS Pro.

I followed the steps here, edited the pg_hba.conf file even by making so all connections to the database are allowed thinking this would be the issue but this didn't help.

I am configuring it like this now:

Where my database name in PGAdmin is this:

I am using regular settings:

host name: localhost
port: 5432
username: postgres

But yet, whatever I try, this error pops up:

What I am doing wrong? This is my first time doing it on ArcGIS Pro and I didn't have any problems using other software.


texts:
I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines on top of an OSM map in several layers. Those points and polygons should contain meta data (at least an ID) to show the user extra information on mouse over, click or touch events. Now I'm looking for the best way to send that data to the client. The whole area, where these features are placed, is subdivided into several sections and most of the time, a user is working in one section (reading information - writing is a very rare case, that will not be implemented right now). But these sections are placed next to each other and most of the time at least 3 sections are visible. Also the points could be clustered or hidden at a higher zoom level.

I've heard about WFS, but I can't see the advantages over GeoJSON or KML. Would it be possible to just retrieve the features within the bounding box of the current view with WFS? We've got a MSSQL database and a webservice between the database and the web application and if it has not really advantages, we don't want to set up a GeoServer and a Postgres DB. Also it wouldn't be a problem to tell the webservice: Give me all features of layer L between X1,Y1 and X2,Y2 (as GeoJSON, KML or whatever). What are the advantages of WFS? What is the way, you would go or what more information is relevant for this decision?


texts: How to have a CSV load correctly into a template geodatabase with a specific schema and field domains?

texts:
My goal is to be able to batch process a folder of CSV tables to a geodatabase template. My process right now is CSV -> XY Event layer -> shapefile -> append to template geodatabase. But the problem is that some attribute are not added even though the column headers are the exact same in the CSV and the geodatabase.

My question is how would I get the schema of both the CSV and the geodatabase to match exactly so the process of appending is completely seamless?

Here is an example of what I need to match:

All of the Target Fields have A Matching Source Field but it is not picked up automatically. I need it to be automatically matched while using append so that I can batch a folder of CSVs, rather than process them one by one.


texts: Can Time Manager ignore/skip time when there is no data?

texts: I have several months of data where it is only between 8am and 5pm mon-fri.  When I export .png images in time manager it includes the time in between, eg 5pm-8am and sat-sun.  Is there a way for it to ignore those times and only export the data?


texts: How can I add a new layer, then remove previous layer from a Leaflet/CartdoDB map without the map clearing everything

texts:
I am new to CartoDB/Leaflet. Here's my fiddle...
http://jsfiddle.net/zippyferguson/fLkqgf4q/1/

If you click the play button, I want it to load data to the map year by year from 1966 to 2015 from a CartoDB query. But, with each iteration, the map is cleared of data, and then the next year data appears. I am looking to load the next year data and remove the previous year data underneath in the previous layer, without the clearing of everything on the map. If you comment out this line in the fiddle, you will kind of see what I am looking for.

removeAllLayersExcept(layer);

...this function is an attempt to remove all layers on the map except the one just loaded.

But, with removeAllLayersExcept(layer) commented out, that just keeps putting more layers on the map. I don't understand why it clears the whole map each iteration.


texts:
My app needs to work in offline way because we have problems with signal internet 3G and can't downloading images from our servers. Somebody know how can do it ?

Now I'm using API Arcgis JS 3.1 and my basemap is

var basemap = new esri.layers.OpenStreetMapLayer();

I'm trying to install a OpenStreetMap local server in Ubuntu VM.
I will check it.

if somebody has some ideas, please I appreciate in advance..


texts: how to filter point features based on the filterted polygons with OpenLayers

texts:
I have one WFS polygon layer and one WFS point layer. The polygon layer has an attribute user_id. The web map has two requirements.

Filter the polygons based on the attribute user_id. That is, a user can only  see polygons which are assigned to him.
This can be done like this:

filter: new OpenLayers.Filter.Comparison({
                 type : OpenLayers.Filter.Comparison.EQUAL_TO,
                 property : "user_id",
                 value : user_id
                 })
Filter the points based on the filtered polygons. That is, a user can only see points within the filtered polygons from step1.  I checked the

OpenLayers.Filter.Spatial.INTERSECTS.
it only takes OpenLayers.Bounds || OpenLayers.Geometry.

I have no idea how to achieve this. Please help. Thanks.


texts: OpenLayers 4.6.5 - jQuery : map disappears after hide() show() event

texts:
This is a little example of what I'm trying to do : https://codepen.io/remifroger/pen/ZZWgbM

I would like to build a tabs design, with one map in each tab. I use jQuery to deal with it but I have a trouble when I resize the window.

I already tested to use map.updateSize() in each click event but it doesn't work, do you have any ideas to fix this behavior ?

EDIT

Problem comes from the hide() method which applies a display: none on a parent element of my div containing the map => it also affects a display: none on the map div's; and this generates the unwanted behaviors

So to fix the problem, instead of show() and hide() methods, I use the visibility property (with jQuery : $("#id").css('visibility', '...')) which doesn't generate any display: none

And I put the content of the tab content in position: absolute to eliminate spaces

I updated the CodePen, but I'm still open to any improvement, this method doesn't seem optimal !


texts:
I've got to make a route with my multilinestring table "routebus", but I can't create the node ids... maybe the fact that it's a multilinestring is the problem, but I really don't know how to solve it. I created "source" and "target" fields and tried with this query:

SELECT assign_vertex_id('routebus', 0.00001, 'the_geom', 'gid');

But it returns me an error:

ERROR: query string argument of EXECUTE is null
État SQL :22004
Contexte : PL/pgSQL function "assign_vertex_id" line 36 at EXECUTE statement

I'm not really used to PostGIS and pgrouting, maybe un must convert multilinestring to linestring?

I have PostGreSQL 9.1.9 with PostGIS 2.0.1 installed

Thanks in advance for your help


texts:
I have a series of (lat, lng) coordinates and I need to extract 10x10 sq_km satellite imagery from them.

Google Earth Engine (GEE) has this functionality:

geometry = ee.Geometry.Point(lat, lng).buffer(10000)

That clips the defined region but gives me a circular geometry, is there a way to extract a square geometry enclosing the circle.

I am also ok with replicating the same using Planet-API.

Also, what is a good way to download large number of such regions from GEE.


texts: How to make QGIS model result to be a variable?

texts:
My model's temporary result is a point layer (one feature) and I need a value from one of its fields because I want to use it in the same model to select a feature on another layer.

So for example, after running the model, the result is a single point. This point has a field and its value is 46. I need this number in my model to select a feature on another layer (and I can carry on building the model).


texts: How to export vector layer's legend separately in QGIS

texts:
I have a vector layer with QgsRendererRangeV2() objects. I searched to get legend belongs to the vector layer and found this:

legend = QgsComposerLegend(c)
legend.model().setLayerSet(mapRenderer.layerSet())
c.addItem(legend)

which attaches the legend to the left-top corner of the map plot. But I want to get the legend as a separate image.


texts: Where can I get an ocean shaded relief for Central America?

texts: Does anyone know where I can get an ocean shaded relief for the Central American coast?


texts: File Geodatabase - Feature Save/Edit/Add Error

texts:
USING: ArcMap 10.4 & ArcCatalog 10.4

FILE LOCATION: Local

Was wondering if anyone came across the same issue mentioned below, as I'm haven't been able to find an issue like mine elsewhere -

I have a file geodatabase, with several feature classes within it. However, while everything has been fine, there is one issue that for the life of me I cannot fix. For example (and it happens with every feature class), I added about 60-70 line features, added the appropriate attributions, and then finished by clicking "Save Edits" and then "Stop Editing" - and then proceeded to save the document as a whole, verify that I had saved the edits, and then closed the program. The next morning, most of those edits were gone, and considering that it took me 2-3 hours to add those features.

To ensure it wasn't my computer, I installed the trial software on another computer, recreated from scratch the entire file geodatabase, and the feature classes within it. Then I proceeded to create the same features I had in my first installation, saved the edits, stopped editing, saved the arcmap document, and then closed it out. After returning from a meeting, I opened the program and discovered yet again that most of the previous feature additions were gone, with only a few remaining.


texts: Running raster calculator to build expression for ls factor?

texts:
I am trying to run a raster calculator, but it failed. I believe that ArcGIS 10 does not understand when I use the variable resolution.

What do I need to put in its place?

I took the equation from this sheet USLE from North Carolina State University and checked on 2.3 for ArcGIS 8.1.

Here is the code I used:

Power (("flowaccNW")  *  resolution/22.1, 0.6) * Power(Sin("slope_degnw") *  0.01745)  / 0.09, 1.3

I am using ArcGIS 10 SP4 using the Map Algebra raster calculator.


texts: In jgrasstools kriging, what is the variogram model used when defaultVariogramMode = 0?

texts:
In jgrasstools 0.78, what are the variogram models corresponding to the values 0 and 1 of the defaultVariogramMode field?

For mode 1, it seems to be a Gaussian variogram, by looking at the source. But for mode 0, it uses the variance of the measurements and something called an "integral scale" (fields pVariance and pIntegralscale).

The formula for the covariance in this mode is variance * exp(-h^2), where variance is the supplied variance, exp(x) is the exponential function, and h^2 is the square of the distance between the points (the distance in each axis is "normalized" by the integral scale).

What variogram model is this? The formula for the exponential variogram model is more complex, according to Wikipedia. I also did not find a corresponding formula in Isaaks & Srivastava's An Introduction to Applied Geostatistics either.


texts: ArcMap Cell calculations and focal statistics

texts:
I have a raster with gridsize 10m x 10m. Cells have values 1 or 2. For every raster cell I want to make a calculation using cells in a 200 cell (2000 m) radius. I want to find out the percentage of cells with value 1 within this radius. The calculation should be
"Number of cells within 200 cell radius" / "Number of cells with value 1".
I tried focal statistics and zonal statistics, but I can't find the option to input my equation.
Am I looking at the wrong tools?