texts: Create Rubber Band with rotation using PyQGIS

texts:
To start I am going to be upfront, I am trying to add a feature to a QGIS Plugin Called instantprint. I am trying to add rotation to the tool so that you can align features to the print box and have them print in that orientation.
First I managed to successfully create a python function to capture the rotation value of the canvas and apply it to the map in the composer see below

from qgis.core import *
from qgis.gui import *
from qgis.utils import iface

@qgsfunction(args='auto', group='Custom')
def CanvasRotation(feature, parent):
    return (iface.mapCanvas().rotation())

This function can be used in the data defined rotation like CanvasRotation() so that your map rotation matches your canvas. This allows you to use your map rotation to set how you want the map to be aligned.

The issue I am into now is the Map box is defined by the extent of the Map view port which skewes due to the rotation. So I changed the rubber band def to incorporate the roation in hopes to resolve this.

Original Code:

 def __createRubberBand(self):
    self.__cleanup()
    extent = self.mapitem.extent()
    center = self.iface.mapCanvas().extent().center()
    self.corner = QPointF(center.x() - 0.5 * extent.width(), center.y() - 0.5 * extent.height())
    self.rect = QRectF(self.corner.x(), self.corner.y(), extent.width(), extent.height())
    self.mapitem.setExtent(QgsRectangle(self.rect))
    self.rubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.PolygonGeometry)
    self.rubberband.setToCanvasRectangle(self.__canvasRect(self.rect))
    self.rubberband.setColor(QColor(127, 127, 255, 127))

    self.pressPos = None

I added the rotation math to the self.corner = part to:

def __createRubberBand(self):
    self.__cleanup()
    extent = self.mapitem.extent()
    center = self.iface.mapCanvas().extent().center()
    self.corner = (QPointF(center.x - ((((((0.5)*(extent.width)))*((math.cos(iface.mapCanvas().rotation()))))-((((0.5)*(extent.width)))*((math.sin(iface.mapCanvas().rotation()))))))), (center.y - ((((0.5)*(extent.width)))*((math.sin(iface.mapCanvas().rotation()))))+((((0.5)*(extent.width)))*((math.cos(iface.mapCanvas().rotation()))))))
    self.rect = QRectF(self.corner.x(), self.corner.y(), extent.width(), extent.height())
    self.mapitem.setExtent(QgsRectangle(self.rect))
    self.rubberband = QgsRubberBand(self.iface.mapCanvas(), QgsWkbTypes.PolygonGeometry)
    self.rubberband.setToCanvasRectangle(self.__canvasRect(self.rect))
    self.rubberband.setColor(QColor(127, 127, 255, 127))

The plugin loads up but when I run it I get an error TypeError: unsupported operand type(s) for *: 'float' and 'builtin_function_or_method'.

I added all the imports I needed for the functions I am using, not sure what I did wrong. I checked my math a few times and didn't see any issues there but I might have missed something there are quite a few bracks. It almost looks like the results of the math are not what the tool is looking for.


texts: Avoiding R for Windows GUI front-end has stopped working error?

texts:
I am trying to load huge number of points (shapefile) in R. But when I load it, the program displays following error message and just stops.

"R for Windows GUI front-end has stopped working"

My OS is Windows 7 for 32 bit and R version is 3.1.0. I have tried on 2 different desktops with same OS and R version but both of them have same problems.

I have used below script.

#####-----------------------------------------------------------
##### Loading required packages # Also install packages
#####-----------------------------------------------------------
library(sp)
library(raster)
library(rgdal)
require(maptools)

#####-----------------------------------------------------------
##### Loading shape file    # All geographical files should be same extension
#####-----------------------------------------------------------
forest  <- readShapePoints("F:\\NDVI_MODIS_500\\Mod_ndvi_500_shapes\\mod_ndvi_500_grid_point_03_forest_steppe.shp")

Previous (forest) shape (point) loaded perfectly, but following shape (point)

could not to load because of this error. The only one difference between those

shape is the number of point. The 'steppe' contains large number of point to

compare 'forest' shape file.

steppe  <- readShapePoints("F:\\NDVI_MODIS_500\\Mod_ndvi_500_shapes\\mod_ndvi_500_grid_point_04_steppe.shp")


texts: Removing shapes on a mouse click - Angular 6

texts:
So I can remove a layer fine, and I can see how I can remove a feature(shape) by grabbing it's id lets say and populating the list of current features for the user to select.

But ideally I want to be able to select a remove button and then click on the feature(shape) that I'd like to remove.

I see that there are a couple of remove properties at my disposal one on the Shape object and one on the Modify object but can't seem to work out how to use them on a click event.

Edit ***

With the help of Mike the function at the moment looks like this

  removeShape(){
var layer = this.vectorLayer;
this.coreMap.map.removeInteraction(this.draw);
this.coreMap.map.removeInteraction(this.snap);
this.coreMap.map.on('click', function(evt: any) {
  this.forEachFeatureAtPixel(evt.pixel,
    function(feature) {
      layer.getSource().removeFeature(feature);
      return true;
    });
});
  }

I can console log the feature absolutely fine as well so it's selecting it, but despite passing it into removeFeature nothing appears to be happening.


texts: Exported georeferenced tif from QGIS composer (QGIS 2.16.1) does not contain "origin" or 'Pixel Size" properties

texts:
I would like to export a georeferenced tif from QGIS composer.  I am using QGIS 2.16.1 with windows 7 (32 bit).

In the composer export settings I have selected "Print as raster" and "Save World File".  I am using an export resolution of 96 dpi and an A4 page size.  When I use "Export as image" and use file formats including jpg, tif, tiff and bmp I obtain excellent raster images without a corresponding world file.  The QGIS documentation states that the "Exporting big rasters can sometimes fail, ..." but does not qualify what big means, or, what is meant by "fail".

In my situation a suitable raster is generated, but, it is missing the associated world file. My data is a topographic map containing vector layers only.  Although the generated image file is not accompanied by a world file, it contains the suitable "Layer Spatial Reference System" property, but is missing the "Pixel Size" and "Origin" properties.  From the same QGIS project file and the same "print composer" QGIS 2.14.3 outputs an image file that contains the suitable "Pixel Size" and "Origin" properties.


texts: Merging many rasters with Python script within QGIS using GDAL?

texts:
I have many rasters that im trying to combine in order to produce contours. They are in the .bil format so I understand that i need to translate them using gdal first but none of my attempts have worked.

I have tried to used gdal_translate and gdal_merge with no success.

import os
import sys
import gdal
chdir C:\Users\jeswa\Desktop\GAL
SDKShell.bat
chdir C:\Users\jeswa\Desktop\TESTY
dir /s/b *.bil >listbil.txt
gdalbuildvrt -input_file_list listbil.txt testscript.vrt
#error does not like N34025raster but passes 44 and 45
gdal_translate -of GTiff C:\Users\jeswa\Desktop\TESTY\testscript.vrt C:/Users/jeswa/Desktop/TESTY/VIRTUALTIFF.tif
#no such thing as gdal_translate apparently


texts: Commiting Changes (WFS-T) Problem with Base Layer (Error Found: outside of (-180.0,180.0))

texts:
Committing changes stops working after changing the basemap from OSM (as a WMS) to Bing maps (or Google or even OSM as a "OpenLayers.Layer.OSM")  PS: All my layers are on 3857
Here's the Error :

...
ext>org.geotools.referencing.operation.projection.PointOutsideEnvelopeException: -375375
.85085794 outside of (-180.0,180.0)
Parsing failed for LineString: org.geoserver.wfs.WFSException: org.geotools.referencing.operation.projection
.PointOutsideEnvelopeException: -375375.85085794 outside of (-180.0,180.0)
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException: -375375.85085794 outside
of (-180.0,180.0)
...

(See the screenshots)

...
store: new GeoExt.data.WMSCapabilitiesStore({
url:
"/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1",
autoLoad: true
}),
},
...
extent: OpenLayers.Bounds.fromArray([
-389443.8438372187,3795830.778190598 ,
-361613.60599175736,3828780.6685322397
]),

layers: [new OpenLayers.Layer.Bing({
name: "Bing Hybrid",
key: "AtiDbrNiSbYFAW0azuAZHQLgk5ULkZIOqWyKW4IfkY9q3uhDuCZh6Av7aOOUOs9Q",
type: "AerialWithLabels",
Projection : "EPSG:3857"
})
/*
new OpenLayers.Layer.WMS(
         "OpenStreetMap WMS",
        "https://ows.terrestris.de/osm/service?",
        {layers: 'OSM-WMS'}
        )
new OpenLayers.Layer.Google(
"Google Satellite", {
type: google.maps.MapTypeId.SATELLITE,
 numZoomLevels: 25
})*/],

});
...

text: "Save",
handler: function() {
    app.featureGrid.store.proxy.protocol.commit(
        vectorLayer.features, {
            callback: function() {
                selectedLayer.redraw(true);
                    app.featureGrid.store.reload();
                                    }
                                });
            }
}]});

    ...
var schema = new GeoExt.data.AttributeStore({
url: url,
baseParams: {
"SERVICE": "WFS",
"REQUEST": "DescribeFeatureType",
"VERSION": "1.1.0",
"TYPENAME": layer.params.LAYERS
},
autoLoad: true,
listeners: {
"load": function(store) {
app.featureGrid.setTitle(layer.name);
selectedLayer = layer;
configureGrid(store, url);
}
}
});

...

app.featureGrid.reconfigure(new GeoExt.data.FeatureStore({
autoLoad: true,
proxy: new GeoExt.data.ProtocolProxy({
protocol: new OpenLayers.Protocol.WFS({
url: url,
version: "1.1.0",
featureType: rawAttributeData.featureTypes[0].typeName,
featureNS: rawAttributeData.targetNamespace,
srsName: "EPSG:3857",
geometryName: geometryName,
maxFeatures: 25000,
})
}),
fields: fields
}),

...


texts: What are pros and cons of forcing square pixels on reprojection?

texts: I am using Erdas Imagine 2014 to reproject 4-band raster data from GRS 1980 NAD83 Lambert Conformal Conic (ft) to UTM GRS 1980 NAD83 North UTM Zone 11 (m).  Unlike ArcGIS, Erdas provides the option to reproject irregular cells (where x != y) or force square pixels on reprojection (where x = y).  What are the pros and cons of accepting the default irregular shaped cells versus forcing square pixels on the reprojection?  I am particularly interested in how these options could effect processing efficiency, accuracy and geoprocessing within ArcGIS.


texts: What CRS is my data being transformed to in ST_Project? What about ::geometry?

texts:
My understanding is that ::geography transforms data from whatever CRS into 4326. But what is ::geometry doing?
Relatedly, in the context of the ST_Project function:
st_project(a.geom::geography,b.recommended_radius,radians(a.azimuth))
which takes as input a Point (in 4326), a distance (in meters), and an azimuth (in radians), presumably there's a transformation of some kind happening to get from a Point(4326) to a distance (in meters) - is there a way of finding out more details about the function? The documentation is minimal.
Ultimately, the ST_Project function is nested inside of an ST_MakeLine function, then cast back to ::geometry (but without any specified CRS).
st_makeline(array[a.geom,st_project(a.geom::geography,b.recommended_radius,radians(a.azimuth))::geometry])
Finally, for context, I am drawing wedges around a given azimuth using this code:
st_intersection(
    st_buffer(
        a.geom::geography, b.recommended_radius*1000, 50
    )::geometry()
    , st_makepolygon(
        st_makeline(
            array[
                a.geom
                , st_project(a.geom::geography, b.recommended_radius*1000*2, radians(a.azimuth-a.sector_width/2))::geometry
                , st_project(a.geom::geography, b.recommended_radius*1000*2, radians(a.azimuth+a.sector_width/2))::geometry
                , a.geom
            ]
        )
    )
)


texts: The scale in Qgis is not setting to feet

texts:
I am working in QGIS 2.4. I have changed the CRS of all the layers and in the project properties to EPSG:102739 - NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet.

I am in print composer trying to create a scale bar and I can not figure out why the scale is so off. I am trying to go from feet to miles and it just creates a really long scale bar. Basically 1 mi = 5280 is what I am going for I have already checked each layer and they are all in state plane 4203. I am not sure what I am missing. I checked other threads about scale in QGIS and I am still at a loss. I have tried flipping the conversion around and its still not working.

Edit 2: Sounds crazy is there a difference between Qgis for Windows and for Linux. I loaded the exact same data(just copied and pasted the file with the map and data) to a windows computer. Opened it and everything works fine.

Edit: The answer given How to get correct scale values? does not address my issues. I have already done everything in that answer. All of my layers have been resaved with projection and the project projection has been changed.

Using scale bar units in QGIS composer?

What do I need to change to get scale bar units other than degrees?

Why does QGIS scalebar show a wrong scale?


texts: Backtransformation of kriging predictions and variances

texts:
I'm not sure how to back-transform log-normal kriged results. This example using the "meuse" data shows how to make variogram and use it to get kriging predictions (and variances) using the popular 'gstat' package of R. The last few lines show backtransformation from log-space to original concentrations just using the 'exp()' function. I read some articles confirming biased outcome of this approach. I was wondering if anyone exactly knows how to convert the kriged predictions and variances to unbiased original mean concentrations and standard deviations using R.

library(gstat)
library(sp)

data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)

#fit variogram
v = variogram(log(zinc)~1, data=meuse, meuse.grid)
m <- vgm(0.59,"Sph", 897, 0.05)
plot(v$dist, v$gamma, ylim=c(0,0.75), xlim=c(0,1600), xaxs="i", yaxs="i")
lines(variogramLine(m, maxdist=1600), lwd=2, lty=2, col=4)

# do the prediction by kriging
gridded(meuse.grid) = ~x+y
a <- krige(log(zinc)~1, meuse, meuse.grid, m)

#back transformation to original concentration space?
#predictions
exp(a$var1.pred)
#standard deviations
exp(sqrt(a$var1.var))


texts:
Since it's not available in Qgis 2, I'm trying to duplicate a composition with pyqgis translating this code from Qgis 3.
Duplication is fine, but every time I want to export an atlas of this new composition, qgis crash. Do you have any idea?

Here is a reproductible example of my code (using with python console and a small project):

from qgis.PyQt.QtXml import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtWidgets import *
from qgis.PyQt.QtCore import *

import os

def saveAsTemplate(composition):
    doc = QDomDocument()
    composerElem = doc.createElement(  "Composer"  )
    doc.appendChild( composerElem )
    composition.writeXML( composerElem, doc )
    composition.atlasComposition().writeXML( composerElem, doc )
    return doc

def duplicateComposition(composition):
    currentDoc = saveAsTemplate(composition)
    compositionElem = currentDoc.documentElement().firstChildElement( "Composition" )
    if compositionElem.isNull():
        print( "selected composer could not be stored as temporary template" )
        return None

    newComposition = QgsComposition(composition.mapSettings())

    if not newComposition.loadFromTemplate(currentDoc):
        print( " Cannot load template ")
        del newComposition
        return None

    return newComposition

myComposition = iface.activeComposers()[0].composition()
newComposition = duplicateComposition(myComposition)

atlas = newComposition.atlasComposition()
atlasLayer = iface.activeLayer()
atlas.setCoverageLayer(atlasLayer)
atlas.setPageNameExpression(atlasLayer.name())
atlas.setEnabled( True )
ret = newComposition.setAtlasMode( QgsComposition.ExportAtlas )
if ret is False:
    print "Error"

outputDir = "C:/temp/export_atlas"
atlas.beginRender()
print("atlas")
num = atlas.numFeatures()
for i in range(0, num):
    ret = atlas.prepareForFeature( i )
    if ret is False:
        print "prepareForFeatureror"
    printer = QPrinter()
    printer.setOutputFormat(QPrinter.PdfFormat)
    ret = newComposition.exportAsPDF(os.path.join(outputDir, str(i)+".pdf"))
    if ret is False:
        print "exportAsPDF"

atlas.endRender()


texts: Extracting set of values from raster and form new raster file using QGIS?

texts:
How to extract some values (eg: 2,7,42,132) from a raster and form a new raster file?

I need a file with specified values as 1 and the rest 0.


texts: buffer in spsample for distance between randomly selected points

texts:
I wanted to know if there is a way to add a buffer in the function spsample in the sp package.  I am randomly selecting points within 28 polygons and would like to specific a minimum distance the points can be from each other.  The examples I have found use the gBuffer function in the rgeos package, but if I am understanding the function correctly you need to supply gBuffer with a spatial dataset.  I do not have a spatial dataset since I am asking spsample to generate the random samples.

Code used to generate random samples:

library(sp)
  #iterate through all polygons in survey domain shapefile and select n points from each

allocation <- sapply(1:length(info2), function(i) spsample(info2[i,],
    n=info2$Total_N[i], type='random'))

s.merged <- do.call('rbind', allocation)

ids <- sapply(slot(info2, 'polygons'), function(i) slot(i, "ID"))

npts <- sapply(allocation, function(i) nrow(i@coords))

pt_id <- rep(ids, npts)

s.final <- SpatialPointsDataFrame(s.merged, data=data.frame(poly_id=pt_id))

#use over function to get strata number for each random point
strata_assign<-over(s.final,info2)

Information about info2:

class(info2)
[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"

R information
R version 3.2.1 (2015-06-18)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1


texts: The confidence level alfa value for spatial randomness with Ripley K and L function

texts:
I have a point set of the spatial distribution of twitter posts relevant to a certain event.

I would like to evaluate evidence for clustering or dispersion of points. This is usually performed by comparing the distributions of the observed values of Ripley K and L inhomogeneous functions to the theoretical values of a Poisson point process in which the events are distributed independently according to a uniform probability distribution over the region.

I did all computations in R using Kinhom Linhom functions and I compared the distribution with respect to the Poisson distribution I would also like to add the confidential interval (I applied plot(envelope(...) with 99 simulations) the problem that I am having is that I can not understand how much is the alpha value?

The help section of the R says  alpha = 2 * nrank/(1 + nsim) - but how much is the nrank, or how I can compute it(obtain it)?

Total number of the observations of the pointdataset is 154.


texts: SDM: Dealing with coarse environmental data

texts:
I wish to determine the most important environmental covariates controlling a species distribution.

I have a large collection of species presence data for a small survey area (e.g., 600 presence points for a 800 m survey area).

However, my environmental covariates are sourced from medium-resolution satellite data (e.g. 1 km cells).

This means that all of my 600 species presence points fall into a single 1 km cell of temperature, which will of course introduce a large bias.

Are there any approaches that deal with the issue of a high density of presence data within a small area being modeled against broadscale environmental data?


texts: ArcGIS Find and Replace attribute search error

texts:
I am editing a vector layer in ArcMap 10.1 in the attribute table the no data value for some of my fields is -1.7976931348623157e+308. I would like to replace that with 0.

I attempted to use the Find and Replace function in the Table Options using the following settings:

Find what: -1.7976931348623157e+308
Text Match: Whole field
Search: Down
Match Case: Unticked
Search Only Selected Field(s): Ticked
Replace with: 0

Clicking either Find Next or Replace All results in an error message:

Search error
An invalid SQL statement was used.
An invalid SQL statement was used. [Ground_Dissolve2]
An invalid SQL statement was used. [SELECT * FROM Ground_Dissolve2 WHERE (htMN = -1.79769313486232e+308)

What does this error message mean and how do I replace -1.7976931348623157e+308 with 0?


texts: How to write code for downloading a file in ArcGIS 10?

texts:
I have an offline database which has lat & long coordinates. The functionality I need to provide is to have a (latitude, longitude) point which will have country and city in it. Once the user has selected the location, user shall be able to download the shapefile to the user defined location.

I am able to design the GUI but don't know how should I do the download. It would be real great if you guys can explain with examples as I am new to Python. Or may be simple code.  I have to run this on ArcGIS 10.

The flow is like this:

Select the country ,
then select the city,
create shapefile,
then a button which can let the user download the shapefile.

I did try to implement http://code.activestate.com/recipes/496685-downloading-a-file-from-the-web/ but could not get through.


texts: In CartoDB, why can't I see my text item in the map view editor?

texts: I'm working in CartoDB on a map that is pretty much completed. I was editing a text item that I had added to the map, and I somehow moved it out of the editor screen and now cannot find it again (it has the data citation). I would assume that was deleted, but when I view my map on my organizations website where it is embedded, it is appearing in the original place. I need to edit the text item, though - any suggestions for how to locate it and move it back into the map view editor?


texts: Opening *.lyr file in QGIS without access to ArcGIS for Desktop?

texts:
Is there a way to open a *.lyr file in QGIS without using ArcGIS for Desktop?

I have no access to ArcGIS, so the solution explained in Adding Layerfiles (.lyr) to QGIS? is not an option.

I have a *.lyr file with a lot of information and it is not possible to reproduce it all by myself.


texts: How to save new drawing feature to my own WorldImage layer(only base layer)?

texts:
Recently, I have been learning geoserver and openlayers to construct my own indoor map. As I am going to build a indoor wifi location system so I need to create the map. I use Raster Data Sources -- WorldImage to create the stores in my geoserver, but it needs a .meta and a .prj to save the store. I just changed the default file usa.meta and usa.prj's name to the same name of my .png file.(I don't know whether it is a right or accepted way to do so, just try) Then a base layer finished, it can be viewed at the Layer Preview.

My target is to add a feature layer on the base layer in my browser from a html file. Inside, I use javescript to get the base layer from my geoserver and it can be displayed in the Firefox browser. After reading many tutorials, I can draw a OpenLayers.Layer.Vector above my base layer which has some rectangles to represent different stores in the supermark. Their attributes can be displayed after selecting the vector.

But how to save the vector layer which is a new layer created by in the javascript. I finally find two possible way. One is to create a layer programmatically bt using REST. But it seems a little difficult for me in few days. Another way is to load the feature layer from the geoserver which can be a real layer in geoserver or using OpenLayers.Protocol.HTTP to load from a XML/JSON file. I have tried the second way. The feature can be loaded from my customed XML but I cannot save changes to the XML file. Stuck here for a few days. Here is a good example on the topic: http://maps.peterrobins.co.uk/files/ol6.html

Hope I can get some help or ideas here. Thanks in advance!


texts: Missing columns opening GDB with GeoPandas/Fiona

texts:
I am trying to import a GDB file database table and convert it to a (Pandas) dataframe. I have been trying to do so using GeoPandas and Fiona. The problem is however that not all columns are being read, and I am not sure why not. I use the following simple code to read the file:

gdbfile = gdp.read_file("path_to_gdb", driver='FileGDB')

Alternatively, I've also used fiona.open() with the same arguments. These two methods do return all of the rows, but do not however return all columns. The 'objectid' column is not read, which I know is in there (when I open the same GDB database table using QGIS, it is included). When I print the GDB database-file's schema with Fiona, it returns:

{'properties': OrderedDict([('CAT_GEWASCATEGORIE', 'str:60'),
              ('GWS_GEWASCODE', 'str:10'),
              ('GEOMETRIE_Length', 'float'),
              ('GEOMETRIE_Area', 'float'),
              ('GWS_GEWAS', 'str:255')]),
 'geometry': 'MultiPolygon'}

and as you can see, 'objectid' is not in it. But when I print gdb.next() using Fiona, it includes 'id' (which content-wise is equal to the objectid):

{'type': 'Feature',
 'id': '1526148',                                               <--the 'objectid'
 'properties': OrderedDict([('CAT_GWS', 'Grassland'),
              ('CODE', '265'),
              ('GEOM_Length', 1362.792),
              ('GEOM_Area', 10739.457),
              ('CROP', 'Grass')]),
 'geometry': {'type': 'MultiPolygon',
  'coordinates': [[[(109397.83300000057, 439262.45899999887),
     (109396.84699999914, 439271.9699999988),
     (109396.09099999815, 439287.80900000036),
 ]]]}}                                                          #I've shortened the poly

When I transform the Fiona's object into a data frame, it is not included. Does anyone know how I can include 'objectid' in the data using GeoPandas (or Fiona)? I've been trying and searching, but can't find anything on this problem with reading GDB database tables. I've been trying to include the 'id' in the schema argument of fiona.open() but that didn't work for me either (though perhaps I did it wrong, I used the schema below and it seemingly ignored it and kept the old schema). I am new to the GDB database filetype.

{'type': 'str:10',
 'id': 'int',
 'properties': {('CAT_GWS', 'str:60'),
               ('CODE', 'str:10'),
               ('GEOM_Length', 'float'),
               ('GEOM_Area', 'float'),
               ('CROP', 'str:255')},
  'geometry': 'MultiPolygon'}


texts:
I am trying to code anything in the HTML coming from Qgis2web to center a popup in the screen when open it without having to scroll aroung the screen to see all info. Ej;

And I would like to see all info after the click:


texts:
I am working on a process to show location on the map along with its label. I have figured out the way to show the marker location but not the  but I cannot figure out the way to show the label.
Here is my code:
var positionFeature = new ol.Feature();
positionFeature.setStyle(new ol.style.Style({
    image: new ol.style.Circle({
        radius: 6,
        fill: new ol.style.Fill({
            color: '#3399CC'
        }),
        stroke: new ol.style.Stroke({
            color: '#fff',
            width: 2
        })
    })
}));
var labelFeature = new ol.Feature();
labelFeature.setStyle(new ol.style.Style({
    text: new ol.style.Text({
        font: '14px Calibri,sans-serif',
        overflow: true,
        text: item.item.val.NAME,
        fill: new ol.style.Fill({
            color: "#000",
        }),
        stroke: new ol.style.Stroke({
            color: '#fff',
            width: 3,
        }),
    }),
}))

Geocoordinates = ol.proj.fromLonLat([it.LONG, it.LAT]);

positionFeature.setGeometry(Geocoordinates ?
    new ol.geom.Point(Geocoordinates) : null);
view.animate({
    center: Geocoordinates,
    duration: 200,
    zoom: 10
});


texts: Adjusting for road surface in Network Analyst?

texts:
I'm building a street network dataset and want to adjust the speed limit of certain segments to account for road surface (paved vs. unpaved).

Are there any guidelines/rules for doing this (e.g. an unpaved road should be set to 5mph)?


texts: How to sequence points for GPS collection?

texts:
I have a large number of points representing assets that I need to field verify.  Their unique IDs reflect when they were created, which is not a good indicator of how close they are to each other.  How can I sequence these points in a logical order for exporting to a shapefile that will be transferred and updated on a Trimble GeoXH unit? I am using ArcGIS Desktop 10.3.1 with an Advanced License and have access to the following extensions: 3D, ArcScan, Geostatistical, Network, Publisher, Schematics, and Spatial Analyst.

I do not have a geometric network in place, and haven't had any success using the "Find Route" tool, probably because the points aren't addresses on a street.

My thinking is some kind of model that calculates the closest point from a defined starting point (Near tool), writes an n+1 integer to a sequence field, then iterates to select that next closest point and repeat the process.

I have very limited coding experience and am hoping there is an easy tool or small set of tools to use instead of having to code a large, complex model.


texts: QGIS-Feature "Generate band name with NetCDF EXTRA_DIM" - Which NetCDF attribute/variable does that refer to?

texts:
According to the changelog of QGIS, the feature "Generate band name with NetCDF EXTRA_DIM" was implemented already in version 2.4.
The description says:

The NetCDF provided extra dimensional information. This information provides metadata on each band. These metadata can be used to explain the name of each band. For example, the bands of a NetCDF file represents the temperature at a given depth. For the user, it is easier to select a band with depth information, rather than only the band number.

This functionality is exactly what I was searching for. However, I couldn't find any information, how this extra dimensional information is saved in the NetCDF. Usually, I create multi-dimensional NetCDFs using the Python-API. What is the naming convention and/or attribute, needed for this extra dimensional information, so that QGIS can make use of it?


texts: Styling features based on a custom rule using GeoTools

texts:
I have a Java swing app which loads lines shapefiles which represents a road system. I want to show the congested roads on this map with a separate style.

My current approach

I have two attributes in the shapefile for each line named "DesignCapacity" and "CurrentTraffic". I have a simple rule to check whether the DesignCapacity is less than the CurrentTraffic. The rule is attached to a Line symbolizer which draws the line in a separate color.

LineSymbolizer lineSymbolizer = sb.createLineSymbolizer();
Stroke stroke = sb.createStroke(Color.RED, 4);
lineSymbolizer.setStroke(stroke);
Rule rl = sb.createRule(lineSymbolizer1);
rl.setFilter(sb.getFilterFactory().less(
            sb.getFilterFactory().property("DesignCapacity"),
            sb.getFilterFactory().property("CurrentTraffic")));
FeatureTypeStyle ft = sb.createFeatureTypeStyle("Feature", rl);
style.featureTypeStyles().add(ft);

return style;

My objective

I would need to add the "DesignCapacity" and "CurrentTraffic" to a separate database thus removing the two attributes from the shapefile. In that case,

Can I use the existing rule based styling approach and set a filter? (Instead of shapefile properties, the values should come from database tables)
If styling is not the optimum approach, what would be the best way to achieve this?


texts: How to remove terracing from Civil3D GeoTIFF export?

texts:
I've received a GeoTIFF DEM that was exported from Civil3D and at every contour there is a distinct terrace created when I process an aspect or slope in QGIS with the GRASS plugins.

I've looked around a bit and I think this is related to the algorithm used to create the DEM on the Civil3D side (Inverse Distance Weighting method).  Are there parameters within Civil3D to prevent this? or Is there a way to process the terraces out after the file is created in QGIS?


texts:
Postal codes of  Brazil and another countries are oriented to distribution logistics, and  improvement of reliability in writing the postal addresses; but without much concern for the spatial correlation.

Old codes, with 5 digits, have good spatial correlations (national scale), but new codes, with 8 digits (street scale), no. It is a situation similar to the USA-zipcode.

So, the problem is: "What are the geometric principles and GIS techniques that I can use to generate a postcode coverage of my city at street scales?"

Important-1: the POSTCODE codes are defined only into a cadastral database, there are no geographical association. Each POSTCODE is associated to an street name, range of house numbers, and number parity.

Important-2: brasilian house-numbers have only 70% to 90% (depends of city) of spatial correlation, that is, 10% to 30% can not be interpolated, because they are "numerological" or not checked with the correct street metrics.


texts: How to assign custom fonts for the Dialog Box appearance?

texts:
I am developing a Toolbox for ArcGIS Desktop. All the work have been almost completed and I am writing the item description for the toolbox.
The description fonts are not what I want and I'd like to change the fonts. Here are my questions:

Is this possible to assign custom fonts for the Dialog box descriptions?
How can I do that in a way that sharing the toolbox does not ruin this? (Custom font appears for different users and computers)

P.S. I have read this article but I did not understand what to do.
http://resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/documenting_tools_and_toolboxes/changing_tool_dialog_appearance.htm


texts: Mapping & digitizing geographic features freehand?

texts:
I´m working on a project to map a colleague´s farm, and then ultimately digitizing that information to produce maps and signage.

To start, we´re focusing on a small agroforestry plantation. We want to capture the fenceline (borders which essentially form polygons), irrigation lines and the locations of a different types & species of trees.

Aerial imagery isn´t that great for this area and we need to be more precise than our GPS unit allows, so we´ve begun doing everything old-school: measuring tape, protractor, pencil & paper.

What´s the best way to make sure all of our lines and angles are accurate & true?

Fencelines around the area form a kind of  "hour glass" -shaped polygon, so nothing is really parallel nor perpendicular to anything else. Irrigation lines are more or less straight, with some variance following natural curvature, etc.

After we´ve made all the measurements and have everything locked in & drawn to scale, what sort of program is recommended to digitize (and geo-reference) everything?

I have no experience with AutoCAD, but I feel like it´s inevitable at this point.


texts:
I work in project of geocoding so Ii want to import the OpenStreetMap data. I created a database and name it Nominatim and I tried this command:

sudo ./utils/setup.php --osm-file morocco-latest.osm.pbf
--all –osm2pgsql-cache 18000 2>&1 | tee setup.log

It shows me this message:

CREATE DB
ERROR: database already exists ( pgsql : // @/nominatim)

Now when I delete my database Nominatim it shows this error message:

ERROR: unable to find /usr/pgsql-9.3/share/contrib/postgis-1.5/postgis.sq

BTW I installed postgres with all the packages.
Any idea what the issue is?


texts: Adding datetime to each band's metadata in a multiband raster using Python

texts:
I've created a multiband raster of individual rasters of temperature at different times over a period of two days using rasterio in the following way:
with rasterio.open('test.tif', 'w', **meta) as dst:
    for id, layer in enumerate(file_list, start=1):
        with rasterio.open(layer) as src1:
            dst.write_band(id, src1.read(1))

Using gdalinfo to evaluate test.tif reveals lackluster metadata for the bands.
Band 1 Block=69x3 Type=Float64, ColorInterp=Gray
Band 2 Block=69x3 Type=Float64, ColorInterp=Undefined
Band 3 Block=69x3 Type=Float64, ColorInterp=Undefined
Band 4 Block=69x3 Type=Float64, ColorInterp=Undefined

I've used this for adding a description to each band, but I have not found a way to add datetime to the metadata.
I've looked at this answer, but it only changes the description and doesn't add a new tag. Additionally, I would have to run it as a subprocess in python, and I'd prefer to do this entirely within python.
I've also looked at this answer, but using the tag TIFFTAG_DATETIME with gdal's ds.SetMetadata() is not working. It doesn't throw an error but when I view the metadata using gdalinfo or qgis nothing shows up.
Does anybody know how to add a datetime property to the metadata of a multiband raster using python?


texts:
I'm looking for a faster SQL that looks for any matches of multiple values in multiple fields. My current method is as so:

"ORDERNUMBER1" IN ('7006007', '30132084', '7005769') OR "ORDERNUMBER2" IN ('7006007', '30132084', '7005769') OR "ORDERNUMBER3" IN ('7006007', '30132084', '7005769')

This works, but I wonder if there's a faster way.

I've tried the SQL below but it doesn't work:

ANY ('7006007', '30132084', '7005769') IN ("ORDERNUMBER1", "ORDERNUMBER2", "ORDERNUMBER3")

as well as:

ANY ("ORDERNUMBER1", "ORDERNUMBER2", "ORDERNUMBER3") IN ('7006007', '30132084', '7005769')

This too fails.

Is there a way to select any of multiple values in multiple fields?


texts: Geocoding addresses including address cleaning and validation

texts:
I am tasked with building a geocoder (and in the long term reverse geocoder) from a local data I own. Since I am new to this and literature is relatively scarce, I would like to know what are some best practices.

For example, my input addresses are full address strings while my data is stored by field (ex: street, city, postcode ... etc). Should I instead manipulate the data such that it is also stored as strings of addresses or should I manipulate the input address (break it down from string to fields of address components)?

I am currently using elasticsearch which I have found to be very fast and robust. Does anyone recommend anything else?

Are there any techniques or literature I can go over to validate the address before searching them in data? Since human error is very common in geocoding one has to make sure the address string is clean.


texts: How to number points along a line consecutively

texts: I have a line and along this line I have different points which are max. 20m away from that line. Now I would like to number the points along the line, like shown in the grafic. Any suggestions how to achieve with QGIS or GRASS.


texts:
How do I create a ASCII remap if I want to reclassify values ranges such as the following:

0 - 200 > 5

201 - 400 > 10

etc..

I have tried it but it gives me this error


texts: Miller cylindrical projection - central meridian

texts:
I'm new to projections topics and I've got a question that may be silly, but I  hadn't found answer so far. I'm trying to use Miller's cylindrical projection for converting osm lat/lon to x,y values. I don't know how should I choose central meridian. It should be calculated for every transformation I make or I choose it once? What should be value of it?

I use this code to calculate miller's projection:

import sys
import math

lon = float(sys.argv[1])
lat = float(sys.argv[2])

x = lon # - CENTRAL_MERIDIAN?
y = 1.25 * math.log(math.tan(math.radians((math.pi/4.0) + (2.0/5.0*lat))))


texts: Based on what rule does Raster Calculator produce output when the input rasters are misaligned?

texts:
Taking into account the following assumptions:

we have 2 rasters (satellite images from different satellite platforms) of the same pixel size, same coordinate system, little bit misaligned, Snap to Raster environment variable is not defined

I apply a map algebra operation on them. Let's say I add them (arcpy.sa.Plus(raster1, raster2)).

The question is: based on what rule does the Raster Calculator algorithms choose which of the two input rasters the output raster will be aligned to.

Example:

Inputs: Raster1, Raster2

Map Algebra Operation: Raster1 + Raster2

Output: Result (aligned to Raster1)

Question: Why Result is aligned to Raster1 instead of Raster2, since I have not defined Snap to Raster environment variable?

The search I did in order to find an answer to that is based on ArcGIS online documentation, help tools inside ArcGIS desktop environment, gis.stackexchange, esri forum, as well as python files. In the latter case, I ended up dealing with built-in functions that are included in arcgisscripting.pyd where I don't have access.


texts: How do I convert longitude & latitude to a 3d (geocentric x,y,z) coordinate?

texts:
I'm interested in finding the centroid of a point cloud. I understand that to do this I need to convert latitude and longitude values to 3d coordinates, average them and then convert the resulting coordinate back to latitude and longitude (From a previous answer: https://gis.stackexchange.com/a/6026/8891).

How would I go about doing this (preferably in either QGIS or R)? Is there an appropriate formula which I can recreate in R or a function already available in QGIS?

The main aim of this is to identify the following: If each point in the point cloud was a person, and all the people had to travel (as the crow flies) to a single point, which point would minimise the total distance travelled by the whole group?


texts: How to change default path for ".qgis2" folder on Windows?

texts:
I'm working with Windows 8 32Bit OS and QGIS 2.8.2.

The QGIS default installing path for ".qgis2" folder is C:\Users\image95\\.qgis2. This directory stores several useful components like QGIS extensions, SVG images or cache.

I really want to move the location of this directory to my D: disk.

That's why I edited the qgis.bat file and I added the following line:

--configpath "D:\cci93\test_modify_config_path"

So, currently, my qgis.bat file is like that:

Unfortunately, my attempt did not seem to have the expected effect. When I restart QGIS and I install new extensions, the installation directory seems to always be C:\Users\image95\\.qgis2. Moreover, the extensions installed earlier are no longer available and usable.

Could you tell me the way to reliably and properly change the path of the directory ".qgis2"?


texts: How can I add individual geoprocessing tool, for e.g. buffer onto the toolbar in qgis?

texts:
I am no programmer so I do not understand how to create a plugin to add a button to the toolbar. Is there another simpler way to do so?

I only need a few tools from the ftools suite and do not want the whole list to confuse my students, therefore I'm looking for a solution to add only individual buttons to the toolbars.


texts: GDAL Python OGRFeature .GetGeometryRef vs .Clone().GetGeometryRef

texts:
Just recently I was trying to get the geometry of a polygon stored in an ESRI Shapefile. In the script I was trying to read the polygon as follows:

import ogr
path = "shape.shp"
ds = ogr.Open(path, 0)
layer = ds.GetLayer()
layer.GetFeature(0).GetGeometryRef().GetGeometryName()

which resulted in a memory access error.

I then tried this:

import ogr
path = "shape.shp"
ds = ogr.Open(path, 0)
layer = ds.GetLayer()
layer.GetFeature(0).Clone().GetGeometryRef().GetGeometryName()

Which worked.

Why does that work but not the other approach? Which of them is 'right'?


texts:
Suppose I have a points shapefile with a 'group' attribute, each value of which identifies a number of points (e.g. group=1 identifies points 1,3,6 and group=2 identifies points 2,4,5).

How can I create a buffer for each group that contains all the points belonging to that group?


texts: mapnik-vector-tile produces tiles with only one feature

texts:
I've written some C/C++ code to wrap mapnik-vector-tile and produce a mapbox vector tile from GeoJSON.

mvtc_return * mvtc_from_geo_json(const int tile_size,
                                 const char * geo_json,
                                 const char * layer_name,
                                 const char * mapnik_input_plugins_path,
                                 const int z,
                                 const int x,
                                 const int y)
{
  mvtc_return * rv = new mvtc_return();
  if (rv == NULL) return NULL;

  try
  {
    double area_threshold = 0.1;
    double simplify_distance = 0.0;
    bool strictly_simple = true;
    bool multi_polygon_union = false;
    mapnik::vector_tile_impl::polygon_fill_type fill_type = mapnik::vector_tile_impl::positive_fill;
    bool process_all_rings = false;

    mapnik::datasource_cache::instance().register_datasources(mapnik_input_plugins_path);

    mapnik::Map map(tile_size, tile_size, "+init=epsg:3857");
    mapnik::parameters p;
    p["type"] = "geojson";
    p["inline"] = geo_json;

    mapnik::layer lyr(layer_name,"+init=epsg:4326");
    lyr.set_datasource(mapnik::datasource_cache::instance().create(p));
    map.add_layer(lyr);

    mapnik::vector_tile_impl::merc_tile out_tile(x, y, z, tile_size);
    mapnik::vector_tile_impl::processor ren(map);
    ren.set_area_threshold(area_threshold);
    ren.set_strictly_simple(strictly_simple);
    ren.set_simplify_distance(simplify_distance);
    ren.set_multi_polygon_union(multi_polygon_union);
    ren.set_fill_type(fill_type);
    ren.set_process_all_rings(process_all_rings);
    ren.update_tile(out_tile);

    out_tile.serialize_to_string(rv->mvt);
    rv->return_code = MVTC_SUCCESS;
  }
  catch (std::exception & ex)
  {
    rv->mvt = "";
    rv->return_code = MVTC_FAILURE;
    rv->message = std::string(ex.what());
  }
  return rv;
}

The full code is available as a gist.
If it looks familiar, that's because it's mostly a copy of node-mapnik's addGeoJSON function. My problem is that given GeoJSON with multiple features, the vector tile produced seems to only include the first feature.

For example, given the following GeoJSON I would expect a vector tile with 3 features.

{
  "features": [
    {
      "geometry": {
        "coordinates": [[115.859553, -31.951733], [115.859679, -31.951774]],
        "type": "LineString"
      },
      "type": "Feature",
      "properties": { "name": "Wellington St" }
    },
    {
      "geometry": {
        "coordinates": [[115.844394, -31.944039], [115.844396, -31.944256]],
        "type": "LineString"
      },
      "type": "Feature",
      "properties": { "name": "Railway St" }
    },
    {
      "geometry": {
        "coordinates": [[115.849276, -31.938264], [115.849227, -31.93725]],
        "type": "LineString"
      },
      "type": "Feature",
      "properties": { "name": "Cleaver St" }
    },
  ]
  "type": "FeatureCollection"
}

However, the tile produced by this GeoJSON (and dumped to the console) is

�@x
foolayer(�name"
Wellington St"  ��

Admittedly I haven't rendered the tile, however given there is only one street name in the output, I'm fairly confident only one feature is included in the tile.

My question, therefore, is why is my code not producing a tile that includes all of the features in my GeoJSON?

EDIT

The critical piece that I neglected to include is that this was part of an FFI from Haskell, which was taking a C string (i.e. null terminated). As the MVT contained a null, the marshalling into Haskell land was truncating the string. This code does appear to work correctly.

Not sure if this question should now be deleted - happy to do that if advised.


texts: Split linear features when intersecting another (line, polygon, point) in PyQGIS?

texts:
I am new to QGIS Plugins and I got something that has stressed me a lot. I want to have a layer(Linear) split whenever it intersects another feature (in another layer). I have tried with the one at:

Split a feature when intersecting with a feature of another layer using PyQGIS/Python?

and it works well. However, I want to have it split the line and not the polygon. Any help?


texts: How to calculate RMSE of geographic coordinates?

texts:
I've been working on my project and I stumble upon how I can calculate the Root Mean Square Error (RMSE) of geographic coordinates.

What I have is a derived coordinates from processing LiDAR data and aerial images in ArcMap and I also have actual field-measured coordinates. But now I am lost on how I could measure the error between the derived coordinates and field-measured coordinates.

Any help?

Furthermore, is there a specific format of the geographic coordinates where I could calculate the error? I am currently using the DD format.


texts: Implement Basic Terrain Analysis（SAGA） by Python

texts: Basic Terrain Analysis is in Processing Toolbox of QGIS and it has many output results, like Channel Network, Drainage Basins, Valley Depth, etc. I just want to get Channel Network among these results. And as you know, this processing progress takes too much time and it can only deals with small area. So I am wondering if I can rewrite this processing tool. I went to the official website(http://www.saga-gis.org/saga_tool_doc/6.0.0/ta_compound_0.html ) to find out the detail description of this tool. But it didn't show me the way to implement this tool. So does anyone know how to implement basic terrain analysis. Or does anyone know the detail description of this tool.


texts: Decreasing distance between legend's items in R-- round 2

texts:
In response to the question posted here, Farid Cher provided a slick modification to choro.legend that enabled R users to control the amount of space inserted between legend colors and their description.  I am trying to use Farid's modification to choro.legend, but regardless of the value I set for the space_reduction attribute, I get the following error message:

Error in legend(x = px, y = py, legend = rep(" ", length(res)), fill = sh$cols, : 'text.width' must be numeric, >= 0

My function call looks like:

choro.legend(-85.80, 45.3, tneffort.shades, title='Trapnet lifts per year',  cex=0.6, bty="n", fmt = "%0.0f", space_reduction=4000)

Can anyone identify the source of the problem? Apologies to the community for initially posting this question as a comment to the original post.


texts: Determining the SRID of a dataset in PostGIS

texts:
Sometimes the dataset provides some information about its projection. For example, it can mention Horizontal_Datum_Name: North American Datum of 1983, Ellipsoid_Name: GRS1980, Geographic_Coordinate_Units: Decimal degrees.

How do you determine the SRID? Doing the following query does not seem to work all the time (like this query itself returns no result)

SELECT srid, srtext,proj4text
FROM spatial_ref_sys
WHERE proj4text ILIKE '%nad83%'
AND proj4text ILIKE '%grs80%' AND proj4text ILIKE '%longlat%';


texts:
I tried to access the WMS request through the ArcGIS Online which is published in geoserver. The WMTS request of the same data is coming fine without any issues. When i checked the geoserver log i'm getting a error like "could not reduce the grid geometry inside the valid area bounds".

The below screenshot shows the details of the error.

2019 -04-03 12 :27 :32, 759 ARN  [lite.gridcoverage2d]  - Could  not  reduce the grid  geometry  inside the valid  area  bounds :
Referenced Envelope [ - 53.0  :  37 .0, -85 .0  :  85.0]
Grid geometry isGridGeometry2D [Grid Envelope2D[1..2074, 0..1007],PARAM_MT["Affine",
PARAMETER ["num_row" , 3],
PARAMETER ["num_col", 3],
PARAMETER ["elt_0_0", 0 . 25],
PARAMETER ["elt_0_2", 702634 .125],
PARAMETER ["elt_1_1", -0 .25 ],
PARAMETER ["elt_1_2", 730837.625]]]


texts: How to batch export to PMF using ArcGIS 10.2 and VB.Net

texts:
I have modified a code I found online to batch export a series of map documents (mxds) to ArcPublisher files (PMFs). I have all the relevant licenses and the code does "work", the only problem is the resultant PMF's are all empty.

I think I know where the problem lies, in that I think the code may not (well most likely is) be reading the data in the MXDs.

I have included the code:

 Protected Overrides Sub OnClick()

    Dim pGxDialog As IGxDialog
    Dim pGxObjectFilter As IGxObjectFilter
    Dim anythingSelected As Boolean
    Dim pGxMaps As IEnumGxObject
    Dim pGxMap As IGxMap
    Dim pGxFolders As IEnumGxObject
    Dim pGxFolder As IGxObject
    Dim strStartingLocation As String
    Dim lngMXDCount As Long
    Dim sFullPathName As String
    Dim pGxObject As IGxObject
    Dim pGxMapPageLayout As IGxMapPageLayout
    Dim pPageLayout As IPageLayout

    ' input mxds
    pGxObjectFilter = New GxFilterMaps
    pGxDialog = New GxDialog

    With pGxDialog
        .Title = "Select input MXDs"
        .AllowMultiSelect = True
    End With
    pGxDialog.ObjectFilter = pGxObjectFilter
    anythingSelected = pGxDialog.DoModalOpen(My.ArcMap.Application.hWnd, pGxMaps)
    If Not anythingSelected Then
        MsgBox("Cancel")
        Exit Sub
    End If

    ' starting location, name
    strStartingLocation = pGxDialog.FinalLocation.Parent.Name

    ' output folder
    pGxObjectFilter = New GxFilterBasicTypes
    pGxDialog = New GxDialog
    With pGxDialog
        .Title = "Select output folder"
        .AllowMultiSelect = False
        .StartingLocation = strStartingLocation
    End With
    pGxDialog.ObjectFilter = pGxObjectFilter
    anythingSelected = pGxDialog.DoModalOpen(My.ArcMap.Application.hWnd, pGxFolders)

    If anythingSelected Then
        pGxFolder = pGxFolders.Next
    Else
        MsgBox("Cancel")
        Exit Sub
    End If

    pGxMaps.Reset()

    pGxMap = pGxMaps.Next
    Do Until pGxMap Is Nothing
        lngMXDCount = lngMXDCount + 1
        pGxMap = pGxMaps.Next
    Loop
    If lngMXDCount = 0 Then Exit Sub

    With My.ArcMap.Application.StatusBar.ProgressBar
        .Message = "Exporting MXD to PMF..."
        .MinRange = 0
        .MaxRange = lngMXDCount
        .StepValue = 1
        .Show()
    End With

    pGxMaps.Reset()
    pGxMap = pGxMaps.Next

    Do Until pGxMap Is Nothing

        ''''new
        Dim publisherengine As IPMFPublish3 = New PublisherEngine
        Dim publishersettings As IPropertySet = publisherengine.GetDefaultPublisherSettings

        pGxObject = pGxMap

        pGxMapPageLayout = pGxMap
        pPageLayout = pGxMapPageLayout.PageLayout

        sFullPathName = pGxFolder.FullName & "\" & pGxObject.BaseName & ".pmf"

        Dim App As IApplication
        Dim mapdoc As IMxDocument

        App = My.ArcMap.ThisApplication
        mapdoc = App.Document

        Dim pagelayout As IPageLayout = mapdoc.PageLayout
        Dim defaultview As IActiveView = mapdoc.ActiveView
        Dim settings As IPropertySet = publishersettings
        Dim relativepaths As Boolean = True
        Dim document As String = sFullPathName

        publisherengine.Publish(pagelayout, defaultview, settings, relativepaths, document)

        ''''end

        My.ArcMap.Application.StatusBar.ProgressBar.Step()
        pGxMap = pGxMaps.Next

    Loop

    My.ArcMap.Application.StatusBar.ProgressBar.Hide()
    MsgBox("ArcPublisher tool has completed exporting: " & lngMXDCount & vbNewLine & "to the following directory: " & pGxFolder.FullName, MsgBoxStyle.OkOnly, "Process completed successfully")

    My.ArcMap.Application.CurrentTool = Nothing
End Sub


texts: Processing Tools Help Documentation for QGIS?

texts:
I'm used to ArcGIS but am attracted to QGIS for its open source (free) nature.  At present I'm trying to use native QGIS processing tools and also script my own algorithms (was used to geoprocessing with ArcPy).

The main hurdle I find with QGIS is the lack of documentation on how to use the existing tools (something similar to ArcGIS Help website).  ArcGIS Help is excellent.  Usually a simple read through their description and examples for any given tool has me able to use it very quickly.  I realize Esri has the budget for this and QGIS is open source, free, and programmed by volunteers, but without good explanations on how to use QGIS tools how can one expect to master them as much as the ArcGIS tools?

Example:  ArcGIS Help's entry for their Add Field (Data Management) tool

Is there a book, a website, etc. where similarly helpful instruction is given on the tools available in QGIS and how to use them?

I am familiar with using "processing.alghelp(..tool name..)" in QGIS' python console, but the "help" results offer no real instruction on how to use the tools.


texts: Creating forest patches from land cover layer?

texts:
I have a land cover layer from which I've extracted the tree canopy class and set all values that are not tree to NULL. I've also converted it to a vector and exploded it to make single part features.

I want to classify each patch into "small" (being very small trees along streets or in fields), "medium" (groups of backyard trees clustered together/ in small parks) and "large" (legitimate forested areas such as town forest and the like).

However, there are some medium and large patches that are connected by a very small "bridge patch" resulting in humongous patches that should be a large and medium patch, respectively. It's a mostly residential area bordering public parkland so there is much more dense tree canopy than you see here (also a 6 sq mile area).

I have access to data like roads, town boundaries, etc. etc. No special data or anything not available publicly (from USGS or other sources). I do have the Spatial Analyst and Patch Analyst extension (among others) as well as an ArcGIS for Desktop Advanced License.

For a little visualization of the data I'm working with:

Edit:

I do have an update on this problem. For whatever reason, the issue with the buffer I mentioned above did not occur the second time I tried it and produced a layer that I then used to create the forest patches. I did try the thin tool to see what kind of layer it produced and ended up with something looking like it came straight out of Tron. I did try "expanding" this layer but I ended up losing much of the integrity of the original TC layer.


texts: I have a problem with overlaying two different scales vector files such as 1:10000 and 1:50000 in Arc Gis format .There is a shift with these two layers .When I overlay with these vector files in to rectified google images this shift can be seen clearly..If somebody can help me pls notice the method to adjust this shift .


texts: Detecting change between 4 series times polygons (shapefiles) in R?

texts:
I have 4 series times shapefiles (my shapefiles are Polygons), my shapefiles are  about urban(Urban land uses include: Agriculture,Built Up,Bare Land,Water), I want extraction change detection urban in 4 time series(years: 1990-2000-2006-2010).

How can I do change detection between 4 shapefiles in R?

Which book can i find more information about Change Detection spatial in R?


texts: How to download Sentinel2 L1C using AWS Python SDK (boto3)

texts:
The permissions for Sentinel2 L1C changed today

https://www.sentinel-hub.com/faq/how-will-access-permission-changes-aws-bucket-affect-users-accessing-data-directly-non-sentinel#

How can I send a 'requester pays' header when using boto3?

My previous code (below) which worked previously is now hitting a 403

  s3 = boto3.resource('s3')
  bucket = s3.Bucket(bucket_name)
  bucket.download_file(key, fpath)


texts: Pyqgis - selectedFeatures() doesn't seems to work

texts:
Qgis version : 2.18.1

I just want to print the ids of the selected features of a certain layer (I should specify that this layer is stored in a spatialite database), but even if I specified the correct one and manually selected features in it I can't access them via the console.

here is my code:

layer1 = QgsMapLayerRegistry.instance().mapLayersByName("Sites_atelier_vienne")[0]

selfeat = layer1.selectedFeatures()

and the result when I print :

print selfeat
[]

But my layer (and I checked, I have the right one in layer1) have selected features so I'm kind of stuck here.


texts: Classifying type of crop on satellite images using Python

texts: I'm trying to make a classification on the send with python, but logically I find all the vegetation that I don't care about. The even more serious fact is that if the species is not present in a homogeneous way it is difficult to use even the send.


texts:
I am trying to access a WFS using geotools. Access is working with version 1.0.0 and 1.1.0 without problems. Here my code:

// Conenction
String getCapabilities = WFSDataStoreFactory.createGetCapabilitiesRequest(new URL("http://demo.opengeo.org/geoserver/wfs"), new Version("2.0.0")).toString();
Map connectionParameters = new HashMap();
connectionParameters.put(WFSDataStoreFactory.URL.key, getCapabilities);
WFSDataStoreFactory dsf = new WFSDataStoreFactory();
WFSDataStore dataStore = dsf.createDataStore(connectionParameters);
// Layer
SimpleFeatureSource source = dataStore.getFeatureSource("maps:ne_10m_lakes");
// Features
SimpleFeatureCollection fc = source.getFeatures();
SimpleFeatureIterator iterator = fc.features();
while (iterator.hasNext()) {
    SimpleFeature sf = iterator.next();
    // dostuff
}

Using version 2.0.0 results in:

  Can't find a response parser factory for
  DESCRIBE_FEATURETYPE/'application/xml' Failed to execute request
  http://demo.opengeo.org:80/geoserver/wfs?REQUEST=DescribeFeatureType&VERSION=2.0.0&SERVICE=WFS
  Exception in thread "main"
  org.geotools.factory.FactoryNotFoundException: Can't find a response
  parser factory for DESCRIBE_FEATURETYPE/'application/xml'     at
  org.geotools.data.wfs.internal.WFSExtensions.findResponseFactory(WFSExtensions.java:106)
    at
  org.geotools.data.wfs.internal.WFSRequest.createResponse(WFSRequest.java:205)
    at
  org.geotools.data.wfs.internal.WFSRequest.createResponse(WFSRequest.java:38)
    at
  org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:445)
    at
  org.geotools.data.wfs.internal.WFSClient.internalIssueRequest(WFSClient.java:292)
    at
  org.geotools.data.wfs.internal.WFSClient.issueRequest(WFSClient.java:354)
    at
  org.geotools.data.wfs.WFSDataStore.getRemoteFeatureType(WFSDataStore.java:210)
    at
  org.geotools.data.wfs.WFSDataStore.getRemoteSimpleFeatureType(WFSDataStore.java:264)
    at
  org.geotools.data.wfs.WFSFeatureSource.buildFeatureType(WFSFeatureSource.java:348)
    at
  org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:356)
    at
  org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:325)
    at
  org.geotools.data.store.ContentFeatureCollection.(ContentFeatureCollection.java:80)
    at
  org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:583)
    at
  org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:114)
    at TestWFS.main(TestWFS.java:79)

Any suggestions?


texts: How to get the z(elevation) value from a rendered map at webgl(Qgis2threejs plug-in)?

texts:
I am interested at getting the z value at any lat and long i want. For example i have made a 3D map using Qgis2threejs plug-in and it showed the map rendered using three.js library. The elevation value data stored at the Export_Name.js i suppose that are the one i use to create the 3D. Now Qgis2threejs uses some function to create the elevation values between the given elevation values. What i need is either the function that Qgis uses to calculate them ;either some kind of getElevation() function so i can give the lat and long values and i get back the already calculated "z" value.

Any help??


texts: Applying coordinate systems and projections to unprojected images

texts:
I have a folder with many unprojected images (i.e. LocX_1_LocY_1.tiff  to LocX_32_LocY_32.tiff) which have a naming convention that is associated with a text file that has surveyed locations of the images (i.e. LocX_1, LocY_1, UTM_Easting, UTM_Northing to LocX_32, LocY_32, 499999.795400,4480849.220620).

I wanted to ask if Python GDAL could be used to apply a coordinate system and project the images to overlay the images and view them spatially on a map with ArcGIS?


texts: "AND" or "OR" in filterMetadata in Google Earth Engine

texts:
I would like to filter out only the leap years from my imageCollection using the 'system:index' property:

var polygon = ee.Geometry.Polygon(
        [[[-3.1929991656897982, 57.196020922235135],
          [-3.2808897906897982, 57.05289582927173],
          [-2.9732726031897982, 57.05289582927173]]]);

var chirps = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY")
            .filterDate('1981-12-31','2019-01-01')
            .filterBounds(polygon)
var leapYears1 = allYearsChirps.filterMetadata('system:index','contains',('2016' || '2012' || '2008' || '2004' || '2000' || '1996' || '1992' || '1988' || '1984'))

Is it just not possible to filter for multiple strings, or is there something I am missing?


texts: Importing several LiDAR (.las) files in GRASS using v.in.lidar?

texts:
I'm building a DEM of a terrain in GRASS and have 48 LiDAR (.las) files. I know I can do this by using
r.in.lidar (including the list of files as a .txt) and then r.fillnulls

However, I want to test how different it is to do the same process but using v.in.lidar and then interpolating with something like v.surf.rst as explained here

However, v.in.lidar seems not to accept the list of all .las files as r.in.lidar does, thus I'm forced to do this one by one. This is not only cumbersome, but I'm also afraid the quality of the output may not be the best in the borders between tiles.

I would rather avoid merging all my .las files in one, as this would be a very heavy file and I may not be able to use some functions in GRASS as explained here in Step 4.

Does anyone know how to efficiently (all files in one or few lines) import several .las files to GRASS as vectors so i can then interpolate them using v.surf.rst or similars?

Some further details of my problem

The point clouds have ground and non ground points, but they are classified and am using class_filter=2. In a 5m resolution grid the point density is around 15-20 points on average on each of them. I want to use the DEM for a flood model and to analyse vegetation height with the same LiDAR data (other classes). I think I need to perform the interpolation. The only way to have almost no gaps would be a >15 m resolution which is not acceptable for my problem. Although not preferable, I would be happy to use alternative software (as long as it is open source), if there was no possible solution in GRASS.

GRASS Version

GRASS version: 7.6.0
GRASS SVN revision: r73958
Build date: 2019-01-17
Build platform: x86_64-w64-mingw32
GDAL: 2.4.0
PROJ.4: 5.2.0
GEOS: 3.7.0
SQLite: 3.26.0
Python: 2.7.14
wxPython: 2.8.12.1
Platform: Windows-10-10.0.16299


texts: ModelBuilder inline variable does not change consecutively when iterating raster?

texts:
I am trying to create a model in ModelBuilder (ArcMap 10.2.2), where there is an iteration through rasters in a workspace, each raster is run through a formula in raster calculator and where the output name is dependent on the raster name. As you can see in the picture, I have put an invariable output name %Name%, which should change with each iteration, with a new name coming from the new raster. This does not work however, only the first two iterations change the name, then all following iterations uses the first created namespace.

E.g.: If the raster file names are 'a' through 'c', the model will create raster a and b and then overwrite all following raster onto 'a' namespace, overwriting the data.

I have also tried using the %n% and %i% variables, with the same result.

I have put all rasters in a workspace (geodatabase) that is another than the the currently active one, using ArcCatalog Import-->Raster Datasets... in ArcMap window. The raster file names does only have text and numbers, no spaces or special characters.

Model created in the ArcMap modelbuilder. There are so many arrows pointing to raster calculator because their values are used multiple times in the formula

Add.The problem with the model is that the generic variable "Workspace" don't work this way, see solution below

This post seems to have a somewhat similar problem, although it has not been resolved: Why does inline variable output overwrite occurs with Reorder fields tool?

I have also tried to set 'Name' as a precondition for Raster calculator.
I have been trying both running raster sets from Workspace (default and other geodatabase (gdb)) and from a Raster catalog, same results.
This happens even if I use other tools such as Clip, with Workspace as input for rasters.

I am using the following paths:

input: E:\kaosmapp\Magdalena Bulks\NDVI calc\NDVI_images
or E:\kaosmapp\Magdalena Bulks\NDVI calc\NDVI_calc.gdb (tried both)

output: E:\kaosmapp\Magdalena Bulks\NDVI calc\output\%Name%.tif

It gives the same result regardless if I add .tif or not for output file.


texts: Create Right of Way from Street Centerline file

texts:
I have a project where I would like to take all of the right of way areas in a county and categorize them based on type/ownership (state right of way vs. county vs. private and maintenance responsibility).  All of this information is already contained within the street centerlines layer.  Seems like the logical way to do this would be to create a right of way layer where I buffer the street lines out to the parcel edges and create polygons using a few chosen attributes of the street centerline data.

Currently, the closest I have come with my workflow is:

Buffer the Street Centerlines (Dissolved on Category, Type and Name)
Erasing using the Tax Parcels as the Erase Feature
Integrate Street Centerline Buffer to edge of tax parcel polygons  (this is
especially helpful to fill in cul de sacs and larger right of ways surrounding larger highways)
Snap the Centerline Buffer to the Tax Parcel Line (Edge snapping)

My issues with this, is the end result includes many overlapping polygons and the manual cleanup of data would take up quite a bit of time.  I cannot have overlapping areas, because acreage calculations would double count in those areas.

My assumption is that I'm not the first person to have a need to solve this problem--and that there is an easier, better way to attempt to do what I am doing. Logically, this doesn't seem like a difficult task...but when I put the processes together they just don't seem to be the best way to solve the issue. Does anyone have any insight into an easier way? Or can point me to somewhere where a similar task is being solved? I have done several searches for expanding out streetlines to polygon borders, but have not received any helpful results. I'm also likely making this way more difficult than it needs to be.

I'm currently going through the process manually to verify things are working properly, so I'm welcome to solutions that involve out of the box ArcGIS tools as well as ArcPy. I need to make this repeatable, so best case, I am able to write a script or create a model. Worst case, I heavily document this to put in the instructions of how to create the next instance of this report.


texts: Using Find your nearest type function with large dataset?

texts:
In a previous employment, I needed to display a "Distance to stockist" on our website. It would get your current co-ordinates (from a postcode or HTML5 geolocate) and then display a list of nearby stockists.

Because we only had about 150 stockists in our database, what I could do was:

Get each stockist from the database
Work out the distance to that stockist
Order the list by distance and display it

And due to the small numbers, it was quick and worked well.

However, I'm undertaking something similar now but instead of having 150 stockists to check against, I'm working with a much larger dataset - let's call it somewhere between 10,000 and 20,000 different locations.

I don't feel I can use the same approach because of the time it would take to retrieve the data, calculate the distance to each, and sort it.

So what can I do?

Information I have to me is:

The user's latitude/longitude co-ordinates
The latitude/longitude of each location
The Northings / Eastings of each location

I'm developing in C# with SQL Server 2014 Express. A solution in either C# or T/SQL will be fine.

I have just come across https://msdn.microsoft.com/en-gb/library/ff929109.aspx which I think will do what I need.


texts: Conversion of coordinates of "Bochum coordinate system"

texts:
I need to convert historic coordinate data into more recent Gauß-Krueger data. Specifically, I need to convert "Bochum coordinates" used till 1960 in the local coal mines into DHDN/Gauß-Krüger zone 2 (EPSG 31466, ID 2646).
Is there in QGis a tool (similar to that that seems to exist is ESRI ArcGIS) that I can use for this job?


texts: How to make SQL definition query in ArcGIS to show only unique values (hide duplicates)?

texts:
I have a vector file with field of type LONG. Some values of this field are duplicates.

Is it possible to make such SQL definition query in ArcGIS 10.3 to show only unique values without duplicates?

Example data: 1, 2, 3, 3, 3, 4, 5, 1, 6

What I want:  1, 2, 3, 4, 5, 6

Picture examples:

1) Before definition query:

2) After definition query:


texts: Band conversion from different landsat imagery (Landsat 5,7 and 8)

texts:
I am mapping mangrove areas over time (from 2003 to 2014 ) and thus use different Landsat imagery.
Band combinations Iuse and am satisfied with in Landsat 7 include band:

4,5,3
4,5,1
7,4,2

When using Landsat 5 or 8 these combinations look completely different.
Do I need, and if so, how to convert the bands when using a different Landsat?


texts:
I have a PostGIS table which I have stored the location of some viewpoint photographs. I would like to store the location of the photo file in a field, but when I add a file path in the attribute table dialog in QGIS, QGIS/PostGIS removes '\' and spaces from the path.

Can anyone help me work out why this is? I have done this before without any issues.

If I enter the data through pgAdmin it comes across to QGIS correctly, and I can link to the photographs.


texts:
Is there a standard way of referring to a repeat-swath of a Sentinel-2 MSI acquisition?
For example the swath shown in the figure below is repeated every 5 days.

(Here it is further split in to component UTM Tile/units.)

For Landsat-8 there is an implicit repeat-swath identifier in the WRS-2 Orbital path number. I can't see a mention of such an identifier  in the Sentinel-2 Handbook


texts: Setting transparency color in Expression Builder

texts:
Using QGIS 3.16, I am trying to set color through expression builder, using #RRGGBBAA format.
The problem, I was using the same color, let's say '#94AFDCff', it should return the same color as '#94AFDC' in #RRGGBB format, yet the color that is rendered is fully different. I cannot seem to find out why.
Could anyone help?
The code is simple, it is used in symbol, as a condition of fill colors of circles.
CASE
    WHEN   "Cat_Num" = 1 THEN '#94AFDC66'
    WHEN  "Cat_Num"  = 2 THEN '#FFFF0066'
    WHEN  "Cat_Num"  =  3 THEN '#ffc40366'
    WHEN  "Cat_Num"  =  4 THEN '#54823566'
    WHEN  "Cat_Num"  =  5 THEN '#7030a066'
    WHEN  "Cat_Num"  =  6 THEN '#843c0c66'
    WHEN  "Cat_Num"  =  7 THEN '#38c0f666'
    WHEN  "Cat_Num"  =  8 THEN '#CCCC0066'
    WHEN  "Cat_Num"  =  9 THEN '#C55A1166'
    WHEN  "Cat_Num"  =  10 THEN '#8d5a9966'
    ELSE 'pink'
END

but this code resulted in (notice that the 2 circles are "Cat_Num" = 8 THEN '#CCCC0066' and "Cat_Num" = 10 THEN '#8d5a9966')

In the end, I did change the code to rgba format, so that "Cat_Num" = 8 THEN '204, 204, 0, 90' and "Cat_Num" = 10 THEN '141, 90, 153, 90'
with this result:

How are these 2 so different?? The hex color returns pink result for "Cat_Num" = 8 THEN '#CCCC0066' (the bigger circle). The smaller circle, which should return purplish, became greenish... Did I make a mistake?
As a reference, in QGIS' own color picker, inputting '#CCCC0066'  will have the same color as '141, 90, 153, 90', only different transparency value (90 is about 0.65% for RRGGBBAA and 66 in hex is 40% )


texts: Reading TIFF file using ArcPy with ArcGIS Pro

texts:
I have trouble when I try to set null some value, when I try this code, it didn't do anything or exporting any file. I run this code on Python ArcGIS Pro and when I import the ArcPy and os it seems ok.
import arcpy
import os
#inputcloudmask
arcpy.env.workspace = "E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask"

path = "E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask"

raw_name = os.listdir(path)
rname: str
outname = []
for rname in raw_name:
    portion = os.path.splitext(rname)
    temp_name = 'filter' + portion[0] + '.TIF'
    outname.append(temp_name)

rasters = arcpy.ListRasters("QF*","TIF")
i = 0
for raster in rasters:
    Oname = outname[i]
    i = i + 1
    outSetNull = arcpy.sa.SetNull(raster, 1, "VALUE <> 32 And VALUE <> 34 And VALUE <> 36 And VALUE <> 42 And VALUE <> 48 And VALUE <> 50 And VALUE <> 52 And VALUE <> 58 And VALUE <> 1056 And VALUE <> 1058 And VALUE <> 1060 And VALUE <> 1066 And VALUE <> 1072 And VALUE <> 1074 And VALUE <> 1076 And VALUE <> 1082")
    on = "E:/aa/TUGAS AKHIR/VNP46/2018/1 Juni 2018\output" + Oname
    outSetNull.save(on)
    print(raster + "---->" + Oname)

This is the file in my path (E:\aa\TUGAS AKHIR\VNP46\2018\1 Juni 2018\QF Cloud Mask)

What is wrong with my code?


texts: Can't install QGIS 1.7.4/1.8 after system update

texts:
After a routine system update my QGIS got lost (xubuntu 12.04). After trying to reinstall 1.7.4 this message appears in Softwarecenter (German):

Die folgenden Pakete haben nicht erfüllte Abhängigkeiten:

qgis: Depends: libc6 (>= 2.4) aber 2.15-0ubuntu10 soll installiert werden
      Depends: libgcc1 (>= 1:4.1.1) aber 1:4.6.3-1ubuntu5 soll installiert werden
      Depends: libgsl0ldbl (>= 1.9) aber 1.15+dfsg-1build1 soll installiert werden
      Depends: libpq5 (>= 8.4~) aber 9.1.3-2 soll installiert werden
      Depends: libqt4-network (>= 4:4.5.3) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqt4-sql (>= 4:4.5.3) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqt4-svg (>= 4:4.5.3) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqt4-xml (>= 4:4.5.3) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqtcore4 (>= 4:4.7.0~beta1) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqtgui4 (>= 4:4.6.1) aber 4:4.8.1-0ubuntu4.1 soll installiert werden
      Depends: libqtwebkit4 (>= 2.2~2011week36) aber 2.2.1-1ubuntu4 soll installiert werden
      Depends: libstdc++6 (>= 4.6) aber 4.6.3-1ubuntu5 soll installiert werden
      Depends: qgis-providers (= 1.7.4-1~oneiric1) aber 1.7.4-1~oneiric1 soll installiert werden
      Depends: qgis-common (= 1.7.4-1~oneiric1) aber 1.9.90+git20120511+6678c75~precise1 soll installiert werden

After trying to install QGIS in terminal, that appears:

root@MAP-PC:~# apt-get install qgis
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
nicht erstellt wurden oder Incoming noch nicht verlassen haben.
Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 qgis : Hängt ab von: qgis-providers (= 1.7.4-1~oneiric1) soll aber nicht installiert werden
        Hängt ab von: qgis-common (= 1.7.4-1~oneiric1) aber 1.9.90+git20120511+6678c75~precise1 soll installiert werden
        Empfiehlt: qgis-plugin-grass soll aber nicht installiert werden
        Empfiehlt: python-qgis soll aber nicht installiert werden
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.
root@MAP-PC:~#

Seems, some dependencies are missing, but that makes no sense for me! The same happened with qgis-masters.

What am I doing wrong?

Thanks!
Martin


texts: Invalid geometry message when using Difference tool

texts:
I am using the Vector \ Geoprocessing \ Difference tool to get the resulting area when taking a) current ground disturbance away from b) historic total ground disturbance to give c) what has been cleaned up over the years. I have a maximum of 41,000 nodes in the larger file (b).

I've run the geometry validity checker and noted 4 duplicates. All else seems ok. However when I run the tool I get an invalid geometry error message and only get about 70% of the polygons I expect to get. The OGR log says for these says "Pointer 'hLayer' or 'hFeat', is NULL in 'OGR_L_CreateFeature'. I've done this in MapInfo with these polys with no issues (the files have been brought as .TAB's).

Are there any other tools / checkers to use? I would assume the Check Geometry Validity would pick up problems or is this limited?

I note a bug #9152 was logged last year for a similiar issue. How do I find out where this is at / status and what I can do about it? Thanks.


texts: Convert polyline with Left ID and Right ID to polygons with ID

texts:
I have a polyline shape file which contain Left Id and Right ID information and struggling in converting this polyline layer to polygon with ID via arcpy.

I am using ArcGIS(editor) license so feature to polygon tool is not available to me. I also know there are number of methods available like this and this one in ArcGIS if you have editor license but i want to use arcpy to automate my workflow.

Any ideas how i can do it using arcpy?


texts: How to use Field Calculator on 1 to Many Join and keep most recent

texts:
I have a Hydrant layer and a hydrant inspection table.  So when I join them, it is a one to many join since there are multiple inspections for one hydrant.
I need to populate a field in the hydrant layer with the inspection data.  However, I only want to populate the hydrant layer with the most recent inspection for a given hydrant.
How do I do this?
I'm hoping for a Python or arcade script to run. I just don't know where to start.
I've thrown around doing a summary table first... but it's just too many steps for me to feel comfortable handing that off to a client, so I'd rather have a script for them to run.


texts: Acceptable traverse field file syntax for processing on Copan, with azimuths reckoned from south

texts:
I'm looking for a way to properly process .RAW traverse data from Nikon DTM on Copan 11.11. These points, after calculations and processing, will later be used as points in a thematic map and a .dwg file.

I kept getting an invalid at-station error when I try to plug in my data in the Calculation-Process Field Data UI window as follows:

Azimuths are reckoned from the South.

I also tried loading the sample data for 2D and 3D closed traverse computations from the Copan 11.11 manual (http://www.underhill.ca/software/manuals/windows/User%20Manual.pdf)  pages 5 to 7. But they did not work either.

After three attempts of editing my raw input file to match the specified format on the manual, I still get an error that refuses to process my data from Nikon. I also have another Total Station raw data that I need to edit in an acceptable format for the field file portion of Copan because it is not organically supported by Copan (this other set of data is not taken from Leica or Nikon).

At this point, it might help to have a live sample of a pair of .pts file and field file in .raw, .f, .fld, or .txt format that I can load to Copan 11.11. I just need to see what a field file looks like so that I can pattern my current inputs accordingly and eliminate the errors such as "Invalid assertion", "Invalid at-station", "Invalid to-station", and "No Observation".

I already tried looking for sample raw data online that has been tested to work with Copan but I have not found any, so far.

My other option is to encode all my existing raw data manually or line per line using Copan's other options in the Calculation menu. But given the volume of the computations that I need to make under the deadline, it might not be a feasible option.


texts: Export PDF from a folder having multiple single mxd and mxd's having data driven pages

texts:
I have folder having multiple single mxd and mxd's having data driven pages. I am trying to get the pdf's of each of these MXD's.if mxd's has a data driven pages then all the pages from a same mxd document needs to save in a single pdf.  What part of the below mentioned script will change so that it will consider the data driven pages.Right now this script is only exporting pdf from multiple single mxd document and not considering data driven pages. Need your suggestion for the same!!

>>> #Multiple single MXD's and Multiple datadriven pages in a single folder.

import arcpy, os

#Read input parameter from user.
#path = arcpy.GetParameterAsText(0)
path = r'Z:\Tier3\TrainControls\NonReportSpecific\2015_FINAL_PresentationMaps\MXD\REVISED\test'

#Write MXD names in folder to txt log file.
writeLog=open(path+"\FileListLog.txt","w")
for fileName in os.listdir(path):
    fullPath = os.path.join(path, fileName)
    if os.path.isfile(fullPath):
        basename, extension = os.path.splitext(fullPath)
        if extension == ".mxd":
            writeLog.write(fullPath+"\n")
            mxd = arcpy.mapping.MapDocument(fullPath)
            print fileName + "\n"
del mxd
print "Done"
writeLog.close()

#exportPath =arcpy.GetParameterAsText(1)
exportPath = r'Z:\Tier3\TrainControls\NonReportSpecific\2015_FINAL_PresentationMaps\MXD\REVISED\test'
MXDread=open(path+"\FileListLog.txt","r")
for line in MXDread:
    #Strip newline from line.
    line=line.rstrip('\n')
    if os.path.isfile(line):
        basename, extension = os.path.splitext(line)
        newName=basename.split('\\')[-1]
        if extension.lower() == ".mxd":
            print "Basename:" +newName
            mxd = arcpy.mapping.MapDocument(line)
            newPDF=exportPath+"\\"+newName+".pdf"
            print newPDF
            if "DDP enabled mxd":
                ddp = mxd.dataDrivenPages
                ddp.exportToPDF(tmpPdf,"ALL")
                finalPdf.appendPages(tmpPdf)
            else:
              arcpy.mapping.ExportToPDF(mxd,newPDF)
            print line + "Export Done"
MXDread.close()
item=path+"\FileListLog.txt"
os.remove(item)
del mxd
BergenCountyLine_KeyMap.mxd

BergenCountyLine_SurveyAssets.mxd

Done
Basename:BergenCountyLine_KeyMap
Z:\Tier3\TrainControls\NonReportSpecific\2015_FINAL_PresentationMaps\MXD\REVISED\test\BergenCountyLine_KeyMap.pdf
Runtime error
Traceback (most recent call last):
  File "<string>", line 38, in <module>
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 612, in dataDrivenPages
    return convertArcObjectToPythonObject(self._arc_object.pageLayout.dataDrivenPages)
AttributeError: Data Driven Pages is not enabled on this map document.


texts:
I have been working with Geoserver and today I was not able to perform any operations in it. The error message says that,

"Failed to upgrade lock from read to write state, please re-try the configuration operation"

I have no idea about this error. Could anyone help me with this?
NB: I already tried restarting the OS.


texts: How to change from EPSG:900913 to EPSG:3857 in Postgresql

texts:
I didn't use the '-E 3857' switch when importing the OSM data into postgresql using osm2psql.

I'm trying to set up a map server for the first time and I'm following the instructions from here: https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows#osm-prep.

I read that epsg900913 and epsg3857 are basically the same here: What is the difference between EPSG:900913 and EPSG:3857?.

How do I change/transform the spatial reference in the osm tables (i.e. osm_line, osm_point, osm_polygon, etc) within postgresql from epsg900913 to epsg3857 using a SQL command?


texts: Are there better climate data than Worldclim for Europe?

texts:
I am looking for the best available climate data in Europe. Worldclim seems to be the best source of information for global data, but I am wondering if there is a higher resolution (better than 1km cell size and/or 1 month temporal resolution) product in Europe. (I've seen on this site that PRISM is great for the USA, but I couldn't find anything similar for Europe).

EDIT : my purpose is to use the dataset for ecological modeling.

EDIT: if you use another dataset, I am very interested in knowing why it is used instead of worldclim.


texts: Off-setting a single character in a text box

texts:
I am attempting to offset an ESRI character (the bird in the image) to be bottom-alignment with Location X. Is there any type of formatting tag that might allow me to shift the character upward? I already tried Superscript and it shrunk the symbol down too much.
The input text is below:

<BOL>Location X</BOL><FNT name="ESRI Environmental &amp; Icons" size="30"> )</FNT>
Disease Y
Total Avian Cases: 12,345
<FNT size="8">Since:  01 JAN 2016 </FNT>


texts: Why are some QGIS 2.2 bar graphs not displayed?

texts:
I created a vector layer containing all European countries and some double information about them. I'd like to show this information for every object in a bar graph.
My problem is that the bar graphs of some areawise "big" countries (e.g. Germany, France) are not displayed in normal mode. Strangely all bar graphs are being displayed as soon as I enter the edit-mode or zoom into the countries.
I already tried all possible configurations in the bar graph menu but I can't fix it. Has anybody got an idea how to solve this problem?
I use QGIS 2.2 Valmiera.


texts: ArcGIS Online - Not all layers in tile layer showing when published. Why?

texts:
I georeferenced a scanned map and added it the "my content" in my ArcGIS Online account as a tile package. I then published it so I could use it in my mapping application. However, only a fraction of the map is showing in the application.

The Tile Layer (Hosted) Settings tells me that 13.5% of the tiles are available. Why isn't the rest of the map available?

The entire map will show in the mapping application if I zoom out a lot - but at that scale the map is a thumbnail and of no use to me. Can someone please explain what's going on and how to fix it?

The map is the size of Bermuda. I have already added a similar raster map, and that layer says that 100% of its tiles are available and I have no problem. I know it has something to do with the % tiles available, I just don't know how to make the rest available.


texts: How to get QGIS project title with PyQGIS?

texts: I would like to get the project title with PyQGIS to use it as a parameter of a Python script.


texts: QGIS clip vector layer to current map extent

texts:
I wonder if there is a way to simply clip a vector layer in QGIS (2.14.1) to the current map extent.

Clipping algorithm needs another 'clipper' vector layer as input and 'save as...' saves a vector layer restricted to the current extent but does not clip. I think it might be not too difficult to write a plugin to accomplish it - and I certainly will, if there is no simple way that I might have missed to do this.


texts: Getting error from Timestamp format for QGIS Time Manager?


texts: Need to highlight required area using leaflet

texts:
I need to display a polygon and highlight a city, I added the link bellow

https://nominatim.openstreetmap.org/search.php?q=Bambalapitiya&polygon=1&viewbox=

as nominant search I need to highlight a city using leaflet java-script library.
Help me with this.


texts: So I created square buffer points on a satellite image and I am trying to cut the images under these buffer points as like a JPEG or PNG file. Is there any way to do this in QGIS?


texts:
This is my first question here. I have used the forum extensively in the past and it has been an incredibly useful resource, but this time I am stuck with an issue I cannot resolve.
Here is a brief description. I have a map showing:

postal code polygons (in light yellow in the example)
another layer shows a few much bigger polygons (let's call them urban
areas, in grey in the example) which intersect with the postal code polygons
a layer showing points across the map (red stars in the example)

I then create 3km buffer circles around the points from the third layer. Now, here is what i would like to do:

when a postal code polygon intersects with a buffer circle AND an
urban area polygons, I would like to associate the value 1 with that
postal code polygon (if it intersects with two circles AND an urban
area than the value would be 1+1=2)
finally, I would like to create a heatmap with the postal code
polygons based on these values

I'm using QGIS 2.16.3.
Please let me know if anything is unclear and I will clarify.

See this extract as example where i added some of the values i would like to see returned, thinking that this would be the best way to build the heatmap in the final step, but if i'm going down the wrong path, let me know.


texts: How to geocode IP addresses at finer resolution than the city level?

texts: I have tried several Geocoding IP API or tools but found that the Lat/Long output is same for all addresses in the same city, which could not meet my needs. Can anyone suggest a better way to geocode IP addresses at a higher resolution?


texts:
using PyQGIS, I need to create a map tip using this HTML code: ID = [% ID %] and style it like the picture below (white text and black background). I don't know how to use CSS in this case.

If is not possible create a map tip using PyQGIS, can I maybe save it in a .qml file e set it using PyQGIS in someway?


texts: ArcObjects VB.Net - Editing in Geodatabase

texts:
I have a script in VB.Net for grabbing values from one feature and assigning them to another. It works fine on shapefiles, but upon importing the same shapefiles into a file geodatabase, I get an error thrown at me.

Try
    'Start edit operation
    pEditor.StartOperation()

    'Update the new fields with the correct values
    pFeature.Value(pFeature.Fields.FindField("ReachCode")) = strReach
    pFeature.Value(pFeature.Fields.FindField("Measure")) = dblMeas
    pFCursor.UpdateFeature(pFeature)

    'End edit operation
    pEditor.StopOperation("UpdateFields")

    pFeature = pFCursor.NextFeature

Catch e As Exception
    'Cancel edits and exit loop
    pEditor.AbortOperation()
    MsgBox("There has been an error... edits will not be saved.", MsgBoxStyle.Exclamation, "Error")
    pEditor.StopEditing(False)
    Exit Sub
End Try

The loop is an update cursor for the feature class. When working in the geodatabase, the first update is applied fine, but when it reaches the "pFCursor.UpdateFeature(pFeature)" in the second loop, it throws this error:

  "The cursor has been invalidated because the edit operation has stopped"

Is there some syntax change when working in geodatabases with respect to starting and stopping editing operations?


texts: Trying to get GDAL 2.x to work, but ogrinfo reports ERROR 3: and ERROR 4: and "Failed to open table res_t48.PAT"

texts:
We have been using GDAL 1.9 for years on a Ubuntu 12.04 machine, but are trying to upgrade to Ubuntu 16.04 with the latest PostGIS and GDAL.  When I install gdal-bin I end up with version 2.1.3. But using ogrinfo fails in the new environment, while it still works fine on the same data on the old machine.  This is what happens on the new machine:

rauser1@raserver:~$ ogrinfo /projects/t48/overlays/res_t48
ERROR 3: EOF encountered in /projects/t48/overlays/res_t48/../info/arc.dir
after reading 0 bytes while trying to read 32 bytes. File may be corrupt.
ERROR 4: Failed to open table res_t48.PAT
ERROR 3: EOF encountered in /projects/t48/overlays/res_t48/../info/arc.dir
after reading 0 bytes while trying to read 32 bytes. File may be corrupt.
ERROR 4: Failed to open table res_t48.PAT
Had to open data source read-only.
INFO: Open of `/projects/t48/overlays/res_t48'
  using driver `AVCBin' successful.
1: ARC (Line String)
2: CNT (Point)
3: LAB (Point)
4: PAL (Polygon)

This processes fine using the same data in the 1.9 environment so the data is not corrupt as the error suggests.

Could someone point me in the right direction?