texts: Google Earth Engine ee.Number() function produce an object instead of number values

texts:
I calculate the mean ndvi values of the images and extracted it with ee.Number() Algorithms but the type of my variables named sayı_sonrası_2 and sayı_sonrası_3 is an object instead of number. I want them as number because I want to use them in some if functions like sayı_sonrası_2 > sayı_sonrası_3 or something like that. Can I convert it to number version (float, integer... instead of object). Currently my if condition not working well. It has no error message but logically working wrong. Condition not working true.
Part of the code below here with comments that explain how the code works:

//Calculating NDVI images with formulas of ndvi: (NIR-RED)/(NIR+RED)
var nir_sonrası_2 = subset_sonrası_2.select('B8');
var red_sonrası_2 = subset_sonrası_2.select('B4');
var ndvi_sonrası_2 = nir_sonrası_2.subtract(red_sonrası_2).divide(nir_sonrası_2.add(red_sonrası_2)).rename('ndvi_sonrası_2');

var nir_sonrası_3 = subset_sonrası_3.select('B8');
var red_sonrası_3 = subset_sonrası_3.select('B4');
var ndvi_sonrası_3 = nir_sonrası_3.subtract(red_sonrası_3).divide(nir_sonrası_3.add(red_sonrası_3)).rename('ndvi_sonrası_3');

// This part calculating mean ndvi values as object for each Image.
var c_sonrası_2=ndvi_sonrası_2.reduceRegion({
  reducer:ee.Reducer.mean(),
  geometry:geometry,
  scale:10
});

var c_sonrası_3=ndvi_sonrası_3.reduceRegion({
  reducer:ee.Reducer.mean(),
  geometry:geometry,
  scale:10
});

// This part extracting the number values from an object which named "ndvi_sonrası_2 and ndvi_sonrası_3"
var sayı_sonrası_2 = ee.Number(c_sonrası_2.get('ndvi_sonrası_2'));
var sayı_sonrası_3 = ee.Number(c_sonrası_2.get('ndvi_sonrası_3'));

//If Conditions

if (sayı_sonrası_2 > sayı_sonrası_3 ){
  print('It worked')
  print(typeof sayı_sonrası_2,'sayı2')
  print(typeof sayı_sonrası_3,'sayı3')
}


texts: Tolerance argument for ST_RemoveRepeatedPoints in PostGIS

texts:
I have a multipoint PostGIS table with 8,000 or so points that represent intersections in a city street grid. I'd like to clean up this table to remove any points that are within 100 meters of another point.

Looking at the docs, ST_RemoveRepeatedPoints appears to be the best way to go about this. However when I try the example, I can't seem to get the tolerance parameter to work in the way I expect.

For example:

 SELECT ST_AsText(ST_RemoveRepeatedPoints(
            'MULTIPOINT((4 4), (1 1), (1 0), (0 3), (4 4))', 100.0));

Returns:

MULTIPOINT((4 4), (1 1), (1 0), (0 3))

It does remove the duplicate point (4 4), but given that I set the tolerance parameter to 100, I would expect it to remove all the points (except one) given that they are all within 100 units of each other.

What am I missing? And what's the best way to run this operation using PostGIS or ogr2ogr?


texts: Converting circular structure to JSON error

texts:
I am trying to create a feature service from a feature collection. Prior to that, a query was performed and a featureSet was produced. However, I get the circular json error when I try to create a feature layer from the query results. Suggestions?

            mapServiceUrl= <map service>;
            var requestHandle = esriRequest({
        "url": dojo.replace("{0}/layers",[mapServiceUrl]),
        "content": {
          "f": "json"
        },
        "callbackParamName": "callback"
    });

   requestHandle.then(lang.hitch(this, function(response){
         dojo.forEach(response.layers, function(layerInfo) {
          console.log(layerInfo); //checking layer name
        if(layerInfo.fields) {
          dojo.forEach(layerInfo.fields, function(fieldInfo) {
                            console.log(fieldInfo); //checking fields
          });
        }
        myfields =layerInfo.fields;
    });
         }));

    var featureCollection = {
      "layerDefinition": null,
      "featureSet": {
        "features": [],
        "geometryType": "esriGeometryPoint"
      }
    };

    layerDefinition = {
      "geometryType": "esriGeometryPoint",
      "objectIdField": "ObjectID",
      "field": [myfields]
    };

     var featureCollection = {
        layerDefinition: layerDefinition,
        featureSet: featureSet
        };
    var thislayer = new esri.layers.FeatureLayer(featureCollection);
},


texts: How to set a coordinate transformation GRID

texts:
Does anyone know how to set a coordinate transformation in qgis so I can measure the distances in meters or kilometers?

If anyone has a clue, would be just great.

Thanks!


texts: Finding distance from every point in one layer and every feature in another using ArcGIS Pro

texts:
I have two layers.  One contains points (lat/lng) and the other contains lakes (polygons).  I want to generate a table that shows, for every point, the distance to every lake.

What tool in the toolbox is designed for this task?


texts: QGIS Mutually exclusive legend within a shapefile

texts: I have a shapefile with 30 different categories/symbols which I would like to make mutually exclusive. I am able to make the shapefile itself mutually exclusive by adding it to a group, but not the symbols within. Is it possible to do this?


texts: Zoom further in than level 19 with leaflet javascript API?

texts:
We're using the leaflet JavaScript API with a tile layer which supports zoom level up to 19.  I'd like users to be able to zoom further even if the tiles blur as they have to place markers to a high degree of accuracy.

Is this possible ?

We want the map to zoom not the markers or other elements.


texts:
I was sent some old MS Access files that contained survey data and served as a "file geodatabase".

I want to import these to my Oracle Database with it maintaining "geometric" sense and meaning.

I am relatively new to this and want to know if there is a way to proof my data/format when i do these imports.

In addition to these files forming part of a feature class, it has some crucial metadata about the survey that needs to be stored in our enterprise database.


texts: Union of multiple shapefiles (polygons) in ArcMap creates random vertical and horizontal lines (sections) in output

texts:
I have made a union of 4 features (polygon shapefiles) in ArcMap. However in the final output it has made random completely vertical/horizontal lines/sections in the final union. So it should look like this:

But it actually turns out to look like this:

Not sure why this is happening, any ideas of how to solve this?


texts: Customizing QgsProcessing output layer name

texts:
I'M writing an own QgsProcessing Algorithm and I want to give the output layer in the registry a custom name instead of the default "Output layer". I want to do that during processAlgorithm(), because I'd like to name the output after an input layer, adding a fixed name prefix.
I tried the setOutputLayerName() from the class QgsProcessingContext::LayerDetails, but it doesn't change the name of the output. The example below is the "template" that the QGIS processing toolbox suggests for algorithm writing. Note the last third last and second last rows of the code, where I tried out my approach.
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import (QgsProcessing,
                       QgsVectorLayer,
                       QgsFeatureSink,
                       QgsProcessingException,
                       QgsProcessingAlgorithm,
                       QgsProcessingParameterFeatureSource,
                       QgsProcessingParameterFeatureSink)
from qgis import processing

class ExampleProcessingAlgorithm(QgsProcessingAlgorithm):

    INPUT = 'INPUT'
    OUTPUT = 'OUTPUT'

    def tr(self, string):
        return QCoreApplication.translate('Processing', string)

    def createInstance(self):
        return ExampleProcessingAlgorithm()

    def name(self):
        return 'myscript'

    def displayName(self):
        return self.tr('My Script')

    def group(self):
        return self.tr('Example scripts')

    def groupId(self):
        return 'examplescripts'

    def shortHelpString(self):
        return self.tr("Example algorithm short description")

    def initAlgorithm(self, config=None):
        self.addParameter(
            QgsProcessingParameterFeatureSource(
                self.INPUT,
                self.tr('Input layer'),
                [QgsProcessing.TypeVectorAnyGeometry]
            )
        )

        self.addParameter(
            QgsProcessingParameterFeatureSink(
                self.OUTPUT,
                self.tr('Output layer')
            )
        )

    def processAlgorithm(self, parameters, context, feedback):
        source = self.parameterAsSource(
            parameters,
            self.INPUT,
            context
        )

        if source is None:
            raise QgsProcessingException(self.invalidSourceError(parameters, self.INPUT))

        (sink, dest_id) = self.parameterAsSink(
            parameters,
            self.OUTPUT,
            context,
            source.fields(),
            source.wkbType(),
            source.sourceCrs()
        )

        # Send some information to the user
        feedback.pushInfo('CRS is {}'.format(source.sourceCrs().authid()))

        if sink is None:
            raise QgsProcessingException(self.invalidSinkError(parameters, self.OUTPUT))

        total = 100.0 / source.featureCount() if source.featureCount() else 0
        features = source.getFeatures()

        for current, feature in enumerate(features):
            # Stop the algorithm if cancel button has been clicked
            if feedback.isCanceled():
                break

            # Add a feature in the sink
            sink.addFeature(feature, QgsFeatureSink.FastInsert)

            # Update the progress bar
            feedback.setProgress(int(current * total))

        if False:
            buffered_layer = processing.run("native:buffer", {
                'INPUT': dest_id,
                'DISTANCE': 1.5,
                'SEGMENTS': 5,
                'END_CAP_STYLE': 0,
                'JOIN_STYLE': 0,
                'MITER_LIMIT': 2,
                'DISSOLVE': False,
                'OUTPUT': 'memory:'
            }, context=context, feedback=feedback)['OUTPUT']

        layer = QgsVectorLayer(baseName="My Output") # Create an empty layer for output naming
        context.layerToLoadOnCompletionDetails(dest_id).setOutputLayerName(layer) # Add this name to the output context
        return {self.OUTPUT: dest_id}


texts: Why is layout disappearing entirely in Layout View of ArcMap?

texts:
I am using ArcGIS Desktop 10.5.1.

After any redraw/refresh (F5) command, ArcMap will redraw the map in layout view and then instantly disappears again. Nothing can be seen--not the print layout, not the data frame, data...I've attempted resizing the document with and without scaling map elements proportionate to changes in page size; saving, quitting and restarting. Layers are visible in Data View.


texts: How do you merge small gaps into the larger surrounding polygon?

texts:
I have a layer which has small rectangular gaps, I need to merge the gaps into the larger polygon that surrounds it, has anyone got any idea of how to do this, I know i can fill in the gaps with a new feature then go to Editor> Merge, but i have hundreds of these. If theres a way of doing this via vba or python, it would be great.

I'm using ArcGIS 9.3.1 (ArcEditor)

Heres what it looks like


texts:
"Due to various IT policies at my workplace, QGIS is installed on a machine (Window 7, 64bits and QGIS 2.6) that is not connected to the internet. I wish to install a couple of QGIS plugins on this system.

I have downloaded the required plugins and save them on usb key. How do I install them in QGIS?"

i 've already tried :
-Unzip in folder \qgis\python\plugin
=>says in plugin manager "plugins broken" displayed in red

As i'm a new user, I'll be very glad to read a step by step how to do that.
I am seeking to get archeoCAD,numericalDigitize and numericalVertexEdit working.


texts: Shortest path between one point to every other points

texts:
I am trying to figure out how to find all the shortest paths from each point and each node of a line to the other points and nodes of lines of this map.

I have tried to do it in Python using NetworkX. For testing, I clipped the map and tried to only look for the shortest paths from each node of a line to every other nodes of other lines of this map:

With that road network, I have 214 nodes (which should result in 214x214 shortest paths, I think). I have tried to make the graph of the road network with this code:

#Create the network graph
G = nx.DiGraph()
for k,v in idict.items():
    G.add_edge(v[0],v[1], weight = v[2]) # v[0] = first (x,y) of a linestring, v[1] = last (x,y) of a linestring, v[2] = distance
    G.add_edge(v[1],v[0], weight = v[2]) #  return path

len(G.edges())

pos = nx.spring_layout(G)
nx.draw_networkx_nodes(G, pos = pos, node_size=20,arrows = True)
nx.draw_networkx_edges(G, pos = pos)
plt.show()

And the result shows:

I've also tried to apply the networkx floyd warshall function to calculate all shortest paths from each point to another point but some of the results return to infinity (as I think it says that no path is found between the points, while actually all paths are connected). All in all, it only returns to about 1720 shortest paths

How should I proceed to have the shortest path of each node to every other nodes in the map?


texts: Trying to join opentopomap maps together with mkgmap

texts:
I'm trying to join the georgia contour map and topo map from http://garmin.opentopomap.org/ with mkgmap using

java -jar mkgmap.jar --gmapsupp georgia_contours.img georgia.img

runs with no errors, but end result file has only 166kb data and no map shows.

What am I missing.


texts:
I have a large shapefile with 2,5 million points and I would like to create a new field in the attribute table that groups the features into groups of 65000 features.

In other words: Select the first 65000 features, field calculator: = 1, select the next 65000 features, field calculator: = 2 and so on.


texts: php_mapscript.so not present after Mapserver 6.2.0 compilation

texts:
I use this to compile mapserver

cd /opt/
wget http://download.osgeo.org/mapserver/mapserver-6.2.0.tar.gz
tar xvf mapserver-6.2.0.tar.gz
cd mapserver-6.2.0
./configure --with-ogr=/usr/local/bin/gdal-config --with-gdal=/usr/local/bin/gdal-config --with-httpd=/usr/sbin/httpd --with-wfs --with-wfsclient --with-wmsclient --enable-debug --with-curl-config=/usr/bin/curl-config --with-proj=/usr/local --with-tiff --with-gd=/usr/bin/gdlib-config --with-jpeg --with-freetype=/usr/include --with-threads --with-wcs --with-xml2-config=/usr/bin/xml2-config --with-postgis=/usr/local/pgsql/bin/pg_config --with-geos=/usr/local/bin/geos-config --with-sos --with-agg --with-agg=/usr/local --with-php=/usr/bin/php-config
make
make install
ldconfig

I work on Centos 6.3 x64

After the compile i do not find the php_mpscript.so in the right location (./mapscript/php).

This affect my GeoMose install, giving me 500 error for apache in accesing the geomose .php files. I think this is because MapServer is not compiled.

Any clue? Thanks!


texts:
I have many raster data in tiff format. I need to extract the values for some coordinates and save it as a csv file.
I have a code to extract data from some stations across the raster flies, and the code works as long as I extract just one station. Once, I put other coordinates to extract their values it gives errors. so I have to run the code for each of stations separately (I have 8 stations).

Can you help me modify the code?

library(raster)
library(sp) # used to create a SpatialPoint object
setwd("c:/PET")

# LOAD RASTERS INTO A LIST OBJECT.
tmp <- lapply(list.files("c:/PET", pattern = ".tif$", full.names = TRUE), raster)

coords <- data.frame(

# **1st station**
"lat" = c(498957.72),"lon" = c(4516020.57)

)

pts <- SpatialPoints(coords = coords,
              proj4string = CRS("+proj=utm +zone=16  +datum=WGS84 +units=m"))

outt=as.data.frame(cbind(coords, do.call("rbind", lapply(tmp, extract, pts))))

write.csv(outt, file="myFileName.csv", row.names = FALSE)


texts: Is there a way to view Qgis models from version 2.14 so they can be recreated in 3.0

texts: I upgraded my qgis version from 2.14 to 3.0 and didn't realize that the models from the graphic modeler are not compatible.  Is there a way to view or read the models so I can recreate them in 3.0?  I have 24 that I use in various project and I would rather not have to build them from scratch again.


texts:
I was wondering if you can save a certain view from QOSM to a GeoTiff?

The reason I ask is that I want to be able to clip a View into several smaller images which all border each other. For example, I have a basemap at scale 1:70000 covering part of Spain. I then need smaller but higher resolution images of this area, say at 1:10000. At the moment, I am zooming in on each area and trying to draw the outline on the 1:70000 map. There must be a simpler way!

I am using QGIS 2.14.10 - Essen.


texts: Rotating raster grids using ArcObjects changes cell size in ArcGIS Desktop?

texts:
I am using ArcObjects, namely RasterGeometryProc, to apply rotation on grids. The transformation works fine. However, when looking at the grids properties in ArcGis, the cell sizes has changed.

Without rotation, the cell size is 50 X 50 as expected. After applying rotation transformation (30 degrees), I get 72.728 X 64.539.

Seems like the new size is the extent of the rotated cell ?

Is this a bug, or is it the way it is supposed to be ?


texts:
When I run my script outside ArcGIS it works because during execution script uses a GDAL and OGR modules from osgeo. When I use script as a tool in ArcGIS it does not work. In PySripter I can import all modules and it work. In Python Window in ArcGIS I cannot import because I get this error:

  Parsing error SyntaxError: invalid syntax (line 2)
  import ogr
  Runtime error
  Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python27\ArcGIS10.1\lib\site-packages\osgeo\ogr.py", line 26, in
      _ogr = swig_import_helper()
    File "C:\Python27\ArcGIS10.1\lib\site-packages\osgeo\ogr.py", line 22, in swig_import_helper
      _mod = imp.load_module('_ogr', fp, pathname, description)
  ImportError: DLL load failed:

In the case when I import  gdal in ArcGIS Python Window I do not get this error.
How to force arcgis to import ogr and use it in ModelBuilder or Script??
I check a lot of solutions includin reinstallation, changing and adding environment variables. I checked :

http://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/
http://www.wildsong.biz/index.php/Running_GDAL_scripts_in_ESRI_Model_Builder

and I still do not have a good solution. Any idea?

UPDATE:
I also try use direct importing in my script:
import imp
ogr = imp.load_source('ogr', 'c:\Python27\Lib\site-packages\osgeo\ogr.py'
and I get the same error. If I use this method in standalone script it works.


texts: How can I make these two MapServer WMS layers align correctly with each other in OpenLayers?

texts:
I have two MapServer WMS layers that I want to overlay on each other in OpenLayers. One comes from vector data in a PostGIS table, and the other comes from raster data in another PostGIS table. They both have the same projection in PostGIS, the mapfile, and OpenLayers (EPSG:4326). The vector layer is simply a 0.5° x 0.5° grid, the raster layer has a resolution of 0.5° and they have the same origin, so they should align with each other. However, depending upon the bounding box of the WMS request issued by OpenLayers, they don't. It seems like MapServer is unable to return part cells from the PostGIS raster.

Here is an example WMS request:

http://46.43.3.32/cgi-bin/mapserv?map=/var/www/mapfiles/testing1.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=rasters,grid&SRS=EPSG:4326&STYLES=&WIDTH=2024&HEIGHT=600&BBOX=-14.840529126958776,32.55961652888951,7.395798998041224,39.15141340388951

Which gives:

The alignment changes depending upon the bounding box. If I round the bounding box coordinates to integers, the two layers align correctly with each other (almost) reliably, but unsurprisingly this creates an unfortunate 'jumping around' effect in OpenLayers, where the user pans to a particular location but the map then jumps to slightly different location.

It seems to be a MapServer issue caused by the relatively large cell size in the raster.

I'm using MapServer 6.4.1, GDAL 1.10.1, PostgreSQL 9.4.9, PostGIS 2.1.4, OpenLayers 4.0.1, WMS 1.1.1


texts: Using GeoServer WMS-T with QGIS TimeManager?

texts:
I have a GeoServer layer that was generated from a Cassandra database via the GeoMesa api. When I run a WMS query such as the following with changing &TIME parameter values, the openlayers page for each time slice shows the data points correctly for each timestamp:

http://localhost:8080/geoserver/mygeomesademo/wms?service=WMS&version=1.1.0&request=GetMap&layers=mygeomesademo:mygeomesademo&styles=&bbox=-265.78125,-128.67188,266.48438,130.78125&width=768&height=374&srs=EPSG:4326&format=application/openlayers&TIME=2018-01-08T09:40:00Z/2018-01-08T09:46:00Z

Now I was hoping I could use the QGIS time manager plugin to vary the time parameters and run these queries in succession to do autoplayback. When I create a connection, and add the layer as WMS/WMTS, the layer is available to TM as "Add raster".

My question is, does the TM plugin call WMS in the way that I am showing in the REST uri above for a raster layer, varying the time parameters, or does it only do this for vector layers?

QGIS 2.14.20, GeoServer 2.12


texts: Is it possible to compute higher order queens contiguity in PySAL?

texts:
I'm computing a spatial weights matrix in PySAL using Queens Contiguity. My problem is that I would like to consider areas that are contiguous to the first set of neighbours (ie. 2nd or even 3rd order contiguity.)

Reading the docs here...

https://pysal.org/libpysal/generated/libpysal.weights.Queen.html#libpysal.weights.Queen

...leads me to conclude that higher order contiguity is not possible with the Queens weighting in PySAL since I can't find a parameter for it.

GeoDa seems to have the option as illustrated here:

Source: https://geodacenter.github.io/workbook/4a_contig_weights/lab4a.html#queen-contiguity

Am I missing something or is it not possible in PySAL?


texts: How can I retrieve/query data from shapefile for forms/grid in website?

texts:
I've made a site using OpenLayers and GeoServer. Currently I'm serving WMS layers from GeoServer (shapefiles). I want to add in my site a search form that the user can search for data (which I have in the shapefile) and the result will be either presented in grid or markers on the map (irrelevant for now).

I wish to keep technology open source, I've installed OpenGeo so I have PostGIS (if needed).

If there is a solution in which I don't need to update a database every time I make changes to the shapefiles, it's better.

Site using asp.net (no PHP...)


texts: Drawing districts on city map using ArcGIS for Desktop?

texts:
I am quite new to ArcGIS.

I am trying to create district level maps of all 81 cities in Turkey. There have been lots of new districts recently, so I feel like I have to draw these manually to make them up to date. I have ArcGIS 10.1.

What would be the best way to draw districts on the individual city maps? I already know the boundaries and shapes of each district, but I just need to have them in SHP format.


texts: Horizontal color lines artifacts / bug with GDAL Tiff

texts:
I would like to document a bug I encountered, and scratched my head against several hours:

I wrote a python script for extracting (cropping) many images from a big TIF image. I used both gdal.ReprojectImage and ReadASArray.

I ended up having really strange bugs in output, like so :

This happens my script was using multithreading (parallellization), which is wrong : gdal is not thread safe when accessing a common dataset.

I hope this helps someone in the future.


texts: Does the precision of digitized points vary depending on scale in QGIS?

texts: I have been editing the locations of some points in QGIS. The scale that I am using varies between 1:6000 and 1:12000 depending on the area that I am looking at. I have been seeing some irregularities in that some points that I have moved. They appear to be in a different location than where I had placed them. Is it possible that when I move a point at 1:12000 scale its location is being stored at a lower precision than when I move a point at 1:6000 scale? For example, at 1:12000 scale there are n number of significant figures but at 1:6000 scale there are n+x significant figures. That is to say, do the number of significant figures used to describe a point's location vary based on the scale the point was created/altered in?


texts:
Before I run my code, I need to move the focus to a group in my layer tree.
I managed to do it with a layer:

registry = QgsProject.instance()
layer = registry.mapLayersByName("LayerName")[0]
iface.setActiveLayer(layer)

but there doesn't seem to be a similar method for groups, like

group = root.findGroup ('groupName')
iface.setActiveGroup(group)

How is this accomplished?

EDIT:

I have tried to use this code:

#Moving the 4 layers generated by the model to the group "QS"
ModelTuple = ("Cirlces", "Border 1", "Border 2", "Trees")
for itm in ModelTuple:
    try:
        layer = QgsProject.instance().mapLayersByName(itm)[0]
        root = QgsProject.instance().layerTreeRoot()
        mylayer = root.findLayer(layer.id())
        myClone = mylayer.clone()
        parent = mylayer.parent()
        group = root.findGroup("QS")
        group.insertChildNode(0, myClone)
        parent.removeChildNode(mylayer)
    except:
        print("Error: "+ itm)
        continue

it works perfectly fine in a new blank project. But when the code is executed in my already created project with several groups and layers, 2 of the layers from the model can't be cloned, for some reason, error message:

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

so I decided to go a different way: not move the 4 layers to the group "QS", but instead choose the right place in the layer tree before hand and leave the layers right there.


texts: OpenLayers AnimatedCluster delete all features

texts: I am using OpenLayers.Strategy.AnimatedCluster in my application in order to cluster and show points to the end-user. The example is here. All points are located in concrete vector layer. I need to remove all features from that vector layer, but when I use removeAllFeatures or destroyFeatures then it removes clusters only from the concrete zoom level and if I zoom in and then back I see all my clusters again. How can completely remove them from the map?


texts: Getting KeyError when using shortest_path of NetworkX and ShapeFile

texts:
I have a shapefile of all street segments in Los Angeles County that I have made sure is clean.  I am able to use the QGIS Road Graph plugin to calculate various shortest paths, see attached as my first example.

I am getting an error when trying to use the NetworkX shortest_path on my network.  I am loading a shapefile (roughly 410,000 edges).  My route start and end points are well known and ON the network.  There are probably better data structures, but i have created a dictionary of Points with values of what i believe to be the street segment keys, though not sure (from docs:  Coordinate tuples are used as keys).

Error:

.... weighted.py", line 359, in _dijkstra
  for u, e in G_succ[v].items():
KeyError: ((-118.3162743390968, 34.25880839639892), (-118.31575202245774, 34.25880723483486))

I verified that this street segment listed in the KeyError is in the edges list as I wrote all edges to file.

I am now going to start diagnosing the weighted.py code.

Core code snippets:

def InitRoadGraph():

    self.roadGraph = nx.read_shp(self.roadsrc)
    self.StreetNodeFromDict = {}
    for edge in self.roadGraph.edges(data=True):
        self.StreetNodeFromDict[edge[0]] = (edge[0], edge[1])

def GetStreetIDFromNodeSimple(self, geometry_point):

    return self.StreetNodeFromDict[geometry_point]

def GetShortestRoute(self, srcPoint, dstStreetSegmentID):

    srcSegmentID = self.GetStreetIDFromNodeSimple(srcPoint, "FNODE_")

    shortestRoute = nx.shortest_path(self.roadGraph, srcSegmentID, dstStreetSegmentID)[![enter image description here][1]][1]


texts: Blending features in QGIS: Approximating road edges for map render

texts:
I'm having trouble getting the right render for the tertiary roads and service roads look in my map render. I'm trying to get road edges like in the old USGS topo maps:

Notice how the road interior is empty. You can see boundaries and contours through the road.  So the trick of using a thick white line with two thin dark edges wont work for me.
So I set up two lines with offsets in opposite sides of the road. My version shows overlaps between road segments:

The rendering in QGIS is incredible, so I'm wondering if there's a style approach that I haven't discovered to get the appearance of connected road edges.


texts: Why is the ArcMap IDW tool interpolating values higher that it's closest data points

texts:
I have a dataset of equally spaced, by 3 arcseconds, points.  Each point represents the radio signal strength from a near by transmitter.  I wanted to convert the point data set into a raster for better visual analysis.  I  used the IDW (spatial analyst) tool, expecting that a cell between points would interpolate a value somewhere between the two values, but not greater or less both.
In the picture below I'm using IDW on the point set that's visible.  I set it to consider 4 data points and use variable radius.  If you look at the picture, where the pixel inspector is, the cell that i'm pointing to is close to 4 other points for which I pasted the value in the picture.  I expected that to get the value of that cell that the tool would consider the value of the 4 closest points and take the weighted average of the 4 which would be somewhere between -157.1 and -148.1, but the value the tool is giving is -106.03778.  So where is that value coming from?
I using the wrong tool for what I want?

This is the identify all layers output from the same project.  It has the IDW set up to evaluate based on 4 of the closest points, also I created an INT layer out of the idw layer.  I used the identify tool and sampled a "square" of 4 data points then the top output is taken in the center of the "square.


texts: PostGIS change column type varchar => geometry

texts:
I have a Postgres database with PostGIS extension on it. Also, I have a table with column lat with type (varchar 40). Column values are like this:

52.1432514
52.1431855
52.1431586

I want to convert the whole column to geometry type. When I do ALTER TABLE m_copy ALTER COLUMN latitude TYPE geometry USING (latitude::geometry); I see an error:

ERROR: parse error - invalid geometry
SQL state: XX000
Hint: "52.1432514" <-- parse error at position 11 within geometry

What am I doing wrong and what is the right query?

P.S Also I have a lon column. Maybe it is better to combine that columns?


texts: Calculating latitude and longitude fields using PostGIS?

texts:
I have a shape in PostGIS that has 2,658,061 records (points).

I need to create a field that is called "Latitude" and another that is called "longitude" and calculate a position in WGS84 (SRID: 4326).

How do I do this in PostGIS?


texts: Calculating intersection between points and polygon in shapefile

texts:
I want accomplish the following using command line python tools only (shapely + fiona)

I was wondering if there was a straightforward way for me to do the following:

Read in a shapefile (all counties in the UK)
Read in a csv with a list of lat / lon (this I know how to do)
Spit out a csv with the same list of points and the polygon id from
the shapefile, indicating that the point lies within the polygon (i.e.
in the county)

Ive got this to work by manually constructing polygons from a csv
export of the shapefile, but I'm afraid that Im not going to deal very
well with holes in counties, or edge cases. A standard out-of-the-box
solution would be great.


texts: How to create "wave styled" lines in geoserver SLD style?

texts:
I nees to stylize lines with a style like the image below:

as seen in nautical charts.
Already read the "geoserver cookbook" but can't found anything useful.


texts:
I wondering how to interpret the elevation calculation. Per example. We are in Canada and I use SRTM3 files. I use the GDAL library to extract my elevation, everyting is ok, except: Why (or how) the differents tools like WiND (Wireless Node Database), Radio Mobile, Google Earth, Bentley, etc... give the elevation in decimal and the value in the SRTM file is an integer?

I've tried to understand the logical behind this but I never got the same answer for a unique point, except the value in the HGT file, regardless the tool.

My understand is the SRTM3 have a 10 meters precision, SRTM1 32 meters, and the elevation in decimal still defer from both file formats and tools. 4 different tools, 2 different file format, 8 different results... except the HGT file elevation value.

Does anyone have an insight on this?


texts: Geonode pyCSW additional elements from ressourceBase in new schema

texts:
On

Ubuntu 14.04
geonode 2.4
pyCSW 1.10

I´m trying to create a new schema as plugin based on Dublin Core. This new schema should present additional elements. Therefore I´ve extended Geonodes Base Models with additional fields:
https://github.com/GeoNode/geonode/blob/2.4.x/geonode/base/models.py#L237

And added my fields in local mappings https://github.com/GeoNode/geonode/blob/2.4.x/geonode/catalogue/backends/pycsw_local_mappings.py

Unfortunately after reading the pycsw documentation I´m stuck finding a start for the plugin. Maybe one could outline the steps that are needed to create a plugin based on Dublin Core with add additional fields from geonode ressource_base?


texts:
Is it possible to see the 3D shapes of the PolygonZ shapefile?

I have Qgis2treejs plugin installed, but it shows the shapes as if they are Polygon so 2D shapes).


texts: SQL Sort data spatially using Peano method

texts:
I have to keep going back to ArcGIS to sort a dataset spatially using the PEANO method that's described here - http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/how-sort-works.htm#ESRI_SECTION1_9C199CD3D68A41029943D4FF79500A73

I want to try to achieve the same using SQL - I have asked previously trying to do it using QGIS and haven't got a workable response.

For my data it's critical that the sort doesn't result in a multipart dataset unless two or more road segments with the same name are not connected. If they don't connect there's an issue with the segment.

The solution should work in the QGIS implementation of SQL that only allows the following - https://sqlite.org/lang.html

The data has roads that are segmented and sometimes the segments aren't sequential but join other segments on the same road. This causes issues when calculating the start/end/midpoints of the road once the data is joined by road name and so I need to sort it/dissolve it spatially.


texts: QGIS: Preserve layer names when loading raster

texts:
I have a raster with 81 bands. The format is .gri with an ENVI header file .hdr.

Band names are stored together with other information in the header file:

  ENVI
  description = { CARI Carter Carter2 Carter3 Carter4 Carter5
  Carter6 CI CI2 ClAInt CRI1 CRI2 CRI3 CRI4 Datt Datt2 Datt4 Datt5 Datt6
  DD DDn DWSI4 DWSI5 EVI GDVI_2 GDVI_3 GDVI_4 GI Gitelson Gitelson2 GMI1
  GMI2 Green.NDVI Maccioni MCARI MCARI2 mND705 mNDVI MPRI MSAVI mSR mSR2
  mSR705 MTCI MTVI NDVI NDVI2 NDVI3 NPCI OSAVI PARS PRI PRI_norm PRI.CI2
  PSRI PSSR PSND SPVI.1 PWI RDVI REP_Li SAVI SIPI SPVI.2 SR SR1 SR2 SR3
  SR4 SR5 SR6 SR7 SR8 SRPI TCARI TCARI2 TGI TVI Vogelmann Vogelmann2
  Vogelmann4 }

When reading the file into QGIS, I just get "Band 01", "Band 02" etc. when using the "Identify" tool.

When reading the file into R, layer names are preserved. Here not the .hdr file is taken but the corresponding .grd file for reading layer names.

I am wondering where QGIS reads/tries to read layer names from if not from the .hdr file (which is required otherwise QGIS cannot open the file at all)?

Get the data from here.


texts: Converting string to float in Calculate Value for ModelBuilder?

texts:
In ArcMap 10.2 I have created a nested model where I am iterating through some feature classes in order to get the minimum value of a specific field for each of them and then collect the outputs using the Collect Values Tool. The output is named Zminand for whatever reason it is a string.

Afterwards I want to get the minimum of these minima in order to use it as parameter in a following step of the main model.

I have tried to use the Calculate Value Tool as follows:

Expression:

lowest("%Zmin%")

Code Block:

def lowest(Zmin):
    Zmin.split(';')
    LowestLine = min(Zmin)
    return LowestLine

Data Type: Double

Unfortunately I get the following error message:

ValueError: invalid literal for float(): -129.8;-119.4;-118.9;-157.3

My knowledge of Python is not really deep, however the problem is obviously in the type of the input. I tried to split it into a list of strings by using
Zmin.split(';')

before to convert it into floating points, but this is probably the wrong way and I do not know how to solve it.


texts:
I have an SVG image and I want to rotate it around itself. So I do the following:

var origin = new OpenLayers.Geometry.Point(vertices[0].x,vertices[0].y);
feature.geometry.rotate(90 ,origin);
feature.layer.drawFeature(feature);

but nothing happens. Does anyone know why?


texts:
I have a very simple map (http://www.nyc.gov/html/dcp/download/bytes/nybb_15b.zip) and I have never before worked with shapefiles in any way. Can someone tell me what I need to do in order to change each borough's colour and to remove the outline? (Usually I use Python.)

The map below was made with (Geo-)Pandas. But after a few hours of research, I don't even know whether the colours could be changed with something that comes with the Anaconda package.

boros = GeoDataFrame.from_file('nybb/nybb.shp')
boros.plot()


texts: Extract ways and corresponding nodes from .json file of OSM and save to CSV

texts: I fetched the highways data from turbo overpass API, and save the result in json file. OSM json has very nested document structure. I want to get the ways and their corresponding node IDs from json file into separate csv file such that each node have corresponding way IDs in it. How can i perform this?


texts: ogr SimplifyPreserveTopology does not keep the Topology

texts:
I use ogr2ogr to simplify a layer of polyline, from the document:

  -simplify tolerance: (starting with GDAL 1.9.0) distance tolerance for simplification. This method will preserve topology, in particular for
  polygon geometries.

However, it seems that the topology are not kept.
http://pbrd.co/SPt39N

What's the problem?

And the gdal version I use is 1.10.0.


texts: view zenith angle of MODIS surface reflectance product and Landsat 8

texts: I have a MODIS daily surface reflectance product (MYD09GA) which I'd like to validate Landsat 8 image with. I want to obtain pixels that only fall within the view zenith angle of Landsat 8 ( 0 - 7.5). I have used the the scale factor of 0.01 to scale my MODIS imagery so it falls within the valid range of 0 - 18000. Having tried a lot of overlapping images with my Landsat, I've not found MODIS product that has very low view zenith angle like 7.5. The least I've seen is ~30. Wondering if anybody has used this/has experience what could be going on. Does it have to do with my area or I still need to rescale my MODIS to be comparable with Landsat?


texts: How to keep georeferencing from ArcGIS when importing raster into QGIS?

texts:
I tried searching for the answer to this, but I didn't see anything, so here it goes:

I have previously georeferenced some .png raster images in ArcGIS 10.2.2, and could like to import them into QGIS. When I tried doing this, the raster would load, but it was not georeferenced.

Any suggestions on how I can accomplish this? (And yes, all the relevant files from ArcMap are in the folder, as I moved the entire folder to the new computer with QGIS).


texts: Displaying features at map scale corresponding to attribute?

texts:
Suppose one had a large dataset of features of vastly different sizes - perhaps political boundaries ranging from country to county.  It would be useful to be able to display only the large countries at a distant scale while increasingly displaying smaller boundaries as the map is zoomed.

In ArcMap, the only way I know how to accomplish this is by creating multiple copies of the layer in the Table of Contents and choose the maximum and minimum display scales.  However, can I set an attribute, say display_scale_min and display_scale_max where it specifies at which scales the individual feature should be displayed?

This wouldn't add too much complexity because the database could quickly narrow the results given the current map scale.  It would be handy because the display scale could be programmatically assigned.  It would also be handy when one feature class had several scale-dependent classes (such as having eight or so ways to simplify the display of roads).


texts: In QGIS is there a way to filter a layer using the Query Builder to show all values which include a particular phrase.  For example I have a list of organisations and I want to filter all those which include the word Wales.  I can do this using the attribute table but not in the map view so that the map just shows these selected features.


texts: Geoserver cannot be stopped or started on tomcat

texts:
I recently tried to create a script to check if my geoserver was running and if not, restart tomcat so that it was running.  I placed the script into the cron.hourly folder, however the script was not updating the log file that I created.  My geoserver now will not start back up and I am getting a java.Nullpointerexception when I try to do the shutdown command.  The script looked like this:

#!/bin/bash
STAT=`netstat -na | grep 8765 | awk '{print $7}'`
if [ "$STAT" = "LISTEN" ]; then
cd /home/blair
date >> practice-log.txt
echo "DEFAULT TOMCAT PORT IS LISTENING, SO ITS OK" >> practice-log.txt
elif [ "$STAT" = "" ]; then
cd /home/blair/
date >> practice-log.txt
echo "8765 PORT IS NOT IN USE SO TOMCAT IS NOT WORKING" >> practice-log.txt

############################################################################
cd /opt/apache-tomcat-7.0.52/bin
sudo ./shutdown.sh
sudo ./startup.sh
fi
RESULT=`netstat -na | grep 8765 | awk '{print $7}' | wc -l`
if [ "$RESULT" = 0 ]; then
cd /home/blair/
echo "TOMCAT PORT STILL NOT LISTENING" >> practice-log.txt
elif [ "$RESULT" != 0 ]; then
cd /home/blair/
echo "TOMCAT PORT IS LISTENINS AND SO TOMCAT WORKING" >> practice-log.txt
fi

It is now impossible for me to finish the shutdown command without getting an error message of:

  java.lang.NullPointerException
      at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:494)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:622)
      at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)

I could really use some help to get this back and running.  Also when trying to start the geoserver using the tomcat webapp manager on the html page I get the FAIL - Application at context path /geoserver could not be started error message.  If anyone has any suggestions they would be extremely useful.

Also I am running tomcat 7 on apache 2 on an ubuntu server.


texts: Parse GPS track data into 10 sec intervals

texts:
I have a GPX track containing latitude, longitude and elevation data. The recordings are done by a Garmin device and have been recorded in varying intervals (between 1 and 44 seconds). I would like to know my (interpolated) location data for every 10 seconds.

I have installed gpsbabel and ran this per page 138 in the manual (on Mac OSX)

gpsbabel -t -i gpx -f in.gpx -x track,pack,split=10s,title="LOG # %c" -o gpx -F out.gpx

The file out.gpx is created, but appears to be exactly the same as the input file. Am I using the wrong function?

When the input timestamps are

2016-11-27T22:56:58.000Z
2016-11-27T22:57:02.000Z
2016-11-27T22:57:07.000Z
2016-11-27T22:57:13.000Z
2016-11-27T22:57:19.000Z

I would like to have a 10 second interval output like

2016-11-27T22:56:58.000Z
2016-11-27T22:57:08.000Z
2016-11-27T22:57:18.000Z

with the corresponding (calculated) coordinates for those sections.

A sample of my original data can be found here.


texts: How do I convert coordinates to raster (bsq, bil) lookup?

texts:
I have a .bil file, which has interleave = bsq in the hdr file.

I'm having trouble finding any insight into how I would essentially do a lookup on the file.

I have no problem reading a specific chunk of bytes randomly from the file, but am unsure of how I would go about converting a lat/lon pair to a specific offset within the file. I've only seen solutions in R, but ideally I'd like to be able to do this in python or javascript, using proj4 or something to that effect.

Any advice?


texts: Get row counts of all tables in file geodatabase, ideally from metadata

texts:
I need some help with finding a way to list all the row counts for many tables (feature classes as well as non-spatial ones) in a file geodatabase. At the moment it's done manually by viewing the description tab in ArcCatalog and copying and pasting but I think there should be a way to bring out that information using arcpy. (EDIT, see further below: there is possibly also a way to do it via OGR in QGIS).

The file geodatabase structure is as follows:

my_geodb.gdb
        |----Feature_Dataset1
                    |----Table1
                    |----Table2
                    |----Table3
                    |----Table4
                    |...

I have gotten as far as doing this with a bit of help from here:

import arcpy
arcpy.env.workspace = my_geodb.gdb
oldws = arcpy.env.workspace               #saves this as main workspace

featureDatasets = arcpy.ListDatasets()    #lists all datasets in geodb
for fd in featureDatasets:
    arcpy.env.workspace = oldws + "\\" + fd
    featureClasses = arcpy.ListFeatureClasses()
    for fc in featureClasses:
        count = arcpy.GetCount_management(fc).getOutput(0)
    print fc, count

It's just getting the row counts from the metadata that I'm having problems with, my arcpy API knowledge is a bit inadequate for that. The above code works but it's really slow, and I was wondering how I can pull these row counts directly from the metadata since it's displayed there already in the ArcCatalog.

I'm finding this and this might help.

EDIT:

Trying to go with the way of ogr in qgis now. Referencing this.

Still need to work out the code to do so.


texts: Correct resampling method to simulate lower resolution satellite data?

texts:
I would like to simulate lower resolution satellite imagery from continuous higher resolution imagery. For example I want to use Landsat derived leaf area index data with a resolution of 30 m  and simulate a MODIS type of resolution of 250 m or 100 m.
The operation can be done using 'gdalwarp':

 gdalwarp -overwrite Landsat30m.tif Landsat_at250m.tif -tr 250 250

This would use gdals default setting for the resampling, which is the nearest neighbour resampling. However, this method is fast, but not very accurate, as it only takes into account a single pixel value (?).

Other available resampling methods are:

-r resampling_method:
Resampling method to use. Available methods are:

near:
    nearest neighbour resampling (default, fastest algorithm, worst   interpolation quality).
bilinear:
    bilinear resampling.
cubic:
    cubic resampling.
cubicspline:
    cubic spline resampling.
lanczos:
    Lanczos windowed sinc resampling.
average:
    average resampling, computes the average of all non-NODATA contributing pixels. (GDAL >= 1.10.0)
mode:
    mode resampling, selects the value which appears most often of all the sampled points. (GDAL >= 1.10.0)
max:
    maximum resampling, selects the maximum value from all non-NODATA contributing pixels. (GDAL >= 2.0.0)
min:
    minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0.0)
med:
    median resampling, selects the median value of all non-NODATA contributing pixels. (GDAL >= 2.0.0)
q1:
    first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0.0)
q3:
    third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0.0)

My first guess would be to use 'average' as it would sum all values covered by the lower resolution pixel. However, the value going into a pixel is defined by a point spread function. Is there any algorithm, that would come closer to simulate lower resolution satellite pixel data than 'average'?


texts: Field Calculate to remove certain values in field

texts:
I have a field named "ZIP" which has the zip code information for numerous records. Some of them have 9 numbers, but I only want them to have the first 5. What should my Pre-Logic Script look like to Field Calculate removing the last 4 numbers in this field?

Here is an image of the Field Calculator and the field:


texts: Wrong value in ST_distance between two lines

texts:
I have two geometries (MULTILINESTRING, type 4326). I load them (a sql database with these values) in QGIS and their distance is around 4km (I checked it with the original file in kml).

When I measure the distance between them throught PostGIS and I got a wrong value:

select st_distance('0105000020E6100000010000000102000000020000000000000048A057C06E352565BCA1414000000000880855C02737039CC94E4240'::geography, '0105000020E6100000010000000102000000020000000000000078F757C04DE67241D707444000000000885157C037F73119779E3E40'::geography)

It returns 0 instead of 4 or 4000


texts:
I have working Java code for an intersect:

gp = new GeoProcessor();
gp.setOverwriteOutput(true);
Intersect newintersect = new Intersect();
String in = "(" + srcShapefilePath + "\\polygon.shp; " + srcShapefilePath + "\\lines.shp)";
newintersect.setInFeatures(in);
newintersect.setOutFeatureClass(srcShapefilePath + "\\result2.shp");
newintersect.setOutputType("POINT");
gp.executeASync(newintersect);

How can I pass Geometry or feature class instead of shapefile. I want to use gp.execute instead of gp.executeASync.

executeASync creates an output shapefile,  but I don't want to create a shapefile, I want to make some analysis on the result. Any ideas?


texts: Using TIF format to view vegetation Map with QGIS?

texts:
I'm a new user of QGIS and I'm trying to view a map present in an online GIS dataset. There are several formats for this dataset and one of them is a TIF folder with several files: .tif, .tif.aux, .tif.rrd, tif.vat.dbf and I have no idea how to handle these files to view the map with all its informations about the vegetations of a region.

Effectively it was easy to do. In my research I'm tring to view a vegetation map and to have also the possibility to separate each layer.

So I went in the website of vegetation mapping project to download what I would need:
http://www.vegmad.org/default.html

In this way I have tried to find the right file to download, and every time (always using QGIS) I can see only the image of Madagascar but I can't distinguish each layer.

I have tried to do what you said, but it's not so easy as I expected.

I'm showing you what I have obtained downloading MODIS Dataset Geotiff, and which classes I have opening Classes.xls file.

And I think that before I separate each layer in different raster files I need to give the exact classification to each pixel value range, but I can't treat those data...

In QGIS first of all I have opened Modis_classification2.tif and what I observe is more pixel values than what that I have in this classification file.xls. This is shown below...

So what do you think that i should do?


texts:
I want to use GCPs list for converting HDF file to GeoTIFF file with lat/lon. The related example on internet is very poor. My code below can't run.

import gdal
from pyhdf.SD import SD, SDC
file="C:/Users/TLQ/Desktop/11/MYD09.A2011093.0410.006.2015217030905.hdf"
f1 = SD(file, SDC.READ)
lat = f1.select('Latitude')
latitude = lat[:,:]
lon = f1.select('Longitude')
longitude = lon[:,:]
b1 = f1.select('BAND31')
AOP = b1[:,:]
GCPList=[]
for i in range(10):#latitude.shape[0]-1
    for j in range(10):#latitude.shape[1]-1
        GCP = gdal.GCP()
        GCP.GCPLine= i*203
        GCP.GCPPixel = j*135
        GCP.GCPX = float(longitude[i*203,j*135])
        GCP.GCPY =float(latitude[i*203,j*135])
        GCPList.append(GCP)
datatype=gdal.GDT_UInt16
driver=gdal.GetDriverByName('GTiff')
dataset=driver.Create("C:/Users/TLQ/Desktop/11/MYD09.A2011093_111.tiff",1354,2030,1,datatype)
dataset.GetRasterBand(1).WriteArray(AOP)
ds=gdal.Open("C:/Users/TLQ/Desktop/11/MYD09.A2011093_111.tiff")
result=gdal.Translate("C:/Users/TLQ/Desktop/11/MYD09.A2011093.tiff",ds,\
                      options=gdal.TranslateOptions(GCPs=GCPList,format='GTiff'))


texts: Unknown item type 'Layer' arcGIS API for JavaScript

texts:
I'm using the ArcGIS API for JavaScript to create an interactive map in a web page. When I try to add a layer with an specific id, doesn't recognize the layer and I receive this error:

The code to add the layer is:

require([
          "esri/Map",
          "esri/views/MapView", // SceneView
          "esri/layers/Layer",
          "dojo/domReady!"
        ], function(Map, MapView, Layer) {
          var map = new Map({
            basemap: "gray" // streets, topo, satellite, gray
          });

          var view = new MapView({
            container: "viewDiv",  // Reference to the DOM node that will contain the view
            map: map,               // References the map object created in step 3
            zoom: 4,  // Sets the zoom level based on level of detail (LOD)
            center: [-58, -15]  // Sets the center point of view in lon/lat
          });

          // Add a layer in the map
          Layer.fromPortalItem({
            portalItem: { // autocast as esri/portal/PortalItem
                id: "405b97de934143aebe4784e833258a0f"
            }
          }).then(addLayer).otherwise(rejection);

          // Adds the layer to the map once it loads
          function addLayer(lyr) {
            map.add(lyr);
            alert("Layer added");
          }

          function rejection(err) {
            alert("Layer failed to load: " + err);
          }
});

The layer is in the arcgis portal (layer) with the extension .lyr.


texts: Style Print dijit menu in esri JavaScript API

texts:
Trying to add styles to a dijit is difficult enough, as I have to track down the classes it uses after it loads. I've managed to do that, but I'm struggling to find the appropriate classes to alter for the menu that pops out from the esri Print Dijit (esri.dijit.Print) that lists the different layout options. This doesn't show up in the structure in the browser's development environment, so I can't track them.

Is there a better way to find and alter these style classes?


texts: How to properly point the Sun in CesiumJS?

texts:
I prepared a Cesium sandcastle example based on this answer from @FSimardGIS, but something is going wrong: only one of many rays correctly points to the Sun, the other appears random.

What's wrong here?
I took the test coordinates from SunCalc library, but you can also insert data manually, using for example this site for calculations:
https://planetcalc.com/320/?day=2020-11-19%2004:31:37&plat=36.13&plon=138.36&gmtdiff=0&UTCoffset=0
This is the source code from the other answer:
function CalcPosFromAltAzDist(startPoint, vectorPointing) {
  var ellipsoid = Cesium.Ellipsoid.WGS84;
  var ENU = new Cesium.Matrix4();
  Cesium.Transforms.eastNorthUpToFixedFrame(startPoint,ellipsoid,ENU);
  var myX = vectorPointing.dist * Math.sin(vectorPointing.az * Math.PI / 180);
  var myY = vectorPointing.dist * Math.cos(vectorPointing.az * Math.PI / 180);
  var myZ = vectorPointing.dist * Math.sin(vectorPointing.alt * Math.PI / 180);
  var offset = new Cesium.Cartesian3(myX,myY,myZ);
  var finalPoint = Cesium.Matrix4.multiplyByPoint(ENU, offset, new Cesium.Cartesian3());
  return finalPoint;
}

Call with:
vectorPointing= {"alt" : 30, "az" : 0};
startPoint= Cesium.Cartesian3.fromDegrees(290.6, -35.78);


texts:
Kriging of NDVI of Sentinel2, I'm getting an error:

Want to interpolate pixel values of NDVI obtained from Sentinel2.
Exponential: Tile error: Property ' ndvi ' is missing.

My code:

var image = ee.Image('COPERNICUS/S2/20180705T134211_20180705T134414_T21JZN');
var ndvi = image.normalizedDifference(['B8', 'B4']).select('nd').rename('ndvi');

// Define a geometry in which to sample points
var geometry = ee.Geometry.Rectangle([-53.768199, -24.604938, -53.768371, -24.605016]);

// Sample the SSM image at 1000 random locations.
var samples = ndvi.addBands(ee.Image.pixelLonLat())
  .sample({region: geometry, numPixels: 500})
  .map(function(sample) {
    var lat = sample.get('latitude');
    var lon = sample.get('longitude');
    var sst = sample.get('sst');
    return ee.Feature(ee.Geometry.Point([lon, lat]), {sst: sst});
  });

// Interpolate SSM from the sampled points. (gaussian, exponential)
var interpolated = samples.kriging({
  propertyName: 'ndvi',
  shape: 'exponential',
  range: 100 * 1000,
  sill: 1.0,
  nugget: 0.1,
  maxDistance: 100 * 1000,
  reducer: 'mean',
});

var colors = ['00007F', '0000FF', '0074FF',
              '0DFFEA', '8CFF41', 'FFDD00',
              'FF3700', 'C30000', '790000'];
var vis = {min:-3, max:40, palette: colors};

var interpolated = interpolated.clip(Talhao_PR)

Map.setCenter(-53.772523, -24.600772, 16);
Map.addLayer(interpolated, vis, 'Exponential');
Map.addLayer(ndvi, vis, 'NDVI');
Map.addLayer(samples, {}, 'Samples', false);


texts: Handling many-layer queries using GeoExt/Geoserver/OpenLayers?

texts:
Am developing an application using GeoExt/OpenLayers and Geoeserver and am using more than ten (10) layers.  I wanted to add a querying functionality on my application.  I have done for one layer and is working really fine.

Code

var secStore = Ext.create('GeoExt.data.FeatureStore', {
        layer: secschools,
        fields: [
            {name: 'Name_of_Sc', type: 'string'},
            {name: 'Girls_Boys', type: 'string'},
            {name: 'School_Spo', type: 'string'},
            {name: 'Day_or_Boa', type: 'string'},
        ]
    });
    secStore.load();
    var sm = Ext.create('GeoExt.selection.FeatureModel', {
            autoPanMapOnSelection: true,
            mode: 'MULTI'
    });
var secGrid = Ext.create('Ext.grid.GridPanel',{
        store: secStore,
        autoScroll:true,
        layout:'fit',
        columns: [{header: "Name", flex:0.4, dataIndex: "Name_of_Sc"},
                {header: "Sponsor", flex:0.2, dataIndex: "School_Spo"},
                {header: "Girls/Boys", flex:0.2, dataIndex: "Girls_Boys"},
                {header: "Day/Boarding", flex:0.2, dataIndex: "Day_or_Boa"},
                ],
        tbar:[{
                xtype: 'textfield',
                width:100,
                margin: 2,
                enableKeyEvents: true,
                listeners: {
                    keyup: function() {
                        var store = this.up('grid').store;
                        store.clearFilter();
                        if (this.value) {
                            store.filter({
                                property     : 'Name_of_Sc',
                                value         : this.value,
                                anyMatch      : true,
                                caseSensitive : false
                            });
                        }
                    },
                    buffer: 500
                }
            }
        ],
        selModel:sm,
        stripeRows: true,
        columnLines:true,
        selType: 'featuremodel',
    });

The secschools is a WFS layer added on my map.As you can see the grid displays the records form the secschools layer and can be filtered using the textfield.
The issue is, I will have to repeat this code as many times as the layers I want queried.

How can I handle such a querying functionality (to search e.g. 10 layers) in my app without doing as above?


texts: When should I use a Web Coverage Service instead of a WMS?

texts:
Having used WMS for years now, I am wondering what extra benefits there could be if I also offered WCS for certain raster datasets eg. DEM.

I have geotiff DEMs which I have loaded into geoserver and the height value is readable by WMS-getFeatureInfo. If I displayed this as a WCS what would I gain?


texts: How to define which columns in a Spatialite database are the latitude and longitude?

texts: I have imported a CSV containing points with coordinates specified in columns named Latitude and Longitude. How do tell spatialite that these columns are the coordinates of of my points?


texts: Which data format typically displays fastest in ArcMap?

texts:
My organization is working on an application running on ArcGIS Engine. Previous versions of the application used primarily Shapefiles for displaying roads, parcels, buildings, etc.

Since I was taught to avoid Shapefiles when managing data at my college job, I suggested moving to file geodatabases.

Esri claims file geodatabases are optimized for performance and storage.

My co-worker remembers hearing that Shapefiles usually draw faster.

I didn't come across an article directly talking about this topic, so I thought I would ask the community.

I'm leaning towards file geodatabases, but it would be nice to know if I'm missing out on anything that Shapefiles offer.


texts:
I have installed QGIS in a Conda virtual environment called qgis_stable. When I open Python in the terminal and try to run:
import gqis.core
I get the error message:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

The file "libGL.so.1" is located here: "/projects/conda/env/qgis_stable/x86_64_conda-linux-gnu/sysroot/usr/lib64". I tried adding this directory to my sys.path but this did not fix the problem. Any suggestions to resolve this?


texts:
I have 65 Landsat 8 tiles I download off of EarthViewer form the USGS website. What is the fastest way I can load these files into QGIS?

My issue is that each tile I downloaded came with a folder where every spectral band is separate tiff file instead of all being in a single GeoTIFF.

Is there a fast way to load the files and get an RGB image or am I stuck making virtual rasters/ combining the bands for each file?


texts:
I want to publish a database to ArcGIS Server. When I try and register the database, I get this error:

Can anyone help me?

I am using ArcGIS Server and Desktop 10.2 with Microsoft SQL Server 2008.


texts: Obtaining SLD styles that works with a given OpenStreetMap shape files?

texts: I have downloaded shapefiles from open street map. I want to apply different stylings to a single vector file(i.e different colours to highways, street roads, pathways etc). Is there any way to obtain SLD styles so that it look similar to open street map?


texts: Raster calculator to create single raster with 4 values from two binary rasters

texts:
I have two binary rasters showing habitat suitability (0 = unsuitable, 1 = suitable) under current and future climate scenarios. I am trying to create a raster showing:

0 = cells that are not suitable under either scenario (i.e. = 0 in both rasters)
1 = cells suitable under current (=1) but NOT future (=0)
2 = cells suitable under both scenarios (i.e. both = 1)
3 = cells suitable under future (=1) but not current (=0)

So the final raster will consist of values of 0 , 1 , 2, 3, 4 (and no data = -9999)

I am struggling with the correct syntax in raster calculator. Is it possible to do this all in one line of syntax or do I have to create four separate rasters?

To summarise my files:

I have a current binary raster (Model10a_bin.tif) and a future binary raster (Model10a_yr2050_bin.tif) and I am trying to create a new raster showing the following:

If Model10a_bin.tif = 0 and Model10a_yr2050_bin.tif  = 0  ;  Value new raster = 0

If Model10a_bin.tif = 1 and Model10a_yr2050_bin.tif  = 0  ;  Value new raster = 1

If Model10a_bin.tif = 1 and Model10a_yr2050_bin.tif  = 1  ;  Value new raster = 2

If Model10a_bin.tif = 0 and Model10a_yr2050_bin.tif  = 1  ;  Value new raster = 3


texts: PostGIS Update parse error – invalid geometry

texts:
I’m trying to update geometry table using the following command but get
parse error – invalid  geometry
HINT: “MULTIPOINT(“ <--  parse error at position 11 within geometry

    Update geo_table
    Set geom =ST_ConvexHull(
                                ST_GeomFromText('MULTIPOINT(co_ord_string)', 4326));
    WHERE
    Id =1234;

originally I created this data with a perl script  something like
     insert into geo_table (stuff,date, co_ord_string,geom) values (‘Hello’,’02-07-2018 00:00:00’, T_ConvexHull(ST_GeomFromText('MULTIPOINT($co_ord_string)', 4326));

The co_ord_string is a series of long lat points separated  by a comma.
These don’t create perfect polygons as they may contain internal points but using ST_ConvexHull a polygon is created.
Only by viewing the data in QGIS I can see there are errors in the original coordinates that need manually editing (Missing minus signs some points or other issues ) and the geometry recreating.
What is the correct syntax?


texts:
I'm building an app with the Web AppBuilder of ArcGIS Online.
I heard it would be possible to download the app so that it could be used offline or deployed on another server. In my case, i would just need to be able to use it offline.
I managed to download the app which gave me a zip folder but once it's done i have no idea what to do with all these files to be able to visualize the app. I have very basic notions of HTML/CSS only. I opened the index.html file but i receive this error message: "Unable to load config.json?wab_dv=2.15 status: 0"
Does anyone have any leads to share?


texts: Manage symbol levels between multiple layers in QGIS?

texts:
I'm working with OSM data in QGIS that I imported with Imposm, so the roads are split into multiple layers: motorways, main roads, and minor roads.

I'm trying to manage the symbol levels between the three layers so that they can have borders but also seamlessly join with one another, but I can only figure out how to set symbol levels at an individual layer level.

In ArcMap you can group multiple layers and then edit the symbol levels of the entire group, but QGIS doesn't seem to have this ability. Is there an alternative workaround to achieve this?


texts:
Brand new QGIS user here. I'm on version 2.12.3 on a Win7 machine.

I've downloaded a vector layer as part of an assignment. After adding an OpenStreetMap base layer, the project placed my vector feature somewhere in Nigeria, when it's supposed to be in Navarro, the US.

What is likely to be the problem here? Both layers are on the WGS 84 / Pseudo Mercator (EPSG:3857), and I have OTF projections turned on.

addendum:


texts: How to assign costs for turns on GRASS vector network analysis?

texts:
I would like to get a better understanding of how to assign costs for turns when creating a least-cost path with GRASS network tools, basically because I don't want any line to be used twice for creating the path.

For example with v.net.path, there exists the option to assign turning costs to each line with arc_backward_column and turn_layer.

Question 1: What's the difference between those two?

Then, I question whether any of them would be helpful, because in the wiki it is mentioned that 'Vector directions are defined by the digitizing direction (a-->--b).' However, I do not want to define a direction in according to how lines are digitized (my lines are not), but in terms of the direction that the network graph has already used that line.

Question 2: What is used as direction if the layer is not digitized? Is there a way to consider the direction to the one that the network graph has already used that line for generating a least-cost path?


texts: OpenLayers 3: Create a map based on ImageStatic and add features (polygons, linestring etc.)

texts:
I have an image that I need to create an OL3 map for, so I've done:

var map;

$(function() {
    var imgProjection = new ol.proj.Projection({
        code: 'pixel',
        units: 'pixels',
        extent: [0, 0, 3721, 2631]
    });

    map = new ol.Map({
        target: 'skimap',
        renderer: 'canvas',
        layers: [
            new ol.layer.Image({
                source: new ol.source.ImageStatic({
                    url: 'http://skimondo.swissgeo.ch/mapeditor/config/schwarzsee/data/map.jpg',
                    imageSize: [3721, 2631],
                    imageExtent: [0, 0, 3721, 2631],
                    projection: imgProjection,
                    center: ol.extent.getCenter(imgProjection.getExtent()),
                    extent: imgProjection.getExtent()
                })
            })
        ],
        view: new ol.View2D({
            projection: new ol.proj.EPSG4326(),
            center: ol.extent.getCenter(imgProjection.getExtent()),
            zoom: 2
        })
    });

    var vectorSource = new ol.source.GeoJSON({"type":"LineString","coordinates":[[3.625,-28.952465726],[0.1875,2.235034274],[0.09375,19.578784274],[-1.25,33.922534274]]});
    var vectorLayer = new ol.layer.Vector({
        source: vectorSource,
        style: new ol.style.Style({
            stroke: new ol.style.Stroke({
                color: '#FF0000',
                width: 2
            })
        })
    });

    map.addLayer(vectorLayer);

But no feature shows up plotted onto the map? I am not sure if I have correctly made the map / layers / projection ? I have basically been trying to convert the old OL 2.13 code that I had working. It used WKT which was generated from the DB using ST_AsText, for the OL3 code, I have to use geoJSON (which is generated from ST_AsGeoJSON I believe):

$(function() {
    var map = new OpenLayers.Map('skimap', { controls: [] });

    map.addControl(new OpenLayers.Control.PanZoomBar());
    map.addControl(new OpenLayers.Control.KeyboardDefaults());
    map.addControl(new OpenLayers.Control.Navigation());
    map.addControl(new OpenLayers.Control.ArgParser());

    var options = {
        numZoomLevels: 5,
        minResolution: 0.05,
        maxResolution: 0.30,
        projection: new OpenLayers.Projection('EPSG:4326'),
        isBaseLayer: true,
        opacity: 0.8
    };

    var skimap_image = new OpenLayers.Layer.Image(
        'schwarzsee',
        'http://skimondo.swissgeo.ch/mapeditor/config/schwarzsee/data/map.jpg',
        new OpenLayers.Bounds(-180, -127.272238646, 180, 127.272238646),
        new OpenLayers.Size(3721, 2631),
        options
    );

    map.addLayers([skimap_image]);

    var vector_layer = new OpenLayers.Layer.Vector('Points', {
        projection: new OpenLayers.Projection('EPSG:4326')
    });

    var polygonFeature = [];

    var polygonGeom = new OpenLayers.Geometry.fromWKT('LINESTRING(X X, X X)');
    polygonFeature.push( new OpenLayers.Feature.Vector(polygonGeom,
        {
            id: '1'
        },
        {
            pointRadius: 8,
            color: '#FF0000',
            strokeColor: '#FF0000',
            strokeOpacity: 0.8,
            fillColor: '#FF0000',
            fillOpacity: 0.4
        }
    ) );

    vector_layer.addFeatures(polygonFeature);

    map.addLayer(vector_layer);

    map.zoomToMaxExtent();

    map.zoomTo(10);

});

Any ideas why my OL3 version code isn't working (with added features showing up)?


texts: Query result showing unsupported data type

texts:
When I use this code:

SELECT SDO_GCDR.GEOCODE_AS_GEOMETRY

    (
    'SPATIAL',
    SDO_KEYWORDARRAY
    (
    '3746 CONNECTICUT AVE NW',
    'WASHINGTON, DC 20008'
    ),
    'US'
    ) geom
    FROM DUAL;

the result of my query is unsupported data type, however it should be showing:

SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-77.060283, 38.9387083, NULL), NULL, NULL)

How can I manage to do that? I just started learning Oracle Spatial, and am using Oracle APEX.


texts: Get all bus lines for a set of stops in overpass / OSM

texts:
I am trying to get a list of lines for a large set of busstops (lets assume to query worldwide). As far as I have figured it out, I get a set of busstops from download.osmdata.xyz.
Now I could query overpass API with the OSM Node Ids like:
(node(483556383);
<;
);
(node(2101949781);
 <;
);
out;

How is the correct query if I am just interested in the relations pf type
<tag k="route" v="bus"/>

Or even better just get the line numbers at the set of bus stops.


texts: Using Arcmap to update a field based on data from another fields

texts:
I'm trying to update latitude and longitude data per individual station for a lab I'm working for.

Here's some code I have that's supposed to assign any all bay stations of a certain name the appropriate GPS coordinates.

Whenever I try to run it arcMap simply says there was an error processing the data.


texts: Creating QGIS Shapefile in PyCharm leaving some attributes NULL

texts:
I've created the shapefile and can manually enter in all the attributes to come in fine, but when I call it any other way (which I will need to do), the values for the floating types appear as NULL, even after converting to str or int.
When I print dato.iloc[0].tolist(), it spits out the first row of data as a list, and looks as follows: ['1', '1', '31isk', 4613427, 413588.12200000003, 1.19, 'sand'].
If I have feat.setAttributes(dato.iloc[0].tolist()), all values except for the three floats come in fine. If I print and copy the resulting string into feat.setAttributes, it will add the attribute perfectly okay. This is only a quikc fix and not possible when there are hundreds of more attributes to add.
So again, this does NOT work: dato.iloc[0].tolist()
But this DOES work: feat.setAttributes(['1', '1', '31isk', 4613427, 413588.12200000003, 1.19, 'sand'])
This is all done within PyCharm. Fields are as follows (Northing, Easting, and Altitude all appear NULL):
layerFields = QgsFields()
layerFields.append(QgsField('Transect', QVariant.String))
layerFields.append(QgsField('PointNumber', QVariant.String))
layerFields.append(QgsField('SubClass', QVariant.String))
layerFields.append(QgsField('Northing', QVariant.String))
layerFields.append(QgsField('Easting', QVariant.String))
layerFields.append(QgsField('Altitude', QVariant.String))
layerFields.append(QgsField('Notes', QVariant.String))

I've tried setting QVariant to int and converting the float values to ints but still nothinng.


texts: OpenLayers 3 - Build GetMap query string for WMS

texts:
We have an application with OpenLayers 2. There we are using WMS layers, which make requests to an custom Web service. This Web service creates an image for the current map window.
To achieve that, we use the getUrl method, where the bounds are passed and where we build the URL for the request.

For OpenLayers 3 I have not seen that possibility. What is the best way here to solve this?

EDIT:
In ol2, we used the getUrl method of the WMS layer object to build a specific url for each WMS request. Is there an equivalent there for ol3?


texts: Identify a Massachusetts Municipality from address

texts:
I am trying to create or utilize a lookup table to identify which Massachusetts Municipality my address is in. Do you know of an online resource available, or a way to identify the municiaplity uses FIPS codes? I currently only have the following fileds.

Address, City, State, Zip, MSA 5 digit, county 3 digit, state code 2 digit, census tract 6 digit.


texts: OpenLayers: How to get backgroundGraphic to go under externalGraphic

texts:
I've got a layer with nodes features on which I may want to display two images, a main one and a background one. This page : http://openlayers.org/dev/examples/marker-shadow.html shows what I want: the shadow is under the golden item (it's more obvious when we move the png with a dev tool).
For this, they use:

// Set the external graphic and background graphic images.
externalGraphic: "../img/marker-gold.png",
backgroundGraphic: "./img/marker_shadow.png",

// Makes sure the background graphic is placed correctly relative
// to the external graphic.
backgroundXOffset: 0,
backgroundYOffset: -7,

// Set the z-indexes of both graphics to make sure the background
// graphics stay in the background (shadows on top of markers looks
// odd; let's not do that).
graphicZIndex: MARKER_Z_INDEX, //11
backgroundGraphicZIndex: SHADOW_Z_INDEX, //10

Obviously it's not about real CSS z-index since the DOM element both have a z-index: auto in the end. But whatever, I wanna try this myself (not at the layer construction but afterwards):

style["backgroundGraphic"] = './img/marker-shadow.png';
style["externalGraphic"] ='./img/marker-gold.png';
style['graphicZIndex'] = 1;
style['backgroundGraphicZIndex'] = style['graphicZIndex']-1;

The images are displayed. But while one could think the backgroundGraphic would automatically go under the externalGraphic, the contrary actually happens. Fine, I'll just add the z-index thing:

style['graphicZIndex'] = 1;
style['backgroundGraphicZIndex'] = style['graphicZIndex']-1;

But it changes absolutely nothing. How do I get my background underneath?


texts: Determining of vector dataset single files to specify its size on a disk

texts:
I wonder how to get size of disk space that a specific vector dataset occupies on a disk. I didn't find any ogr2ogr util or OGR Python method that can return a list of files that belongs to given dataset. I could use ogr2ogr util or CopyDataSource OGR method to copy the dataset to new empty directory using the same driver and analyze the directory then but this method do not preserve original features (and file size) or even does not allow dataset creation for some of OGR formats. Another way is to make a list of possible file extensions that may belongs to given vector format and try to test if the file exists...
Any other ideas?


texts: OpenLayers plugin displays OSM in infra-red

texts:
In QGIS, I try to add OpenStreetMap as a base layer with OpenLayers plugin > OpenStreetMap > OpenStreetMap but it only displays in infra-red.  Is there a way to solve this?

The Apple maps base layer, by contrast, displays normally:


texts:
I can't use imposm tool, because it is not compatible with Nominatim.
So it seems that I can use only osm2pgsql. But is there any ready to use toolchain, that allows to update OSM in an easy way.

I looked at docs and it seems that I need to do all by hands.

Is there any tested version that are ready to work?


texts: Combing rows together/Summing up the data in an attribute table

texts:
There are approximately +1,000 rows, almost all of them have the same name but are split up with different lengths.  I was looking for a way to combine the rows based on length and combine the names to a single name. So looking for a single row that keeps the name but has a total length.
I have tried the dissolve function but I don't think that was working considering it was copying the lengths when setting it to SUM.

I do believe it is a standard license that is version 10.5.

Looking for these to be all one attribute in a shapefile


texts: Determine % of overlap of two networks within a certain distance (e.g. 1km)

texts:
I'm a beginner to GIS analysis.

I have two shapefiles with two networks and would like to calculate the % of overlap within a certain distance (1km).

How can I do this kind of analysis using QGIS?


texts: Calculating number of points within different parts of raster?

texts:
I want to calculate the number of points that overlap a raster with different areas (the areas have different numerical values).

How can I determine how many points fall within each area of the raster?


texts:
I'm trying to make a model of surface runoff of rain water. I'm using GRASS GIS function r.flow, which generates nice smooth lines of runoff. What I need is edit these flowlines some way to avoid crossing between lines (see picture). As a input data, I'm using DEM in 5 meters resolution, which is smoothed by circle filter 9 x 9 cells.

Do you have some ideas how to automatically adjust lines? I can use ArcGIS, GRASS GIS, QGIS or SAGA GIS. I can even write some in Python. But I do not know how to solve it.


texts: Geocoding error MMQGIS plug-in on QGIS 3

texts:
Using the mmqgis plug-in for QGIS 3, I tried to geocode some addresses, but get the following error: "Failure connecting to maps.googleapis.com:

I am doing the following: MMQGIS tab -> Geocode CSV with Google/OpenStreetMap -> enter csv file, which has address, city, and state

I've tried with and without an Api key. I've also tried with OpenStreetMap. No results.


texts: Pixel alignment for trend analysis in Earth Engine

texts:
I am trying to calculate NDVI trends over time using Landsat scenes and the earth engine code below:

var point = /* color: #d63000 */ee.Geometry.Point([-133.49, 69.18]);
var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
  .filter(ee.Filter.lt('CLOUD_COVER',10))
  .select(['B3', 'B4'])
  .filterBounds(point)
  .filter(ee.Filter.calendarRange(7,8,'month'));

//adds ndvi as band 'B4_1'
var ndvi = function(image) {
  var nir = image.select('B4');
  var red = image.select('B3');
  var ndvi = nir.subtract(red).divide(nir.add(red));
  var proimage = image.addBands(ndvi);
  return proimage;
};

var createTimeBand = function(image) {
  return     image.addBands(image.metadata('system:time_start').divide(3.154e10));
};

var stack = l5.map(ndvi).map(createTimeBand);

var linearFit = stack.select(['system:time_start','B4_1'])
.reduce(ee.Reducer.linearFit());

var linpar = {min: 0, max: [-0.01, 0.01, 5], bands: ['scale', 'scale',         'offset']};
Map.addLayer(linearFit, linpar,'fit');
Map.setCenter(-133.50, 69.19, 9);

However when I zoom in it seems the pixels are misaligned between scenes from different paths/rows.

I found this code to register an image to a reference, but is there some way to align the geometry of a large stack of images?


texts:
I am writing a paper for my GIS MSc and trying to justify a hypothetical move for the EPA from proprietary GIS software to open source (QGIS).

Can anyone hazard an educated guess as to how much ArcGIS would cost an organisation the size of the EPA per year? Are we talking 100,000's or millions?


texts: Does anyone know any public sources for GIS leaseholding data for large players in the Oil & Gas industry.  I would like to get my hands on leasehold polygons of large producers like Chevron, Exxon, etc.  To my knowledge this is all public data, and in no way private, correct?


texts: Auto-populating dynamic text for attribute table information on multiple layers within MXD with Data Driven Pages?

texts:
I am working on creating a maintenance inventory for a City's Parks Departments in ArcGIS 10.2.2 for Desktop. I have used the Township/Range/Section boundaries as the clipping areas for my data driven pages to set up viewing windows for different areas of the City. I have created 5 shapefiles of landscape maintenance types, which are present at varying levels in each of the individual Sections within the City. I have set up my pages as follows in the attached image, and would like to know if there would be a way to auto-populate the "table" at the bottom of the page with information that is only present in the current viewable Section(s).

For each of the 5 landscape maintenance types, I have the total area and modes 1-3 in the attribute table. Is there a way to auto-populate the red circled areas for just data within the individual page based on this?

I have found through researching this issue (without much luck so far) that more than likely I will have to join my tables for each landscape type with my index layer that is determining the data driven pages.

If this is the case, what would be the best method to join my landscape maintenance layers with the index layer?

I have access to the X-Tools extension if it would be helpful in this instance.


texts: Extracting relevant data from CAD format into a PostgreSQL database

texts:
I have received some survey information in the format of a .DWG (AutoCAD file) and I am trying to extract the data from this file into QGIS and then into a PostgreSQL database.

In the .DWG file there are a number of linestrings that have 3D geometry (differing x,y and z values), but when importing into QGIS only the first z value is used for the remaining x and y values of that linestring. (some of the linestrings have up to 100 different vertices, all with different x,y,z values. But when imported, only one z value is used for the whole linestring)

Is there a way to extract each individual z value that corresponds to the correct x,y value?


texts: QGIS very slow when browsing files on macOS

texts:
QGIS is performing very slowly for me when browsing files and folders recently. I am running macOS Mojave and have no performance issues within QGIS, apart from the times I need to open or save a file.

I'm running the latest QGIS (3.4.4) as of 29/01/2019

I thought this issue may have been related, but the slowness of the finder window applies no matter which folders I am navigating between.

I have tried uninstalling all the plugins I have one by one, but that did not resolve the issue. It is making it very frustrating to use QGIS because I need to wait every time I save a file.

Again, this is a recent issue and I have not yet worked out what changed that may have caused it.


texts: Building a web map with spatial search functionality

texts:
I have some population and thefts data as below:

I am able to geocode these and build a map of county polygons in QGIS with the attributes attached.

However, my final objective is to have a web map where the user should be able to type in a zip code which returns the number of total thefts and growth of thefts for all counties within a 50 mile radius. We need the map to be accessible on a ipad as well.

what tool to use for building such a web map?


texts: How to perform image classification with SemiAutomaticClassificationPlugin and BIP files?

texts:
I have multiband satellite images BIP format, Landsat TM/ETM containing 7/8 bands respectively along with a separate header file, some of them corrected by nearest neighbour classifier.

I'm working in QGIS and need to segment specific regions of these images. I saw good examples with TIFF images format, but when proceeding with BIP format the SemiAutomaticClassificationPlugin" gives me different kind of errors like not attribute is found in images, can't perform the instruction, or it's just not loaded.

Could someone guide me on this? Thanks a lot in advance.


texts: Determining elevation of a point from a DEM in QGIS?

texts:
I have created a series of DEMs that layercake on top of each other.

I would like to be able to lookup a coordinate and get the elevation that has already been interpolated.  The goal is to introduce a new data point (coordinate and elevation) and determine which layer of the cake the new point is closest to.

I am using QGIS.


texts: ST_Transform generates incorrect geometry data

texts:
I am trying to load latitude and longitude from a CSV file to PostgreSQL database table using a database function. The db function has the following code to transform the lng/lat to the proper point data:
"ST_Transform(ST_SetSRID(ST_MakePoint(longitude,latitude),4326),2272)".
The database table has a field called 'location' and is configured as : geometry(Point,2272).
It was working fine until I had to reinstall the database, and subsequently reinstalled PostGIS / GDAL / proj / etc.
Now, the db function generates a point data that is somewhere in Antartica. I compared the data by running
SELECT ST_Transform(ST_SetSRID(ST_MakePoint(-77.622917,40.67931),4326),2272);
and got '0101000020E0080000487BB57A23933E41987B010FC2ED1D41'.
Whereas if I run the same query in my test server, I get the correct result as:
'0101000020E0080000397BB57A23933E41987B010FC2ED1D41'
It's just a difference of 2 digits ( bolded ). How can I rectify this ?
dev server:
POSTGIS="2.4.4 r16526" PGSQL="100" GEOS="3.8.1-CAPI-1.13.3" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 3.1.2, released 2020/07/07" LIBXML="2.9.2" LIBJSON="0.15" LIBPROTOBUF="1.3.3" TOPOLOGY RASTER
test server:
POSTGIS="2.5.2 r17328" [EXTENSION] PGSQL="110" GEOS="3.7.0-CAPI-1.11.0 673b9939" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.3.1, released 2018/06/22" LIBXML="2.9.1" LIBJSON="0.12" LIBPROTOBUF="1.3.0" TOPOLOGY RASTER


texts: Grass 7 - where is r.regression.multi hiding?

texts: I compiled Grass 7 on Ubuntu and all works fine - except, I cannot find r.regression.multi. I installed it, yet it is nowhere to be found in the drop-down menus; r.regression.line is there and works, however.


texts: Can't resample two images with different coordinates and extents

texts:
I am very new to image analysis and GIS. I tried to resample a tiff file based on a reference raster, the following is the code and objects I have:

Green_stage_1:
class       : RasterLayer
band        : 1  (of  2  bands)
dimensions  : 7311, 6124, 44772564  (nrow, ncol, ncell)
resolution  : 0.08541, 0.08541  (x, y)
extent      : 225357.8, 225880.8, 2585532, 2586156  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=51 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : /Users/shu-yunchen/Desktop/UVA_related_articals/Images_for_testing/Image/20160929/reflectance/1214_multi_transparent_reflectance_green.tif
names       : X1214_multi_transparent_reflectance_green

RGB_1:
class       : RasterStack
dimensions  : 25223, 19462, 490890026, 4  (nrow, ncol, ncell, nlayers)
resolution  : 0.02973, 0.02973  (x, y)
extent      : 179774.1, 180352.7, 2583827, 2584577  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=51 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
names       : X1005_rgb_a7_transparent_mosaic_group1.1, X1005_rgb_a7_transparent_mosaic_group1.2, X1005_rgb_a7_transparent_mosaic_group1.3, X1005_rgb_a7_transparent_mosaic_group1.4
min values  :                                        0,                                        0,                                        0,                                        0
max values  :                                      255,                                      255,                                      255,                                      255

What I tried is resample the three layers of RGB_1 with Green_stage_1 as followed:

RGB_1_layer_green_resample_to_Green_stage_1=resample(RGB_1[[1]],Green_stage_1,method="bilinear")

What I got is an error message:

  Error in .intersectExtent(x, y, validate = TRUE) :    Objects do not
  intersect

This "resample" way worked well with my other two RGB files (RGB_2 and RGB_3) which the coordinate are:

+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0

So I tried to solve the different coordinate issue between RGB_1 and Green_stage_1, I tried:

RGB_reprojected <- spTransform(RGB,CRS(Green_stage_1))

Another error message I got:

  Error in !is.na(projargs) && !nzchar(projargs) :    invalid 'x' type
  in 'x && y'


texts: Showing GPS movements on map (Openlayers or Leaflet) using DB and GeoServer?

texts:
I have GPS unit which update the DB with Points every 10 seconds.
I want to show the position in real time (as much as I can) on map using OL or Leaflet.
What I did is serving the Point as Layer in Geoserver and using it as WMS layer and redraw it every 2s (to show update asap).

Thing is that this solution feels kinda slow/heavy on performance... and in Leaflet the WMS layer flickers every redraw.

Is there a better way to do such thing ?


texts: Get altitude through Trimble TDC 100 and Qfield

texts:
Good morning every one,
In our company we got Trimble TDC 100 and install Qflied for data collection. We collect points and polylines. Our aim is to get vertex and points while saving their altitude ( height above the mean sea level ).
When we work on the desktop project, we enable the "Z". But after the field collection, Z($geometry) just products " 0 " not the altitude. Please how to solve this issue ?
Thanks


texts: Extent is zooming map to 0,0 in ArcGIS API for Silverlight?

texts:
When I use this code (from the example):

        ESRI.ArcGIS.Client.Geometry.Envelope myEnvelope = new ESRI.ArcGIS.Client.Geometry.Envelope();
        myEnvelope.XMin = -130;
        myEnvelope.YMin = 5;
        myEnvelope.XMax = -70;
        myEnvelope.YMax = 65;
        mapControl.Extent = myEnvelope;

The map is centered over that ever-popular and fascinating point off the coast of Africa: 0,0.

What am I doing wrong?


texts: Reducing number of attributes (classes of marks) in marked point pattern using R?

texts:
I have a marked spatial point pattern loaded in R (from Shapefile). This dataset has 4 different "classes" of marks: class A, class B, class C and class D. Each class of marks is categorical. One can imagine it as an attribute table, where each class of marks is a new categorical attribute (or column).

Now I need to work with the dataset using only class of marks A. Saying in other words, I need to reduce my dataset to have only one attribute, not 4 as before. Using split() does not work for my case.

What is the command for doing that in R?


texts: Smart quotes in ArcGIS (titles, legends)

texts:
Is there a way to ask ArcMap to use "smart quotes" in map titles, legends, etc.? This is what I've currently got on my map:

I'd like the quotation marks and apostrophe to be curved instead. Pretty cartography includes good font choices, and smart quotes look nicer.


texts: Bad layers in QGIS 3.4 after copying a template folder into a new project folder

texts: I am working in QGIS 3.4.4. We have a template folder for all our QGIS maps. We then copy this folder into a new project folder and edit from there. One of the template maps uses a number of shapefiles from different sources. The template map will open as it should in QGIS from the original template folder and loads all the necessary shape files. However, when I make a copy of the template folder and paste this into a new project folder and try to open the same template map, the handle bad layers message returns. Could this have anything to do with the fact that I am using a VPN to work remotely from home and the projects and shapefiles are saved remotely on a drive? Let me know if there is any further information you need (I'm by no means a GIS expert).


texts: How to get the length of each line segment in a line shapefile in QGIS

texts:
I am new to QGIS. I drew a line depicting a small length of road. But I drew it in segments and then at last right clicked at the end point and gave id=1.

I extracted the nodes, their geometry. But what I need is the length of individual segment, its starting node coordinates, ending node coordinates.

for eg:

I need data in the attribute table as id;start_X;start_Y;end_X;end_Y;length

I have a large dataset of road network to be done in the same way.


texts: I have created an annotation feature class in Arc10 and when viewed within the database, looks great. However, whenever I go into catalog and export the annotation feature class to a shapefile, it turns the shapefile into a polygon layer. The Text is still within the attribute table, and when going into properties to set to proper fields, it does not display. I have only appended the annotation and have not feature linked them. This worked on dummy data, but now it is screwy on project data. Is there something that I am doing or a way to export annotation within a .mdb to a .shp?


texts:
I'm trying to set the extent of a square feature to the canvas, that works in QGIS, but when I print the canvas into a PDF, it always gives me some empty area, below is the screenshot of QGIS canvas having feature extent:

and below is the resulting PDF having empty spaces:

the pyqgis code used to get these results:

from qgis.core import *

mr=iface.mapCanvas().mapRenderer()
composition = QgsComposition(mr)
composition.setPaperSize(220, 220)
composerMap=QgsComposerMap(composition,0,0,composition.paperWidth(),composition.paperHeight())
composition.addItem(composerMap)

layer =  QgsVectorLayer('Polygon?crs=EPSG:4326', 'poly' , "memory")
pr = layer.dataProvider()
poly = QgsFeature()
poly.setGeometry(QgsGeometry.fromWkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))"))
pr.addFeatures([poly])
layer.updateExtents()
QgsMapLayerRegistry.instance().addMapLayers([layer])
bb =  poly.geometry().boundingBox()
iface.mapCanvas().setExtent(bb)
iface.mapCanvas().refresh()
composition.refreshItems()
composition.exportAsPDF('test.pdf')


texts: How to color SVG symbols in QGIS 2.18.14?

texts:
Why can I color some SVG symbols, but not others?

At symbol # 1 I can change the color, but not the others.

In the XnView viewer, the symbols are shown differently.

What qualifies an SVG symbol to change the color?

Even editing it in Adobe Illustrator, I do not understand what's happening!


texts:
I'd like to convert a whole folder of files from GRD to MRR. Is this possible in mapbasic or from the interface or do I need to do them file by file?

I have tried to searching in the mapbasic forums for code for mrr conversions but not found any and the mapbasic window does not show any code in MI Pro.


texts: How can i upgrade geoserver on a geonetwork install?

texts:
I have a default geonetwork install with Jetty and geoserver but i would like to upgrade to the latest (unstable) build of geoserver instead of the stable version it comes with.

Any ideas how i can do this?

I don't mind reinstalling everything from scratch if i have to.

I'm running Windows Server 2008r2 sp1.


texts: Eliminate selected polygons in QGIS not working properly

texts:
I have a vector layer with classified slopes in percentage (three classes). I vectorized that layer from a raster.
I want to eliminate all the small polygons from certain surface. I selected the polygons after calculating the area. I have this selection.

After selection I run the tool "Eliminate selected polygons" and I select to merge them with the neighbour with biggest area. The result is very bad. It eliminates some big polygons and keep some of the selected ones.

There is not options in the tool so I don't know what else to do or why it happens. All the polygons are valid.
Some idea?