texts: Image Segmentation and Object-based Classification in Google Earth Engine

texts:
I have tested three methods to segment my image collection:

(https://code.earthengine.google.com/699f04706c114260068275acd2605644)

var l8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR');

function maskL8sr(image) {
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = ee.Number(2).pow(3).int();
var cloudsBitMask = ee.Number(2).pow(5).int();
// Get the pixel QA band.
var qa = image.select('pixel_qa');

// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
  .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

// Return the masked image, scaled to [0, 1].
return image.updateMask(mask);
}

// Map the function over one year of data and take the median.
var composite = l8sr//.select(bands)
           .filterDate('2017-05-01', '2017-10-1')
           .filterBounds(StJohn)
           .sort('CLOUD_COVER')
           //.limit(500)
            .map(maskL8sr)
            //.median()
            .mosaic()
            ;

 // This method belongs to this
 link:https://gis.stackexchange.com/questions/273658/object-based-image-
 classification-in-google-earth-engine
 var boxcar = ee.Kernel.square({
 radius: 7, units: 'pixels', normalize: false });

 var smooth = composite.convolve(boxcar);
 Map.addLayer(smooth, {bands: ['B4', 'B3', 'B2'], max: 0.5}, 'smoothed');
 // These are the GEE methods for Object-based
 var objim= composite.connectedPixelCount();
 Map.addLayer(objim,{},'obj');

 var patchid = composite.connectedComponents(ee.Kernel.gaussian(1), 256);
 Map.addLayer(patchid, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3}, 'patches');

Unfortunately, the results visualization are not appropriate for me. Also, I need to classify this image collection using my own training data, so I don't want to use clustering or unsupervised methods.
I was wondering if anybody could help me to solve it.


texts: How to check for empty values in fields of a featureclass?

texts:
(ArcGIS Desktop 10.0 Python 2.7)

I need to check if any empty fields exist in featureclass fields in a gdb. These could be NONE, NULL "". The field name here is "Stand".

The following code doesn´t seem to work as "Test" is printed for every feature class even when they are filled!

rows = arcpy.SearchCursor(fc,"","","","")
        for row in rows:
            try:
       #check to see if field "Stand" has empty rows and print message to confirm
                if row.Stand:
                    print "empty row!"
                    break
            except:
                print "Feld existiert nicht"


texts: How to switch between SLD styles geoserver of one layer

texts:
i have one layer published in geoserver and i added 4 styles(sld1, sld2, sld3, sld4) to the same layer, now how could i to switch between 4 styles each style with the legend use leaflet ? this wms of my layer:
var mylayer = L.tileLayer.wms("http://localhost:8081/geoserver/map/wms", {
    layers:'map:mylayer',
    format: 'image/png',
    transparent: true,
    attribution: "mylayer"
});
mylayer.addTo(map);


texts: How to read Alphanumeric value when importing csv location file to ArcGIS?

texts:
So I am importing a csv file to ArcGIS and it has a bunch of alphanumeric values..

e.g. Attribute ID contains values such as 101, 101A, 101B etc ...the problem is when i am importing the csv to ArcGIS it is putting  values wherever alphanumeric signs exist

Can anyone suggest a way to overcome this ?


texts: Turning on Smooth Pixel Transformation in QGIS?

texts: How do I turn on "Smooth Pixel Transformation" in QGIS?


texts: Can QGIS generate multiple lines by a line based on distance

texts: Can QGIS generate multiple lines based on distance, and try to use the gadgets or plug-ins in it to generate lines


texts: How to iterate over features in a filegdb - ogr Python

texts:
I'm trying to convert an Esri GDB terrain containing LiDAR data to a flat file structure (csv, xyz). Using ogr2ogr (with --explodecollections) is taking a long time (8 days so far to convert 40% of a 900GB terrain layer) - so while its grinding away, I'm exploring alternatives.

Each record in the terrain is a mulitpoint geometry with up to 3500 points. I'd like to test whether loading each record in the terrain to ogr memory, then exploding and writing to the flat file is more efficient than --explodecollections

My test code (so far) is below, but is failing while iterating through the features in the layer.

While iterating though each feature in the layer, so I have to 'unload' the geometry after each iteration, or am I referencing the geometry incorrectly?

from osgeo import ogr
# Open layer from GDB
gdb =  "source.gdb"'
driver = ogr.GetDriverByName("FileGDB")
dataSource = driver.Open(gdb, 0)
layer = dataSource.GetLayerByName("DTM_1_MRFC")

print layer.GetName()

# Print field names
lyrDefn = layer.GetLayerDefn()
for i in range(lyrDefn.GetFieldCount()):
    print lyrDefn.GetFieldDefn(i).GetName()

# Features in layer
print "No of features: %d" %(layer.GetFeatureCount())

for feature in layer:
    fid = feature.GetFID()
    geom = feature.GetGeometryRef()
    geom_count = geom.GetGeometryCount()
    type = geom.GetGeometryName()
    # print fid
    print type
    print geom_count

# Clean close
del gdb


texts:
i have an error when i launch the qgis 2.8.2 it says that the module sip cannot be load
python 2.7 has been installed

i am under ubuntu 14

please if you have any idea

here is the message (in french sorry ):

Le module SIP n'a pas pu être chargé.
Le support Python va être désactivé.

Traceback (most recent call last):
  File "", line 1, in
ImportError: No module named sip

Version de Python :
2.7.6 (default, Mar 22 2014, 23:03:14)
[GCC 4.8.2]

Version de QGIS :
2.8.2-Wien 'Wien', exported

Chemin vers Python :
['/usr/share/qgis/python', u'/home/flodev/.qgis2/python', u'/home/flodev/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-i386-linux-gnu', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']


texts: Run LandTrendr algorithm on a collection of points/pixels in Earth Engine

texts:
Regarding the LandTrendr algorithm in Earth Engine... I have prepared an input image collection and can successfully get a result from the algorithm (no errors), but how can I extract segmentation information for each of the points in a feature collection from the result?

Here is the code for building the input collection and running LandTrendr:

// #############################################################################
// ### INPUTS ###
// #############################################################################

// Define a point feature collection to run LandTrendr on.
var points = ee.FeatureCollection([
  ee.Feature(ee.Geometry.Point(-122.62346, 44.0332), {'id': 0}),
  ee.Feature(ee.Geometry.Point(-122.71169, 44.0404), {'id': 1}),
  ee.Feature(ee.Geometry.Point(-122.63977, 44.0409), {'id': 2})
]);

// Define annual composite date range.
var startDoy = 175; // start at 175th day-of-year
var nDays = 90; // end 90 days later

// Define year range.
var startYear = 1984;
var endYear = 2012;

// Define band to use for segmentation.
var bandName = 'B7';

// Define LandTrendr parameters.
var ltParams = {
  maxSegments: 6,
  spikeThreshold: 0.9,
  vertexCountOvershoot: 3,
  preventOneYearRecovery: true,
  recoveryThreshold: 0.25,
  pvalThreshold: 0.05,
  bestModelProportion: 0.75,
  minObservationsNeeded: 6
};

// #############################################################################
// ### COLLECTION PREPARATION ###
// #############################################################################

// Display the point.
Map.centerObject(points, 13);
Map.addLayer(points, {color: 'red'});
Map.setOptions('SATELLITE');

// Define function to mask clouds and cloud shadows.
function cfmask(img) {
  var cloudShadowBitMask = 1 << 3;
  var cloudsBitMask = 1 << 5;
  var qa = img.select('pixel_qa');
  var mask = qa.bitwiseAnd(cloudShadowBitMask)
    .eq(0)
    .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return img.updateMask(mask);
}

// Import Landsat 5 surface reflectance collection
var lsCol = ee.ImageCollection("LANDSAT/LT05/C01/T1_SR");

// Define a list of years to make composites for.
var yearsList = ee.List.sequence(startYear, endYear, 1);

// Map over the year list to build an annual composite collection.
var annualCol = ee.ImageCollection.fromImages(
  yearsList.map(function(yr) {
    var startDate = ee.Date.fromYMD(yr, 1, 1).advance(startDoy, 'day');
    var middleDate = startDate.advance(nDays/2, 'day');
    var endDate = startDate.advance(nDays+1, 'day');
    var yearCol = lsCol
      .filterDate(startDate, endDate)
      .filterBounds(points)
      .select(bandName)
      .median();
    var nBands = yearCol.bandNames().size();
    return yearCol.set({
      'system:time_start': middleDate.millis(),
      'nBands': nBands
    });
  })
);

// Deal with missing years (no images or all pixels masked).
var yearsPresentCol = annualCol.filter(ee.Filter.neq('nBands', 0));

var yearsAbsentCol = annualCol.filter(ee.Filter.eq('nBands', 0));

// Make a filler image for missing years - all pixels masked.
var dummyImg = ee.Image(0).selfMask().rename(bandName);

// Add dummy image band to images with no bands (missing years).
yearsAbsentCol = yearsAbsentCol.map(function(img) {
  return img.addBands(dummyImg);
});

// Merge the missing years collection to the valid years collection.
var ltCol = yearsPresentCol.merge(yearsAbsentCol);

// Set the annual composite collection as the LandTrendr timeSeries parameter.
ltParams.timeSeries = ltCol;

// #############################################################################
// ### RUN LANDTRENDR ###
// #############################################################################

var ltArrImg = ee.Algorithms.TemporalSegmentation.LandTrendr(ltParams);
print(ltArrImg);


texts: Casting ArcPy result object from arcpy.GetCount_management() as integer instead?

texts:
I am trying to get a number by counting how many points are in a shapefile. And this works, except I then am running into trouble using that number somewhere else. Eventually, I'll be using that count in some math (field calculator), but while debugging I'm running into an error that will end up causing me trouble later on.

This code:

TotalPoints = arcpy.GetCount_management(Path_Pts)
arcpy.AddMessage(">>>> PROCESS: COUNT PATH POINTS {" + TotalPoints + "}")

gives this error:

TypeError: cannot concatenate 'str' and 'Result' objects

I tried casting it as a int, which it ALSO doesn't like:

TypeError: int() argument must be a string or a number, not 'Result'

So I've got a 'Result' object and need to turn it into a number.

How can I do that -- or is using the ArcPy function unnecessary or overly complicated here?


texts: Clustering Raster Monthly Precipitation Pattern

texts: I am looking for a way to automatically cluster the monthly rainfall data that I have like the Koppen Classification Map. I have 12 raster files of precipitation (months of Jan-Dec) of a country and I want to make a map of the precipitation pattern (eg. Cluster 1 are regions with Jan-Dry, Feb-Dry, March-Wet ..... while Cluster 2 are regions with Jan-Wet, Feb-Dry .... Cluster 3 are regions with Jan-Wet, Feb-Wet and so forth....). Can I do that on QGIS 2.18?


texts:
I have loaded a map layer (containing school catchment boundaries) and I have also plotted numerous houses (as points within a layer). How can I search for houses which are within 2km of each boundary?

I am using QGIS and am a relatively new user so don't know much about the programme.


texts:
I am a new user to QGIS and GRASS.

I want to use v.centerline so I opened GRASS as administrator on Windows 10 and I went to the gui of g.extension and successfully installed v.centerline.

I opened QGIS, I still don't see v.centerline in the Processing Toolbox, is there anything else that needs to be done.

Similar questions have been asked before but all of them refer to the GRASS manual and I don't understand that. I am certain that something more needs to be done, but can anyone clearly specify what these things are because GRASS website isn't helpful at all.


texts: Postgresql view with Point geometry returns QGIS error “(the_geom) sql = is an invalid layer and cannot be loaded”

texts:
I want to create a Postgresql view using point data.  When I create the view, the geometry_columns table updates appropriately.  Attempting to load in QGIS produces the error “(the_geom) sql = is an invalid layer and cannot be loaded”.

For all of the working (polygon) views, when I load them in QGIS, I need to specify the primary key column (as documented here: How to make a spatial view in PostGIS and add it as a layer in QGIS?).  When I try to add my point view, I am not given the option to choose the primary key.

I have tried several tables all with Point geometry and nothing is working. The tables do have the 3 constraints: enforce_dims_the_geom, enforce_geotype_the_geom, and  enforce_srid_the_geom.   I have also run st_isvalidreason (the_geom) and the geometry is valid.  How do I get a view with point data to show the selection for a primary key in QGIS?

We are running PostGIS 1.4 and I am using QGIS 1.8.


texts: How to export a georeferenced TIFF for editing in QGIS?

texts:
I've successfully plotted some points. See code and output.
I now want to save this as a .tif in order to add a base map like OpenStreetMap or Google Maps. How to?
pspcoord<-spTransform(plotcoord, CRS('+proj=utm +zone=21'))
plot(pspcoord)


texts:
I have a large OpenStreetMap .pbf history file.
How do I know if this file has a specific attribute such as a name or version number?
Or, in general, the number of feature attributes in this file.


texts:
I'm running ArcMap 10.3.

I'm looking to analyse road collision data provided by a client. Each collision is recorded as a point, with a severity allocated to the accident. For example fatal accidents have a score of '3' whereas minor shunts and bumps have a score of 1. My client is interested in one kilometer stretches of roads which have a combined 'score' of more than 7 for the accidents therein.

In the past I've simply used a 'Polyline Dicer' tool to split a model of the road network into kilometer lengths. However this is a 'dumb' process, and it is possible that stretches of the road network that meet the above criteria will be missed.

I've considered cluster analysis but 1) there seems to be a slightly wooly element to how you set the parameter and 2) cluster analysis outputs won't flag up sections of the road network. For example I can identify the roads within a cluster hotspot, but I will also erroneously flag up side streets and other unrelated road lengths.

I'm aware of the 'SANET' toolset which would perform the sort of analysis I'm interested in. I can potentially commission another organization to carry out this work (I can't obtain a SANET license directly for my line of work), but I'm wondering if there is a deft combination of tools in ArcMap that would give me the same, or similar, results.

In my head there is a fuzzy workflow that involves step-wise buffer analysis of each accident to consider all other collisions within a 500 meter radius of the given collision, identifying those which have the same underlying road attribution (road name/type) and somehow working from there.


texts: Extracting NDVI for Landcover Classes in Google Earth Engine

texts:
I am working on a project where I have created a supervised classification of an image which contains four land cover classes. I have reduced the classification to a frequency histogram that displays the percent land cover taken up by the image, however, I now want to get the NDVI mean for each land cover class.
Using a reducer seems to be the most likely approach but I am not sure how to reduce and match NDVI values associated with each class in this case. The frequency histogram reduction yields the resulting pixel counts:
...
classification: Object (4 properties)
0: 15330.674509803957
1: 7207.431372549016
2: 71314.45098039194
3: 3969.709803921568

Ideally, I would get an object that looks like this:
classification: Object (4 properties)
0: {pixel_count: 15330.674509803957, NDVI: ...}
1: {pixel_count: 7207.431372549016, NDVI: ...}
2: {pixel_count: 71314.45098039194, NDVI: ...}
3: {pixel_count: 3969.709803921568, NDVI: ...}

Does anyone know what the best way to go about computing this reduction would be?
Thanks for any help!


texts: Run the Sub procedure by selecting an object from the map

texts: In Mapbasic made custom menu selected item to run  sub procedure, what i want to make the Sub procedure to be ready to run by selecting an object from the map and run again by selecting another object, and so on


texts:
We are transitioning from Google Maps to Mapbox.  Mapbox is a proponent of geoJSON and uses it extensively, so we are considering adopting it for all of our maps.

An issue is the creation of the geoJSON from Postgres v9.3.6 with PostGIS v2.1.5, and within PHP

This is my current SQL query:

SELECT
stop_name, stop_lat, stop_lon, stop_time_id, stop_times.stop_id
FROM stop_times
INNER JOIN stops
ON
stop_times.stop_id = stops.stop_id
WHERE
trip_id =$query_trip_id
ORDER BY
stop_times.stop_sequence
ASC";

This is an example output:

stop_name || stop_lat || stop_lon || stop_time_id || stop_id || arrival_time || departure_time
Location1   35.782312   -78.671343     1526016        777640      09:17:00         09:17:00
Location2   35.78144    -78.674683     1526125        777662      09:19:00         09:19:00
Location3   35.78022    -78.67614      1526126        777641      09:19:00         09:19:00

It seems as though I have 2 options to generate this file from the database:

1) rewrite the above SQL query so that it generates the geoJSON file directly as per the instructions below:

http://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html

(note that the example in the link uses geography(POINT), rather than lat and long in separate fields)

2) create temporary table, insert the results from the intitial SQL query, and generate the geoJSON from the single temporary table

As I see it, option 1 means writing some horrible looking SQL to generate the geoJSON, because I am joining tables (and I have to do this with several maps), but the processing times will be reduced

Option 2 has the advantage that the original SQL stays intact, and I only have to create the geoJSON from one table (and not two).  But the processing time will be longer.

Recommendations?


texts:
I want to create my own Toolbar with a Toolbar button which has a drop down menu:

The following code works fine in the QGIS console:

from qgis.core import Qgis
from PyQt5.QtWidgets import QToolBar,QMenu,QToolButton,QPushButton,QAction

def findActionByObjectName(objname,iface):
    try:
        toolbars = iface.mainWindow().findChildren(QToolBar)
        for toolbar in toolbars:
            for action in toolbar.actions():
                if action.objectName():
                   if action.objectName().lower() == objname.lower(): return action
                if action.actionGroup() is not None:
                    for a in action.actionGroup().actions():
                        if a.objectName():
                            if a.objectName().lower() == objname.lower(): return a
        menubar = iface.mainWindow().menuBar()
        for action in menubar.actions():
            if action.menu():
                for action in action.menu().actions():
                    if action.menu():
                        for a in action.menu().actions():
                            if a.objectName():
                                if a.objectName().lower() == objname.lower(): return a
                    else:
                        if action.objectName():
                            if action.objectName().lower() == objname.lower(): return action
            else:
                if action.objectName():
                    if action.objectName().lower() == objname.lower(): return action
    except Exception as e:
        print(e)

toolbar = iface.mainWindow().findChild(QToolBar,'Test')
if not toolbar:
    toolbar = QToolBar()
    toolbar.setObjectName('Test')
    toolbar.setWindowTitle("TEST")
    iface.addToolBar(toolbar)

actionlist = ["mActionMeasure","mActionMeasureArea","mActionMeasureAngle"]
stdAction =None
menu = QMenu()
for name in actionlist:
    action = findActionByObjectName(name,iface)
    if action:
        print ('found:',action.objectName())
        menu.addAction(action)

stdAction=QAction("Measure")
stdAction.setMenu(menu)
toolbar.addAction(stdAction)

When it runs from my plugin, it creates the toolbar, but not the button with the menu?


texts:
I have set of areal imagery.

One of a parameters I get with images is camera's Principal Distance , what I'm looking for is Focal length, but I don't have Focal length at the moment

I tried to substitute between two to create DEM with one of the commercial software, as a result I'm getting wrong Altitude.

Maybe there is some calculation that can be used to get Focal length from Principal Distance ?


texts: How to add csv file in QGIS 2.0 using Delimited Text Layer Plugin?

texts:
I used to import csv files in previous versions of QGIS using the format below, but when I upgraded to QGIS 2.0 the delimited text layer plugin was changed and I can't import the file anymore. The plugin can't also detect the x,y or long lat field unlike in previous versions. Any ideas how to add the file? Thanks

Heres what it looks in Text Editor:


texts: Seeking QGIS algorithm for Swapping land parcels/plots by property?

texts:
I've searched for a QGIS Algorithm for swapping plots in an area by land owners and I didn't find anything.

Do you know something that did that?

For example, in an area or in a town we have 2 big land owners. The plots are mixed between them. For a land consolidation we need to swap the plots between them. The result would be that land owner 1 is in the west side of the town and the land owner 2 is in the south side of town. It's about the agricultural land for bigger agricultural exploitation.

Example:

Plots before a swap

Plots after a swap

The green plot/parcels are for owner 1
The Red plot/parcels are for owner 2

It can be used for land consolidation.


texts: Create a List of All Webmaps within a Portal

texts:
I'm trying to do some spring cleaning and in the plans of organizing and archiving older webmaps.
We have several hundred maps, so I'm looking for a way to create a simple CSV that will list all webmaps. With a CSV I will be able to track my progress better.
Does Portal have any way to do this?
Admin Tools for ArcGIS Online does this for AGOL, but not for free in portal.


texts: processing.runalg('qgis:splitvectorlayer') --> wrong Output directory

texts:
I'm tryiing to split a vector layer using this code :

processing.runalg('qgis:splitvectorlayer', 'D:/Images_Sentinel_2/2A/shp_taitt/contour.shp', 'nom', 'D:/Images_Sentinel_2/2A/shp_taitt_split')

the problem is that the output files are saved in 'D:/Images_Sentinel_2/2A/shp_taitt' not in 'D:/Images_Sentinel_2/2A/shp_taitt_split'

I tried to run it manually in two ways, one of them is working and the other one is not

the first one is not saved in the processing history, but it save output files in the output directory:

the second one is saved in the processing history but it doesn't save output files in the output directory given as parameter


texts: R Set Spatial Points in a Matrix around given Spatial Points

texts:
I am struggling  with the task to set one point in each pixel (of a given raster) in a distance of 3km of my points.
I tried buffering in QGIS and R but cannot find a way to set exactly one point in each pixel.
I think it will work with creating a matrix around the points but I couldn´t find a way doing this.
Data:
46 species presence points;
Raster Stack with environmental Data Res: 100x100m

raster with presence points (zoomed in)

presence points: black crosses, buffers(false): purple, backgroundraster: allbands

gridpts
code:
# Points in Matrix around Presence Data

# #---------------------------------------------------------------------
# Prework

# Packs
library(spdep)
library(sp)
library(rgdal)
library(raster)
library(RStoolbox)
library(rgdal)

#-------------------------------------------------------------------------------------------------------------------------
# Data

# Presence Points:
pts <-readOGR("D://GIDEON_korrigiert_aktuell_repro_EPSG32648_forR.shp")

> pts
class       : SpatialPointsDataFrame
features    : 46
extent      : -507313, 812849.9, 761011.2, 2831574  (xmin, xmax, ymin, ymax)
crs         : +proj=utm +zone=48 +datum=WGS84 +units=m +no_defs
variables   : 2
names       :    Lat,     Lon
min values  : 10,230, 100,030
max values  :  7,880,  99,950

# Raster:
allbands <- raster("D:/Database/AllReproCliped_for_DOWN/ForestFrek/Stack_8er_Prec_Wet_Temp_Land_Tree_Short_Bare_ForestFrek.tif")

> allbands
class      : RasterLayer
band       : 1  (of  8  bands)
dimensions : 23913, 17032, 407286216  (nrow, ncol, ncell)
resolution : 106.8938, 106.8938  (x, y)
extent     : -835901.2, 984713.7, 624198, 3180349  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=48 +datum=WGS84 +units=m +no_defs
source     : D:/Chris/Studium/BA/QGIS_Datein/Database/AllReproCliped_for_DOWN/ForestFrek/Stack_8er_Prec_Wet_Temp_Land_Tree_Short_Bare_ForestFrek.tif
names      : Stack_8er_Prec_Wet_Temp_Land_Tree_Short_Bare_ForestFrek
values     : -6.3375, 28.77083  (min, max)

#-------------------------------------------------------------------------------------------------------------------------
# Plot

plot(allbands)
plot(pts, add= TRUE)

#------------------------------------------------------------------------------------------
# Buffer

pres_st <- st_as_sf(pts, crs= "bogus")
crs(pres_st)

d = 3000
buf <- st_buffer(pres_st, dist=d)

gridpts <- st_as_sf(
  as.data.frame(
    mask(allbands, buf),
    xy=TRUE,
    na.rm=TRUE),
  coords=1:2,
  crs=st_crs(allbands))

#------------------------------------------------------------------------------------------
#Plot

plot(gridpts)

plot(allbands)
plot(pts, add=TRUE)
plot(gridpts, add=TRUE)

#------------------------------------------------------------------------------------------


texts: QGIS- Problem with saving from Layout Manger - Map area is blacked out when saved

texts:
I have been composing a number of layout from a project in QGIS.  These have all exported with no issue.  But today I have encountered a problem when exporting as an image, pdf and SVG that I can not resolve.  One of my maps boxes appears blacked out (see below for what the output should look like and what I am getting when I export).

I have tried saving in different file formates and also tried deleting the map frame and then reinstalling it.  The rectangle in the top left has two map frames.  Originally both of these map frames appeared as black but after re-adding the large frame and redoing the overview for the smaller insert map the smaller map frame is now visible when I try to export.  I have tried adding an overview to the larger frame but this does not make any difference and the large frame remains blacked out.

I am new to QGIS and have learned everything from googleing how to.  I would really appreciate if anyone could help me fix this issue.


texts:
I've tried to come up with an open-source equivalent to the following process in ArcGIS 10.3:

Spatial Analyst Toolbox > Extract by Mask
target input: 1" SRTM DEM in EPSG 4019
mask layer: single rectangular polygon, shapefile in EPSG 4283
Environment Settings: Snap Raster to target input, output coordinate system EPSG 4283

This gets me a 'perfect' clip - no changes to pixel size or alignment, identical cell values in the output. The output doesn't align perfectly to the clipping polygon of course, but I don't need it to. Arc just extracts all the cells intersecting the polygon (although I note that the top-most and right-most columns are set to no-data, presumably because their upper-right corners were outside the bounding box).

I've worked out one solution using GRASS 7 and GDAL processing tools in QGIS 2.14.3:

Create a mapset and import the raster to be clipped
Run g.region.multiple.raster so that region settings match the imported dataset
Use v.in.ogr to import the bounding box shapefile
Use v.to.rast.constant to convert the bounding box to a raster with value 1 for all cells. The output is aligned with the input due to the region settings.
Use g.region.zoom with the new raster boundary to shrink the region without altering cell size or alignment
use r.out.gdal.geotiff to export the source dataset. Only the area within the updated region is exported.
Use gdalwarp to re-project the output .tif in EPSG 4283

The output is nearly identical to the ESRI workflow, but where ESRI set the top-most and right-most columns to no-data, GRASS just didn't export them. Fine by me.

Can an equivalent procedure be run in QGIS without using GRASS?


texts: Fill masked array values with reflect padding

texts:
I have a square matrix (image) with masked values in an area. The mask corresponds to missing values in areas close to the border (always). I want to create a new image where the masked values are replaced with the reflect padding of the values where actual image values exist. How can I do so in python or C++?

In the example below I want to replace (left panel) the yellow area with the reflected image of the middle panel, where data exist. The result should be something like the right panel image (the  padding here  is not the appropriate reflect padding I am after, as I just used the naive recipe  right_image = np.where(temp.mask,middle_image[::-1,::-1],middle_image))

edit: I tried to transverse the image row by row, and use numpy reflect padding, with the code below, but it doesn't work in all regions (bottom left is problematic):

# Row Reflect
# Here out_image is the original image, where -2 is no data value
xx = []
for i in range(6000): # Number of rows
    temp1 = np.ma.array(out_image[0,i,:],mask= out_image[0,i,:]==-2) # Create mask per row, -2 is the masked value
    edges = ma.flatnotmasked_edges(temp1) # Find edges
    #if edges is not None:
    xx += [np.expand_dims(np.pad(temp1.data[edges[0]:edges[1]],((edges[0],temp1.shape[0]-edges[1])),mode='reflect'),0)]
out = np.concatenate(xx)
#out = out.reshape(2000,2000)

The result is incorrect.


texts:
I downloaded the point sampling tool for QGIS and I'm trying to run it. A few days ago it worked fine, but now it gives the following error:
An error has occured while executing Python code:

Traceback (most recent call last):
File "C:...pointsamplingtool    \doPointSamplingTool.py", line 262, in accept
   self.sampling(outPath)

File "C:....pointsamplingtool\doPointSamplingTool.py", line 315, in sampling
   if pointGeom.wkbType() == QGis.WKBMultiPoint:

AttributeError: 'NoneType' object has no attribute 'wkbType'

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version:
2.10.1-Pisa Pisa, d20c5b7
Does anybody know how to fix it?


texts: Shapefile to polygon, then edit the polygon in order to use it as a mold

texts:
I am working on QGIS with a shapefile:

I transform it through Raster-> Conversion-> Polygonize

Then I eliminate some parts (Sea), and those that are bigger than one single square of grid but are inside of the mainland

I would like to fill those black gaps with no grid in the vector file with a grid of the same size of all the other squares.
I'm working on this trying to use the final polygon as a model to cut other shapefiles.


texts: Performing addition in QGIS Raster Calculator?

texts:
I am using QGIS 2.6 on Windows 7.

I have generated two rasters from vector layers. They cover the same extent and have the same projection (Irish Transverse Mercator) and cell size (5m x 5m). I have 'reclassified grid values' to ensure that both rasters now have values of only 0 or 10. I have been attempting to add the rasters together in the raster calculator ("NPWS@1"+"CH_Extract@1") and I am expecting to see values of 0, 10 or 20 (where there is overlap between the two original vector datasets). Instead I get an output layer with values of 0 or 9.989990. I have tried every permutation I can think of to fix this and am having no joy.


texts:
I would like to show a map on my website.
I have 2 different kinds of KML files that need to be plotted. One defines region boundaries. The other points within those boundaries.
The region boundaries are in standard google map format. The points are in "EPSG:4326" format.

Is google maps the right tool for the job or should I use something else? I heard openlayers is an alternative.


texts: Feature Linked Annotation, annotation does not behave the way the labels do (extra line space)

texts:
I created a feature-link annotation layer by converting labels created in MapPlex to annotation.  I'm using a balloon callout label and my label expression has tags that change the font size (label font size is 8) on a second line, example:

[name] & vbnewline &"<fnt size = '5'>" &[other_name] &"</fnt> "

After converting the labels to annotation, the appearance is really nice and compact. But if I change the attributes of the source feature or add a new feature, the annotation changes in appearance such that it looks like extra space is added between the two lines.  It is as if the second line has a height of 8 point when I want it to be 5. I've tried looking through the annotation attribute table as well as compare the label properties, tab by tab, to find differences between the two different appearances but am unable to find any.  I can create work-arounds, but because there are so many labels to be placed, I'd really prefer the compact version. Anyone else run across this?

Here is a visual:


texts: Seeking all US 2010 Census Data at Tract Level

texts:
I'm trying to find where I can download all the data (summarized to the tract level).
By all data, I mean

population
race
Marital status
job
wage
age
sex
same sex couples
kids
education

I need this for every tract, in every county, in every state.

Every search I do shows someone asking for something like just population counts by block in 1 area. people are usually pointed to the American Fact Finder, but this is going to be too cumbersome for what I want.

I think I need the summary files, but haven't been able to find anything that shows, in clear detail, which ones I need.


texts:
I just used a leaflet. From the geoJSON demo page I saw if you want to include data you have to use

<script src="data/us-states.geojson"></script>

and if you open the files looks like

var ustates = {
"type": "FeatureCollection",
......
[]
};

and if you want to call them use

var data = [ustates] ;

Is there another way to call the data?
The geojson file that I have has no initial variable and looks like this:

{
"type": "FeatureCollection",
......
[]
}

I have lots of data and I have to open 1 by 1 to add variable on geojson data so I mean can I just call the data like

var ustates = <?php include "data/us-states.geojson"; ?>
var data = [ustates];


texts:
Is it valid GML if the boundary of a polygon intersects itself?
E.g. I have this polygon consisting of some gml:LineStingSegment and one gml:Arc:

My task is to import GML based data (german ALKIS data in NAS format) to Oracle spatial.

In Oracle some polygons have a invalid geometry after import:
ORA-13349 The boundary of a polygon intersects itself

So I wonder if it is allowed in GML to define a polygon with a boundary that intersects itself.

Here is a snippet of the GML:

> <gml:Surface gml:id="BRPPR">  <gml:patches>       <gml:PolygonPatch>
>           <gml:exterior>
>               <gml:Ring>
>               ...
>                   <gml:curveMember>
>                       <gml:Curve gml:id="BRPPW">
>                           <gml:segments>
>                               <gml:LineStringSegment>
>                                   <gml:posList>323671.155 5538007.151 323674.553 5538013.270</gml:posList>
>                               </gml:LineStringSegment>
>                           </gml:segments>
>                       </gml:Curve>
>                   </gml:curveMember>
>                   <gml:curveMember>
>                       <gml:Curve gml:id="BRPPX">
>                           <gml:segments>
>                               <gml:Arc>
>                                   <gml:posList>323674.553 5538013.270 323673.358 5538012.318 323671.840 5538012.488</gml:posList>
>                               </gml:Arc>
>                           </gml:segments>
>                       </gml:Curve>
>                   </gml:curveMember>
>                   ...
>               </gml:Ring>             </gml:exterior>         </gml:PolygonPatch>     </gml:patches> </gml:Surface>


texts: Arcpy 64 bit, or multiple Python installs?

texts: I am new to Python, and am trying to write a script that would upload a geodatabase to AGOL at a scheduled interval. However, the 32 bit distribution of Python cannot handle the file size (over 1 MB), even when the multipart parameter of addItem (using ArcREST) is set to true. Through some investigation, I've learned that this is a limitation of Python32, and to do what I'd like to do I need the 64 bit version. I was trying to avoid having multiple installs of Python (as I said, I'm new to it, so the less complication, the better), but if I remove Python as it was installed with ArcGIS, I lose Arcpy, which I also need. So, my question is, does anyone know of a solution to this issue, or am I stuck dealing with multiple Python installs?


texts: Click features & aggregate unique attributes only (QGIS)

texts:
In QGIS 3.16: the "merge feature attributes" function (on the advanced digitizing toolbar) allows merging the attributes of selected features by either 1) selecting which feature to keep the attributes from, or 2) concatenating the values from all selected features.  However, there is no 'concatenate unique' option here; equal values will be duplicated.
Is there a way to concatenate the attribute values without duplication?  I am not looking to do this across the board for all features in a layer; just for features that I click and select.   Thanks.


texts: How to render overlapping bus trips as one route from OSM?

texts:
I would like to create bus map for my city from OSM data.

I imported data into Postgresql with osm2psql and I can render routes with Mapnik. But the problem is that same route ref is shown multiple times and very close together.

I think this is because each bus route is made from multiple trips.
For example bus line 4 has 11 different stop combinations but most of them go through same stops only in different order.

My question is how to avoid repeating name of the same route multiple times by any means necessary. (preprocessing XML, different SQL, carto css attributes)
I found a post aboutOverlapping lines but this are lines from different routes and a different problem.

I fixed this a little by select distinct(way) but it isn't great.

I found out about ST_DIFFERENCE Postgis function but I don't know how to construct SQL that would create difference of all different trips on same route joined them and represents them as one.

I read similar question and added text-clip:true and text-avoid-edges:false to #Routes, buffer-size:768 to Map and  changed MetaTile to 8 with no visible differences.

I render map with Tilemill with this cartocss:

#Routes {
  line-width:1.5;
  line-cap: round;
  ::labels {
    text-name: "[ref]";
    text-face-name: "Trebuchet MS Regular";
    text-placement:line;
  }
}

I select bus routes from DB like that:

(select distinct on (way)   way, ref from planet_osm_line WHERE "route" = 'bus'  order by way, ST_LENGTH(way) DESC) as buses


texts: Openlayers -- Is there a way to delay server requests on zoom for a particular layer?

texts:
I have a rather complex issue where I have 10 TMS Layers (I'm using OpenLayers) that animate. When I zoom in and out quickly I can quickly rack up 1000's of hits to the same server. Is there a way I can delay the request of that layer until zooming has stopped for x amount of time?

Thanks!


texts: DBMS and ArcSDE Architecture for Large (Mostly Non-Spatial) Dataset

texts:
I have ~1000 fixed points representing data collection stations with multiple sensors, and a csv that is ~4.5GB of values in the format:

id     pointid  sensor  measdatetime      measvalue
50345  500      tempa   1/1/2011 13:55    72.81
50346  501      tempb   10/31/2011 14:00  75.65
55457  500      gaght   10/31/2011 01:00  6.56

(The data is similar to USGS stream gauges, but from a different network and different format.)

I am somewhat familiar with geodatabase design, but have little experience with the capabilities of the different DBMS's that work with ArcGIS. I'm considering using a variation of the Marine Data Model for the geodatabase design, but am a bit fuzzy about the DBMS ArcSDE Architecture I should use.

It seems that hardware wise, I'll want a dedicated machine for DBMS and SDE with a direct gigabit lan connection to a desktop machine running ArcInfo. For cost and "openness" sake, I'd like to use postgreSQL with postGIS (Followed by MS SQL Server Express, as I'm more familiar with T-SQL), but am not sure of the implications because of having such a large dataset. Also, from what I've researched, PostGRE has much better built in "windowing" for queries (eg. calculating a moving-window 2-week tempa average). If it makes a difference, I'd like to be able to load a given dataset entirely into RAM if I know I will be using it extensively for a specific work session. (Similar to This Helpful Answer)

To The Point:

Is there a performance reduction by using PostGIS, since there is only a 32-bit version of SDE for it? Can I use 64-bit PostGRE, authorize it with 32-bit SDE, then use a direct connection to PostGRE to avoid a 32-bit "bottleneck"?
Is there an advantage to keeping the bulk of the data "non-spatial", so I could have 64-bit PostGRE do the queries, then join the results to the points in ArcMap?
Is there a better overall approach to managing a large amount of data using postGRE, considering ArcSDE's 32-bit limitation?

Other considerations:

I am using ArcInfo 10.0 with SP3, and have an EDN membership, so I can experiment fairly freely with minimal cost. I also have MS SQL Server 2008 R2 for developers, if needed.
The desktop machine will obviously need to be windows, but I can run windows or linux for the DBMS machine if there's an advantage.
There will be a number of static queries (eg 2-week moving average) that I may store the results of, but I would also like to be able to perform a specialized query quickly if needed. (eg. What is the minimum of the daily mean temps from stations 003, 007, and 104, betweem 1/1/2011 and 1/31/2011.)
I've read this guide, but find it to be mostly ambiguous and not useful for finding any pros or cons regarding specific scenarios (Lots of info, but little useful guidance. Am I really supposed to believe that there is NO difference in performance by using or not using the ArcSDE service?)


texts: Identifying OD-pairs where pgr_withPointsCost() did not find path?

texts:
I am currently working with the pgr_withPointsCost() function in order to get the shortest path costs for millions of origin-destination pairs of Points (OD-Pairs; Many-To-Many). I got the function to work but I was wondering what happens to OD-Pairs pgrouting cannot find a path for?

The documentation  of the function states the following:

"When the starting vertex and ending vertex are the different and there is no path. The agg_cost in the non included values (u, v) is ∞"

From this I see that OD-Pairs with no path found (which is eg. due to network connectivity problems) are not included in the result table.

Does pgrouting feature any option to include OD-Pairs that have no shortest path between the origin and destination point (eg by including them with an agg_cost value of NULL or ∞)?

I would like to see which pairs could not be connected by a shortest path in order to identify graph connectivity issues. I already thought about getting the result by using joins on OD-id pairs and the result table but was wondering if there was any pgrouting specific solution I have overseen.


texts: Tiling rgba geotiffs using vrt rather than gdal_warp

texts:
I've carefully cut the collar off a set of USGS geotifs and I'd like to run through them with gdal2tiles but producing a vrt that undersands the alpha layer, or having gdal2tiles overlap two source files into one tile is not working. Some things I have tried have made all black pixels transparent. Other attempts rendered the transparent borders on my source files as if they were solid white, so when one tile is made from two adjoining tifs the transparent border from one covers up the useful content of another. Here is my process, maybe someone can tell me a conversion step I'm missing:

Download regular USGS geotif from Topoquest
gdal_translate -expand rgba -co COMPRESS=LZW orginal.tif translated.tif
Open translated.tif in Photoshop, cut off the collar, save.
gdalcopyproj.py translated.tif prepared.tif

Do that for all of them

gdalbuildvrt temp.vrt *.tif
gdal2tiles.py temp.vrt tiles

P.S. I can merge them all smoothly with gdal_warp but on this group of 30 it is making a combined geotiff of 51223 x 65163 and on other sets there will be lots of wasted space when the source tifs are in a diagonal line but gdal_warp will create a rectangular output.


texts:
I have a cron job to run osmosis + osm2pgsql to keep my OSM database updated from https://planet.openstreetmap.org/replication/day/

Due to problems in my server I have lost two weeks of update, working back again yesterday.

Now I have a gap in my data. What can I do to correct this?


texts: Updating Street Features in QGIS from Google Maps

texts:
I am updating infrastructure layers in QGIS for a small municipality.

Everything is open source and there is no budget for buying new data.

I need to update the ROADS layer - as the one in the original database is well... absolutely terrible. Rather than fixing every feature to become workable with I want to just re-create the whole layer by digitizing in roads from a Basemap. My problem is that all of the basemaps used from the OpenLayers plugin seem to be out of date. I also tried using some WMS maps from StatsCanada (Its Canadian Data) and there are some roads missing.
The most accurate/updated data I am able to find is from maps.google.ca. I could do it the long/hard way by clicking on each point on google maps saying "whats here" to get the coordinates, then start a line feature at that point.. but that is a lot of going back and forth between my browser and my GIS program.

I was wondering if anyone has tried to take google maps (from maps.google) and use it as a basemap in QGIS - getting what you see on their main website not some old cached version from openlayers. OR if there is a better way to do this? (I thought about using a mapserver and digitize a KML layer on there then convert it to a shapefile and import into QGIS but that seems like a lot of extra steps as well..)


texts: I want to import DXF/DWG files in QGIS, therefore I use the import function. The problem is, that I have to know the crs of the CAD file. Is there any way to get the crs in QGIS, because I have no access to a CAD programm.


texts: I built a network dataset with HERE data using Street Data Processing Tools v10.3.1.1. The dataset built fine, but I'm seeing some issues with the route making a left turn onto a divided highway. I've looked at the area on Google Street View, and there is indeed a concrete barrier dividing the highway, which should prevent a left turn onto the highway. When I look at the attribute table, it appears to have the right values in the DIVIDER field. I cannot for the life of me figure out why the route doesn't seem to take into account divided roads.


texts: How to center a popup window exactly where I've clicked?

texts:
I have a question on how I can change this code

selectedFeature = feature;
popup = new OpenLayers.Popup.FramedCloud("chicken",
  feature.geometry.getBounds().getCenterLonLat(),
  null,
  div,
  null, null, onPopupClose);
feature.popup = popup;

to make the center point of popup window exactly where I've clicked, instead of on the center of object bounds as it is now ?


texts: How do I get geodatabase automatically upated from edits in access database?

texts:
I have an Access database that I have joined to a file geodatabase. There is a numeric field in the database that the symbology graduated colors is based on, ie: 0-39=red, 40-60 is orange, etc.

I am wondering what is the best way to update/edit the data within the access database (because these numeric values will change over time) in order to have it automatically update the attribute table/symbology colors in the file geodatabase. I just have Arcview 10 and Microsoft access.


texts: Create PostGIS trigger that splits lines

texts:
I have a table with LINESTRING where one condition is for lines to be composed of only 2 vertices. I want the user to be able to create, or import lines with more than 2 vertices, but upon feature creation, the line would be split into 2-vertices lines.

I have created a trigger function for this purpose, using an example from Paul Ramsey's blog.

This is the trigger function:

CREATE OR REPLACE FUNCTION check_vertex()
RETURNS trigger AS $BODY$
BEGIN
IF (ST_NPoints(NEW.he_geom))= 2 THEN
RETURN NEW;
END IF;

IF (ST_NPoints(NEW.he_geom))>2 THEN

INSERT INTO he_temp VALUES (NEW.*);

INSERT INTO he_temp (he_id, orientation, inclination, he_geom)
WITH segments AS (
    SELECT he_id, orientation, inclination, ST_SetSRID(ST_AsText(ST_MakeLine(lag((pt).geom, 1, NULL) OVER
    (PARTITION BY he_id ORDER BY he_id, (pt).path), (pt).geom)), 22780) AS geom
      FROM (SELECT he_id, orientation, inclination, ST_DumpPoints(he_geom) AS pt FROM he_temp) as dumps)
SELECT he_id, orientation, inclination, geom FROM segments WHERE geom IS NOT NULL;

DELETE FROM he_temp WHERE ST_NPoints(he_geom) > 2;

INSERT INTO horizontal_element (orientation, inclination, he_geom)
SELECT orientation, inclination, he_geom FROM he_temp;

TRUNCATE TABLE he_temp;

END IF;
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql;

The only way I found to implement this trigger is to insert lines with more than 2 vertices into a temporary table (he_temp), execute the split there and copy the split elements back to the primary table (he). After each insert, the temp table would be cleared.

I ran a few tests and it seems to work.

So my question is, is there a way to implement the same logic without using a temporary table, cause I have a feeling my implementation might have some issues, although I fail to see them at the moment?


texts: How to display MousePosition outside map container?

texts:
I am a new to OpenLayers.
By Default the MousePosition displays the coordinates within the map.

I need to display the coordinates outside the map is a specific place. How do I do this?


texts:
I'm trying to construct voronoi diagram from grid of points using modified code from here. This is SQL query after my modifications:

DROP TABLE IF EXISTS example.voronoi;
WITH
    -- Sample set of points to work with
    Sample AS (SELECT ST_SetSRID(ST_Union(geom), 0) geom FROM example."MeshPoints2d"),
    -- Build edges and circumscribe points to generate a centroid
    Edges AS (
    SELECT id,
        UNNEST(ARRAY['e1','e2','e3']) EdgeName,
        UNNEST(ARRAY[
            ST_MakeLine(p1,p2) ,
            ST_MakeLine(p2,p3) ,
            ST_MakeLine(p3,p1)]) Edge,
        ST_Centroid(ST_ConvexHull(ST_Union(-- Done this way due to issues I had with LineToCurve
            ST_CurveToLine(REPLACE(ST_AsText(ST_LineMerge(ST_Union(ST_MakeLine(p1,p2),ST_MakeLine(p2,p3)))),'LINE','CIRCULAR'),15),
            ST_CurveToLine(REPLACE(ST_AsText(ST_LineMerge(ST_Union(ST_MakeLine(p2,p3),ST_MakeLine(p3,p1)))),'LINE','CIRCULAR'),15)
        ))) ct
    FROM    (
        -- Decompose to points
        SELECT id,
            ST_PointN(g,1) p1,
            ST_PointN(g,2) p2,
            ST_PointN(g,3) p3
        FROM    (
            SELECT (gd).Path id, ST_ExteriorRing((gd).geom) g -- ID andmake triangle a linestring
            FROM (SELECT (ST_Dump(ST_DelaunayTriangles(geom))) gd FROM Sample) a -- Get Delaunay Triangles
            )b
        ) c
    )
SELECT ST_SetSRID((ST_Dump(ST_Polygonize(ST_Node(ST_LineMerge(ST_Union(v, ST_ExteriorRing(ST_ConvexHull(v)))))))).geom, 2180)
INTO example.voronoi
FROM (
    SELECT  -- Create voronoi edges and reduce to a multilinestring
        ST_LineMerge(ST_Union(ST_MakeLine(
        x.ct,
        CASE
        WHEN y.id IS NULL THEN
            CASE WHEN ST_Within(
                x.ct,
                (SELECT ST_ConvexHull(geom) FROM sample)) THEN -- Don't draw lines back towards the original set
                -- Project line out twice the distance from convex hull
                ST_MakePoint(ST_X(x.ct) + ((ST_X(ST_Centroid(x.edge)) - ST_X(x.ct)) * 2),ST_Y(x.ct) + ((ST_Y(ST_Centroid(x.edge)) - ST_Y(x.ct)) * 2))
            END
        ELSE
            y.ct
        END
        ))) v
    FROM    Edges x
        LEFT OUTER JOIN -- Self Join based on edges
        Edges y ON x.id <> y.id AND ST_Equals(x.edge,y.edge)
    ) z

Below - result of my query.

As you can see I get "almost" correct voronoi diagram, except highlighted points which don't have unique polygon. Below is what QGIS algorithm produce and what I would like to obtain from query. Any sugestions where is the problem with my code?


texts: Why does Transverse Mercator projection have scale factor?

texts:
Why does the Transverse Mercator projection have a scale factor in ArcGIS and the standard Mercator projection not?

In other words what is the difference between these two projections beside being a horizontal respectively vertical cylinder?


texts: multiple users on one wms layer - style and filter

texts:
I am using geoserver to show Points data from MySql in OL.
The data saved in one table for all the users - 'Points' with a geometry field and Id of the user.
I want to be able to let the users to see only their data, and also to style this features, but i didnt find any solution to filter or styling this data not from the geoserver panel.
I need to filter the data by the Id number of the user, and then he see only his data, it is possible to do it like this? from the js file?
if not, there is a other way to do it?


texts: How to make a change in the_geom_webmercator visible in the_geom in CartoDB?

texts:
I am having some trouble with the the_geom column and the the_geom_webmercator column in CartoDB. I have some SQL (which I modified from http://bl.ocks.org/andrewxhill/8695515) in which the the_geom_webmercator column is changed, but the the_geom column is not changed. This means that the changes to latitude and longitude which are visible in the map are not visible in the data, which is a problem. Below is the SQL:

with q AS (
  SELECT cartodb_id, the_geom_webmercator
  FROM untitled_table_7
  WHERE name= 'Rome'),
             m AS (
               SELECT count(*) n,
               array_agg(cartodb_id) id_list, the_geom_webmercator
               FROM q
               GROUP BY the_geom_webmercator),
             f AS (
               SELECT  n, generate_series(1, array_length(id_list,1)) p, unnest(id_list) cartodb_id, the_geom_webmercator
               FROM m),
              a AS (
             SELECT ST_SetSRID(
               ST_MakePoint(
                 ST_X(f.the_geom_webmercator) + f.p * 180 * cos(f.p * radians(301*ceil(f.n/20.0))/f.n), ST_Y(f.the_geom_webmercator) + f.p*180 * sin(f.p * radians(301*ceil(f.n/20.0))/f.n)),3857) the_geom_webmercator, f.cartodb_id
FROM f, untitled_table_7 t)
UPDATE untitled_table_7
SET the_geom_webmercator = a.the_geom_webmercator
FROM a
WHERE untitled_table_7.cartodb_id = a.cartodb_id

How can I adapt this so that the changes in the the_geom_webmercator column are shown in the the_geom column?


texts: Converting 5 digit serial date to mm/dd/yyyy using VBScript in ArcMap Field Calculator?

texts:
I have imported a table from Excel that has one field (StartDate) to hold dates.  When I imported the table it into ArcMap, the date values in that field changed from DD/MM/YYYY to a 5-digit number, e.g. 3/3/2010 now shows as 40240.  In ArcCatalog, upon inspection the properties of this field is now a string data type. This 5 digit number is a result of stripping away the Excel formatting and revealing the true absolute, or serial date value of this particular date.

Therefore, I want to use the field calculator to convert the 5-digit string values back into a readable date format, using VB.

I have created a new field (StartDateDT) (formatted to DATE) to house the converted (5-digit to Date) date values.

Using ArcMap 10.2.2 Standard license.


texts: Use GeoServer for serving custom layer parameters

texts:
We have a webGIS app based on a GeoServer back-end serving WFS layers and a web client based on OpenLayers.
For various purposes, in the client we have a config object for the layers such as:
const layers = {
    layer1: {
        id: 0,
        typename: 'workspace:layer_name',
        title: 'my title',
        geometryType: 'Polygon',
        maxResolution: 10,
        visibility: false,
        param1: true,
        ...
    },
    layer2: {}
    ...
}

Can this config object be served somehow by GeoServer? Is there a Geoserver plugin for that? The reason is that we'd like some admin be able to change some parameters in the GeoServer admin interface without editing a line of JS.
I saw that GeoServer can serve some data about the layers as a REST service (eg: http://localhost/geoserver/rest/layers.json). Another possibility would be to extend the "GetCapabilities" (http://localhost:8001/geoserver/workspace/wfs?service=WFS&version=1.1.0&request=GetCapabilities) of the WFS to have these parameters. The solution I found at the moment  is to put these parameters in the "Abstract" of each layer, so I can parse the WFS GetCapabilities request to build my config object, but this is a little bit crappy:
<Abstract>maxResolution: 10, visibility: false, param1: true</Abstract>


texts: Filling voids in ASTER stereo-images for DEM generation using ArcGIS Desktop?

texts:
I'm trying to use a stereo-pair of ASTER images to generate a DEM (in ERDAS Imagine). However, the mountains are rather cloudy and the images can't be used as they are. But the relevant parts (valley bottoms) are well visible.

I had this idea of cutting the cloudy parts from the stereo-images and inserting the SRTM (in ArcGIS). With this I probably could generate a DEM. But I'm not sure how much sense this makes because I would loose the stereo-view where I insert the SRTM (as I would have to insert the exactly same SRTM-DTM in both ASTER-images).

Do you think it makes sense to insert SRTM-data where there are clouds in ASTER?

Alternatively I could use a different ASTER-scene to insert where I have those voids in my original ASTER-set. But then probably there is the question of the viewing angle of the sensor, if it was not exactly the same, this idea is also useless..?!


texts: Creating edge and vertex identifiers for Python AddIn?

texts:
I can create multiple points using the add-in that I created. But the problem is, I don't know how to add edge and vertex identifiers to my tool (like in the picture).

Here is my code :

class ToolClass2(object):
"""Implementation for PPPpoint_addin.tool (Tool)"""
def __init__(self):
    self.enabled = True
    self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.
def onMouseDownMap(self, x, y, button, shift):
    fc = r"C:\Test\pourpoint.shp"

    pt = arcpy.Point()
    pt.X = float(x)
    pt.Y = float(y)

    ptGeoms = [arcpy.PointGeometry(pt)]
    cursor = arcpy.da.InsertCursor(fc, ['SHAPE@'])
    cursor.insertRow([pt])
    del cursor


texts:
I have generated a 'bubble' map in Carto:

Custom CSS:

#layer {
    [capacity >= 70000]
    {marker-width: 90;
    }
    [capacity >= 60000][capacity < 70000]
    {marker-width: 80;}
    [capacity >= 50000][capacity < 60000]
      {marker-width: 70;}
    [capacity >= 40000][capacity < 50000]
       {marker-width: 60;}
    [capacity >= 30000][capacity < 40000]
      {marker-width: 50;}
    [capacity >= 20000][capacity < 30000]
       {marker-width: 40;}
    [capacity <= 20000]
       {marker-width: 30;}
 marker-fill: teal;
    marker-fill-opacity: 0.5;
    marker-line-color: #FFF;
    marker-line-width: 1;
    marker-line-opacity: 0.8;
    marker-placement: point;
    marker-type: ellipse;
    marker-allow-overlap: true;
  }

However there is no option to create a bubble style legend. I have looked at several examples to use custom html to implement this, however none seem to generate what i am after.

The question - CartoDB choropleth + bubble visualization with two independent value ranges in legend seems to show what I am after but the code supplied does not seem to behave the same my end

  1.46

  18.5

I don't expect this to suddenly work with my data but I don't understand why I return:

Instead of:

Has the functionality of 'cartodb-legend bubble' changed at all?


texts: Moving from one Latitude and Longitude, to another point?

texts:
I don't really have a good understanding of GPS other than I know what Latitude is and what Longitude is, but I don't know how exactly to move between the 2 points.

First  point is Lat: 56.53515 and Lng: -111.53155
Second point is Lat: 54.13513 and Lng: -112.41244

How can I move between the two points, at say 1.3 meters per second?

This is for a program I'm working on, the 1.3m was just a random speed, and the coordinates were random as well. I would like to know how to calculate the distance between two points, so I can get the time it would take to travel that distance so I can increment / decrement the lat/lng at that speed until there.


texts: How to set the distance to label in pyqgis？

texts:
layer=iface.activeLayer()
label=QgsPalLayerSettings()
label.readFromLayer(layer)
label.enabled=True label.fieldName='NAME'
label.placement= QgsPalLayerSettings.OrderedPositionsAroundPoint
label.labelDistance=2
label.writeToLayer(layer)

I want to use label.labelDistance=2 to set it,but it no use.


texts:
I am currently attempting to load in 1000 data sets I have in 1000 different tables. I need to do this in Microsoft SQL Server.

My data sources are either in Excel or geodatabases. The plan is to download all the data sources and put them into one location. Once I have done this, I would directly like to set up some workbenches to load the data directly.

My question is what would be the most efficient way to create the SQL Server tables with the Geometry using FME. Then in the future, these tables will need to be continuously updated with the data. As there are so many columns with each data set, is there a quick and easy way to create the 1000 tables without much manual input.

At the moment, I have tried creating the tables individually by writing up SQL Script but is taking a lot of time to create. Are there any past examples I can base this on or transformers that can speed tthis process?


texts: QGIS Server dosen't answer a GetCapabilities request on Debian 8.3

texts:
Following the server install steps from Q-website and others mentioned,
after I install qgis-server & libapache2-mod-fcgid (and mod enabled),
QGIS Server should answer a GetCapabilities request:

Using my Firefox webbrowser=

  http://localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

which brings up a page stating:

  This XML file does not appear to have any style information associated
  with it. The document tree is shown below.

There's to much text to paste here, unless requested.

Am I mistaken to expect some kind of graphic output? NO instructions have described successful output of query.

Then instructs move on to adding a qgis project file.

  ..test the setup using “Add WMS Layer” in QGIS by adding the service
  URL such as http://localhost/cgi-bin/boundary/qgis_mapserv.fcgi and
  ticking “Ignore GetMap URI …” and “Ignore GetFeature URI …”.

Response:

  The server you are trying to connect to does not seem to be a WMS
  server. Please check the URL

A dead-end at every turn..with no "trouble-shooting" instructs included
or explained!

How do I serve maps on the web, using qgis-mapserver?


texts: Changing features of vectorlayer using PyQGIS

texts:
I am working on a QGIS plugin for which I am iterating over an inputlayer (point) and requesting a responselayer (polygon) for each inputfeature. The responselayer then contains several responsefeatures for each inputfeature.
I am trying to create a new vector layer having the geometry of each responsefeature and its attributes. Also the inputfeatures attributes shall be copied over.
So far I have managed to create the new vector layer and adding the inputfeatures x times to it. But I am struggling to set the geometry and attributes of it to the responselayer's ones.
This is my relevant code:
# creating outputlayer
Isochrones_Memorylayer_VL = QgsVectorLayer("Polygon?crs=epsg:4326", "Isochrones", "memory") # Create temporary polygon layer (output file)
Isochrones_Memorylayer_PR = Isochrones_Memorylayer_VL.dataProvider()
Isochrones_Memorylayer_VL.startEditing()
Isochrones_Memorylayer_PR.addAttributes(isochrones_selectedLayer.fields()) # Copy all fieldnames of inputlayer to outputlayer
Isochrones_Memorylayer_PR.addAttributes([QgsField("Isochrone_UID", QVariant.Int),QgsField("Isochrone_Error", QVariant.String),QgsField("Isochrone_URL", QVariant.String),QgsField("Isochrone_Time",QVariant.Int)]) # Add Error and URL Field to outputlayer
Inputlayer_outFeat = QgsFeature() # set QgsFeature

# iterating through input layer
for Inputlayer_Feature in Inputlayer_Features:
    # doing stuff
    # e.g. requesting response layer having several features for each feature of input layer

    # iterating through response layer
    for feat in Isochrone_Feature:
                Isochrones_Memorylayer_PR.addFeatures([Inputlayer_outFeat]) # Add attributes of inputlayer to outputlayer
                #Isochrones_Memorylayer_PR.addFeature(feat)
                #Isochrones_Memorylayer_PR.changeAttributeValues(feat.id(), 2, 30)
                #Isochrones_Memorylayer_PR['Isochrone_URL'] = str(isochrone_url)
                #Isochrones_Memorylayer_PR.changeFeatures(feat.geometry())

As you can see the second loop is a mess of a few things I have tried. I think the way to go should be changeAttributeValues and changeGeometryValues, but from the docs I have no idea how to actually use it. An example would help here. I already took a look at the cookbook. The only question with an example I can find is six years old and doesn't help solving my question. When trying the answer, I am getting TypeError: QgsVectorDataProvider.changeAttributeValues(): argument 1 has unexpected type 'int'. Maybe due to changes in the API? But since I am still a beginner in pyqgis it could also be some simple stuff.
How can I set the geometry of my new vector layer to the responselayers geometry and add the responselayers attributes (only "time", the other attributes like url, error, etc. are generic) to it?


texts: Sum the value of two raster files using Rasterio (Rasterio equivalent of Raster Calculator from ArcGIS)?

texts:
I'm trying to calculate the "real height" of a region, meaning I want to sum the elevation value and building height value, if there is any building, for a region.
I know I can simply use Raster Calculator in ArcGIS and do a rasterA + rasterB, but I'm wondering if I can do it using Python.
I have generated two input raster files for this step:
First, Elevation raster
import rasterio

file1 = r"L:\lvpcgis\BowenLiuTemporary\ExtendLinesToLayer\Starry\allentown_elevation.tif"

elevation = rasterio.open(file1)

show(elevation, cmap = 'terrain')

It shows up like this:

Second, Building raster with building height as pixel value:
file2 = r"L:\lvpcgis\BowenLiuTemporary\ExtendLinesToLayer\Starry\BuildingRasterTry2.tif"

bldg = rasterio.open(file2)

show(bldg)

It shows up like:

Now I'm wondering if I can add up these two layers so that the end result can reflect the sum of the values from the two rasters. It shall be doable but I haven't found any method online to achieve this with rasterio.
Other methods with Python will also suffice for me. I mentioned rasterio as it's the only module that I know can deal with raster files in Python.


texts: Communicate with QGIS 3D view via PyQGIS?

texts:
I want to automate setting parameters for the QGIS 3D map view window in my project, presumably using PyQGIS.
For the standard 2D map canvas, I can access iface.mapCanvas and use its various methods, but I can't find an analogous iface.mapCanvas3D or similar. My goal is to then use methods from https://qgis.github.io/pyqgis/3.16/3d/index.html to work with it, especially Qgs3DMapSettings and Qgs3DCameraPose, once I can get my hands on the right instance. How can I access it, or do something equivalent?
(I know from Call the QGIS 3D view using PyQGIS that I can't start the 3D view from PyQGIS, but I'd be fine just reading and modifying its settings once it's active.)


texts: Make Google Analytics city data showed on the Google map

texts:
I use the Google fusion table to table to mark city on google map, but there are about 20~25% which quality is ambiguous. How to make the ambiguous data precise?
Here is my finished map (scroll down to see map)


texts: Incorrect slope values for points in QGIS

texts:
I'm trying to determine the slope of sampling points in QGIS 3.4, but the values are all ~89.99°, which I know is incorrect. Pretty sure it's an issue when creating the slope raster.

Based on the steps detailed below, is it clear to anyone what I'm doing wrong?

My points and ⅓ arc-second USGS DEM are set to CRS EPSG:4269 - NAD83.

This is my DEM (with points).

I select Processing => Toolbox => Raster Terrain Analysis => Slope to generate the slope raster.

This is the output slope raster (with points):

Then I use the point sampling tool with the slope raster and points to generate the slope values. These are all ~89.99°, which isn't right.


texts: How to use ST_DWithin to query features from one table within a distance of a specific feature or features in another table

texts:
I'm pretty new with PostGIS. I have a parcel layer and a census block layer in a postgres database, and I would like to be able to query out all census blocks within a specified distance of a specific parcel. I found this example statement, but I'm not sure how to reference the specific parcel in the query, say by parcel ID?

SELECT roads.roadname, pois.poiname
FROM roads INNER JOIN pois
ON ST_DWithin(roads.geog, pois.geog, 1609);`

This example uses the geography type, but my layers don't have that. They are in EPSG 3857; can I use the geometry type and get accurate results?


texts:
Does anyone have any good examples of using Python to automate or simplify common surveying tasks?

I'm teaching a Python/ArcPy lab this week for a GIS class.  There are a number of surveying students in the class that think GIS is largely a waste of their time, and are only taking the course because it's required.  I want to give them something to be excited about.

A little context: Most of the students will probably be working for forestry or title companies when they graduate, and we are in Arkansas, so almost everything around here is based on PLSS.  So far, my thoughts are showing them the angular math functions and mentioning the couple of free Python-based CAD programs.  I've also learned there is a project to write a plugin for AutoCAD that provides a Python interface.

I've already taught the class, and as expected, the surveyors weren't too thrilled.  I'd still love to hear any good examples of using Python to facilitate surveying.


texts: How to merge selected features with different attributes in QGIS?

texts: I want to merge several features with attribute values that fall within a certain range. I use Select by Expression to select the relevant features, but when I click merge selected features, QGIS times out and ends up crashing. I think it's because the features have many attributes, which are different, and QGIS is not sure how to merge them. I thought I would be prompted with a window to define the attributes after the merge, but I guess not?


texts: arcpy.mapping.ListLayers returns inconsistent dataSource properties

texts:
ArcMap 10.3.1

It seems that the layer object returned by arcpy.mapping.ListLayers will have a full .dataSource property only in a brand new MXD. After changing the target version in the TOC, the same python returns an incomplete .dataSource and the .workspacePath property is empty.

Any suggestions? Could this be intended behaviour?

Steps:

1) create blank MXD

2) add data from Oracle SDE geodatabase

3) execute python to create layer object and print .dataSource property

4) change version in TOC

5) execute python again

mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
     print(lyr.dataSource)


texts: Stopping FME TINGenerator processing unwanted nodes

texts: I run an FME workbench quite often to convert .xyz point clouds to a LandXML TIN surface. I'm wondering if it is possible to stop the TINGenerator tool from processing the TINEdges, Triangles, and VertexPoints - all I actually need from the translator is the TINSurface. FME still needs to process through these other data types though before finishing the workflow. My only reason for asking is it seems that it might speed the process up. Screenshot of the workbench below:


texts:
I'm pretty new to GIS.  I have some files that seem to have been created using ArcGIS (I got them from here http://www.fao.org/ag/againfo/resources/en/glw/GLW_dens.html).

I would like to do some analysis on these maps, preferably using python.  I'm wondering if it's possible to use pyqgis to do this kind of thing.

I'm really just looking for some info to get me started.
e.g.

Is it possible to import these files into a pyqgis application?
Are there any tutorials that might help me get started?

The file types I see are .lyr, .aux, .avl, .dat, .nit, .adf

Here's a specific example of what I'd like to do.  Say I have two maps (map A and map B).  I think these are raster images, and let's say that the "colour" in a given cell in map A measures quantity qA. And likewise for map B.  Something simple I'd like to do is to produce a third map (map C) whose cells have quantities given by qC = qA*qB.


texts: How-to have tile actually looking bigger (Openlayers 3)

texts:
On small mobile screens, I'd like to display 384x384 "retina" tiles instead of 256x256, but also with the viewport scaled 1.5x.

Tile size handling with pixelRatio:1.5 works well, however the actual size on screen is the same.
Also, if I set

map.getViewport().style.transform="scale(1.5)";

Then the viewport is scaled, but tiles looks pixelized even if they are 384x384.
I'm looking for a magnifier here, magnifier that should display well with 384x384 tiles.


texts:
Do I need to re-install plugins after upgrading to 2.6?
Not all the plugins I had on QGIS 2.4 appear on 2.6.


texts: Filtering the atlas coverage layer by a different layer in QGIS

texts: I need to create one map atlas for each municipal administration filtering the coverage layer (red rectangles = map sheets) by municipal administrations boundaries layer (green polygons). How is it possible to solve this problem?


texts: Profiletool export error "global name 'os' is not defined"

texts:
I am using QGIS 2.18.5 and the Profiletool 4.0.2. plugin
I tried to save my profile to an .png file and this resulted with an error:

Traceback (most recent call last):
File "C:/Users/b/.qgis2/python/plugins\profiletool\ui\ptdockwidget.py", line 567, in saveAs self.outPNG()
File "C:/Users/b/.qgis2/python/plugins\profiletool\ui\ptdockwidget.py", line 587, in outPNG PlottingTool().outPNG(self.iface, self, self.mdl, self.cboLibrary.currentText ())
File "C:/Users/b/.qgis2/python/plugins\profiletool\tools\plottingtool.py", line 525, in outPNG wdg.profiletoolcore.loaddirectory = os.path.dirname(fileName)
NameError: global name 'os' is not defined

The same with exporting to .svg or .dxf

How can I fix it?

Profiletool 4.0.2. plugin (profile.py) itself already imports os:

import sys
import os
import time
import marshal
from optparse import OptionParser

However, I guess it is somehow correlated with it's predecessor - plottingtool.py which actually prints the error. The latter does not import os:

from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.core import *
from qgis.gui import *
from qgis.utils import *
import qgis

try:
    from qgis.PyQt.QtWidgets import *
except:
    pass

from . import resources
from .tools.profiletool_core import ProfileToolCore


texts: Seeking term for calculating variables within defined distance of point?

texts:
Imagine I have a dataset where each row is a single property with information like square footage, price, the lat/lon, etc. For each row, I would like to identify all other properties within a defined radius -- for example: 0.25 miles -- then, I want to calculate new variables from within that radius (like average square footage of all properties within 0.25 miles).

My hypothesis is that calculating variables in this manner will have more predictive power than using "panel data", for example, "Median income in the census tract" or "Average square feet in the neighborhood".

Basically, I would like to show one model with panel data, and another with explanatory variables calculated from a radius around each individual point, and compare the results of the predictive models (predicting, for example, the price of the property).

What is the correct term for this procedure?

Is there any recent research comparing the use of panel data to the above-described procedure?


texts: Assigning overlapping polygons based on attribute using ArcGIS for Desktop?

texts:
I am using ArcGIS 10.1 and have a polygon shapefile with 16000 records. There are many polygons that are overlapping and my goal is

to determine the overlap portions
fix the problem, so that there is no overlap between adjacent polygons (likely using dissolve)
ideally that the overlapped portion between the polygons is assigned to the polygon that has the older date, taken from the date column of the attribute table.

The graphic shows the details:

So far, I have succeeded with 1, detecting the overlap by using either union or running intersect on the original file (upper right portion in graphic).

Next I ran dissolve with the goal of merging the overlapped portion with the polygon that shares the same ID:100. This does not work; it does not dissolve the boundaries between the original overlap and the polygons. This really puzzles me, because if there are polygons with shared boundaries that have the same attributes and you use dissolve, should they not become the same polygon? All the attributes of the overlap and one of the polygons are identical, and I have used several different fields as well as all fields for the dissolve, all with the same result.

Using another approach, I created a separate shapefile that contains only the overlapped polygons. I then used erase on the original file to stamp out the overlap portion, which left me with a hole where the overlap was. I then tried to combined these 2 files (I tried merge, union, and update), thinking that I could then use dissolve on that result. However, the output from that dissolve is still the same, it does not dissolve the boundaries.

Because I did not succeed in the dissolve, I don’t even know how to attack 3, assigning the overlap to the polygon with the older data.


texts: Fill a field based on the selection from a domain of another field

texts:
I have 700 Unique values “Communities” and each one of this 700 unique communities has a unique reference. For example the community “Abc” has a reference “A001”, Now I have two fields in my attribute table the first one is CommunityName and the second is REF_Number this two fields should be filled.
The question now is there any method that allow me fill the field “REF_Number” based on my section form the domain of the communityName field to limit the errors and to avoid filling the data two times.
For example: If I select the community Abc form the domain list then the value of the field REF_Number should be updated automatically to A001.


texts: QGIS Layout: Script to create layouts based on "paper format" based paper format template

texts:
Currently we have two or some layouts for two specific paper formats (A3 en A0), these templates have some special settings, where they use some system variables including some variables in specific table that is loaded in as a layer into the project file. Mainly title, source of the map etc.**
But that made me think of something, would it not also be easier instead of duplicating these templates all the time that layouts are created with a script that use this table? This table currently has columns
these in these formats.

Now these are these variables are the one that we most intressting,
"Paper", choice between A0 and A3.
"Layout" is supposed the name of the layout and also the name of the theme
"Scale" is the scale of the map.
Other variables are being printed by expression so in the terms of constructing the layout there irrelevant on this script.
So here is the summary what the script has to do:

It creates a layout for each row in the table if the layout does not yet exist.
It chooses one of the two templates based on value of the "Paper" Column (the template layout is named the same as the Paper format.
Optional: It modifies the layout scale to the scale value in the column

Note there are two option I can see how this script works especial for point 2:

This script duplicates these template layouts existing in the current project, note in this format these layouts are not actually template they would just exist as two separate layouts..
This script looks at the template folder connected to this QGIS project and create a new layout based on those. Note though that the Templates are not called A0 and A3. But Sjabloon A0 and Sjabloon A3.

Considering the coding I believe that option 1 is the easiest. 2 may bring more trouble that it is worth.
So how do I do this?


texts: Selected Line feature to Buffer in Model Builder

texts:
How can I Create a model in arcgis model builder for Select one road(Line) from Road network and then create a buffer for that particular line feature.
there is a big road network and we want to select one particular road(Line) and then create a 100m buffer for that in ArcGIS Model...???


texts: How to run tilemill remotely via the web interface (ubuntu)

texts:
I have set up tilemill on my Ubuntu 12.04 machine using the commands:

sudo apt-add-repository ppa:developmentseed/mapbox
sudo apt-get update
sudo apt-get install tilemill
service tilemill start

Now I was able to access tilemill on http://localhost:20009. But whenever I tried
to access tilemill functions on the same machine using its IP from my other computer,
I get an error saying

Firefox can't establish a connection to the server at HOST_ADDRESS:20009

I have checked that firewall isn't an issue because other other ports such as 8080 hosted on the same server can be accessed correctly.

Any idea how to enable access to tilemill from a different computer?

Thanks


texts: Minimum ShapeLength using arcpy.Polyline?

texts: Please, i am creating lines using arcpy.array(point1,point2) --> arcpy.Polyline...but my ArcGIS create lines only with shape lenght 0.0002 and longer...why ?? I want to create also shorter lines cause my points are very close to each other. Is it something with arcpy.env.XYTolerance or Resolution? Thanks for your advices...


texts:
I'm trying to clip a raster layer with a vector layer, but openlayers seems to fail when it tries to call getImage on the vector layer?

What am I doing wrong?

proj4.defs('EPSG:3006', '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
ol.proj.proj4.register(proj4);
var geoJSONGeometry = {
    "type": "Polygon",
    "coordinates": [
        [
            [458243.52, 6249847.520000001],
            [457869.44, 6249619.040000001],
            [458086.72000000003, 6249146.400000001],
            [458601.92, 6249137.440000001],
            [458942.4, 6249697.440000001],
            [458243.52, 6249847.520000001]
        ]
    ]
};

var format = new ol.format.GeoJSON();
var olGeometry = format.readGeometryFromObject(geoJSONGeometry);
var osmLayer = new ol.layer.Tile({
    source: new ol.source.OSM()
});

var vectorLayer = new ol.layer.Vector({
    renderMode: 'image',
    source: new ol.source.Vector({
        features: [
            new ol.Feature(olGeometry)
        ]
    }),
    style: () => new ol.style.Style({
        fill: new ol.style.Fill({
            color: '#ff0000'
        }),
        image: new ol.style.Circle({
            radius: 10,
            fill: new ol.style.Fill({
                color: '#ff0000'
            })
        })
    })
});

var raster = new ol.source.Raster({
    sources: [osmLayer, vectorLayer],
    threads: 0, //todo: remove this limitation!
    operation: (pixels) => {
        if (pixels[1][3] == 0) {
            return [0, 0, 0, 1];
        } else {
            return pixels[0];
        }
    }
});

const resultLayer = new ol.layer.Image({
    source: raster
});

var map = new ol.Map({
    layers: [
        resultLayer
    ],
    target: 'map',
    view: new ol.View({
      center: [457847, 6249963],
      zoom: 14,
      projection: 'EPSG:3006',
    })
});

<link rel="stylesheet" href="https://openlayers.org/en/v5.3.0/css/ol.css" type="text/css">

JSFiddle

Edit: i get the following error imageSource.getImage is not a function and imageSource is the VectorLayer.


texts: Arcade expression to find minimum value that is not zero

texts:
I am trying to create an Arcade expression to calculate a field in ArcGIS Pro.
In my streets feature there are 4 number fields to evaluate. I can easily use the Min() function to do this. The problem that I am having is sometimes there is a 0 in one or more fields.  I need the lowest number that is not a 0. In python I had this script which worked well:

min([x for x in ( !L_F_ADD!, !L_T_ADD!, !R_F_ADD!, !R_T_ADD!) if x is not 0])

I have tried redoing this in Arcade but can't figure it out. Any ideas?


texts: Split Line at Points not splitting at every point in ArcGIS for Desktop?

texts:
Why does Split Line At Points not split at every point encountered, even if run in an iterative fashion?

Following the suggestions of a thread here and several others, I made a set of points in order to split polylines at specified intervals. In order to do this, I used linear referencing to turn my lines into routes. Then, I exported the attribute table, divided each length by 5, and set points at multiples of 1/5 the length of the line. I used this as the event table to create a layer of events. So, each line has 4 equally spaced points along it, and I thus ultimately need the 5 segments separated by those points.

Curiously, though, when I try to do the second part "Split Line at Point," it seems that only one point is used on a given line at a time, and I'm not sure how it chooses the point (maybe order in its attribute table?) I could run the tool multiple times, but this doesn't seem to solve the problem either. For example, I could see how it would continue splitting segments as more segments are generated, but on e.g. the 4th run I see that some lines are still only split 3 times, even though there is a point within a line segment that was never split and existed before I ran the tool. I'm not sure how the splits are generated, but in any case, it doesn't seem to do what I want it to do, which is produce a split at "each" point.

What should I do to split lines at ALL points along the line?


texts: OpenLayers 3 editing properties in application through form

texts:
I have a web page built with the QGIS webappbuilder by Boundless and the WFS-T widget.  Right now, the comments say that it only currently supports geometry updates.  I wanted to know if it would be possible to support properties (attribute) updates (i.e., non-spatial data in other columns).

Here is the code for the drawing:

{
key: '_onDrawEnd',
value: function _onDrawEnd(evt) {
  var wfsInfo = this._layer.get('wfsInfo');
  var feature = evt.feature;
  var node = this._format.writeTransaction([feature], null, null, {
    gmlOptions: {
      srsName: this.props.map.getView().getProjection().getCode()
    },
    featureNS: wfsInfo.featureNS,
    featureType: wfsInfo.featureType
  });
  this._doPOST(this._serializer.serializeToString(node), function (xmlhttp) {
    var data = xmlhttp.responseText;
    var result = this._readResponse(data);
    if (result) {
      var insertId = result.insertIds[0];
      if (insertId == 'new0') {
        // reload data if we're dealing with a shapefile store
        this._layer.getSource().clear();
      } else {
        feature.setId(insertId);
      }
    }

I have tried to add a properties argument in the writeTransaction line but I don't think I have the right syntax.  After digging through other forums and the OL3 API, I came across the setproperties command in the API.  Is it possible for a form to be generated with the OL library to update attributes as well with the setProperties command?

I saw similar post here: How do I set attributes when creating vectors using OpenLayers and WFS-T?

But it didn't seem to approach my end goal of having the user on the client end to input data as a form built from a GeoServer WFS request.

Another issue that I've been running across is that a lot of fixes involve using OL2, not OL3.


texts: Undoing last point when drawing linestring in OpenLayers 3?

texts:
I would like to be able to draw a linestring and to be able to undo the last drawn point when the key ESC is pressed.

I used that code when I first wrote my application :

  // create the interaction
  draw_interaction = new ol.interaction.Draw({
    source: vector_layer.getSource(),
    type: /** @type {ol.geom.GeometryType} */ ($geom_type.val())
  });
    // add it to the map
  map.addInteraction(draw_interaction);

  // when a new feature has been drawn...
  draw_interaction.on('drawstart', function(evt) {
    var feature = evt.feature;
    var geom = feature.getGeometry();
    document.addEventListener('keyup', function() {
      if (event.keyCode === 27) {
        if (geom.getType() === "LineString") {
          var coords = geom.getCoordinates();
          var len = coords.length;
          console.log("undo");
          if (len > 1) {
           geom.setCoordinates(geom.getCoordinates().slice(0, len - 1));
          }
        }
      }
    });
  });

You can see a live version on codepen following that link:

http://codepen.io/anon/pen/waPXyG

My problem is when I upgraded from 3.5.0 to 3.6.0, the behaviour changed :

http://codepen.io/anon/pen/LVOrrq

As you can see on the live example, when undoing (pressing ESC) it seems to be working but when you want to add a new point to the linestring, the points I removed are back in place. Looks like a caching behaviour as been added to 3.6.0

I hope someone can help me, it's either a regression or a api modification that I did not notice in the change log.


texts: How to use any ArcMap tool from a python script?

texts:
I'm trying to develop a tool that uses some of arcmap default tools like the Sketch Tool or Trace Tool. Is it possible?

Let me explain a little more, I need to draw a feature, ask for user input, and save the feature + data to the shape file, can it be done using python?


texts:
How can i get the Object ID for the last feature created ?
i use m_editEvents_OnSketchFinished() event to run some code, but i can't get the OID
of the most recent added feature.


texts: QGIS Cannot check validity or perform geoprocessing on layers imported from KML

texts:
I am using QGIS 2.18.13 on Windows.  I have imported some shapes from KML, and saved them to ESRI shapefiles layers.  I have tried to perform Vector > Geoprocessing Tools > Difference on some of the layers, but the results are either empty (if I check 'Ignore invalid input features') or an '1006 See log for more details' error.  When I View > Panels > Log Messages Panel, I see an 'Uncaught error while executing algorithm' error in some .py Python routines.

The shapes I am working with have the same CRS.  When I try to run 'Check validity' on the shapes, I get this error: '-2147483645 See log for more details' and again the log shows an 'Uncaught error while executing algorithm' error.

How can I make these into valid shapes that I can work with an manipulate in QGIS?


texts: generate 1-18 simple worldmap with mapnik

texts:
I have postgresql with postgis and mapnik, I need to generate a tiled world map with only country contours and country name that are displayed at all zoom levels, no extra info.

How can I do it without using osm2pgsql importing all the planet.osm (20gb)?

I generate a map using for example cyprus.osm but the area of Cyprus is now of course filled with additional information not required that slow down the generation process.

If i start the generate_tiles.py utility without use osm2pgsql I get many errors..
there is nothing like a void osm file?

How can I configure the map style to display only country contours and name, at all zoom levels?

Thanks very much!


texts: Click Handler not working on OpenLayers Map in Ubuntu

texts:
This is really strange as the problem seems to be persisting on the Ubuntu OS itself. I have created a WMS and it works fine on Mac and Windows, but not on Ubuntu.

I have a simple WMS which is returning the Lat & Long for the location on the map where the user does a single click. It seems that on Ubuntu (all the browsers), the map gets dragged when clicked once.

Is this a bug?? is it becoz i m using Ubuntu 12.04??


texts: Transferring SHP files from Pathfinder to ArcGIS for Desktop?

texts: Does anyone have step by step instructions to bring files from Trimble Pathfinder to ArcGIS 10.3.1 for Desktop?


texts:
I want to filter an OpenLayers(2) vector layer based on tags. Therefore, the vector layer has a property column which can be filled by comma-seperated tags like e.g. "culture,food,park", but also only one tag e.g. "food". I want to show all features who has one tag "activated" by respective jquery controlled buttons.

with only one tag per feature it is working with the following code:

tags = ['school','food','park'];

activeTags = [];
function fillArrayOfFilters() {
  activeLayers = [];
  $.each(tags, function(id, tag) {
    if ($('#' + this).hasClass('active') == true) {
      activeTags.push(tags);
    };
  });
  filters = activeLayers.map(function(tag, id) {
    return new OpenLayers.Filter.Comparison({
        type: OpenLayers.Filter.Comparison.EQUAL_TO,
        property: "tags",
        value: tag
      });
  });
}

function filter() {
  var filter = new OpenLayers.Filter.Logical({
    type: OpenLayers.Filter.Logical.OR,
    filters: filters
  });
  filterStrategy.setFilter(filter);
};

I know that there is a LIKE comparison in OpenLayers. But how can i use it in this case? I want something like that:

  new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.LIKE,
    property: "tags",
    value: *tag*
  });


texts: GeoDjango: read geometry column in geography field

texts:
I have a Django application that needs to work with an existent PostGIS database, apart from its own database. I've configured multidatabase support, created a database router, created models for the existent tables in the PostGIS database and told syncdb that, for that models, managed=False (so, it won't create the tables in the database, they already exist)

My problem comes because I need to create distance queries using one of those PostGIS tables. The table stores points objects with srid 4326, and I need to know how many of these points are within a given distance of a reference point (like ST_DWithin).

I'd like to use geography for the distance queries. So, I could define the geom field in the model that maps to that table with geography=True. But the problem is I just have read access to the PostGIS database. So, I can't change the column type to geography. I don't want to write a raw query, transforming the column to geography. Unless there's no other method. Is there a geodjango-friendly way to deal with this?


texts: How to read and write to .txt in layer properties, action tab?

texts:
I want to write a certain attribute to a .txt file using the action tab in the layer properties (combined with Hotlink).

In the QGIS-2.2-UserGuide, on page 97, there is an example on how to do that in Linux (see image).
What is the correct alteration of this for it to work in Windows?


texts: How do i save my tool arrangement at the top of arcmap when i close it?

texts: When I close an arcmap project and then reopen it, even though I save the mxd, the toolbar arrangement is not the way I left it. Is there a setting or some way to save my toolbar locations?