texts: QgsMapCanvas has no attribute 'setLayers'?

texts:
I would like to construct a GUI using PyQt4 and qgis outside of the main QGIS application. I found this tutorial which provides some indications on how to do this. I am looking to build something similar.

I was able to open up the MapCanvas object as shown in the PyQGIS cookbook using the following script. I also kept the parts where they were adding buttons for zooming, panning, etc

from qgis.gui import *
from qgis.core import *
from qgis.PyQt.QtGui import QAction
from qgis.PyQt.QtCore import SIGNAL, Qt
from qgis.PyQt.QtWidgets import QMainWindow

class MyWnd(QMainWindow):
    def __init__(self, layer):
        QMainWindow.__init__(self)

        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor(Qt.white)

        self.canvas.setExtent(layer.extent())
        #self.canvas.setLayers([layer])

        self.setCentralWidget(self.canvas)

        self.actionZoomIn = QAction("Zoom in", self)
        self.actionZoomOut = QAction("Zoom out", self)
        self.actionPan = QAction("Pan", self)

        self.actionZoomIn.setCheckable(True)
        self.actionZoomOut.setCheckable(True)
        self.actionPan.setCheckable(True)

        self.actionZoomIn.triggered.connect(self.zoomIn)
        self.actionZoomOut.triggered.connect(self.zoomOut)
        self.actionPan.triggered.connect(self.pan)

        self.toolbar = self.addToolBar("Canvas actions")
        self.toolbar.addAction(self.actionZoomIn)
        self.toolbar.addAction(self.actionZoomOut)
        self.toolbar.addAction(self.actionPan)

        # create the map toolsq
        self.toolPan = QgsMapToolPan(self.canvas)
        self.toolPan.setAction(self.actionPan)
        self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
        self.toolZoomIn.setAction(self.actionZoomIn)
        self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
        self.toolZoomOut.setAction(self.actionZoomOut)

        self.pan()

    def zoomIn(self):
        self.canvas.setMapTool(self.toolZoomIn)

    def zoomOut(self):
        self.canvas.setMapTool(self.toolZoomOut)

    def pan(self):
        self.canvas.setMapTool(self.toolPan)

QgsApplication.setPrefixPath(r"C:\Program Files\QGIS 2.18", True)
qgs = QgsApplication([], True)
qgs.initQgis()
layer = QgsVectorLayer(r'path\to\layer\layername', 'layername')

w = MyWnd(layer)
w.show()

qgs.exec_()
qgs.exitQgis()

When I run this I get the MapCanvas in a GUI type environment with no issues. However if I uncomment line 15 self.canvas.setLayers([layer]) I get an error message:

>>> execfile('test.py')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "test.py", line 60, in <module>
    w = MyWnd(layer)
  File "test.py", line 15, in __init__
    self.canvas.setLayers([layer])
AttributeError: 'QgsMapCanvas' object has no attribute 'setLayers'

Why does this occur?

How can I set layers to the MapCanvas outside of the qgis application?

Following  an answer below I have modified line 15 to self.canvas.setLayerSet([QgsMapCanvasLayer(layer)]) however what I am getting now is a blank map canvas with nothing on it.

Why is this occuring?


texts: Filled Polygons on the Edge of a Map - ArcMap 10.1

texts:
Today while making a map I encountered a problem with the fill from one of the displayed polygons flooding the whole map:

Notice the upper right corner where the polygon appears hollow, it should have the dots inside of it, not the other way around.

Thinking back to my days of playing with MS Paint it occurred to me that the fill was acting like the 'Flood Fill' tool does when the area you are trying to fill isn't entirely closed.

On a whim, I moved the map slightly to the west, so that the polygon didn't break on the edge of the map, and amazingly, the problem immediately dissappeared:

So, the question here is: Has anyone else encountered this type of drawing error?  And secondarily, WTF?!


texts: Given a collection of polygons, how do you find which one contains a given point? Java or Python

texts: I'm looking for Java or Python libraries that will help me answer this question efficiently: given a collection of polygons (via shape files or GeoJSON), which one of them contains a given point? The overall objective is to compute counts of points by polygons.


texts: Changing field values on a attribute table using GDAL/OGR (ESRI Shapefile)?

texts:
I am trying to create a new column on attribute table of my shapefile.
This table must be the FID formatted with 4 (or any number) digits (for instance: 0 = 0000, 1 = 0001, 2 = 0002...)
but I just can't, I must be missing something, I already take a look on other users codes and I cannot find my bug... My code just add a new column, but doesn't write anything...
def iterable_field_creator(shp_path, number=2 or 3 or 4):
    import ogr

    # Checking if parameter is a shp, create driver, datasource and layer
    if shp_path.endswith(".shp"):
        DriverName = "ESRI Shapefile"
        driver = ogr.GetDriverByName(DriverName)
        datasource = driver.Open(shp_path, 1) # 1 para escrever
        lyr = datasource.GetLayer()
        feature = lyr.GetNextFeature()
    else:
        print("\033[31mNOT A SHAPEFILE\033[m\n"
              "The program will be closed")
        quit()

    # Add new field on Att table (ID_it)
    idField = ogr.FieldDefn("ID_it", ogr.OFTString)
    idField.SetWidth(number)
    lyr.CreateField(idField)

    ### I did try this way before
    # for features in lyr:
    #     fid = features.GetFID()
    #     id_it = formating_number(str(fid), number)
    #     feature = lyr.GetFeature(fid)
    #     print("The feature FID nº \033[31m{}\033[m will be called \033[33m{}\033[m on ID_it field!!!".format(
    #         fid, id_it))
    #     feature.SetField(id_it, "ID_it")
    # del features
    #

    while feature:
        fid = feature.GetFID()
        id_it = formating_number(str(fid), number)
        feature.SetField("ID_it", str(id_it))
        print("A feição de FID nº \033[31m{}\033[m terá o Identificador iterável de código \033[33m{}\033[m!!!".format(
            fid, id_it))
        feature = lyr.GetNextFeature()

    datasource.Destroy()

    osgeo = None
    ogr = None
    lyr= None
    driver = None
    DriverName = None


texts: Abnormal Output of OpenDroneMap with GCP file

texts:
I am using a gcp_list.txt file with the following text:

I am supposed to get a geo-referenced mesh object like this:

But, I am getting something like this:

I am running ODM locally in ubuntu 16 following their doc provided here: https://github.com/OpenDroneMap/ODM

It's written here that if I provide a file named gcp_list.txt, it will automatically detect it. So, I have placed the gcp_list.txt file in the folder with images and run it according to the doc without any extra flag setting.

What am I doing wrong?


texts: "Request contains a format not offered by the server." Error when using CRS transformation with WMS in QGIS

texts:
When I try to load a WMS layer which has a WSG84 as a default projection and use a CRS transformation on it, it gives this error message:

Request contains a format not offered by the server.
The WMS vendor also reported:
Parameter 'width' contains unacceptable value.

The default projection I use for my project is S-JTSK Krovak (Greenwich) projection with WGS84 correction:

+proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222
+k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=greenwich +units=m +no_defs
+towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56

At a zoomed-out view (whole Czech Republic displayed), it displays correctly, but when I zoom in, the error above occures and the layer fails to display. Any advise on what should I do?
Also, the WMS layer I use is http://geoportal.gov.cz/arcgis/services/CENIA/cenia_rt_II_vojenske_mapovani/MapServer/WMSServer

Thanks.


texts: QGIS adding numeric value to algorithm into modeler

texts:
Aim:
i would like to create a model that allows my user to select records from a table between two years.
Methodology:
i am using modeler in QGIS LTR 2.14.9 (win is the OS of my PC) table A is a vector file (point), select by expression is the algorithm which should run the following expression:
"date" >= start_year AND "date" <= end_year
where start and end year are two numbers.

I try to add to the model two parameters (numbers) called start_year and end_year with a min/max values 1800/2050

I would like to see these two parameters taken as input in the expression i wrote in the select by expression algorithm but i am not successful.
I have checked on StackExchange and i came across this previous post:

How to multiply a user-defined input parameter with a field value within the graphical modeler?

Is creating a script still the only solution or there is another one for people without coding experience?


texts: How to show text display from two layers in QGIS 3.4

texts: I have two layers. I want to show text display from two layers when mouse hover on layer. It can be ?


texts: How to create/obtain district data for Singapore?

texts:
I am newbie in GIS and have started using QGIS. I am hoping to map all districts of Singapore and create a Shapefile and get GeoJSON details for all districts. I am not able to find that currently.

So what I thought of doing after looking on internet is:

Get a base map layer (something like Google Map OR OpenStreetMap) and load in QGIS using Plugins
Load another image file  on top of it which has districts mapped to it.
Make that image file layer transparent with borders.
Create polygons for each districts
Save that as Shapefile and export as GeoJSON

This is what I thought based on tutorial I followed.

https://github.com/mtop/speciesgeocoder/wiki/Tutorial-for-creating-polygons-in-QGIS

But, this was done for the entire world map. How can I do it for Singapore as I am not able to find TIFF file for Singapore districts.

I only have shapefile for Singapore country.


texts: Arcmap [ArcView License only] 10 labels at different scales

texts:
Is it possible to have different labels at different scales (without duplicating layers)?

For e.g. I have loads of point shapefiles and would like to label them with ID, Name and postcode.

My idea was to give more information as we zoom in - meaning
1) at full extent - no labels
2) at 1: 1,000,000 - ID only
3) at 1: 500,000 - ID and Name
4) at 1: 100,000 - ID, Name and Postcode

Any ideas or thoughts?


texts: Joining multiple lines into single line in ArcGIS Desktop?

texts:
In ArcGIS, I have digitized roadmap in shapefile, and i want to join several lines into one (singlepart) line, NOT merging (i.e., I want to join from one's node to another node). The feature exist in QGIS using "join multiple lines" plugin.

How do I perform the task in ArcGIS Desktop?


texts: Iterate Feature Selection freezes in ArcGIS Pro 2.7

texts:
I'm recreating a model on ArcGIS Pro 2.7 that I have used in the past on ArcMap 10.7.1.  It is a model that takes a selected parcels layer, iterates through each selected parcel to find the addresses within them, and replaces the PIN in the address with the PIN in the parcel.
It works flawlessly in ArcMap, but for some reason, the Iterate Feature Selection function freezes upon starting in ArcGIS Pro.  I have created a very simple model that uses my selection of 3 parcels.  When I hit run, the model freezes at the Iterate Feature Selection process.  The only way to stop it is to Task Manager out of ArcGIS Pro.
I know we can still use ArcMap since it works there but would like to get it running on ArcGIS Pro as well. We have deleted and recreated the model and rebooted the workstation. No luck.
Any thoughts as to what is going on with ArcGIS Pro?


texts:
Continuing the strenuous trial of generating the viewshed for the points, from
QGIS viewshed plugin returns error I am still getting an error:

  Traceback (most recent call last): File
  "C:/Users/mariuszk/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\viewshed_raster.py",
  line 233, in processAlgorithm refraction = refraction ) File
  "C:/Users/mariuszk/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\modules\Raster.py",
  line 147, in set_master_window self.window = np.zeros((full_size,
  full_size)) MemoryError: Unable to allocate array with shape (9600001,
  9600001) and data type float64 Execution failed after 1.26 seconds

I do not know where the problem is and how to encounter some steps, which I couldn't find.

Basically I have:

Points prepared - imported in the CSV comma delimited layer, which has been added as a vector layer, and saved as a point SHP layer with the random geometry.
I have also the DEM incorporated as a raster layer.

So, now I am following the steps in the Viewshed plugin, selecting the observer location and the DIgital Elevation model (in my case the .tif file).
Then atmospheric refraction remains default and earth curvatore is selected.
With or without output file, the result is the same.

Moreover this error appear also when I select another Visibility options like "Depth below the horizon" or "Create viewpoints", etc. This error is EXACTLY the same:

self.window = np.zeros((full_size, full_size))

  MemoryError: Unable to allocate array with shape (9600001, 9600001) and data type float64

I did a deep searching throughout the web and I found as follows:
This plugin works on the different way in QGIS 3x
Error memory on Viewshed Analysis plugin QGIS
https://github.com/zoran-cuckovic/QGIS-visibility-analysis/issues/17

where the way of using it is different, the best explained here:

https://landscapearchaeology.org/2018/visibility-analysis-0-6/

It looks like is a lack of information between the DEM stage and using this plugin.

The video below:
https://www.youtube.com/watch?v=fGKgvg0QoXA&t=124s

could explain it the best, but again - they have all stuff ready prepared - points & dem), whilst DEM looks like 3D instead of raster.

The tutorial for GIS 3x mentions the "Processing » Graphical Modeller", but to be honest apart from the screenshot (coming from QGIS 2.8) I don't know how to set these scripts.

Could anyone advise how to make this plugin usable?


texts: MapServer: msWMSGetCapabilities(): WMS server error. WMS request not enabled

texts:
I took a look at Getting MapServer to show raster?, and although helpful, it did not solve my issue.

After spending the last couple days on this, I am confused as to why I'm getting:

msWMSGetCapabilities(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings

I've tried

"wms_enable_request" "*"

along with

"ows_enable_request" "*"

both in METADATA under WEB and METADATA under LAYER

As for my URL, I am using:

http://192.168.2.164/cgi-bin/mapserv.exe?map=/data2/html/OL_AllWorldAirports/catest.map&SERVICE=WMS&REQUEST=GetCapabilities

I initially had the VERSION set too (to 1.1.1) but I read somewhere this is not a necessity.

/tmp/mapserver3.log is not providing much help.

In regards to how the mapfile(s) and data are set up:

-I have one mapfile which has one layer. Within that layer, I reference another mapfile. The mapfile (catest.map) being referenced uses an OGR connection and connects to a .db file.

See here for the mapfiles: https://gist.github.com/DavidPardy/5911943

I feel that I'm close and have some glaring error somewhere, but not sure where to pinpoint it.


texts: Background reading on using GPUs for GIS?

texts: I'm interested in the emerging intersection between GIS systems and GPUs, which can provide orders of magnitude improvement to certain classes of GIS problems. Do you know of any good resources discussing this area?


texts: Multiple Leaflet maps on web site in different divs

texts:
I'm pretty new to leaflet.js and I'm trying to figure out how to assign the same map with the same set of options and layers to a different HTML container instead of having to remove and add a new one every time?

I used to deal with OpenLayers 2 and I had map.render(div); option every time I wanted to set map to another div.

Is there solution to this?


texts: calculate least cost pathways for a region and create distance rasters to rivers

texts:
How do you calculate all the least cost pathways that exists for a region? I would like the output map to display all routes (and was wondering whether this can be done in one set of operations). I want to determine this by taking into account two things: slope and valley floors.

I have been informed that I need a DEM raster, and distance rasters to valley floors and rivers. I have a river system shapefile (once is in a polygon and the other is in a line format) but I don't know exactly how to create these rasters. As it stands, this is what the DEM raster and the riverways shapefile look like:

I have followed the tutorials in ArcGIS help 10.1 but I just don't seem to be going anywhere. I am able to create least cost pathways between two points based solely on slope, and I have tried reclassifying via building models but have been unsuccessful in creating images that display meaningful results - I think the biggest issue is inputting or creating distance rasters to valley floors/rivers and combining that with the slope raster.

Can anyone explain in layman's terms how I could create distance rasters to valley floors/rivers from a polygon or line shapefile and how this can be combined with a slope raster to create an output map displaying all existing least cost pathways for a selected study area?

Please, any help, advice, suggestions or comments would be immensely appreciated!


texts: Google Earth Engine "Land Cover Dynamics Yearly Global" (MCD12Q2.005) visualization problem?

texts:
I am currently trying to explore the MODIS Land Cover Dynamics dataset using Google Earth Engine. However, when I runned the snippet proposed on the GEE page, i.e.:

var dataset = ee.ImageCollection('MODIS/MCD12Q2')
                  .filter(ee.Filter.date('2014-01-01', '2014-05-01'));
var vegetationMaturity2014 = dataset.select('Onset_Greenness_Maximum1');
var vegetationMaturity2014Vis = {
  min: 0.0,
  max: 32766.0,
  palette: ['0f17ff', 'b11406', 'f1ff23'],
};
Map.setCenter(6.746, 46.529, 2);
Map.addLayer(
    vegetationMaturity2014, vegetationMaturity2014Vis,
    'Vegetation Maturity 2014');

the output does not match the preview on the GEE page. In fact, what I am assuming to be a color scale instead appears as a single color. I have tried changing the dates, the max vis value, the band selected, yet none of these actions has any incidence on the fact that the map is a single color. Is the dataset faulty? Am I doing something wrong?


texts: Is "Hawth's Tools" available for ArcGIS 10?

texts:
I am  looking for Hawth's Tools for ArcGIS 10.  Is it available?
I found that similar functions are in the new program Geospatial Modelling Environment (GME), but Hawth's Tools for ArcGIS 10 is not visible yet.

Can anyone help me?


texts: Best algorithm to trace stream network in flat areas

texts: I want to ask you what method do you suggest me for to trace stream network in flat areas and please explain me how to deal with the previous preparation of the DEM.


texts: How to pass an argument to an event function in OpenLayers?

texts:
I am loading to my map two KML layers for which I add a quasi-similar featuresadded event :

layerICPE = new OpenLayers.Layer.Vector(
    "ICPE (Installations Classées pour la Protection de l'Environnement)", {
        projection: "EPSG:4326",
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.HTTP({
            url: "kml/icpe.kml",
            format: new OpenLayers.Format.KML({
                extractStyles: false,
                extractAttributes: true
            })
        }),
        styleMap: styleICPE
    }
);

layerICPE.events.on({
    featuresadded: function(evt) {
        $.ajax({
            type: "GET",
            url: "appel_bdd.php?layer=icpe",
            async: true,
            dataType: "json",
            success: function(data) {
                var taille = evt.features.length;
                for (var i = 0; i < taille; i++) {
                    var feat = evt.features[i];
                    feat.attributes = data[feat.attributes.ID.value];
                }
                evt.object.redraw();
            }
        });
    }
});

layerVoieFerree = new OpenLayers.Layer.Vector(
    "Voies ferrées", {
        projection: "EPSG:4326",
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.HTTP({
            url: "kml/voie_ferree.kml",
            format: new OpenLayers.Format.KML({
                extractStyles: false,
                extractAttributes: true
            })
        }),
        styleMap: new OpenLayers.StyleMap({
            'default': styleVoieFerree
        })
    }
);

layerVoieFerree.events.on({
    featuresadded: function(evt) {
        $.ajax({
            type: "GET",
            url: "appel_bdd.php?layer=voie_ferree",
            async: true,
            dataType: "json",
            success: function(data) {
                var taille = evt.features.length;
                for (var i = 0; i < taille; i++) {
                    var feat = evt.features[i];
                    feat.attributes = data[feat.attributes.ID.value];
                }
                evt.object.redraw();
            }
        });
    }
});

The only different thing is the value of the variable in the url.
Since I will have to add this event to 16 layers, I would like to create a generic function with this value in parameter.

I have isolated the function :

ajoutAttributs = function(evt) {
    var nomlayer = 'icpe';
    $.ajax({
        type: "GET",
        url: "appel_bdd.php?layer=" + nomlayer,
        async: true,
        dataType: "json",
        success: function(data) {
            var taille = evt.features.length;
            for (var i = 0; i < taille; i++) {
                var feat = evt.features[i];
                feat.attributes = data[feat.attributes.ID.value];
            }
            evt.object.redraw();
        }
    });
};

layerICPE.events.on({
    featuresadded: ajoutAttributs
});

I can't figure how to pass 'nomlayer' as an argument to the function.

I have tried :

ajoutAttributs = function(nomlayer, evt) {...};

layerICPE.events.on({
    featuresadded: ajoutAttributs('icpe', evt)
});

==> Uncaught ReferenceError: evt is not defined

ajoutAttributs = function(nomlayer, evt) {...};

layerICPE.events.on({
    featuresadded: ajoutAttributs('icpe')
});

==> nomlayer gets the correct value but evt is undefined

What am I doing wrong ?
How can I pass an argument to this function and avoid typing it 16 times ?

Thanks.


texts:
I'm trying to convert a GeoJSON Coordinates Point to latitude and longitude format, but I don't know exactly which is the format they have or which is the coordinate system they are expressed in.

I know this: I have a point and I know the latitude and longitude of that point. For example, [5438568.711686796, 6354981.321006546] should be latitude: -32.946403 and longitude: -60.656932.


texts: Increasing Resolution of Image By Splitting Image Pixel into Smaller Pixels | Google Earth Engine?

texts:
I have two MODIS satellite images with same custom band, one of 1000m/px resolution and other of 250m/px. I want to compute their mean 'image' and display as map layer.
My current way of achieving this is as follows:
var img_col = ee.ImageCollection(img_1.select('DP1'), img_2.select('DP1));
img_col = img_col.mean();
Map.addLayer(img_col, params_obj);

But this does not result in raster image with 250m/px resolution. How to specifically generate image with resolution equal to the highest of two initial images?


texts: Custom functions for SAVE and CANCEL on Leaflet.draw edit control

texts:
I have added an edit control on my map which is working fine (On the Frontend);

var editControls = new L.Control.Draw({
      draw: false,
      edit: {
        featureGroup: this.updateGeomLyr
      }
    }).addTo(this.map);

Now, when I save or cancel my changes, the event "draw:editstop" is called

this.map.on("draw:editstop", e => {
      this.updateGeomLyr.clearLayers();
      this.overlapLyr.clearLayers();

      //if saved;

      //if cancelled,
    });

But I want separate backend functions to be called on SAVE ad CANCEL. I couldn't find any attribute in the event "e" which shows if save is called or cancel.


texts: Counting number of polygons inside zone using QGIS?

texts:
I've seen a lot of questions about counting the number of points within a polygon but my question is I have 1 vector layer with polygons showing past landslides that have occurred and another 206 layers with each one of the layers representing a catchment. I need to count the number landslides that have occurred within each catchment. The only suggestion so far was to use "count points in polygon" but some landslide polygons span multiple catchments so if I convert the landslide polygons to points, I'm worried it would be much smaller than the actual polygon and wouldnt represent that the landslide spans multiple catchments.

Any tips?


texts: Inserting polygon centroids into an additional column in PostGIS

texts:
I'm trying to calculate the x and y centroids for a table using ST_Centroid. The documentation says that it returns the geometric center of a geometry. I first made a column X:

ALTER TABLE "test_table" ADD X double precision;

and was then planning on storing the x component of the centroid there. My code to calculate the centroid is as follows:

select
  ST_Centroid(a.the_geom)
FROM
  "test_table" AS a

However this query returns the following result which I don't understand:

"01010000006BAEC2FBDFC61E415B3E9E2946520541"
"0101000000E6ABADEBFEC51E4102E9A95858520541"
"01010000003233333321C61E410BD7A37061520541"
"0101000000F710787300C61E4177C8C783D94E0541"

My second problem with this approach is trying to store the result. When I tried to insert this result into Column X I could not figure out the correct syntax. What I tried using was:

INSERT INTO "test_table" (X)
VALUES ( ST_Centroid(a.the_geom) ),
FROM "test_table" AS a

and also

INSERT INTO "test_table" (X)
VALUES ( SELECT ST_Centroid(a.the_geom)
FROM "test_table" AS a)

but neither of these work.

My two very basic questions are (1) what is the value being returned by ST_Centroid, and (2) how I can I insert the result into an existing table?


texts: Coordinate extraction in a different projection in MapInfo

texts:
I have a .TAB file of polyline objects in British Grid Coordinate.
I need to extract the end points/nodes of each polyline and find their latitude/longitude (WGS84).


texts:
I have a series of attribute tables that already have date-time, but I need to add a "time of day" attribute. Time of day is defined as one of the following four: "crepuscular_am," "crepuscular_pm," "diurnal," or "nocturnal". Crepuscular is within 60 minutes of sunrise or sunset. Diurnal is while the sun is up, nocturnal is while the sun is down. I have an .xls table with all the sunrise and sunset times, but I'm at a total loss about how to start tackling this complicated problem.

EDIT:

This is probably obvious, but the sun rises and sets at a different time each day.

EDIT2:

Here is an example of what my data looks like. Table 1 is the ARC attribute table where I need the "Time of Day," data. Table 2 is an excel spreadsheet with sunrise and sunset times.

EDIT3:

I changed the format of Table 2, which, if I understood correctly, is what was suggested (this continues for 731 rows).


texts: Determine neighborhood of coordinate pair

texts:
I have a data set consisting of coordinates in Los Angeles, which I plotted using ArcMap on a shapefile:

My goal is to determine the respective underlying neighborhood name as listed in the shapefile for each coordinate pair. I only found the spatial join function which calculated a count of coordinate pairs in each neighborhood. However, I would like to know for each coordinate pair the corresponding neighborhood name.

Under the spatial join it only calculates a count in the shapefile data. My goal is however to have next to each coordinate name the respective "slug" name from the shapefile data.

I tried using the spatial join as suggested below, using the following parameters, where sheet 1 are the test coordinate pairs which I would like to have matched the name field of the shapefile to:

Now I get the following error message, which I don't understand:

What am I doing wrong?


texts: What if 'geometry_columns' already exists in MSSQL Server Database?

texts:
When trying to load a .SHP into MSSQLSpatial using OGR2OGR, I get the following error:

ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Dr
iver][SQL Server]There is already an object named 'geometry_columns' in the data
base.

I can see the entries using this query:

SELECT *
FROM giswork.INFORMATION_SCHEMA.COLUMNS
where table_name like 'geometry%'

And the result looks like this:

And If I dig deeper with this query:

select * from matthew_baker.geometry_columns

I get a set of empty results:

My questions:

What should be in the geometry_columns table (if it's not there already...)
Why does og2ogr throw the error about the geometry_columns table already being created?

EDIT: It seems that GDAL created these tables when I tried to use the OGR2OGR command - they have not been in my database until now. My current spatial data was created using FME and is updated with FME.

I can view AND edit my MSSQLSpatial tables in QGIS 2.10 without any issues, across multiple schemas in my database.


texts: Error in executing query while selecting features on map

texts:
I'm working on an ArcMap add-in that attempts to streamline doing feature class queries.  It mostly works, but there is one bizarre behavior that I'm attempting to track down.

There is one Feature Class in our database that gives slightly wonky results.  In almost all cases, it works fine, but if its layer is set to be visible, I cannot use the selection tool on the map.  Any attempt to do so comes up with 'There was an error executing the query' (it doesn't specify which layer is causing that, but setting that layer to be invisible does get rid of the error).

Now, the test data I'm using has three records in that Feature Class, and everything looks fine (the Shape fields, for instance, do have the expected Point values).

But it gets a bit weirder.  If I add that same feature class via File->Add Data->Add Data, it creates a Query Feature Class (usually I get an 'SDE Feature Class'; does that have something to do with whether the Feature Class is registered?).  There is no where clause in that Feature Class (neither in the Query itself, nor in the Definition Expression.  Nor was I given a chance to specify one in the creation process), but only two of the three records appear.

In fact, if I specify a DefinitionExpression of "Name='A'" (the value for the record that doesn't appear), nothing appears.  And if I explicitly set the where to "1=1", that is the same as having no DefinitionExpression.

Perhaps most importantly, however, having that Query Layer visible on the map does not impede selecting features.

And as a final data point, setting a where clause on my programmatically-created layer of "Name <> 'A'" (or something similar that rules out the record not appearing in the manually-created layer) does not help.  Selection still fails in every case I've tried.

Does anyone have any suggestions for what is going on or what else can I look at to get a better idea what it is?

If it matters, the database backing the feature class is SQL Server.


texts:
What could be the best solution for this?

I'm looking for the simplest way to create an online map with 3000 photos in it. I'm looking for batch upload (say, upload all the photos in a folder). Should be a very simple map with photos in it.


texts: ONS Open Geography Portal API Usage for boundaries

texts:
Is it possible to retrieve json/geojson boundaries using the ONS Open Geography Portal API, if so how?

I have got my apikey and gone through the documentation though I am not seeing any mention of boundary data.

If you visit the page http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0

The API dropdown gives links like the ones below:

http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0.geojson

And the link for a filtered dataset is showing as:

http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0.geojson?where=&geometry={"xmin":-7777680.618944722,"ymin":6062179.402493376,"xmax":7113475.483456216,"ymax":8997361.288643364,"spatialReference":{"wkid":102100,"latestWkid":3857}}

Visiting the related site http://statistics.data.gov.uk/ you can retrieve a json boundary from a url like below which is more what I was expecting.

http://statistics.data.gov.uk/boundaries/E05009755.json


texts: Comparing distances between old and new Esri geocode locator points

texts: I need to check the accuracy of the locators between Esri's Streetmap 14_2 and Streetmap 15_1. The two layers need one to one distances measured between points that have the same attributes i.e. same address, city, state, and zip. The tables are exactly the same essentially with the exception of X and Y coordinates. Would the point distance tool be the best option? A colleague suggested the point distance tool and selecting the points individually. With 150 million records, that seems like it would take a while. Any suggestions?


texts: How to use GRIB data in ArcGIS? (Zonal Stat as Table)

texts:
I am trying to calculate zonal stats as table with a python script for 45 .grib files from the ERA-40 Monthly Mean of Daily Mean database (http://data-portal.ecmwf.int/data/d/era40_moda/) for certain country shapefiles. I know that the data is in Kelvin rather than Celsius. But when I do it manually it's not working.
I also have the same data in NetCDF format if that changes anything. But even in nc format, the zonal stats are not computing.
Does anyone have any experience with using .grib and calculating zonal stats?
Help please!


texts: CARTO weighted heatmap with variable range per point

texts:
I'm trying to do a Heatmap with carto but seems that torque considers each point equal in covered range but my data consists in values from antennas that cover different ranges (and i need that granularity).

Is this possible? Do I have to preprocess my data or use another tool?

I tried to draw every point instead of using torque but then I've got graphical glitches on the zoom

Carto CSS for that:

#heatmap {
  image-filters: colorize-alpha(blue, cyan, lightgreen, yellow , orange, red);
  marker-file: url(http://s3.amazonaws.com/com.cartodb.assets.static/alphamarker.png);
  marker-allow-overlap: true;

  [value > 1] {
    marker-opacity: 0;
  }
  [value > 10] {
    marker-opacity: 0.2
  }
  [value > 100] {
    marker-opacity: 0.4
  }
  [value > 1000] {
    marker-opacity: 0.8
  }
  [value > 10000] {
    marker-opacity: 1
  }

  [zoom>=0] {
    marker-width: [range] * 1;
  }
  [zoom>=1] {
    marker-width: [range] * 2;
  }
  [zoom>=2] {
    marker-width: [range] * 4;
  }
  [zoom>=3] {
    marker-width: [range] * 8;
  }
  [zoom>=4] {
    marker-width: [range] * 16;
  }
  [zoom>=5] {
    marker-width: [range] * 32;
  }
  [zoom>=6] {
    marker-width: [range] * 64;
  }
  [zoom>=7] {
    marker-width: [range] * 128;
  }
  [zoom>=8] {
    marker-width: [range] * 256;
  }
  [zoom>=9] {
    marker-width: [range] * 512;
  }
}


texts: Auto-incrementing in Python Script with ArcPy cursor?

texts:
I want to autoincrement values in a field within a Python script. I've done this using Field Calculator and the code referenced here. I tried using this code in the Python script below but it is not working.

#Import modules
import os, sys
import arcpy

#Set variables
workspace = "D:\\GIS\\data.gdb"
arcpy.env.workspace = workspace
table_name = "data_table"
field = "KEY_2" #Short integer field

#This is the function I want to use on my KEY_2 field
rec=0
def autoIncrement(field):
    global rec
    pStart = 10
        pInterval = 2
    if (rec == 0):
        rec = pStart
        return rec
    else:
        rec += pInterval
        return rec

field = autoIncrement()

I get a TypeError when I run this code:

Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\pythonwin\pywin\framework\scriptutils.py", line 312, in     RunScript
    exec codeObject in __main__.__dict__
  File "D:\Python\scratch\sc3.py", line 23, in <module>
   field = autoIncrement()
TypeError: autoIncrement() takes exactly 1 argument (0 given)

I've moved things around in the script a bit but have not yet gotten my field to populate. Anyone have a suggestion?

Here's my final code, based on blord-castillo's answer:

#Import modules
import os, sys
import arcpy

#Set variables
workspace = "D:\\GIS\\data.gdb"
arcpy.env.workspace = workspace
table_name = "data_table"
field = "KEY_2" #I made this a text field
rec=0

def autoIncrement(pStart = 10,pInterval = 2): #Using default values instead of setting     inside function
    global rec
    if (rec == 0):
        rec = pStart
        return rec
    else:
        rec += pInterval
        return rec

incrementCursor = arcpy.UpdateCursor(table_name) #There is no guarantee of order here
for row in incrementCursor:
    row.setValue(field, str(autoIncrement()))
    incrementCursor.updateRow(row)

del incrementCursor


texts: Raster Published as Tile Layer Not Displaying on AGOL

texts:
I have a raster layer given to me by a colleague. I was able to successfully publish and view it on ArcGIS Online as a tile layer, but now I'm trying to resample it to reduce the size and am starting to see some weird behavior - not only am I not able to successfully view a resampled version, I'm unable to re-publish the original tile layer. Here's the information I've collected so far:

The original layer shows up correctly when I add it as a weblayer set to cache on the server.
It shows up in a gray box when I look at the tile layer or the service definition on ArcGIS Online.
It's 43 MB as a tile layer, 102 MB as a service definition. Its visible range was set by default to state-metropolitan area

When I use the resample tool to resize the raster pixel size from 30m to 50m and then publish as a web layer, it publishes without errors but does not show up when I view it with MapViewer (new or classic).
It does not show up in a gray box when I look at the tile layer or the service definition on ArcGIS Online.
It's 6MB. Its visible range is set by default to state-metropolitan area.

When I re-upload the original layer, it also publishes without errors but does not show up correctly when I view it with MapViewer.
It does not show up in a gray box when I look at the tile layer or the service definition.
It's the same size as the original as a service definition, 102 MB. It's only 21 MB as a tile layer.


texts:
I am trying to use polygon coordinates to plot polygons on GeoTIFFs of satellite images using gdal or rasterio, yet somehow I keep failing. There is two things I want to do:

create a mask with only the polygon as data and the rest as nodata, and
overlay the mask on the image to see how accurate the polygons are.

I simply do not know how to create a mask and overlay it in gdal in python when starting from WKT or GeoJSON strings.

I have the GeoTIFF loaded (and can plot it), and have the polygon coordinates in wkt and geojson format (and also as a geometry object). I can also transform the coordinates to and from desired projections. But I simply have no idea how I can overlay them on an image in GDAL or Rasterio to check the accuracy of the polygon (or better yet: create a separate mask which I can plot on top of the image).

Here is an example of a polygon I have in wkt in EPSG 4326:

'POLYGON ((5.5937209 52.24012314 0,5.5936411 52.24048512 0,5.59413417 52.2415213 0,5.59434149 52.24151408 0,5.59463832 52.24015416 0,5.5937209 52.24012314 0))'

I've seen some potential answers using .shp files, but haven't managed to recreate them from my starting point. It is not impossible that the answer is already somewhere on the forums, but I've been reading and searching for a long time and can't find the right one.

I do know how to do it in QGIS using the quickWKT plugin which is very straightforward.

Eventually however, I want to create a process in python to use these polygons to create masks for smaller tiles of GeoTIFFs for modelling. I wouldn't mind going straight to creating masks using polygons and simply plot them with an alpha over the image.


texts: How to compute satellite coordinates (lat,long) given antenna's coordinates, angles and satellite height

texts:
Given an Earth station (antenna) coordinates (in lat,long) ant its Elevation (El) and Azimuth (Az), how to compute the satellite coordinates (lat,long), known its height?

For simplification purposes, the Earth can be considered as an sphere.

So its given:

Earth Radius = 6371000 meters
Satellite Height, in meters (perpendicular to the Earth's)

Station lat, long (as parameters)
Station height (0 = Zero, for simplification purposes)
Station Elevation (angle, radius or degrees)
Station Azimuth (angle, radius or degrees)

The problem can be shown in this two figures:


texts: qGIS' Database Manager "Load as New Layer" Option Not Working

texts:
I'm trying to visualize some of my database queries on qGIS. I run a valid SQL query which returns a subset of my table that should be easily loaded as a layer. I then check "Load as new layer," selected the right id and geom columns and typed in a new layer name. Then, I clicked "Load Now!." qGIS does some thinking and things pause for a second, but no new layer is created. No error messages are thrown. Thanks in advance.

EDIT: It turns out that add a new layer is throwing an error :$. Let me provide some more detail. I'm trying to do a pgrouting query and display the results. My database table is qc28l. When I run this query:

      SELECT * FROM qc28l
   JOIN (SELECT seq, id1 AS node, id2 AS edge_id, cost FROM pgr_dijkstra('
        SELECT gid AS id, source::integer, target::integer, miles::double precision AS cost FROM qc28l',
                747, 311, false, false)
   )
AS route ON qc28l.gid = route.edge_id;

I get a valid-looking table and there are no errors. When I click the Add layer option, this query is embedded in more SQL syntax (and, you'll have to forgive me, I'm a bit of an SQL newb though I do know more traditional programming languages). The error that trying to add a new layer gives is:

Unable to execute the query.
The error message from the database was:
ERROR:  syntax error at or near ";"
LINE 6: AS route ON qc28l.gid = route.edge_id;
                                             ^
.
SQL: SELECT * FROM (SELECT * FROM qc28l
   JOIN (SELECT seq, id1 AS node, id2 AS edge_id, cost FROM pgr_dijkstra('
        SELECT gid AS id, source::integer, target::integer, miles::double precision AS cost FROM qc28l',
                747, 311, false, false)
   )
AS route ON qc28l.gid = route.edge_id;
) AS "subQuery_0" LIMIT 1

Thanks in advance.


texts: If not using CartoDB to host your data, how can we modify the input parameters to point toward a layercube file,, and how to generate that file?


texts: Install ArcView 3.2 and extensions from original disks

texts:
I see someone mentioned copying the c:\esri folder and pasting in/on Windows 7 64 bit. Sounds easy enough; however, I thought the installation process partly consisted of putting certain files in certain places in order for the whole thing to work? Oddly enough, I work as a GIS Specialist and know little about the computer. My oversight, excuse me.

So, I have to be led by the nose (really good and thorough intructions).

Could I really just copy my ESRI folder on my xp machine to an external drive and then transfer it to my new machine?

Otherwise, can I use my original installation disks?

Thanks in advance for the education

John


texts: Hiding a field column while editing in pyqgis3

texts:
I would like to hide a field column while editing. The following code works perfectly in pyqgis2.

def fieldVisibility (layer,fname):
  f = layer.editFormConfig()
  for i, column in enumerate(layer.fields()):
    if column.name()==fname:
      f.setWidgetType(i, "Hidden")
        break
    else:
      continue

setWidgetType has been superseded and I don’t know the new expression in pyqgis3.


texts:
I am new in QGIS plugin development using Python and Qt designer. Previously, I did lot of AddIns development for ArcMap using C#. I am using Plugin builder to develop the plugin.

Is there any way I can create a basic 'Hello World' plugin using windows form not the dialog with button template provided by the plugin builder?


texts:
I am trying to understand the effect of forest fragmentation on vertebrate populations. I need to analyse my study area using Fragstats however, I couldn't find a suitable land cover map for my study area (which is in Guanacaste Province in Costa Rica). So I instead manually mapped the about 170 sq. km. surrounding my study sites using Google Earth into forests, intensively cultivated areas and moderately cultivated areas. Now I need to create a land cover map from the KML files and then create classes for each category and then analyse it using Fragstats.

Can someone tell me:

If the procedure which I am using for such a study is alright.
How can you convert KML files into classes and prepare it for use as a land cover map?


texts: Any Open source implementation just like ArcGIS Desktop Identity function?

texts:
I tried to identity thousands of points with millions polygon. ArcInfo work well but i have to get the result from Web Services.So i tried to implement the algorithm(Point in polygon) by myself,it doesn't work efficiently. Is there any faster algorithm or implementation for solve this?

Appreciate any suggestion.


texts: Select all vector features underneath the mouse cursor (clientside)

texts:
I have a number of polygons that are exactly equal covering each other and shown on one layer. When using OpenLayers.Control.SelectFeature - only the topmost feature is selected.

How to get info on other features, which are under the topmost polygon?


texts: How to check how much of a line (percentage-wise) is covered by a polygon in arcpy?

texts:
I'm searching for an efficient way to check if a line is covered by a polygon (see image, this case should return 2x "true").

Right now I only check wether a line is within a buffer with

line.shape.within(buffer.shape)

But I want to know if a line is covered by a buffer with at least 50%.
As I'm doing this fully automated in a script with a lot of lines and buffers this should be fast.
Any tips?

current code snippet:

lines = arcpy.SearchCursor('lines')
for line in lines:
  bufferList = arcpy.SearchCursor("buffers")
  for buffer in bufferList:
    # here I want to check if a line is just covered by a buffer
    if line.shape.within(buffer.shape):
        if line.getValue('type') == buffer.getValue("type"):
          matchList = arcpy.InsertCursor('MatchList')
          matchList.insertRow(line)
          break


texts: How to efficiently change all source/output files in an FME workspace?

texts:
I have a large FME workspace with 5 readers, each of which are reading in many files, going through several transformers, and then writing out several resulting files.

Now I need to do the exact same process for a different set of files (a different geographic area). Everything in the workspace will be the same except for the names of read and written files.

FME seems not to allow the changing of a reader path (the read fails for me during execution), and does allow changing the path of the written file - although this gets cumbersome.

Rather than deleting all readers and redirecting all the writers with a bunch of mouse clicking, there must be a more elegant approach?


texts: How to show coordinate on a GeoExplorer map by moving the mouse?

texts: I am new in developing a GIS web page. I am using OpenGeo suite 4.6 at my work and I want to show the coordinate on the GeoExplorer map. I know that OpenLayers use a code for showing the coordinate of the map (new OpenLayers.Control.MousePosition()), but I don't know where and how I should add this code?


texts: How to load gdal from python 2.7.8 on win7 32bit using arcgis python 2.7.8?

texts:
My Python installation is:

Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win3s

gdal installation file:

gdal-202-1500-core.msi

I have installed the following python binaries:

GDAL-2.2.1.win32-py2.7.msi

I  put GDAL in the "Path" system variable:

C:\Program Files (x86)\GDAL

PYTHON_PATH - C:\Python27\ArcGIS10.3;C:\Python27\ArcGIS10.3\Lib;C:\Python27\ArcGIS10.3\DLLs;C:\Python27\ArcGIS10.3\Lib\Lib\lib-tk;C:\Program Files (x86)\GDAL

GDAL_DATA - C:\Program Files (x86)\GDAL\gdal_data

GDAL_DRIVER_PATH - C:\Program Files (x86)\GDAL\gdal_plugins

But still after a new start of windows I get the following message when trying to load gdal in python:

import error: dll load failed

what else can I do to run gdal in python?


texts:
i am attempting a volume calculation using the route of 2 dems (upper and lower) and trying to subtract the difference.

workflow as follows:
A. rasterise vector contours (v.to.rast.attr)

B. create 2 dems (r.surf.contour)

C-D. create and rasterise vector overlay (in prep for mask) (v.to.rast.attr)

this is where it goes undone:

E. create mask (r.mask) - mask the regions in 4 outside of the polygon(s) with a '0' null value and those inside the polygon with a '1' value (indicating the area to be processed).

F: calculate area (r.surf.area)
G: calculate volume r.volume or r.topidx

OR

F1: raster algebra (r.mapcalculator in grass) // raster calculator in qgis (demA - demB)

Is this an appropriate workflow or what would an appropriate workflow look like (with associated r./v/g. steps)?


texts: Merge a table with a shapefile (not the same dimension)

texts:
I am trying to merge a table with a shapefile using R. The shapefile's database is bigger than the table and I need to have null or zero values where the two data sets don't match.

Table data

no.   table_id   value
 1.        a11     123
 2.        a12     456
 3.        a14     789

Shapefile's data db

no.   polygon_id
 1.          a11
 2.          a12
 3.          a13
 4.          a14
 5.          a15

Desired result (on the shapefile):

no.    id   value
 1.   a11     123
 2.   a12     456
 3.   a13       0
 4.   a14     789
 5.   a15       0

What I tried

I tried merge but it didn't work I think because the two tables have different sizes.

#trying to merge
joined <- merge(table,polygons, by.x="table_id", by.y="polygons_id",all=T)
## overwrite the file with this new copy
library(foreign)
write.dbf(joined, "Polygons_R.dbf")

Ward_polygons <- readShapePoly(fn="Polygons_R")

Receiving this error

Error in `row.names<-.data.frame`(`*tmp*`, value = value) :
  invalid 'row.names' length

I tried also

polygons$polygons_id<-(table)

Getting this error

Error in `[[<-.data.frame`(`*tmp*`, name, value = c(1, 2, 1, 2, 9, 8,  :
  replacement has 1309 rows, data has 2490

I read a previous post (here), as well, but I couldn't find my answer


texts: How to calculate mean pixels value of shapefile (for specific place)?

texts:
I have GeoTIFF image. I want to know how to calculate specific area mean pixels values?
Is field calculator for(value*count fields) right or get raster properties? Or what can I do?


texts:
I have a map that relates to a table.  When the user selects a table row, I would like to highlight the corresponding map feature.  This is the only way I found to do it:

const siteGeoJSON = SitesToGeoJSON(sites, activeId);
const newSource = new carto.source.GeoJSON(siteGeoJSON);
siteLayer.update(newSource, siteViz);

What I'm doing here is regenerating the entire GeoJSON object to set a single property indicating whether each feature is active or not, then digesting that into Carto anew.  Features with the active property have a different symbol.

This probably isn't a very efficient way to do this, though.  Is there any way to change feature properties without creating a new source?


texts: Getting feature data from vector source using OpenLayers 3?

texts:
I need help concerning feature clustering in OpenLayers 3. I have a vector layer that dynamically "collects" a large number of features. All features have various properties like title, content, permalink.

Unfortunately, I only have a clue how to copy style data from the source layer (for all features that are not included into clustering at the respective zoom level).

How do I get all the other properties into the features at the cluster layer?

I would like to add feature.get('permalink') and so on, but I don't have any idea where I have to put this.

Here's my code:

// marker clustering
    clusterLayer[i] = new ol.layer.Vector({
        source: clusterSource[i],
        style: function(feature) {
          var size = feature.get('features').length;
          if(size > 1) {
              var style = new ol.style.Style({
                  image: new ol.style.Circle({
                    radius: 10,
                    stroke: new ol.style.Stroke({
                      color: '#fff'
                    }),
                    fill: new ol.style.Fill({
                      color: '#3399CC'
                    })
                  }),
                  text: new ol.style.Text({
                    text: size.toString(),
                    fill: new ol.style.Fill({
                      color: '#fff'
                    })
                  })
              });
          }
          else var style = feature.get('features')[0].getStyle();
          return style;
        }
    });

Any idea how I can add the properties from all source layer features to the features at the cluster layer?


texts: Set opacity of cached ArcGISTiledMapServiceLayer

texts:
Is it possible to set the opacity of a cached Tiled Map service using ESRI JS API?

I am using:

var layer;

layer = new ArcGISDynamicMapServiceLayer("URL",
            {"opacity": 0.5});

map.addLayer(layer);

This should work with 50% transparency being set to the layer, right?


texts: Mutually Exclusive Bootstrap Checkbox Switches as Layer Control

texts:
I have this JSFiddle with two checkboxes using Bootstrap Switch that changes the layer visibility in Leaflet.

I would like them to be mutually exclusive, i.e neither of them can be on or off at the same time.


texts: MS Access/VBA used to open an ArcGIS map document: Map fails to connect to database

texts:
I have an MS Access front-end that can be used to open ArcGIS map documents (.mxds).

It has a macro that runs an OpenRoadMap() function:

 Function OpenRoadMap()
     CreateObject("Shell.Application").Open ("{your path here}\ROAD.mxd")
 End Function

Problem:

The .mxd connects to the database just fine when I open it manually.

However, when I open the map using the VBA script, the map is unusable because it is unable to connect to the database:

Why is the VBA-opened .mxd unable to connect to the database?

Windows 7 Enterprise - Service Pack 1
Microsoft Access 2010
ArcGIS 10.3.1
Oracle 12c


texts: Changing entries in attribute table from text to rational number

texts:
I recently merged two sets of data in a single attributes table. To my surprise I can not opperate the variables or observations because, for some reason, it recognized the numbers in different columns as text entries.
How can I change the type of data from text to rational number?


texts: How to configure HTTP requests between two applications on OpenShift

texts:
I have deployed a GeoServer and a Java EE REST API on OpenShift as non-scalable applications.

From the REST API I'm trying to connect to GeoServer using Apache httpclient. When I'm requesting GeoServer on OpenShift from my REST API installed locally it works (so the application logic is working). But when I deploy the REST API on OpenShift and try the same requests. I'm getting the following exception:

java.net.BindException: Permission denied

at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.Socket.bind(Socket.java:631)
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:606)

It seems to me that the communication between these two applications is stopped by OpenShift in some way. All the requests to the REST API that are not involving an internal request to GeoServer are working fine.

Is there some setting in OpenShift that I've missed?


texts: Dynamically update index layer for Data Driven Pages using ArcPy/Python

texts:
Is there a way to dynamically pull in a new index layer for a data driven page in ArcMap?
Scenario: I have an MXD which will be my template. I am trying to update the index layer dynamically in Python. I want to switch out my "dummy" index layer with the layer that gets fed to the MXD by the user/my Python script.


texts: Whats the best way to create bathymetric contour lines?

texts:
I have a raster dataset with both Topographic and Bathymetric stored in it. What is the best way to create exact contours of the lake-bed? This becomes tricky when I want to make the contour for depth = "zero", when in fact it is not as easy as it seems, since I get contour out of the lake "boundary". Then the question becomes how we really define a lake boundary.

Thanks

P.S. I'm using ArcGIS-10.1 and model builder.


texts: Moving multiple point features back to their original location?

texts:
Is there a way to move multiple point features in bulk back to their original location given their X,Y locations?

The red points and green points are from the same feature class, the only difference is that the red points were ran through the Geo processing wizard (which snaps all the points to the line) and the green points are the same feature class not ran through the Geo processing wizard.  The points highlighted in yellow are exactly the same in their schema and data including their x,y coordinates (which is odd because they visually appear to be in slightly different location.  I need to move the red points to their green counter part denoted by the bold label 'BVKYXXXXXXX).


texts: GeoServer GetFeatureInfo with time range

texts:
I've been building a WMS service for time series data following this tutorial:

http://docs.geoserver.org/latest/en/user/tutorials/imagemosaic_timeseries/imagemosaic_timeseries.html

Everything is fine and my GetMap function work well and all the maps are loaded according to their data. The problem is when I want to use the GetFeatureInfo function. If I use it to retrieve the feature value of a point for a single date it works well, but if I try to add the time range parameter I only get the feature info of the starting date.

I use it in this way: http://localhost/geoserver/cite/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fjpeg&TRANSPARENT=TRUE&QUERY_LAYERS=cite%3A9_S_int&STYLES=ocean&LAYERS=cite%3A9_S_int&INFO_FORMAT=application%2Fjson&FEATURE_COUNT=50&I=50&J=50&CRS=EPSG%3A4326&WIDTH=101&HEIGHT=101&BBOX=-77.27783203125%2C-46.5380859375%2C-72.83935546875%2C-42.099609375&TIME=2018-08-09/2018-08-11&

I've always used the time range in this way for all WMS service I used. Now that I'm trying to build my own WMS service I get this problem.  I've enabled the time dimension setting the presentation value to List.

Here in the following the layer properties retrieved with GetCapabilities:

            <Layer queryable="1" opaque="0">
                <Name>9_S_int</Name>
                <Title>CMEMS_int_S</Title>
                <Abstract/>
                <KeywordList>
                    <Keyword>CMEMS_int_S</Keyword>
                    <Keyword>WCS</Keyword>
                    <Keyword>ImageMosaic</Keyword>
                </KeywordList>
                <CRS>EPSG:4326</CRS>
                <CRS>CRS:84</CRS>
                <EX_GeographicBoundingBox>
                    <westBoundLongitude>-83.8750025510788</westBoundLongitude>
                    <eastBoundLongitude>-63.79166538715362</eastBoundLongitude>
                    <southBoundLatitude>-55.70833460489909</southBoundLatitude>
                    <northBoundLatitude>-35.62500127156576</northBoundLatitude>
                </EX_GeographicBoundingBox>
                <BoundingBox CRS="CRS:84" minx="-83.8750025510788" miny="-55.70833460489909" maxx="-63.79166538715362" maxy="-35.62500127156576"/>
                <BoundingBox CRS="EPSG:4326" minx="-55.70833460489909" miny="-83.8750025510788" maxx="-35.62500127156576" maxy="-63.79166538715362"/>
                <Dimension name="time" default="current" units="ISO8601">2018-08-08T00:00:00.000Z,2018-08-09T00:00:00.000Z,2018-08-10T00:00:00.000Z,2018-08-11T00:00:00.000Z,2018-08-14T00:00:00.000Z</Dimension>
                <Style>
                    <Name>raster</Name>
                    <Title>Default Raster</Title>
                    <Abstract>A sample style that draws a raster, good for displaying imagery</Abstract>
                </Style>
            </Layer>

Are there other properties I should check to enable the time range capability?


texts:
Setup:
OpenLayers 3

Description:
I have a map and I need to draw GPS points (10000+) to the map  points have extra attributes on them (id, datetime, name etc.). I also have to draw path between those points. I now have two layers, one with the features and one with the line drawn from the GPS points. I need to filter (hide) the points and the line by the time attribute.

What is the fastest way to filter (hide) features (10000+) from a layer?


texts: Using S2 Geometry as a grid for earth-wide processings

texts:
I am looking at options concerning the processing of raster data (sentinel, landsat, etc.) at a continent scale (for example, north america and south america), with respect to discrete global grid systems, projections and parallelization of work (using the cells or a regular subdivision of the cells of the grid).

There is obvisouly the MGRS partitioning but I find it quite complex to implement and it has a lot of small polygons, some hard-coded rules (northern Europe), etc.

This is why I thought of S2 cells : https://s2geometry.io/.

I was wondering if:

this is a stupid idea?
anyone had already used S2 cells (at zoom 11 for example) for such processings?
in particular which CRS would be suited to those geodesic quadrilaterals?


texts:
I would like to use the travelling salesman algorithm in the GRASS plugin in QGIS. I have a points layer (3 points) and a road layer. I have connected the 2 together using v.net

and I am given this:

and it looks like this:

but when I open up the window for v.net. salesman only the new Network layer is there in the dropdown tab, not the nodes or lines.

Any suggest on where I went wrong?


texts:
I am new to PostGIS/PostgreSQL and have downloaded and installed to perform a spatial join which ideally takes 27 hours in ArcGIS Pro and 19 hours by ArcPy.Hoping for a faster results via PostGIS from what I read everywhere online.

I have installed both PostgreSQL and PostGIS. But I am unable to import a shapefile to the database. Basically I have a spatial table in Sql Server which I is somewhat challenging to import to pgAdmin as I cannot figure out a way to connect the database of sql server using ogr_fdw. The answer here does not help as I believe there are some restrictions in the organization end causing a failure as it only takes windows authentication.

As a workaround I converted the spatial table to a shapefile using feature to feature conversion. But now I am unable to import the shapefile to PostGIS/PostgreSQL. I am using the shp2pgsql GUI for importing and its throwing out a "Error reading shape output" as an error.

Any suggestion to have my spatial table imported to postgis or a way to get the converted shapefile imported?


texts: How can I change the precision in the attribute table?

texts:
I'm working with QGIS, v. 2.0.1.
I opened a csv-table (from an Excel-file) and now the precision is very high but I don't need this. At the moment the values are for example 15.00000000000000, how can I change this to 2 decimals? And is it possible to set the precision before I open the table in QGIS?

The methods suggested by simo just worked partially... I opened the table and it looked good but as I wanted to create a shapefile of the layer the precision switched back to many decimals. What can I do?

There are only two decimal places in the csv file and there are also only two decimal places when I load the csv file into QGIS. But as soon as I create a shapefile, there are 14 decimal places.


texts: How to generate discrete areas from multiple, overlapping features?

texts:
I have a point dataset that I want to append some information from a polygon to.

My polygon shapefile contains over 500 features. Whilst each of these features represents individual areas they are not discrete in their extent. For example, (see highly sophisticated Paint mock up below) a point (point 1) in Figure A may actually overlay all three zones (Point 1, Figure B). A spatial join or query will then result in an incorrect zone being appended.

What I’m wanting is a dataset like that shown in Figure C i.e. discrete polygons that do not overlap.

I have tried splitting my original polygon by an attribute/location and unioning these ~500 shapefiles together but to no avail. Namely, the Union tool would like to do this process two shapefiles at a time (I ideally wanted to point the tool at a folder containing the split shapefiles and union them all together).

This should be a really easy problem to solve but I want to avoid doing this manually (i.e. through the Editor 'Clip' tool).

Does anyone have any ideas?


texts: I have a simple line added as a layer from a KML file.  I can select the features and show numerous nodes.  It is in edit mode.  Normally I would expect to be able to delete a node, split a line, etc. but none of the advanced digitizing works.  The vertex tool is grayed out.  I get the error "CAD tools are not enabled for the current map tool".  I have scoured Google and am at a loss.


texts: Determining if a group in legend is selected, using PyQGIS

texts:
How can I determine in code (python or c++) whether a group in legend is selected or not?

mQGisIface->legendInterface()->selectedLayers()

gives me only selected layers and no groups, and in QgsLegendInterface I doesn't find anything about it.

I use QGIS Version 2.14.4.


texts: How can I limit a spatial binning query to a specific bounding box?

texts:
I am using Esri's GIS tools for Hadoop but I think the query is pretty standard stuff.  The SQL/HQL below is from the Esri tutorial found here https://github.com/Esri/gis-tools-for-hadoop/wiki/Aggregating-CSV-Data-%28Spatial-Binning%29

So I have a datastore of millions of points but I only want to produce a map of a specific region (say Europe).

The query I currently run generates a Spatial bin of the entire world

FROM (SELECT ST_Bin(0.001, ST_Point(dropoff_longitude,dropoff_latitude)) bin_id, *FROM taxi_demo) bins
INSERT OVERWRITE TABLE taxi_agg
SELECT ST_BinEnvelope(0.001, bin_id) shape, COUNT(*) count
GROUP BY bin_id;

How would I limit this to a specific bounding box?  Any Ideas?

EDIT: including solution for reference (UK envelope):

SELECT ST_Bin(0.001, ST_Point(coordinates.coordinates[0],coordinates.coordinates[1])) bin_id, *FROM data_final
WHERE ST_Contains(ST_Envelope(ST_Polygon(-11.115,49.511, 2.537,49.511, 2.537,59.41, -11.115,59.41, -11.115,49.511)), ST_Point(coordinates.coordinates[0],coordinates.coordinates[1]))


texts: Snap (editing tools) in ArcGIS not working properly

texts:
I am using the snap tool to match one polygon file to another, using the EDGE Snapping Environment Type Option. The tool appears to work properly for the vertices of the input feature polygons that are outside of the snap environment polygon, but vertices of the input feature that are within the snap environment feature will not snap to it.

Is this the way the tool is supposed to work, or am I missing something?


texts: QGIS: plotting real time lat/lon GPS input on a different projection

texts:
I'm trying to plot realtime GPS over a satellite image in QGIS 1.8. The GPS data is coming in as NMEA lat/lon from a Garmin Etrex. This works when the image is in WGS84 lat/lon projection and therefore the coordinate systems match.

Unfortunately, I will be using this in high latitudes and WGS84 becomes unusable. I'd much rather have the image in something like UTM 24N or polar stereographic.

Does anyone know a way to get the GPS to plot in the right location?

I don't seem to be able to change the coordinate system that the GPS outputs, only the on-GPS display. Suggestions for either Linux or Windows welcome!


texts:
I need to color a DEM that I have loaded in QGIS 2.2.  I'd like the DEM colors to represent different elevations, something like:

https://dl.dropboxusercontent.com/u/26086662/color_ramp.jpg

None of the color ramps that come with QGIS are related to elevation, so can anyone point me to pre-existing ramps that I can load in to QGIS?  Thanks!


texts: Finding the nearest address to a point in PostGIS

texts:
I'm trying to generate a synthetic dataset which resembles a real dataset. (The real dataset can not be distributed due to data privacy issues, so I need a synthetic test dataset which I can hand out.) In particular, the original dataset contains street addresses. Those addresses need to be obscured.
I've approached the problem by geocoding the addresses in the original dataset, approximating the distribution of the (lat, long) pairs so generated, and taking a random sample of synthetic (lat, long) pairs from that distribution.
Now I need to convert those pairs back to addresses which can be embedded in the synthetic dataset.
Obviously, that won't work unaltered, since the synthetic (lat, long) pairs will rarely correspond to a street address. I propose to solve this by taking each of these synthetic pairs, finding a nearby packet  which has an address, and then using the address of that packet as the address of the entry in the synthetic dataset.
So I'm left with the following question:
"Given a (lat, long) pair, find the street address of the nearest postal destination."
That can be reduced to the following, simpler question:
"Given a (lat, long) pair, find the centroid of the nearest postal destination."
I assumed that I could use the faces table to find a candidate centroid, but I'd need to restrict the faces table to records that actually represent a packet.  How could I do that?
Edited to add:
Point-by-point obfuscation doesn't work in a case like this because of isolated points: if an address is very remote from other addresses, then rounding, truncating, or randomly sampling near that address still gives an attacker a way to find the original address with high probability.
I'm using a more subtle method: I'm building a continuous distribution across all addresses in the input set and picking a random point according to distribution. This has the disadvantage that the points selected will rarely, if ever,  correspond to actual addresses; that's the disadvantage I'm trying to solve.


texts: I just downloaded QGIS 3.0 on Mac OS X but I could not find TIN interpolation plugin in the Search & manage plugin. Is there something wrong with the Mac version of QGIS 3?


texts: How to make a custom properties dialog for a custom text background

texts:
I'm developing a custom text background in ArcObjects like in this example.
I would like to know if it is possible to make a custom properties dialog to set up parameters of this text background. It would be another "Type" instead of "Line Callout" in the properties window:

The custom properties dialog would be packaged in the same .esriaddin than my custom text background.
Does the ArcObjects java API allows this ?
Does anyone know globally how to do this ?
Thanks.

I saw this example: [Sample: Simple dispersal renderer][3]. It's possible to make a custom property page for renderers and layers extending BaseCustomRendererPropertyPage and BaseCustomLayerPropertyPage. But which class could be extended to make a property page for a TextSymbol and a TextBackground ?


texts: Is there some string-like format I can use that would encapsulate what is in a GIS file?

texts:
I'm running comparisons to find if there was a change in data. I'm using GeoTIFF and GPKG files (GeoTIFF will be compared to GeoTIFF and GPKG will be compared to GPKG). I have a database with information on each file.
Rather than having to pull the actual files and compare files directly to see if there is a difference in the data (not necessarily what the actual difference is, just if there is one or not). I would like if there was a way to just store some unique textual representation of what's in the file in a database than I can just compare that to see if there is a change.
Is this possible in anyway and what would be the best approach? Is there a way I can represent a GeoTIFF or GPKG in a string and that string could represent with precision what is in the GeoTIFF/GPKG file?


texts: ArcPy Table to Table Conversion Not Working Correctly

texts:
I have a script which writes the lat/lng of a JSON web service of bus routes.  The script writes the latitude and longitude to a CSV correctly.  However my table to table conversion does not work correctly in Python.

# IMPORTS

#Make Python understand how to read things on the Internet
import urllib2

#Make Python understand the stuff in a page on the Internet is JSON
import json
from decimal import Decimal

# Make Python understand csvs
import csv

# Make Python know how to take a break so we don't hammer API and exceed rate limit
from time import sleep

# tell computer where to put CSV
outfile_path='C:\Users\Administrator\PycharmProjects\untitled\json2fgdb.csv'

# open it up, the w means we will write to it
writer = csv.writer(open(outfile_path, 'wb'))

#create a list with headings for our columns
headers = ['latitude', 'longitude']

#write the row of headings to our CSV file
writer.writerow(headers)

# GET JSON AND PARSE IT INTO DICTIONARY

# We need a loop because we have to do this for every JSON file we grab

#set a counter telling us how many times we've gone through the loop, this is the first time, so we'll set it at 1
i=1

#loop through pages of JSON returned, 100 is an arbitrary number
while i<2:
    #print out what number loop we are on, which will make it easier to track down problems when they appear
    print i
    #create the URL of the JSON file we want. We search for 'egypt', want English tweets,
#and set the number of tweets per JSON file to the max of 100, so we have to do as little looping as possible
    url = urllib2.Request('http://api.metro.net/agencies/lametro/routes/704/vehicles/' + str(i))
    #use the JSON library to turn this file into a Pythonic data structure
    parsed_json = json.load(urllib2.urlopen('http://api.metro.net/agencies/lametro/routes/704/vehicles/'))
    #now you have a giant dictionary.
#Type in parsed_json here to get a better look at this.
#You'll see the bulk of the content is contained inside the value that goes with the key, or label "results".
#Refer to results as an index. Just like list[1] refers to the second item in a list,
#dict['results'] refers to values associated with the key 'results'.
    print parsed_json

    #run through each item in results, and jump to an item in that dictionary, ex: the text of the tweet
    for items in parsed_json['items']:

     #initialize the row
         row = []
     #add every 'cell' to the row list, identifying the item just like an index in a list

    row.append(str(items['longitude']).encode('utf-8'))
    row.append(str(items['latitude']).encode('utf-8'))

     #once you have all the cells in there, write the row to your csv
    writer.writerow(row)
    #increment our loop counter, now we're on the next time through the loop
    i = i +1
    #tell Python to rest for 5 secs, so we don't exceed our rate limit
    #sleep(5)

    import arcpy
    arcpy.TableToTable_conversion(outfile_path, "C:\dev_folder\orginalDev.gdb", "jsoncsv2")

Output:


texts: Why doesn't installing GDAL from `pip` work on Ubuntu 18.04x64

texts:
Does anyone know why the pip install of gdal never seems to work? I am asking out of genuine curiosity and don't intend to sound negative. I have a related downstream packaging issue with GDAL as a dependency, but was just wondering why this installation has persisted for such a long time. Because of the pip errors, I actually have to develop my package for conda-forge instead of PYPI. My usual workaround for gdal is to use the conda-forge installation of gdal.
I get all kinds of errors whenever I try and install gdal. I get different kinds of errors each time I try and install it.
For example, if I use Anaconda to create a new environment:
conda create -n myenv python=3.6
conda activate myenv
pip install gdal

I will either get errors about broken wheels or I get an error such as this about gcc:
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /media/xxx/t_gdal/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/xxx/pip-install-bmel7ik_/gdal/setup.py'"'"'; __file__='"'"'/tmp/xxx/pip-install-bmel7ik_/gdal/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/xxx/pip-record-df_uldmb/install-record.txt --single-version-externally-managed --compile --install-headers /media/xxx/anaconda3/envs/t_gdal/include/python3.6m/gdal Check the logs for full command output.

Here are other folks who have had similar issues installing gdal.
Python GDAL package missing header file when installing via pip
How to (re)install gdal in python3 (mac)?
https://stackoverflow.com/questions/43587960/gdal-installation-error-using-pip
Installing GDAL and OGR for Python?
Is gdal one of the cases where pip does not work well, because of all the C and C++ compilation, etc? I was just wondering what the cause was.


texts: Batch processing LiDAR files (.las to raster) with PyQGIS?

texts:
for layers in glob.glob("*.las"):
        processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,layers+"E:/las_new/.tif")

  {'output': 'PNOA_2016_CAT_huso31_346-4560.lasE:/las_new/.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4562.lasE:/las_new/.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4564.lasE:/las_new/.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4566.lasE:/las_new/.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4568.lasE:/las_new/.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4570.lasE:/las_new/.tif'}
  output_ras=("E:/las_Ras")

for layers in glob.glob("*.las"):
    processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,layers+"output_ras.tif")

  {'output': 'PNOA_2016_CAT_huso31_346-4560.lasoutput_ras.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4562.lasoutput_ras.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4564.lasoutput_ras.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4566.lasoutput_ras.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4568.lasoutput_ras.tif'}
  {'output': 'PNOA_2016_CAT_huso31_346-4570.lasoutput_ras.tif'}

for layers in glob.glob("*.las"):
    processing.runalg("grass7:r.in.lidar", "input_las",5,1,"",1,100,"","",5,"","",False,True,True,"331289.57265,337990.42735,4558790.0,4560890.0",0,"output_ras.tif")

  {'output': 'output_ras.tif'}
  {'output': 'output_ras.tif'}
  {'output': 'output_ras.tif'}
  {'output': 'output_ras.tif'}
  {'output': 'output_ras.tif'}
  {'output': 'output_ras.tif'}

I would like to batch process many LAS files to rasters using the PyQGIS algorithm. As you can see in the code, I think the final problem is with the output. It does not write the files out to my defined output pathway as tif files. Also how can I make sure the naming of output rasters are according to the original LAS they are generated from? What am I doing wrong here? Not a pro at Python. Started 3 days ago.


texts: Federating multiple ArcGIS servers with Portal for ArcGIS

texts:
has anyone experience with a federation of two or more ArcGIS Servers with Portal for ArcGIS?

If we try federate the second AGS, we have a problem with publishing map services in the form of web-map application (we can not find this services in Portal for ArcGIS).

I suppose that I'm doing something wrong.

Is there more detailed documentation how to federate next ArcGIS Server?


texts: Query the lowest temperature from single GFS forecast with GEE

texts:
My goal is to get the lowest temperature from a given GFS forecast.

// import GFS forecast collection
var gfs_dataset = ee.ImageCollection('NOAA/GFS0P25');

// get a single forecast
var gfs_single_forecast = gfs_dataset.first();

// select temperature measurements
var tempr = gfs_single_forecast.select('temperature_2m_above_ground');

var global_min_tempr = tempr.reduceRegion({
  reducer: ee.Reducer.min(),
  geometry: tempr.geometry(), // image footrint
  scale: tempr.projection().nominalScale() // querying at original scale
});

print(global_min_tempr);

The problem is that I get an error when using reduceRegion():

Dictionary (Error)
Image.reduceRegion: Provide 'geometry' parameter when aggregating over an unbounded image.

Although valid geometry is clearly provided.
What is the problem?

Link to my code on GEE


texts:
I would like to make a map of the USA Roads with traffic load data (I don't care if it updates monthly , quarterly...) in order to analyze location of customer's shops (they sell vehicle parts and want to see how close their / competitors stores are to high traffic roads)

What I'm looking for is :

Average Load
Peak Load

I don't know which resolutions are available but of course I would like to have the best there is (hope for free :)  )

I need the entire USA roads highways & main roads are most important.
the more data I have the better my map will be for my client.

Any idea where I can get such data ? I would like to have end result like this (color wise) :


texts: How to add a "loading" image is ESRI JSAPI AMD

texts: Does anyone have an example of how to display a "loading" image in the new AMD environment of ESRI's JSAPI? Familiar with doing it in the past, just seems there's quite a lack of documentation. Thanks.


texts: How to properly deal with rectangles being curved on geographies?

texts:
I'm using Microsoft SQL Server to store simple data for administrative boundaries of the world (lots of polygons). I store this in a geography data type column. Afterwards I query these polygons by a bounding box and draw these polygons on the computer screen, using WebMercator projection.

But now I've noticed a problem. When I make a rectangle polygon in SQL server, it has curved edges. For example, the following query produces the following results (screenshot from SQL Server Management Studio):

select geography::Parse('POLYGON((10 50, 50 50, 50 60, 10 60, 10 50))')
union all
select geography::Parse('POLYGON((30 51, 24 48, 36 48, 30 51))')

Even more importantly - these two shapes are NOT considered to be overlapping by the STIntersects() function, even though they would intersect if the borders were straight.

In a sense this is actually correct. These are the shortest lines on a globe which connect the given points.

But this presents me with a problem - my viewport is a rectangle in WebMercator projection. I need to select all shapes which intersect with my viewport, and for that I need to get a truly rectangular rectangle to pass to the STIntersects() function.

And of course, I now realize that I'm probably drawing these polygons wrongly as well... or am I? I'm using the data from Natural Earth, although I'd like to switch to OpenStreetMap, since it has more useful data. But should the polygon data I acquire from these sources be drawn with the "curves enabled" or not?

I don't even know what this phenomenon is called, so I don't know what to Google for.

What is the correct manner of doing this?


texts:
What I need to do is change data type of a field of a table or feature class. If there are some data,  then I need to transfer it, if its possible, if not possible then just set null for that data. I need to do it using python script.

Problems:

Because of before and after changing the data type, field name is same, I can not add new field with same name using arcpy.AddField_management method.
Because of I need to transfer field values from first field to second one, I need to map both data types.

It will be good for me if I can find any ArcPy procedure similar to artwork21's answer to Renaming field using ArcPy?


texts: How to use Memory layers in QGIS plugin to store results of Geoprocessing tools

texts:
I'm building a plugin to perform Multi Criteria Analysis (yes another one...). As part of my workflow intersecting vectorlayers is needed. I use QgsOverlayAnalyzer.intersection (a pity union is not yet supported as far as I know).

Because intersection is limited to 2 layers a number of inbetween results is generated. Until now I create these inbetween results as shapefiles, add them to the TOC, use them in another intersection step and eventually remove them later.

Sample code (path, intersectionlayer1 and 2 are defined)

productname= "intersection_output1" # first inbetween result

product = QFileDialog.getSaveFileName(self.pluginGui,"Save inbetween result as", path, "shapefiles (*.shp)")

QgsOverlayAnalyzer().intersection(intersectionlayer1, intersectionlayer2, product, 0)

self.iface.addVectorLayer(product, productname, 'ogr')

Not very elegant and therefore I have a few questions:

how to bypass adding the inbetween results to the TOC (QgsMapLayerRegistry requires them isn't it) ? Just using disk as storage is an improvement.
how to store these inbetween results in memory (Plugin) layers ? This would improve  processing speed and removal of inbetween results is easy.


texts: how to group interconnected edges inside a table?

texts: Given a table and a random set of edges with source and target columns, how can I find out which edges connect with each other and then group them together using PostgreSQL?


texts:
I am trying to select all rasters using arcpy.ListRasters within all folders of a directory using arcpy.da.Walk. I'm using arcMap 10.2.

An example portion of the code I have:

workspace = ("...")
output = ("...")

walk = arcpy.da.Walk(workspace, topdown=True, datatype= "RasterDataset", type = "TIF")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        rasters = arcpy.ListRasters("*", "TIF")
        print rasters

Doesn't work. It results in :

None
None
None
None
None
None
None
None
None

This works and lists all raster names, but what I need is a list of the raster that I'm able to use for further processing:

workspace = ("...")
output = ("...")

walk = arcpy.da.Walk(workspace, topdown=True, datatype= "RasterDataset", type = "TIF")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        print filename

I'm trying to use ListRasters so that I can batch process those rasters. In most cases I could do something like:

import arcpy arcpy.env.workspace = (...)
rasters = arcpy.ListRasters("*", "TIF")
for raster in rasters: arcpy.BatchBuildPyramids_management(raster)

But in this case I have a lot of folders with rasters in each folder. I need to grab all those rasters into a raster list I can then batch process


texts:
Does anybody found a way to use GRASS 7 in QGIS 2.18 under MacOS?

QGIS 2.18.19-2 is the latest version packaged with GRASS 7. For many reasons, all the following versions been have packaged with GRASS 6 only. But the tools are unusable with this version because they are compatible with version 7 only.

I tried to copy the GRASS 7 folder from QGIS 2.18.19-2 into /Applications/QGIS.app/Contents/MacOS/grass7 in my 2.18.28 version, but it doesn't to work.

QGIS gives me an error, it cannot find default.qgc in /Applications/QGIS.app/Contents/MacOS/grass7/default.qgc


texts:
In QGIS 2.14, in print composer I can save my project as a PDF file. There is no controls of the color space in which colors are specified in the output file. It will be very useful to have a choice of the color space: RGB or CMYK.
Is it possible to resolve this issue ?


texts: Compute forest loss per polygon in Google Earth Engine

texts:
I am trying to compute the total forest loss based on the Hansen dataset in Google Earth Engine.

I would like to know the total number of pixels lost per polygon of a shapefile imported as a feature collection.

The code runs and the tasks appear on the task tab, but when I run it I get an error:

  Error: Feature, argument 'metadata': Invalid type. Expected: Dictionary. Actual: FeatureCollection.

This is my code:

var table = ee.FeatureCollection("users/alejandrofeged/Colombian-map");
Map.addLayer(table,{},"Colombia")

var image = ee.Image("UMD/hansen/global_forest_change_2017_v1_5")
  .clipToCollection(table);

var lossImage = image.select(['loss']);
Map.addLayer(lossImage.updateMask(lossImage),
    {palette: ['FF0000']}, 'Loss');

Export.image.toDrive({
  image: lossImage,
  description: 'GFW-2000-2017',
  scale: 30,
  region: table,
  maxPixels: 8813288590
});

var means = lossImage.reduceRegions({
  collection: table,
  reducer: ee.Reducer.sum(),
  scale: 30,
});

// Print the first feature, to illustrate the result.
print(ee.Feature(means.first()));

var feature = ee.Feature(null, means);

// Wrap the Feature in a FeatureCollection for export.
var forestloss = ee.FeatureCollection([feature]);

// Export the FeatureCollection.
Export.table.toDrive({
  collection: forestloss,
  description: 'forestloss',
  fileFormat: 'CSV'
});


texts: Extract values from multiple rasters using lat / long and save as one CSV file

texts:
I would like to extract values from multiple rasters with a single lat / long or Shapefile. I have tried every tutorial and stackoverflow post and am getting nowhere. Maybe someone could please help. Here is what I have tried so far:

# Imports
library(raster)
library(sp)

# Raster List
tmp <- lapply(list.files("D:/rasters", pattern = ".tif$", full.names = TRUE), raster)

# Lat and Lon
coords <- data.frame("lat" = c(29.940668), "lon" = c(48.363455))

# Create spatial points
pts <- SpatialPoints(coords = coords,
              proj4string = CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0  "))

# Extract the points
as.data.frame(cbind(coords, do.call("rbind", lapply(tmp, extract, pts))))

The code runs but the return values are all NA and I checked and I should be getting back some values.

I have also tried to read the values in as a shapefile using readOGR as in Extracting values from raster according to Lat and long of values?, but I get an error

  Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  :
    Cannot open layer

I'm at a loss why nothing is working for me.


texts: How Should I Show Osm Point Layer in geoserver?

texts:
I've downloaded osm file and extract it to postgres sql. Now I have for layers :
 1 - planet_osm_line
 2 - planet_osm_point
 3 - planet_osm_polygon
 4 - planet_osm_roads

I've added this layer to geoserver and give each of them one sld file as style except point layer.
then I create one group layer in geoserver but after preview layer i have something like this:

the point layer is shown as red point. what should I do to solve this problem??


texts: Downloading map of each region of Tanzania?

texts:
I need to download good resolution map of each region (total 30 according to wiki) of Tanzania. The maps should contain major roads, thematic land cover and landmarks.

This map of Tanzania may help to find the areas.


texts: Is there a way to programmatically access an ArcGIS Pro project's default geodatabase?

texts:
In the ArcGIS Pro workflow, one typically creates a project that is set up with its own file geodatabase.

Is there a way to refer to this geodatabase generically in a python script?

I have been poring over Esri's documentation and can't find anything on this.

Essentially, I would like to do something like this:

fc_name = "some_name"
sr = arcpy.SpatialReference(4326)
out_fc = arcpy.CreateFeatureclass_management(*DEFAULT PROJECT FGDB HERE*, fc_name, "POINT", "#", "DISABLED", "ENABLED", sr)

How do I simply refer to *DEFAULT PROJECT FGDB HERE*?

This would help me write tools where the user would be able to access the output in whatever project template they happen to have active.


texts: How to check for geometry intersection (point in polygon) using OpenLayers3?

texts:
For example, I have this vector (It will be a more complicate linestring, not just a rectangle).

For a given coordinate (without clicks, just a latitude, longitude), how could I know (in an easy way, maybe collision?) if that coordinate is inside that vector?

SOLUTION

From the @JohnBarça answer, with turf library, this is working perfect:

var linestring1 = turf.linestring([
    [4.9020, 52.3667],
    [4.9030, 52.3667],
    [4.9040, 52.3667],
    [4.9050, 52.3667]
]);
var pt1 = turf.point([4.9040, 52.3667]);
var pt2 = turf.point([4.9060, 52.3667]);

var intersection = turf.intersect(pt1, linestring1);
if (intersection)
    alert('found pt1')
else
    alert('not found pt1')

intersection = turf.intersect(pt2, linestring1);
if (intersection)
    alert('found pt2')
else
    alert('not found pt2')


texts: QGIS SVG custom symbols more than 2 colours

texts:
I would like to know if it possible to have a SVG symbol with more than 2 colors. I would like to have one with up for colors? A simple point with 4 colors representing different species sighted in a place. I do not which a pie.

Any answer would be helpful


texts: I am new at using QGIS. How can I simply split features in QGIS? The manual tells to simply draw a line through the polygon you want to split. But it doesn't work. The line disappears when finishing it. When I select the polygon and then split it, it sometimes works and sometimes doesn't (an info appears after which it does not split the feature). Does anybody have an idea why the tool does not work properly?


texts: Seeking iOS GIS applications/frameworks for mobile data acquisition?

texts:
I'm starting to develop an application for iPad which should enable the users to go to the field and acquire georeferenced information. The idea is to enable acquisition of points and polygons, and the filling of a set of attributes for the geometry. Also important is the ability to connect to externals geo-referenced databases, such as a PostGIS one.

Ideally, I would want to be somewhat similar to the ArcGIS for iOS application, which has a good user interface.

Can you guys point me to other applications similar to what I am developing?
I already know the following ones:

Geo-jot
pcMapper
iGIS
GISRoam
field_assets
Geopaparazzi

Possibly you can point me to something with similar functionality to the ArcGis for iOS?

OR

Interesting programming frameworks to achieve the desired functionality on iOS?


texts: ArcGIS Attribute table appears empty until features are selected

texts: I have a multiple layers that show features in the data frame and the layers are editable and labeled, but when you open the attribute table for these layers, it's empty.  The only way to get the features to appear in the attribute table is to select them.  I have also noticed that these layers have no symbology in the table of contents.  Once again, they have symbology in the data frame just not in the TOC, and I cannot change the symbology anywhere to make it appear in the TOC.  What's going on here?


texts: How do I protect a custom ArcMap extension with SofPro PC Guard for .NET?

texts:
I have a library containing an arcmap extension that I would like to protect using SofPro's PC Guard for .NET.

Since Sofpro won't let me protect my dll unless I also protect arcmap.exe, I changed my dll so that it gets built as an Exe. (I added a Main simply prints "hello world".)

I'm able to register the exe using EsriRegasm and have verified that arcmap loads the extension from the exe.

However, after applying SofPro protection to the exe, EsriRegAsm refuses to register it.

  "Registration failed, Could not load exe or one of its dependencies.
  The module was expected to contain an assembly manifest".

I've tried, as suggested, turning off "Hide executable object names", and also turned off data or code section encryption.


texts: Converting ArcGIS REST to OpenLayers Vector?

texts:
I am working with openlayers and esri rest services. In my api, due to esriGeometryPolygon for all cities, rendering the map is taking lots of time and therefore I don't get a good result. First of all, is there a way to get robust performance when loading a layer, aside from simplifying it first? Or is there any way of converting arcgis rest to vector layer for openlayers?

The snatchy solution I have found is logging from the following address

  //myserver/arcgis/rest/admin

and then a periodic Clear Cache Options  ... The long term solution is caching.


texts: Calculate obstacle accountability area in QGIS

texts:
Still being new to the whole GIS world, I am trying to calculate a regulatory takeoff obstacle accountability area for a given runway. For my case, this is defined as an area as follows. At the start of the extended runway centerline it is 90m wide both sides, then widens by an 8th of every distance unit along that centerline up to a width of 900m, after which it is constant at 900m wide either side. Sketch attached (known line - green; to be calculated - magenta).

I think what I want is a polygon with the above characteristics. I do have this in a kml file; however I wonder whether it would be possible to calculate this directly in QGIS, if I have the start point and extended centerline as vector. Can anyone help?

All the best


texts:
I have files projected in British National Grid.
After I have transformed them into WGS_1984.
 I noticed that if I were to transform them back to BNG the original would not match the new.
Is there a way to make sure this does not happen especially when moving from BNG to WGS 1984 multiple times?