texts: How to add border and border colour to TITLES in mapbox

texts:
I have titles in Mapbox which are black, Is there any possibility that I can add white borders to it. I have tried a lot of things (fill outline colour etc.) and it didn't work out. Any help is appreciated.
  map.addLayer({

    'id': layerID, // changing here gives the description
        'type': 'symbol',
        'source': 'places',

        'layout': {
        'text-field'  : ['get', 'title'],
        'text-offset' : [0, 1.25],
        'text-anchor' : 'top',
        "text-font"   : ["DIN Offc Pro Medium", "Arial Unicode MS Bold"],

            'icon-image': 'myimage',
            'icon-allow-overlap': true,
            "text-size": 20,

        },

        "paint": {
            "text-color": "black",

            },


texts: Python in QGIS is missing SQL drivers in PyQT4

texts:
I am developing a QGIS plugin and need to create a table view in my GUI that I have been designing with QT Designer. I have PyQT4 installed but I have noticed that I have 2 Python directories. I have one main install on my C: drive and one in my QGIS directory. Both of these Python folders have PyQT4 installed, but the contents of the folders are different. The main issue that I am having is that while the main install of Python has everythign I need to connect to a postgres databased, the QGIS install of PyQT4 has the QSql module but not the drivers to connect to the database!

I don't know why this is or how I can get a complete install of PyQT4 in the QGIS version of Python?


texts: Spatial indexing of GeoTIFF images (Java Library)

texts:
I have a requirement to spatially index each pixel of GeoTIFF images and store them in a scalable database. I intend to perform this in the following manner.

Divide each GeoTIFF into smaller tile sizes (size could be
configured) or into individual pixel and obtain spatial coordinates.
Calculate spatial index for each tile/pixel (Quadtree index or Hilbert
Space-Filling index or another suitable spatial index) and store pixels later in a HashMap or directly in a key-value database such as HBase.

Currently, I see Java libraries such as GeoTools are being used for GeoTIFF manipulation. But I am looking for a pure Java-based library. I am aware of Apache Commons Imaging. I didn't find it's capability to support spatial indexing. I don't intend to use GeoSpatial systems such as GeoTrellis, GeoMesa or GeoWave as my requirement is simple. Thus, I'm looking for an existing pure Java library (or a GitHub repository) that could support my requirement.
(Side note for people who have similar requirements. GeoTrellis could be a viable solution. Please check here and here for more information. Since my requirement cannot be bind to existing spatial system implementation, I am looking for a pure Java library.)


texts:
I have reviewed Getting polygon boundaries of City in JSON from Google Maps API? as well as the answers by german_martin and Kamil Latosinski. There are two critical weaknesses in Nominatim, using Malaysia as a case study:
1) The polygons include water (left = Nominatim, right = Google Maps)

Above are searches for 'Selangor'. I am aware that the boundary over water is the true administrative boundary, but for most visualisation exercises, this would make it look quite weird.
2) Postcode-level data is very coarse, at least for Msia (left = Nominatim, right = Google Maps)

Above are searches for '11900, Penang'. Nominatim just doesn't have it.

So, you can see why I really need to extract the JSON from Google Maps.
Does anyone know how to do this, preferably programatically so I can iterate over 2000 postcodes?
However, if it requires manual effort, I'm willing to do it.


texts: ArcGIS javascript api ignores proxy when getting basemaptiles

texts:
The ArcGIS-javascript is ignoring my proxy.ashx when getting the tiles for a basemap-layer. In my case this tiles will come from "HERE". For this I need authentication-informations (AppID & AppCode) which should be set in the proxy. When not routed through the proxy, the requests will obviously fail.

I'm setting alwaysUseProxy to true, also I'm adding a rule for api.here.com. Roting the requests through the proxy worked with an earlier version (something like 1.3 or 1.4) and isn't working in the current version 3.13. Everything would be fine when the requests would be routed over the proxy.

When looking via console into the esriConfig alwaysUseProxy is true and also the rule exists.
Any ideas what could cause the problem ?

PS: for getting the here-tiles I wrote an own HERE-layer-object. It's inheriting from the TiledMapServiceLayer providing a new constructor and a new getTileUrl-function. Just for information. I don't think that the problem lies there.


texts: Converting Trimble SSF format to shapefile?

texts:
I would like to convert a small amount of data from trimble ssf format to shp format for inclusion in an ArcGIS database.

I have been trying to do this for a few months and not success.

I have a small amount of data so do not want to purchase a license for PathFinder.


texts: Round() does not return an integer raster in R

texts:
I want to convert the datatype of a raster to integer. For example:

x <- raster(nrow=10,ncol=10)

its datatype is float

dataType(x)
[1] "FLT4S"

then I round the pixel values of x by

 y <- round(x)
 dataType(y)
 [1] "FLT4S"

How can I change the dataType of y to int?


texts: How to set a custom position for Atlas pages in QGIS 2.18.14

texts:
I want to set a position for each page/feature in the Atlas.

For scale and rotation I resolved here: Set a custom maps rotations for specific pages in the print composer in QGIS

But now, I can´t find any option for positioning the content of a map/maps.

Edited to give more details...

This screenshot (1) shows a page of the Atlas using Data defined override on the Main properties, Scale and Map Rotation. It uses that two fields of the table from the coverage layer; scale and rotation.

The second screenshot shows what I need to do. Move the content to a better position... see (2).

Is there a way to control like I did with scale and rotation?


texts:
I’ve realized a desktop application based on Qt Mobility for displaying maps and adds some landmarks in real-time (like QGeoMapObject). I've to see the track of some vehicles...
I've used the code that can be downloaded here.

To manage the map, I've used a QGeographicsGeoMap object.

I want to have a cache for using my program also without an internet access.

Is it possible?

What is the way to do this?


texts:
I have already processed so far NDSI map by using Rrasterio, NumPy, os and matplotlib.pyplot for plotting the data.

Now, I would like to eliminate permanent ice from NDSI map. I am facing one major problem reading reprojection. I have one permanent ice global mask having spatial resolution of 1000 meter which is in EPSG:4326 in geographic coordinates in unit degree. The NDSI map is in LCC in unit meter ('+proj=lcc +lat_1=40 +lat_2=55 +lat_0=0 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs') and also having 1000 meter spatial resolution.

I am unable to burn the permanent ice mask with NDSI map after reprojection and cropping/subsetting AOI with bounding box from shapely.geometry as the reprojection is not giving same rows and same columns after cropping with same box(coordinates). I have found after reprojecting the data there is a slight change in pixel size it converted into 999.999 meter instead of 1000 meter I think, which could be reason of change rows and columns in spite of having the same extent.

What I did actually let me explain -

After processing NDSI map I check the coordinates system by using

img= rasterio.open('/scratch/spatra/test_reproject/NDSI.tif')
print(img.crs)

>>>> NONE

In that I would define the projection ArcMap then reproject the data but I am very much confused in Python how to assign projection?

So, I did reprojecting the NDSI map twice first with it's own projection ('+proj=lcc +lat_1=40 +lat_2=55 +lat_0=0 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs') and 2nd time with 'EPSG:4326' or it's proj4format

Here is the Code:

import os
import numpy as np
import rasterio as rio
from rasterio.warp import calculate_default_transform, reproject, Resampling

#first time I reprojected with it
dst_crs = '+proj=lcc +lat_1=40 +lat_2=55 +lat_0=0 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=longlat +no_defs'

#2nd time I reprojected into geographic coordinates
#dst_crs='EPSG:4326'

with rio.open('/scratch/spatra/test_reproject/ndsi.tif') as src:
    transform, width, height = calculate_default_transform(src.crs, dst_crs, src.width, src.height, *src.bounds)
    kwargs = src.meta.copy()
    kwargs.update({
    'crs': dst_crs,
    'transform': transform,
    'width': width,
    'height': height
    })

with rio.open('/scratch/spatra/test_reproject/new/ndsi_reproj.tif', 'w', **kwargs) as dst:
      rio.warp.reproject(
            source=rio.band(src, 1),
            destination=rio.band(dst, 1),
            src_transform=src.transform,
            src_crs=src.crs,
            dst_transform=transform,
            dst_crs=dst_crs,
            resampling=rio.warp.Resampling.bilinear)

Problem:

After reprojecting 1st time with it's own projection which is not defined I have seen change in pixel size from 1000 meter to 999.9999 meter. Which eventually giving results of less  rows and columns.
In ArcMap defining projection and reprojection steps are different. However, I could not find how to define the projection by using Python. So that I have re projected it twice.

I want to have the same AOI with same rows and columns from both of the data so that I could burn the product without getting an error message.
If anyone could help me to find solution of my problem I am literally stuck with the reprojection.


texts: Create a raster of uniform value over a uniform grid from the partial intersect of raster over that grid?

texts:
I need to generate a time series of data over different grids in ArcGIS.
Here I am intersecting the raster file from a polygon shapefile of irregular shape, which gives a final raster file as shown in figure.

Here, I want to generate a raster file which assign the values to Grid 1, 2, and 3 from the partially intersected raster.

Once I could do this, I will be getting the raster something like shown below.

I am trying to this as I have center grid points for all the polygon and I could extract values to those point by doing this, and have a time series.


texts: Correcting polygon geometry so edges can be reshaped to match that of subsequent layer in ArcGIS for Desktop?

texts:
I have two layers; a polygon layer representing maritime boundaries/economic areas of countries in the world and another polygon layer representing all countries but with a detailed coastline. In the image, you can see that the economic boundary (red) has been simplified at the coast. I would like to correct this on a global scale so the detailed coastline replaces the simplified edge.

Is there a quick way to do this manually or maybe via Python or ModelBuilder?

I'm using ArcGIS 10.2 for Desktop.


texts:
In QGIS I create a line that crosses a polygon twice. By using intersection, it will create a new shapefile that gives me as a result two visible lines (the polygon cut the line).

With geometry tool "from multiple part to single part" QGIS recognizes that I have two lines. The problem occurs when a line intersects itself because when I do the same procedure as above, QGIS thinks that I have four lines!


texts: Creating Tile Service in ArcGIS Online Python API

texts:
I'm trying to create a tile layer via the ArcGIS API for Python. When creating a tile layer in AGOL (manually) they have you specify a range of scales for the zoom level (e.g. 1:1000 or 1:4000).

But for the create_tile_service method, they tell you to specify the scales as a floating point number. So would the range of 1:1000 and 1:4000 look like this? Otherwise, I'm not sure what scale I should be referring to.

gis = GIS('arcgis.com','username','pwd')
some_feature_layer = feature_layer.url
some_feature_layer.create_tile_service('name',
                                        1000.00, # min scale
                                        4000.00) # max scale


texts: Forming queries with node.js, PostGIS and GeoServer?

texts:
I am not sure If I got the overall web-mapping architecture right. I can easily find tutorials about each part, but nothing on how to connect them.

I have openlayers in the front-end, node.js as a server and postGIS as a DB.

An action is done in the openlayers part, the data are sent to node, they define a query. Node sends this query to postGIS, postGIS answers it. The new data now travels back to the front-end via node to be rendered on openlayers. Openlayers fetch OSM as a base layer and I only save points/lines/polygons in postGIS.

(User clicked on the map, get lon/lat, use them as query parameters, find 4 nearest neighbors, send neighbors back, render them on the map).

Geoserver confuses me. I cannot understand its role in this mix. I cannot see how queries are related to it. I see SQL in all the postGIS tutorials and in OpenLayers and Geoserver I see CQL, that is not on the same level.

Do queries get formed in node but go to postGIS via Geoserver or do they get formed in node, they go to postGIS via node and then postGIS sends the answer in Geoserver to alter the map?


texts: Why do I get "Failed to transform" when reprojecting from WGS84 to Google Mercator?

texts:
I am attempting to re-project a vector shapefile from Natural Earth, following a qgis tutorial. Another user reported this error, but a solution has not yet been reported.

Given this post, and the last line of the error, I suspect that there is something wrong with the CRS setting, etc. Though, I have not been able to identify it.

   Export to vector file failed.
Error: Failed to transform a point while drawing a feature of type 'ne_10m_admin_0_map_units'. Writing stopped. (Exception: forward transform of
(3.141593, -1.570796)
PROJ.4: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +to +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
Error: tolerance condition error)

I am using qgis 1.8.0 on Ubuntu 12.05. Thanks for the help!


texts: Zeros disapearing in front of numbers when exporting from attribute table

texts:
I have a large set of points in ArcMap desktop. In the attribute table I have a column called ID, where each point have an individual number. Some of these numbers starts with a double-zero, which is fine in the attribute table. However, when I export the attribute table into excel, the zeros in the beginning of the numbers are lost.

I'm doing a simple mark in ArcMap and the chose "copy selected" before I paste it in Excel. Is there a better way of doing this so that I can keep my zeros? Or do I need to solve this matter in Excel, and do you have any suggestions on how to?


texts:
I want to create a scale bar in QGIS that also includes the scale written out as text - like 1:20 000 or 1:10 000.

I would like it to appear just under the scale bar itself.
Can this be done automatically in any way or shall I just use a ordinary textbox?

If I get it to work automatically, the risk of me changing the scale in one place and not the other will not be a problem.


texts: Programmatically reordering ArcGIS layers

texts:
I programmatically create several layers for my map and I want my layers to be on top of the layers from the original map.

Is there a way I can do that? I also want to be able to put "bring forward/backward" as a menu item in the TOC context menu.

Thanks and Regards


texts: Querying multiple values in field using ArcGIS ModelBuilder?

texts:
This is part of a much larger project in modelbuilder.  I want to use the make feature layer tool to query a field that has multiple values in each record.  For example, the field name is "Animal" and the value would be "zebra, cat, horse, dog" (without quotes) for each record.  How can I setup the query to search for all the animals?  There are some records that only have one value in which case I can just set the query to = the field but when the field has multiple entries for each records, I'm not sure how to setup the query.  I need something like "Animal" IN ('zebra', 'cat', 'horse', 'dog')
But how would I add the single quotes and the parenthesis to the field value(s)?

I'm using ArcGIS 10.2.2 and all values in the field are separated by a comma and a space.

Edit: I should have been a little more clear in my original post.  This query is going thru an iterator and each time the query will be different (there are hundreds of animals).  The field itself has to pass thru the iterator for the query so I'm wondering how I can accomplish this.  I've included a screenshot of the current model.  Circled in red is where the field passes thru the "Get Field Value" tool and I then need to use that value to query a separate layer of "animals" and select all the animals in the "animal" layer there are in the "animal" field from the first layer.  In essence I need to figure out how the field can be modified to feed directly into the query.


texts: To create Categorical Heatmaps in Qgis do I need 1 heatmap or 1 per layer for each category

texts: In Qgis 2.18 I have a points layer and can create a raster heatmap for all the points with singleband pseudocolour. If I wanted to show separate categories as different colour ramps do I need to create 1 raster per category and manually select a different colour or is there a smarter way to accomplish the same thing and is it correct to call that a multi-band heatmap?


texts: PDAL: writing tutorial .exe cannot find PDAL DLLs

texts:
I'm following this link: https://pdal.io/development/writing.html#writing
My environment is Windows 10
I already have Visual Studio 2019 installed.

Install Conda, create environment "pdal", install pdal on that environment.
Open Conda terminal window. I did "echo %PATH%" and saw that "...\anaconda3\envs\pdal\Library\bin" is in the PATH.
Copy the files tutorial.cpp and CMakeLists.txt from PDAL github
Install CMake
Run cmake. Visual Studio .sln file was created. No error.
Open the .sln using Visual Studio and build the solution. No error. tutorial.exe was created.

Note: steps 3-6 are run inside Conda "pdal" environment.
When I tried to run the tutorial.exe from the command line, I got a debug error.
When I tried to run it from VS, using "Start without Debugging", I got all these:

The code execution cannot proceed because ____.dll was not found.

But these .dll files are in the "...\anaconda3\envs\pdal\Library\bin" folder which is in the PATH.
Can anyone point me to what I missed?


texts: Installing ArcGIS Python API with deep learning dependencies

texts:
I am a GIS guy and do not know much about deep learning and AI.
How can I start using ArcGIS Python API to do GeoAI ?


texts:
I am trying to sync 3 maps (BaseMapd, overlayMap, tiledMap) side by side however these maps don't sync together immediately but it works sometimes during different multiple browsers (Chrome, Firefox & IE) of refreshes.

Most of the problem is from Chrome. I realize that cache is one of the issues that I have faced. When I uploaded the files into a webserver, it loads perfectly. Soon after, it has sync problem once again.

requirejs.config({
    'baseUrl': 'lib/',
    'paths': {
        'leaflet.wms': 'leaflet.wms' ,//.js'
        'L.Map.Sync': 'L.Map.Sync' //.js'
    }
});

define(['leaflet', 'leaflet.wms','L.Map.Sync'],
    function(L,wms,sync) {

var BaseMapd   = basecreateMap('base-map');
var overlayMap = createMap('overlay-map', true,'2007');
var tiledMap   = createMap('tiled-map', true,'1988');

BaseMapd.sync(overlayMap);
BaseMapd.sync(tiledMap);
overlayMap.sync(BaseMapd);
overlayMap.sync(tiledMap);
tiledMap.sync(BaseMapd);
tiledMap.sync(overlayMap);

}

Then I use another method from MapBox (below), and these 3 maps sync perfectly. When I interact with 'BaseMapd', the non-active maps ('overlayMap' and 'tiledMap') are not auto-re-rendered.

Afterwards, I click on the 'overlayMap' to interact and move around. However, the non-active maps ('BaseMapd' and 'tiledMap') are not auto-re-rendered. And it just goes on for the same thing with 'tiledMap'.

function(L,wms,sync) {

var BaseMapd   = basecreateMap('base-map');
var overlayMap = createMap('overlay-map', true,'2007');
var tiledMap   = createMap('tiled-map', true,'1988');

// when either map finishes moving, trigger an update on the other one.
BaseMapd.on('moveend', follow).on('zoomend', follow);
overlayMap.on('moveend', follow).on('zoomend', follow);
tiledMap.on('moveend', follow).on('zoomend', follow);

var quiet = false;
function follow(e) {
    if (quiet) return;
    quiet = true;
    if (e.target === BaseMapd) sync(overlayMap, e);
    if (e.target === BaseMapd) sync(tiledMap, e);
    if (e.target === overlayMap) sync(BaseMapd, e);
    if (e.target === overlayMap) sync(tiledMap, e);
    if (e.target === tiledMap) sync(BaseMapd, e);
    if (e.target === tiledMap) sync(overlayMap, e);
    quiet = false;
}

// sync simply steals the settings from the moved map (e.target)
// and applies them to the other map.
function sync(map, e) {

    map.setView(e.target.getCenter(), e.target.getZoom(), {
        animate: false,
        reset: true
    });

}

I would like to know how to resolve these 3 maps to sync immediately when the user loads on the browser.


texts: Using Hot Spot Analysis Plugin on QGIS 3?

texts: I need a help on trying to use the Hot Spot Analysis Plugin on QGIS Noosa. I am not able to install the module "moran".


texts: Keeping original cell values when replacing NA values using nearest neighbour with focal function of R?

texts:
The following code for replacing NA values was posted by Jeffery Evans. This function smooths the whole raster. I only want to fill the gaps of the NA cells keeping the other values in place. How do I adjust the function so that it only replaces NA values with the?

library(raster)
  r <- raster(matrix(1:16, nrow=8, ncol=8))
  r[r==12] <- NA

fill.na <- function(x, i=5) {
  if( is.na(x)[i] ) {
    return( round(mean(x, na.rm=TRUE),0) )
  } else {
    return( round(x[i],0) )
  }
}

r2 <- focal(r, w = matrix(1,3,3), fun = fill.na,
            pad = TRUE, na.rm = FALSE )

as.matrix(r)
as.matrix(r2)


texts: ArcGIS JS - Printing with private layers

texts:
I have a map built using ArcGIS JS API v4.8. The map has a basemap and FeatureLayer that are both secured by a custom API and a server-side proxy.

I'm looking to make use of the Printing widget, but if I have the private FeatureLayer displayed, it fails to work, and if I switch that layer off it provides a print out but it doesn't show the custom basemap (so it's effectively just a blank page).

Is there a way to use the Printing widget even if layers/basemaps are not publically accessible? I presume the issue here is the PrintTaskUrl that's hosted by Esri can't access my private layers? Does anyone have any suggested workarounds for this at all?


texts:
using QGIS (or even GRASS) is it possible to label a contour lines shape with arrows that indicate the flow direction?

Briefly: I have a point shape with elevation values. I make an interpolation map and then I extract the contour lines.

Now how can I show the flow direction with arrows?


texts: Creating array of z-values from line vertices in QGIS field calculator?

texts:
I would like to create an array of a line's z-values to use as part of another expression. The z-values should be in the same order as the vertices, I would like to be able to use it as an input for min(), max() functions etc.

I have looked through the geometry and array expressions in the field calculator but I haven't found anything that works. I had an idea to count the number of points (nump_points($geometry)), and loop through the geometry pulling out z values at individual vertices but there's no loop function in the field calculator.


texts: How can i set scale for each layer symbol?

texts:
I'd like to use reference scale : 1:10000000 for layer a and 1:2000000 for layer b to set scale of labels and symbologies. one method is Working with data frame reference scales
but this method works for all of layers in data frame . i want to use scales separately.
How can i set scales for each layer? or any method to set size of symbology and labels?


texts: Highlight Polygon coordinates using OpenLayers 4

texts: Is it possible to highlight all the boundary coordinates of a polygon in OpenLayers 4 JavaScript API as shown in the image .


texts: How to drawing ROC curve in Orfeo Toolbox

texts:
I would to like to known how i plot the roc curve after training the machine learning model in orfeo toolbox/monteverdi GUI. I have the matrix error of the model.
I used Large scale mean shift segmentation and the segments were classified with random forest.


texts: Assigning values values to raster cells overlain by polygon layer using R?

texts: I have a raster layer and a polygon layer overlaying the raster. The thing is that I want to make a new raster as follows: 1) the extents of the new raster should be the same as the old raster. 2) The cells which are overlain by polygons should have a value of 1 and the parts which are not overlain by polygons, should have the value of zero.


texts: Python Fiona affecting external GDAL binaries?

texts:
Curious if anyone else has encountered this before and may have an explanation:

In my Python workflow, I'm importing fiona (1.8.4) to manipulate shapefiles, and then later downstream I'm shelling out to gdalwarp to reproject a GeoTIFF using python's subprocess.check_output to make system calls..

Most of the time, this works flawlessly. But for certain EPSG codes, I'm seeing some very odd behavior I'm hoping someone can shed light on. With EPSG 26749 as target, the reprojected boundaries are only correct if I don't import fiona in the lines above.

My suspicion is that my pip install of Fiona is pointing to out of date GDAL libraries lurking around my system, but what I really don't understand is how this could possibly be affecting the behavior of the call to the gdalwarp binary outside of Python?

While I dig in and try to fix my Fiona GDAL dependancies, I would love to know if anyone can explain how importing a gdal-dependent module in Python could then affect the behavior of an external GDAL call... but only for the duration of the Python script?


texts:
I'm taking a course in Qgis and I've come up in a problem I can't figure out.

I'm supposed to split a line in to segments with the v.split.lenght tool.
But when I do this there is no new layer coming up.
It runs the process but then nothing happenes.

Anyone got an idea why this keeps happening?
Using Qgis  version  2.18.


texts: How to replace a shapefile name in a directory using Python QGIS?

texts:
How to replace name or delete .shp file from directory using Python QGIS ?

import os
import processing
input = "//input.shp"
output = "//output_100.shp"
interval = 100
processing.runalg("qgis:densifygeometriesgivenaninterval", input,    interval, output)
paths = (os.path.join(root, filename)
    for root, _, filenames in os.walk("C:/" + os.getenv('USERNAME') + "/SHP_Path")
    for filename in filenames)

for path in paths:
newname = path.replace('_100', '')
if newname != path:
    os.rename(path, newname)

Result:

WindowsError: [Error 183] Can't create existing file.

I think that I should delete input.shp before renaming output.shp to input.shp.
But If I'll try to delete that files (.shp, .dbf, .shx) with code:

    filename="C:/" + os.getenv('USERNAME') + "/SHP_Path" + "//input.shp"
if os.path.exists(filename):
os.remove(filename)

I 've got result:

WindowsError: [Error 32] The process can not obtain access to the file because it is being used by another process :


texts: I don't really understand how .xml files interact with QGIS

texts:
I just saw Why are the Google basemaps no longer appearing in QGIS? and I don't understand the answer from user Thomas Horner.

Could someone explain why a .xml can be loaded as a raster?


texts: Loading TomTom Multinet with shp2pgsql accented characters

texts:
I am tasked with loading a new set of TomTom multinet shape files into a Postgres database using a bespoke tool for the process.  The source data is supposedly in UTF-8.

I have just realised that some of the French data has been loaded and has had accented characters mangled, and the same for Spanish data (I presume the same is true of any accented data).

I have access to the C# code, and it creates batch files to run shp2pgsql like this;

{binpath}\shp2pgsql.exe" -s 4326 -d -D -I -g geom -W Latin1 "{datapath}\fraf24___________gc.shp" fraf24.gc | "{binpath}\psql.exe" -d Test -U postgres

I have confirmed that shp2pgsql.exe is outputting these mangled characters by redirecting output to a text file.

As I understood it, the -W option controlled the encoding, but whatever I have used, from not using -W at all to specifying Latin1, LATIN1, UTF-8; the output every time has been garbled accented characters such as these:

"Rue de la RÃ©publique"
"Rue de la BÃ©casse"

In other respects the loads seem to have gone well, so I am at a loss to explain what is going on, especially as it sounds like the -W option should be the solution?


texts: Selecting points shapefile by raster values

texts:
I have a shapefile point (with 200 points record) and a raster image (with 5 classes). I want to select points that fall within a specific class of the raster image. For example, I want to select points that fall within class 2. I am using ArcGIS 10.7
I have tried to use select by attributes, intersect tools or zonal statistics but they do not solve my problem.
Attached is a picture of the data (red dots are the points)


texts: Filtering out canopies and buildings from DSM to have a bare earth elevation

texts:
Can anyone suggest methods in filtering out trees and buildings from a DSM so as to come up with a reliable DEM?

What  I have is a grid from a LIDAR data (.tif file, with 1m resolution). I was going to clean out the unnecessary items so I presume that I can solicit suggestions from here.


texts: Deleting anomalous points in *.lasd using ArcGIS for Desktop?

texts:
I am using ArcGIS 10.3.1 for Desktop. I have a raw .las file that I have brought into an ArcGIS .lasd file format.

The raw data has several anomalous points; i.e. the maximum elevation for any point should only be 100 meters but there are perhaps 30 points with an elevation above 1000 meters.

I would like to delete these anomalous points.

The points are unclassified except for "ground".  All others, including the anomalous ones, are "unclassified".

There doesn't seem to be a way to select these, or filter them out and then write a new .las / .lasd file that has eliminated them.


texts: Update AutoCAD 2015 custom drawing property fields from ArcGIS Shapefile

texts:
I need to update AutoCAD 2015 custom drawing property fields from a GIS point dataset shapefile format (in ArcGIS). I would like to do this for an AutoCAD template as project work starts.

I have tabular data for multiple sites as a point shapefile. I have created custom drawing property fields in AutoCAD 2015 that are currently copy and pasted from a spreadsheet output into CAD.

I know you can export Layer properties like color etc. from GIS into CAD file. Does anybody have experience on updating custom properties?


texts: Unable to load raster from PostGIS into QGIS

texts:
I'm trying to load raster from a postGIS connection into QGIS, but I'm getting the following error:

PG: dbname=EnvModel host=127.0.0.1 user=postgres port=5432 mode=2 schema=public column=rast table=dem10m is an invalid layer - not loaded

I saw this question, but on my case the error is different as you can see. I can add vector layer without any trouble. I thought that it could be a GDAL related issue, but I can access all GDAL functions through the Geoprocessing panel.

I'm using Ubuntu 14.04 LTR, I first faced this problem on QGIS 2.8, which lead me to try QGIS 2.10. Same problem on both versions. I do not have this problem on QGIS 2.8 for OSX and neither at QGIS 2.10 for Windows. I am literally lost at this, the QGIS log is not very helpful as you can see, is it possible to get a more complete log?


texts: Domain field not showing up in Feature Class properties

texts:
I am working on a project where I made domains for my feature classes, and I need to connect the domain to the actual feature class. When I go to the Feature Class properties, the domain field is not showing up. I have attached a screenshot of the issue.
I am using ArcMap 10.5.
The second screenshot in the image is from the project instructions.


texts: I have downloaded a crime dataset from imaps, an online GIS server for Raleigh, NC.  The dataset shows the location and types of crimes in the past 90 days.  Using the info tool, I can see all of the attributes of an individual crime point, such as the date, category of crime, and address.  I cannot get an attribute table or use a selection query for this layer (it downloads as an .lyr file), which is what I would like to do to filter the data.  Is it possible to do this?


texts:
Is there a way to get a report of the values of every land parcel on a raster map layer?

In the same way r.report can be used to find how large the parcels are.


texts: Is it possible to permanently save the Edit Widget for a Postgis layer?

texts: Is there a way of configure the editing type for a POSTGIS layer through Edit Plugin and do not lose the changes after remove the layer or exit the program?


texts: Export from GIS to static html clickable hypermap?

texts:
What plugins or tools are available to conveniently export a GIS view to a html clickable hypermap?

Since 2005 or so we use a commerial plugin for ArcGIS,

We have a working example of the output here.
At this time, this is good enough, but it requires a few manual postprocessing steps, which should be reduced. Besides, the annual license for the plugin is considered a nuisance from a corporate accounting standpoint.

Now we are wondering if there are better alternatives.

Here are our requirements

Export a GIS view map to a bitmap, Correctly export it without distortions and with valid html, preferably with style information extra (in css), no proprietary attributes inside the html...
Export point features to clickable <area> elements. Make the points clickable, but also make the labels clickable.
Export as a single bitmap, do not convert to tiles
Export without a sidebar (only export the map, not the layer selection frame and other stuff such as trademark infos, "created with" footers in the bitmaps, etc.)
Aesthetic alignment of labels next to points
Label alignment configurable, set preferences and priorities image-wide (try to put label to the right of a point. If there is a collision with another label, then put label at the top of a point, etc)
Possibility to re-align + re-format labels individually after semiautomatic/algorithmic alignment steps have completed
it's ok when based on free software. However, if we switched to this software, it should be able to import ArcGIS 9 project files.
easy to use, preferably gui-based


texts: Remove Layers in a forEach with condition in openLayer3

texts:
I need to remove some specific Layers of my map, depending on a condition, like:

map.getLayers().forEach(function(layer) {
    if (layer.get('title')) {
        map.removeLayer(layer);
    }
});

But this doesn't delete all the Layers that get this condition, because the layer collection is modified while looping...

Is there any pattern to answer this problem?
I was thinking about reverse looping to delete the layers but I wasn't able to do that.


texts: Obtaining base maps / base layers in QGIS 3.0

texts:
I'm excited to upgrade from QGIS 2.18 to 3.0. However, I rely heavily on the plugin QuickMapServices for base maps. For example, the main project I'm working on currently uses these base layers, all from QuickMapServices:

CartoDB Positron [no labels]
ESRI Gray (dark)
ESRI Gray (light)
Google Road
Google Terrain

QGIS 3.0 doesn't currently have this plugin or the similar OpenLayers plugin. Instead it seems we're supposed to use the "add WMS layer" function. I'm trying to replace the layers I listed above using this method, but I'm struggling. I can't figure out what URL to use to get any of the layers.

Here I found instructions for adding these layers as xyz tiles in QGIS 2.18. The URL they provided for adding a Google road layer is: https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}

I tried every possible variation on this URL without success.

How can I get these base maps in QGIS 3.0?


texts: Select or export features within layer that intersect one another, and also within distance in ArcMap

texts:
As shown in the image, I would like to select or export features within a layer that intersect one another, and also within a specified distance.

I am trying to use the "Select Layer by Location" tool, but it is selecting all the features.

How do I do this in ArcMap?


texts: How to use Sharpmap to display spatial data from MS SQL Server 2008

texts:
Can anyone show me a step by step example on how to use Sharpmap to display MS SQL server spatial data using C# as the programming language?

Please note I have exploit some of the example online but nor seem to be displaying data from MS SQL server 2008.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using SharpMap;
using SharpMap.Geometries;
using SharpMap.Layers;
using SharpMap.Data.Providers;

namespace sqlcnx
{
    public partial class Form1 : Form
    {
// we start with the connection string
       static string connstr = "user id=Youssef;password='';"+
//user id = name of your PC and because I use windows authentification I don't need passowrd

            "server=YOUSSEF-PC\\SQL;"+
//write your PC name + \\SQL (my PC is YOUSSEF)

            "Trusted_Connection=yes;"+
            "database=test;connection timeout=10";
//my database name is 'test' , the connection timeout is the time in second that the proram will waite for the server to connect before generating an exeption

   SqlConnection myConnection = new SqlConnection(connstr);
        Map map;
        VectorLayer vly= new VectorLayer("vly", new SharpMap.Data.Providers.SqlServer2008(connstr, "quartier", "shape", null));

// 'quartier' is the name of the table in my database and 'shape' represente the geometry column in that table

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            map = new Map(pictureBox1.Size);
// we give the map the pictureBox size, don't forget to add a pictureBox to your form in the designer ;)

            vly.Style.EnableOutline = true;
            vly.Style.Outline = Pens.Black;
            vly.Style.Fill = Brushes.Red;
//the style of our vectorlayer color contour ..etc

           map.Layers.Add(vly); // add layer to the map
           map.ZoomToExtents(); //zoom to extentto see all the map
           map.BackColor = Color.White;
           pictureBox1.Image = map.GetMap();
//affect the map to the pictureBox
        }

    }
}


texts: Multi MXD export excluding specific MXD using arcpy

texts:
I try to export multi MXD into pdf files, but i want to exclude specific MXD files from this action:

import arcpy,os
import arcpy.mapping
from arcpy import env

env.workspace = r"D:\desktop\Project"
for mxd in arcpy.ListFiles("*.mxd"):
    mapdoc = arcpy.mapping.MapDocument(r"D:\desktop\Project\\" + mxd)
    if 'project2' or 'project3' in mxd:
        pass
    arcpy.mapping.ExportToPDF(mapdoc, r"D:\desktop\Project\out\\"+os.path.basename(mapdoc.filePath).replace ('.mxd','') +".pdf")
    print mxd
    mapdoc.save()
del mxd

But the result is that all MXD files has been exported:

 >>>
project.mxd
project2.mxd
project3.mxd
>>>


texts: Combine raster (monocromatic and RGB image)

texts:
I have to make an image starting from a cadastal map (monocromatical image) and an orthophoto (RGB image). Both are in tif format. The images are perfectly coincident, resampled to have the same pixel size and same system reference coordinate SRC. The cadastral image is black and white (black = 0, white = no data). Initially I had thought of using a merge tool of QGIS to merge the two raster, but it seems that this procedure does not work perfectly: I get the same orthophoto by losing the cadastral margins.
Using the blend function of the PIL library in python you get something that remembers the result I should have, basically playing on the transparency of the layer that overlaps.
Instead, I'd like to get a final picture where you can see the cadastral boundaries on the orthodox background.
I put un example image to try explain better what I want realize.

Can you help to me to find a solution?


texts:
I am struggling to produce a terrian file with RAS Mapper.

I have a .tif file produced from a .asc raster elevation and when I tried to add a New Terrain Model as described in the documentation I get the following error:

  Error creating Terrain: Input string was not in a correct format.

I have gone through all options related with the file paths and it seems to be something with the file itself, but what?

Among the many ways I have tried to produce it I am using GRASS.

The source of the raster data:

+----------------------------------------------------------------------------+
 | Map:      DTM2plus_2-18882@MA            Date: Mon May 28 12:04:37 2018    |
 | Mapset:   MA                             Login of Creator: MA              |
 | Location: GRASS_SWEREF99_1800                                              |
 | DataBase: R:\6_GIS\62_A_Data\                                              |
 | Title:    DTM2plus_2-18882                                                 |
 | Timestamp: none                                                            |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Data Type:    FCELL                                                      |
 |   Rows:         2500                                                       |
 |   Columns:      2500                                                       |
 |   Total Cells:  6250000                                                    |
 |        Projection: SWEREF99 18 00                                          |
 |            N:    6647500    S:    6642500   Res:     2                     |
 |            E:     185000    W:     180000   Res:     2                     |
 |   Range of data:    min = 8.68  max = 39.2                                 |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.patch                                                    |
 |                                                                            |
 |   Comments:                                                                |
 |    r.patch input="x800_664_18_5025@MA,x800_664_18_5000@MA\                 |
 |    ,x800_664_18_2525@MA,x800_664_18_2500@MA" output="DTM2\                 |
 |    plus_2-18882"                                                           |
 |                                                                            |
 +----------------------------------------------------------------------------+

The command to produce the tif file:

r.out.gdal input=DTM2plus_2-18882@MA output=R:\6_GIS\DTM2plus_2-1882B.tif format=GTiff


texts:
I have a dataset with start and end points of lines. Columns in the table are

unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon

I need to use this in my website (python,mysql) to draw lines as map overlays connecting these points.

According to the user selection, the map will display one or more
lines from the above table
I need to zoom the map to fit the
line/lines in the view when the page is loaded, and center the map accordingly
I would like to add a small thumbnail image in the middle of each line

I am looking for open source technologies to use in my website which would not need a paid license. (I have a vague idea to use google maps as base map images and use google JS API or D3.js, I've also seen references to GeoDjango) Please  let me know any demo sites too, with one or more of these implemented.


texts:
I was given a folder of .sid, .sdw, and .sid.aux.xml files to use as tiles on our map. I'm pretty sure I can use ImageMosaic for this and have followed the doc at http://docs.geoserver.org/stable/en/user/tutorials/image_mosaic_plugin/imagemosaic.html.
When I get to the step to add a Store and click save, I get the error "Could not list layers for this store, an error occurred retrieving them: Argument "value" should not be null." What can I do to fix this? Thanks!


texts: Selecting Multiple Layers under Table of Contents

texts:
I have been trying out what ARCMap10 can do in terms of the TOC. And their TOC has a lot of good functionalities.

I really want to figure out how to Group/Drag and Drop/ and select multiple layers.

As for this question, do you guys know how to select multiple layer in the TOC?
This is for ArcEngine 10 .Net


texts: Map generation failing with Kartograph.js

texts:
I am trying to generate a very simple map using kartograph.js. But some how my code is not working.

    <html>
<head>
     <script src="jquery-1.8.3.min.js"></script>
     <script src="raphael-min.js"></script>
     <script src="kartograph.min.js"></script>

<!---starting karograph.js-->

    <script language="JavaScript">
function loadmap(){
var map = Kartograph.map('#map', 900, 0);

map.loadmap('map.svg', function() {
    // add layers.
        map.addLayer('countries');
        map.addLayer('depth');
        map.addLayer('trees');
        map.addLayer('crops');
        map.addLayer('rivers');
        map.addLayer('canals');
        map.addLayer('city');
        map.addLayer('states');
        map.addLayer('coast');
        map.addLayer('coast');
});
}
</script>
</head>
<body onLoad = "loadmap()">
<div id = "map">
</div>
</body>
</html>

It basically shows a blank page. I am not sure If this has to be hosted on a local server? however I setup a local server using Python but it still shows a blank page. I checked all the source file addresses and they are all right. Not sure whats happening here?


texts:
I am trying to overlay the KML file over google maps and want to know where I can host the kml file which I will then be able to add to the google maps. I tried using google drive and dropbox but they do not allow the file to be read from these sites.

Can somebody tell me where I can host it?

UPDATE

According to this google-groups discussion, I cannot overlay a KML file from my local system.


texts: Unable to Provide Input for a MultiValue Parameter Script Tool

texts:
I have the following script:

#Import ArcPy site package
import arcpy
from arcpy import env
from arcpy import Raster
from arcpy.sa import ZonalStatistics
from arcpy.sa import CreateConstantRaster

# Set Environment Workspace
ws = env.workspace = "MY_WORKSPACE_PATH\\FGD.gdb"
# Set Environment Raster Cell Size
env.cellSize = 10

# Check out ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Get Parameters as Text
rasters = arcpy.GetParameterAsText(0)
inputRasters = rasters.split(";")
inZoneData = arcpy.GetParameterAsText(1)
zoneField = arcpy.GetParameterAsText(2)

# The constant raster = 0
addedRaster = CreateConstantRaster(0)

# Process each raster string
for raster in inputRasters:
    addedRaster = addedRaster + Raster(ws + "\\" + raster)

# Execute Zonal Statistics
zoneStats = ZonalStatistics(inZoneData, zoneField, addedRaster, "MAXIMUM", "DATA")

# Save the output
zoneStats.save(ws + "\\" + NewTest_12102011")

I have imported the script as a script tool in ArcMap, my parameters are in the correct order and have the correct attributes (this script works when I have, for example, just two raster inputs as parameters). The input rasters are referenced as a String (this tool will eventually be used as a Geoprocessing Task, so I cannot use rasters a input directly). The problem I have is that when I open the tool, there is no way for me to input anything into the first parameter.

To provide some clarity: each value that could be entered into the parameter would be the name of a raster inside the geodatabase. For instance, say the user enters "rasterOne" and "rasterTwo". This would refer to MY_WORKSPACE_PATH\FGD.gdc\rasterOne and MY_WORKSPACE_PATH\FGD.gdc\rasterTwo, which are then cast to a Raster object with

Raster("MY_WORKSPACE_PATH\\FGD.gdc\\rasterOne")

Any suggestions would be great. Thanks.


texts:
I am rendering multipolygons of FEMA flood zones using mapserver / mapcache / openlayers.  The flood zones render correctly directly from mapserver, but at a few zoom levels interior tiles (by which I mean tiles inside the multipolygons which contain no edges) are rending grey.  The odd thing is that when I zoom in further they display correctly again.  I'm attaching links to config & an example of missing tiles.

mapcache.xml
floodbroker.map
image of missing tiles


texts: QgsRubberBand constructor deprecation warning

texts:
I construct a QgsRubberBand in PyQGIS 2.18.17 the following way

canvas = iface.mapCanvas()
my_rubber = QgsRubberBand(canvas, QGis.WKBPolygon)

according to https://qgis.org/api/2.18/classQgsRubberBand.html

and get a Deprecation Warning like

2018-03-23T11:56:19 1   warning:C:/Users/Jochen/.qgis2/python/plugins\BBBBPlanung\bbbb_planung_dockwidget.py:666: DeprecationWarning: QgsRubberBand constructor is deprecated
          my_rubber = QgsRubberBand(canvas, QGis.WKBPolygon)

Why this?


texts:
As of yesterday, the OpenLayers plugin stopped working - as in I could no longer get google, bing or any other background maps. Then in the process of checking and reinstalling the OpenLayers plugin, I found that I could no longer access the QGIS Official Plugin Repository.

I'm on a win64 QGIS 2.18 system.

Is this my local system issue or is there some sort of problem with the QGIS and or OpenLayers systems?  Any ideas on how I can resolve either problem?


texts: Looking for high resolution (1m or better) aerials for Turkey?

texts:
Would prefer free but under a couple hundred dollars is also doable.

It would be nice to have actual tif, sid, etc. files but a WMS would also work.

The WMS (bing and esri) I have been able to locate have holes and poor resolution in many areas of our 24k scale Turkey project.

aerial problem areas here

Have attempted to use the trial versions of ArcBruTile and Global Mapper. Both of which don't provide what we need without spending too much on what looks like overpriced convoluted products.

It seems there has to be some high resolution aerials for Turkey that are free/inexpensive and user friendly to download/use.


texts:
I am struggling to find right syntax for unregistering addin using a bat file.

path=%path%;
 "%CommonProgramFiles(x86)%"\ArcGIS\bin\ESRIRegAddIn.exe {5980f3b2-f335-47c4-bfd4-bfa181dd9c4d} /u

Problem here is that some times (very few times) it seems to work. However, most of times it doesn't.
 You can say you can simply delete the folder. However, what if the user keeps the addin in non-standard location.  However, I could install using bat file successfully.
So, I appreciate your response.

Alternatively, is there a way to programatically access additional folder locations user specified in add-in manager?
 It allows me to search for apps in those locations.

Is there any best way to tell if your add-in is installed on the user machine programmatically. With
classic com extensibility, you can look in registry to retrieve whether an application is installed and where it is located.
 However, with add-in nothing would be added to the registry. It loads all the applications when arcmap is opened. So, what is the best approach. I opine that above two options are the way to go. Please let me know if you have any better recommendations.
Thanks in advance.


texts: Looking for PyQGIS Syntax Examples/Guide

texts:
I am a long-time user of arcgis with intermediate experience python scripting for automation of geoprocessing workflows. I am moving towards using QGIS on the regular and I would like to dive into python scripting for QGIS.  However, I have previously relied on esri's help screens which contain python syntax as well as examples (ESRI Example). Is there an equivalent of this python documentation for QGIS? I have found the PyQgis Cookbook limited and the API Documentation beyond what I'm able to undertake.

Any suggestions would be much appreciated.

thanks in advance,
mike


texts: How to make a density map from polygons/rasters (ArcGIS)

texts:
I would like to make a density map of grasslands.  I have a vector layer of habitat classifications, I would like to a density map of grasslands within a specified radius.  My thoughts are to:

convert the layer to a raster, then to a point layer.
do a point density map

Is there a better way of doing this?


texts:
I need to display points in ArcMap using a spreadsheet with United States National Grid (USNG) Coordinates. I have previously done it with Lat/Longs where I convert the spreadsheet to a table, right-click on the table and select 'Display XY Data'.

Is there a way to map the points using the USNG Coordinates?


texts: Creating vectors based on U and V values using ArcGIS Pro?

texts:
I am conducting an exposure assessment and need to isolate downwind populations from numerous points of exposure in the US. I have a shapefile that separates the entire US into 36x36 km cells. Each cell has emissions data and U and V wind values.

The easiest analysis is to create a buffer around each cell to capture the exposed population within x meters, for example. However, that does not take into account wind direction or speed (values that can be derived from the U and V values). Another option would be to calculate a buffer that is weighted towards the prevailing wind, but I do not believe a function in GIS exists to do this.

A step by step alternative would be to first calculate and create wind vectors per cell, and then use the Linear Directional Mean to create a mean vector within designated areas. Then I could buffer around this vector, however this would still be a very crude estimate of the exposed population.

Can anyone suggest a method of creating ellipse-like buffers that preferentially capture downwind areas using ArcGIS Pro (I am not very familiar with ArcPy). If not, I would like to at least be able to create a new layer of vectors based on U and V wind values. (Also, to be clear, I do not want to visualize the wind directions - I know how to do this using symbology. I would like to create a new shapefile of vectors so that I can use the Linear Directional Mean tool.)


texts: QGIS Variable Symbol Levels / Layer Rendering

texts:
I am trying to display a regular series of circles that are sized and colored differently based on their attributes. So for example:

Let's say attribute A is green, B is blue, C is yellow.

I always want the smallest circle on top, then the next smallest, etc. So object one the display order (top to bottom) would be Attributes A B C, but in Object 2 the order would have to be Attributes B C A.

I hope this is clear. I can't figure out how to do this. I can separate the information to layers but can only have a static rendering order.

I could control the symbols levels but again, this is static.

Any suggestions would be great!


texts: Is there a way to get undistorted maps in R (when using the OpenStreetMap package)?

texts:
When I download a large map within R (using the OpenStreetMap package) and I reproject the map (ideally to +proj=longlat), the map will always turn out distorted, making country labels etc. near the poles illegible.

Q1: Is there a way to obtain such a map (ideally still in R) in such a way that you can still read the labels? Secondly, if I keep the original map (in mercator projection) but "reproject" the points, and I use the map in a (ggplot2) plot, the labels will still look strange - probably because the size of the map image changed between downloading and plotting.

Q2: Is there a way to either download the perfectly sized tiles or to use the original tile size in the plot, so that the labels don't look blurred?

My code (for Q1, but Q2 is based on this as well) looks similar to this:

library(OpenStreetMap)
map <- openmap(c(85,-179.99999),c(-60,179.99999), zoom=2, type = "osm")
# - type="nps" is about the only type that looks okay because it has no labels
map <- openproj(map)
plot(map)

...and the map looks like this (if you look closely, you will see that "Brazil" is clearly visible, but "Russian Federation" (in Russian) not so much):


texts: Computing the horizon profile given a DEM in Python

texts:
Can anybody orient me towards an open source Python script that computes the 360° horizon profile (azi + elevation of highest topography in eye sight) from a single point (x,y,z) on Earth (account for a geoid model) ?

Such as this Matlab script, but in Python : https://fr.mathworks.com/matlabcentral/fileexchange/59421-dem-based-topography-horizon-model.

I use Python 3.4. I do not wish to use other tools other than Python.


texts: How to prevent base layers from being edited?

texts:
I've made a local tile server (mapnik + postgis + tilecache).

Now i need to make use of some editing tool so that only newly created layer can be edited: users of this tool shouldn't have rights to edit "base" geographic layer (in order not to spoil it).

edit:

I'll try to explain my workflow better: i want to allow users create and edit some specific objects on the map (parts of network infrastructure i.e. routers, optic lines and so on), but the critical feature  is to prevent users from editing the geographic map.

So, in short, they shoud only be able to edit the layer with our data, but not the data from openstreetmpas (i still need it for being able to update it).

I'm using JOSM for now, but how can i disable base layer editing?


texts: ArcMap ModelBuilder iterate Raster and field value of Feature Class with Raster Calculator

texts:
We have a geodatabase with rasters and one Feature Class with a field "Radfahrer" (Long Integer datatype).

We try to multiply the rasters with the values of the fields with iteration: raster_1 * field_1, raster_2 * field_2, etc...
Is that possible in ModelBuilder?
In the case we get the following error:
Executing (Raster iterieren): IterateRasters G:\probability.gdb # # NOT_RECURSIVE
Start Time: Sun Jan  3 13:06:43 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,37 seconds)
Executing (IterateRadfahrer): IteratePixel G:\grunddaten.gdb\gebaeude_bezirke\testbezirk
Start Time: Sun Jan  3 13:06:44 2021
Executing (Zeilenauswahl iterieren): IterateRowSelection G:\grunddaten.gdb\gebaeude_bezirke\testbezirk "OBJECTID #" false
Start Time: Sun Jan  3 13:06:44 2021
Executing (Make Feature Layer): MakeFeatureLayer G:\grunddaten.gdb\gebaeude_bezirke\testbezirk I_testbezirk_OBJECTID ""OBJECTID" = 1" # #
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,34 seconds)
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,34 seconds)
Executing (Feldwert abrufen): GetFieldValue I_testbezirk_OBJECTID Radfahrer Long 0
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,00 seconds)
Executing (Zeilenauswahl iterieren): IterateRowSelection G:\grunddaten.gdb\gebaeude_bezirke\testbezirk "OBJECTID #" false
Start Time: Sun Jan  3 13:06:44 2021
Executing (Make Feature Layer): MakeFeatureLayer G:\grunddaten.gdb\gebaeude_bezirke\testbezirk I_testbezirk_OBJECTID ""OBJECTID" = 2" # #
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,01 seconds)
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,01 seconds)
Executing (Feldwert abrufen): GetFieldValue I_testbezirk_OBJECTID Radfahrer Long 0
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,00 seconds)
Executing (Zeilenauswahl iterieren): IterateRowSelection G:\grunddaten.gdb\gebaeude_bezirke\testbezirk "OBJECTID #" false
Start Time: Sun Jan  3 13:06:44 2021
Executing (Make Feature Layer): MakeFeatureLayer G:\grunddaten.gdb\gebaeude_bezirke\testbezirk I_testbezirk_OBJECTID ""OBJECTID" = 3" # #
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,00 seconds)
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,01 seconds)
Executing (Feldwert abrufen): GetFieldValue I_testbezirk_OBJECTID Radfahrer Long 0
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,00 seconds)
Executing (Zeilenauswahl iterieren): IterateRowSelection G:\grunddaten.gdb\gebaeude_bezirke\testbezirk "OBJECTID #" false
Start Time: Sun Jan  3 13:06:44 2021
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,00 seconds)
Succeeded at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,38 seconds)
Executing (Raster berechnen): RasterCalculator "p_cd_1"*77 G:\result.gdb\r_p_cd_1
Start Time: Sun Jan  3 13:06:44 2021
"p_cd_1"*77
ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 8, in rcexec
AttributeError: 'str' object has no attribute 'save'

Failed to execute (Raster berechnen).
Failed at Sun Jan  3 13:06:44 2021 (Elapsed Time: 0,10 seconds)


texts: GeoServer: Creating a datastore with spaces in the path

texts:
I am using the GeoServer REST API to create a datastore. The path that I am using has a space in it. This does not seem to work well in GeoServer 2.11.2 since it generates an "Input type is not supported" error.

When I go in GeoServer and I use the datastore page directly this does not seem to work unless you replace the spaces with %20 and the file: to file://.

So it works if the url field looks like this: file://C:source/example%20source/example.ecw

I can not get it to work with these paths in the REST call:

C:/sources/example source/example.ecw (throws org.geoserver.rest.RestletException: java.lang.IllegalArgumentException: Unsupported input type)
C:/sources/example%20source/example.ecw (throws file not found)
file://C:/sources/example%20source/example.ecw (this converts in geoserver to file://file:) (throws file not found)

Is there a way I can make this work with the REST API?
Maybe GeoServer should support spaces natively?

the last option works but there was something in my code already adding the "file:" part so it added it double


texts: QGIS - QField - Retrieve target field value when source feature intersects target feature in target layer

texts:
I have a simple project in QGIS 3.10.5: a polygon layer and a point layer. When the user add a point feature which intersects a polygon feature, a calculate field make this intersection and get the id attribute of the polygon feature.

In my desktop project, I used refFunctions extension, and result is ok. I have a calculate field in my point layer with an expression: geomintersects('polygonLayer', 'polygonID').

I deployed this project in QField and refFunctions isn't working anymore, even when geopackage is synchronised with desktop project. I tried an other expression without using, refFunctions but it's not working better.

aggregate(
layer:= 'polygonLayer',
aggregate:='concatenate',
expression:=polygonID,
concatenator:=', ',
filter:=intersects($geometry, geometry(@parent))
)

How to calculate an intersection between two layers (and get an attribute value) with QField?

Can I use a "native" QGIS function to make this intersection in a calculate field? (without using aggregate because my field is an integer id)

-- EDIT

In my point layer, I also have a date field wich have a default value format_date( now(),'yyyy-MM-dd HH:mm:ss'). When I add a feature in QField, date is well calculated and displayed in the form but aggregate function result isn't. When I synchronize my layer with QFieldSync, date value is ok but my intersection field with aggregate function is NULL.

How to explain this? Both are functions, why behaviours are different?

Documentation seems to indicate, this should works, maybe I'm missing something.


texts:
I am trying to iterate through 2 folders (1 for points, and 1 for polygons) and use the output values as inputs for another submodel that applies IDW, Focal Statistics, and finally a Clip (to a polygon) to convert a series of points into a raster (clipped to the individual polygons). I have created a batch iterator tool to overcome the one iterator restriction within a model. I have tried multiple configurations of this (1 iterator + iterator submodel, 2 iterator submodels, etc...) without success. I have also tried to use the "Collect Values" tool, but when I do this, it only allows me to connect to the Points to Raster submodel as Preconditions, not inputs.

What am I doing wrong here?

Below are the two submodels (Batch_Iterator_tool & Points to Raster tool) and the main model that I am trying to build.
Batch iterator tool submodel:

Points to Raster tool submodel:

Main Model:


texts:
How do I install sDNA in QGIS for mac?

Every time I try to do it the following message appears.


texts: Decimal degree coordinates plotting incorrectly on basemap in ArcMap

texts:
I'm trying to plot some GPS coordinates onto the World Light Gray Canvas basemap, but they are not showing up near the correct location (Ecuador). I uploaded a shapefile for Ecuador which did show up in the correct location on the basemap, so I'm not sure why the lat/long are so far off.

Spatially, the locations appear to be the correct distance from one another, but they are showing up near the prime meridian instead of off the coast of South America.

I have the coordinates in decimal degrees in an excel file (0.32, -89.95), and I'm adding the XY data with X=long, and Y=lat, and the coordinates should be WGS_1984 (I got them from google maps, so probably the mercator projection?)

Steps I took: Add data--> Add excel sheet with coordinates --> Display XY Data--> X Field=Long, Y Field=Lat, Coordinate System=GCS_WGS_1984

Any ideas???


texts: Passing token to secure FeatureServer fails on /query request

texts:
I am looking to fetch some ArcGIS FeatureLayers from arcgis.com which are secured, using the JS 4.0 API. If I include them as normal, I get the pop-up window to allow users to log in. Ideally, this needs to use application authentication so end-users do not need to log in each time.

I have the App ID and App Secret details and can generate a token. If I append the token to the URL when making the new FeatureLayer, the first call is successful and I can see the token is sent through. But when that first call is completed, a second call is made to the /query method - this call no longer includes the token, which then fails the authentication and brings up the login window.

I am currently doing:

var layer = new FeatureLayer({
   url: "featureserverurl?token=token"
});

I have tried to pass the token through as a second option, though this is then never picked up on any of the requests. Is there something that I'm missing?


texts: Create KML in Ruby with ruby_kml and use in Javascript

texts:
I want to create a KML in Ruby and use it with Openlayers. But Openlayers only wants a real KML file. It's complicated to explain. Just look at my Code:

In my Controller I have the following method for the KML:

def kml

require 'ruby_kml'

kml = KMLFile.new
folder = KML::Folder.new(:name => 'Melbourne Stations')
[
    ["Berlin1", 52.520645, 13.409779],
    ["Berlin2", 52.520645, 13.409779],
    ["Berlin3", 13.409779, 52.520645],
].each do |name, lat, lng|
  folder.features << KML::Placemark.new(
      :name => name,
      :geometry => KML::Point.new(:coordinates => {:lat => lat, :lng => lng})
  )
end
kml.objects << folder
@kml = kml.render
return kml
end

And in my index View I will call the KML with the following Script:

<script>
loading.style.display="none";

var vector = new ol.layer.Heatmap({
    source: new ol.source.Vector({
        url:   '<%= @kml %>',
        format: new ol.format.KML({
            extractStyles: false
        })
    }),
    blur: parseInt(10, 10),
    radius: parseInt(3, 10)
});

var koordinate = 5.6;

var map = new ol.Map({

    layers: [vector],
    target: 'vector',
    controls: [] ,
    interactions: ol.interaction.defaults({
        dragging: false,
        dragPan: false
    }),
    view: new ol.View({
        center: ol.proj.transform([10.5 , 51.0], 'EPSG:4326', 'EPSG:3857'),
        minZoom: koordinate,
        maxZoom: koordinate,
        zoom: koordinate
    })
});

blur.addEventListener('input', function() {
    vector.setBlur(parseInt(blur.value, 10));
});

radius.addEventListener('input', function() {
    vector.setRadius(parseInt(radius.value, 10));
});
</script>

But this doesn't work because OpenLayers only handles a real KML. How can I solve this problem? Is there a possibility to do this with ruby_kml?


texts: Delete the vertex of a line in Carto Builder

texts:
How can I delete the vertex of a line that I have previously created?
I´m doing tests. I know how to edit a line or create a new one and add vertexs clicking in a transparent circle between two vertexs already created, but if i want to remove this vertex created, i don´t know how to do it.


texts: Calculating percentage of area by district of land use type

texts:
I have a file geodatabase feature class, type polygon, of land use type.
SEQ LU Update X project clip in the attached.

I have a districts shapefile (shapefile feature class polygon).
All_Brisbane in the attached.

I need to know, by district, the percentage of the area of each district that is irrigated. There are six land use types beginning with Irrigated (see attached).

I'd like to generate a table (CSV etc) that has each district name/id in one column and the percent of the total district area that is irrigated (i.e. the sum total of all six Irrigation types divided by the total of all types in the district) in another column.

How can I do this?


texts: Understanding ArcPy tools needed to create shapefile from CSV table?

texts:
I couldn't find a tool in ArcGIS Desktop (10.2.2) to convert a CSV into a shapefile, which was surprising to me, so I decided to script my own.

I found a helpful example script on ESRI's website (converting a dbf to layer) here: http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/make-xy-event-layer.htm

I took the bulk of that script and added a CopyFeatures_management step to create the shapefile I wanted (relevant portions of my script below).

# Make the XY event layer
arcpy.MakeXYEventLayer_management(Input_Table, x_coords, y_coords, XYevent_Layer, spRef)

# Save to a layer file
arcpy.SaveToLayerFile_management(XYevent_Layer, Saved_Layer_path)

# Copy features to shapefile
arcpy.CopyFeatures_management(Saved_Layer_path, Output_FC)

My script works fine.

But this seems like it should be a one-step task (CSV to shapefile).

Can anyone tell me what is going on "under the hood" that requires 3 separate steps, OR why ESRI doesn't have a CSV to shapefile tool?  I don't see anything like that in the Conversion Tools folder.

I realize this question isn't focused on a problem per se, but I hope it is allowed because I think it would be valuable to those who want to better understand Arcpy scripting AND I've already tried searching the web to no avail.


texts: Growing polygons with limiting area and boundary using ArcGIS Desktop?

texts:
I need to create polygons of a specific area based upon random points within bounding polygons, but haven't been able to find a tool able to do all these.

I've looked at growing Theissen polygons, but can't find a way to stop the growth to a specific area.

I've looked at buffering the points, but that doesn't provide a way to grow the polygon to the correct area within the bounding polygons.

I've attached a hand-drawn concept of what I need.


texts:
I have to map a point using this coordinates:

38 R MF 18852 15799

I can't understand the coordinate system.

For sure '38' is the UTM zone number and 'R' is the designation (indicating southern Iraq)... but the rest?


texts:
I need a simple understanding of nontopological geometry.

I am completely new in this area so please correct me if I am wrong.

As far as I understand in topological geometry the object(say a line) can be bend but in nontopological geometry object can be only be moved but can not be changed in a new shape.

I came to know about nontopological geometry while reading a documentation about afrigis mapserver. Here is a little from the documentation where I found the term nontopological which may have its source the ESRI Shapefile Technical Description (page 1).

  A shapefile stores nontopological geometry and attribute information for the spatial
  features in a data set. The geometry for a feature is stored as a shape comprising a set of
  vector coordinates.
  Because shapefiles do not have the processing overhead of a topological data structure,
  they have advantages over other data sources such as faster drawing speed and edit
  ability


texts:
I'm connecting to a WMTS service using a viewer we're building on top of Cesium.  The client probably isn't important, except to say that it already supports both WMTS request modes (KVP or RESTful).

Between these two request encodings, why should I choose one over the other? For example, maybe one offers a performance advantage, or better compatibility if we were to later install a tile caching server.


texts: Using Feature Class name to populate new field

texts:
I am trying to get the Feature Class name (from Iterate Feature Classes) into a new field. I have been following the models described in the following two threads.

Using Value from Iterate Feature Selection to Calculate Field in ArcMap 10.1 ModelBuilder

and

this one

However, whenever I run the model I get the following error message

ERROR 000539: Error running expression: CF0140r01
Traceback (most recent call last):
  File "", line 1, in
NameError: name 'CF0140r01' is not defined
Failed to execute (Calculate Field)

I have tried it using Parse Path using %Value% in the expression field (here is  my model) (http://i.imgur.com/aOFgCgJ.jpg)
and I have tried it with the Parse Path tool removed , entering %Name% in the Expression box for Calculate Field

I get the same error message either way

Here are two screen shots of the Feature folder

and the Calculate Field

I have tried to simplify this model (not even sure why I need the Feature Class to Feature Class tool, I just have it there because an earlier thread I was using to build this had that in it). Here is the updated, and simplified model, with the Error Message I am getting. FYI: the Expression in the Calculate Field tool is %Name%


texts: Using valueAsText, giving me unicode data instead of a list

texts:
I am learning Python to create toolbox right now. When I'm trying to get the parameter, using valueAsText, the date returned is unicode instead of a list that I was expecting.

This is the code that I was using:

inFeatures = parameters[0].valueAsText

I was hoping the input data would be stroed in a list in this way, put when I use for loop, this is what I have:

    messages.addMessage(type(inFeatures))
    for inFeature in inFeatures:
        messages.addMessage(inFeature)

It is dividing the path into single characters.

Any way I could get the result in a list?


texts: How to use spatialite SQL functions in GDAL/OGR

texts:
I would like to create one-sided buffer geometries around linestrings. I found this ST_SingleSidedBuffer SpatialLite function that I would like to use in my Python script.

When I run the function below, the bufferFeature is empty without throwing any error. Is this because I am using an incorrect syntax or because the ST_functions cannot be run without setting up a database? I am accessing my data with OGR/GDAL functions.

I couldn't find complete examples online to compare my syntax with, only small snippets from GDAL on spatialite SQL functions, as well as further ones that seem to require a database connection: stack exchange: How to use SpatiaLite functions in a Python script?

def createBuffer(self, datasource, layer, bufferDistance, side):
 [...]
    for feature in layer:
        geometry = feature.GetGeometryRef()

        sqlQuerry = "SELECT ST_SingleSidedBuffer(%s, %.2f , %i) * FROM %s" \
                    % (geometry, bufferDistance, side, layer.GetName())

        bufferFeature = datasource.ExecuteSQL(sqlQuerry, None, 'SQLite')
        #syntax: ExecuteSQL(statement, [spatialFiler], [dialect])


texts: Using ModeBuilder to populate a table with the feature count of multiple feature classes

texts:
Specs:  I'm using ArcInfo 10.1 and have all extensions available to me.

I have a folder with many file geodatabases.

Each file geodatabase contains 2 feature classes.  One is a point fc and the other is a polygon fc.

I'm trying to figure out how to calculate the total number of polygons stored in all geodatabases in this folder.  I'm happy for this number to go anywhere i.e .txt, .csv, .xls, even just a box somewhere so I can write it down.

I think I'm nearly there with ModelBuilder, but I'm stuck at what I believe is the last step.

My logic:

1 - Use an iterator to iterate through all the fgdb's in the folder.

2 - Use an iterator to iterate through the feature classes in the fgdb looking only at the polygon feature type.

3 - Use the Get Count tool to count the number of rows in the feature class.

4 - This is where I'm stuck.  I think I want to be using the Collect Values tool to collect all off the returned polygon counts, but I can't figure out how to extract and sum the values from here.  Am I thinking about this in completely the wrong way?


texts: Using QGIS widget value-relation with PostgreSQL tables?

texts:
I am trying to implement types and subtypes to a layer of points that is stored in PostgreSQL and I wonder if it is possible to use Value Related Widget of QGIS, in PostgreSQL?

I followed the procedure explained at https://www.northrivergeographic.com/archives/qgis-3-2-drive-down-lists-aka-value-relation-widget

It works with shapefiles and geopackage, but it does not work with tables that are stored in PostgreSQL.


texts: Retrieving specific value from CSV layer to use in QGIS Expressions when conditions match current Atlas feature

texts:
I have configured an Atlas which is tied to a "ref_pln" column in a coverage layer. I also have a CSV layer with the columns "ref_pln", "attribute" and "value".

I'd like to pull the value of "value" for a specific value of an "attribute" in the CSV layer whenever its "ref_pln" matches the "ref_pln" currently being displayed in the Atlas.

Example:

Atlas "ref_pln" is currently "003";
The attribute I want to pull is "date";
My CSV layer has the following records:

RECORDS:

ref_pln | attribute | value

002     | issue     | yes
002     | solved    | no
002     | date      | 1500
003     | issue     | yes
003     | solved    | no
003     | date      | 1250

I'd like to build an expression which displays "1250" (i.e. the value of "value" when the value of "attribute" is "date" and the value of "ref_pln" is "003" - i.e. the same as the Atlas).


texts:
I have searched many information in Internet but don't know for example how to implement a WCS service like GeoServer. I suppose they a Geo Sever need to use some (GML Schema like version GML 3.2.1 to generate geodetic data to Web Client that can be a GIS application).

So question is the relation between GML Schema (a kind of template) plus some data object to GML returns to Web Client, how to implement? (I just want to ask general idea no need to detail).


texts:
I'm working with ArcGIS 10.2 for Desktop and OS Windows 7.

I need to set numeric vales from Zero back to NULL, but I can't from the field calculator.

I'm working with  a vector file and I need to display NULL in one column that shows 0 (Zero) as default value.

-------- Edit-------
I am adding the error messages that he received

Translation:  An error occurred during the process.  Please consult the Geoprocessing Results Window to obtain more details.

Error at bottom, translation:  The values of the selected column can not be set to null because the field in the database is defined as "Not Null".


texts:
I am trying to create a web map using ArcGIS Online with a polar projection.
As a basemap I selected this one https://gis.ngdc.noaa.gov/arcgis/rest/services/arctic_ps/arctic_basemap/MapServer?f=jsapi
The WebMap then automatically switches to a polar projection web map (EPSG 3995).
I projected my files to 3995 and published them in my ArcGIS Online account. My point layer consists of 300 points and my line layer consists of 40000 lines connecting each point with every other point on the map.
On my desktop using ArcMap (but also QGIS) my lines look correct.

When I try to create a web map with the above mentioned baselayer, I get this type of distortion

Do you know why this is happening, and how I can fix my map?


texts: Updating onEachFeature property of GeoJSON in Leaflet?

texts:
Here's my code:

var eurojson = L.geoJSON(
eurojson,{
  onEachFeature: onEachFeature,
  style: EU_color
});

var econjson = eurojson;
econjson.setStyle(Econ);

When I initialize econjson variable, I would like the onEachFeature property to be null, or turned off (I still don't  have the vocabulary down yet). But I still need it for the eurojson variable.


texts: How to install PostGIS and OpenLayers plugins?

texts:
I am new to QGIS and have installed the QGIS v 2.2.0.

For adding google map as a base layer I need to install OpenLayers plugin. I also need to add the PostGIS plugin for DB management purpose.

Can anyone guide me how to add/install the plugins OpenLayers and PostGIS to QGIS 2.2.0?


texts: Subtracting out slope (in general) of DEM using ArcGIS for Desktop?

texts:
I'm searching for a solution process to subtract out the slope of a DEM like this:

I have a high resolution DEM and want to reconstruct historical/old/not active parts of a river. The problem is the trend of the whole area. Structures from different areas are at different highs and its not possible to describe/visualize the whole area in the same way. So my idea is to adjust all highs to solve the problem.

Any idea?


texts:
I'm trying to access a database located on a remote server.

I used ArcMap "Create Database Connection" tool on my computer to create a SDE file and I want to use a script to add some data to a table located on this remote database.

On the server SQLEXPRESS

there is a database called WeatherData (the SDE file is used to access this database)

and in this database there is a table called Weather1.

I'm currently using this script :

import os
import arcpy
from arcpy import env

directory = os.path.dirname(os.path.realpath(__file__))
arcpy.env.workspace = os.path.join(directory, "SqlServerConnect_UserAuthentication.sde")

table = "Weather1"
tableLocation = os.path.join(arcpy.env.workspace, table)

print arcpy.env.workspace
print tableLocation
print arcpy.ListTables()

arcpy.env.workspace and tableLocation are printed correctly, but arcpy.ListTables() print an empty list

C:\Users\...\ArcGISApp\SqlServerConnect_UserAuthentication.sde
C:\Users\...\ArcGISApp\SqlServerConnect_UserAuthentication.sde\Weather1
[]

which I guess means the script didn't find anything in the workspace. (or couldn't connect to it)

Afterwards, I just want to add some data to the table using another arcpy function

data = os.path.join(directory, "test.csv")
arcpy.Append_management (data, tableLocation, "NO_TEST")

Of course I get an error : (translated from french)

Traceback (most recent call last):
File "C:\Users\...\ArcGISApp\test.py", line 28, in <module>
arcpy.Append_management (data, tableLocation, "NO_TEST")
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 3785, in Append
raise e
arcgisscripting.ExecuteError: Execution Error. Incorrect parameters
ERROR 000732: Dataset C:\Users\...\ArcGISApp\SqlServerConnect_UserAuthentication.sde
does not exist or is not supported
Execution Error(Append).

So how I am I supposed to use the SDE file to access the database (and the table) correctly ?


texts: I am looking for a way to draw polygons with a fixed area. I am currently mapping farming options on field parcels. Some areas such as buffer strips run along features like rivers and hedgerows so they have easily mappable fixed lengths but I also need to create a fixed area for the feature which would govern the width. As hedges and rivers are rarely straight and farmers like to farm to straight lines the perimeter needs to be adjustable to create the most efficient use of space. Using QGIS 2.8.3 and ArcMap 10.3


texts: Script I made for pyQgis runs slow but can't find another way around it

texts:
registry = QgsProject.instance()

first_layer = registry.mapLayersByName('buffered')[0]
second_layer = registry.mapLayersByName('buffered')[0]

areas = []
instrument_number = "tin_ttl_in"
proprietor = "tin_ttl_re" #input field name for the registered proprietor

SLayerList = second_layer.getFeatures()

for first_feature in SLayerList:
    tempLayer =first_layer.getFeatures(QgsFeatureRequest().setFilterRect(first_feature.geometry().boundingBox()))
    for second_feature in tempLayer:
       if first_feature.geometry().overlaps(second_feature.geometry()):
           if (first_feature[instrument_number] == second_feature[instrument_number]) or (first_feature[proprietor] == second_feature[proprietor]):
            areas.append(first_feature.id())

first_layer.select(areas)

I'm having trouble with this script running very slow and I believe it could be because I'm making too many calls to getFeatures() or having a nested for loop? But I am not hugely experienced in Python or pyqgis (only started in the last month).

The data set I'm using currently only has around 35,000 polygons in it and it takes probably 20-30 mins to complete but I plan to be able to run this script on data sets of around 200,000 so definitely need some other option.

I'm not aiming to have this run in seconds as that's unrealistic, but do have a goal of having it run in around 5 minutes.


texts:
Is there a way to set GeoServer/GeoWebcache to cache on demand i.e. instead of having it tie the server up for days, whilst it caches millions upon millions of tiles, can it be set to cache tiles (to GWC cache directory on the server) as they are served?

That would mean, of course, that the first person to request tiles may have a  slower experience to start with but they and everyone else would be served cached tiles thereafter.


texts: Resample raster image, how to choose new resolution?

texts:
I know this is not a new question, and I know it depends on the context and what I would like to do with the data, but I am still finding it difficult to solve this problem in practice. And I haven't found any good answer online (this question was marked as possible duplicate, but I do not think this is the case, so I have modified my question, I hope it is clearer now).

For example: I have a raster image of modeled atmospheric N deposition for the whole world, with a resolution of 5 by 3.75 degrees. Now I would like to resample it to a finer resolution, say with cubic resampling from GDAL warp.

EDIT:
The reason I want to do this is that I would like to estimate N deposition per country. I understand I am introducing an error when I do any resampling, however as you can see in the image, the pixels are really quite large compared to the size of an average country.

Now I could run a zonal statistics on a world countries vector layer, using this raster image as it is. However, I suspect that my results would be of better quality if I resample the raster image first, to a higher resolution. If I am wrong, than please let me know and I will close this question myself.

Question: Can you please explain what logical steps and reasoning I should follow to decide the new resolution of the raster image? The aim here is to then run a Zonal Statistics on the higher resolution raster image, with a vector layer containing country boundaries.

I would like this to be an example of how to make such a decision, I don't care so much about the answer to this specific case.


texts: Writing where_clause to Select Layer By Attribute for Python Add-in?

texts:
I have an add-in script for a toolbox in ArcMap that lets a user select a data frame, a layer within it, a field from the layer, an operator (= , > , <, etc.), and a value from the field. I'm struggling to write a where_clause for the button class that is to execute the selection. I have global variables for each of the combo boxes, but I'm not unsure of how to translate the global variable for the field value to something usable in the Select By Attribute where_clause.

class OK(object):
"""Implementation for ok.button (Button)"""
def __init__(self):
    self.enabled = True
    self.checked = False
def onClick(self):
    mxd = arcpy.mapping.MapDocument("CURRENT")
    df = mxd.activeDataFrame
    arcpy.MakeFeatureLayer_management(layer, "layerSel")
    where_clause = "\"field\"= + '"+ valueS + "'"
    arcpy.SelectLayerByAttribute_management("layerSel","NEW_SELECTION",where_clause)
    df.zoomToSelectedFeatures()
    arcpy.RefreshActiveView()

layer, field, and valueS are the global variables for the user-chosen layer, field, and value, respectively.

This error appears when I run the script:

ExecuteError: ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute).

This I know has to do with the where_clause, I'm just now sure how to re-write it. I've read the Select Layer by Attribute article, as well as a few on SQL expressions, and I'm still very lost.


texts: Point data request from WMS, WFS, WCS using lat lon or station ID

texts: What is the best service to use when requesting data for a specific point?  For example we have graphical data that we can expose using any of the services.  If we want to build a request url that uses a lat/lon point or even an airport ID, which service would be optimal?  We want to provide known points within the request.


texts: How to customize the ArcGIS print legend text using javascript

texts:
Is there a way to customize ArcGIS print service so that it will not print the layer id and the string that is given in ClassBreakRenderer in the legend.

var layer = new FeatuerLayer(url, {
  id: "featureLayerId",
  opacity: 0.5
});

var renderer = new ClassBreakRenderer(null, "columnName");

var legendLayer = new LegendLayer();
lengendLayer.layerId = "featureLayerId";


texts: Making donut without updating id in MapInfo

texts:
I wont to make a donut out of an polygon in MapInfo. I store my data in Sql Server 2008 R2 and access it as a linked table. In SQL Server the Id-column is an Identity column that is used to as a primary key and is related as a foreign key in other tables.

My problem is when I try to make the donut the Id is reset to zero and when I save the changes it gets an new Id in the database, since I use the Id to connect to other tables you can se the problem. Is there a way to avoid resetting the Id?

Regards
Ulrik


texts: Splitting polygons with single shared vertex?


texts:
Does anyone know if it is possible to Calculate Geometry with Arcpy? I need to replicate the command > Right click field and Calculate Geometry except with Arcpy as I need to integrate this into my model.

Looking for some examples on how to do this.arcpy.CalculateField_Management("sample.shp", "LAT", "...X, Y", etc..
using ArcGIS 'Basic'


texts: SQLite / Geopackage and saving Geometry in ArcGIS

texts:
Has anyone successuflly created a layerfile (ArcGIS 10.4) to a dataset/table stored in a SQLite or Geopackage file?

Process of creating Layerfile: ArcMap TOC > Change Symbology > Right click > Create Layer file

It seems that everytime I drag in layerfile thats connected to either database, breaks or shows up but the attribue table wont work.

Adding the geometry straight in from either an SQLite of Geopackage doesnt seem to be an issue, its when I want to create symbology or categories that I would like saved for later use. Ideally I would like to create a layerfile for the Query Featureclass, though doesnt seem to ever want to work more than twice.

Seems to work no problem in QGIS as it looks better suppored, but ArcGIS is having a harder time using it.

Would love to hear from anyone who has done this succuessfully in ArcGIS 10.X


texts: Split polygons into equal areas within each region

texts:
I've a set of regions within a city. I'd like to split each region into five subregions and then get the centroid of each one of them.

I know how to make a vector grid, but the problem I have is that the generated points are not taking into account the regions, they're only related to the general map.

I have this:

And I want to split each region in five equal size areas. Something like this:

I'd like to build a visualization similar to this one: http://bl.ocks.org/mbostock/8814734. In order to accomplish that, I need to split each region, because the original ones are pretty big.


texts: What might be the discrepancy for a survey line originally projected in NAD83 over 500 metres if the high precision GPS unit is using a WGS84 projection? Is there a possible also a cumulative error with distance?


texts:
Has anyone ever put the results of a RelationshipQuery() into a map.infoWindow that's been replaced with a dijit.popup?

Here's the workflow:
User clicks a point, and all identify results are put into popup. <--this part is fine

I'm struggling with calling a relationshipquery, then putting the results into the infoTemplate.

The function findRelatedRecords performs 3 relationship queries and assembles an array of objects that are related to the single point. I cannot get this data back into the executeIdentifyTask function.

The function getWindowContent takes the relationshipquery array and converts it to html and constructs a dijit.tabcontainer & 2 contentpanes (tabs). It return the tabcontainer.domNode.

Any help? I'm really struggling!!

function executeIdentifyTask(evt) {
    facSel.clearSelection();
    identifyParams.geometry = evt.mapPoint;
    identifyParams.mapExtent = map.extent;

    var deferred = identifyTask.execute(identifyParams);

    deferred.addCallback(function(response) {

      // response is an array of identify result objects
      // Let's return an array of features.
      return dojo.map(response, function(result) {
        var feature = result.feature;
        console.log(result);
        //feature.attributes.layerName = result.layerName;
        if(result.layerName === 'parcel_area2'){
          //console.log(feature.attributes.site_code);
          var template = new esri.InfoTemplate("", "${site_code} <br/> Owner of record: ${facil_loca}");
          feature.setInfoTemplate(template);
        }
        else if (result.layerName === 'logistics2'){
          var template = new esri.InfoTemplate("", "Parcel ID: ${Type}");
          feature.setInfoTemplate(template);
        }
        else if (result.layerName === 'query2'){
            findRelatedRecords(feature,evt) //<--get relationship query results here
            var template = new esri.InfoTemplate("", getWindowContent(data,evt.graphic));
            feature.setInfoTemplate(template);

        }
        return feature;
      });
    });
    // InfoWindow expects an array of features from each deferred
    // object that you pass. If the response from the task execution
    // above is not an array of features, then you need to add a callback
    // like the one above to post-process the response and return an
    // array of features.
    map.infoWindow.setFeatures([ deferred ]);
    map.infoWindow.show(evt.mapPoint);

  }


texts: How to move labels (from map exports) using program like photoshop?

texts:
In the past, I have exported from QGIS composer some maps in .pdf and some in .png.

In those exports I release to have some wrong (placed) labels and I have I release to lose the QGIS projects where I use for exports and is very hard to start again with to take some results.

Can I use some program like Photoshop,illustrator,GIMP,adode pdf pro,Adobe Creative Suite,adobe illustrator cs6 to move that wrong labels to other place in map?