texts: What is the equivalent of QgsMapToolIdentifyFeature in PyQGIS 3?

texts:
I was trying to use the  QgsMapToolIdentifyFeature() tool as shown in an answer of StackOverflow, but when executed it gave the error:

'QgisInterface' object has no attribute 'QgsMapToolIdentifyFeature'

I am assuming it was deprecated, in that case how do I call this tool in PyQgis3.4?


texts:
I have a script that prints coordinates on mouse klick including snapped coordinates if snap is active. The strange thing is that there’s no symbolism on the canvas that shows that you are snapping on a point or other things.

Does it have to be activated somehow, if yes then how?


texts: How can I snap a polygon to a line? For example, I have a polygon which represents some meadows to snap over a line which represents a road.


texts: How do I delete specific graphics on the map using arcobjects

texts:
I am writing a small application that allows the user to click on the map, and it will create 3 buffers (these are graphics using the IElement interface) at specified distances.
What I want to do is if there are buffers on the map from the previous click, and the user clicks on the map to create another set of buffers, delete the oldest set of buffers (which are graphics)
So in essence at anyone time there should only be 3 buffers on the map.

Has anyone got any ideas on the best way to do this?

Thanks


texts: How to change parameters of certain algorithms in QGIS process modeler during run time?

texts:
I am using Process modeler to automate a bunch of things like Create Graticule -> Extract points at the graticule centeroids -> Add coordinates to the points -> update certain fields of the point file with respect to a polygon.

Edit:

The model has run successfully. Except, i would like to change certain parameters during run time with respect to the input file. My question is, is it possible to change the parameters during run time itself ? What i am looking for is, the model should ask for user's input during run time and it should not process the predefined values.

For example, i've five algorithms (A,B,C,D,E) in model. Once the process starts all the algorithms are being processed with predefined parameters (like grid cell size, etc..) and the "E" is giving the final output file. Instead, what i would like to do is, after algorithms A->B the user has to input parameters for "c". It should not be a continuous process. There should be an option for user inputs at certain junctions.

Any ideas please ?


texts: How to de-authenticate from Earth Engine API

texts:
Question
I am using the Python API of Google Earth Engine and I authenticated myself a long time ago with :
import ee
ee.Authenticate()

I can now connect myself directly using ee.Initialize()
My question is how to revoke this authentification process ?
Context
I am building a test suits for my librairy.
instead of using ee.Initialize() in the files that requires GEE API I created a function that check if the credential exists in the system (because of course they are unavailable in travis) to use a json private key file if necessary:
def init_ee():
    """Initialize earth engine according to the environment"""

    # only do the initialization if the credential are missing
    if not ee.data._credentials:

        # if in test env use the private key
        if 'EE_PRIVATE_KEY' in os.environ:

            # key need to be decoded in a file
            content = base64.b64decode(os.environ['EE_PRIVATE_KEY']).decode()
            with open('ee_private_key.json', 'w') as f:
                f.write(content)

            # connection to the service account
            service_account = 'test-sepal-ui@sepal-ui.iam.gserviceaccount.com'
            credentials = ee.ServiceAccountCredentials(service_account, 'ee_private_key.json')
            ee.Initialize(credentials)

        # if in local env use the local user credential
        else:
            ee.Initialize()

    return 0

I would like to launch my test suit in the same condition as in travis without pushing to github


texts: Filter Google Earth Engine image collection between today and 10 days ago

texts:
I wrote a small script that filters GEE image collection by date that I'm manually change:

var start_date = '2018-11-02'
var end_date = '2018-11-30'

// choose image collection
var ls8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_RT_TOA')
.filterDate(start_date, end_date)
.filterBounds(fc)
.select('B1','B2','B3','B4','B5');

fc is a feature collection. This works fine but I'm looking for a way to change the end_date for today and the start_day for 10 (or some other number) days before today, automatically. So every time I ran the script it looks for images in the last 10 days.

Maybe something like:

var start_date = ee.Date(Now-10)
var end_date = ee.Date(Now)

Is there something like that?


texts: Link multiple Photos to Features using ID in QGIS

texts:
In QGIS I have a Postgis layer with POIs. Further, I have a folder with images. The name of the images matches a unique identifier in the attribute table.

Is it possible to automatically connect these two datasets and show the images when I open the feature form?

I use QGIS 2.4 on a mac, do GIS but no programming.

I had a look a eVis, Import Photos, but couldn‘t do the job.

Update:
eVis works. But: I sometimes have two pictures referring to the same ID. Is there a solutions for that?


texts: Stacking a raster with GDAL in python - vrt, translate, merge giving errors

texts:
I'm trying to create a composite of all my sentinel bands into one tif in python. I've tried doing a few things but nothing seems to be working. I am using an arcpy python environment as I need a few ArcGIS-specific tools later on in my script.

I have a dictionary of bands that are the band name and the absolute path to the tif.

First I tried using subprocess.call and gdal_merge.py

def createindices(index_dict, name):

    print(index_dict)

    coastal = index_dict["COASTAL_AEROSOL"]
    blue = index_dict["BLUE"]
    green = index_dict["GREEN"]
    red = index_dict["RED"]
    vegre5 = index_dict["VEG_RED_EDGE5"]
    vegre6 = index_dict["VEG_RED_EDGE6"]
    vegre7 = index_dict["VEG_RED_EDGE7"]
    nir = index_dict["NIR"]
    narrownir = index_dict["NARROW_NIR"]
    watervap = index_dict["WATER_VAPOUR"]
    swir11 = index_dict["SWIR11"]
    swir12 = index_dict["SWIR12"]

# Create the stacked image that has the highest resolution
    out = name + "_ALL_BANDS.tif"
    vrt = name + "_vrt.vrt"
    bandslist = [coastal, blue, green, red, vegre5, vegre6, vegre7, nir, narrownir, watervap, swir11, swir12]

    print("Stacking all bands")
    subprocess.call("gal_merge.py -o " + out + " -of GTiff -ps 10 10 -separate -a_nodata -10000 " + coastal + " " + blue + " " + green + " " +
                 red + " " + vegre5 + " " + vegre6 + " " + vegre7 + " " + nir + " " + narrownir + " " + watervap + " " + swir11
                + " " + swir12)

I get this error: FileNotFoundError: [WinError 2] The system cannot find the file specified. I am using the exact paths for my inputs, have checked it multiple times and they're right. I did a little reading online about subprocess giving these errors but I don't really understand the solutions.

I also tried replacing subprocees.call with os.system and get this error: 'gal_merge.py' is not recognized as an internal or external command, operable program or batch file.

So then I tried a different way to avoid using subprocess by using creating a vrt and then use gdal translate from this thread:

def createindices(index_dict, name):

    print(index_dict)

    coastal = index_dict["COASTAL_AEROSOL"]
    blue = index_dict["BLUE"]
    green = index_dict["GREEN"]
    red = index_dict["RED"]
    vegre5 = index_dict["VEG_RED_EDGE5"]
    vegre6 = index_dict["VEG_RED_EDGE6"]
    vegre7 = index_dict["VEG_RED_EDGE7"]
    nir = index_dict["NIR"]
    narrownir = index_dict["NARROW_NIR"]
    watervap = index_dict["WATER_VAPOUR"]
    swir11 = index_dict["SWIR11"]
    swir12 = index_dict["SWIR12"]

# Create the stacked image that has the highest resolution
    out = name + "_ALL_BANDS.tif"
    vrt = name + "_vrt.vrt"
    bandslist = [coastal, blue, green, red, vegre5, vegre6, vegre7, nir, narrownir, watervap, swir11, swir12]

    print("Stacking all bands")

    vrt_options = gdal.BuildVRTOptions(resolution='10', separate=True)
    gdal.BuildVRT(vrt, bandslist, options=vrt_options)

    translate_options = gdal.TranslateOptions(format="GTiff", outputType='gdal.GDT_Int16', noData=-'10000')
    gdal.Translate(out, vrt, options=translate_options)

I get this error: TypeError: in method 'BuildVRTInternalNames', argument 3 of type 'GDALBuildVRTOptions *'

I also can't use rasterio as I can't duplicate my arcpy environment for some reason, which you need to do to add new libraries to it.

I'm lost.


texts: Ajax parameters to arcGIS's find Address

texts:
I write a ajax to consume the arcGIS services to return json results, I have tried so many way for the findAddress function parameter, non seems work, plese help.  Below is my code:

     function AddrCandidates()
    {

        var obj = {};
            obj.Street = $.trim($("[id*=txtStreet]").val());
            obj.City = $.trim($("[id*=txtCity]").val());
            obj.State = $.trim($("[id*=txtState]").val());
            obj.Zip5 = $.trim($("[id*=txtZip5]").val());

             $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "http://something/arcgis/rest/services/GeocodingResources/USA_CompositeAll/GeocodeServer/findAddressCandidates",
                data: { data: {Address: "380 New York St", City: "Redlands", State: "CA", Zip: "92373"},},
               // data: JSON.stringify(obj),
                datatyp: "json",
                success: function (data) {
                    var results = data.d;
                    var candidateAddr = results.candidates;
                    alert(results);

                    }
                    else {
                        alert("No address found");
                    }
                },
                failure: function (xmlHttpRequest, status, err) {
                    alert('Error happens: ' + err);
                }
            });
      }

The example usage address in document is:  http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer/findAddressCandidates?Address=380+New+York+Street&City=Redlands&State=CA&Zip=92373


texts: Errors when using the Corridor Designer tool from Arctoolbox

texts:
I am using the corridor Designer ArcToolbox for designing a habitat suitability model and I've got the following errors:

Error 010328: syntax at or near symbol SPACE
ERROR 010267; Syntax error in parsing grid expression

I´ve tried moving the files without spaces and number to the default file of ArcGis. Also carefully rewriting the txt.files for the reclass table. And nothing seems to work.


texts: Open Identify Results Window from QGIS Plugin

texts:
I am trying to open Identify Results docked window using qgis plugin. How can i open the identify results window using feature id?

I am iterating through active layer, get a specific feature and then open the identify results window automatically within that plugin.


texts: WAB Developer Edition Header Controller widgets loading onscreen incorrectly

texts:
Has anyone ever had an issue with Web AppBuilder Developer Edition where the widgets in the header controller  not loading in their proper location?  Sometimes on initial startup of the browser the widgets will load on the map as seen below.

Once the browser is resized the widgets return to the HC.  Is there code I could change to ensure these widgets load in the header controller?


texts: Cost Distance interpretation in ArcGIS 10.2

texts:
I am using the Cost Distance tool in ArcMap 10.2 to find the how far it is to walk to the closest area of green space along the road network in a town.

I have a input raster of the location of the green spaces and a cost raster of the road network. For the cost raster a road suitable for pedestrians is given a cost of 1 and an unsuitable road is given a cost of 10.

The tool produces a sensible output as the costs increase with greater distance from green spaces, but I do not understand what the cost values correspond to. I assumed that as the cell size was 10 m an area 400 m from a green space would have a cumulative cost of 40 (400/10 = 40) this is not the case.

Is there a way of converting the cumulative cost result into a real world measure (i.e. distance) or is there another tool which would perform this analysis.

EDIT

The picture shows the result of the Cost Distance tool, the green space is in green the roads in red with darker desk showing a higher cost. Cost values next to green space are 70 increasing to 5070.45 at a distance of about 500 m.


texts: Adjust GeoServer home page just to WMS service

texts:
I want to adjust my first GeoServer home page (before logging in) just to WMS service
Can anybody help me please?


texts: Search Cursors Inside of Loops Throwing Runtime Errors?

texts:
I am attempting to create a function to use a search cursor and associated list to get the unique values of a specified field and then use that list of unique values to loop through each value, create a where_clause with that unique value, and then use a search cursor to sum the field values in a target field for the queried results. Currently I am trying to get area(acreage) values with this measurement.

import arcpy
#User provides workspace, feature class, field to search by and desired
 field to sum together

def search_test(workspace,inFC,searchField,targetField):
arcpy.env.workspace = workspace
fields = [searchField,targetField]
#List to store values
unique_field_attributes = []

with arcpy.da.SearchCursor(inFC,fields) as cursor:
    for row in cursor:
        if row[0] not in unique_field_attributes:
           unique_field_attributes.append(row[0])

unique_field_attributes.sort()
print "unique attributes: ",unique_field_attributes

Here everything runs fine, I get a nice ordered list of attributes. The problem occurs when I try to use a search cursor inside of a for loop.

for attr in unique_field_attributes:
    swhere_clause = """{0} = {1}""".format(arcpy.AddFieldDelimiters(
                    inFC,searchField),attr)
    print swhere_clause

When I do not have the search cursor after this in my program, it prints all of the where clauses correctly. However, when I add the search cursor it only prints the first where clause and I get a Runtime Error

with arcpy.da.SearchCursor(inFC,fields,swhere_clause) as cursor:
    for row in cursor:
        #Attempt to sum an area value
        area += row[1]

Error looks like this:

Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "SearchTest.py", line 24, in search_test
        for row in cursor:
    RuntimeError: an invalid SQL statement was used. [file name here]

Any help or suggestions?


texts: Launch QGIS GUI using batch file and Python 3 - Windows 10

texts:
Ultimately I'm attempting to launch the QGIS GUI and run a python script from a batch file. I've reviewed numerous instances referencing similar scenarios on this and other forums but for the life of me I can't get it to work.

My batch file code is:

@echo off

SET OSGEO4W_ROOT=C:\Program Files\QGIS 3.4

call "C:\Program Files\QGIS 3.4\bin\o4w_env.bat"
call "C:\Program Files\QGIS 3.4\bin\qt5_env.bat"
call "C:\Program Files\QGIS 3.4\bin\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis
set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%PYTHONPATH%

python C:\temp\test.py
pause

My python script is:

import sys
from qgis.core import *

# Initialize QGIS Application
QgsApplication.setPrefixPath("C:\Program Files\QGIS 3.4\apps\qgis", True)
app = QgsApplication([], True)
QgsApplication.initQgis()

# Add the path to Processing framework
sys.path.append('C:\Program Files\QGIS 3.4\apps\qgis\python\plugins')

# Import and initialize Processing framework
from processing.core.Processing import Processing
Processing.initialize()
import processing

print('Hello QGIS!')

Currently this code fails with the following message:

If I remove the importing of the processing framework section of the py script then 'Hello QGIS!' is printed in the batch window but the GUI does not launch.

Where am I going wrong?


texts: Leaflet vs Openlayers vs Geoserver for overlapping polygons application

texts:
I have 3 layers of vector polygons(about 80 polygons - 1MB geojson each but I haven't simplified any yet) displaying school territories (kindergardens, primary and secondary education) and I want to produce a web map so that the user would know in which school his/her children "belong":
The plan is:

I enter my address
A marker on the address is created
A radius of 10 meters is created around the marker
The map highlights the polygons in which my address (marker with radius of 10 meters) lies in or are near (20 meters) to the point
I am informed about the name of each of the polygons my address(marker with radius of 10 meters) falls in.

The polygons may sometimes be more than 3 because some territories overlap another.

Can I implement all this tasks by using a client-side library (leaflet, openlayers)
or should I implement this project by using server-side geoserver?

Would I be able to create the radius around the marker point?
Would I be able to manage the overlapped polygons so that all of them are selected when a point lies within them and not just the top one?

Any ideas to help me start?


texts: Isolating only few polygon parts for editing in shapefile with many polygons in QGIS?

texts:
I have a Shapefile layer with thousands of polygons.

I want to edit the vertices of just a few, but when I select them to try to modify them it becomes very slow. How can I isolate those few to make this work faster?

Here`s an image to make it easier to explain.

These two blue polygons belong to the same field/category. I need to edit them to unite them, the problem is that in my actual Shapefile they aren`t just two polygons but thousands belonging to the same Field and as I mention Qgis becomes really slow.

How can I cut just the red square area (image), edit it in a separate shapefile (unite them) then bring it back to the actual Shapefile.


texts: Getting FeatureCollection id in Google Earth Engine

texts: How can I get the 'id' field shown when I print a FeatureCollection in Google Earth Engine? I tried get('id') or get('system:index') but it didn't work (returns null).


texts: Where can I find a shapefile of the US boundaries from the 1780s, including the original thirteen state boundaries?


texts:
I'm trying to update a lat and lon columns each time I insert a point with a trigger, but I don't know why I get an error. This is the syntax I'm writing:

CREATE OR REPLACE FUNCTION update_tg2()
RETURNS trigger AS
$$
BEGIN
update places set new.lat  = new.st_y(geo::geometry);
RETURN NEW;
END;
$$
LANGUAGE 'plpgsql';

DROP TRIGGER IF EXISTS triger_coords2 on places;
create trigger triger_coords2 after insert or update on places
for each row execute procedure update_tg2();

And when insert:
insert into places (id, nombre, geo) values
(18, 'my place', ST_GeomFromText('POINT(-0.42154 38.38000)', 4326))

I'm getting the error:

ERROR:  column "geo" does not exist
LINE 1: SELECT new.st_y(geo::geometry)

Of course, the column exists. If I select st_y(geo::geometry) from places, I can see its Y coord.

Does anyone know what could be failing?

I'm quite new with functions.


texts: How to get polyline latitude and longitude by click on polyline android?

texts:
I have set Polyline click listener like this :

map.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() {
        public void onPolylineClick(Polyline polyline) {
            int strokeColor = polyline.getColor() ^ 0x0000CC00;
            polyline.setColor(strokeColor);
            Log.e("TAG", "Polyline points @ " + polyline.getPoints());
            Toast.makeText(Draw_Route.this, "Polyline klick: " + polyline.getPoints(), Toast.LENGTH_LONG).show();
        }
    });

But i need to get coordinates of that point when user click on polyline, i also used this code to get the codrinates -- >

map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
        @Override
        public void onMapClick(LatLng clickCoords) {
            Log.e("TAG", "Found @ " + clickCoords.latitude + " " + clickCoords.longitude);
        }
    });

But it only works when i click on map, i need to get that point coordinates on click on polyline so please help me, how to get that.


texts: Calculating azimuth angle from two X,Y,Z points

texts:
I'm following @whuber's post for calculating azimuth and elevation angles based on two vector3's. The elevation equation works great and gives me numbers that makes sense. I'm running into issues with the azimuth equation though and its way above my head on how it fully works. My end goal is to calculate az/el angles from a point on earth to a satellite. Also, while this post includes JavaScript, I'm not looking for coding help but how to solve the problem mathematically.
Calculating View Angle?
I've created this little 3D simulation for calculating these to try and wrap my head around it. I'm not looking for a perfect simulation so the fact that the earth is perfectly round is okay. Also the "earth" has a radius of 1 and the satellite a radius of 2 just to make the math simpler.
https://jsfiddle.net/51yerkvu/16/
By changing the longitude slider for either the base station or satellite you can see the El angle properly calculates. As it goes below the horizon, the numbers become negative and directly above its 90°.
The az calculation seems to be correct in some scenarios, but not others. For example, the default position when loading the jsfiddle it calculates an azimuth of -63.43 degrees. Moving its longitude -1° causes it to calculate -90 degrees, and moving +1° causes it to calculate +90 degrees. The azimuth angle should be the same when changing the longitude as its on the same plane as the satellite and is just moving closer or further away. Moving its latitude causes it to calculate really wrong numbers.
Cos(azimuth) = (-z*x*dx - z*y*dy + (x^2+y^2)*dz) / Sqrt((x^2+y^2)(x^2+y^2+z^2)(dx^2+dy^2+dz^2))
Sin(azimuth) = (-y*dx + x*dy) / Sqrt((x^2+y^2)(dx^2+dy^2+dz^2))

By plugging in whubers example points (1285410, -4797210, 3994830) and (1202990, -4824940, 3999870) into my program, I do get roughly the same value as him. He calculated .331 for his azimuth where I'm getting .336. I found this to be a discrepancy in the Cos(azimuth) function providing a slightly different number. I don't think this is the issue though and I've rechecked that I put the expression in correctly a dozen times.
Maybe I'm misunderstanding and this approach and this isn't a good way to calculate azimuth for what I'm trying to do. Elevation works perfect, and I've tried a few other approaches leveraging the 3d library I'm using but haven't been able to get something reliable.
Converting whubers equation to JavaScript I get this:
function calculateAzimuth(p1, p2) {
  const d = p2.clone().sub(p1.clone());

  // Cos(azimuth) = (-z*x*dx - z*y*dy + (x^2+y^2)*dz) / Sqrt((x^2+y^2)(x^2+y^2+z^2)(dx^2+dy^2+dz^2))
  let azCos = (-p1.z*p1.x*d.x - p1.z*p1.y*d.y + (p1.x**2+p1.y**2)*d.z);
  azCos /= Math.sqrt((p1.x**2+p1.y**2) * (p1.x**2+p1.y**2+p1.z**2) * (d.x**2+d.y**2+d.z**2));

  // Sin(azimuth) = (-y*dx + x*dy) / Sqrt((x^2+y^2)(dx^2+dy^2+dz^2))
  let azSin = (-p1.y*d.x + p1.x*d.y);
  azSin /= Math.sqrt((p1.x**2+p1.y**2) * (d.x**2+d.y**2+d.z**2));

  return Math.atan(azCos / azSin);
}

I've checked it over a dozen times to make sure its the same, but I'm hoping I just have an equation error. I'm also open to trying other ways of calculating azimuth, but I would like my solution to be based on positions relative to the earths center.
If I look down the blue axis of the point on the earth and project the satellite onto the same plane, its then just a simple 2D problem. I'm not sure how to go about that mathematically however.


texts: Not Able to Add MPK to Map in ArcGIS .Net Runtime and MVVM

texts:
I am trying to add an MPK to ArcGIS Runtim 10.27 using MVVM pattern and WPF
I am able to see the MPK running on the localhost after running the application but the MPKMap = localMapService.UrlMapService; is not adding the MPK to the map. (And Yes! I already have base map so map is running well but no MPK!)

In my Model.cs I have

public class Model
{
    private string mapPackage = "E:\\App\\Data\\Parcels.mpk";
    public Model()  { }

    public string MapPackage
    {
        get { return this.mapPackage; }
        set
        {
            if (value != this.mapPackage)
            {
                this.mapPackage = value;
            }
        }
    }
}

and in the ViewModel.cs I have

public class ViewModel : INotifyPropertyChanged
{
    public Model myModel { get; set; }

    public event PropertyChangedEventHandler PropertyChanged;

    public ViewModel()
    {
        myModel = new Model();
        this.CreateLocalServiceAndDynamicLayer();
    }

    public async void CreateLocalServiceAndDynamicLayer()
    {

            LocalMapService localMapService = new LocalMapService(this.MPKMap);
            await localMapService.StartAsync();

            MPKMap = localMapService.UrlMapService;
    }

    public string MPKMap
    {
        get { return myModel.MapPackage; }
        set
        {
            this.myModel.MapPackage = value;
            OnPropertyChanged("MPKUri");
        }
    }

    protected void OnPropertyChanged([CallerMemberName] string member = "")
    {
        var eventHandler = PropertyChanged;
        if (eventHandler != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(member));
        }
    }
}

in the MainWindow.xaml I have

<Window.Resources>
    <local:ViewModel x:Key="VM"/>
</Window.Resources>

<Grid>
    <esri:MapView x:Name="MyMapView" Grid.Row="0" LayerLoaded="MyMapView_LayerLoaded" >
        <esri:Map>
            <esri:ArcGISDynamicMapServiceLayer ID="MPK" ServiceUri="{Binding Source={StaticResource VM}, Path=MPKUri}"/>
        </esri:Map>
    </esri:MapView>
</Grid>


texts: Clipping raster-image increases file size

texts:
Working with QGIS 2.4.0 Chugiak I have a question regarding the clipping of raster images. I have an aerial picture that I want to clip using the extents of a shapefile. So far so good, I used the raster/extraction/clipper tool to do this. The problem is that the file size of my output raster is nearly three times larger than the original file (i.e. 725.283 and 249.693 kb respectively), whereas it covers a smaller surface.

Why is my file larger? And is there any way to 'set' the output file size?

The help function of clipper refers to the following page: http://www.gdal.org/gdal_translate.html Though I cannot make much out of it.

I am relatively new to QGIS.


texts: Error in r.thin QGIS GRASS: Input raster must be of type CELL

texts:
I am getting the following error from QGIS GRASS GIS r.thin module

ERROR: Input raster must be of type CELL.

The input file is a simple file of 0 and 1 that represent a drainge network. I obtained it by applying a simple accumulation > value rule to the raster calculator

What can be the problem?


texts:
I would like to know why I see a sort of change in topology after having used ST_Dump.

First, I have done buffers on a table made of polygons.
Second, I have made the difference between my buffers and polygons to get ring
Third, I have done the following test :

SELECT
t1.geom,
t1.idu
FROM ring t1
INNER JOIN polygon t2
ON ST_TOUCHES(t1.geom, t2.geom)
WHERE ST_TOUCHES(t1.geom, t2.geom) IS TRUE AND t1.idu = t2.idu

And the result is correct

Then, I have split my rings with lines after having added the ST_SplitPolygon function (because when I try to use ST_Split it doesn't work although I use Postgis 2.3) :

CREATE TABLE ring_split
AS SELECT geom(ST_Dump(ST_SplitPolygon(t1.geom, t2.geom))) as geom,
t1.idu,
t1.id_ilot
FROM ring t1
INNER JOIN
(SELECT idu, ST_UNION(geom) as geom
FROM lines
GROUP BY idu) as t2
ON t1.idu = t2.idu
WHERE t1.idu = t2.idu

And when I lauch the same test :

SELECT
t1.geom,
t1.idu
FROM ring_split t1
INNER JOIN polygon t2
ON ST_TOUCHES(t1.geom, t2.geom)
WHERE ST_TOUCHES(t1.geom, t2.geom) IS TRUE AND t1.idu = t2.idu

The result is not correct.

On the left, the result of the first test, on the right, the result of the second test

May somebody help me to understand why the result is not the same and how to get all ring_split with the ST_Touches query but without using a buffer ?


texts: Can a mask layer in advanced drawing options be easily reversed?

texts:
I wonder if there is an solution to my crude workaround. I use often use the Advanced Drawing Options to mask items such as line underneath a contour label, etc.

I am continually running into situations where I need to reverse this mask. Instead of masking a line features that intersects several large lakes for example I would like to mask the portion of that line feature that does not cross intersect those lakes: a reverse mask.

The crude workaround is to create a large polygon feature and clip all the "lakes" out then use this feature as the Masking layer. It works but it is not easily maintained especially when the "masked" feature changes.

Example: I have a map of a province with shaded relief and 20 layers of various spatial information. I have a polygon of an area of interest (AOI) and I need to show all spatial information within the AOI but only basic information outside this AOI (i.e. shaded relief, hydrology). If I create a layer that contains the province polygon with the AOI clipped out, i can use it as a Mask in the Advanced drawing options. This creates redundant data and extra work. Is there a better workaround?


texts: Representing multiple work visits to same location in ArcMap?

texts:
How can I get ArcMap to summarize and display multiple feature
records for the same address location?


texts: Maximize CPU and memory usage when using gdalwarp

texts:
I'm using gdalwarp to clip and warp a large (but not huge) GeoTIFF (6.2 GB total size). The GDAL command I am using is:
gdalwarp --config GDAL_CACHEMAX 80% -wm 80% -multi -wo NUM_THREADS=ALL_CPUS -t_srs "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0" -tr 10 10 -r bilinear -cutline [datasource] -cwhere [expression] -crop_to_cutline -cblend 100 [srcfile] [dstfile]
I want to make sure I'm fully utilizing all available resources so this goes as fast as possible (hence the --config GDAL_CACHEMAX 80% -wm 80% -multi -wo NUM_THREADS=ALL_CPUS flags). However, when my CPU usage never goes above 100% (i.e.  that is only 1 of 8 cores is being used) and memory usage is < 1 GB. Is there any way I can speed up this process?


texts: Is the filename of a shapefile the same as its Feature Class name?

texts:
This is a very basic question, but I'm not finding the answer on Google or here...

I have a bundle of files I have to submit in an incredibly specific format.  Our sub-consultants gave us a set of shapefiles, but the shapefiles have a different file name than the required feature class.  All the required attributes are correct.

For example, they named the file "boundary.shp" (plus all of it's accompanying files) whereas the feature class needs to be named "gis_boundary_limit".

Can you have the feature class name be different than the shape file name?  If I just rename the files have I renamed the feature classes?  Is there a way in ArcMap to rename a feature class within a shapefile?

Forgive how basic this question is, I had been operating on the assumption that shapefiles and feature classes were interchangeable.


texts: How to convert numeric fields into strings with leading zeros?

texts:
I'm trying to define an action in Quantum GIS using on of my fields but I have some problems with its format.

I have a numeric string like '5' and I need to have a format like '005'. I've tried function  "tostring(myfield)" but I am not able to define the format that I want.

Is there any way to do something like tostring(myfield,"000")?

What I'm looking for is a function like this one:
http://office.microsoft.com/en-us/excel-help/text-HP005209313.aspx?CTT=5&origin=HP005204211


texts: Processing post-execution script hook to clear scratch layers?

texts:
I've been cobbling together some Processing scripts for QGIS 2.18 (I'm not a fan of QGIS 3 scripts), and I keep running into one particular problem:  my script creates a lot of scratch layers and they stick around until I reboot QGIS.

Question:  How can I get rid of all the invisible scratch layers after running a script?

For example, running the following:

outputs_SAGACONVERTLINESTOPOINTS_1=processing.runalg('saga:convertlinestopoints',Sampling_line,True,0.2,None)

...creates a point shapefile at C:\Users\Nick\AppData\Local\Temp\processing7a722160fed94f10b2cfe8e4dac9e9f8\18f2cf1c3459481b9d1f75d8e1b04a5b\POINTS.shp , which can be called with outputs_SAGACONVERTLINESTOPOINTS_1['POINTS'] in later lines of the script. The file stays there until I exit and restart QGIS.  I would like to clear out that file (and the rest that my script generates but does not load into the main layer tree) when the script finishes running.

Digging around a bit, it looks like the QGIS manual almost gets me there with pre/post execution hooks: https://docs.qgis.org/2.18/en/docs/training_manual/processing/hooks.html

import os
import shutil
from processing.core.outputs import OutputVector, OutputRaster, OutputFile

MY_DIRECTORY = '/home/alex/outputs'

for output in alg.outputs:
    if isinstance(output, (OutputVector, OutputRaster, OutputFile)):
        dirname = os.path.split(output.value)[0]
        shutil.copytree(dirname, MY_DIRECTORY)

Except that the example does exactly the opposite of what I want. How could that script hook be modified to clear out the junk "ghost layers" (or whatever the correct term is for the layers that are created but not loaded into the Layers Panel) and leave me with a fresh scratch file location before running the next script?

If there's an alternative method for clearing the cached "ghost layers" that's better (and easy for a Python neophyte), I'd be interested in that as well. Any ideas?

Edit (2019-03-10):
Minor progress.  The following works, run from the python console, but not as a post-execution hook:

import glob
import shutil
files = glob.glob('C:\Users\UserName\AppData\Local\Temp\processing*')
for f in files: shutil.rmtree(f)

NOTE: All of the temporary/scratch layers must be removed from the QGIS layer tree for this to work.


texts: Problem with missing tiles in a WMS Service Layer on Leaflet Map

texts:
When we load a WMS service in our Leaflet maps, we encountered tiles that do not show.

You can see this happening on the following Plunker if you zoom in and pan to the left or right.

http://plnkr.co/edit/jPkeP6

I am very interested in finding out where the error lies here. Is it a problem with this specific WMS service or Leaflet?

Note: The WMS Service works in ESRI ArcMap, although it is a bit slow.


texts: Selecting feature by attribute with expression to delete it from same feature class in ModelBuilder?

texts:
I want to create a model in ModelBuilder that contain two processes:

The first  process is to select a feature using an expression.
The second process is to delete the feature selected in first process.

I want to do both processes within the same feature Class, so I cannot use the Select (Analysis) tool because that gives me a new feature class as output.

I am using ArcGIS 10.2 for Desktop.

I found the Select Layer By Attributes tool but it does not accept feature class format, and I do not have any other format except feature class.


texts: How to Retrieve X and Y from a papermap or gif picture

texts:
Goal:
Visualize a subway map in SQL server 2012 spatial data based on the map of the subway.
The map shall use geometry, traffic rail road as line object, station as point object and zon as polygon object.

Problem:
In order to display the map, I need retrieve X, Y  coordinate (cartesian coordinate system) and display it in the SQL server spatial data.

The question is:
How should I get X and Y coordination in every object from the map when you have the map as a paperwork or gif picture?

I have a feeling that I need a special application having cartesian coordinate system for the map. In the application (maybe same application as CAD) you have the map as a background and then you use the cursor to retrieve X and Y coordinate for every object. Then you have the data so you can use SQL server to picturize a map with data.
Maybe you have another solution.

Other Info
*Please take account that I do not want to use geography data.

*The X and Y data retrieve from the special application shall be enable to use in SQL server. In other word, same cartesian coordinate system.

*The Spatial reference system shall not be used.


texts: Georeferencing multiple images (100 or more) of same region in QGIS?

texts:
I'm trying to georeference multiple satellite images of the same region over the course of a few years and get a separate output for each georeferenced image (a .tif file).

How can I achieve this in QGIS?

Is there a script that I can run?


texts: I have my map code in openlayers JS. My input data is in a text file and I am able to render the points on the map. I have to give the user a right to create a layer by entering the data in a form. Writing a program to insert data into a text file is trivial. But I am stuck at how to include this layers code in the JS programmatically so that after giving the layers details in the form if the user reloads the page then the new layer should be visible, Any solutions??


texts: Concatenating strings from lists in calculated field

texts:
I'm trying to calculate a field with concatenated strings from zipped lists but I'm having issues with syntax.

MyList1 = ['Orange', 'Red']
MyList2 = ['Purple', 'Green']

for x, y in zip(MyList1, MyList2):
    ...##Other code working with x, y
    arcpy.CalculateField_management(InputLyr, "ColorConcat", "Color: {} and Color: {}".format(x, y), "PYTHON_9.3")
    ...##More code working with x, y

I'm hoping to get my output, calculated, field to look like this:

|          ColorConcat            |
|---------------------------------|
| Color: Orange and Color: Purple |
|  Color: Red and Color: Green    |

The only other thing I've tried is using codeblocks, but I don't think that the codeblock will return x and y because they're not global variables. I've also tried simply using + to concatenate but I returned the same syntax error.

arcpy.CalculateField_management(InputLyr, "ColorConcat", "Color: " + x + " and Color: " + y, "PYTHON_9.3")


texts:
I'm looking into the possibility of creating an all-in-one portable report derived from data compiled in GIS. This would contain a campus map with point data which, when clicked, would take the user to the relevant entry in a table and ideally have an option to open an image.

A software package might be an option. I'm aware of TerraGo (far too expensive) and InstantAtlas (a bit too expensive probably and uses ArcMap) - both of these offer more than I need.  I use QGIS on Linux, but can use Windows 7.  Some of the related answers on StackExchange are ArcMap-based & my future is not with this.

I wondered about HTML/web tech. Not sure if this can be done as a single file or some other unbreakable setup. Webmapping etc is not an option and I can't see sending the data with a free GIS viewer working, as it needs to be reasonably end user proof.

Can anyone advise any packages to look at, or how (conceptually- I can learn the nuts & bolts) I might achieve this with any of the options above, or anything else?


texts: Blanking out Wales and Scotland and certain local authorities from map of Local authorities in UK?

texts:
I have used a shapefile I've downloaded from ONS for the UK's local authorities. However, I am only interested in certain local authorities in England and want to blank out Scotland and Wales.

How can I do this?


texts: What is the difference between MapBox and CartoDB ?


texts: What resources are there for PostGIS maintenance?

texts:
I am recommending the usage of a Postgres+PostGIS database to a client for storage of their Geospatial Data. I need to recommend the processes for maintenance of the database.

The Client is an Oracle user, so they are used to constant active maintenance of databases.

My personal experience of PostGIS has only been on small to medium databases, and they have been very low maintenance, requiring vacuuming once in a few months.

Where can I read about maintenance of Postgres+PostGIS databases?


texts:
I work with QGIS 2.18. I have a polygon shapefile with two atrributes: id (unique for each polygon) and type.

I visualize the shapefile using the "type" attribute, but I would like to add a nested rule or category using the "id". When I try to do that, for each type, all the available ids are added when, what I want is to add only the ids that correspond to the type I am modifying.

For example, if I have

"id" "type"
  0  forest
  1  road
  2  road
  3  river
  4  forest
  5  building
  6  river

I would like to have:

One category for 'forest' with the nested values of "id" 0 and 4
One category for 'road' with the nested values of "id" 1 and 2
One category for 'river' with the nested values of "id" 3 and 6
One category for 'building' with the nested values of "id" 5

For 6 features it is simple, but I have 200 hundreds of them.

The goal is to keep the visualization by type and to be able to hide/show the features that I am interested in.

I know I can use the filter option, but when the filter is active I loose the ability to edit the file. I could also split the file using the "type attribute" but I would like to avoid doing that and to keep everything in one file.

Is there a way to do that?


texts:
I had made an Android app which send current Latitude and Longitude of user to my server continuously, on the server I calculate 5 KM in circular way of user location to find the nearest known points if it's in the range of user location.
For example: there are 3 point(point A, point B, point C) in range 5 KM of user location, how to know probability of user move into point A or point B or point C?
In conclusion, I have user location (lat and long) + destination location(lat and long) +  the points in range of 5 KM of user location.
How to find probability of user move through points (A or B or C) to reach the destination?


texts:
Input raster map is flipped or rotated - cannot import. You may use 'gdalwarp' to transform the map to North-up.
Finished with error.

The above lines are the error message that i get when trying to import a raster imahe in GRASS that has been uploaded in QGIS version 3.12


texts: PostGIS Out of DB raster Configuration fails to register a raster

texts:
I have been trying to get my postgis enabled postgres database to register raster data in out of db and it is not working. All I get is a distorted image shown below:

If i use raster2pgsql to keep the raster data in the database everything works. I'm on windows 7, have qgis 2.8.4 installed and OSGEO4W, postgis 2.1 and postgres 9.3.5. According to the install notes I have to set some environment variables in windows to enable the out-of-db option and I've done that (POSTGIS_ENABLE_OUTDB_RASTERS and POSTGIS_GDAL_ENABLED_DRIVERS). Everything inside the database columns seems to be in order.

Anyone has any suggestions on what to try next?

Installed all the required software on a new machine. The problem still persists. Next I will try to go to the latest version of postGIS and test if the issue is still there.


texts: Crop raster in memory with python GDAL bindings

texts:
I have a bunch of rasters I need to crop to a bounding box, perform come calculations with, and then close; I have no need to keep the cropped raster.

So far I've only been able to crop using gdal.Warp(dest_file, src_object, bbox), which creates the unwanted dest_file.

I'd like dest_file to point to an empty gdal object, but can not figure out how to initialize one.
I've created one in memory using:

mem_drv = gdal.GetDriverByName('MEM')
dest = mem_drv.Create('', rast.RasterXSize, rast.RasterYSize, 1, gdal.GDT_Float32)
dest.SetProjection(rast.GetProjection())
dest.SetGeoTransform(rast.GetTGeoTransform())

where rast is an raster opened with gdal.Open

This lets me store the output of gdal.Warp in memory but it does not crop it; I'm assuming because the width is hard coded in the creation routine.

What is the best way to store the cropped image in memory?

Should I just get the pixel spacing from the original raster and initialize the size of dest using this?


texts: GeoServer 2.13.3 - 2.15.0 ImageMosaic blank transparent spaces with overlapping images

texts:
I'm migrating from JDK1.7/Geoserver2.8.3 to OpenJDK11/GeoServer2.15.0, and have issues with ImageMosiac layers. No matter how I configure it, take from old Geoserver, upload by interface or configure by REST, it always show blank spaces where one tranaparency overlaps on other tiff's values. When I enable jaiext (shouldn't it be enabled by default according to documentation?) nothing helps, it is even worse, some grey boxes show up (they change depending on zoom level...).

Tried dozens of combinations of parameters, clean install, with enabled or disabled JAIEXT, sisabled BandSelect operation, etc, and nothing seems to work.

Clean install of Geoserver 2.8.3 with Java 7 shows it ok (attached).

UPDATE:
Installed several versions of Geoserver 2.11.x - 2.15.x, it turns out that the presentation of my ImageMosaic changed from 2.13.2 (works fine) to 2.13.3 (shows transparent spaces). Both 2.13.2 and 2.13.3 installed in same environment - Oracle JAVA 8.

Any ideas?

Attaching some results and sample files (EPSG:2178):

https://filebin.net/m9l299g8mndmmcvz

geoserver 2.8.3-2.13.2 clean install shows ok:

geoserver 2.13.3-2.15.0 jaiext disabled preview - blank spaces

same as above but on map

geoserver 2.13.3-2.15 jaiext enabled preview

geoserver 2.13.3-2.15 jaiext enabled, other zoom level preview

geoserver 2.13.3-2.15 jaiext enabled on map


texts: I've gotten a state file with count outlines joined to an attribute file that shows numbers of items per county. ArcGIS has the ability to set the symbology to grade the results into pre-determined results, such as 0-10, 11-20 and so forth. Can QGIS do this without having to go through the tedious advanced query of getting all the 0-10, 11-19, 20-29 and create them into separate v-layers. It would seem that a one stop progression that would be set up in symbology or somewhere else would be more useful.


texts: Listening for edit events through dockable window using ArcObjects?

texts:
I am creating a dockable window that allows users to select features of a particular featureclass, iterate through records in the featureclass, populate textboxes with certain attributes, and edit existing records.  I am trying to keep everything within the scope of edit session.

A problem I am having is listening to editor events (edit session start/stop, selection change).  I've wired up the event handlers in the Load event of the Dockable Window (DockWin) using the code below (Disclaimer, I'm an ArcObjects beginner):

Dim m_Editor As IEditor3
Dim m_EditEvents As IEditEvents_Event

Public Sub New(ByVal hook As Object)

    ' This call is required by the Windows Form Designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    Me.Hook = hook

    '--Get the editor extension.
    Dim editorUID As UID
    editorUID = New UID
    editorUID.Value = "esriEditor.Editor"
    m_Editor = (My.ArcMap.Application.FindExtensionByCLSID(editorUID))

End Sub
Private Sub DockWin_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    m_EditEvents = CType(m_Editor, IEditEvents_Event)
    AddHandler m_EditEvents.OnSelectionChanged, AddressOf OnSelectionChanged_Handler
    AddHandler m_EditEvents.OnStartEditing, AddressOf OnStartEditing_Handler
    AddHandler m_EditEvents.OnStopEditing, AddressOf OnStopEditing_Handler
End Sub

Private Sub OnSelectionChanged_Handler()
    MessageBox.Show("Selection Changed")
End Sub

Private Sub OnStartEditing_Handler()
    MessageBox.Show("Editing Started")
End Sub

Private Sub OnStopEditing_Handler()
    MessageBox.Show("Editing Stopped")
End Sub

None of my MessageBoxes pop up, telling me it's not wired correctly.  Is there anything apparently wrong with my approach? Or is there another more suitable one?

I've see that there are numerous types of selections in ArcObjects.  Perhaps another is more suitable?

I've seen where others have had problems with IActiveViewEvents and dockable windows, here and here, so I wonder if anyone has experience with IEditEvents and dockable windows.


texts: Calculate the area of NDVI values above 0.2 in Google Earth Engine

texts:
I am new to GEE and Javascript. I was looking for a solution to calculate the area of NDVI values above 0.2 from the years 1989 and 2018, and quantify vegetation loss. Is this possible? I have pasted the codes below. https://code.earthengine.google.com/48b9e089abdb51354c45333c7ea8b0f2
var MMR =
/* color: #d63000 */
/* displayProperties: [
{
"type": "rectangle"}
] */
ee.Geometry.Polygon(
[[[112.21780240632957, 30.2114140665558],
  [112.21780240632957, 29.295784619630325],
  [113.23403775789207, 29.295784619630325],
  [113.23403775789207, 30.2114140665558]]], null, false);
// Load 1989 and 2010 Landsat5 annual composites.
var image1989 = ee.ImageCollection("LANDSAT/LT05/C01/T1").filterDate('1989-01-01','1989-12-31')
.filterBounds(MMR)
.median()
.clip(MMR);

var image2010 = ee.ImageCollection("LANDSAT/LT05/C01/T1").filterDate('2010-01-01','2010-12-31')
.filterBounds(MMR)
.median()
.clip(MMR);

// Compute NDVI the easy way.
var ndvi1989 = image1989.normalizedDifference(['B4', 'B3']);
var ndvi2010 = image2010.normalizedDifference(['B4', 'B3']);

// Compute the multi-band difference image.
var diff = ndvi1989.subtract(ndvi2010);

var NDVI_Palette = '00FF00, FFFF00, 000000';
Map.addLayer(ndvi1989.gte(0.2), {min: -0.3, max: 0.4, palette: NDVI_Palette}, "NDVI 1989");
Map.addLayer(ndvi2010.gte(0.2), {min: -0.3, max: 0.4, palette: NDVI_Palette}, "NDVI 2010");
Map.addLayer(diff, {min: -0.3, max: 0.4, palette: NDVI_Palette}, "Difference NDVI", false);
Map.centerObject(MMR, 9);


texts:
I am attempting to follow Anita Grazer's post on creating alpha shapes in pgRouting.

My query:

CREATE TABLE home_isodist (id serial, max_cost double precision);
SELECT addgeometrycolumn('home_isodist','geom',4326,'POLYGON',2);

INSERT INTO home_isodist (max_cost, geom) (
SELECT 1.5, ST_SetSRID(geom_way,4326)
FROM
pgr_alphashape('SELECT id, ST_X(geom_way) AS x, ST_Y(geom_way) AS y FROM home_catchment5km WHERE cost < 1.5'));

I am getting the following error code:

ERROR:  column "geom_way" does not exist
LINE 5: SELECT 1.5, ST_SetSRID(geom_way,4326)


texts:
I have downloaded r.mcda.electre addon from the following link:

https://wingrass.fsv.cvut.cz/grass71/x86_64/addons/grass-7.1.svn/r.mcda.electre.zip

But I can not install it with the latest version of GRASS 7.3. When I click on the exe file I get the following message:

---------------------------
r.mcda.electre.exe - System Error
---------------------------
The program can't start because libgrass_gis.7.3.svn.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK
---------------------------

I even tried to install the addon from the Grass GUI but I get the following message in GRASS 6.4.3:

ERROR: GRASS Addons <r.mcda.electre> not found

In GRASS 7.3 I get this error message:

Downloading precompiled GRASS Addons <r.mcda.electre>... Traceback (most recent call last):   File "C:\Program Files\GRASS GIS
7.3.svn/scripts/g.extension.py", line 1729, in <module>
    sys.exit(main())   File "C:\Program Files\GRASS GIS
7.3.svn/scripts/g.extension.py", line 1708, in main
    install_extension(source=source, url=url, xmlurl=xmlurl)   File "C:\Program Files\GRASS GIS
7.3.svn/scripts/g.extension.py", line 679, in install_extension
    ret += install_extension_win(module)   File "C:\Program Files\GRASS GIS
7.3.svn/scripts/g.extension.py", line 952, in install_extension_win
    outdev=outdev, directory=srcdir, tmpdir=TMPDIR)   File "C:\Program Files\GRASS GIS
7.3.svn/scripts/g.extension.py", line 1093, in download_source_code
    f, h = urlretrieve(url, zip_name)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\urllib.py", line 94, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\urllib.py", line 240, in retrieve
    fp = self.open(url, data)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\urllib.py", line 208, in open
    return getattr(self, name)(url)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\urllib.py", line 345, in open_http
    h.endheaders(data)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\httplib.py", line 969, in endheaders
    self._send_output(message_body)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\httplib.py", line 829, in _send_output
    self.send(msg)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\httplib.py", line 791, in send
    self.connect()   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\httplib.py", line 772, in connect
    self.timeout, self.source_address)   File "C:\Program Files\GRASS GIS
7.3.svn\Python27\lib\socket.py", line 571, in create_connection
    raise err IOError: [Errno socket error] [Errno 10061] No connection could be made because the target machine actively refused it (Sat Jun 04 09:05:16 2016) Command finished (1 sec)

This is my first experience with Grass.


texts: How can I determine when a Bing map waypoint is going to overlap an existing one, and give the original waypoint a “badge-like” update?

texts:
I want to be able to determine when a Bing map waypoint that I want to add is going to overlap an existing one, so that, rather than bunching them all up in one spot like a litter of kittens on a catnip plant, I can instead alter the text/"badge" of the existing waypoint marker so that it displays an indication that it has been "reached" N times.

For example, in showing where a person was, and marking the waypoint with a sequential number, I may want to update the text on the waypoint marker from "1" to "1,2" and then "1-3" or possibly just "1+" as there won't be enough room to display something like "1,7,42" etc.


texts: Return symbols for geometries from Dynamic Service Layer?

texts:
I'm using the ESRI Silverlight API and I've got a question regarding tasks such as identifies and queries that return geometry from a Dynamic Service Layer. These tasks return graphic geometry but no symbol, so in order to display that graphic in another GraphicsLayer, I have to have a symbol setup client side and then assign that symbol to the graphic. What I'm wondering is if there is any way to not only pull back the geometry from the Dynamic Service, but also pull back symbols?

The only approach I've been able to come up with is to access the FeatureLayer via the REST endpoint and pull back it's renderer to assign it to my GraphicsLayer. This works, but limits me to only the symbols specified in the Dynamic layer (I can't use a single graphics layer for results from multiple Feature Layers). This also seems fairly complicated to get to where I'm wanting to be.

I'm thinking there might not be any way to do this, but wanted to ask and see if anyone has any ideas. Thanks!


texts: How to read shapefile of road segments into Python data structure to get begin and end point coordinates?

texts:
How can I take a shapefile that has road segments and read it into a data structure in Python that I can use to get begin and end points with?

For example x, y to x2, y2.

It's not a large shapefile, just a one with roads for my county. I've previously worked with argisscripting at ArcGIS 9.3 but that was a couple years ago and now I'm rusty and using ArcGIS 10.1.

Any and all help is appreciated.

import arcpy

infc = "C:\\Users\\Jeff\\Downloads\\tl_2013_30063_edges\\tl_2013_30063_edges.shp"

for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
    # Print the current line ID

    print("Feature {0}:".format(row[0]))

    #Set start point
    startpt = row[1].firstPoint

    #Set Start coordinates
    startx = startpt.X
    starty = startpt.Y

    #Set end point
    endpt = row[1].lastPoint

    #Set End coordinates
    endx = endpt.X
    endy = endpt.Y

This is what one of the features looks like.

FID 16992

Shape   Polyline

STATEFP 30

COUNTYFP    063

TLID    205238472

TFIDL   217915003

TFIDR   217914215

MTFCC   S1400

FULLNAME    S 9th St W


texts: how can I increase the zoom level in QGIS for OpenStreetMap (OSM) data? I am new to GIS therefore I may have the terminology wrong. I have added an OSM layer using the OpenLayers plugin. Everything is working fine except once I zoom in too much, the layer disappears. I need to be able to zoom very close. How can I achieve this? I have tried importing shapefiles instead and it does let me zoom in however, it does not look the same as the openstreetmaps.com website. Is there a way to basically copy this data and be able to zoom in very close and have the same style (meaning the colors, width of roads, buildings, etc.)? 1:1 scale would be great!


texts: How to fix Raster Dataset with numbers in Extent that look like latitude/longuitude but say metres?

texts:
In ArcGIS for Desktop 10.1, the Spatial Reference of my Raster Dataset reports that its units are metres (well meters) but the values look like decimal degrees e.g. -33 degrees is highly plausible but not -33 metres.

How can ArcGIS for Desktop be "told" that these numbers are degrees of latitude and longitude, rather than values in metres?


texts: What is the easiest way to create a trip distribution matrix in QGIS? I've counted my pickup points in each polygon and drop-off points in each polygon but I can't seem to find a way to link them (as you do when making a trip distribution matrix).


texts: Selecting Duplicate values in ArcMap attribute table

texts:
I am getting query errors while attempting to create a new selection (from a shapefile) by find duplicate values. My query is: "GBIN" In (SELECT "GBIN FROM Ward_10 GROUP BY "GBIN" HAVING Count(*)>1)
and the error is : An Invalid SQL Statement was used.


texts: QGIS - how to retrieve information on features during editing

texts:
I am developing a QGIS plugin that allows me to draw QgsPoints on a vector layer. When drawing, I toggle QGIS's edit mode.
In some cases, the last drawn point needs to be deleted. In order to do this, I need to retrieve the feature id of the last drawn feature while the edit mode is toggled.

Unhappily, I am unable to do so. I've been searching for a solution and found nothing so far :

I can iterate on the layer features, but the features
coordinates are empty as long as edit mode is toggled.
I can connect
to the adding features signal, but again, the signal is sent only
when the edit mode is deactivated.

In order to draw, I've developed a FeatureDrawingPoint class, inheriting from QgsMapTool. I draw on a QgsRubberBand that does not give me any access to the ID of the feature I'm drawing.

Any ideas?


texts: Error while importing arcpy in shell of 64bit geoprocessing arcgis ! python window crashes

texts:
I am using arcgis 10.5 on windows 10.

I am getting this error after importing arcpy in shell of 64 bit geoprocessing.

i have done a clean installation of arcgis and 64 bit geoprocessing but i am always getting this error.

can anybody please help me.

here is the text of my sys paths

    >>> import sys
    >>> print(sys.path)
    ['', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.5\\arcpy',
    'C:\\Python27\\ArcGISx6410.5\\ C:\\Python27\\ArcGISx6410.5\\Lib',
    'C:\\Python27\\ArcGISx6410.5\\ C:\\Python27\\ArcGISx6410.5\\DLLs',
    'C:\\Python27\\ArcGISx6410.5\\ C:\\Python27\\ArcGISx6410.5\\Lib\\lib-
    tk', 'C:\\Python27\\ArcGISx6410.5\\ C:\\WINDOWS\\system32',
    'C:\\WINDOWS\\SYSTEM32\\python27.zip',
    'C:\\Python27\\ArcGISx6410.5\\DLLs', 'C:\\Python27\\ArcGISx6410.5\\lib',
    'C:\\Python27\\ArcGISx6410.5\\lib\\plat-win',
    'C:\\Python27\\ArcGISx6410.5\\lib\\lib-tk',
    'C:\\Python27\\ArcGISx6410.5', 'C:\\Python27\\ArcGISx6410.5\\lib\\site-
    packages', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.5\\bin64',
    'C:\\Program Files (x86)\\ArcGIS\\Desktop10.5\\ArcToolBox\\Scripts']

I type this command in my shell

    >>>import arcpy

and the shell hangs and gives this result


texts: ogr2ogr difference between -append and -update

texts:
I wonder what's the difference between the ogr2ogr parameters -append and -update.

It seems that they both are used to prevent ogr2ogr from creating a new layer:

-append: Append to existing layer instead of creating a new one
-update: Open existing output datasource in update mode rather than trying to create a new one

There also seems to be a difference between running ogr2ogr on windows and on linux. I use "ogr2ogr -skipfailures -append" to fill some existing oracle tables with data. both ogr2ogr versions are 1.11( Windows 1.11.1 Linux GDAL 1.11.5). On windows the tables are filled with data, on linux there is just an error that the table already exist and no data is inserted.


texts: Power BI maps: something in between ArcGIS Maps and Shape Maps

texts:
I'm trying to create a colored heat map on some polygons (originally a .kmz file that I converted to TopoJSON - .json with mapshaper.org) and overlay on them a few coordinate points.

I tried first with ArcGis: I used Longitude and Latitude to visualize the location of certain objects and then I overlapped a layer I found online on ArcGis (that's the same I would like to use). The problem is that I cannot color the polygons in this layer and it seems not possible (https://community.powerbi.com/t5/Desktop/ArcGIS-geographic-ID-mapped-onto-a-polygon-layer/m-p/339432). I cannot even upload the data on ArcGis because the data are private company data.

Then I tried with Shape Map: I uploaded the TopoJson and colored them with the data I had associated with these zones, but I cannot find a way to display the objects with coordinates on top of them.

Do you have any suggestion on what can I do? or is it an impossible task at the moment?
I can show here the results (the dots with the coordinates are in the center of the image on the left):

Here there are some mock up data and the PBI file I created: https://drive.google.com/open?id=1rloRkCdi0-M-4ljPdOU9cxg_KpcU5GnT

Pay attention to data format: I converted some of them during the import.


texts: Logarithmic Relationship for Chart in Google Earth Engine?

texts:
In the below code, how can I compute logarithmic trendlines? Google Earth Engine just computes linear, exponential and polynomial automatically. In other words I need slope and offset values in logarithmic relationship between two variables(data1 and data2).
code link: https://code.earthengine.google.com/3529165c811530af1169747d68983ffa
var data1 = ee.List([1,2,3,4]);
var data2 = ee.List([10,100,1000,10000]);

var data1Array = ee.Array(data1);
var data2Array = ee.Array(data2);

var log_chart = ui.Chart.array.values(data1Array,0,data2Array).setOptions({
      title: 'logarithmic Curve',
      curveType: 'function',
      pointSize: 3,
      trendlines: { 0: {
          type: 'linear',   //exponential, linear, polynomial
          color: 'red',
          lineWidth: 3,
          opacity: 10,
          showR2: true,
          visibleInLegend: true
      }}
});

print(log_chart);


texts: How to close/remove QGIS welcome page (recent projects) for plugins?

texts:
I have a python plugin that completely overwrites the GUI in QGIS. Now I'm trying to upgrade from the previous LTS version to 2.14, but the new feature (Recent Projects) shines through as displayed in the picture:

I tried all the answers mentioned here but none of them work. It looks like once I have the setting

[UI]
Customization\enabled=true

in my QGIS2.ini, then I can't get rid of the Recent Projects. Without UI customization this line here

projOpenAtLaunch=3

works and the Recent Projects is gone, but then I get the regular icons on top of everything and things look like this:

Any ideas how to solve it? Of course I could just add a non-transparent background to all my Qwidgets, but would prefer a solution that doesn't involve editing every UI file in Qt 4 Designer and then recompiling them.


texts:
Does anyone know if it's possible to:

make a hillshade,
render it with blender
go to Photoshop and place a layer on
top of it [like a tint, color bands,
or terrain data]

and then render it once more, in Blender?
something like this:


texts: Attaching picture to email link inside ArcGIS Online PopUp

texts: I am using collector to gather data and attach images to that data using the camera function within the collector app. After collecting the feature, the user will then click on the feature to show the popUp (either in collector or on the web app on the PC). I configured the PopUp to have a link that opens the users email. Included in the email is a standardized summary of the attributes that were collected on that particular feature. I am looking for a way to attach the image that was captured during collection to the email. I'm assuming a link to the picture may not work because it resides on ESRI's secure cloud. Below is a screen shot of the Email To link in the configure attributes. Also in the popUp is the test image I am trying to attach. Any help would be amazing, as i assume there are others out there wondering the same thing.


texts: How to download only selected attributes using Overpass turbo?

texts: does anyone know of a query to download select attributes using Overpass turbo? I am trying to download very granular road dataset for an entire country, but I only want a few columns. Thanks!


texts:
I have shapes with attribute BLUE. I have shapes with attribute ORANGE.

The attribute table has two entries - BLUE, ORANGE - even though there are more isolated shapes ( islands in fact).

I wish to find the centroid  of the dominant (largest by area) shape BLUE and the centroid of the dominant shape ORANGE. Red DOTS in image.

I suspect there must be a way to ignore the non-dominant island shapes and then find centroid of dominate shape.

The purpose is that I want to determine LAT-LONG of the centre of shape in order to place Capital name there.


texts:
I have designed a Model to assess flood vulnerability using ModelBuilder and some python scripts. The Model has overall 56 stages of process.
My problem is that when a user clicks on the model from the ArcToolbox, it takes a while to load the Dialog box.
Moreover, whenever the user clicks on a input box (in the dialog box) to define the path of the input source file, it takes a while to load the path!
The model runs without any noticeable delay or slow process and the SLOWNESS is only attributed to the first load of the model and defining the inputs.
What can I do to fasten the loading processes?
The model is fully offline (i.e. all files are on local drives) and uses the following tools:
Extract By Mask, Raster Calculator, Slope, Multiple ring buffer, Int, Raster to polygon, Update, Polygon to raster, Clip, Update, Select, Copy features, Add geometry attributes, Add field, Calculate field, , Add field, Calculate Field + 2 python scripts and a branching tool
updates:


texts: How to create arc from points using JTS library?

texts:
I have start point , end point , center point, angle, radius of arc.
I want to create a arc from these data.
I tried to Use JTS library to create arc.
but when I checked its source code I am confused about arc creation mechanisum also.
for arc creation JTS required.

GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setSize(10); // radius
gsf.setNumPoints(28); // no of points array required
gsf.setCentre(new Coordinate(43, 144));

LineString lineString = gsf.createArc(?, ??);

I am confused with these 2 parameters that required to pass. how to calculate

I have data as
    start point : 43    145
    end point : 43  144
    arc center point : 43   144
    sweep angle in deg : 60
    radius : 20 nm


texts: Using variable in graphical modeler for raster calculation? (QGIS 3.8)

texts:
I am trying to create a flow in the graphical modeler using a variable in a raster calculation. Is there a way to use a variable directly in the raster calculator (SAGA or GDAL)? I know there was a similar question Number inputs as raster calculator variables in QGIS Modeler some time ago,
however, I cannot get the solution from there to work in the latest QGIS version. Is there an alternative solution?


texts: Database standards for storing and analysing raster

texts:
Vector data stored in a database is covered by OGC's Simple Features and WKT. Databases indeed implement these standards. Some databases such as Oracle, PostGIS extend their support to rasters.

Is there an equivalent to WKT and Simple Features for rasters?


texts: If Geographic Coordinates are unprojected coordinates, how can GIS softwares display such unprojected data on a plane?

texts: I have been using ArcGIS and QGIS regularly for about 2 years now, and just recently I was struck by this new thought. If a data set in say, in ArcMap, has been georeferrenced with a Geographic Coordinate System (which is the representation in the Earth´s surface), and is hence not projected, how can ArcMap display such data set on a plane (i.e. the screen)?


texts:
I am trying to export a specific layout with python in QGIS3. But I am struggling with the QgsLayoutExport class. How do you use it? How can specify which layout should be exported? This is the code I tried but it's not working. The layout in the brackets is the layout I want to export.

QgsLayoutExporter(layout).exportToPdf(filepath)


texts: ogr2ogr - Lost projection when converting geojson to MapInfo Tab

texts:
I have the following geojson that I would like to convert to MapInfo tab with ogr2ogr: ogr2ogr -f "MapInfo Tab" output.tab input.geojson

geojson:

{
   "type":"FeatureCollection",
   "crs":{
      "type":"name",
      "properties":{
         "name":"urn:ogc:def:crs:EPSG:3857"
      }
   },
   "features":[
      {
         "type":"Feature",
         "geometry":{
            "type":"LineString",
            "coordinates":[[-7551132, 6293816],[-7560916, 6260489]],
         },
         "properties":{
            "id":36
         }
      }
   ]
}

However, the output MapInfo Tab does not include the projection defined in the geojson.

Using ogrinfo on output.tab: ogrinfo -ro -al output.tab

Layer name: output
Geometry: Line String
Feature Count: 1
Extent: (-7560915.990000, 6260488.995000) - (-7551132.000000, 6293815.995000)
Layer SRS WKT:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563],
            TOWGS84[0,0,0,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1.0]]
id: Integer (0.0)
OGRFeature(output2):1
  id (Integer) = 36
  Style = PEN(w:1px,c:#000000,id:"mapinfo-pen-2,ogr-pen-0")
  LINESTRING (-7551132.0 6293815.995,-7560915.99 6260488.995)


texts:
I have a point type WKT geometry column in a MySQL table storing the location of some stores.

I want to display it on a Leaflet map on my website. I've found plenty of tutorials to doing this on leaflet official website from GeoJSON data.

But I found no precise documentation which clearly explains how to convert WKT to GeoJSON...even if it seems to be a very important part of the process.

Does someone know a good source which fills this gap or can explain to me how to do this in PHP or JavaScript?


texts:
In ArcGIS and QGIS you can add data on your map and it aligns perfectly even when the Coordinate Reference System (CRS) is not set. Both softwares inform the user that the CRS is not set and it should be done.

How the added data can align itself perfectly even if the CRS is not set?

After setting the correct CRS the data stays in exactly the same position and seemingly nothing changes. For me it seems that the CRS is originally correctly set in some unknown way.

Why does the user have to set the CRS manually again in both mentioned softwares, even the software knows the correct CRS already?


texts:
I am trying to change my tile URL in OpenLayers-3.

I made this Fiddle, with the code:

var map;
var icons = [];

var source = new ol.source.OSM();
map = new ol.Map({
    layers: [
    new ol.layer.Tile({source: source}),
    new ol.layer.Vector({
        source: new ol.source.Vector({features:icons})
    })],
    renderer: "canvas",
    target: 'map',
    view: new ol.View2D({
        zoom: 11
    })
});

// Change map source URL dynamically
// This line gives error in console:
// Resource interpreted as Image but transferred with MIME type text/html:
source.setUrl('http://a.tile.openstreetmap.org/');

map.getView().setCenter(transform(5, 52));

function transform(lng, lat) {
    return ol.proj.transform([lng, lat], 'EPSG:4326', 'EPSG:3857');
}

The code breaks on the line:

source.setUrl('http://a.tile.openstreetmap.org/');

It gives a message in the console (Chrome: Ctrl + shift + j):

Resource interpreted as Image but transferred with MIME type text/html:

Any solutions?


texts: The connection was reset deploying geoserver.war in ubuntu

texts:
I have installed Tomcat 7 in Ubuntu and when I try to deploy geoserver.war I receive the error "The connection was reset" in Firefox and "402 Access Denied" in Chromium.

How do I deploy geoserver.war?


texts:
I would like to download 2010 Census Block Data for several towns and I can't seem to find it on American Factfinder.

Is it there? And if not, does anyone know where I could find it?


texts:
I'm pretty novice at Python and I'm trying to employ a search cursor to round a field in a table in ArcGIS.

cursor = arcpy.SearchCursor(table,'', '', 'Distance')

for row in cursor:
    round(cursor, 3)

I'm receiving a "TypeError: a float is required" message.

Does anyone have any suggestions?


texts:
I want to measure the growth of different areas in spatial directions. The same as in this article of M.S.Moeller on page 5 (Figure 5 and 6).

But I don't know how to build such a Wind Rose in QGIS.
Do you have any ideas?!


texts: Batch Extract by Mask, but customize individual output names

texts:
I want to extract by mask (the same mask everytime) on about 500 raster's, but I want to just append the name of every input raster.  So if a raster is titled Landsat_010182 I just want to add _clip to it so that I still know what every image contains.  Is this something I would need to do in python or is there another way to do this?

Edit:

This is the exact code I am trying:

import arcpy
import glob
import os

arcpy.CheckOutExtension('Spatial')

"""folder containing only input rasters and nothing else"""
indir = r'D:\Sheyenne\Atmospherically Corrected Landsat\Practice_bands'

"""absolute path to mask layer"""
mask = r'D:\Sheyenne\sheyenne_area_poly.shp'

"""create emply list to hold paths to input rasters"""
inrasters = []

"""populate the list inrasters with all paths to .tif in directory"""
os.chdir(indir)
for r in glob.glob('*.tif'):
    inrasters.append(r)
#
#"""iterate over all input .tif from list inrasters"""
for inraster in inrasters:
#
#    """create a unique name for each output raster"""
    outraster = inraster.replace('.tif','_clip.tif')

#    """Clip each raster with it's unique name as output""
    arcpy.sa.ExtractByMask(inraster,mask)

but it returns the error:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000865: Input raster: LT50290282011268PAC01_sr_band1.tif does not exist.
Failed to execute (ExtractByMask).

LT50290282011268PAC01_sr_band1.tif is the first file in the inrasters list

Edit:

Everything works as I expect up until the loop starts.  When I print inrasters all of them are listed.  When I print outraster only the second raster in my list is printed.  So somewhere in the loop is when things are breaking down.  Also, I never actually use the variable outraster which may be part of the problem.

Edit:

I got it to work using this code:

import arcpy

arcpy.env.workspace='D:\Sheyenne\Practice_bands'
arcpy.CheckOutExtension('Spatial')

"""absolute path to your mask layer"""
mask = r'D:\Sheyenne\sheyenne_area_poly.shp'

"""Loop through rasters, append names and savefiles"""
rasters = arcpy.ListRasters()
for raster in rasters:
     outraster = raster.replace('.tif','_clip.tif')
     arcpy.gp.ExtractByMask_sa(raster,mask,outraster)


texts: Shortest network to connect multiple points (Euclidean Steiner Tree problem)

texts:
I have a shapefile (Houses.shp) with points representing houses in a village (from 10 to 40 houses per village). I want to connect the houses in each village to each other with the shortest possible network layout. I have been using so far a plug-in (ReconstructLine) which gives me the Minimum Spanning Tree, with the constraint that each node of the network has to correspond to one of the houses. What I am looking for is a way to create the Euclidean Steiner Tree, which leaves the possibility of creating new nodes laying in between different houses if the resulting network is shorter (see https://en.wikipedia.org/wiki/Steiner_tree_problem#Euclidean_Steiner_tree for detailed explanation).
I checked various GRASS tools such as v.net.steiner but that's not what I am looking for because it only works for shortest paths between nodes along a pre-existing network.

I know that the Euclidean Steiner Tree problem for N elements is an NP-hard problem, but I was wondering if there is any approximation that could work for a limited number of houses like in my case, through python coding (of which I have very little experience) or with an existing tool.


texts:
I'm trying to update geometry column with pyspatialite but it returns error:

  spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry constraint   [geom-type or SRID not allowed]

My code is:

 cursor.execute(''' UPDATE mypoints SET  address = ?, the_geom = geomFromText('POINT(%f %f)', 2100)  WHERE PK_UID= ? ''' % (x_egsa, y_egsa),  (myaddress , myID))


texts: Get country statistics using Iterate Feature Selection in ModelBuilder

texts:
I'm using night light data from the NOAA and I want to generate statistics on luminosity for each country, ie what is the mean pixel value for a country. I have been following this guide: http://economics.mit.edu/files/8945

This guide worked for one country and now, starting from clipping the countries, I would like to use the Model Builder in ArcMap to do the same thing for each country using the iterate feature selection. Here is what I've tried so far, which is to follow the above guide and add those tools in the model builder:

The "countries_erase" is a layer containing boundaries where I have selected the "Name" as the field. "F182013" is the night light raster file. From there on the I wish/tried to create a fishnet and clip it to the night light data. Finally I tried to use the "Zonal Statistics as Table" to obtain the statistic and then merge all values for each country into a dataset that can be loaded to Stata.

I've tried running the model but it fails midway through and since I'm a complete novice I don't know how to fix it or if I'm even on the right track.


texts: Exclude image from rendering in layout if file not found

texts:
I'm using QGIS 3.4. print layout to create an atlas with photos of features. I have a folder with photos and each photo is named with an ID of related feature.

Example:
If ID of feature is 543, photo is named "543.JPG"

I'm using an expression to define a path to photo:
concat('C:/Users/user/Desktop/Photos/', "id" ,'.JPG')

This works fine, but sometimes the photo of a feature is missing in folder and then I get a huge red X instead of a photo.

Is there a way to exclude the picture from rendering if it is not found in folder?

I found an example (link here) that uses "data defined override", but it requires the features to have an attribute "image path" and uses it to determine if the image will be rendered or not based on existence of that value. I don't have image path in my data, i just use feature ID to get the photo.


texts:
I have been using QGIS Madeira on Surface and Desktop but had to reload Win 10 on Desktop.  Reloaded QGIS but it's now Coruna.  Coruna will not load Maps saved in Madeira, the basic map will load but the extra layers do not.  Is there a fix?

I get a dialogue box listing offending layers with "Keep Unavailable Layers", "Remove Unavailable Layers" and "Apply Changes". If I "Keep" they are loaded with warning triangle. If I hover over the layer name in layer panel it says "Layer data source couldn't be found. Click to set a new data source". These layers took a long time to draw and I don't have the time to redo.

I tried to find a copy of Madeira to download but could only find on sites I wouldn't trust, any suggestions for a safe site to download Madeira?


texts: Randomly Sample Raster Pixels With a Minimum Distance in QGIS

texts: Is there a way I can sample random raster pixels from a satellite image with QGIS or QGIS plugin?   I also need each randomly-chosen pixel to have a pre-defined minimum distance from the other raster pixels. I need this pre-defined minimum distance in order to minimize spatial autocorrelation.


texts:
Using ArcView 10.1 and using excel for Lat/Long conversion to a shapefile.  The original Lat/Long has 7 numerical characters past the decimal point xx.1143717.  When I convert this excel into a shapefile, the numbers are shortened down to 6.  The Lat of ex.. xx.1143717 when converted into a shapefile is brought down to 6 numbers past the decimal and rounded up to xx.1143720

Is there a way, or how can I make it where all the Lat/Long numbers are shown, all 7 instead of 6 in the attribute table?


texts: MMQGIS Distance to nearest hub tool error when using meters

texts:
When I am using the MMQGIS distance to nearest hub tool with the measurements in meters I am getting the same measurement for all features. This does not happen when using the other units. For ease I would really like to be able to sort this problem.

Please see image below:

The HubDist column states 3706...etc for all features. My CRS is set to BNG 27700.


texts: How to programatically initiate LineString Draw in OpenLayers 3

texts:
I am trying to activate draw and place the first point when a action is clicked on a  feature. This will then create a single line string to the next point where the marker will move to.

However I am having issues initiating the draw feature start point programatically so that my next click would be the second and final point of the line string.

I have tried implementing using:

 function startmove(coords) {

 interaction = new ol.interaction.Draw({
                        type: 'LineString',
                        createFeature: coords,
                        source: source
                    });
  map.addInteraction(interaction);

 }

Does anyone have any ideas on how to achieve this?


texts: arcpy.management.SelectLayerByAttribute and a variable

texts:
I have to create a folder from a Shapefile of the municipal boundaries and put the folders (line and point) of the municipalities in it.
I managed to create a loop that creates a folder with the name of my municipality but I can't select the data included in the municipality.
This comes from the expression to select the municipality but I can't find the solution.
I created a list of municipalities.
All my data are shapes.
arcpy.management.SelectLayerByAttribute(Commune_IGN_Layer, 'NEW_SELECTION', '[NOM_COMMUN] = {}'.format(Liste_Commune[a]))

Does anyone know how to put the expression SQL as a variable in this selection?
Here's my code:
    """5- Creation of the file of the day for importing data"""

    #Declaration of the location of the file for the creation of the day record"
    Emplacement = r"C:\Users\nh\Desktop\DEV_ArcGis\EXPORT_GIRES"

    #DATE , variable allowing to have the name of the future folder where
    # to create the folders of the data of the communes in order to avoid
    # the duplications the use of the hour allows differentiation
    Date = datetime.datetime.today().strftime('%Y-%m-%d_%H_%M_%S')

    #Creation of the folder of the day"
    DossierDuJour =  os.path.join(Emplacement,Date)
    os.makedirs(DossierDuJour)

    """6 - Creation of files and data specific to each municipality """
    #Script allowing to list the name of the commune of the field NOM_COMMUN ,
    # !!!! warning there shouldn't be any special characters,
    #Indice [0] allows you to remove the tuple index from the list in order to have only the tuple name.,
    #The name is then used to create the name of the municipality's folder
    Commune_IGN_Layer =r"C:\Users\nh\Desktop\DEV_ArcGis\TEMP\COMMUNE_IGN_Layer.shp"

    Liste_Commune = []

    with arcpy.da.SearchCursor(Commune_IGN_Layer, ["NOM_COMMUN"]) as cursor:
        for row in cursor:

        #6.1 - Creation of the folder for the municipality
        DossierCommune = os.makedirs(os.path.join(DossierDuJour,(row[0])))

        #6.2 - Selection of the municipality
        CountyNM = str(row[0])

        #Add municipalities names to my list
        Liste_Commune.append(CountyNM)

    # Number of municipalities in the list
    nb_listeCommune = len(Liste_Commune)

    a=0
    while a < nb_listeCommune:

    Com = arcpy.management.SelectLayerByAttribute(
        Commune_IGN_Layer,
        'NEW_SELECTION',
        '"NOM_COMMUN" = {}'.format(Liste_Commune[a])
    )

    #6.2 - Select and export SOUTERRAIN data of the municipality
    #6.2.1 - Select SOUTERRAIN data of the municipality
    COMMUNE_IGN_Sout= arcpy.management.SelectLayerByLocation(
        in_layer=Com,
        overlap_type="INTERSECT",
        select_features=SD_EP_SOUTERRAIN_GEOREF,
        search_distance="",
        selection_type="NEW_SELECTION",
        invert_spatial_relationship="NOT_INVERT"
    )

    #6.22 - Export SOUTERRAIN data of the municipality in its folder
    exportSout = arcpy.conversion.FeatureClassToShapefile(
        Input_Features=COMMUNE_IGN_Sout,
        Output_Folder=DossierCommune
    )

    #6.3 -Select and export SOUTERRAIN data of the municipality
    #6.3.1 - Select SOUTERRAIN data of the municipality

    #arcpy.management.SelectLayerByAttribute(fc, 'NEW_SELECTION', row[0])

    #6.32 - Export SOUTERRAIN data of the municipality in its folder
    a=a + 1


texts: QGIS: Split with lines does not fully work

texts:
I'm using QGIS 3.8 and I've got two shape files which I would like to cut in pieces using Split with lines

Both times I used the algorithm the first two lines did not cut through my shapes, while the rest of the shape is properly cut in pieces. I would like to know if this is a bug that someone else has experienced aswell or am I the only one with this problem?

Here are some pictures of my problem:


texts: Missing text, buttons and scrollbars in QGIS UI

texts:
So I'm having a problem in QGIS 3.12 where the text for certain buttons, menu items and messages is improperly spaced/positioned within the UI, and in many cases, is totally hidden from view. Additionally, in many parts of the UI the scroll bars are tiny, to the point where they can't be used, most irritatingly when viewing attribute tables.

These issues are making QGIS borderline unusable for what I need to do.

I believe part of the cause has to do with the fact that I changed the aspect ratio of my computer as I recently reconfigured my display setup with a second monitor. However multiple resets of the aspect ratio settings has been of no avail and neither has a reinstall of QGIS.

No other software on my computer has this issue.

My question:
How can I fix my text and UI problems with QGIS?

Edit: Here is an example of how some of the text looks like. Note that there are entries in this list that aren't visible.

Edit 2: So it turns out that resetting the computer itself was what was required. I did change the settings as per the comment below and reset but I don't know if the changes were required.

If you encounter this problem yourself, first try just resetting your computer, and if that doesn't work, try changing the settings as below.


texts: Optmizing PostGIS minimum distance query

texts:
I have the field_1 of my Table_1 that must have the minimum distance between the geometry of my Table_1 and any geometry of my Table_2.
To do so, I used a CROSS JOIN (Full Cartesian Product) between Table_1 and Table_2. I also used the KNN operator <->.

My trouble is that it took more than 3 hours to run and I decided to abort the query while it was running.

Table_1 has 56230 entities.

Table_2 has 234843 entities.

Here is my code:

UPDATE Table_1
SET field_1 = list.distance
FROM(
    SELECT T1.gid AS name, MIN(T1.geom <-> T2.geom) AS distance
    FROM Table_1 AS T1
    CROSS JOIN Table_2 AS T2
    GROUP BY T1.gid
    ORDER BY T1.gid
     ) AS list
WHERE Table_1.gid = list.name;

Do you have any ideas with a lighter query that could execute this much faster ? I already have created spatial indices.


texts: Are raster color band codes standardized in ArcMap/ArcGIS?

texts:
I have multiple TIFF files which contain rainfall data. Different colours are associated with different levels of rainfall.
When I add the files to arcgis, a colour/colour code is created.

These two images represent the colours/colour codes for two different TIFF files.
On first glance, it appears that ArcGIS assigns the same code to the same colour, however what I would like to know is if this is guaranteed? As in, will a shade of blue in one TIFF file have the same code as a shade of blue in another TIFF file?


texts: What's next if our KML is too big/complex for the Google Maps API?

texts:
Our web app includes simple mapping capabilities (currently just markers and KML overlays on an embedded Google Map). This works pretty well; the only real limitation we face is KML overlays that go beyond Google's size & complexity restrictions for KML.

We're considering standing up our own server (e.g. GeoServer or ArcGIS Server); but that seems like a huge step just to serve up (for example) 15 MB of KML when Google's limit is 10 MB.

I need a sanity check: Is there some middle ground between Google's free and easy API for KML overlays, and setting up my own tile server?


texts: Trying to add a property from an attribute table to a raster data in QGIS possible

texts:
I am really new to GIS in general. I've been working with QGIS.
I downloaded this data: WISE30sec Soil Properties. I'm trying to create a geotiff clipped to my study region with the soil property's TAWC(total water available capacity) value from the attribute table in the zip file for each grid cell of the raster file.
I followed the instructions in the zip file:

Using ArcGIS or similar, user may join the raster data to the derived soil properties files, as managed the MSAccess database
(WISE30sec.mdb). Linkage is through the map unit code or grid cell
identifier(NEWSUID) of the raster set and the NEWSUID of the various
soil attribute data files.

I managed to connect the MSAccess database in QGIS and get the attribute table, but I cannot find a way to add properties from the table with the NEWSUID grid cell identifier to the raster map. All I've found online are tutorials on how to add attributes to a vector layer and not to a raster layer.
Is it even possible in QGIS? Or maybe I misunderstood the instructions.
Edit: Complete Instructions from the ReadME file in the zip file:

This soil data set is provided in one single zip file, called WISE30sec_v1.zip. By default, this fill will be unzipped to folder X:\WISE30sec, where X is the actual folder on your system.
The zip file includes a raster GIS file(WISE30sec) as well as a range of soil attribute data files; for details please see Appendix 3 in the technical documentation.
Using ArcMap, users may join the raster data to the derived soil properties files, as managed in the MSAccess database (WISE30sec.mdb). Linkage is through the map unit code or grid cell identifier (NEWSUID) of the raster set and NEWSUID of the various soil attribute data files. The above files are also provided in TIFF and TXT format ( see folder "...\interchangeable_format") so that they may be easily accessed using other systems.
Depending on the proposed applications, users may select the appropriate data set(s) with due consideration for the issues raised in Section 3.4 in the technical report on "appropriate use of the derived data': comprehensive studies should consider the full mapping unit composition.


texts: What's the fastest way to search for polygons that intersect with others?

texts:
I'm querying the database for searching polygons that intersect with others, but is very slow research, wanted to increase the speed.

I thought of using sphinx, solr, elastic search googled but did not find much content on georeferencing, wanted to know if it is possible to manipulate polygons in these tools

Im using st_intesects on where clause, using buffer in a polygon because i want search intersetions > 50m


texts: I am having issues with coordinate systems in post processing. Does anyone have a recommendation of videos to watch or online classes that can help me improve on this? This is my current issue: Data was taken in the field using UTM, 16 North, using NAD 1983 (Conus). When I export it using Pathfinder I choose to Use Export Coordinate System using Projected Coordinate System NAD 1983 UTM Zone 16N. When I open it in ArcMap it is no where near where it should be. I know this is probably super simple but I can't figure it out.


texts:
My c++-plugin for QGIS 2.18 should read out the labeling properties from the layer. So I was searching the API for getting informed of rule-based-labeling but still get more confused. In my example I have four rules. For every rule I want to read out the QgsPalLayerSettings and the properties of the rule (name, scale dependency, filter...)

For getting the QgsPalLayerSettings a ProviderID is needed. In the api I found, the member ruleKey() of a Rule is the
Unique rule identifier (for identification of rule within labeling, used as provider ID)
But there also is a list of providers in the labeling object of the layer. So I ran through the layer with the following code:

    if (vLyr->labeling()->type()=="rule-based")
    {
        const QgsRuleBasedLabeling* rl = static_cast<const QgsRuleBasedLabeling*>( vLyr->labeling() );
        QgsRuleBasedLabeling::Rule* rootRule = rl->rootRule()->clone();

        qDebug() << QString("Root Rule [%1] ").arg(rootRule->ruleKey());
        QStringList sp;
        rootRule->subProviderIds(sp);

        int i=0;
        foreach(QgsRuleBasedLabeling::Rule* rl, rootRule->children())
        {
            qDebug() << QString("Rule [%1] %2").arg(rl->ruleKey()).arg(sp.at(i));
        }

        foreach(QString sProv , vLyr->labeling()->subProviders())
        {
            qDebug() << QString("Provider [%1] ").arg(sProv);
            QgsPalLayerSettings layerSettings = vLyr->labeling()->settings( vLyr, sProv );
        }
    }

And this is the output:

"Root Rule [{0149ca5f-1ae3-46c8-a245-16e55bb9ce3c}] "
"Rule [{ede1075f-0c72-461f-be71-22987a6ab011}] {ede1075f-0c72-461f-be71-22987a6ab011}"
"Rule [{559d4578-770b-49c4-a7cb-eb0665e90838}] {559d4578-770b-49c4-a7cb-eb0665e90838}"
"Rule [{63523eeb-b29d-4225-a4c8-5d8936c031f0}] {63523eeb-b29d-4225-a4c8-5d8936c031f0}"
"Rule [{3c5edfb3-a717-48da-bc83-a4969ee549cc}] {3c5edfb3-a717-48da-bc83-a4969ee549cc}"
"Provider [{72fefc10-2f5c-424c-8524-6c2cc7db7e26}] "
"Provider [{67b3a0c7-c2eb-47a9-bab9-9c3fd7905bbc}] "
"Provider [{48c4d4da-d94b-435f-8424-fe6e1c545ab8}] "
"Provider [{b59c0c89-98fe-42b6-99d3-4b5a4efc63ae}] "

I supposed that the four keys/providerIDs are the same but now I'm confused and don't know what to read out. I don't understand the difference between subProviders() and rooleKeys. And because this class is not available in python, there are no examples to find.

EDIT:

I found out the layersettings I get from rulekeys are empty, those from subProviders have the right informations. But how to combine them? Tried with QgsRuleBasedLabeling::Rule::subProviderIds but the IDs are the same like ruleKeys.


texts: I've currently got data on the NYC subway stations (including name, position, and how many people entered and existed during a timeframe). Also, I have the data on which stations have which train lines. However, I don't have the order of these stations on the line. Is there anywhere where this data is already formatted in some way that can be easily used programmatically? I could put them in order in some csv file on my own, but I'd rather avoid that if I can. Thank you much!