texts: Trying to script an export using individual selections based in excel

texts:
I am currently using Data Driven Pages to select a large group of blocks, and exporting them using a field name (after they have been related to the Excel spreadsheet).  The problem is that ALL of the blocks are selected, and therefore the exported PDF might have two of the blocks highlighted on it.

I would like to have an individual selection shown on the exported PDF, but still do all of the fields in the spreadsheet.  Possible?


texts: How do I find major locations within postal codes from GeoNames?

texts:
I'm trying to narrow down my postal code table and limit the number or rows to 1 per postal code.  I've not had a problem with Canada and the USA.  However with Great Britain the data from GeoNames has several location names per posta code in some areas.

For instance, ZE2 in Scotland has 162 locations within it, most have the same lat & lon. Apparently it's one of the postal codes for the Shetland Isles.

How do I find the major location/town within a given postal code?  I've tried some sites like http://www.postcodearea.co.uk/postaltowns/shetland-isles/ze2/ but they don't have that sort of information.  Where can I find that sort of information?

I'm not building a geolocation map of great detail.  This is for a hobby site to help people find others within a reasonable distance.


texts: How to open KML file in Google maps for android?

texts: Does anybody know how to open the KML file in Google maps for android?


texts: Replace data source of layer in ModelBuilder

texts: After reading through the documentation about MapDocument and Layer classes, I have been trying to use the replaceDataSource method in ModelBuilder to replace the data sources of certain layers within a map document I specify. However, it gives a runtime error even though I state the workspace (a file geodatabase), the type ("FILEGDB_WORKSPACE") and the dataset name ("fc1").


texts:
I'm having problem with ArcScene. I'm doing a project on the visual impact of felling areas of forest in locations regularly visited/used by people.

I have viewpoints and have created a TIN model for ArcScene. However when i try to drape my other layers - forests, roads, viewpoints - some become patchy and disappear beneath the surface of the TIN in ArcScene.

I have tried converting these features to 3D, adding layer offsets and extruding features but they just seem to make the imagery worse. I have also set the drawing priority to its lowest for the TIN and all others layers' priority to their highest.


texts: Generate Service Area Polygons with Field(s) Added

texts:
Does anyone know of a way to generate service area polygons which, when created, maintain a field from the feature class from which the polygons are generated?

For example, if I am generating a service area from a single parcel, and my parcel data contains Land Use, can I create a service area polygon file that contains my Land Use data?

As of now, the one data that is generated in the output feature class are the service area break values.

I am using Network Analyst in ArcGIS 10.1.


texts: How to connect mapinfo 10 with bing map or other mapping service?

texts: Is there way to connect mapinfo with bing or google map. I have done this with mapinfo 10.5 but could not find it with mapinfo 10.


texts: Literature on bias in spatial weights matrix

texts:
I have a question with regard to a possible bias as a result of how one constructs the spatial weights matrix.
Consider a case where one works with areal data, for instance we're interested in whether the crime rate in one neighbourhood depends on the rate in other states.
The spatial weights matrix is this case can be constructed using contiguity,e.g. queen contiguity based on 1st order neighbours, or using a distance cut off.

Working with areal data the polygons used as unit of analysis are rarely equally size.
So it seems to me that if one uses the distance based spatial weights matrix the results might be biased due to this variability in size among the polygons.

I wondered whether anyone knows of any good references from the literature on this subject?
I didn't have much success with my internet search so far.
Thanks in advance.


texts: TileMill shows black lines around raster layers

texts: I've taken a large number of raster images and added them to TileMill. Everything has worked great. The problem that I am seeing is that TileMill adds a small black line around each layer. I know that the layers overlap so there shouldn't be any gaps in between the layers. Is there an easy way to get rid of the black lines? These lines do not show when viewing the raster layers in QGIS.


texts: Sorting Points after distance from start point

texts:
Currently, I am working in QGIS to draw and plan grids. For different reasons I need to sort my pole layer (points) in the order that they run along with a cable layer (lines) with the same "cable_name". Each cable is divided into many features, sharing the same "cable_name". This is needed for voltage drop calculations.  In other words, I have to sort the points from a certain point one after the other as they appear along the cable.
My current best idea on how to achieve this is to calculate the total length of the lines from a certain point, join the point layer, and sort according to distance.

The picture shows a grid with lines and poles.
Between the poles are individual features (lines) They share the same "cable_name" so I can easily dissolve them back into one line. The trick is now to sort the Poles as they appear along each string.
The star being my center point. In the yellow box for example I would like to automatically sort the poles like this: 211;213;214;427;431;215;216;218;...
I have tried the v.distance approach in GRASS but quickly abandoned that approach, as GRASS kept crashing and I am a newbie to GRASS anyways.
Any tips or different approaches? I am a bit stuck on my solving process.


texts: Getting intersection between two rasters using QGIS

texts:
I'm in a middle of a task where I have to extract the intersection between two rasters.
I need to obtain this overlapping portion of the rasters where they touch themselves.
The result I expect is something like this piece in red.

In other words, it's similar to the Intersection function on QGIS (but this only works with vectors).
Is there something like this for rasters?


texts: Inline variable substitution in Model Builder using python code

texts:
I have an inline variable substiution which I would like to import into my Python script. Is that possible? I am trying to make a parameter within my path.

My path currently is "c:\Users\Jelle\Dropbox". Within Model Builder I can substitute 'Jelle' by using an inline variable subsitution (name) and call it through %name%.
I would like to replace "Jelle" with other names but then within a Python script.

I have tried using GetParameterAsText and making the inline variable as a Parameter within Model Builder but I get an empty output: Here is the script which I tried for it:

import arcpy
username = arcpy.GetParameterAsText(0) #this is the inline variable 'name' which I am trying to call
input_table = "C:\\Users\\"+str(username)+"\\Dropbox"

Input_table gives the following return:

"C:\Users\\Dropbox"

Hence the 'username' variable is not returned

I have the feeling I should be using something else other than GetParameterAsText. Could someone help me out here?


texts: Merging adjacent polygons using Geopandas by avoiding filling gaps

texts:
I have raster dataset that I would like to convert into vector polygons. Raster to polygon conversion works pretty good. But, having problem when I  try to merge adjacent polygons using Dissolve function in Geopandas. Gaps inside polygons are automatically filled which I don't want as I want to use those gaps in further analysis. Is there a way to avoid automatically filling gaps?
Here is a simple code:

shp = gpd.read_file("file.shp")
shp_dissolved = shp.dissolve(by="VALUE")
shp_dissolved.to_file("dissolved_file.shp")

Input image:

Output image:


texts: Merge two GeometryArray into one one GeometryArray in geopandas?

texts:
How can I merge two GeometryArray (available in GeoPandas)?

I have two Geometry arrays and I want to merge them to save them to a single file.

Sadly I get TypeError: unsupported operand type(s) for +: 'GeometryArray' and 'GeometryArray' and GeoPandas docs are not helpful.

data = gpd.read_file(in_file)

if "waterway" in data:
    rivers = []
    streams = []
    rivers = data[data["waterway"] == "river"]
    rivers.geometry = rivers['geometry'].buffer(0.000250)
    streams = data[data["waterway"] == "stream"]
    streams.geometry = streams['geometry'].buffer(0.000025)
    (rivers + streams).to_file(out_file, driver = 'GeoJSON')


texts:
I'm trying to calculate a polygon area. This is the polygon and the attribute table:

When i open field calculator and use the Geometry--> area$, the area result for ID 1 is (in squere meters) 1809477.67:

but when i use the Export/Add geometry column tool, two things happen:

a new layer been created named "added geom info"- why the data isn't created in the polygon attribute table?
the area result is (in squere meters): 1799292.92 - why i get different results?

When i measure the area in ArcGIS 10.3 - the result was 1799292.92 squere meters.

I also red

How to calculate polygon areas and perimeters using QGIS?

and didn't found any suitable answer.


texts: Installing Rectangle, Ovals, Diamonds plugin?

texts: I'm using QGIS 2.6 on Mac and unable to find the Rectangle, Ovals, Diamonds plug ?


texts:
I am working with PostgreSQL 12.2 and PostGIS 3.

I have been through a lot of posts talking about "Lateral joins" and other solutions but I am stuck with some incoherent results up to now.

I have two tables. One containing a list of airports.

CREATE TABLE app.apt_airports (
   id INTEGER NOT NULL
   , icao_code CHARACTER VARYING(16) NOT NULL
   , iata_code CHARACTER VARYING(4) DEFAULT NULL
   , name CHARACTER VARYING(255) NULL
   , refpoint geography(POINTZ,4326)
   , importance INTEGER NOT NULL
   , type INTEGER NOT NULL
   , status INTEGER NOT NULL DEFAULT 1
)

The other table is a list of weather reports generated for some airports (not all).

CREATE TABLE metar_raw
(
  id BIGINT NOT NULL DEFAULT nextval('sq$metar_raw_id'),
  icao_code CHARACTER(4) NOT NULL,
  time timestamp without time zone NOT NULL,
  raw_metar text NOT NULL,
  CONSTRAINT metar_raw_data_pkey PRIMARY KEY (id,icao_code,time)
) PARTITION BY RANGE (time)

For any given geographical coordinates I must be able to find the three closest airports having a weather report and find the latest one.

I am able to get the expected result if I query only for the closest airport with the following query:

SELECT apt.public_id
     , apt.name
     , mtr.time
     , apt.icao_code
     , mtr.raw_metar
     , st_y(apt.refpoint::geometry)::double precision as latitude
     , st_x(apt.refpoint::geometry)::double precision as longitude
     , ST_Distance(apt.refpoint, st_makepoint($2,$1)::geography)*0.000539957 as distance
     , degrees(ST_Azimuth(st_makepoint($2,$1)::geography, apt.refpoint::geography)) AS heading
FROM app.apt_airports apt
     INNER JOIN weather.metar_raw mtr ON (apt.icao_code=mtr.icao_code)
WHERE mtr.time > now() - INTERVAL '1 DAY'
ORDER BY apt.refpoint <-> ST_Point( $2,$1) asc, mtr.time desc
LIMIT 1;

Please note that the table containting the weather reports grows quite fast and performance is kinda key here. The table contains several millions of records (reason why it is partitioned).

How to find the latest weather report for the three closest airport having one? (ignoring those not having weather reports)


texts: Setting extent with python in QGIS in new project

texts:
Situation:
I am trying to write a simple python script for QGIS. The script aims to load one layer, zoom to given coordinates, and 'place a pin' there. The coordinates will change every time I run the script, so I cannot create the pin in advance (QGIS is launching from another application which will feed it the coordinates).

My solution to place the pin was to create a second layer with a single point, by reading in a CSV file containing the following:

Latitude,Longitude

-38.6195,142.998

Problem:
My script works to an extent, however if I run it into a blank project it loads the layers but sets the extent to the layer extent of the largest layer, rather than the zoom extent. If I run the script again, it zooms to the correct extent but now has loaded two copies of both layers.

I do not want to install any plugins because I am making a stand alone program which is to open QGIS on other computers. There is no flexibility in that regard. I am new to python, and am curious about why the set extent seems not to work in this particular case. Running the entire script through the python input produces the desired result on the blank canvas.

Here is my script

from qgis.core import *
import qgis.utils

layer = iface.addVectorLayer("C:\paththatworks\meter.shp","meter","ogr")

uri = "file:///C:/Users/me/Desktop/pin.csv?crs=epsg:4283&delimiter=%s&xField=%s&yField=%s" % (",", "Longitude", "Latitude")
vlayer = QgsVectorLayer(uri, "pin", "delimitedtext")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

canvas = qgis.utils.iface.mapCanvas()
canvas.refresh()

offset = 0.001
pos = [-38.6195,142.998]
zoomRectangle = QgsRectangle(pos[1]-offset, pos[0]-offset,pos[1]+offset,pos[0]+offset)
canvas.setExtent(zoomRectangle)
canvas.refresh()


texts: syntax error when using gdal in python console QGIS

texts:
When I run the following code in the python console in QGIS I get a syntax error:

import osgeo.gdal
gdal_rasterize [-b 1] [-burn 255] [-a Pixelkost] [-te 170000.2 168000.27 177999.8 177999.8] <Adp322.shp> <work.tif>

b command for burning it in band number 1
burn command for the color red
a command for using the attribute pixelkost
te command for x,y min and x,y max
the already loaded Adp322.shp file (I also tried it with the whole system path towards the file but this didn't work either)
work.tif is the name the new file should have. (Should this maybe be an already existing file? but how should I produce this?)


texts: Superpixel segmented image boundary into SpatialPolygons format

texts:
I have an image mask segmented through superpixels algorithm like this.

I want to just extract its boundary and save it as a shapefile SpatialPolygons for using spatstat. Can anyone help on how to go about in doing this? Thanks!


texts: I want to merge a [LAT] column and [LON] column in arcgis to create a field called 'location' [lat, long] column in order to join my information to a csv file which only contains a column labelled 'location', which is latitude and longitude.


texts: Merging Multiple JP2 image files on QGIS

texts: I have about 150 Images that I need to merge together.  I have tried to go about this by using the GDAL misc > merge tool but it is too much for QGIS to handle with even 20 images at a time.  I was wondering if there was a different way to go about this. The image layers I am using are Multi-band not singleband layers.


texts: Finding nearest line to point using ArcGIS Desktop (ArcObjects/ArcPy)?

texts: I am new to building custom ArcObjects, and am looking for a custom python script for arcgis version 10 that will loop through a point shapefile to find the nearest line segment of a line shapefile (or multiple if possible) and add the 'NAME' attribute from the line shapefile to a new 'STREET' attribute in the point shapefile.


texts: Save MapContent issue with latitude/longitude lines

texts:
All labels for longitude lines at bottom and latitude lines on left and right of the map look fine when viewed in JFrame like the one used in  https://docs.geotools.org/latest/userguide/tutorial/raster/image.html

File saved using saveImage function in https://docs.geotools.org/latest/userguide/library/render/gtrenderer.html

Using mapContent.getMaxBounds() as envelope to create and save the image.
The green background filling of rectangle for Graphic2D image used to save in the file.
 The same map seem to appear in both images attached, yet the labels at the bottom and on the right of the map (JFrame) are not included in the saved file.

Any suggestion or tip on how to debug this issue is appreciated. I am not really familiar with this geographical representations although I am learning a bit.


texts:
Can anyone tell me how I could add the functionality as seen on google maps that allow users to specify a URL to a KML file in the search bar?

I would like to include this in my own embedded map but I'm really lost on how to execute it.

I've seen examples for KML URL search on other sites but they don't seem to work. Maybe google has dropped this feature from embedded maps/api3 maps?


texts: EarthEngine save TIFF - Python API Changes?

texts:
This code used to work using the Python API:
    url = ee.data.makeDownloadUrl(ee.data.getDownloadId({
          'image': image.serialize(),
          'scale': '%d' % scale,
          'filePerBand': 'false',
          'name': 'data',
    }))

It now complains that
   Image as JSON string not supported.

I'm assuming something changed in the API but I can't figure out what I need to change the "example" in the documenation is empty.
Anyone any suggestions?


texts:
What considerations should be taken into account when trying to derive a NDVI from an urban environment?

I pulled a tree canopy layer from LAR-IAC data and used an NDVI of 0.38. However, this FAQ on Vegetation in Remote Sensing recommends using >0.8, while I've read >0.6 as a good NDVI for dense vegetation. Is 0.38 too low, and is it possibly lower because of an urban environment (Pasadena, CA)? Should I be using an alternative index, like SAVI (Soil Adjusted Vegetation Index), but maybe for urban areas?


texts: Creating imageCollection for each date from a table in Google Earth Engine?

texts:
In my AOI there are 8 different Firms alarms on different places, which are available as a table (Feature Collection). Now I want to create an image collection that displays the last five images and the next five images for each date. Is this possible?

Here is my Code:

var FIRMS_filtered = ee.ImageCollection('FIRMS')
.filterDate('2018-01-01', '2018-12-31')
.filterBounds(AOI)
.select('T21')
// Create a list of start days
var dayOfYearList = ee.List.sequence(1, 365, 5)
// Function to convert day to date
var dateFromDayOfYear = function(day) {
var dateString = ee.String('2018').cat(ee.String(ee.Number(day).toInt()))
return ee.Date.parse('YYYYD', dateString)
}
// Create a list of start dates
var startDateList = dayOfYearList.map(dateFromDayOfYear)
// Function to return an image consisting of count of valid pixels in the date range
var checkDateRange = function(start) {
var end = ee.Date(start).advance(5, 'day')
var dateRangeFiltered = FIRMS_filtered.filter(ee.Filter.date(start, end))
var pixelCount = dateRangeFiltered.reduce(ee.Reducer.count())
// return the image with a new property for start date
  return pixelCount.set({start_date: start})
}

// Count total pixels within AOI
var totalPixelCountAOI = function(image) {
 var countDict = ee.Image(image).reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: AOI,
scale: 500})
var totalCount = countDict.get('T21_count')
// Create a featurecollection with null geometry
// featurecollection helps because you can filter by properties
return ee.Feature(null, {'date': ee.Image(image).get('start_date'), 'totalCount': totalCount})
}
  // Map the functions over all dates
  var yearImages = startDateList.map(checkDateRange);
  var yearCounts = ee.FeatureCollection(yearImages.map(totalPixelCountAOI))
  // Apply filter on results
 var rangesWithNoFiresAOI = yearCounts.filter(ee.Filter.eq('totalCount', 0))
 // Ranges with fire
  var rangesWithFiresAOI = yearCounts.filter(ee.Filter.gt('totalCount', 0))
 print(rangesWithFiresAOI.aggregate_array('date'))

At the moment, I get an imageCollection for the whole year 2018. I think I have to create a loop for each date in the table, but I dont know.

  var table = ee.FeatureCollection(rangesWithFiresAOI);
  print ('table is', table)
  var Sentinel2 = ee.ImageCollection('COPERNICUS/S2')
              .filterDate('2018-01-01', '2018-12-31')
              // Pre-filter to get less cloudy granules.
              .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
              .map(maskS2clouds)
              .filterBounds(bounds_AOI)
              .map(function(image){return image.clip(bounds_AOI)});


texts: Centralizing QGIS connections for multiple QGIS installations?

texts:
I have multiple computers with QGIS installed on them. I regularly use the same WMS / WFS services. Now I have to connect to these services for each QGIS installation separately.

It would be great if there was a way to place the configuration for connections in the QGIS browser on a centralised locations (such as a NAS). That way I could access the same connections from every QGIS installation without having to add them manually every time.

Is this possible and, if so, how?


texts: How to get lengths between intersecting points

texts: I have a route that goes all the way along the project scope (Route A) and then multiple other alternative routes that intersect Route A at different points (See picture Here).  I want to get the lengths that Route A is between the alternative routes.  I've exported the routes previously but it was only for the individual lengths themselves.


texts: Forcing table output by geoprocessing to be added to TOC?

texts:
In ArcMap I can set a Geoprocessing option to add geoprocessing output to my table of contents (Geoprocessing > Geoprocessing Options...)

If this option is enabled my script output will be added to the table-of-contents, but if it's not enabled it isn't added.  This happens even if I have output parameters set in my tool and arcpy.SetParameter() in my script.

Is there a way I can force an output to be added to my ToC when a tool is run?  The output is a temporary table (in_memory) that users need to be able to access once the tool is run in the current ArcMap session.

import arcpy

testabc = r"in_memory\testabc"
myTable = "mytable"
in_memory = "in_memory"

output = arcpy.TableToTable_conversion(myTable, in_memory, "testabc", "", "", "")

arcpy.SetParameter(0, output)


texts:
Using PyQGIS with QGIS 3, I am trying to zoom in a specific layer but I have not succeeded. He tried several answers but it doesn't work for me. Either it gives me a mistake or it does nothing to me

This is my code:

from qgis.utils import *
from qgis.PyQt.QtCore import *
from qgis.PyQt import QtGui
import os

fn8=rutas[2]
fn8=fn8.rstrip()
fn8=fn8+"\Datos Puntos Qgis.shp"
fn8=fn8.rstrip()

layer6 = QgsVectorLayer(fn8, 'ObrasCiviles', 'ogr')

QgsProject.instance().addMapLayer(layer6)#Lo añado al mapa de capas
QgsProject.instance().layerTreeRoot().findLayer(layer6.id()).setExpanded(False)

layer6 = iface.activeLayer ()

canvas = iface.mapCanvas ()
canvas = qgis.utils.iface.mapCanvas ()
canvas.zoomToSelected (layer6)
canvas.refresh ()


texts: Getting / displaying all data bands in ArcMap using *.hdf data?

texts:
I was using modis snow cover product with ArcMap 10.1 which had 2 data bands (0,1) and suddenly it stopped showing one of the bands which i needed (1, the snow cover).

How to get that data band back ?


texts: In GEE, how to export data to team driver instead of Google driver?


texts:
I have this WFS: https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/au?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities with different SRS available. I would like to run a URL request to select in a Bounding Box to try this function with GetFeature request.

I did this: https://inspire-wfs.maanmittauslaitos.fi/inspire-wfs/au?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&COUNT=5&TYPENAMES=au:AdministrativeUnit&SRSNAME=EPSG:4258&BBOX=59.6522,22.211,62.619,28.2755,EPSG:4258 with the definition of the SRS in the KVP and in the BBox parameter.

But it does not work: I can´t get any feature type back!

Is there a problem in the URL I did?


texts: Recalculating Spatial Extent of Subset using ModelBuilder?

texts:
I have a feature class of areas that are discontinuous. I want to be able to select each site and then create a fishnet grid (2x2) for each site I specify.

I am able to do this except one major step: The Spatial extent is still set to the entire dataset.

I am trying to stick to using ModelBuilder so I can automate it easier or give to a colleague.

Below is the ModelBuilder diagram. Even though I add the "Recalculate Feature Class Extent" tool, it returns the same extent origin.


texts: leaflet fitbounds with a cartodb named maps

texts:
It seems that fitbounds() is not possible with named maps

cartodb.createLayer(map,layerSource)
    .addTo(map)
    .done(function(layer) {
        beams.addLayer(layer);
        map.fitBounds(beams, {maxZoom: 6, paddingTopLeft: [50, 70], paddingBottomRight: [50, 50]});
        map.spin(false);
    });

Any idea how I could use it ?


texts: Remeasuring portion of NHD route system?

texts:
How do I remeasure a portion of the NHD route system? So that it measures continuous through each confluence, that is, if 0 station is at the first confluence then when we reach the next confluence it continues to measure up through both reaches. All distances can be measure back to the first confluence.

I am using ArcGIS 10.3.1 for Desktop.


texts: Is it rational to compare vegetation indices derived from different Landsat sensors?

texts:
I am using images from two different sensors, Landsat 8 OLI (January 2017) and ETM+ (January 2007) to compute various vegetation indices.

These indices involve RED and NIR band to scale vegetation density and intensity. I have noticed the difference in wavelengths of both sensors’ required bands as follows;

Wavelength (micrometers)

Landsat 7 ETM+

Band 3 – Red            :   0.63-0.69

Band 4 – Near Infrared (NIR)    :   0.77-0.90

Landsat 8 OLI

Band 4 – Red            :   0.64-0.67

Band 5 – Near Infrared (NIR)    :   0.85-0.88

See Reference https://landsat.usgs.gov/what-are-band-designations-landsat-satellites

Keeping in view this wavelength difference of both sensors' RED & NIR Bands, I am interested to know whether this difference will affect my intended results?


texts: How to remove border and legend of 1:50 000 rasterfile in QGIS?

texts: How does one remove the border and legend of a 1:50 000 map? Want to combine several maps to form one.


texts:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />

How to store my lat lng to a local file after every click?


texts: im trying to place points at a fixed distance from each other, is there a way to place two points at a fixed distance from each other?


texts:
I want to know how to import points from QGIS into AutoCAD. My points have certain coordinates for X and Y and when importing them into AutoCAD they should have the same coordinates as in QGIS.

Is there any easy and fast way to do this?


texts: Different NoData values when processing a GeoTIFF in QGIS and bringing it to ArcGIS

texts:
I'm trying to process a GeoTIFF in QGIS 1.8 using SEXTANTE and GRASS via the r.neighbors tool.  I'd like to process the image, then be able to utlize it in ArcGIS.

The problem I'm running into is that the output file has a different nodata value than the input, and Arc isn't recognizing the correct nodata value (which is 3 E-38).  Arc reads the output file as having a nodata value of 0, and QGIS reads it of having a nodata value of NaN.  This causes Arc to render the file incorrectly, and makes utilizing the output file in Arc difficult.

When identifying nodata pixels in ArcGIS, they return the cell value of nodata, however the raster's nodata value is 0, instead of nodata (as in the cell value nodata).  This causes them to be rendered as black, instead of nofill, and may impact further processing of the file.

Suggestions?


texts: Server unknown issue when creating new SQL view

texts:
I have been following a course on Udemy using GeoServer (my version is 2.12.0). I plug in the same SQL code used in the course but when I click "Guess SQL Parameters", this message shows up:

  org.apache.wicket.WicketRuntimeException: Exception in rendering component: [WebMarkupContainer [Component id = selectItemContainer]]

Perhaps it has something to do with Java? This morning I went to start GeoServer and it wouldn't start, so I looked at the startup.bat file and it was looking for a Java file that disappeared from my computer somehow (it wanted Java/jre1.8.0_73; I had jre1.8.0_71 and had just installed jre1.8.0_151, so I changed it to the latter and it started up just fine, but the error message seems to suggest that it's Java related.


texts: Issues with 'Split Features' in QGIS 2.18.2 - splitting polygons with holes

texts:
I am trying to split polygons using the 'Split Features' tool. This works for most polygons except for the ones that consist of a full circle such as the selected polygon in the snapshot below:

I also tried using 'Split selected features with selected line from another layer'. This does not work either.


texts: Transforming polygon geometry across antimeridian in QGIS

texts:
I am working on a Python script in QGIS 3 that creates buffers around points in Web Mercator (EPSG:3857) and transforms the buffers into WGS84 (EPSG:4326).
I have a problem with geometries that cross antimeridian (180 deg longitude) - after transformation the buffers (circles) show up as long rectangles that span from -180 to +180 longitude, with actual buffers (circles) being "excluded" from these geometries.
Fig. 1: Buffer in Web Mercator that crosses antimeridian

Fig. 2: Buffer after transforming into WGS84

How best to transform geometries that span across antimeridian?
Is there a way to fix the output geometries?


texts: How to bind popup in the centre of a layer react leaflet

texts:
I have a <Map> component with <Geojson> component with in it. I want to bind a popup in onEachFeature method.

I have successfully done layer.bindpopup(); but don't know how to bind it to the centre of the geoJson layer.

adding a <Popup ref="popup"> in <Map> and doing this.refs.popup.getLeafletElement() throws an error, so I am not being able to use popup.setLatlang()


texts: Add reference lines at specific degree/minute/seconds?

texts:
I need to add reference lines at specific latitudes, like the image here: https://nrm.dfg.ca.gov/FileHandler.ashx?DocumentID=113031&inline
Here's what I've tried/found so far:

I found ESRI's base layer lat/long grid, but the resolution is not fine enough (it only goes to 1 degree)
I found another group of files hosted by USGS (I believe) that had the resolution I need, but not the extent (I need it to cover California but also into the Pacific Ocean)
I saw something about a "Reference Latitude" tool, but I don't appear to have the proper license to use it
Lastly, I saw references in a couple of semi-similar questions to the "Create Fishnet" tool, but I honestly can't figure out what parameters to use to get what I need. I'm using the California Teale Albers (meters) projection.

This seems like something that would be really simple, but I can't figure it out.
I'm using ArcMap 10.8.1


texts: I want to create an ellipse around a point. I have the lat/longs of the point and the length of semimajor and semi minor axes in a CSV format. Is there a way?


texts: Installation and configuration of stand-alone GeoWebCache

texts:
I recently installed the stand-alone version of GeoWebCache 1.6.0 and deployed it on a Tomcat 7.0 container.

The official documentation tells to modify "geowebcache.xml" in the following location ..

The main configuration file for GeoWebCache is geowebcache.xml.
It is located inside the the main GeoWebCache application directory at
WEB-INF/classes/geowebcache.xml.

But I couldn't find it anywhere in the "...\Tomcat7.0\webapps\geowebcache\" at all!

Also, I have an empty list of layers on the "demo" page on the geowebcache web admin.
When I hit "Reload Configuration" button, it popped up a login box. I looked for username and password in "user.properties" file following the instruction. But it only contains "geowebcache=secured,ROLE_ADMINISTRATOR".

What are the username and password should I use?

It just has a so bad documentation... ...

p.s. I don't have GeoServer installed yet. Does GeoWebCache mean to work in stand-alone? I just want to cache an external WMS. Where do I find "GeoWebCache.xml" and where are all cached files stored in Tomcat?


texts: returning attribute values without additional characters

texts:
I have this part of code inside a plugin:

Emptylist = []
def saveToList(self, layer, EmptyList):
        for feat in layer.selectedFeatures():
            attributes = feat[self.pgLyr.currentText()]
            EmptyList.append(attributes)

when I run this code it stores attribute values to the list, but with additional information about the type of the field, so it returns (for example) u'387' if the field is text typed or L387 if the field is Long typed.

is there any way to get only 387 value, regardless of the additional information, without using a text splitting function?


texts:
I have seen that people already had issues about overlapping class boundaries with the classification of graduated vector data.
I am wondering if there is somewhere written in the documentation if the upper class boundary contains the stated value or if the class ends "just before" the stated value (<). So if I want to adjust class boundaries in the legend do I write 0 -< 10, 10 - <20 ... or is it 0 - 10, >10 - 20, ... ?


texts: How to visualize callout lines between points and labels in Geoserver?

texts:
Is there a way to visualize calloutlines between points and dynamic labels in Geoerver (SLD)?
From my understanding, there are no elements in TextSymbolizer to achieve it. But perhaps, there is a way to work things around by applying a more advanced SLD-scheme?
Basicly, i wonder if it is possible to convert the vizualisation in the picture below (from Qgis) to an SLD-scheme. Note: the circles are points not polygons.


texts: ArcGIS Desktop 10.1 SP1: how to install/use additional Python modules?

texts:
I'm currently working on a project where I have to identify geomorphological features in a digital elevation model. Since the aim is to have a single ArcGIS Toolbox integrating all processing steps in the end, I would like to use Scipy and Scikit-image besides the already provided numpy (version 1.6.1) package in Python (version 2.7) for the image processing.

Installing Scipy and Scikit-image from the precompiled binaries provided by C. Gohlke (many thanks to him for providing this! http://www.lfd.uci.edu/~gohlke/pythonlibs/) is normally a good solution, but not possible in this case, since they were compiled using a newer numpy version.

Upgrading the numpy module of ArcGIS seems not to be an option, because it breaks the arcpy API (reported by ESRI in the webhelp).

I see now two options, but not sure about it at all:

1.) Using another python installation besides the one provided by ArcGIS. The Toolbox is only used to link to external python scripts.

2.) Compiling/building SciPy and Scikit-image from source using the correct modules (extremely complicated, since it has a lot of dependencies, already tried for hours, not successful yet...)

3.) Any other suggestions how to solve this problem?

Thank you!


texts: Crop Raster from using Polygon shapefile in R

texts:
I am trying to crop a raster by a polygon in R to the state of Sergipe-Brazil. My raster is a raster brick criated by 7 .tif files which are EVI (vegetation index) time series. Since the EVI archives are larger then the state I want, I'm trying to crop it by using a Polygon shapefile of Sergipe. Here is the script:

# Loading the packages
library(raster)
library(sp)
library(rgdal)
library(RCurl)
library(bitops)
library(hddtools)
library(XML)
library(zoo)

# Creating the rasterbrick
evi <- list.files(pattern = '^.*\\.tif$')
evistack <- stack(evi)
evibrick <- brick(evistack)

# Converting from -1 to 1 (EVI)
evit1<-evibrick/10000

#Saving the RASTER BRICK
writeRaster(evit1, filename="evi_2000t1.tif", format="GTiff", overwrite=TRUE)

# Importing the shapefile of Sergipe
se <- readOGR(dsn = "C:/ArquivosR/EVI/Dados_anuais/2000", layer = "Estado")

### Transforming the CRS os the shapefile
SE.utm <- SpatialPolygons(list(Polygons(list(Polygon(se)), "1")))
proj4string(SE.utm) = CRS("+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs")
SE.utm@bbox; SE.utm@proj4string

### CRS GEO (GeoTiff)
SE.geo<- spTransform(SE.utm, CRS("+proj=longlat +datum=WGS84"))
SE.geo@bbox; SE.geo@proj4string

# Reprojecting the RasterLayer
projection(evit1) <- CRS("+proj=longlat +datum=WGS84")
alt.utm <- projectRaster(evit1, crs="+proj=longlat +datum=WGS84")

### Cropping
evit1.crop <- crop(alt.utm, extent(SE.geo), snap='out')
image(evit1.crop, asp=1)

I've changed the CRS os the shapefile to let both rasterbrick and shapefile in the same coordinate system. BUT, when I run it:

cr <- crop(alt.utm, extent(SE.geo), snap="out")

Error in .local(x, y, ...) : extents do not overlap

Checking out the extent of the files I got this:

extent(alt.utm)
class       : Extent
xmin        : -38.24549
xmax        : -36.39112
ymin        : -11.56996
ymax        : -9.51354

extent(SE.geo)
class       : Extent
xmin        : -37.44375
xmax        : -37.44375
ymin        : -10.58074
ymax        : -10.58074

I'll aprecciate any help!


texts: What does property FeatureTypeName do in Styled Layer Descriptor (SLD) specification?

texts:
I am studying the Styled Layer Descriptor (SLD) specification. I got a general grasp of how I can use it to style a map. I still have one question about the FeatureTypeStyle though.

When looking at the FeatureTypeStyle I see the property FeatureTypeName. What does this do? Say for example I got a layer called 'Rooms' and every room has a door (line) and figure (polygon) could I use the FeatureTypeName to say I only want to draw the doors?


texts: Missing toolbar menu from Processing Modeler QGIS

texts: Does anyone know how to I may have turned off the algorithms and inputs tool menus in the modeler? I have not been able to figure out how to get it turned back on.


texts: How do I make the indoor svg drawing for OSM Buildings?

texts:
How do I make the indoor svg drawing?

I could not find the source.

Can you tell me how to do?

http://osmbuildings.org/examples/indoor/


texts: Counting points of specific type within polygon using ArcGIS ModelBuilder?

texts:
I'm analyzing wind farms and wind turbines within ArcGIS Desktop 10.2.

My data consists of the locations of individual wind turbines that are associated with a wind farm (let's call it "Wind Farm A"). From creating 5km buffers around each wind farm, I know that in certain cases wind turbines from a neighboring farm (let's call it "Wind Farm B") are part of the buffer of Wind Farm A.

How can I use ModelBuilder to count the number of turbines within a buffer zone that are part of Wind Farm B and not part of Wind Farm A (i.e. foreign turbines within A's buffer)?

Using the Select Features tool I can count the turbines by hand, but this is slow. I also know that I can use the Near tool or a Spatial Join to count all the points in a polygon, but how do I then select only those that are not part of Wind Farm A?

I'm attaching a screenshot that illustrates my challenge visually.


texts: Scatter matrix using pandas does not reset any graph

texts:
I would like to find the statistical correlation between all the pixels of an image in relation to the bands. In my case 7.

from osgeo import gdal
from osgeo import gdal_array
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import scatter_matrix
%matplotlib inline

dataset = gdal.Open( "C:\Mosaico.tif")
image_datatype = dataset.GetRasterBand(1).DataType
image = np.zeros((dataset.RasterYSize, dataset.RasterXSize, dataset.RasterCount),
                  dtype=gdal_array.GDALTypeCodeToNumericTypeCode(image_datatype))

for b in range(dataset.RasterCount):
    band = dataset.GetRasterBand(b + 1)
    image[:, :, b] = band.ReadAsArray()

df=pd.DataFrame(np.concatenate(image))

scatter_matrix(df,figsize = (10,10), diagonal = 'hist')


texts: Determining covariance of irregularly spaced spatial data in R?

texts:
I'm comparing concentration C of a contaminant in the same spatial region at two time point 2000 and 2010 with sample size of N_2000 = 51 and N_2010 = 26 (not all the samples are from the same location), mean of mu(C)_2000 = 47 and mu(C)_2010 = 27 (determined by block kriging of all point observations using the 'gstat' package of R) and variance of V(C)_2000 = 89 and V(C)_2010 = 68 (kriging variance). To determine if there has been any significant change over the last 10 years, we first need to determine the variance of change in the area:

V(delta C) = V(C)_2000 + V(C)_2010 - V(C)_2000,2010

where, V(delta C) is the variance of change over time; and V(C)_2000,2010 is the covariance between the two temporal samples. Does anyone know how to determine the V(C)_2000,2010 term in the above equation?


texts: Converting ERDAS (*.img) file into headerless binary file?

texts:
I am having trouble converting an ERDAS (*.img) file into a headerless binary file.

I want to use those images in the TIMESAT program.

I'm trying to do this in IDRISI 32 but there is an error saying:

  minimum values exceeds maximum value

during the process.

What does the error mean, or how can I achieve this task using another program?  For example, ArcGIS, ENVI, ERDAS, but not GDAL (with which I am unfamiliar). It seems I need to write some code to work in GDAL and I am not a coder.


texts: PostGIS: why does it return an error when changing geometry to GeometryCollection?

texts:
I've got a postgreSQL/postGIS table whose geom column holds Geometry type (MultiLineString). I want to include in the table also Points and MultiPoints, so I tried to change the geometry type with
alter table lineas
alter column geom type geometry(geometrycollection);

However, it returns
ERROR:  Geometry type (MultiLineString) does not match column type (GeometryCollection)
SQL state: 22023

Why is that? A GeometryCollection column shoud be able to admit all other types, shouldn't it? How can it be solved?


texts: Workflow of Processing Landsat data for landcover classification

texts:
I have downloaded Landsat-8 data to make a land-use raster.  So far I've made a composite image and clipped it by my study area.  As you can see, there is some slight cloud cover.  I've gone ahead and downloaded L-LDOPE Toolbelt and the same tile during earlier times in the growing season to possibly interpolate the area covered by clouds.

I'm unsure of what to do next.  Should I go ahead and run image classification then go back and account for the clouds or should I deal with the clouds first?  What is the standard work flow for processing these images?  Does anyone know of good background reading on this?  I'm very new to working with Landsat-8 data.  I'm using ArcGIS 10.1.


texts: Selecting multiple coded values for domains

texts:
Is it possible to setup a domain that allows for the selection of multiple coded values? I have setup an app that allows field staff to do inspections at various field sites by asking them preset questions. The problem is that for some questions there is often multiple answers.

For example, one question asks for the type of material used for structural foundations. In a lot of cases there is only one type used (concrete, wood etc...), however in some cases there maybe multiple foundation types.

Is there anyway to allow for the selection of two (or more) answers for coded value domains?


texts: Can MapInfo ProViewer be installed on and be run from USB drive?

texts:
I am looking for a portable simple GIS.

Is it possible to install MapInfo ProViewer on a memory stick or DVD and run it from there, i.e. without requiring admin rights or installing any files (e.g. DLLs) on the machine?


texts:
For my Ph.D. thesis I'm looking at royal inscriptions from Mesopotamia (ancient Iraq), and part of what I'm trying to do is analyze their spatial distribution - i.e. how many were found at which archaeological site. I'd like to create a map to illustrate this, with a visual indication of the quantity of objects found, e.g.:
Kish - 20 objects
Ur - 100 objects
Uruk - 2 objects
etc etc.

I have an excel spreadsheet with the site names, their lat/lon, and the quantity of objects found there.

Can someone point me in the right direction for how to change this data into a visual representation?


texts:
I have mbtiles data downloaded from internet. I need to publish mbtiles in ArcGIS Server as tiled map service. I find out the layer was not supported on ArcMap during publishing on ArcGIS Server.
Is there a way to publish mbtiles in ArcGIS Server or to convert mbtiles into ArcGIS Tile Package format .tpk?


texts: Custom scalebar with half-segments in QGIS

texts:
I am trying to recreate a scalebar thats part of a norwegian standard (NS3039) in QGIS.

QGIS makes these half-segments for negative values (highlighted in red in  the picture below 1, but I want these half-segments for the first positive segment, as shown in the picture at the bottom 2

The original from QGIS:

The target scalebar:

Any idea how I can create this in the Print Layout in QGIS?


texts:
Is it possible to add just a single layer from WMS service to a map in ArcGIS (Desktop/Portal)? As an example, I am looking at the Maritime Boundaries WMS Service from: Flanders Marine Institute (VLIZ) - Geoserver WMS Service

The service consists of ~40 layers and I'm only interested in one of them.
Is it possible? What should the URL for this query look like?


texts: Union of several linestring to multilinestring using MS SQL Server

texts:
Followed Postgreql query is the existing one used to combine serveral linestring to a single multilinestring. is there any equivalent of this in SQLServer .

SELECT ST_AsText(ST_Collect(

ARRAY[

ST_GeomFromText('LINESTRING(1 2, 3 4)'),
                ST_GeomFromText('LINESTRING(3 4, 4 5)')
]
)) As wktcollect;

This is the sample query . My input will be multiples of Linestrings . (Eg: LINESTRING(1 2, 3 4)) which comes dynamically .

Kindly execute this in Postgresql . you will get a clubbed  Linestrings as  single MultiLinestrings .

Same result  required in SQL server . Kindly Help me in this .


texts: Spatial join for adjacent polygons with same attributes

texts:
I am working with QGIS 3.4.5. I have a map of soil types (~ 100.000 polygons) and I'm trying to find the best way to make a spatial join with ~5000 point features with several numerical characteristics of soil samples. So, most soil types polygons do not have any point sample within it. At the end of this task, I need to have a polygon shapefile and all features should have informations on joined from the attribute table of the point features file but I'm not sure how to do that.

I already did a simple spatial join to get a summary of the point attributes that were inside the soil types. On the next step, for polygons without any point inside (and no numerical information on attributes table after the spatial join) I am trying to find a way to make a test to check if a polygon "X" with data has the same attribute (i.e. levels of soil classification) than polygon "Y" (no data) considering also if they are adjacents. In case of the attributes are the same, the polygon "Y" will get the same attributes of polygon "X".

Any ideas on how to do this in a proper way using QGIS tools?


texts: CopyRows_Management in ArcPy gives ERROR 000732?

texts:
I get the following error when running a CopyRows_Management with Python (ArcGIS 10.1):

ERROR 000732: Input Rows: Dataset \MyConnection.odc\MyTable does not exist or is not supported

Here is the script that the model builder exported.

# Import arcpy module
import arcpy

# Local variables:
MY_DATA = "Database Connections\\MyConnection.odc\\MyTable"
MY_DESTINATION = "C:\\GIS-Shared\\MyData\\MyGDB.gdb\MyTable"

# Process: Copy Rows
arcpy.CopyRows_management(MY_DATA, MY_DESTINATION, "")


texts:
I have a shapefile similar to the one below. This shapefile shows zones in a specific model. The model cell size is 100 x 100 m.

I want to convert it to integer array file with unique integer value assigned for each zone.
For example, the .dat file below

Any suggestion how can I do that? in R, Python or QGIS?


texts: I'm playing with various raster layers (DEM, geophysical data such as gravity or gamma-ray, etc). QGIS does a fine job at reading and displaying them, but I'm looking for more control on symbology, effectively similar to what is allowed for graduated symbology for vectors, such as defining breaks for equal intervals, equal counts, etc... So far the raster coulour table only allow one option (seems to be equal interval).


texts: How to use QGIS from command line on Windows

texts:
I have QGIS running on a windows operating system.
I am willing to use QGIS from command line to follow this procedure.

Unfortunately, i cannot manage to have qgis declared in the command windows.
I have added "C:\Program Files (x86)\Quantum GIS Lisboa\" to the path variable. but it does not seem to be sufficient.

Would you have any tip on that ?

EDIT

As proposed by Andre Joost, declaring the \bin subdirectory is a first step.
Following procedure, the command I am trying to run is:

 C:\...>qgis --project myproject.qgs --snapshot image.png
 --width 1500 --height 1000 --extent 831421.30, 6496828.19, 860046.84, 6536520.86

QGIS loads the project and then the cursor freeze/standby. and Qgis answers no more for several minutes and I kill it. the snapshot image.png and companion world file are generated but are empty (7Ko png).

the cmd output is:

_path=C:\PROGRA~2\Quantum GIS Lisboa\apps\Python27\Scripts
OSGEO4W home is C:\PROGRA~2\Quantum GIS Lisboa

END of EDIT

best regard,
Pascal


texts:
There are several similar questions around, like Sort layers in QGIS table of contents or Order layer in QGIS with PyQgis, but I can't get it to work. Here is what I do:

# image and shapefile are already defined
canvas = iface.mapCanvas()
li = iface.legendInterface()
iface.addVectorLayer(shapefile)
iface.addRasterLayer(image)
lakes = [l for l in li.layers() if l.name() == 'lakes'][0]
raster = QgsRasterLayer(image, QFileInfo(image).baseName())

# set "lakes" layer on top:
for l in li.layers():
    if l.name() == lakes.name():
        li.moveLayer(l, 0)

The condition from "if" is fulfilled (I checked it several times using some print commands), but the "lakes" layer won't move to the top. Actually, nothing happens at all. Am I using the wrong function to set the layer order?

According to QGIS Layer Tree API (Part 2), I tried this

root = QgsProject.instance().layerTreeRoot()
for ch in root.children():
    if ch.layerName() == lakes.name():
        root.insertChildNode(0, ch)
        root.removeChildNode(ch)

which does the job for me. But why does moveLayer not do what it is supposed to do?


texts:
My target is to have the whole planet to be available in the map client[leaflet.js/openlayers.js] but only a specific country loaded with roads etc.

I have followed the steps below to setup my Geoserver (2.7.1) with OpenStreetMaps:

Downloaded the shape files for a country [e.g. http://download.geofabrik.de/europe/czech-republic-latest.shp.zip] and uploaded them to Geoserver.
Downloaded the land polygons [http://data.openstreetmapdata.com/land-polygons-split-4326.zip] and uploaded them to GeoServer.
Downloaded the mapnik styles[http://svn.openstreetmap.org/applications/rendering/mapnik], converted them with mapnik2geotools and uploaded them with it using the rest services option.

When visiting the Layer Preview and select the land-polygons layer it displays fine with zooming going all the way. When I assign the world style to this layer the zooming is not quite going all the way down and after some zooming point the map is blank.

On top of that, when I add the road layer and assign the mapnik converted road style as its default nothing gets rendered. The layer and the whole map is just blank. The documentation says that this is most probably because there are semantic errors in the styles.

What am I doing wrong? Can anyone let me know of any current OSM Geoserver ready styles I could use? Which one of the two (Mercado or 4326) projections would you recommend? Should I just go for another map server which is straight away compatible with OpenStreeMap data and mapnik styles?


texts:
I'm trying to convert MapInfo tab file to ESRI shapefile using ogr2ogr either with SQLite dialect or without.
When using sqlite dialect,

ogr2ogr -overwrite -f "ESRI Shapefile"  -dialect sqlite -sql "select * from _MigrationIlot where not (geometry is null or IsValid(geometry))" "%Chem%\MigrationIlotErreur.shp" "%Chem%\_MigrationIlot.tab"

the resulting shapefile (the DBF file to be precise) will have a different structure than the original dat file and I will then be unable to open it in my Delphi program (with a TTable component) nor can I open it with my usual database desktop (Borland database desktop).

Whereas without using SQLite dialect,

ogr2ogr -overwrite -f "ESRI Shapefile" "%Chem%\MigrationIlot.shp" "%Chem%\_MigrationIlot.tab"

everything is fine (it's not what I want but the DBF file is readable). After some investigations with a Hexadecimal Editor, I noticed that Numeric field type in the DBF file are defined as N 24,15. Using -lco RESIZE=YES doesn't help: still N 24,15.

According to DBF specifications found here: http://www.clicketyclick.dk/databases/xbase/format/data_types.html
or here : http://linux.techass.com/projects/xdb/xbasedocs/xbase_toc.html, it seems that Numeric fields size in DBF files shouldn't be greater than 18 digits.

As I'm unable to read these DBF files in my program, is there a way around this?


texts: Export feature classes in geodatabase to CSVs

texts:
I am trying to export feature classes within a geodatabase to CSV format using "Export Feature Attribute to ASCII" in ArCGIS. I am getting the following error

Traceback (most recent call last):
  File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 159, in <module>
    export = setupXYV()
  File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 49, in setupXYV
    outFieldNames = outFieldNames)
  File "c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExportXYV.py", line 129, in exportXYV
    formatValue = LOCALE.format(localeDict[field], value)
  File "C:\Python27\ArcGIS10.2\lib\locale.py", line 196, in format
    return _format(percent, value, grouping, monetary, *additional)
  File "C:\Python27\ArcGIS10.2\lib\locale.py", line 202, in _format
    formatted = percent % value
TypeError: not all arguments converted during string formatting

Here's the python script I am using

import arcpy
from arcpy import env
import os, sys
arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput = True

#Set environment settings
workspace = r'L:\Simulation\Output\PoolVariables.gdb'

# Set local variables
outWorkspace = r'L:\Simulation\Output\CreateCSV'

feature_classes = []
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureClass", type = "Point"):
    for filename in filenames:
        feature_classes.append(os.path.join(dirpath, filename))

#print feature_classes

# Loop through feature_classes list

try:
    for fc in feature_classes:
        field_names =[f.name for f in arcpy.ListFields(fc)]
        print field_names
        #arcpy.ExportXYV_stats(fc, field_names, "COMMA",  )
        name = os.path.basename(fc)

    # Extract only the FC basename
        arcpy.ExportXYv_stats(fc, field_names,"COMMA",name, "ADD_FIELD_NAMES")

except:
    print arcpy.GetMessages()

Could someone explain what is happening here?


texts: Uploading vector files in Open Street Maps

texts:
I want to automate editings in OSM.
I have shapefiles of an area of interest that has almost no information in OSM about it. Is there a way to upload these vector files that I have into OSM?


texts: Disabling mouse events on GeoJSON particular feature on load

texts:
I am using geoJson coordinates for creating boundaries around the countries in Leaflet.

I am also filling the country with some colors and then showing marker on those countries which have data.

My concern is, can i disable mouse events on some countries(feature) which doesn't have data?


texts:
I'd like to display data of a WMS (WebMapService) that contains different layers. The URL of the capabilities document is:

http://geoportal.saarland.de/mapbender/php/wms.php?layer_id=41183&PHPSESSID=152fa295e90a06833f823fd2a3fcff34&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS&withChilds=1

The problem is about the layer_id. To retrieve the WMS data, the Parameter "layer_id" is needed. But I want to see several layers (about 170 layers) of the WMS, so I don't want to send several requests with varying URLs.

Is there any possibility to obtain all layers at once?

I already tried setting the Parameter to "layer_id=all" or "layer_id=*".


texts: How to find library or other business POIs?

texts:
I am just starting an Intro GIS course, so I really have no idea what the best place is to find downloadable GIS data.  I was really hoping to do my semester project on library or bookstore locations in Southern California, but I am having major trouble finding some kind of library locations GIS file to download.

I'm sure I'm using all the terms incorrectly, but could someone please help? If such a thing does not exist at all, that would also be useful to know.


texts: How to calculate Percentages of NDVI Classes

texts:
I Have calculated the NDVI Using Landsat. I Classify it by threshold value of 0.25
 I Then made 5 classes. Now i want to calculate the percentages of each class individually. please reckon me process.


texts: Polygon layer and Polyline layer intersect. How attach the distance along the line at which they intersect to the Polygons

texts:
Eg. A line maybe 100m long. Polygon A intersects the line at 0m and 50m, Polgon B intersects the line at 50m and 75m, Polygon C intersects the line at 75m and 100m.

How do I retrieve these distances and attach them to the polygon layer?


texts: Making a pretty Base Map for QGIS and OpenLayers?

texts:
I am developing a standalone QGIS application as well a web GIS using Openalyers. Both applications use GeoServer published WMS and WFS services of parcels as a base layer. I was wondering if it is possible to render this vector layers using Mapnik. What I wanted to have is a map styled the way OSM is which I think is rendered using Mapnik.

I know Mapnik has a Python API, which I could use with with PyQGIS, but would it be possible to use Mapnik to render on the QGIS map canvas? If yes, how?


texts: QGIS - Polygon to Lines Tool Incredibly Slow

texts:
I am trying to convert a few polygons to polylines so I can save them as a .GPX file.

I'm using QGIS 2.8.1 (Wein) on the Mac.

It seems to be hanging. I only have a few small polygons (see screenshot) but it's taking forever. I can't tell if it's actually processing them or if it's crashed. I usually give up after waiting 10-15 minutes.

Has anyone else run into this problem before?

Link to shapefile: https://ucdavis.box.com/shared/static/lhnqypkphlma4y1h4hw76gd29m8mdets.zip

EDIT: I found a workaround by using GDAL ogr2ogr in the Terminal to directly convert the shapefile to a .gpx file. I used this command:

ogr2ogr -f GPX -dsco GPX_USE_EXTENSIONS=YES FPS_buildings.gpx FPS_buildings.shp -nlt MULTILINESTRING

This is a good workaround but I still don't have an answer about my original question.


texts: Mapping Trails with GPS - Hardware Suggestions

texts:
I have been hired to map about 100km of XC ski trails. I am super proficient in GIS but have not done any detailed GPS work since college when I worked with some sort of Trimble explorers. This is a complex network of trails and each segment needs to be a unique feature.

I own a Garmin etrex 30. My guess is that this will not be a great unit for this sort of work. I am thinking of buying a used Trimble GeoExplorer and an antenna that I can attach to my hat so that the GPS can be in a hip pack. I do want my polylines to be accurate and if I remember correctly the Trimble points can be nicely corrected after collection. Any other suggestions for hardware? Do I even need a device this sophisticated?


texts: Exporting File Geodatabase Raster license-free to TIFF or IMG?

texts:
Is there a license-free technology that can export rasters from an ESRI File Geodatabase to a file-based raster (e.g. GeoTIFF or IMG file)?

ESRI has the FileGDB API for "reading" the contents of a file geodatabase, but it has very few features for rasters.
GDAL has some extensions for file geodatabase, but I've been unable to find one that can export the rasters.


texts: Finding line length while editing in QGIS?

texts:
I am using QGIS.

I would like to know if there is any way during the editing phase of a vector (line or polygon) to know the length of the line (total and partial) that is being created?


texts: Casting between PostGIS types in GeoAlchemy

texts:
I'm working with OpenStreetMap data, and loading it into a PostGIS database using osm2pgsql.

The issue that I am currently dealing with is that osm2pgsql stores the shape as a geometry type.

I'm using GeoAlchemy2 to query the Postgres database, but I am having issues with the following query.

query = session.query(Route).filter(func.ST_Distance(Route.way,'SRID=4326;POINT(10.71223 47.69716)') < distance )

Because osm2pgsql stores the data as a Geometry type, it doesn't interpret my points as a geography type, and therefore doesn't filter based on distance in meters, but rather in degrees.

Would there be a way to cast the Geometry type objects (Route.way and the string representation of the point ) to a Geography form?


texts: How would I flatten a projected vector dataset to georeference a historic map to it?

texts:
So I have vector data for quad lines, township/range lines and section lines for this area.  The data is already projected into NAD83 UTM zone 10N and the lines are no longer straight.  They warp pretty severely when going over hilly areas for instance.

What I've been asked to georeference are some 1860'S General land office plats of the area that have township and section lines on them.

If I bring the GLO plats into my MXD it becomes very hard to georeference the very square ancient maps to the modern squiggly lines (caused by modern projection) of the vector data.

I figured I could flatten the vector data out in another environment and georeference the plats to the flattened vector lines then project the newly georeferenced plats into the desired UTM zone 10N projection.

What projection, geographic coordinate system (or tool?) would be optimal for accomplishing this?

Edit: ArcMap 10.1.  Student version.

Edit2: By not straight I mean on lets say a printed topo map the section, township and range lines are straight up and down.  Those same lines when projected are not straight up and down, they go around elevation changes and are no longer square.  I want to georeference the lines from the GLO plats to the lines on the vector data and was hoping I could flatten it out to do this easier.  The content of the GLO plats other than the lines is suspect because when they were made the features were only recorded where they crossed section or township/range lines, the rest was essentially guessed at by whoever created the plats.


texts: Apply .lyr Symbology To Layer Names That Meet if Condition

texts:
I am trying to create a script that applies a layer style from .lyr file to layers in my table of contents that meet a certain criteria. The criteria being the layer name must contain string of "x".

Edit - This script now works for copying .lyr styles to layers that meet a certain if condition.

mxd = arcpy.mapping.MapDocument("CURRENT")
var1 = #Path to .lyr file
var2 = #Path to .lyr file

for lyr in arcpy.mapping.ListLayers(mxd):
    if "TEXT" in lyr.name:
        arcpy.ApplySymbologyFromLayer_management(lyr, var1)
        print lyr.name + " identified as TEXT"
    elif "TEXT2" in lyr.name:
        arcpy.ApplySymbologyFromLayer_management(lyr, var2)
        print lyr.name + " identified as TEXT2"
    else:
        print lyr.name + " did not meet the criteria."


texts: "Root element is missing" error upon calling InitializeAsync on Esri.ArcGISRuntime.Layers.WmsLayer

texts:
We are using ArcGIS and a call to InitializeAsync of an object of type Esri.ArcGISRuntime.Layers.WmsLayer gives error "Root element is missing".
Stack trace is

at Esri.ArcGISRuntime.Layers.Layer.b__3(Task`1 t)
   at System.Threading.Tasks.Task.Execute()

Using the rest services API, "Current Version: 10.41", on a server.
Client is a WPF application.

Collegues of mine working on this project but from a different location don't have this error and the same code works fine for them. We suspect a network / credentials issue. A VPN is used.
I can see the services directory https://.../arcgis/rest/services/ using the Chrome browser, but get a 404 error using Edge.
Any ideas?


texts: Using tool validation to create parameter based on fields of another parameters input?

texts:
I'm assuming I'm missing something and this is a pretty easy thing to do but I'm stumped...

I'm working on a script that currently takes and input excel file and uses a "hard coded" field name that I know is in the table.  I would like to make the tool a little more user friendly in that I would like to have a drop-down of field values from within the table, letting the user select the appropriate field from the table.  This would ensure that the field being used is indeed in the table.

So... If I have an input parameter for a file in which the user selects an excel workbook, how would I create another input parameter that would then be a drop-down menu of field headers from the selected excel workbook.  Is there some kind of validation code for this?


texts:
Just looking for an explanation on SDE Topology dirty areas that don't go away.   My workflow involves editing a version of SDE data, then once finished I use the Validate Topology in Current Extent tool.  There is now a white box around my extent which looks good.
Next when I save, reconcile and post the dirty area boxes all return.

Is the picture below the way my data should look, or am I missing some steps?
Thanks,

Frank

The topo rules look something like this.


texts: Adding field to existing feature class using ArcObjects and Java?

texts:
I tried to add a new field to an existing feature class using ArcObjects and Java. This is the code:

IFeatureClass FcTes=sdeConnexion.connectionSDE().openFeatureClass("name of feature class");
    IField testField=new Field();
    IFieldEdit testField2=(IFieldEdit2)testField;
    testField2.setName("symbol1");
    testField2.setAliasName("symbol1");
    FeatureClass FC=new FeatureClass(FcTes);
    ISchemaLock schemaLock = (ISchemaLock)FC;
    try{
    schemaLock.changeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock);

    FcTes.addField(testField2);

    }catch(Exception e){
        e.printStackTrace();
    }
    finally{
        schemaLock.changeSchemaLock(esriSchemaLock.esriSharedSchemaLock);
    }

when I executed it, this exception fired:

  AutomationException: 0x80040220 - The application is not licensed to
  create or modify schema for this type of data  in 'Esri GeoDatabase'
    at com.esri.arcgis.interop.NativeObjRef.nativeVtblInvokeNative(Native
  Method)   at com.esri.arcgis.interop.NativeObjRef.a(Unknown Source)   at
  com.esri.arcgis.interop.NativeObjRef.a(Unknown Source)    at
  com.esri.arcgis.interop.Dispatch.vtblInvoke(Unknown Source)   at
  com.esri.arcgis.geodatabase.IClassProxy.addField(Unknown Source)  at
  travaux.ConnectGeoDB2.main(ConnectGeoDB2.java:58)

Can anyone see what I did wrong?

I have ArcGIS 10.2 Advanced (Server and Desktop) and in my project I'm working with arcobject.jar of ArcGIS Server.


texts: Using alternative transformations in PostGIS on Amazon RDS

texts: I am trying to apply the advice in George MacKerron's blog on Using the OSTN02 transformation in PostGIS however I am using the Amazon RDS service where I do not have access to the underlying file system.  Any recommendations on if / how this is possible or an alternative workaround for applying more precise transformations from British National Grid to WGS84?


texts: Masking NetCDF time series data from shapefile using Python

texts:
I have a 3-D time-series precipitation data (187 x 1800 x 3600), stored in a NetCDF file. I need to obtain the precipitation data for a shapefile.
import matplotlib.pyplot as plt
from netCDF4 import Dataset, num2date,
from matplotlib.pyplot import figure
from datetime import datetime, date, timedelta
import numpy as np
import xarray as xr
import pandas as pd
import geopandas as gpd

MSWEP_monthly = 'D:\G3P\DATA\Models\MSWEP\MSWEP_monthly.nc4'

MSWEP_monthly = Dataset(MSWEP_monthly, 'r')
Pre_MSWEP = MSWEP_monthly.variables['precipitation'][:]

MSWEP_monthly2 = xr.open_dataarray('D:\G3P\DATA\Models\MSWEP\MSWEP_monthly.nc4')

Lon_MSWEP = MSWEP_monthly2.lon
Lat_MSWEP = MSWEP_monthly2.lat

Africa_Shape = gpd.read_file('D:\G3P\DATA\Shapefile\Africa_SHP\Africa.shp')

from osgeo import gdal,osr,ogr

def makeMask(lon,lat,res):
    source_ds = ogr.Open(shapefile)
    source_layer = source_ds.GetLayer()

    # Create high res raster in memory
    mem_ds = gdal.GetDriverByName('MEM').Create('', lon.size, lat.size, gdal.GDT_Byte)
    mem_ds.SetGeoTransform((lon.min(), res, 0, lat.max(), 0, -res))
    band = mem_ds.GetRasterBand(1)

    # Rasterize shapefile to grid
    gdal.RasterizeLayer(mem_ds, [1], source_layer, burn_values=[1])

    # Get rasterized shapefile as numpy array
    array = band.ReadAsArray()

    mem_ds = None
    band = None
    return array

shapefile = 'D:\G3P\DATA\Shapefile\Africa_SHP\Africa.shp'
source_ds = ogr.Open(shapefile)

# calculate the cellsize
cellsize = Lon_MSWEP[:][1] - Lon_MSWEP[:][0]

# create the mask
mask = makeMask(Lon_MSWEP,Lat_MSWEP,cellsize)

Now if I implement the following code, the precipitation data for the first day (from the time-series) can be obtained with shape of 1800x3600:
precip = np.ma.masked_where(mask==0,Pre_MSWEP[0,:,:])

I tried to use a for loop to mask the precipitation data for the entire time series (time, lon, lat) over the area of interest. however, the below code gives me a 2-D data, probably for the last day.
Why is that?
for i in range(len(Pre_MSWEP)):
    precip = np.ma.masked_where(mask==0,Pre_MSWEP[i,:,:])


texts: SpatiaLite Buffer() to repair geometries

texts:
I work in a mixed open/closed-source GIS office where we have both open source (QGIS, and soon PostGIS) and Esri (ArcMap, ArcGIS Pro) available.

I bring in OpenStreetMap regularly and have to fix the polygon layer because of illegal geometries.  Typically I do this by casting the data to a shapefile and then running Esri's Repair Geometry function.  Reasonably fast and efficient.  But I would like an open-source version of doing the same thing.

Before this question is marked as a duplicate, I did review:

Repairing geometry using QGIS? (I don't have a few errors, I have many thousands; thus I want to avoid the GUI in favor of CLI, plus GRASS is not working right in my version and I have no access to v.clean (Boundless Desktop 1.0)), and

Fixing geometry validity errors in QGIS? (liblwgeom processing plugin seems like it would meet my needs but there is no clear explanation of "Here is how you find the path to liblwgeom on Windows, once you install the plugin.")

I would like to use SpatiaLite's MakeValid() function but our version of QGIS does not contain it.  So instead I am trying to do a Buffer() of zero, and outputting that to a new spatial table in the same SpatiaLite db.

I get that this brushes up against SE rules but I have no real starting code.  When I try to use either Qspatialite plugin or the QGIS Database Manager to write:

(this is in the Qspatialite plugin SQL screen, setting Option to "Create Spatial Table & Load in QGIS):

Buffer( "multipolygons".'GEOMETRY', 0)

it gives me this response:

The SQL query seems to be invalid.
near "Buffer": syntax error

I get that it's a syntax error, but I have not found any resources for those of us who are not DBAs already, that bridge the gap between SpatiaLite documentation (theoretical) and the QGIS SQL window(s) (working with your own real data).

My desired end result is a permanent spatial table of the corrected polygon layer.


texts: Error trying to export in TIFF format using Google Earth Engine

texts:
I am trying to export a file in TIFF format but gives the following error:
Error: Image.clipToBoundsAndScale, argument 'input': Invalid type. Expected: Image. Actual: ImageCollection.

This is my script:

var collection = ee.ImageCollection('NOAA/CDR/AVHRR/NDVI/V4')
    .filterDate('2008-04-01', '2008-07-01');

var median = collection.median();

var fc = ee.FeatureCollection('users/julianabelmiro18/Tailandia');

var clipped = median.clipToCollection(fc);

Map.centerObject(fc, 9)
var visParams = {bands: ['NDVI'], min:-1000.0, max:5000.0,palette: [
    'ffffff', 'ce7e45', 'fcd163', 'c6ca02', '22cc04', '99b718', '207401',
    '012e01'
  ],
};

Map.addLayer(clipped, visParams, 'clipped composite');

print (visParams)

Export.image.toDrive({
  image: collection,
  description: 'imageToCOGeoTiffExample',
  scale: 0.0001,
  region: ee.Feature(fc.first()).geometry().bounds(),
  maxPixels:1e13,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});


texts: Remove outlying territories/islands from Europe map

texts:
Using a shapefile from Natural earth, I am trying create a map of Europe with d3-geo’s new command-line interface. The following:

shp2json -n ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp \
| ndjson-filter '["ALB", "AND", "AUT", "BEL", "BGR", "BIH", "BLR", "CHE", "CYP", "CZE", "DEU", "DNK", "ESP", "EST", "FIN", "FRA", "FRO", "GBR", "GIB", "GRC", "HRV", "HUN", "IMN", "IRL", "ISL", "ITA", "LIE", "LTU", "LUX", "LVA", "MCO", "MDA", "MDA", "MKD", "MLT", "MNE", "NLD", "NOR", "POL", "PRT", "ROU", "SMR", "SRB", "SVK", "SVN", "SWE", "UKR", "VAT", "XKX"].includes(d.properties.adm0_a3)' \
| ndjson-reduce \
| ndjson-map '{type: "FeatureCollection", features: d}' \
| geoproject 'd3.geoConicEqualArea().parallels([43, 62]).rotate([0, 0]).fitSize([960, 960], d)' \
| geo2svg -w 960 -h 960 \
> europe.svg

...creates this output:

How can I remove all the overseas territories (e.g. French Guyana) and distant islands, so I'm left with a map of just 'mainland' Europe? Nothing west of Portugal, nothing south of mainland Spain etc. More like this:


texts:
I am trying to use MapServer to display a raster image (png). That's it for now at least. However, I am having no luck. When I visit my map by using a link like:

*http://myurl.com/cgi-bin/mapserv?map=/path/to/file.map&layer=base&mode=map

I get the following error:

  msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN validation failed. msEvalRegex(): Regular expression error. String failed expression test.

When I use shp2img:

shp2img -m file.map -o myimage.png -all_debug 5

I get no errors, but the image that's produced is completely gray except for the upper right quadrant which is white. This is nothing like my raster image.

My mapfile:

MAP
    SHAPEPATH     "/home/name/public_html/dir"
    IMAGETYPE     PNG
    EXTENT        -180 -90 180 90
    SIZE          800 600
    IMAGECOLOR    155 155 155
    UNITS         DD
    STATUS        ON
    DEBUG         ON

    LAYER
        NAME      "base"
        DATA      "/home/name/public_html/dir/image.png"
        STATUS    ON
        TYPE      RASTER
    END
END

What am I doing wrong?


texts: Mobile, Offline viewer for geographic data

texts:
Currently, field crews consumer geographic data via laptop (no internet, no gps). ArcReader.

I would like to get them shapefiles (or some derivative of a shapefile) on a mobile platform (smartphone) - because of its usability (built in GPS) and to get them acclimatized to using (trusting) a smart phone, among many other reasons.

It needs to be offline (we have limited cell service).  It needs to contain some basemap information (which I can providen if needed; imagery, road centerlines, etc...).

No editing, just viewing.

What are my options here?  Is there an app I can download that provides this functionality?  Very surprised ESRI doesn't have an offline viewer for data on smartphones or tablets.


texts: OSM:Redirect from 'https:' to 'https:' has been blocked by CORS policy

texts:
I'm using OSM Standard base layer with Openlayer V4.1 API. While accessing OSM getting Exception:

  Access to Image at
  'https://b.tile.openstreetmap.org/18/113126/107324.png' from origin
  'http://localhost:9040' has been blocked by CORS policy: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin 'http://localhost:9040' is therefore not allowed
  access. The response had HTTP status code 404.

I also tried with and Without crossOrigin null.
The code is:

map = new ol.Map({
      layers: [
        new ol.layer.Tile({
          source: new ol.source.OSM(),
          opacity: 0.7,
          crossOrigin:null
        })
      ],
      target: 'map',
      view: new ol.View({
        center: [19412406.33, -5050500.21],
        zoom: 5
      })
    });
  });

Any help to solve the issue?


texts: Unable to connect to PostGIS databases after Mac OS X Yosemite upgrade

texts:
I upgraded to Mac OS 10.10 Yosemite and am unable to connect to PostGIS databases (PostgreSQL version 9.3 and PostGIS installed from KyngChaos). Typing psql my_database returns this message:

psql: could not connect to server: No such file or directory
       Is the server running locally and accepting
       connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

The responses to this question suggest some postgres directories get removed during a Yosemite upgrade, but following the recommended solutions doesn't fix my error.

As requested, here are my conf settings (just showing those that aren't commented out):

listen_addresses = '*'
port = 5432
max_connections = 20
shared_buffers = 128MB
log_destination = 'stderr'
logging_collector = on
log_directory = '../var'
log_filename = 'postgresql-%Y-%m-%d.log'
log_line_prefix = '%t'
log_timezone = 'US/Pacific'
datestyle = 'iso, mdy'
timezone = 'US/Pacific'
lc_messages = 'en_US'
lc_monetary = 'en_US'
lc_numeric = 'en_US'
lc_time = 'en_US'
default_text_search_config = 'pg_catalog.english'


texts: How would I process and output every possible route of a stream network?

texts:
Starting with a stream network, I would like an output that includes every possible route from the lowest level stream to the highest level river as separate lines. Is this possible?
I am using QGIS. Ideally would be calculating and exporting stream lines for Strahler levels 4–9 for the Mississippi River basin. That being said, I don't have a sense if that is realistic or enormous amount processing.


texts: Show/filter features based on field value in Leaflet

texts:
I have geoJSON file with an ID Field.

I would like to add an input box with where a user can enter a specific ID.

Based on this input only features with this ID would be displayed.

Can anyone point me in the right direction as to how I may achieve this.


texts: Fitting tooltip completely inside a feature else removing it in Leaflet

texts:
I have been using tooltips as a form of labeling my polygons in Leaflet. The problem I'm not able to solve is to remove the labels from the view that doesn't fit completely inside the feature. Something similar to what happens when we select Only draw labels which fit completely in the feature in QGIS

The polygons are in GeoJSON format and I'm using the latest leaflet version.
Please help me if you know a way around this problem!

Thanks in advance


texts: What are the meaning of Grass drainage direction values from r.watershed

texts:
In Grass r.watershed the D8 drainage directions generated from r.watershed are -8. -6.-4.-2, 2, 4, 6, 8 (-1 No Data)

What actual directions are these?

For example in ArcGIS I know 128 is up and so on from this diagram.

What in Grass r.watershed which is up, right, etc?

When I compare the value to ArcGIS it would be

r,waterhsed (grass).....ArcGIS (flow).....Direction

8 ..........................................1.....................East

6 ..........................................4.....................South

4 .........................................16.....................West

2 .........................................64.....................North

The minus value are very few and likely edge pixel as the grass manual states.

But I would like a source to confirm this (and why only 8 values?)


texts: How to split multiple lines into equal parts or overcome split tool limitation using Basic or Standard license?

texts:
I would like to split multiple lines into equal aproximately 10m lengths. (Line length / 10m = number of segments) The split tool can only split one selected feature at a time. To overcome this I can merge multiple lines into a single multigeometry feature then run the split tool on the merged line. Works fine until I run into what seems to be a limitation - the split tool can only split into a maximum of 999 equal parts. When I enter a higher number the OK button goes dim.

Is there a workaround to overcome this limitation or another way to split mupliple lines into equal parts?  Basic or Standard licence only.

Figure 1 - Split Tool dialog showing 999 equal parts:

Figure 2 - Split Tool dialog showing 1000 equal parts:


texts:
I have PostGIS database, and want to extract lat, lon pairs sequence from Polygons (and MultiPolygons). As a very fresh PostGIS user, I'm able to just extract the Polygons:

SELECT st_astext("GEOMETRY"::geometry) FROM my_postgisdb;

which outputs Polygons and MultiPoligons.

How should I extract x, y pairs from these structures?


texts: Openlayers toggle Marker controls and update information in external form fields

texts:
I am setting a form (for multiple addresses) where users can click on map by creating a marker for each address they want to input. Users can only create one marker per address and once the marker has been created I need to get nearest address and update the address field (form input) with that address.

I am able to activate the marker drawing control but how can I make sure that user only creates one marker (not more) per address and then take that calculated address and update original text field (which fired the event) with new information.

This is what I have so far:

<form name="xxxx">

POI 1: <input type="text">
 click here to select address on map
POI 2: <input type="text">
 click here to select address on map

</form>
 Add more poi's

Here's the javascript code

poi_markers = new OpenLayers.Layer.Vector('markers',{styleMap:markerStyleMap});
poi_marker_control = new openLayers.Control.DrawFeature(poi_markers,OpenLayers.Handler.Point);

function e_drawPOIMarker(evt){

        route_markers.events.register('featureadded',poi_markers,function(evt){
         {
         //get JSON response
                     var place_name = getGeoName(evt.feature.geometry)
                     poi_marker_control.deactivate();
                            //Somehow find the id of the text field which fired original event and update its contents with data returned in place name.
        }
    });
        poi_marker_control.activate();
    }

Basically I have to capture co-ods of locations clicked by users. Each field (in form) should only allow 1 marker. Suppose if I have unknown numbers of poi address fields (which users can add dynamically) whats the best way of capturing coods and then updating original fields with that information.

At the moment I can activate and deactivate controls and allow users to create marker(s). but how can I know which marker belongs to which text field ?

Thanks.


texts: QgsVectorLayerExporter writing either geometry column or attribute table, not both

texts:
I'm trying to save a WFS layer to a Postgis database with no success. Somehow modifying the connection string I can get QgsVectorLayerExporter to write either the geometry column or the attribute table, never both.
So with these commands...
con_string = """dbname='gis' host='localhost' port='25432' user='qgis' password='qgis'
key='id' type='CURVEPOLYGON' table="public"."my_layer_new" (geom) """

QgsVectorLayerExporter.exportLayer(my_layer, con_string, 'postgres', project.crs())

... I see the geometry column in the views.geometry_columns table and the my_layer_new table is created but it is empty.
However if I remove the (geom) from the connection string...
con_string = """dbname='gis' host='localhost' port='25432' user='qgis' password='qgis'
key='id' type='CURVEPOLYGON' table="public"."my_layer_new" """

QgsVectorLayerExporter.exportLayer(my_layer, con_string, 'postgres', project.crs())

... no geometry column is in the views.geometry_columns table but on the otherhand the my_layer_new table is created and populated with the attributes of each feature.
This really feels like it's an just add this string to X type of situation.
EDIT:
After changing the last lines to
    err = QgsVectorLayerExporter.exportLayer(my_layer, con_string, 'postgres', project.crs())
    print(err)

I discovered that the actual problem is ERROR:  Geometry type (MultiSurface) does not match column type (CurvePolygon)


texts: OGR: How to best use GetFeature on a selection?

texts:
I think the following is very confusing

sel_str = "ND_14 = '108'"
l.SetAttributeFilter(sel_str)
l.GetFeatureCount()
>>> 1

In a for-loop this gives me

for f in l:
   g = f.GetGeometryRef()
   print g.GetEnvelope()
>>> (8.39746, 8.95788, 46.52757, 46.99331)

Whereas GetFeature() gives me

>>> feat0 = l.GetFeature(0)
>>> feat1 = l.GetFeature(1)
>>> g0 = feat0.GetGeometryRef()
>>> g1 = feat1.GetGeometryRef()
>>> g0.GetEnvelope()
(8.21206, 10.65409, 56.55045, 57.75181)
>>> g1.GetEnvelope()
(10.60014, 10.6172, 57.48933, 57.4979)

Apparently GetFeature() is based on the FID of the whole set, not the selection. But using a for-loop on a selection of length one is pretty ridiculous. How do I get the FID of my selected feature then? Or what are other ways of using GetFeature() with your current selection?


texts: How do I calculate trips between selected traffic cells in QGIS?

texts:
I have a polygon layer representing traffic cells (from VISUM) and I have a matrix in Excel format which contains the calculated amount of trips between each cell in the polygon layer. Now I want to calculate how many trips are done between cells that are lying within a given buffer. How would I have to set up the polygon layer with the traffic cells to be able to just calculate the cells within the buffer area?

I could join the polygon layer column containing the traffic cell ID with the Excel columns containing the same ID but after selecting the Cells within the buffer I would sum the trips between the cells within the buffer with all other cells - because the "target cells" would be rows after joining both layers. I can't get my head around a method that is allowing me to select the cells in a buffer area and limiting the calculation to sum up the trips just to the same cell. I am working with QGIS 3.4.2.

Example Date of the trip matrix

Example Date of the traffic cell data (row = single polygon representing the cell)


texts: Mean watershed slope - are there better methods than taking the mean of the contained slopes?

texts:
I am wondering if there are better methods for determining the mean watershed slope, other than taking the mean of the slope values contained within the watershed?

For example, could or should one take the main channel slope as the watershed slope?    Or the average of all identified channel slopes as the watershed slope?

I am looking to categorize several watersheds using, among other things (i.e. basin compactness, etc.), mean watershed slope.

Edit: I am assuming an estimate of watershed slope can act as a predictor for streamflow characteristics.  I do not want to actually estimate the streamflow, but group similar basins based on several attributes that might be used to predict streamflow.


texts: QGIS Field Calculator Expression - GeoHash32

texts:
I am attempting to write a QGIS 3.10 Field Calculator Expression that will use the mz2geohash library to encode the centroid of the current feature as LAT/LON, and then pass this tuple to the mz2geohash.encode() function to return a value.

I've in-lined my current code below, as well as linked to where it lives on my GitHub:

from qgis.core import *
from qgis.gui import *
import mz2geohash

@qgsfunction(args='auto', group='Custom')
def geohash32(value,feature,parent):
    ft_centroid = centroid($geometry)
    ft_lon = x(transform(ft_centroid),layer_property(@layer_id,'crs'),'EPSG:4326'))
    ft_lat = y(transform(ft_centroid),layer_property(@layer_id,'crs'),'EPSG:4326'))
    ft_array = []
    ft_array.append(ft_lon)
    ft_array.append(ft_lat)
    geohash32 = mz2geohash.encode
    return geohash32(ft_array)

Steps I have taken:

Installed mz2geohash library into QGIS 3.10 python environment using pip
Verified functionality of mz2geohash library in QGIS 3.10 python environment

Integrated suggested changes in Comments 1 & 2 from Gabriel De Luca and jbalk
(removal of extraneous parentheses)
Recast ft_tup as an array using the QGIS array() function
Removed empty initialization of tuple since it is immutable and makes no sense, as per Gabriel De Luca and ThingumaBob.
Added ft_array to create an empty array element
Added ft_array.append(ft_lon) and ft_array.append(ft_lat) to add values to ft_array
aliased mz2geohash.encode as geohash32
Verified that these steps work stepwise in the Python terminal

What I'm doing with my code:
ft_tup is establishing an empty tuple
ft_centroid is getting the centroid as a geometry object for the current feature
ft_lon is returning the X value of the centroid projected into WGS84
ft_lat is returning the Y value of the centroid projected into WGS84
ft_array is establishing an empty array to hold the results of ft_lon,ft_lat
ft_array.append(ft_lon) is inserting the x value into position 0 of the array
ft_array.append(ft_lat) is inserting the y value into position 1 of the array
geohash32 is created as an alias for mz2geohash.encode
return geohash32(ft_array) is supposed to give the encoded geohash

What QGIS has to say about my code:

An error occurred during execution of following code:
from qgis.core import *
from qgis.gui import *
import mz2geohash

@qgsfunction(args='auto', group='Custom')
def geohash32(value,feature,parent):
    ft_centroid = centroid($geometry)
    ft_lon = x(transform(ft_centroid),layer_property(@layer_id,'crs'),'EPSG:4326'))
    ft_lat = y(transform(ft_centroid),layer_property(@layer_id,'crs'),'EPSG:4326'))
    ft_array = []
    ft_array.append(ft_lon)
    ft_array.append(ft_lat)
    geohash32 = mz2geohash.encode
    return geohash32(ft_array)

traceback.print_exception() failed

Python version:

QGIS version:
3.10.0-A Coruña 'A Coruña', 6ffa89eb3e

Python path:

Individually, each line from the above works when tested in the python console outside of QGIS, or when each line is tested in the Field Calculator (with variables substituted for actual values).
Examples:

ft_centroid
centroid($geometry) = <geometry: Point>
ft_lon
x(transform(centroid($geometry),layer_property(@layer_id,'crs'),'EPSG:4326')) = -82.83264665692754
ft_lat
y(transform(centroid($geometry),layer_property(@layer_id,'crs'),'EPSG:4326')) = 42.61281133650196

Why do I want this?
I strongly desire the ability for QGIS to create human-readable spatially-derived interoperable/standardized GUIDs.

See my issue here:
https://github.com/qgis/QGIS/issues/31327

What will I do with the fixed code?
Open a PR to have this moved to core so everyone can use it.

What am I missing here?


texts: Fill combobox with NULL values in PyQGIS

texts:
I'm writing a plugin that has a form with a combo box that I fill with the unique values in a field of a vector layer in the project.
The problem is that there are NULL values in that column and I get this error when I run the code:
TypeError: index 0 has type 'QVariant' but 'str' is expected

I'm trying with this code, but I still get the same error:
layer = QgsProject.instance().mapLayersByName('MyLayer')[0]
fieldsLayer = layer.fields()
idxField = fieldsLayer.indexFromName('MyField')
unique_values = layer.uniqueValues(idxField)

combovalues = []

for value in unique_values:
    if value == 'NULL':
        combovalues.append('')
    else:
        combovalues.append(value)

self.dlg.cmbRuta.addItems(combovalues)


texts: I have a line shapefile in ArcGIS 10.1 (road shapefile) in WGS datum but they are not exactly placed as in the Satellite image. Is there a way to adjust all those lines to places on Arial image?


texts: Enabling preview in QGIS recent projects?

texts: after installing qgis on win 10 I am missing the map-preview in the recent projects window as I had under win7(see screenshot). where is the setting to enable this?


texts: Finding units for specific spatial reference system?

texts:
I want to use the st_within function to find geometries within a specifi distance. My geometries are both in the same SRID stored in a postgis db.
From what I read here: http://postgis.net/docs/ST_DWithin.html "The distance is specified in units defined by the spatial reference system of the geometries."

Where can I find the units of this specific reference system I use (EPSG:2100)?


texts: Looping Projection in ArcGIS ModelBuilder?

texts:
I've got a global DEM raster dataset in WGS84 and need to project this to all WGS84 UTM Zones. So after that I should have 120 raster, one in each Zone.

Is there a possibility to automate this process with the ArcMap ModelBuilder?
I tried the "for" iterator, but I can't choose the epsg as iterating value.

Then I need to run the flow length tool on all those rasters and then reproject the resulting 120 flow length rasters again into WGS84.

Do you have any idea for an efficient way to create a ModelBuilder path for that?


texts: Adding nodes to vertices on lines automatically using QGIS?

texts:
I'm currently using QGIS 2.17 to process map data and for drawing roads. I'm trying to add nodes whenever a road breaks, turns or starts/ends.

I've tried using the plugin "Locate points among lines" but it has one error : it adds a node to both a start and end of a road point instead of linking it with the next road point, which means I've got 1 extra node on each start and end of road to delete.
(A road "breaks" whenever it reaches an intersection/pedestrian crossing, and a new road linked directly with the previous road starts.)

Basically i want to do this : O-->O--------->O
instead of this OO----->OO---------->OO

Is there a way to automate this process?


texts: ShapefileFeatureTable cannot be converted to FeatureTable with Android?

texts:
I'm creating an Android application to display shapefiles. I'm using this code that I found on the Internet:

try {
        ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable("file:///mnt/sdcard/ShapeFile/LVA_water_lines_dcw.shp");
        FeatureLayer featureLayer = new FeatureLayer(shapefileFeatureTable);
        featureLayer.setRenderer(new SimpleRenderer(new SimpleFillSymbol(
                getResources().getColor(android.R.color.holo_blue_bright),
                SimpleFillSymbol.STYLE.SOLID)));
        map.addLayer(featureLayer);
    } catch (FileNotFoundException ex) {
        //Toast.makeText(this, R.string.shapefile_not_found, Toast.LENGTH_LONG).show();
        ex.printStackTrace();
        return;
    }

But it gives me the error:

ShapefileFeatureTable cannot be converted to FeatureTable


texts:
Anyone have any good resources you can point me to find additional symbol libraries that are published for qgis/sld?
My preliminary search has turned up a lot of plugs for the Resource Sharing plugin, but unfortunately, there really isn't much in terms of complex line styles.
For context, I'm looking for line styles along the lines of these: