texts: Listing Feature Classes, Geometry Types server and user names from a parent directory in Python in ArcGIS

texts:
I have parent directory containing subfolders with layer files (.lyr) and I want to list Feature Classes, Geometry Types, server and user names for these files. Also I need Python to scan these files recursively.
I am only a beginner in Python, so I don't really know how to do it.
All I've done so far is here:

import os, fnmatch
import arcpy

for dirpath, dirnames, filenames in os.walk("F:\\"):
    for filename in filenames:
        if fnmatch.fnmatch(filename, "*.lyr"):
            lyr_filename = os.path.join(dirpath,filename)
            layers = arcpy.mapping.MapDocument(lyr_filename)
            for layer in arcpy.mapping.ListLayers(layers):
                    print(lyr_filename,layer.serviceProperties)

This code scan all the files in the subfolders, but it does not print the information I need.
Version of my ArcCatalog is 10.0.


texts: Applying Symbology to layer through ArcPy script and values are getting changed?

texts:
I am doing a raster calculation over a hdf file and after that i have to apply symbology on it.When i am applying Symbology to the raster layer through script .its values get changed as compared to the values i am geting when i am doing it manually .
Symbology Type : Stretched

script i am using is as ...

import arcpy
from arcpy.sa import *
env.workspace = "E:\data"
arcpy.CheckOutExtension("Spatial")
in_layer ="E:\data\filename.hdf"

#raster calculation

output= floatdivide(in_layer,10000)

# applying symbology

lyr ="output"
symbolLyr = r"E:\data\Layer.lyr"
arcpy.ApplySymbologyFromLayer_management(lyr, symbolLyr)

Applying Script changes the topmost 3 values and changed it to the Min value ,Avg Value and Max Value , As Shown in Screen shot 1.. Max Value : 0.997 , Avg Value : 0.3985, Min Value :-0.2.

In Screen shot 2 we can see the first three values are changed.

Screenshot for Process by Arcpy Script

Screenshot for Manual Process


texts: Corner coordinates of Google static map tile

texts: How to calculate the corner coordinates (bounding box) of a static Google Map image, fetched with e.g. http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=400x400&sensor=false ?


texts: How to add r.vieshed.cva to QGIS 2.18.3 processing toolbox?

texts:
I want to add r.vieshed.cva on my grass 7.2.0 from QGIS 2.18.3.
I need to access to r.vieshed.cva from processing and conect it with processing.runalg().
I saved the alg on C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing\algs\grass7 as python file but it doesn't appear on processing tools on QGIS or GRASS.

I want to add the result os a first processing in r.viewshed.cva vector file.

How can I do it?


texts: Using Latitude and Longitude with SRTM3 DEM file

texts:
I am new to working with DEM files but have a need to be able to work with SRTM3 DEM files to calculate elevation given a Lat,lon coordinates.

I understand from reading the documentation that the file contains binary data that represents Signed Int16 data that has height in meters.

My question is this, given a file say that has its bottom left corner being -33, 152 and covers 1 degree of lat, long how would do read a location in the file based on a given latitude, longitude point.

So if I had a position that was -33.456 152.434 how do I calculate the position of that height reading in the file?

I have read the file in to memory I just need to work out how to select the correct location in the resulting array.

Hope this makes sense.

Thanks for you help


texts: How to use OpenLayers OSM-Layer with degrees instead of meters?

texts:
I have an OSM-Layer as a base layer. When I create a vector I have to define the coordinates in meter.
Is there a way to use degrees right a way without reprojecting them beforehand to meters?

var p0 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(13.39, 52.5));


texts:
Could someone give an suggestion about how to erase an image using another image?
Like erase concept in ArcMap.
Like so:


texts: Selecting only Spatial tables from PostgreSQL database?

texts:
My database contains both Spatial and Non-Spatial tables, but I want to retrieve only Spatial table from the query.

Any suggestions to select only Spatial tables. 'the_geom' is the geometry column in the spatial table.

Otherwise, is it possible to select tables from its column name.

I tried with this code select relname from pg_stat_user_tables WHERE schemaname='public' ; but from this we get all table names.


texts:
I'm interested in trying to reproduce this kind of cartography in a Mapbox/Turf/vector tile stack:

I would start with the polygon for the lake edge, and generate a series of concentric polygons inside. Note that when the edges of the internal polygons meet, they split, so we will end up with multi-polygons.

Is there a way I can achieve this in Turf? Some possible candidates:

transformScale: just produces identical polygons, but smaller
lineOffset: would maybe solve part of the problem, but I'd need to manually detect when the lines are intersecting, then remove the intersecting bits.
buffer: sounds like the right tool, but the description is vague about how it would operate on lines or polygons.

To make matters more complicated, because the lake features might cross vector tile boundaries, I really want to first convert the polygon to a line, and remove the segment along the tile edge. This might limit options further.

If it can't be done in Turf, pointers to algorithms that can be implemented in JavaScript would still be valuable.


texts: Using selection instead of click for display of features in OpenLayers?

texts:
Currently I am able to display a popup of a feature that was clicked on.  I would like to be able to instead of click, to select an area and then show the feature(s) from the selected area.  Here is what I have so far for the click.

How would I handle "selection" instead of "click"?

Here is the current working code (handling click event):

featurePicker = new OpenLayers.Control.WMSGetFeatureInfo({
                url: "http://server01:8080/geoserver/sf/wms",
                title: 'identify features on click',
                layers: [PointsLayer],
                queryVisible: true
            });
            featurePicker.infoFormat = 'text/html';
            featurePicker.events.register("getfeatureinfo", this, showFeatureInfo);
            map.addControl(featurePicker);
            featurePicker.activate();

            function showFeatureInfo(e) {
                if (e.text.indexOf("<table class=\"featureInfo\">") != -1){
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                                "frame",
                                map.getLonLatFromPixel(e.xy),
                                null,
                                e.text,
                                null,
                                true
                            ));
                }
            }

How do I change to handle the "selection" event instead of "click" event?

In another words, to handle event when an area is selected with the mouse instead of clicking on a point?

Additionally it would be nice to have an additional popup/selection window before the framecloud is displayed to allow the user to select which feature he would like to be displayed on the framecloud from the ones found in the selected area.

The layer in question is WMS but I can create a "dummy" WFS layer for mouse selection if this is what is required to get this working.

I found something that might help but not sure how to implement it in my case:

   selectControl  = new OpenLayers.Control.GetFeature({
                protocol: OpenLayers.Protocol.WFS.fromWMSLayer(PointsLayer),
                box: true,
                hover: false,
                multipleKey: "shiftKey",
                toggleKey: "ctrlKey"
            });


texts:
I installed Qgis 3.4 Madeira and it worked fine, but now it throws me two errors

The first is the following:

The second is:

By omitting the two errors that load with several defects, such as: a empty vector box and the python console does not appear.


texts: Clip (Analysis) in ArcGIS 10 running indefinitely

texts:
I am attempting to clip a series of polylines (cross sections) using a single polygon. There are approximately 2400 polyline features in my input featureclass. Is this too large for the Clip tool to handle? I've tried it a few times and each time I've just shut it off after 40 or so minutes. I figure it should take less than a minute to run.

Any thoughts?


texts:
the function is very simple:

arcpy.CalculateField_management (fc, "DFDD", "aaa", "PYTHON")

and I want to calculate DHDD field with simple text "aaa", but I get error:

name 'aaa' is not defined. Any solutions?


texts: Error when using r.watershed in QGIS 2.10.1 with Grass

texts:
I am running r.watershed within QGIS processing the I get the error below.

I draw your attention to:

  GRASS_INFO_WARNING(2205,1): Subprocess failed with exit code 256 GRASS_INFO_END(2205,1)

Does anyone know the cause of this error?

QGIS Pisa 2.10.1
Tried differing machines.
Different input DEMs.
Outputs in memory and in folders.
Turning off the view layers.
Checking folder permissions.

It used to work in earlier versions on these data.

Here is the DEM.

Basically, it creates the output folders, finds the raster but never actually runs. Can someone maybe try the DEM on older version of QGIS. All the options can be left as default. The failure is pretty close to instant.

  GRASS_INFO_ERROR(2206,1):  USAGE for slope length determination:

  GRASS_INFO_ERROR(2206,1):
  Applications/QGIS.app/Contents/MacOS/grass/etc/r.watershed.ram [-4]
  el=elevation_map t=swale_threshold [dr=drain_direction_map]
  [de=depression_map] [ac=accumulation_map] [di=display_map]
  [ms=max_slope_length] [ob=overland_blocking_map]
  [S=slope_steepness_map] LS=length_slope_map [r=rill_erosion_map]
  [sd=slope_deposition value or map]  GRASS_INFO_END(2206,1)

  GRASS_INFO_WARNING(2205,1): Subprocess failed with exit code 256
  GRASS_INFO_END(2205,1)


texts: Using relative path in QGIS 3.x processing modeler?

texts:
I try to use a relative path for the algorithm "Set style for vector layer" in the processing modeler, but it works only with absolute path.

A similar request is here, but the answer doesn't suit me. It is proposed to copy the files to the root of the hard drive. I need to share the model and the qlm files with external users who may not have access to the root of the disk or whose disk is not named c: /  and aren't on the same network.

Would someone have a other solution?


texts:
The instructions from the url http://gdal.org/gdal_tutorial.html give the following example:

dataset = gdal.Open( filename, GA_ReadOnly)

with the following description:

  It's interpretation is driver dependent, and it might be an URL...

I would like to know, what kind of URL is this? Where can I find a detailed description with  methods and attributes which illustrate how to use this function?

http://gdal.org/python/ does not help. I think, the only way I can understand this is to learn C++ and then to study GDAL source code, which is a very difficult way.

My goal is to convert a wms request (the request specifies the BBOX, HEIGHT, WIDTH, SRS=4326), storing the tile in memory on a server and reprojecting it using SRS=3857.


texts: Save 1-band-raster to geopackage results in 4-band-raster

texts: I have a 1-band-raster (geotiff) and want to export it to a geopackage in QGIS 3.14. When I do that (right-click --> export --> save as), it results in a 4-band-raster. How can I prevent that?


texts: NetCDF - QGIS does not recognize projection

texts:
I have downloaded a netcdf (.nc) file from here: https://nsidc.org/data/NSIDC-0756/versions/2
In order to display in QGIS I have extracted one variable from it. The file successfully displays in Panoply, and displays projection information in the header for the main file (Polar Stereographic South), but when I load it into QGIS it says it does not have projection info. When I manually define it as Polar Stereographic South, it does not project anywhere close to correctly.
Though the header for the overall file shows projection info, the header for the actual variable does not. I have tried converting to geotiff then loading in QGIS, but it has the same issue.
Header info for file for Panoply:

And for the variable


texts: Finding average of values assigned to a field

texts:
I am using ArcGIS Pro.
I have an attribute table with point data of the amounts of time it takes a vehicle to reach its destination. Each destination is assigned to one of three zones and each response time is categorized as "on-time" or "late". I want to find the average of "on-time" responses per zone. How can I do this?
Fields: Response_Time (in minutes), Outcome ("on-time" or "late"), Zones (3 diff values)
I have tried creating a report, creating a graph, and using summary statistics, but these don't seem to allow expressions nor multiple field inputs. Is python my best bet?


texts:
I've added an image

The Blue area is the SPA area for the South Pennines, the red dot is a nesting bird, the 10km purple circle is the buffer zone of where another nest will not be allowed to reside.

I would like to work out and map the best fit for the nests (red dots) inside the blue area without the 10KM buffer zones overlapping (it doesn't matter if the buffer zones are outside the SPA).

Does that make sense to anyone? can it be done, can I then reverse this to see the worst case senario?


texts:
I can add a div into the infowindow content and set it's style giving it background color,  but I failed to make it transparent.

Is there a way to make the infowindow of google maps API transparent, without using other objects or 3rd party developed library?


texts:
I added a shapefile of Iran to QGIS.

'Tehran' has 35.6833° N, 51.4167° E coordinates, however QGIS shows Tehran with 4772860,31296767.

How can I view coordinates of a city or location in latitude and longitude form in QGIS?


texts: Creating in-line variable in field calculator of QGIS

texts:
I create new field based on other fields. For example; if "Field_A" is smaller than "Field_B", value of new field is 'A', otherwise it is 'B'. So I want to create new variable for this case within Expression area.

It's possible in QGIS 3 by means of with_variable function. But QGIS 2 don't have that function.

In QGIS 3:

# mn -> new variable
with_variable( 'mn',  min( "Field_A", "Field_B" ),
               if( @mn = "Field_A", 'A', 'B' ) )

or

with_variable( 'mn',  min( "Field_A", "Field_B" ),
               case when @mn = "Field_A" then 'A' else 'B' end )

In QGIS 2, I want to write something like that:

mn = min("Field_A", "Field_B")

CASE
WHEN mn = "Field_A" THEN 'A'
WHEN mn = "Field_B" THEN 'B'
END

I don't mean global or project variable, I'm asking to create a new variable to be used in Expression area scope.

How can I do that within Expression area in QGIS 2?


texts: ArcObjects bug in OID field duplication while duplicating feature class?

texts:
I have a shapefile with a column of type esriFieldTypeOID with the name FID and numbers from 0 to 5 (the first odd think is that ArcMap does not show a * next to the column name in the table view even if its of the OID type)

After duplicating the whole FeatureClass I have my FID column in the new FeatureClass but this time I have the numbers from 1 to 6!

If I use another file were I have the number from 1 to 6 I have also 1 to 6 in the copy.
According to the doc the OID is an integer and not null, therefore the 0 to 5 should not be a problem.

Thats the code I use:

// get FeatureClassName for input
        IDataset inDataset = inFeatureClass as IDataset;
        IFeatureClassName inFeatureClassName = inDataset.FullName as IFeatureClassName;
        IWorkspace inWorkspace = inDataset.Workspace;

        // get WorkSpaceName for output
        IDataset outDataset = outWorkspace as IDataset;
        IWorkspaceName outWorkspaceName = outDataset.FullName as IWorkspaceName;

        // Create new FeatureClassName
        IFeatureClassName outFeatureClassName = new FeatureClassNameClass();
        // Assign it a name and a workspace
        IDatasetName datasetName = outFeatureClassName as IDatasetName;
        datasetName.Name = newName == String.Empty ? (inFeatureClassName as IDatasetName).Name : newName;
        datasetName.WorkspaceName = outWorkspaceName;

        // Check for field conflicts.
        IFieldChecker fieldChecker = new FieldCheckerClass();
        IFields inFields = inFeatureClass.Fields;
        IFields outFields;
        IEnumFieldError enumFieldError;
        fieldChecker.InputWorkspace = inWorkspace;
        fieldChecker.ValidateWorkspace = outWorkspace;
        fieldChecker.Validate(inFields, out enumFieldError, out outFields);
        // Check enumFieldError for field naming confilcts

        //Convert the data.
        IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();
        featureDataConverter.ConvertFeatureClass(inFeatureClassName, null, null,
        outFeatureClassName, null, outFields, "", 100, 0);

        IFeatureWorkspace pFeatureWS = (IFeatureWorkspace)outWorkspace;


texts:
I have addresses that are somewhat noisy since they have been entered by humans. What this basically means is that in most cases the addresses make perfect sense, but in other cases it can something such as Right door on 2nd floor, MegaMall, 2100, Copenhagen.

Is there any service that allows for geocoding and can give some kind of score if they are able to geocode the address or not? :) Afraid of getting some coordinates that just simply does not make any sense.


texts: Geowebcache tiles showing only when seeding and not when viewing the map

texts:
I have created a map with geoserver and postgresSQL. I have managed in geoserver to seed the layers into tiles but for some reason as you view across the map, it does not create those tiles. For instance, if I seeded the layer till zoom 11 and wanted to view at zoom level 20, I could but it does not seem to create the tiles for a later stage nor make it more effective or faster. Also when I set a bounding area in the seeding form section, it gives me http 500 error and I'm not sure why.

I have set up geoserver and placed the folder for the tiles for the geowebcache.

I am using the intergrated geowebcache that comes with geoserver. The logs don't seem to show if there is something wrong.

Any help will be grateful.


texts: Extending polylines edges to create polygons using ArcGIS Desktop?

texts:
I have two separate polyline shapefiles where the second was created by editing the records of the first one. (in the first file the line is in a different position than the other and have common unique records in the table).

Is  there a way to extend the edges of a line and join the ends of the other one, without moving some of the existing vertices, to create polylines which close together for the creation of polygons?

I seek to do this using ArcGIS Desktop.


texts:
I am trying to read NMEA messages via GPSD (http://www.catb.org/gpsd/), but I do not know how to do that.

I have a GPS antenna which connects to the u-blox M8 GNSS Evaluation Kit Timin (https://www.u-blox.com/en/product/evk-8evk-m8) and this Kit is connected to Ubuntu laptop.

In the Terminal window, when I type "lsusb", it shows me the device successfully connect (for example: Bus 001 Device 036: ID 1546:01a8 U-Blox AG)

As I know when the GPS receive a signal, it should be putting NMEA messages out in each port, and should be mounted by TTYACM0.

The Laptop also installed NTP (Network Time Protocol)

My question is:

what does the GPSD do with that?
what can  the GPSD log these messages?
How to confiure GPSD to set NMEA messages from the u-blox USB port?


texts: Select points based on value and proximity

texts:
I have a set of points in a table, each has a value between 1 and 100.

How could I reduce this to the point with the highest value within a radius distance X. So that no point is ever closer than X to another.

As an example. If the table contained 4 points

Point 1 - value 10
Point 2 - value 15
Point 3 - value 20
Point 4 - value 5
Point 5 - value 3

If Point's 1 - 3 were within 100 metres of each other then Point 3 would be selected. If points 4 -5 were within 100 meters of each other but > 100 metres from the others then point 4 would be selected. The resultant data set would be:-

Point 3 - value 15
Point 4 - value 5


texts:
I have a set of coordinates obtained from GPS signals in decimal degrees. These are apparently captured in WGS84 datum. I want to convert these into X and Y. below is a subset.

lon         lat
33.9500167  35.14637
33.94996    35.1463433
33.94999    35.14632
33.9500633  35.1462667
33.9500633  35.1463
33.9500467  35.1462467
33.95004    35.1463333
33.9499167  35.1463533
33.94975    35.1464233
33.94981    35.1464533
33.9500433  35.1463167

I want to do this probably in R as I do have signals from a few different receivers ending up with thousands of points. I need to get this X,Y values as I want to use it elsewhere in R that does not accept lon/lat cords.


texts: How to fix distortions for Baden-Württemberg?

texts:
I'm working in an area in Baden-Württemberg, Germany. I loaded some OSM data in QGIS but the map display is distorted.

I tried ftools define projection with many different projections but nothing changed.

I tried: - WGS 84/ World Mercator - DHDN / Gauss-Kruger zone 2 - Google mercator - ETRS89 / UTM zone 32N - DHDN / Gauss-Krugerzone 3 - DHDN / Soldner Berlin

and many others...but nothing worked. There was no difference visible.

ich bearbeite derzeit ein Gebiet in Baden-Württemberg und habe dazu Daten aus OpenStreet Map in QGIS geladen.
Leider wird das Gebiet immer in der Breite verzerrt dargestellt.
Ich habe über Rechtsklick auf den Layer und auch über fTools->Aktuelle Projektion definieren schon viele verschiedene Projektionen ausprobiert, jedoch ändert keine was an dieser Verzerrung.
Könnte mir jemand helfen, wie ich den Layer richtig darstellen kann?
Vielen Dank!


texts: QGIS 3.4.4 Processing Tools not working on Mac

texts:
I'm running QGIS3.4.4 on a mac (OS:10.14.2). The Processing Tools don't appear to work.

I'm working through the examples in 'Learn QGIS -4th edition' from Packt> which uses the official qgis_sample_data for Alaska. So I assume the data and loading are clean. I've used Processing Tools successfully in earlier QGIS versions (currently 2.14), but can't get them working for 3.4.

The lastest failure is on 'Clip Raster by Mask Layer', reports similar problems to earlier failures - saying, 'layers not correctly generated'.


texts: Scalebar gives error in measurement in Qgis: Different measurements of distance on OSM tiles and GoogleEarth

texts:
I've created a map of Bordeaux using the QGIS map compositor by following this procedure:

Used the OSM plugin to display an OSM map and zoomed to Bordeaux
Used the print composer to create a map of Bordeax using A4 at full screen
Added a scale bar, and compared the distance markers with a distance measured in GE between two points in Bordeaux

The two do not agree by quite a lot.  The GE measurement for the test area was approximately 1100m, the scale bar suggested the same distance was approximately 1500m.

Is the QGIS scale bar in the print composer supposed to be only approximate?  Anyone know if I'm doing something wrong?  I don't believe the distance is long enough to worry about possible topography differences.

I've attached a screen shot to show the two measurements:


texts: Why "Unique ID fields" is not saving its value in Dissolve algorithm in Graphical modeler?

texts:
I am working on my project in QGIS 2.18 through Graphical modeller and using some basic algorithms for polyline objects.

However, I do not understand why specification for Dissolve algorithm cannot be saved as a parameter in its window. Any ideas?
When I execute this model through Processing Toolbox it dramatically impacts my desired output. Looks like it simply does not remember my settings.

Example. I use "SLINIE" field as a Dissolving parameter.

But after I click OK and open the window again I can not see that option.

Can somebody tell me please what am I missing?
Another solution such as:

SAGA Line Dissolve works only with three parameters
With OGR Execute SQL I can execute the proper query but I do not know how to save properly the output as a shapefile.


texts: How to apply if-else condition on two different rasters to produce another rasters?

texts:
I want to create a new raster image which meet certain criteria from two underlying images.

I created a dummy raster with each pixel having value = 1.

Raster values are to be set to 0 if underlying pixel values for Raster_1 is between 100 to 110 and Raster_2 is 60 to 80.

I tried to do it with con but it gives a raster with garbage pixel values.

import arcpy

arcpy.gp.RasterCalculator_sa("""Con(("Raster_1.tif" < 1002) & ("Raster_1.tif" > 110) & ("Raster_2.tif" < 62) & ("Raster_2.tif" > 80) ,0)""","RasterOut.tif")

I wonder can I do it using something like `if-else' condition as we do in MATLAB for matrix operation


texts: Angle between 2 lines with each line represented by set of lat/lon pairs

texts:
I'm really new to GIS and i'm interested in finding angle between 2 lines. Each line is represented by start location(lat/lon) and end location(lat/lon).

Could some one point to an algorithm or any sample code(in any language), I can port that in to my desired language?

I tried searching in different forums but all i found was distance between 2 points and distance between a point and line, but not one to find the angle.


texts: Is there a Mapbox GL renderer that outputs SVG?

texts:
I have a vector tile source and a Mapbox GL style sheet and would like to produce vector images (SVG) with them. The renderers I found only render in canvas client-side or PNGs server-side.

Any ideas?


texts: Earth Engine error: Error: Image.select, argument 'bandSelectors':

texts:
I have done a supervised classification. The output is an image collection. I cannot export it in drive. Here is the link

https://code.earthengine.google.com/ebd671bb75dde4892e3a7e14acdc7d4e

var maskL8 = function(image_m) {
  var qa = image_m.select('BQA');
  var mask = qa.bitwiseAnd(1 << 4).eq(0);
  return image_m.updateMask(mask);
};

var image_m = ee.Image(ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(roi)
.filterDate('2018-06-16', '2018-10-15')
.map(maskL8)
.median());
Map.addLayer(image_m, {bands: ['B5', 'B4', 'B3'], max: 0.3}, 'image_m');

var maskL8 = function(image_s) {
  var qa = image_s.select('BQA');
  var mask = qa.bitwiseAnd(1 << 4).eq(0);
  return image_s.updateMask(mask);
};

var image_s = ee.Image(ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(roi)
.filterDate('2018-03-16', '2018-05-15')
.map(maskL8)
.median());
Map.addLayer(image_s, {bands: ['B5', 'B4', 'B3'], max: 0.3}, 'image_s');

var maskL8 = function(image_w) {
  var qa = image_w.select('BQA');
  var mask = qa.bitwiseAnd(1 << 4).eq(0);
  return image_w.updateMask(mask);
};

var image_w = ee.Image(ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterBounds(roi)
.filterDate('2017-11-16', '2018-02-15')
.map(maskL8)
.median());
Map.addLayer(image_w, {bands: ['B5', 'B4', 'B3'], max: 0.3}, 'image_w');

var mergedCollection = image_m.addBands(image_s.addBands(image_w));
print('mergedCollection: ', mergedCollection);
Map.addLayer(mergedCollection, {bands: ['B5', 'B4', 'B3'], max: 0.3}, 'mergedCollection');

//merge
var newfc = Waterbody.merge(Wetland).merge(Vegetation).merge(Agricultural).merge(Builtup).merge(BarrenLand);
print(newfc);

//create training data
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7'];
var training = mergedCollection.select(bands).sampleRegions({
  collection: newfc,
  properties: ['landcover'],
  scale: 30
  });
print(training);

//Train the classifier
var classifier = ee.Classifier.cart().train({
  features: training,
  classProperty: 'landcover',
  inputProperties: bands
  });

//Run the classification
var classified = mergedCollection.select(bands).classify(classifier);

//Display classification
Map.centerObject(newfc, 11);
Map.addLayer(mergedCollection,
{bands: ['B4', 'B3', 'B2'], max: 0.3},
'Landsat image');

Map.addLayer(classified,
{min: 1, max: 6, palette: ['003EFF', '638A61', 'E34314', 'C3C056', '96E6E5', '95F905' ]},
'classification');
Map.addLayer(newfc)

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: classified.select(classified),
  description: 'imageToDriveExample',
  scale: 500,
  region: roi
});

It is showing the following error

  Error: Image.select, argument 'bandSelectors': Invalid type. Expected:
  List. Actual: Image<[classification]>


texts: Creating multiple maps in a QGIS print composer

texts:
I'm relatively new to QGIS - I'm switching from MapInfo.

I'd like to have two separate maps in my print composer in QGIS. One the main frame linked to my canvas window and the other a raster image from OS mapping (an overview of the project). Screenshots attached of my current QGIS window and the MapInfo layout I'm trying to replicate.

I can't work out how to just bring my raster into the small map window at the moment.


texts: MapServer HTML Template doesn't display map/image

texts:
I'm using ms4w and working on my local machine and want to build a map like in the MapServer Example 1.9 (https://mapserver.org/tutorial/section1.html).

Unfortunately the HTML template doens't display the image of the map. The map images are only generated and saved in the tmp folder, but not shown in the browser.

My HTML template index.html looks like this:

    <form name="mapserv" method="GET" action="http://127.0.0.1/cgi-bin/mapserv.exe">

          <input type="hidden" name="program" value="http://127.0.0.1/cgi-bin/mapserv.exe">
          <input type="hidden" name="map" value="C:/MapServer-Project/myMap.map">
          <input type="hidden" name="imgext" value="270353 5135877 931021 6201334">
          <input type="hidden" name="imgxy" value="200 150">
          <input type="hidden" name="zoom" value="0">
          <input type="hidden" name="layer" value="airports">
          <input type="hidden" name="mode" value="browse">

            <input type="image" name="img" src=[img] width="400" height="300">

    </form>

The web definiton in my mapfile myMap.map looks like this:

    WEB
        TEMPLATE  'index.html'
        IMAGEPATH data/tmp/
        IMAGEURL  tmp
    END

Folder structure:

-[]C
  -[]MapServer-Project
    -index.html
    -myMap.map
    -[]data
      -[]tmp

I think there is a problem with relative paths. I think the img-tag in <input type="image" name="img" src=[img] width="400" height="300"> is not able to find the C:/MapServer-Project/data/tmp folder.

For exmple somehow I can't use /cgi-bin/mapserv.exe for <form name="mapserv" method="GET" action="http://127.0.0.1/cgi-bin/mapserv.exe">. I have to use the http://127.0.0.1 prefix. Otherwise the application can't finde the file.


texts: Reclass or other if/then logic expression in field calculator

texts:
I'm trying to reclass values in field calculator using Python (recreating something I did successfully last month and am failing now). I've reviewed many questions and answers on this site with no success.

I've followed multiple examples from ArcGIS help and on this site, and regardless of how I change my statements, the calculator returns only one answer for all records. I added a picture as an example.

I wrote the following pre-logic script code, but the calculator returns "1" for all data.
I have a field (Percent) of percentages and I'd like to bin them into 5 groups in the cate field:
greater than or equal to 80; greater than or equal to 60 and less than 80; greater than or equal to 40 and less than 60; greater than or equal to 20 and less than 40; greater than or equal to 0 and less than 20.

I have no python experience and am just trying to replicate examples from GIS help and answers to similar questions on this site.

def Reclass(Percent):
  if Percent >= 80:
    return 5
  elif Percent >= 60 and Percent < 80:
    return 4
  elif Percent >= 40 and Percent < 60:
    return 3
  elif Percent >= 20 and Percent < 40:
    return 2
  elif Percent >= 0 and Percent < 20:
    return 1


texts: Cannot save column names or data in QGIS Attribute Table?

texts:
Whenever I add a new column within the attribute table and subsequently press "save changes" (also in the attribute table), the name of the column (header) will disappear and instead there are a bunch of symbols.

After restarting QGIS, all data that I previously entered in the attribute table is gone. This happens across all of my files. It wasn't always like this but has been for some months now.

I've already reinstalled QGIS a bunch of times (running 2.18.14 but had this problem with the previous LTR)

File Format: ESRI Shapefile

Has anyone had this problem and found a solution?


texts: How to find highest kernel density point

texts:
I've been using spatstat to analyse point patterns in R. Here's an example to put this in context:

library(spatstat)
library(maptools) # to convert sp class to ppp

Some point data:

set.seed(1985)
x <- rnorm(20)
y <- rnorm(20)
p <- SpatialPoints(coords = matrix(c(x, y), ncol = 2))
plot(p)

The challenge is to find the kernel density at each point, not in a continuous field
aggregated as cells in a raster image, as calculated by density from spatstat:

p <- as.ppp(p)
d <- density.ppp(p, sigma = 0.3)
plot(d)

From this one can identify clusters and other useful things, but it does not provide imediate insight into
the point that has the highest dot density. So this is a two-part question:

How to extract the coordinates of the pixel with the highest density in d?
Is there a way to calculate the kernel density only for the 20 points in p?


texts: QGIS 3.10.4-A Coruña processing.run overload?

texts:
I have a command block with multiple run.processing commands (gdal:clipvectorbyextent, grass7:v.transform, native:dissolve) in a loop for in PyQGIS.
Everything is fine at first, after executing a for loop multiple times I get error:
Traceback (most recent call last):
  File "/usr/lib/python3.8/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 36, in <module>
  File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 106, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 181, in runAlgorithm
    raise QgsProcessingException(msg)

Is it possible to overload the processing.run algorithm?


texts: How to discard null coordinate points automatically when we make Multipoint Geometry in Spatialite?

texts:
I have a Spatialite table that contains a series of 80 coordinates where each coordinate placed into one column in a table. Then, I want to add all those coordinates into one Multipoint Geometry Column. Unfortunately, some of those coordinates have NULL value randomly. This will make the Multipoint Geometry Column having NULL value as well.

I tried to catch the NULL value using CASE WHEN, but since the table has 80 columns, my CASE WHEN code becomes very long because I must check it column by column.

Is there any automatic way to discard/unconsidered NULL coordinate points when we make a Multipoint Geomatry Column?


texts: Differences in QGIS server with WMS and WFS projections?

texts:
I serve WMS and WFS data using QGIS server and have a problem with projections. My project uses CRS EPSG:3857, the layers use CRS EPSG:4326.

Showing a WMS layer using Openlayers works fine. Tiles are called like that:

http://localhost/cgi-bin/project/qgis_mapserv.fcgi?map=/home/gerald/project.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=riversWithName&WIDTH=256&HEIGHT=256&CRS=EPSG:3857&STYLES=&BBOX=-469629.10178412125,4696291.017841229,-313086.06785608025,4852834.051769271

When I try to get the same layer as WFS data (based on this example from Openlayers) it doesn't work:

http://localhost/cgi-bin/project/qgis_mapserv.fcgi?map=/home/gerald/project.qgs&service=WFS&version=1.1.0&request=GetFeature&typename=riversWithName&outputFormat=GeoJSON&srsname=EPSG:3857&bbox=-469629.10178412125,4696291.017841229,-313086.06785608025,4852834.051769271,EPSG:3857

It expects the bounding box as EPSG:4326, the same call defining "projection: 4326 in the Openlayers view works fine and returns the features:

http://localhost/cgi-bin/project/qgis_mapserv.fcgi?map=/home/gerald/project.qgs&service=WFS&version=1.1.0&request=GetFeature&typename=riversWithName&outputFormat=GeoJSON&srsname=EPSG:3857&bbox=-2.94186767578125,38.78664566796875,6.51186767578125,44.06557633203125,EPSG:3857

What do I have to do to make it work with standard Openlayers projections 3857?


texts: How to create graph out of two layers using ArcGIS 10.1 for Desktop?

texts:
I would like to create a graph of two layers I have. On the one hand is the land price of a certain area and on the other a layer with a crime rate.

First of all, the layer with the land prices doesn't have a table like the crime rate layer. So I can't join them, which was my first intention, the other problem is that I don't even know how to create a table out of that layer (well I do in general but the create table tool won't offer me the land price layer as an option). If someone could explain that to me I guess the rest wouldn't be much of a problem.

Eventually the graph should look something like this (with the crime rate at the x-axis and the land price at the y-axis):


texts:
Any idea why the function loadThis() comes back as undefined?
I've tried adding jsonp: false  which doesn't help either. The json object is returned properly, I can view it in FireBug, but I can't get it to the callback function. Hope it's something simple I've missed,

var geojsonLayer = new L.GeoJSON();

function loadThis(data) {
    console.log(data);
}

$.ajax({
    url : "http://geoserver.capecodgis.com/geoserver/capecodgis/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=capecodgis:tracts_2010_4326&maxFeatures=2&outputFormat=json&format_options=callback:loadThis",
    dataType : 'jsonp'
});

map.addLayer(geojsonLayer);


texts:
I am trying to simply draw a 1km radius around a point, but I am unfamiliar with how all of it works precisely. This is what I have:

d = data.frame(lat = 10, lon = 10, ID = 1)
coordinates(d) = ~lon + lat
proj4string(d) = raster::crs(sp_df)
buf = rgeos::gBuffer(d, width = 1)

This is what buf looks like after:

> buf
class       : SpatialPolygons
features    : 1
extent      : 9, 11, 9, 11  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0

Now, what I don't know is what 1 means... I would like to have a 1km radius around a point.


texts: Rule of thumb for complexity of 3d Kriging (with pykrige)

texts:
I've been using pykrige for some data interpolation. It's great and works well in 2d. I recently tried the 3D version though, and it takes forever to run (> a day before I killed it), just for roughly a 10x10x20 point fit.
I'm not sure if this is to be expected or not, does anyone know how I should expect the run time to scale as a function of the number of fit points? Just not sure if I should leave it to run for a week or if it would need much longer and I'll be wasting my time.


texts:
I need to put a geocoder in a Leaflet page and I'd like to uso Photon (rif. http://photon.komoot.de/).

There is a leaflet plugin here https://github.com/komoot/leaflet.photon but no example is given: is there someone that use it in some projects and can give me a little example?


texts: ArcPad custom edit form validation behaviour

texts:
I have a custom ArcPad form, which includes the geography tab.  Users use this tab to update coordinates using the GPS.  When user press OK in the edit form, I want to first check that they have not moved the coordinates of a point beyond a set distance.
However, when I try to get the coordinates in VBS, from an event, it does not give me updated coordinates, only the coordinates that existed when the form was opened!

Here is the VBS Sub to grab the coordinates:

Sub SubCheckCoords()

  Dim msg
  Dim newXC, newYC, newZC
  newXC = EditForm.Fields.Shape.X
  newYC = EditForm.Fields.Shape.Y
  newZC = EditForm.Fields.Shape.Z

  msg = "NEW X "&newXC&" Y "&newYC&" Z"&newZC
  MsgBox(msg)

End Sub

Does anyone have any pointers on how to get the current coordinates that are stored in the geography tab - before the form is closed?


texts: Leaflet: calling a JS variable after feature.properties

texts:
Currently I have a dictionary where each field from my geoJSON is listed as a key and its alias is the value. I want to loop through this dictionary and return feature.properties.key. Here's some sample code:

var watershedFields = {Shed_Scale: "Watershed Scale", TP_TMDL: "TP TMDL"};

function onEachFeature(feature, layer) {
    var popupContent = "" + feature.properties.Location + " Watershed

"
    for(var field in watershedFields) {
        var fieldName = watershedFields[field];
        popupContent += "
" + fieldName + ": " + feature.properties.field
        + "

"
    }
    layer.bindPopup(popupContent);
}

What happens when this runs is that the code looks for a field name in my geoJSON that's labelled "field", and because this doesn't exist, it returns undefined. Basically, I'm wondering if there is a way to call a variable in place of a field name after feature.properties.


texts: Plotting Storm Prediction Center (SPC) Shapefile using Python?

texts:
I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this code to try to read the data.

    from mpl_toolkits.basemap import Basemap
    #draw basemap
    m=Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,llcrnrlon=-130,\
      urcrnrlon=-60,resolution='c')
    m.drawcoastlines()
    m.drawcountries()
    m.drawstates()
    m.drawmapboundary(fill_color='#FFFFFF')
    shp_info = m.readshapefile('..\day1otlk_20140709_2000_cat','thunder')

But then I get ValueError: Shapefile must have lat/lon vertices - it appears this one
    has vertices in map projection coordinates. Convert the shapefile to
    geographic coordinates using the shpproj utility from the shapelib
    tools.

I am pretty new to this but I understand I need to convert this shapefile to geographic coordinates but the error message is too vague and I have no idea how.


texts: ArcGIS for Server Printing - Data Frame Grid

texts:
We need to print the map from web client (Developed using ArcGIS JavaScript API). I have prepared the Templates and published as Export Web Map (GP Tool). My templates are using Data Frame Grid (Measured grid). I need to customize the grid size based on the printing scale. Is there any possibility of sending the grid size and scale as parameters to Export Web Map tool while generating the print?

please suggest if there is any Paid / Free tools available for printing the data frame grid dynamically on ArcGIS server.


texts: How to query data like only for point by from a grouplayer by using WMSGetFeatureInfo in Openlayers?

texts:
till now I have been known how to query data from a groupLayer by using WMSGetFeatureInfo while the point is it shows a lot of  associate results features,so I aim to query a single layer infomation from enter code herea groupLayer,just like only query point information.I don't konw whether it is right to use filter or CQL ,does anybody know how to handle this and can anybody give me a demo?

Here is My code:
var styleMap = new OpenLayers.StyleMap({
             "default": {
                 fillColor: "#990033",
                 fillOpacity: 0.4,
                 strokeColor: "#990033",
                 strokeWidth: 1,
                 strokeDashstyle: "dash"

             }
         });

        var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {
            displayInLayerSwitcher: false,
            isBaseLayer: false,
            styleMap:styleMap
            });
        this.map.addLayer(highlightLayer);

        var filterCql1 = "ROADCODE IS NOT NULL";
        var filterCql2 = "ROADNAME IS NOT NULL";
        var filterCql3 = "STARTZH > 0";
        var info = new OpenLayers.Control.WMSGetFeatureInfo({
            url : 'http://geoserver:8080/hdmapserver/wms',
            title : 'Identify features by clicking',
            //output:"object",

            /*
             * hover:true, handlerOptions:{ //"click": {delay: 100}, "hover":
             * {delay: 300} },
             */
        //  layers:[point,point1],
            maxFeatures : 10,

            infoFormat : "application/vnd.ogc.gml",
            vendorParams : {
                //'CQL_FILTER' : filterCql1/* +";"+filterCql2+";"+filterCql3, */,
                //featureId:"",
                radius : 5
            },
            queryVisible : false,
            eventListeners : {
                getfeatureinfo : function(event) {
                    var data = event.features[0].attributes;
                    if(event.text != null){
                        this.map.addPopup(new OpenLayers.Popup.FramedCloud(
                                "chicken",
                                this.map.getLonLatFromPixel(event.xy),
                                null,
                                "
"+data.num+"
"+"
":"+data.name+"
",
                                null,
                                true));
                    }
                    //console.log(data);

                    if(event.features.length>=1){
                        for(var i=0,j=event.features.length; i<j;i++){
                            console.log(event.features[i].geometry);
                        }

                    }

                }
            }


texts: Calculate geographic location of point display offset in QGIS

texts:
I have a point layer in which some symbols are displayed offset from the feature's true location by a given number of millimetres. As the map's zoom changes the offset symbol's geographic location changes to maintain the millimetre display distance.

I'd like to implement this approach to connect symbols to their features using lines, but to do this I need to know the geographic location of the offset symbol. To do this I need to know the geographic distance of the millimetre offset at the current zoom level and add that to the feature's coordinate.

QGIS obviously knows the scale and crs so in theory it has all the information required, however I'm not sure if a suitable function exists. If one does exist, what is it, and if one does not exist, how would I create one?

Edit to clarify: any solution that assigns fixed geographic locations to labels is inadequate. Offsetting a label using a display distance (mm) ensures the offset remains the same across different scales - this is not true of geographical offsets, which can disappear off-screen or cluster together when zooming in or out. I need an approach that calculates a geographic location based on a mm offset at any scale.


texts:
I'm currently getting an error message (Error 000366 - Invalid Geometry Type) when trying to dissolve a multipatch (3d) polygon - does anyone know if a dissolve of a multipatch polygon is possible?
I can't find any answers within the documentation on multipatch polygons.


texts: Converting National Bridge Inventory(NBI) ASCII file to shapefile

texts:
I have downloaded the NBI ascii file data from http://www.fhwa.dot.gov/bridge/nbi/ascii.cfm. Now I am not able to convert it into a shapefile. The ASCII file has a latitude longitude column. I understand that it can be imported in a GIS software using X,Y values. But I am not able to make out whether the latitude longitude is in DMS or decimal degrees.

I am posting a sample here.

Sample Latitude: 40454200
Sample Longitude: 122190700

If there is any other way of converting it, I would like to know.


texts: Converting GeoTiff to UTM in QGIS is slow?

texts:
I am trying to convert a Geotiff from WGS84 to UTM17. In QGIS, there seems to be a super easy way to do this:

First, I input my tiff by clicking add raster layer. This works successfully, as I can see my image on the screen and if I move my mouse of the screen it tells me the GPS coordinates in lat long for every point.

Next, I click save as, and save it as a geotiff with the coordinate system changed to UTM. This appears to work, but it takes pretty long so I have a couple questions.

Originally, the files are about 250mb. When I convert them to another coordinate system, it becomes like 2GB?? Why is it becoming so massive? I would think they should be of similar size.

It takes about 15 min to convert the file while the "save as raster" screen continues. I tried compressing them as JPEG, but that didn't seem to speed things up. I know this is long because I was converting .las point cloud from wgs to utm in Python and it only takes about a minute for the same size.

Am I doing something wrong?

Edit

AndreJ's answer is what I was looking for. This is the correct way to change the files. The file size remains the same and it processed 600mb in about 3 minutes.


texts: Too many contours labels are showing up in ArcMap, not just ones for selected subset?

texts:
I created a shapefile for contours lines on the basis of a raster. Since I am interested in just 5 contours (out of, say, 50), I selected for display just the contours I am interested in. I achieved this from:
properties > symbology > categories > unique values (from the 'contour' shapefile menu).

As expected, ArcMap is showing only the selected contours, BUT the labels of all the contours are actually showing up. I did not manage so far to fix this issue.


texts:
I'm working with large PostGIS tables in QGIS but really only need to do simple visualization and editing the attributes (like change road names, speed limits, etc).  The most processing I need to do is just a simple join by attributes between a couple tables.  The large datasets are about 400 MB.

Are there ways to speed up things loading the attribute table and rendering the map?  If not, are there any other good GIS software designed to handle bigger datasets?  Or is it really just an issue of optimizing my network connection and postgres database?


texts: How to label a road with my symbol multiple times?

texts: I am trying to label a road that I create with Select Features, with a symbol multiple times along the road. Is it possible to recreate my symbol multiple times along the road to label it?


texts: Computing annual spatial (zonal) statistics of a NetCDF file for polygons in shape-file

texts:
I have a NetCDF-file containing annual GDP data for Africa. I also have a shape-file containing provinces in Africa as polygons.

I now want to compute statistics (ie. mean, sum, ...) per polygon based on the data of the nc-file in this polygon using python.

Have tried various approaches with xarray, rioaxarray, rasterio, etc., but none of them worked.

Has anyone a code snippet/approach how to code that correctly?


texts: Changing DPI of Composer Output in QGIS?

texts:
I need to export and print a high quality raster image as a pdf from QGIS 2.18.

No problem exporting the image as a pdf from composer but how can I change the DPI output to maximize quality?


texts: Add a NoData buffer to a raster with rasterio

texts:
I am currently trying to extract Web Mercator tiles from a Geotiff raster using rasterio VRT (version 1.0rc5). The tiles sometimes exceed the extent of the raster, which causes me trouble.

Reading the tile with data = vrt.read(window=tile_window, out_shape=tile_shape) gives me corrupted result, instead of a cleanly cropped tile (I would expect to have NoData values out of the raster extent). According to the doc, the parameter boundless=True seems to do what I want, but it does not work for WarpedVRT.

I am trying to find a workaround by adding a NoData buffer around my raster. Is it possible, and, if so, how can I do it?

My simplified code:

with rasterio.open(image) as src:

    extent = ...
    tile_shape = ...

    with WarpedVRT(src, crs='EPSG:3857', resampling=Resampling.bilinear) as vrt:

        # Window for reading the dataset
        tile_window = vrt.window(extent.x_min, extent.y_min, extent.x_max, extent.y_max)

        # Read tile content (boundless mode does not work yet for WarpedVRT)
        data = vrt.read(window=tile_window, out_shape=tile_shape)

Edit to illustrate the issue:

The tile I want to extract (there are 3 or 4 rows of pixels et the very bottom of the tile):

What I get from rasterio.vrt:


texts: How to perform PCA with 2 different Landsat scenes

texts: I want to perform PCA on 2 sheets of Landsat imagery with different acquisition time and coordinates. Prior to processing, should I combine both into one scene (mosaicking process)? If so, how is the procedure pre-processing. Is it possible I could process them separately?


texts: Route optimisation for multiple vehicles

texts:
I have 100 destinations and 5 vehicles and I need to code a solution that efficiently routes the vehicles to each destination, so each destination is visited by 1 of the vehicles. Some of these destinations could have time windows to be visited during as well.

I'm using PostgreSQL and PostGIS, and was looking to use pgrouting but I'm not sure it's suitable for multiple vehicles - from my limited knowledge of Dijkstra etc I think they're designed for a single vehicle.

Any thoughts on whether pgrouting can solve this problem, and if so, any code examples? If not, are there any open-source alternatives that can do it?


texts: How to load multiple images with the same CRS?

texts:
When I add several images to QGIS 1.8 it asks the coordinate reference system for each one. There are several seconds in between the dialog and it is not easy to just continue working as the dialog keeps popping up with focus.

Is there any way to check "the same" CRS for all selected (inserted) rasters?
With 10 it is not that big of a deal but when it is 100 it seems to occupy a lot of time.

I normally use the gui so writing a batch program is not what I am looking for.
I select NOT all of the images in a given folder.


texts: Changing Coordinate System of Census TIGER data in ArcGIS

texts:
I have the block group files from the Census TIGER dataset, and am trying to line them up with some GIS Data from HUD.

When I load them both into ArcGIS, I see that the files do not quite align, when they should:

Using this site (http://prj2epsg.org/search), I discovered that the TIGER files use the NAD83 GCS, while the HUD files use the WGS 84 GCS.

Assuming the different coordinate systems was the cause of the misalignment, I attempted to use the Project tool in ArcToolbox to project the TIGER files to the WGS 84. However, after doing so, and loading in the newly created layer, I end up with the exact same picture as above, even though both layers are now in WGS 84.

I'm a little lost on what to do now.

As requested, I am including screenshots showing the projection process.


texts: Geocoding with Latitude and Longitude in OpenLayers3

texts:
I have Longitude and Latitude, I would like to connect to Geocoding or Nominatim and get the address of these Lat and Lon.

I want to do it in OpenLayers 3 using OSM.

With help from @ThomasG77, I implemented ReverseGeocoding in my code with this function:

function simpleReverseGeocoding(lon, lat) {
    fetch('http://nominatim.openstreetmap.org/reverse?format=json&lon=' + lon + '&lat=' + lat).then(function(response) {
      console.log(response.json());
      return response.json();
     }).then(function(json) {

     return json.display_name;
    })
  }

But the answer of the JSON is:

Promise { <state>: "pending" }

When I show the address in my console:

console.log('http://nominatim.openstreetmap.org/reverse?format=json&lon=' + lon + '&lat=' + lat);

The address that it send is Kenia, or "Unable to Geocode"

Obviously, console.log(json.display_name); is undefined.

Do I have to know something about headers or something similar?


texts: QGIS select by location and use field calculator python

texts:
I am trying to automate the repetative task of selecting by location and updating a field according to the selection. The issue is that field calculator uses all features instead of the selected. Is there a simple way to do this with qgis python? Here is my code:

import processing
moment_all = iface.activeLayer()
moment_all.startEditing()
processing.runalg("qgis:addfieldtoattributestable","filepath.shp","blast",2,2,0,"/Users/pgcseismolab/Desktop/qgis/moment_all.shp")
processing.runalg("qgis:selectbylocation","filepath.shp","filepath2.shp",['within'],0,0)
processing.runalg("qgis:fieldcalculator","filepath.shp","blast",0,10,3,False,"'b'","filepath.shp")
moment_all.commitChanges()

A similar thread I've found is here QGIS selecting features and using field calculator to update existing field using python, though I don't think it works for my situation. Would graphical modeler be a better way to do this?


texts: Rescaling Landsat-8 SR to surface reflectance

texts:
I want to rescale the Landsat-8 SR image using the rescale factor in the documentation, which is 0.0001 for each band. I assume that the original values are DN values, and after rescaling I can get reflectance values (Is it right?).
After applying the rescaling factor the image only shows 0 values. I am also using a .int16() to keep it as an integer, but it does not work. It seems that I am missing some steps in this process.
This is the code:
// Landsat 8 - Image
var image = ee.Image("LANDSAT/LC08/C01/T1_SR/LC08_016039_20190107");

// Rescale image
var rescale = image.divide(10000).int16()

//RGB color palette
var rgbVis = {
  min: 0,
  max: 2000,
  bands: ['B4', 'B3', 'B2'],
};
var rgbVis2 = {
  min: 0,
  max: 0.2,
  bands: ['B4', 'B3', 'B2'],
};

// Add to map
Map.centerObject(rescale)
Map.addLayer(image, rgbVis, 'Original');
Map.addLayer(rescale, rgbVis, 'Rescaled');

Link to the code editor:
https://code.earthengine.google.com/abb6f59a90864368dd462e3267072834


texts: Splitting multiband raster into multiple bands using ArcGIS ModelBuilder?

texts:
I'm using the ModelBuilder functionality in ArcGIS, and would like to take a raster that contains 4 bands, clip it with a polygon and then make NDVI from the clipped file. To do that, I need access to the different bands in the raster. In QGIS (where I'm coming from), some libraries don't preserve all 4 bands.

In QGIS, the raster calculator menu gave access to all of the bands, but ArcGIS doesn't seem to. Examples I've found breaks the raster into multiple entities in the model builder and works with those?

In ModelBuilder, how would you go about breaking the raster into its 4 bands?


texts: Normalization of Kernel Density Estimate rasters in ArcGIS 10

texts: I've been told by several GIS instructors that the pixel values of a Kernel Density Estimate raster output by the point KDE tool in ArcGIS 10.1 represents the probability of encountering a point, not the density of points at that location. I've been told that the KDE surface is normalized to a probability density surface by dividing the surface by the total number of points used to make it. My problem is that there is no reference to this normalization procedure in the ArcGIS help files at all, with the possible exception to a reference to the paper by Silverman (1986) from which the quadratic kernel function used in ArcGIS 10.1 is derived. Can any one tell me if this is the case? In addition, if this is the case, if you select a field value instead of just using the point location to build the KDE surface, does this normalization procedure still occur, and how would you interpret the surface?


texts: Agglomerate nearby points and sum attributes

texts: I've got a number of ticket outlets, each of which has annual sales as an attribute. I'm looking to represent outlets that are near to each other (within 100m) as one single large outlet, with the sum of its composite outlets kept as an attribute. What's the best way to do this?


texts: Google Earth Engine: Get Variable by name string

texts:
Situation
I have a list of variables:
// Example data
var data_2016 = 7;
var data_2017 = 9;
var data_2018 = 5;
var data_2019 = 2;

I would like to loop through a selection of these variables, by specifying years, e.g. 2017 to 2019, ultimately applying a range of functions to the variables.
// Specified year range
var startyear = 2017;
var endyear = 2019;

// Set up loop: Make list of years
var years = [];
for (var j = startyear; j <= endyear; ++j) years.push(j);
var years = years.map(String);

// The main loop
var i;
for (i = 0; i < years.length; i++) {
   var yr = years[i];
   var img = 'data_' + yr;
   print(img);
}

Here is the link for this example.

Question
How do I call the actual variables, rather than just the string? In R, I would be using get() for this. The expected output for this example would be 9, 5, 2.
Tried so far
I have tried solutions for javascript, but none of them seem to work:
var img = 'data_' + yr
var img = window[img];

var img = 'data_' + yr
var img = eval[img];

var img = 'data_' + yr
var img = this[img];


texts: Creating a point buffer along a road network

texts:
I have a road network and have added points indicating fire hall locations.

How would i go about creating buffers on those points following the road line.

The result am i looking for would create a buffer from the fire hall to 5km away on all possible roads/paths.

I do have the full OSGeo suite. Currently using QGIS 2.0.1

Thanks


texts: Adding current row in arcpy.SearchCursor to selection

texts:
I want to make a code that select all unique values of a field in a attribute table. However, while everything in the code apparently works, I don't know how to add the current row in the Search Cursor in my selection.

    layer = parameters[0].valueAsText
    mylist = []
    rows = arcpy.SearchCursor(layer, fields="Surveyor")
    for row in rows:
        value = row.getValue("Surveyor")
        if value not in mylist:
            mylist.append(value)
            arcpy.SelectLayerByAttribute_management(layer, 'ADD_TO_SELECTION')
    arcpy.AddMessage(mylist)
    return

On the message (second last line), the program prints a list with 3 unique values. Yet, the code always select every single row. Makes sense, since there was no filter on my SelectLayer, so it just select the whole layer. So I tried using a field with Unique Values:

    layer = parameters[0].valueAsText
    mylist = []
    rows = arcpy.SearchCursor(layer, fields="Surveyor, uniqueID")
    for row in rows:
        value = row.getValue("Surveyor")
        myid = row.getValue("uniqueID")
        if value not in mylist:
            mylist.append(value)
            arcpy.SelectLayerByAttribute_management(layer, 'ADD_TO_SELECTION', '"uniqueID" = myid')
    arcpy.AddMessage(mylist)
    return

But no success, it still selects the whole layer. So, how I make the SelectLayerbyAttribute to add to the selection only the row that the cursor is located?


texts: Determining statistical relationships between rasters using R vs ArcGIS Desktop?

texts:
I am trying to analyze how sets of rasters relate to each other using some statistical techniques. As, I don't have much experience using the spatial statistics tools in ArcGIS I was exporting my rasters as Ascii files, and analyzing them using R (specifically the maptools package, and readAsciiGrid() ). This has been functioning ok (but as the datasets have 90,000 points it is slow to run the analysis), but I don't know if I am recreating in R, existing functionality in ArcGIS.

For example, I want to perform regressions between each of these rasters using a few different transformations (logarithmic, exponential, etc). Can this be done within ArcGIS? A second broader question is if there are standard statistical methods for examining this type of data?

Each raster pair has matching data/no-data values and all parameters are identical, aside from the gridcell value.


texts: Export WMS layer to PDF using Openlayers and Geoserver

texts:
I'm trying to replicate this https://openlayers.org/en/latest/examples/export-pdf.html pretty simple, you press the button and whatever is on the map gets exported to a pdf file, I tried copying the code from here, but it won't work on my project, here:

https://jsfiddle.net/m77t3esb/

Now you can't see my layers as you don't have my geoserver, but this is what its supposed to look like normally.

When you press the guardar capa button, it should download a pdf file titled map.pdf, but instead, this happens.

The map gets distorted and nothing is downloaded.

The part of the code that should export is this

var raster = new ol.layer.Tile({ source: new ol.source.OSM() });

var dims = { a0: [1189, 841], a1: [841, 594], a2: [594, 420], a3: [420, 297], a4: [297, 210], a5: [210, 148] };

 var loading = 0;
  var loaded = 0;

  var exportButton = document.getElementById('export-pdf');

exportButton.addEventListener('click', function() {

exportButton.disabled = true;
document.body.style.cursor = 'progress';

var format = document.getElementById('format').value;
var resolution = document.getElementById('resolution').value;
var dim = dims[format];
var width = Math.round(dim[0] * resolution / 25.4);
var height = Math.round(dim[1] * resolution / 25.4);
var size = /** @type {ol.Size} */ (map.getSize());
var extent = map.getView().calculateExtent(size);

var source = raster.getSource();

var tileLoadStart = function() {
  ++loading;
};

var tileLoadEnd = function() {
  ++loaded;
  if (loading === loaded) {
    var canvas = this;
    window.setTimeout(function() {
      loading = 0;
      loaded = 0;
      var data = canvas.toDataURL('image/png');
      var pdf = new jsPDF('landscape', undefined, format);
      pdf.addImage(data, 'JPEG', 0, 0, dim[0], dim[1]);
      pdf.save('map.pdf');
      source.un('tileloadstart', tileLoadStart);
      source.un('tileloadend', tileLoadEnd, canvas);
      source.un('tileloaderror', tileLoadEnd, canvas);
      map.setSize(size);
      map.getView().fit(extent);
      map.renderSync();
      exportButton.disabled = false;
      document.body.style.cursor = 'auto';
    }, 100);
  }
};

map.once('postcompose', function(event) {
  source.on('tileloadstart', tileLoadStart);
  source.on('tileloadend', tileLoadEnd, event.context.canvas);
  source.on('tileloaderror', tileLoadEnd, event.context.canvas);
});

map.setSize([width, height]);
map.getView().fit(extent);
map.renderSync();

  }, false);

I'm pretty sure that the issue is with the variable raster there, as I don't fully understand what it does, and I don't know how to make it work on my project.

Previously I was trying to import to png, but was unable to do it and couldn't get much help here, so I'm hopefully trying something else.


texts: Consuming ArcGIS Server map services from WCF

texts:
I am consuming some map services in my WCF services and for each service that I have I get the client object via this code. Every new service that I add, I get the client object this way. I am curious if I can consume the map service using it's URL so that I dont have to add the map service as a service reference. I would like to use the URL of map service to create client object. Appreciate any feedback.

MapServerPortClient client = new WellMapService.MapServerPortClient();
OR
MapServerPortClient client = new PipelineMapService.MapServerPortClient();


texts: Using pymssql to create a table using python ArcMap 10.3

texts:
I am using ArcMap 10.3 have a my data in a geodatabase (MS SQL Server Express) and I am trying to write a python script that does a bunch of spatial and non-spatial data manipulation.

I need to dump results into non-spatial tables in MS SQL Server so I can run queries off of them.

However, I cannot seem to get my CREATE table query to run properly.  I have tried a bunch of variations of this query (e.g. putting dbo. etc) to no avail.

import arcpy
import os
#  Set environment variables for pymssql
import pymssql
server = os.getenv("DRAKE\SQLEXPRESS")

conn = pymssql.connect(server="DRAKE\SQLEXPRESS",database="NATA_Data")
cursor = conn.cursor()
cursor.execute('CREATE TABLE tempIntersect_withNATA (ZIP varchar(max), Measure varchar(max), HAP varchar(max), Result decimal(35,30))')
conn.close()

Nothing seems to happen, even when I paste it into the ArcMap python window.  I have created a simple query such as cursor.execute('SELECT * FROM NATA_All') and that does hook to my database and retrieve data.


texts: I am developing an ArcGIS desktop addin. I am attempting to get the distance units (ft, mm, km, etc.) from a layer in my .mxd and display it on a windows form. How can I do this? I can access the distance units of a map by using IMap.DistanceUnits, but I have had trouble accessing the distance units of an individual layer.


texts: why won't the view options for the attribute table under "data; existing file" window not display with Trimble GeoXT?

texts:
I'm using the Trimble GeoXT and TerraSync version 5.3.

I'm in TerraSync under Data -> Existing File -> and chose a shapefile to open up and view. It immediately displays the attribute table, however, the only field displayed is "distance". When navigating to "options" -> "view", it will let me click on any of the other options including, number, name, label 1, label 2, update, and filter,  as if it were to put a check mark next to it and display that field in the attribute table but it does not!

I know everything displays and all of my data is associated in map view when I click on the features. It just will not display the other attributes in the table. It is not just this one shapefile either, no matter what file I choose to open it displays the table the same.

It only started doing this when I just recently opened the shapefile and was curious with how things displayed in the attribute table so I navigated to options -> view, and un-checked everything except "distance" just to see what it would do. Now it will not let me re-check them.

I've tried a soft and hard reset.


texts: Calling Web Geoprocessing Services From Other Programs

texts:
Where can I go to find information about calling ArcGIS Server geoprocessing services from other programs like a .NET Framework program or possibly even a SQL Server job?

So far, I've found Using ESRI geoprocessing services from a non-ESRI client (Python)? which seems to indicate that I'll have to put together a program to call the REST interface from scratch.


texts: How to stop requesting tiles after a certain zoom level in OpenLayers

texts:
I am using OpenLayers to create a map. The base of the map is being created using XYZ as the source. I only have till certain zoom level and i was wondering if there is any way to make the browser stop requesting more tiles after a certain zoom level.

  GET http://localhost:4200/assets/tile/14/5/3.png 404 (Not Found)


texts: GeoServer getfeatureinfo replaces HTTP href link in attribute value. Why?

texts:
We are using GeoServer (version 2.12.1) to deliver a rich HTML-attribute on the getfeatureinfo request. This allows us to add a table when the format requested is in HTML. This will of course not look nice when requesting the getfeatureinfo in any other format. But here it is not relevant.

In the table we deliver in the attribute we have a link to a factsheet. It would seem the link is rewritten so that it now looks like this:

  https://maps.ourdomain.xx/geoserver/ourworkspace/%22https://factsheet.factsheetprovider.xx/?id=vv01234%22

%22 equals ", so this is what it says...

  https://maps.ourdomain.xx/geoserver/ourworkspace/"https://factsheet.factsheetprovider.xx/?id=vv01234"

My freemarker template (content.ftl) look like this:

Informasjon om prioriterte områder

<#list features as feature>
  <#list feature.attributes as attribute>
        <#if attribute.name=="html_content">
        ${attribute.value}
      </#if>
  </#list>

</#list>

Seems like https://maps.ourdomain.xx/geoserver/ourworkspace/ is added by GeoServer.

Is there a way around this? What am I missing?


texts:
INTRO

A bit of tool introduction, but the problem is not related to this directly.

I have an app in CesiumJS.

I am using Cesium World Terrain, and get altitude using Sample Terrain Most Detailed

This would allow me to As is typical of the Cartographic type, the supplied height is a height above the reference ellipsoid (such as Ellipsoid.WGS84) So getting an height in WGS84.

PROBLEM

I have my WGS84, but I am using a server that require an altitude in MSL, not WGS84. Which require me to convert my WGS84 altitude to MSL.

Over the internet I found that a way would be

MSL = GPS - GEOID

I then took some measure using those sites :

Geoid Height Calculator ;
Find Altitude on Map; and
my Cesium app.

And found the following difference (in meter)

GPS   |  CESIUM       | GEOID      |  DIFF (GPS / CESIUM)

669   | 705           | 49.421     | +36
52    | 88            | 37.162     | +36
51    | 36            | -15.992    | -15
0     | -86           | -98        | +86

From what I understood, GPS and WSG84 should be the same, so my GPS and my Cesium altitude should be the same...

But it turn out that, if I use the previous formula I do find the correct value for GPS, but not with my Cesium WSG84 value.

QUESTION

When referring to altitude, are WGS84 and GPS measure identical, or is GPS just based on WGS84 but require additional conversion to retrieve a WSG84 altitude ?


texts:
I am trying to use a 200GB ortophoto tif file in a web application using OpenLayers library. As I don't have no software to create WMS WMTS etc. I want to use OpenLayers.Layer.XYZ.

How can I create files required for that (the small tiles and any other metadata file)?

Can I just place that in my web directory or do I need a handler to translate the requests from OpenLayers to find the tile and ship it back?


texts: Installing raster resampling module in QGIS 1.8

texts:
On the website of Sourcepole, I have recently come across the case of resampling images in Quantum GIS. Because I am rather a beginner in GIS software I would like to ask you for information about how I can enable/install the resampling option (as shown here) on QuantumGIS 1.8., (perhaps it is obvious, but not for me).

I would be very grateful for any information.


texts: Resize vector marker according to zoom (i.e. marker constant size in meters) in Leaflet?

texts:
I have a map with 20 markers on a geojson layer. They are all from the same SVG and represent a certain area on the map (meaning they represent a circle of constant radius in meter on the map). I need these marker to adapt their size according to zoom level.

I've tried to use a circle as a marker. But my marker needs to be a SVG because it is complex graphic and radius doesn't apply to markers.

I think each time zoom level changes marker size should be resized proportionally to the new zoom level but I don't know how to achieve this.

He's how the markers are displayed, parsed from a csv sheet :

    for (i in chapters) {
        var c = chapters[i];
        if (!isNaN(parseFloat(c['Latitude'])) && !isNaN(parseFloat(c['Longitude']))) {
            var lat = parseFloat(c['Latitude']);
            var lon = parseFloat(c['Longitude']);
            var cercleDirection = parseFloat(c['Direction']);
            var photoIcon = L.icon({
                                iconUrl: 'media/Cercle.svg',
                                iconSize: [220, 220],
                                iconAnchor: [110, 110],
                            });
            markers.push(
                L.marker([lat, lon], {
                    icon: photoIcon,
                    rotationAngle: cercleDirection

                }));
        } else {
            markers.push(null);
        }

Another way maybe

I did find this approach online that seems interesting. But I couldn't have more explanation from the author that remains silent :

var layer = ''; // what would be the layer name in my case ?
map.on('zoomend', function() {
    var currentZoom = map.getZoom();

    //Update X and Y based on zoom level
    var x= 50/currentZoom; //Update x
    var y= 50/currentZoom; //Update Y
    var LeafIcon = L.Icon.extend({
        options: {
            iconSize:     [x, y] // Change icon size according to zoom level
        }
    });
    layer.setIcon(LeafIcon);
});


texts: QGIS 3.45 Layers Panel point data labels set too far apart

texts:
The Layers Panel in v 2.18 is fine but we are now trying to go live with 3.45 and are experiencing issues with the display of some layers in the panel.

Layers that are generated from an MSSQL spatial Database are displaying so that the symbology is so stretched out that it is unreadable.

If I go to the Layer Properties and click apply it reverts to what it should look like but as soon as I leave properties and interact with the layer i.e. try and untick a symbol it immediately extends the symbols so far below the layer heading that I can't see them. It also removes the label but retains the symbol.


texts: display point with absolute size (diameter) from attribute

texts:
I have a point file with an area attribute.  I've since edited the table to  back-calculate an equivalent circular diameter, with an additional field to suit (with a view to simplifying the procedure).

Can I style the point style to display points with an absolute size (diameter in meters) equivalent to the diameter (meters) attribute?

Even more preferably - could I style the point to display an absolute size (diameter in meters) equivalent to the area attribute?

Existing guides I've seen seem to make reference to styling tools in previous QGIS versions that now don't seem to exist.


texts: Using data from my cartodb in my search box

texts:
I would like to use the data on my cartodb in the search function using SQL API. Please help me understand what is missing form my code because when i use my search, i get this error:-

  (Bad Request)send @ cartodb.js:5ajax @ cartodb.js:5a.execute @
  cartodb.js:23a.getBounds @ cartodb.js:23(anonymous function) @
  cartoEx2.html:66dispatch @ cartodb.js:4h @ cartodb.js:4

My code is as follows:-

<!DOCTYPE html>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

   <link rel="stylesheet"
      href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />

  <input type="text" name="ad" value="" id="ad" size="10" />
  <button type="button" id="searchButton">Search</button>


texts: How to connect points to line in Mapinfo?

texts:
I am using Mapinfo and Mapbasic.

I have all the points stored in a DBMS.
I have four columns with four points longitude and latitude.
Is there any way to connect the points?

I am using Mapinfo 10.5 with MySql as database.


texts:
Context: ArcGIS applications for one of our customers are currently running on multiple sites in Americas, Europe, Australia and Africa geos (15 different countries). They are considering a cloud model. As you all are aware AWS provides 5 regions and support few edge locations for each of the regions.

Challenge: The coverage is not adequate for the current scenario. Considering that the applications are currently hosted at 15 different locations. Running intensive analysis on a ArcGIS cloud based solution results into a substandard user experience is my understanding.

Question: My question to the experts on this forum is cloud a suitable model to be recommended for my client. I have read about caching and elastic caching but are they really going to be effective considering the geo spread. My major concern is around latency with EC2s limited coverage and hence user experience will be taking a big hit.

Case Studies: I am keen to hear about case studies of similar nature use cases if any.

Thanks in advance.

Regards,
Sameer


texts:
I have received many unclipped Colour Infrared Aerial photos (around 1000) which have been georeferenced but still have the black thick borders including flight information etc. The images are of course not perfectly aligned and their borders are also unfortunately not perfectly square. (See attatchment)

Does anyone know of a method to somehow automate or simplify the process of cutting the borders out?


texts: How to install QGIS 1.8 plugin Georeferencer?

texts:
My question is about QGIS 1.8 georeferencer plugin.

I installed the new version of QGIS (1.8) but I don't have the georeferencer plugin, how do I install it?

I used the georeferencing plugin with QGIS 1.6 and now that I've upgraded to 1.8 I'd like to use it again, but it's not available! Am I doing something wrong?

I've gone to Plugins > Manage Plugins. I've searched for Georeferencer, but there were no results.


texts: Applying SPEI::hargreaves function to time series from each pixel rasterbrick using R?

texts:
library(SPEI)
library(raster)

Basically, given a monthly time series for two variables a and b as follows:

a = array(1:(3*4*12*64),c(3,4,12*64))
a = brick(a)

dates=seq(as.Date("1950-01-01"), as.Date("2013-12-31"), by="month")
a<- setZ(a,dates)
names(a) <- as.yearmon(getZ(a))

b = array(1:(3*4*12*64),c(3,4,12*64))
b = brick(b)

dates=seq(as.Date("1950-01-01"), as.Date("2013-12-31"), by="month")
b<- setZ(b,dates)
names(b) <- as.yearmon(getZ(b))

Both a and b are time series with a time dimension. Now, I would like to apply the function SPEI::hargreaves to time series of each pixel in a and b and return a rasterbrick C

From the SPEI package ,  har <- hargreaves(TMIN,TMAX,lat=37.6475). Here, consider Tmin=a, Tmax=b and lat=latitude of each pixel which is the same in a and b. I will parallelize the process once I get an idea how to apply the function to my rasterbricks.

At the moment, I am using data.table to collapse my rasterbricks and then applying  hargreaves to the table. This approach is very inefficient so far.


texts: How to access the road graph plugin in python?

texts:
I am developing a few scripts in Python for QGIS 1.8 to automate some geo-tasks and one of them would be to calculate the shortest distance from a hospital to each building in a town.

I would like to take advantage of the already existing Qgis plugin but, as it is a C++ plugin, I am not sure whether it is possible to access it from Python? Is there a binding or a trick for that?

If not, any further advice would be appreciated! As the base data is OpenStreetMap data stored in a PostGIS DB, I may also try with pgRouting. But the QGIS plugin would be my favourite choice if possible.

PS: this question is close to this one: Is there a way to access QGIS plugins in Python? but I believe it's still different enough to be worth a new thred.


texts: Quick Map Service - Update Broke Quick Map Service

texts:
I recently triggered an update of my Quick Map Service plugin.  The update I am trying to update to 0.19.10.1.  I have QGIS 2.18.19.  Once I ran the update, I received the following error:

Plugin Broken
ImportError: cannot import name uic.


texts: ISODATA unsupervised classification in ArcMap 10.1

texts:
I’m doing a project on landsat 5 images.
I’ve composited the images into 1 raster, and I want to classify the raster with ISODATA Unsupervised Classification.
How do I calculate the best number of classes in each group, the sample interval and the best minimum class size?
thanks!


texts: How can I accurately measure area of polygons using field calculator in qgis?

texts:
I have several polygon shapefiles, both set to WGS84 CRS.  I have been using the google basemap with the Openlayers plugin, using the mercator CRS.  On the fly CRS transformation is enabled.  Should my shapefiles be set to the same thing as the google basemap?

When I use the measure area tool (View>Measure>measure area), the areas of the polygons in my two shapefiles are accurate.  However, when I try to calculate the area using the Area function of the field calculator, the values are incorrect.

I have read posts saying that the openlayers plugin distorts the areas.  I tried saving the shapefiles as wgs84, opening them in a new project, and calculating the areas, but the values were the same.  I am in Pennsylvania, USA.  If not the mercator CRS, what should I use? Should find an alternative basemap?


texts: Remove layers references from geoprocessing tool

texts: When I run my tool it is calling some geoprocessing tools and performing some operations on some layers but when i delete those layers from arcmap then those layers are removed from arcmap but not from Geoprocessing tool. Please tell me how to remove layers references from geoprocessing tools programmatically.


texts: How to add dataURL image as source in OpenLayers?

texts:
I am building a web application with OpenLayers that should have offline map support. I save pictures from a WMS server to the browser cache and load them from the cache as a dataURL. The next step is to input the dataURL to an tileWMS source in OpenLayers. When examining the documentation there seems to be an option called tileLoadFunction that should allow a dataURL to be passed in and added as the source. However I'm not able to understand how to use this option.
Does anyone know how to use the tileLoadFunction or know of some other way to input a dataURL as a source in OpenLayers?


texts: QGIS actions - get currently selected attribute column (with python?)

texts:
I'm trying to open files dynamically through actions. A simple example would be:

Action name: OpenLink

from PyQt4.QtCore import QUrl;
from PyQt4.QtWebKit import QWebView;

myWV = QWebView (None);
myWV.load(QUrl('[% "myColumn" %]')); myWV.show()

However this example is working with a fixed column name (myColumn). What I want to do is execute the action using whatever column in the object attributes I have selected.

Let's say I have three columns:

mycolumn
myColumn2
myLink

when I right-click myLink, I would like to use the value from it in the above action. Is that possible?

Image:


texts:
select distance(T1.Geom,T2.Geom) as Distance, T1.POI_ID, T2.LINK_ID
from temp1 as T1, temp2 as T2 where T1.POI_ID = T2.POI_ID AND Distance < 100

temp1 having point geometry
temp2 having line geometry

While I running above query through C# program I am getting Error ::

Assertion failed !

Program: ...
File: geos_ts_c.cpp
Line : 3472

(look attached snapshot)

I am having database in .db format.
I am using SQLlite and spatialite for gis functionality.

From code ::

I am loading spatialite.dll and then with sqllitecommand running query..

ExecuteStatement("select load_extension('spatialite.dll')", con);
SQLiteCommand selectCommand11 = new SQLiteCommand(selectSQL10, con);
SQLiteDataReader dataReader10 = selectCommand11.ExecuteReader();

anybody have idea why I am getting this error ? and how can i resolve this ?


texts: How to add an existing QGSVectorLayer to QGIS project?

texts:
I know I can pull a vector file into my current project using:

vlayer = iface.addVectorLayer(r"S:/Data/Natural_Earth_quick_start/110m_cultural/ne_110m_admin_0_countries.shp", "admin", "ogr")

But if I create my layer using something like:

vlayer = QgsVectorLayer(r"S:/Data/Natural_Earth_quick_start/110m_cultural/ne_110m_admin_0_countries.shp", "admin", "ogr")

and then I do some processing on vlayer how do I then add it to the current project or map layers list?


texts: Reading Attributes from Attributed Relationship Class ArcObjects

texts:
I have an M-N relationship class with attributes. I am listening to the IRelationshipClassEvents.OnCreate Event event to see if any new relations are created. How can I read these attributes from an IRelationship?

private void m_editEvents_OnCreateRelation(IRelationship rel)
{
    //how to get the attribute here?
}


texts: Using QGIS ComboBoxManager: adapting for QGIS plugin

texts:
I'm looking for more guidance using the QGIS ComboBoxManager module (http://3nids.github.io/qgiscombomanager/). After finally getting the imports correct, I'm trudging my way through learning how to use it. I'm creating a simple plugin that utilizes three separate combo boxes to choose layers. Accepting the initial dialog runs a series of calculations based on data associated. Adding attribute list to combobox in a python plugin got me off to a good start, but I'm new to this, and having some issues adapting the example.

Some code from my plugin's main .py:

class zConso(Ui_zConso, VectorLayerCombo):

def __init__(self, iface, QComboBox, initLayer="", options={}):
    # Save reference to the QGIS interface
    self.iface = iface
    VectorLayerCombo.__init__(self, QComboBox, initLayer, options)

    self.layerChanged()
    self.indivComboManager = VectorLayerCombo(self.indivCombo)
    self.grosComboManager = VectorLayerCombo(self.grosCombo)
    self.resComboManager = VectorLayerCombo(self.resCombo)

    # Create the GUI dialog (after translation) and keep reference
    self.dlg = zConsoDialog()

    # current layer ref (set in handleLayerChange)
    self.indivLayer = None
    self.grosLayer = None
    self.resLayer = None

def initGui(self):
    # connect the action to the run method
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)
    #self.action.triggered.connect(self.run)

    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&zConso", self.action)

    QObject.connect(self.dlg.ui.indivCombo,SIGNAL("currentIndexChanged(int)"),self.layerChanged)
    QObject.connect(self.dlg.ui.grosCombo,SIGNAL("currentIndexChanged(int)"),self.layerChanged)
    QObject.connect(self.dlg.ui.resCombo,SIGNAL("currentIndexChanged(int)"),self.layerChanged)

def layerChanged(self):
    self.indivLayer = self.indivComboManager.getLayer()
    self.grosLayer = self.grosComboManager.getLayer()
    self.resLayer = self.resComboManager.getLayer()
    if self.layer is None:
        QMessageBox.warning(
            None,
            'Statistic AEP',
            'Choissisez des couche pour calculer des statistics de consommation AEP')

My plugin imports as broken:

__init__() takes at least 3 arguments (2 given)

I'm not sure I'm going about this the right way. Do let me know if you can make a suggestion.


texts: Changing climate grid values by adding decimal point numbers

texts: I have climate grids (based on climate data from 1961-1991) which I have converted from ascii to raster in ArcGis 10.2.2. The temperature is in degrees celsius. I want to alter the temperature values to incorporate future climate changes in the temperature. I want to alter the whole grid by the same number, but the numbers I want to add to the grid are 0.3 or 0.8 etc, therefore reclassify is not possible.  I do not have another layer or grid, I just want to add numbers to the current grid values, for example, all grid values + 0.3°C. Would this be possible using the raster calculator and how would I do it?


texts: How to avoid holes in polygons from lines?

texts:
I am trying to convert a dataset of lines that contains the coast of New Zealand into a big polygon.

However using the vector -> geometry tools -> lines to polygon command in Quantum GIS results in a mess with lots of holes and lines outside of the coast.

How can I do the conversion successfully?

It worked on the 1:500k data, the 1:250k data, but not the 1:50k data.

I have a screenshot of the problem here - before and after:

The dataset is from here.


texts: Removing overlapping part of polygons using QGIS?

texts:
Here is what I'd like to achieve in QGIS.

Is there a processing tool to remove the overlapping part of polygons?

It is also very important that they do not get merged during the process and that they keep their original attributes since I need to work with them afterwards.


texts: Replacing data source of annotation feature classes using ArcPy?

texts:
I want to batch replace paths in a series of .mxd files using Python. Many of the layers have moved and in some cases the name has changed or its dataset is different.

I've written this code which takes an Excel file with two columns (one column for the old path and one column for the new path) and converts to a dictionary. Then I iterate through the layers in my .mxd files, and iterate through the dictionary, using replaceDataSource to change the data sources.

The trouble is this won't work with annotation feature classes. I've added in a try/except with findAndReplaceWorkspacePath to see if that may work (I don't believe the annotation layers/names have changed), but the code still doesn't address those layers.

One thing to note is that the annotation feature classes are stored in a personal geodatabase, but I don't know if this could be causing any issues.

I am hoping someone has ideas on code that will work to change the path of the annotation feature classes!

Here is my code:

import xlrd, arcpy, os

mxd_path = r'C:\temp\Chapters'

d = {}
wb = xlrd.open_workbook('U:\GIS\Chevron_Lokern\Projects\Figures_Update_2014\Lokern_Source_Paths_KL.xls')
sh = wb.sheet_by_index(0)
for i in range(293):
  cell_value_class = sh.cell(i,0).value
  cell_value_id = sh.cell(i,1).value
  d[cell_value_class] = cell_value_id

  for dirpath, dirnames, filenames in os.walk(mxd_path):
    for filename in filenames:
      fullPath = os.path.join(dirpath, filename)
      if filename[-4:] == ".mxd":
        mxd = arcpy.mapping.MapDocument(fullPath)
        print filename

        for lyr in arcpy.mapping.ListLayers(mxd):
            if lyr.supports("DATASOURCE"):
                #print lyr.datasetName
                for k,v in d.iteritems():
                    #print k,v
                    k_path, k_name = os.path.split(k)
                    v_path, v_name = os.path.split(v)
                    if lyr.dataSource == k and k != v:
                        #print 'KEY:',k,'VAL:',v, 'NAME:',v_name
                        try:
                            print 'trying to change data source for',lyr.dataSource
                            lyr.replaceDataSource(v_path,'FILEGDB_WORKSPACE',v_name,True)
                        except Exception as e:
                            print 'can\'t replace',lyr.dataSource, e
                            try:
                                print 'trying to change data source for',lyr.dataSource
                                lyr.replaceDataSource(v_path,'RASTER_WORKSPACE',v_name,True)
                            except Exception as e:
                                print 'still can\'t replace',lyr.dataSource, e
                                try:
                                    print 'trying to change data source for',lyr.dataSource
                                    lyr.replaceDataSource(v_path,'SHAPEFILE_WORKSPACE',v_name,True)
                                except Exception as e:
                                    print 'still can\'t replace',lyr.dataSource, e
                                    try:
                                        print 'trying to change data source for',lyr.dataSource
                                        lyr.findAndReplaceWorkspacePath(k_path,v_path)
                                    except Exception as e:
                                        print 'can\'t replace workspace path for',lyr.datasetName, e
        mxd.relativePaths = 'True'
        mxd.save()
del mxd


texts: How to determine if an object is a circle

texts:
I have a polygon shapefile that consists of many different shaped features.  I would like to identify only those shapes that are circles.  Is there a way to do this?  Is it a calculation I could do in the field calculator?

Thanks...


texts:
Is it possible with GRASS or QGIS to link a data point on a map with a report of some kind (photo, pdf, graph etc)?

I am interested in this feature, to facilitate data entry from the field, understanding of site conditions, tracking data, presentation etc.


texts: Using Python to disable Scale map elements proportionally to changes in page size?

texts:
I am changing sources on MXDs in differents offices using ArcPy and ArcGIS 10.0. As observed here, the printer settings revert to the default printer when the instruction mxd.save() is sent.

Losing the printer is a minor issue in my case, but it becomes major if the print option "Scale map elements proportionally to changes in page size" is ticked while the "Use Printer Paper Settings" is selected. The screenshot below is my worst-case scenario, the best case would be unchecking both tick-boxes.

I would like to use comtypes to check the value of that option and set it to False (unticked) before saving the MXD - the idea is to call this as a function from an existing ArcPy script. (primary goal)
To secure the print settings further, I would ideally also like to untick the "Use printer setting" box if it is ticked. (secondary goal)

Can anyone help?


texts: ArcMap: Identify mismatch between position of points from database with their actual location in polygons

texts:
A map in ArcMap contains two datasets:

Points J_i from table Jurisdiction of an SQL-database (SQL Server 2017) displayed by Display XY Data (Data Type: XY Event Source)
Polygon shapefile feature Districts with polygons for districts

The table Jurisdiction contains column District which tells within which district polygon a specific point J_i is expected to be located. How can I identify points J_i, which are not located within the district polygon as suggested by column District? A goal would be to make those points visible.

Adding a field with field calculation in table Jurisdiction ist not applicable as Jurisdiction has a database connection. Other approaches I know from the toolbox produce static results. The approach should dynamically react to modified entries in Jurisdiction as Jurisdiction experiences ongoing editing.


texts: Is it possible to get Elevation from a Satellite Image?

texts: I would like to get elevation from a satellite image. I would be needing resolution less than or equal to 5 m. Is this possible? If yes, how can I procure these images and where?


texts: Quick method to evaluate MXD project for dashed line

texts:
ArcMap export of a layout to Adobe Illustrator file converts all dashed-line symbology into dashes or dots that are not selectable as one object.

How can I use ArcObjects .NET to access symbol properties in an MXD to warn users.


texts: Why is ArcGIS for Desktop not joining records when values have dot (.) in text string?

texts: ArcGIS is not joining records from a table that have a dot (.) in the text string.  Has anyone else come across this problem?  Is it a known issue?