texts: Understanding gap in Cesiumjs bar chart?

texts:
I use Cesiumjs to create a bar chart.  I don't understand why there is a gap in the bar? Code Link

        var viewer = new Cesium.Viewer('cesiumContainer');
        viewer.scene.globe.depthTestAgainstTerrain = true;
        var alt = 0;
        var height = 1204.5894586894588;
        var blueBox = viewer.entities.add({
            name: "1",
            position: Cesium.Cartesian3.fromDegrees(-122, 37.5, alt),
            box: {
                dimensions: new Cesium.Cartesian3(4000 / 20.0, 3000.0 / 20, height),
                material: Cesium.Color.YELLOW
            }
        });
        alt += height;
        height = 1141.9837105171814;
        var blueBox = viewer.entities.add({
            name: "2",
            position: Cesium.Cartesian3.fromDegrees(-122, 37.5, alt),
            box: {
                dimensions: new Cesium.Cartesian3(4000 / 20.0, 3000.0 / 20, height),
                material: Cesium.Color.BLUE
            }
        });
        alt += height;
        height = 1676.1912919343326;
        var blueBox = viewer.entities.add({
            name: "3",
            position: Cesium.Cartesian3.fromDegrees(-122, 37.5, alt),
            box: {
                dimensions: new Cesium.Cartesian3(4000 / 20.0, 3000.0 / 20, height),
                material: Cesium.Color.RED
            }
        });
        alt += height;
        height = 1199.65;

        var blueBox = viewer.entities.add({
            name: "4",
            position: Cesium.Cartesian3.fromDegrees(-122, 37.5, alt),
            box: {
                dimensions: new Cesium.Cartesian3(4000 / 20.0, 3000.0 / 20, height),
                material: Cesium.Color.GRREN
            }
        });
        viewer.zoomTo(viewer.entities);
        /*var outlineOnly = viewer.entities.add({
         name : 'Yellow box outline',
         position: Cesium.Cartesian3.fromDegrees(-100.0, 40.0, 300000.0),
         box : {
         dimensions : new Cesium.Cartesian3(400000.0, 300000.0, 500000.0),
         fill : false,
         outline : true,
         outlineColor : Cesium.Color.YELLOW
         }
         });*/

        viewer.zoomTo(viewer.entities);


texts: Label every polygon with true/false if it contains point

texts:
I have large polygon data set and I want to label every one with true if polygon contains point or false if it does not. Polygon can contain multiple points, but if just one point fall into polygon it should be true.
With large polygon data set  (about 100 mil polygon and 10 mil points) what is the most efficient time-consuming way to do this using postgis?
This is what I ended up with:
select distinct on (poly.id) poly.id, case when st_contains(poly.geom, point.geom) is true then true else false end as contains
from polygon poly
left join public.poi point
on st_contains(poly.geom, point.geom);


texts: Use QuadTree in R to create Geospatial clusters

texts:
I am currently looking into different clustering techniques to form clusters from geospatial data.

Is it possible to utilize quadtrees(from the SearchTrees package in R) to come up with something similar to k-means/k-medoid clusters for data points?


texts: How to set feature vertex Z from an intersecting feature's Z?

texts:
In ArcGIS how can I set the Z values of the portion of a line that intersects another line to the Z values from the other line? A batch process is preferred.

I tried FeatureToLine, but the null values of line A (blue) remain null.

[update] The red line is source and has a constant Z, though ultimately there is no reason it has to be constant. Blue line is variable Z, the target, the one with vertices we want to change, while the red line should be read-only and unaltered by the operation.

(The diamonds are just to indicate where the vertices are.)


texts: Does a polygon in a layer intersect with another polygon in the same layer

texts: I am a CS major with little experience in GIS. I am working on vector polygon overlay. Looking at GML and shapefile data, I realized that a map is made up of a large number of polygons. Does a polygon in a map intersect with another polygon in the same map? In other words, is it correct to assume that no two polygons in one map intersect with one another? It is very difficult to verify this by looking at the vertices of the polygon because of the sheer size of the files.


texts: Using st_union for joining overlapped areas in PostGIS?

texts:
I have two land use maps for London which have an overlapped area.

Can I use the st_union function in postgis to join them together?

The attribute table contains information includes legends and building heights.

Will this method affect my features?

For example, in the overlapped area, will the build heights become 2 times of the original?

Data from postgres have the same columns and same type of data.

After using @CL.'s method, I got this map. Only some features near the boundaries were deleted which needed to be fixed.


texts: QGIS 3.4 Spatial Join error message interpretation

texts:
I had a problem when spatial joining two polygon layers.
The error message says:
" Feature (182) has invalid geometry. Please fix the geometry or change the Processing setting to the "Ignore invalid input features" option. "
How I'm supposed to discover wich feature has the (182) associated to it? Is this information obtained by ID column? What if I don't have a ID column? Or is that number associated to the current order of the attribute table?


texts: Update Cursor keeps Crashing and Skipping

texts:
I use a 3rd party software that exports the name of JPEG as I collect points, in this case street signs. I know the names stay static and are all unique but different features may have the same JPEG (which I think wont be a problem). So the issue I am having, as my update cursor is running it seems to crash and often times skip over fields (they do exist and are still being skipped over). When I run my codes again sometimes I will get this "Too many outputs to process".
Here is my Code:

I am using Pycharm, I have some theories to why it keeps crashing, not enough memory, data too large, or the program is clunky when processing large data. If anyone has some suggestions or more efficient programs for processing python code for my large data sets that would be awesome.

Here is my Code:

import arcpy

from arcpy import management

arcpy.env.workspace = r'F:\Compton LTI Imagery\Imagery'

folders = arcpy.ListWorkspaces("*")

for folder in folders:

arcpy.env.workspace = folder

rasters = arcpy.ListRasters("*")

for raster in rasters:

    desc = arcpy.Describe(raster)

    input = r'C:\Users\ferna\Desktop\Compton_Signs\Compton_Signs.shp'

    management.AddField(input,"Direct_R", "TEXT", "","", 100)

    fields = ['Right_Img', 'Direct_R']

    with arcpy.da.UpdateCursor(input, fields)as cursor:

        for row in cursor:

            name = desc.baseName

            if row[0] == name:

                row[1] = folder + "\\" + raster

            cursor.updateRow(row)

            print raster + " " + "Directory_R Copied"

    management.AddField(input,"Direct_L", "TEXT", "","", 100)

    fields_2 =  ['Left_Img', 'Direct_L']

    with arcpy.da.UpdateCursor(input, fields_2)as cursor:

        for row in cursor:

            name = desc.baseName

            if row[0] == name:

                row[1] = folder + "\\" + raster

            cursor.updateRow(row)

            print raster + " " + "Directory_L Copied"

print "Operation Completed"


texts: Multiple geometry types in one column not recognized

texts:
I often use PostGIS tables with a geometry column of type "Geometry" containing varying geometry types e.g. polygons and points. When opening the table in QGIS the Connections dialogue lists the table once for each different geometry type as expected. Today I converted a PostGIS table from MultiLineString to Geometry and added some point and polygon objects to the table. But QGIS does not recognize the change and has only one entry for the table in the Connections dialog with a Spatial Type of LineString. However, in PostGIS, if I query:
select distinct st_geometrytype(wkb_geometry)
from tracts_test;

I get:
"ST_LineString"
"ST_Polygon"
"ST_Point"

as expected.
I've tried adding and removing the spatial index, adding and removing the primary key, and creating a new table with create NEW_TABLE as select * from OLD_TABLE; but in no case does QGIS see any geometry type other than LineString. What else should I be doing, or where else should I be looking, coerce QGIS into seeing the other geometry types in the table?


texts: Editing shapefile Item Description > Summary in ArcPy?

texts:
Is there a way to edit a shapefile's Item Description > Summary in ArcPy?

I can right click on the shapefile in catalog, select Item Description, then click edit... but I want to automate this in arcpy. I also want to keep the default metadata format. Screenshot below is example of default metadata format, with my manual edits to Summary (not done in arcpy).


texts:
I have 2 polygon layers, 1 showing roads and another showing parking restrictions on those roads (no parking, residents only, etc). I'm trying to style the layer according to the markings that would appear on the actual street (double yellow lines for no parking and white dashed line for residents only).

I've generated styles using a negative buffer in the geometry generator. But I'm not sure how to show only the section of polygon outline that are next to the curb (i.e. the shared outline of the road and restriction layers). This is as far as I have got:

But I'd like this as the end result (created with MS paint):

I need to achieve this without actually altering the geometry or creating any new layers that are for 'cartographic purposes only'. I found a useful question and answer here, but it's not quite what I'm looking for.


texts: How do I add custom CSS class to an image overlayer in Leaflet?

texts:
I have been using Leaflet's imageOverlay quite frequently to overlay images in a Leaflet map pane.  Now I would like to apply a custom CSS to the overlaid image dynamically.  I came across Raphael's post on How to add custom CSS class to leaflet tilelayer.  How do I extend this method to an image layer?  I tried the following using IvanSanchez example but could not get it to work. I was trying to apply CSS filter: grayscale(100%) to both the under-laid tiles and the overlaid image (a pineapple).  The tiles and grid lines became gray scale but not the overlaid pineapple image.

<!DOCTYPE html>

<link href="https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/master/leaflet.css" rel="stylesheet" type="text/css" />

<meta charset="utf-8">
<title>Leaflet JS Bin</title>


texts: How to preserve properties (like -p) in topojson conversion in Mapshaper?

texts:
I'm trying to use mapshaper.org to convert some geojson files to topojson, and I need the identifying properties to be preserved.

Normally this would be done with the -p flag on the command line, but despite mapshaper having the facility to allow "options from the command line interface", I can't get it to work.

I've tried -p identifier-name which give the error:

  Unknown command: p

...and I've tried I've tried "-p identifier-name" in quotes following the help examples which give the error:

  Unknown output option: -p identifier-name

Update: I've figured out that Mapshaper isn't passing these commands to the normal topojson tool, it's using them in its own custom command line interface, which is documented here (strangely there don't seem to be any links to this in Mapshaper itself).

In theory I want the option "id-field=nameoffield" but it doesn't seem to make any difference - all the geojson properties are still appended to the end of the file and the named property is not changed to an identifier.

How can I filter the properties in Mapshaper like I would with the command topojson in.json -o out.json -p prop1,prop2?


texts: Where can I get public transportation route information for USA?

texts:
I'm trying to find a list of public transit route information, mainly location of bus and train stops for the US.  I've looked around at some of the Google products and openstreetmap but can't find anything.  Any suggestions?  Where does Google get their info?

Thanks.


texts: QGIS showing text annotations from other geographically adjacent projects

texts:
I have a few QGIS projects that are adjacent to each other, geographically, but I have them as seperated projects within QGIS.
Occasionally, text annotations from one project will appear in another where there's some overlap of the geographical location.
Sometimes they only show up in Print Composer but aren't in the main QGIS window when I go to delete them.


texts: Attributing data from multiple polygons to larger polygon by proportion contained using ArcGIS Desktop?

texts:
Using ArcMap 10.3.1.

I have searched for an answer, but have only found reference to merging polygons which does not answer my question.

I have two shapefiles, one representing postcode regions and the other representing larger regions

Each postcode polygon has a value (total number of survey participants). I would like to 'assign' the data from the postcode polygons to the regional polygons; however, some postcode polygons intersect more than one regional polygon. I'd like to allocate to whichever polygon it is most contained within, and then sum the 'number of participants for the region.

I have tried 'Spatial Join' and 'Intersect' but these have not worked out.


texts:
I'm able to run PyQGIS on my Mac (OSX 10.10.3) through the Python (2.7) console and through execution of Python files through my terminal. In order to do so, I added the following to my bash_profile:

export PATH=$PATH:/Library/Frameworks/GDAL.framework/Programs/
export PYTHONPATH=$PYTHONPATH:/Applications/QGIS.app/Contents/Resources/python/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/Applications/QGIS.app/Contents/MacOS/lib/:/Applications/QGIS.app/Contents/Frameworks/

However, when running the same scripts in PyCharm, I get the following package not found errors:

ImportError: No module named qgis.core
ImportError: No module named PyQt4.QtCore
ImportError: No module named PyQt4.QtGui

In PyCharm settings, I've tried adding the following Environment Variables to Build, Execution, Deployment > Console > Python Console:

PATH - /Library/Frameworks/GDAL.framework/Programs/
PYTHONPATH - /Applications/QGIS.app/Contents/Resources/python/
LD_LIBRARY_PATH - /Applications/QGIS.app/Contents/MacOS/lib/:/Applications/QGIS.app/Contents/Frameworks/

...but to no avail. I've tried playing around with adding/removing semicolons and $VARS but no joy.

This problem is quite vexing as I'm able to import the packages without problem in PyCharm's Python console. I'm using a virtualenv that is setup within my PyCharm.


texts: Getting data of ground water quality for spatially map for demonstration purpose?

texts:
I need some arbitary data of ground water quality for demonstration purpose or for analysis in qgis.

Can some body tell me where i can get these data easily?


texts: How to use python to turn a .dbf into a shapefile

texts:
I have been scouring the internet trying to find a pythonic (sp?!) way to process this data..

Everyday we will recieve a load of data in .dbf format (hopefully) - we then need to save this data as a shapefile.

Does anyone have any links or any suggestions as to my process?


texts:
I am selecting a lot of polygons within a gigantic polygon by using  the postgis function ST_Intersects().

SELECT
        *
FROM
        data.polygons AS poly,
        data.gig_polygon AS gig
WHERE
        ST_Intersects(poly.geom, gig.geom)

The gigantic polygon is just a (one row) large sized polygon at the moment. The query is taking a very long time. I was wondering if it would be faster to split the gigantic polygon in multiple smaller polygons and run the query again. I dont want to cancel it without knowing this will be faster. To know the answer to my question I guess you have to understand in what way the ST_Intersects() function works.

Does anybody know that? Or knows another way of speeding up the ST_Intersect() functionality?


texts:
I am trying to do an ordinary least squares on some data, and the value field for the 'Unique ID Field' that I want to select isn't appearing, so I'm not able to run my ols.
Has anyone encountered this problem, and managed to overcome it?


texts: Retrieving features from MSSQL to OpenLayers and displaying them?

texts:
Today I have a table in the DB with columns Feature Name and Feature Point.

When I want to load the points to OL I do the following :

First I call web service to get list of json objects:

var request = OpenLayers.Request.POST( { url:
 "../service.asmx/GetCameraFeatures", async: false, data: "{}",
 headers: { "Content-Type": "application/json; charset=utf-8" },
 callback: this.callbackLoadCameras});
I parse points to features and add to the layer:

var objArr = eval('(' + request.responseText + ')').d;
        var jsonFormat = new OpenLayers.Format.JSON();
        var features = jsonFormat.read(objArr);
        var format = new OpenLayers.Format.WKT();
        var featuresArr = [];

    for (var i = 0; i < features.length; i++) {
        var f1 = format.read(features[i].point);
      f1.id = features[i].name;
        featuresArr.push(f1);
    }

    if (featuresArr.length > 0) {
        cosmeticLayer.addFeatures(featuresArr);
    }

Is there a better way to do this ? faster? more convenient ?


texts: Run and install packages from local folder QGIS

texts:
I use QGIS in my work and sometimes need install python libraries for plugins to work but I don't have write access to C:/ where QGIS and python is installed (OSGeo4W).
Is there a way I can install pip to a local write folder so I can install and run libraries from local path?


texts: What is the background processing of rainfall thresholding?

texts: I want to create a flood map using Quantum GIS. First of all I create catchment area (flow accumulation). Then, I delineate a Channel Network by applying a threshold to flow accumulation. So I want to know, How can I determine threshold value and what is the mathemathical concept?


texts:
I'm trying to get QGIS API intellisense in VS Code IDE but it doesn't work.

I'm using QGIS 3.4 and Windows 10.
I followed the instructions from this link: http://gis-expert.com/wp/2018/10/15/how-to-setup-qgis-3-and-visual-studio-code-plugin-development-windows/

I'm using: VS Code 1.29.1, extensions: Python and PYQT Integration.

This is my bat file:

@echo off
path %PATH%;C:\PROGRA~1\QGIS3~1.4\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\grass\grass-7.4.2\lib
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\Qt5\bin
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\python\qgis\PyQt
path %PATH%;C:\PROGRA~1\QGIS3~1.4\apps\Python37\Scripts
set PYTHONPATH=%PYTHONPATH%;C:\PROGRA~1\QGIS3~1.4\apps\qgis\python
set PYTHONHOME=C:\Users\[username]\AppData\Local\Programs\Python\Python37
path %PATH%;C:\Users\[username]\AppData\Local\Programs\Python\Python37\Scripts

start "VisualCode QGIS" /B "C:\Users\[username]\AppData\Local\Programs\Microsoft VS Code\Code.exe" %*

Python and PyQT intellisense are ok, QGIS not.
Can you help me?


texts:
I'm using rmapshaper, the R wrapper of MapShaper, to simplify polygons without slivers and it works well on small shapefiles. However, when I run it on a larger one (~150M, ~5000 shapes), it runs out of memory. Here's a reproducible example:

# Load packages
if (!require("pacman")) install.packages("pacman")
pacman::p_load(knitr, readr, knitr, readr, plyr, dplyr, sp, rgdal,maptools, rgeos, rmapshaper)

# DOWNLOAD and UNZIP this file in the local folder.
# https://borders.ukdataservice.ac.uk/ukborders/easy_download/prebuilt/shape/infuse_ward_lyr_2011.zip

# read shapefile
uk_wards_2011 <- readOGR(dsn="infuse_ward_lyr_2011.shp")

# save attribute table
df = uk_wards_2011@data
sdf = uk_wards_2011

# simplify without slivers
geom_simpl = rmapshaper::ms_simplify(sdf, keep = 0.01 ) # !!! This runs out of memory !!!
sdf_simpl = SpatialPolygonsDataFrame( geom_simpl, df )

summary(sdf_simpl)

# write to a geojson
writeOGR(obj = sdf_simpl, dsn = "simplified_shapes.geojson",layer='simple_shapes', driver="GeoJSON", overwrite_layer=T, delete_dsn=T)

This always generates this error:

#
# Fatal error in CALL_AND_RETRY_0
# Allocation failed - process out of memory
#

Any workaround? I tried with QGIS but it always generates slivers in the simplified polygons.


texts: Zonal histogram completed but no output created

texts:
I am trying to obtain zonal histogram data for about 10 000 statistical sectors in Belgium.
So I have a shapefile containing these polygons.
I also have a value raster which has been reclassified : it contains integer values from 1 to 5.
When I run zonal histogram, the tool runs (for a little more than 1 hour) and then displays "Completed". The result window confirms that the Output was created, however, I can't display it. If I go looking for it manually, it's also absent.

Is there a solution to this ?
I would like to obtain a table with the refid of each zone and a column with the counts of pixels of value 1, a second column counting the pixels with value 2, etc.


texts: Setting up an application in QT Creator that uses QGIS API

texts:
I am a 15 year veteran of Java making my first entry in to C++ applications.  I have a specific need to develop a desktop application that produces graphics type output as well as displaying embedded maps.  It looks like Qt and QGIS API are exactly what I need to get this going.

I have been playing around with Qt Creator and generated several of the tutorials without too much problems.  Now I am trying my first Qt project that incorporates the QGIS API.  I am really stuck.  I can't figure out where the libraries are that contains the QGIS modules.  I think I have an idea how to configure the Qt project if I could find QGIS.  I found all the .h files but some of what I need just aren't there.

There are some good examples of code that shows how to code with QGIS classes.  But I can't find anything that explains how to set the project up.  Could someone please help guide me through setting up a project in Qt Creator that will allow me to incorporate the QGIS modules?  I have been searching everywhere.  Google can be a strange beast.  Sometimes you find what you need on the first search.  Other times it just never happens.


texts: Calculating consecutive number of dry days in year using Time Series in GRASS

texts:
I have a database with daily raster maps of future precipitation for some years (let's say 2020-2050, divided in 10 years subperiods), named like this:
"pr_model_rcp_2020_2030.1", "pr_model_rcp_2020_2030.2", ..., "pr_model_rcp_2020_2030.3650", starting from 01/01/2020 (raster n.1) to 12/31/2030 (raster n. 3650), for the first ten years. "Model" is the model chosen for projection, "rcp" is the emission scenario.
I want to calculate the maximum number of consecutive dry days (pr < 1mm) per year.
How can I use time series command on grass or temporal aggregation (t.rast.series) to do that?


texts: solving Mixing dicts with non-Series may lead to ambiguous ordering

texts: am trying to analyze geojson data using pandas library but am getting this error "Mixing dicts with non-Series may lead to ambiguous ordering." how am able to eliminate the error since the output i need to incorparate in django view and i dont want to use geopandas


texts: How to save shortest path attributes to a new layer with PyQGIS?

texts:
I'm using QGIS 2.14.22 Essen. I'm using network analysis dijkstra() to find the shortest path from p1 to p2 on a power grid network. But what i get from it is the shortest path without any attributes and fields.

I have found a way to save the shortest path attributes and fields to a new layer, but it requires to apply a buffer over the "empty" shortest path and then use qgis:selectbylocation to select only the power grid features that are inside the buffer. Is  it possible to do the same only using dijkstra()??

Here is the code, it may help someone else:

##-- coding: utf-8  --##

import processing
from processing.tools.vector import VectorWriter
from PyQt4.QtCore import *
from qgis.core import *
from qgis.networkanalysis import *

########--- Finding Shortest Path from p1 to p2 ----#########

# Load the power grid network
layer = QgsVectorLayer("C:\...\power_grid.shp",
"power_grid", "ogr")
QgsMapLayerRegistry.instance().addMapLayers([layer])
layer = processing.getObject('power_grid')

(x1,y1)=(357719.47,6307582.61)  #p1
(x2,y2)=(357801.11,6307695.86)  #p2

director = QgsLineVectorLayerDirector(layer,-1,'','','',3)
director.addProperter(QgsDistanceArcProperter())
builder = QgsGraphBuilder(layer.crs())
from_point = QgsPoint(x1,y1)
to_point = QgsPoint(x2,y2)
tied_points =director.makeGraph(builder,[from_point,to_point])
graph = builder.graph()
# compute the route from p1 to p2
from_id = graph.findVertex(tied_points[0])
to_id = graph.findVertex(tied_points[1])
(tree,cost) = QgsGraphAnalyzer.dijkstra(graph,from_id,0)
route_points = []
curPos = to_id
while (curPos != from_id):
    in_vertex = graph.arc(tree[curPos]).inVertex()
    route_points.append(graph.vertex(in_vertex).point())
    curPos = graph.arc(tree[curPos]).outVertex()
route_points.append(from_point)

result = 'C:\...\p1_to_p2.shp'
writer = VectorWriter(result,None,[],2,layer.crs())
fet = QgsFeature()
fet.setGeometry(QgsGeometry.fromPolyline(route_points))
writer.addFeature(fet)
del writer
#processing.load(result)

###- Creating a buffer over the "empty" shortest path found above -###

#lyr is the shortest path generate above, without attributes
lyr = QgsVectorLayer("C:\...\p1_to_p2.shp",
"shortestpathEmpty", "ogr")

# Next, visualize the shortest path on the map:
QgsMapLayerRegistry.instance().addMapLayers([lyr])

# Access the layer's features:
fts = lyr.getFeatures()

# Creating a buffer layer in memory
buffLyr = QgsVectorLayer('Polygon?crs=EPSG:29189', 'Buffer' ,"memory")
index=QgsSpatialIndex()

#Creating the buffer over the empty shortest path
#It's not necesary a for to do it, but it works
for f in fts:
    buff = f.geometry().buffer(1,2)
    pr = buffLyr.dataProvider()
    b = QgsFeature()
    b.setGeometry(buff)
    pr.addFeatures([b])

# Update the buffer layer's extents:
buffLyr.updateExtents()
# Set the buffer layer's transparency to 80
buffLyr.setLayerTransparency(80)
# Add the buffer layer to the map:
QgsMapLayerRegistry.instance().addMapLayers([buffLyr])

#####--- Saving the shortest path with attributes to a new layer ---#####

#Selecting the features from power_grid that are 'within' the buffer with
#the empty shortest path shape
processing.runalg("qgis:selectbylocation",layer,buffLyr,[u'within'],0)

power_grid= qgis.utils.iface.mapCanvas().currentLayer()
# Saving the shortest path with attributes
result='C:\...\p1_to_p2withattr.shp'
# Using geoprocessing alg "Save selected features"
processing.runalg('qgis:saveselectedfeatures', layer, result)
#Add saved path with attributes to map
processing.load(result)
iface.zoomToActiveLayer()

Applying a buffer and using qgis:selectbylocation, this is the result:

Finally, I'm able to get the shortest path attributes in a new layer:


texts: How to install OSM .pbf support in GDAL on Debian?

texts:
I'm trying to use Anita Graser's post on loading OSM data from .PBF files into a SQLite .db file using ogr2ogr but it stopped working.
I'm trying to run the following command:
ogr2ogr -f "SQLite" -dsco SPATIALITE=YES Denver_OSM_Test.db denver.pbf

...yields the following error:
Unable to open datasource `denver.pbf' [list of drivers]
I'm trying this on both Ubuntu 14.04 and Linux Mint 17.2
Note: This has worked cleanly before on Ubuntu 14.04 as per the instructions linked below which installed GDAL 1.9 or older... why this has stopped working is beyond me...
I have installed the prerequisites:

libsqlite3
libexpat

Then tried to re-install GDAL both from source, and from Sara's instructions which pull from the UbuntuGIS project.
EDIT:
Versions:
Using ogrinfo --version I get GDAL 2.0.0, released 2015/06/14
Using apt-cache policy gdal-bin I get:
gdal-bin:
  Installed: 1.11.2+dfsg-1~exp2~trusty
  Candidate: 1.11.2+dfsg-1~exp2~trusty
  Version table:
 *** 1.11.2+dfsg-1~exp2~trusty 0
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1.10.1+dfsg-5ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages


texts: Getting QGIS TMS layers (using GDAL_WMS driver) to work via http proxy?

texts:
Has anyone managed to get QGIS to successfully load TMS tiles when the QGIS client is behind an HTTP proxy?

I host a number of TMS layers, and make them available to GIS users as well as to my own website.  They layers are accessible in QGIS via the XML scripts on the following page:

http://mapspast.org.nz/gdal

These scripts load and the maps are displayed fine in QGIS when the client has direct access to the internet (just open them as raster layers in QGIS and they work). However, when the QGIS client is behind a firewall I have not managed to get the HTTP GET requests to go via the proxy.

What I have tried:
QGIS network settings:                ignored - GET requests go direct to target
GDAL_HTTP_PROXY environment variable: ignored - GET requests go direct to target

I should state that the clients are running on windows PCs and so I may be setting the environment variable in the wrong place (I set it as a windows environment variable)

Has anyone got this to work?


texts: ArcObjects add multiple inputs to GeoProcessor

texts:
I am trying to send multiples input features to the Geoprocessing.IGeoProcessor (to do an Intersect). I am doing this because I can't add the layer path since one of them is from ArcSDE. The example on the ESRI website is incomplete:

Building a custom geoprocessing function tool

[VB.NET]
' Multivalue parameter of Feature Layers/Feature Classes.'
Dim inputParameter As IGPParameterEdit3 = New GPParameterClass()
Dim inputType As IGPDataType = New GPFeatureLayerTypeClass()

Dim mvType As IGPMultiValue = New GPMultiValueClass()
mvType.MemberDataType = inputType

Dim mvValue As IGPMultiValue = New GPMultiValueClass()
mvValue.MemberDataType = inputType

inputFeatures.Name = "input_features"
inputFeatures.DisplayName = "Input Features"
inputFeatures.ParameterType = esriGPParameterType.esriGPParameterTypeRequired
inputFeatures.Direction = esriGPParameterDirection.esriGPParameterDirectionInput
inputFeatures.DataType = CType(mvType, IGPDataType)
inputFeatures.Value = CType(mvValue, IGPValue)

parameters.Add(inputFeatures)

There is no code to actually add the feature layer to the input features list. I tried to add my feature layer with :

mvValue.AddValue(lFeatureLayer)

and I got a invalid COM interface cast exception. What is the real way to do this?


texts: How to display multiple labels when polygons overlap in Carto?

texts:
I have a polygon layer in Carto where polygons overlap.  I need to display both sets of attributes for overlapping polygons when a user clicks on them.  Is this possible?

For example if PolygonA has attribute NAME=A and PolygonB is NAME=B and the two overlap, and I click on the area where they overlap, I want to see an info window, or multiple windows, that show both A and B.


texts: Set georeferenced extents of VRT file when calling GDALBuildVRT

texts:
I'm using Jupyter Notebook and gdalbuildvrt to write a program that loads hundreds of rasters. I want to set an area of interest, and only keep rasters (or portions of rasters) that fall in this area.

Here's an example pulled from the internet, using the 'te' flag from the command line to set a bounding box:

gdalbuildvrt -te 5.8887,50.3332,9.4702,52.5212 output.vrt -input_file_list

However, in the Python/Jupyter API, using BuildVRT, it isn't clear how to set the georeferenced extents:

outds = gd.BuildVRT(output.vrt, filelist, separate=True)

Simply adding 'te' causes a syntax error


texts:
I want to create a map with openlayers, add feature points, let people move the points and retrieve the new coordinates later. I have searched the net for two days but all I found was an example where you get the new coordinates while the move is in progress capturing the data of the event. But I want to access the feature later (on another event).

Everything works fine beside accessing the feature object afterwards to retrieve the coordinates.

Here is my working code:

    <link rel="stylesheet" href="path/to/bootstrap.css">

And now I would like to retrieve the coordinates of the object with this function:

function getFeaturecoordinates(featureID) {
console.log('Feature Moved To:' + vectorSource.getFeatureById(featureID).getGeometry().getCoordinates());
    }

But obviously it does not work. I also tried a lot of other possibilities to access the feature, e.g.

vectorLayer.getSource().getFeatureById(featureID).getGeometry().getCoordinates());

But they all do not work.

What is the right way to access the feature by featureID?


texts: Using Arcade conditional IIF Statement in ArcGIS Field Maps

texts:
I am building a form in ArcGIS Field Maps and if one field is answered NO, I want the next 8 fields to not even show up.  I think I need them in a group and to use an IIF statement:
IIf($feature["FCTR_PRSNT"]=='NO', valueIfTrue, "")

I'm struggling with the syntax and finding any examples of how to write the ValueIfTrue part that would essentially 'hide' those next 8 fields?


texts: Arcpy export shp to kmz with transparency

texts:
I'm trying to export massive shp to kmz aplying simbology.

The code without transparency works good:

    import arcpy, os
    workspace = r'C:\\folder\\of\\the\\workspace\\'
    in_symbology_layer = 'lyr.lyr'
    arcpy.env.workspace = workspace
    for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureClass", type = "Polygon"):
        for filename in filenames:
            lyrname = os.path.splitext(filename)[0]
            arcpy.MakeFeatureLayer_management(filename, lyrname)
            arcpy.ApplySymbologyFromLayer_management (lyrname, in_symbology_layer)
            arcpy.LayerToKML_conversion(lyrname, lyrname + '.kmz')

When I try to export it with the transparency it doesn't work:

    import arcpy, os
    workspace = r'C:\\folder\\of\\the\\workspace\\'
    in_symbology_layer = 'lyr.lyr'
    arcpy.env.workspace = workspace
    for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureClass", type = "Polygon"):
        for filename in filenames:
            lyrname = os.path.splitext(filename)[0]
            arcpy.MakeFeatureLayer_management(filename, lyrname)

            lyrname = arcpy.mapping.Layer(in_symbology_layer)
            lyrname.transparency = 50

            arcpy.ApplySymbologyFromLayer_management (lyrname, in_symbology_layer)
            arcpy.LayerToKML_conversion(lyrname, lyrname + '.kmz')

Do you know how to resolve this problem?


texts: How can I include HTML Audio in a Folium Marker popup?

texts: I need to insert a audio HTML format, so when the people click in the marker, the popup will be a audio to listen. Is it possible?


texts: Changing dialog appearance (labels, etc) of tool made in ModelBuilder?

texts:
For this tool I've created, I would like to change how the user would see the things they can choose. This is the tool in ModelBuilder:

And this is what the user sees when they click on the tool:

I would like to change what the user sees so that:

The label that currently says CSRS_ORN_NER would say Selecting Features.
The label that currently says Stations_Diff_by_CSRS would say Input Layer.
The Field option is no longer there.
The Linear unit can only be in kilometers, meters, or miles.
The fields are all blank when the tool is opened.
This fields are ordered in this way: Selecting Features, Input Layer, Selection Type, Distance.
And lastly, you can bypass clicking the 'browse for a folder' button next to two of the fields and just click the drop-down arrow to search for your input.


texts: Selecting files with matching names and then executing a process

texts:
I have two lists and I would like to find a way to select them based on names.

In list one I have a series of tif files:

list1=['LT50300281984137PAC00_sr_band1.tif',
,'LT50300281984137PAC00_sr_band2.tif'
'LT50300281984137PAC00_sr_band3.tif','LT50300281994260XXX03_sr_band1.tif',
'LT50300281994260XXX03_sr_band2.tif',
'LT50300281994260XXX03_sr_band3.tif']

in list two I have two files:

list2=[LT50300281984137PAC00_mask.tif,LT50300281994260XXX03_mask.tif]

I want to exectue a process (which I won't ask how to do here) for files in list one which start with LT50300281984137PAC00 to the file in list 2 which starts the same way, and the same for the files which start with LT50300281994260XXX03.

I think it will go something like:

#select the files based on names
for i in list1:
    if i[0:20] in list2:
#this code executes the process I want ONLY if the naming matches
        for b in list1:
            arcpy.gp.ExtractByMask_sa(b,list2,outraster)
     else:
          print('Done')

So basically if the file names in list 1 match those in list 2 I want to execute my process otherwise print done

Edit:

New code being tried is:

import arcpy

arcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected Landsat\hank_practice'

list1 = arcpy.ListRasters("*band*")

list2 = arcpy.ListRasters("*_nocloud.tif")

for raster in list1:
  rasterName = raster
  rasterMask = "" #initialize your variable to be populated in the inner loop
  for mask in list2:
    if mask.startswith(rasterName):
      rasterMask = mask
      break #break out of the inner loop - we have a match
  if rasterMask != "": #just to make sure we have something
    #generic naming
    outraster = rasterName.replace(".tif", "_masked.tif")
    arcpy.gp.ExtractByMask_sa(rasterName,rasterMask,outraster)


texts: Bounding Areas using Feature Collection values (RESOLVE Ecoregions 2017)

texts:
I'm pretty new to the Earth Engine and have been working through some of the tutorials to familiarize myself with it. I have very little code experience.
What I am trying to accomplish is creating a line of code that will reference a specific biome in the Resolve Ecoregions 2017 Feature Collection and use that biome to create a boundary. I can always just trace this boundary in the code editor, but I believe there is a way to reference it from the source material to improve accuracy of my boundary and also save time. My usual method of clipping any geometry is as follows:
var NameofClipVar = function(image) {
  return image.clip(GeometryName);
};

Where GeometryName is the name of any shapefile or geometry point drawn onto the map via and NameofClipVar is just whatever I need that variable to be named. I would then reference this during filtering of say Landsat imagery. What I would like to do is instead of referencing the geometry I reference the name of a biome and its subsequent bounds.


texts: I previously had a PC computer, where I could easily save QGIS files to any folder I wanted through the browse tool under "Save As".  However, I have since switched to a Mac and when I try to save my files to a custom folder, it  only shows a select few folder options instead of allowing me to browse to the folder that I want to save the files in.  Has anyone else experienced this problem and figured out a solution?


texts: Export of group = multiband raster to another format not works in GRASS

texts:
I am really new in GRASS and my question is really basic but I don't realize where I am wrong.

I have a set of single layers in my PERMANENT from some Landsat images (1 Landsat = 7 one layer rasters). I would like to export group (named "stack" in R) of these layers = forming 1 Landsat image to .img. I suppose the following steps to do it in GRASS:

Import single layer to GRASS (there is no way to import multiple layer in one time?): r.in.gdal
Create "group" = multiband raster from singleband rasters: i.group.
Export multiband raster as new format: r.out.gdal

My problem is why when I use i.group I see that actually I have a group of my bands:

but if I want to export group of my layers a see only single bands, not the group!!

Please, any idea how to create and export multiband raster to .img in GRASS? (and try to avoid python?). As my bands are in GRASS format, I can't easily do the job in software more convenient for me.


texts:
Is there an easy way to mass download SRTM data?  The data is published for download here, but it's sliced into thousands of small files, and I don't see an FTP option for more efficient downloading...  Another issue is that the server seems to die (or run out of bandwidth) when I use a download manager like the "DownThemAll" Firefox extension to get them.

Is there a better resource for getting this data?


texts: Overlay polygons on raster in different projections

texts:
I'm overlaying polygons on a raster to get the average value inside the polygon (using SAGA->Shapes-Grid->Add grid values to shapes in the QGIS Processing Toolbox), using a geographic and a projected coordinate system.

When I compare the average polygon values, they are different based on the projection. That is, when I use a polygon layer and raster in WGS84 (EPSG: 4326), I get one value. If I reproject both the polygon layer and the raster to MGA56 (EPSG: 28356) and redo the average calculation, I get different values for most of the polygons. Why is this? I feel that the average should be preserved. Is it because of the algorithm used to determine which raster cells are inside the polygon? Is one value "more correct" than the other?


texts:
I can not obtain my reflectance map in pix4D.

The program said:

  Unable to computed radiometric calibraticon from sequoia. Unable to
  computed coordinated system.

Its rare, because normally i can obtain my maps.


texts: Filter an imageCollection by a given month for a range of years in Earth Engine?

texts:
I want to filter TRMM precipitation data for a defined region and specific month, for example January, over 10 years.

To be clear, I only want observations referring to January for each year in a given range.

I've tried using .filterDate(), but this does not seem like the right method for this task.

What ee.ImageCollection method is best suited for this?


texts: Automatically assigning current map scale to shape created in QGIS?

texts:
In QGIS, would it be possible to automatically assign the current map scale to a feature created during an edit session and save it into a field in the attribute table?

I have a series of OS maps of different scales set up to allow automatic zooming in and out.  Users will digitise features onto a study area and may choose to do this at different scales - for example a large polygon of a general, non specific, area at a small scale, and a point location for which the location is known exactly and is digitised at a large scale.  To allow me to determine the potential accuracy of the features being digitised (after the session) I would like to be able to automatically assign the current map scale to the attribute table when completing a feature.

Ideally it would happen automatically on finishing each feature, so that there is minimal user interaction (the people using the system are non-specialists), but other suggestions welcome that could be adapted into a reasonably slick workflow.


texts: Error WFS (2.0.0) GetFeature spatial query with multi-surface geometries in ArcGIS Server 10.6

texts:
In the new version of ArcGIS Server 10.6 it is not possible to request GetFeature WFS with spatial filters with multi-surface geometry. The following is an example of the query:

GML3 geometry would be represented as:

> <gml:MultiSurface
> srsName="urn:ogc:def:crs:EPSG:6.9:6247"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>98465.5842225004
> 106542.564601002 98498.638362525 106596.879798651 98570.0738671067 106561.465944204 98542.3330263732 106505.380223682 98465.5842225004 106542.564601002</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>98547.0558057572
> 106505.380685821 98581.8812200508 106557.334667689 98668.0733316556 106543.174764104 98634.4311531541 106465.24560996 98547.0558057572 106505.380685821</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface

The POST query for the following case would be as follows:

WFS URL: http://www.secretariadeambiente.gov.co/arcgis/services/MapasVisorGeo/EEP_Reporte_Dec190/MapServer/WFSServer?

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature service="WFS" version="2.0.0"
    xmlns:wfs="http://www.opengis.net/wfs/2.0"
    xmlns:fes="http://www.opengis.net/fes/2.0"
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:EEP_Reporte_Dec190='http://www.secretariadeambiente.gov.co/arcgis/services/MapasVisorGeo/Lote/MapServer/WFSServer'
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.opengis.net/wfs/2.0
                        http://schemas.opengis.net/wfs/2.0/wfs.xsd
                        http://www.opengis.net/gml/3.2
                        http://schemas.opengis.net/gml/3.2.1/gml.xsd">
  <wfs:Query typeNames='EEP_Reporte_Dec190:EEP_Reporte_Dec190:Parques_Urbanos' srsName="urn:ogc:def:crs:EPSG:6.9:6247">
      <fes:Filter>
    <fes:Intersects>
    <fes:ValueReference>SHAPE</fes:ValueReference>
    <gml:MultiSurface><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>98465.5842225004 106542.564601002 98498.638362525 106596.879798651 98570.0738671067 106561.465944204 98542.3330263732 106505.380223682 98465.5842225004 106542.564601002</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>98547.0558057572 106505.380685821 98581.8812200508 106557.334667689 98668.0733316556 106543.174764104 98634.4311531541 106465.24560996 98547.0558057572 106505.380685821</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface>
    </fes:Intersects>
     </fes:Filter>
    </wfs:Query>
</wfs:GetFeature>

And ArcGIS Server returns the following error:

<?xml version="1.0" encoding="utf-8" ?>
<ExceptionReport
 version="2.0.0" xmlns="http://www.opengis.net/ows/1.1"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsAll.xsd">
    <Exception exceptionCode="InvalidParameterValue" locator="Unknown">
        <ExceptionText>
            <![CDATA[Unknown geometry type was found.]]>
        </ExceptionText>
    </Exception>
    <Exception exceptionCode="OperationProcessingFailed" locator="Unknown">
        <ExceptionText>
            <![CDATA[Operator 'Intersects' can't parse geometry.]]>
        </ExceptionText>
    </Exception>
</ExceptionReport>

It is to be noted that in version 10.4.1 this query worked correctly.


texts: Can ArcGIS automatically round labels for a raster symbolised according to a classification?

texts:
I'm looking for a way to automatically adjust the reported precision of the label field for a float raster rendered in ArcGIS according to a classified symbology. Currently, the a classified raster symbology label is reported at the class break precision (8 decimal places).

I don't want to modify the class breaks itself, just round the reported break (e.g. to 2 decimal places) for producing a map layout.

I know I can modify the label manually but I don't want to have to do this for every class break and for multiple rasters.

Is there a setting automatically adjust the label?


texts: Adding an incrementor in CalculateField_managment() expression

texts:
I am trying to recalculate a value for a field using arcpy.CalculateField_management() using a tricky expression. Currently, I am recalculating one field named REACH_ID, using another field ('CO_FIPS') and them adding "01" + '!REACH_ID[-5:]'
arcpy.CalculateField_management(layer_output,'REACH_ID','!CO_FIPS! + "01" + !REACH_ID![-5:]','PYTHON')

So if I had a REACH_ID = 440030100008 and a CO_FIPS = 44023, it would recalculate as 440230100008. Now what I want to do is simply replace the '!REACH_ID[-5:]' with an incrementor. So if 440030100008 was the first REACH_ID in my attribute table, I want to make replace 00008 with 00001 and then for the next row, I want to add 00002, and so on. The first problem is that its tricky creating a string incrementor, but I have overcome that issue. I can use something like this (using a 'counter'):
x = '00000'
for i in range(0, 10):
    x = str(int(x) + 1).zfill(len(x))
    print(x)

or as a function where length would be the row count of the feature, layer_output :
x = '00000'
f_length = arcpy.GetCount_management(layer_output)
def incrementor(counter, length):
    for i in range(0, length):
        counter = str(int(counter) + 1).zfill(len(counter))
        print(counter)

arcpy.CalculateField_management(layer_output,'REACH_ID','!CO_FIPS! + "01" + incrementor(x, f_length),'PYTHON')

But, the problem is...how does one get the incrementor to work inside of the expression in CalculateField_management? Am I going about this the wrong way? I haven't come across any other questions that explain how to achieve this.


texts: What are common mistakes when creating mosaic datasets?

texts:
I have a set of images taken from a unmanned air vehicle, they have lat/lngs when properties are clicked in windows, but when they are imported into ArcGIS they have no spatial reference or coordinate reference system.  I have tried projecting the images in WGS and a state plane projection, but still no luck.  The images are taken at 1CM resolution on one day. When an actual mosaicked data set is completed, my output is usually the last data set that was uploaded into the dataset, hence I have a footprint around one image instead of multiple images.

As far as typical workflow:

Should the images be projected, then assembled into a mosaic dataset?

When should I use a raster dataset or raster catalog to assemble a mosaic dataset?

I will have upwards to 100 or more images that will need to be mosaicked.

I am using ArcGIS 10.2


texts: Rendering image in QGIS from custom plugin

texts:
How is it possible to render TIFF image from the path in the custom plugin?
I tried to do like this:
canvas = QgsMapCanvas()
layer = QgsRasterLayer('my.tif',
                            'mytif',
                            'gdal')
QgsProject.instance().addMapLayer(layer, False)
canvas.setExtent(layer.extent())
canvas.setLayers([layer])
canvas.show()

also tried iface.addRasterLayer() and gsMapLayerRegistry.instance().addMapLayer(layer) - these two ways are definitely workable from the qgis python console however in the plugin I have warnings like
    Warning: QObject::setParent: Cannot set parent, new parent is in a different thread
Warning: QObject::connect: Cannot queue arguments of type 'QList<QgsMapLayer*>'
(Make sure 'QList<QgsMapLayer*>' is registered using qRegisterMetaType().)

and nothing is rendered.
I'm trying to do it from the separate class in the plugin package if it is a necessary information.


texts: earthEngine: count number of fully covered pixels within a region

texts:
I would like to count the number of pixels that are fully covered by a given region/geometry. How can I do that? Using standard reducer, I can get:

ee.Reducer.count() will just count the number of pixels whose centroid is included in the geometry. In the example, 6.
ee.Reducer.histogram() will do a weighted count of the number of pixels that have at least 0.5% covered by the geometry. Here 6.31
ee.Reducer.histogram().unweighted() does some strange stuff I don't get. Here 11

But none of these solutions counts the number of fully covered pixels, here 2. How can I do that?

Code

Available at: https://code.earthengine.google.com/615a60459b5a025eca34e3e42cf78496?noload=true

var rectangle = ee.Geometry.Polygon(
        [[[-92.53867, 40.18690],[-92.53867, 40.18638],[-92.53750, 40.18638],[-92.53750, 40.18690]]], null, false);
var CDL_2015 = ee.Image('USDA/NASS/CDL/2018')
  .select('cropland')

//count
var hist_1 = CDL_2015.gt(0).reduceRegion({
  reducer: ee.Reducer.histogram().combine({
  reducer2: ee.Reducer.histogram().unweighted(),
  outputPrefix: "_unweighted",
  sharedInputs: true}),
  geometry: rectangle,
  scale: 30,
  maxPixels: 1e9
})
print(hist_1)

var hist_2 = CDL_2015.gt(0).reduceRegion({
  reducer: ee.Reducer.histogram(),
  geometry: rectangle,
  scale: 30,
  maxPixels: 1e9
})
print(hist_2)

var count = CDL_2015.gt(0).reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: rectangle,
  scale: 30,
  maxPixels: 1e9
})
print(count)

//////////////////
// Visu
/////////////////

Map.centerObject(rectangle)
Map.addLayer(CDL_2015.clip(rectangle.buffer(20)), {}, "CDL_2015")
Map.addLayer(ee.FeatureCollection(rectangle).style({width: 3, color: "blue", fillColor: "#00000000"}), {}, "CLU_here")


texts:
I am doing a project for a telecom company. I have to render circles on the map(assuming the center of the circle as tower and circle as the area covered by that signal), I am using base layers as Google Maps,Yahoo maps(Spherical Mercator) So I have used CreateGeodesicPolygon() successfully to create circles  by reading the values from DB.

Now Since I have to render lot of circles, it made me switch to geoserver. Since the data is being provided by telecom company , they provide Lat,Lon,Gt,Gr,Pt,Pr,lambda(I think their meaning is irrelevant here) values. These values are stored in the database as they are. Now should use a equation(FRIIS transmission equation) and substitute each row(of a tower) values to find the distance covered by the tower.Then I have to create circles with that distance(considered as radius) and lon/lat and render them on map using geoserver.

Please suggest me any ideas of how to carry on this task.... I wud be thankful to your guidance

My Idea is to use these steps once I get distance from the equation.Will this work???

CREATE TABLE circles (cid int4,point_circle st_geometry);

INSERT INTO circles
 VALUES(1,
        ST_BUFFER(ST_GeomFromText('POINT(lon lat)',SRID),radius,'quad-segs=8')
 );

Create a POSTGIS store in geoserver and this circles table as a layer.


texts:
I've just installed QGIS 3.4.4. Each time I edit any layer, as soon as I select the vertex editor (single shapefile) I receive the 'unknown exception error'. The error then occurs with ANY edit in any layer. QGIS then crashes.

I have checked in ArcGIS and the shapefiles are clean. I have tried creating new (clean) projects with new (clean) shapefiles of just a simple two-node line but nothing fixes this error. Every shapefile I create or download is faced with the same issues.

I'm stuck - any suggestions?


texts: QgsJsonExporter preserve attributes order in QGIS

texts:
I've a memory layer i created that i would like to export in GeoJson.
If i add it to main canvas, the attributes table preserve attributes order.
# Attributes order preserved
QgsProject.instance().addMapLayer(layer, False)
ltcbr = qgis.utils.iface.layerTreeCanvasBridge().rootGroup()
ltcbr.insertLayer(0, layer)

If i use QgsJsonExporter, the attributes order isn't preserved
#Bad order
exp = QgsJsonExporter(layer)
geojson = exp.exportFeatures(layer.getFeatures())

#Bad order
ogrLayer = QgsVectorLayer(geojson, 'Temp', 'ogr')
QgsProject.instance().addMapLayer(ogrLayer , False)
ltcbr = qgis.utils.iface.layerTreeCanvasBridge().rootGroup()
ltcbr.insertLayer(0, ogrLayer )

How to preserve attributes order in GeoJson?


texts:
I am working with ArcGIS 10.3 and ArcGIS Online. I have feature layer with dataset of around 1000 points with attachments.

I called the layer into ArcMap, where I exported the table and cleaned the data in excel. I lost the image attachment when I published the layer back. Further, I tried performing a join on the desktop with the cleaned data so that the other fields would be deleted later online, but I could not published it as a service because the layer source is online.

Does anyone have an Idea how I can clean the data and still have the image attachments maintained?


texts: LeafletSlider not recognising my timeAttribute

texts:
I'm trying to get LeafletSlider working on some geoJson data.  Here's a snippet my my geoJson:

var millionmap = [{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "Year": 2002
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [

And this is what I've got in my code:

var testlayer = L.geoJson(millionmap);

sliderControl = L.control.sliderControl({
    position: "topright",
    layer: testlayer,
    range: true,
    timeAttribute: 'Year',
    timeStrLength: 4,
    maxValue: 2016,
    minValue: 1987
});

map.addControl(sliderControl);
sliderControl.startSlider();

I don't think it's recognising the date in my numerical "Year" attribute, but I don't know how to fix that.  I've made an attempt at forcing it with the other options there, but no dice.  I've also tried:

timeAttribute: new Date('Year'),

...but that's really grasping at straws.  How do I correctly feed my year into sliderControl?

Edit: Today I tried a few other things:

Changing "Year" to be a string, while still explicitly specifying a timeStrLength of 4.
Changing "Year" to a string, with a the LeafletSlider default time formatting (e.g. "1987-01-01 00:00:00+01").
Doing the above but changing "Year" to "time", which seems to be the default.

None of these seemed to change anything.

Edit2: Honestly, now I think my problems are stemming from my incorrectly loading the JSON file.  If I take the line of code that loads the file from the example, and explicitly insert (heh) the URL to the example JSON, it works fine:

    $.getJSON("http://dwilhelm89.github.io/LeafletSlider/points.json", function(json) {

If i then save that JSON off, re-host it on my domain, and link to that, it doesn't work.  I don't get it.


texts:
I'm trying to create a set of labels that are callouts that I can move, manipulate and position around the edges of my map but is also tied to the attribute table data.

Is there an extension or way to do this other than converting labels to annotations?

Using arcmap 10.3.


texts: Proper formula for computing signal-to-noise ratio of a camera?

texts:
I have a 5-band muultispectral camera, and I'm trying to find the signal-to-noise ratio (SNR) to supplement some research data I collected. Cameras with low SNRs generally have lower-quality images due to sensor sizes.

According to a formula I found on Axis communications, the SNR can be computed by taking the 20(log10) of the ratio of the mean pixel values of a given area to the standard deviation of the same pixel values, of a homogeneous image. The formula is as follows:

where µR µG µB is the mean pixel value of the red, green, and blue bands, respectively, and the denominator is the variance of the red, green, and blue bands, respectively. (Note: My camera has 5 bands, so I would just add the two additional bands to the RGB bands).

However, according to Lu and He (2017), the SNR can be computed by simply taking the ratio of the mean pixel values to the standard deviation. Apparently, there is no log 10 calculation according to this source.

Which method is the correct way to find the SNR of a camera?

Source:
Lu B, He Y (2017) Species classification using Unmanned Aerial Vehicle (UAV)-acquired high spatial resolution imagery in a heterogeneous grassland. ISPRS Journal of Photogrammetry and Remote Sensing 128:73-85


texts: How to fill gaps in SLC-Off Landsat 7 ETM+ Images with QGIS?

texts:
Explanation of the problem:

  On 31 May 2003 the Landsat 7 Enhanced Thematic Mapper (ETM+) sensor had a failure of the Scan Line Corrector (SLC). Since that time all Landsat ETM+ images have had wedge-shaped gaps on both sides of each scene, resulting in approximately 22% data loss. These images are available for free download from the USGS GloVis website and are found in the L7 SLC-off collection.

source: Yale University

Can I use Qgis instead of proprietary software (ENVI, Erdas....) to fill the gaps?


texts: Rasterio CLI warping multiple rasters like another raster in all minus one feature

texts:
I'm writing a bash script to warp all the rasters in a specific directory to match another raster. I'd like to warp all these rasters iteratively in to match the other raster in all was except shape and boundries. At the most basic level I just want to warp the reprojection and upsample the resolutions to match.

tempA2 (primary raster) is raster of a specific region in the US.
The files (secondary rasters) I'm warping are lower resolution rasters of the entire US.

Using the following code

for file in *.bil; do rio warp "$file" /media/warped/warped-"$file" --like /media/templates/tempA2.tif --resampling nearest --co compress=LZW --overwrite ; done

does everything I need, but also clips (I think you GIS people call that masking?) the raster of the US to the same region as the original. In fact it seems to do this first and overzealously at the boundries which sucks for the lower resolution raster that's then increased in resolution.

I'd manually specify the resolution and crs in warp and not use the "--like" flag, however I have different primary rasters and I'd like to have the same bash script be iterable without modification. I suspect I could pipe out the metadata of the primary raster minus the boundaries and shape somehow, then pipe that metadata in for the warping of the secondary rasters, but I have no idea how to pull this off.


texts: QGIS Oracle-Spatial-GeoRaster-Plugin not working

texts:
I am having trouble with Oracle-Spatial-GeoRaster-Plugin in QGIS (running on Windows 7 Professional N 64bit). The connection to my database on an external Oracle-Server obviously works as it shows the containing rasters in the database. But as soon as I try to open a raster an error message comes up with the information that the connection could not be established. I should check the connection options and make sure the GDAL-Georaster-Plugin is installed.

I tried it with three independent standalone versions of QGIS (all 64bit):

QGIS 2.14.3 running with GDAL 2.1.0
QGIS 2.12.2 running with GDAL 1.11.3
QGIS 2.10.1 running with GDAL 1.11.2

On my system I installed GDAL 2.1.0 with gdal-oracle-oci-driver (with OSGeo4W) and I know I could load Oracle rasters in QGIS with an earlier version of QGIS. When I updated the GDAL-version on my system it was not working any more.

My Questions:

Is there another plugin apart from the "oracle-spatial-georaster"-plugin like written in the error message ("GDAL-georaster)? I don't find it.
With which GDAL-Version is QGIS running? I thought QGIS installs its own GDAL-version and doesn't use the system-GDAL, but apparently its not working any more since I installed the recent GDAL-version on my system.
Is there any other solution or has anybody hints of what I am doing wrong?


texts:
Using this Google Earth Engine code I am trying to create a line graph of the data for the specified date range. The result I got is not a continuous line graph and the exported value shows undefined:0. How can I get continuous line graph with the proper value? also a request to the forum that how can I incorporate several city points in one graph. Here I have taken only one city point
The code is written as
var city1 = /* color: #d63000 */ee.Geometry.Point([-93.881640625, 37.391718430950796]),
   city2 = /* color: #d63000 */ee.Geometry.Point([-106.27421875, 33.71035637052483]),
   city3 = /* color: #98ff00 */ee.Geometry.Point([-117.436328125, 39.7618477958936]),
   city4 = /* color: #0b4a8b */ee.Geometry.Point([-95.5515625, 29.74978297462196]),
   city5 = /* color: #ffc82d */ee.Geometry.Point([-115.151171875, 36.15978520358036]);

// get the data
var y2019 = ee.ImageCollection("COPERNICUS/S5P/NRTI/L3_NO2")
             .filterDate("2019-01-01","2019-12-30");
// Select the NO2 column number density.
var times2019 = y2019
   .select("NO2_column_number_density")
// Create a time series chart.
var TimeSeries = ui.Chart.image.seriesByRegion(
   times2019, city1, ee.Reducer.mean(), "NO2_column_number_density", 100, 'system:time_start', 'label')
       .setChartType('ScatterChart')
       .setOptions({
         title: 'NO2 Timeseries',
         vAxis: {title: 'NO2'},
         lineWidth: 1,
         pointSize: 4,
         series: {
           1: {color: '0000FF'}
}});

// Display.
print(TimeSeries);


texts: ArcGIS Server getToken Encrypted Password with Python

texts:
I originally posted this in the geonet, but unfortunately got crickets.

I'd like to fetch an ArcGIS Server token with a python web service and an encrypted password. I have it working nicely with plain text, but I'd rather avoid this method since using passwords in plaintext is always a bad idea, even on a server side script. Essentially, my python script will instead store the encrypted information, which will be used to access secure resources. This way, if worse case scenario, the server is compromised, the plain text passwords won't be available.

The reason I'm storing the user's password is so that I can periodically refresh the token without requiring the user to login again when the token times out.

The arcgis server generate token page has a certain functionality that encrypts the password using javascript before its sent to the server. It uses the arcgis server public key/modulus to create an encrypted string. Then it passes encrypted=true and the encrypted data.

I would like to replicate this function in my python web service. However, I cannot find any documentation on this encryption technique anywhere. I have done a little researching and had figured out how to do the encrypting here: https://stackoverflow.com/questions/40094108/i-have-a-rsa-public-key-exponent-and-modulus-how-can-i-encrypt-a-string-using-p

But this method hasn't yielded any fruit yet, as arcgis server doesn't seem to accept the encrypted data. Has anyone dealt with this situation before or know of any resources available to figuring it out?


texts:
Is there a way to export a layer in GeoTIFF format from Python? I am able to perform georeference with Python and show the results on the canvas. However, when I am inserting the .tif file in any third party program like AutoCAD, then the georeference is not right.

However, the very same .tif file, when loaded to QGIS, even in a different project, works like a charm.

Any ideas?


texts: Add height/elevation in generated sql files from osm2po

texts:
I am using osm2po to generate a routable network (by importing .sql files from osm2po into a PostgreSQL/Postgis database).
This works great using the post process filters PgRoutingWriter and PgVertexWriter.

However, I also want to take elevation data into account.
The first thing I did is to use the osmosis-srtm-plugin to add information about the height to the OSM export that I downloaded. At least when sticking to STRM3 this tool is very easy to use and as far as I can see, it should also be possible to use SRTM3 version 3 data.

The problem is that osm2po simply does not use this information (stored into tag "height" or "ele") at all when generating sql files.
I know that there is a answered question about adding ferry durations to ways, but when it comes to elevation information this does not work, since there is no field that can be used when writing nodes with PgVertexWriter. It might work for ways (although in my eyes it wouldn't be the best/very clean solution since it (mis)uses the osm_meta field), but I also need it for nodes.

There would be two possible solutions (that I can think of):

Adding the possibility to add new fields to ways and nodes (maybe a (Sorted)Map called custom_columns)
Adding the elevation information into the geom_vertex and geom_way columns

With both approaches the information could be used inside the PgVertexWriter/PgRoutingWriter (or any extending class) while writing the generated sql files.
However, I can not implement one of the suggested solutions, since neither can be implement by extending solely the WayTagResolver or NodeTagResolver classes (I would also need to change the SegmentedWay/Vertex classes that are not open-source).

Can elevation be added to nodes and ways in a different way (a.k.a: is there something else that I am missing)?

Also tried with the now suggested tag "ele" (instead of height)


texts: What's wrong with my IDW interpolation function (Python)?

texts:
Original Question

Can anyone see what's wrong with my custom IDW interpolation below?

I know there are existing libraries that can do this for me, but for various reasons including educational and stubbornness, I'm trying to create a pure Python Inverse Distance Weighted Interpolation function. I'm basing myself off the "basic form" of the Shepard algorithm from this Wiki article:

and

The way I interpret these equations is weightofknownpoint = 1/(knowntounknowndistance to the power of the P parameter) and IDWforunknownpoint = sumforallknownpoints(weightofknownpoint*valueofknownpoint/thesumof(allknownweights))

The Python code I came up with produces interpolated values that are way off (the values spike in between known points instead of doing a smooth transition). To limit the length of this post I'm not going to show all of my code, so you won't be able to run this on your own. Just assume that everything else is correct (btw I know the code might not be very optimized but I'll deal with that later); is there anything about the code below that doesn't look right in terms of what the IDW algorithm is supposed to be doing, that might explain my odd results:

#ASSUMPTIONS
#math module is imported
#unknowncell and knowncell refer to custom created instances with a .x and .y position properties, and a .value property for their data value to be interpolated
#the unknowncell argument that I use for the _CalcIDWvalue function are all the unknown cell instances in the grid
#knowncells = list of known cell instances (ie the known points used to inform the interpolated value)
#sensitivity = 3 #ie the power parameter

def CalcIDWvalue(unknowncell):
    calclist = []
    for knowncell in knowncells:
        if cell.x == knowncell.x and cell.y == knowncell.y:
            continue
        #prep
        def _getweight(unknowncell,knowncell):
            dist = math.sqrt((unknowncell.x-knowncell.x)**2 + (unknowncell.y-knowncell.y)**2)
            return 1/float(dist**sensitivity)
        weight = _getweight(unknowncell,knowncell)
        sumofallweights = sum([_getweight(unknowncell,tempknowncell) for tempknowncell in knowncells
                               if unknowncell.x != tempknowncell.x and unknowncell.y != tempknowncell.y])
        #calculate
        tempcalc = (weight*knowncell.value) / sumofallweights
        calclist.append(tempcalc)
    return sum(calclist)

My input grid is this:

[0, None, 1, None, 2, None, 3, None, 4, None, 5]
[None, None, None, None, None, None, None, None, None, None, None]
[0, None, 1, None, 2, None, 3, None, 4, None, 5]
[None, None, None, None, None, None, None, None, None, None, None]
[0, None, 1, None, 2, None, 3, None, 4, None, 5]
[None, None, None, None, None, None, None, None, None, None, None]
[0, None, 1, None, 2, None, 3, None, 4, None, 5]
[None, None, None, None, None, None, None, None, None, None, None]
[0, None, 1, None, 2, None, 3, None, 4, None, 5]
[None, None, None, None, None, None, None, None, None, None, None]
[0, None, 1, None, 2, None, 3, None, 4, None, 5]

And my incorrectly interpolated output grid is:

[0.0, 4.92, 1.0, 11.76, 2.0, 18.79, 3.0, 26.47, 4.0, 36.33, 5.0]
[1.42, 0.66, 5.54, 1.56, 9.92, 2.5, 14.64, 3.44, 20.43, 4.34, 39.83]
[0.0, 3.17, 1.0, 7.51, 2.0, 12.0, 3.0, 16.82, 4.0, 22.8, 5.0]
[1.43, 0.67, 5.22, 1.57, 9.28, 2.5, 13.68, 3.43, 19.11, 4.33, 36.8]
[0.0, 3.03, 1.0, 7.1, 2.0, 11.32, 3.0, 15.86, 4.0, 21.53, 5.0]
[1.44, 0.68, 5.17, 1.57, 9.15, 2.5, 13.48, 3.43, 18.84, 4.32, 36.14]
[0.0, 3.03, 1.0, 7.1, 2.0, 11.32, 3.0, 15.86, 4.0, 21.53, 5.0]
[1.43, 0.67, 5.22, 1.57, 9.28, 2.5, 13.68, 3.43, 19.11, 4.33, 36.8]
[0.0, 3.17, 1.0, 7.51, 2.0, 12.0, 3.0, 16.82, 4.0, 22.8, 5.0]
[1.42, 0.66, 5.54, 1.56, 9.92, 2.5, 14.64, 3.44, 20.43, 4.34, 39.83]
[0.0, 4.92, 1.0, 11.76, 2.0, 18.79, 3.0, 26.47, 4.0, 36.33, 5.0]

Update

I found out what was wrong and posted the solution as an answer below. Another answer by Rickhg23s has further helped optimize the speed of the code, so see his answer for the final most up-to-date version of the IDW code.


texts: Converting shapefile labels to graphics ArcMap?

texts:
I have a shapefile that represents contours. Because I have clipped the contours to the map boundary they are broken in several places. Now that I have labeled the contours there are labels that are repeated for the same value, for example, the 0.1 contour interval is broken is several places and the label 0.1 is repeated. I would like to convert my labels to graphics so that I can delete the undesired labels.

How do I do this in ArcMap 10?


texts: Merging zip code based polygons to create sales territories?

texts:
I have access the full data set of the KML file shown here:
http://www.maptechnica.com/downloads/samples/mt_2014a_kml_us_zcta5_sample.tar.gz

Here's what it basically looks like: http://www.maptechnica.com/us-zip-code-boundary-and-geodata

It's basically a bunch of polygons that match (close enough) ZIP code boundaries. What I also have is a table that shows which zip codes go with which territory (i.e., a territory overlaps multiple ZIP codes).

I'm looking for a tool that I can use to merge these two sources together to create new polygons consisting of the group of zip code polygons that make up a territory.

Mapping is completely new to me, so I'm not even sure which tools I need to use.

Ideally I'd like to avoid making a big software purchase.


texts: UTM conversion to Lat/Lon using Karney equations in script is off by 0.05 degree latitude - why?

texts:
I have translated the Karney provided equations from the javascript at https://github.com/chrisveness/geodesy/blob/master/utm.js to translate UTM to Lat/Lon into a different scripting language for a project to translate shapefiles to map files for a satellite visualization tool.  When I run what purports to be a WGS-84 UTM shapefile it translates the lat/lon points into maps that are 0.05 degrees too far north.  I have tried using other datums (Clarke, GRS80) and they all seem to give virtually identical results using the semimajor values.  If I substitute the semiminor values the offset is greater.

I am checking the conversion results against a file of the same data that my source provided after running the data through ArcGIS to convert it to geographic directly.  I don't have access to ArcGIS, so I can't just do that.  I need an in-house more direct tool to integrate with our system.

I am not a math major, just an old line programmer, so I can't easily understand why this is happening.

Anybody got an idea about how I might fix this?

Here is the metadata from the UTM file I am converting followed by some points and conversions.  I have determined that for the initial points they are pretty much 6000 meters too far north.  I can get them within ~100 meters if I subtract 5500 meters before converting, so that suggests, since it doesn't get precisely there if I subtract 'exactly' 6000 meters, that the calculations are still off somewhere in the math.

20120510
17021000
Website\2012\Packages\ELEVATION\PackagedData_Statewide\Contours500Ft\Contours500Ft.shp
Projected
geogcsn Sync="TRUE" GCS_North_American_1983
projcsn Sync= "TRUE" NAD_1983_UTM_Zone_12N
PROJCS ”NAD_1983_UTM_Zone_12N”,
GEOGCS ”GCS_North_American_1983”
DATUM ”D_North_American_1983”
SPHEROID ”GRS_1980”,6378137.0,298.257222101
PRIMEM ”Greenwich”,0.0
UNIT ”Degree” 0.0174532925199433
PROJECTION ”Transverse_Mercator”
PARAMETER ”False_Easting”,500000.0
PARAMETER ”False_Northing”,0.0
PARAMETER ”Central_Meridian”,-111.0
PARAMETER ”Scale_Factor”,0.9996
PARAMETER ”Latitude_Of_Origin”,0.0
UNIT ”Meter”,1.0
XOrigin -5120900
YOrigin -9998100
XYScale 450445547.3910538
ZOrigin 100000
ZScale 10000
MOrigin -100000
MScale 10000
XYTolerance 0.001
ZTolerance 0.001&
MTolerance 0.001&lt
HighPrecision true
bounds minlat="4094776.60000000" minlon="228582.50000000" maxlat="4653399.00000000" maxlon="673947.300000007"

UTM     CNV
 lat = 4650693.00000000 lon = 389280.60000000   lat = 42.04826024690    lon = -112.33814680302
 lat = 4650348.50000000     lon = 389380.40000000   lat = 42.04517176050    lon = -112.33687612607
 lat = 4650360.00000000 lon = 389520.70000000   lat = 42.04529498908    lon = -112.33518315671
 lat = 4650690.50000000 lon = 389650.40000000   lat = 42.04828955593    lon = -112.33367812578
 lat = 4650673.00000000 lon = 390428.00000000   lat = 42.04824036112    lon = -112.32427926799
 lat = 4650328.50000000 lon = 390489.50000000   lat = 42.04514639600    lon = -112.32347200664

I did look at the Guidance 7-2 document that was suggested and I 'might' be able to convert the formulas to the scripting language, but it will probably cost me what little hair I have left on my head... the conversion from one language to another was relatively easy, but translating the formula direct may be above my rusted-out math skills.  I will check with our forecaster, he may be able to help me.


texts: QGIS 3 Graphical Modeler field calculator with attribute's parameters

texts:
I want to make a model with a vector layer to calculate the sum of two parameters contained in the attribute table of the layer.

I want to create two variables in the model, the name of the two fields of the attribute table to use in the model for the calculation of the new field (A and B), but the geoprocess of the advanced field calculator with python does not get to configure so that you can relate those two variables.


texts: Can QGIS preserve layers when exporting to PDF?

texts:
In ArcMap, when you export data to PDF it preserves the layering within the PDF so that you can turn on/off individual map layers (within the PDF itself).  When I export from QGIS to PDF, I don't appear to have the option for this.

Does QGIS support preserving layers when exporting to PDF?  Is there a special setting needed to enable this capability?  Or has anyone wrote a plugin for this feature?


texts: How do I secure a specific workspace in GeoServer REST API?

texts:
I want GeoServer rest security setup so that only a specific role can access everything under a specific workspace.  This is what my /datadir/security/rest.properties file looks like:
/**;GET=ADMIN
/**;POST,DELETE,PUT=ADMIN
/rest/workspaces/myworkspace/*;GET,POST,PUT,DELETE=myrole

But I get a 403 error with this:
curl "http://mygeoserver/geoserver/rest/workspaces/myworkspace/layers" -u "userinmyrole:password" -v

How can I secure a workspace in REST?


texts: Performing raster to polygon conversion in ArcMap?

texts:
I have done raster to polygon conversion in ArcMap 10.3. The polygon shape is not the same as the raster pixels.

How can I polygonize the raster so that the polygons follow the raster's cell boundaries?


texts: How to resolve error "Handle bad layers" in QGIS?

texts:
I'm new to QGIS and have been seeing what it can do for me – seems good. I imported shape file data from a UK Ordnance Survey data file and saved the file in a new folder. It was very good, doing all I wanted. I exported and got exactly what I wanted ( a tiff image).

I closed the file in order to try a new experiment. When I went to re-open it I got a dialogue box saying 'Handle Bad Layers. I don't understand what is at issue and what to do.


texts: Can GeoWebCache serve tiles from blobstore?

texts:
Currently I use MapProxy to serve custom sqlite tile stores with a certain schema.  I would like to enable GeoWebCache to do the same, but I don't know if GWC work the same way that mapproxy does.

MapProxy will serve out all the data in my cache if it exists.  Since I have no source for this cache, if there is a missing tile, there is no server to retrieve it and nothing is shown for that tile.

I see that GeoWebCache has no native sqlite blobstore and the one github fork that added sqlite as a blob store is no longer available.  Since GWC works by pointing it to a map service which it will then tile, will it serve requests for data from the cache even if that source is down?

I eventually want to get to the point where GWC is serving out sqlite tiles as it's own service and not reliant on another map service source.

Thanks


texts: Defining field mapping for Service Area Calculation in ModelBuilder?

texts:
I am building a model to generate service areas for health facilities and I'd like to have the facility ID instead of OID used in the Name field of the resulting service area layer. Outside of model builder I can accomplish this by defining the Name Property in the Location Analysis Properties dialog box.

In my model however, I can't enter a value for that property in the Add Locations tool. I have tried both doing it within the "Add locations" tool and defining a variable from the "Field Mapping" parameter neither approach lets me define the field for the Name Property.

Is there a way in model builder to define which field should be used for the Name in the resulting service area polygons?

I'm using ArcGIS 10.3


texts:
I am trying to get seasonality parameters from MODIS EVI (MOD13Q1) for Indonesia. I have loaded data from 2013-2015, but the plotted time-series is shifted from what I expect. Indonesia has rice-growing seasons peaking in Jan (season 1, Oct-Mar) & Apr (season 2, Mar-Jun) but the plots I'm getting are peaking in Mar and Sep. I am definitely getting two distinct growing seasons, just offset from where I'd expect them.

Data:
MODIS MOD13Q1 EVI for 2013-2015 (last 5 values for 2015 copied from 2014). 23 points/yr for 3 years
Savitsky-Golay fitting
Seasonal parameter 0 (2 seasons/yr)


texts: Downloading Collected GPS Data from Trimble Nomad GPS on Ubuntu Desktop

texts:
I am wanting to use Ubuntu on some off network computers.  We will need to put background layers on the GPS and also download the data we collect.  When I plugged the GPS into the ubuntu 16 machine it was not recognized.

Can someone help me with the steps to get the GPS recognized?

It's a Trimble Nomad running Windows Mobile 6 Classic. CE OS 5.2.1946(Build 18550.7.4) Processor is ARM920T PXA3xx.  On Windows machines they use Microsoft Windows Mobile Device Center that establishes the connection and then it can be browsed like an external drive or cell phone in file browser.


texts: How to merge a 4 band tfwx file into one tif for use in Qgis

texts:
I have a tfwx file and when I open it in arcmap it is displayed as 4 bands.
I would like to use the georeferenced file in qgis since I know nothing about arcmap.


texts: Why is there a lock when using arcpy.DeleteField_management in arcgis 10.0?

texts:
This code only works when ArcCatalog is closed or the featureclass has never been opened by ArcCatalog. For other arcpy management functions
this is not the case, but when ArcCatalog is open, I get the error in Sublime text2:

[Decode error - output not utf-8]

or in IDLE the error "feature class locked"

But when it is closed, it works fine.

for item in nfld_rrop:
    if item in ["test","PLANZ"]:
        print item            this
        arcpy.DeleteField_management(fc, item)

Is there any way to stop this?


texts: infoWindow does not open on initial page load (ArcGIS Javascript API)

texts:
I am working on a webapp using the ArcGIS Javascript API.  I noticed that when I first load the map (currently living on a development server), the infoWindow does not open (when clicking on a feature).  When I refresh/reload the map, the infoWindow then works as it should.  This behavior happens in both IE and Firefox.
I am guessing there is some problem with my initial load, perhaps the 'init' function is loading before the libraries are finished loading somehow..? I appreciate any suggestions.  Below is the the HTML setup.  Currently I am using
    $(function () {

    dojo.ready(init);
});

to add the init setup in the main .js file.  Thanks, Jason

HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7", "IE=9" />

<link href="mainCopy.css" rel="stylesheet" type="text/css" />
<script src="jquery.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="http://localserver/arcgis_js_api/library/2.1/arcgis/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="http://localserver/arcgis_js_api/library/2.1/arcgis/js/dojo/dojox/grid/resources/Grid.css">
<link rel="stylesheet" type="text/css" href="http://localserver/arcgis_js_api/library/2.1/arcgis/js/dojo/dojox/grid/resources/claroGrid.css">
<link rel="stylesheet" type="text/css" href="http://localserver/arcgis_js_api/library/2.1/arcgis/js/dojo/dojox/image/resources/image.css">

<script type="text/javascript">
var djConfig = { parseOnLoad: true };
</script>
<!-- Tell the browse to include the dojo library -->
<script type="text/javascript" src="http://localserver/arcgis_js_api/library/2.1/arcgis/"></script>
<script src="application.js" type="text/javascript"></script>
</head>

<style type="text/css"> </style>

<body class="claro">

......


texts: ArcGIS Collector doesn't show up in iTunes-cannot transfer tile package

texts:
I am trying to use tile package offline in Collector. I have followed the instructions in the link below. My issue is: Collector never shows up under Apps in the iTunes, so I can't use it to transfer my tile package to my iPad.

I have updated iOS, all my apps, everything I can think of. I am using iTunes 12.8 on Windows 7. I'm not sure which iPad I have but it's pretty new as of this post.

Do I have to have Collector downloaded as an app to my computer?

I want to just take the tile package from ArcMap and load it to my iPad.

https://doc.arcgis.com/en/collector/ios/collect-data/offline-use.htm


texts: Inverting values of raster file using QGIS?

texts:
I ran a proximity (raster distance) function and I would like to invert the result.

Is there a simple way to do this with out converting it back to vector format and editing the attribute table?


texts: I was tracking tourist's movement patterns in a city with GPS and I would like to know the speed of all participants (60). The data were recorded and saved in gpx files, so in order to open it and work with it in QGIS, I converted the tracks from gpx to KML and SHP. I would like to know the speed of participants, but the only data I have is a track with points without any information about their speed. I was wondering if there is a program that could calculate and vizualize the speeds.


texts: Access coordinates from a firebase database

texts:
I want to access the coordinates from a firebase database in order to add them to my web map.
The structure of the data looks like this, and there around 12,000 sets of coordinates.
In my python script I am accessing the whole body of data using
result = firebase.get('/ChargeDevice', None)

which returns a JSON.
I ultimately want to end up with a list of dictionaries storing each locations latitude and longitude. I am unsure whether I should do this through the firebase.get method or iterate over the result in python.


texts: Applying color to Features in FeatureCollection based on given property value in Google Earth Engine

texts:
I have a NYC census track FeatuerCollection in GEE, and I wish to visualize each census track by one of the property columns. How can I assign colors to each feature according to values in a selected property column?

Here is the code I have:

var urb = ee.FeatureCollection('users/--------')
  .filterBounds(ee.Geometry.Rectangle(-74.18, 40.60, -73.75, 41.00));

Map.addLayer(urb, null, 'layer1');
print(urb);

var Area = urb.aggregate_array("Area");
print(Area);


texts: informations about "gdaltransform" utility of GDAL

texts:
I have a doubt about GDAL reprojection.
I use "gdalwarp" utility to reproject an image in a specific projection system (for example WGS84 UTM49).
"gdalinfo" on original image displays this corner coordinate:

Lower Right ( 123.0220110, -54.6797900) (123d 1'19.24"E, 54d40'47.24"S)

and projected image in UTM49:

Lower Right ( 1845275.980,-6159877.836) (131d34' 2.85"E, 53d48' 4.36"S)

I suppose that degrees (131d34' 2.85"E, 53d48' 4.36"S) are degrees coordinates of the pixel in lower right in the projected image, different from the originals.

I read about "gdaltransform" utility that it reprojects coordinates from one system to another, but running this:

$ gdaltransform -s_srs EPSG:32649 -t_srs EPSG:4326

1845275.980 -6159877.836

(when 1845275.980 -6159877.836 are projected coordinates in utm49)
it displays geographic coordinate not in original image ( 123.0220110, -54.6797900), but in the projected image(131.56745835871 -53.8012102381326).
From this result I suppose that gdaltransform doesn't reprojects from one system to another, but it simply "translates" coordinates.
Is that affirmation correct?


texts: Crash and minicrash after fixing several selected errors?

texts:
I am using QGIS 2.18.2. I intended to fix the invalid features in a polygon layer, therefore I ran the "Check Geometries" and then I selected several errors, maybe tens or hundreds of them, and then I ran "Fix selected errors using default resolution". Very frequently, the qgis creshed and a minicrash report was sent to a folder in C drive.

Could anybody advise me how to stop the qgis from crashing after fixing errors?


texts:
Behold the photo:

I want to split the two islands into two separate polygons. The Cut tool does not work. Is there a way to split these polygons without having to redraw them?

ArcGIS 10.5.1


texts:
I have many polygons to insert. This code is ready to use.

geom_str = '"MDSYS"."SDO_GEOMETRY"(2003,NULL,NULL,"MDSYS"."SDO_ELEM_INFO_ARRAY"(1,1003,1),"MDSYS"."SDO_ORDINATE_ARRAY"(-735342,-1010550,-735347,-1010551,-735347,-1010563,-735342,-1010563,-735342,-1010550))'
insert = u'''INSERT INTO poly_gr (geomtype, sdo_geom ) VALUES ("TARGET"."LIDS_GEOMTYPE"(1002,6) ,%s)''' %geom_str
cur.execute(insert)

But this is vary lazy. I would like use variables in execute statement. Like this

insert = u'''INSERT INTO poly_gr (geomtype, sdo_geom ) VALUES (:1 ,:2)'''
cur.execute(insert, ('"TARGET"."LIDS_GEOMTYPE"(1002,6)', geom_str)

Do you know how can I insert geometry or own datatype variable with cx_Oracle module? I would like use executemany() in next step for more powerfull aplication.


texts: Determining suitable server specification?

texts:
I am looking for server specifications for a moderately sized habitat mapping project.  My current server is about to reach its storage capacity, so I am researching buying a new one that I can dedicate to the project.  The following is a list of my basic server requirements:

10-12 TB Storage Capacity
RAID 5
$5k limit
Primarily used to support ArcGIS, Erdas, and ENVI applications

Given the previously stated constraints, what server configuration would work?


texts: Write each layer of a RasterBrick as a kml file

texts:
I have a RasterBrick which contains the distribution models of 7 palm Species. The RasterBrick looks like this.

What I want to do is to export each of this layers to a .kml format so I can upload them into GoogleEarth Engine.

If I try to write down each layer separately with the following code, it works perfectly:

KML (currentStack_match$cuneata_current, filename= "J:/Natalia/x.kml")

But when I try to do the same operation with the rasterBrick with the following code:

KML (currentStack_match, filename= paste("J:/Natalia/",names(currentStack_match),".kml", sep=""))

It gives me this error message:

Error in file(file, ifelse(append, "a", "w")) :
  invalid 'description' argument
In addition: Warning messages:
1: In if (file.exists(kmlfile)) { :
  the condition has length > 1 and only the first element will be     used
2: In if (file == "") file <- stdout() else if (substring(file, 1L,  :
  the condition has length > 1 and only the first element will be used
3: In if (substring(file, 1L, 1L) == "|") { :
  the condition has length > 1 and only the first element will be used

Can anybody give a hand?


texts: ArcPy extract and split FC name to create table

texts:
I have geodatabase with many feature classes. Filenames of these fc have all info I need. My goal is to have a CSV or Excel table, that I can work with.

So all filenames match schema What_Where_HowMany.

eg.

C:\GIS\Data.gdb\Egs_Basket_10
C:\GIS\Data.gdb\Milk_Fridge_2

What I want to get:

Egs Basket 10
Milk Fridge 2
...

I'm interested in other solutions too.


texts: Display port 6080 for ArcGIS 10.0 Server

texts: I couldn't display port 6080 for ArcGIS 10.0


texts: PCA for Sentinel2 SVM and RF classification

texts:
I am attempting to classify dump pile in google earth engine. Using Sentinel 2 data and classifying the first 5 PCAs lead to the best visual result. Here the PCA code used in script with Sentinel2.

Is there a way of iteratively testing SVM parameters in google earth engine and select best fit based on ROC, AUC.
How to limit overfittig (other than visual inspection)?


texts:
I am new to liDAR and trying to extract some .laz files to .las.

It seems that this should be a pretty straightforward process in Windows using the LASzip GUI, however I am not able to open the application.

I have not tried to use the command prompt to accomplish this task as mentioned in Converting LiDAR files from LAZ to LAS format.

I would like to try to use the GUI first. When I try to open the laszip.exe application it seems to open for a second and then close.

Does anyone have this issue and/or any guidance?


texts:
While developing a user interface using Ext.viewport and GeoExt, gx_mappanel tricked me.I'm using OpenStreetMap as base layer and a vector layer.Both layers works fine when I use Openlayers alone for visualization. But not work when I use gx_mappanel as shown in the code.  console of my Firebug shows the warning message as follows:

window.controllers is deprecated. Do not use it for UA detection. OpenLayers.js:1171
Use of inputEncoding is deprecated. Can this warning be the case?

Please look at the code and help. I tried several times without success, It is for fist time that I'm using GeoExt. I think what I lack is the properties of gx_mappanel.

var options = {

        projection: mapprojection,
        units: 'm'

    };

var map = new OpenLayers.Map(options);

      map.addControl(new OpenLayers.Control.ScaleLine());

  var layer = new OpenLayers.Layer.OSM();

  map.addLayer(layer);
  map.setBaseLayer(layer);

  var vStyle = new OpenLayers.StyleMap({
  pointRadius:4,
  fillOpacity: 1, fillColor: '#ee9900'

 });

var vLayer=new OpenLayers.Layer.Vector("vLayer",

       {

        projection:mapprojection,

        strategies:[new OpenLayers.Strategy.Fixed()],

        protocol:new OpenLayers.Protocol.HTTP({

            url: "myserverscript",

            format: new OpenLayers.Format.GeoJSON()

        }),

        styleMap: vStyle

      });

    map.addLayer(vLayer);

new Ext.Viewport({

layout: "border",

items:[{

        region: 'east',

        id: "form",

        title: 'some title',

        width: 200,

        collapsible: true,

        items: [plantInfo]

    },{
        region: "center",

        id: "mappanel",

        title: "map goes here",

        xtype: "gx_mappanel",

        center: new OpenLayers.LonLat(9.05, 51.20).transform(

                new OpenLayers.Projection("EPSG:4326"),

                new OpenLayers.Projection("EPSG:900913") ),

        map: map,
        //layers:[layer,vLayer],
        //extent:extent,
        zoom:10

    },
 ]

});


texts:
I'm developing a software using QGIS. When building my software there is a LINK error.

1>mainwindow.obj : error LNK2019: symbole externe non résolu "public: __thiscall
   QgsLegend::QgsLegend(class QgsMapCanvas *,class QWidget *,char const
   *)"(??0QgsLegend@@QAE@PAVQgsMapCanvas@@PAVQWidget@@PBD@Z) référencé dans la
   fonction "public: __thiscall MainWindow::MainWindow(class QWidget *,class
   QFlags<enum Qt::WindowType>)"
(??0MainWindow@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
1>C:\Documents and Settings\XXXXX\mes documents\visual studio 2010\Projects\XXXXX
\XXXXXX.exe : fatal error LNK1120: 1 externes non résolus

I'm using QGIS 1.7.2, QT 4.7.3, Visual Studio 2010 (with VC10), and there were no errors when I built the sources of QGIS.
I've already put all the .libs I found in the link editor of VS10.
In QGIS API, it is written that for the QgsLegend, I had to link the qgis_gui.lib, so had I.

I don't know what I can do now. Can someone help me ?  Or how to proceed in order to find the lib i missed.

If you need more information, just ask. I'm really blocked...


texts: Changing infoWindow style in ArcGIS JavaScript API (v3.2)

texts:
See below a screenshot of the infoWindow's appearance in my ArcGIS JavaScript API (v3.2) application.

As you can see the transparent title bar with the white buttons doesn't work too well against a background map with white areas.

I've used Chrome's developer tools to test changing the CSS of every element associated with the infoWindow but still haven't managed to stop it having a transparent background. The closest I've come gave it a coloured background - by adding a background-color to the title class - but this extended way outside the infoWindow and out of the map.

How do I style this differently? Do I need to choose a new (non-claro) theme for the whole page? What are the other theme options?

Any input much appreciated.


texts: Creating report from selected features in ArcMap using AddIn and C#?

texts:
I am new to ArcGIS and I am trying to create an Add-In button which can

figure out which polygons are selected and
query the selected polygons to generate a report on the underlying metadata (similar to the Identify tool).

I had a look at this article, which helped with finding the selected feature layer, but I haven't been able to progress much further.

At the moment all I have is a one-liner. Here is some pseudo code of what I would like to do:

var featureLayer = ArcMap.Document.CurrentContentsView.SelectedItem as IFeatureLayer;
var selectedFeatures = featureLayer.SelectedFeatures;

// A list to contain the info available in Identify tool (not sure what this is called)
var featuresAttributes = new List<FeatureAttributes>();

// For each selected polygon
foreach(var feature in selectedFeatures)
    featuresAttributes.Add(feature.Attributes);

// Go off and generate some report based on the selected polygon attributes
MyReportGenerator.CreateReport(featuresAttributes);