texts: Creating if-else condition with ArcGIS API for JavaScript combo boxes?

texts:
I have an ArcGIS JavaScript API Web App that uses multiple combo boxes.  I would like to create an if-else conditional statement between two fields in my feature layer.  If one field is chosen in combo box one is 1  then combo box three should automatically populate to 3.

Below is my validate function for my request type.

 function changeonevent() {
  (dijit.byId("cbRequestType").on('change'), changeonevent (MFValue) {
    if (MFValue == 'Electronic Waste') {
   dijit.byID("cbMFSubType"). set ('value', 'Copy Machine');
   } else if MFValue == '...'{
   dijit.by.ID('cbMFSubType').set('value', 'Printer');
   }


texts: City Engine: Align Terrain to Shapes - Purpose?

texts:
What is the purpose of aligning the terrain to shapes, if I have already aligned my shapes to the terrain?
In my understanding, the terrain is a reference surface, and therefore I wouldn't want to shift it.


texts: Directional Buffer increasing radius of geometry

texts:
I have a bunch of polygons in the shape of a pie in a geopandas df under geometry as seen below and I am looking at increasing the radius from x to y of the polygons.

Can this be done using geopandas or shapely?
I am not sure where to start with this.
import pandas as pd
from shapely.geometry import Point, LineString, Polygon
import geopandas as gp

data = [[1,72.774906,27.620367],[1,72.983647,27.707941],[1,73.148441,27.785725],[1,73.280277,27.853741],[1,73.401127,27.921714],[1,73.467045,27.795445],
[1,73.510990,27.737117],[1,73.521977,27.659298],[1,73.500004,27.581423],[1,73.478031,27.552206],[1,73.467045,27.503493],[1,73.434086,27.454759],
[1,73.412113,27.406003],[1,72.774906,27.620367]]
df_poly = pd.DataFrame(data, columns = ['poly_ID','lon', 'lat'])

lat = df_poly.lat.tolist()
lon = df_poly.lon.tolist()

polygon_geom = Polygon(zip(lon, lat))
crs = {'init': 'epsg:4326'}
polygon = gp.GeoDataFrame(index=[0], crs=crs, geometry=[polygon_geom])

import folium
m = folium.Map([50.854457, 4.377184], zoom_start=5, tiles='cartodbpositron')
folium.GeoJson(polygon).add_to(m)
folium.LatLngPopup().add_to(m)
m


texts: Calculating point layer values within polygon features in QGIS 2

texts:
There are two layers

polygon 'BereichBerechnung' with a field "Are_Number"
points 'EW2017' with a field "EWjeAdr"

In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for points that are within each feature from the layer 'BereichBerechnung'.
I have found Updating field to give count of points in polygon using STIntersects? which seems related but I cannot figure out how to adjust my expression properly.
With this code:
SELECT Are_Number, SUM(EWjeAdr)
FROM BereichBerechnung
JOIN EW_Data ON BereichBerechnung.ogr_geometry.STContains(EW2017.ogr_geometry) = 1;
GROUP BY Are_Number

I am getting the following error:

How can I do it?


texts: Using individual bands from multi-band image in ArcGIS raster calculator?

texts:
I'm trying to use individual bands from a multi-band TM image (IMG file) within the raster calculator in ArcGIS 10 (SP2/3).

I can add individual bands to my MXD, but raster calculator will only use Band 1 regardless of how I reference the layers from the MXD.

Using something like "TM_Image.img - Layer_3" - 0 in the raster calculator will run, but will use Band 1.

Using the full path to the image works correctly but is unwieldy for longer expressions/paths.  Like "X:\TM_Image.img\Layer_3" - 0

I think this worked in earlier versions of Arc 10, but no longer on SP 2 or 3.


texts: Raster image error when entering stack layers using Rstudio

texts:
I am a beginning user of Rstudio, and
I want to run Random Forest by using a couple of "raster layers" which were stacked in ENVI.
Before doing stacking I checked the cell size and the columns and rows numbers in GIS which they all had the same cell size and the columns and rows numbers. My data contains slope, aspect, landuse, geology, etc.
The main problem is that the following error happens whether I entered just one raster layer or whole layer as a stack layer I face with the error
library(rgdal)
Loading required package: sp
rgdal: version: 1.5-12, (SVN revision 1018)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
Path to GDAL shared files: C:/Program Files/R/R-4.0.2/library/rgdal/gdal
GDAL binary built with GEOS: TRUE
Loaded PROJ runtime: Rel. 6.3.1, February 10th, 2020, [PJ_VERSION: 631]
Path to PROJ shared files: C:/Program Files/R/R-4.0.2/library/rgdal/proj
Linking to sp version:1.4-2
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
library(sp)
library(raster)
library(caret)
Loading required package: lattice
Loading required package: ggplot2
library(lattice)
library(ggplot2

library(readr)
img1 <- read_csv("E:/Topic_sinkholes/Final data/stack layers/img1.hdr")
Parsed with column specification:
cols(
  ENVI = col_character()
)
Warning: 8 parsing failures.
row col  expected     actual                                                  file
 12  -- 1 columns 11 columns 'E:/Topic_sinkholes/Final data/stack layers/img1.hdr'
 13  -- 1 columns 23 columns 'E:/Topic_sinkholes/Final data/stack layers/img1.hdr'
 16  -- 1 columns 3 columns  'E:/Topic_sinkholes/Final data/stack layers/img1.hdr'
 17  -- 1 columns 2 columns  'E:/Topic_sinkholes/Final data/stack layers/img1.hdr'
 18  -- 1 columns 3 columns  'E:/Topic_sinkholes/Final data/stack layers/img1.hdr'
... ... ......... .......... .....................................................
See problems(...) for more details.

This error happens even when I enter layers with TIFF format

I tried the suggested direction from the comments, but the problem still remains:

library(raster)
library(readr)
img1 <- read_csv("E:/Topic_sinkholes/Final data/stack layers/img1.img")
Parsed with column specification:
cols(
EHFA_HEADER_TAG = col_character()
)
Warning: 153556 parsing failures.
row             col  expected        actual                                                  file
1 EHFA_HEADER_TAG           embedded null 'E:/Topic_sinkholes/Final data/stack layers/img1.img'
1 NA              1 columns 222 columns   'E:/Topic_sinkholes/Final data/stack layers/img1.img'
2 EHFA_HEADER_TAG           embedded null 'E:/Topic_sinkholes/Final data/stack layers/img1.img'
3 EHFA_HEADER_TAG           embedded null 'E:/Topic_sinkholes/Final data/stack layers/img1.img'
3 NA              1 columns 2 columns     'E:/Topic_sinkholes/Final data/stack layers/img1.img'
... ............... ......... ............. .....................................................
See problems(...) for more details.

View(img1)
raster()
class      : RasterLayer
dimensions : 180, 360, 64800  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs


texts: Make holes in a polygon from existing smaller polygons

texts:
In QGIS, I have a layer of polygons which represent forested area, captured from an old paper map, that I have converted from polylines. See my screenshots below. The forest area has holes in its coverage. The polylines defined the edges of those holes.  Unfortunately, the conversion from polylines, which I did in QGIS using Vector > Geometry Tools > Lines to polygon, cannot be configured to sense that a nested polygon must be a hole within the larger polygon. It simply filled all closed polylines regardless of nesting.

To manually cut the holes, I have tried to use the ‘Add Ring’ feature on the Advanced Digitizing Toolbar. This has not worked for me. So here are my questions:

1). Is there a way to ‘Add Ring’ in a larger polygon using an existing smaller polygon as a ‘cookie-cutter’, or must one always use the Add Ring tool by actively drawing a new closed line, vertex-by-vertex, with the tool’s cursor?

2). Is there a way to cut a bunch of such holes in one single operation, perhaps by dragging a selection box over a wider area and applying the cutting operation to all polygons within it?

3). If neither these processes are possible, can someone suggest another workflow to achieve the same thing within QGIS, or else confirm that QGIS is unable to do this.

This topic has not been answered fully here before. There is a GIS StackExchange thread
How to create a hole in a polygon in QGIS?
which neither discusses how to use an existing polygon to cut a hole in a larger polygon, nor does it offer any way to cut many holes at once. It does not answer my question. I am asking a new question here.

Finally, I wouldn't want anyone to get hung up on the specifics of this example, so I better say that although you might inspect my screenshot of the forest cover on the original map cover and see it has few 'donut holes', the raster conversion had to contend with a lot of noise, so that the resulting vectors tended to join up and have far more donut holes. None of these little details are essential to the general questions I'm asking above.

Screenshots:

1. Portion of the georeferenced paper map showing forest cover

2. Polylines created from an edge-detected raster to vector conversion

3. Polygons created by QGIS ‘Lines to polygon’ command


texts: ArcGIS Server GP Service: How to create a txt file or rename a dbf to txt in the "%SCRATCHWORKSPACE%"

texts:
My end goal is to get an excel (I'll probably just settle for .csv) file loaded from a silverlight app into my "%SCRATCHWORKSPACE%" for my gp service.  I will be linear referencing the data onto a polyline.

I have silverlight reading the csv file's contents and packing it into a string to send over to ArcGIS Server.

Then I want to write this data to a csv file in the "%SCRATCHWORKSPACE%".  But I don't seem to be able to use any standard python code to hit the "%SCRATCHWORKSPACE%".

Any thoughts or critiques?


texts: Displaying labels from a lower zoom level?

texts:
In QGIS, is there a way to "pin" labels and features from a lower zoom level so that they appear higher up?

For instance, considering a map of the US, it would be impossibly cluttered to show every local road and town on a national scale. What if for instance, I wanted to take a specific road and the cities along it, and pin their labels such that these few features appeared even on a national scale? For example, could I take the section of I90 that runs through South Dakota and ensure that it and each town along the road appeared at all zoom levels?

I'm using QuickMapServices for base maps, but suspect this is something that can be done more generally if at all.


texts: How to display a picture in QGIS custom form?

texts:
I'd like to integrate an UI file as a form in QGIS 2.8. The UI file is created in QT Designer.
One of the attributes in the attribute table is a filepath to an image. I'd like to display the picture in the form instead of the filepath. I created lineEdits for each attribute and named them properly, so everything works well, except for the picture.

I load all the layers from my Qgis plugin and I set "Photo" as an EditType for that attribute in the script (You can find it also in layer Properties/Fields). So when I choose "Autogenerate" form, the picture is displayed correctly.

Could anyone give me a hint how could I make the form work correctly?


texts: Using external table to iteratively change parameters into ArcPy code

texts:
I am working with Python 2.7 and ArcPy under Jupyter notebook environment. I would like to adapt iteratively my code to a reference table.
This is my reference table which contains the 3 variables that I use for the tool I am running in ArcPy:
RegY          HunCal    CRY
    1            1718     BL1
    1            1112     JU1
    1            1112     JU1
    1            1213     JU1

This is a simple XLS table which I imported to my Jupyter notebook. I have it as a visual reference for when I have to change these variables in my code.
In the beginning, I was doing it by hand because they were a few changes to make. But now there are more than 150 changes to adapt, and, this amount increases with time. Therefore, I would like to modify the code in such a way that it uses the reference table to iterate through every feature each time the reference table changes.
This is the code I am using:
# 2011
# Set geoprocessor object property to overwrite existing output
arcpy.gp.overwriteOutput = True

arcpy.env.workspace = r'C:\Users\GeoData\simSear\SBA_D.gdb'

# Process: Group Similar Features
SS.SimilaritySearch("redD_RegY_1_1112","blackD_CRY_JU1_1112","SS_JU1_1112","NO_COLLAPSE",
                        "MOST_SIMILAR","ATTRIBUTE_PROFILES",0,
                        "Temperatur;Precipitat", 'DateFin')

How can I adapt the code in such a way that the variables from the reference table are inserted into my code in the following way?
From the reference table, the values from RegY would be replaced in redD_RegY_**1**_1112. The values from CRY would be replaced in blackD_CRY_**JU1**_1112 and SS_**JU1**_1112 and finally, the values from HunCal would be replaced in redD_RegY_1_**1112**, blackD_CRY_JU1_**1112**,SS_JU1_**1112**.


texts: Make polygon from area not covered by loaded polygons (like invert selection)

texts:
See screenshot, from geojson.io, with a geojson file loaded:

So how do we make a polygon out of the blank area? Looking for a way which doesn't involve manually copying selected sequences of co-ordinates from each enclosing polygon's edge. But if we can automate that, awesome!

Obviously the solution would involve specifying a bounding box limit, so we don't polygon the planet.

Some kind of proximity detection could be a way to go : enlist lines (ie, pair of sequential co-ordinates) which don't have any close-by counterparts in the other polygons loaded. Just an idea.

Guess I'm wishing for an "invert selection" like feature ;)


texts: Is there a way to hide range categories using Python code on a vector layer?

texts:
I have a routine to create a layer with 6 categories (see 1st graph) based on the values of the attributes. Is there a way I can hide the categories (see the 2nd graph) using Python code?

def mapRange(layerName, fieldName):

    #https://gis.stackexchange.com/questions/31789/setting-color-of-feature-depending-on-attributes-with-pyqgis
    layerCat = QgsProject.instance().mapLayersByName(layerName)[0]

    values = (
    ('0.0-0.2', 0.0, 0.2, 'red'),
    ('0.2-0.4', 0.2, 0.4, 'orange'),
    ('0.4-0.6', 0.4, 0.6, 'yellow'),
    ('0.6-0.8', 0.6, 0.8, 'green'),
    ('0.8-1.0', 0.8, 1.0, 'blue'),
    ('Dry', -9999, -0.001, 'gray'))

    # create a category for each item in values
    ranges = []
    for label, lower, upper, color in values:
        symbol = QgsSymbol.defaultSymbol(layerCat.geometryType())
        symbol.setColor(QColor(color))
        #https://gis.stackexchange.com/questions/200094/how-to-define-border-colour-for-rule-based-style-using-pyqgis/220662
        layer_style = {}
        layer_style['color'] = color
        layer_style['color_border'] = color
        symbol_layer = QgsSimpleFillSymbolLayer.create(layer_style)
        if symbol_layer is not None:
            symbol.changeSymbolLayer(0, symbol_layer)

        rng = QgsRendererRange(lower, upper, symbol, label)
        ranges.append(rng)

    #create the renderer and assign it to a layer
    renderer = QgsGraduatedSymbolRenderer(fieldName, ranges)
    layerCat.setRenderer(renderer)


texts: How to flash a graphic in JSAPI using AMD

texts:
With the code below I was hoping to flash the selected polyline, however no success.

function flashResults(featureSet) {
alert("flash");
//remove all graphics on the maps graphics layer
map.graphics.clear();

//assign featureSet array to a single variable.
var resultFeatures = featureSet.features;

//Loop through each feature returned
for (var i = 0, il = resultFeatures.length; i < il; i++) {
    //Get the current feature from the featureSet.
    //Feature is a graphic
    var graphicFlash = resultFeatures[i];

    // allow different symbols
    markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND, 28,
    new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
    new dojo.Color([255, 255, 255]), 2),
    new dojo.Color([255, 0, 0, 0.85]));
    lineSymbol = new esri.symbol.CartographicLineSymbol(esri.symbol.CartographicLineSymbol.STYLE_SOLID,
    new dojo.Color([0, 255, 255]), 10, esri.symbol.CartographicLineSymbol.CAP_ROUND,
    esri.symbol.CartographicLineSymbol.JOIN_MITER, 5);
    fillSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
    new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
    new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.85]));

    // figure out which symbol to use
    if (graphicFlash.geometry.type === "point" || graphicFlash.geometry.type === "multipoint") {
        symbol = markerSymbol;
    } else if (graphicFlash.geometry.type === "line" || graphicFlash.geometry.type === "polyline") {
        symbol = lineSymbol;
    } else {
        symbol = fillSymbol;
    }

    graphicFlash.setSymbol(symbol);

    //Add graphic to the map graphics layer.
    map.graphics.add(graphicFlash);

    var shape = graphicFlash.getDojoShape();
    var animStroke = fx.animateStroke({
        shape: shape,
        duration: 500,
        color: {
            end: new dojo.Color([0, 0, 0, 0])
        }
    });
    var animFill = fx.animateFill({
        shape: shape,
        duration: 500,
        color: {
            end: new dojo.Color([0, 0, 0, 0])
        }
    });
    var anim = dojo.fx.combine([animStroke, animFill]).play();
    var animConnect = dojo.connect(anim, "onEnd", function () {
        map.graphics.remove(graphicFlash);
    });
}

}


texts: Leaflet: Show/Hide Symbols Loaded from a Style File

texts:
I have a project that uses an OSM2VectorTiles map with Leaflet through the library, mapbox-gl-leaflet, in order to load my own locally-hosted style file.  I edited the style file in Mapbox Studio to get it how I wanted it, but now I'm trying to programmatically show and hide certain labels and symbols originating from that file via Leaflet.  I thought I had it with

var gl = L.mapboxGL({
    style: 'styles/bright-v9.json',
    accessToken: 'no-token'
}).addTo(map);

gl._glMap.style._layers.place_label_city.layout.visibility = 'none';

but that only has an effect if it's called before the map fully loads in the browser (it does nothing when I stick it inside a jQuery .on handler).  My intent is to be able to show and hide the city labels via the Leaflet control.  Is it even possible to do this with data contained in the style file?


texts: Transferring MapInfo TAB to PostGIS using FME?

texts:
I am using FME to try and  transfer hundreds of MapInfo TAB files into PostGIS.

I know how to get the tables into PostGIS using FME but  I cannot work out how to transfer the styles of the MapInfo tables over.

For example, council owned land has a style of red polygons in my MapInfo TAB file, I want to keep those saved red polygons when taking the layer to PostGIS but I lose the style of the layer in the process.

Does anyone know what I am missing?


texts:
I've scripted my own wps for GeoServer using the GeoScript Groovy API. I can make a request from inside GeoServer and the process runs smoothly. I'm now trying to use the process as a rendering transformation but am having trouble.

The GeoServer log says:

Caused by: java.sql.SQLException: org.postgresql.util.PSQLException: ERROR: parse error - invalid geometry
  Hint: "POLYGON ((-?" <-- parse error at position 12 within geometry

After doing some digging through the GeoServer docs, I found a section on query rewriting which mentions that this might be necessary for "controlling query optimizations (for instance, ensuring that geometry decimation does not prevent point features from being read)". However, there is no example on how to do this.

I looked in the geotools heatmap code and found an invertQuery method, but this is only my second time writing code and I don't understand what it's doing or how it's used. I tried putting the following in my script but it didn't help.

public Query invertQuery(

        Query targetQuery, GridGeometry targetGridGeometry) throws ProcessException {

    targetQuery.setProperties(null);

    Hints hints = targetQuery.getHints()
    hints.put(Hints.GEOMETRY_DISTANCE, 0.0)

    return targetQuery

So, what the heck is geometry decimation? and how can I amend the above code to avoid the invalid geometry error?

The geometry is in PostGIS if that helps

Edit:

When using the GEOTOOLS_DEVELOPER_LOGGING properties I find the following request:

SELECT "id","name","species","bto_code","mass","incubation_days","rearing_days","ad_inc_dist","fid_inc_dist","ad_rer_dist","fid_rer_dist","buff_inc_dist","buff_rer_dist","date_start","date_end","live_dist","conservation_score","legal_dist",encode(ST_AsEWKB("the_geom"),'base64') as "the_geom" FROM "birds_other"."birds_tst_view" WHERE  "the_geom" && ST_GeomFromText('POLYGON ((-? -?, -? ?, ? ?, ? -?, -? -?))', 27700)

So it does indeed look like a bad query as I'm styling a points layer. How do I fix this? The query is automatically generated, so it's not obvious to me.


texts: QGIS Finding valves to turn off for water lines

texts:
I am wondering if there is a tool for QGIS that can do what I am about to describe. It might be in network analysis but I am not sure. I have used water gems but it does not do what I want it to do.

Lets say I have a network of water lines. These water lines all have valves. Now, lets say I have to fix a certain spot on one line and I need to know all the valves that needs to be turned off to shut off the water to that line so the men can work on that line.

How can this be done?

What would be nice is that I am able to chose the line and point where the breakage is located and it tells me all the valves that need to be turn off to stop the water.

Any idea if there is a tool like that already or even how could we do this with  Python?


texts: How to compare two DEMs and show their difference?

texts: I want to compare my DEMs with each other (ASTER GDEM2 and SRTM4.1). I know, that the GDEM has some "holes" with wrong elevations (I found 3 of them in my working area). Now I need to know, if there are more of them to eventually correct them with the SRTM. I use SAGA, GRASS and QGIS.


texts: World map shapefile including disputed areas

texts:
I am looking for a global shapefile that allows you do show data for all disputed areas (like Waziristan, Spratlay Islands, Kahsmir, etc.). Do you have any idea where I can find a shapefile with not only the recognized countries but all disputed territories as well? Thanks a lot for any helpful input!

Stephanie


texts: Clustering markers from GeoJSON after adding data to layer in Leaflet

texts:
I am trying to add clusters in my leaflet map. I use overlayMaps which helps to choose one of the active layers, and in that case I want my marker to be a cluster. But it is not clustering. Again  when I am trying with making any overlayMaps variable and put all the data its working the marker are cluster.
I want to show cluster in the map when the layer is active.
Plugin used: https://github.com/Leaflet/Leaflet.markercluster
var cluster = L.markerClusterGroup();
var geo = L.geoJSON(dataview, {
  onEachFeature: function (feature, layer) {
    layer.bindPopup(feature.properties.tags.name);
  },
});
geo.addTo(cluster);
var overlayMaps = {
  tourism: tourism,
  hospital: geo,
};
//add the layer control option
L.control.layers(baseMaps, overlayMaps).addTo(map);


texts: Installing v.stream_order on GRASS 7.8.3 on MacOS

texts:
I am trying to install the v.stream.order add on in GRASS and get the following error:
ERROR: GRASS Addons <v.stream.order> not found

This happens with all of the extensions I have tried to install. I have seen on other forums that it might be network error, but those are from a few years ago.


texts: In ArcMap 10.3 I need to overlay a grid on my data sets where each cell is 1 square mile. I do not need the fishnet using geographic coordinates, just simply a grid of 1 square mile placed over the shapefiles and rasters being used.


texts: Is it possible to block a data set programmatically through the API in Carto?

texts:
We are automating the creation of data sets with Carto. Now we would like to be able to lock to avoid unwanted changes in the data.

We know that this can be done through the dashboard, but is it possible to do it through the API? We do not find this in the documentation.


texts: How to set vector symbol outline properties in pyqgis 3?

texts:
I have a polygon vector layer and I want to style it within a processing script. Part of the code creates a categorized symbology for my layer but I cannot find a reference online on how to access the properties of the stroke/border. I have checked the documentation here and I can only find setColor and setOpacity functions which I have used.

    scenarios = {}
    for i, fld in enumerate(fld_names):
        #attribute_value = (color, label)
        scenarios[fld] = (colors[i%2], fld)

    categories = []
    for attr, (color,label) in scenarios.items():
        symbol = QgsSymbol.defaultSymbol(lyr.geometryType())
        symbol.setColor(QtGui.QColor(color))
        #symbol.setOpacity(0.5)
        category = QgsRendererCategory(attr, symbol, label)
        categories.append(category)

    renderer = QgsCategorizedSymbolRenderer('SCENARIO', categories)
    lyr.setRenderer(renderer)
    lyr.setOpacity(.5)
    lyr.triggerRepaint()


texts: Splitting lines that are not contiguous (Creating a leak detection dataset)

texts:
I am having trouble with one of the steps of a very long model. The goal is to generate a dataset of the water lines that have been "inspected" by our leak detection devices.  The devices supposedly will "inspect" all pipe that is 500 feet from the detector, as long as it is connected within that 500 foot buffer.  See attached image.  The green star represents a leak detection device.  The resulting inspected pipe will be all pipe within the circle (500 foot buffer) except the ones highlighted in yellow because they connect outside of that 500 foot buffer.  I have tried many ways to achieve this in a model (I need to run this weekly for 3000 miles of pipe), but cannot find an automated way of doing this.  My plan was to merge the pipe that is inside the buffer, then remove the sections that are not contiguous with the portion that intersects with the leak detection point, but I have not found a way to do that.
Anyone have any thoughts on this?


texts: Checking accuracy of IDW using ArcGIS Desktop?

texts:
I performed IDW using ArcGIS on 121 evenly distributed samples and generated a surface.

How do I check the accuracy of the method?


texts:
I am currently evaluating CartoDB(and really happy with it), and am trying to setup a proof of concept of a secure map.

I would like to implement a tile proxy, but really don’t know where to start.

I understand we can use this:

https://github.com/javisantana/cartodb-tiles-proxy a nd possibly node.js.

I am trying to create a map with an overlay that is accessed through some kind of web portal that users can filter polygons based on numerical sliders/web inputs.

It’s important that users can’t see the data in the tables.

Are there any guides out there?


texts: Using wildcard condition to find mean value from table in ArcPy?

texts:
I have a feature class with 20 fields and 13 of them have datas from year 2003 to 2015. I create a new field named 'mean' which will calculate the mean value only for the values from 2003 to 2015. All this fields has a equal sufix named 'ACH'. Here is the problem: I tried many ways to do the mean in the new field, using wildcard, but the script complete with no errors but do not calculate.

It`s not the mean from the column itself. I need to sum all the columns and divide in the new 'mean' fild, with this I will get the mean value for each cell.

What`s the best way to do?

I found some ways, but no one using wildcards.

import arcpy, math

featureclass = arcpy.GetParameterAsText(0)
field_names = [f.name for f in arcpy.ListFields(featureclass, '*ACH*')]

if field_names == '*ACH*':

     x = sum([a for a in [0,  !field1!, !field2!, !field3!, !field4!] if a is not None] ) / max([1,len([a for a in [ !field1!, !field2!, !field3!, !field4!] if a is not None] )])

arcpy.AddField_management(featureclass, 'mean', 'float')
arcpy.CalculateField_management(featureclass, 'mean', '!x!' , "PYTHON_9.3", "")

Here is the table. There is many others fields in  the table, but I want to calculate only the mean from the fields ACH_M1S_20XX (XX representes the year) tha preffix is ACH. I only want to calculate the values from all years, and put in a new field called mean.

field1 + field2 + .... + fieldX / field quantities = mean. there is a value for each cell in the line. remember, it`s not the column mean, is the line mean.


texts: Postgis How to populate column with geography data from geometric data?

texts:
I stored my point date in geometry format with SRID 4326 supposed EWKB (data looks like this "0101000020E610000071F1A611E9392640AECD10D8E68C4A40") =  way geometry(Point,4326)
I want to have the coordinates in geography format. So what to do?
So far I created another column for it:

ALTER TABLE brb_point ADD COLUMN geography geography(POINT,4326);

With this I get the coordinates shown:

ST_AsEWKT(way) from brb_point;

But I do not get along with the second step: populating the new column 'geography' with data from 'way' showing the coordinates with lon, lat.
Trials like this led nowhere:

UPDATE brb_point SET geography = ST_GeomFromEWKB((way), 4326);

I found a similar question here and here, but I'm not sure how to use it in my case.


texts: Can you map with numbers and words in the same column?

texts:
I have a column in my .dbf file that is a mixture of gradually increasing numbers but also a word for all of the items that don't match the criteria, for example:

**JUNIOR_PRI,N,4,2**
3.9
2.44
1.38
2.73
0
Non
Non
0

I didn't want to make the 'Non's a number, because then it would throw off my graduated color ramp if it took those into account; that's why I wanted to have the numbers ramp from yellow to blue, and then make the 'Non's all the same color -- like red. But when it goes into the GIS attribute table, it resets all my 'Non's to zeros. Is that because you can't mix numbers/words in a column?

And is it possible to do my initial thought -- or would I have to make another column with all the 'Non's in that one so I could overwrite the blanks from my "JUNIOR_PRI,N,4,2" column?


texts: Overlay two linestring objects in geopandas, accounting for the attributes

texts:
This is a follow up to Intersecting MultiLinestring based geodataframes with geopandas? in which I was trying to intersect polyline layers and carry the attributes over to a resulting overlay/intersected layer. I did receive a response to this previous question but unfortunately was not able to extend the code provided to this more realistic and complex 2 dimensional case. Ultimately I would like to perform this for large shapefiles with thousands of segments carrying many attributes.

My new limited working example is as follows:

In the above figure red nodes are vertices, black lines are line segments, blue letters/numbers are attributes for each segment, and black numbers are the lengths of each line segment. Notice that the bottom figure is an intersection of both geometry and attribute data. Here are the wkt strings for the top left figure:

MULTILINESTRING ((0 0, 6.656423206909781 4.437570291332059))
MULTILINESTRING ((6.656423206909781 4.437570291332059, 8.070636769282876 5.851783853705154))
MULTILINESTRING ((8.070636769282876 5.851783853705154, 14.33789797945475 13.64417995012345))
MULTILINESTRING ((6.656423206909781 4.437570291332059, 10.98655022583197 1.937570291332059))
MULTILINESTRING ((10.98655022583197 1.937570291332059, 13.68293236472948 0.6224568509648269))
MULTILINESTRING ((13.68293236472948 0.6224568509648269, 17.54663566988575 -0.412819329445256))
MULTILINESTRING ((17.54663566988575 -0.412819329445256, 18.41266107367019 -0.912819329445255))

Here are the wkt strings for the top right figure

LINESTRING (0 0, 4.160264504318614 2.773481432082537)
LINESTRING (4.160264504318614 2.773481432082537, 6.656423206909781 4.437570291332059)
LINESTRING (6.656423206909781 4.437570291332059, 8.070636769282876 5.851783853705154, 9.950815132334437 8.189502682630641)
LINESTRING (9.950815132334437 8.189502682630641, 13.08444573742037 12.08570073083979)
LINESTRING (13.08444573742037 12.08570073083979, 14.33789797945475 13.64417995012345)
LINESTRING (6.656423206909781 4.437570291332059, 10.98655022583197 1.937570291332059, 10.98655022583197 1.937570291332057)
LINESTRING (10.98655022583197 1.937570291332057, 13.68293236472948 0.6224568509648269, 15.61478401730761 0.104818760759786)
LINESTRING (15.61478401730761 0.104818760759786, 17.54663566988575 -0.412819329445256, 18.41266107367019 -0.912819329445255)

Running this through the script provided by @Jon in their answer to Intersecting MultiLinestring based geodataframes with geopandas?
gives the following result (only geometry is shown)

LINESTRING (0 0, 4.160264504318614 0)
LINESTRING (4.160264504318614 0, 6.656423206909781 0)
LINESTRING (6.656423206909781 0, 8.070636769282876 0)
LINESTRING (8.070636769282876 0, 9.950815132334437 0)
LINESTRING (9.950815132334437 0, 10.98655022583197 0)
LINESTRING (10.98655022583197 0, 10.98655022583197 0)
LINESTRING (10.98655022583197 0, 13.08444573742037 0)
LINESTRING (13.08444573742037 0, 13.68293236472948 0)
LINESTRING (13.68293236472948 0, 14.33789797945475 0)
LINESTRING (14.33789797945475 0, 15.61478401730761 0)
LINESTRING (15.61478401730761 0, 17.54663566988575 0)
LINESTRING (17.54663566988575 0, 18.41266107367019 0)

Which is a straight line, and thus incorrect.

How can I accomplish this operation using python and preferably shapely or geopandas? If shapely and geopandas are not suitable tools, which are the suitable tools for this?

It is very important for me to carry the attributes over as well.


texts: No Data Holes in Certain Tiling Scheme Levels in Mosaic Dataset Imagery Cache

texts:
I have a mosaic dataset containing three other mosaic datasets (one containing county imagery, one containing regional imagery, and one containing city imagery) I have them ordered by putting the county at the bottom (25 cm resolution), then regional (10 cm), then city (10 cm). County covers the same extents as the regional and city imagery, but the regional and city imagery is placed overtop the county imagery to use the better resolutions in their respective areas.

Each set of images are in their own mosaic dataset, and added each of them into a fourth master dataset. I created the overviews and tried to create the cache with a tiling scheme 1:577,791 - 1:564:

When I try and create a cache to publish online, the tile levels for 1:2,257 has a strange set of discoloured strips:

and the tiles at 1:1,128 and 1:564 are partially empty:

Any ideas on how to fix this?


texts: Importing csv file with varying numbers of values per row into PostgreSQL?

texts:
I am trying to import a csv file into postgres using this statement:

COPY T00_import FROM E'C:\\temp\\CSV\\Aberdeen City 9051_20150212_C_01.csv' CSV;

The Table T00_import is a simple table with 17 fields, all set to varchar(100). The csv does not have a header and the first row only has 9 values, rows further down have up to 17 values (columns). Postgres is giving me this error:

    ERROR:  missing data for column "field10"
CONTEXT:  COPY t00_import, line 1: "10,"Aberdeen City Council",9051,2015-02-12,1,2015-02-12,111245,1.0,"C""
********** Error **********

ERROR: missing data for column "field10"
SQL state: 22P04
Context: COPY t00_import, line 1: "10,"Aberdeen City Council",9051,2015-02-12,1,2015-02-12,111245,1.0,"C""

I have tried identifying the Null string but this did nothing. It should be easy to fix this, but I can't find how.


texts: Alternative to Generate Near Table in ArcMap 10.2

texts:
I want to get the distance between each polygon in one layer (each rectangle in a fishnet grid over the area in question) and the nearest polygon in another layer, but "Generate Near Table" never finishes. Because I am limited to using school computers I can't allow the program to run continuously long enough to finish. Any ideas for a workaround or another tool I can use to gather the same information?

I do have the "nearest only" box checked. Within each grid cell are aggregated points. I need the distance from the grid cell to the nearest park (polygons in another layer file). That data will be joined to an existing table and used as a potential explanatory variable in an OLS regression analysis, in which the dependent variable is number of points within the grid cell.


texts: Problem with importing GeoTif files in QGIS

texts:
I have installed the new version of QGIS (2.12) and the newest OSX version (El Capitan).
When I tried to open GeoTif files with QGIS, it always crashed!
Then I tried an older version of QGIS (2.8) and the same problem appeared!
I don´t know what to do know and I hope there is anybody who is good with QGIS and MAC!


texts: How to rasterize a vector data with style

texts:
I want to make a utility in c++ which can rasterize vector data with some specified style. I know about gdal_rasterize. But the problem with it is, we cannot specify the style details. Do we have a library using which i can make this utility? If no libraries available then what is the best method to do the same?

Thanks in Advance


texts: "IndexError: list index out of range" when trying to add coordinates to an array

texts:
I am trying to reconstruct a car's path from some GPS coordinates given in a CSV file. I created an empty array to add the X and Y values (lat, long) and create the lines using it but I am getting an IndexError: list index out of range for the lat= line[latIndex] part.

I am unsure what I am doing wrong. I am still fairly new to Python and coding so bear with me here please. Here is my code:

import arcpy
import csv

arcpy.env.workspace = r"C:\data"
arcpy.env.overwriteOutput= True
FilePath= open(arcpy.env.workspace + "\GPSTrack.csv", "r")
shapefile_line= "carPathLine.shp"
arcpy.CreateFeatureclass_management(arcpy.env.workspace, shapefile_line, "POLYLINE")

spatialRef = arcpy.Describe(shapefile_line).spatialReference

csvReader = csv.reader(FilePath)
headerLine= next(csvReader)

with FilePath as pointFile:
    csvReader = csv.reader(pointFile)
    header= next(csvReader)

    latitude_Index= header.index("Latitude")
    longitude_Index = header.index("Longitude")

    coord_pairs= arcpy.Array()

    for coord in csvReader:
        lat= coord[latitude_Index]
        lon= coord[longitude_Index]

        coord_list= arcpy.Point(lon,lat)
        coord_pairs.add(coord_list)

    with arcpy.da.InsertCursor(shapefile_line, ("SHAPE@")) as cursor:
        # Create a Polyline from your Array
        car_polyline = arcpy.Polyline(coord_pairs, spatialRef)
        cursor.insertRow((car_polyline,))

print("success!")

Here is a sample of the CSV file:

Time    Lap GPS_Update  GPS_Delay   Accuracy (m)    Latitude    Longitude   Altitude (m)    Speed (KM/H)    Heading Accel X Accel Y Accel Z
0   0   1   0   13  -34.8394436 149.6849218 672 0   0   0   0   0
0.012   0   0   0   13  -34.8394436 149.6849218 672 0   0   0   0   0
0.113   0   0   0   13  -34.8394436 149.6849218 672 0   0   0   0   0
0.113   0   1   0   13  -34.8394436 149.6849218 672 0   0   0   0   0
100.051 0   1   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.01    -0.01   -0.01
100.11  0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.03    0   0.01
100.172 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.04    0.01    0.02
100.231 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.03    0.01    0.01
100.293 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.02    0   -0.01
100.355 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.02    -0.01   -0.01
100.415 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.02    -0.01   0
100.476 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.04    -0.01   0.01
100.534 0   0   0   3   -34.8401262 149.6844768 670 22.1    199.5   0.04    0   0.01
456.775 3   0   0   3   -34.8434759 149.6846522 680 51.2    240.2   -0.08   -0.48   -0.01
456.835 3   0   0   3   -34.8434759 149.6846522 680 51.2    240.2   -0.1    -0.46   -0.02
456.896 3   0   0   3   -34.8434759 149.6846522 680 51.2    240.2   -0.13   -0.46   -0.02
456.957 3   0   0   3   -34.8434759 149.6846522 680 51.2    240.2   -0.15   -0.45   0
457.016 3   0   0   3   -34.8434759 149.6846522 680 51.2    240.2   -0.14   -0.46   0
457.055 3   1   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.16   -0.46   0
457.118 3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.17   -0.46   -0.01
457.179 3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.19   -0.47   -0.01
457.237 3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.2    -0.48   0
457.283 3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.21   -0.48   -0.01
457.338 3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.21   -0.48   -0.01
457.4   3   0   0   3   -34.8435081 149.6845147 680 43.2    260.5   -0.23   -0.5    -0.02


texts: Incorrect coordinates when reprojecting NAD27 to NAD83

texts:
I have some historic UTM coordinates as NAD27 (556787, 7169250) which I entered into a spreadsheet and have imported into QGIS.

I assign them the projection Nad27 / UTM zone 12N (EPSG: 26712)

I save as... Projection Nad 83 /UTM zone 12N (EPSG: 26912)

When I compare coordinates, the coordinate shift is different than what I know it should be (in particular, there is no east-west component to the transformation), and when I use a separate NTV2 transform there is a shift of ~ 30m north, 50m west.

I have looked at This help article which involves projecting across UTM zones, which I am not doing.

and This other help article which is solved by using a more robust version of the nad27 projection (EPSG: 26712 instead of  EPSG:2027) which I am already doing

Am I missing something very simple here?

I am running QGIS 1.8.0 on window


texts: Determining Euclidean Distance in Polygon using ArcGIS for Desktop?

texts:
I would like to ask about how to create an euclidean distance analysis from a polygon shapefile.

I got a geology shapefile in which I want to create a "distance from geological boundary" analysis.

The idea is to create a distance from the geological boundary, I've done this several time with a polyline feature, but I've no idea how to do it with polygon.

Tools being used: Spatial Analyst>Distance>Euclidean Distance

The feature class: multi-polygon in one shapefile.

This is what I got when I run the euclidean distance with the polygon.

The analysis only returns the distance from the polygon perimeter

What I would like to see is the distance analysis from all the geological boundaries not just the perimeter.

I'm using ArcGIS 10.1 for Desktop.


texts: Including rotated label alongside stacked label in ArcMap?

texts:
I am trying to replicate the label that I have attached an image of.

Is this possible in ArcMap?

So far I have stacked 3 labels but am unsure how to:

Create 3 individual boxes around the stacked labels
Include the 4th label field and rotate at 90 degrees

This is my current expression:

[Code] &vbnewline& [Plot_Ref]&"_"& [Plot_ID] &vbnewline& [GRASS_Ref]


texts:
I'm trying to link a GeoServer application to a SQL Server Spatial Database.
The spatial data has been saved as Geography, but GeoServer can read only Geometry type.

So I'm using the following script to create an additional field of Geometry type:

UPDATE [dbo].[GeoBoundaries]
SET [GeoCoords] = geometry::STGeomFromWKB([SimplifiedCoords].STAsBinary(),[SimplifiedCoords].STSrid).MakeValid()
GO

The issue is with Russian Federation that has polygons crossing the 180 meridian.

The Geography data type is correctly shown:

instead, the Geometry data type has issues displaying the crossing meridian polygons:

Obviously Geoserver is not able to read the GeoCoords field even if it is a geometry field and raise an error:

java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds for GeoBoundaries
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry":

How can I correctly convert geography to geometry to be used by Geoserver?


texts:
I am developing my first plugin for qgis. the operating system is Windows 10 Enterprise. I use Eclipse -PyDev as my programing  enviroment. And has qgis installed as a standalone program. When i try:

from qgis.core import QgsDataSourceURI,QgsVectorLayer, QgsMapLayerRegistry

PyDev then warns me:

So when I run the code I get this error:

Traceback (most recent call last):
  File "C:\Users\username\.qgis2\python\plugins\PluginNaeme\Source\theCode.py", line 9, in <module>
    from qgis.core import QgsDataSourceURI,QgsVectorLayer, QgsMapLayerRegistry
  File "C:\Program Files\QGIS 2.14\apps\qgis-ltr\python\qgis\__init__.py", line 36, in <module>
    from qgis.core import QgsFeature, QgsGeometry
  File "C:\Program Files\QGIS 2.14\apps\qgis-ltr\python\qgis\core\__init__.py", line 34, in <module>
    from qgis._core import *
ImportError: DLL load failed: The specified module could not be found

What does this error mean? How can I fix it?


texts:
I am trying to achieve a convex hull over a feature Set returned by a query. But have been facing the error below which i am not able to figure out

In order to debug to see how the convex hull works i had mocked up features and ran the convex hull for the created poly line features as seen in the below code. This works fine, But the above approach of plotting a convexhull for the feature set fails with the below error.

Error:

1) OPTIONS file:///C:/wip/maps/code/test/proxy.ashx?http://karthikpc:8399/arcgis/rest/se...ver/convexHull Resource failed to load

2) Another is a type error

TypeError
arguments: Array[2]
get message: function () { [native code] }
get stack: function () { [native code] }
set message: function () { [native code] }
set stack: function () { [native code] }
type: "non_object_property_load"
__proto__: Error

Have given my function below.

function bounding_polygon(featureSet){
    var geometries = [];
    var geometries_1 = [];
    var geoms=[];
var symbol =  new
    esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new
    dojo.Color([255,0,0,0.85]), 2);

    //getting geometry from feature set
    var geoms = dojo.map(featureSet.features, function(graphic) {
     return graphic.geometry;
     });
    map.graphics.clear();
     //function that fails
      gsvc.convexHull(geoms,function store_value(result){
    var symbol;
    switch(result.type){
          case "point":
            symbol = new esri.symbol.SimpleMarkerSymbol();
            break;
          case "polyline":
            symbol = new esri.symbol.SimpleLineSymbol();
            break;
          case "polygon":
            symbol = new esri.symbol.SimpleFillSymbol();
            break;
        }
     map.graphics.add(new esri.Graphic(result,symbol));
    },function error_log(error){});

//trying to run the same for manually created geometries
     var new_polyline= new esri.geometry.Polyline(map.spatialReference);
 var other_polyline= new esri.geometry.Polyline(map.spatialReference);
new_polyline.addPath([[103.76794615402221, 1.4416487206261546], [103.76790721700029, 1.4427548269642734], [103.76789991705209, 1.4429139656905441]]);
 other_polyline.addPath([[103.77897404312868, 1.3687951231704805], [103.7789286010334, 1.36900185852713], [103.7788202535522, 1.3694226417416273]]);
 geometries_1[0]=new_polyline;
 geometries_1[1]=other_polyline;

gsvc.convexHull(geometries_1,function store_value(result){
var symbol;
 switch(result.type){
          case "point":
            symbol = new esri.symbol.SimpleMarkerSymbol();
            break;
          case "polyline":
            symbol = new esri.symbol.SimpleLineSymbol();
            break;
          case "polygon":
            symbol = new esri.symbol.SimpleFillSymbol();
            break;
        }
     map.graphics.add(new esri.Graphic(result,symbol));

    },function error_log(error){});

    }


texts:
I have QGIS installed in Ubuntu and I want to install a Python package.
I simply cannot find the QGIS Python console. Where is it located?


texts: Creating distance radius along line network from point

texts:
In QGIS I'm trying to create a 1/4 mile radius (1,320 ft) around a point. I could obviously use buffer, which shows 'as the crow flies' - but I would like this along with the road network (in green). See below: buffer gives me the circle in blue, I want the irregular shape in green.

I've tried using Network Analysis (Service Area - from the point), but the results seem way off: the shape seems like a regular diamond, and the length is way more than I'd input. The radius is a 1/4 mile buffer, while the blue lines are the result from running Service Area from the point, even though I'd inputted 1,320 feet.

Any idea what I'm doing wrong?

Not sure if it makes a difference, but I've been putting in XY coordinates for the starting point.

[

I've figured it out.
Step 1: processing toolbox > network analysis > service area from point. Easy enough. For some reason the 'distance' is in meters even though all layers are in NAD83 (feet)...?
Step 2: processing toolbox > vector geometry > Concave Hull (k-nearest neighbor).


texts: Fixing contour lines in ArcGIS for Desktop?

texts:
I am using ArcGIS for Desktop and I want the lines to be curvy not that straight as the picture depicts:

solution: In Arcgis , the smooth lines tool , peak ...


texts: How to sum area of polygons by values occuring in multiple fields?

texts:
My data has 2 fields holding landuse types, which both describe what is within the polygon.
For example, the polygon may have Type1=Retail, Type2=Leisure Area= 1
but another polygon has Type1=Leisure, Type2=Swimming Pool Area=3

I want to discover the total area of polygons with a Retail attribute, Leisure attribute etc.. to build a table like:

Retail 1
Leisure 4
Swimming Pool  3

etc. Of course some polygons will be counted in multiple categories, but this is ok for what I am working on.

In some cases the polygon might have Type1= Retail, Type2= Retail. In this case the area should only be counted once.

Can I ask PostGIS to sum the areas for all of the values it finds in the fields, without me having to write/run a query for each of the types (there are a lot)?


texts: Is it a bad idea to use a geometric network for road editing?

texts:
I am producing a road map (for print and online). I was thinking of using creating a geometric network with my roads, for editing purposes mainly, but I would like to know any critical downsides of selecting this strategy. This is why I turn to You.

All the examples I can find on the web (including Esri) are utility related -- either power, water or sewerage. So, if this concept is created with those in mind, is it useful for road editing too?

The reasons I find geometric networks attractive for road editing are:

Excellent editing features.
Automatic clipping of existing segments, when a new segment is drawn to them.
Existing annotations and representations are not lost, when a new road is added -- the automatic clipping preserves annotations and representations. The Planerize tool loses annotations and representations.
Lightning-fast identification of disconnected road segments.
Fast identification of dangles (send by analysing for loops
On-the-fly validation of new features.

This far, I have identified following downsides:

Closed line features are not allowed
Roundabouts are really hard to create without the Circle drawing tool (following the above mentioned limitation).
Not being able to have a topology within the same featureclass.

Are there any critical issues that should prevent me from using geometric networks?


texts: problem with adding 64-bit background geoprocessing to ArcGIS 10.2.2

texts:
My code written in python language using Arcpy works perfectly with small to average size datasets; however, with a big dataset, the script stops in the middle of execution which most likely is due to lack of memory. the solution I found is to employe the 64-bit background geoprocessing so that the whole RAM could be used during the running time. the problem is that my ArcGIS 10.2.2 is installed by the technical staff in our department and the 64 bit BG geoprocessing is not set up.
According to the comments here , I downloaded the relevant patch but when I run it, the following error is appearing:

"The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded is missing, or the upgrade patch may upgrade a different version of the program"

Update:
As I checked, the code jumps out as soon as it starts a function which needs to use FeatureToPolygon function.

do you know how to fix this error or any other workaround for installing the 64-bit background geoprocessing in ArcGIS 10.2.2?


texts: Find features based on total overlap of another feature class

texts:
I have 2 polygon feature class's (A and B) that overlap each other.

I want to select all the polygons of feature class A where the total overlapping area of feature class B polygons is less than 10m2 using ArcPro.

There may be multiple polygons overlapping

I was able to do this when there is only 1 overlapping by doing this:

Union of feature class A and B
Clip the union output with Class A feature class as clip feature
Definition query on the output to only show polygons with an area less than
10m2
Select by location on feature class a with step 3 output as the intersecting
feature

But I am not sure how to do this when there are more than 1 polygons of feature class B overlapping feature class A


texts: QGIS Network Analysis Control and Plugins

texts:
I am trying to create Isocrones in QGIS for network analysis. I am able to accomplish this using the plugin ORS Tools from my transit stop using a drive time of 5-, 10-, and 15-minutes. However, the total control when using the ORS Tools compared to that of, say, ArcMap's Network Analysis extension, is limiting. For instance, I can't control for the speeds, the types of roads that are accessible, or the isocrone generation field types such as overlap.

Is there a way to generate an Isocrone through a form of network analysis either using ORS Tools or another plugin with such control as stated above?

I have done several extensive dives into this topic regarding background research and I just can't seem to figure this out.


texts: Deploying QGIS settings on a Citrix server – copying settings to user profiles

texts:
This is similar to the question at Deploying QGIS settings in an enterprise environment – We are looking to copy the QGIS settings from a preconfigured user to new users on a Citrix server.

The answer there suggests copying and pasting the .qgis2 folder and exporting and importing the relevant registry settings.

On the Citrix server registry, while the QGIS application is open for a specific user, we have registry folders for that user, including the path as follows:
'session/user ID'\Software\QGIS\QGIS2\Qgis

The Qgis folder has the settings that you would find in the QGIS menu bar under Settings > Options

However, when the application is closed, the whole session disappears from the registry. The option of importing the registry folders for a user may be unfeasible, because the session/user ID folders exist only when the user has the application open.

If we re-open the application for this user, the settings are retained, so they must be stored somewhere, but these settings are not stored in the .qgis2 folder.

We have considered the possibility of importing the folders for a user while their session is open, but the user/session ID is just a long string of letters, numbers, and hyphens, and it is difficult to identify the correct session even when there are only a couple of them open in testing, so it might be quite unfeasible when there are more open after deployment to more users.

The answer at QGIS keeping settings in sync? suggests that the settings are stored in a file called QGIS2.ini - but we cannot find any file of that name either.


texts: Assigning geometry to existing features in QGIS?

texts:
I have a point-shape-layer with existing features and an attribute table. But none of these features have a geometry  yet(i.e. no points that are shown).
How can I now add a point to each feature?
Ideally I want to click on a row in the attribute table and then click on the map to set that new point.


texts: How to fix Import arcpy ImportError: cannot import name _remove_dead_weakref

texts:
When I try to import arcpy into the python window in ArcGIS Desktop and I am given this ImportError.

>>>import arcpy

Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.\arcpy\arcpy\__init__.py",  line 21, in <module>
    from arcpy.geoprocessing import gp
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 592, in <module>
    env = GPEnvironments(gp)
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 589, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 542, in __init__
    import weakref
  File "C:\Users\dayl\AppData\Local\Continuum\anaconda2\Lib\weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref


texts:
I have a problem with osx font translate on Qgis.
For example (with a french language selected in osx system preferences) when i want to use a "bold" style, the font stay in "normal".

On the opposite, with a english language selected in system preferences, everything turn tout normal.

any ideas to solve my problem ?


texts:
I am working on Lena image (unsigned 8 bit grayscale 512*512 pixels). I tried to plot the histogram using matlab (inbuilt imhist function) and in arcgis. I am getting different pixel count, appx duble in arcgis plot.

What could be the reason?

Is there some sort of normalization that is occurring in using the imhist function?


texts: Trouble installing the ODC-Core in docker on Ubuntu 18.04?

texts: I am trying to install ODC-UI in docker on Ubuntu using this link:https://github.com/ceos-seo/data_cube_ui/blob/master/docs/ui/ui_install.md but before that, I need to install ODC-Core using this link:https://github.com/ceos-seo/data_cube_ui/blob/master/docs/ui/open_data_cube_install.md but its not available.


texts: Seeking compiled QGIS for 64-bit Windows 7?

texts:
It seems to me that a 64-bit build would be a much desired version.

Has it been done or are there Qt 64-bit compiler issues blocking the way?


texts: How to extract multiple polygons from a layer that overlap with a point?

texts:
I would like to get attributes of polygons that overlap with a point. This is to see on which street the lanterns are located, so if they are on a crossing I want to get both streets.

Right now I can only get the first street it encounters, and I can't find a way to iterate over the different polgyons.

Anyone that can help?


texts: OpenLayers zooming to a 5x5 degree section on double-click

texts:
Here is the high level description of what I'm trying to do. When the user double-clicks on the map I want to map to zoom to a 5x5 degree grid around the point they clicked on. I want to in essence hard code the zoom so not matter what zoom level they are in it always zooms to 5x5 of where they click.

I'm using the OpenLayers 3.12.1, Angular 1.4.8, and my own GeoServer server.

Here is my double-click function in my Angular app.

  $scope.map.on('dblclick', function(evt) {
    $scope.coordinate = evt.coordinate;
    $scope.center = ol.proj.transform($scope.coordinate, 'EPSG:3857', 'EPSG:4326');
    $scope.map = evt.map;
    $scope.extent = $scope.map.getView().calculateExtent($scope.map.getSize());
    $scope.bottomLeft = ol.proj.transform(ol.extent.getBottomLeft($scope.extent), 'EPSG:3857', 'EPSG:4326');
    $scope.topRight = ol.proj.transform(ol.extent.getTopRight($scope.extent), 'EPSG:3857', 'EPSG:4326');
    console.log('left', wrapLon($scope.bottomLeft[0]));
    console.log('bottom', $scope.bottomLeft[1]);
    console.log('right', wrapLon($scope.topRight[0]));
    console.log('top', $scope.topRight[1]);
    console.log($scope.center[0]);
    console.log($scope.center[1]);

    $scope.map.getview().fit($scope.extent, map.getSize());
});

I'm able to calculate the center, calculate the extent edge points. However when I try using the .fit function no matter what I put in for the inputs, the console says this function doesn't exist. I know the parameters I have in there are not right at all, their just placeholders.

I know I'm calculating a lot of extraneous information but I'm new to OpenLayers and keeping any successful lines of code I have for now.


texts: FME - calculating distance to points along a line

texts:
I am new to FME, and trying to get my head around what should be pretty straightforward issues, but I find myself going around in circles

Basically I want to determine the distance (chainage) to a series of points on a water main, which consists of 8 connecting line segments.

I have managed to create the chain of points every 10m by using the Labeller and then the GeometryCoercer (fme_point).
I also joined up the 8 line segments into 1 by using LineJoiner.

The question is now how do I get the chainage to each of the points along the line?

I've tried MeasureGenerator, but that gives me the chainage to the vertices not to the points
I've tried ShortestPathFinder but they all come out of the Unused port. I also tried it with the TopologyBuilder first, but this had no effect
I've tried PointOnLineOverlayer but this splits my line.
I checked FME - Calculate distance of point along a line but couldn't get the answer either.

I think I'm close, but anybody got any suggestions?


texts:
I'm trying to convert MapInfo, non-earth projection, layers with data in ITM or ICS (Israel coordinates in meters).

When I do so through Universal Translator with converting to SHP and back again, they sit about 70 meters off of where they actually are, and even the ITM and the ICS layers sit a few meters off from each other.

Is there a way to convert from non-earth meters to the their actual projections without this offset?


texts: Dynamically changing fillColor variables in leaflet

texts:
When I want to style a polygon using a property the traditional way is to assign a function that returns a style object. Within that object you assign the fillColor property to a getColor function
fillColor: getColor (feature.properties.population)
Is this the only way?
What if I want to style layers by dynamically changing the fill variable in a case where a drop down has 100 feature properties?


texts: Importing AWS downloaded Sentinel-2 data into SNAP software?

texts:
I have downloaded Sentinel-2 L1C granules from AWS. I saved it as .SAFE format and now have for each tile downloaded as folder structure:

AUX_DATA
IMG_DATA
QI_DATA

i would like to run some algorithms (atmospheric correction, biophysical procesor, etc.) with ESA's SNAP sowftware on these files.

As there is no .xml file downloaded from AWS, how can i import this file-structure into the SNAP software?

So far i can only select each band independently and load in SNAP as one product, but i would like all bands together as one product.


texts:
I would like to calculate area-weighted mean shape index (AWMSI) and mean nearest neighbor distance (MMN) and other landscape metrics for a classified map (tif) using R.

I've found a github package called "LandscapeMetrics"
https://rdrr.io/github/LandascapeMetrics/LandscapeMetrics/

My code is

install.packages("devtools")
library(devtools)
install_github("LandascapeMetrics/LandscapeMetrics")
library(LandscapeMetrics)
library(raster)
imagg <- raster("R/01.tif")
AWMSI(imagg)

I am getting

Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘is.projected’ for signature ‘"NULL"’
In addition: Warning message:
In rasterToPolygons(fragment_forest, fun = NULL, na.rm = TRUE, dissolve = TRUE) :
  no values in selection

How can I specify the class that I would like to calculate AWMSI for and other metrics?


texts:
I have a layer of polygons that are pretty detailed.

I need these to be more simple.

Is there a way to make this into a polygon with just the outer boundries?


texts:
I need to be able to bring the pictures as points and then be able to click at a certain point and an image pops up.

I added a column for images label as pic. How can I show that image on the point?


texts: Using boolean parameters in Python Script Tool of ArcPy?

texts:
I'm using ArcGIS for Desktop 10.3.0.4322

I have a script tool which requires a parameter (folder path to a gdB, via GetParameterAsText) so that a later process can be saved there. The thing I want to do is make an Optional Boolean parameter, that when checked, automatically fills in the folder path gdB parameter. The boolean text asks the user, "Use default workspace?", to which if they check the box (boolean == True), then the folder path parameter will be automatically defaulted (saving the user a small amount of time). I have already created the boolean parameter in the script tool, I am however unaware of how to "fill in" the required parameter based on the user's boolean.

Code Snippet:

# Ask user to select the Geodatabase workspace to use for data output
userWorkspace = arcpy.GetParameterAsText(0)

# Ask user if they want to use default workspace (boolean)
useDefault = arcpy.GetParameterAsText(1)

# If user wants default workspace, then give it to the required parameter (0)
if useDefault == True:
 arcpy.env.workspace = path
else:
 # Set workspace environment based upon user's choice
 arcpy.env.workspace = userWorkspace


texts:
I am trying to get familiar with MapProxy. I was able to install and start the demo page as well as the OpenStreetMap configuration from here: http://wiki.openstreetmap.org/wiki/MapProxy

I am curious now about other sources, such as Bing Maps. Unfortunately I am not able to find the source URL of this service (like http://c.tile.openstreetmap.org/%(tms_path)s.%(format)s for OpenStreetMap).

I can figure out the domain name by evaluating the get calls in the browser when using Bing Maps. But all the parameters after the domain name are a riddle to me.

Is there a page that shows such sources of different web map services or are they maybe not even communicated?


texts: ok simplest question i have asked i think. but im a running QGIS 1.7.4 and there are no other tools in the dropdown menu other than raster calculator. I have seen in a lot of online demos tools below the raster tab.....the one i am interested now in is polygonize...i have searched in the pluggins and no luck......what am i missing


texts: Renumbering a lot of cross sections - Access and changing polyline IDs

texts: I have a poly line shape which represents cross sections along a river. Thses cross sections are numbered and it appears in the map. The numbering happens from downstream to upstream. In a specific point I have to add anew cross section (see Fig 1). Afterwards I have the problem that the cross sections must be numbered from that point to the upstrem (see Fig 2). I have more than 1000 cross sections. How can I do it automatically.


texts: Getting Transparent Circles with Heatmap Plugin

texts:
With QGIS, I am trying to create a heatmap from a set of points I added as a layer using the "Add Delimited Text Layer" plugin.

The points are a collection of complaints from around a city and I want to visualize portions of the city that have a higher frequency of complaints.

Using the heatmap plugin, I choose the following options:

Input Point Vector: my CSV layer of complaint points
Output Raster: heat_map
Output Format: GeoTIFF
Radius: 1000 meters
Decay Ratio: 0.1

I click OK and then choose NAD83, EPSG:4269 for coordinate system.

Next, I get a large grey box with tiny transparent circles.

I've tried switching the color map to pseudocolor and adding a transparent pixel list to make anything with a value of zero appear to be transparent.

Then the whole map disappears.

I'm not getting a heatmap at all and I've followed all of the popular guides I can find with Google.

Advice would be greatly appreciated.

Thank you!


texts: how to name the band created with ee.Image.expression?

texts:
I'm computing the bands of the 'UMD/hansen/global_forest_change_2019_v1_7' by creating a new composite band :
var aoi = table //any aoi/country/polygon avalaible
var dataset = ee.Image('UMD/hansen/global_forest_change_2019_v1_7');

//clip the dataset on the aoi
var clip = dataset.clip(aoi)

//create a composite band bassed on the user threshold
var threshold = 30

var calc = "(A<=threshold)*((C==1)*50 + (C==0)*30) + " //Non forest
calc += "(A>threshold)*(C==1)*(B>0)*51 + "         //gain + loss
calc += "(A>threshold)*(C==1)*(B==0)*50 + "        //gain
calc += "(A>threshold)*(C==0)*(B>0)*B + "          //loss
calc += "(A>threshold)*(C==0)*(B==0)*40"           //stable forest

calc = calc.replace(/threshold/g, threshold)

var gfc = clip.expression(calc,{
  'A': clip.select('treecover2000'),
  'C': clip.select('gain'),
  'B': clip.select('lossyear')
});

print(gfc)

The obtained band in gfc is named treecover2000. I'd like to use gfc instead. according to the doc :

If the result of an expression is a single band, it can be assigned a name using the '=' operator (e.g.: x = a + b).

But I don't understand where to put the '=' statement. Anyone that has already used it can give me a clue ?


texts:
I have a problem with some shapefile, PolygonZ type, I have imported with "shp2pgsql-gui".

This is the output (note 'coord_dimension' value):

mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3003
Shapefile type: PolygonZ PostGIS type: MULTIPOLYGON[4] Shapefile
import completed.

From this point of view it seems a data issue but I must say also that I'm able to display the same data with Qgis 1.8 (build from source).

So what could be the cause of this behavior?

PS:using Qgis 2.2 and Postgis 2.0.3 from UbuntuGIS repository on Linux Mint Maya


texts: Load vector tiles (pbf) directly from mbtiles database using OpenLayers 3

texts:
In response to the answer of Klokan Technologies in this thread: OSM offline tiles -- mbtiles in openlayers. I managed to unpack a random small mbtiles vector tile map from osm2vectortiles.org and load it locally in a browser using npm http-server, based on this OpenLayers example. However I still have a question:

In the previous answer it is mentioned that the vector tiles down to zoom level 14 contains all street data with details of zoom level 20. However, when I zoom in to level 15+ I get (of course) HTTP 404 file not found errors. I can limit the zoom by setting tileGrid: ol.tilegrid.createXYZ({maxZoom: 14}) but then the map gets blurry at zoom level 15+. How can I utilize the data in zoom level 14 for higher zoom levels?


texts: Loading layers from PostGIS db (populated with osm2pgsql) in QGIS?

texts:
I have downloaded some OSM data from geofabrik and used this to create a PostgreSQL/PostGIS database using the osm2pgsql tool:

osm2pgsql -G -d <db> -U postgres myfile.osm

Examining the database in pgAdmin shows everything as I would expect: there are tables for planet_osm_line etc. which all have data including geometry column. However, when I connect to the database from QGIS and attempt to add layers, none of these tables appear in the Data Source Manager|PostGIS dialog.

Searching on this site (and comparing with a working PostGIS database that I created using QGIS and some random shape files) led me to suspect that I might need a primary key field in my tables. But adding one with:

ALTER TABLE planet_osm_line ADD COLUMN id SERIAL PRIMARY KEY;

has not helped. I have also tried running osm2pgsql without the -G flag, changing the name of the geometry column to 'geom' to match what QGIS produced in my working database and changing projection in QGIS to Spherical Mercator (3857) to match the data in the PostGIS database. And I've made sure to name the connection as per the solution here: Why can't I open postgis layers in QGIS?

As I'm quite new to all this I suspect I've overlooked something in my usage of either osm2pgsql or QGIS. Could someone point out the error of my ways?

In case it's useful, I'm using:

osm2pgsql version 0.96.0
QGIS 3.4.3-Madeira
PostgreSQL 11.1
postgis_full_version(): POSTGIS="2.5.1 r17027" [EXTENSION] PGSQL="110" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.3.2, released 2018/09/21" LIBXML="2.9.8" LIBJSON="0.13.1" LIBPROTOBUF="1.3.1" RASTER


texts: Merging Feature Records with Identical Parameters in Two Different Fields using ArcPy?

texts:
I'm trying to merge feature records based on identical parameters in two different fields using Python or SQL.

I have a polygon feature class with ~800 records, that I've intersected with another feature, which has created a number of duplicated geometry fragments.

The intersected feature has a field containing IDs (catch_ID), and a field containing landuse (land_ID).  The land_ID field contains a string value that's either Impervious or Pervious. After I intersected, I was left with too many duplicates, I'd need to reduce the duplication to each catch_ID so that I'm left with two, one for impervious land_ID and the other for pervious land_ID.

Right now I'm tackling this manually using Select By Attributes ie. catch_ID = '100' AND land_ID = 'Impervious',  and then merging them using the editor.  I will have to repeat a process a few more times, so I'd like to figure out how to automate this.

What Python commands would I need to generate a script for this, I'm not really familiar with the functions ArcPy uses the Editor, or can this be done with SQL in the Select By Attribute window?

I have Python 2.7.5 and Arcmap 10.2.1 (extensions 3D Analyst, ArcScan, Spatial Analyst, Geo statistical Analyst).


texts:
I'm programming with the ARCGIS Java SDK, in Eclipse.

I need to cast an IFeatureClass to an ISchemalock. This cast is supposed to be allowed. There is an example of this cast in:
http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm

However, when I try to perform this cast in my code, an exception appears:

Exception in thread "main" java.lang.ClassCastException: com.esri.arcgis.geodatabase.IFeatureClassProxy cannot be cast to com.esri.arcgis.geodatabase.ISchemaLock

Are you able to make this cast on an IFeatureClass ? Here is the code to perform this:

//Attempt to acquire an exclusive schema lock on the feature class.
IFeatureClass fc = fw.openFeatureClass("featureclass name");
ISchemaLock schemaLock = (ISchemaLock)fc ;

I would appreciate if you could try this simple line of code in one of your programs.

Keep me posted...

EDIT:
I wanted to see if an IFeatureClass was, at least, recognized as an instance of ISchemaLock. Believe it or not, it was NOT recognized as an ISchemaLock! The execution of the code below did not enter the if statement.

if (fc instanceof ISchemaLock)
{
  System.out.println("all ok");
  ISchemaLock schemaLock = (ISchemaLock)fc;
}

Maybe is there something not correctly installed with Eclipse ?


texts: I want to add a linestring to a CartoDB API web app for one time use, I have SQL statement being ran at the same time and just want the linestring in the SQL statement to be displayed.


texts:
I am using QuickMap Services MapSurfer OSM Roads Map, and it seems that there is some data missing. This was previously working for me - I'd use another map and move on, but all the other images in the report are using this as a basemap.

Any ideas?


texts:
I'd like to add a layer in QGIS, not just filtered by attribute, but using a spatial relationship.

For example, visualize only river features that are within the state of São Paulo, Brazil.

How can I do this in QGIS without having to create a new shapefile and cut that data to the state?


texts: OpenLayers2, trouble with XYZ layer bounds

texts:
I have folder with image at server:
ex: /folder/zoomlevel(z)/id/x-y.png

I added it by the OpenLayer.Layer.XYZ with my getURL() function:

getUrl: function(bounds) {
  var xyz = this.getXYZ(bounds);
  var path = this.url + '/img_folder/' + z + '/';
  ...
  return path;
}

But there are 404 requests to generated URL, when I drag map to region without image.

How I can set minExtent or maxExtent for  this solution?


texts:
I'm having a hard time displaying a PNG correctly through ImageStatic. Here is what I have right now:

the outer feature is the extent of the PNG (the original image has margin around the colored content)
the inner feature is the expected display of the PNG

The PNG fits exactly with the inner feature, but OpenLayers seems to deform the image.
The PNG content was generated with EPSG:4326. The OL view was in EPSG:3857, I changed it to EPSG:4326, but with both EPSGs I can't make the PNG fit the inner feature.
I'm using ngx-openlayers, with this configuration:
<aol-view #view [minZoom]="3" [zoom]="6" [maxZoom]="18" [center]="center" [projection]="proj4326"></aol-view>

<aol-layer-image [zIndex]="1">
    <aol-source-imagestatic
      [url]="imageLink"
      [imageExtent]="imageExtent"
      [projection]="proj4326"
    ></aol-source-imagestatic>
</aol-layer-image>

I also tried to use image reprojection (based on OL example), using EPSG:3857 for the view and EPSG:4326 for the ImageStatic. The result was similar to the one I showed above.
How can I make OpenLayers keep the original display of my PNG, without transformation?


texts: How to bring 3D object into 3D application?

texts: I'm doing some GIS as part of my college course and have just started to do some 3D modelling, I'm really a GIS novice, The module is short (only 5 lectures) My lecturer has said that it is possible to bring in an object such as a tree or wind turbine and place it on the 3D model, (problem is he doesn't know how to do it) can anybody on here help. I don't need it for exam or any thing, but I am doing a few maps for my final year project and would like to do a 3D model.


texts: Unable to snap vertices and segment in QGIS 3.0

texts:
I'm unable to snap 2 polygons in QGIS 3.0. I tried snapping 2 polygons from the same layer and also 2 polygons from different layers.

I ensured that snapping is enabled in the Settings>>Options>>Digitizing tab, and increased the snapping distance.

I could not locate any 'snapping settings' at the layer level.
Layers are projected.


texts: How can I put Voronoi/Thiessen polygons on Google Maps for free with no programming knowledge?

texts:
The only thing anywhere close to what I describe in the title is this site: http://lpetrich.org/Science/GeometryDemo/GeometryDemo_GMap.html. It has a couple problems, though: 1. There is no easy to way to preserve whatever map one makes and 2. Sometimes, if two points are too close together the border between them will be obviously off-center.

I just want to play around with this function. I lack the commercial motives or technical knowledge to buy or use ArcGIS. I can find free map tools online that allow me to find latitudes and longitudes and measure distances between two points: Why can't I find a way to make a Voronoi diagram?


texts: arcpy.da.UpdateCursor "iteration not started" when using pairwise iteration through cursor

texts:
Without getting too much into the context of this workflow, I'm trying to find whether a stream segment is flowing in the right direction.  If the "FROM_NODE" or the "TO_NODE" values of two adjacent stream segments are equal, then one of the segments isn't digitized in the correct direction, and that record is tagged with an error code (i.e. 6).

I am trying to do this by iterating through a file geodatabase table using  da.UpdateCursor, iterating two cursor rows at a time.

I'm using a function called "pairwise" to iterate through two rows at a time, which I got from the Python 2.7 itertools documentation here:

https://docs.python.org/2/library/itertools.html#recipes

When stepping through the code, everything works fine until I get to one of the cursor.updateRow(row1) lines, then I get the following error:

StopIteration: iteration not started

Here's the code:

# iterates over two items at a time (recipe from python documentation)
def pairwise(iterable):
    a, b = tee(iterable)
    next(b, None)
    return zip(a,b)

# Find flow direction errors
def flow_direction(tmp_network_tbl):
    arcpy.AddMessage("... flow direction")
    fields = ["ReachID", "UpstreamID", "FROM_NODE", "TO_NODE", "ERROR_CODE"]
    with arcpy.da.UpdateCursor(tmp_network_tbl, fields) as cursor:
        for row1, row2 in pairwise(cursor):
            if (row1[2] == row2[2]): # upstream has same from_node as reach
                row1[4] = 6
                cursor.updateRow(row1)
            elif (row1[3] == row2[3]): # reach has same to_node as upstream
                row1[4] = 6
                cursor.updateRow(row1)
            elif (row1[4] != 0):
                pass

I'm assuming that the fact that the cursor is being run through the pairwise function is causing the problem, so I suppose my whole effort to try iterating two rows at a time isn't a good idea... Or is there just something simple I'm missing?


texts: Saving a scratch layer into an existing Spatialite database in QGIS?

texts:
It is possible to save a QGIS scratch layer (QGIS 2.18) into all the usual formats - including as a new Spatialite database file.

Is there a way to save such a layer into an existing Spatialite database file?


texts: Force reload assigned datasets for Mesh Layer

texts:
I am wondering if there is any way / python code to force QGIS 3.12 to reload the data source of mesh layer and its assigned datasets?

Mesh layer is a .xmdf file that's similar to .2dm with assigned datasets.

My layer:

from qgis.core import QgsProject
layer = QgsProject.instance().mapLayersByName('urib_v61-T_F100_P')[0]

I tried:

layer.dataProvider().forceReload()
AttributeError: 'QgsMeshDataProvider' object has no attribute 'forceReload'

layer.dataProvider().Reload()
AttributeError: 'QgsMeshDataProvider' object has no attribute 'Reload'

This seems to just force redraw of layer in Map Canvas:

layer.setAutoRefreshInterval(360000)
layer.triggerRepaint()

This works for raster layers but doesn't seem to refresh assigned datasets:

layer.dataProvider().reloadData()


texts:
I am a GIS analyst working for regional govt. I quite often have to create quite complicated interactive maps for non-gis users who need them for presentations. These non-GIS users then need to have ArcGIS experience in order to just disaplay layers. This often leads to confusion when for example the contents window has been switched off my mistake, and other little problems due to not having enough experience with the software.

My question is...Does anyone know of any viewers which can basically display arcgis MXD documents but do not contain all the tools. I basically just need to display the layer groups/layers and keep their symbology, be able to switch the layers on and off, and possibly do a few other things like search for attributes, alter opacity. But the last two points are not really too important.


texts: I have a point shapefile in edit mode, containing x and y coordinates. When I move the point to another location, the x and y coordinates do not update to the corrected location. I realize the x and y fields, although they are the ones I used to plot the points in the first place, now have nothing to do with the points actual location. Is there any simple way to just move a point in edit mode and have the coordinates automatically update?


texts: Printing a list element from a for loop in Earth Engine

texts:
I would like to generate a collection of the 3 least cloudy granules for each Sentinel-2 tile within the bounds of a particular shapefile. It seems that this will require a function that iterates on each tile separately rather just using .sort, "Cloudy_Pixel_Percentage", and .mosaic to create a single mosaic of the least cloudy granule for each tile. So, I have created a script that identifies the distinct tiles:

    // Load the ROI table
    var table =
    ee.FeatureCollection("users/theronmb/TTCS_Area_Crop_for_Sentinel-2");

    // Find the MGRS_TILES that overlap with the ROI for the time period
    // of interest
    var collection = ee.ImageCollection("COPERNICUS/S2")
      .filter(ee.Filter.calendarRange(3,6,'month'))
      .filter(ee.Filter.calendarRange(2017,2017,'year'))
      .filterBounds(table)
      .distinct('MGRS_TILE')
    ;

    print(collection);

    // Get a specific metadata property.
    var tiles = ee.List(collection.aggregate_array('MGRS_TILE'));

From there, I was thinking to use a for loop to create the collections I need, iterating on the list of distinct tiles. Unfortunately, this simple loop I am using for testing does not seem to do anything (or even generate an error). Where am I going wrong?

    print(tiles.get(0)); // This works
    print(tiles.size()); // This works

    // Test iterating on the specific metadata property (does not work)
    for (var i = 0; i < tiles.size(); i = i + 1) {
    print(tiles.get(i));
    }


texts:
I have downloaded the netCDF plugin for GeoServer 2.15 and put it in its directory >> it had been shown on GeoServer as raster data >>
but while uploading .nc file by using this plugin I still have this error

  Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:gwc/psl_RF_1980-2005_monmean.nc and hints Hints: REPOSITORY = org.geoserver.catalog.CatalogRepository@7062ed2a EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@960bf8a[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] System defaults: FORCE_LONGITUDE_FIRST_AXIS_ORDER = true STYLE_FACTORY = StyleFactoryImpl FORCE_AXIS_ORDER_HONORING = http FILTER_FACTORY = FilterFactoryImpl GRID_COVERAGE_FACTORY = GridCoverageFactory TILE_ENCODING = null LENIENT_DATUM_SHIFT = true COMPARISON_TOLERANCE = 1.0E-8 FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@11acdc30

that can`t enable me to upload any data.


texts: How to add Elevation to a QGIS 3.12 attribute table for shapefile points

texts: What code do I use in the Field Calculator of the Attributes Table within QGIS 3.12 to generate the elevation of shapefile points in feet?


texts: How to automate the QGIS Raster Interpolation Plugin using python console?

texts:
I have a rainfall data from 1961 to 2015 for each day of this years. I need to create a raster for each day with this configuration.

Do you know how to automate this using this plugin and python?


texts: How to Display ArcMap Generated Layer (.lyr) on ArcGIS JavaScript API Map

texts:
Can you please let me know if it is possible to present an ArcMap Generated Layer (.lyr) on top of ArcGIS JavaScript API Map without using ArcGIS Server?
Like using server uploaded file from URL ?


texts: MySQL: Query the envelope (mbr, extents) of a spatial table?

texts:
this question provides a solution to get the evelope (aka: mbr, aka: extents) of a spatial table in PostGIS, but I'm having trouble doing the same in MySQL.

The ogr MySQL driver does this, and a solution is noted here on a Ruby forum (circa 2006), but surely this doesn't require external programming? Does anyone have a clean SQL recipe for this case?

[Answer]

After getting pointed in the right direction by @GIS-Jonathan, the working query ends up looking like what follows. CAVEAT: You may not need to change the group_concat_max_len value for a small table, but large tables with many features may need the larger group_concat_max_len buffer. It seems safe to me to just increase this value in the session as part of the solution.

# increase group_concat_max_len to be safe

SET SESSION group_concat_max_len = 104448;

# air8 is my geodata table
# shape is the geometry column

SELECT
  asText(
    Envelope(
      GeomFromText(
        Concat(Concat("geometrycollection(", Group_Concat(asText(shape))),")")
      )
    )
  )
  AS extent FROM air8;

[Concluding Remark]

I was curious how well this would scale against larger tables and found that it starts to break down around some upper limit I don't have the time to identify.

For a table with 60864 features, I had to use SET SESSION group_concat_max_len = 10444800;, then it worked (that's up to about 10MB). However, for a table with 242439 features, I tried 104448000 (about 100MB), then 1044480000 (about 1GB), then most rediculously 10444800000 (about 10GB). At that point I quit caring if it would eventually work because surely that violates sensible practice!

Anyway here is the take-home message: If you run this on a large dataset and it returns null, you may very well be hitting the upper limit.


texts: ArcGIS Focal Statistics Returns Out-of-Bounds Result

texts:
I am trying to compute a moving window maximum on a raster, such that the output is the max within a 5 mile radius.
This should result in an output grid where the maximum is equal to the maximum of the input grid.
I am using the FocalStatistics function in spatial analyst,

Here is the code:

import arcpy
from arcpy import env
from arcpy.sa import *
env.extent = "MAXOF"
arcpy.CheckOutExtension("Spatial")

localMax = FocalStatistics(InRaster, NbrCircle(5, "MAP"), "MAXIMUM")

Pretty straight forward.
But if I check that stats:
    arcpy.GetRasterProperties(localMax, “MAXIMUM”)
The value returned is 3.4e+38 (out to lunch), whereas:

arcpy.GetRasterProperties_management(inRaster, “MAXIMUM”)

returns 5.73

I have used this function without problems before – I am out of ideas. Anyone?

edit: inRaster is projected, and the linear unit is Miles (US)


texts: Creating line between polygon and nearest raster cell?

texts:
I need to create a line between polygons (centroid) and the nearest cell of a raster dataset. The polygon and raster do not intersect. Each polygon has a UID. One cell can be linked to many polygons, but the polygon can only be linked to one cell.

To start, I'm converting the raster to point. From there, I think a Spatial Join needs to be performed using "CLOSEST" as the match option. If I can get the raster cell point to have the polygon UID, I can then use Points to Line with the UID field as the "Line Field" parameter to create an individual line between the two points to connect the polygons to the nearest raster cell.

I tested this on a small area and sample, but it was taking a long time to run each step. In the end, this needs to be performed for hundreds of polygons at a time. Can anyone tell me if I'm on the right track or offer any suggestions to make this work? Some searching has indicated using Near analysis and creating a line from the xy coordinates could be an option as well. Whatever is most efficient.

Making a grid with only values along the boundary would make the raster to point processing faster, as described here. I'm still not sure if the rest of the process is going to work correctly.


texts: Adding 2 layers with different coordinate reference sytems

texts:
I'm using QGIS for editing an PostGIS database. This database gives me only lines (streets of a city). But, I have to edit the PostGIS because some streets have changed. So, I put a base map (new layer) as a reference (Google Maps for example), but I have problems with CRS of them.

The PostGIS database have EPSG 22181 and when I try to convert Google Maps layer to this EPSG I don't see any changes... I cannot see the 2 layers on the same map.

What am I doing wrong?

Nate thans for your time!. Here I post the images.
This is the SRC of my Postgis database

Here it's whats my QGIs database manager gives me related to Postgis database

And here you have project SRC

Here the GoogleMaps SRC

ANd finally here it's whats my problem, I can't see both maps on the same screen.


texts: Reproject Geoserver layer in Web Mercator Mapbox frontend

texts: I am looking to visualise live satellite imagery in a Mapbox GL JS Fronend. There exists a Geoserver instance which has exactly the resource I want to use. However, the layer is in the wrong EPSG. What is the easiest way to link my Frontend (Web Mercator, EPSG: 3857) to the output of the Geoserver (EPSG: 4326) without doing any reproduction by hand?


texts: Output data of NDVI of multiple regions into table from GEE

texts:
I am using GEE for NDVI calculating. There are 150 more counties in USA. I am now stuck in outputting the NDVI ("interest" at code) of each counties listing with "OBJECTID" at the end of code. Could you please help to find the solution?
Here is the code I used.
function getNDVI_l8(image){
  return image.normalizedDifference(['B5','B4']).rename('NDVI');

}

var images_L8= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
    .filterDate('2020-06-01', '2020-07-30')
    // .filterBounds(counties)
    .map(maskL8sr)
    .map(getNDVI_l8)
    .median().clip(counties);

Map.addLayer(images_L8,{color:'900000'});
// var interest1 = [];
for (var countyID =1; countyID < 156; countyID++){

  var shp =counties.filterMetadata('OBJECTID', 'equals', countyID);

  Map.addLayer(shp,{color:'900000'});
  var interest = images_L8.reduceRegion({
    reducer: ee.Reducer.mean(),
    geometry: shp,
    scale: 30
  });
  // interest1 = interest.append(interest);
  print(interest);

}

Export.table.toDrive({
      collection:interest,
      description:'USA_county_NDVI',
        folder:'USA_NDVI',
        fileFormat:'csv'
    });


texts: Nonstandard GDAL and BIGTIFF: Is there a hidden flag / env variable?

texts:
I'm having some trouble with GDAL and BIGTIFF support.  I work on a multi user cluster, and the defaults for GDAL are 1.9.2 there.  I've built GDAL 2.1.3, libtiff, libgeotiff, and proj4, making sure to use BIGTIFF support.  Everything works fine during the build, and the configure recognizes bigtiff during the GDAL build.  All good.

However, when I attempt to use gdal_merge.py, I get the following errors thrown:

<GDALPATH>/bin/gdal_merge.py
Warning 6: Driver GTiff does not support BIGTIFF creation option
Warning 6: BigTIFF requested, but GDAL built without BigTIFF
enabled libtiff, request ignored

I've set my environment variables as:

export PATH=<GDALPATH>/bin:${PATH}
export LD_LIBRARY_PATH=<GDALPATH>/lib
export LD_RUN_PATH=<GDALPATH>/lib
export PYTHONPATH=<GDALPATH>/lib64/python2.6/site-packages

When I run gdal_merge.py --version, I get the correct gdal library, with the version as:

GDAL 2.1.3, released 2017/20/01

But when I run the actual gdal_merge.py , I get the error listed above.  Everything built / installed correctly, but for some reason, despite configuring and building with it, the gdal_merge call won't use BIGTIFF support, almost as if it's still pushing the 1.9.2 system version that does not contain support.

I also ran an strace, and after initially finding it wasn't actually finding the libtiff.so (it was looking for .3 instead of .5), I created a symlink and directed it there.  So it's definitely using the custom build libtiff and libgeotiff at runtime.

So, that brings me back to the question.  Is there a hidden variable somewhere I'm not aware of getting used?  Or is there a way to test for BIGTIFF support after a build besides it failing?  I know non-standard installs are always a unique challenge, but nothing I've done so far allows for BIGTIFF use in the merge, and the merges fail at the size of system memory.


texts:
I am trying to write a query to get all bike lanes to display on a map for my project. I want to display all types of bike lanes(shared ,dedicated,tracks etc)

[out:json][timeout:25];
// gather results
(
  // query part for: “cycleway=*”

  // sharrow
  way["cycleway"="shared_lane"]({{bbox}} ) ;

  // CONVENTIONAL BICYCLE LANE
  // lane on both sides of the street
  way["cycleway"="lane"]({{bbox}});

  // lane on either side
  way["cycleway:left"]({{bbox}});
  way["cycleway:right"]({{bbox}});

  // dedicated bikeways
  way["highway"="cycleway"]({{bbox}});

  way["bicycle"="designated"]({{bbox}});

);
out body;
>;
out skel qt;

Am I missing some parameters because I am not getting the same map as open cycle maps. I understand that the open cycle maps is displaying cycling routes as well. So I added the parameter

relation["route"="bicycle"]({{bbox}});

But I am not very sure about what a relation is. Also it gives a lot of overlapping paths. Are all bile paths covered under a relation? Also from my understanding, this relation also has routes which would not necessarily go through a bike path. Coming back to my original question, are there any other parameters that I can add to my query to get all bike paths?


texts:
I have a GPX file with my waypoints.

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0">
    <name>My Favorites</name>
    <wpt lat="-26.7183013" lon="-54.8139346">
        <ele>1</ele>
        <name>F1</name>
    </wpt>
    <wpt lat="-26.7099827" lon="-54.8201895">
        <ele>2</ele>
        <name>F2</name>
    </wpt>
    <wpt lat="-26.6907555" lon="-54.8205221">
        <ele>3</ele>
        <name>F3</name>
    </wpt>
</gpx>

Now I want to display them on the OpenStreetMap map.

How can I do this?

I can only drag the file on thr website when in edit mode and even then I do not see them.

Related: osm-personal-points-of-interest