texts: Customizing Configurable Map Viewer (CMV) to be available on two languages choosing with button click?

texts:
I want to make this application available on two languages (MK and EN) depending on whether the user choose (click) [MK] or [EN] button.
If I set variable loc = "MK", default application language will be "MK", but if I click on button [EN] to change the application language, I don't know how to reload dojoConfig.


texts: Replace text using python in active map view

texts:
I would like to update misc text in an active map window but can't seem to crack the code and I found some presentations that mention it can be done but the full code isn't there.

The following is from an ESRI presentation @ http://www.google.com.au/url?sa=t&source=web&cd=3&ved=0CCMQFjAC&url=http%3A%2F%2Fproceedings.esri.com%2Fdvd%2Fuc%2F2010%2Fuc-index%2Fuc%2Fworkshops%2Ftw_1433.pdf&ei=2R3STZmoAefTiAKT9oTyCg&usg=AFQjCNH-wFZb1mgpnWrV1QKQD5ynZtikfg&sig2=UBLu89hwpAx72djEJggFJg

import arcpy
findText=arcpy.GetParameterAsText(0)
replaceText=arcpy.GetParameterAsText(1)
mxd=arcpy.mapping.MapDocument("Current")
for textElm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"):
    if findText in textElm.text:
        textElm.text=textElm.text.replace(findText, replaceText)

I want to be able to enter text string "This is the old text" and replace with "this is the replacement text"

Simple find-->replace that word or notepad does but in an active ArcMap.


texts:
I am working with MODIS-NDVI data (MODIS/006/MOD13Q1) in Google Earth Engine. I have a script which exports each image in the image collection for given area and time period. I need to upgrade script which will composite band by years to have a single file for each year. Later, I need to export them Google Drive. Could anyone please assist me on upgrading below shown code?

var col = ee.ImageCollection("MODIS/006/MOD13Q1")
    .select("NDVI")
    .filterDate("2000-01-01","2018-06-01");

var ExportCol = function(col, folder, scale, type,
                         nimg, maxPixels, region) {
    type = type || "float";
    nimg = nimg || 500;

    var colList = col.toList(nimg);
    var n = colList.size().getInfo();

    for (var i = 0; i < n; i++) {
      var img = ee.Image(colList.get(i));
      var id = img.id().getInfo();

      var imgtype = {"float":img.toFloat(),
                     "byte":img.toByte(),
                     "int":img.toInt(),
                     "double":img.toDouble()
                    }

      Export.image.toDrive({
        image:imgtype[type],
        description: id,
        folder: folder,
        fileNamePrefix: id,
        region: studyarea2,
        scale: scale,
        maxPixels: maxPixels})
    }
  }

  ExportCol(col, "NDVI_MODIS_NKz_KZ", 250);


texts: Categorization with multiple values- QGIS 2.18

texts:
I'm trying to represent 2 columns in polygon layer. I've tried to do it with the rule-based style but didn't understand how to do it. This is the attribute table of the polygon:

I've tried to use this expression:

but with no succses.

In ArcGIS I can do it with this option, so i can see in the legend both length and area data:

How can i do it in QGIS 2.18?

I also read:

QGIS rule-based categorization with multiple variables
QGIS: Categorized styling - by multiple columns

but didn't find any suitable answer.


texts: Give Properties to a shapefile to be used by another person

texts:
I have bedrock geoology data. I want to classify the data so it appears with the same propeerties as it does on the suppliers website.

Is there a way i can attribute a property to a layer (in this instance colour) so that when i add the layer to another project it has the same properties.

In essence can someone send me a copied style?

Working in qgis 1.8.0


texts:
I want to develop geoserver extension that intercepts wms request, checks specific url parameter, builds clusters of points and generate the response image with clusters.

I've studied a little the geoserver code. And I'm planning now to replace "FeatureLayer" in "mapContent" by my class. The class replaces real points by clusters of points.

The problem is I don't know how to inject my extension code into wms processing.


texts: What is the "command line" in QGIS on Mac?

texts:
I am trying to follow advice here on Stack Exchange [for converting or using .e00 files, although that is not the point of this question].

In the meandering path of search results, I keep seeing answers that involve using "the command line".

What is the command line in QGIS? How do I get access to it?

[I am using QGIS 2.12 Lyon on a Mac running OS X 10.10.5.]


texts: QGIS - tool to plot polygon from point with known bearings and distances

texts:
Is there a tool that can convert a point dataset to a polygon based on some known parameters.

We will have

1- x,y

Azimuth

3.Distances in m for a- point in the direction of 2 (the azimuth) (200m), distance 180 degrees from 2 (25m), and distance -90/90 from the point (12m)

So the shapes will be something like this and be based on the point dataset.

We need to get the x,y for points lowercase a-d and then create a polygon based on these. If this is possible this can then be easily updated to have more points and create a better shape but the key question here is how can we create these points...

Is the only way to do this using spatial maths as in Creating points based on distance and bearing from survey point using QGIS?

Over the last year is there a plugin to achieve this?

Unfortunately, the Azimuth and Distance plugin works based on starting from a point and moving along that, whereas here I have multiple points and fixed dimensions.

The process to build a plugin/model to do this seems to be in http://www.portailsig.org/content/pyqgis-des-geometries-des-vecteurs-de-l-algebre-vectorielle-ou-des-cosinus-directeurs-exempl but I don't want to recreate the 'wheel' if I don't need to...

UPDATE
Unfortunately, my result with Kazuhito's reply is

and I get
2019-03-12T04:00:49     WARNING    Cannot zoom to selected feature(s) : No extent could be determined. Working in WGS 84.


texts:
I am building Google Map URL that will point few locations in the map

I want to add Zoom control to the map so users can zoom in and out

all the examples i saw were for java script and coding maps

is there any parameter i can add to the url to get the zooming control

I tried

&callback=initMap

&gestureHandling=cooperative

but non worked

any one know what i have to add to get scrolling and zooming controls?

my current URL looks like this

https://maps.googleapis.com/maps/api/staticmap?zoom=13&gestureHandling=cooperative&size=1200x800&maptype=roadmap&key=AIza***********************&markers=label:1%7C-33.87277000,151.21408000&markers=label:2%7C-33.87257000,151.21520000


texts: QGIS-- Find zipcode boundaries bisected by city boundaries

texts: I've tried the intersect function but that also returns small zipcodes entirely within a city. Ideally, I just need zipcodes that extend beyond city lines.


texts: Finding a Minimum Spanning Tree using QGIS

texts: As shown in the image I have a road network and the intersections as separate layers on QGIS. What I require is to extract the Minimum Spanning Tree connecting all points along the road network. Would be grateful for any suggestions as to how I may go about doing this.


texts: Using Python if/then codeblock to determine line segment lengths in ArcMap Field Calculator

texts:
Can anyone help me create a codeblock using an if/then statement through the Python parser in Field Calculator, to calculate the length of a line segment when the value of a different field is a certain value?
I am trying to calculate percentages of Passing Zones within Undivided 2-Lane State Highways. I have one field [PassingZoneDesc] with values "Both", "Left",  "Right" and "None". I have added fields for each type of Passing Zone, and would like to create an expression in Field Calculator that goes along the lines of If [PassingZoneDesc] = "Left" Then [Length_NPZ_Left] = !Shape.Length@Miles! else [Length_NPZ_Left] = 0.
I understand the above is a messed-up mash of VB Script and Python. Frankly, I am more familiar with VB Script but apparently ArcMap only supports geometry calculations in Field Calculator with Python now (hence the Python length calculation above). I know there are workarounds available, but I'm just wondering if there is a way to calculate the lengths in this manner.
I am not permitted to upload an actual sample of the data, but here is a screenshot of the attribute table and a draft code I was trying to use.


texts:
I cannot find a way to show in the Legend the Bus icon from Maki.

What should I write in the custom HTML?

http://com.cartodb.users-assets.production.s3.amazonaws.com/maki-icons/bus-18.svg)"> Greyhound Station


texts: Making raster DEM from irregular points shapefile in QGIS?

texts: I assume that first I need to interpolate and then somehow turn it into raster in QGIS?


texts: Create NetCDF subset with different sizes

texts:
I have to create a netCDF file with different subsets.
For example subset1 must be a 2d matrix, subset2 a vector, etc.

I am using functions of netcdf library in C/C++ code:

nc_create for the file creation,

nc_def_dim for dimensions definition,

nc_def_var for variable (subsets) definition.

Can you indicate me an example code which creates more variables with several dimensions?

I didn't find it.


texts:
What is the unit of measurement for pointRadius in the code below:

var dotStyle = new OpenLayers.StyleMap({
      pointRadius: 5,
    });

I mean what does 5 represent? 5 pixels or 5 mm or something else?


texts: QGIS 'Difference' tool return empty layers

texts:
I've been using QGIS's difference tool to create some new layers. All was going well until I hit a number of layers which return a blank layer with no features when I use the difference tool.

The shapefiles for the input and difference layers can be found at https://www.dropbox.com/sh/bd43bd3mtbsxu9r/AABW5RWlZn9iXiMYorD8Xftra?dl=0

QGIS 2.10.1 - Pisa running on OSX 10.10.5


texts: OpenLayers legend graphics not using proxy?

texts:
I am using the OpenLayers/GeoServer stack and my WMS requests are configured to go via a proxy using the following:

OpenLayers.ProxyHost="../gis/geoserver.seam?url=";

So far so good, all future WMS request are now channelled through this proxy script and WMS images are generated/returned as expected.

My problem arises when viewing the legend, the request to get the layer image (WMS request) ignores the OpenLayers proxy definition and tries connecting direct (client browser->geoserver server which is not externally accessible - hence the proxy).

How can I force the legend image requests to use the proxy?


texts: Composer style and printed style are different (minimized)

texts:
composer styles and printed image styles dont match. I tried printing with #Save out
    dpi = comp.printResolution()
    dpmm = dpi / 25.4
    width = int(dpmm * comp.paperWidth())
    height = int(dpmm * comp.paperHeight())
    image = QImage(QSize(width, height), QImage.Format_ARGB32)
    image.setDotsPerMeterX(dpmm * 1000)
    image.setDotsPerMeterY(dpmm * 1000)
    image.fill(0)
    imagePainter = QPainter(image)
    comp.renderPage(imagePainter, 0)
    imagePainter.end()
    image.save(plaan, "jpg")
and img = comp.printPageAsRaster(0,QSize(2970,2100),250)
     img.save(plaan, "jpg")

Canvas and composer window display picture like this(that was purpose too):
Printed image has styles somehow minimized. Tried as well from QGis and from standalone app as pdf and raster. Anyway result is not satisfying. Is there any additional option I can change to get output like I have in composer?

In my output styles are hard to distinguish, but I can change them, cause Forest Management Plan stylesheet is regularized by act.


texts: Create contours based on text attribute of point data (isogloss map)

texts:
I am trying to make an isogloss map in QGIS to map dialect differences.
I have made a point shapefile in which each point represents a place, and the different pronunciations are put in the attribute table. Obviously I have a massive amount of attributes.
As it is not convenient to just constantly change the attribute for the symbology, I wanted to create contours that separate the areas with different pronunciation.
I tried using contour, but it doesn't accept string data.
Imagine the points are plotted as follows, with the colours relating to a specific attribute

The countours I would like to have are something like this (for the same attribute)

I wonder if there is some way to do this easily, so far the only option I found was using voronoi polygons which I then merge based on the characteristics, which is quite a lengthy process, considering I have quite a few attributes to repeat this for. (The other way is changing the symbology and drawing manually)


texts:
I am using QGIS 2.12.0 to make a geologic map of NY and overlay things on it.  Helpfully the USGS provides a kml file to do this easily.

I found out that I could only edit the kml file outside QGIS (somewhat obnoxious) but if I save the kml file as a shapefile (using QGIS), then I can edit the attribute table within QGIS. I had done quite a lot of formatting the style page with my kml file and found that I could easily transfer the styles to the new shapefile with a simple copy and paste style command.

However when I edit the attribute table of the new shapefile the formatting disappears on the map for each entry I edit, despite still showing up in the style page of the shapefile.

Anyone seen this or know how to avoid it?


texts: "Multi-part geometries do not provide a coordinate sequence" error when extracting the long and lat of start and end points in GeoPandas

texts:
I am trying to extract the start and endpoint coordinates in GeoPandas. Following this link, I am using this code to extract the start and endpoints for GeoJSON files.
def add_start_end_nodes_to_gdf(self, gdf=None):
# This function adds start and end nodes to geodataframe

    if gdf is None: gdf=self.GeoData.gdf

    gdf['start_node'] = None
    gdf['end_node'] = None

    for index, row in gdf.iterrows():
        coords = [(coords) for coords in list(row['geometry'].coords)]
        start_node, end_node = [coords[i] for i in (0, -1)]
        gdf.at[index, 'start_node'] = start_node
        gdf.at[index, 'end_node'] = end_node

This is giving me an error
coords = [(coords) for coords in list(row['geometry'].coords)]
  File "****lib\site-packages\shapely\geometry\base.py", line 841, in coords
    "Multi-part geometries do not provide a coordinate sequence")
NotImplementedError: Multi-part geometries do not provide a coordinate sequence

What is happening here and how can I extract the start and endpoint of any polylines? I tried this list(row['geometry'])[0] to get the first line in the Multi-part geometries (polylines) with no success. My file contains only lines.


texts: QGIS extract average attribute value from layer based on vector

texts: Say I have one layer below with the blue, red, and yellow polygons in the image below. Each of these values has a different value for attribute A. I have a second layer, which denoted by the bold box in the figure below. I would like to find the average value of attribute A within the area spanned by the bold layer. In the example case it should return an average value of 2 since. How would I do this type of calculation in QGIS 3?


texts: How to generate evenly sized polygons within a boundary

texts: I have an area and need to create evenly sized polygons within the area. It doesn't matter where the polygons fall, only that they don't overlap and each area is the same. They needn't be squares/rectangles or any specific shape. Can this be done in ArcGIS?


texts: Installing module in embedded Python in QGIS

texts:
I'm a newbie to Quantum GIS and Python. I'm using QGIS on a Windows platform.

How can I install module for Python embedded in QGIS and how can I run embedded Python from windows directly?


texts:
I have two volunteers using iPhones with ArcGIS collector, but cannot get Collector installed on one of them.

iPhone 5 running 6.1.2 installs fine however, the other, an iPhone 5 running iOS 6.1.3. does not install.

Obviously I may have to get them to upgrade their OS as the message says but I am curious to know why this would be happening.

Is there something that has changed with Collector recently or any suggestions to get collector working with iOS 6?


texts: How do I calculate the percentage of a line which falls in each of my multiple ring buffers?

texts:
I have lines around which I have created multiple ring buffers at several intervals.
I have another line (call it the flight line) which in theory should overlap the original line.
I need to work out how much of the flight line falls within each of the buffers of the original line. See attached picture.

So, my plan of attack was to do an intersect of the flight line with the buffer, creating a point output. I was then planning to do a 'Split Line at Point' then using the attribute table to work out the lengths.

However, when I do the intersect, points are not created at all of the intersections with the buffer, just some of them, randomly.

Any ideas what I am doing wrong?
Or is there an easier way to do this?


texts: geoserver and openlayers select rectangle pixel values

texts:
I'm running a geoserver (2.5.x) with 1 raster file (GeoTIFF) as a layer. From my application I can access a single pixel value when clicked (through WMS), but what I'm really interested in is to get a range of pixels and then do some processing on that. The way I was thinking of doing it was to create a control with MOD_CTRL as trigger and then when dragging ended, to pass the selected range to geoserver so that I can get a list of pixel values back.

    OpenLayers.Util.extend(control, {
      draw: function () {
          this.drag = new OpenLayers.Handler.Box( control,
              {"done": this.notice},
              {keyMask: OpenLayers.Handler.MOD_CTRL});
          this.drag.activate();
      },

      notice: function (bounds) {
        leftBottom = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.left, bounds.bottom));
        rightTop = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.right, bounds.top));
        console.log(leftBottom, rightTop);
        return(true);
      }

The problem I'm facing is that I can't seem to find a way to pass the "range" (leftBottom,rightTop) to the geoserver - only a single pixel. The leftBottom and rightTop works fine, but how do I get back the list of pixel values?

This function seems to make the call but I'm not sure which service or parameters to use...

 function makeCall(bounds) {

   var url = sec.getFullRequestString({
                                          REQUEST: "GetFeature",
                                          SERVICE: "WFS", //should this be WPS?
                                          EXCEPTIONS: "application/vnd.ogc.se_xml",
                                          typeNames: 'mystore:mylayer',
                                          BBOX: bounds.toBBOX(),
                                          INFO_FORMAT: 'text/plain',
                                          QUERY_LAYERS: layerlist,
                                          FEATURE_COUNT: 50,
                                          WIDTH: map.size.w,
                                          HEIGHT: map.size.h,
                                          format: 'image/png',
                                        },
                                        "http://localhost:8080/geoserver/wfs");

    var request = OpenLayers.Request.GET({
      url: url,
      callback: extractFeatures
    });
  }


texts: Can the new Mapbox Vector Tiles be used as a QGIS basemap?

texts:
With the implementation of the mapbox vector tiles begs the question of how these could be used as a basemap in a QGIS printed map (assuming anyone cares about printed maps anymore!).

To use OSM data in a high-quality printed map currently involves downloading the data, styling it, and using it as the basemap - rather than using the openlayers plugin basemaps, which are rasters and do not print well at large print sizes.

I'm intrigued as to whether a mapbox OSM vector tile layer could ever be used to alleviate the download and styling of OSM data (a pain in the rear...). When I hear the word 'vector' I think of print quality...

Perhaps a mapbox QGIS plugin that allows one to sign in and use their own mapbox layers as basemaps?

Any thoughts or insights appreciated!


texts: Clipping cross-sections by flood area using ArcGIS for Desktop?

texts:
I have a problem with clipping cross-sections by flood area. I have source cross-sections that goes beyond the flood area:

When I clipped it by "Clip" tool I have this:

But I needs this:

It must be automatic because I have thousands of cross-sections.

Can anyone help me?

I'm using ArcGIS 10.1 for Desktop.


texts: Randomly select a record to update using arcpy.da.UpdateCursor

texts:
This question is related to Correct usage of a counter using arcpy.da.UpdateCursor. What I would like to do is use a cursor with a where clause to select a number of records. For each row, the values in two fields, TYPE_A and TYPE_B should be compared. If those two values are not the same, the field NUM_ID should be updated with the current value of the counter.

Once that is done, all but one of the rest of the records in the selection should be updated with the value of the incremented counter.

Some example data:

FEATURE 1 :NUM_ID = 4   TYPE_A = NEW   TYPE_B = NEW
FEATURE 2 :NUM_ID = 4   TYPE_A = NEW   TYPE_B = EXISTING
FEATURE 3 :NUM_ID = 4   TYPE_A = NEW   TYPE_B= NEW
FEATURE 4 :NUM_ID = 4   TYPE_A = NEW   TYPE_B= NEW
FEATURE 5 :NUM_ID = 11  TYPE_A = NEW   TYPE_B = EXISTING
FEATURE 6 :NUM_ID = 14  TYPE_A = NEW   TYPE_B = NEW
FEATURE 7 :NUM_ID = 11  TYPE_A = NEW   TYPE_B = EXISTING

The 4 features with NUM_ID = 4would be selected and Feature 2 will be given the NUM_ID 21, as its values for TYPE_A and TYPE_B are different. The next step would be to update all but one of the other 3 records by incrementing the counter. The next selection would be the 2 features with NUM_ID = 11. As both the records have different values for both fields, they would both be updated. The last selection will be for NUM_ID = 4. As both its values for the fields are the same, and it is the only record in its selection set, no update is needed.

The result:

FEATURE 1 :NUM_ID = 23   TYPE_A = NEW   TYPE_B = NEW
FEATURE 2 :NUM_ID = 21   TYPE_A = NEW   TYPE_B = EXISTING
FEATURE 3 :NUM_ID = 22   TYPE_A = NEW   TYPE_B= NEW
FEATURE 4 :NUM_ID = 4   TYPE_A = NEW   TYPE_B= NEW
FEATURE 5 :NUM_ID = 11  TYPE_A = NEW   TYPE_B = EXISTING
FEATURE 6 :NUM_ID = 14  TYPE_A = NEW   TYPE_B = NEW
FEATURE 7 :NUM_ID = 25  TYPE_A = NEW   TYPE_B = EXISTING

The code I have:

getNum("%Selected Features%")

def getNum(ftr):
  lst = [4, 11, 14, 15] #values for SQL expression
  x = 20
  fields = ('TYPE_A', 'TYPE_B', 'NUM_ID')
  assert "NUM_ID" in [f.name for f in arcpy.ListFields(ftr)], "NUM_ID field no in feature class"
  for l in lst:
    y = x + 1
   whereclause = "%(sql_name)s = '%(l)s' """ {"sql_name":arcpy.AddFieldDelimiters(ftr, "NUM_ID"), "l":l}
    with arcpy.da.UpdateCursor(ftr, fields, whereclause) as cursor:
      for row in cursor:
        if row[0] ! = row[1]:
          row[2] = y
        #some condition here
        cursor.updateRow(row)
    y += 1

TYPE_A only has one value in it for all features i.e NEW. TYPE_B could have any value. It does not matter which feature gets updated amongst those which have the same values for both fields (NEW), as long as one of them keeps the original value for NUM_ID. While this code updates the row correctly where the two fields don't match, I do not know how to let one of the records keep the original value, while the rest should be updated.


texts: Custom PrintService in ArcGIS WebApp Builder throws error Export Map Tool

texts:
I have WebApp application I am creating with the Developer Edition.
In ArcMap I created a custom print service like described here (https://enterprise.arcgis.com/en/server/latest/create-web-apps/windows/tutorial-publishing-additional-services-for-printing.htm).
When I use the custom PrintService in the Print Widget, no file is exported but an error is thrown: Error executing tool. Export Web Map.

When I copy the Web_Map_as_JSON code that is generated, remove the basemap layer (https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer), I can get the PrintService to work when I start from REST endpoint (execute) in the ArcGIS Server Manager.

However, the combination of MapServices (hosted on an internal server) and the ESRI basemap does not seem to work.

When I use the standard PrintService of WAB, I can get an export when I deselect all layers and only print the basemap, but when I add layers of my MapServices, it fails.

Any idea what has to be done to make the print widget working with a custom PrintService?


texts: How to fill a file with different GPS tracks so that when opened in a GPS track viewer the tracks appear simultaneuosly as different tracks? What GPS viewers do that?


texts:
Is there a lib (or api) that gives you a list of points that make a zone bound (circle, square or more complicated) when you give it a city name.

Given an iso city name (does this even exists?)

Ex:

Asking for 'Paris'

answer is :

south: 40.2
north: 41.44
west: -74.7
east: -72.69

I don't really care about the format


texts: Source for high-resolution satellite images free/low-cost?

texts:
I am doing a household survey in Kenya, and I need to ensure that my survey team visits every house within a given area.  I've been going to google maps and right-clicking on roofs to get coordinates via the "what's here" option.  This is really an inefficient use of time.

I'd prefer to have a high-resolution image that I could upload to google earth engine, and then perform a machine-learning algorithm to identify roofs.  I'd want to get a text file of the lat/longs of all the houses, which I could then cluster by distance and give to my surveyors, both in map and in checklist format.

But the images in google maps satellite view are copyrighted and not available in earth engine.  So I need images at high-enough resolution to identify corrugated iron and straw thatch roofs, with roughly ~3km^2 spatial extent.

What are some good sources for such data?  Ideally that will give it freely or cheaply to graduate students and/or nonprofits?


texts: Python: Open a (line) shapefile and calculate distance to point given as a longitude-latitude tuple

texts:
I have a Pandas dataframe in Python with longitude and latitude values of certain locations (see sample below):

        Index     Long       Lat
        0        -98.58       29.49
        1        -85.73       38.19
        2        -46.65       -23.56

I would like to calculate how far these locations are from a hurricane trajectory. I have the trajectory (line) as a shapefile.

Is is possible to do this directly in Python (I know how to do it in other programs, but want to do it in Python directly)?


texts:
I have this code right here
# Load package heavyRain and RCurl
library(heavyRain)
library(RCurl)

 #Assigning url and destfile
url <- "ftp://chg-ftpout.geog.ucsb.edu/pub/org/chg/products/CHIRPS-2.0/"

destfile <- "New Chirps Data.R"

 #Download CHIRPS
Download.chirps <- getCHIRPS(
          region = "Europe",
           format = "netcdf",
          tres = "monthly",
           sres = 0.05,
          begin = as.Date("1981-01-01"), end = as.Date("2020-11-30"),
           download.file(url, destfile)

       )

I get the following error message which I'm a bit of trouble getting rid off.
trying URL 'ftp://chg-ftpout.geog.ucsb.edu/pub/org/chg/products/CHIRPS-2.0/'

Error in download.file(url, destfile) :
cannot open URL 'ftp://chg-ftpout.geog.ucsb.edu/pub/org/chg/products/CHIRPS-2.0/'
In addition: Warning message:
In download.file(url, destfile) :
InternetOpenUrl failed: 'The server name or address could not be resolved
'
How do I solve this problem?


texts: Adding output to ArcPy script in ArcGIS ModelBuilder?

texts:
In ArcGIS 10.5, I have the following script which grabs the files from a geodatabase and merges them into one layer:

import arcpy

# specify the path to the GDB with the asset files
#make sure the path uses '/' and NOT '\'
arcpy.env.workspace = 'path/example.gdb'
arcpy.env.overwriteOutput = True

# collects all the Feature Classes in the GDB
fcs = arcpy.ListFeatureClasses()

# run the Merge tool
arcpy.Merge_management (inputs=fcs, output='merge_result')

I added the script to my toolbox as 'Merge'. I then go on to add the script to my model, where I need to use the 'merge_result' output for other processes. However, when I add the script to the model, there is not 'output nodule' which I can connect to the other processes (such as Intersect, seen below). How would I go about adding an output nodule to this?


texts: simple field calculator question in QGIS

texts:
I'm quite new to QGIS and I guess my question is quite simple but yet I couldn't find out how to do this successfully

I Have a 'roads' string column with text such as:

primary

secondary

etc.

and I want to make a new column/layer that which I give an integer value such as:

1

2

Respectively

So I can later Rasterize the layer

Any Ideas?


texts:
I believe this issue is is part of a bigger problem causing an issue with an arcpy script that I am trying to have run periodically to load data into ArcSDE feature classes using Append_management.

I have an ArcSDE database in SQL Server.  From a .sde connection inside of the catalog pane in ArcMap (10.2).  When connected as a user, it shows the feature classes that they can access as  dbname.user.featureclass.

For instance mygeodatabase.FCowner.WaterLines , each feature class in the sde database looks like this, as expected.  However when I drag the feature class into my mxd map area, the table of contents will say "WaterLines", then another featureclase might come into the .mxd as "mygeodatabase.FCowner.WaterPoints"

Can anyone explain to me why this is?  I'm not even sure if this is coming into play with the bigger issue I am having.


texts: R: polygons' id different than @data id after load from shapefile

texts:
I loaded a shapefile in R using readOGR and I named as data.map.

I can see the shape pretty well by using

plot(data.map)

The issue is that polygons' id (the id of the plot) is not the same with the @data id. What I mean is that, when I run:

plot(data.map[2, ])
data.map@data[2, ]

the polygon 2 that is drawed in the plot, is not the one that the data row  2 refers to.


texts: Creating adjacency matrix of topology graph of ArcMap for shortest path using ArcObjects?

texts: I have created a topology graph of a polygon feature and I want to find the individual FIDS of the lines of the polygon. I want to construct an adjacency matrix to create the shortest path. How can I do this with ArcObjects programming with VBA?


texts: Leaflet custom div & click propagation on other elements

texts:
I've gotten custom HTML applied successfully within my #map element (where Leaflet is appended) but I'm having unusual behavior with other Leaflet objects that find themselves within the transparent portion of my div.

The full div is highlighted in blue in the image above. The area above the marker and its popup have no special stylings or any Javascript applications to explicitly affect event propagation.

However, were I to click anywhere on that popup or its map marker, the click is propagating all the way through to the map, rather than stopping at the popup/marker. It's as though the inherent stopPropagation functionality on those objects is somehow nullified by being under my custom div. My cursor, too, has the grab-hand associated with moving the map, whereas it should be a default pointer when on those objects.

If I scroll the map so those objects are outside my div (outside the blue) then my clicks stop at them correctly.

I'm not sure if it's relevant but the top and left portions of the custom div do have stopPropagation applied to them, which also works as intended. But again, their parent element (the whole blue area) does not.

Any thoughts?

P.S. I should also point out that due to some dynamic scaling logic for resizing, there's no way to get rid of the parent element without a considerable and complex workaround, which we'd prefer to avoid. Otherwise I'd have done that already to bypass the problem.


texts: ArcGIS, Combine tool. Crashes once reaching 40% progress

texts:
I'm trying to combine 7 rasters containing soil related data. Rasters are 4.5G, give or take. All the rasters contain integer values. Once the combine tool reaches 40% progress, it stalls and arcmap shuts down itself.

Any suggestions on what is wrong and how to solve it?

This is my code:

series_raster  = arcpy.GetParameterAsText(0)
texture_raster = arcpy.GetParameterAsText(1)
wam_raster     = arcpy.GetParameterAsText(2)
slope_raster   = arcpy.GetParameterAsText(3)
ecodist_raster = arcpy.GetParameterAsText(4)
ecoreg_raster  = arcpy.GetParameterAsText(5)
vegtype_raster = arcpy.GetParameterAsText(6)
Output_raster  = arcpy.GetParameterAsText(7)

rasters = []
rasters.append(series_raster  )
rasters.append(texture_raster )
rasters.append(wam_raster     )
rasters.append(slope_raster   )
rasters.append(ecodist_raster )
rasters.append(ecoreg_raster  )
rasters.append(vegtype_raster )

arcpy.AddMessage('> Combining rasters...')
outCombine = Combine(rasters)

# Save the output
arcpy.AddMessage('> Saving combined raster...')
outCombine.save(Output_raster)


texts: QGIS Raster calculator predefined expressions syntax?

texts:
What is the correct syntax for the 'Predefined expressions' feature of the Raster Calculator of QGIS 3.14? How one can replace layer names with variables in the expression being saved (so they can be selected from dropdowns later, just like in predefined NDVI formula)? Is adding some other variables possible?
I mean the calculator which can be found in Processing Toolbox > Raster analisys > Raster calculator, not the one from the 'Raster' menu > Raster Calculator. (By the way, why there are two raster calculators?)


texts: Run pgr_createTopology() on custom geometry(linestring) table

texts: How could I create a topology for a custom generated geometry table having just the_geom geometry(linestring) column? Because pgr_createTopolgy() asks for the gid column also for a given table, which is not something like primary key.


texts: Does anyone know how (if) I can set the defaults within Legend Designer?  I want my rectangles for each layer to default to a 20x20 square, not a rectangle.  At the moment I have to change it manually for each layer.


texts: Distort image to display on leaflet.js based on known 16x16 point grid

texts:
I have an image that is a satellite picture, and with php gd I want to distort it so I can overlay it on a leaflet.js map. To make it a bit more simple, I have a grid of points, 16x16 which bind the image to the coordinates, like I chopped the image to 256 pieces and found appropriate coordinates for corners of each of those pieces.

It's tedious and inefficient to draw 256 pieces simultaneously, hence I'd like to process the image on the server-side. Is it even possible to do it with just PHP's GD library or is it necessary to reinforce the arsenal? The projection I'm using (and would like to stick with) is standard leaflet.js EPSG:3857. How do I even start about such a task ?


texts: Adding multiple layers in CartoDB using createLayer() not working

texts:
Using CartoDB (cartodb.js 3.5.02), it seems like you should be able to add multiple, independent tile layers to an instantiated Google Map.

I've tried using createLayer() a number of ways, using both viz.json and dynamic SQL and no matter what I do, only the last createLayer's tiles are displayed. (e.g. If I use viz.json, both legends are shown but only one set of tiles.)

Example loading 2nd layer on 1st layer's done():

cartodb.createLayer(map, url1)
    .addTo(map) // ultimately not displayed
    .done(function (layer) {
        console.log('added url1 ',url1);
        cartodb.createLayer(map, url2)
        .addTo(map) // displays OK
        .done(function (layer) {
            console.log('added url2 ',url2);
        })
        .error(function (){
            console.log('problem adding 2nd layer');
        });
    })
    .error(function () {
        console.log('There is something wrong with requested data!');
    });

Example using dynamic SQL:

cartodb.createLayer(map, {
    user_name: 'validusername',
    type: 'cartodb',
    sublayers: [
    {
        sql: 'SELECT * FROM '+tbl1,
        cartocss: '#'+tbl1+'{polygon-fill: #FF6600; line-color: #FFFFFF; line-width: 1; polygon-opacity: 0.7; line-opacity: 1;}'
    }]
})
.addTo(map)
.done(function(layer) {
    console.log('added ',tbl1);
    console.log(map.overlayMapTypes.length); // ==1
}).error(function(layer) {
    console.log('problem loading cartodb layer');
});

cartodb.createLayer(map, {
    user_name: 'validusername',
    type: 'cartodb',
    sublayers: [
    {
        sql: 'SELECT * FROM '+tbl2,
        cartocss: '#'+tbl2+'{polygon-fill: #FF6600; line-color: #FFFFFF; line-width: 1; polygon-opacity: 0.7; line-opacity: 1;}'
    }]
})
.addTo(map)
.done(function(layer) {
    console.log('added ',tbl2);
    console.log(map.overlayMapTypes.length); // still ==1
}).error(function(layer) {
    console.log('problem loading cartodb layer');
});

I'm guessing that createLayer() resets gmap's map.overlayMapTypes on each call, as its length == 1 even after the second call. Is there a better way to do this, or is this a bug?


texts: How to create a minimum bounding polygon for raster layers in QGIS?

texts:
I am looking for a tool, that creates minimum bounding polygons around georeferenced aerial images. I have about 200 of them an redrawing there dimensions by hand would be quit time consuming.

I am working with QGIS 2.14.3. I want the tool not to redraw the bounding box but the valid pixel only.

I allready tried out the deprecated plugin Image boundary (which creates only a bounding box and not even that correctly) and the experimental plugin Image footprint (which crashed after 10 minutes). Is there any alternative to these tools?


texts: Is there a way to Rotate Map Window or Layout in MapInfo Pro v16?

texts:
I have a town that is long and narrow on a north-west aligned coast. Ideally I would like to print a properties and water network for the town at around a 1:5000 or greater scale, with the map realigned to have the town lie lengthways.

Have only been using MapInfo for a few months, coming from an ESRI background where this task is pretty straight forward. It looks like there was a tool in previous 32-bit versions of MapInfo to rotate the Map window, but it does not appear to have made into the new 64-bit versions of MapInfo.

I don't have the necessary programming skills to even begin to construct my own tool to do this. Hopefully I have simply overlooked a MapInfo Pro feature or someone can point me in the right direction to a community made tool.


texts: Is there a way to retrieve the version of the ArcMap Addins currently loaded?

texts:
The Addin system doesn't seem to be perfect. When I update the Addin in the network share, the version number immediately gets updated in the ArcMap Addin Manager, even though the updated binaries have not been loaded into the Assembly Cache. This can confuse people whether they have the most current version actually loaded.

I am trying to compare the version of the actual binary, to the version ArcMap thinks it has installed. Getting the binary version is easy, but I am having difficulty getting the ArcMap Addin version. Is there an interface for this I need to query? Or is this even possible to do?


texts: Toolbox tool - IGPParameterEdit3 to browse for file

texts:
I'm trying to implement a custom Toolbox tool in ArcGIS, and am trying to setup a custom GPParameter that will take a file type with a specific extension.

I know that DEFileType is available and will provide a file browser.  How do you set a filter for specific file types using this object?

I suspect this needs to be done via IGxFilterInfo, but am unable to find any relevant documentation or examples, and am having a difficult time finding an example anywhere.


texts: Calculate auto covariant term using focal function from raster package

texts:
I want to calculate the auto covariant by myself. At this point I found the function focal from raster package. Here I show I proceeded :
 glm_BEF_AUTO <- glm(as.formula (MODEL_FORM) ,family = binomial(link = "logit"), data=Data) # my glm before adding autocov variable
  m48 <- matrix(1, nrow=7, ncol=7) #I choose here a neigbor matrix 7*7
  m48[4,4] <- 0
  my_point <-  c(500000, 5600000) # arbitrary point just to compute the distance matrix
  cells_a <- cellFromXY(ras_[[1]],my_point) # ras_ is one of my raster files juste to reconver the adjacent cells from it
  xy_point <- xyFromCell(ras_[[1]], cells_a)
  a<- adjacent(ras_[[1]], cells=cells_a, directions=m48, pairs=FALSE)
  xy_a <- xyFromCell(ras_[[1]], a)
  dist_to_a <- pointDistance(xy_a, xy_point , lonlat=FALSE)
  dist_to_a <- append(dist_to_a, 0, ((length(m48)-1)/2))
  d <- matrix(dist_to_a, nrow=dim(m48)[1], ncol=dim(m48)[2])
  inv.d <- 1/(d)
  inv.d [(dim(m48)[1]+1)/2,(dim(m48)[1]+1)/2] <- 0
  predic <- predict(Full_stack, glm_BEF_AUTO, type="response") #Full_stack represents raster stack of all my predictors
  #----------------------------------------------------------------
  autocov <- raster::focal(predic, w=inv.d, na.rm=T)

Where predic is the predicted occurrence probabilities raster and inv.d is inverse Euclidian distance matrix to the adjacent cells.  Is this way correct? I'm observing the same pattern between the probabilities and the autocov (see the attached figure).


texts: Why is the Upload checkbox for GP Services missing when publishing to ArcGIS Server on Amazon EC2?

texts:
I am trying to publish my own GP services to a GIS server instance with ArcGIS Server 10.4.1 built on Amazon EC2. In the service editor window, I do not see the "Upload" checkbock that typically shows when publishing GP services on a server. The WPS checkbox is ALSO missing.

Does anyone know why this is happening?

Is this normal?

I want the users of my web app to be able to upload files to use my GP services like I always did for on premise servers.


texts: How to plot coordinate system from EPSG 4326 on north pole centered map in Python?

texts:
I have the following pandas dataframe (df) which looks like this with column headers and data values, 3 points each:
temperature: array([-101.6015625, -100.9296875,  -85.4296875])
latitude: array([32.54681317, 32.81152175, 30.30341752])
longitude: array([-101.6015625, -100.9296875,  -85.4296875])

Using these following imports:
import matplotlib.pyplot as plt
import pandas
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point
import cartopy.crs as ccrs

When I run this code snippet:
d = {'temperature': [-101.6015625, -100.9296875,  -85.4296875], 'latitude': [32.54681317, 32.81152175, 30.30341752], 'longitude': [-101.6015625, -100.9296875,  -85.4296875]}
df = pd.DataFrame(data=d)
df = df.reset_index()
geom = [Point(x,y) for x, y in zip(df['longitude'], df['latitude'])]
gdf = gpd.GeoDataFrame(df, geometry=geom)
gdf.crs = {'init': 'epsg:4326'}
fig1 = plt.figure()
ax11 = fig1.add_subplot(121, projection=ccrs.PlateCarree())
ax11.coastlines()
ax21 = fig1.add_subplot(121)
ax21.set_frame_on(False)
ax21.xaxis.set_visible(False)
ax21.yaxis.set_visible(False)
gdf.plot(ax=ax21)
plt.tight_layout()
plt.margins(y=10)
ax11.set_xlim(ax21.get_xlim())
ax11.set_ylim(ax21.get_ylim())
plt.show()

I get the following output:

However, when I run the following to centre the map over the North Pole,
d = {'temperature': [-101.6015625, -100.9296875,  -85.4296875], 'latitude': [32.54681317, 32.81152175, 30.30341752], 'longitude': [-101.6015625, -100.9296875,  -85.4296875]}
df = pd.DataFrame(data=d)
df = df.reset_index()
geom = [Point(x,y) for x, y in zip(df['longitude'], df['latitude'])]
gdf = gpd.GeoDataFrame(df, geometry=geom)
fig = plt.figure()
ax1 = fig.add_subplot(121, projection=ccrs.AzimuthalEquidistant(central_latitude=90, central_longitude=0))
ax1.coastlines()
ax2 = fig.add_subplot(121)
ax2.set_frame_on(False)
ax2.xaxis.set_visible(False)
ax2.yaxis.set_visible(False)
gdf.to_crs("+proj=aeqd +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs").plot(ax=ax2)
plt.tight_layout()
plt.margins(y=10)

I get this:

The coordinates are in the wrong position.
I have followed this kaggle tutorial tried using this North Pole Azimuthal Equidistant transform on the GeoDataFrame but I think I have not implemented it correctly.
The output I'm after I would like to look like this:


texts: Split lines layer into multiple parts using polygons

texts:
I have a polyline layer of rivers in England (one line, only attribute is length), and I need to divide it into regions so that I can work out the length of rivers in each region (the green bit is the line layer in the picture.

Is there a way to clip the line by the polygon layer, so that it creates one line per region? (a multi-part feature is fine)

Just to add - I've tried the clip tool, but it just clips to the outline of the whole polygon layer - so doesn't split up the regions...


texts: Is it possible to sum labels that are colliding in MapboxGL?

texts:
I have a set of vector data with monetary values.  With the default MapboxGL label behavior, some labels are displaced 'behind' others and set to hidden, dependent on the camera angle.
I would like to be able to aggregate the labels that are displaced, and add their values to the label that is displacing them.  Is this possible?
A sloppy alternative would be to generate combinations of vectors beforehand and serve them based on the tile layer, since I'm using Mapbox Vector Tiles served locally.  Unfortunately that wouldn't really account for viewport angles, and would only minimize the issue rather than solve it.


texts: What geocoding service can handle addresses in China and deliver accurate latitude, longitude, and estimation of accuracy results?  I have between 6,000 and 40,000 addresses in total.


texts: Is there a way to create a tiled map cache without using ArcServer? I have aerial photography in .sid format that takes a while to load, whereas cached jpeg tiles will load much much faster. Any way I can work around this issue?


texts: Out-of-Sample predictions with spdep::sarlm

texts:
I am trying to make an out of-sample-prediction for spatial data using the spdep package. The documentation claims that this should be possible. However, I do not understand how it works. In particular I do not know how the spatial weights should be handled.

In the example below I generated data which I split into a training and a test set. How can I fit the model using the training data and predict the outcome of the test data?

library(spdep)
set.seed(1)
coords    <- data.frame(x = runif(n=20, min =0, max = 10),
                     y = runif(n=20, min = 0, max = 10))
sp_data   <- SpatialPointsDataFrame(coords, data = data.frame(a = rnorm(20), b = rnorm(20) ) )
weights   <- nb2listw(knn2nb(knearneigh(sp_data, k = 2),  row.names = 1:20 ))

#Using all data to fit the model
sp_model  <- lagsarlm(a ~ b, data = sp_data, listw = weights)
in_sample <- predict(sp_model)

#Using train set to fit the model
train_set <- sp_data[1:15, ]

#Out-of-sample prediction
test_set <- sp_data[16:20, ]


texts: Import and Plot MS Excel file in ArcGIS (v9.3) ModelBuilder

texts:
I am trying to create a tool using ArcGIS ModelBuilder (v9.3) that will allow me to import an Excel file, and output it as a shapefile in a coordinate system of my choice - or, if choosing the CRS is not an option, in WGS84.

I have set the input dataset (as part of the model), but can't seem to find a tool to facilitate the import. I have an ArcView licence.


texts:
I have published a WMTS based on png8 images.
I have tried to view it in QGIS but even though I can apparently connect to the service I see no image at the viewer.

I am not sure whether the image format must be described in the capabilities as png or png8.
Should the image format be described as png or png8?
does QGIS support png8 format for WMTS?


texts: How to set identical EXCLUDE conditions for multiple layers all at once?

texts:
We do noxious weeds surveying, and have a geodatabase with separate point feature classes for each distinct species.  In our Noxious Weed map, we have all of these species arranged into a single group in the table of contents.

Sometimes we make maps that need to display ALL the different species we've surveyed.  We generally use proportional symbology based on our "WeedArea" field, but we often need to use the EXCLUDE function to only show those points that have attributes that match certain values.

It's a pain in the butt to set the symbology for each separate feature class individually, when we are using the same conditions for each one.  An example exclude function we might use is SurveyDate >= date '2014-11-01 00:00:00' AND Control = 'UNTREATED'.

Is there any way to easily change the exclude condition of multiple feature classes all at once, to something like my example above?  Likewise, if we are not using proportional symbology (and thus, also not using the EXCLUDE function) but instead displaying using the Categories -> "Unique values, many fields" option, is there any way to have the same conditional symbology be selected for all feature classes?


texts: How do you convert raster to polygon while avoiding small polygons

texts:
I intend to convert a raster to several polygons, but I want to ignore polygons that are too small, and just keep the larger polygons.

How can I do that?


texts: How to work around rasterio installation issue below

texts:
I'm trying to install the rasterio python package using the conda package manager. But when I try to do this in a new clean conda environment, I get an "Found conflicts!" error with no information on what the conflicts are.
conda create --name newenv1 --channel conda-forge rasterio
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will     retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Failed
UnsatisfiableError:
Note that strict channel priority may have removed packages required for satisfiability.


texts: How to extract common outline of multiple polygons with code?

texts:
I'm not really asking for a chunk of code to do this, but more of an algorithm I can work with myself.

For example, this is the state of Maine, obviously, and I have the points of each county stored as an individual polygon. I am looking to process all of those points in whatever way possible to end up with only the outer outline. Does having islands outside of the outline complicate things? Note: I know this is easy in QGIS but I need to be able to do it on the fly with a PHP script. Note2: Maine is just an example, I know state outlines are available elsewhere...I could have any number of counties from potentially more than one state. Any help is greatly appreciated! - Brandon

EDIT: This question differs from others in that it is absolutely necessary for it to be done in PHP code, and not in GIS editing programs. In addition, this problem is more complicated than simply generating a convex hull as concave contours are a definite possibility. I honestly have no idea where to even begin and am looking for someone with a little more experience with problems like this than I have.


texts: How do I convert open street map export to geojson?

texts: I am trying to render this output from open street map into geojson to add into a map. I only need to export the data one time. How do I do that? OSM lists it as a use case. I see a js library to do this (but I need a backend solution). It also seems like you can export it as geojson from the api somehow. How do most people usually do this?


texts: Measuring the area of polygon tool not working

texts: I am using ArcMap 10.2.2 and can't get the measure tool to measure an area. For some reason The option to measure an area is not available for selection. Any ideas of how to activate it so I can measure an area of a polygon shape file?


texts: What is the limit to a column (field) title string in ArcMap?

texts:
Is the column heading limited to 10 characters?

Is there a workaround besides changing the alias?

I hear that QGIS does not have this issue.

I downloaded shapefile data from https://egis-hud.opendata.arcgis.com/datasets/c1c32742599a42c9a45c95be50ed2ab6_0 and added it to ArcMap. This data has a dictionary (below) detailing column suffixes and prefixes, but my column titles are truncated.

https://static1.squarespace.com/static/5902a36c6b8f5b69e909d6ff/t/590ca0766a4963faa86d03b1/1493999734390/lai_data_dictionary.pdf

The data dictionary does not match what is shown in the picture (e.g. "h", "transit_trips", "ht_own").


texts:
I'm using ArcMap 10.3.1, and I'm working with monthly precipitation raster data from 1995 - 2015. Currently, I'm trying to get all of these raster layers (252 in total) to a different projection by using Project Raster (I'm using UTM NAD 1983 13N). I was doing a batch process (R click tool > Batch) with all of these layers.

All was going well, but while on the 210th raster layer, processing stopped at 78% and timed out with an Error 999999: Error executing function.(I mention the percentage because the time out occurs at the same value each time I've restarted the process.) The message I received simply stated that it "failed to copy raster dataset." In addition, it continues to give this error for all of the remaining rasters, and I cannot continue the process.

I've checked the rasters I'm projecting from, to see if I can diagnose some error with the original, and nothing is out of the ordinary; the other rasters that I was able to successfully project are all the same as the ones that spark the error (i.e. their extent, rows, columns, initial projection, cell size, etc. are all the same. The only difference is the pixel data they hold). The successfully processed rasters (1 to 209) also appear fine. Does anyone have any idea for why this is occurring?


texts: Problem loading tif into raster dataset in ArcSDE 10.2

texts:
I have over 1000 raster datasets I need to mosaic into ArcSDE 10.2.  I can't use a mosaic dataset because the county I am working for wants to keep the files on an external HD, so the pointers won't work.  Unfortunately, I ran into this 10.2 bug when defining a spatial reference for the parent raster dataset:

http://communityhub.esriuk.com/technicalsupport/2014/1/28/updating-raster-datasets-in-geodatabases-at-102.html

The problem is that when I try the suggested workaround and create a raster dataset without a defined spatial reference, loading data is MUCH slower, meaning it will take weeks or possibly months to load everything.  I am building pyramids with Bilinear sampling, and LZ77 compression.  Any suggestions as to how I can speed up this process?


texts: Applying symbology to layers within the Table of Contents with Python

texts:
I am using arcpy to pull in layers from a file geodatabase but I receive the following error below. How can I assign symbology from a .lyr file to a TOC layer using arcpy?

# Name: Create Map
# Purpose: Fixes bugs and other mapping problems

# Import system modules
import arcpy
from arcpy import env

# Set the current workspace
env.workspace = "I:\UPDM.gdb"

# Rebuild Map Workspace
#
mxd = arcpy.mapping.MapDocument(r"C:\Users\aa2zz6\Desktop\test\Untitled.mxd")

df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
# Add layer to TOC
#
addLayer = arcpy.mapping.Layer(r"I:\UPDM.gdb\P_PipeSystem\P_Meters")
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")

#Set layer to apply symbology to
inputLayers = ["P_Meters",]

# Set layer that output symbology will be based on
symbologyLayer = (r"C:\Temp\Meters.lyr")

# Apply the symbology from the symbology layer to the input layer
for layer in inputLayers:
arcpy.ApplySymbologyFromLayer_management (layer, symbologyLayer)

Error

Traceback (most recent call last):
File "C:\Users\aa2zz6\Downloads\CREATE NEW MXD.py", line 29, in <module>
arcpy.ApplySymbologyFromLayer_management (layer, symbologyLayer)
File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py",
line 6934, in ApplySymbologyFromLayer
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Layer: Dataset P_Meters does not exist or is not
supported
Failed to execute (ApplySymbologyFromLayer).


texts: OpenLayers/Extjs/Mapfish put permaink in menubar

texts:
I solved my problem Problems getting openlayers permalink working on how to get the maps view permalink but now I want to put the permalink in the toolbar instead of reloading the page with the permalink. I would like a popup like the one here on stackexchange when you click the "Link" under the post. That pops up a box with the URL selected.

Here is my map: http://babkart.no/ and the toolbar is like this now:

var setToolbarContent = function() {

toolbar.addControl(
        new OpenLayers.Control.ZoomToMaxExtent({
            map: map,
            title: 'Zoom til kartets maksimumsvisning'
        }), {
    iconCls: 'zoomfull',
    toggleGroup: 'map'
}
        );

addSeparator();

toolbar.addControl(
        new OpenLayers.Control.ZoomBox({
            title: 'Zoom inn: klikk i kartet eller bruk venstre museknapp for å tegne en rektangel'
        }), {
    iconCls: 'zoomin',
    toggleGroup: 'map'
}
        );
toolbar.addControl(
        new OpenLayers.Control.ZoomBox({
            out: true,
            title: 'Zoom ut: klikk i kartet eller bruk venstre museknapp for å tegne en rektangel'
        }), {
    iconCls: 'zoomout',
    toggleGroup: 'map'
}
        );
toolbar.addControl(
        new OpenLayers.Control.DragPan({
            isDefault: true,
            title: 'Pan kartet: hold venstre museknapp inne og dra i kartet'
        }), {
    iconCls: 'pan',
    toggleGroup: 'map'
}
        );
toolbar.addControl(
        new OpenLayers.Control.DragPan({
            title: 'Vis info: klikk på et ikon for å vise mere informasjon'
        }), {
    iconCls: 'info',
    toggleGroup: 'map'
}
        );


texts: Is there an expression that can be used to force labels to not overlap specifically when there are more than one label per point. I have a map that has over 1000 school names and I am printing it on a poster. Some labels overlap. I have a feeling there is an autoplacement script that would avoid the labels from colliding. I have tried the leader lines and other tools and don't like how easylabel handles the data in the map composer.


texts:
I have a QGIS project, based on data from a PostgreSQL database. In this database I create an extra user, with limited rights.
I want to give this project to other users, but I don't want that they have to enter the login data everytime they open the project.
Therefore I store the connection to the database and the login data in the qgis_global_settings file and replace it on the PC of every project user.
It works fine and they can use the database, but if they want to open the project, the have to enter a master password. I never set any master password.

Where is the master password in QGIS stored?

Is there any file that I can give to the user, maybe in the qgis_global_settings or the qgis3.ini?

I do not want the user to have to enter any login data.


texts: Are personal geodatabases better suited for quickly querying indexed attributes than file geodatabases?

texts:
I'm preparing data for an ArcGIS Engine application that queries the data to search for an address. Sometimes we search just on the street name field, just on the house number field, or both. When using personal geodatabases or SDE geodatabases, one can add a multi-column attribute index in addition to single-column indexes. For some reason, according to the Creating attribute indexes ESRI article, multi-column attribute indexes are not possible when using file geodatabases. They don't mention why this is the case - maybe file geodatabases don't need them for some reason?

A multi-column index on the house number field and the street name field should theoretically improve my query performance when searching both fields at once, but is it worth switching over to using a personal geodatabase? I have a feeling that downsides of using a personal geodatabase might negate the benefits of the multi-column index.

I have been under the impression that Esri wants us to move away from personal geodatabases, but is this a case where personal geodatabases are the better option? If you have any experience with this, I'd love to know.


texts: ITRF 2014 at Epoch 2010.00 and ITRF2014 at Epoch 2018.60?

texts: What is the difference between ITRF 2014 at Epoch 2010.00 and ITRF2014 at Epoch 2018.60 ?


texts: It is possible to get single polygon using gdal.Polygonize()?

texts:
I have to get polygon outline for all raster in our server. I tried one example raster  and used gdal.Polygonize() function. With that I could produce thousands of small polygons but I only want a big polygon showing raster data areas. Does anyone have any idea How could I do this?

My Code sample:

import os
from osgeo import gdal, ogr
import sys
# this allows GDAL to throw Python Exceptions
gdal.UseExceptions()

#  get raster datasource

src_ds = gdal.Open( r"F:\Geodaten\Eigene\Luftbild\Orthobilder\20130802\Klostermoor2013_Ortho-0-0.jpg" )
print src_ds
if src_ds is None:
    print 'Unable to open %s' % src_filename
    sys.exit(1)
print "Done"

srcband = src_ds.GetRasterBand(3)
print srcband

# create output datasource

dst_layername =r"F:\TRANSFER (RW)\Shiuli\script_andre\raster_luftbild\POLYGONIZED_STUFF"
drv = ogr.GetDriverByName("ESRI Shapefile")

if os.path.exists(dst_layername+".shp"):
    drv.DeleteDataSource(dst_layername+".shp")
    print 'deleted'
dst_ds = drv.CreateDataSource( dst_layername + ".shp" )
dst_layer = dst_ds.CreateLayer(dst_layername, srs = None )
#prog_func = gdal.TermProgress

gdal.Polygonize( srcband, None, dst_layer, -1, [], callback=None )
dst_ds.Destroy()
src_ds=None
print "we are done..."

Here is the snapshot of my results:


texts: Select lines with an endpoint within a distance of a point feature class

texts: Any ideas on ways to select line features that have an endpoint/node within a distance of a point feature class? I have been using arcpy.SpatialJoin_analysis and arcpy.SelectLayerByLocation_management to achieve selecting all lines that fall within a specified distance of a point feature class; though, I want to make sure I do not capture lines that may fall within the search radius of a point but do not have and endpoint within the same search radius (e.g. just passing nearby within the search radius). I don't see this type of selection as a built in function for either arcpy.SpatialJoin_analysis or arcpy.SelectLayerByLocation_management, but I may have missed something. This would be a very useful functionality if it exists.


texts: Python console not working in QGIS on Mac?

texts:
Trying to open Python in QGIS returns this:

Failed to open Python console:

Traceback (most recent call last):
  File "", line 2, in
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 46, in show_console
    _console = PythonConsole(parent)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 83, in __init__
    self.console = PythonConsoleWidget(self)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 109, in __init__
    self.shell = ShellScintilla(self)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console_sci.py", line 86, in __init__
    self.refreshSettingsShell()
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console_sci.py", line 141, in refreshSettingsShell
    self.setCaretForegroundColor(cursorColor)
TypeError: setCaretForegroundColor(self, QColor): argument 1 has unexpected type 'unicode'

Python version:
2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

QGIS version:
2.18.9 'Las Palmas', exported

Python path:
['/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', u'/Users/Malaquias/.qgis2/python', u'/Users/Malaquias/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/C/Python/2.7', '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/numpy-override', '/Library/Python/2.7/site-packages/matplotlib-override', '/Library/Frameworks/GDAL.framework/Versions/2.1/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', u'/Users/Malaquias/.qgis2//python']

Deleted and reinstalled QGIS multiple times. No dice.


texts: Calculating field from three conditional statements

texts:
I am working on a road dataset and would like to calculate a field(speed) using three conditional statements from two fields:

formOfWay: with value, Dual carriageway etc.
routeHierarchy: with values A Road, A Road Primary etc.

My aim is to return a speed value of 65 where formOfWay is Dual Carriageway AND Route Hierarchy is either A Road or A Road Primary.

Using the code provided in a similar question asked, I have tried the code below in ArcGIS Field Calculator, but haven’t been unsuccessful. The error message returned point to a syntax error in line 2 and I suspect this should be the part of the code having the two ‘routeHierarchy’ values (A Road and A Road Primary).
 The code works with one coded value for routeHierarchy but returns an error when the second value is added.

def ifBlock(routeHierarchy, formOfWay):
    if routeHierarchy == ['A Road','A Road Primary'] and formOfWay == 'Dual Carriageway':
        return 65
    else:
        return 30

Please, can someone point out the correction I can apply to make this work?


texts: Using raster values from QGIS (Point Sampling Tool) vs Surfer (Grid Residuals)

texts:
I have a grid/raster file, interpolated using triangulation method in Surfer (Golden Software). When I contour the file (either in Surfer or QGIS), the contours are basically identical.

I have a point file (x,y) and I use it to read raster values at the point locations. If I use 'grid residual' function in Surfer, I get different values than if I use 'point sampling tool' in QGIS.

When I create a new raster from sampled xyz file, the raster obtained from point sampled QGIS data is not 'smooth'. The raster obtained from Surfer grid residuals is fine. To compare the contours - see figure below. The black contours are from point sampled file (QGIS), the red, smooth contours are from Surfer (grid residuals).

More details here (including some background on the interpolation of the original raster): Point sampling - QGIS vs Surfer

My questions are basically variation on the same theme:

1) Why is there a difference between QGIS point sampling tool and Surfer grid residuals?
2) How does the actual raster sampling work if the sampling point is not at the centre of the raster cell?
3) Is Surfer somehow smoothing the data?
4) Is the problem with my original raster - interpolation method, raster cell size? Should I be analysing the data before I interpolate it?
5) Anybody else had similar issues? Do you manage to deal with them in QGIS?


texts:
Every time when I start my QGIS I see the following message:

  GRASS init error: Problem in GRASS initialization, GRASS provider and
  plugin will not work : Module built against version $Revision: 64733 $
  but trying to use version $Revision: 67364 $. You need to rebuild
  GRASS GIS or untangle multiple installations.

This problem has appeared on Friday. And I am not able to find out what caused this issue. I work in Ubuntu Trusty Tahr 14.04 LTS. QGIS version is 2.12.3-Lyon.

Could someone help me to solve the problem with QGIS and GRASS?


texts: Setting field equal to raster Name ID for batch process in ArcPy

texts:
I am wanting to set an existing field called RasterID to the name of the raster for which the attribute table belongs to, but for a batch of rasters. Is there a way to do this with my current code structure and by setting 'expression' equal to the raster name? If I simply set expression = desc.baseName, I get an error.

This is how I am trying to implement arcpy.Describe():

import os,arcpy,glob
from arcpy import env
arcpy.env.workspace = r"C:\VMshared\small_example_valley3\SnowDepth4"
#arcpy.env.overwriteOutput = True
fieldName = "RasterID"

for rasterFile in arcpy.ListRasters("*.tif"):
    desc = arcpy.Describe(rasterFile)
    print "Base Name: " + desc.baseName
    expression = desc.baseName
    print expression
    arcpy.CalculateField_management(rasterFile, fieldName, expression, "PYTHON_9.3") #something wrong with this line?
print "done"

  Base Name: snowdepthN0001 snowdepthN0001 Runtime error  Traceback
  (most recent call last):   File "", line 12, in
  File "c:\program files
  (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3128, in
  CalculateField     raise e ExecuteError: ERROR 000539: Error running
  expression: snowdepthN0001  Traceback (most recent call last):   File
  "", line 1, in  NameError: name 'snowdepthN0001'
  is not defined  Failed to execute (CalculateField).


texts: Definition query on GDB annotation file- ArcGIS 10.3.1

texts:
I convert Cad annotation from Autocad, into GDB annotation using "import cad annotation" tool and this part of a big attribute table:

The "TextString" is the field i need to present on my map, but i need only the values that contain the character "k" inside them. I try to find a way to solve this issue in the definition query

I tried to select by attribute tool using this expression:
TextString ='*k', but with no success.

I know i can create a new field and start to classified every value with the character "k" inside it- but unfortunately, i have 3000 values!

also, i prefer not to use sort ascending on that field in order to gather all the wanted values and select them- there too many values.

I red Creating definition query on layer excluding decimal values in ArcGIS for Desktop? but didn't found answer.

How can i solve this issue with the right expression?


texts:
I'm using Open Street Map (OSM) and Open Trip Planner (OTP).
To perform a multimodal logistic system I have to integrate OSM with sea routes.
Specialists of ship simulation can represent sea routes using Route Exchange using RTZ-standard format.

Considering that OSM can be integrated with transit agency’s General Transit Feed Specification (GTFS), how can I convert back and forth sea routes from RTZ to GTFS?

I still don't find any tag for RTZ- they told me that it is a quite new format


texts: How to specify geometry field in Carto Import API?

texts:
I'm trying to import a CSV file into Carto via the Import API. The file looks like:

id,name,shape
1,"Test","POINT  ( 2673560.14000273 209469.89266413)"

I wrote a Python script to upload this test file via the carto-python library.

from cartodb import CartoDBAPIKey, FileImport

API_KEY = '...'
DOMAIN = 'mydomain'
cl = CartoDBAPIKey(API_KEY, DOMAIN)

fi = FileImport('test.csv', cl, privacy='public')
fi.run()

I can run the script and see the table in Carto, but the shape column isn't being recognized as geometry and therefore isn't making it into Carto's the_geom column. I'm looking at the documentation but I don't see any way of telling the API which field to use for geometry.

Also, is there a parameter for which SRID to use?

My XYs are in EPSG:2272; obviously Carto isn't going to guess that so is there a way to specify that as well?


texts: Format and coordinate flip of the Projected Hartebeeshoek Coordinates?

texts:
Could someone please explain (or point me to a place that explains) what the coordinate system for Wg23 (Hartebeeshoek Lo23) should look like on a map? There is a coordinate flip that constantly comes into play, when I work with WG23 data, which I don not understand. This gets even messier when working with a modified grid (e.g. a mine grid).

My first coordinate (Easting I assume?) is usually negative, resulting in map displays that are North down. Occasionally I would receive similar data sets with the North up. I'm not sure when and how this flip is applied and how I should correct for it.

I work in QGIS and ArcGIS.


texts: ArcGIS Error: Cannot set input into parameter spatial_reference

texts:
I'm using ArcGIS 10.2.
I can do "add XY data as layer" to associate latitude and longitude to a .dbf table, but when I try to do the same with python script it gives me an error:

Python code:
import arcgisscripting, sys, string, os
gp = arcgisscripting.create()
in_Table = "F:\Otim\interf\cg_rea.dbf"
in_x = "Latitude"
in_y = "Longitude"
out_Layer = "cg_rea_otim"
spref = "Coordinate Systems\Projected CoordinateSystems\Lisboa_Hayford_Gauss_IGeoE.prj"
gp.MakeXYEventLayer(in_Table, in_x, in_y, out_Layer, spref) #line where is the error!

Error: Runtime error  Traceback (most recent call last):   File "", line 191, in  ExecuteError: ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter spatial_reference.


texts:
I'm almost totally new to CartoDB. I've been looking around and read the api reference, but there seems not to be what I'm looking for.

What I want to do is to "Create visualizations at runtime". From what I read, it is possible to do it only if you already have a visualization created with the UI and then you can work with sublayers.

But what I actually want to do is to create a visualization from scratch, using just the table containing the values I want to represent on the map.

Is this possible or I'm totally out of mind?


texts: Nominatim 3.4.1 installation fails on Ubuntu 18.04

texts:
I am trying to install Nominatim 3.4.1 on Ubuntu 18.04 using the instructions here. When it is time to setup the Apache Web Server I get the following error after entering this command in the terminal.

gerry@gerry:/etc/apache2$ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
gerry@gerry:/etc/apache2$

I have a file here /etc/apache2/conf-available/nominatim.conf  that contains this text but I am unsure if this is correct.

<< EOFAPACHECONF
<Directory "$USERHOME/Nominatim/build/website">
Options FollowSymLinks MultiViews
AddType text/html   .php
DirectoryIndex search.php
Require all granted
</Directory>

Alias /nominatim $USERHOME/Nominatim/build/website
EOFAPACHECONF

Why can't I restart apache2?


texts: Hide layers with custom widget in QGIS 3.10 (C++)

texts:
I have written a custom application that loads multiple QgsMapLayers onto a basemap (OpenStreetMap raster tiles).  I am attempting to include a menu option that allows the user to hide or show one or more layers upon clicking on a checkbox.  As of QGIS 3.x you are supposed to utilize the QgsLayerTree class to set the layer visibility.  Relevant excerpts of my code are as follows:
layerDisplay.h:
using namespace Ui
{
    class layerDisplay;
}

class layerDisplay : public QDialog
{
     Q_OBJECT
  public:
     explicit layerDisplay(QgsMapCanvas *qmc, QgsProject *prj, QList<QgsMapLayer* > *lst, QWidget *parent = nullptr);
     ~layerDisplay();
     QgsMapCanvas *qm0;
     QgsProject *pj0;
     QList<QgsMapLayer* > ls0;
     bool selected;
  private slots:
      void setRasterDisplay(int checked);
  private:
      Ui::layerDisplay *ui;
};

layerDisplay.cpp:
layerDisplay::layerDisplay(QgsMapCanvas *qmc, QgsProject *prj, QList<QgsMapLayer* > *lst, QWidget *parent) : \
QDialog(parent), ui(new Ui::layerDisplay)
{
    ui->setupUi(this);
    setParent(parent);
    qm0 = new QgsMapCanvas();
    qm0 = qmc;
    pj0 = new QgsProject();
    pj0 = prj;
    QList<QgsMapLayer* > l;
    ls0 = l;
    ls0 = lst;
    selected = false;
    connect(ui->rasterCheckbox,SIGNAL(stateChanged(int)),this,SLOT(setRasterDisplay(int)));
}

void setRasterDislpay(int checked)
{
    QString layerName = ui->rasterCheckLabel->text();
    QgsMapLayer *lay = pj0->instance()->mapLayersByName(layerName)[0];
    if ( lay->isValid() )
    {
       selected = true;
       QgsLayerTree *tree = new QgsLayerTree();
       tree = pj0->instance()->layerTreeRoot();
       QgsLayerTreeLayer *root = tree->findLayer(lay->id());
       if ( checked == 0 )
       {
           root->setItemVisibilityChecked(false);
       } else
       {
           root->setItemVisibilityChecked(true);
       }
       qm0->refresh();
    }
 }

and now just the relevant slot in mainwindow.cpp:
void MainWindow::onSelectOverlaysTriggered()
{
    layerDisplay *ld0 = new layerDisplay(qm0,pj0);
    ld0->show();
    if ( ld0->selected() )
    {
      for ( QgsMapLayer *lay: pj0->instance()->mapLayers().values() )
      {
        QgsLayerTree *tree = new QgsLayerTree();
        tree = pj0->instance()->layerTreeRoot();
        QgsLayerTreeLayer *root = tree->findLayer(lay->id());
        QString chk;
        if ( root->isVisible() )
        {
           chk = "true";
        } else
        {
           chk = "false";
        }
        cout << "Layer " + lay->name().toStdString() + " is visible: "   << chk << endl;
      }
    }
 }

This; however, does not change the layers displayed despite the standard output showing the following when I un-check the box:
Layer OpenStreetMap is visible: true
Layer Raster is visible:  false

Does it have to do with passing the pointers (map canvas and map project)?  I have a similar program that adds the layers by passing these as arguments which work fine.  Or maybe how I construct/initialize the pointers/objects to begin with?


texts: How to delete features selected by expression using graphical modeler in QGIS3

texts:
I can't find an algorithm for deleting features (points), so I can't delete features in the graphical modeler.

I found related information (Select by expression and remove points). However, I want to know how to use QGIS3.


texts: Find elevation for series of (lat,lon) combinations to make 3d model of earth with relief

texts:
I would like to say I am a complete novice to the world of GIS, so if I ask stupid questions or make strange assumptions, please point it out and I will try to clarify myself.

I would like to make a 3D-model of the earth with relief. To do this, I was thinking to divide the earths surface in a matrix of about 10000x10000 (dividing the earth horizontally and vertically) points and then find the elevation for all these points. So I need to find an excel file somewhere with a lot of (lat,lon) points on this earth and their elevation. No idea where to start though. First of all I looked into the google elevation api, but there is a limit to request max 2,500 elevations per day, so this does not seem like a good option. Another alternative I have looked into is the gmted2010 data on earthexplorer.usgs.gov, but I only seem to be able to download the data as tiff files, while I just would like to download an excel file. Can someone advise me the best place to find (lat,lon) combinations of the entire earth's surface with their elevation? Furthermore I also want to know how to find coordinates of the points that make up the borders of the countries in our world?

I will first try to get an answer to the first part here and then later post my other question about the boundaries. It was more intended to guide people in the right direction when choosing between different solutions to offer me (i.e. which one is most compatible with the boundary task). Radouxju, I tried your solution, but am still confused on some parts (I repeat: I am a complete newbie to all this). So it would be great if you could clarify some things to me:) First of all I downloaded one of the NOAA tiles to try it out and opened it in Photoshop, the only software of the possibilities they list, that I posses. I did everything as they explained here (http://www.ngdc.noaa.gov/mgg/topo/report/s11/s11Gx.html) and now have a really good looking graphic on my screen, coloured according to the elevation. I looked everywhere for solutions to export this to ASCII, but without succes. The only thing that mentioned ASCII was saving as EPS and choosing ASCII as encoding. But this still saves it as a graphic. So no idea how to get from the file I downloaded to ASCII.


texts: Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

texts:
I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to C:\Python27\Lib\site-packages that is written as:

C:\Program Files (x86)\ArcGIS\Desktop10.2\bin64
C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts

when I then open the python 2.7.6 x64 IDLE and run the following command : import Arcpy, I get this error

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 24,     in <module>
    from arcpy.toolbox import *
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\toolbox.py", line 356,     in <module>
    from management import Graph, GraphTemplate
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 22,     in <module>
    import _management
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_management.py", line 14,     in <module>
    import _graph
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_graph.py", line 27, in     <module>
    import numpy
 ImportError: No module named numpy

it seems to me that the 10.2.2 x64 bit python is pointing to the 32 bit python library. I have tried substituting the code from: http://resources.arcgis.com/en/help/...00000008000000

c:\Program Files\ArcGIS\Desktop10.2.2\arcpy
c:\Program Files\ArcGIS\Desktop10.2.2\bin
c:\Program Files\ArcGIS\Desktop10.2.2\ArcToolbox\Scripts

I get the error that it cannot even find the arcpy module.
My ultimate goal is to get the arcpy module to run in spss 22 which is built on the Python 2.7.1 x64 framework. However even when I put the DTBGGP64.pth file in the site-packages folder of that module, I get the same exact traceback error that it cannot find Numpy

Any thought on how to solve this?


texts: Is it possible to use If/Then Statements with dynamic text in Data Driven Pages?

texts:
Is it possible to use If/Then statements with dynamic text in Data Driven pages labeling?
I have been trying a bunch of different ways, but it has not been working, and I am fairly new at writing scripts.

If I was to write out my statement in a label expression, my example would be:

Function FindLabel([Land_Owner_Zone1], [Land_Owner_Zone2], [Zone])
If [zone] = "Zone 1" Then
Findlabel = [Land_Owner_Zone1] & vbnewline & [Zone]
Else
Findlabel = [Land_Owner_Zone2] & vbnewline & [Zone]
End If
End Function

I am unsure how to write this in dynamic text format for data driven pages.


texts:
I wanted to use temporary results in my pyqgis script just like

import processing
from qgis.core import *

carte_init=processing.getObject("carte_postes")

extent = "%s,%s,%s,%s" % ( carte_init.extent().xMinimum(),
carte_init.extent().xMaximum(), carte_init.extent().yMinimum(),
carte_init.extent().yMaximum() )

# Exrtacting test posts centroids
postes= processing.runalg('qgis:saveselectedfeatures', carte_init, None)
centroides_postes=processing.runalg('qgis:polygoncentroids',
postes['OUTPUT'], None)
voronoi_max_extent=processing.runalg('grass7:v.voronoi',
centroides_postes['OUTPUT'], False, False, extent,  -1, 0, 0, None) }

But I get the following when I run it in the python console...

Traceback (most recent call last):
File "<input>", line 1, in <module>
KeyError: 'OUTPUT'

As it works perfectly well in this script

import processing
from qgis.core import *

layer=processing.getObject("carte")
layer.invertSelection()

tampon_plus = processing.runalg('qgis:fixeddistancebuffer', layer,
"20","5",False, None)
dissolve = processing.runalg('qgis:dissolve', tampon_plus['OUTPUT'], True,
None, None)
carte_finale = processing.runalg('qgis:fixeddistancebuffer',
dissolve['OUTPUT'], "-20","5",False,
"c:/Users/LENOVO/Desktop/zones/carte_finale.shp")}

I wonder where is my mistake. I tried to use algorithm  ['Result'] just as in Saving layer as temporary file usig PyQGIS? but it's not working any better.


texts: QGIS 3.4.9 installer fails on qtquickcontrolsplugind.dll

texts: Running Windows Server 2016 standard. The installation will not continue.


texts:
I have one question:

How can I adopt updated qgis\python\plugins\processing\algs\saga\description txt files?

The rest of this text is "enough detail to identify an adequate answer". I will try to follow the rules and not make any of it look like another question.

I'm running QGIS 3.0.3 in Windows 10. Ran into a bug:

https://issues.qgis.org/issues/19205

SAGA -> Terrain Analysis - Profiles -> Cross profiles gets a float where an integer is required

This is like:
https://issues.qgis.org/issues/18870, but a different SAGA module.

Looks like NUM_PROFILE is different from the other parameters, but QGIS is sending floats for all three:
Usage: saga_cmd ta_profiles 3 [-DEM ] [-LINES ] [-PROFILES ] [-DIST_LINE ] [-DIST_PROFILE ] [-NUM_PROFILE ]

-NUM_PROFILE: Profile Samples
Integer
Minimum: 3
Default: 10

The bug is supposedly fixed already, by editing the file:
https://issues.qgis.org/projects/qgis/repository/changes/python/plugins/processing/algs/saga/description/CrossProfiles.txt?rev=master

[File fixed:
8323462f 06/16/2018 07:35 AM    Nyall Dawson [processing][saga] Fix definition of cross profiles alg, add test]

I downloaded the new txt file and replaced my bad one, with QGIS not running. Started it back up and it still gets the error.

This seems to say replacing the txt files should work:
Prevent SAGA in QGIS 3.0 from creating certain outputs?

How can I adopt updated qgis\python\plugins\processing\algs\saga\description txt files?

These are not additional questions, they are suggestions of what might be required:
Perhaps there is some other way to grab QGIS bug fixes immediately?
Perhaps some txt files get compiled into the ta_profiles.dll or affect other files I need to update?
Perhaps the only solution is to download a full "nightly" build of QGIS? (My internet is very slow and very expensive, so I'd really like to avoid that!)


texts: Geotiff based mbtiles generation using Geoserver WPS process

texts:
When I tried to generate a mbtile using wps request builder, I am getting the following error:

  "Feature not available."

But the particular layer is in the form of geotiff and came to know that the

  "feature cannot be added to geotiff based layers".

Please correct my understanding and how can I generate mbtiles based using WPS process in this situation.

Note:

  I am using "WPS request builder" (WPS process) of Geoserver admin and
  select gs:Mbtiles process from drop down list. This will display a
  form to enter layer name, crs system, bounds, min zoom and max zoom.

  Then clicks on "Execute Process" and I am getting the above error.


texts:
I apologise from the outset. I need a full run through of working gdalwarp to downsample a raster to match another i.e. How to resample GeoTIFF images to the same resolution?. Using QGIS 2.12.

Using '-tr switch' what command goes in next so I specify the resolution to switch too.

Or how do I find the resolution from each raster to ascertain the height and width values necessary?


texts: Using R to combine long/lat data into UK region polygons?

texts:
I have a CSV file with geoinfo:

JobSeekerId   LocationId    UpdatedDt   EndDt   Latitude    Longitude   Country      Name         JobTitle                                                    CompanyName
559098           3042091    05:20.2     NULL    49.18804    -2.10491    GB   Saint Helier    Funds of Funds financial controller                       AXA Private Equity
2949016          3042091    43:05.7     NULL    49.18804    -2.10491    GB   Saint Helier                     Investment Manager                     Lloyds Banking Group
2093684          3042091    12:42.7     NULL    49.18804    -2.10491    GB   Saint Helier                     Head of Compliance              Bank Leumi (Jersey) Limited
3397729          3042091    01:20.3     NULL    49.18804    -2.10491    GB   Saint Helier                         Trust Officer      Kleinwort Benson, Fiduciary Services
.
.
.

Now, I have a UK shapefile, loaded using readOGR from regdal:

ds <- readOGR(datdir, layer = "european_region_region")

that gives

> ds@data
                          NAME  AREA_CODE        DESCRIPTIO                  FILE_NAME   NUMBER NUMBER0 POLYGON_ID UNIT_ID      CODE    HECTARES       AREA TYPE_CODE             DESCRIPT0     TYPE_COD0    DESCRIPT1
0          Eastern Euro Region        EUR   European Region        EASTERN_EURO_REGION        1       2     124430   41425 E15000006 1958623.344  45150.544        VA      CIVIL VOTING AREA          <NA>        <NA>
1    East Midlands Euro Region        EUR   European Region  EAST_MIDLANDS_EURO_REGION        1       2     124952   41423 E15000004 1581093.950  16766.722        VA      CIVIL VOTING AREA          <NA>        <NA>
2           London Euro Region        EUR   European Region         LONDON_EURO_REGION        1       2     124433   41428 E15000007  159469.727   2118.277        VA      CIVIL VOTING AREA          <NA>        <NA>
.
.
.

What I'd like to do is to generate a plot where I'd get the sum of entries in each geographical region/polygon. I'd like to get the number of users within the London region, for example.

Is there a straightforward way of joining the data and the shapefile via the geo coordinates?


texts: Pan-sharpening Landsat 8 All bands using Arcgis 10.3

texts:
I need to pan-sharpen a landsat 8 image with at least 5 bands using Arcgis 10.3.
Any way to do ?

Bands I need are 6,5,4,3 and 2. To vegetation classification I'll use 654 and the bands 432 are to layout map.


texts: Grouping similar Node links in attribute table of QGIS

texts:
I have a situation like this:
I have network with nodes (vertices) and points. I extracted the nodes using Extract Vertices in QGIS. After that I connected the vertices with points with perpedicular lines using join-by-lines-hub-lines in QGIS. The problem here is:

The attribute table is producing separate IDs for each link. Ideally, there should be a single ID of vertice for the same connected links.
For instance, a single vertice (2628) in the below image is connecting five points, however, the attribute table is showing separate IDs for the same vertice. Ideally, there should single vertice ID with links column.
Is there a way to group the links which are connected to the same vertice?


texts:
I'm trying to calculate the area of multiple classes within Lake Manyara in my map. The overall area of the lake is approx 38,000 hectres (380km) (worked out by creating a polygon and calculating its area). However when the areas of the different classes are calculated and added together, it equals over 68,000 hectres which is clearly incorrect. I already put a feature over my lake to ensure no other lake's classes are added on, yet it is still incorrect. Can someone explain how to overcome this?

Here is my link containing the total and classed areas:
https://code.earthengine.google.com/6fec6f9208d132a3f1e974217fe7cfe0


texts: How to remove parallel stripes from DEM in QGIS or GRASS?

texts:
I have DEM (*.tif) from which I need to create shaded relief in GRASS/QGIS.
Problem is that it appears to have some parallel stripes all across the raster, as on picture below.

I used resampling method (Warp(Reproject)) to visually increase resolution, and I filtered the raster with GRASS function r.neighbors.

Then I created shaded relief using r.relief and the stripes become more visible.

How can I remove those stripes?

original DEM

shaded relief


texts:
I have a  layer that I want to upgrade using SQL sentences with QGIS DB manager. I want to do a simple join with another table, both are in a geopackage.
My question is: Can I update the point layer that I'm using for the join without necessary load a new layer?
I know is possibly using the interface of QGIS in proprieties > joins but I want to know if it's possible to do the same with the DB manager.


texts:
To start off with:

Using Gdal compiled with Xerces

Coding in C++ with the QT Creator version 5.4.1

So my problem is I'm trying to use Gdal to create my own Esri shapefile, I get a strange runtime error when trying to add multiple fields

Example:

    // Create a ogr feeature
    OGRFeature* ogr_feature;
    // Set a bunch of fields
    ogr_feature->SetField("Blah","Blah");
    ogr_feature->SetField("Foo","Foo");
    ogr_feature->SetField("Bar","Bar");
    ogr_feature->SetField("Test","Test");

When I run the program once it hits this part it gives out this error message:

Error :1 Invalid Index -1

I'm not too sure what's causing this. I've tried taking out all but 1 and that's fine doesn't give me any errors. But more than 1 it throws that error.

Anyone know how to fix this/ why its doing it?


texts: openlayers 2 coloring a polygon layer based on a database ( postgresql ) table that is different from the attribute table of the layer

texts:
I have trouble coloring the polygons in my layer based on the values in a certain field in another table in my postgresql database that is different from the attribute table of the layer itself. Is there any way to do this ?

note : I am working on a decision support system that is using a key performance indicator ( KPI ) that is being calculated by means of a stored procedure and the result is received in a separate table from which I need to color my original layer that is visible to the user.

1- I am using zend framework

2- I use openlayers to render the maps from geoserver

3- My layers are published using geoserver from postgis database and I would like to use another separate table in the postgresql database in order to style one of the published layers
I think it can be done with table joins but the problem is openlayers makes layer styling by calling certain functions that deals with geoserver directly
so, how can I solve this problem ?


texts: How do I fill Landsat 7 SLC gaps using QGIS?

texts:
I am currently using the QGIS 3.4.0 Raster -> Analysis -> Fill nodata (a tool for Landsat 7 data).

I am using the directly downloaded USGS tiff band files with corresponding gap mask band tiffs as input and specifying the output as a tiff file both directly onto my desktop and as a temp file.

I receive the same error in regard to the layers not being generated correctly. I have tried with and without default validity mask. The script is below:

Results: {'OUTPUT': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/townl/Desktop/band1test.tif, 'createOptions': {'fileEncoding': 'System'}}>} Loading resulting layers The following layers were not correctly generated.

C:/Users/townl/Desktop/band1test.tif

You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.


texts: Finding the "center of gravity" of multiple points where points have unequal weights

texts:
I'm trying to reduce a set of lat/lons (each with it's own weight) into one lat/lon that is the center of mass of all of the points.

however when I map the results the average point falls no where near where I think it should be (I've tested on multiple sets of points).

here's my code, in python, based on these two answers:
How to find a point half way between two other points?
Computing an averaged latitude and longitude coordinates

import math
import nummpy
import math

def toCartesian(t):
        latD,longD = t
        latR = math.radians(latD)
        longR = math.radians(longD)
        return (
            math.cos(latR)*math.cos(longR),
            math.cos(latR)*math.sin(longR),
            math.sin(latR)
            )

def toSpherical(t):
    x,y,z = t

    r = math.hypot(x,y)
    if r == 0:
        if z > 0:
            return (90,0)
        elif z< 0:
            return (-90,0)
        else:
            return None
    else:
        return (math.degrees(math.atan2(z, r)), math.degrees(math.atan2(y,x)))

xyz = numpy.asarray([0.0,0.0,0.0])
total = 0
for p in points:
        weight = p["weight"]
        total += weight
        xyz += numpy.asarray(toCartesian((p["lat"],p["long"])))*weight

avgXYZ = xyz/total
avgLat, avgLong = toSpherical(avgXYZ)
print avgLat,avgLong


texts: Intensity calculation unclear in ESA SNAP

texts:
I found a strange behaviour of SNAP during the intensity derivation of a SAR image.
The problem begins to manifests itself just during the calibration step, that it is generally (one of) the first step in a common processing pipeline for the backscatter derivation.
When I calibrate a single pol image flagging “save as complex” it produces three layers: the i_VV, the i_VV and the virtual intensity band.
When I calibrate an image without flagging “save as complex” it produces directly the intensity layer, that in this case is called Sigma0_VV.
I ascertained that the virtual intensity layer derived producing the complex i an q is equal to the Sigma0.
I don’t know why if I manually calculate Intensity (or Sigma_0) using the raster calculator with the formula
Intensity_VV = i_VV * i_VV + q_VV * q_VV

or
Intensity_VV == 0.0 ? 0.0 : i_VV * i_VV + q_VV * q_VV

it produces a results that is slightly different from the virtual intensity layer and the sigma0 layer derived before.