texts: How can the maximum temperature (tmmx) band in the TerraClimate GEE dataset be interpreted?

texts:
This question was already asked here. But there was no correct answer. link
I'm using the precipitation, maximum temperature (tmmx) and soil moisture in the TerraClimate dataset in GEE. I cannot find out how to interpret the tmmx values. I have looked into the literature Link Link Link, but couldn't find what these numbers exactly mean.
The tmmx is based on the WorldClim dataset and is apparently "average maximum temperature (°C)"
The range is between -670°C and 576°C (globally) Link.
Gridded TMN and TMX are derived from gridded TMP and DTR according to:
TMX = TMP + DTR/2 Link in appendix 3
My ideas are: 1) it is some other unit (Fahrenheit or Kelvin)(but they say it's in °C)
2) it is accumulated (but nowhere on earth the max T adds up to -670)
3) it is accumulated in another way (temporal or spatial) which leads to these numbers
This is how it looks in GEE for central Europe:


texts: Translating raster from GTiff to ASC format using GDAL Python package?

texts:
I tried using GDAL Translate as follows and encountered an error.

OutTileName_tif = CH_14.tif
OutTileName_asc = CH_14.asc

gdal.Translate(OutTileName_tif, OutTileName_asc)

Error message is

ValueError: Received a NULL pointer.


texts:
I am currently recreating a hazard map that was processed by another program.
Is there a tool/plugin available that can be used to smoothen out the rough edges of the grids?
Attached is the current map and the wanted result.


texts:
I am trying to rasterize a shapefile with Python using ogr, but if you know to do with other libraries as fiona, I am interested in too.

I use the shapefile in the following website: https://www.hydrosheds.org/page/hydrolakes (Lake polygon).
I try to get a raster of 0.5° resolution and in lat/lon projection. I want to create a matrice M where M(i,j) correspond to lake fraction. In my shapefile the polygons are lakes.

I see people using the function gdal.RasterizeLayer(target_ds, [1], source_layer, burn_values=[0]) and I don't success to use it.

Can you give me tips?

I just success to get a raster with undefined values.

EDIT

I try the method of snowman2.
But finally with a friend that have the costum to do it R. I follow his algorithm in python with ogr and I sucess to get something precise.

I will put the code within the day.


texts: Probelm with Add Network Analyst dll in My Web Mapping Application adf?

texts:
I'm a beginner in ArcGIS & I'm shooting blind really. I want to add the Network Analyst tool box to find the shortest path in my project. I tried this solution:

I can't add Network Analyst dll to my web mapping application. I use ArcGIS 10 & Visual Studio 10 and I used web application adf to build my website. I tried the Network Analyst toolbox or networkanalyst.dll from developer kit folder but an error occurs:

there are no components in 'C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet\ESRI.ArcGIS.NetworkAnalyst.dll that can be placed on toolbox


texts: Combining several mask rasters to obtain one single mask with binary values

texts:
I have a series of separate rasters which represent the cloud cover over the same area but in different months. Each raster has 2 values: nan for "no cloud" and 255 for "cloud". What i want to do is to create a single mask, where each pixel has a value of nan if ALL the separate rasters have nan as a value for that pixel, and a value of 255 if ANY raster (even only one is enough) has a value of 255 for that pixel.
I'm using QGIS and I guess the raster calculator should be used for this, but I have no clue about how to do it and I've had no luck searching for solutions so far because I don't know how to even call the operation I'm trying to do. I tried to add the rasters but I got a weird result.


texts: Extracting admin boundary data from OpenStreetMap?

texts:
I'm really just looking to get borders for cities and regions around the world. Ideally in a shapefile format.

Does anyone know how I can do that from OpenStreetMap?


texts: Creating copy of featureclass using ArcObjects does not set measures?

texts:
I am making an exact (empty) copy of an existing featureclass using the following code:

public static string createFCCopy(IFeatureClass pFromFC, IFeatureWorkspace pToFWS, string sNewFCName)
{
    IFeatureClass pNewFC;
    UID pUID;

    pUID = new UIDClass();
    pUID.Value = UID_FEATURECLASS; // UID_FEATURECLASS is a constant set to "esriGeodatabase.Feature"

    sShpFld = pFromFC.ShapeFieldName;
    pNewFC = pToFWS.CreateFeatureClass(sNewFC, pFromFC.Fields, pUID, null, pFromFC.FeatureType, sShpFld, "");
}

The problem is that the resulting copy does not have Measures and Z set like the original.

Is there a way of specifying the fields set that preserves the HasM and HasZ values in the Geometry Def?


texts:
I'm trying to spatial join bus stops and census block groups. However, these are a bit tricky with walking distance. Many bus stops are right on the borders of census block groups or within walking distance of others, as shown below.

I've buffered them 1320 feet (the proper coordinate system is being used) so that each bus stop circle is large enough to touch or cover every census block group that is within walking distance. See below.

I want to figure out how to do a one to many spatial join or the equivalent so that, for each census block group, I have a record of each bus stop inside of it or within walking distance of it. I've tried all sorts of combinations within "Join Attributes by Location" and none seem to work. The bus stop layers have individual stopID's and each census block has a GeoID. I'm trying to either get an output that has each census block that is within or intersecting (I think these are the right terms) a bus stop or vice versa. Maybe something else would work better?

Here are parts of the attribute tables for block groups and bus stops respectively. The lon and lat for bus stops are the original points, but they are buffered.

Update: I tried using field calculator and got this, which still fails.


texts:
I want to copy a geometry with Python OGR within a loop:

I tried the following, but I get ERROR 1: Empty geometries cannot be constructed

import ogr
import copy

d = ogr.Open('sampleData.geojson')
l = d.GetLayer()

for f in l:
     gCurrent = f.GetGeometryRef()
     gPrevious = copy.copy(gCurrent)

I know I can't just assign gPrevious = gCurrent since it only references the geometry. But why is it trying to construct an empty geometry?


texts: How can I clip/filter my .unmask() to only unmask within a region?

texts:
When I mask, all the masked pixels have no value. So I go to unmask, but it then assigns a value of 0 to every single pixel, including outside of my region. How can I only have the unmask work within the boundaries of my region? I know of .clip and .clipToCollection and .filterBounds, but each one is not fixing the problem. My code:

//attempt at filtering out non-field bits
var classDiffIndex = cropFields.gt(0);
var connCount = classDiffIndex.updateMask(classDiffIndex).connectedPixelCount(40,true);
var classDiffIndex = cropFields.updateMask(connCount.gt(39)).unmask();
// var classDiffIndex = cropFields.where(connCount.gt(39), 0);
Map.addLayer(classDiffIndex,{min:0, max:1, palette:['000000', 'bb6666']},"Classified Difference Index L8")

Where I essentially classified my fields, used .connectedPixelCount to mask out the obvious non-field pixels, updated the mask to mask out places with less than 39 connected pixels, and then unmask the masked to give them values of 0. You can see in the commented out line another way that I tried to do this.


texts:
My question has overlap with Changing colours in GeoPandas?, but unfortunately still unanswered: I want to plot a multiline shapefile in 1 color.

import geopandas as gpd
multiline_example = gpd.read_file('multiline_example_filepath.shp')
multiline_example.plot()

This works fine so far, except that the lines have multiple random colors:

Now I simply want to assign 1 color for all lines. Is this possible, and if so, how?

What I found so far:

On the GeoPandas site, some plotting-examples are given (http://geopandas.readthedocs.io/en/latest/mapping.html). Here, they simply use

multiline_example.plot(color='green')

However, if I try this, I get the following error:

TypeError: plot_dataframe() got an unexpected keyword argument 'color'

Why doesn't this work?

I have been able to choose a column (where the color is dependent on the column values), as well as a colormap, but the results are still different colors for different lines.

multiline_example.plot(colormap = 'Greens')
multiline_example.plot(column = 'a_column_name')

Simply by updating from GeoPandas 0.1.1 to 0.3.0.

multiline_example.plot(color='green')

works fine now.


texts: Using multilingual names in OpenStreetMap

texts:
In OpenStreetMap one can set building names for each building.

Available is for example:

name as default name and name:de for its German translation.

Example:

name Italian Restaurant

name:de Italienisches Restaurant

However, with this syntax in openstreetmap.de both names are displayed in the map, positioned below each other (which looks very ugly). How can I avoid this behavior, so only one name is displayed (in case of German visitor = German name preferred)?


texts: Split lines at vertices based on length and angle in QGIS

texts:
I have polyline data that represents watermains. I want to break polyline features up based on some point layers to input into another software package - the points represent valves, fittings, etc.  Currently a single polyline feature may have several point features on it, as well as some bends ranging from minor (a few degrees) to signficant (up to 90 degrees).

Ideally I want to break the polyline based on criteria such as:

Where a bend is greater than say 5 degrees
Where the length is greater that say 100m
Based on points in a specific layer

I tried to utilise "Split by Points" command but where the polylines had bends the new line would be straight through.  I tried this with various settings but couldnt achieve a good split.

I tried "V.split" with the "No of Vertex" set to 2 but this broke the lines at every vertex (eg on curves or poorly digitised sections). I then run "Split by Points" but this generated a huge number of short lines.  I had a similar result with "Explode" command.

I tried "Extract Vertices" command but couldnt figure out a way to weed out the points that were too close or on small bends.

I also couldnt find a plug in to achieve what I need.

Is there an alternate method to achieve this that I might have missed.


texts: How to calculate the polygon area and create a column of results in R

texts:
I'm working with shapefile in R and I need to calculate the polygons' area that I created by Gdiference function, So ,now I need to create a column with the size of  freshly  polygons created, because after that I need take out the small polygons which are not important to my academic research

I didn't use any function yet.


texts:
I updated to QGIS 3.4 on Ubuntu, but there are some functions that are not working so I want to downgrade. Therefore, I have several questions:

How to downgrade or reinstall to some older version easily?
A safe, standard and easy way to install multiple QGIS versions on Ubuntu?

Please Note: I have investigated a few similar questions but they are old and related to QGIS 2, nevertheless, QGIS 3 has significant changes.


texts: Tracing up a stream network & tabulating attributes of polygons it passes through

texts:
I have an ArcGIS question that is either very easy or impossible (my favorite kind). I am somewhat inexperienced when it comes to dealing with network analysis, so maybe I'm missing something major here.

I have a stream network covering a very large area & some census data. My problem is: I want to take each of the highest-order river mouths and associate a population value with it, which will tell you "here's how many people live in the drainage area derived from this pour point".

I understand the usual way to do this would be to delineate catchments using ArcHydro or Spatial Analyst Hydrology tools, which I've done many times (then I could associate said catchments w/ census data). In this case, however, the area of interest is huge, and the processing time for even one raster operation seems to be far longer than is acceptable.

Since I can't imagine that there's any way to delineate catchments w/o involving raster processing, I'm wondering if there's a way to do something like the following rough workaround:

Given a feature class of pour points, have ArcGIS go through each pour point & determine the upstream river network. I also have a separate shapefile of watershed polygons for the area, with associated population attribute. Then, tracing down the network to the river mouth, it could tell when the network crosses a polygon boundary, and then "add" the population of the new watershed it has entered to the subsequent downstream reach. So, it'd be kind of like a weighted flow accumulation, except the "cells" would be large watershed polygons, & it would need to know, as it traces along the network, when it's crossed into a new one. By the time it reaches the mouth, it will have tabulated the total populations of all the polygons the network has passed through.

In the following image:
One river mouth of interest is circled in red (there would be hundreds of these, probably). The higher-order streams are selected in turquoise just for more visual clarity. Basically, I just want to see how many of the watershed polygons upstream the network leading to that mouth propagates through, & add up their populations.

Is anything like this at all possible? I would greatly appreciate any insight! Thanks!

(One non-automated way to do what I want is to put a flag at the river mouth using Utility Network Analyst, cross my fingers & hope that it's been placed correctly, use Trace Upstream to select the features connected to that mouth, extract those, & count up the populations of the watershed polygons they intersect with. Now if there was a way to automate doing this hundreds of times... -- unfortunately I don't know how to access that toolbar via arcpy or automate things that require human clicking)


texts:
I have a large number of shapefiles in OSGB (EPSG:7405), with no .prj file that I would like to convert to WGS84 (EPSG:4326).

Can you let me know if this is possible in QGIS and, if so, how, and, if not, indicate another tool that can do this?


texts:
Why my "OpenLayers" not displayed added layer?

window.setWMS = function( WMSN ){
    window._blockEvents = true;
    var url = WMSN[0];
    var layer = WMSN[1];
    var server = WMSN[2];
    var wms = new ol.layer.Tile({
    source: new ol.source.TileWMS({
               url: url,
               params: {'LAYERS' : layer },
               serverType: server,
               crossOrigin: ''
           })
       });
    map.addLayer(wms);
    window._blockEvents = false;
 }

URL: 'http://mapserver.heller-ig.de/osm/de/technical'
Layer: 'Germany'
Server: 'mapserver'

The layer does not appear.

e.g:
URL: 'http://wms.geo.admin.ch/'
Layer: 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'
Server: 'mapserver'

It works flawlessly.


texts: GDAL's SetProjection() produces error: (Error) GDAL failure (1) missing [

texts:
I'm trying to compute a CHM (Canopy Height Model) using GDAL for Python.

A_TIF = os.getcwd() + xyzlocation + folder + "\\dtm.tif"
B_TIF = os.getcwd() + xyzlocation + folder + "\\dsm.tif"
OUT_TIF = os.getcwd() + xyzlocation + folder + "\\chm.tif"

ds1 = gdal.Open(A_TIF, gdalconst.GA_ReadOnly)
ds2 = gdal.Open(B_TIF, gdalconst.GA_ReadOnly)

arr1 = ds1.ReadAsArray()
arr2 = ds2.ReadAsArray()

# subtract every value from both rasters
result = np.subtract(arr2, arr1)

# get attributes from input raster 1 and set them to the output raster
driver = gdal.GetDriverByName("GTiff")
output = driver.Create(OUT_TIF, arr1.shape[1], arr1.shape[0], 1, gdal.GDT_Float32)
output.SetGeoTransform(ds1.GetGeoTransform())
output.SetProjection("EPSG:3067") # (Error) GDAL failure (1) missing [

output.GetRasterBand(1).WriteArray(result)

The line mentioned above produces an error:

  (Error) GDAL failure (1) missing [

Why is this?

Also, this code may fail to produce the CHM (results in 1KB file). But this is not the point of the question.


texts: Create screenshot of each polygon using QGIS

texts: I have a grid covering some area and roads shapefile on the map. Now I want to make a screenshot of each grid square and save it as a picture. How I can do that using qgis? I have searched for plugins but with no success. Also I have tried to use print composer but I can't do the right thing for each square.


texts: How to load a weighed shapefile in networkX

texts:
I have a added a length table in every line of my shapefile which contains lines that represent roads, and I want to create a weighted graph with this data using the length table as weights.

I have used this answer to load my shapefile and create the graph with NetworkX.

I am wondering how can I get the weights defined in the table "length", so I can show in my graph.

Edited
Result after using @gene 's solution to draw the graph.

pos = {v:v for v in weighted_G.nodes()}

labels = nx.get_edge_attributes(weighted_G,'weight')

nx.draw_networkx_nodes(weighted_G,pos, node_size=10,node_color='r')
nx.draw_networkx_edges(weighted_G, pos)
nx.draw_networkx_edge_labels(G,pos,edge_labels=labels)
# plt.xlim(577000, 579500) #This changes and is problem specific
# plt.ylim(9718500, 9721000) #This changes and is problem specific
plt.xlabel('X [m]')
plt.ylabel('Y [m]')
plt.title('From shapefiles to NetworkX')
plt.show()
plt.savefig('graph.eps', format='eps', rasterized=False)


texts:
Looking for help with a problem in QGIS. I'm using QGIS 2.2 and 2.4 for potential analysis of surfaces. Data are based in gdb datasets that were created in ArcGIS and made available to me. Some gdb datasets I can easily insert as vector shapes. A set (2.5GB) but it makes problems. It opens only one layer of many layers from the data set. I was told by the supplier of the data that it is a compressed gdb, that should not be used otherwise than in the compressed form. ArcGIS can handle it.

Is it possible in QGIS for a setting to make or is there an extension that can handle that?


texts: Get the coordinates of the snapped and clicked point in ArcGIS Engine

texts:
I am developing an ArcGIS Engine program. I am using the code below to activate snapping to a layer programmatically. I want to get the coordinates of the snapped point (clicked point). I know I must use ESRI.ArcGIS.Controls.ISnappingResult interface. I do not know how. Can anyone help me?

 public void AddNewSnapAgent(IEngineEditor editor)
    {
        //IEngineEditor editor = new EngineEditorClass();
        IEngineEditLayers editLayers = editor as IEngineEditLayers;
        IEngineSnapEnvironment snapEnvironment = editor as       IEngineSnapEnvironment;

        //Check that the user is editing; otherwise, there will be no snap agent loaded.
        if (editLayers.TargetLayer == null)
        {
            System.Windows.Forms.MessageBox.Show("Please start an edit session");
            return;
        }

        //Clear all existing snap agents.
        snapEnvironment.ClearSnapAgents();

        //Create a feature snap agent.
        IEngineFeatureSnapAgent featureSnapAgent = new EngineFeatureSnap();
        IFeatureClass layerFeatureClass = editLayers.TargetLayer.FeatureClass;
        featureSnapAgent.FeatureClass = layerFeatureClass;
        featureSnapAgent.HitType = esriGeometryHitPartType.esriGeometryPartVertex;
        //Activate only the snap agent for the target layer.
        snapEnvironment.AddSnapAgent(featureSnapAgent);
    }


texts:
My problem is with the print composer: it shows a huge red cross. I thought it is because of a wrong image format, because there was a smaller cross on one of the images. So I deleted it, then deleted all of the images I have used, but it is still there.

Can someone help me how to remove it?


texts: geoserver wps gs:clip error - "This XML file does not appear to have any style information associated with it" hence "Failed to parse process inputs"

texts:
I'm working on GeoServer 2.10.1 , trying to work on gs:clip in wps.

I'm following this tutorial :

http://geoserver.geo-solutions.it/edu/en/wps/chaining_processes.html

and I'm using same input layers. When I execute the process i get the following error:

This XML file does not appear to have any style information associated
with it. The document tree is shown below.

<ows:ExceptionReport version="1.1.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8081/geoserver/schemas/ows/1.1.0/owsAll.xsd"><ows:Exception exceptionCode="NoApplicableCode"><ows:ExceptionText>Failed to parse process inputs</ows:ExceptionText></ows:Exception></ows:ExceptionRepor

here is the screenshot of what i m doing......

the xml code from subprocess looks like below

<?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
  <ows:Identifier/>
  <wps:DataInputs/>
  <wps:ResponseForm/>
</wps:Execute>


texts:
Project QGIS have two layers: 'Points', 'Lines'.

Layer 'Points' have field 'id_point'.

Layer 'Lines' have fields 'begin' and 'dest'.

How to change feature attribute 'begin' and 'dest' in layer 'Lines' by start and end of line intercsect whith points from layer 'Points' on-the-fly?

I write some code.

from qgis.core import *
from qgis.gui import *
from qgis.utils import iface

allfeatures = None
index = QgsSpatialIndex()
indexMade = 0
refLayer = None

myLayer = QgsMapLayerRegistry.instance().mapLayersByName( 'Lines' )[0]
beginField = myLayer.fieldNameIndex( 'begin' )
destField = myLayer.fieldNameIndex( 'dest' )

def updateFeatureAttrs( fId, geom=None ):
    f = myLayer.getFeatures( QgsFeatureRequest( fId ) ).next()
    if not geom:
        geom = f.geometry().asPolyline()
    myLayer.changeAttributeValue( fId, beginField, spJoin('Points','id_point','None',geom[0]))
    myLayer.changeAttributeValue( fId, destField, spJoin('Points','id_point','None',geom[-1]))

myLayer.featureAdded.connect( updateFeatureAttrs )
myLayer.geometryChanged.connect( updateFeatureAttrs )

def spJoin(layerName, refColumn, defaultValue, geom):
    if geom is None:
        return defaultValue

    global allfeatures
    global index
    global indexMade
    global refLayer

    if refLayer is None:
        for layer in iface.mapCanvas().layers():
            if layerName == layer.name():
                refLayer = layer
                break

    if indexMade == 0:
        index = QgsSpatialIndex()
        allAttrs = layer.pendingAllAttributesList()
        layer.select(allAttrs)
        allfeatures = {feature.id(): feature for (feature) in refLayer.getFeatures()}
        for f in allfeatures.values():
            index.insertFeature(f)
        indexMade = 1

    fid = None
    ids = index.nearestNeighbor(geom,0.00001)
    for id in ids:
        fid = id
        break # Only get the first match.
    if fid is not None:
        return allfeatures[fid].attribute(refColumn)

    return defaultValue

It work when i create new lines, but when change lines get this error:

Traceback (most recent call last):
              File "/home/xxx/Untitled-0.py", line 18, in updateFeatureAttrs
                myLayer.changeAttributeValue( fId, beginField, spJoin('Points','id_point','None',geom[0]))
            TypeError: 'QgsGeometry' object does not support indexing


texts: Creating equally spaced points within shapefile with multiple polygons using QGIS?

texts:
In QGIS 2.18.  I have a vector shapefile with multiple polygons, all of these are squared and have their own attributes. Inside these polygons I will have more (small) polygons that will represent areas where it cannot be constructed.

I need to create as many points as possible within each square but excluding the inner polygons (mountains). The points should be equally spaced (i.e. 250 m) from each other and cannot be placed in the edge of the bigger polygon, necessarily have to be inside.


texts: Getting rid of feature points within buffer using ArcGIS Desktop?

texts: I've created my buffer, 10 m around surrounding streets, now I need to remove all trees (points) that are within that buffer but I'm having trouble doing so! I've tried clipping but I guess my input/clip features are wrong.


texts: How can I show the details from the highest zoom of OSM webmaps in QGIS for printing?

texts:
I would like to compose a large format map for printing in QGIS with the highest detail possible.  My process looks like this,

Install "QuickMapServices" plugin
Click the "QuickMapServices" button and choose OSM >> OSM Standard
Pan to my selection area
New print layout (ctrl + p) and make a name
add item >> add map (its now at the zoom where I want more detail displayed and I don't know what to do).


texts: Polygon to raster conversion failure - workaround for very small polygons?

texts:
As one of many processes within a workflow/script, I need to convert polygons to rasters. I am using the feature_to_raster tool in ArcGIS 10.1.  This is done within a python script, but for the purpose of trouble-shooting I'm also trying these things in ArcMap.

For most features the process works fine, but there are a handful of features which result in empty rasters (i.e., only NoData cells).  I do need to have at least one data cell created for each polygon; empty rasters are not acceptable.

I determined that the problems are very small polygons which don't intersect any cell center of my reference (snap) raster, since the cell size is relatively large in comparison to the polygon.  If I don't specify the snap raster, I've found that it does successfully create a raster with a single cell that does have a data value.  But I DO need to specify a snap raster so that all my outputs line up, and when I do this, I end up with the empty rasters.

I've tried using the alternate tool, polygon_to_raster, and specifying the cell assignment type to either MAXIMUM_AREA or MAXIMUM_COMBINED_AREA, but I still get the empty rasters.

Does anyone know of a workaround?

Thanks!

EDIT 1:  I got polygon-to-raster to work when I added an arbitrary priority field.


texts: How to get a grid 500m x 500m on map composer

texts:
I need to make a map on map composer, with a grid layed on it which is 500m x 500m. however the only way I could find of doing this was by adding a grid to my map, found within item properties.

This works fine however to  get a grid of 500m, I have had to set the 'Interval' to

  x = 0.009200000000
  Y = 0.009200000000

with the 'Interval units' set ot 'Map units' which in this case is 'Meters'.

As you can see from the image below my grid 'By eye' is ~500m.

Is there an accurate way to produce a grid to fit a required distance accuratly?.

I am usign QGIS V3.4


texts:
I have the problem with encoding because I need Polish letters and encoding="utf-8" didn't work.
import geopandas
df = geopandas.read_file(r'/home/gis/adresypolska/PRG_PunktyAdresowe_POLSKA.shp', layer ='PRG_PunktyAdresowe_POLSKA', encoding = "utf-8")

I got this, look at second and third column:
How can I solve that?


texts: How to calculate area or centroid of the_geom in CartoDB?

texts:
Is it possible to calculate area or centroid of the_geom in cartoDB?

It would not be a huge time saver, and I am doubtful that it is an option but figured I would ask.


texts: Read / write MapInfo Tab and convert it to CSV format

texts:
I am very new in python and trying to read MapInfo (.TAB) file and convert it in to CSV format in following way:
import geopandas as gpd

input_file = 'F:/.../QGIS/sites.tab'

test = gpd.read_file(input_file, driver="MapInfo File")

output_file = 'F:/.../QGIS/new_sites_copy'

test.to_file(output_file, driver = "CSV")

The code creates the CSV file which contains only the header similar to MapInfo Tab file but no other attributes are available in csv file in respect to column heading. Below is the snip of output csv file:

And below is the error that showing after executing the code:

I have installed these modules for this purpose:
numpy, pandas, shapely, gdal, fiona, pyproj, rtree, geopandas
Below are the supported drivers by geopandas (gpd.io.file.fiona.drvsupport.supported_drivers):
{'AeronavFAA': 'r', 'ARCGEN': 'r', 'BNA': 'rw', 'DXF': 'rw', 'CSV': 'raw', 'OpenFileGDB': 'r', 'ESRIJSON': 'r', 'ESRI Shapefile': 'raw', 'FlatGeobuf': 'rw', 'GeoJSON': 'raw', 'GeoJSONSeq': 'rw', 'GPKG': 'raw', 'GML': 'rw', 'OGR_GMT': 'rw', 'GPX': 'rw', 'GPSTrackMaker': 'rw', 'Idrisi': 'r', 'MapInfo File': 'raw', 'DGN': 'raw', 'PCIDSK': 'rw', 'OGR_PDS': 'r', 'S57': 'r', 'SEGY': 'r', 'SUA': 'r', 'TopoJSON': 'r'}
How do I solve this?


texts: How do I automatically print individual regions from a MapInfo table to a PDF without interactively selecting and printing each one?

texts: I need to automatically print individual polygons that make up a table.  I need them to be a close-up view of the polygon and print to a PDF file.  It is very time consuming to print each one manually.  I am thinking I will have to write a program to accomplish this, unless there is a tool that currently exists.  Any ideas?  The currrent process is to zoom in on the desired region until it fills the layout window.  I then print the layout to a PDF, select the next region, and repeat.


texts: Do R @data and coordinates() preserve structure?

texts:
I need to assign centroids for census blocks to a data frame, my way of doing so is listed below. Since gCentroids doesn't return any UID, if I cbind the centroid coordinates() to the census @data will the centroids be assigned to their correct corresponding census blocks?

census=CENSUS@data

CENTROIDS = gCentroid(CENSUS,byid=TRUE)

centroids=as.data.frame(coordinates(CENTROIDS))

censcent=cbind(census, centroids)

df=merge(df, censcent, by=geoid)


texts:
I have the following code:

   var map = {};
   var googleMercator = new OpenLayers.Projection("EPSG:900913");
   var wgs84 = new OpenLayers.Projection("EPSG:4326");
   var lyr_osm = {};
   var texas = {};
   var lll = {};
   var query = {};
   var fin = {};
   var fout = {};
function init(){
    OpenLayers.ProxyHost = "proxy.cgi?url=";
//--------------------------------------------------map
    $(document).ready(function () {
    map = new OpenLayers.Map('map',
                    {
                    numZoomLevels: 18,
                    projection: googleMercator
                    }
       );
    });
//--------------------------------------------------layers definition
    var lyr_osm =new OpenLayers.Layer.OSM("OSM");
//--------------------------------------------------setting wms layer
       texas = new OpenLayers.Layer.WMS("Texas",
           "http://54.228.242.237:80/geoserver/us_admin/wms",
           {
           'VERSION' : '1.1.0',
           layers: "us_states_gen",
           format: "image/png",
           transparent: true,
           cql_filter: "state_name LIKE 'Texas'",
           },
                {isBaseLayer: false,
                visibility: true,
                sphericalMercator: true,
                }
           );
//---------------------------------------------------filters
                             fin = new OpenLayers.Filter.Comparison({
                                     type: OpenLayers.Filter.Comparison.GREATER_THAN,
                                     property: "store_id",
                                     value: 500
                             });
                             fout = new OpenLayers.Filter.Comparison({
                                     type: OpenLayers.Filter.Comparison.LESS_THAN,
                                     property: "store_id",
                                     value: 100
                             });
                             query = new OpenLayers.Filter.Logical({
                                    type: OpenLayers.Filter.Logical.AND,
                                    filters: [fin, fout]
                             });

    var awfspc = new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        url: 'http://loclahost/geoserver/stores/ows',
        featurePrefix: 'stores',
        featureType: 'stores',
            defaultFilter: fin,
            srsName: "EPSG:3857"
    });

    lll = new OpenLayers.Layer.Vector("Points", {
             externalGraphic: 'http://localhost/black_marker32.png',
             graphicHeight: 20,
             graphicWidth: 20,
          strategies: [new OpenLayers.Strategy.Refresh(), new OpenLayers.Strategy.Fixed()],
          protocol : awfspc,
    });

//--------------------------------------------------------------------map controls
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.addControl(new OpenLayers.Control.MousePosition());
//--------------------------------------------------------------------add Layers
    map.addLayers([lyr_osm, texas, lll]);
//--------------------------------------------------------------------map position
    var mapCenter = new OpenLayers.LonLat(-99, 31.3);
    mapCenter.transform(wgs84, googleMercator);
    map.setCenter(mapCenter,6);
//  map.zoomToExtent();
}

When I use fin filter or fout filter, the filters are applied and they return good. When I use querry filter, nothing is returned, no error and no data.

Any clue? Thanks!


texts: I have converted an XML (NAS) - File into a SQLite-Database using ogr2org - which worked quite well. Now I'd like to read the data using Python (3.72) - which works quite good as well. But there is a datatype (columntype) called JSONSTRINGLIST, which I have never seen before - even google seems not to know it. Can anybody tell me how to convert the data to a Python tuple or list?


texts: Mapping and Pedestrian Routing on Android (guidance needed)

texts:
I 'm new to this stuff (GIS).
I was assigned a project in which i have to implement for the Android platform:

showing up maps
showing up routes
showing up nearby POIs.

Everything has to be offline!!(loaded on the Android device!) with NO connection to Wifi or GSM network.
Please correct me if i'm wrong (as i stated above this is brand new stuff for me - i never did a project in this field, though 20 years in business):

Can the above points be solved with the following tools (respectively)?

using OSMDroid (with ZIPped Openstreet maps)
using Spatialite (just quickly read through some articles but not sure if i can use it!) - or should i use pgRouting (i understand i have to port it to SQLite - but is it possible?))
using "simple maths" (great-circle distance,...)

The above points have to be implemented (as far as the amount of data concerned separately) for maps like Italy, Spain, France, Germany, and Greece.

I need some guidance!! Is there anyone who has done something similar?

Thanks in advance!


texts: How to create an animated map in QGIS which cycles through column values

texts:
So I have a shapefile with 40 polygons(rows) and 30 columns where each column represent values from different time period.

I have created a map with graduated style by choosing values from one column but I want to do the same for every column. And if it's possible in QGIS, I need an animation or at least a slider to see differences through time.

Do I have to do that through web application or QGIS is capable of that (without writing a script). I am aware of time manager and mmqgis plugins but I believe they don't fit to my needs.


texts: QGIS does not get installed on Windows 10

texts:
A few weeks ago I formatted my laptop where among other things QGIS 3.4 was installed.

In the last 48 hours I was busy trying to reinstall it, but until now without succeess.
I have a Thinkpad with Windows 10 PRO. I installed versions 3.4 and 3.2 several times: everything goes well but I do not get the launch icon and in "ProgramFiles" the postinstall.bat icon gives the message:

  Windows cannot access the specified device, path, or file. You may not have the appropriate permission to access the item.

With a Windows technician I have checked all the admin settings in my PC. We also have created an administrative account. Same issue.

Edit:
I have installed using OSGEO4W. It was installed not only QGIS 3.10 but also a lot of software which I would like to get rid of. When I open QGIS I ge this message: ' An error has occurred while executing Python code:

  *PermissionError: [WinError 5] Access is denied
  Traceback (most recent call last):
    File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\saga\SagaAlgorithmProvider.py", line 86, in loadAlgorithms
      version = SagaUtils.getInstalledVersion(True)
    File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\saga\SagaUtils.py", line 141, in getInstalledVersion
      universal_newlines=True,
    File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 756, in init
      restore_signals, start_new_session)
    File "C:\OSGEO4~1\apps\Python37\lib\subprocess.py", line 1155, in _execute_child
      startupinfo)
  PermissionError: [WinError 5] Access is denied


texts: Counting overlaps between raster files using ArcPy?

texts: Would it be possible to simply detect and count overlaps between raster files, i.e. not polygons against rasters, using arcpy? By default I don't have the spatial analyst extension for ArcMap 10.1 but if need be I could acquire one temporarily. I need to iterate over small tif files in various directories and test them against large rasters.


texts: How to break a single polyline into multiple polylines in ArcMap 10

texts: I want to delete certain segments in a selected segment of a line in a line shapefile in ArcMap 10.


texts: PostGIS - Get geofence polygon points within 100 metres of an existing geofence

texts:
Let's say I have a geofence polygon with the following coordinates

POLYGON((-36.861986 174.726745,-36.859241 174.730442,-36.859821 174.730976,-36.862321 174.728156,-36.861986 174.726745))

I'd like to be able to generate another set of polygon points from this that is within a 100 metre radius. Is there any formula to achieve this?

My use case is that if I have an existing geofence polygon, I want to create another geofence polygon surrounding it in a distance of 100 metres.

I'm using the following query to insert data into my table. The columns 'geofence' and 'geofence_buffer' are of type geography. The column with the name 'geography' is of type text. I just use that for a quick reference.

insert into site(name,status,client_id,geofence_type,geography_drawn,geofence,geofence_buffer)
values('Fanshawe','Active',1,1,'POLYGON((-36.849530 174.760984,-36.839295 174.763729,-36.841696 174.779093,-36.854061 174.774291,-36.849530 174.760984))',
      'SRID=4267;POLYGON((-36.849530 174.760984,-36.839295 174.763729,-36.841696 174.779093,-36.854061 174.774291,-36.849530 174.760984))',
      (select ST_Buffer(ST_GeographyFromText('SRID=4267;POLYGON((-36.849530 174.760984,-36.839295 174.763729,-36.841696 174.779093,-36.854061 174.774291,-36.849530 174.760984))'),100)));

Data gets inserted just fine but when I run the following query to find if a point exists within a geofence_buffer, I get the error below.

NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
LINE 1: ...ect * from site where ST_DWithin(geofence_buffer, 'SRID=4267...
                                                             ^
ERROR:  Operation on mixed SRID geometries
SQL state: XX000

The query I use is

select * from site where ST_DWithin(geofence_buffer, 'SRID=4267;POINT(-36.848362 174.764417)',0.0,false);

However, if I query within a geofence like this, then everything works fine.

select * from site where ST_DWithin(geofence, 'SRID=4267;POINT(-36.848362 174.764417)',0.0,false);


texts:
I want to extend a raster layer to another layer's extension (my input raster layer is smaller). The new raster cells should have 0 value.

Is this possible in QGIS?


texts:
I have used the Lines to polygons tool to turn a city boundary linestring feature into a polygon. However, the tool has connected some nodes more than one time, resulting in multiple edges .

I would like to remove some edges but not the nodes, therefore I cannot use the Node tool. Is there any way to do this (or to keep the tool from connecting node more than one time)?

Thanks


texts:
I want to create a plugin that adds a raster layer (published on geoserver) on QGIS via PYQGIS.
As long as i enable the advertised option in the layer publish panel the layer is easily added on the QGIS.
But when I unchecked the advertised option, the layer is not added.
So, please suggest a method through which i can create a custom plugin that adds published WMS layer (whose layer preview is OFF) on the QGIS desktop?


texts:
I have a linestring in a vector layer in QGIS. How can I expot/save this linestring as a GPX file?

I tried to select the linestring, then right click on the vector layer and choose "Save selection as..." and then I choosed GPX format and saved it. But I got this error message:

  Export to vector file failed.
  Error: creation of field code_06 failed (OGR error: Field of name 'code_06' is not supported in GPX schema. Use GPX_USE_EXTENSIONS creation option to allow use of the  element.)

The GPX file is created, but it contains no coordinates. Is there any settings I should do to avoid this error?

How can I export a linestring to a GPX file in QGIS?


texts: Update a feature class from a feature class in another geodatabase

texts:
I have a feature class that I update occasionally. Most of the time it is just adding new features, but sometimes I do update attributes on existing features. However, I need to update a 'copy' of this feature class within another database. I have previously just deleted the feature class in the second database and remake it with the updated first feature class. My vendor would like me not to do this.

Is there another way of updating a feature class within a separate database?

I am using ArcGIS Desktop 10.3


texts: Deleting old schema locks from ArcGIS Desktop

texts:
I am going through old data on our GIS System (hoping to improve our file storage), and discovered that we have multiple schema locks on files that date back to 2017, 2018, and 2019.

A little bit of background: we use a shared file system (shared between 5 computers). The schema locks I've encountered have been from all of these computers, and I have confirmed with my co-workers that they don't have ArcGIS open. The format of these locks is .shp.COMPUTERNAME.NUMBERS.sr.lock (see picture below).

How do I get rid of these locks and what created them?


texts: OpenLayers 4 moving polygon like a circle with Modify interaction

texts: In example http://openlayers.org/en/latest/examples/draw-and-modify-features.html when you hover on the center of the circle appears a point and you can move circle. Is it possible to do the same for the polygon?


texts: My class using ogr to calculate distance is returning incorrect results away from the equator

texts:
In an answer to this question ustroetz kindly provided some sample code for use of ogr to do lat/lon distance and point in polygon calculations.

I've created a Python class based on his example to do distance calcs but the results aren't correct.  I realize that I could simply use haversine but the class is meant to grow to include other ogr functions, this is just the first step.

Allowing for the small difference due to the earth not being a perfect sphere, I'd expect the distance between degrees of latitude to be approximately 60 nautical miles anywhere from the equator to the poles, but the code in my class is returning approx 60 nm at the equator and 89 nm at 47 degrees latitude.

I'm geo-ignorant so don't know how to go about fixing this.  I assume that the problem is in the class init where the coordinate transform is set up.  Perhaps EPSG 3857 is not the correct projection to convert to from EPSG 4326?

Since distance is not calculating correctly I think that a point in polygon method (to be added to the class) will also be inaccurate unless I perform a repair.

#!/usr/bin/python

from __future__ import print_function
from osgeo import ogr
import osr
import sys

class Geo(object):
    def __init__(self):
        """
        Set up coordinate transform
        """
        inSpatialRef = osr.SpatialReference()
        inSpatialRef.ImportFromEPSG(4326)           # WGS 84
        outSpatialRef = osr.SpatialReference()
        outSpatialRef.ImportFromEPSG(3857)          #Spherical mercator
        self.coordTransform = osr.CoordinateTransformation(inSpatialRef, outSpatialRef)

    def distance(self, position_1, position_2, units="km"):
        """
        Returns distance in 'units' (default km) between two Lat Lon point sets
                position_1 and position_2 are dicts containing "lon" and "lat"

                Units (optional) can be "km", "sm", or "nm"
        """
        point1 = ogr.Geometry(ogr.wkbPoint)
        point1.AddPoint(position_1["lon"], position_1["lat"])
        point1.Transform(self.coordTransform)

        point2 = ogr.Geometry(ogr.wkbPoint)
        point2.AddPoint(position_1["lon"], position_2["lat"])
        point2.Transform(self.coordTransform)

        raw_dist = point2.Distance(point1)

        print("Raw distance from ({0:6.2f}, {1:6.2f}) to ({2:6.2f}, {3:6.2f}) is {4:14.6f} km, "
            .format(position_1["lon"], position_1["lat"],
                    position_2["lon"], position_2["lat"],
                    raw_dist), end="")

        if units.lower() == "km":
            return raw_dist * 0.001
        elif units.lower() == "sm":
            #return raw_dist * 0.00062137
            return (raw_dist / 1000) * 0.621371192
        elif units.lower() == "nm":
            #return raw_dist * 0.000539956803
            return (raw_dist / 1000) * 0.539956803

if __name__ == "__main__":
        g = Geo()
        print("{0} {1}".format(g.distance({"lon":147.0, "lat":0}, {"lon":147.0, "lat":1}, "nm"), "nm"))
        print("{0} {1}".format(g.distance({"lon":147.0, "lat":47}, {"lon":147.0, "lat":48}, "nm"), "nm"))

The output produced by the code below is:

Raw distance from (147.00,   0.00) to (147.00,   1.00) is  111325.142866 M, 60.1107682357 nm
Raw distance from (147.00,  47.00) to (147.00,  48.00) is  164780.762454 M, 88.9744936905 nm


texts: Spatial Join problems in ArcGIS 10.1 - intersect polygon and lines

texts:
I have hurricane tracks (Lines) and Florida county boundary (polygon) and I want to extract only those hurricane tracks that intersect Florida.
In ArcMap 10.0 I used Spatial Join (from Analysis/Overlay) to join the hurricane tracks and Florida polygon map. This created a new shp file of only those tracks that intersected Florida. Importantly it kept the entire length of each of the hurricane track lines that intersected Florida.
I have tried repeating this in ArcMap 10.1 using Spatial Join and while it seems to intersect the hurricane tracks with Florida okay - the new shp file does not have the entire length for each of the hurricane tracks - only short bits of lines outside the Florida polygon boundary.

Can anyone provide guidance on why this may be the case - it is critical for this exercise to extract the those hurricane tracks intersecting Florida polygon but we need the entire length of each of the tracks for each of these hurricanes.


texts:
I am using ArcGIS Desktop 10.4.1 and trying to create a mailing list using parcel data. I need the parcel lines to be dissolved if they have the same owner name and are adjacent or adjoining. Afterwards, I need to select the new parcels that are 35 acres or more.

How do I dissolve parcel lines but still keep other attributes associated with the layer such as addresses?


texts: Error concatenating lines in Oracle Spatial

texts:
The function SDO_AGGR_CONCAT_LINES is returning an error when concatenating lines from a table with simple line geometries (SDO_GTYPE - 2002):

ORA-29400: erro do cartridge de dados
ORA-06502: PL/SQL: erro numérico ou de valor
ORA-06512: na "MDSYS.SDO_UTIL", linha 2101
29400. 00000 -  "data cartridge error\n%s"
*Cause:    An error has occurred in a data cartridge external procedure.
This message will be followed by a second message giving
more details about the data cartridge error.
*Action:   See the data cartridge documentation
for an explanation of the second error message.

I have checked, through SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function that all input geometries are valid.
If I try to group all the input geometries into one row, like:
SELECT SDO_AGGR_CONCAT_LINES(t.SHAPE) AS SHAPE
FROM my_input_lines t;

it returns the error described, but if I group by one particular field, like:
SELECT SDO_AGGR_CONCAT_LINES(t.SHAPE) AS SHAPE
FROM my_input_lines t
GROUP BY my_field;

it works with some fields (returns valid concatenated lines), but not with others (returns the error described). This means that the aggregate functions works merging some of the geometries, but not with others.
Any thougths on the possible solution?

Further developments:
By analysing the SDO_AGGR_CONCAT_LINES documentation from Oracle (as suggested in comments), it says that:

The topological relationship between the geometries in each pair of geometries to be concatenated must be DISJOINT or TOUCH (...)

Based on this I've tried a query to determine which objects did have interactions different then DISJOINT (no interaction) and TOUCH:
WITH T AS (
  SELECT
    A.DESIGNACAO,
    SDO_GEOM.RELATE(A.SHAPE, 'determine', B.SHAPE, 0.05) AS INTERACTION,
    A.OBJECTID AS OID1,
    b.objectid AS OID2
  FROM MOB_REDE_CICLAVEL_LN A
    INNER JOIN MOB_REDE_CICLAVEL_LN B
    ON A.DESIGNACAO = B.DESIGNACAO
      AND a.objectid <> b.objectid -- prevents results for interactions of the object with itself
      AND SDO_ANYINTERACT(A.SHAPE, B.SHAPE) = 'TRUE'
)
SELECT *
FROM T
WHERE t.interaction <> 'TOUCH';

I then found that were other interactions between the objects present in the table: 'EQUAL', 'COVEREDBY', 'OVERLAPBDYDISJOINT' AND 'COVERS'.
From this, I tried to discover if any of these types interactions was solely responsible for the resulting error, but doing something like the following, i.e., merging only the objects that present a specific type of interaction:
WITH T AS (
  SELECT
    A.DESIGNACAO,
    SDO_GEOM.RELATE(A.SHAPE, 'determine', B.SHAPE, 0.05) AS INTERACTION,
    A.OBJECTID AS OID1,
    b.objectid AS OID2
  FROM MOB_REDE_CICLAVEL_LN A
    INNER JOIN MOB_REDE_CICLAVEL_LN B
    ON A.DESIGNACAO = B.DESIGNACAO
      AND a.objectid <> b.objectid -- prevents results for interactions of the object with itself
      AND SDO_ANYINTERACT(A.SHAPE, B.SHAPE) = 'TRUE'
)
SELECT t.DESIGNACAO, SDO_AGGR_CONCAT_LINES(t.SHAPE) AS SHAPE
FROM MOBILIDADE.MOB_REDE_CICLAVEL_LN T
WHERE T.DESIGNACAO IN (
  SELECT DISTINCT DESIGNACAO
  FROM T
  WHERE t.interaction = 'COVERS'
)
GROUP BY t.DESIGNACAO;

returned error, for any of the identified interactions.
I then "corrected" the identified geometries through a GIS application (ArcGIS in this case) until I had no other interactions between the different geometries other then TOUCH and DISJOINT, but it still returns the same error.


texts: How can I export data containing umlauts from PostGIS to shapefile, without losing the umlauts?

texts:
I am exporting my Finnish (Finland) data from PostGIS to esri shapefile. I am using the PostGIS Shapefile Import/Export Manager and I don't see any way to specify the encoding of the shapefile's attributes in the .dbf file. My PostGIS table contains umlauts, but they are lost when the data is exported to the shapefile.

The following address is in my PostGIS table: 16 Itälahdenkatu.

The above address is changed to this in my shapefile (.dbf): 16 ItÃ¤lahdenkatu


texts: How to convert Google Earth KML to Raster with classes for Fragstats

texts:
I have digitized the Google Earth imagery for a 117 sq. km. area and have classified the land-use into forest and non-forest sites. I need to use this map for fragstats and calculation of landscape metrics. When I load the KML files into QGIS I don't get any information and I am stuck on how to go ahead with creating classes and creating a raster with forest and non-forest information.

I have looked into supervised and unsupervised classfication and the resolution obtained would not work very well for my study on forest fragmentation. I have also looked at land cover maps which are available for the region and they are not of use either.

How can I create a raster from a KML such that the raster contains class information?


texts: SyntaxError: expected expression, got '< Error While passing List Parameters in GeoServer View

texts:
Hello I am creating Geoserver view to view my result and for zoom to result.
My Sql Query is like SELECT * FROM geotable WHERE gid IN (%gid%)

View Parameters to Query like 1,2,3

Regular Expression like '^[\w\d\s]+$'

My Zoom function like

  function binddata(data) {
        myObject = JSON.parse(data.d);
        gid = [];

        for (var i = 0; i < myObject.length; i++) {
            gid.push(myObject[i].gid);
        }
        //var plcd = plcd1[0];
        ZoomtoParcelsByAcers(gid, SearchResultsLayer);
}

//Function to escape comma in viewparameters
    String.prototype.replaceAll = function (search, replacement) {
        var target = this;
        return target.replace(new RegExp(search, 'g'), replacement);
    };

    function EscapeCommasSemiColons(input) {
        return input.toString().replaceAll(",", "\\,");
    }

function ZoomtoParcelsByAcers(gid, SearchResultsLayer) {
        $.ajax({

            url: 'http://localhost:8080/geoserver/plotgeo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=plotgeo:vwnew&maxFeatures=5000&outputFormat=text/javascript',
            contentType: 'application/json',
            dataType: 'jsonp',
            jsonpCallback: "parseResponse",
            data: {

                viewparams: "gid:" + EscapeCommasSemiColons(gid)
            },

            success: function (response) {

                search(response);
            }
        });

 }

When i pass multiple parameters in geoserver it is working fine.
When i am using above code to zoom to result i am gettin Error like

   **<ServiceException>
      java.lang.RuntimeException: java.io.IOException
java.io.IOExceptionInvalid value for parameter gid
</ServiceException>**

Can anyone help what is error in it.


texts: Python script for select by attribute function for QGIS

texts:
The following is of course working, selects these features of my_layer that have attribute 1 for my_field2 and appends the corresponding attributes of my_field1 in my_list:

my_layer = iface.activeLayer()
indexmf = my_layer.fieldNameIndex("my_field1")
my_list = []

it = my_layer.getFeatures( QgsFeatureRequest().setFilterExpression ( u'"my_field2" = 1') )
my_layer.setSelectedFeatures( [ f.id() for f in it ] )
selection = my_layer.selectedFeatures()
for feature in selection:
    sfeat = feature.attributes()[indexmf]
    my_list.append(sfeat)

#and of course remove selection
layer.removeSelection()

Then, I would like to create a function to do the above:

[edited.. it is working]

def my_function(layer, list, fieldname, attribute, index):
    it = layer.getFeatures( QgsFeatureRequest().setFilterExpression ( u'"%s" = {0}'.format(attribute) %fieldname ) )
    layer.setSelectedFeatures( [ f.id() for f in it ] )
    selection = layer.selectedFeatures()
    for feature in selection:
        sfeat = feature.attributes()[index]
        list.append(sfeat)
    layer.removeSelection()

But when I call it nothing happens:

my_function(my_layer, my_list, "my_field2", 1, indexmf)

Could you please help me understand what I am missing?


texts: Finding specific area with coordinates out of a lot of LAS data?

texts:
I would like to extract spatial data out of a great amount of LAS data.

Unfortunately, there is no index or sth that could help me find which file is for what area.

Also, it is not possible to check all the data as the LAS files are big and can not load all of them.

I would like to know if is there a possibility to extract data out of a lot of LAS data?


texts: Is it possible to draw direction arrows using SLD of GeoServer

texts:
I have one record in MySQL with LINESTRING field which contains list of points.

Is it possible to draw direction arrows over whole line using SLD of GeoServer? Or i need split my one line?


texts: Deleting all fields from feature class with ArcPy?

texts:
How do I delete all of the fields from a feature class in a simple way?

I don't want to loop over the fields using the Delete Field tool because this method is very slow in ArcPy.

I am using a polygon feature class, and I tried arcpy.MultipartToSinglepart_management but the feature class result saved all the fields.


texts:
I want to apply an algorithm to calculate the clorophyll-a concentration of a reservoir using Sentinel 2.
To do this I need to create a mask using Sentinel's 2 band 11(infrared) to separate the water pixels from pixels with larger reflectance values than the water.
This is the algorithm:
(If B11 <=0.05 then 109.17*((1/B4-1/B5)*B6+ 19.03 else 0)

but I can't use if and else in QGIS.


texts: layer.addData - circle marker style pointToLayer

texts:
So, my problem resides when creating a layer. then adding data to it later. but the style feature not taking control. and it adding default style.

Here is some code that I have. That creates a layer. Then adds data to that layer. But my problem is once the layer has been created and added. The layer won't render any new points with the style.

Is there a style option for the add data function?

let tlll = []; let map = this.map; let lc = this.lcontrol; let tll = null;
let ml = mapdata.layers; let a = null; let b = null; let c = null;
let smf = this.styleFeature;
   Object.keys(ml).forEach(function(k){
        tll =  L.geoJson().addTo(map, {pointToLayer:smf});
        a = k;
        Object.keys(ml[k]).forEach(function(v){
             console.log(v);
             b = v;
             Object.keys(ml[k][v]).forEach(function(vv){
                  tll.addData({
                       type: 'Point',
                       coordinates: [ml[k][v][vv].lng,ml[k][v][vv].lat],
                       properties: ml[k][v][vv]
                  });
        });
   });
   c = lc.addOverlay(tll,b,a);
   tlll.push(c);
});
this.testloclayer = tlll;
this.map.setView(tll.getBounds().getCenter());


texts: Using ArcPy.AsShape results and converting them to feature class?

texts:
I have a GeoJSON that I'm trying to convert to a feature class or shapefile using ArcPy.

The original GeoJSON is taken from a web link here:

geojson

Here's a sample of the GeoJSON:

{ "type": "FeatureCollection", "features": [{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.4223477910157,37.79754300228804]},"properties":{":@computed_region_6qbp_sg9q":"105","point_city":"","location":"Greens Sports Bar",":@computed_region_26cr_cadq":"3","objectid":"1308","globalid":"{B1BEFBCB-BEB6-458A-B8C5-DDB016BAF2A2}","point_zip":"",":@computed_region_ajp5_b2md":"32","placement":"SIDEWALK",":@computed_region_qgnn_b9vv":"4","install_yr":"2003","install_mo":"0","address":"2239 POLK ST","lon":"-122.422348","street":"POLK","point_address":"","racks":"1","spaces":"2","point_state":"","lat":"37.797543"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-122.38985779819565,37.77014138205314]}

And then proccessed:

bikeLanesRaw = 'https://data.sfgov.org/resource/ygmz-vaxd.geojson'
bikeLanesRawResponse = urllib2.urlopen(bikeLanesRaw)
bikeLanesRaw_JSON = bikeLanesRawResponse.read()
#Write each response to JSON
foo = open(bikeFacilitiesFolder + "\\" + "bikeLanes_SF_2.json", "wb")
foo.write(bikeLanesRaw_JSON);
foo.close()

filename = bikeFacilitiesFolder + "\\" + "bikeLanes_SF_2.json"

And then I iterate through the features to use AsShape:

with open(filename, 'r') as fp:
# read json and add "features"
jData = json.loads(fp.read().decode("utf-8-sig").encode("utf-8"))
for feature in jData['features']:
    geom = feature["geometry"]
    point = arcpy.AsShape(geom)
    print(point)

I can successfully print the points, which gives me a series of:

<geoprocessing describe geometry object object at 0x17B0F480>
<geoprocessing describe geometry object object at 0x17B0F480>

But I'm unclear on what the next step is.  Ideally, I want to use arcpy.JSONToFeatures_conversion to convert the JSON to features for use in ArcMap, but I'm unsure where to go from here once I've used AsShape.


texts: Mapbox satellite failed to upload in QGIS

texts:
I tried to upload the mapbox satellite map in QGIS and got this message: QuickMapServices: Failed to download all 16 files. Mapbox

I have reinstalled the QuickMapServices plugin, but it did not fix this problem. I tried to use the Mapbox online help menu, but I think it is not updated and the instructions were ineffective.
The other Mapbox map I have in QGIS,"Mapbox Gray", is working just fine.

What can I do in order to fix this problem?


texts: Histograms in Erdas Imagine staying grey

texts:
When I open the metadata in Erdas Imagine 2016 of a raster file (I tried several different raster files) the histogram at the histogram button stays grey. I already tried to change the setting of NAs and select different bands in the multispectral options but no help.

I doubt, there is a problem with Erdas Imagine, as the histograms worked fine on one day when I had access to a computer with Erdas Imagine 2015. Unfortunately, I  cannot get access to this computer anymore.

I tried to reach the support team of Erdas (Hexagon Geospatial Support Portal) but was not successful.

Did anyone have a similar problem in Erdas and figured out what the exact problem is? Or has any hints what might have gone wrong?


texts: Partition an area into polygons so that each polygon will contain at least one point of each type

texts:
This question is similar to Create polygons from point dataset, where each polygon contains 3 points from the dataset, and in particular my problem is actually described in this comment to that question. But the problem were never solved there.

I have three sets of points. I want to partition the area which is covered by the points into polygons. Each polygon must have at least one point from each set of points.

The more polygons the better solution. I use R, so solutions written in R are preferred.

Ideally, the solution would be general enough to apply to a situation where there were two sets of points, or four sets of points.

My data is available here, and with this code, a map with the points can rendered:

library(ggmap)
load(url("http://hansekbrand.se/gis.RData")) ## this loads "gis" and "my.map"
my.map + geom_point(aes(colour = Generation, x = lon, y = lat),
                   size = 0.01, data = gis)

The type of point is given by the variable Generation in the object gis

str(gis)
'data.frame':   875 obs. of  3 variables:
$ lon       : num  -1.52 -2.42 -2.35 -1.57 -1.53 ...
$ lat       : num  12.4 13.6 13.2 13.6 13.3 ...
$ Generation: Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...


texts: ArcGIS Javascript API - Use array of values for breaks in Class Break renderer instead of a range for a Dynamic Layer

texts:
I'm trying to use ClassBreak renderer in ArcGIS API v3.27. I have a dynamic layer with ZIP as one of its fields. I would like to add breaks based on the ZIP value. But the class breaks usually don't follow a format. For example if i have 1 to 100 ZIPs ( just for ease of explanation) ZIP 1,2,5 might be class break 1 where as 3,6,7 might be class break 2 and so on. How do i use these values for class breaks as they don't fall in a particular range.

Below is the code:

crFeatureLayer.on("load", function(){

            var renderer = createRenderer();
            var optionsArray = [];
            var drawingOptions = new LayerDrawingOptions();
            drawingOptions.renderer = renderer;
            optionsArray[0] = drawingOptions;
            crFeatureLayer.setLayerDrawingOptions(optionsArray);

        });

var createRenderer = function() {

        var calculateColorValue = function(value) {
            if (value.hasOwnProperty("attributes"))
                var ZipCR = value.attributes.ZipCR;

            ///Some logic to retrieve class breaks will be inserted here
         }

        var renderer = new ClassBreaksRenderer(null, calculateColorValue);
        renderer.setMaxInclusive(true);
        for (var i = 0; i < ntaData.length; i++)
        {
            addNtaClassBreak(renderer, i);
        }

        return renderer;
    };

     var addNtaClassBreak = function(renderer, index) {
        renderer.addBreak({
            minValue: index,
            maxValue: index+1,
            label: null,
            symbol: new SimpleFillSymbol().setColor(colorsAvailable[index])
        });
    };

The value of the ZipCR is always undefined. How to pass the layer info to the function in case of Dynamic layer. If i use the same code for generating the rendered and apply it to a Feature Layer instead of a Dynamic layer it works like a charm.


texts: Clustering of multiple raster layers to create sub-regions using QGIS?

texts:
I'm attempting to create n sub-regions from a polygon based on a cluster analysis of a bunch of overlapping raster layers (physical layers, eg: depth, currents, waves).

Currently, I can create a regular grid across the polygon, then extract physical attributes from the physical raster layers (eg: Gridspot or equivalent tool) then, run a cluster analysis restricted to n number of clusters (in R or other stats package).

Then, I can identify each cluster-group, and plot them back in GIS (QGIS or ArcMap). I envisage however, that some cluster-groups will be dispersed (spatial outliers and not meaningful), whereas some will be clumped (worthy of being a sub-region).

I could then manually draw around representative clumps to create n sub-regions.

Is there a tool like ArcMap 10.1 Grouping Analysis that can be run in QGIS? I'm only running 10.0.

Are there suggestions of a better way to do cluster analysis of multiple raster layers, to create n sub-regions (bio-regions)?


texts: QGIS 2.10 with ubuntugis dependecies Grass issues Ubuntu 14.04

texts: I saw in Installing QGIS with GRASS plugin on Ubuntu? how to get Qgis 2.10 running from the non ubuntugis repository with grass features but I'm still having problems with getting it to work with the ubuntugis unstable dependencies.  I have tried using 2.10, 2.8.3, and the nightly build but can neither get the GRASS plugin toolbar to work or the new browser to show the grass files like the video shows here.  While I can get work done with the standard install I like having using the ubuntugis dependencies and packages for work with postgis, spatialite, etc and would really like to have it all gel together rather than have multiple repositories that may confuse each other.  So after all of that filler I guess my question would be has anybody got QGIS 2.10's grass tools(both processing and plugin) to work with the ubuntugis dependencies and if so how?


texts: How to get the most accurate elevation reading for the ground floor of a building?

texts: I am looking into a way to calculate the elevation of the ground floor of many buildings in a study area. My plan is to run the building centroids against an elevation grid to get an elevation measurement for each point. I know that by using an elevation source such as NED, the elevation that will be assigned to each point will be somewhat less than that of the actual ground floor of the building. My plan was to apply some sort of factor to the extracted elevations to hopefully increase the accuracy of my data. How would I go about determining such a factor?


texts: Measurement units - advanced digitizing toolbar - QGIS

texts:
I want to create a polygon with certain dimensions in QGIS. 180x180 feet.

I am trying to use advanced digitizing toolbar in order to create it. But I do not know the measurement units of d (distance) value. I am using EPSG: 3857. d values are not measured in units for sure, as I tried to create a polygon 100 m x 100 m by setting d = 100 and the dimensions of the generated poly are not 100m x 100m. Do you know how I can set or at least identify the measurements units of d?


texts: SAGA IDW interpolation algorithm has been changed?

texts:
Yesterday, I try after a long time to make an IDW interpolation on a point layer in Qgis 2.18 with SAGA tools. I use same parameters as before on Qgis 2.14, but the result is quite different. Raster isn't smooth and all points are very visible on it.

Has SAGA IDW interpolation has been changed between these 2 versions?


texts: How to fill the empty space automatically, QGIS 2.16.3

texts:
Is it possible to fill empty space inside of polygon?
I have problem, a clever boy drilled my polygons with road polygon,and I want to fill up polygons again, but how? I cannot merge every single polygon by hand, it would be too much. Different color means different polygon with attribute data.Thanks


texts: Sort attribute table in an atlas layout with PyQGIS 3

texts:
I wrote a script that automate the production of an atlas layout with PyQGIS 3 that works well but it remains a detail I can't figure out.
Each page of my atlas contains a map zoomed on a particular extent, and an attribute table presenting some key informations on the features visible on the map.
I would like to sort the attribute table according to the values of one attribute.
I know how to do it for a text table:
tab.sort(key=lambda x:x[0]) # to sort from the 1st column

But it doesn't work for the QgsLayoutItemAttributeTable class that has no attribute sort
I first thougth to "convert" my attribute table to a text table, but I am sure there is an easier and faster way to sort it. Like the attribute table change on each page, it will make the script too heavy for nothing.
UPDATE
The following code return a sorted attribute table displayed on my layout
project = QgsProject.instance()
manager = project.layoutManager()
layoutName = "Atlas"
layouts_list = manager.printLayouts()
for layout in layouts_list:
    if layout.name() == layoutName:
        manager.removeLayout(layout)

layout = QgsPrintLayout(project)
layout.initializeDefaults()

layout.setName(layoutName)

manager.addLayout(layout)

pdf = project.mapLayersByName('plan_de_ferme')[0]
pdf_table = QgsLayoutItemAttributeTable.create(layout)
pdf_table.setVectorLayer(pdf)
pdf_fields = ['champ','sup','supepnd']
pdf_table.setDisplayedFields(pdf_fields, True)
layout.addMultiFrame(pdf_table)
frame2 = QgsLayoutFrame(layout, pdf_table)
frame2.attemptResize(QgsLayoutSize(60.6, 153.3),True)
frame2.attemptMove(QgsLayoutPoint(213, 30.73, QgsUnitTypes.LayoutMillimeters))
pdf_table.addFrame(frame2)

tblCol = QgsLayoutTableColumn()
tblCol.setAttribute('champ')
tblCol.setSortOrder(0) # 0 = Asc, 1 Desc
pdf_table.setSortColumns([tblCol])
layout.refresh()


texts: Replacing Attribute Values With New Values Based on the Old Values Using ArcMap Field Calculator

texts:
I am using the Field Calculator of ArcMap.

I need to replace multiple values (codes) with another words in a field at one time in one script.

For example in my CodeField I need to replace "A01", "A02"... with "TextValue1", "TextValue2"...

How can I do this?


texts: How to extract elevation data from DEM along a polyline

texts:
I've been trying to use qGIS to extract and save as an attribute the data elevation along a line, knowing that something similar is available in ArcGIS using the Spatial Analysis tool.  So far, though, I've been unable to find the right tools in qGIS.

I imagine this will involve two separate steps: first creating a point layer at even intervals along a line, and then extracting the elevation of each point.  I'll keep plugging away at the problem, but if anyone had any pointers, all help would be much appreciated.


texts: Terrasolid - How to define spherical Mercator (EPSG::3857)

texts:
I'm trying to define the SRS EPSG::3857 inside Terrasolid software. I ran into a problem because the definition of the reference ellipsoid is given with a major axis and inverse flattening, not via both axis. Since flattening of a sphere is 0, inverse of a zero is infinite and I can't input that. Doesn't work with a 0, 1 or some very high value either. Any thoughts on how to define it, and if its even possible?
EDIT:
The issue is, a sphere (reference body for EPSG::3857) is a kind of ellipsoid that has no flattening, hence you cannot define 1/flattening. I'm looking for a workaround in this particular software, or just a confirmation that its in fact impossible to do at this point, since I cannot define datum that involves a sphere as a reference body.
Here's a screenshot of the datum input screen:


texts: Delete all files in a directory, except files with a specific string

texts:
At the end of my script I want to delete all my temporarily created files in a directory. For this purpose I write all files into a list and look in the elements to see if it has the string "final.shp" or "final.tif". If it does, it remains and if not, the file should be deleted. This works fine with all shape files, only with the TIFFs my function fails. Unfortunately I can't find a way to solve the problem and I hope that someone can give me the decisive tip. Maybe you can tell me how to make the query case-insensitive?

def endreiniger(path):
    for root, dirs, files in os.walk(path):
        for f in files:
            if not f.endswith('final.shp') or f.endswith('final.tif') or f.endswith('final.TIF'):
                arcpy.Delete_management(f)
            else:
                print(f)


texts:
Unfortunatly the processing plugin stopped working and I don't know why. When starting QGIS (2.18.2) I get the error: TypeError: coercing to Unicode: need string or buffer, NoneType found .

Did anyone else come across this problem lately?

Traceback (most recent call last):
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 333, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/__init__.py", line 38, in classFactory
    return ProcessingPlugin(iface)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/ProcessingPlugin.py", line 58, in __init__
    Processing.initialize()
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 148, in initialize
    Processing.addProvider(c())
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 103, in addProvider
    % (provider.getDescription(), traceback.format_exc()))
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py", line 123, in getDescription
    version = SagaUtils.getSagaInstalledVersion()
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaUtils.py", line 130, in getSagaInstalledVersion
    commands = [os.path.join(sagaPath(), "saga_cmd -v")]
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaUtils.py", line 75, in sagaPath
    if not os.path.isdir(folder):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 49, in isdir
    st = os.stat(s)
TypeError: coercing to Unicode: need string or buffer, NoneType found


texts: Backup/Restore ArcGIS Server 10.2.2 site that is federated with Portal 10.2.2

texts:
Is it possible to backup and restore an ArcGIS Server site that is federated with portal using a domain certificate (in other words a certificate that is not CA-signed)?  I am attempting this directly in the REST admin site using the exportSite and importSite operations.  I am receiving the following error:

  "Unable to find valid certification path to requested target."

I am curious if this is even possible, and if so, what steps should I take to get around the issue of using a domain certificate?


texts: Using Con tool with iterator in ArcGIS ModelBuilder?

texts:
I have been using ArcGIS Modelbuilder on 16 years of MODIS LST 8 day data, ie. quite a few files. I want to use the QC pixel data at error <=1, 2, and 3K to overlay on the base LST data so I can determine the amount of pixels this knocks out. I'm aiming to get the "best" pixels to use for some research (without losing too many).

I have used the iterator with raster calculator (rescale), extract by attributes (Value) and reclassification (0 and 1) tools without issues apart from some data stat problems. The final bit will be overlaying the reclassified quality pixels (0 and 1) of the various K error ranges on the original LST data. I was going to use the Con tool which works fine manually however am thinking maybe this won't be able to do the job as I need to actually iterate through 2 raster sets - the reclassified into K error ranges LST (conditional) and the original LST. Only one iterator can be used it seems?

Anybody able to provide any insight on possibility of use of the Con tool using an iterator in ModelBuilder?

I have the final K to C conversion and reprojection models developed.

A little bit more explanation as the concept is not that straightforward and model attached. I have 92 LST 8day rasters  for the year which will be iterated through using  %NAME% as the inline variable to select the pixels of value based on 3 error values (<= 1, 2 and 3 Kelvin). I won’t go into detail as to how these are calculated by MODIS suffice to say that there needs to be some manual binary value interpretation done from the values in the QC file to get the pixel error values. I use the iterator with 1) Extract Values to get the 3 error ranges, and 2) Raster Calculator to classify these errors. For example an error <= 1K uses attributes of 0, 17 and 33 so only those are classified as 1, with all others 0. <= 2 uses values of  0, 17, 33, 65, 81 and 97; <=3 uses 0, 17, 33, 65, 81, 97, 129, 145. The QC quality spreadsheet which comes with the downloaded data flags what all the values are and what error they belong to. No issues with the first part (apart from a problem with occasional files with no value, and hence no statistics, crashing the model which I will post about separately).

Anyway, given I can overcome the last issue, the final step is that original 92 LST rasters need to have the pixels selected based on whether the specific conditional raster is 1 (true) or 0 (false), previously done in the reclassification stage. This is basically overlaying the error pixels on the originals and only pulling out those pixels which are true for the reclassified data. I will then have 3 separate folders with 92 files each containing only pixels related to the specific error value. This will be used to make a judgement on what error value is acceptable. Note that the same original file name is used for all the calc’s, just coming from different folders. Eg. MOD11A2.006_LST_Day_1km_doy2010001_aid0001.tif, etc.

Of course the attached model will only work for the first conditional raster as it cannot iterate through them in concert with the original iteration which is what I do with the original 2 processes. Just started using ModelBuilder so maybe there is an easier way (probably using Python)!


texts: Automating detection of clearcut areas in optical satellite imagery?

texts:
Given optical satellite or aerial imagery of a resolution similar to the image below, is it possible to accurately detect clearcut areas?

Is there research or documentation that supports a specific methodology (e.g. object-oriented classification which considers contrast and geometry)?

How can this process be automated over areas ~1000km^2?


texts: FME workspace slashes ('/') missing in resulting attribute values

texts:
I have a MS Access DB table with attributes containing slashes /:

When I process it with an FME workspace like (MSACCESS_JDBC reader)

the slashes disappear in the resulting attributes (FME data inspector):

Why is that so? How to preserve my slashes?


texts: Error when running Python script to replaceDataSource of multiple layers in multiple mxd's

texts:
I looked on all of your sites and did not find a solution to my problem.
Almost all of our data has been copied to an SDE and now most of the layers in all of the mxd's need to be redirected to the new location before the old data is deleted.
The old data is a mixture--shapefiles, gdb, etc. and it is located directly in the oldLayerLocation, or in subfolders of that location.

I only want to change the data source for layers pointing to the oldLayerLocation and its subfolders, as some people may have developed their own data which they are storing elsewhere.

I am open to other ways of getting this done, if this is not the best way.

I tried using mxd.replaceWorkspaces, but the results were not enough (only changed items that were located directly in the oldLayerLocation, but not in subfolders below that), and too aggressive (changed everything that I wanted to, but also changed layers that did not point to oldLayerLocation).

I am running ArcGIS 10.2.2, editing with PythonWin 2.7,

and the error that I am getting is "ValueError: Layer: Unexpected error" referring to the line containing the lyr.replaceDataSource.

newLayerLocation = r"X:\Path to new data.sde"
oldLayerLocation = r"X:\Path_to_old_non-SDE_data"
MXDlocation = r"Z:\Where_the_MXDs_are_located"
Suffix1 = r".mxd"
Suffix2 = r"_SDE.mxd"

import arcpy, os

for dirpath, dirnames, filenames in arcpy.da.Walk(MXDlocation, True, None, True, None, None):
    for filename in filenames:
        if filename.lower().endswith(Suffix1):
            mxdPath = os.path.join(dirpath, filename)
            mxd = arcpy.mapping.MapDocument(mxdPath)
            for df in arcpy.mapping.ListDataFrames(mxd):
                for lyr in arcpy.mapping.ListLayers(mxd, '', df):
                    if lyr.supports("DATASOURCE"):
                        if lyr.dataSource.startswith(oldLayerLocation) == True:
                            newMXDname = mxdPath.replace(Suffix1, Suffix2)
                            lyr.replaceDataSource(newLayerLocation, "SDE_WORKSPACE")
            mxd.saveACopy(newMXDname)
            del mxd

`


texts:
I am a total newbee to GIS and currently using QGIS. I have opened a shapefile which should give information about the European subsurface, but everything becomes colored but I do still see the outlines of the polygons.
I've now had this with two different datasets so I figured nothing is wrong with the files but with the program instead. Can someone tell me how this can be solved?
Edit: this image is extremely small, but this is what it should approximately look like:


texts: Does OpenLayers support right to left languages?

texts: Right to Left languages need to be handled differently. For instance, in popups the text and the close box should be reversed. Google Maps supports this if the page has a <html dir='rtl'> element, how about OpenLayers?


texts: Openlayers 3 how to get if an image loaded ol.source.Image

texts:
I'm trying to detect if an image exists or not when I try to load it.

layerPrec = new ol.layer.Image({
                         name: "imgprec",
                         style: 'imgprec',
                         visible: true,
                         opacity: 0.7,
                         source: new ol.source.ImageStatic({
                                               url: 'myimageurl',
                                               imageExtent: vExtent
                                                          })
                              });

I have images that exist but some of them not yet. And when I put an unexisting image, how can I detect if it exist or it has loaded or not without using jQuery '.error'?


texts: PostGIS recursive query in order to find the longest connected subnetwork in my line network

texts:
Let's said that I have this line network:

The goal is to find the longest connected subnetwork.
So I want to find all the line's ID that are connected to the line with the ID = 1 because I know that the ID=1 is part of the longest connected subnetwork.

I guess that have to use a recursive query, I have try to run the following query:

WITH RECURSIVE connected_line AS (
    SELECT a.ID,a.geom FROM network a WHERE ID = 1
  UNION ALL
    SELECT b.ID,b.geom FROM network b, connected_line c
    WHERE st_intersects(b.geom, c.geom)
    AND NOT b.ID = c.ID
)
SELECT ID FROM connected_line;

The result should be:

ID
1
2
3
4

But the query is endless, how to create such a recursive query ?


texts: Construct a shapefile from information in a dBase file in QGIS

texts: I am using QGIS. I have been provided a dbf file but no shp or index files. Each line in the .dbf file corresponds to a line I wish to show on the map. Each line in the .dbf file has a unique identifier and a start lat lon for the line and an end lat lon for the line. How do I construct a .shp and index files for this data from the .dbf file?


texts:
I'm writing a program to count the number of times a polyline self-intersects.  I create a new feature class to keep track of the line and the number of intersections.  The feature class is created with the appropriate fields but it is not populated with the information.  So I simplified the code to just look at the search cursor and insert cursor (as shown below) and this simple code does not populate the attribute table.  I've used a similar code before to create a feature class and populate the table and it works fine. This seems like it should work, does anybody see anything wrong with this? (This is typed directly into the Python window in the ArcMap document containing the feature class). The fields intCount and Trip_ID are type double.

import arcpy

Fields = ['SHAPE@','intCount','Trip_ID']
insCur = arcpy.da.InsertCursor("Bikemap_SelfInt",Fields)

with arcpy.da.SearchCursor("BikemapTC_linesTEMP",["SHAPE@","trip_id"]) as cursor:
    intCount = 0
    for row in cursor:
        segments = row[0]
        trip_id = row[1]
        intCount +=1
        insCur.insertRow([segments, intCount, trip_id])
del insCur


texts: Using Czech republic (European) Postcodes in CartodDB?

texts:
I have dataset with columns country (contains only one country "Czech republic") and postcode (contains postcodes in NNNNN format) and other two cols (date and total). However when I try to use feature to geocode data by postcode and country its giving me result, that no data were geocoded.

Are European postcodes supported for this feature?


texts:
I am able to successfully map my data points using 'and` on a map:

import React, { Component } from 'react';
import { Map, CircleMarker, TileLayer, Tooltip, AttributionControl } from "react-leaflet";
import "leaflet/dist/leaflet.css";

...

        <Map
          style={{ height: "480px", width: "100%", opacity: "0.9" }}
          zoom={4.25}
          center={[37.7687477, -99.6820275]}
          attributionControl={false}>
          <TileLayer url="https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.png"
            attribution="Map by Stamen Design | &copy; OpenStreetMap contributors"
          />

          <AttributionControl position="bottomright" prefix={false} />

          {this.state.dataMaps.map((dataItem, k) => {
            let { coordinates, company, url, loc } = dataItem;
            return (
              <CircleMarker
                key={k}
                center={[coordinates[0], coordinates[1]]}
                fillOpacity={0.5}
                stroke={true}>

                <Tooltip direction="right" offset={[-8, -2]} opacity={1}>
                  {company}
                  {loc}
                </Tooltip>
              </CircleMarker>);
          })
          }
        </Map>

And it renders as follows:

However, I have a lot of data points that have the same City (e.g. San Francisco), and therefore the same lat/long coordinates -- so I need help clustering.

I have had a hard time finding sample code or tutorials that make sense to me.

It seems like there's no out-of-the-box clustering in react-leaflet, and I need to use the https://github.com/Leaflet/Leaflet.markercluster plugin, correct? Would I also need the "react wrapper" from https://github.com/YUzhva/react-leaflet-markercluster or is that optional?

Can anyone point me to a tutorial or documentation or roughly guide me on whether it is possible to use <CircleMarker> and <Tooltip> and make a cluster using Leaflet.markercluster ?

Thanks in advance!


texts:
I'm trying to find a very simple solution to reproject a vector layer into a temporary layer in pyqgis, however documentation is really extensive and I'm fairly new to pyqgis; the only answer I've found here saves the layer, which I totally want to avoid.
The code I've tried:

layer = QgsVectorLayer("/path/file.gpkg", "oko", "ogr")

epsg_crs = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)

layer.setCoordinateSystem(epsg_crs)
Traceback (most recent call last):
  File "/usr/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
TypeError: QgsVectorLayer.setCoordinateSystem(): too many arguments


texts:
I'm trying to setup a geotiff folder inside ImageMosaic plugin after following this https://docs.geoserver.org/latest/en/user/tutorials/imagemosaic_timeseries/imagemosaic_timeseries.html

Using the samples files from the tutorial I'm ok, but if I try to use my own geotiff files I get the following error.

17 Feb 10:45:21 WARN [gce.geotiff] - File /home/geoserver/data_dir/data/swiss is a directory.
Caused by: java.io.IOException: File /home/geoserver/data_dir/data/swiss is a directory.
17 Feb 10:45:24 INFO [geoserver.web] - Getting list of coverages for saved store file:data/swiss/
java.lang.RuntimeException: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:data/swiss/ and hints Hints:
  EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@2186fe12[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
  REPOSITORY       = org.geoserver.catalog.CatalogRepository@26aa7b11
System defaults:
  LENIENT_DATUM_SHIFT              = true
  FILTER_FACTORY                   = FilterFactoryImpl
  COMPARISON_TOLERANCE             = 1.0E-8
  GRID_COVERAGE_FACTORY            = GridCoverageFactory
    TILE_ENCODING                  = null
  STYLE_FACTORY                    = StyleFactoryImpl
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true
  FORCE_AXIS_ORDER_HONORING        = http
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@5827af16
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)


texts: Converting "ALOS PALSAR" DEM to EGM96 vertical system using ArcGIS Desktop

texts:
I have downloaded "ALOS PALSAR" DEM from NASA's EOSDIS.

Can you help me to convert the high-res DEM to EGM96 (like SRTM data)?

I have used ArcGIS Desktop 10.7 edition but it does not work correctly.

I have checked the vertical box to enable vertical transformation:

Now the sea level is 200 meter and other elevations are 140 meter or something similar instead of being 1 meter or 2 meter!

I have tried many times now I'm here!


texts: Install osmosis without wget and still create its folder?

texts:
I am trying to install osmosis onto my Ubuntu 16.04 PC.

I tried to do it using this explanation, but I can't download osmosis-latest.tgz because the link throws a 404 error.

Now I installed it by simply using apt-get install osmosis which worked well, but I don't know what to do about the osmosis folder which the above explanation creates. I just created an empty folder now, but that's surely not what I would like to have I guess.

PS: As you can tell, I'm new to this.


texts: Map missing in map composer and when printing map?

texts:
I am new to QGIS and when I set up a new composer and add a map to the page nothing appears. I have pressed the render button and the up date with no results. When I print the map there is no map but the legend I added to the page is there.

I am using the latest version of GGIS on a MAC running Lion.


texts: Should I measure distance in projected or geographic coordinate system?

texts:
I want to evaluate the distance between a set of points and lines on a small scale (points across China). I am using the sp package of R for this purpose which warns if the underlying coordinate system is not projected.

However, if I change my coordinate system to a projected coordinate system my distance calculations will not be 100% accurate due to distortions caused by the projection, right?

Thus, wouldn't it make more sense to calculate distances in a geographic coordinate system taking into account the refernce ellipsoid (like in the geosphere R package). Wouldn't this apporach give more accurate results?


texts: Why does QGIS recognize the geometry type of some MSSQL tables and not others?

texts:
In QGIS, when I go to add a MSSQL table, it recognizes the geometry type and SRID of some tables and not others. When it doesn't recognize these I can set them manually and load the data without a problem.

What do I have to set within SQL Server to have QGIS recognize the geometry type and I have not selected the option "Only look in the geometry_columns_metadata table" for the MSSQL connection?


texts: How do I rubbersheet two vector layers one with a projection like UTM WGS 84 Zone 45N using QGIS?


texts: Suggestions for vector format for contour map

texts:
I've been trying to create a contour map of a DEM and I've been running into some technical problems. I want to avoid artifacts, so I'm using a DEM of the entire area. This means the size is rather large, over 40 gb. I then run gdal_contour to get a shapefile.

I think gdal started throwing out errors when the .shp file reached over 4gb. This is over the filesize limit of 2gb, so I did not get a finished map or valid shapefile. So I was wondering if anyone had experience working with large raster sets, and had suggestions for an appropriate file format.

Other considerations:

Space is a small consideration. I created a few contour maps of a small sample section, and noticed that the other formats were over two and a half times the size of the shapefile.

Ram is an issue. I'd like to keep ram usage minimized. I only have 16gb of ram, and I saw gdal_contour go up to 12gb of ram used. My fear is that going to a more space intensive format will increase ram usage. I can go up to 32gb of ram, but I'm also wanting to create another contour map with a higher definition, which will increase ram usage.


texts: When is the option to delete field in an attribute table enabled in QGIS? I'm in editing mode and still am not able to delete a field...


texts:
I just discovered JTS through this stack exchange. I'm looking for a Java solution to cut an abitrary polygon into two by a line. I've implemented one that does fine on convex polygons, but it messes up on concave ones.

Can anyone give an example on how to use JTS to cut a convex polygon by a line segment? I know that sometimes you can end up with more than two polygons depending on the shape.


texts: I'm looking for some algorithm able to better recognize the geometry place only exploiting wi-fi antennas. I read about place recognition is divided in two classes: geometry and fingerprint. I'm interested to use fingerprinting one and I'd like to develop an intelligent system able to learn more and more which is the correct set of right values (e.g. rssi, mac, response rate...) identify the place. I'm not interested to geo-referentiate the place but only to recognize the place. What kind of technique should I consider? Statistical learning (MLE, bayesian models...) or I can think to use classification algorithms like support vector machine or others? can I think to explore fuzzy system for my purpose?


texts: Positioning multiple attributes separately in a label

texts:
I'm using QGIS

I've got a basemap with the Texas landgrid for all of the counties in the Permian Basin. There are various attributes associated with the sections in the grid, but I only need 2 to display (Section # & Abstract #). I can get them to display just fine, however they both display in the same location within the polygon, and they have the same font size no matter how far I am zoomed in or out of the map. I need "Section #" to display in the Northeastern most corner of the section and resize dynamically based on the size of the polygon, and Abstract to display in the Southeastern most corner with the same dynamic function.

Here is an example of how the attributes display in my basemap: ("S" is Section, "B" is Block & "A" is Abstract. I'll be getting rid of "B")

And here is an example from a software called DrillingInfo: (Notice the Section # is displayed in the NE corner, and the Abstract # is in the SE corner)

I don't know much about Python, but based on my limited experience, I think it should be possible to manipulate and position these attributes using Python functions. Does anyone know of a way to do this, or if it is even worth my time trying to learn it?

My research has consisted of:

I've spoken with a couple people who have more experience using GIS software, and they have both told me they don't know of a way to do it. I've been taking a Python course at Codecademy.com to try and become familiar with the language. I've also read multiple "How To's" regarding labeling and positioning. I know there is a way to manually move each label into the position that I want, but I've got 1,000s of polygons that all need the same positioning with their labels. In other words, I have done some research before asking this question, and haven't found an answer. I also looked for other questions in this forum to see if this is a duplicate question, and I think I have unique attributes to my question. Sorry if it IS a duplicate!