texts: Generate global grid of circles with minimum overlap with PostGIS

texts:
I want to generate a table of geometry points in PostGIS which represent the centers of circles, each with the same radius of X meters, that together form a "grid" that covers the entire earth's surface (ie every point on the earth is covered by at least one circle), and with minimal circle overlap.
On a plane, I imagine this pattern is pretty efficient in terms of minimal overlap. If there is a better pattern, please suggest.

I imagined an approach like this, first generating squares and using those to create circles, but such a grid ends up with much more circle overlap.

However, then I found that the circle centres can be described by the vertices of a grid of equilateral triangles.

I thought that because of that, a geodesic Discrete Global Grid System (DGGS) which used Class I triangle subdivisions would achieve the desired circle overlap pattern.
However, I ran into this problem: due to the way regular shapes become distorted when projected onto a sphere, the DGGS made by this method is completely irregular.
First level Class I subdivisions with this method have >10% differences in the lengths of triangle sides... no longer remotely equilateral, creating a pattern where the same radius circles can not guarantee complete coverage and minimum overlap.
Here's an example of 136km circles at level 5 subdivisions over part of Australia. They're nice and regular where I start recording, but move to the right and there are large gaps.

So my question is how can I create such a DGGS that is regular? By "regular", a maximum 1% variance in distances between circles would be acceptable, but >10% in my mind is too much to achieve the aims of coverage completeness and minimal circle overlap.


texts:
I'm having some trouble with QGIS because when I try to edit a vector, it displays the edges in that point of all the layers loaded in the drawing even though they are off, making it almost impossible to proceed.
I have turned off all the snap options I could find.
Does anyone know what this could be due to or how to fix it?


texts: geoprocessing across multiple vector layers QGIS2

texts:
I have 6 layers of point data (each layer is one year), where data in each layer are distributed throughout a grid, and the grid is identical in each layer.  I'd like to extract data from each layer, excluding those data where there is not a full six years of data in the grid square.  For example, if a grid square does not have 6 years of data, then I'm not interested in it.  If a grid does have data for all 6 years, then I want to keep it.  The result will be a series of layers where the table for each layer has the same number of grid square references.

I've explore database options with this - my data is such that for each grid square per year, there are multiple (ie daily) occurrences within that year, so the Access query becomes very weird quickly, so I thought there might be a gis solution. I considered the geoprocessing tools like clipping or intersection, but it seems you can only do 2 layers at a time.  I'm using QGIS2 but I'm open to a GRASS solutions as well.

Any pointers in the right direction would be great.  Many thanks, Paul.


texts: Referencing an output in an expression in process modeler

texts:
In the process modeler, I'd like to reference an output of a previous step as one of the parameters of an algorithm. In this case, the previous step was clipping a large raster and I want to use the clipped raster data to shift some vector data, so as the parameter to the vector transform I've got the following:

raster_value(@Clip_raster_by_mask_layer_OUTPUT ,1,$geometry)

This doesn't work. However, if I output everything from the model and then do the same transform operation manually and use 'name_of_clipped_layer' instead of @Clip_raster_by_mask_layer_OUTPUT, then it works as I expect. Is it possible to get this model to do what I want?


texts: error in reasoning: logical operators in raster calculator

texts:
I'm  processing a formula in QGIS raster calculator and have an error in reasoning.

Having the layers a and b I want to create output layer c under the following conditions:

(1) if a = 1 or b = 1 --> c = 1
(2) if a = 5 or b = 5 --> c = 5, whereas condition (1) should overrule condition (2)
(3) if a + b = 0 --> c = 0
(4) else a + b / (number of layers which are != 0; !=1; !=5

Below is the formula with comments and hopefully readable.

It actually works, but there is a NoData Output for a+b=0.

a=1 OR b=1 --> c=1:

(
    ("a@1"=1) OR ("b@1"=1)
)+

a=5, b not equal 1; OR b=5, a not equal 1 --> c=5:

(
    (
        (("a@1"=5) AND ("b@1"!=1)) OR
        (("b@1"=5) AND ("a@1"!=1))
    )*5
)+

a=0 and b=0, -->c=0:

(
    (("a@1"=0) AND ("b@1"=0)) *0
)+

a and b not equal 1; 5 --> c= average of a and b, disregarding 0 values:

(
    (
        ("a@1"!=1)  AND
        ("b@1"!=1)  AND
        ("a@1"!=5)  AND
        ("b@1"!=5)  AND
        (("a@1"!=0) AND ("b@1"!=0))
    )
 ) *
    (("a@1"+"b@1")/
        (
            (("a@1">=2) AND ("a@1"<=4)) +
            (("b@1">=2) AND ("b@1"<=4))
        )
    )
)

What am I missing?

I have a similar question pending for SAGA Raster Calculator, but would prefer using QGIS Raster Calculator.


texts: The following layers were not correctly generated. Grid

texts:
I keep getting the same error:

  The following layers were not correctly
  generated.GridYou can check the log messages to find
  more information about the execution of the algorithm

I saw two post about it on this forum but none of them helped me. I see that that it is related to the Grid but I don't know what it means (I used EPSG:4326 - WGS 84 and I put 0,0005 instead of 100 to convert in degrees).

EDIT:
My version of QGIS is 2.18.1 Las Palmas (the last one). I followed this tutorial (https://www.youtube.com/watch?v=bLbY3iMBW-A) from 5:00 to 9:00 and I used 0,0005.


texts:
I have a polygon representing a wall.

Is there a topology check on ArcGIS Desktop to close gaps like this? Or is there a different workflow I can try?


texts:
For some reason I'm having trouble finding any documentation about releasing feature locks in a GeoServer WFS (or any WFS for that matter).

I can easily request a FeatureLock with a request like this http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&typeName=namespace:layer_name&maxFeatures=1&outputFormat=json&request=GetFeatureWithLock&cql_filter=Id%3D0

I have read that an update will release the feature lock once completed, but what if my user cancels? Should I just update the feature with its original data, or wait for the lock to time-out? Looking through the WFS GetCapabilities response I thought I could make a LockFeature request and pass a ReleaseAction parameter, but this didn't work out. The URL was http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&typeName=namespace:layer_name&maxFeatures=1&outputFormat=json&request=LockFeature&releaseAction=ALL&cql_filter=Id%3D0 but the result was 'A LockFeature request must contain at least one LOCK element'.

The GetFeatureWithLock response didn't include any new lock identifier, and there are no cookies in the response headers, so I don't really understand how I'm supposed to release the lock I just created.

Any thoughts on this would be very much appreciated!


texts: QGIS - Label Rectangle/Buffer Overlapping Layer Above

texts: When I apply a buffer or rectangle to my labels they show through the overlying layers. Is there any way to avoid this, i.e. arrange the label so it lies underneath the layers above? I'm assuming the labels themselves take priority and lie on top of any layers above (I've tried playing with the various priority settings). The yellow layer below has some transparency. I want to include a space around the label so it blocks the underlying contour line, but I don't want the buffer or rectangle showing through the yellow layer.


texts:
I have a global json files about countries' boundaries but the Russia is in two parts (two polygons). I want to merge the two parts in one, without the boundary at the middle.

Is there a way to "repair" that with QGis?


texts: Can QGIS Web Client be used with SQL Server based QGIS project?

texts:
question:  We are running a QGIS project with the majority of data coming from a SQL Server 2008 database as well as some third party WMS feeds.

Will QGIS Server and QGIS Web Client be compatible with data originating from a SQL Server database and accept WMS feeds not generated by the QGIS Server?

thanks!


texts:
I'm a computer scientist, and not really familiar with all the terms related to GIS, please forgive me.

I have been given an ArcMap project that consists, what I believe are raster layers, aligned tiff images that represent a park. To that project I have added several shape files (which I've read I'm supposed to put into a geodatabase, but that's another story).

When I export the ArcMap into an ArcPad project using "Get data for ArcPad", I export my shapefiles for background editing (AFX) and export all the tiffs as jpegs. I ensure it's a prebundled CAB for the device, and that I only wish to export the current extent.

Now, when I open that map in ArcPad 10 Desktop (or on a Trimble unit) ArcPad becomes unresponsive and crashes.

The exported project is only a few megabytes in total, nothing outlandish.

What am I doing incorrectly that ArcPad is crashing?


texts: Saving output from Add Join in ModelBuilder?

texts:
I try to join a polygon layer and a multipoint layer. When the model runs, it keeps saying:

  Failed to execute. Parameters are not valid. ERROR 000840: The value
  is not a Layer.

How could I solve it?


texts: Calculating percent overlap between polygon shapefile and grid using QGIS

texts:
I want to calculate what percentage of each grid square is covered by part of a polygon shapefile in QGIS. So far I can get a column of whether a grid square touches the polygon or not (0 or 1), but I want to know the percent overlapped in each cell. Grid is in red, polygon is in yellow.
Perhaps join features?


texts: Writing an algorithm to find the most efficient line angle at which to draw lines

texts:
I've written a tool that fills a polygon in ArcMap with parallel lines at a user specified distance apart and at a user specified angle, written in vb.net and arcobjects. What i'm looking to do next is write a tool that calculates the most efficient angle at which to draw these lines (i.e. the angle which fills the polygon with the least number of lines, or greatest average line length), given the specified line separation distance.

For example if the polygon was a simple rectangle, then the most efficient line angle to fill the rectangle would be parallel to the long axis, as it would take more lines to fill the polygon if they were drawn parallel to the shorter axis. For more complicated shapes I have little knowledge of how to achieve this.

The only way I can think of doing it is to write a loop that creates lines at every angle and then pick the output with the greatest average line length, but that would take too long (drawing each set of lines takes a good 5-10 seconds depending on the number of lines).

I know it's a longshot but does anyone have any ideas? Probably quite a tricky one...


texts: How to use subprocess module to run QGIS toolbox modules

texts:
I've been trying to use subprocess for a while now, but can't get it to work when calling QGIS modules. Here's my script:

import subprocess

call("processing.runalg('gdalogr:merge',
 [rasterin1,rasterin2],'false','false',5,rasterout)")

No matter the input rasters I use (or how I write their paths: I assume they should contain / , not \ to separate folders), I always get this error :

Traceback (most recent call last):
   File "<input>", line 1, in <module>
   File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 711, in __init__
     errread, errwrite)
   File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 948, in _execute_child
     startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

I used gdalogr here (and it doesn't work), but could have used saga:module or grass:module.

The script works perfectly in the console (i.e. when not wrapped by subprocess.call).

I also note people use subprocess successfully to run gdal (Use subprocess.call with gdalwrap), so why subprocessing the processing module would not work?

Any clues?


texts: There are some OpenStreetMap data that doesn't show when I query it with Overpass. Why does this happen?

texts:
So I noticed when I wrote this call
https://api.openstreetmap.org/api/0.6/map?bbox=-118.652199,34.210391,-118.641990,34.214548&page=0&traffic_sign

I get a lot of data and some of them are nodes with traffic signs like
<node id="6786529269" visible="true" version="1" changeset="74327303" timestamp="2019-09-10T19:50:23Z" user="Clarke22" uid="703694" lat="34.2108057" lon="-118.6474817">
        <tag k="direction" v="forward"/>
        <tag k="highway" v="stop"/>
</node>

However when I move to the same bbox on Overpass Turbo and write this query
[out:json][timeout:25];
// gather results
(
  // query part for: “highway=*”
  node["traffic_sign"]({{bbox}});
  way["traffic_sign"]({{bbox}});
  relation["traffic_sign"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Very few traffic signs are shown or mapped.
Why is this? I need to find all the traffic signs in a given bbox.


texts: ogr2ogr command : chaining -clipsrc and -sql filters?

texts:
I'am currently doing a clip then SQL query to select the biggest cities out of Natural Earth data via 2 commands :

ogr2ogr -clipsrc 1 52 7 49 ./tmp.shp ../data/natural_earth_vector/10m_cultural/ne_10m_populated_places.shp

ogr2ogr -sql "SELECT * FROM tmp ORDER BY POP_MAX DESC LIMIT '15'" -dialect SQLITE ./places.shp ./tmp.shp
rm ./tmp.*

I tried to merge them via :

ogr2ogr -clipsrc 1 52 7 49 \
        -sql "SELECT * FROM ne_10m_populated_places ORDER BY POP_MAX DESC LIMIT '15'" -dialect SQLITE \
        ./places.shp ../data/natural_earth_vector/10m_cultural/ne_10m_populated_places.shp

but it fails. I suspect the FROM ne_10m_populated_places part to fails on the clipped data.

How could I do this in a single command ?


texts:
I have a polygon shapefile in ArcMap 10 made up of several vertices/line segments. I need to convert some but not all of the sides of this polygon into arcs. Is there a way to do that without having to redraw the shape? I don't have many other programs available so I'm looking to avoid having to outsource or export the shapefile to another program.

For reference: I also work in AutoCAD 2014 and something like the "convert line to arc" command found in that program would be useful. I'm just not sure if a similar one exists in ArcMap.


texts: Extend Leaflet JS Polygon by x kilometers

texts: I have a huge JSON file with a lot of polygons and I want to extend each polygon by, let's say, 4 kilometers. I don't know any plugin that can do this. Is there a way to achieve this?


texts:
I have an ASTER DEM with some data gaps. The gaps are not necessarily NULL but rather unusual values. For example, in the image below, the black portion has an altitude in the range of 2000 - 2100 m while the white space just outside has elevation in range 6000 - 7000 m. I super imposed the data with google earth image and the second image shows how it looks to G-earth. I've highlighted the parts of interest.
I measured the length of these blacks, they are less than a kilometer long. The surprising part is that these are the mountain peaks. And there's no way there's gonna be so huge elevation difference.

  What I need to do is fill up these space with relevant data. May be some interpolation techniques be helpful or any other method. Is there a way to fill up such data, in QGIS or may be in R ?


texts: Create a network topology for pgrouting with grade separation

texts:
I have built a network using Ordnance Survey's ITN data and I can solve routes across the network. What I need is to build in grade separation topology for overpasses and underpasses on the network so that my routing solutions do not drop off bridges onto roads underneath in an attempt to make the shortest path possible. Does anyone have any pointers as to where to start?

I am using PostGIS 2.0.3, pgRouting 1.0.7dev and Postgresql 9.2 on Windows.


texts:
I am trying to use NumPyArrayToRaster but it does not work. It even doesn't throw me errors, it just stops forever (my file is very small)
So this is my code:

import numpy as np
import arcpy
import math
import linecache

arcpy.env.overwriteOutput = True

myarray = np.array([])
workpath = "D:/testing/"
ascpath = workpath + "testing.asc"

ncols = int(linecache.getline(ascpath, 1).split()[1])
nrows = int(linecache.getline(ascpath, 2).split()[1])
xllcorner = float(linecache.getline(ascpath, 3).split()[1])
yllcorner = float(linecache.getline(ascpath, 4).split()[1])
cellsize = float(linecache.getline(ascpath, 5).split()[1])
nodata = int(linecache.getline(ascpath, 6).split()[1])
print ncols, nrows, xllcorner, yllcorner, cellsize, nodata

f = open(ascpath, "r")
readfile = f.readlines()
for line in readfile[6:]:       #after first 6 lines
    token = line.split()
    myarray = np.append(myarray, token)
newarray = np.reshape(myarray, (ncols, nrows))
print newarray
arcpy.NumPyArrayToRaster(newarray, arcpy.Point(xllcorner,yllcorner), (cellsize), value_to_nodata= nodata)
raster.save(workpath + "test")
f.close()

If anyone can spot the problem, please tell me.


texts:
I am trying to write a function that takes as input two files:

A Shapefile of a region of interest,
A CSV file containing columns with latitudes and longitudes for the stations of interest.

The output is simply a map with the region and points referring to these stations. I am using GeoPandas for this:

def map_stations(self, path_shp, path_csv):
    """
    Maps the stations starting from
    CSV file containing columns with
    latitudes and longitudes, and SHP file
    for the region of interest.
    """

    crs = {'init': 'epsg:4326'}

    map_ = gpd.read_file(path_shp)
    map_.crs = crs

    df = pd.read_csv(path_csv)
    geometry = [Point(xy) for xy in zip(df['longitude'], df['latitude'])]
    geo_df = gpd.GeoDataFrame(df, crs=crs, geometry=geometry)

    _, ax = plt.subplots(1, 1, figsize=(15, 15))
    map_.plot(ax=ax, alpha=0.5, color='grey')
    geo_df.plot(ax=ax, markersize=10, color='red', marker='o')

It's pretty straightforward. The problem is with the scale of the Shapefile I am using. The values of latitude and longitude are on a different scale than the ones in my CSV file.

What am I doing wrong? Isn't setting the CRS enough?


texts:
I have a grid created by mean the following script:

# My grid [using package 'sf']
worldGrid <- st_make_grid(x = worldMap, what = "polygons", cellsize = 10)
worldGrid <- st_sf(idcell = 1:length(worldGrid), geom = worldGrid) %>%
st_cast("POLYGON")

What I want to obtain is a SpatialPolygonDataframe with tre columns:
idcell, LONG, LAT

where the coordinates 'LOG' and 'LAT' represent the longitude and latitude of the centroids of each cell of my grid, respectively.

Is that possible in R?


texts: GP-Tool: Detect if running in background or foreground ? (ArcObjects)

texts:
I got a geoprocessing tool which I want to prevent from running in background, due to some weird crashes that happens.

Is it possible to programmatically detect if background processing is enabled ? (tried to look into environments with no luck).

I know there is a mechanism for this in 10.1, but I am stuck with 10.0 SP 5.


texts: Get cell value based on its rank position from an input raster collection

texts: I have a QGIS overlapping five-raster set, and I want to get the third-ranking value for each cell from these rasters. How can I get this value by considering the five values of this cell in the five different rasters?


texts: How to change the description (text) of a layer in the Leaflet Layer Control?

texts:
In the Layer Groups and Layers Control tutorial, you first create the "cities" object, and add it to the overlayMaps group control with the "Cities" label name.

var baseMaps = {
    "Grayscale": grayscale,
    "Streets": streets
};
var overlayMaps = {
    "Cities": cities
};

Is it possible to programatically change the "Cities" label (as seen in the checkbox) to "Cities (zoom in)"?

The reason I want to do this is because I'm "turning on/off" the layer at a specific zoom level by using "clearLayers" method, which leaves the checkbox turned on if the user has already checked it on.

So I am looking for a way to alert the user they need to zoom in to view the layer.


texts: Setting BackgroundImage on the MAP control using DotSpatial

texts:
A colleague and I are trying to create a microscope software where we would like to display a video stream from a camera on the background on the MAP control using DotSpatial. The idea is to stream the video and use the GIS functionality in dotspatial to draw lines and polygons on top of the image.
The map control has a BackgroundImage property but I can't figure out how to display an image. Are there someone out there with ideas on how to do this? This is how I tried to implement it in visual basic.net:
            Dim picturePath As String = "C:\135624.jpg"
            Dim bm As New Bitmap(picturePath)
            map1.BackgroundImage = ScaleImage(bm, map1.Height, map1.Width)

Optimistic regards
Morgan


texts: Removing "_1" at end of feature class name using Python?

texts:
how to only trimmed off "_1" at End of string. e.g

old name:XX_GIS_XXX_P2_Contour_1mSmooth_Ln_1 to new_name:XX_GIS_XXX_P2_Contour_1mSmooth_Ln

I have tried this but not working removed all last character from feature class.

import arcpy

from arcpy import env

env.overwriteOutput = True
env.workspace = r"C:\Users\SRI00571\Documents\06102016\ttcen_ANNOgdb.gdb"
nameOf_file = arcpy.ListFeatureClasses()
#print nameOf_file
for f in nameOf_file:
    #print f
    if "_1" in f:
        #FN = f.replace("_1"," ")
        #print FN
        gridname = arcpy.Rename_management(f, f[:-2])

##        Output_path ="E:\Anita\Weymouth\Input.gdb"
##        grid = arcpy.ASCIIToRaster_conversion(gridname, Output_path + "\\" + str(FN),"FLOAT")

    else:
##        Output_path ="E:\Anita\Weymouth\Input.gdb"
##        grid = arcpy.ASCIIToRaster_conversion(gridname, Output_path + "\\" + gridname,"FLOAT")
     continue


texts:
I am trying to create a script that creates a new list of rasters by searching through the file names then using that new list to execute the weighted sum function in spatial analyst. I am having trouble with executing the weighted sum.

Here is my code and error messaage:

#Import System Modules
import arcpy
from arcpy import env
from arcpy.sa import *

#set environment setting
env.workspace = "E:/AlexandraOrrego/GIS_2017/RasterData/clipped.gdb"
arcpy.env.mask = "E:/AlexandraOrrego/GIS_2017/RasterData/forest_xcap"

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

#Runs through rasters and sums based on DCA
rasList = arcpy.ListRasters()

#initialize an empty list
matchedRasters = []

for raster in rasList:
    outRasterName = raster[7:12]
    if outRasterName.startswith('11004'):
        print outRasterName
        matchedRasters.append(raster)

#executes weighted sum for of all matchedRasters with using value field and
given a weight of 1
for raster in matchedRasters():
    WSumTableObj = WSTable([raster, "VALUE", 1])
    outWeightedSum = WeightedSum(WSumTableObj)
    #Saves the output
    outWeightedSum.save("output folder")

Here is what is printed and my error message:

11004
11004
11004
Runtime error
Traceback (most recent call last):
  File "<string>", line 29, in <module>
TypeError: 'list' object is not callable
>>>


texts: DEM from overlap monocular images Pleiades

texts:
I am trying to create a DEM from 4 overlap monocular satellite images of different dates from Pleiades using UP42.com. But I could find only information about stereo images processing.

Is it even possible to obtain DEM from several monocular satellite images or I need to use only stereo-images? The problem is that we could not find any for our AOI.
What tools would you recommend to start with?


texts: LiDAR point cloud to numpy array to raster?

texts:
I'm looking for a way to create a height raster (raster of z values - i.e. not just ground poinits). I can accomplish this with gdal by creating a point vector layer from the numpy array then using RasterizeLayer() with options="BURN_VALUE_FROM=Z". However this takes waaaay too long for las files with 10 million plus points.

I have this that works (taken from this gdal cookbook):

def create_z_raster(las, tif, srs):
    """
    Create a height raster

    las = an open laspy File
    tif = 'path/to/tif'
    srs = string format of spatial reference
    """

    # set up the driver in memory
    driver = ogr.GetDriverByName('Memory')

    # create the data source
    data_source = driver.CreateDataSource('in_mem')  # get in_memory driver

    # create the spatial reference
    sr = osr.SpatialReference()
    sr.ImportFromWkt(srs)

    # create the layer
    layer = data_source.CreateLayer('points', sr, ogr.wkbPoint)

    # process numpy array of las points
    las_points = np.vstack((las.x, las.y, las.z)).transpose()

    print("creating point vectors...")
    start_time = time.time()
    for pnt in las_points:
        # create the feature
        feature = ogr.Feature(layer.GetLayerDefn())
        # create the wkt for the feature
        wkt = 'POINT ({0} {1} {2})'.format(float(pnt[0]), float(pnt[1]), float(pnt[2]))
        # create the point from the wkt
        point = ogr.CreateGeometryFromWkt(wkt)
        # set the feature geometry using the point
        feature.SetGeometry(point)
        # create the feature in the layer
        layer.CreateFeature(feature)
        # dereference the feature
        feature = None
    print("done...")
    print(time.time() - start_time)

    # calculate raster resolutions
    pixel_size = .5
    xmin, xmax, ymin, ymax = layer.GetExtent()
    x_res = int((xmax - xmin) / pixel_size) + 1  # round up and add additional pixel for remainder
    y_res = int((ymax - ymin) / pixel_size) + 1  # round up and add additional pixel for remainder

    # create destination source
    target_ds = gdal.GetDriverByName('GTiff').Create(tif, x_res, y_res, 1, gdal.GDT_Byte)
    target_ds.SetGeoTransform((xmin, pixel_size, 0, ymax, 0, -pixel_size))
    band = target_ds.GetRasterBand(1)
    band.SetNoDataValue(0)

    # Rasterize
    gdal.RasterizeLayer(target_ds, [1], layer, options=["BURN_VALUE_FROM=Z"])
    layer = None
    target_ds = None

I would like to know how to do this without first creating point vectors. How do I build a numpy array of z values that can be written to a raster band with a width of x_res and a height of y_res from a las file with n number of points? Or is this a wildly inappropriate approach?


texts: What's the batched Refactor Fields tool "field mapping" syntax in QGIS?

texts:
In QGIS, there is this nice tool "Refactor Fields" in the Processing Toolbox :

Using it on a single layer is fairly straightforward.

However, when you plan on using it in a batch mode, one can see the "Fields mapping" textbox. I'm looking for an example of the syntax to be used there.  I haven't found any specific documentation yet.


texts:
I made a template that allows to quickly export a map. For layers groups, i can disabling showing it on legend and symbol stay displayed on the map :
QgsLegendRenderer.setNodeLegendStyle(group, QgsLegendStyle.Hidden)
I would like to make the same for layers but it doesn't work. The legend entry is always visible. The check option "hidden" is well checked in QGIS Composer (bug ?).
I've try an other approach with the legend model and i remove the current node :
child = ...
model = legend.model()
index = model.node2index(child)
model.removeRow(index.row(), index.parent())

However, the layer is removed from the main ToC.
Is there a solution to keep the layer in the main ToC and remove the entry (but not the symbol) in a layout in PyQGIS ?


texts: Creating points in specified distance along line using QGIS？

texts:
I want to use QGIS creating points along the line, but in specified distance. I found two GRASS tools in SEXTANTE Toolbox：

v.to.points
v.segment

I tried v.to.points, setting the maximum distance between points in map units to 100 and got this：

The second photo showed a close look from the upper one. The result was what I want, but I want to get less points, but even I set the maximum distance to 1000, or 1000000, the result was the same.

I tried to use v.segment, but I had no file containing segment rules.

Underdark gave me some advice, and I tried Densify geometries given an interval. First it gave me a polyline shapefile the same as I input, and then I used extract nodes to try to get those points. But the result was the same as I got using v.to.points, no matter what I set the distance interval.

How can I create points along the line, and in specified distance？


texts: Export a specific region of leaflet map to png

texts:
I'm not sure if what I'd like to do can be done or not. I'm building a leaflet based app to track aircraft performing search and rescue patterns. The country is divided up into predefined grids, and these grids are used by the pilots to fly their track. The scanner in the backseat is survey the ground below looking for any sign of a downed aircraft.

What I'd like to be able to do is to print a copy of the map that is bound by the 4 points of the rectangle at a specific zoom level so it fits within an 8.5x11 sheet of paper. Examples I've seen all use a centerpoint, but I need to define the 4 corners, see what zoom level will fit on a page, and then make a print grid function available to users of the app.

Is this possible?


texts:
I tried downloading Sentinel-2B imagery from https://scihub.copernicus.eu/s2b with python urrlib2 but get HTTPError: Unauthorized on urllib2.open().

The same procedure works for https://scihub.copernicus.eu/dhus (where S2B is not available).

Does anyone have a working method for programmatically downloading S2B?


texts: Opacity / Transparency in raster legend QGIS

texts:
I have a classified raster with three classes. One of them has to be hollow. I added a legend which looks like this.

Apparently, the opacity level - in this case 0% - is not transferred to the legend in the map. On the right side you can see that the color in the map is hollow. I created "hollow" by selecting any color, in this case orange, and setting the opacity to 0%. Is there any way to transfer the opacity / transparency level to the legend in the map?

This is how I got this legend:

Load a raster file with categorical data (in this case values 0, 1, and 2)
Properties -> Style -> Render type: Singleband pseudocolor -> Classify -> Choose colors (One of them was a random color, here orange, with Opacity=0%)
Change to new Map Composer. Add a Map and a Legend.

Result:

The legend now shows the random color. However the opacity is not forwarded to the legend.

I'm aware that in this case it might be possible to change the random color to white and thus synthesize the "hollow" color. However, I think this might be useful for other users who face this problem as well.


texts: Creating dynamic overlay grid in ArcMap or ArcGIS Pro?

texts: I have a shapefile of multiple polygon features corresponding to geographic regions that vary in area. The task is to create a dynamic grid over each polygon, with the size of the squares for each grid dependent on the area of the underlying polygon, e.g. if area of polygon exceeds a certain threshold then grid square width and height is x metres by x metres. I can use the Grid Index Features tool in ArcMap (v 10.7) to create one grid over a single polygon, so am wondering if this can be extended to loop through multiple polygons, producing the required grid for each polygon. The ultimate aim is to create input for the Data Driven Pages tool (or the equivalent Map Series tool in ArcGIS Pro) to produce a map atlas for each geographic region, including an overview map plus maps for each of the individual grid squares to provide greater detail.


texts: Label size in map units, GeoServer .SLD file

texts: Is it possible to define labels in map units in a GeoServer SLD file?


texts: Why can't I add more vector layers without QGIS freezing up on me?

texts:
I've been working on a project for a quite a while, I've loaded many vector layers, including several hundred short line segments that are kmz files, as well as topo lines, lake and glacier polygons, rivers, roads, vegetation, hillshade, etc.
I've also created about 50 Map themes and map layouts that use these layers in many different configurations. Everything is quite intricate and has taken a ton of time to set up.
Unfortunately I've run into a problem where I can't load additional vector layers in. When I try to add a layer, the layer will appear in the layer panel, but the program will then freeze with a spinning wheel. Generally if I click a few more times QGIS will alert me that the program isn't responding, and I restart. Once or twice I left it for a long time, maybe 30 minutes, and it seemed to resolve and was usable again, but then froze up in the same manner shortly after.
I've tried trouble shooting and found that if I remove about 80 percent of the kmz files the project seems to function normally and I can add new layers, however this won't allow me to finish my project. Also, I was able to continue to add new kmz files fairly recently so I don't' understand why I'd need to remove so many files for it to work normally. I've tried to determine if there's a corrupted vector layer by removing the layers in different combinations but it doesn't seem like there's one file causing the issue.
The other possible problem I've tried to look at is whether the map themes could be causing an issue, perhaps if they link to a layer that I accidently deleted, but this doesn't seem to be the case.
Any thoughts on what might be going wrong?
One thing I just noticed while using the plugin Layer Board. When I use it to look at the layers, it identifies over 1200 layers. As part of my workflow I've been editing my vector layers in Google Earth and saving them as kmz for import as vector layers into QGIS. Later I often tweak the layers in Google earth and overwrite the kmz using the same name. those files edited vecor files show up in QGIS in their updated configuration without having to add them again. However, looking at Layer Board it looks like all of the previous kmz's that were overwritten are being considered as vector layers in the project. Most vector layers show up several times in the Layer Board list - The layer names are the same, but the IDs are not the same.- the number/letter code added to the name for the IDs are different. Instaead of tracking about 350 kmz, it's tracking over 1200, more than half of which were overwritten by a file with the same name. see the inlcuded screes shot to clarify.
could this be causing my issues?


texts:
I've done quite a bit of research here and elsewhere and am still having trouble coming up with a solution for measuring volumes using a DEM derived from high-resolution (1 m) stereo satellite imagery.

The closest solution I have found so far has been this: "How to calculate the volume of several DEMs to obtain elevation and volume changes?".

I understand that the 3D analyst extension within ArcGIS would be able to accomplish this, however, I am limited to the availability of open source software such as QGIS which I am an active user of.


texts: How can I get features that satisfy a QgsExpression using PyQGIS?

texts:
I have two fields say "State" and "name" which would be get from the two comboboxes. After which, based on the current text in the combo box, I want to make QgsExpression and feature that satisfies QgsExpression should be get back and for that feature I would do spatial operations. How this could be done using python?

I want something like this:

state= current text in state combo
city=  current text in city combo
feature = "state" and "city"
exp = QgsExpression(feature)


texts: Hillshade Elevation relativity (Keeping elevations relative across various rasters)

texts:
I have a number of various Lidar projects that I created DEM's with. I want to keep them separate (no mosaic), but need to create a hillshade from each DEM. My issue is if the max Z value in DEM#1 is 100m and the max Z value in DEM#2 is 200m, when I create their respective hillshades the max Z value is used to calculate the shade on the colour ramp.

For example, the highest elevation in DEM#1 (100m) will be white, and the highest elevation in DEM#2 (200m) will be white as well. When I want to display the hillshades side by side you wouldn't see any difference in elevation, eventhough there is a 100m difference. Has anyone come across this issue before, and if so is there a remedy?


texts: images URL "Geojson-dashboard" framework for Leaflet js

texts:
a question for somebody that used before the Geojson-dashboard framework for Leaflet (https://github.com/fulcrumapp/geojson-dashboard):

Is it possible to add the images URL or Hyperlink dynamically? or is it strictly necessary to edit insight of the geojson file (so to create a column for the URLs)?

My goal could be adding a reference to my images directory (local directory) somewhere into the code (app.js) like this :


texts: Invalid Expression ERROR 000358: Select by Attribute

texts:
I'm attempting to select a certain point in a feature layer so I can perform buffer analysis on it. The code seems fine, but I am getting an invalid expression error:

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 7221, in SelectLayerByAttribute
      raise e
  ExecuteError: ERROR 000358: Invalid expression
  Failed to execute (SelectLayerByAttribute).

Here is my code:

import arcpy
where = """ Location = 'C' """
print where
arcpy.MakeFeatureLayer_management("Q:\Admin\F2F_Scripts\Tools\Template\Intermediate\DATA\Temp.gdb\PADPOINTS", "POINTS")
arcpy.SelectLayerByAttribute_management ("POINTS","NEW_SELECTION", where)
arcpy.Buffer_analysis("POINTS", "Q:\Admin\F2F_Scripts\Tools\Template\Intermediate\DATA\Temp.gdb\Buff", "100 Feet")
arcpy.Delete_management("POINTS")
del where


texts: When adding a new field, my data type changes from short integer to long integer in ArcGIS Pro

texts: I am having trouble in Pro where, when I'm adding a new field to an attribute table (let's call it "Code"), I m trying to make the data type Short integer. Once i change it to short integer, I run it and a new field is created under Code. When I hover my mouse over it, it says the type is Long integer. I can't seem to fix this no matter what path I take. It's a new field and there is no data I have added to it. I am relatively new to ArcGIS Pro so I'm assuming there's a simple fix to this.


texts:
Here's a quick summary about what I'm trying to do: Let's say I got two layers. One (A) with 10 polygons and one that is more granular with 100 polygons (B). Just to check if the behavior of PostGIS and ArcMap is the same, I would like to select all polygons in B that are under a polygon in A. Since the sum of all polygons of both layer got the same shape, all polygons of B should be selected. If I do that in ArcMap, everything works fine (100 of 100 polygons selected). If I use the following statement in PostGIS, some of the polygons are not in the resultset (about 10%):

SELECT layer_a.gid, layer_b.gid FROM layer_a, layer_b WHERE ST_Contains(layer_a.geom, layer_b.geom);

No I want to be more specific. Let's say I'd like to select all Polygons from B that are under a specific polygon from A with a polygon_id = 1. For this I use the following statement:

SELECT layer_a.gid, layer_b.gid FROM layer_a, layer_b WHERE ST_Contains(layer_a.geom, (SELECT layer_b.geom WHERE layer_by.polygon_id = '1');

But now, I get a empty resultset and I really don't know why. Could somebody explain me this behavior?
Note: I just imported shape files without assigning a special SRID or something like this.
I appreciate any help. :)


texts:
I have a PostGIS database with various tables and views. With pgAdmin I can make requests on the tables, on the views, all is working.
I add tables in QGIS 2.8, it's working, I can read, write, modify the data.
I can add views in QGIS, for all of them except two, it works.
For two views, a QGIS error window says the layer "is an invalid layer and cannot be loaded".
But I have tested on pgAdmin, the views are good and quick the load data.
So I modify the views with :
ADD OR REPLACE VIEW x AS (/*SQL code*/ LIMIT 10);
And now I can add the views in qGIS, and it works.
I modify the views to remove the LIMIT 10. And in qGIS I can see the views and ask informations about entities, all is good.
But if I save the QQIS project, on restart the layer fails to load.
I think the problem is in QGIS. But how can I know the way QGIS checks all the shapes.


texts:
How can I save the output of my For loop so that I have a different output name each time?

This is the code I´m using:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\shapefiles'
outworkspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\KernelDensity'
fcList = arcpy.ListFeatureClasses ()
for fc in fcList:
    outKDens = KernelDensity(fc,"NONE",4670)


texts: Drawing line to closest point within single column

texts:
I have sets of points that define a roadway segment, and can connect them with St_MakeLine, but I have no field with which to order them, so they zig-zag. Ordering by lat/long/x/y only partially helps, as they curve back on themselves.

I would like to connect each point to the next closest point with a new line, from within the same column.

ArcGIS Pro was my first try, but it is closing the segments at both ends (regardless of the settings I use). I am using PGAdmin4 with the PostGIS extension. Query speed is not an issue, I need it to run correctly once and then I will import the results into ArcGIS Pro.


texts: Calculating the Centroid of polygon in modelbuilder (VBA to Python)

texts:
Got an easy one, that's got me stuck.
I'm moving some models that were created in 9.3.1 to work in 10.

Part of the model is calculating the X coordinate of a polygon to a specified field.

The code that works (in 9.3.1) is

Dim Output As Double
Dim pArea As IArea
Set pArea = [Shape]
Output = pArea.Centroid.X

Expression = output

It doesnt work in 10 as i get the following error.

General error executing calculator.
ERROR 999999: Error executing function.
Expected end of statement
Failed to execute (Calculate Field X_COORD).

I've tried the following using the python parser

def calc(shape,x):
    x = "shape.CENTROID!.split()[0]
    return x

calc(!SHAPE!, !X_COORD! )

But that gives an error - invalid syntax on line 2.

Any pointers?
Thanks


texts: Selecting lines occupying identical positions in MapInfo or QGIS

texts:
I have two shapefiles from a client, one is their entire network (complete with unique IDs) and another a selection I need. However the selection file does not have unique IDs but the entire one does. How would I be able to select the lines that appear in both files from the entire network shapefile?

Thanks,
Alan


texts: I want to track device using triangulation algorithm. It works fine with 3 BTS stations at 3 different locations. What should I do if only 1 or 2 BTS exists.


texts: Expression to convert string to float (MapServer)

texts:
Is it possible to convert a value string into a float in a mapfile? The code is in CLASS / TEXT, so I can use expression.

For example my value is always displaying ".7". I would like to display "0.7". But I can't  do "0" + [value], because sometimes, I have "1" and I don't want to show "01".

For now, it seems that a function float() doesn't exist.

I have MapServer 7.

Edit:

I also try ternary operation like:

TEXT (length([value]) = 1 ? [value] : "0"+[value])

But ternary doesn't exist...


texts:
I'm following along the D3 tutorial, and on this line:

ogr2ogr \
  -f GeoJSON \
  -where "adm0_a3 IN ('GBR', 'IRL')" \
  subunits.json \
  ne_10m_admin_0_map_subunits.shp

run into the following problem:

FAILURE:
Unable to open datasource 'ne_10m_admin_0_map_subunits.shp' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> GMT
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDump
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> PDS
  -> HTF
  -> AeronavFAA
  -> EDIGEO
  -> SVG
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY

I have the .shp, .shx, .dbf, and .prj files all in this directory.  Why is ogr2ogr unable to read them with anything?  (Shapelib is installed.)

I'm using Ubuntu 12.10 if that makes any difference, and had to compile GDAL from scratch, using version 1.9.0.


texts:
I have a newbie question...

I always used the International Standard Atmosphere model whenever I needed to calculate the temperature in a given altitude.
It always looked accurate to me...

However, doing some work using GFS data, I found something intriguing..

At a given high altitude (let's say : 150 hpa/44000ft), the temperature I saw in the GFS model was almost always colder than the ISA temperature for that altitude

This was mostly TRUE for latitudes between -30 and 30º, and the OPPOSITE for abs(latitudes) > 30º.

Example:

So, I came with a hypothesis... Want I want to know if it is crazy or not.

The ISA model is an average model. Temperatures in the tropics are lower (for high altitudes) and the temperatures near the poles are higher. The final average is the ISA model.


texts: Trying to understand QGIS LRS plugin - How to implement?

texts:
I have been trying to understand how to implement the LRS plugin but there are many things that does not "click" in my head. Not sure if it is the terminology or the process i dont understand, please help with some pointers of what I am missing.

I have been through the documentation and I have been reading these two posts already, but I think there is something fundamental I am missing for my understanding to tie the dots together. If someone have sample data or a video showing the complete process that would be of interest.
Linear Referencing in QGIS?
How to find Chainage of points using QGIS

I will try to be concise and clear of what i ask.. I have far too many stupid questions on this as I am a bit at loss..

If I start from scratch with a topological correct road network that has a field road_number. Several road segments with the same road_number make up a complete road.
Say I have a point layer with street signs, what do i need to do to reference them to the network?

As a test I created a point layer and placed a placed a few points close to the line. Each point has an attribute that is the same as the closest route.

Assuming the first thing i should do is to calibrate it. My output layer I get has 3 columns road_number, m_from, m_to but is completely empty? Am I missing something?


texts: QField crashing when new point data added with error "Feature 0 could not be fetched after commit"

texts:
I have an issue with QField and am not sure how to troubleshoot it. Sometimes when creating a new point (after entering its attributes and pressing the check mark to save it), QField freezes with an alarm in the upper right corner that reads "Feature 0 could not be fetched after commit".

The app has to be closed and restarted to make it work. It seems a bit random on when this occurs (e.g. I can re-enter the exact same information into the attributes form and it will work the second time; it will freeze several times in a row and then work fine for hours).

Any ideas on how to start looking into this?


texts:
Does anyone have or know a citation for the Landsat 8 striping that affects some scenes (Brazil shown here).  It's apparent in all bands (B3 here at 100% stretch) and is present in both RAW and Surface Reflectance imagery.  It's impacting an image classification's accuracy and I can't seem to find much info about it in the Known Issues from USGS.  I've found this document from a Yale website, but again, can't seem to find a primary source to cite.

Google Earth Engine link to script showing the striping effect at Band 3. The script also allows the export of a subset of the product LC08_L1TP_230066_20170621_20170630_01_T1


texts:
I need to use the fileGDB driver in gdal, however I can't figure out how to install the driver.

This is the only kind of documentation I found but it doesn't make any sense to me:
http://www.trac.osgeo.org/gdal/wiki/FileGDB

Could somebody explain to me how to get this driver to work?
My OS is Windows 10 with the gdal core-1600 64-bit from GISInternals.


texts: Keeping my own additional Python layer information for potential further usage in QGIS

texts:
I wrote a plugin that selectively loads simulation data to QGIS. That works fine, but the overhead to convert the data from my own format to QGIS takes a long time, as I have to generate an index and hash-tags etc. After finishing my script, the index is lost.

Later, if I want to work with one of my layers, I don't want to do this work again. It would be nice if I could somehow attach the index and hash-tag list to my QGIS layer, to access it with other scripts later. Currently I have to save it on the disc.

Does anybody know where I could smuggle this data in my layers?


texts: How to use the the Category Widget in the CartoJS v4?

texts:
I'm looking into using the Category Widget in a custom Map, using Carto JS v4.

I've managed to get the data to show up on my map, and Now I want to have a category Widget, like the one you have Carto Builder based maps.

The only example I've found, is on their site, over here: https://carto.com/documentation/cartojs/examples/#example-category-widget

This seems to work, except it doesn't have any UI.

How do I get the widget with UI similar to the one Carto Builder?


texts: Cell-by-cell analysis of values of buildings in a city

texts:
I'm absolute new in GIS.

My task is to estimate the wind energy potential in a part of a certain european city by using a given method which is based on the calculated roughness of cells of one square kilometer. The values I need here are height, ground area and projection area (direction west) of the obstacles (buildings).
I found a complete 3D modell of the city (City GML) and I have additionaly access on a administrative database including position and dimensions of all buildings - unfortunaly there is no one with knowledge able to help me getting started with the software (QGIS).

My (simple) idea is like

adding the grid-layer (like
https://www.govdata.de/daten/-/details/utm-raster-hamburg ?)
analysing cells:
are there buildings in the cell?
saving height and ground area, calculating projection area by using length/width and position
calculating rougness of the cell...

(problem not thought about yet: buildings can be located in more than one cell!)

...and in the end presenting the result (the cells wind energy density per square meter) in a coloured map.

So far - I have few ideas how to concrete start with the given material. Are there some functions, tools or terms I should have a closer look at without the need to start learning the GIS science from zero?

Is it expedient to use the 3D model which is more detailed (including hills etc.) or is the QGIS-database promising more?


texts: Location Marker Pin on Esri map is changing direction when we navigate. How to stop rotating of map pin

texts:
I am using a custom map marker icon which works well as expected. However as I navigate , the direction of the marker pin on map changes. I have tried changing the coarse symbol and heading symbol as well. But that doesn't work. Here's the screenshot. http://i.stack.imgur.com/XXawl.jpg

How can I avoid this?


texts: Querying multiple WMS layers in OL3 and adding to a single popup window

texts:
I've created a simple mapping application that shows a number of WMS layers (from GeoServer/Oracle) on a map, with check-boxes to turn them on and off. The layer list is generated dynamically from a table in a database. What I need to do now is add the ability to query multiple layers. Many of the layers overlap so I need to be able to click on a point and it show all the information from the selected features for the layers that have been turned on.

I can do this for a single layer (either by index in the collection or filtering by name) using the OpenLayers 3 example on their site. However, I want to be able to click on the map, and any layers that are turned on are queried and added to the same popup window.  So far I have this code which generates the URL for each layer:

map.on('singleclick', function(evt) {
var coordinate = evt.coordinate; //Picks up click coordinates
var viewResolution = view.getResolution(); //Picks up map current resolution
var layersCollection = map.getLayers(); //Creates collection of layers object from layers that have been turned on.
var i;
for (i = 1; i <= ((layersCollection.a.length-1)); i++)
{ //Loops through all layers excluding baselayer at index 0 and gets their URL
    var layerID = layersCollection.item(i);
    var url = layerID.getSource().getGetFeatureInfoUrl(evt.coordinate, viewResolution, Projection,{'INFO_FORMAT': 'text/plain'});
}

This generates a URL for each layer.  Normally then for a single layer I would use an iframe to get the information into the overlay like this:

if (url) {
overlay.setPosition(coordinate);
    content.innerHTML =
    '<iframe  src="' + url + '"></iframe>';
    container.style.display = 'block';
};

But I can't work out how to do this for multiple layers. Anybody have any ideas? Apologies for my basic JavaScript skills.


texts:
bit of an odd one which isn't necessarily package-specific.

I'm trying to make a tshirt with a map section centred on the plane between San Francisco, USA, to Galway, Ireland. The Great Circle line between them goes over northern Canada and the Hudson Bay. What I'd like is to make a oblique projection of the earth with that plane as the 'equatorial line'. If that's possible, I'd prefer the projection to be Miller 1 rather than Mercator, but I'm not too fussy since the greatest distortions will be farthest away from the area of interest. This will result in a tshirt whereby one place is on the front, one on the back, joined across the side of the tshirt, which may be hard to print.
In the course of my investigations I've recently seen the Werner (2nd Stabius) map (http://www.progonos.com/furuti/MapProj/Normal/ProjPCon/) which would be perfect as a front or back only (easier for standard tshirt printing) AND is a lovely heart (aww) BUT is less likely to be supported by map projection programmes I assume. Nonetheless if I could make one of those where I could set my own angle and pole, that would be dandy.

I've looked into a variety of tools but come up short so far. I'm not aware that QGis can set a projection which doesn't use the standard equator/poles & angle?

Thanks in advance for any clever ideas!
p.s. this is the centring i'm talking about, but obviously suffers huge distortion at the edges, where the points of interest are: http://imgur.com/ktw4KOr
If anything, I might even be interested in a projection which minimised the centre of focus to the benefit of the edge regions...


texts:
I now have a map and get the basic of the map from a geoJSON file.

Now i have a websocket and sent always positions from 3 different people. So how can i add a marker , which i can move to another location?

I tried to change map._layers[*]._latlngs after adding a marker but it only changes position when i zoom out or move the map.How can i render it by myself, without zooming?


texts: Obtain Longitude/Latitude Values and Export Data From QGIS

texts:
I have a CSV file with address data elements (Street# and Name, City, State, Zip). I'd like to be able obtain corresponding X,Y coordinate for each of the address? How do I achieve this using QGIS?

Ideally, the output would look like this:

123 Main Street, Simi Valley, CA 90020 32.0909090    -118.99839483


texts: Cannot install any extensions on GRASS GIS?

texts:
I'm currently trying to install the m.printws extension using "g.extension" command. However, it is giving me a FileNotFoundError: [Errno 2] No such file or directory: 'svn'. I tried other extensions too, yet non of them worked. Any idea of how to solve this issue?
Full Shell script:
 Fetching <m.printws> from GRASS GIS Addons repository (be patient)...
Traceback (most recent call last):
  File "/usr/lib/grass78/scripts/g.extension", line 1976, in <module>
    sys.exit(main())
  File "/usr/lib/grass78/scripts/g.extension", line 1956, in main
    install_extension(source=source, url=url, xmlurl=xmlurl)
  File "/usr/lib/grass78/scripts/g.extension", line 681, in install_extension
    ret1, installed_modules, tmp_dir = install_extension_std_platforms(module,
  File "/usr/lib/grass78/scripts/g.extension", line 1292, in install_extension_std_platforms
    download_source_code(source=source, url=url, name=name,
  File "/usr/lib/grass78/scripts/g.extension", line 1233, in download_source_code
    download_source_code_official_github(url, name, outdev, directory)
  File "/usr/lib/grass78/scripts/g.extension", line 1119, in download_source_code_official_github
    if grass.call(['svn', 'export',
  File "/usr/lib/grass78/etc/python/grass/script/core.py", line 74, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib/grass78/etc/python/grass/script/core.py", line 63, in __init__
    subprocess.Popen.__init__(self, args, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'svn'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_grass78_scripts_g.extension.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/grass78/scripts/g.extension", line 1976, in <module>
    sys.exit(main())
  File "/usr/lib/grass78/scripts/g.extension", line 1956, in main
    install_extension(source=source, url=url, xmlurl=xmlurl)
  File "/usr/lib/grass78/scripts/g.extension", line 681, in install_extension
    ret1, installed_modules, tmp_dir = install_extension_std_platforms(module,
  File "/usr/lib/grass78/scripts/g.extension", line 1292, in install_extension_std_platforms
    download_source_code(source=source, url=url, name=name,
  File "/usr/lib/grass78/scripts/g.extension", line 1233, in download_source_code
    download_source_code_official_github(url, name, outdev, directory)
  File "/usr/lib/grass78/scripts/g.extension", line 1119, in download_source_code_official_github
    if grass.call(['svn', 'export',
  File "/usr/lib/grass78/etc/python/grass/script/core.py", line 74, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib/grass78/etc/python/grass/script/core.py", line 63, in __init__
    subprocess.Popen.__init__(self, args, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'svn'


texts: How to use Lists with ArcGIS ModelBuilder?

texts:
The ArcGIS ModelBuilder is nice to work for when dealing with single input/outfiles. When I want to use the List option (As to, for example, Clip several layers using the same clip feature layer), I always end up having to fill in the file names manually, as copy paste is very problematic (the ArcGIS help suggests using excel, but the copy-paste of every single path is the problem, not making the names).

Does anybody know of a way to overcome this (I wish there was a way to load a list, but either I didn't find it or it doesn't exist) ???

(oh, and I almost forgot: I'm using 9.3.1)


texts: Converting an AML into Python - terms not within help

texts:
I'm using an AML used for preprocessing required by the SPARROW model (https://www.usgs.gov/mission-areas/water-resources/science/sparrow-modeling-estimating-nutrient-sediment-and-dissolved?qt-science_center_objects=0#qt-science_center_objects). I do not have ArcInfo Workstation, and my IT department does not have a copy either, nor are we able to download a copy. So the solution is to convert it to Python, however even for such a short script this has proven to be rather taxing. Part of the problem is that I do not recognise what all of the commands within the AML actually do (see script below).

/* Edit the pathname for the directory containing the ArcInfo reach coverage as necessary
&workspace A:\river_line

&DATA arc info
ARC
CALC $NM = 1
CALC $COMMA-SWITCH = -1
CALC $PRINTER-SIZE = 200

/* Edit the name of the aat as necessary
arc.aat
/* Edit the name of the attribute for the unique reach identifier
/* as necessary
SORT LINKNO
RESEL LINKNO LT 80000

/************************************
/* Output reach attributes for non-coastal reaches
/* Edit the path for the output file as necessary, but retain the
/* name reach.dat for the output file.
/* Edit attribute names as necessary.
/************************************
OUTPUT D:\sparrow\data\reach.dat INIT
PRINT LINKNO,FNODE#,TNODE#,DEMIAREA,FRAC,HUC2

ASEL/* Edit the aat file name as necessary (retain the # symbol)
SORT arc#
Q STOP
&END
&RETURN

For instance I do not know what: RESEL, LT, and ASEL means. Any idea?


texts: Creating buffers around points and merging with SpatialPolygonsDataFrame to create a list of matched polygons and area of intersection?

texts:
I have data on polling booths as points and data on village boundaries as polygons. I want to create buffers of 1km around the polling booths and (a) save the ID of all the villages that intersect with the buffer (b) in another column have the amount of area that intersects in Km2.

I have tried everything but it doesn't work. I am sharing my code below.
When i use intersect on Spatialpolygons my R crashes with fatal error. I tried to rasterise but i get some strange output that i do not understand.

sample dataset - https://drive.google.com/open?id=1Ha47ZqwG7bCuxExJk6zOs8KoqDiqD5A4

rm(list=ls())
##LOADING DATASETS REQUIRED FOR THIS
load("sampledata.Rdata")

#booths data - dataframe - upbooths_raw
#booths data - spatial file - up_booths_sample
#village data - up_villages_sample
#loading libraries that i might use
library(rgeos)
library(raster)

up_booths<-up_booths_raw
#up_booths_raw<-subset(upid2017matched_gis2,district_name_17=="Jhansi")
up_booths<-subset(up_booths, is.na(latitude.x)==FALSE & is.na(longitude.x)==FALSE)

#project the booths
coordinates(up_booths) <- ~longitude.x+latitude.x

#make same coordinates copy village CRS to booths
up_booths@proj4string <- up_villages_sample@proj4string

#new CRS which is good for Uttar Pradesh India
newcrs <- CRS("+proj=utm +zone=42N +datum=WGS84 +units=km")

#transforms booths and villages to new crs
up_booths_transform <- spTransform(up_booths, newcrs)
up_villages_transform<- spTransform(up_villages_sample,newcrs )

#create booths with 1km buffer
up_booths_transform_buffer1km <- gBuffer(up_booths_transform, byid = TRUE, width = 1, capStyle="ROUND")

#runinng this crashes R into fatal error
pi <- intersect(up_booths_transform_buffer1km, up_villages_transform)


texts: Want to use GDAL in Arc10 toolbox via subprocess call

texts:
I'm attempting to launch a version Python 2.5 that supports GDAL from an ArcGIS10 toolbox script. I'm doing this because I'm having loads of trouble importing the GDAL library directly into Arc, and I'm writing an application that will need to be backwards compatiable with Arc 9.3.

Here's what I'm attempting to do. The main.py file in the toolbox:

import subprocess
p = subprocess.Popen(['C:\OSGeo4W\gdal_python_exec.bat', 'X:\\local\\import_tests.py'])

gdal_python_exec.bat is a windows batch script that fires up the 2.5 version of Python I want while also setting up some environment variables:

@echo off
set OSGEO4W_ROOT=C:\OSGeo4W
PATH=%OSGEO4W_ROOT%\bin;%PATH%
for %%f in (%OSGEO4W_ROOT%\etc\ini\*.bat) do call %%f
@echo on

@C:\OSGeo4W\bin\python.exe %1

Next, import_tests.py tries to import gdal:

try:
    from osgeo import gdal
    raw_input('Imported! (Press enter)')
except Exception, e:
    print(e)
    raw_input('Failed! (Press enter)')

When I run main.py at a DOS command line as C:\Python26\ArcGIS10.0\python.exe gdal_arc_test.py things work fine. However, if I take the same script and add it as a 'toolbox' inside of Arc launch it from there, I get a "DLL not found" for the GDAL lib inside the import_tests.py file!

How can this happen when subprocess is the module that's launching a different Python interpreter? Any ideas on what could be happening?  It feels like the version of Python launched from Arc's tool box does something very strange, but I would have thought the subprocess call would separate that stuff out.

P.S. I can verify that the os.environ['PATH'] variables are the same in both calls.


texts: App user export data? (Google Earth Engine)

texts:
I want to make an app in Google Earth Engine similar to geo-wiki, in which users classify imagery. Something like: user clicks on image to assign classifications, generates a FeatureCollection of labelled points, and exports that data so I can see it (to use for training/validation).
How can an app user export data? I tried using export.table.toAsset(), but of course nothing pops up in my 'Tasks' tab. I suppose the user could download using downloadURL, and email me the points :-/.... What other options exist for the app user to export data and share it with me?


texts: Only show features in visible layers when using the ArcMap hyperlink tool?

texts:
I have an ArcMap MXD file with multiple layers containing points associated with an URL that can be visited using the hyperlink tool. Some layers contain many points, other contains few.

My problem is that when I select the hyperlink tool blue dots are displayed for all points, even from layers that are not visible (i.e. unchecked in the ToC). This makes it near impossible to click points in one of the layers containing few points, since the screen gets completely cluttered with points from the denser layers. The screenshot below illustrate the problem - only two of the blue dots are from points in the visible layer that I would actually like to click. Good luck finding them.

Is there any way to make ArcMap only display blue dots for the visible layers? Limiting it to a selected layer would also be an acceptable solution.


texts: How to bring georeferenced raster data into MAPublisher?

texts: What is the appropriate method to import a georeferenced raster image into MAPublisher? I have been able to import other forms of map data, and created map views and such for them, but I am now interested in importing a raster image with spatial data and retain that data within MAPublisher. Do I need to have some sort of GIS data in the document before I can import the georeferenced raster image? Or is it possible to bring it in on it's own?


texts:
I want to use QSWAT in the QGIS environment but after downloading and installing the SWATeditor and QSWAT I get two errors:

1)First: Couldn't load plugin MetaSearch due an error when calling its classFactory() method

2)Second: Couldn't load plugin QSWAT due an error when calling its classFactory() method

And then as expected in the plugin window it tells me the plugin is broken.

Can anybody help me with this?


texts:
I am having trouble with new shape layers not showing up on my map. When I add the layers they show up fine in the attribute table, but nothing shows up on the map. This happens regardless of what order my layers are in, even when I try to open one in a new blank project I can't see anything.

Additionally, one of the layers I'm trying to use (a shapefile of school districts in a state) displays really implausible coordinates in the status bar. No error message is coming up, or any other type of message that would indicate a problem with the shapefiles.

I am very new to QGIS so I'm pretty out of my depth at the moment.


texts: Convert Longitude and Latitude values from database to Decimal Degrees

texts:
I am getting data from a SQL Server, with values for longitude and latitude stored as "raw" values i.e. there are no negative signs in front of longitudes, and no decimals in either longitudes or latitudes. For example, a point in Colorado is given long/lat values in the database as:

Longitude: 104905936  Latitude: 3980741

These should be: -104.905936 and 39.80741

Is there a way to change these values within ArcMap after I bring the table in as a database file? If this must be done in Excel, can anyone recommend an efficient way of adding the negative sign and the decimal point in the correct spots?


texts: How to find the polygons bordering a feature programmatically with qgis?

texts:
Is there a way to calculate the neighbors of a polygon with pyqgis for every feature? For example, the selected polygons relative to the one in the center:

I found this solution, but it's a year old and doesn't seem to work with QGis 2.0.


texts: How can I write private tag GDAL_NODATA to a TIFF using libtiff?

texts:
In an earlier post I asked how to retrieve this tag from TIFF using python and libtiff. Eventually I found the answer and I reported on the solution last week. I also realised that in order to write a proper GeoTIFF, more tags are needed than only GDAL_NODATA, viz. ModelPixelScaleTag, ModelTiepointTag, ModelTransformationTag, GeoKeyDirectoryTag, GeoDoubleParamsTag, GeoAsciiParamsTag and GDAL_METADATA. Maybe even more are needed? The GeoTIFF format specification is found here - rather extensive ...

Now I want to also know how to write private tags. It goes wrong when I reach line 934 of module libtiff_ctypes:
r = libtiff.TIFFSetField(self, tag, data)

The GDAL_NODATA tag is part of the dictionary tifftags - see my earlier post. The error message that is reported is: WindowsError: exception: access violation reading 0xFFFFD8F1. What am I doing wrong?


texts: Postgis st_intersects fails on an obtained point on the line with the line itself

texts:
I am trying to split a line from its intersection with another line. I know I can use st_split directly here but I wish to split a line from several positions where it intersects other lines. What I discover is the following:

I know that lines 1 and 31 intersect

select st_intersects(a.geom,b.geom) from dumped_roads as a,
       dumped_roads as b where a.gid=1 and b.gid=31;

Output:

st_intersects
---------------
t
(1 row)

Also, st_intersection(a.geom,b.geom) returns an intersection point.

But when I do,

select st_intersects(a.geom, st_intersection(a.geom,b.geom))
from
  dumped_roads as a,dumped_roads as b where a.gid=1 and b.gid=31;

st_intersects
---------------
f
(1 row)

I can't understand what the problem is. Although a.geom && st_intersection(a.geom,b.geom) returns true but that wouldn't help me in splitting the line with the point obtained from intersection.

If it is indeed how it is, is there any way out on breaking a line from an obtained point which physically lies on the line, but is not in the linestrings point set?


texts: Inflating the boundaries created with convex hull

texts:
I have a set of lan and lat points and have plotterd a convex hull for them using QGIS. A polygon is created along the set of points and plotting them on the MAP.

Now I am trying to inflate the size of this polygon (creating a new boundary around the previous convex hull) just to occupy more area on the MAP than before. Is there a trick which can be used in QGIS.

like this (https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons).


texts: Creating polygons of area surrounded by roads / lines using PostGIS?

texts:
I'm currently trying to create polygons that represent the areas surrounded by roads. The roads are stored in PostGIS as points / lines so I have flexibility over what I can do with them.

I'm basically trying to turn the white areas of this example line output into polygons:

Any ideas?

Here is the PostGIS to achieve this (assuming you have a road table full of lines):

SELECT (ST_Dump(ST_Polygonize(roads.geom))).geom AS the_geom FROM
(SELECT ST_Transform(ST_SetSRID(geom, 27700), 4326) AS geom FROM road_lines) AS roads


texts: Is possible to make a graph in Arc that can act like a Pivot graph.

texts:
I have not really used Graphs in Arc that much.

I was wondering if it possible to make a graph that can be interactively changed to the selections that are input into it. Ideally something like a Pivot chart  - Where the selections are being made from the TOC.

MadeUp Example

There is a feature class of polylines that equals a total of 1000 kilometres
I Need to make a sub selection of a total of 100  Kilometres

The selection is a based on a visual selection and cannot be Automated.

As I select different lines I like to have a fast way of summing the total sum of the lines together.

My Workflow is

For each polyline within my feature class I make a separate layer, I label each line with something short and I then make a map of all lines , that I use a reference for lines I like to turn on.

From the dataset I export the this table to Excel and create a pivot chart

I then select lines in Arc and then make these Selections.

This works Ok and does give me the Desired Results

IDEAL OUTCOME

Link my layers to a graph , that interactively updates as selections are made or not made on the TOC , taking a the Culmative of a common FLD ID to make the total

If not via a graph , Are there any other options I could look at


texts: An Error Has Occurred Running Scripts On This Page - Repairing issue with batch script?

texts:
If you've been using ArcGIS for a while, you will have most likely come across this error:

The issue is linked to some sort of ActiveX plugin security setting in the 32 bit version of Internet Explorer. A quick fix is to go into the Security settings of IE and change it from Medium high to Medium, and the problem will be resolved. This is all fine and dandy, I've made the change on my home laptop and there are no more script errors there.

However, my main issue is that on my work computer, the administrators have set the machines up so that any changes done during the session are reverted after a logoff or reboot. It's tiring to open the Internet security settings every day - Is there a way to write a batch or python script that will do this automatically?


texts: Calculate Field based on two fields using python

texts: I'm trying to calculate new values for a field based on two other fields. In VB I don't have any problem, but I need to use python to publish my gp service.


texts: PostGIS geography intersect slower than geometry intersect

texts:
I have a table of large polygons (countries at high resolution), with a geometry (4326) and geography column. Both geography and geometry are indexed with a gist spatial index.

A geography-based query takes more than 10 minutes:

SELECT DISTINCT g1.iso, g2.iso FROM gadm g1, gadm g2
WHERE  ST_Intersects(g1.geog, g2.geog) AND g1.iso!=g2.iso

The equivalent geometry-based query take 1.8 secs:

SELECT DISTINCT g1.iso, g2.iso FROM gadm g1, gadm g2
WHERE  ST_Intersects(g1.geom, g2.geom) AND g1.iso!=g2.iso

What is going on? The query plans from EXPLAIN look identical, except one uses the geom index and one the geog index.

I am running Postgres 9.5.6 and PostGIS 2.2.1.


texts: PostGIS - How to calculate linestring length from WGS84 after transforming from OSGB 36

texts:
I am having problems getting lengths from multilinestrings after transforming data from EPSG:27700 - OSGB 1936 / British National Grid to EPSG:4326/ WGS 84.

I'm doing this conversion to import a roads shapefile into a PostGIS database that uses WGS84 as default. However, when I try to calulate lengths, I'm having weird readings.

Firstly I thought about some incorrect transformation, but after doing some additional tests in an empty database importing the layer without transforming it (OSGB 1936 reference), I´m still puzzled:

The following query returns contradictory results

SELECT
    ST_Length(geom) AS length_OSGB
    ,ST_Length_Spheroid(ST_Transform(geom,4326),'SPHEROID["WGS 84",6378137,298.257223563]') As length_WGS84
FROM osgb36_data
WHERE id = 108

this yields 338 meters for the OSGB36 length and 482 meters for the WGS84 length. The right one is 338 meters.

I've done the importation to the database using QGIS and DBmanager.

Also, I had to guess the initial projectios, as the .prj was missing, but projecting the result over google maps results in a perfect match.

Any hint is welcome

EDIT:

This is the WKT for the element in the example, as suggested:

    SRID=27700;MULTILINESTRING((
 423216.279 574665.249 0,
 423206.315 574708.077 44.649,
 423158.458 574896.911 242.525,
 423132.406 574993.061 344))

Well, that's weird, seems like they were using the z coordinate to register the accumulated distance for each point in the linestring... That could explain the issue with the wrong distances


texts: How to position callout bubble leader using maplex?

texts:
I'm using data driven pages to produce a number of maps.  I'm using Maplex to have a callout bubble labeling my features.  The problem is that for about 5% of the features, the callout bubble is not touching the feature.  I want the tip of the bubble to either touch the boundary or be within the polygon.

In the image below, the labels on the right and left (59 and 63) are correct, while the one in the middle is incorrect because it isn't touching the feature.  Note, these labels are coming from the blue polygons, not the yellow line in the middle.

The relevant settings are shown in the images below:

I would think that having the anchor point set as the eroded centre would do the trick.  However, it looks like it may be placing the label in the centroid instead.

Any thoughts?


texts:
i have to analyse forest cir orthophotos. in high scale resolution, many white pixel appear instead of red ones.
i work with arcmap 9.3, win7


texts: Filtering GeoRSSLayer contents in ArcGIS API for JavaScript

texts:
I would like to make use of a public geoRSS feed with content from 10years (200+ items), however since it is too much information, i would like to show only a subset of this content in my map.

I have been unable to find any reference of how to filter/query the content of an esri georsslayer with the JS API


texts: How to compute the number of none NA-values for each row?

texts:
I have a matrix(raster) that I am computing the the mean of each row in this raster as:

  library (raster)
  r <- raster(nrows=10, ncols=10);r <- setValues(r, 1:ncell(r))

  # The x-values will be the mean of each row in the raster:
  xvals = rowMeans(as.matrix(r))

What I need is to know how many values were considered when computing the mean for each row (N)? Some pixels may have NA so the number of values will not be the same in each row.


texts: How to display output of a chained process in OpenLayers?

texts:
Is there a way I can display the inputs of a WPS process when one of the inputs is output of a chained configured process ?

Maybe the snippet below will explain what  I am trying to do

int1=client.getProcess('local','JTS:intersection');
int1.execute({
inputs: {
a: resp.features,
b: bufproc.output()//want to display/get the output of bufproc-the chained process

},
success: function(outputs)
{
console.log("First chaining is  succesfull");
console.log("trying to access--"+int1.description.dataInputs[0].data.complexData.value); //[0]=input a, able to get this geometry
console.log("trying to access--"+int1.description.dataInputs[1].data); //[1]=input b,not able to get this geometry --prints undefined
console.log("Added result of chaining to res");
map.addLayer(layerres);

}
});


texts:
I have a code which goes like this

with fiona.open(some_file, 'r') as to_dissolve:
    out = to_dissolve.schema
    with fiona.open(another_file, 'w', 'ESRI Shapefile', out) as dissolved:
        # Get properties
        dissolved.write({'geometry': geom, 'properties': property})

The problem is that when multiple points are dissolved, they become multi-points instead. How do I make sure that the output schema will always match no matter what sort of inputs I get?


texts:
I have following HTML page:

<!doctype html>

    <link rel="stylesheet" href="http://openlayers.org/en/v3.3.0/css/ol.css" type="text/css">

    <title>OpenLayers 3 example</title>

My Map

When I open it, it complains about Uncaught ReferenceError: OpenLayers is not defined at the line new OpenLayers.Control.Navigation(),.

How can I fix it?


texts: Register folder on other drive ArcGIS 10.2.1

texts:
I have ArcGIS for server 10.2.1. I've installed his on drive C but i wanna register folder on drive D.

ArcGIS Server Account have full premissions to drive D.

How can I register the folder on server?


texts:
I would like to copy all visible layers in a project to a new group. Does anyone know of a quick way of doing this?
Background:
We have a Project that acts as a library for all the spatial data we hold.
When creating output-oriented Projects, we identify the data required in the library, copy it to a new Group and then that new Group becomes the basis of the new Project. Being able to batch copy all visible (displayed) layers to the new group would massively speed up the new Project generation process and keep the workflow (and datasets) clean and simple.


texts: RuntimeError when adding shapefiles using addDataFromPath in Python

texts:
I am attempting to take a SHAPEFILE, create separate shapefiles based on specific attributes via split by attributes, adding the separate shapefiles to the map and exporting them to PDF.
I am stuck on the last part : adding the shapefiles to the map and exporting them.
This is the code that I am using to do this:

workspace = r"C:\Data\NPS"
aprx = arcpy.mp.ArcGISProject(r"C:\Data\NPS\NPSProjTest.aprx")
map = aprx.listMaps()[0]
map.addDataFromPath(workspace)
for lyt in aprx.listLayouts("*"):
    lyt.exportToPDF(r"C:\Data\NPS\NPS.pdf", resolution = 300)

I am getting this error code in return:

File "C:\Users\kimve\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 1771, in addDataFromPath return convertArcObjectToPythonObject(self._arc_object.addDataFromPath(*gp_fixargs((data_path,), True)))

RuntimeError

Any suggestions? I am not sure what I am doing wrong.


texts:
I'm looking at a project and trying to determine if from a features standpoint if I will lose anything by just pointing to the CSS and JS files for OpenLayers like https://openlayers.org/en/latest/doc/quickstart.html ?

If I want to add something down the road, like drawing tools or heat maps, or something else, will I be able to do so with just the CSS and JS files, or will I need to port it all over to the NPM ol package as described on https://openlayers.org/en/latest/doc/tutorials/bundle.html

I guess my specific problem is I see NPM is recommended, but I can not currently adequately explain to others involved why it is recommended for OpenLayers.


texts:
I need to merge the attributes on a leaflet geojson layer and another geojson based on a common field.  I have tried the following code, which does put the keys in the layer but all values are undefined.  How do I also get the value to transfer to the layer.  geojson is the variable that holds the attributes that I want merged in the layer.

var schemaL = new L.GeoJSON(schema);

// get RG attributes
schemaL.eachLayer(function (layer) {
  for (var i = 0; i < geojson.features.length; i++) {
    if (layer.feature.properties.CodeLink === geojson.features[i].properties.SiteId) {
      for (var key in geojson.features[i].properties) {
        layer.feature.properties[key] = geojson[key];
      }
    }
  }
});


texts: Canvas wider than containing div (OpenLayers)

texts:
Map canvas is wider than the containing map div. Causes problems when zoom to extent etc.
Using Angular Material Flex-Layout / OpenLayers 6.
// css
.mapContainer {
  height: 100%;
  padding: 16px;
}

.map {
  width: 100%;
  height: 600px;
}

//HTML

//Result
Map div width = 793. 2
canvas width = 1841. 1
<canvas width="1841" height="600" style="position: absolute; left: 0px; transform-origin: left top; transform: matrix(1, 0, 0, 1, 0, 0);"></canvas>

Edit: The ol.css is imported in the scss (@import '../../../../node_modules/ol/ol.css';).


texts: Creating polygons based on attributes in point layer using ArcMap

texts:
I have a point layer of residential coordinates which includes an attribute field indicating the most visited hospital for the people living at the coordinate. From these data, I want to create a polygon layer of "hospital areas" that groups neighboring coordinates with the same most visited hospital, with a bit of an outside buffer, as illustrated below. Ideally, I want the polygons to cover also "weird" coordinate pairs, i.e. any coordinates which are clearly geographically located within a larger cluster with the same most visited hospital, but which they themselves have a deviating most visited hospital. Please see the example of Hospital B in the middle of the Hospital A cluster in my illustration.
How do I do this?
I don't have an advanced ArcMap license and have no python skills. The real data covers many thousand coordinate pairs and a total of 150 different hospitals.


texts: Using ranges for raster colour map in QGIS?

texts:
I have a raster layer in GeoTIFF format, with continuous data values between -1 and +1. For the colour map, I would like...

  0 to be green

= 0 to be grey
<0 to -0.25 to be pink
<-0.25 to -0.50 to be dark pink

...etc to 1. Is this possible with QGIS? I tried putting ranges in the colour map box, but it didn't work.


texts: Is there anyway to combine a static geojson and data from database then display it in leaflet?

texts:
I do have a web map application that can load geojson then display it on leaflet map, however  I encountered unresponsive script whenever I refresh my page due to big size of geojson. Is there anyway that I do have this static geojson of province then link it to data from database?

I am just a newbie.


texts: Loop in ModelBuilder in a specific situation

texts:
I would like to make a loop in the next model

base on a expression, this expression received a code with consecutive numbers in a reference layer call "sector",
to summarize, for each "code" do a "intersect" and create a new feature class made by "base selected"
I tried with for iterator and while but it does not work pretty well

And how can I change the final name in the new feature class made in a new geodatabase without doing it manually every time?

I know its something related %Name%intersect%n% but I would like that have the same name that the feature in "beselected"

I found some kind of solution, i made a "For loop" with a code in U_SECTOR , but unfortunately works in numbers that at the end of the code has between 10 to 99 or adding a 0 in the code i could find a numbers between 1 to 9
i would like to try how can i do the same iteraction whit diferents layers whitout adding manualy at the model


texts: I'm using the Map Swipe Tool in QGIS 3.6.2 on a Mac and a PC. I'm using the tool on two imported raster layers to compare changes in temperature. On the PC, it works just fine. On the Mac, I'm getting a lopsided image (see attached image). I don't know if this is Mac related or not, but does anyone have any ideas on how to fix this or why this might be occurring?


texts:
I'm working with GeoDjango and have a polygon in the WGS84 projection.  I need to find its area in square meters.  When I call polygon.area, I get some float out and I have no idea what the units of it are.

For example, Central Park in New York (843 acres according to Wikipedia) has roughly these coordinates (WGS84):

MULTIPOLYGON (((-73.9582363278800017 40.8002491235089977, -73.9489666135250019 40.7967404799830007, -73.9729992062979989 40.7639841980140005, -73.9820972592760029 40.7681446212439980, -73.9582363278800017 40.8002491235089977)))

Accessing the "area" property by calling polygon.area yields 0.00038966160697

When I plug the polygon WKT into PostGIS directly and call ST_Area (as suggested here: How can I measure area from geographic coordinates?), I get 3650892.09953911 (which is in square meters), which comes out to about 920 acres, which is about right (I didn't digitize Central Park perfectly).  I'd prefer not to have to do raw SQL calls in the code to avoid potential SQL injections.  Is there a way to get to this number straight from GEOS?


texts: Using GeographicLib's LocalCartesian to translate LiDAR (LAS format) data onto an SBET file in WGS84

texts:
I've been working for a while now to combine LAS 1.2 formatted LiDAR data with a matching SBET file to fill in the LASF_X/Y/Z fields in the LAS file. The matching of LiDAR points to SBET trajectory points is done by matching the second of week time format.

The desired output format for these LASF_X/Y/Z fields is WGS84 latitude, longitude, and elevation to be clear. I realize it's a weird choice. It's a requirement for a client. The problem I'm having is that it just doesn't display anything reasonable at all regardless of what I output.

I used LocalCartesian centered on each SBET point and called Reverse to calculate the new WGS84 point resulting from the translation of the SBET point by the LiDAR points converted directly from the angular and distance data and the device orientation. I get good WGS84 points as output but I'm getting results which just don't look right when plotted using basic lasview or Quick Terrain.

I'll post more detail if it helps. But I'm mostly asking if this process works the way I believe it should.

The header of my LAS 1.2 file output:

0000000 414c 4653 0000 0000 0000 0000 0000 0000
0000010 0000 0000 0000 0000 0201 4547 2d4f 4433
0000020 535f 5359 4554 004d 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 3354 5f44 4143
0000040 5450 5255 0045 0000 0000 0000 0000 0000
0000050 0000 0000 0000 0000 0000 0047 07e4 00e3
0000060 00e3 0000 0000 0000 2203 8700 4c8a 8700
0000070 4c8a 0000 0000 0000 0000 0000 0000 0000
0000080 0000 3a00 308c 8ee2 4579 3a3e 308c 8ee2
0000090 4579 fc3e f1a9 4dd2 5062 003f 0000 0000
00000a0 0000 0000 0000 0000 0000 0000 0000 0000
00000b0 0000 9d00 392c 1417 3040 003f 48b8 0090
00000c0 8924 26bf 9dae fb07 519f a03f 33bf 014e
00000d0 7f38 fcbf f1a9 4dd2 63d2 d740 70a3 0a3d
00000e0 6073 00c0 0000 0000 0000 0000 0000 7600
00000f0 11b7 0001 0000 3e00 bc30 a7e1 eaa2 0040
0000100 0000 0000 0000 0000 0000 0000 a300 0000
0000110 c300 1194 0001 0000 5300 f671 a7e1 eaa2
0000120 0040 0000 0000 0000 0000 0000 0000 b800
0000130 0000 ce00 118a 0001 0000 6700 30b2 a7e2


texts:
I have a problem with GRASS GIS 6.4.3.

I installed QGIS 2.4 with GRASS GIS 6.4.3 GUI on Windows 7 64 bit - admin user. When I click on GRASS GIS icon the program not starting (without error messages). I see the first map (loading gui) but the software not starting.

I tried uninstall and reinstall software but the problem remain.

Can someone help me?

Sorry for my english.

Best regard

PS If I call GRASS from cmd (windows) I read error like in image file


texts: Is IIS configuration necessary to serve ArcGIS Server wms services?

texts: with ArcGIS for Server server 10.3 on windows Server 2012 and I would like to serve wms services over the internet. I have a reverse proxy set up which directs requests to an end point in ArcGIS server, but am getting a 403 forbidden answer from the server. How can I find out if this an IIS issue or an ArcGIS Server issue? It is necessary to configure IIS in any way before administering wms over the internet?


texts: GeoTools Geometries lost when storing features to shapefile

texts:
As you know, the geometry column name of schema for saving into a shapefile must be "the_geom". I have a SimpleFeatureCollection with a schema, geometry name of which is not "the_geom"; It is "geometry". I want to save this collection into an esri shapefile. But I loose geoemetries when storing.

Attribute table before save:

|  FeatureIdentifier  | name | people |     geometry     |
----------------------------------------------------------
| jahan_0             | ali  | 23     | POINT(67.0 35.0) |
| jahan_1             | gh   | 245    | POINT(67.2 34.4) |
 ---------------------------------------------------------

Attribute table after reading shapefile:

|  FeatureIdentifier  | the_geom | name | people |
--------------------------------------------------
| mesal_0             |          | ali  | 23     |
| mesal_1             |          | gh   | 245    |
 -------------------------------------------------

How can I save my feature collection into shapefile without loosing geometries?  The problem is on storing. I tested the saved shp file by QGIS and saw geometries lost.

more code on saving shapefile:

DataStore dataStore = ...; // shapefile data store
// My FeatureCollection containing two features
SimpleFeatureCollection collection = ...;
dataStore.createSchema(schema);
String typeName = dataStore.getTypeNames()[0];
SimpleFeatureSource fs = dataStore.getFeatureSource(typeName);
MyUtil.saveToFeatureStore(collection,(FeatureStore) fs);

MyUtil.java:

public class MyUtil{
  public static void saveToFeatureStore(SimpleFeatureCollection collection, FeatureStore featureStore){
    Transaction tx = new DefaultTransaction("create");
    featureStore.setTransaction(tx);
    try{
      featureStore.addFeatures(collection);
      tx.commit();
    } catch(Exception ex){
      tx.rollback();
    } finally{
      tx.close();
    }
  }
}

My problem is: How to save features into shapefile by GeoTools. There is no question about storing features by GeoTools at this site.


texts: Avoiding overlap when creating many fixed sized buffers with PyQGIS?

texts:
I want to eliminate any overlaps in a single vector layer with many buffers. I have a raster file of population density and picking out areas over some threshold. I need to cover those points with a fixed size buffer to show satellite beam cover but don't want redundant or overlapping buffers because that would waste beams (don't want to just dissolve them into one to show coverage).

I know about the topology checker to create rules for overlap but this seems impractical to manually resolve all the errors on large scale.

Is there a better way?

I've also seen things about using intersect but I'm not exactly clear on how I would made a decision based on that. I'm new to GIS.

Here is the code to get to this point:

from qgis.analysis import QgsGeometryAnalyzer

env = "/PATH/TO/WORKSPACE"

layer = iface.activeLayer()

provider = layer.dataProvider()

extent = layer.extent()
xmin,ymin,xmax,ymax = extent.toRectF().getCoords()
rows = layer.height()
cols = layer.width()
xSize = layer.rasterUnitsPerPixelX()
ySize = layer.rasterUnitsPerPixelY()

block = provider.block(1, extent, cols, rows)

xinit = xmin + xSize/2
yinit = ymax - ySize/2

x = xinit
y = yinit

points = []
values = []

for i in range(rows):
    for j in range(cols):
        value = block.value(i,j)
        if value > 3000:
            points.append(QgsPoint(x,y))
            values.append(value)
        x += xSize
    y -= ySize
    x = xinit

epsg = layer.crs().postgisSrid()

uri = "Point?crs=epsg:" + str(epsg) + "&field=id:integer&field=value:integer""&index=yes"

mem_layer = QgsVectorLayer(uri, 'point', 'memory')

prov = mem_layer.dataProvider()

feats = [ QgsFeature() for i in range(len(points)) ]

for i, feat in enumerate(feats):
    feat.setAttributes([i, values[i]])
    feat.setGeometry(QgsGeometry.fromPoint(points[i]))

prov.addFeatures(feats)

QgsMapLayerRegistry.instance().addMapLayer(mem_layer)

QgsGeometryAnalyzer().buffer(mem_layer, env + "output.shp", 1.5, False, False, -1)


texts: WMS configuration error reading the project file or the SLD configuration

texts:
I downloaded the OsGeo4W-Installer and installed Apache (Windows 7). The web site localhost has an error like:

WMS configuration error">There was an error reading the project file or the SLD configuration.

Could anyone tell me how to solve this and how to connect the WMS?

The process I followed from the web site: http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial#QGIS-Server-configuration


texts: Mapping polygon vs points within each polygon into one table using QGIS?

texts:
I have 2 layers: 1 is for points (GPS), another is the polygon containing administrative borders in my country.
I would like to know for each polygon *(the district/ state.) the list of points that fall within that polygon .
So for example my desired output is

District 1  Point 1
District 1 Point 2
District 2 Point 3
District 2 Point 4
...
District N Point N

How can I achieve this?


texts: When I try to copy graphics and text between .mxd documents, size of the elements (width, height, font size) change randomly. Anyone know how to transfer LayoutElements between .mxd without any distruptions?


texts: Format and convert JSON to GeoJSON using JavaScript

texts:
I'd like to convert this JSON file to GeoJSON using JavaScript and use it with leaflet.js, it's a LineString file, I'm trying it using geojson.js but without success.

  <meta charset=utf-8 />
  <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
  <link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css" />

It return a geometry undefined, I believe that problem is that the JSON doesn't have a colunm lat and long, my JSON file has the colunm coordinates with 3 atributes string.