texts:
I am trying to display a month worth of daily images to a map to visually inspect them for the presence of dust. I was able to add the images to the map but the name in the layer box is not helpful. I would like each layer to be named the date of the image. This is the code I have so far:
var TerraFilt = Terra.filterDate('2012-12-01', '2012-12-31');

function addtoMap(image) {
    var id = image.id
    image = ee.Image(image.id).select('sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03')
    var date = image.get('system:time_start')
    date = ee.Date(date)
    Map.addLayer(image, Terra_vis, 'Terra' + date)
}

TerraFilt.evaluate(function (TerraFilt) {
    TerraFilt.features.map(addtoMap)
});

When I run this code each layer is named `'Terraee.Date({
"type": "Invocation",
"arguments": {
"value": {
"type": "Invocation"...,
This is the link to my GEE code: https://code.earthengine.google.com/2649e710570ae6804bd469d0bc572269


texts:
I'm interested to scale CartoDB installation to multiple machines to distribute computational resources.
We start using torque with some big tables (more than 5 to 10M points) and the processing for each datacube tile is quite long.
Is it possible to have some hints on what you are currently using to scale CartoDB and in particular PostgreSQL/PostGIS?


texts: How do I assign polygon colors in CARTO based on whether it is a positive or negative number? For example, I want the range of negatives to be one color, and the range of positives another, with a gradient in each.


texts:
Are there any publicly available sources of geolocated Tweets?

I'm aware that one can collect them on their own, but was wondering if there is something readily available to play with.

There is a similar question on Stack Overflow; however it's not focused on geolocation and the first source mentioned there informs that:

  As per request from Twitter the data is no longer available.

Second one seems to be limited to specific tags.


texts:
I'm trying to save layer files from a colleague's mxd. As usual I right clicked on the layer and saved as layer file. Simple - but no - the layer files can't be opened. I get this message

  "Adding the selected layer file failed. Possible reasons include that
  it may have been created using a newer version of ArcGIS and can't be
  opened in the version you are using"

Its not a different version of ArcGIS - I've been using 10.2.2 the whole time. I've had a look at the layers to find anything unusual about them. They are slightly unusual in that is it a table stored in a mdb joined to a point feature class in the same .mdb with XY events displayed. I've tried with other tables and with the same tables in a .gdb and I have the same problem. Joining the FC to the table works fine, but there is a one to many relationship so not all of the rows from the table are displayed.

Is this a limitation that I can't get round or does anyone know of a solution? Perhaps there's something else that's causing the problem that I haven't thought of.


texts: What is the strategy to add attributes to shapefile when the number of records are not the same?

texts:
I'm trying to add attributes (in excel format) to an existing shapefile using ArcGIS, but the number of records between the two are not the same; there are some records in one file but not in the other, and vice versa. I'm new to GIS field and not sure what steps to take, but here's what I think will work:

Export attributes from shapefiles to database format, convert it to excel format
Merge shapefile attribute with the other excel attribute to form one file
Retain those from shapefile attribute
Import new data back to the shapefile

Do you think this will work? Especially at step 4, can I import new data (i.e., with updated attributes) in the excel form to the shapefile in some way? Sorry if it's looks too rudimentary/crude a plan, but to my beginner level that makes some sense intuitively.

EDIT:

The reason I think I have to use Excel is because the ID field (FID) is available in the shapefile but not in the Excel. What they have in common is the description of the FID; in this data, the descriptive fields include county, district, and province. In addition, these descriptive fields are collectively unique but not individually unique; that is, it may be that some counties have the same name, but they belong to different districts (or even the same district but different provinces). So what I can think of is to export data and work on Excel, or whatever external program (a statistical one will do), to assign FID to the additional attribute table, before joining/relating them. But does ArcGIS allow joining/matching using more than one ID fields?
The relationship is one (of the shapefile) to many (of the additional attribute table). How does it complicate the joining/relating plan?


texts: I'm using one of the esri model sewer system geodatabases. It includes empty feature classes and a geometric network.  i need to add a field to one of the pre-made feature classes, but it won't let me. I've tried adding it in ArcGIS Pro, ArcGIS Desktop and in ArcCatalog, but all of them won't let me update or add any fields.


texts: Converting WGS84 coordinates to British National Grid Easting/Northings using C#?

texts:
I'm looking for some code, ideally C#, to convert a WGS84 coordinate to British National Grid Easting and Northings.

Does anyone have this to hand?

I tried converting the Javascript code here:

http://www.movable-type.co.uk/scripts/latlong-gridref.html

to C# - but the code doesn't seem to give the correct coordinates for easting and northings - see below:

public void LatLongToEastNorth(double latitude, double longitude)
    {
        latitude = toRad(latitude);
        longitude = toRad(longitude);

        double a = 6377563.396, b = 6356256.910; // Airy 1830 major & minor semi-axes
        double F0 = 0.9996012717; // NatGrid scale factor on central meridian
        double lat0 = toRad(49);
        double lon0 = toRad(-2); // NatGrid true origin
        double N0 = -100000, E0 = 400000; // northing & easting of true origin, metres
        double e2 = 1 - (b * b) / (a * a); // eccentricity squared
        double n = (a - b) / (a + b), n2 = n * n, n3 = n * n * n;

        double cosLat = Math.Cos(latitude), sinLat = Math.Sin(latitude);
        double nu = a * F0 / Math.Sqrt(1 - e2 * sinLat * sinLat) ; // transverse radius of curvature
        double rho = a * F0 * (1 - e2) / Math.Pow(1 - e2 * sinLat * sinLat, 1.5); // meridional radius of curvature

        double eta2 = nu / rho - 1;

        double Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (latitude - lat0);
        double Mb = (3 * n + 3 * n * n + (21 / 8) * n3) * Math.Sin(latitude - lat0) * Math.Cos(latitude + lat0);
        double Mc = ((15 / 8) * n2 + (15 / 8) * n3) * Math.Sin(2 * (latitude - lat0)) * Math.Cos(2 * (latitude + lat0));
        double Md = (35 / 24) * n3 * Math.Sin(3 * (latitude - lat0)) * Math.Cos(3 * (latitude + lat0));
        double M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc

        double cos3lat = cosLat * cosLat * cosLat;
        double cos5lat = cos3lat * cosLat * cosLat;
        double tan2lat = Math.Tan(latitude) * Math.Tan(latitude);
        double tan4lat = tan2lat * tan2lat;

        double I = M + N0;
        double II = (nu / 2) * sinLat * cosLat;
        double III = (nu / 24) * sinLat * cos3lat * (5 - tan2lat + 9 * eta2);
        double IIIA = (nu / 720) * sinLat * cos5lat * (61 - 58 * tan2lat + tan4lat);
        double IV = nu * cosLat;
        double V = (nu / 6) * cos3lat * (nu / rho - tan2lat);
        double VI = (nu / 120) * cos5lat * (5 - 18 * tan2lat + tan4lat + 14 * eta2 - 58 * tan2lat * eta2);

        double dLon = longitude - lon0;
        double dLon2 = dLon * dLon, dLon3 = dLon2 * dLon, dLon4 = dLon3 * dLon, dLon5 = dLon4 * dLon, dLon6 = dLon5 * dLon;

        double N = I + II * dLon2 + III * dLon4 + IIIA * dLon6;
        double E = E0 + IV * dLon + V * dLon3 + VI * dLon5;

        //return gridrefNumToLet(E, N, 8);
    }


texts: shp2pgsql mangles date field -- quotes data as if it were char or varchar

texts:
I'm attempting to import a shapefile into postgis via shp2pgsql.

Among the fields in the shapefile's .dbf file is a date field with format yyyymmdd, which is a valid date format for postgresql.

However, the sql generated by shp2pgsql outputs the date field with quotes:

And that means when I run the command, I get an 'invalid input syntax' error:

What do I need to do to get shp2pgsql to format the value correctly so it can be loaded into my database?  I need to automate this loading process, so anything that involves opening up the SQL and editing the file should be a last resort.

Thanks

EDIT: Turns out it was a bad record causing the error.  Of course an insert statement uses quotes around the values.  I get stupid after midnight :)


texts: Creating .tfw world files from .tiff & coordinates in Excel?

texts:
I have .tiff files from aerial photography. I also have coordinates of the center of these pictures (northing, easting, height as well) stored in a excel table.

Is there a way to create .tfw world file from these information and, if so, what is the easiest?


texts:
I am interested in generating a polygon grid shapefile for the landmass of the world. What I have presently is two tables in PostgreSQL:

Table 1: Coastal area shapefile (http://openstreetmapdata.com/data/coastlines): Consists of Linestrings
column names : gid, fid, geom

Table 2: Polygon grid shapefile created for the above Table 1 with the help of QGIS
Grid is (1 lat x 1 lon) in size.
column names : gid_grid, id_grid, coord_grid, geom_grid

Now I want to find the polygon grids in Table 2 which are in the land area (even if a small part of coastal line falls inside the grid, it has to be marked as land area).

My initial thought is to find the polygon grids which intercept with any of the coastal lines, and mark it as a land area (using PostGIS queries). The problem is, it will not find any polygon grids which totally falls inside the land area.

Any suggestions please?


texts: Is there a way to add a Geopackage in QGIS 2.18.20 like QGIS 3?

texts:
Is there a way to add a Geopackage into QGIS 2.18.20 that is similar to the approach taken in QGIS 3?

The below is a screen grab from QGIS 3.0.3

When I drag and drop into QGIS 2.18.20 it gives me the option to add all layers but the layer names are given a prefix of Geopackage and I don't want this.


texts:
Landsat 8 Collection 1 Tier 1 8-Day EVI Composite.
I continued with the starting codes given by Google Earth Engine. I tried to solve my work by adding code to the rest of these codes. However, it keeps giving an error.
Codes:
var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_8DAY_EVI')
                  .filterDate('2006-03-30','2006-10-10');
var colorized = dataset.select('EVI');
var colorizedVis = {
  min: 0.0,
  max: 1.0,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'

  ],
};
Map.setCenter(32, 37, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
var landsat = ee.Image('LANDSAT/LE07/C01/T1_8DAY_EVI');
var geometry = ee.Geometry.Rectangle([31, 36, 34, 39]);
Export.image.toDrive({
  image:dataset,
  description: 'imageToDriveExample',
  scale: 30,
  region: geometry
});

Error: Image.clipToBoundsAndScale, argument 'input': Invalid type.
  Expected type: Image<unknown bands>. Actual type: ImageCollection.

How can I fix this code?

A) EVI is not a band, but a separate index (a single value) obtained after a certain mathematical operation is applied to the bands. Therefore, the following command: [image: dataset.toBand ()] did not work. I tried all of them (image1_band1), (image1), (band1) in this statement but never accepted.
B) dataset.first() This code has been accepted. However, whatever you put in parentheses, it definitely downloads something. However, this is not EVI.
C) dataset.get(x) (x: image index),This code does not work either. I wrote everything that could be "index" by looking at the Google Engine inspector section. However, it did not happen again.
D) Use a reducer On this page, there is a lot of information such as choosing wavelength bands and taking the average.
My situation is simple. I want certain dates from the EVI index, which is ready in Google engine. I'm writing the latest working code below. This code downloads images. However, this image does not have an image.
The Code:
var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_8DAY_EVI')
                  .filterDate('2006-03-30','2006-10-10');
var colorized = dataset.select('EVI');
var colorizedVis = {
  min: 0.0,
  max: 1.0,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'

  ],
};
Map.setCenter(32, 37, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
var geometry = ee.Geometry.Rectangle([31, 36, 34, 39]);
Export.image.toDrive({
  image:dataset.first(20060330),
  description: 'imageToDriveExample',
  scale: 3000,
  region: geometry
});

For example, these image is that:

Another image:


texts: What countries allow commercial use of drones to collect aerial imagery?

texts:
Currently the US government forbids commercial use of drones to collect aerial imagery.  The FAA is supposedly reviewing this to determine what sorts of restrictions are needed to allow this to happen while minimizing threats to privacy.  From the Denver Post:

  Last year, Congress mandated that the Federal Aviation Administration
  create a plan for the safe integration of unmanned aerial vehicles
  into the national airspace. Those regulations should be complete by
  2015, and the agency expects a commercial boom — as many as 30,000
  drones airborne in the U.S. by 2020. But public fears about police
  spying could stall the technologically advanced industry eager to be
  unleashed.

What countries currently allow commercial use of drones to collect aerial imagery?

In these countries, have there been problems with invasion of privacy?

Update

  The influential head of Google, Eric Schmidt, has called for civilian
  drone technology to be regulated, warning about privacy and security
  concerns. - BBC News


texts: Identifying of Vertical Datum from Metadata

texts:
I have been working with the DEM of South Carolina and I am not able to see from the metadata what is the vertical of the DEM.

How do I identify the vertical datum from the attached screenshot of the metadata?


texts: Creating contours for specific elevations

texts:
Input data: 1. an SRTM raster.
2. Point file of peaks. -Attributes contain ID, x, y, z and the elevation at which the peak is completely isolated from a neighboring peak.

The output I want is a line/polygon/point/raster file containing contours for that specific elevation of peak-isolation, for all the peaks.
Simply put I want to draw a contour at a particular elevation below that peak.

I have reviewed r.contour.level and r.contour.step commands in QGIS's GRASS toolbox, which can give me contours for exactly the elevations I want, but I need contours at different elevations for different peaks, as their elevation of complete isolation would be different.

I could manually do it for every peak I have, but could it be done through raster calculator for all the peaks and at specific elevations?


texts:
If you look in the ArcGIS 10.1 help, the Pythonaddins module SaveDialog shows the following:

SaveDialog({title}, {name_text}, {starting_location})

But if you open the python window in ArcMap, you get a little something extra:

SaveDialog({title}, {name_text}, {starting_location}, {filter}, {filter_label})

When you use the SaveDialog, it doesn't behave very well, and has a dropdown for "Save as type" that I cannot figure out how to access.  It would seem that, although the help doesn't contain instructions for doing so, they have built in a means to control the dialog so you can filter it for only certain types.

I've tried many alternatives, but cannot figure out how to get this dialog to let me filter.  Does anyone have an idea of how this would be implemented (since it's completely undocumented)?


texts: Adding "monitor" layer with Access Database and coordinates x/y in QGIS?

texts:
I want to add a Microsoft Access "mdb" or "accdb" as vector layer.
The layer should work all the time with current updated data from the Access file. This function allready exist for a txt(!) file:
Layer>add Layer>add txt file as layer. Also hit checkbox for "keep watching file" for current data.
Maybe there is an accdb third party plugin

Also known function:
Database>Evis only create a momentary connection and is not my solution. Finally I want probably the same like the txt as vector layer.
My problem is to tell QGIS the X and Y collumns (for ex. longitude/latitude coordinates) and I haven't found any way still there.


texts:
Trying to create a simple line symbol.
But getting an error: "The type 'ESRI.ArcGIS.Display.RgbColorClass' has no constructors defined"

public override void OnClick()
    {
        IDocument pdoc = m_application.Document;
        IMxDocument pmxdoc = (IMxDocument)pdoc;
        IActiveView pactive = pmxdoc.ActiveView;
        IRgbColor rgbColorCls = new RgbColorClass();
        rgbColorCls.Red = 138;
        rgbColorCls.Green = 151;
        rgbColorCls.Blue = 255;
        ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol();
        simpleLineSymbol.Color = rgbColorCls;
    }


texts: Is it possible to override autoincrementing keys when QGIS inserts into SQLite?

texts:
I have a table, without any geometry, loaded in QGIS 1.8.0 (from OSGeo4W) via the Add Vector Layer option.  The table resides in a SQLite/SpatiaLite database, and has a field named "id" that was created with INTEGER PRIMARY KEY option.  From SpatiaLite GUI or SQLite Manager in Firefox, I can add a new row using any unique 64-bit integer value for "id".  However, an attempt to add the same row from QGIS results in "id" being autoincremented.  My question is: Is there a way to override or fix this behavior?

According to http://www.sqlite.org/autoinc.html it is valid to assign a value (within constraints) to an INTEGER PRIMARY KEY field.


texts:
I've created contour lines every 5 meters from a grid DEM with 5x5 meter of resolution. But strangely I've obtained that the contour lines are segmented and rich of lines that goes up and down, especially in the plains areas.

I've then used a focal statistic to smooth the DEM and I've obtained a very good result in term of aesthetic; but is preferable to non alter excessively the original data.

Some suggestions or ideas on what is the problem?!


texts: How to make a 3d visualisation of different peat layer to show the height of each layer?

texts:
I have bore hole point data that has about 5 to 7 types of peat layer and also has several depths. I also have digital elevation data of the area.

I need to interpolate these layers separately, then visualise the layers sequentially in 3d.

Is it possible to to it with ArcGIS?

I want to add a Screen shot that may make my querry more clear:

My points include the measurement depth of 4 different quality pit layer. The left image is my data set and right image is what I want from my data. I want to visualize a block diagram of formation of each peat layer. I did not find a clear description or tutorial to make the block diagram in arcscene.:-(


texts: I have a layer of building footprints that I would like to make each building outline the same size (all single family homes). Is there a way to batch convert all of the footprints (over 400) instead of replace each individually with a new feature?Attached is a screenshot of what I have thus far.


texts: Multiple script hyperlinks not loading in ArcGIS

texts:
I've set up my layer to use hyperlinks based on a script.  When I use the Hyperlink tool and click on a link, often times it loads just fine.

The problem I have is when there are multiple points on top of each other, each with their own hyperlinks.  A window opens that allows me to select the hyperlink I'd like to use.  The problem is, I can't seem to activate the hyperlink.

Note that these links are used by a script hyperlink.  That's why they aren't websites or document paths.

I've tried selecting the link, and clicking "Jump".  I've tried double-clicking the link.  I tried pressing "Enter" on the keyboard.  I tried the Space Bar.  Nothing seems to activate the links.

Are multiple script links from multiple points not supported in ArcMap 10?  Is there another way to activate these links that I haven't thought of yet?


texts: Imported map showing up small in ArcMap?

texts:
In ArcMap 10.2, I have .asc files that contains a map of a predicted species distribution I got from using MaxEnt.  When I import the file with the data frame properties set to North American Albers Equal Area the map shows up only about 60 meters across and 50 meters tall, when the coordinates are originally from Top: 76.06, Left: -163, Right: -102.16, Bottom: 27.10 - it even says these coordinates in the Extent information in the Layer Properties.

I converted the .asc to raster, reclassified the values (0 for absent, 1 for present), extracted the present values using the Extract by Attribute tool, then turned the present area into a polygon, all while changing the layers projections-yet still it remains small.  The ultimate reason for making the projection correct is to calculate the predicted area of the species.  The area calculated in the attribute table is also incorrect.

What could possibly be happening?


texts: Effective PostGIS ORDER BY distance of points


texts: Copy and paste of dataframe in ArcMap table of contents?

texts: I am new to ArcGis and I am currently taking a course. In one of the exercises Im supposed to copy a dataframe from the table of contents in ArcMap ( in data view) back into the table of contents so there are two copies. I am supposed to right click on the data frame name, select copy. Then go to the edit menu and select paste. Every time I have done this nothing happens. I tried on another person's ArcMap and it worked. I tried checking off the 'spatial analysis' box in the customize--> extensions menu but that did nothing. Any ideas?


texts: Save rule based lables to new attribute in QGIS

texts: Is it possible to save/export rule based lables in QGIS to a new attribute?


texts: Can I access the request URL in a AGS Server Object Extension (SOE)?

texts:
I would like to obtain the full URL of a REST request inside of an ArcGIS Server SOE.

I would like to return the full URL to an output file.  But, the service may be exposed on different servers or through different urls on the same server via a proxy.

I'm working with ArcGIS Server 10.1 on Windows with IIS.


texts: R using fortify to project shapefile on google map gives wrong results


texts: Leaflet L.DomEvent.On returning an error on marker click

texts:
I used two button in my marker popup. I need to trigger a function by clicking on marker. I used the following code. Its working fine. But when I am clicking on marker it's returning an error in console

    var marker = new L.Marker(new L.LatLng(23.25, 90.56), {
        icon: myIcon,  riseOnHover: true, riseOffset: 25
    });

    map.addLayer(marker);
    var title =  "My Title";
    var subTitle = "My Sub Title";
    var analysisPharam = "Analytical Parameter";
    var popupContent = "
"
        + "
Title: " + title + "
"
        + "
SubTitle: " + subTitle + "
"
        + "<button id='layerAnalysis' class='btn btn-danger btn-xs'>Analyze</button>"
        + "<button id='popupClose' class='btn btn-danger btn-xs'>Close</button>";
    "
";

    marker.bindPopup(popupContent);

    marker.on('popupopen', function(){
        L.DomEvent.on(
            $("#layerAnalysis").click(function () {
                analysisFunction(analysisPharam);
            })
        );
    });

The error in console and the myAction.js indicating error at L.DomEvent.on event

> Uncaught TypeError: Cannot read property 'trim' of undefined
>     at Object.trim (leaflet.js:5)
>     at Object.splitWords (leaflet.js:5)
>     at Object.on (leaflet.js:6)
>     at e.<anonymous> (myAction.js:487)
>     at e.fire (leaflet.js:5)
>     at e.onAdd (leaflet.js:7)
>     at e._layerAdd (leaflet.js:6)
>     at e.whenReady (leaflet.js:6)
>     at e.addLayer (leaflet.js:6)
>     at e.openPopup (leaflet.js:7)


texts: Script to convert a shapefile to an OSM poly file on WIN 7?

texts:
Is there a commande line tool running on WIN 7 which is able to create OSM poly files (polygon filter file format) from shapefiles?

The tools listed here do not seem to fit my needs. The only suitabel one seems to be ogr2poly.py. However, when I run it I recieve following error: ImportError: No module named osgeo. Actually, I'm not even sure if this script works on windows.

Any ideas?


texts: Loading .json files into Leaflet and filtering them

texts:
I am new to web development and Leaflet/GIS in general.

I have a couple of shapefles, let's say they are roads.shp and utilities.shp. And let's say I have the means to convert these shape files into .json files, so now we have: roads.json and utilities.json.

Now I want to write HTML code to present this data on a leaflet map, putting in mind that the file: roads.json has data in the form of polylines, and the file: utilities.json has data in the form of markers.

After displaying this data on the map, I want to be able to filter them, for example: make 2 radio buttons to show/hide one of them or both of them.

How can this be achieved with code?


texts: Carto does not find several Swiss administrative regions?

texts:
I'm trying to highlight all different cantons of Switzerland and then give them a different color. However Carto does not find several administrative regions and there seems to be no way to change this.

Can anybody help?


texts:
I just started using RQGIS. I ran the example code using qgis:polygoncentroids shown on https://github.com/jannes-m/RQGIS with no problem.

I tried then to create a vector grid using qgis:vectorgrid but I get an error, which seems to indicate that the command expects a raster format output, when the output in QGIS for this plugin is a shapefile.

If I run run_qgis without the load_output argument I don't get an error, but no file is created on the disk either (I am on Ubuntu 16.04).

My code is as follows:

library(RQGIS)
library(rgdal)
library(rgeos)
library(raster)

##PARAMETERS
#working directory
work.dir <- "/media/olivier/olivier_ext/gedata_current/jde_coffee/data/ES"
#Location and name of the grid to output
out <- c("Grids","ES_grid_test")
#Resolution of the grid in km
res <- 2
#Location and name of shapefile with the extent and outline of the grid
shp.ext <- c("Boundaries","Espirito_Santo_geo")
#Projection to use
project <- CRS("+init=epsg:32723")

#Set working directory
setwd(work.dir)

#Import boundary and extent
bound <- readOGR(dsn=shp.ext[1], layer=shp.ext[2], stringsAsFactors=F)
bound <- spTransform(bound, project)

#Set a QGIS environment
env <- set_env()

#retrieve the function arguments
args <- get_args_man(alg = "qgis:vectorgrid", options = TRUE, qgis_env = env)

#Fill arguments
args$EXTENT <- as.vector(extent(bound))
args$STEP_X <- res*1000 #In meters if UTM
args$STEP_Y <- res*1000
args$TYPE <- 0
args$OUTPUT <- paste0(work.dir,"/",out[1],"/",out[2],".shp")

grid.shp <- run_qgis(alg = "qgis:vectorgrid", params = args, load_output = args$OUTPUT, qgis_env = env)

I get the following error:

  Error in .local(.Object, ...) :
  `/media/olivier/olivier_ext/gedata_current/jde_coffee/data/ES/Grids/ES_grid_test.shp'
  does not exist in the file system, and is not recognised as a
  supported dataset name.

  Error in .rasterObjectFromFile(x, band = band, objecttype =
  "RasterLayer",  :    Cannot create a RasterLayer object from this
  file. (file does not exist)

It makes me believe that run_qgis expects a raster format... But in QGIS it's definitely a shapefile output.


texts: Spatially joining district wise polygon shapefile with smaller polygon indicating loamy soil proportion in 5km by 5km grid using QGIS

texts:
I have two shapefiles:

a shape-file for India district wise
I have another .asc raster file for India's loamy soil area in a 5km by 5km grid cell (and a converted shape file version for the same). Each cell in this data contains the data on fraction of grid cell area in absolute integer term that is loamy textured (needs to be divided by 10000 for fraction) .

Now what I wish to find is the total fraction of land in loamy texture by district. So, I wish to spatially join the two shapefiles in order for each of this 5*5km grids to have a district code (i.e. the census code in my attributes table). I have tried the spatial join by vector-> data management-> Join attributes by location. But it reported "invalid geometry" for both the data sets. So I tried it by fixing geometry using the vector geometry-> fix geometry for both the shape files. Now joining them on fixed geometry shape file using the Join attributes by location reports:

No spatial index exists for join layer, performance will be severely
degraded.

I really feel it a very basic question on joins but I still didn't manage to find any legible answer to it online and hence, I am stuck.
How do I join the two shapefiles to have a single district code along every grid and also how do I join them in a way that the grid cells which lies in the intersection of two districts goes to the district where it has the grid's centroid or the grid's major area (any one of them would do)?
My attribute tables look like the following:

and My shapefiles look like the following:


texts: Specify absolute center for bi-directional color ramp in QGIS?

texts:
How do I center the color ramp on '0' for a series of raster with positive and negative values?
The values are non-normally distributed.
There doesn't seem to be a an 'absolute' option, only relative (circled, below).

Bonus: The min/max values change from one raster to the next, so it would be nice to be able to both: A) have the ramp autoscale around zero and B) color map the range of values absolutely (e.g. based on values from raster with the abosolute max and the (possibly different) raster with absolute min).
I'm running QGIS 3.10
There does not appear to be a "Symmetric Classification" option for rasters as indicated for polyline symbology in this post:
https://gis.stackexchange.com/a/385536/17482


texts:
I want to cut out a segment of a DTM - to isolate a river catchment.
I would then perform hydrological analysis on the cut out segment - calculate flow direction and so on.
What is the best way to do this in ArcGIS Pro version?

I assume I would need to convert the DTM to a shapefile, manually cut out the segment I need by hand, and clip it to the DTM. If so, I am concerned about data loss around the edges - would this likely cause errors in the analysis? *

Here is the DTM I am working with:


texts: I am trying to join tables together and need the PLSS to line up correctly.  In my table with geometries I have "CO060020N0650W0SN330" in a field.  I want to make a new column and make it say 2N65W33 so I can join a table.  Is there a formula I can use in the Field Calculator to get this result?


texts: What is the origin of the Degrees, Decimal Minutes format?

texts:
In my experience, for most non-GIS folks, the most commonly used and understood coordinate system is good old Latitude and Longitude, displayed as degrees, minutes, and seconds (DDMMSS.ss). In GIS, it's of course much easier to use decimal degrees (DD.dd), and with the growth of everyday GIS apps like Google Maps, the non-GIS user is much more familiar with decimal degrees these days than they were 10 years ago.

But every now and again, someone brings me a set of coordinates in degrees and decimal minutes. This seems like the worst of both worlds: it can't be used in GIS without a little work, and the format is not immediately obvious to most non-GIS people (many think that it's DDMMSS at first). So why does it exist when we already have decimal degrees, which is easily understood by computers, and degrees-minutes-seconds, which is easily understood by humans?


texts:
I'm a new user of QGIS. I have a problem trying to update layers from a database.
I have a MySQL database in a server that I add as a layer (or more than one, depends on the project) with no problem.
That database changes each five minutes, and I want to update the associate/s layer/s.
Now, I push the refresh buttom, but I guess that this could be done automatically, without my interference, as a programmed routine or plugin.
Any have tried it?
Do you know how to achieve it?
Thanks in advance!
Laura


texts: GUID field error when trying to Create a Local Copy

texts:
I am hosting our tree inventory data ArcGIS Online so that our Urban Forester can do tree inspections and create work recommendations to field maintenance staff. The database consists of multiple related tables, related by Global ID and GUID fields.

Once the edits have been made in esri's Collector App, I need to being them back into ArcMap (10.3). I am able to do this just fine, but when I try to "Create Local Copy for Editing" I get the following error:

REC_ID refers to the GUID field for my Work_Recommendations feature class.

I need to be able to sync my local copy edits back to the hosted feature service, so that I don't have to re-publish the feature service.

The reason for using the Global_ID as the primary key and GUID as the foreign key relationship classes is that I need to generate the unique TREE_IDs on the back end, and Collector app does not support Object ID relationships. There are two feature classes and five related tables. I updated the Geometry for the Work_Recommendations feature class (REC_ID), but I cannot do the same for the tables, of which most have GUID fields.

I attempted to export the feature layer to a FGDB, as was suggested in a comment, and this wasn't able to be accomplished either. I received another error (this time, less specific):

Can anyone help me identify the issue with my database?


texts:
I've created a relate in ArcGIS Pro - joined a shape layer to a table on a key. ArcGIS Pro says it has gone through okay, and when I click on a feature I can go down into the information displayed and see the relate (though I can't see the related data, just the relate taking place).

How can I filter on this? I can't find the option anywhere to filter on a relate and, when I look at the definition query, it only has the options from the selected table (i.e. the shape).

I can see the related data now, I'd linked it up the wrong way. I still need to filter on it somehow.

It turns out that doing a JOIN will do the job (I thought it would simply take one set of data and add it to another, but both sets of data seem to remain separate - I can update them at source and they'll reflect their changes).


texts: Installing command line tools for Open Data Cube?

texts:
I am trying to setup my own Open Data Cube environment, I did installed Postgres and datacube python libraries, but in order to initialise the database schema the following command is suggested:

  datacube -v system init

I have not being able to find instructions to install command line tools for ODC? Where can I find them?

I have my Linux machine and executed the following commands to install opendatacube Python API:

conda config --add channels conda-forge
conda create --name cubeenv python=3.6 datacube
source activate cubeenv
activate cubeenv
conda install jupyter matplotlib scipy

Also I executed the following commands to install postgres and start it:

sudo yum install postgresql12
sudo yum install postgresql12-contrib
/usr/pgsql-12/bin/initdb

I think I have not executed any steps to install command line toos, I am following this link:

https://opendatacube.readthedocs.io/en/latest/ops/install.html

followed by database setup steps.

In these database setup steps, the last one is to initialise database schema, and I was planning to execute it using bash window.


texts: Administrative boundaries missing in OSM and/or Maperitive?

texts:
I'm lost trying to render maps with administrative boundaries using OSM and Maperitive.
For some cities, e.g. Mexico City, there are boundaries.

But, e.g. for Belo Horizonte, there are none, at least in the SVG I export for Illustrator (at zoom level 16) from Maperitive.

I find references in the OSM XML for Belo Horizonte to <tag k="boundary" v="administrative"/> and <tag k="admin_level" v="7"/>. Also, on the OSM website, the map of Belo Horizonte has an admin boundary:

http://www.openstreetmap.org/relation/368782#map=11/-19.9185/-43.9604

...although sometimes you may have to switch to MapQuest view and then back to Standard for it to appear.

So, it could be that no boundaries have been included in the OSM data for Belo Horizonte, or they have been and Maperitive isn't reading them. Advice very welcome...

=====update====

The answer here:

Finding administrative boundaries in Guinea using OSM

suggested using http://overpass-turbo.eu/ to get admin boundary data, but what I downloaded  for BH (7MB) wasn't the boundary of BH.

===update 2===

Found this: http://global.mapit.mysociety.org/ but the search found no boundaries for BH. I guess there are none in oSM data.


texts: Accessing pgsql db set in cygwin from qgis installed on windows through osgeo4w, possible?

texts:
As the title of this question, I want to know if it is possible to access a PostgreSQL database set in cygwin (version 9) from QGis installed in Windows 8.1 through the OSgeo4W application, is that possible? if so, could you explain some simple steps to do so?

Thanks for any pointers,


texts:
I am making an atlas of protected areas using QGIS. I am using version 2.12, but this question will probably also apply to version 2.14 as well.

Several points of interest (poi) objects are presented in this atlas. Some of these, like parking, information station and viewpoint are presented as icons. When these are close to oneother it is relevant to group the icons and align them (on a line) close to a centerpoint for the poi-objects. Currently this is done using desktop publishing tools and it looks like this:

I would like to pull as much as possible of this process into the QGIS atlas system. We have many of the protecteda areas, so the gain of automating the process is potentially big.

How can this be done in QGIS?

Also see question Using FME to aggregate POI to one point for context.


texts: Overlaying WMS in custom coordinate system with other layers in openlayers 3

texts:
I have a raster in a custom coordinate system (I added the coordinate system definition to the geoserver EPSG file so that I could choose it as the native projection. Now I would like to add it to a map in openlayers 3, however I can't seem to get it to show up. I was trying to use the code in this example http://openlayers.org/en/v3.12.1/examples/wms-custom-proj.html but so far I can't get it to show. This is the code for my WMS layer I want to add:

var countyAerial = new ol.layer.Tile({
    extent: [2422100,574699.9999999,2565500,781299.9999999998],
    source: new ol.source.TileWMS({
      url: 'http://107.182.235.75:8080/geoserver/wms',
      params: {'LAYERS': 'IDAda:county_aerial', 'TILED': true},
      serverType: 'geoserver'
    })
  });

I want to transform this into EPSG 3857 and am not sure the code in the example will work for me, I don't completely understand it. Can anyone help?


texts:
Can anyone help me label z layers (years in my case) along z-axis shown in image please? The Year labels that appear now on this image is just my text added onto the screenshot just to show what I am wishing to achieve.

Labels are shown in ArcScene in this youtube video


texts: Are there any open source software for obtaining and processing data from the Velodyne HDL-32E lidar?

texts: Does anybody know if a FOSS package exists? The best I could find are the scripts at binarymillenium. I was just hoping somebody here knows of a complete package for obtaining and processing the data.


texts: Zoom to extent using geom or xmax, ymax?

texts:
I made a function to zoom to polygon geom if I click the button. This is my script:

$.ajax({
            type: "POST",
            url: 'core/zoomtolocation',
            data: {
                iddesa: iddesa,
            },
            dataType: "JSON",
            success: function (responsezoom) {
                if (responsezoom!='kosong') {

                    $.each(responsezoom, function (index, value) {

                        var extent = [value.geom];
                        map.getView().fitExtent(extent,map.getSize())

                        // var maxExtent = [parseFloat(value.xmax), parseFloat(value.ymax), parseFloat(value.xmin), parseFloat(value.ymin)];
                        // map.getView().fit(maxExtent, { duration: 1000 });
                    });

                } else {

                }
            }
        });

But from that script I get error:

  Uncaught TypeError: map.getView is not a function.

I'm using OpenLayers 4.


texts: Extracting zipped shapefile and check its shape type without writing on disk?

texts:
I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I tried something like

import cStringIO, zipfile, arcpy
stringIO = cStringIO.StringIO()
file_ = r"C:\Polyline.zip"
zipFile = zipfile.ZipFile(file_)
for name in zipFile.namelist():
    if name.endswith(".shp"):
        stringIO.writelines(zipFile.read(name))
        print arcpy.Describe(stringIO).shapeType

But it is not working. I got the trace back:

Traceback (most recent call last):
  File "", line 8, in
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy__init__.py", line 1190, in Describe
return gp.describe(value)
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing_base.py", line 374, in describe
self._gp.Describe(*gp_fixargs(args, True)))
RuntimeError: Object: Describe input value is not valid type

How can I unzip a shapefile in memory and finds its shape type?


texts: Qgis load a set of excel points into a googlemap with only one point with real coordinates

texts:
I am working with a google map on which I want to attach a grid of five points. Only one of them has real coordinates in the centre, point O ( 8.32688E, 48,32933N). For all the rest only the excel coordinates with respect to this know central point.
I want to plot the grid on the map and also I want to determine properly the coordinates of the other 4 points.


texts: GPKG and GPKG-WAL - not sure if main process finished

texts:
I am performing ZonalStatistics (mean value from a Float32 virtual raster) in QGIS 3.4 on a huge geopackage layer. Originally it was 240 GB and after few days the process became odd:

The QGIS process bar shows that the algorithm is on 100 % while the ZonalStatistics windows show 99 % already 4 days
The GPKG-WAL file is being still updated all the time and now it came to the size of 220 GB - and it is increasing (the GPKG is 278 GB)

What is happening really? Is the main process over or not? How big can this GPKG-WAL become (based on the main GPKG size) and should I wait for the process to finish or stop it?


texts: Error in GUI startup when launching GRASS GIS 7.8.4

texts:
I have just installed the latest version of GRASS GIS(7.8.4) but it doesn't launch. I've tried reinstalling a few times and nothing seems to work. Does anyone know what is wrong?
Starting GRASS GIS...
Traceback (most recent call last):
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 1150, in OnInit
StartUp = GRASSStartup()
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 230, in __init__
self._set_properties(grassVersion, grassRevisionStr)
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 291, in _set_properties
self.OnSetDatabase(None)
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 927, in OnSetDatabase
self.OnSelectLocation(None)
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 862, in OnSelectLocation
self.lblocations.GetSelection()]))
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 829, in UpdateMapsets
gisdbase=self.gisdbase)
File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\core\gcmd.py", line 720, in RunCommand
stderr = decode(stderr)
File "C:\Program Files\GRASS GIS 7.8\etc\python\grass\script\utils.py", line 194, in decode
return bytes_.decode(enc)
File "C:\Program Files\GRASS GIS 7.8\Python37\lib\encodings\cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 2: character maps to
<undefined>
OnInit returned false, exiting...
エラー: Error in GUI startup. See messages above (if any) and if necessary, please report this error
to the GRASS developers.
On systems with package manager, make sure you have the right GUI package, probably named grass-gui,
installed.
To run GRASS GIS in text mode use the --text flag.
Use '--help' for further options
 grass78 --help
See also: https://grass.osgeo.org/grass78/manuals/helptext.html
Exiting...


texts: Python column checker-comparing 2 fields

texts:
One problem I am having is the following:

I want to create an automatic program to see how well the automozation has been with comparing the results of 2 columns to each other in the same column.

In python psedocode, it would look like this:

rows= "all rows in table X"
row=rows.next()

counter =0
row counter= rows.length()// amount of rows

while row:
         //If the row`s attribute1 and attribute 2 are the same, add 1 to counter...
         if row. Atrribute1 == row.Attribute:
            counter+= counter
            row=rows.next()
         else:
             // Just go on to next row
            row=row.next()

//Give an overall percentage of success
print(counter/row_counter)*100

I cannot imagine that this is hard, but I cannot get it to work with the code from research

One of the major problems is  I cannot find a way to compare 2 field to each other. Ive been searching for a while now, but have found that you can see what a field is, but not how to directly call it.

Originally this question included the error message below which was addressed by one of the answers:

  'module' object has no attribute 'searchCursor'


texts: How to speed up rendering MSSQL layers in QGIS 2.18?

texts:
Rendering a large MSSQL-Layer in QGIS 2.18 is very slow. The same segment takes in 2.14.1 about 10 seconds and in 2.18.3 about 2 minutes. In 2.16.1 or 2.18.1 it is also very slow.

What can be the reason for this?

EDIT:

My MSSQL-Layer has about 3,1 millions polygon-objects. I found out that the rendering-process is different in the two QGIS-Versions (2.14 and 2.18):

The drawing of the objects in full extent in QGIS 2.14 is scattered (not grouped together!). The objects come into sight scattered over the full extent of the map. Here is an image from the first seconds of rendering:

If I scale then to a detail section, rendering is very fast.

Otherwise the drawing of the objects in full extent in QGIS 2.18 is grouped. The objects come into sight grouped in regions. Here is an image from the first seconds of rendering:

If I scale then to a detail section, rendering is very slow.

Is there a way to render the layer in 2.18 like in 2.14? Why is there a difference in the render process?

Was there a known general change in the render process in QGIS or could it be a wrong adjustment of my QGIS Installation?

EDIT in Sept. 2017:

I have tested the rendering performances described above with QGIS 2.99.0 (I think Version 36). But the problem is still the same as in 2.18.

Is there a possibility to speed up rendering in 3.0?


texts: Geopandas Overlay Union does not find all Overlaps

texts:
I am trying to union 4 polygons and want to know for each (sub)region, which of the 4 polygons are overlapping. My idea was to use geopandas.overlay(..) iteratively.
The code looks like this:
union = None

for i in range(4):
    # Shapely Polygon
    polygon = list_of_polygons[i]

    gs = gpd.GeoSeries(polygon)

    # Give each Polygon its index as identifier
    df = gpd.GeoDataFrame({'geometry': gs, str(i): [True]})

    print(df)

    if union is None:
        union = df
    else:
        res = gpd.tools.overlay(union, df, how='union', keep_geom_type=True)
        union = res

print(union)

This gives me for the 4 polygons
                                            geometry     0
0  POLYGON ((0.42565 2.00000, -3.21000 8.33000, -...  True

                                            geometry     1
0  POLYGON ((-3.29000 8.33000, 1.50000 8.33000, 1...  True

                                            geometry     2
0  POLYGON ((-1.69946 -3.69930, 1.00000 1.00000, ...  True

                                            geometry     3
0  POLYGON ((0.00714 -6.96842, -0.00201 -6.96432,...  True

and for the union-dataframe
      0     1     2     3                                           geometry
0  True   NaN  True  True  MULTIPOLYGON (((2.00000 2.00000, 5.14000 2.000...
1  True   NaN   NaN  True  MULTIPOLYGON (((4.03834 -1.03834, 5.35000 -2.3...
2   NaN  True   NaN  True  POLYGON ((-1.64000 8.33000, -0.79000 8.33000, ...
3  True   NaN  True   NaN  POLYGON ((-1.69789 -3.69773, 0.42570 -0.00000,...
4  True  True   NaN   NaN  MULTIPOLYGON (((0.42565 2.00000, -3.21000 8.33...
5  True   NaN   NaN   NaN  MULTIPOLYGON (((-1.51000 -11.52000, -1.51000 -...
6   NaN  True   NaN   NaN  MULTIPOLYGON (((-0.79000 8.33000, 1.50000 8.33...
7   NaN   NaN  True   NaN  MULTIPOLYGON (((8.79000 8.33000, 9.77000 8.330...
8   NaN   NaN   NaN  True  MULTIPOLYGON (((9.77000 -0.00000, 9.77000 -10....

In theory, each row contains one region of the union and True/NaN if the corresponding polygon (0, 1, 2, or 3) overlaps there or not.
However, the plot of the resulting 9 (multi-)polygons is not congruent with the plot of the union of the original 4 polygons.
The plots of polygons 0 - 3 and their overlayed plot are as follows:

Whereas the plot of all 9 (multi-)polygons looks like this (each color represents a different overlap, white areas indicate missing regions):

Am I missing something, or is that an error of geopandas.overlay?
What would I need to change to get the desired outcome?

I still do not know why geopandas behaves that way, but using @rickD 's comment I found a workaround using intersection and difference from shapely.
# Contains a tuple of a shapely object
# And a list of indices of the polygons which overlap there
sub_division = [(list_of_polygons[0], [0])]

for i in range(1, len(list_of_polygons)):
    tmp = []

    polygon = list_of_polygons[i]

    # For every new polygon, loop over the list of existing (sub)regions
    # And compute the intersection and differences
    for (sub_region, indices) in sub_division:

        intersection = sub_region.intersection(polygon)
        difference = sub_region.difference(polygon)
        polygon = polygon.difference(sub_region)

        tmp.append((intersection, indices + [i]))
        tmp.append((difference, indices))

    tmp.append((polygon, [i]))
    sub_division = tmp

Now, sub_division contains all (sub)regions where polygons in list_of_polygons overlap, together with their indices.


texts: Erdas LPS : how to rename points_ID values?

texts:
I'm working with ERDAS LPS 2014, i would like edit the name given for my GCPs and TPs (add the following suffix : "_w").

I tried to do that using the "formula" menu... in vain. I did not find a function able to do this task.

Thus, I tried to export my column "point_id" into a text format. I succeed to importing and i succeed in editing my useful field with Excel. But, however, I do not manage to reimport my new edited text file into ERDAS LPS.

Could you throw light for me and tell me how to rename values for the points_id with erdas LPS?


texts:
I am trying to create a label in arcgis with about 30 columns with this basic VBscript:

[field1] & vbnewline & [field2] & vbnewline &[field3] & vbnewline... ETC

How can I make it so that fields with no data (not even a "0") do not show up?  I have been experimenting with If Then labels to no avail.


texts: GeoServer- Reload feature type doesn't work

texts:
I have Oracle database and I had created layer in GeoServer. It had worked good, but when I recreated database with different table structure (some columns dropped, some new added), I've got a problem.

Layer features (table columns) are shown two times, and those columns that have been dropped are also shown. For example, there are two geometry columns, two ID columns, one STATE column (which had been dropped) and so on. Option 'Reload feature type' doesn't work.

How can I clear old columns, and get only new?

EDIT:

I have just tried to clone (copy) this GeoServer instance to another server with another database instance (the same schema). I only changed database parameters and then accessed the layers. Everything is working good. I see columns (features) reflecting current table structure (no duplicates). I also tried to drop one table column and then tried option 'Reload feature type'. It works.

So, what might be the problem?

RESOLVED:

So, I had two database schemas with the same tables (one for testing and one for production purposes). Both schemas were granted dba privileges. Revoking privileges, resolved the problem, but I'm wondering if this is expected behavior.

When creating layer in GeoServer and when choosing table I get all columns from both tables (from both schemas). I think that this should not happen regardless of the db privileges.


texts:
I'm writing an automatization script that auto imports new line features. This has to be done for ~40k line features. The program runs pretty well since i had to optimatize it quite a lot to meet speed standards and to avoid memory errors.

I have one existing feature dataset in *.gdb that represents roads in my country . I then get a shapefile that represents new features. The scipt then takes each feature of a shapefile and creates new temporary shape with only that feature so i can select by location for only one feature. Geometry of the selected data is then saved as python dict for faster processing. That single feature is also saved as dict with geometry. Then it runs some self created functions for fixing topology(intersections, deletes overlaying features, snaping) and finally updates attributes with some of new attributes from shapefile and some attributes that are copied from overlaying features that were deleted.

The whole "program" is 1000+ rows long and seperated in more files for better code organization so that specific code snippet might be not useful.

Every so often though the script runs into runtime error. What is strange about this error is that there is no trackback or anything. It just shows the "Runtime Error" in red and nothing else.

I should say that this error only happens every so often but it breaks my code stability.

Does anyone have similar error experiance using arcpy and what could be done to avoid this error since I can't even handle the exeption since i get no feedback to the exact line in which the error happens?

What i'm trying to ask is if anyone from SE comunity got this "blank" error in their work with arcpy.

I'm using ArcGis 10.4 with python 2.7

Here is the picture of error message.


texts: How does QGIS legend divides its classes?

texts:
When making the legend in QGIS, does anybody know how QGIS divides its classes? For example, see the legend below. What do these numbers represent? Upper/lower borders, class centers?

Can anyone help me out?


texts: Performing sjoin on polygons and lines without intersection using GeoPandas?

texts:
I want to join a GeoDataFrame with Polygons (circular, were created from Points with buffer) with a GeoDataFrame that has Linestrings.
These polygons and lines do not necessarily intersect nor contain each other (might have a polygon in between two lines), and I would like to join them based on which polygon is closest to a linestring.

Is there a way to do so using GeoPandas (not using ArcPy)?

Data sample:

df_pts:                    df_lines:
    id | geometry              id | geometry
    p1 | POLYGON( .. )         l8 | LINESTRING( .. )
    p2 | POLYGON( .. )         l11| LINESTRING( .. )

What I have tried so far:

import geopandas as gpd
from shapely.geometry import Point, LineString

df_pts['buffer'] = df_pts.geometry.buffer(2)
df_lines = gpd.read_file('from_shape_file.shp')
df_join = gpd.sjoin(df_pts, df_lines, how="inner", op='intersects')

The problem with my current code is that it will miss cases where the buffered points in df_pts aren't 'touching' the lines.


texts: Creating geojson with lat lon out of shapefile using QGIS?

texts:
I have a shapefile which I want to export as geojson from qgis. To mix it with other data in my d3 project I want go get the coordinates als lat-lon-values (similar to the values you get by geocoding points with google-maps-API). Unfortunately qgis gives me x-y-values all the time like this:

{
"type": "FeatureCollection",
"name": "Rettungsdienstbereiche-BW-RLP",
"crs": {
    "type": "name",
    "properties": {
        "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
    }
},
"features": [{
    "type": "Feature",
    "properties": {
        "GEN": "Name",
        "BEZ": "Class"
    },
    "geometry": {
        "type": "MultiPolygon",
        "coordinates": [[[[393361.66645,
        5504072.61038],
        [393366.83389,
        5503968.65939],
        [393096.0904,
        5503949.01054],
        ...

I read many times that I have to give the layer a different CRS (e.g. EPSG 4326) but it does not seem to fix it.

Any ideas?


texts: Display a single country with OpenLayers

texts:
Can I display a single country using Openlayers?

I'm not trying to restrict zoom levels or . I want only one single country to be displayed. The rest of the world cannot be displayed.

My reasearch shows no information on my specific issue.


texts: Mass updating of joins in ArcGIS Desktop?

texts:
I have an MXD used to join many feature classes to the same table. This table has moved to a different workspace and so I need to update all the Joins to point to the new workspace. I don't see any tools in ArcMap for modifying an existing join.

How can I do this?


texts: Clip raster by raster with data extraction and resolution change

texts:
I need to stack multiple maps (tif) together and clip them all according to extent of one small raster map (second raster at the top of picture below). However, the size of pixels in each map is different. Is there any way how to make process visualized bellow?

Please, answer only R-solution or QGIS-solution.

library(raster)
e1<-extent(c(0,6,0,6))
r1<-raster(nrows=3,ncols=3,ext=e1)
values(r1)<-c(0,4,1,0,1,1,1,2,3)
plot(r1)
e2<-extent(c(2,5,2,5))
r2<-raster(nrows=4,ncols=3,ext=e2)
values(r2)<-c(0,8,2,1,4,9,9,4,0,8,0,0)
plot(r2)


texts: Displaying images next to features in ArcMap?

texts:
I have a series of point features which represent road signs and each point has one photo of each sign associated with it.

I want to create a mapbook with the locations of the signs shown as points and the photo displayed next to the point. Each page in the mapbook will have multiple sign locations and photos on it.

Is there an easy way to automate importing photos into an MXD in data view next to a point feature?

There are about 1000 hence need for automation.  Or somehow "labeling" a feature with a photo?


texts: Removing functions from Python Toolbox Template?

texts:
I've been working on a new Python Toolbox, which is getting quite large, and am wondering what of the template can be trimmed off when not used.

In the template there are functions like isLicensed, updateParameters, updateMessages etc., which most of the time I don't modify.  If I'm not modifying them from their original state (which is usually just a return or a return True, can they be safely removed?

I did a quick test where I just commented out these extra functions, and haven't seen any issues raised about them not being there, but haven't been able to find anything definitive about what needs to be there and what is optional.  Maybe they are required by ArcToolbox somehow.

The Python Toolbox template with unused functions commented out:

import arcpy
class Toolbox(object):
    def __init__(self):
        """Define the toolbox (the name of the toolbox is the name of the
        .pyt file)."""
        self.label = "Toolbox"
        self.alias = ""

        # List of tool classes associated with this toolbox
        self.tools = [Tool]

class Tool(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Tool"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        """Define parameter definitions"""
        params = None
        return params

    # Commented out as not being used
    #def isLicensed(self):
    #    """Set whether tool is licensed to execute."""
    #    return True

    # Commented out as not being used
    #def updateParameters(self, parameters):
    #    """Modify the values and properties of parameters before internal
    #    validation is performed.  This method is called whenever a parameter
    #    has been changed."""
    #    return

    # Commented out as not being used
    #def updateMessages(self, parameters):
    #    """Modify the messages created by internal validation for each tool
    #    parameter.  This method is called after internal validation."""
    #    return

    def execute(self, parameters, messages):
        """The source code of the tool."""
        return


texts: Enable a GeoServer OWS WFS Service via REST

texts:
I am trying to activate a GeoServer OWS (WFS) service via the REST interface for a workspace.
In the GeoServer admin interface, there are two boxes to tick for enabling a service manually.
One in the "Edit Workspace" page and one on the service page itself, as in the screenshots. Both need to be ticked to have the service enabled.
Edit Workspace page:

Service page:

I am able to enable the box on the service page via the REST call

PUT
http://localhost:8080/geoserver/rest/services/wfs/workspaces/workspace/settings

sending this as the json body:
{"wfs":{"enabled":true}}

The problem is, I have to manually enable the WFS checkbox on the "Edit Workspace" page first, otherwise the REST call will return a 500 Internal Server Error.
How can I get the first checkbox ticked as well using a REST call?


texts:
I received a dataset that had the coordinates for Latitude and longitude broken up in different fields.  There's a LAT_DEGREE field and a LAT_MINUTES field.

I've collated them into a single field for display, assuming I'm working with DMS coordinates- but when I bring the csv into arcmap the two new STRT_LAT and STRT_LONG fields are not present within the dropdown table of the Display XY Data tool.

I'm a bit confused, as this tool is not usually very picky, and will literally allow you to input any field you want no matter how wrong they may be. The fields are viewable when I open the table, but not through the Add XY Data option.

Any ideas?


texts: Trouble selecting points within a viewshed using QGIS 2.18.17

texts:
I'm newish to QGIS and am trying to select UK postcodes that are within the viewshed of at least one wind farm, however when I try to select only postcodes inside the viewshed, it simply selects all of them. I have already clipped to postcodes that are within 14km of a wind farm centroid, and need to now clip those based on whether they have a view of the wind farm centroid or not.

Basically, I calculated the viewshed, turned it into a polygon (Raster->conversion->polygonize), added rules to the new shapefile so that only the viewsheds would be colored/drawn, then used 'clip' under Vector->Geoprocessingtools->Clip. I then set the input layer to be the postcodes, and the clip layer as the viewshed polygon. But it's clipping all of the postcodes, rather than only those in the viewshed. I'll go into a bit more detail on what I've done/what outputs I'm getting below.

I have used the GBSRTM 90m as the elevation raster, and csv files with x-y coordinates for both postcodes and windfarm centroids. I then used the viewshed analysis plugin to calculate the binary viewsheds (using the windfarm centroids as the observer) and create a cumulative raster, which works very nicely.

Viewshed laid over postcodes

You can see here that there are clearly postcodes that are outside of this polygon.However, it seems that it is making both 0 and 1 (view or no view) the same polygon, as when I 'clip by polygon' the resulting clip is of all the postcodes.

If I don't remove the rule 'no filter' it will fill the entire area of the elevation raster, rather than the areas with a viewshed. I have removed this, but the clipped postcodes are still all of the postcodes, rather than those within the viewshed, so I think that this has been turned into one polygon with subdivisions.

Fill covering entire work area:

Is there a way to make it so that only the viewshed is turned into the polygon rather than then entire workspace? Or if not, is there a way to clip from only the viewshed part?


texts: Create multiple text layers in QGIS from one text file

texts:
I am using QGIS 2.10 and I want to import data which I have on a text file. This text file is a csv comma separated with four columns (first raw is the name of columns):

id,coordinate_y,coordinate_x,data
1,38.756812,-8.961929,Data 1
1,38.756812,-8.961929,Data 2
1,38.756812,-8.961929,Data 3
2,38.756812,-8.961929,Data 4
2,37.18333,-7.96667,Data 5
3,39.02292,-9.10491,Data 6
4,41.19508,-7.98096,Data 7

(The file contains in fact much more data, this is just an example)

If I import this to QGIS I get just on layer, because I add just one file obviously. But I want to have different layers, exactly as many layers as differente id values I have (first colum). So in the example above I would want to have four layers.

Of course, I could transform my csv file into different files containing just the same id values before importing to QGIS. But I wonder if QGIS has an option to create new layers based on an specific feature. That is, can I import just one file to QGIS and after that split into different layers?


texts: Global composite of radar data available?

texts: Iowa State offers an exceptional NEXRAD composite image as GeoTIFF for the entire continental US at a reasonable resolution. Is there a comparable GeoTIFF composite updated semi-regularly available for the entire world, or at least other major continental areas?


texts: ArcGIS popup two relations between the same tables

texts:
I am working with ArcGIS Server 10.5 and my problem is a double relationship between my data (web portal).
I have a layer (point) with different fields. Two fields is used to create two relations on a table (analysis) :

P 0
P 1

I have a table (analysis) with two fields to make two relations on an entity layer

Analysis 0
Analysis 1

I create two relationships between these data: Analysis 0 to P 0 and Analysis 1 to P 1.
I publish the data as a Map service.
When I select an entity, I can see the results of these relationships by "show related records".
But when I try to configure popup to get these results, only the first relation is displayed; for the second nothing is returned.
I'm searching for a solution to add the second relation in a popup.


texts: How to perform point to raster operation and plot it with raster of different spatial resolution in R?

texts:
I posted a question (please find the link below) regarding raster plots at stackoverflow but could not get the solution. Does anyone here has the solution?
https://stackoverflow.com/questions/63209707/how-to-perform-point-to-raster-operation-and-plot-it-with-raster-of-different-sp
The question :
I have following dataframe with three columns namely, "Latitude", "Longitude", and "value", along with a raster file (as attached with name "ras.tif') and area shape file (as attached with name "okl_shape.shp"):
Dataframe
df <- data.frame(Latitude=c(34.80833, 34.79851, 34.91418, 36.07204, 36.80253, 35.96305,
36.69256, 36.83129, 35.5915, 34.8497, 34.60896, 35.65282, 36.74813, 35.54615, 33.92075,
35.54848, 35.20494, 36.26353, 36.84053, 36.60183), Longitude=c(-98.02325, -96.66909, -98.29216,
-99.90308, -100.53012, -95.86621, -102.49713, -99.64101, -99.27059, -97.0033, -96.33309,
-96.80407, -98.36274, -99.7279, -96.32027, -98.03654, -99.80344, -98.49766, -96.42777, -101.6013
), value=c(0.84629845, NA, 0.916147287, 0.735707364, 0.432443798, 0.959728682, 0.123924419,
0.849589147, 0.307998062, 0.932215116, 0.939897287, 0.915825581, NA, 0.273945736, NA,
0.705023256, 0.447494186, 0.840686047, 0.901098837, 0.202523256))

Attached files
Here is the shape file of my area:
file
Here is the raster file:
file
Problem Description
I have to make a plot comparing point data (i.e. data frame described above) with attached raster (i.e. "ras.tif") and the shape file should overlay these plots. See the picture below for reference (In this figure, the left panel plots the points values as defined in the dataframe, right panel plots the raster, and the polygon represent the area shape file):

My code
I tried solving this with "spplot" but couldn't get the desired plot (something similar to above plot). Also, I don't know how can I insert the shape file in my plot. Below is the code I tried so far:
library(raster)
library(sf)
library(maptools)
meso.shape <- st_read('okl_shape.shp')
ras1 <- raster('ras.tif')
df <- data.frame(Latitude=c(34.80833, 34.79851, 34.91418, 36.07204, 36.80253, 35.96305,
36.69256, 36.83129, 35.5915, 34.8497, 34.60896, 35.65282, 36.74813, 35.54615, 33.92075,
35.54848, 35.20494, 36.26353, 36.84053, 36.60183
), Longitude=c(-98.02325, -96.66909, -98.29216, -99.90308, -100.53012, -95.86621, -102.49713,
-99.64101, -99.27059, -97.0033, -96.33309, -96.80407, -98.36274, -99.7279, -96.32027, -98.03654,
-99.80344, -98.49766, -96.42777, -101.6013), value=c(0.84629845, NA, 0.916147287, 0.735707364,
0.432443798, 0.959728682, 0.123924419, 0.849589147, 0.307998062, 0.932215116, 0.939897287,
0.915825581, NA, 0.273945736, NA, 0.705023256, 0.447494186, 0.840686047, 0.901098837,
0.202523256))
coordinates(df) <- ~Longitude+Latitude
x <- vect2rast(df, fname = names(df)[1])
x <- raster(x)
extent(x) <- extent(ras1)
crs(x) <- crs(ras1)
x <- projectRaster(x,ras1)
s <- stack(ras1,x)
sp <- as(s, 'SpatialPolygons')
p <- spplot(s, names.attr = c("Simulated FWI","Observed FWI"))
show(p)


texts: Showing only maximum values for each point

texts:
I have a dataset with concentrations of copper from different stations taken over several years. I would like to show only the highest concentration (mikromolar) for each station (STATN), and I tried using the
maximum("mikromolar", group_by:="STATN")

in the query builder but all I get is an error message. How do I do this?


texts: When I select a Polygon of a layer in QGIS, I am pretty sure I can see its coordinates somewhere, but I have no clue where.


texts: OpenLayers 3: setCenter seems not to work in jsfiddle

texts:
I'm trying to replicate an example from the OpenLayers Examples, specifically this one: http://openlayers.org/en/v3.0.0/examples/animation.html

The problem is that in my jsfiddle I cannot get all the buttons to work properly. For some reason the rotate buttons work but all the other ones do not. My fiddle is right here; http://jsfiddle.net/TimLucas/m6cju630/1/

It seems to be a problem with some view.setCenter since this is the only thing different in the functions calling the other buttons ('rotate to Madrid', etc.). I was searching for other examples where this function does work, but I cannot find any differences between the function in my fiddle that does not work and fiddles that do seem to get this functionality working (such as http://jsfiddle.net/ygtxwodL/).
 Can anyone see what I am doing wrong?

I am rather new to JavaScript so apologies for any obvious mistakes.


texts: How to change default base layer in GeoNetwork 3.0?

texts:
GeoNetwork seems to use OpenStreetMap and MapQuest as default WMS (or WMTS), but I found nothing about that in the documentation.

Can I change it to another WMS or WMTS, if so how?


texts: How to document field properties of attribute in shapefile?

texts: I would like to document within ArcGIS how the values for specific shapefile attribute fields were derived or obtained.  Is it possible to input and export this information as a report with ArcGIS 10?


texts: Remove points outside a map with ggplot2

texts:
My dataset consist in a converted raster dataframe, with for each point a long/lat, a categorical value and a numerical value are associated with. It can be downloaded here.

The code hereafter allows me to generate this map.

My issue is that I can't find a way to get rid of all the points that are mapped outside the polygons boundaries. I tried to convert the df as a raster and use the raster::mask function, but when doing this I loose information. I also tried the the rgeos::gDifference, but same problem, can't make the job. Any hint on how I can achieve my goal?

library(rgdal)
library(raster)
library(sp)
library(maptools)
library(ggplot2)
library(ggmap)

# load spatial data
fr <- getData('GADM', country = 'France', level = 0)
fr <- spTransform(fr, CRS("+proj=longlat +datum=WGS84")) #provide a
coordinate system

#open df to plot
df = read.table("mapdata.txt", header=T, sep="\t", quote="", dec=".")

ggplot() +
  geom_tile(data=df, aes(x=lon, y=lat, fill=item, alpha=prob)) +
  geom_polygon(data = fr, aes(x=long, y = lat, group = group),
           fill="transparent", colour = "white", size=1) +
  theme_nothing(legend = FALSE)


texts: Listing installed QGIS plugins via PyQGIS

texts:
Can you please tell me how I can programmatically (or from the console) access the loaded plugin list? I tried:

QgsProviderRegistry.pluginList()

but got:

  TypeError: QgsProviderRegistry.pluginList(bool asHtml=False): first argument of unbound method must have type 'QgsProviderRegistry

I am sure I am missing something, but don't know what. How can I get access to the actual QgsProviderRegistry instance?


texts: Change detection between two Landsat scenes?

texts:
I want to do time series analysis and find change in NDVI. I have rasters where each pixel is represented by some value at a time. Also I have same thing but represented by points.

And I would like to generate new map, with changes. Now Im looking at the transformation matrix and also on this post:
What is Change Detection and how I can perform such analysis with open source tools?

Am I thinking right about it? I would really like try to use something in Rcode (How to represent trend over time?), but Ive just started to learn it.

Qgis, landsat 30x30m


texts: Why does R's osmar::get_osm throw an error?

texts:
May be this is obvious, but I was not able to find a solution:
I just copied the code from here

library('osmar')
library('geosphere')
rome.box <- center_bbox(center_lon = 12.5450, center_lat = 41.8992, width =  2000, height = 2000)
api <- osmsource_api()
rome <- get_osm(rome.box, source = api)

but the resulting output / error message is

  Space required after the Public Identifier SystemLiteral " or '
  expected SYSTEM or PUBLIC, the URI is missing Opening and ending tag
  mismatch: hr line 7 and body Opening and ending tag mismatch: body
  line 4 and html Premature end of data in tag html line 2
  Fehler:
  1:  Space required after the Public Identifier
  2: SystemLiteral " or ' expected
  3: SYSTEM or PUBLIC, the URI is missing
  4: Opening and ending tag mismatch: hr line 7 and body
  5: Opening and ending tag mismatch: body line 4 and html
  6: Premature end of data in tag html line 2

What is wrong?

PS: I am a beginner with GIS...


texts: Loading RGB legend for vector layer from text file using QGIS?

texts:
I have a shapefile with one field containing a code for geological unit. I don't have ArcGIS Desktop l and therefore cannot access the layer file. However, from the source, I obtained a text file containing a line for each discrete code, its RGB definition, an entry for what I think is opacity, and a Text value for the legend.

What I want to do is load this text file and associate the contents with the appropriate field to define a style, which can then be saved in standard QGIS format.

I have seen two questions and answers about loading style from a text file for raster layers:

Load and convert .txt file to .qml for raster color map
https://pvanb.wordpress.com/2014/02/05/creating-a-qgis-color-map-from-text-file/

However, I cannot see any questions about how to do this with vector layers.

Do I have to manually edit my file into an XML-type style file or is there a quick option?

My file has this format at present (but can be readily changed):

QGIS Generated Color Map Export File

INTERPOLATION:EXACT
0,255,255,255,255,None

773,84,201,84,1,UISD-MFIR

42,176,219,255,1,KKF-WACKE

etc etc (note there are no spaces between lines but I have put them in for clarity. Also the first 2 lines were copied from one of the questions and inserted into my file, so they may not be relevant)

I am using v3.8.3.


texts: Determining best k node sample to approximate betweenness centrality

texts:
I'm looking for a way to approximate the calculation of betweenness centrality over nodes of a large spatial graph.

I know that igraph in R has a tool to approximate this index: estimate_betweenness()

The networkx python library also provide a tool to approximate the betweenness: betweenness_centrality

Now all those tools are asking for a sample of nodes on which the index calculation will be made. I want to use networkx, and the tool asks for a number of nodes it will randomly pick to constitute the sample.

My question is: how can I determine the best value of k (number of nodes) to sample from my graph, in order to keep the best ratio precision/time-efficiency? My idea involved a formula that could go like:

k = nb_node * x

where k is the number of nodes to sample from the graph, nb_node the number of nodes in the graph, and x some kind of magical number that would resolve all my problems...


texts: Choosing spatial statistics approach (in Arc or QGIS) for two point files?

texts:
I have two shapefiles made up of points, in which I am trying to statistically show their spatial relationship.

Here is my data:

The black points are landslides, and the points ranging from blue to red are points of channel steepness calculated continuously along a river network.

Basically I'm trying to find a way to numerically show that the landslides occur close to sections of the river that are steeper (light blue to red).

I'm struggling to choose which analysis (either in ArcMaps or QGIS) that would allow me to asses the distance between the landslides and the points in the river channel, with the additional variable of channel steepness.


texts: Using a hillshade function as processing template while adding rasters to a mosaic in ArcPro 2.5.1 does not work

texts:
I have a workflow in Arc desktop 10.6 where I add bathymetry raster source mosaics of different cell sizes to a master mosaic as type table and apply a hillshade function at the same time. (This is the only way I found to prevent Arc from outputting hillshade pixels which are in themselves shaded, which we do not want.) This works fine, except that arc desktop by design outputs hillshade rasters slightly smaller than the bathymetry, leading to gaps between the tiles.
I now wanted to make use of the fact that in Arc Pro the edges for a hillshade raster can be calculated. But if I try to add a hillshade function as a processing template in the same way I do in Arc Desktop, I only get the error message "Error: 8004205f: No new mosaic dataset item was added." I thought this had worked earlier (before the software update?) but am not quite sure any longer.
Does anyone have experience with performing these kind of tasks?


texts: Looking for major river basins boundaries worldwide

texts: I need the data (lat,long) for the world's major river basins boundaries. I want to use it in MATLAB, like "load coast" that gives the coast's boundary.


texts: I'm new to ArcGIS API for Javscript V3, and trying to dynamically create group layers and add layers together in a existing layer list. I'm not sure how to get this done.


texts: How to create a transparent buffer of a polyline?

texts:
I use vb.net arcobjects create a buffer around a polyline feature once it is selected. The problem is the buffer has a obvious colour. Since I have other functions on the selected feature,  I cannot clear the buffer because user may still need the feature selected.

When I select another feature, the new buffer will created and old buffer cleared. But there always a buffer which makes the polyline there looks different from other features in the same layer.

So I am thinking whether can make the buffer transparent so that it wouldn't affect the overview of the map.

My code is from an ESRI web sample:

 Public Sub CreateGraphicBuffersAroundSelectedFeatures(ByVal activeView As ESRI.ArcGIS.Carto.IActiveView, ByVal distance As System.Double)

    'parameter check
    If activeView Is Nothing OrElse distance < 0 Then
        Return
    End If

    Dim map As ESRI.ArcGIS.Carto.IMap = activeView.FocusMap
    ' Clear any previous buffers from the screen
    Dim graphicsContainer As ESRI.ArcGIS.Carto.IGraphicsContainer = CType(map, ESRI.ArcGIS.Carto.IGraphicsContainer) ' Explicit Cast
    graphicsContainer.DeleteAllElements()

    ' Verify there is a feature(s) selected
    If map.SelectionCount = 0 Then
        Return
    End If

    ' Reset to the first selected feature
    Dim enumFeature As ESRI.ArcGIS.Geodatabase.IEnumFeature = CType(map.FeatureSelection, ESRI.ArcGIS.Geodatabase.IEnumFeature) ' Explicit Cast
    enumFeature.Reset()
    Dim feature As ESRI.ArcGIS.Geodatabase.IFeature = enumFeature.Next()

    ' Buffer all the selected features by the buffer distance and create a new polygon element from each result
    Dim topologicalOperator As ESRI.ArcGIS.Geometry.ITopologicalOperator
    Dim element As ESRI.ArcGIS.Carto.IElement
    Do While Not (feature Is Nothing)
        topologicalOperator = CType(feature.Shape, ESRI.ArcGIS.Geometry.ITopologicalOperator) ' Explicit Cast
        element = New ESRI.ArcGIS.Carto.PolygonElementClass()
        element.Geometry = topologicalOperator.Buffer(distance)
        graphicsContainer.AddElement(element, 0)
        feature = enumFeature.Next()
    Loop

    activeView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGraphics, Nothing, Nothing)

End Sub

I am using vb.net arcobjects and arcmap 10.2. Any advice on it?


texts: Change the symbol scale in ArcMap legends

texts: As you can see from the image below, my enormous scale for traffic pattern shadows the other objects in the legend. Are there ways to reduce the size of object portrayed in the scale?


texts: Interpreting viewshed results attribute table

texts:
Using QGIS Viewshed Analysis plugin I've run an intervisibility analysis (with 5km buffer) on one point against 218 others and its produced the table below. Each of the 218 points has a unique code assigned to it, however on the attribute table below I cannot see easily on the table is what the code of the unique points are that are visible.

How can I create an attribute table with the unique code?


texts: How to transfer SQL variable back into ArcPy script?

texts:
I am trying to teach myself to access sql tables from an ArcPy script as part of a larger QC process. I am fairly certain that I have the sql statement correct (it works in SQL Server, albeit formatted a little differently), but I have no clue how to return my declared sql variable back as a python variable so that I may run other stuff on it.

I am trying to check a sql table in an ArcSDE Database where the value of a single column is smaller than 1000 and larger than 10. If there are values outside this range, I need to run other processes.

This is what I've got so far:

SDE = r'Database Connections\NC_RISK - 106.sde'
SQLLink = arcpy.ArcSDESQLExecute(SDE)
L_HAZARDPROBABILITY = r'\NC_RISK.sql.L_HAZARDPROBABILITY'

sql = '''DECLARE @MyBadIndicator int; SET @MyBadIndicator = 0; SET @MyBadIndicator = SELECT 1 WHERE EXISTS (SELECT L_HAZARDPROBABILITY.F_EVENT
    FROM L_HAZARDPROBABILITY WHERE L_HAZARDPROBABILITY.F_EVENT<10 Or L_HAZARDPROBABILITY.F_EVENT >1000)'''

How do a get the value of MyBadIndicator so that ArcPy can use it?


texts:
I am using this command to get the ATMs list

osmosis --read-xml my_map.osm --tf accept-nodes amenity=atm --write-xml output-nodes.osm

But it is giving the list of nodes and ways also...I want only nodes and is there any relation for these nodes and ways.


texts: How does an underscore change leaflet layer behavior?

texts:
I'm not sure how the underscore affect leaflet layers.  I've seen it used to bind a popup to a sidebar click.  How does "map._layers" work?  I can't find anything in the documentation about using an underscore to select a layer differently.

geojson.eachLayer(function (layer) {
            var id = layer._leaflet_id;
            var name = layer.feature.properties.NAME;
            var coords = layer.feature.geometry.coordinates;
            var lng = layer.feature.geometry.coordinates[0];
            var lat = layer.feature.geometry.coordinates[1];

            // Populate features array and build autocomplete
            features.push({id: id, label: name, value: name, lat: lat, lng: lng});
            $( "#search" ).autocomplete({
                source: features,
                minLength: 3,
                select: function( event, ui ) {
                    map.setView([ui.item.lat, ui.item.lng], 18);
                    map._layers[ui.item.id].openPopup();
                }
            });
            // Populate sidebar table with clickable feature links
            $("#featurelist table").append('
'+name+'
');
            // Add features to zoom dropdown
            options += '<option value="' + lng + "," + lat + '", id="' + id + '">' + name + '</option>';
        });


texts: Issue running r.region in GRASS command line

texts:
I'm currently attempting to use r.region to preform analysis on a specific area of a raster image.  I'm receiving Lat/Long data from the step before me, but I'm having issues using that data in r.region.

The command I'm currently running is:

r.region map=dem n=32:13:51N s=32:13:34N e=110:56:46W w=110:57:13W

Which returns the error:

`ERROR: <n=32:13:51N> ** illegal value **`

What I'm confused about is that according to the specification, this input should be legal for r.region on GRASS 6.4.  According to the documentation (https://grass.osgeo.org/grass64/manuals/r.region.html) the boundaries can be specified as:

 n=value
      Value for the northern edge (format dd:mm:ss{N|S})
 s=value
      Value for the southern edge (format dd:mm:ss{N|S})
 e=value
      Value for the eastern edge (format ddd:mm:ss{E|W})
 w=value
      Value for the western edge (format ddd:mm:ss{E|W})

Why does my input fail when as far as I can tell it is in the correct format?

All the examples I've seen of r.region don't do it this way and instead do something like r.region map=mymap n=220750 s=220000 w=638300 e=639000.  I would have no problem running like this except I don't understand what those values are and how to convert from lat/long (I have both DD and DMS) to this integer value.


texts: Why the joined fields doesn't show properly in attribute table?

texts:
I recently joined an excel into attribute table on ArcGIS. The excel has been saved into csv format and the joining worked.

Also, when I click on a feature, it shows all attribute fields.
Now I repeated the process but it appeared some problems. The first lines which contains numbers is not appearing with a letter in front, like in the first screen, but like this:
 Also, when I click on the feature, it doesn't appear the fields that I've added from the excel, but only the primary ones.
Now, I removed all symbols that ArcGIS doesn't like from the excel, but with all that, I don't know what to do in order to overcome this problem.
I know that it's something easy but I'm beginner and all this little issues can became very annoying because of my misunderstanding.


texts:
I would like to use the richer data and styling API QgsComposerTextTableV2 offers. However I get this error when adding it to the composer:

TypeError: QGraphicsScene.addItem(QGraphicsItem): argument 1 has unexpected type 'QgsComposerTextTableV2'

here is the code:

    r = iface.mapCanvas().mapRenderer()
    c = QgsComposition(r)
    rows = self.buildRows() # A list of lists
    composerTable = QgsComposerTextTableV2(c, False)
    composerTable.setContents(rows)
    c.addItem(composerTable)
    return c

could someone provide code demonstrating a minimal implementation ?


texts:
Does anybody know what's the easiest way to install GDAL 2.0 on a MacOSX?

The usual suspects kingchaos binary distribution and homebrew seem to be stuck on GDAL 1.11

I need support for TopoJSON feature properties that seem to have been included in 2.0

EDIT 2017/01/07: kingchaos binary distribution provides now the GDAL 2.1 distribution


texts: Workflow for Data Cleaning and Merging of Multiple Point Vector Layers in QGIS

texts:
I have multiple point vector layers in shapefile format. Each shapefile contains information of points (longitude and latitude) and datetime (in dd-MM-yyyy format). The problem is that some layers have overlapping areas with points from 2 or more layers in the same area.
I would like to clean up these overlapping areas by removing the points from the older layer and just keeping the newer points in the overlapping areas. Subsequently, I will merge all the layers after cleaning (as well as those without overlaps) into one layer. However, I am unsure of how to automate the comparing of newness between layers and removing the older overlapping points.
So far, I have only managed to come up with a model that converts the newer point layer into a polygon>extracting out points of the older layer that is within the polygon>remove these points from older layer with difference>merge 2 layers into one "cleaned" one before merging all the layers. But this is very manual as I have to select and check the layers myself and this model could only handle 2 layers at one go.
What is a better way of improving the automation of the entire process?


texts: Importing rrd file into ArcGIS for Desktop?

texts:
I have an something.rrd with something.img.xml and something.img.vat.dbf.

I need to import them as raster image to ArcMap 10.4.

Is this possible and if so, how can I do it?


texts: Local GeoJSON in Leaflet using leaflet-ajax

texts:
My aim is to include a local geojson file in my Leaflet map application using leaflet-ajax , as suggested by this earlier answer.
In my root directory, I have:

index.html
entire contents of Leaflet download
leaflet.ajax.min.js containing the contents of the source file on Github
bb4326.geojson containing 4 point features in EPSG4326

Index.html looks like:
<!DOCTYPE html>

    <title>Hey up here!</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>

Opening index.html in a browser results in the basemap at the requested location and zoom-level, but the geojson file contents are not displayed. What am I overlooking? I thought that the ajax.min.js script ought to load the dataset for me?
bb4326.geojson was created by exporting a Shapefile to GeoJSON in QGIS and looks like:
{
"type": "FeatureCollection",
"name": "bb4326",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 1, "cat": "A" }, "geometry": { "type": "Point", "coordinates": [ -1.903211081088789, 52.483536707820782 ] } },
{ "type": "Feature", "properties": { "id": 2, "cat": "A" }, "geometry": { "type": "Point", "coordinates": [ -1.569431757803851, 55.041100936161001 ] } },
{ "type": "Feature", "properties": { "id": 3, "cat": "B" }, "geometry": { "type": "Point", "coordinates": [ -0.164490580870734, 51.446934150191545 ] } },
{ "type": "Feature", "properties": { "id": 4, "cat": "C" }, "geometry": { "type": "Point", "coordinates": [ -3.239562634800648, 51.514642158718445 ] } }
]
}


texts: How to split non-contiguous feature in QGIS?

texts:
I have a shapefile with a feature that is non-contiguous. I want to split the areas on the left from the area on the right. However, QGIS's Split Features tool requires you to draw a line over the feature. When I draw a line between the two areas of this feature, it doesn't do anything.

How should I split this feature?

Here's a screen shot. The feature I want to split is in yellow.


texts: Cannot remove blue "nested" grid/rectangles in QGIS canvas?

texts:
A blue "nested" grid suddenly appeared in the canvas (see image below). I don't know what I did to make this happen and how to get rid of it.
Can anyone please advise me on how to remove this?


texts: How to mask labels in QGIS using an inverted polygon?

texts:
I created a file consists of a raster (snow load) and a vector with municipal boundaries. I added a vector with the contour lines of the snow load. Labels represent the snow load (kN / m2).

With the function inverted polygons I got this result

http://ge.tt/36VVO082/v/0?c

How can I hide the labels without using the plug-in mask (http://www.oslandia.com/masking-features-in-qgis-24-en.html)?

EDIT 06/01/2015
I am attaching a printout of the Atlas (snow load).
http://ge.tt/16FBv382/v/0?c


texts:
As for my issue, I am facing a problem when importing a polyline shp from AutoCAD MAP.

For example I am having a shpfile with 5 features and when imported to AutoCAD, polylines are exploded to lines.

Has anybody faced this issue before ? Any propositions on how to handle with this ?


texts: ArcPy UpdateCursor: How to find specific row index of dictionary key/value difference?

texts:
I have a Python script that hits a REST API and grabs attribute data for rooms in buildings from an IBM Tririga DB. I have an Enterprise geodatabase rooms feature class populated with these same attributes. I want to update the feature data if there are changes in the Tririga DB. It works, but at the moment, it's changing all the data for the record, whether it matches or not. For example Rows[1,2,3] match the DB, but Row[4] does not. All four values are overwritten anyway. This is fine, but I'd like to make the script more efficient/elegant. I only want to change the specific row indexes where there are differences.

I'm assigning the feature class and DB attributes to a dictionary {fc_attr:db_attr} and comparing the differences between the keys and values. I'm wondering if there is a way to identify the specific row or rows where there are differences and change only those?

Here the relevant section of my script. I'd like to change the line row[6], row[7], row[8], row[9] = tri_attribute to rows_that_need_to_be_changed[x]= tri_attribute:

with arcpy.da.UpdateCursor(rooms, '*') as cursor:

##sde feature class attributes

for row in cursor:

    fcSpaceID = row[2]
    fcSiteName = row[5]
    fcRoomNum = row[6]
    fcSpaceClass = row[8]
    fcArea = row[9]
    fcEditUser = row[13] ## last_edited_user field
    fcEditDate = row[14] ## last_edited_date field

    attributes_dict = {fcRoomNum:triRoomNum,
                          fcSpaceClass:triSpaceClass,
                          fcArea:triArea,
                          }

    fc_attribute = attributes_dict.keys()
    tri_attribute = attributes_dict.values()

    ##update feature class with data from Tririga
    if fcSpaceID == triSpaceID:

        if fc_attribute != tri_attribute:

            row[13] = "GIS Admin"
            row[14] = datetime.now()
            row[6], row[7], row[8], row[9] = tri_attribute

            cursor.updateRow(row)

    else:
        continue


texts: GeoServer polygon intersecting features of WFS

texts: How to get all the features intersecting a polygon using wfs.I am able to get all the features from WFS geoserver but dont know how to pass a polygon to get only specific features which are intersecting with the polygon.Please provide few lines of code in ol3


texts: Error 000212 Cannot create XY event source from arcpy.MakeXYEventLayer_management?

texts:
I am using ArcPy to create an output feature layer. I am using the command:

arcpy.MakeXYEventLayer_management(wells, "longitude", "latitude", wells_layer, GEOGCS, ""),

where wells is my input csv file and wells_layer is the path for the output feature layer. The idea is that after creating this feature class I will convert it to a shape file using arcpy.FeatureClassToShapefile_conversion. The issue is that when I try to run the first command

 arcpy.MakeXYEventLayer_management(wells, "longitude", "latitude", wells_layer, GEOGCS, ""),

I get error 000212 : Cannot create XY event source:

Error:File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 6589,
in MakeXYEventLayer raise e arcgisscripting.ExecuteError: ERROR 000212:
 Cannot create XY event source Failed to execute (MakeXYEventLayer).

The weird thing is that I am running this command on around 50 numbered csv files which have been created in Stata using a for loop. Therefore, the formatting and structure of these files is precisely the same. However, this error only occurs for files numbered 15 and above. For files 1-14 this command works perfectly. I am at a complete loss because there seems to be no difference between these files.

I checked the ArcGIS help section and it says that I should check paths, field names and whether the coordinates are numeric. All of these appear to be fine across all the files.

I am using Python 2.7 and Arc Gis 10.2

I have detected with some help in comments that ArcMap is not detecting the latitude field for files 15 onwards. This is strange because the formatting is consistent and there are no spaces etc.

The field names in the csv are in top row as follows:

id_no,latitude,longitude