texts: Geoserver/Geowebcache producing corrupt tiles

texts:
I've used Geoserver 2.6.4 (with GeoWebCache 1.6.2) to generate a tile cache. However, some of the tiles are becoming corrupt (see below). I've looked around and found many references to improvements to GWC that prevent corruption, but they all talk about older versions of GWC that we are using?

Does anyone know why this might be happening?

EDIT: extra information based on questions:

If I request the same tile directly using WMS it doesn't have the issue
The source data is an image mosaic made up of GeoTIFFs (RGB, not palette)
The data uses the default GeoServer raster style


texts: Counting number of lines connected to point?

texts:
I have a water network which and I need to install elbows and Tees (T). When 2 lines connect to a point, I want to install an elbow, when 3 lines connect, I want to install a Tee.

How do I get ArcGIS or QGIS to determine how many lines are connected to a point and designate an elbow or a tee based on that criteria?


texts: Divide two rasters with different cell sizes using ArcGIS for Desktop?

texts:
I've got two rasters of the exact same location (So every pixel in one raster is equivalent to the pixel in the other raster).

Raster A has a resolution of 6m per pixel.
Raster B has a resolution of 12m per pixel.

I want to divide Raster A by Raster B, and receive an output of 6m per pixel (Like raster A). I'm trying to do this via ArcMap and couldn't find a way to do it. Every method gives me an output resolution of 12m.

Any ideas or any other recommended method?


texts: Performing definition query against Polyline shape field in ArcGIS Desktop?

texts:
I have joined two polyline shapefiles together that represent two months worth of data. I'm now trying to find any changes to the shape of the records between the two months (added vertices, deleted vertices).

Is this possible to detect these changes with a definition query?

If not, is there an efficient way to detect changes in the geometry of the record?

I have a "LENGTH" field and I am able to query records that have a different length but that doesn't necessarily give me all of the records who have had their vertices changed.


texts: Computing long expression in ArcGIS field calculator?

texts:
I am trying to compute the following expression with the Field Calculator of ArcMap. The input table values are around the size of this value: 562643580,7843, and the field name (the field of destination) is: double, precision=20, scale=20:

([Sum_Pri_17]*0.0669)+(([Sum_Pri_18]-[Sum_Pri_17])*0.0551)+(([Sum_Pri_19]-[Sum_Pri_18])*0.0306)

The destination field should therefore not be too short. When doing the calculation, no result is computed and no error appears either.

I thought the expression was too long, so I tried to compute the following:

[Sum_Pri_17]*0.0669

The calculation's result was the same: no result is computed and no error appears either.

What am I doing wrong?


texts: Why isn't enabling on the fly projection reflected in raster? QGIS 1.8.0

texts:
I have imported a map from the Ordnance Survey Open Data website. It is a 50k Street View raster. I have also created a new shapefile layer in which I have created a polygon overlay for the raster map. I have enabled "On the fly projection" in the Settings menu and also selected OSGB1936 CRS for both layers. However, it is apparent from the co-ordinates displayed at the bottom of the map pane that this CRS is not activated.

What do I need to do to apply the desired CRS?


texts: Leaflet with EPSG4326 Tile Layer (using maptiler.org)

texts:
I have successfully been using Klokan Petr Pridal's MapTiler (http://maptiler.org ) to take GeoTiff files and create TMS tile pyramids for Leaflet (option #1 which projects to EPSG3857, also called Google Maps compatible Spherical Mercator).

But my source data is in EPSG 4326, so I am now using option #3 for WGS84 Plate Caree (Geodetic). I believe it is using gdal2tiles under the hood.

The issue I have is that I do not see any of these overlay tiles in Leaflet. Even though am being careful to make sure the map is created with the right CRS.

I have tried tuning TMS: false, and TMS: true. No luck.

One thing I see is that the numbering even for the top levels z/x/y is weird: (e.g.  0/1/2.png ). Should a Krakow, Poland map really be at coordinates: 5/35/24? or 10/1136/795?

With the Spherical Mercator I have 10/568/346!!!

Also, all the specs for TMS tile numbering that I have seen are only good for EPSG3857 (spherical Mercator) which I believe has bounds of _85/-85 lat. But EPSG4326 would go to 90. So what gives in the numbering?

var map;
var krakowLayer = null;
var mapOptions = {
    center: new L.LatLng(0, 0),
    zoom: 1,
    tms: true,
    crs: L.CRS.EPSG4326
};
    map = new L.Map('map', mapOptions);
    krakowLayer = new L.TileLayer("./tiles4326/{z}/{x}/{y}.png", { tms: false, opacity: 0.8 });

function addLayers() {
    var baseLayers = {
        "CloudMade": cloudLayer,
    };
    var overlays = {
        "Krakow Layer": krakowLayer
    };
    L.control.layers(baseLayers, overlays).addTo(map);
}


texts: Buffer in ArcView/Basic vs ArcInfo/Advanced level licenses of ArcGIS Desktop?

texts:
I have ArcGIS Desktop 9.3.

Is Buffer only available with an ArcInfo (called Advanced from 10.0) or is there a way to buffer with an ArcView (called Basic from 10.0) level license?


texts: Geographic coordinate system - shapefile not matching with basemap

texts:
I am trying to line-up road data from Korea's transportation bureau with my basemap in ArcGIS, but the road shapefile and basemaps are not lining up. I am using the coordinate system for the road data ("KoreaRoads" shp file below). The top right portion of the first screenshot is the "readme" file that came with the road data. That page is talking about the coordinate system for the data-set...

Even when I make a new map and set everything to the coordinate system that the transportation bureau requests, "Bessel", their road file still does not match up with the basemap. Please see screenshots below:

As you can see the road files do not like up in South Korea at all...I am a bit confused about why this might be despite me ensuring the coordinate systems match with what the Transportation bureau is saying.


texts: Redistricting for QGIS plugin,voters field error

texts:
I'm using the Redistricting for QGIS plugin .My QGIS version is 2.14.10-Essen.I'm getting this error message:The pengundi (voters field) must be an integer number field.

My shapefile is the shp file which is given in the plugin data folder.The pengundi field type is Integer64,but I also tried with Integer type and I'm still getting the same error.

What can be the problem?


texts:
I have several Layers published On Geoserver 2.12.1. These are properly organized in Workspaces.

I want the WFS to work on 2 of the Workspaces, but not serve out the data from one Workspace. WMS should work with all layers in all Workspaces. (like it is working currently)

I've tried several things, but I have not been able to lock down the WFS only on one Workspace.

Things I have tried:

Go to WFS Under Services in the Left hand panel. Then select the workspace, and uncheck 'Enable WFS'.

This does not seem to affect anything.

Go to WFS Under Services in the Left hand panel. Then not select any  workspace in the dropdown, and uncheck 'Enable WFS'. This seems to disable all WFS services.

How to Disable WFS on a specific WorkSpace in Geoserver?


texts: How to keep vector layer on top of all layers despite toggling order?

texts:
How do I keep a layer on top of my other layers despite the order it is toggled by the user? In this example, I've set up two layers named layerONE and layerTWO.

How do I keep my layerTWO (red square in this example) on top of layerONE at all times?

I tried this but it didn't work (notice my bringToFront method):

var layerONE = L.geoJson(layerOne).bindPopup('this is layer one!');

var layerTWO = L.geoJson(layerTwo, {
    style: {color: 'red'}
}).bindPopup('this is layer two!').bringToFront();

var overlays = {
    "Layer One": layerONE,
    "Layer Two": layerTWO
};

L.control.layers(null, overlays).addTo(map);

JSFIDDLE link


texts: quickwatch on COM-objects does not show any information

texts:
While debugging my ArcObjects-code using VS2015 and .NET 4.5 I often try to inspect the data from my geodatabase.

So for example see this code:

public static bool PointsAreCollinear(IPoint from, IPoint intermediate, IPoint to, double tolsquare)
{
    // We compare the distance of the intermediate Point from the line between from and to.
    // (intermediate-from)*perp = dist * len
    // where perp is a vector perpendicular to (to-from) and len is it's length.
    // In order to avoid square roots, we prefer calculating the squares

    double tx = to.X - from.X;
    double ty = to.Y - from.Y;
    double hx = intermediate.X - from.X;
    double hy = intermediate.Y - from.Y;

    double lenSq = tx * tx + ty * ty;
    double dByLen = hx * ty - hy * tx;
    double dByLenSq = dByLen * dByLen;

    return dByLenSq <= lenSq * tolsquare;
}

When I add a watch to to for example it gives me this annoying info. From this thread I suppose we could get the information for all the properties that are actually used within my source-code. All the rest is omitted while generating the interop-types for COM-objects. However as you can see I actually do use to.X, which is why I supposed that I could at least see its value within my quickwatch.

The suggestion from the mentioned post was to use the "Dynamic view" which depends on IDispatch.GetTypeInfo(). However that didn´t help neither.

Did anyone else ever had this problem when debugging ArcObjects?


texts: Why can't I run the OpenGeoSuite on port 80?

texts:
I'm trying to install the Boundless OpenGeoSuite on a Ubuntu 14.04 system, and I'm following the instructions given at: http://suite.opengeo.org/opengeo-docs/intro/installation/ubuntu/install.html#intro-installation-ubuntu-install

So far I've managed to get the Suite to run on Port 8080.

Now I'm follwoing the instructions given in After installation to get it to run on Port 80, so my Users can access it by directly entering the URL, and don't need to enter the port number.

I've modified the server.xml, and restarted the tomcat7 service, but I can't get it to run.

Tomcat seems to be running, but is not listening to port 80, when seen by nstat -tulpn.

How do I get the Suite to run on Port 80?


texts:
I am in the midst of a task which involves the clustering of assessment neighborhoods into larger neighborhoods (data link). The goal is build these neighborhoods in a manner consistent with major economic corridors in DC.  I'd like to provide a dynamic method of selection for others in the office, and my chosen approach is the overlay of assessment polys on a map tile via Folium.

Here is the set up:

#Read in data
aneigh=gp.GeoDataFrame.from_file(data_dir+'ASNBHDPLY.shp')

#Transform to WGS84
aneigh_ll=aneigh.to_crs(crs={'proj':'longlat',
                             'datum':'WGS84'}).rename(columns={'geometry':'geom_temp'})

#Define function to swap lat-long coords in Polygon objects
def swap_coord(poly):
    '''Mappable function that switches coordinates in polygon objects'''
    #If the object is not a Polygon...
    if poly.geom_type != 'Polygon':
        #...take the first component and switch the coordinates
        new_poly=Polygon([(x[1],x[0]) for x in poly[0].exterior.coords])
    #...otherwise...
    else:
        #...swap the coordinates of the Polygon
        new_poly=Polygon([(x[1],x[0]) for x in poly.exterior.coords])
    return new_poly

#Swap coordinates
aneigh_ll['geometry']=aneigh_ll['geom_temp'].apply(lambda x: swap_coord(x))

#Drop geom_temp
an_ll=aneigh_ll[[x for x in aneigh_ll.columns if x != 'geom_temp']]

#Write transformed data to disk
an_ll.to_file('asmnt_neigh_ll2.json',driver='GeoJSON')

First, I know the transformation above works because 1) I can plot one coordinate of one of the constituent polygons, and 2) I used it before.  I should also note that the to_file() method that writes the GeoJSON to disk is from the geopandas package (which relies on fiona for I/O operations).

Where I am running into trouble is getting the overlay to work.  I know overlays are possible with my setup because I can recreate the example provided here.  In fact, I wrote the set to disk to follow as closely as I could to the example.  However, when I proceed with the following, I get only the base map.

wd='/home/choct155/dissertation/MiscProj/'

dcmap2=folium.Map(location=[38.9072309,-77.0364641])
dcmap2.geo_json(geo_path=wd+'asmnt_neigh_ll2.json')
dcmap2.create_map(path='dcmap.html')
showmap(dcmap2,'dcmap.html')

Any thoughts on why this might be the case?  I am wondering if there is a fundamental difference between the GeoJSON files fiona has generated and those used on the folium site.


texts: QGIS 2.2.0 Update column with another layer

texts:
I've got 2 layers : the first one with points, the second one with polygones (their ID). I created a new column in the first layer, and I want to update it with the ID of the polygone that contains the point.
I hope I'm clear !
It seems to be a basic issue, but I spend a large part of the day surching for the answer, in vain... Thanks a lot for the incoming answer!


texts:
I have a script which geocode an address and buffer that address by 1, 5 and 10 mile radius. The problem I am having is that the address on the map shows 4 different points not sure what's causing it. Please let me know how to fix this issue.

    Find Address

Locate and buffer an address

        <input type="text" id="address" value="6360 Sprint Parkway Overland Park KS">
        <button dojotype="dijit.form.Button" id="locate">Locate</button>


texts: Landsat8 DN to TOA Reflectance (minus values)

texts:
I'm learning how to perform atmospheric correction manually, hence not using the automated methods available in ENVI

metadata (band 1) for my Landsat 8 scene is as follows;

RADIANCE_MULT_BAND_1 = 1.2344E-02

RADIANCE_ADD_BAND_1 = -61.72016

REFLECTANCE_MULT_BAND_1 = 2.0000E-05

REFLECTANCE_ADD_BAND_1 = -0.100000

SUN_ELEVATION = 48.12237303

So when I use band math to calculate TOA Radiance I type in this:

(0.012344*B1)-61.72016

And it yields a spectral statistics that look kind-of right

When I use any of the following band math formulae;

TOA Reflectance (excluding sun elevation adjustment)

(B1*0.00002)-0.1

TOA Reflectance (including sun elevation adjustment)

((B1*0.00002)-0.1)/0.74457226676389733207607359928648

Or calculate straight from the raw DN to TOA Reflectance (including sun elevation adjustment)

((((0.012344*B1)-61.72016)*0.00002)-0.1)/0.74457226676389733207607359928648

I end up with something like this:

which looks incorrect.

I've googled and either my search terms are rubbish or no one uses manual band math to do this.

[EDIT]

Mikkel's answer below with the revised band math calculation (omitting the intermediate steps) yielded the following statistics:

which look somewhat more realistic.

Wondering if i should add 13.4305 to each band, or ignore the negative minimum?

[END EDIT]

[EDIT #2]

Mikkel was spot on again, in suggesting that the -13.4305 values were isolated to the "no data" areas around the image;

as you can see, isolated only to the northern edge of the scene.

[END EDIT #2]


texts: aerial vintage changes in one compiled raster, how to split it?

texts:
What is the best way to create polygons defining borders where aerial vintages change?

This is one big merge of aerial data here that needs to be split into 3 tiffs based on the vintages.

Doing it manually seems archaic, but if that is the best available, what is the correct editor tool(s) to use here? snap to?


texts: ArcMap "clip to shape" analogue for basemaps in QGIS?

texts:
Is there any function in QGIS like ArcMap's Clip to shape?

I want to clip base map like in ArcMap (below)

In QGIS with the same shape (below)


texts: How can one edit file geodatabase in QGIS. I have tried with even version 3.0 of QGIS, but it can't still be done.


texts: Deriving equations of Epipolar lines for linear array scanners?

texts:
I'm going to obtain the equations of the Epipolar lines of a given image captured with linear array scanners. There are some papers addressed this subject, but they haven't stated key points in detail, and thus I'm not able to implement the equations properly. Therefore, I need a pseudo code listing all the procedures step by step.
Can someone suggest me the steps of the Epipolar line extraction for linear array scanners?

The links of the papers are as follows:

http://asprs.org/a/publications/pers/2000journal/august/2000_aug_961-966.pdf

http://www.ipi.uni-hannover.de/fileadmin/institut/pdf/ono.pdf


texts: SAGA-GIS Produces different results in command line than GUI

texts:
I have been working on a lidar processing workflow using SAGA-GIS.  I determined my workflow on a single tile in the SAGA GUI and now I need to batch the operations on 100 more tiles.  I wrote a batch file to call the SAGA Command Line to run all the las files in a folder.

I noticed, though, that the out DSM created by the command line process looks much more blurred and interpolated than the DSM I created in the GUI for the same tile.  Then, I started to investigate, so I started running each individual process of my workflow in the GUI and in the command line with the same data.

The very first step is to import the LAS file.  In the GUI, this doesn't save to a .spc file, it just seems to do it in memory.  With the command line, it will save a .spc file from the LAS file.  These two files are different:

The picture in the upper left is the point cloud created when I imported the LAS file in the SAGA GUI.  Notice the values circled in the lower left image.  Those are the Min/Max values of the upper left point cloud.  The picture in the upper right is the SPC file that was created when running the Import LAS module via the command line.  Notice the Min/Max values circled in the bottom right.

As far as I can tell, all the parameters I used were identical.  In fact, I ran the GUI version first and then right-clicked on the module to create the batch file with all the same parameters.

Can anyone help me with this?  The DSM's created by the batch file are not nearly as clear as the one created by the GUI because they require more interpolation and cannot be used for identifying tree canopy.


texts:
I have written a python script to export my mxd into a pdf (not using data driven pages). I am getting the error that my mxd path is incorrect! I have included my script below. Any help would be appreciated.

# Necessary modules
import arcpy, os, string, sys

# For less complicated scripts -
# these 2 imports are necessary to utilize a simpler method of debugging outher than traceback
import win32ui, win32con

# example debug message to screen ......
# arcpy.AddMessage("mxd_file = " + str(mxd_file))
# val = win32ui.MessageBox("mxd_file = " + str(mxd_file), "title",
                          #win32con.MB_OKCANCEL)

#Paramaters...

mxdList = string.split(arcpy.GetParameterAsText(0), ";")
dir = arcpy.GetParameterAsText(1)

#Loop thru & take the base name of each MXD selected and append all map pages to a single pdf
# and save to chosen directory......

for mxdPath in mxdList:
    mxd = arcpy.mapping.MapDocument(mxdPath)
    name = mxdPath[:-4] + ".pdf"
    file = dir + os.sep + os.path.basename(name)
    ddp = mxd
    ddp.exportToPDF(file, "ALL")

del mxd, file


texts: QgsVectorFileWriter creating layer with unexpected WKB type

texts:
I'm trying to use a vector file writer and I'm getting an unexpected WKB type of my output layer.

I'm setting up the writer like this

writer = QgsVectorFileWriter( output_layer, 'UTF-8', fields,  QgsWKBTypes.PointZM , inlayer.crs() )

Below is information about my QGIS installation at the time.

When I check the properties of the shapefile that is generated, the geometry type is showing up as PointZ instead of PointZM. The simple script below should duplicate the problem.

##input_layer=vector
##output_layer=output vector

from qgis.core import *
from qgis.utils import *
from PyQt4.QtCore import *

inlayer = processing.getObject(input_layer)
provider = inlayer.dataProvider()
fields = provider.fields()
writer = QgsVectorFileWriter( output_layer, 'UTF-8', fields, QgsWKBTypes.PointZM, inlayer.crs() )
feature = QgsFeature()
feature.setGeometry(QgsGeometry(QgsPointV2(QgsWKBTypes.PointZM, 1, 2, 3, 4)))
writer.addFeature(feature)
del writer

It may be easier to test this in the python console with the following commands

>>> writer = QgsVectorFileWriter('c:/test/test_layer.shp', 'UTF8', QgsFields(), QgsWKBTypes.PointZM, QgsCoordinateReferenceSystem('EPSG:3857'))
>>> feature = QgsFeature()
>>> feature.setGeometry(QgsGeometry(QgsPointV2(QgsWKBTypes.PointZM, 1, 2, 3, 4)))
>>> writer.addFeature(feature)
True
>>> del writer

Just make sure you have a test folder on the C drive and then you can add the generated shapefile to QGIS to inspect.


texts: How can I add vector tiles to my tileserver?

texts:
I created my own tileserver under ubuntu 12.04 as described here:

http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/

now I want to serve the tiles as vectors, I found this:
https://github.com/mapbox/mapnik-vector-tile

but I dont know if I can use it right now. I installed the dependencies but when building the make command does not work at the installation because
make: * No targets specified and no makefile found.  Stop.
is shown.


texts:
I'm still having trouble with the dissolve tool and I've tried all of the solutions offered here including moving the process from the background and repairing the geography. I've also tried amending the spatial index and narrowing the dissolve area down considerably.

Is there anything that I'm missing?

Right now when I run the tool, it jumps right to 33% complete and stalls out. If I wait for an hour or so it gives me the 99999 error (edited to clarify, I am also getting the Invalid Topology error).  I'm doing this project for work and waiting an hour each time isn't working for me (or my boss) anymore.


texts: Dynamically-generated heatmap WMS tiles on GeoServer/Leaflet displays wrong

texts:
I am using a GeoServer to calculate dynamically a heatmap on points coming from a postgresdatabase with the SLD style presented there : https://docs.geoserver.org/stable/en/user/styling/sld/extensions/rendering-transform.html

However, if the result is okay in OpenLayer preview in GeoServer, the WMS tiles are totally wrecked when requesting them from Leaflet like here :

I kind of understood that the problem was due to tiles calculating only points in their tile, leading to this, and that single-tile mode was a solution.

However, while OpenLayers provides the possibility to request WMS in single tiled mode, Leaflet does not.

There are plugins developed here and there but I am working with VueJS so I can't use them directly.

As a consequence I am looking for a way in GeoServer to correct this behavior but i don't know if there is a way and how to do it. I tried to add tiled=false in parameters of the URL but it doesn't seem to work and the tile caching  tutorials are aimed at saving tiles which is different from what I want.


texts: Programmatically creating exports from PostGIS database into different file formats (e.g. shapefile, dxf, dgn,...)?

texts:
Is there a kind of wrapper/library written in python which would enable me to programatically create exports from postgis database into different file formats (most common being, shapefile, dxf, dgn,...). If not i ll probably build one myself using psycopg2, gdal and ogr, these are probably components to start with, yeah?

I need this because i ll be making some kind of web service for data exports.


texts: Error "layer not accessible" in creating ArcGIS Operation Dashboard and problem in adding feature layer

texts:
I am currently working on an operational dashboard.

Apparently, I wasn't able to create a dashboard from a web map due to an error message layer not accessible. I also failed in uploading a feature layer. I observed that the checkbox stating Publish this file as a hosted layer is missing every time I tried to add a new item.

I hope somebody can explain why the layer is not accessible and the missing feature of publishing a hosted layer when adding an item in my content.


texts: I've got a large polygon feature class that covers the whole of GB and contains about 120k features. I need to do a spatial filter on this feature class in FME workbench. I've done this in Arc ModelBuilder in the past using 'selectbylocation' which can return an output instantly, however FME seems to read through each of the 120k features individually which takes forever (5 mins) which is too long. Can someone explain why Arc can do this instantly and whether this can be replicated in FME workbench quickly?


texts: Create a polygon shapefile from .dbf table

texts:
I am using arcgis 10.1 and have a table "dbf" containing information of polygons.

This table has fields "OID" "SHAPE" "SHAPE.area" "SHAPE.LEN"

there is a way or tool to convert this table as  shp polinos


texts: GPS integration with multiple waypoint routes

texts:
I'm building a system that needs to get the output of a route optimizer into the hands of a driver who intends to make deliveries on that route.  Whilst I can supply this to the driver as a printed map with route overlay (which requires mapping software), I'm currently wondering whether skipping the mapping software and feeding the list of waypoints directly to a GPS is an option.

I am wondering if anyone knows of any GPS units that (in order of preference);

Can have a list of waypoints forwarded to the unit over WiFi (at the beginning of the journey) or;
Can read a USB stick (not a cable to a PC) with a list of waypoints contained on it
Can have a list of waypoints forwarded to it over 3G

EDIT

The routes are a collection of about 30 stops selected and optimized from a larger collection of 100-200 stops and split between trucks.  I may be using the wrong terminology so i'll refer to it now as "a (sequenced) list of waypoints"  Whilst my future intention is to create some kind of smartphone/tablet application to display both the waypoints and interactive delivery information, considering I already have the list of waypoints I was wondering (to start with) if there is a quick, automated/integrated method for transferring these to a given driver's GPS unit.

My idea with WiFi (and I don't know if such a device exists) is that when a driver returns a depot, my system can detect the WiFi connection and forward pre-selected list of waypoints to the device.

Are smartphones/tablets the only way to go?  I was assuming (perhaps incorrectly) that GPS/navigation devices would by now have some kind of data transfer capability?


texts:
I have a basemap (parcels), which is to be used as target for several conflation tasks. This basemap MUST NOT be modified in any way.

The basemap ist part of numerous topology rules. Each time topology is validated ArcGIS inserts vertices in the basemap and/or the other layers. I want ArcGIS to simply show errors, rather then trying to dissolve them. Assigning the highest rank to the basemap doesn't prevent ArcGIS from changing it. Finding the appropriate solution for error correction (e.g. verification of measurements in the field) or accept the error as exception is part of MY job.

How can I make ArcGIS to simply show errors without any attempt to fix them?


texts:
I've downloaded some geodata but I'm unable to import it into GeoPandas.

This is a sample of the geodata (I've trimmed the JSON object):

{'displayFieldName': 'NAME',
 'fieldAliases': {},
 'geometryType': 'esriGeometryPolygon',
 'spatialReference': {'wkid': 102100, 'latestWkid': 3857},
 'fields': [],
 'features': [{'attributes': {'OBJECTID': 2050,
    'PRECINCTID': '01029B',
    'NAME': 'COLUMBUS 29-B',
    'COUNTY': None,
    'ESS_PRECINCT_NO': None,
    'ESS_PRECINCT': None,
    'CITY_OR_VILLAGE': None,
    'SCHOOL_DISTRICT': None,
    'TOWNSHIP': None,
    'HOUSE_DISTRICT': None,
    'SENATE_DISTRICT': None,
    'CONGRESS_DISTRICT': None,
    'POLICE_DISTRICT': None,
    'ROAD_DISTRICT': None,
    'FIRE_DISTRICT': None,
    'PARK_DISTRICT': None,
    'COURT_APPEALS_NAME': None,
    'BOARD_OF_ED_NAME': None,
    'LIBRARY': None,
    'EDUCATIONAL_SERVICE_CENTERS': None,
    'CAREER_CENTERS': None,
    'WINNINGPARTY': None,
    'TOTALBALLOTS': None,
    'SHAPE_Length': 26636.15475759097,
    'SHAPE_Area': 30443700.474467456,
    'POLLINGID': None,
    'POLLINGLOCATION': None,
    'LID': 'N/A',
    'Symbol': 'A'},
   'geometry': {'rings': [[[-9235687, 4854329],
      [-9235918, 4851467],
      [-9239010, 4854564],
      [-9235687, 4854329]]]}},
]}

I've tried the following:

import geopandas as gpd

df = gpd.read_file(filename)
df.head()

but it doesn't return any rows...

Is this standard GeoJSON or a different format? What does "rings" mean here? My assumption was that there would be additional keys in the JSON schema for both latitude and longitude, but instead I see a list/array.


texts: App Title, Header Title and Header Subtitle Override?

texts:
Has anyone else been experiencing any "override" issue with their custom Titles? For example try the public URL:

http://bhgis.org/apeg/test/viewer/

Watch closely as the titles quickly override to the default.


texts: Why does my gpx layer go to the wrong spot even if they have the same CRS?

texts: Help! I am a QGIS beginner with a big problem! I am trying to load a gpx file from Garmin into my map.  The project CRS is WGS 84, and the incoming data is in CRS WGS 84.  When I look at the bottom of my map in QGIS or on the coordinate capture, all of  my locations appear to be in the UTM format.  However when I load in the gpx files, the points go to their long/lat locations, which is of course very far away from everything else because everything else as UTM coordinates in the thousands. I have on the fly enabled... but I am not sure how to fix this.  Even if I save the GPX data in coordinate form, it still loads to its lat/long numbers as UTM coordinates.  I am hoping there is an easy fix that I am too inexperienced to know about?


texts: a map for the number of overlapping polygons

texts:
I have a geodatabase with a given number of polygon features. I would like to generate a layer (V) that displays the number of overlapping polygons at any given (x,y) location spanned by my polygons. For example, if at (x1,y1) I have two overlapping polygons my V(x1,y1)=2, if I have no polygons at (x2,y2) then V(x2,y2)=0, and so on.
What is the easiest way to build this map? I am currently reviewing join and merge tools to see how I can make this work.


texts: Fast way to convert Polygons to Points in PostGIS

texts:
What's the fastest way to convert a polygon to a point in PostGIS?

I don't care where the point is in relation to the geometry, but the resulting point does need to be consistent.

Using ST_Centroid takes about 19 seconds to do it for 1000 polygons, which seems very slow (I need to do it repeatedly for millions!), but that's probably because it's calculating the centroid of the feature.

I briefly flirted with ST_DumpPoints, but that seems to take even longer (over 30 seconds for the same 1000) points.

So what's the fastest way to do this?


texts:
Is there a way to load an image into a map div to use as a tracing guide for digitizing features?(not in geoserver) Eg: farm paddock layouts from a plan? I would assume you would need to drag, resize and rotate to fit. Like you can currently do in google earth.
Hope that makes sense.


texts: Change raster value for an area based on a class of another raster

texts:
I would like to change all raster values in raster A that fall into the locations of category/class 1 of raster B.

Here, some more details. I did a calculation on a DEM resulting in different topography layers which I summed up to raster A. Now, I have a polygon map which I transferred into raster B. The class 1 of raster B should be an area that has only values of 1 in raster A. So I would like to use map algebra to change this (perhaps using a complex if() statement in GRASS GIS?)

I think I could have prevented all this earlier by simply applying a mask to the raster A before the calculations. However, the calculations took quite a while (2hours) so I would not like to repeat all the steps again...

any help is very much appreciated!
Jens


texts: Display legend/value when hovering over raster layer in QGIS

texts:
Is there a way for this and how would I approach this? This would be in the normal map view and not in layout mode. It would be very hand if you have a lot of raster lays in one project and want to have a quick look over the values.
I don't know if you could get the colors in the pop up?


texts: Getting concatenated attribute values from Spatial Join

texts:
How can I query polygon features that intersect other polygon features in QGIS?  I have ZIP code areas and city areas, and I would like to list all the ZIP codes that intersect the city areas. Example: San Antonio= 78209,78258,78259,78250, etc.

I've been looking for a method for a while that can do this in QGIS, I tried "list unique values and union" commands in the vector tools and no luck.  I know you can do a Union in ArcMap Pro but I don't have that software here. I was also able to do this in GeoMedia Pro years ago. I am unable to figure out in QGIS how to do some polygon vs polygon analysis.

I am still having problems with this, I was able to create an intersection layer but I can't figure out how to associate the results back to the city area feature. I would like to add a field to City_Area which would list the ZIP Code names separated by comma. (City_A=78205,78204,78203,78201)


texts: Empty results from r.fuzzy.set in GRASS 7.4.2

texts:
I am trying to fuzzify a distance to roads tiff file using r.fuzzy.set in GRASS (installed with QGIS). I input the parameters (input layer, output, inflection points, fuzzy range, fuzzy boundaries etc and when I execute the tool it will finish in 0 seconds and the output will be empty. I have tried everything and I really don't know what could be causing the issue. The distances raster imports and shows perfectly in grass, but when I process, nothing comes out of it. the metadata shows only one cell:

  +----------------------------------------------------------------------------+  | Map:      prueba@PERMANENT               Date: Mon Nov 05 21:58:04
  2018    |  | Mapset:   PERMANENT                      Login of
  Creator: K               |  | Location: prueba
  |  | DataBase: C:\grass
  |  | Title:    prueba
  |  | Timestamp: none
  |
  |----------------------------------------------------------------------------|  |
  |  |   Type of Map:  raster               Number of Categories: 0
  |  |   Data Type:    FCELL
  |  |   Rows:         1
  |  |   Columns:      1
  |  |   Total Cells:  1
  |  |        Projection: UTM (zone 30)
  |  |            N:          1    S:          0   Res:     1
  |  |            E:          1    W:          0   Res:     1
  |  |   Range of data:    min = 0  max = 0
  |  |
  |  |   Data Description:
  |  |    generado por r.fuzzy.set
  |  |
  |  |   Comments:
  |  |    r.fuzzy.set --overwrite input="distancias_autovias@PERMANENT"
  output\   |  |    ="prueba" points="500,2000" side="left"
  boundary="Linear" shape=0. h\   |  |    eight=1.
  |  |
  |
  +----------------------------------------------------------------------------+

While the input, the distance raster, shows correct metadata:

  +----------------------------------------------------------------------------+  | Map:      distancias_autovias@PERMANENT  Date: Mon Nov 05 21:46:39
  2018    |  | Mapset:   PERMANENT                      Login of
  Creator: K               |  | Location: prueba
  |  | DataBase: C:\grass
  |  | Title:    distancias_autovias
  |  | Timestamp: none
  |
  |----------------------------------------------------------------------------|  |
  |  |   Type of Map:  raster               Number of Categories: 0
  |  |   Data Type:    FCELL
  |  |   Rows:         33402
  |  |   Columns:      39587
  |  |   Total Cells:  1322284974
  |  |        Projection: UTM (zone 30)
  |  |            N: 4834444.8198    S: 3999394.8198   Res:    25
  |  |            E: 1013496.991    W:  23821.991   Res:    25
  |  |   Range of data:    min = 0  max = 353793.7
  |  |
  |  |   Data Description:
  |  |    generado por r.in.gdal
  |  |
  |  |   Comments:
  |  |    r.in.gdal -a -k input="C:\grass\distancias_autovias.tif"
  output="dis\   |  |    tancias_autovias" memory=300 offset=0
  num_digits=0                      |  |
  |
  +----------------------------------------------------------------------------+

Any ideas?


texts:
I'm trying to produce a simple NDVI map in QGIS using a Macbook pro (2011) from landsat raster images.

I've tried using the 'Measuring Vegetation' plugin, but for some reason that goes absolutely haywire as soon as I load it up, and I have to uninstall the plugin to use the system at all afterwards.

So I've tried doing it in the Raster Calculator plugin using exactly the same foruma as works perfectly in Grass GIS, namely

Float(band4 - band3)/ Float (band4 + band3)

I've tried it without float, with and without spaces between commands, with quotation marks around raster files.

All that is ever produced is a map that is uniform in tone (ie contains no information).

What am I doing wrong?


texts:
Selection exceeds the maximum allowed per request download limit cannot download more than a max of 20 rasters at time

I couldn’t figure out why the when I select more than 20 raster and try to download them form a mosaic dataset I got the following message?!
“Selection exceeds the maximum allowed per request download limit cannot download more than a max of 20 rasters at time”
Is there any method to configure the mosaic to download more than 20 Rasters??


texts: Imported shapefiles not displaying after being imported via processing script

texts:
EDIT: Code sample at bottom.
I am running into an issue with QGIS v3.12.3.
Currently, I am attempting to import a shapefile using QgsVectorLayer's addMapLayer method, as outlined in the cookbook (the first table of https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/loadlayer.html section 3.1) via a processing toolbox script.
After executing the code however, the imported shapefile is not displayed on the Layers list in the QGIS GUI for the user; nothing shows up, as if nothing had been imported at all.
This problem appears to be unique to when the code is executed in a script; running the code directly in the built-in Python console appears to work fine and as intended, with the shapefile being imported and displayed normally.
The confusing thing is that the script runs without errors, and the shapefiles appear to actually be imported properly; they are just not displayed in the GUI for the user. As an example, in the attached image you can see that the imported layer (testlayer) exists and can be selected in other scripts, but is not being displayed in the sidebar.
https://i.imgur.com/HSzqAOe.png
Anecdotally, colleagues are also running into the same issue which did not exist in an earlier version of QGIS, so I was wondering if anyone else is able to replicate this problem? A simple importation of any shape file using the cookbook's guidelines successfully would be enough to let me know that the issue is on my end.
I am unable to update QGIS at this time, but changelogs for v3.14 and v3.16 do not seem to indicate this particular issue has been fixed
The following is a snippet of code that reproduces this issue:
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import *

from qgis import processing
import qgis.utils

import geopandas as gp
import pandas as pd
import os
import osmnx as ox

north_lat = 33.5050
south_lat = 33.4859
west_lon = -111.9909
east_lon = -112.0149
save_path = os.getcwd()+"/Temp/Temp/Temp/" #specify whererever save path is
custom = r'["highway"~"primary|secondary|road"]'
G = ox.graph.graph_from_bbox(north_lat, south_lat, east_lon, west_lon, network_type='drive', simplify=True, custom_filter=custom)
G_projected=ox.projection.project_graph(G, to_crs={'init': 'epsg:4326'})
ox.io.save_graph_shapefile(G_projected, filepath=save_path)

shape_layer = QgsVectorLayer(save_path + "edges.shp", "edges", "ogr")
QgsProject.instance().addMapLayer(shape_layer, True)
print("done")


texts: Working/Functioning of "sampleRegions" function in Google Earth Engine

texts:
I am doing land use classification in Google Earth Engine. I am using three different classes(forest, building, water) for classification. For each class, there is a shapefile containing polygon geometries of various sizes.

Training_shapefile contains 50 polygons for each class and polygons are of various sizes.

I want to know:

Does sampleRegions function uses all pixels values in polygons? Or is it calculating mean value (or some other normalization) for each polygon.
In other words, if I am applying Random forest classifier, does input for classifier contains 50 values for each class (because of 50 polygons of each class) or the input size depends on total no of pixels (no of pixels in each polygon of a given class * no of polygons in each class).

Code used is given below. Code is working fine and I am able to do the classification. But I am not sure about the size of my training input for the random forest classifier as asked above.

//training_shapefile contains 50 polygons for each class and polygons are of various sizes.

var training_fc = ee.FeatureCollection('users/ha/training_shapefile')

var training = training_image.sampleRegions({
  collection: training_fc,
  properties: ['class'],
  scale: 10
});

// training the random forest classifier
var trained = ee.Classifier.randomForest(10).train(training, 'class', bands);


texts: Importing a `.jpeg`, `.prj` and `.wld` triplet as a raster layer in QGIS

texts:
I have a couple .jpeg files of few hundred megabytes each along their .prj projections and .wld world files – i.e. some georeferenced raster from what I read — and wish to import them for use with osmand as overlays.

I'm quite a newbie in this field and have no idea of the steps to follow, however I'm guessing that a good first step is to properly import these files as georeferenced raster layers in QGIS 3.12.

What is the proper way to import a .jpeg, .prj and .wld triplet as a raster layer in QGIS?


texts: How to delete coordinate system from raster file with prj.adf?

texts:
How can I delete the coordinate system from a raster file like .adf which is multiple files?

I found a file with tha name "prj.adf" so if I delete this file is it enough?

In shapefiles usually Ι delete the .prj file and thene I define the projection again, if necessary.


texts:
Eventually I came to know that in order to use pgr_createTopology function to create topology network on my imported OSM data (using pg_routing and PostGIS on postgresql), apart from the_geom geometry column I also need the gid integer column which is shipped along with the OSM geometry data.

SELECT pgr_createTopology('ways', 0.00001, 'the_geom', 'gid');

But what is this gid column? I need to run the same pgr_createTopology function on my custom linestring geometry table but I don't know about this gid column.


texts: Create my own OSRM for routing machine on leaflet

texts: I am implementing the routing machine wich is leaflet extension for routing analysis but by default the routing in routing machine is for demo based on OSM data.I want my own route ;How I do to build my OSRM server for route and how I make route of public transport based on bus lines not roads .


texts: Points that get created in the wrong order when using e.g. QChainage?

texts:
I have a polyline layer (road) that I want to use to get a point layer with 1 km between the points.

I have tried both 'QChainage' and 'Locate points along lines' to do this.
They both work, I get the points that I want. But, the problem is, the end up in a crazy order. I want them to be geographically along the road, starting with 0.

What can I do that get them in the right order?
I have used 'dissolve' on my road layer, and then 'QChainage' or 'Locate points along lines'. I've also tried using GRASS v.to.points.
And, they all make the points, but the order is wrong in all cases.

I use QGIS 2.10 and Windows 10.
My files are in SWEREF99TM (EPSG:3006)

I read Creating equidistant points in QGIS? but I don't know any programming.

What am I missing?


texts: Generating elevation polygon coordinates

texts:
I have created a raster of New Mexico with a contour line signifying a certain elevation.

What I'm trying to do is have QGIS finish the line around the edges of the state (where applicable) so it creates a polygon. If this is not possible, is this something I can do in GDAL or something?

I'm trying to create overlays for Google maps, so I need to get the coordinates all the way around so that I can make a polygon if that makes any sense.


texts:
Possible Duplicate:
  How do you decide what interpolation method to use for resampling raster data?

I want to interpolate a certiain target variable over a large territory. I trained a random forest using a sample of points on that territory where the target is known (I have many regressor layers / variables). The information of these regressors is available over the whole territory (thus the capability to interpolate the target). The thing is that the regressor layers are available in different resolutions, I used resample to force them to the same resolution (1km^2). Overall the model works rather well (This on a 20% test set). And the output map looks good. But I wanted to know if the different techiniques available for doing resampling have anything to do with the quality of the final output map? What are the pros and cons of the different resampling techiniques available in ArcGis (Nearest neighbor assignment, Bilinear interpolation, Cubic convolution). I'm only referring to continuous variables.

From ArcGis Help: Bilinear interpolation or cubic convolution should not be used on categorical data since the categories will not be maintained in the output raster dataset. However, all three techniques can be applied to continuous data, with nearest neighbor producing a blocky output, bilinear interpolation producing smoother results, and cubic convolution producing the sharpest.


texts: Python Code: "Compare two fields and select missing records"

texts:
The code I wrote is not right!! It's selecting more than what is actually missing. I think I'm wrong on the matched code line. I need the script to make a list of the "FLAG" field and a list of the "TFLAG" field. Then compare and select all the missing records from the "TFLAG " field. For Example, if 105H10 is missing from the "TFLAG" field then it will select that record in the "FLAG" field so I know to fix it and add the record.

import arcpy, traceback

mxd = arcpy.mapping.MapDocument("CURRENT")
lstLayers = arcpy.mapping.ListLayers(mxd)

flayer = arcpy.mapping.ListLayers(mxd, "AADT")[0]
alayer = arcpy.mapping.ListLayers(mxd, "AADTAnnoLabel")[0]

FRows = arcpy.SearchCursor(flayer)
ARows = arcpy.SearchCursor(alayer)

ffields = arcpy.ListFields(flayer, "FLAG", "String")
afields = arcpy.ListFields(alayer, "TFLAG", "String")

FList = []
AList = []

for row in FRows:
    Fvalue = row.getValue("FLAG")
    FList.append(str(Fvalue))

for row in ARows:
    Avalue = row.getValue("TFLAG")
    AList.append(str(Avalue))

matched = set(FList) & set(AList)

for x in matched:
    print x
    exp = '"FLAG" = ' + "'" + x + "'"
    arcpy.SelectLayerByAttribute_management("AADT", "ADD_TO_SELECTION", exp)
    arcpy.SelectLayerByAttribute_management("AADT", "SWITCH_SELECTION")


texts: Simplify repetitive tasks in QGIS Graphical Modeler

texts:
Are there iterators that can be used in QGIS graphical modeler to simplify the model shown above. If not, is there any better way of simplifying the model?

The first column represents my input layers, second column is the intersection, third column is the output from the "intersection" operation, fourth column is the "join attribute by location" operation and fifth column is the result of the join operation.

I would like to carry out "intersection" and "join attribute by location" operations for a watershed analysis. The aim is compute Linear Morphometric parameters such as the total and mean length of streams of different orders, stream ratios and bifurcation ratio.

The first step is to intersect "order1 streams" with the watershed, and then intersect the "Order2 streams" with the same watershed. If there is an "order3 stream" shapefile provided then the intersection for this new layer should be performed. Therefore only "order1 streams" and "order2 streams" are mandatory, the rest depend on the provided watershed layer. For example if the watershed is an order 4 watershed then the streams required are upto "order4 streams".

Once the intersection is completed for all the available input layers, they are then joined by location to the watershed with the options to get the sum and mean of the intersected streams.

The image shows the correct procedure. If I do the operation outside of the modeler the results are correct. When I run the model I get this error.

"Error executing algorithm Order5_plus_wshed 'NoneType' object has no attribute 'dataProvider'".

This occurs if I have not provided an input for one of the optional parameters (i.e. the inputs e.g "order4 streams") However if I provide all inputs I get the results I need.

So, I would like to ask if there is a better way of setting up this task.


texts: Multiple Bathymetry Layers, How to group into one?

texts:
I'm an extreme novice to GIS.

I'm using ArcGIS (Arcmap) and basically I've got 5 bathymetry layers, and I'm just wondering how to group them into one. Which would allow them to be represented with graduated colour with association to depth, rather than each having a single colour.


texts: Is it possible to determine which input led to which output through shapely's union?

texts:
I have a collection of four line segments which cross one another:

Using shapely's union method, I can split these intersecting lines into a larger collection of shorter line segments which share common vertices:

I'd like to be able to map these shorter line segments back to the larger line segment from which they originally came.

Is it possible to tag the input line segments in such a way that union will preserve the tag? And, if not, what's the most efficient way to map the shorter segments back to the originals?


texts: How to convert UK grid to coordinates in PostgreSQL?

texts:
I have a very large file with UK grid references that I need to get coordinates from

I'm on a Mac so I cant seem to use the solution provided in this link https://digimap.edina.ac.uk/webhelp/os/data_information/os_data_issues/ng_converter.htm

Furthermore, since it's too large of a file, I can't just copy the entire grid column onto a txt file.

I was thinking the best solution would just be to import the whole file onto the database and hope that there's some function that will do this.

They look like the following:


texts:
I know similar questions have been asked dozens of times, but unfortunately I tried all possible suggestions like triggerRepaint(), refresh(), refreshAllLayers() and so on, but cannot get it to work.

My problem is as follows: I have a PostGIS datasource with several points across the world. On top of that I have a country layer and based on those two, several layers created via "join attributes by location". For example to compute a sum of specific values from my points and then color the countries based on the sum.

Now when I add a new record to my PostGIS database, lets say based in a new country, after a refresh, the point is visible on my map, but the joined layers are not refreshed. So in this case the "new" country is not colored accordingly. Any idea how to do this in 2.18?


texts: How to create local map tiles for OpenLayers 2 offline use?

texts:
I have to use my OpenLayers 2 map in an offline stand-alone mode (PC/Laptop disconnected from network).

What is the best way to allow easy capture of map tiles for a region of interest, load them onto the offline laptop and have the OpenLayers 2 map see/use them as its imagery tiles?


texts: r raster: unique returns duplicated values?

texts:
I am using function unique() in package raster. I expect it to return the unique values for each layer, yet I get duplicated values... is that the expected result, or is there an issue somewhere?

library(raster)
#> Loading required package: sp
r <- raster(ncol=10, nrow=10)
r[] <- round(runif(ncell(r))*10)
s <- stack(r, as.integer(round(r/2)))

unique(s)
#> [[1]]
#>  [1]  0  1  2  3  4  5  6  7  8  9 10
#>
#> [[2]]
#>  [1] 0 0 1 2 2 2 3 4 4 4 5


texts: Blinking symbology in QGIS on database values

texts:
I made a geopackage to plan Aids-to-Navigation for maritime environments.
In my database I have a few fields that describe the character of the lights that are to be placed on the planned A-to-N's. These are the fields used in the S-57 standard.

e.g.:
A south cardinal bouy (it' s a type of AtoN) has a standard lightcharacter: 6 quick flashes + one long flash in a total period of 15 seconds. this is coded as (italic text not in database:

LITCHR: 25 - Quickflash + Longflash;

SIGPER: 15 - 15 seconds;

SIGGRP: (6+1);

SIGSEQ: 0.5(0.5)0.5(0.5)0.5(0.5)0.5(0.5)0.5(0.5)0.5(2.5)3(4)

The SIGSEQ (signal sequence) is the total flashsequence of the light with the format: light(eclipse), so 0.5(0.5) is half a second lit, half a second dark. The total amount of the SIGSEQ should add up to be as much as the SIGPER.

Is is possible in QGIS to make a SVG marker blink as the intended lightcharacter?! If yes I would like to know where I have to look to make this happen.


texts: Find annotation overlaping file in ArcMap 9.3?

texts:
I have all my textstring(Annotation) at distance 1.5 feet. I want to find all the annotation which are at a distance of less than 1.5. Also want to find the overlapping file.

Can I make any file like shapefile so that I can zoom to location?


texts: Fast way to check if postgis bounding box contains any points/linestrings

texts:
I have a bounding box given and want to know if this bounding box contains (or better intersects) any points or linestrings. So the query should return true if the first point/linestring was found and not test all of them.

The query I got so far is this:

SELECT NOT
 (ST_Intersects(ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(13.3277368531, 52.4783729748), ST_Point(13.463715857, 52.5520736045)), 4326), 3857), geom_vertex_web_mercator)
AND
 ST_Intersects(ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(13.3277368531, 52.4783729748), ST_Point(13.463715857, 52.5520736045)), 4326), 3857), geom_way_web_mercator)) as isEmpty
FROM vertex, edge
LIMIT 1;

But this just takes the first point/linestring and returns the value for it. Can any one help.

EDIT
This query seems to be very fast:

select exists (select true from network where ST_Intersects(ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(-140.0, 80.0), ST_Point(-135.0, 80.0)), 4326), 3857), geom_way_web_mercator)) as isEmpty;


texts: Empty feature classes made when trying to split by attribute

texts:
I am working with a Basic license of ArcMap 10.3, and I am trying to split a feature class into multiple feature classes in a geodatabase by unique values of an attribute. More specifically, I have a feature class of locations of 78 different species, and I want to create individual feature classes for each species. I have put together some code that I have found in various places (including here), and I can get it to create all the feature classes with all the fields, but each one is empty, and I can't figure out why. I am very new to arcpy and coding in general.

# Reads the feature class for different values in the attribute
cursor = arcpy.SearchCursor(inFC)
row = cursor.next()
attribute_values = set([])

strAtt = "ELCODE_BCD"
print strAtt

while row:
    attribute_values.add(row.getValue(strAtt))
    row = cursor.next()

# Output a Shapefile for each different attribute
for each_attribute in attribute_values:
    # Check to see if FC exists
    strEmptyFC = "each_attribute"
    print "Checking to see if feature class exists..."
    if arcpy.Exists(strEmptyFC) :
        print strEmptyFC + " exists."
    else:
        print "Creating feature class..."
        outFC = strWS + "\\"  + each_attribute
        print outFC
        arcpy.Select_analysis (inFC, outFC, "'%s' = 'each_attribute'" %strAtt)

del strWS, inFC, cursor, row, attribute_values

I think it has to do with the where clause in the select statement.


texts: arcgis server 10, vb.net, adding dynamic data

texts: i am using arcgis server 10, with visual web developer 2010 express edition. i downloaded "ArcGIS_AddDynamicData_VBNet\Default_ADF.aspx" project form ArcGIS Add dynamic data for ArcGIS Server 10. everything works fine, now instead of the simple display they have in there i wanted to add the "web mapping application template". so what i really want is to have the same functionality shown in the project but with the default "web mapping application template". plz can you tell me how i could possibly integrate the default web mapping application template into that project? thanks a lot in advance!!!


texts: Atmospheric correction for Landsat 8 in ERDAS?

texts:
I am attempting to run some classification on Landsat 8 imagery, however, I need to perform atmospheric correction on the images in order to reveal true spectral signatures. I am using ERDAS, and the autonomous atmospheric correction tool does not support the Landsat 8 sensor. Unfortunately, I do not have access to ENVI which supports landsat 8, or a licence to ATCOR, which seems to be a ERDAS add on for atmospheric correction.

Any Ideas?


texts: Managing Many Georeferenced Large Files in ArcMap?

texts:
Does anyone have any ideas on how to best handle many large georeferenced files in an ArcMap Document?

I have somewhere around 250 individual historic aerials (none being in the same place or from the same year) that I'd like to have in the same document, rather that having to open a different ArcMap document for every grouping of aerials.

Not all aerial layers have to be open in the ArcMap document at a time, to that could help, but I was wondering if anyone had come across this issue before.


texts:
I have only had limited experience with QGIS.

What i have:
I currently have many different layers (water mains, sewer mains, drainage etc.). These layers are TAB files with attributed data.

What I want:
I want to select (by any means) the relevant layers i need (could be up to 15 layers) and export the layers to DXF so that i can use them in AutoCAD. I would like these layers to export as separate DXF's not all as one DXF. I understand that you can export by selection to dxf, however this is a lengthy process if you need to export many layers.

Why I need this to work:
At work I constantly need to export areas of GIS information from our data base and I have been using QGIS as a replacement for Mapinfo (which I do not have access to any more).

In Mapinfo I used a combination of the plug-ins "MapBasic - Batch Cookie Cutter" and "MapBasic - Batch DXF export with attributes" to first cut all the layers I needed based on a polygon area and then converted the cut layers to individual DXF's - this process took only a few minutes and worked well. I do not know how to do this process or equivalent with QGIS.


texts:
I am trying to extract the z coordinate value from the derived attributes, similar to How to re-calculate area, perim, p2a,width and length in QGIS? but I cannot see a dedicated operator for finding the z coordinate like when trying to find area within the field calculator.

I have tried extraction of geometry tools > extract nodes & export/add geometry columns


texts:
I need to calculate the percentage of coral cover (polygon layer) in a 1 km radius around each record of fish (point layer). There’re about 4000 points (blue squares in the image).

I am new to QGIS.


texts: .shp incompatibilty issue between ArcGIS and QGIS?

texts:
I received a .shp file from an ArcGIS user. He said it was in SAD69UTM23S, and indeed it is (checked it in QGIS properties tab). However QGIS is not placing it correctly (using QuickMapServices as reference and other correctly placed .shp files I have; yes OTF reprojection is enabled). I even checked coordinates (of individual points) taken from the attributes table manually converting them and putting in Google Earth, they were equally misplaced.

However, when loaded the original .shp file in Google Earth all the points were in the right places. So I figured it was actually WGS84UTM rather than SAD69 as they said. I changed it in QGIS but it was also misplaced, this time though by a smaller distance.

Is there some kind of compatibility between ArcGIS and Google Earth that doesn't exist between ArcGIS and QGIS?

I don't get it why would Google Earth place the layer correctly but QGIS won't. In fact, apparently Google Earth is using different coordinates for the points (different from those in the attributes table).

Figures below.


texts: Change size of individual point symbols in QGIS

texts:
I have some point data (towns) with population levels. I'd like to show the smaller populations with small dot and increase the size of the dot symbol as the population increases.

I can do this in Mapinfo but I want to do it in QGIS.


texts: Giving line features of same layer different colours

texts:
I have one layer and there I have different lines. Imagine these lines are pathes of persons. So image a person x and y. And I now want to differ them by just watching on the different colours of the lines. Is this possible?

And please no solution with different layers. For sure that's possible but I cannot create a layer for each of the 50 persons.

So is there a way to differ styling in QGIS on one layer?


texts: Installing Arcpy in an Anaconda enviroment.

texts:
I recently uninstalled Anaconda due to a conflict with my pandas packages. I use to have it configured with my ArcGIS Pro Python 3.65 environment.

Now I want to reinstall it, but for my ArcGIS Desktop 10.5/ Python 2.7 environment. I need to have an environment that has both the arcpy , pandas, and arcgis libraries/mods in it (which my current 2.7/ArcMap 10.5 does).

How can I install Anaconda for 2.7 without overwriting or interfering with my current ArcGIS 10.5/ Python 2.7 environment AND set up my arcpy/arcgis/pandas within that new Anaconda environment?

If I wanted to copy my current Arc - Python 2.7 env folder, where would I find it  (ex: C:\Python27\ArcGIS10.5)?


texts: Make layer stacking in ENVI for Landsat 8

texts:
I downloaded Landsat image 8 and I made layer stacking for RGB layers in ENVI (Bands 4,3,2) to classify the land cover types. But the problem appeared when I conducted supervised classification.

I attached three figures;

A: Layer stacking RGB,
B: ROI,
C: Supervised Classification

Why the supervised classified image appears like C?


texts: How do i join a polygon's (cell shaped) attribute to another polygon in ArcGIS

texts: I have a grid shaped polygon which includes population data inside every cell (1km*1km) and I'd like to transfer this population data to my other polygon that are the districts of a city to find a total population of any district.


texts: "Warning 1: All options related to creation ignored in update mode" (GDAL)

texts:
I am attempting to clip a raster using a polygon file (shapefile) and to save the result in memory. I succeed to do it using gdal.Warp and the option format=VRT using the following code. Please note that before using gdal.Warp, I use a function to fix conflict geometry of my shapefile.

 ## SAVING GDAL.WARP RESULT WITH VRT

from osgeo import ogr, gdal

# input data
raster = file.tif
raster = gdal.Open(raster)
shp = polygon.shp

# function to fix conflict geometries
def clean_shapefile(shp):
    shp = ogr.Open(shp, 1)
    layer = shp.GetLayer()

    for feature in layer:
        geom = feature.GetGeometryRef()
        if not geom.IsValid():
            feature.SetGeometry(geom.Buffer(0))
            layer.SetFeature(feature)
            assert feature.GetGeometryRef().IsValid()

    layer.ResetReading()
    assert all(feature.GetGeometryRef().IsValid() for feature in layer)

# function to clip raster by a polygon (shapefile)
def clip_raster(raster, shp):
    clean_shapefile(shp)
    result = gdal.Warp("", raster, cutlineDSName=shp, cropToCutline=True, dstNodata=0, format="VRT")
        return result

# result
clipped_raster = clip_raster(raster, shp)

However, VRT is quiet slow and I want to save the clipped raster using the MEM driver of GDAL (apparently faster).

Problem: I get the following error when running gdal.Warp:

  Warning 1: All options related to creation ignored in update mode.

Final result is 1 while I want a new gdal dataset. I believed it was due to the gdal.Open reading option (GA_ReadOnly = 0 VS GA_Update = 1), so I tried option 1 (GA_Update) but nothing changed. What is wrong with my code?

 ## SAVING GDAL.WARP RESULT WITH THE MEM DRIVER FROM GDAL

from osgeo import ogr, gdal

# input data
raster = file.tif
raster = gdal.Open(raster)
shp = polygon.shp

# function to fix conflict geometries
def clean_shapefile(shp):
    shp = ogr.Open(shp, 1)
    layer = shp.GetLayer()

    for feature in layer:
        geom = feature.GetGeometryRef()
        if not geom.IsValid():
            feature.SetGeometry(geom.Buffer(0))
            layer.SetFeature(feature)
            assert feature.GetGeometryRef().IsValid()

    layer.ResetReading()
    assert all(feature.GetGeometryRef().IsValid() for feature in layer)

# function to clip raster by a polygon (shapefile)
def clip_raster(raster, shp):
    clean_shapefile(shp)
    array = raster.GetRasterBand(1)
    array = array.ReadAsArray()
    x_pixels = array.shape[1]
    y_pixels = array.shape[0]
    driver = gdal.GetDriverByName("MEM")
    dataset = driver.Create("", x_pixels, y_pixels, 1)

    world_file = raster.GetGeoTransform()
    proj = raster.GetProjection()
    dataset.SetGeoTransform(world_file)
    dataset.SetProjection(proj)
    dataset.FlushCache()

    result = gdal.Warp(dataset, raster, cutlineDSName=shp, cropToCutline=True, dstNodata=0)
    return result

# result
clipped_raster = clip_raster(raster, shp)


texts: Count number of times matching string appears in another column (similar to Excel COUNTIF)

texts:
Which function can I use to count the number of times a string for a row in column "LeaseName" matches another row's string for "LeaseName"?

For example, Row 1 is 'HADLEY #9' and I want to know the total number of times 'HADLEY #9' appears in the table for column LeaseName.


texts: Stop a stylesheet from displaying on layers above it in a Geoserver group layer

texts:
Background: I have a layer group made up of a series of raster tiles of increase detail as you zoom in on the map. The issue is not all of the layers have full coverage of the map. The idea to fill in the missing area was to use the natural earth1 shapefiles to fill in the gaps. We have an OSM like style sheet that labels the states, countries, rivers, and adds state lines. This is so a user can get an idea of where they are in the map if they zoom into to the incorrect area. The only issue is the natural earth stylesheet is showing on top of the raster file when added to the group layer.

Question: Is there a way to stop a stylesheet from displaying on layers above it in a Geoserver group layer? Or would it work to call the layers separately in openlayers?

Tools: Geoserver Openlayers

Below is an exmple of the issue. This is at ~2 million scale. On the left behind the raster is the NE layer where we have missing coverage. On the right is a raster layer. As you can see on the raster are various labels created by the NE layer's stylesheet. We do not want this behavior.


texts: Network analysis service areas vs. network analysis

texts:
i have calculated the distance of certain houses from public parks using both Network analysis service areas and network analysis.

However each method provides a different distance. Would this be expected? or should they be the same as they are both calculated along the road/path networks. The Network analysis has given shortest route, could it be that the service area wouldnt have included that short route?!!

Thanks


texts: Filter Landsat8 image collection to one scene per row/path and mosaic

texts:
I am trying to find and mosaic the least cloudy Landsat 8 OLI scene per tile, filtered by my region and for the year 2015.

I tried using this post to do so. However, unlike Sentinel 2A, there is no unique tile identifier in L8 tiles. I will have to extract unique combinations of the PATH and ROW properties, which I do not know how to do. My code is below, where i get multiple errors-
1) I am unable to extract distinct combination of path and rows stored in tiles using .distinct() as only one property can be used
2) Even when using only PATH as a property in .distinct(), my error says that I am trying to compile a non-image element in var leastCloudy

But the main question I have is how do i filter the image collection to give me the least cloudy scene per tile in the L8 OLI image collection.

//2. Loading L8 image collection (TOA reflectance)
var l8_collection= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR');

//3. Filter by time window (Jan 2015- Dec 2015) for region (private asset)
var x1= l8_collection.filterBounds(asset)
                  .filterDate('2015-01-01', '2015-12-31')
                  .sort('CLOUD_COVER');
print ('L8 2015 image collection:',x1);
print('# images', x1.size()); //446 images

var max_x1=x1.max();
var visParams = {bands: ['B4', 'B3', 'B2']}; // Temporally composite the images with a maximum value function.
Map.addLayer(max_x1, visParams, 'max value composite');

// Load Footprint of Landsat WRS-2 grids
var wrs2_descending = ee.FeatureCollection('users/tnccarbonscience/wrs2_descending')
var wrs2_filtered = wrs2_descending.filterBounds(asset);
print('L8 tile info',wrs2_filtered);
Map.addLayer(wrs2_filtered);

var Tiles = ee.List(wrs2_filtered.distinct(["PATH"]).aggregate_array('PATH'));
print("List of unique L8 paths", Tiles);

//Extract least cloudy L8 scene in each tile
var leastCloudyPerPathRow = ee.ImageCollection.fromImages(Tiles.map(function(tile){
var filtCol = x1.filter(ee.Filter.eq("PATH", tile));
var leastCloudy =  ee.Image(filtCol.sort('CLOUDY_PIXEL_PERCENTAGE').first());
return leastCloudy;
}));
print ("Size of least cloudy image collection",leastCloudyPerPathRow.size());
print ("least cloudy image collection",leastCloudyPerPathRow);


texts:
I am inquiring about the vertex deletion of qgis.

When you delete a link vertex, select Delete vertex and press the DELETE key to delete it. Deletion does not take place.

Is there any problem?


texts: DEM showing areas in the ocean to be greater than 0m (my MSL in my project)

texts: I am a new GIS student currently working on a coastal flood model in arc map, where I intend to create flood polygons at various heights above 0m contour (MSL)to represent the extent of area flooded on the coast. However, the DEM that was created using elevation spot height and contour data shows areas in the ocean >0m. Is this a correct representation? I would think the areas covered in ocean should be 0m or less. Therefore, when I create the flood polygons portions of ocean are shown to be flooded as well. Is there anyway to rectify this?


texts: find closest distance between a polygons segment and a line

texts:
I have a building with a house number as a point feature which is the centroid of that polygon.  I want to locate the closest segment of the building to a street like in the picture and remove the house number point on that segment.

How can i handle this?

I read about :
Near_analysis (in_features, near_features, {search_radius}, {location}, {angle})

But in this case the segment of a polygon is the parameter not the polygon at all.


texts:
It seems like after lots of initial problems Galileo project is taking off (ESA, BBC).

I was wondering what the state of preparation for that is on hardware side.
Are there any consumer grade GPS units that are ready to take advantage of Galileo?


texts: POSTGIS query - extracting common point from polygon data

texts:
I have a polygon dataset and need to find the single common point where 3 polygons meet. I'm approaching this by creating duplicate tables and comparing them to the main one (polygon_table a). I've managed to obtain the relevant polygons with the following query, but can't get it as a point.

SELECT DISTINCT a.geom
FROM polygon_table a, polygon_table t1, polygon_table t2, polygon_table t3
WHERE a.id <> t1.id
AND a.id <> t2.id
AND a.id <> t3.id
AND t1.id <> t2.id
AND t1.id <> t3.id
AND t2.id <> t3.id
AND ST_TOUCHES(a.geom, t1.geom)  = 't'
AND ST_TOUCHES(a.geom, t2.geom)  = 't'
AND ST_TOUCHES(a.geom, t3.geom)  = 't'

Please help?


texts: Load layers only when zoom level is reached

texts:
I'm trying to load different layers based on the user zoom level with OpenLayers. I've seen some similar questions in here, but they load the layer and then hide/show it based on the zoom level.

I don't want the layer to be loaded. I've managed to use some answers and came with a solution, but I don't like it that much. There must be an easier way. Can anybody point me in the right direction?

Here is the solution I've found so far.

map.events.on({ "zoomend": function (e) {
        if (this.getZoom() > 8) {
            // Setup single tiled layer
            var untiled = new OpenLayers.Layer.WMS("cite:ly_parc - Untiled", "http://localhost:8082/geoserver/cite/wms",
                {
                    LAYERS: 'cite:ly_parc',
                    STYLES: '',
                    format: 'image/png',
                    transparent: true
                },
                {
                    maxExtent: bounds,
                    isBaseLayer: false
                }
            );

            this.addLayers([untiled]);
        } else {
            //TODO
        }
    }
});


texts: Need to combine vector layers, but not with merge (QGIS)

texts:
I have four overlapping vector layers.  Each is a grid with a single field of interest:  numpoints.
I want to create a single output layer that is a single grid, with a field sumpoints that is the sum of the numpoints field in each of the input grids.
The grids overlap, but not completely.  I want the output vector layer to have a single grid cell if any of the input layers have a grid cell at that location.  However, I don't want the output layer to have "stacked" cells, so I don't think merge, with subsequent field math, works.
How can I do this?


texts: How to summarize one-to-many spatial join results with the same ID while each ID does have multiple string features

texts: After using the One-to-many option in the spaital join tool, I received a shapefile which includes 13 million rows and several columns. I am wondering how I can calculate the sum of different values of "BldfClass" (see the picture) that have the same "osmid" which is their ID. For instance, how many "Land Only" value of the "BldgClass" column does exist in the "osmid" 81765871. In general, I do have 35000 different ID numbers (osmid), and also the "Bldgclass" column includes about 40 different values. The reason that I have 13 million rows is that the ID number has been repeated for various rows and I want to summarize all of the information regarding each ID number. It would be something similar to the Pivot table of Excel.


texts: How to export to all points within Leaflet polygon?

texts:
Is it possible to export all points within a polygon drawn using Leaflet?

(http://leaflet.github.io/Leaflet.draw/).


texts: How to resolve Clip WARNING 000117 Empty output generated?

texts:
I am having issues clipping a very large polygon shapefile.

Can you all help me?

The error returned is “WARNING 000117: Warning empty output generated“. I have tried troubleshooting all of the usual suspects, including recommendations from the stackexchange community such as:

The polygons are in the same projection
I repaired the geometry (which fixed some issues but still got the error message when re-running)
Since it is a large file – I created a new shapefile of subset data (Export data) that was much smaller and it is still not working
The clip feature is just one single polygon not a multipart polygon
The clip feature is contained within the shapefile of polygons that I am trying to clip (ie clip feature is for a small area in Central America and the polygons that I am trying to clip are for the entire world)
Both are shapefiles as I know geodatabases can sometimes cause issues
I have used the clip feature with other shapefiles without a problem so I know that nothing is wrong with this clip feature.
Standard re-boot of computer, programs
No features are selected when I am running this tool
Located in a folder with no spaces and the file name is very short

However the clip still returns the same error. The large dataset I am trying to clip is the MAMMALS file located at this link (the amphibians and reptiles files work just fine, but the Mammals does not): http://www.iucnredlist.org/technical-documents/spatial-data


texts: How To save Geo-Tiff image in PostgresSQL?

texts:
I have a Geotiff image, which I want to load into a PostgreSQL database.

Currently I am using the command line code for saving this image to my database :

raster2pgsql -I -C -e -Y -F -s 26986 -t 128x128  -l 2,4
    C:\Users\Digital-Globe-Quickbird\pyramids_geotiff.tif public.boston
| psql -U postgres -d test -h 8.35.193.103 -p 5432

And after Run this command it creates one table for that image and stores the data in it.
Now I want to fetch the data from the table and plot it on Google map.
I am executing this query on pgAdmin for fetching the data :

select rid,rast::geometry from boston limit 10;

And I get the output like this :

Now I don’t know  how to plot this data on Google map. please let me know how can do this.


texts: Exporting the contents of an attribute table in formats other than an Excel file

texts: I know that it's possible to export the contents of an attribute table to an Excel file, but could they be exported in any other format (from ArcGIS 10.0)? I have a feature class whose attribute table (minus a few fields) needs to be made available to be displayed and read by the human eye as an ordinary table. Could the attribute table be exported into (for example) .pdf format, or do I have to export it to Excel first, and start from there?


texts: Data management in GRASS from command line?

texts:
I'm trying to import a large set of raster files into GRASS. The GUI import tool works fine for a handful of files, but it appears to require that I click the "Layer id" checkbox for each individual file that I want to import, and that doesn't work well at all for large sets of file. So my question is, how do you manage data in GRASS from the command line? I realize that this is a broad topic, so please feel free simply to direct me toward the documentation for the relevant tools.

I'd also be happy with an approach using the GUI tool in this case, but as I'd prefer a command-line approach because I'm just learning GRASS and need to script almost everything I'm doing, and have read that the Python GUI for GRASS has issues with Mac OS 10.8 (I haven't run into those issues, yet).

UPDATE: It does not appear that a GUI solution will work in this case. Having clicked the checkboxes for about 700 files that I wanted to import, the process does not appear to have succeeded due to a "to many files open" error. The tail end of the log is given below.

startupinfo, creationflags)
  File "/System/Library/Frameworks/Python.framework/Versions
/2.6/lib/python2.6/subprocess.py", line 616, in __init__

errread, errwrite) = self._get_handles(stdin, stdout,
stderr)
  File "/System/Library/Frameworks/Python.framework/Versions
/2.6/lib/python2.6/subprocess.py", line 978, in _get_handles

c2pread, c2pwrite = os.pipe()
OSError
:
[Errno 24] Too many open files


texts:
AttributeError: 'NoneType' object has no attribute 'symbolLayer'
Traceback (most recent call last):
  File "C:/Users/jpilbeam/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 350, in saveMap
    feedback=self.feedback)
  File "C:/Users/jpilbeam/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 101, in write
    folder=dest_folder)
  File "C:/Users/jpilbeam/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 191, in writeLeaflet
    exp_crs, minify)
  File "C:/Users/jpilbeam/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 246, in exportVector
    if is25d(layer, canvas, restrictToExtent, extent):
  File "C:/Users/jpilbeam/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 513, in is25d
    sl1 = sym.symbolLayer(1)
AttributeError: 'NoneType' object has no attribute 'symbolLayer'

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version: 3.12.1-București București, 121cc00ff0
qgis2web version: 3.16.0

I'm using the qgis2web plugin and when I include the OpenStreetMap multipolygons layer I get this python error, which stops me from previewing and exporting to webmap. I can view and export with no problems when I don't include that layer. So, I'm wondering if anyone has a clue as to where I should look to remedy this?

There has been an issue opened regarding this error on the qgis2web Github, but nothing recent.


texts: QGIS Script Editor to get operations between raster and float number

texts:
I am looking for developing python codes mainly for working with raster data, in particular satellite imagery from Landsat. I need to write a script (into the QGIS Script Editor) to make operations between Raster data and number (float). I know how to define the Raster but I don't know how to define the number to make it work. I am working with the last version of QGIS Essen 2.14 and I tried the following code to make a simple sum between a raster and number but it doesn't work:

##RED=raster
##a=number 0.5
##XXX=output raster

from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry

# Get layer object
layer1 = processing.getObject(RED)
# Get number
number1 = a

def xxx (RED,a,output):
    entries=[]

    #define raster 1 ("RED")
    raster1=QgsRasterCalculatorEntry()
    raster1.ref='RED@1'
    raster1.raster=RED
    raster1.bandNumber=1
    entries.append(raster1)

    #define number1 ("a")
    number1=QgsRasterCalculatorEntry()
    number1.ref='a'
    number1.float=a
    entries.append(number1)

    #XXX Processing
    calc=QgsRasterCalculator('("RED@1"+a)',output,'GTiff',RED.extent(),RED.width(),RED.height(),entries)
    calc.processCalculation()

xxx(layer1,number1,XXX)


texts: Can you use data defined override for QGIS label callouts to make the callout line start at the origin if map feature is moved

texts:
I love the QGIS callouts feature for labels but wanted to know if it was possible to anchor the label callout to the original feature position so that when the feature is moved the label callout is visible to the original feature position.
Currently with the label callout, the label has to be moved away from the feature for the callout to show. I was wondering if this could be achieved with the data-defined overide options for the label callouts? I know this is possible to do with the geometry generator in symbology.


texts: Joining CSV and shapefile to map using R?

texts:
I have one CSV file and one shapefile

mydata <-readr::read_csv("~/map/done.csv")
mymap <- shapefile("~/map/tyumen.shp")

How merge it to one table and draw plot?

map_and_data <- merge(mydata, mymap, by='Country')

ggplot(map_and_data) +
  geom_sf(aes(fill=MeDianIncome))

ggplot(map_and_data)+
  geom_sf(aes(fill = MedianIncome))+
  scale_fill_gradient(low= "#56B1F7", high = "#132B43")


texts: How to handle crashes on save causing "Project file read error: unexpected end of file at line 1 column 1 for file [pathway]"?

texts:
QGIS 1.8.0

Tried to save a project and as I saved it gave me the "QGIS has experienced an error and needs to close"
Next time I went to open the project I got this (well I was going to post an image of the error but apparently I need a "10 reputation" to do that) suffice to say it says:

"Project file read error: unexpected end of file at line 1 column 1 for file [pathway]"

The project file now says 0KB for the file size.  Any idea how to get my project restored?  Why are the crashes happening?

QGIS has been crashing more and more frequently especially when saving, trying to split features, and when opening the print composer.  No error messages other than the generic "QGIS has encountered and error and needs to close."


texts:
I am having difficulties with masks in Google Earth Engine (GEE).
I need to classify a sentinel image of the GEE. But I don't want the eucalyptus areas in my image to be classified. I have a shapefile that contains all the areas of eucalyptus planted and I would like the GEE to disregard the eucalyptus shapefile area during classification.
How can I do it?
var S2_1 = ee.ImageCollection("COPERNICUS/S2")
    .filterMetadata('MGRS_TILE', 'equals', '21KYT')
    .filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than', 1)
    .filterDate('2020-01-01','2020-07-31')
    .median();

//Classificação

var classnames = veg1.merge(past1).merge(past2).merge(agua).merge(past3).merge(veg2);
print(classnames);

var bands = ['B4', 'B3', 'B2'];

var training = S2_1.select(bands).sampleRegions({
  collection: classnames,
  properties:['classe'],
  scale: 10
});

print (training);

var cart = ee.Classifier.cart().train({
  features: training,
  classProperty: 'classe',
  inputProperties: bands
});

var cart_class = cart.select(bands).classify(cart)


texts: How exactly does a single laser pulse from LiDAR act?

texts:
I'm trying to understand the behavior of a single laser pulse in a traditional airborne lidar.
I understand that the multiple return values are representative of the surface that reflected the initial pulse. However, does a single pulse from the laser, return each reflection individually to the sensor? Or does a single pulse from the laser continue through it's path, capturing each reflection along it's way until returning to the sensor?
So if a system can capture 300k pulses per second, are those 300k pulses released and captured? Or is that 100k +/- pulses returning 300k values?

Example photo: Does each disturbance in the waveform return it's own pulse to the sensor? If so, how the sensor understand the laser is continuing? And if that is also true, where does the energy come from to continue the pulse further?


texts: DEM with bathymetric contour lines in GRASS

texts: I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative. To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn't work. I think that it would be because the negative values of the created raster. Could someone help me?


texts: QGIS Exporting Line Direction Symbol from Labels

texts:
I have set up certain labels to show the Line Direction using the Line Direction Symbol in Label Formatting, with default < and > symbols. It works great, but I now want to export these symbols for use in a web map.
I have set both the Left and Right directions to 'Store in Project' but when I check the Auxiliary Layers they don't contain any features and just show NULL in the attributes table. The layers are set as Text Edit in the attributes From. I was hoping to use the field calculator to pull the Auxiliary data (< and > characters) into the main database for export.
I'm not sure what I am missing, any ideas? I am using QGIS V3.10.10


texts: How to handle large data exports (>100,000 tables)

texts:
I'd like to export time-series data for many different lakes across the U.S. However, I run into memory issues when trying to start the process.
To handle my processes, I'm using the Python API and ee.batch.table.toDrive. I'm using a loop, like so:
nhd_list = nhd.toList(nhd.size())
for i in range(0, ee.Number(nhd_list.size()).getInfo()):
    feat = ee.Feature(nhd_list.get(i))
    geom = feat.geometry()
    name = str(ee.String(feat.get("NHDPlID")).getInfo())
    .
    .
    #A series of processing steps for export
    .
    .
    #By this step, pixels have been filtered and reductions to
    #get medians have been performed.
    task = ee.batch.Export.table.toDrive(
        table,
        name,
        **{'fileFormat': 'CSV',
           'driveFolder': 'Test',
           'fileNamePrefix': name})
    task.start()

Unsurprisingly, when I try to run this, I receive an error that the user memory limit has exceeded. However, it works when I limit the tasks to 3000 at a time.
My plan is to thus keep a loop going and wait until the amount of tasks falls below some number, after which the next task starts.
Is there a way to view the amount of running tasks through the Python API? Or am I looking at this the wrong way? Is there a more efficient way of handling this?


texts: How to use QGIS field calculator to delete style code?

texts:
I am struggling with following issue:

How to delete style code before id codes x.x.xx.. and the }s in the end?

Examples below:

{\fArial|b1|i0|c0|p34;A.B.11} {\fArial|b1|i0|c0|p34;A.C.1}


texts: Allowing NULL value in field's value map in QGIS?

texts:
Value maps have been set for some attributes in the properties of a layer (which is an offline edit of a PostGIS database saved as a spatialite file).

But in the drop down selection it does not allow for a Null to be selected. So if a user selects one of them, there is no way to undo the selection.

I have tried entering both Null, and NULL, into the value map, and having an extra blank row.

The extra blank row does give me a blank option,

 to give

but the value in the field is '' rather than NULL.

And selecting NULL gives me 'NULL' with the single quotation marks

Edit 1

In response to answer Bhaskar

When I run this SELECT query, I would like to have just these 4 values

not,

How can set it up so that a user can essentially deselect a value and return it to its previous NULL state?

EDIT 2

I have tried to run the SQL suggested by Bhaskar to just swap out a inserted NULL through the value map.

INSERT INTO awrtracker.awr_tracker_sync (threat_lvl) VALUES (NULL) where threat_lvl is 'NULL';

In place of the final 'NULL' in the expression I have tries 'Null' and 'null'. But the error is the same "ERROR: syntax error at or near "where".

It's an SQL problem isn't it, from what I have researched the WHERE statement is invalid here for PostgreSQL?


texts: How to use items param in TemplatePicker to draw with?

texts:
I have been checking the JS API of TemplatePicker and it says to either use featureLayers or items in the params object:

https://developers.arcgis.com/javascript/jsapi/templatepicker-amd.html

I would like to use items in the templatePicker, all the examples I've seen use the featureLayers param. I have attempted to implement the following code:

var symbol =  new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,

   new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,

   new esri.Color([255,0,0]), 1),

   new esri.Color([0,255,0,0.25]));

var items = [
  { label: "item 1", symbol: symbol, description: "description 1" },
  { label: "item 2", symbol: symbol, description: "description 2" },
  { label: "item 3", symbol: symbol, description: "description 3" },
  { label: "item 4", symbol: symbol, description: "description 4" }
];

 var templatePicker = new TemplatePicker({
            items : items,
            grouping: true,
            rows: "auto",
            columns: 3
          }, "templateDiv");

The following error is displayed when clicking any of the items:

  Uncaught TypeError: Cannot read property 'geometryType' of undefined

Obviously I'm missing something, but I can't find any more detailed documentation about this.

Update:

I've looked into it some more and found that the function _activateDrawToolbar in Editor.js is called upon. Which in turn calls _toDrawTool and passes along templatePicker's featureLayer which causes the error because featureLayer is undefined. This seems to be the wrong behaviour seeing as I indicated templatePicker should use items and not featurelayers. In the documentation it clearly states:

  FeatureLayers or items are required all other parameters are optional.
  See options list.


texts: Geocoder leaflet for internal use in the company, which take addresses from any part of the street

texts:
I am making a personal application routing to be used internally in the company using machine leaflet route.
The plugin uses nominatim geocoder, but he geocodificia according to the links of the OSM. I need to get the long / lat of arbitrary points, for example if the A Street No. 1234 is in the middle of the block on the corner geocode returns. That for purposes of mileage will make a difference to me.

Would like suggestions of geocoder that meet this need, remembering that the application is built.


texts: I am very new to QGIS and mapping. I am trying to load a US state map shapefile in QGIS. But the problem is it does not look like another US state map available on the internet. The upper part looks very straight. Am I missing something? Do I need to convert to any other format before displaying?


texts: Identifying downhill cells for dispersing frog?

texts:
I'm working on a movement/cost analysis for frogs dispersing from 135 wetlands located in Maine's mountains.
I have a lot of wetlands, so I'd like to automate this task in ModelBuilder using an iterator (I'm using ArcGIS 10).
The cell values (i.e., cost values) of my cost surface are based on the terrain ruggedness index (TRI); cells that correspond with rugged areas (e.g., mountainside) have greater cell values than cells that correspond with flat areas (e.g., plateau).
Using the Cost Distance tool, I will delineate an "area of influence" around each wetland; this will be based on the cost surface and species-specific dispersal distances.
Finally, I will estimate covariate values (e.g., cumulative stream length [NHD] and wetland area [NWI]) within the "area of influence" around each wetland.

What is the best way to identify those cells that correspond with downhill movements for frogs?

Imagine that a frog leaves a wetland; it will encounter "ups" and "downs" as it disperses. Cells corresponding with "ups" (i.e., elevation gains) should retain their respective TRI value, while cells corresponding with "downs" (i.e., elevation losses) should be reclassified as a 1 (i.e., low cost) because frogs likely have little trouble moving downhill. It seems to me that this analysis should somehow consider the location of each wetland and the direction of the frog's movement because an elevation gain from one direction may be an elevation loss from another direction.


texts:
I want to access the explode lines function in Python outside of QGIS from a standalone script.

What module do I have to load in order to use it?

How can I access processing?

from qgis.core import *

layerInput = QgsVectorLayer('test.shp', 'test', 'ogr')

processing.runalg('qgis:explodelines', layerInput, 'temp.shp')


texts: Determining coverage of polylines within polygon using ArcGIS Desktop?

texts:
Is there a way to calculate the coverage of polylines within a polygon when there are overlapping lines and parallel lines?

I am working on finding route coverage of gps traces within a centerline route buffer, but ran into the issue of having multiple traces that run alongside each other, overlap, or have gaps. The result is numerous short polylines within the route polygon and no way of calculating if the lines provide full coverage of the route extent. For example, I have a route polygon that is 27 miles long, and has 56 polylines within it and the sum of the lines are 126 miles.

I am using ArcMap 10.5, advanced license. I am not using Network Analyst or any other extensions. I am cutting gps traces to a buffer of a route centerline shapefile. The gps traces gets cut at the start and end of a route, I then calculate the length and mileage of the section via the m-values of the line. The issue is that there are numerous traces in each route polygon, and no way to find out if the length of the original route (polygon) is covered due to gaps in coverage and no continuous coverage of a single gps trace.

I am looking for coverage parallel to the X axes. So just the overall length coverage that the lines provide within the polygon, total length covered rather than total sum of all lines.


texts: How can I calculate the intersection of a line and the geoid (EGM96)?

texts: I have a known line (point and vector) described in ECEF (Earth-Centered, Earth-Fixed) coordinates and I need to find where it intersects the geoid (Earth Gravitational Model 1996).  Is there existing software I can use to do this?


texts: Automating QGIS Choropleth Maps Using PyQgis

texts:
I have maps (shapefiles - vector layers) of several states' school districts, appended to a federal dataset containing the same variables for each state's districts (in the attribute table). I want to create a set of choropleth maps, one for each state, color-coding districts by levels of a given variable in the attribute table.

Does anyone know of a tutorial (or can someone share some code) that would let me automate the creation of these maps using QGIS's built-in Python interface, including specification of the colors (preferably in RGB) to represent each level of the variable?