texts: Why do MGI and WGS 84 data not line up in ArcGIS for Desktop?

texts:
When i reproject raster from MGI 6 zone to the WGS84 it makes a mistake (it is moved for 380 m )See example below:
I know that the problem is in MGI 6 projection (it is not accurate),but I do not know how to fix it.


texts: Using Compressed Data Files (.cdf) from a Geodatabase in QGIS?

texts:
I am using QGIS3 for a file geodatabase that was created on ArcMap. I can only access a few of the layers in the QGIS browser because most of them are stored using a compressed data file (.cdf). When I tried executing ogr2ogr in the OSGeo4W Shell, I got the warning message "(layer name) has a C:\Users\user\Desktop\geodatabase.gdb\compressedfilename.gdbtable.cdf file whose format is unhandled for each layer that was stored with these .cdf files.

How can I decompress/convert these .cdf files to a usable format for QGIS without access to ArcMap? Is there a solution using R?


texts: saving Operations accidentally deletes geometry data

texts:
From time to times, the geographical coordinates of some features of my program get deleted on any update - without an obvious cause.

The layer uses WFS  1.1.0 as protocol. The saving Operations looks approximately like this

     feature.attributes.Abteilung = "02";
     feature.state = OpenLayers.State.UPDATE;
     features = [feature];
     saveStrategy.save(features);

In the log, it looks like this:

INFO   | jvm 1    | 2015/06/17 09:21:11 | Request: transaction
INFO   | jvm 1    | 2015/06/17 09:21:11 |     service = WFS
INFO   | jvm 1    | 2015/06/17 09:21:11 |     version = 1.1.0
INFO   | jvm 1    | 2015/06/17 09:21:11 |     baseUrl = http://localhost:8080/geoserver/
INFO   | jvm 1    | 2015/06/17 09:21:11 |     group[0] = wfs:update=net.opengis.wfs.impl.UpdateElementTypeImpl@e6f68e (filter: [ Graeber.1068 ], handle: null, inputFormat: <unset>, srsName: null, typeName: {Ahaus_neu}Graeber)
INFO   | jvm 1    | 2015/06/17 09:21:11 |     update[0]:
INFO   | jvm 1    | 2015/06/17 09:21:11 |         property[0]:
INFO   | jvm 1    | 2015/06/17 09:21:11 |             name = GEOMETRYproperty[0]:
INFO   | jvm 1    | 2015/06/17 09:21:11 |             name = ABTEILUNG
INFO   | jvm 1    | 2015/06/17 09:21:11 |             value = 02property[0]:

which I understand as: the property GEOMETRY is not set to any value.

What I want now, is either:

 To detect the cause (it happens only very seldom)

or

To prevent any update that sets GEOMETRY to NULL

or:

To make the SaveStrategy ignore the geometry and to only update the attributes

is one of these possible and how??


texts: Creating a CSV with Irish Grid references and opening the points in QGIS

texts:
I have a load of Irish grid references that I need to create a map of in Ireland - any advice? Tried to input a couple of refs and open in Biological record tool thinking this would be simple but hey ho, I'm asking for help now!
See the CSV example - what am I doing wrong?


texts: ImageMagick's convert program changes PNG file format so that color/alpha info doesn't survive GDAL

texts:
It appears that ImageMagick's convert program changes something in my PNG file that causes GDAL processing to mess up the color and/or transparency bands.

My original PNG file gets processed successfully by gdal_translate, gdalwarp and gdal2tiles.py to create web tiles. Call it original.png.

Here is the workflow that generates correct tiles:

original.png -> 'gdal_translate' -> tmp.gtif -> 'gdalwarp' -> final.gtif -> 'gdal2tiles.py' -> tiles

Here is the problematic workflow:

original.png -> 'convert -trim' -> trimmed.png -> 'gdal_translate' -> tmp.gtif -> 'gdalwarp' -> final.gtif -> 'gdal2tiles.py' -> tiles

Hence 'convert' changes something that GDAL can't handle (note that if I start with a PDF file format, original.pdf, and use 'convert' to change it to PNG, I have the same problem - so it's not just the trim (cropping) functionality of convert). Using gdalinfo, I see that 'convert' has changed the pixel data type from Byte to UInt16, as you see below.

Here's an excerpt from the gdalinfo printout for the original file:

> gdalinfo original.png
Driver: PNG/Portable Network Graphics
Files: original.png
Size is 1000, 800
Band 1 Block=1000x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=1000x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=1000x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=1000x1 Type=Byte, ColorInterp=Alpha

Note that Type=Byte.

Here's the gdalinfo for the trimmed (problematic) file:

> gdalinfo trimmed.png
Driver: PNG/Portable Network Graphics
Files: trimmed.png
Size is 746, 746
Band 1 Block=746x1 Type=UInt16, ColorInterp=Red
Band 2 Block=746x1 Type=UInt16, ColorInterp=Green
Band 3 Block=746x1 Type=UInt16, ColorInterp=Blue
Band 4 Block=746x1 Type=UInt16, ColorInterp=Alpha

Note the data type has changed from Byte to UInt16, and the Mask Flags are not longer there.

Then after running this file through 'gdal_translate' to get tmp.gtif, here is the gdalinfo:

> gdalinfo tmp.gtif
Driver: GTiff/GeoTIFF
Files: tmp.gtif
       tmp.gtif.msk
       tmp.gtif.aux.xml
Size is 746, 746
... (coordinate info omitted ) ...
Band 1 Block=746x1 Type=UInt16, ColorInterp=Red
  Mask Flags: PER_DATASET
Band 2 Block=746x1 Type=UInt16, ColorInterp=Green
  Mask Flags: PER_DATASET
Band 3 Block=746x1 Type=UInt16, ColorInterp=Blue
  Mask Flags: PER_DATASET
Band 4 Block=746x1 Type=UInt16, ColorInterp=Alpha
  Mask Flags: PER_DATASET

(PER_DATASET flag is back, and ColorInterp values are still rgba)

Finally, after running this output (tmp.gtif) through 'gdalwarp', the ColorInterp values don't survive (nor does the Mask Flag):

>gdalinfo final.gtif
Driver: GTiff/GeoTIFF
Files: final.gtif
Size is 758, 749
... (coordinate info omitted ) ...
Band 1 Block=758x1 Type=UInt16, ColorInterp=Gray
Band 2 Block=758x1 Type=UInt16, ColorInterp=Undefined
Band 3 Block=758x1 Type=UInt16, ColorInterp=Undefined
Band 4 Block=758x1 Type=UInt16, ColorInterp=Undefined

If I view this file, it's grayscale, but then the tiles generated by gdal2tiles.py from this file are a jumbled mix of colors.

Anyone have experience with ImageMagick's convert program and getting it to play nice with GDAL? Thanks ahead.

-Jeff


texts: How to prevent gdalwarp from swapping axes?

texts:
Executing gdalwarp on a file which has an axis mapping (Data axis to CRS axis mapping: 2,1) results in a transposed image (axes are swapped).

Is there a way to prevent this? I tried to use t_srs option, to no avail.

I know I could use, for example, Python bindings and transpose the data with numpy. But I'd rather having a solution with GDAL's CLI.

The command I use:

gdalwarp -of GTiff input.JP2 output.tif

See the sizes in gdalinfo outputs.

JPEG2000 input file's gdalinfo:

Size is 2407, 3729
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
GeoTransform =
  4.424925925925925, 0, 3.7037037037e-05
  50.9246111111111, -1.8518518519e-05, 0
Metadata:
  METADATATYPE=DIMAP
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (   4.4249259,  50.9246111) (  4d25'29.73"E, 50d55'28.60"N)
Lower Left  (   4.5630370,  50.9246111) (  4d33'46.93"E, 50d55'28.60"N)
Upper Right (   4.4249259,  50.8800370) (  4d25'29.73"E, 50d52'48.13"N)
Lower Right (   4.5630370,  50.8800370) (  4d33'46.93"E, 50d52'48.13"N)
Center      (   4.4939815,  50.9023241) (  4d29'38.33"E, 50d54' 8.37"N)
Band 1 Block=2048x2048 Type=UInt16, ColorInterp=Red
  Overviews: 1204x1865, 602x933, 301x467, 151x234, 76x117
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
    NBITS=12
Band 2 Block=2048x2048 Type=UInt16, ColorInterp=Green
  Overviews: 1204x1865, 602x933, 301x467, 151x234, 76x117
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
    NBITS=12
Band 3 Block=2048x2048 Type=UInt16, ColorInterp=Blue
  Overviews: 1204x1865, 602x933, 301x467, 151x234, 76x117
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
    NBITS=12
Band 4 Block=2048x2048 Type=UInt16, ColorInterp=Undefined
  Overviews: 1204x1865, 602x933, 301x467, 151x234, 76x117
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
    NBITS=12

GeoTIFF output's gdalinfo:

Size is 4224, 1363
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (4.424925925925925,50.924611111111105)
Pixel Size = (0.000032698049453,-0.000032698049453)
Metadata:
  AREA_OR_POINT=Area
  METADATATYPE=DIMAP
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (   4.4249259,  50.9246111) (  4d25'29.73"E, 50d55'28.60"N)
Lower Left  (   4.4249259,  50.8800437) (  4d25'29.73"E, 50d52'48.16"N)
Upper Right (   4.5630425,  50.9246111) (  4d33'46.95"E, 50d55'28.60"N)
Lower Right (   4.5630425,  50.8800437) (  4d33'46.95"E, 50d52'48.16"N)
Center      (   4.4939842,  50.9023274) (  4d29'38.34"E, 50d54' 8.38"N)
Band 1 Block=4224x1 Type=UInt16, ColorInterp=Red
Band 2 Block=4224x1 Type=UInt16, ColorInterp=Green
Band 3 Block=4224x1 Type=UInt16, ColorInterp=Blue
Band 4 Block=4224x1 Type=UInt16, ColorInterp=Undefined


texts: Cannot visualize xarray dataframe after converting to NetCDF

texts:
I am trying to convert sample.csv dataframe - link no NetCDF here is what I did

import xarray as xr
import pandas as pd

dfcsv=pd.read_csv('sample.csv')
dfcsv=dfcsv.set_index(['latitude','longitude','zgodina'])
dfcsvx=dfcsv.to_xarray()
dfcsvx.to_netcdf(path='dxa.nc')

Conversion works fine, but I can't visualize data in NOAA Weather and Climate Toolkit I get following error


texts: How to get an ArcGISTiledMapServiceLayer + WMSTLayer based on same service to align?

texts:
The image below can be obtained by adding WorldTimeZone layers to the JSAPI map:

wmtsLayer = new esri.layers.WMTSLayer("http://servicesbeta4.esri.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS", options);
tiledLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://servicesbeta4.esri.com/arcgis/rest/services/WorldTimeZones/MapServer", { opacity: 0.5});

I believe this issue is that the WMTS scale values are based on 0.28mm/pixel instead of 96 DPI.

Is there a way to make these two layers align correctly?

Because a proxy is required I cannot provide working source but I did paste my code here.


texts: Extracting value of raster for specific points (with X and Y coord) and write to column in Attribute Table?

texts:
I have specific points in shp file  and list of rasters in the same coord system
and want to extract   values from rasters for  each point
and place these values in column in Attribute Table  of   shp  file of points.

Rasters are separate files.

Is it possible to go from vector to raster?

Shp file pf points:

infc = 'samplepoints1.shp'

code just a start:

import arcpy

infile = r"C:\Users\anna_pavlenko\Desktop\SILVER\biscuit_dnbr.tif"
#create raster object
ftc = arcpy.sa.Raster(infile)
#rows and columns
ftc.height
ftc.width
#cell size
cellSize = ftc.meanCellHeight
print 'The cell  size is ', cellSize, 'm'

rasterList = r"C:\Users\biscuit_dnbr.tif"
rstArray = arcpy.RasterToNumPyArray(rasterList)

rows, cols = rstArray.shape
print "number of rows: " ,  rows
print "number of columns: ", cols

for rowNum in xrange(rows):
    for colNum in xrange(cols):
        value = rstArray.item(rowNum, colNum)

If I use

inRasterList = [["biscuit_dnbr.tif", "foothills_dnbr.tif", "dNBR1"] ,     ["biscuit_rdnbr.tif", "foothills_rdnbr.tif", "RdNBR1"],["silver_dnbr.tif", "pony_complex_dnbr.tif", "dNBR2"], ["silver_rdnbr.tif", "pony_complex_rdnbr.tif", "RdNBR2"]]
#  ["foothills_dnbr.tif","dNBR1"], "foothills_rdnbr.tif", "RdNBR1"],
#  ["pony_complex_dnbr.tif", "dNBR2"], "pony_complex_rdnbr.tif", "RdNBR2"]]

ExtractMultiValuesToPoints(inPointFeatures, inRasterList, "NONE")

This  function  create  values  for 1 place (polygon) and extract value  for point inside this polygon only  and place them in columns:   "dNBR1", "dNBR2",  "RdNBR1", "RdNBR2".
     For another set of rasters  it create   0 -zeros for  first points and add new columns :  "dNBR1_1", "dNBR2_1",  "RdNBR1_1", "RdNBR2_"  each time.


texts: How do you make Amazon Cloud GIS Server accessible outside local environment?

texts:
I have services in the cloud and want to access them from applications outside the cloud.
How do I set permissions to consume services outside of the cloud?

Also, what is the format or syntax used for referencing Amazon Cloud GIS Server?
So, when I try to add GIS Server what would type in?


texts: How to determine soil moisture index values from reflectance values in a satellite image?

texts: I'm working on determination of soil moisture by remote sensing. I would like to know how we can determine soil moisture index values from reflectance values in LANDSAT TM images.


texts: Adding nodes to a line by interval in MapInfo

texts: I am a MapBasic beginner, and I just want a simple .mbx or tool that can add nodes to a line by interval (say every 50m). I don't really need it to have a start point or end point (or maybe it is necessary to have that for the code to work, not a problem). Just maybe a dialog box that lets me bring in the line table and specify my interval, that's it.


texts: Modelbuilder only outputs Info files and logs

texts: I am developing a processing algorithm in ArcMap ModelBuilder. When I run it everything seems to work fine and running to completion. However when I go check the output directories I only find Info files and Logs, but no output rasters although I have these specified in the model. Does anyone know why this may be?


texts: Controlling layers displayed in data driven pages of ArcGIS for Desktop?

texts:
I am trying to use data driven pages to show four different pages.

All of these have the same extent, so the extent of the index layer is the same in each case.

What I want to do is show different layers in each page.

So for example page 1 would show an extent from bottom left hand corner British National Grid (200000, 300000) to top right hand corner British National Grid (300000, 400000) showing the layer "RED_CIRCLE".

Page two would show the same extent;
bottom left hand corner British National Grid (200000, 300000) to top right hand corner British National Grid (300000, 400000), showing the layer "BLUE_SQUARE".

I have found a lot of tutorials online but these all only show how to use tools to set up data driven pages that all have different extents.

How can I achieve this control of layers in each page?


texts: How to export a polygon based on elevations using a DTM or a DEM

texts:
I have a LiDAR generated DTM and a DEM (accurate to 10x10 feet). I am trying to export a polygon within a boundary which includes all elevations below a specific number. Seems like this should be simple but I am having a hard time. Ideally, I would like this to be accurate to 0.5 ft.

Also, I no longer have a 3D analyst license. If that is the only way to deal with the DTM, I may procure a new license. I'm using ArcMap 10.2.2.


texts: Clip multiple rasters using polygons based on filename in arcpy

texts:
I have created several rasters using arcpy by subtracting several rasters using the arcpy.Minus_3d function.

Now I want to clip these rasters using polygons. My rasters are called test01_out, test02_out etc. My polygons are called test poly_name_test01.shp, test poly_name_test02.shp, etc.

Is there a way to clip raster test01_out with polygon test poly_name_test01.shp using arcpy? I used QGIS to split my shapefile into separate shapefiles based on attributes. Alternatively, how can I call the polygon in a shapefile containing all my shapefiles based on attribute (name=test01)?

I've been trying with this code but I'm stuck

import arcpy
import os
from arcpy import env

env.workspace = r"C:\rasters"

list1 = arcpy.ListRasters("test*out")
list2 = arcpy.ListFeatureClasses("*.shp")
for raster in list1:
    rasterName = os.path.basename(raster) #I know this is wrong - I somehow need to remove the _out
    rasterMask = ""
    for mask in list2:
            if mask.endswith(rasterName):
                rasterMask = mask
                print "mask: " + mask
                break
        if rasterMask !="":
            clipFile = rasterName + "_clip"
            print "clip file: " + clipFile
            arcpy.Clip_analysis(raster, env.workspace + "\\" + mask, env.workspace + "\\" + clipFile)


texts: Parse SQL geometry Value to Arcpy Python geometry object

texts:
I'm trying to get a multiPolgon value returned from an SQL query (SQL Server 2014) to a an Arcpy Geometry Object. I know this is very easy I just am missing something.Whats confusing is this is a Native ESRI Enterprise Geodatabase (ArcGIS 10.7.1) and this is the normal SHAPE field that all feature classes have.

I can do very easily using the Cursor object and the SHAPE@ token associated with the data access module however the query performance on this takes about 4 hours to run due to remote access on very choked pipe. Where as the SQL direct query takes about 30 Seconds to run.

Basically I need the result from SQL Query below for field 4 or 5 or what ever I have to CAST it as to feed into arcpy.Geometry('POLYGON', something from the query)

SELECT
    ITEMS.{feild_0},
    ITEMS.{feild_1},
    ITEMS.{feild_2},
    ITEMS.{feild_3},
    CAST(ITEMS.{feild_4} AS geometry),
    CAST(ITEMS.{feild_4} AS nvarchar(max)),
    ITEMS.{feild_6}
FROM
    {user_id}.{table_id} AS ITEMS

WHERE
    {sql_query}
ORDER BY '{feild_0}';


texts: Error: KrigingModelOrdinary not defined in python

texts:
Here is the code:

rasterKrig = "run{}_Krig_{}".format(counter, field)
outKrig = arcpy.sa.Kriging(Stations2010o3Data__2_, field, KrigingModelOrdinary, {2})
outKrig.save(rasterKrig)
arcpy.env.extent = tempEnvironment0

I am getting a runback error:

  KrigingModelOrdinary not defined in python

How and where do I define the KrigingModelOrdinary?


texts: Modify a Raster display just for aesthetic reason

texts:
I have one raster display that I want to include in a report that I am working for school. This is a picture of the raster file:

This is a river bathymetry and as you can see, on the margins of the river I get this pixelated thing that it is not so visually appealing for a paper display.

Is there any way I can "cut" only that purple margin and stay only with the "orange-yellow" part of the river?

This is the one that really matters for my study.


texts:
I have a large inut raster geotiff map of size 12000x9000.
I am running r.watershed to output a stream raster map. However it is much lower resolution, only about 960x711.
How do I make GRASS GIS / r.watershed command output a matching size raster map of same resolution of my input?


texts:
Assuming I have a table or 2 dimensional array with only geometries and names (all in all 5k elements)

name     the_geom
a        polygon_geometry....
b        polygon_geometry....
c        polygon_geometry....
d        polygon_geometry....
e        polygon_geometry....
f        polygon_geometry....
...      ...

Is there a way to get the distances of all geometries to all geometries within one table.

    a    b    c    d    e    f    ....
a   -    2m   3m   2m   2m   2m
b   2m   -    3m   5m   1m   9m
c   9m   3m   -    2m   7m   2m
d   ..   ..   ..   -    ..   ..
e   ..   ..   ..  ..    -    ..
f   ..   ..   ..  ..    ..   -
....

All hints are welcomed. Python hints as well!


texts: Using GDAL's Python Bindings, how can I download an entire Layer?

texts:
I'm trying to write a Script, which will download an entire WFS layer to Disk. The output format could be GeoJSON, Spatilite or even Shapefile.

I know how to do this using ogr2ogr, but I need to use the Python Bindings, since this is part of a larger Python script.

How do I download the entire layer using the GDAL bindings?

I've managed to write the following code:

import sys
from osgeo import ogr
driver=ogr.GetDriverByName('WFS')
url=sys.argv[3]
layerName=sys.argv[4]
wfs=driver.Open('WFS:'+url)
layer=wfs.GetLayerByName(layerName)

#I'm stuck here
#I need to save this entire Layer to disk, in any format that GDAL understands


texts: Geographically Weighted Regression Using the Poisson Distribution

texts:
From my reading so far, GWR uses the Gaussian or bisquare distribution. My dependent and explanatory variables are rates. I was reading Chapter 12 of Spatial Statistical Data Analysis for GIS Users by Krivoruchko and saw this:

"For non-Gaussian data, gwr can be used with Poisson regression when input data are counts or rates and with logistic regression when data are binary or proportions."

How do I test my data to determine if I should use Gaussian, bisquare or the Poisson for my GWR analysis? What are the key differences between them? Since I was going to use ArcGIS for the GWR, is there a way I can select the Poisson?


texts: How can I export big SVGs for further use in Inkscape?

texts:
I am trying to export as an svg from Quantum GIS and import into Inkscape. However it is failing to Import. Inkscape comes up with the error 'Failed to load the requested file'. The files are quite large, about 3500-3700kB. I tried decreasing the number of vector layers I was exporting on Quantum and that seemed to open however the file size was roughly the same.

However I do need all the layers and it is clearly not an issue of size. I think it may be a problem with the export in the print composer of QGIS as opposed to the import in Inkscape as Inkscape can open a file of the same size.
Thanks.


texts: How to get minx, miny, maxx and maxy of a geometry?

texts:
I'm new to Oracle Spatial.
In MySQL or PostGIS, it's easy to get minx miny maxx maxy of a geometry, any and/or all of them. But how to do that in Oracle Spatial?

Do I need to chain up several functions and properties to get any of them? Well this doesn't make sense to me.

Thanks in advance.


texts:
I was trying to extract the time-series data from the netcdf using grid points (lat/long) by MakeNetCDFTableView. I have more than 100 grid points and I want to extract the data from the netcdf file.
I was trying the following pyscript, but couldn't save the output table.

Could you please help me fix my problem?

#Import system modules
import arcpy

# Set local variables
inNetCDFFile = "F:/VIC_FORCINGS/7071.nc"
variable = "prec"
outTableView = "F:/VIC_FORCINGS/precipm"
rowDimension = "time"
dimensionValue = "64;-146"
valueSelectionMethod = ""

# Execute MakeNetCDFTableView
arcpy.MakeNetCDFTableView_md(inNetCDFFile, variable, outTableView, rowDimension, dimensionValue,valueSelectionMethod)

outTable = arcpy.CopyRows_management(outTableView)
print


texts: How to refresh vector tile layer after setting declutter in OpenLayers 6?

texts:
I am using OpenLayers version 6. I want to change the declutter of a vector tile layer by using vecTileLayer.set('decluter',false).
After changing declutter of layer with the set method of vecTileLayer, My map is not updated and nothing changes.
I also used vecTileLayer.getSource().refresh() to refresh layer after setting declutter, but nothing happens.
This is my code:
layer.set('declutter',!layer.get('declutter'));
layer.getSource().refresh()

How should I change declutter of a vector tile layer and see updates on the map?


texts: Get original SQL Query of layer created from selected features

texts:
Situation

I am currently helping a friend with a ArcGIS problem. She is familiar with ArcGIS but not with programming and I am familiar with programming but not with ArcGIS :-) .

We have a layer LAYER1 that was created via "Create Layer from Selected features" from another layer LAYER0, of which some features were selected via a SQL query 'Select by Attribute' (Open Attribute Table -> Select by Attribute).

Question

How do I extract the original SQL query, which was applied on LAYER0, from LAYER1 via Python/arcpy?

Background

(Why do I want to know it)

The servers of network drives have changed. Solutions to updated the path names are described here. We updated the data sources' path names via appying findAndReplaceWorkspacePaths on the mxd file, which was successful. Unfortunately, all feature selections of layers created by "Create Layer from Selected features" got lost for an unknown reason. We also tried applying replaceDataSource on each layer, which suchseccessfully updated the data path but also removed the selections. In the referenced article it is suggested to "update Layer object's definitionQuery". However, when I get the definitionQuery of one layer variable LAYER (LAYER.definitionQuery), I only get an empty string ... . Now, my plan is to extract the SQL queries and recreated the layers via arcpy.SelectLayerByAttribute_management from the old SQL queries.


texts: Missing attributes while copying features from a shapefile to PostGIS layer QGIS

texts:
I'm trying to copy some features from a shapefile into a PostGIS layer loaded in QGIS. I followed the steps bellow.

Select and copy features from SHP.
activate editing of destination layer and paste copied features.
The process completes successfully and the geometric part is passed, but the attribute part is missing.

How can I solve this problem ?


texts: How to set "hit" tolerance for touch dragging in Openlayers

texts:
I have a Openlayers map with a single point feature on. When pressing a button I activate a drag handler.

My problem is when using mobile devices dragging the point is virtually impossible. No matter the settings in the stylemap (size of the feature), you have to hit it exactly on the point.

Is it possible to set a hit tolerance, or create a buffer?

Any alternate solutions is welcome.


texts: Can ArcEngine resolve unstructured address data?

texts:
In the following tutorial link, the code geocodes a structured address.  In the example address fields are coded so that the program knows in advance 1) state = "CA" 2) city = "Redfield"...
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_geocode_a_single_address/00010000038r000000/

Is there a way to resolve unstructured address data in ArcEngine?

An example of unstructured address data would be a single string like this:
"222 Ashland St N Cambridge MN 55008"

Where the user has not parsed the string down into its elements of street, city, state, zip


texts:
In a well known text definition file of a geolocated image (or whatever else it does) we find this:

  PROJCS["UTM_Zone_19_Northern_Hemisphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS84",SPHEROID["WGS84",6378137,298.257223560493]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-69],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]

My question is, what is the number I marked bold (0.017453292519943295) function?


texts: How to Resize the Qgis Main Window from python

texts:
I would like to write a plugin that simply resizes the qgis main window to make it small. How can I access the qgis main window through the qgis api?

Use Case:
We are having problems with qgis taking over the screen, so that the minimization toolbar is inaccessible, and we can't use anything else on the desktop until we have exited qgis.  This seems to be a result of incapatability between Qt and our very old windowing system.  I know how to fix this problem using the QGIS.conf file or the registry, but we have many users of varying ability, and many are switching between windows and linux (tunneled through Solaris) servers, which can cause the problem to recur.  Fixing the problem with repeated edits of the config file (or the windows registry) is really too much to ask of them.  So, I want to make a button that they can just press, and fix it.


texts: Calculating the proportion of area drawn over boundary file

texts:
I'm working with agriculture area data in MapInfo. I downloaded the boundary file from StatCan (call it STC), and a freehand draw tool downloaded here https://tinyurl.com/ydarsnq8 (call it DRW)

I can draw an area (DRW) over the StatCan boundary file (STC). In some cases DRW falls over 2 or 3 regions (polygon) in the STC (call it STC1, STC2, STC3...etc)

How can I calculate the proportion DRW over each STC regions (i.e. DRW/STC1, DRW/STC2..etc)

Reason, each STC has a unique 'production' value and I need to compute the 'production' value for my DRW.


texts:
I'm attempting to create a schema for some user-provided input GeoJSON so that I can store this data using PostGIS transactions. I am experiencing a problem with input that is a completely empty GeoJSON set.

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

This is valid GeoJSON, so I'd like to support this case when users provide this input to me. I am retrieving a PostGIS data store and then creating a schema for this GeoJSON.

FeatureJSON featureJSON = new FeatureJSON();
SimpleFeatureType featureSchema = featureJSON.readFeatureCollectionSchema(inputStream, false);
DataStore postGisStore = myProjectUtilities.getPostGisDataStore(/*params*/);
postGisStore.createSchema(featureSchema);

The final line throws an error Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")" because it cannot find the default geometry field. This is because, for my empty GeoJSON set, there's obviously no geometry and no attributes.

If I turn on FINEST logging, I can see the SQL statement that is failing:

FINE: Create schema: CREATE TABLE "public"."feature" ( "fid" SERIAL PRIMARY KEY,  )

The SQL statement is attempting to set a primary key, but since my GeoJSON is empty, no value exists and it ends up creating an invalid SQL statement.

Is there a way I can get this schema creation to succeed with an empty GeoJSON set? In my program, users can potentially add more features to this later, so I would really like to be able to create the table at this point in time.


texts:
When I create a .sddraft it by default gets Owner's read and write permissions. I think I need execute permission for creating .sd file.
I am using Python and my file resides in LINUX server.


texts:
I'm trying to use the Intersect tool in ArcObjects SDK Java with two feature classes.

Here is my code:

    public void intersectTwoFeatureClasses(Object in1, Object in2, Object out) throws UnknownHostException, IOException {
    IGpValueTableObject intersectInFeatures = new GpValueTableObject();
    intersectInFeatures.setColumns(2);
    intersectInFeatures.setValue(0, 0, in1);
    intersectInFeatures.setValue(0, 1, 1);
    intersectInFeatures.setValue(1, 0, in2);
    intersectInFeatures.setValue(1, 1, 1);
    Intersect intersect = new Intersect(intersectInFeatures, out);
    IGeoProcessorResult result = gp.execute(intersect, null);
    if(result.getStatus() != esriJobStatus.esriJobSucceeded)
        return;
}

But I get an Automation Exception: Item Not Found in this Collection. in 'DAO.Fields'.

The way I create my IGPValueTableObject seems to be wrong.

Does anyone know how to create it for two feature classes ?


texts: How to copy group layer shape files to geodatabase retaining layer order using Model builder?

texts:
I have set of shapefiles that represent cadastar plan. Correct order of layers look like this in TOC.

I would like to import same structure to existing geodatabase katastar.gdb so I have something like this:

Can this be done with ModelBuilder? Feature class to geodatabase (multiple) does not accept group layer? I probably need to iterate somehow sublayers in group layer and then import one by one. But how to do that?


texts: Google Earth Engine,Selecting Image Properties

texts:
Any ideas on how to select image properties:
In this instance, I want to mask all crop types except for Rice.

var dataset = ee.ImageCollection('USDA/NASS/CDL')
              .filter(ee.Filter.date('2017-01-01', '2018-12-31'))
              .first();
var img_cropLC = dataset.select('cropland');
Map.setCenter(-100.55, 40.71, 4);
Map.addLayer(img_cropLC, {}, 'Crop Landcover');

print(img_cropLC)

var img_cropRice = img_cropLC.properties.cropland_class_names.select('Rice')

The last line is incorrect but I am looking for how to navigate into properties -> cropland_class_names -> and the select 'Rice'


texts: How to change the value of an attribute using QgsFeature in PyQGIS?

texts:
I would like to update one attribute of a feature.  However, I don't know to update it using the feature object. I have to use data provider to update it.

layers = QgsMapLayerRegistry.instance().mapLayersByName('my_line')
layer = layers[0]
dp = layer.dataProvider()
it = dp.getFeatures()

for i in range(0, dp.featureCount()):
  feat = it.next()
  attrs = { 2 : 30 }
  layer.dataProvider().changeAttributeValues({ feat.id() : attrs })

Can I change the value of an attribute using QgsFeature object?

Moreover, is it possible to loop using an iterator object?


texts: I'm in trouble with creating first helloworld app using arcgis android

texts:
I made my first application using arcgis android sdk but when ı'm launching helloworld app emulator didn't launch the map.
Read all questions and documents..Still didnt find any solution to solve this problem. Here is my screenshots;

Eclipse View  -  http://i.stack.imgur.com/FzvPK.jpg

Emulator View -  http://i.stack.imgur.com/an2zi.jpg


texts:
Data has been given to us in a HUGE .xyz file, which has been split into many component CSV files.  When I upload the CSV file, then create the shape file by "save as", all is fine.  When I go to Raster, then Interpolation, the resulting layer appears incomplete, as if it hasn't been processed. - Image below...

Question is: is it incomplete due to lack of "machine-power" (very doubtful) or data issue (doubtful, as it appears OK in the CSV) or is it a limitation of QGIS?  Is there an easier way of uploading the enormous files rather than splitting them and risking a data error?


texts: How to add layer switch/on off layers in OpenLayers

texts:
I have configured a WMS layer into OpenLayers localhost (port 8080), I want to show a layer toggling button which can show only OSM basemap checkbox and my layers.

What is code for it how to add this in my code?

My code is given as:

<!DOCTYPE html>

    <title>Single Image WMS</title>
    <link rel="stylesheet" href="https://openlayers.org/en/v4.5.0/css/ol.css" type="text/css">


texts: Can OpenGeo Community Edition be used in commercial project?

texts:
I would like to know if the Community edition of OpenGeo Suite can be used in a commercial project?

And, if so, what are the conditions of use for the Community edition?


texts: Extracting data from vector tile package (.vtpk) using ArcGIS Pro?

texts:
I have been provided with 1m land contours in a vector tile package (.vtpk). It is 14GB.

Is it possible to extract the data from the .vtpk into a geodatabase?

I have access to ArcGIS Pro 2.2, ArcMap 10.6 and QGIS 3.2.0.

I have tried the "Extract Package" tool in ArcGIS Pro. However, it kept crashing.

Is there a more suitable tool or should I keep trying with the extract package tool?

The contours are required to be in a shapefile in order to be used in acoustic modeling software.


texts:
I have an ArcGIS Pro (.stylx) style I wish to convert to use in QGIS 3.10.
Is there a way to do this?
SLYR only allows ArcGIS (.style) and not (.stylx) from what I can see.


texts:
I have the following png image displaying tanker traffic density:

The colors are from dark red to light red, dark red means 'lowest density' and light red means 'highest density'. For example, the density is highest near the center lines of the ship traffic corridors. My problem is that I don't have the legend of the image and so I'm trying to reconstruct the legend. I'd like to sort the colors from dark red to light red, and assign a relative value from 0 to 1 to each color category. I was able to extract all unique colors from the image with the GDAL rgb2pct and gdalinfo commands:

rgb2pct tankers.png tankersPCT.png
gdalinfo tankersPCT.png > tankersInfo.txt

The color table shows that there are 30 unique colors in the image:

    Band 1 Block=1067x7 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 248,80,80,255
    1: 248,56,56,255
    2: 248,40,40,255
    3: 248,72,72,255
    4: 248,16,16,255
    5: 240,8,8,255
    6: 248,64,64,255
    7: 240,0,0,255
    8: 208,32,32,255
    9: 216,16,16,255
   10: 248,48,48,255
   11: 248,8,8,255
   12: 200,32,32,255
   13: 216,24,24,255
   14: 232,8,8,255
   15: 208,24,24,255
   16: 192,32,32,255
   17: 248,0,0,255
   18: 248,88,88,255
   19: 176,48,48,255
   20: 224,16,16,255
   21: 248,32,32,255
   22: 160,40,40,255
   23: 144,32,32,255
   24: 248,24,24,255
   25: 104,16,16,255
   26: 184,40,40,255
   27: 128,24,24,255
   28: 248,96,96,255
   29: 248,248,248,255
   30: 0,0,0,255

However the colors are not sorted from dark red to light red. Any ideas how to sort the colors according to the "darkness" of the color?


texts: Append not populating target dataset - Arcpy

texts:
I am attempting to append several features from an input dataset to a target dataset.  Both datasets have several matching fields, which are the ones that I would like to keep - fields that do not match do not need to be kept.  I was under the impression that if "NO_TEST" is used in the append tool, the schemas do not have to match and all matching fields will populate without specifying fieldmappings.  However, when I run my script, the input data is not populating the target dataset.  Here is my code:

layer = arcpy.MakeFeatureLayer_management(sgcnpolygons, "sgcn_lyr")
selection = arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", '"Environment" = \'a\'')
tempCatchments = arcpy.SpatialJoin_analysis(catchments, selection, "in_memory\\tempCatchments", "", "KEEP_COMMON")
sgcn = arcpy.Append_management(tempCatchments, sgcnpolygons, "NO_TEST")


texts: Convert negative values to 0 values in attribute table

texts:
I nedd to convert negatives values to 0 values in a column of the attribute table. I'm trying to use the field calculator with CASE function or coalesce, but I think I'm not writing the correct expression. How can I write it?
Example:

CASE
WHEN "z" is <'0' THEN result = '0'
END


texts:
Im iterating through folders and subfolders to find shapefiles (~140 shapefiles, ~20 GB total) then applying fixgeometries and importintopostgis to import them to a postgis database.

While code is executing I would like QGIS to print out for example Processing shapefile123.shp but QGIS is freezing while code is running. All the while the import into postgis is working, I keep track on the side using pgadmin.

What is causing QGIS to freeze while the code is executing and how can I fix it? CPU and mem usage is about 50 %. Maybe Tasks is what I want?

from subprocess import call
import os, datetime

a = datetime.datetime.now()
print ('start',str(datetime.datetime.now().time()))

#Create database
call(["psql", "-U", "postgres", "-c" "drop database if exists lmv;"])
call(["psql", "-U", "postgres", "-c" "create database lmv;"])
call(["psql", "-U", "postgres", "-d", "lmv", "-c", 'create extension postgis;create extension tablefunc;'])

root = r'C:\GIS\data' #Folder with subfolders with shapefiles

for path, subdirs, files in os.walk(root):
    for name in files:
        if name.endswith('.shp'):
            #print(os.path.join(path,name))
            if 'ok_riks' in path:
                prefix = 'ok_'
            elif 'vk_riks' in path:
                prefix = 'vk_'
            elif 'tk_riks' in path:
                prefix = 'tk_'
            elif 'fj_riks' in path:
                prefix = 'fj_'
            else:
                prefix = 'unknownsrc_'
            print('Reparerar: ', prefix+name)
            fixgeom = processing.run("native:fixgeometries",
                {'INPUT':os.path.join(path,name),'OUTPUT':'TEMPORARY_OUTPUT'})['OUTPUT']
            print('Importerar: ', prefix+name)
            print('Tabellnamn: {0}'.format(prefix+name.replace(".shp","")))
            processing.run("qgis:importintopostgis",
                {'INPUT':fixgeom,'DATABASE':'lmv','SCHEMA':'public','TABLENAME':prefix+name.replace(".shp",""),
                'PRIMARY_KEY':'','GEOMETRY_COLUMN':'wkb_geometry','ENCODING':'UTF-8','OVERWRITE':True,
                'CREATEINDEX':True,'LOWERCASE_NAMES':True,'DROP_STRING_LENGTH':False,'FORCE_SINGLEPART':False})

print ('stop',str(datetime.datetime.now().time()))
b = datetime.datetime.now()
print('Total tid {0} s ({1} min)'.format((b-a).seconds, ((b-a).seconds/60)))

Four hours later it unfreezes:


texts: Automating topology error fixing with ArcPy?

texts:
I have a web application where folks upload a zipped up file geodatabase, I unzip it and manipulate the feature classes and then transfer them using insert cursors to an SDE database. I am wondering if I can apply topology rules to the input feature classes to get rid of polygon slivers. I know I can add topology to the file geodatabase they input, the problem is that I don't know if you can automate the fixing of the topology errors with python. Everything I've read thus far makes it seem like you can validate with python and export an error report, but to actually fix the errors you must put the layer into ArcMap and manually do it. Is it possible to fix topology errors using python automation?

If it's not possible, I'm thinking my best option is probably to use the Eliminate tool on the input feature classes before running them through the rest of the script that manipulates attributes and geometry.


texts: Is there any way or any idea on how to handle Time attribute in GIS? For example, which are the ways to specify that an  object is at a place at a given time interval and them it is in another place in another time interval, let's say, like a political boundary that has changed.


texts:
I am after the same solution to Removing elevation trend over sloped surfaces?

I am following the steps outlined, but in the last step it states:

  In this expression [X'] refers to the the x-coordinate grid in the
  original coordinates and [Y'] refers to the original y-coordinate
  grid.

I'm not sure what is meant by the original coordinate grids. It doesn't look as if these are the original x and y values.

What are the coordinate grid values, and how I might obtain them?

That Q&A is quite old so perhaps there is a new method for carrying out this operation.


texts: How to concatenate string and noneType object

texts:
My issue is:

I can't concatenate string and noneType object. Some attribute values are empty. It follows that label isn't displayed.

What is the solution?

def FindLabel ( [CONTENU], [NOM_OBJET_USUEL] ):
  if [CONTENU] == u"Eaux usées":
    return "<CLR red='168' >" + [NOM_OBJET_USUEL] + "</CLR>"

  elif  [CONTENU] == u"Eaux mélangées":
    return  "<CLR red='168'  >" + [NOM_OBJET_USUEL] + "</CLR>"

  elif [CONTENU] == "Eaux pluviales":
    return  "<CLR green='77' blue='168' >" + [NOM_OBJET_USUEL] + "</CLR>"

  elif  [CONTENU] == "Eaux de drainage":
    return  "<CLR green='77' blue='168' >" + [NOM_OBJET_USUEL] + "</CLR>"


texts:
maybe the answer is somewhere, but i can't find it right now... I'm getting problems with SEXTANTE and algorithms with GRASS, SAGA...

Always is the same, they can't open the files, the error is the folowing:

  Oooops! The following output layers could not be open Convex Hull:
  */home/luismi/Escritorio/para_eliminar/interpolaciones.shp* The above
  files could not be opened, which probably indicates that they were not
  correctly produced by the executed algorithm Checking the log
  information might help you see why those layers were not created as
  expected This algorithm requires SAGA to be run. A test to check if
  SAGA is correctly installed and configured in your system has been
  performed, with the following result: SAGA seems to be correctly
  installed and configured

As you can see is not a problem with spaces between names, neither is a problem of writable directory because I tried to write in Desktop folder.

I'm using Ubuntu 12.04 and Qgis is 2.0 version (was updated from repositories from 1.8 and I think i had the same problem...)

Please help... I need this correctly working to continue my project.

Thanks to everybody!!!


texts:
I am using QGIS 3 on a Mac. I have a large raster (bfd.tif size is 26000, 31800) that I'm trying to apply a calculation to. When I use the default raster calculator in QGIS 3 I get a raster back with every pixel the same value. When I try to use the Geoprocessing r.mapcalc I get "env python3 no such file or directory".

I'm following this tutorial Creating Shaded Relief in Blender so in order to have a height map that works with Blender each pixel value needs to be an integer. I'm using this formula to stretch the values evenly from my min -2.06 to my max 1615.48.

raster_out=( bfd + 2.06 ) / ( 1615.48 + 2.06 ) * 65535

There is a question here that looks like an alternative but I'm not sure how to run this code or how to manipulate it for my purpose. QGIS Raster Calculator Not Giving Output Where can I learn about this method?

And fixing environment variables for QGIS 3 and Python might help me but this question has no answers. QGIS 3 env Python 3


texts: How to make smaller ArcMap PDF for use in InDesign?

texts:
I frequently build reports that incorporate ArcMap maps. The maps are all exported in PDF format.

I am finding that there are so many line segments in the map that importing them at times is almost impossible. They also bulk up the report file, ballooning its size.

What can the technician do to make the map file smaller since multiple layers are unnecessary in a print document?


texts:
When working on a map in QGIS I will often set up a view in my SQL Server spatial database and create a MSSQL layer based on this.

As part of my workflow I often make adjustments to the SQL view based on input from the client.

Is there a quick way of refreshing the layer in QGIS so that it picks up on these changes? Currently I end up closing and re-opening my project to pull any changes through.


texts: Merging multiple TIFF files into one TIFF file with multiple bands using Python

texts:
I am trying to merge multiple TIFF files into one multi-band TIFF using Python.
I used subprocess.checkoutput('python gdal.merge.py') and it was working well.
But I am looking for another way to do this without using any external process.
Is there a library or a way that I can use.
This is the code I used
basename = '*'
outdir2 = './TIFF_Files'
filelist2 = glob.glob(os.path.join(outdir2, basename))
files_string = " ".join(filelist2)
print(files_string)
Tiff_output = os.path.join(outdir2,'Multi_band.tif')
command = "python gdal_merge.py -o " + Tiff_output + " -of gtiff -separate " + files_string
output = subprocess.check_output(command)

Keep in mind that I am not really advanced in Python.


texts: Calculate irregular polygon center-point that falls within the polygon boundary

texts:
I have an SDE.ST_GEOMETRY polygon FC in an Oracle 18c/10.7.1 geodatabase.

I can calculate the X and Y of the polygon centroids using the SDE.ST_GEOMETRY ST_Centroid function:

sde.st_x(sde.st_centroid(shape)) as x,
sde.st_y(sde.st_centroid(shape)) as y

  ST_Centroid takes a polygon, multipolygon, or multilinestring and
  returns the point that is in the center of the geometry's envelope.
  That means that the centroid point is halfway between the geometry's
  minimum and maximum x and y extents.

Unfortunately, the polygons are irregularly shaped, and therefore the centroids do not fall within the polygon boundaries:

Is there a way to calculate polygon center-points that fall within the polygons?


texts:
I found what seems to answer my question by @xunilk in this closed post:
Filling polygons with points or polygons using PyQGIS?

I follow the example of @xunilk with some modifications to adapt to QGIS version 3.4. But at the end of the python scipt I have this error message:
"NameError: name 'QgsMapLayerRegistry' is not defined".

In the autocompletion of the python console, there is no QgsMapLayerRegistry function.


texts: Adding new feature via Python in QGIS attribute table

texts:
I want to add a new feature with the Add Feature button in the Attribute Table using one line of PyQGIS.

I can show the attribute table via

iface.showAttributeTable(iface.activeLayer())

Is there not a method like iface.showAttributeTable(iface.activeLayer()).addFeature available?

EDIT: The table I'm adding features to has optional geometry. When geometry is needed directly in the table, the standard Add Feature from the Edit menu works fine: the feature is digitized in and then the attribute edit dialog comes up. But in other cases the geometry is going to be referenced from another table, so I want the attribute edit dialog to come up first, as happens when the Add feature button is selected from a showAttributeTable call.


texts: QGIS does not display all Features of Layer and behaves weird instead

texts:
I have a weird problem with QGIS trying to load a Layer from a Postgis Database

When I open the Layer from Postsgis I have two choices:

Method one:

Either, I use the Panel "Browser", where I can select PostGIS->myDatabase->public->myTable

then, I get a subset of the features in the table to be displayed in the main section (namely, only those features that have been edited via geoserver, but there is absolutely no trace of that in the datbase table).
The subset consists of 338 features, while the whole table contains 5380 features.

When I rightclick the Layer's Name in the "Layer" Panel and select "open attribute table", I still get a List with all Features in the table, even those that are not displayed. When I select one of the non-displayed features and click the Loupe Icon ("zoom to the chosen cell"), It zooms to the place where the feature would be expected but is not displayed.

When I rightclick the Layer's Name  and select "show numbers of object" it shows correctly 5402

But when I rightclick the Layer in the "Browser" Panel and select "properties", it says "Number of Objects within the layer":338

Method two

The second option I have is, open the layer with the Elephant-Icon on the left taskbar.

With this process, I get a layer where all 5402 features are correctly displayed - BUT:

When I try to select features in order to copy or move them, it works only with these 338 features from the other selection. The remaining 5064 features are simply not selectable. When I click on them after I selected the "select objects" button, nothing happens at all.

---

Even when I edit the values of on feature of the 5064 to resemble exactly the values of one of the 338 (except for Id), it is still not displayed in method one and not selectable in method two.

Everything worked fine before. Without any obvious reason, the program decided to behave like this.

Who can help?

Screenshot of info tab of the respective table


texts: Method to compute and visualize the closest set of facilities from OSM data

texts:
I want to use OSM to extract a set of facilities e.g. school, park, hospital inside a given region.
from that, transform the area in grid and for each cell in a grid compute its score mixing the distances of the closest point for each type of facilities (distance from the closest school+ distance from the closest park + distance from the closest hospital)

  score area 1= distance from the closest school (= 1.2 miles) +
  distance from the closest hospital = (2.2 miles)+ distance from the
  closest park= (0.2 miles) (each distance for each type of facility
  will be normalized actually)

and 3.  represents it on a map  (via a HeatMap)

I am sure this is a common practice to determinate for instance the best location to build  a facility according to other existing facilities?

Can someone indicate the common process, lib and algorithms for doing such thing?


texts: How to get gridded data in Excel into ArcGIS?

texts: I am very new to using ArcGIS. Right now I have an Excel sheet with data in it where each cell represents a grid from a model output and contains a value (eg. amount of precipitation in that grid cell from the model output). I am given the coordinates for the "corners" of this area and that each grid box has a lat-lon of 1/16 degree. So the data is already "spatially" laid out in excel. Is there a straightforward way to import this type of data format directly into ArcGIS while maintaining the spatial layout of the data?


texts: How to draw a circle in OpenLayers 2 and measure its radius dynamically?

texts:
With OpenLayers 2.13, I want to draw a circle and obtain its radius at each mousemove. The radius would then be returned as arguments of a callback function, for example. But of course, this is not the problem here.

I have tried several ways but none of the worked the way I want:

METHOD A

I tried to change the "move" method in OpenLayers.Handler.RegularPolygon, adding a custom event in the control of the handler. It worked but, it does not fit my needs, because:

I can only calculate the "normal" length, and not the "geodesic" length. So, I never get a correct radius.
By the way, changing the core of OpenLayers doesn't seem very clean to me, nor safe!

METHOD B

Using OpenLayers.Control.Measure together with OpenLayers.Control.DrawFeatiure, seemed to be the best option to me. I registered an event for "measurepartial", but it didn't return anything. The "measurepartial" event is not triggered when drawing a circle (RegularPolygon) because there is no point being added (I suppose this is the reason).

SOURCES

In this question, it is asked something very similar to what I ask, bt there was no good answer for y case, so I tried to investigate it and post my own question.
In this question, I found the exact same problem as mine, and it is based on this that I applied METHOD A.

CONCLUSION

I would rather use something like METHOD B, but I don't know how. The "measurepartial" event is not triggered when using RegularPolygon.

I didn't post code, because it is work-related. And by the way, I think I explained everything that needed to be told.


texts:
I'm trying to get GDAL extensions to work in a Geoserver standalone installation. I'm following these instructions:

https://docs.geoserver.org/latest/en/user/data/raster/gdal.html

Upon starting Geoserver, I can see that GDAL has been installed. It doesn't seem to work properly though:

I'm on Ubuntu 16.04 and gdal-bin and libgdal-java are installed. How can I fix this?

For the sake of completion, here is the error message in text form:

JNI GDAL Wrapper Version: unavailable


texts: gdalwarp leaves horizontal artifacts regridding from EASE-Grid (laea) to Polarstero (stere)

texts:
I'm trying to understand how to use gdalwarp to warp an image.  I believe I'm doing the basics correctly, but I might be missing some gdalwarp options.

The basic problem is that I see horizontal artifiacts in my output image.

Here's basic steps to reproduce.

Start with a simple 722x722 image.  Here's one on imagur (Direct link to png)

Now use gdal_translate to apply metadata to make this a geotiff (this is a EASE-grid Lambert Azimuthal Equal Area projection on a 1924 authallic sphere.)

gdal_translate -a_srs '+proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m +no_defs' \
    -a_ullr -4524688.262500000 4524688.262500000 4524688.262500000 -4524688.262500000  \
    -co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9 \
    -of GTiff ./UiMbqSd.png ./UiMbqSd.withmetadata.tif

This seems to have the expected geographic information (~12.5km grid) confirmed with gdalinfo

 gdalinfo UiMBqSd.withmetadata.tif

Driver: GTiff/GeoTIFF
Files: UiMbqSd.withmetadata.tif
Size is 722, 722
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["unnamed ellipse",
        DATUM["unknown",
            SPHEROID["unnamed",6371228,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["latitude_of_center",90],
    PARAMETER["longitude_of_center",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-4524688.262500000186265,4524688.262500000186265)
Pixel Size = (12533.762500000000728,-12533.762500000000728)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-4524688.263, 4524688.263) (135d 0' 0.00"W, 29d42'45.71"N)
Lower Left  (-4524688.263,-4524688.263) ( 45d 0' 0.00"W, 29d42'45.71"N)
Upper Right ( 4524688.263, 4524688.263) (135d 0' 0.00"E, 29d42'45.71"N)
Lower Right ( 4524688.263,-4524688.263) ( 45d 0' 0.00"E, 29d42'45.71"N)
Center      (   0.0000000,   0.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Band 1 Block=722x2 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=722x2 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=722x2 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=722x2 Type=Byte, ColorInterp=Alpha

Next I regrid it to a polarstero projection.

gdalwarp -t_srs "+proj=stere +lat_0=90 +lon_0=-45 +lat_ts=70 +ellps=WGS84 +datum=WGS84 +units=m" \
    ./UiMbqSd.withmetadata.tif ./regridded_lon0_-45.tif

The problem I'm seeing is horizontal artifacts that appear to protrude around the middle of the image.
Here's the png representation of the problem (http://imgur.com/Nrx4ZoS)

I thought it might be something weird about my corners, but I see these artifacts with different lat_0 values.

gdalwarp -t_srs "+proj=stere +lat_0=90 +lon_0=0 +lat_ts=70 +ellps=WGS84 +datum=WGS84 +units=m" \
    ./UiMbqSd.withmetadata.tif ./regridded_lon0_0.tif

Here's an example with no rotation (http://imgur.com/uiiF9Ir)

I'm currently running this on a mac:

> gdalwarp --version
GDAL 1.11.1, released 2014/09/24

But I've tested and seen the same behavior on UBUNTU 12.04:

GDAL 1.10.1, released 2013/08/26


texts: Clip vector with grid using loop to do fragstats background

texts:
I would like to put background border - with negative values - in my squere landscape in order to use in fragstats. I'm trying to do it with pyqgis. Exemple what I would like to do (figure 3).

So, I have a land use map (vector) and a grid (vector) (fig 1). I would like to clip land use map with this grid (one by one square grid) through pyqgis script. If possible I set this result in memory. In my code I set to save into temporary folder. I have to do it because I need to do many operations with a clipped land use separately in order to achieve the example result(figure 3) for my case. I try to do it with pyqgis but I dind't. There was a problem with my script. When I have run it, the land use didn't clip completely. What is the problem? The clip was running however it was only do in few polygons (fig 2).

Here is my code:

# coding: utf-8
import processing
from qgis.analysis import *
from PyQt4.QtGui import QInputDialog

#Defining vector land use patch
path_map = QgsVectorLayer("/media/dogosousa/56A22ED6A22EBA7F/
Geoprocessamento/Projetos_2015/Sisbiota/Vetor/Dados_Brutos/mapeamento_total.shp", "landscape use", "ogr")
try:
path_grid = QgsVectorLayer("/media/dogosousa/56A22ED6A22EBA7F/Geoprocessamento/Projetos_2015/Sisbiota/Vetor/buffer_square_point/square_3700m/square_3700m_join_sirgas200024S.shp",
"grid", "ogr")

#Load layer grid into canvas
QgsMapLayerRegistry.instance().addMapLayers([path_grid])

#Doing loop in grid vector rows
canvas_layer = iface.activeLayer()

features = canvas_layer.getFeatures()

for feat in features:
    attrs = feat.attributes()
    print feat.id()
    print attrs[4]
    overlaylayer = path_grid.setSelectedFeatures([feat.id()])

    clip = processing.runalg("qgis:clip", path_grid,  path_map, "/tmp/"+"clip_"+str(attrs[4])+".shp")

except:
    #Conferir se a layer foi criada como esperado
    if not path_grid.isValid():
        print "Layer %s did not load" % path_grid.name()


texts: Is it possible to download map layer from map server and adding it to google map?

texts:
This is a link for the base map server :

It contain about 23 layers, my question.. let say I want layer number 23 is it possible to get this layer and adding it to google map? Because I don't see on google a way to add this layer by a URL from any map server

I want to get this layer
then add it to google map

What do I need for this?

Any advice or solution for this problem?


texts: Reprojecting data from EPSG:3857 into Peru UTM Zone 17

texts:
I am trying to reproject EPSG:3857 Spherical Mercator OpenStreetMap Data to the local Peruvian UTM Zone 17.

How do I find out which transformation method is suitable for +-1m accuracy?
I have SAFE FME and ArcGIS.


texts:
I've got a postgre/postgis database with about 120 million positions (geography type).
I would like to create a density map (e.g. a heatmap) and serve this via geoserver.

I did create a one-band raster. I loop through all points and increase the value of the raster element containing this point. (see code below)
This leads to my database exploding (querery ran about 15 hours, database increased by 60 gigabye).

So I need a faster and more efficient way of doing that.

CREATE TABLE raster_table (
  rid         SERIAL PRIMARY KEY,
  name        VARCHAR(30),
  description VARCHAR(255),
  rast        RASTER
);

/* insert new raster for whole germany */
DELETE FROM raster_table
WHERE name = 'test';
INSERT INTO raster_table (rid, name, description, rast)
VALUES (1, 'count', 'count raster',
        ST_AddBand(ST_MakeEmptyRaster(2500, 4500, 5.5, 47, 0.004, 0.002, 0, 0, 4326), '8BUI' :: TEXT, 0));

CREATE OR REPLACE
FUNCTION update_grid()
  RETURNS VOID AS $$
DECLARE
  pl  RECORD;
  val INT;
BEGIN
  FOR pl IN SELECT positions.id, positions.position
            FROM positions LOOP

    SELECT ST_Value(rast, 1, pl.position :: GEOMETRY)
    INTO val
    FROM raster_table;
    val = val + 1;

    UPDATE raster_table
    SET rast = ST_SetValue(rast, 1, pl.position :: GEOMETRY, val)
    WHERE raster_table.rid = 1;
  END LOOP;
END;
$$ LANGUAGE plpgsql;

SELECT update_grid();

When this is done, I would create the colormap like so

INSERT INTO raster_table (rid, name, description, rast)
  WITH ref AS (SELECT raster_table.rast
               FROM raster_table
               WHERE rid = 1)
  SELECT 2, 'rgba', 'colorful map', ST_ColorMap(ref.rast, 'bluered') FROM ref;


texts: How can I find a postal_code for a given Lat/Lon in a OSM database?

texts:
I have a OSM database on postgres/postGIS. Data are downloaded from https://download.geofabrik.de/ and created in postgres with osm2pgsql using schema osm2pgsql.

Now I'm looking for a postalcode on a given GPS position. How can I find this in the OSM database?


texts: Checking what changed inside updated shapefile

texts:
I am using different shapefiles from open data in Switzerland. They have just updated the whole set. My question is: how to compared two layers (new and old version)? I would like to know the differences in geometry, as well as attributes. In the data there are points, lines and polygons and some of the sets contains a big amount of features (more than 300 000 elements).
I have already checked all the simillar questions, but they all focus on creating the third layer with differences or particular layer example.
What I want to know is just what has been changed.
I am working with QGIS 2.14.3 and i am familiar with Python.


texts: Quick OSM Save As Shapefile error "Can't create field"

texts:
I have used the quick osm plugin to import the rivers in Germany.

I want to save the vector layer as a shapefile so I right click on the layer and go to save as... and save it as a shapefile layer

Once I click okay this error message appears

Any ideas?


texts:
I used to get image pop ups in QGIS using the HTML code:

< img src="[% image %]" width=300 height=300 >

But somehow, I do not manage to use it anymore on QGIS 2.18.

Does anybody have a clue?


texts: Raster calculator: Missing areas in output using two mosaics

texts:
I'm doing a simple DEM minus DSM to get tree canopy heights. However my results are missing most of the data (no data).

I've used the Minus tool and Raster Calculator achieving the exact same result. The DEM/DSM are mosaic datasets which I am assuming is part of the problem. Tiles do work individually. Rasters are floating point if that helps and I have tried building footprints, overviews and boundaries.


texts:
I'm a very beginner at GRASS. I'm using GRASS 7.0 and I tried to install r.vieshed.cva extension. When installed, if I type it in the command line, it appears

  "r.viewshed.cva" is not recognized as an internal or external command,
  operable program or batch file

Could someone help me?


texts: Setting Date and Time for QDateEdit and QTimeEdit

texts:
Working on a QGIS plugin, I am struggling to save/load date and time values. Users can enter dates via QDateEdit widget and times via QTimeEdit widget. Values are then stored the following:
s = QgsSettings()

# Date
self.Isochrones_Date_setting = self.dlg.Isochrones_Date.date()
s.setValue("otp_plugin/Isochrones_Date", self.Isochrones_Date_setting)

# Time
self.Isochrones_Time_setting = self.dlg.Isochrones_Time.time()
s.setValue("otp_plugin/Isochrones_Time", self.Isochrones_Time_setting)

and shall be read by:
s = QgsSettings()

# Date
self.Isochrones_Date_setting = s.value("otp_plugin/Isochrones_Date", QtCore.QDateTime.currentDateTime())
self.dlg.Isochrones_Date.setDateTime(self.Isochrones_Date_setting)

# Time
self.Isochrones_Time_setting = s.value("otp_plugin/Isochrones_Time", '14:00:00')
self.dlg.Isochrones_Time.setDateTime(self.Isochrones_Time_setting)

However, loading saved values or getting default values fails. With this code I am getting the error

TypeError: setDateTime(self, Union[QDateTime, datetime.datetime]):
argument 1 has unexpected type 'QDate'

What is the correct syntax, if not .setDateTime()? Or do I need to convert QDate to some other date before? If so, how?


texts: Getting more accurate area size using QGIS

texts:
I'm using Natural Earth's shapefiles and try to match them to the real area size. I'm utilizing $area expression, but no matter what ellipsoid measurement I use the result seems to be very off. For example, most ellipsoids give Norrbotten county size of 104 725 km², while it should be 98 244 km². I don't need it to be absolutely precise, but I feel like over 5 000 km² offset is too much.
What am I doing wrong?
I am using QGIS
CRS: Sphere_Robinson (EPSG: 53030)


texts: How to change nodata with gdal_translate

texts:
I am trying to create a tiff file using gdal_translate.

Initially my noDataValue was 0.0, but my client suggested that - noDataValue should be -9999.0, so I changed it to -9999.0.

gdal_translate -of GTiff  -a_nodata -9999.0 -a_srs EPSG:4326 -a_ullr -26.62 45.099999999999994 75.46 -6.82 -co INTERLEAVE=BAND -co TILED=YES -co COMPRESS=LZW -ot Float32 shape_19790101.tif shape_19790101_optimized.tif

But now I am getting following suggestion

  You set the noDataValue to -9999, but you did not recompute the imagine and change the value of the "noDataPixels"

Can anybody explain what exactly this means ?


texts: OGR-Driver GML axis order handling (GDAL, QGIS)

texts:
By default the OGR-Driver will swap the axis order to longitude, latitude for geographic coordinate systems.

  "Since OGR 1.8.0, the GML driver has coordinate system support. This is only reported when all the geometries of a layer have a srsName attribute, whose value is the same for all geometries. For srsName such as "urn:ogc:def:crs:EPSG:", for geographic coordinate systems (as returned by WFS 1.1.0 for example), the axis order should be (latitude, longitude) as required by the standards, but this is unusual and can cause issues with applications unaware of axis order. So by default, the driver will swap the coordinates so that they are in the (longitude, latitude) order and report a SRS without axis order specified."

Example (1): urn:ogc:def:crs:EPSG::4326 - GML 3.2  (WGS 84)
Lat / Lon is swapped to Lon / Lat by the driver (result: correct import into QGIS).
http://www.weichand.de/tmp/wfs20gml32_epsg4326.gml

Example (2): urn:ogc:def:crs:EPSG::31468 - GML 3.2  (Gauß Krüger 12°)
North / East is NOT swapped to East / North (result: incorrect import into QGIS).
http://www.weichand.de/tmp/wfs20gml32_epsg31468.gml

Example (3): urn:ogc:def:crs:EPSG::25832 - GML 3.2  (ETRS89 UTM 32N)
Default: East / North (result: correct import into QGIS).
http://www.weichand.de/tmp/wfs20gml32_epsg25832.gml

Is there any reason why OGR 1.9.2 don’t swap the coordinates of projected systems (to East / North)?

Thanks in advance
Juergen


texts: Setting default value in FileGDB table column during GDAL/ogr2ogr export from PostGIS?

texts:
I'm doing an export for one table (table name: 'schaden_polygon') from a PostGIS-database (db-name: 'mydata') to ESRI FileGDB via ogr2ogr commandline-tool. The PostGIS-table contains a column 'm_uuid' [where uuid is automatically generated via 'uuid_generate_v1()']. After the export, the default value in the FileGDB column 'm_uuid' is set to "uuid_generate_v1()", which causes trouble in further data processing. This happens since GDAL-update to version 2.0.
I'm wondering if there is any possibility to set the default value to NULL during the export-process by using ogr2ogr commandline-tool. I'm using the following commandline for the PostGIS to FileGDB-Conversion

C:\OSGeo4W64\bin\ogr2ogr -f "FileGDB" D:\data_export.gdb PG:"host=192.168.0.74 port=5432 user=postgres dbname=mydata password=postgres" schaden_polygon


texts: How to get the feature id of features added to dataProviders?

texts:
My question is somehow related to the problem of finding the id of the last added feature: I am looking for a way to supply the feature id and another attribute of each added feature through a signal. The user can change many layers, but only in case of changing a special layer this signal should be emitted/evaluated.

The solution to the question mentioned above is to connect to the featureAdded signal of the layer being edited.

Instead of editing layers I am going to add features to the dataProvider. In this case the signal is not emitted through the layer.

I see three ideas to prove:

Adding an appropriate signal to dataProvider objects (my preferred solution)
Changing layers featureAdded signal to include feature id and the other attribute (second best solution), and fire it manually.
Define an application specific signal and emit this whenever a feature is added to any provider (the easiest way, but filtering signals by this special layer is required)

In all cases one question is: how can I get the feature id of the feature being added to a dataProvider? According to the first and second idea: is it possible to extend the contents of a signal, or to bind one more signal to mapLayer/dataProvider objects?


texts:
I want to get the point attribute data into intersected layer. I have this code

if pt.geometry().intersects(pg.geometry()):
    intersection = pg.geometry().intersection(pt.geometry())
    intersectionLength = intersection.length()
    print pt['PLATSECID']
    fieldIndex = pointLayer.fieldNameIndex(polygonLayerColumToUpdate)
    pointLayer.startEditing()
    pointLayer.changeAttributeValue(pt.id(), fieldIndex, pg[pointLayerColumName])
    pointLayer.commitChanges()

The problem is that point intesecting with only one split fragmented layer, it is not intesecting with other split fragmented polygon. Although picture seems that point intesecting with both split feature of the layer


texts: OpenLayers - Switching to Google Basemap causes a flicker as it zooms to extent

texts:
I created and example based off of the spherical-mercator example example and placed it here.  I made the bing road layer the default.  If you zoom in on a location and then switch to a google layer you'll see the map go to full extent and then zoom to the correct extent.  It happens very quickly but it is a distraction.  I've tried several hacks to get around this but none of them work (delayed opacity, calling setMapObjectCenter before setting visibility).

Anyone willing to figure out (or already know) how to eliminate the flicker/animation?  Note that this is only an issue the first time you select a google base layer.  Subsequent switching transitions beautifully.


texts: Overlapping features and attributes help

texts:
I'm using ArcMap 10.3 and am looking for some guidance on how to "connect" two layers.
Layer one contains non-overlapping polygons (site)
Layer two contains overlapping polygons (species)
I would like the attributes from layer two to appear in the layer one polygons when the fall within a polygon.

This will create a list of species within a site.


texts: Capturing an event On Sketch Finish in ArcObjects

texts:
I am using IEditEvents_Event and IEditor. I invoked the GarciaUI_CreateNewFeatureTask and used:

pID.Value = "esriEditor.SketchTool";
pCommandItem = pCommandBars.Find(pID);
if (pCommandItem != null)
{
  pCommandItem.Execute();
}

It is working and I can create a polygon in edit mode. I want to capture an event after the Polygon Creation is completed.

I also have another button on the same form to Split Polygon. I want to capture an event after the split is completed. But I want to capture both these events separately. Can someone help me to accomplish it?

I have to do it in c# + ArcObjects ArcGIS 10.3.


texts:
Is it possible to use Python to run actual standard SQL on an enterprise geo-database?
Think about batch deleting, joints, etc moving beyond just the cursor objects in Arcpy.

Note that one can shortcut ArcGIS and directly work with the back end database, but that is not the purpose of the questions here (and it I'd not recommended if you have n advanced geodatabase, like a versioned one)


texts: Convert vertices of polygon features to points using Virtual Layer in QGIS

texts:
I have a polygon layer and want to use a Virtual Layer that creates points from the vertices of the polygon layer. The question is how to write a query that does this?
I am aware of the tool "Extract vertices", but that is not what I am looking for.
What I tried:

 select fid, nodes_to_points(p.geometry) as vertices
 from polygon as p

nodes_to_points() is a QGIS expression, but the documentation says:

Functions of QGIS expressions can also be used in a virtual layer
query.

However, it does not say anything how to include it in the (SQL) query syntax. Update: it seems that not all QGIS expressions can be used in virtual layer, see here for a list of functions that can be used: Listing all functions available in QGIS's Virtual Layer

I also looked in the SpatiaLite 4.2.0 SQL functions reference list, but could not find any function to create individual points for each vertex. The closest I came was using ST_DissolvePoints():
 select fid, ST_DissolvePoints (p.geometry) as vertices
 from polygon as p

This creates the visual effect of vertices, but not as individual points, but a single multi-point feature per polygon:


texts: Seeking alternative to deprecated Min in Raster Calculator?

texts:
I've been trying to run an old model built on 9.3 within 10.6 and I've run into the following error:

  NameError: name 'Min' is not defined

I believe the Min function was removed after 10.0 (?) but I can't work out how to update this equation:

Min(Mod("%Dist%",5), %D0%+%R0%+%DA%+%RA%+%DB%+%RB%)

Dist is a Euclidean Distance Raster, the other Variables are numbers.


texts: How to deploy silverlight application in IIS 7.0?

texts:
I have created a sample silverlight web application and followed the steps given in
http://support.esri.com/en/knowledgebase/techarticles/detail/39169 to deploy. i have copied clientbin folder consisting .xap file and .html and silverlight.js to sampleApp folder in wwwroot and converted it to application in IIS. But when I browse the application, it is not opening and the URL in the browser is coming as "//localhost/sampleApp/" instead of "//localhost/sampleApp/samplepage.html". When I open in content view and rightclick on samplepage.html and browse, it works fine. Can anyone help me where the deployment steps went wrong? I dont want to go to content view always and browse the samplepage.html always. I want this to happen from rightclicking the application and browse.


texts: Highlight Borders When Mouseover Fill Area - Leaflet-R

texts:
Following the guidance of TimSalabim I separated the borders and fill of my neighbourhood polygons so that I could order them appropriately with zIndex.

https://lawsblog.netlify.com/post/leaflet-map/

Now if I place the highlightOptions() function within the addPolygons(neighbourhood fill) function I don't know how to increase the border of the polygon.

If I place the highlightOptions() function within the addPolylines(neighbourhood border) function I can CAREFULLY mouse over just the border and its width increases.

So now that I've separated the fill and borders of the polygons how do I increase the border width when I mouseover the fill area?

# Add hood borders
  addPolylines(data = borders,
               color = "white",
               opacity = 1,
               weight = 2,
               options = pathOptions(pane = "hood_borders")) %>%

 # Add hood fill
  addPolygons(data = hood_shp,
              fillColor = ~pal(be_per_cap),
              fillOpacity = 1.0,
              color = NA,
              options = pathOptions(pane = "hoods",

              # Highlight neighbourhoods upon mouseover - NOT CORRECT
              highlight = highlightOptions(
                          stroke = 4),

              # Add label info when mouseover
              label = labels,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")))


texts:
I am generalizing geological map, for initial process I am dealing with small polygons which are less than minimum separability unit and try either remove them or enlarge. For the first step I am converting geological map scale 1:25 000 to map scale 1:50 000 scale.

Based on the theory we have less space for the same amount of features, and some of them should be eliminated based on area, importance and etc.
Here, question is, what amount of features should be kept to the successive map scale.

I have slight memory from my old Cartography class that 25% of overall  features should be maintained, though I could not find proper reference to link it with the fact.

Does anyone know about this rather simple but important issue?


texts:
I'm learning how to build queries to use OverpassTurbo and retrieve data from OpenStreetMap.

Can anyone help me to understand this query?

(
  node["shop"="bicycle"]({{bbox}});
  way["shop"="bicycle"]({{bbox}});
  relation["shop"="bicycle"]({{bbox}});
);

out body;

>;

out skel qt;

…

I am confused by the need to query relations when looking for bike shops and by the meaning of this syntax:

();
out body;
>;
out skel qt;


texts: Save an edited color ramp as a new color ramp in QGIS 2.18

texts:
Is there a way to save an edited, pre-existing color ramp as a new color ramp, or export the edited color ramp in QGIS 2.18.xx?

I'm able to take an existing gradient ramp, say, "Blues", and edit it, which is very handy. After editing the name of the ramp changes to "[source]":

...and the layer is styled with the edited ramp-- however, the actual edited ramp itself doesn't seem to persist when I save my project file, save the style, etc... the layer itself remains styled in that edited color ramp, however. If I want to edit the ramp further or transfer that ramp to a different layer, I have to start from scratch:

When I launch the layer properties dialog again, the ramp comes up blank, and I'm unable to edit it:

Right now my workaround is to write down all of the information for the edited ramp (values, percentages, stops, etc...) and create a new ramp from that... but that's rather inefficient. Just want to make sure there isn't something obvious I'm missing before I submit a bug report / feature request.


texts: Using SQL query new feature with loop in ArcPy?

texts:
I'm trying to create an individual buffer feature class for each column of an input feature class, where there is a field that contains the buffer distance.

I think there is a problem with my SQL statement because in the inner loop to access the field with the buffer length I get this error:

  for buf in loop2:

  RuntimeError: A column was specified that does not exist.

Any suggestions? Note I also tried: query = ' "UNIQUEID" = '  + str(id[0])

Here is my code:

###loop through field value of nest number, AKA "UNIQUEID"

fc1 = BEN_input
field1 = "UNIQUEID"

with arcpy.da.SearchCursor(fc1, (field1)) as loop1:

    for id in loop1:

        #extract out individual nest
        query = "UNIQUEID" + "="  + str(id[0])

        arcpy.MakeFeatureLayer_management(BEN_input, "BEN", query)

        ##clip water to buffer size

        #access buffer size
        fc2 = "BEN"
        field2 = "best_buf"

        with arcpy.da.SearchCursor(fc2, (field2)) as loop2:
            for buf in loop2:
                water_buf_size = buf

        #buffer nest
        arcpy.Buffer_analysis(BEN, "BEN_buf", water_buf_size)


texts: ArcGIS Raster to Polygon conversion not always outputting Class Names?

texts:
I'm having issues converting a cropland data layer using the conversion tools>>raster to polygon tool. I try to convert the data and select the field "class names" to assign values to the polygons in the output dataset. For some reason, about 95% of the time, the output dataset does not contain the field "class names" in the attribute table. About 5% of the time, it does convert correctly and includes the class names data, but I don't think I'm doing anything different. I need the class names to show up in the output shapefile.

Any suggestions?

I'm using ArcGIS for Desktop.


texts: Cleaning up duplicating Python Add-in buttons in ArcMap

texts:
I have developed an extensive toolbar with ~30 buttons, tools, combo boxes, etc created using the Python Add-in Wizard and ArcGIS 10.2.2.

Something about my development process is causing the buttons, tools and combo boxes to duplicate on my toolbar. Some are now appearing up to six times every time I reload the add-in. I can use customize to remove the duplicated buttons, but even simply re-opening the mxd causes the duplication to reoccur.

Generally, the associated files are located on a network share and I copy the .esriaddin to a different network location to distribute to a number of users. I sometimes copy these files to my local drive, edit them offline and install the add-in to test offline.

If I go to Add-in Manager, I only see my add-in project once. I have tried deleting it and reinstalling it.

The config.xml file only associates each button to a menu or toolbar once.

The users that I distribute the add-in to do not see this duplication behaviour.


texts: Adding separate distance files to calculate total distance in ArcGIS

texts:
I have two raster files:

A raster of distance-to-outlet for a creek. Value = 0 at creek
outlet (white), and the maximum value is at the beginning of the creek (black).
A raster of Euclidean distances from the creek boundary. Distances are
calculated from creek boundary (red-green).

I need to create a third file that adds the Euclidean distances to the creek distances. Essentially, I need to scale the Euclidean distances per the creek distances, so the final file represents "total distance" to each point within the study area.


texts:
Have you heard/read about a distributed SDI (Spatial Data Infrastructure) or GIS ?

I'm thinking on a system that uses something similar to the torrent protocol for managing spatial data and also be able to perform spatial analysis, geoprocessing and visualization in a distributed way without a centralized provider.


texts:
In the PostGIS SQL Editor, I just want to make a loop to make this function work

This query is to give the UTM Zone number to one column of Global DTM raster table

For Loopid = 0 to 1000, then execute the following statments:

UPDATE public.globaldtm
SET "UTM" = loopid
WHERE rid IN (SELECT rid FROM globaldtm WHERE ST_Intersects(rast,(select geom from utm where gid =loopid)));

How do I write a simple code inside this SQL editor to make the loop work?


texts: PyQGIS: How to send signal if layer is currently in edit mode

texts:
I'm looking for a way to send a signal if a layer is in editing mode. I tried editingStarted(), but it wasn't working. I'd like to do something along the lines of the what I have below, but can't find it in the API (where I'm looking: http://qgis.org/api/classQgsVectorLayer.html#a476eaf6ec8f2a45e285e963bcacedcc2)

qgis.utils.iface.setActiveLayer(myLayer)
#capslock is in place of the method i'm searching
if myLayer.ISINEDITMODE() == False:
    qgis.utils.iface.actionToggleEditing().trigger()


texts:
I'm reading a window of a tif using rasterio.  How do I utilize the available overviews to get a down-sampled version of the data instead of reading at the true resolution?

Right now I am reading a window like this:

rmin, cmin = source.index(xmin, ymin)
rmax, cmax = source.index(xmax, ymax)
data = source.read(band, window=((rmax, rmin), (cmin, cmax)))

What I want to do:

rmin, cmin = source.index(xmin, ymin, use_overview=True)
rmax, cmax = source.index(xmax, ymax, use_overview=True)
data = source.read(band, window=((rmax, rmin), (cmin, cmax)), use_overview=True)

Any ideas? Note that in my case the overviews are internal, but any solution which reads off of overviews is great.


texts: Getting banks layer from OpenStreetMap with QGIS?

texts:
I downloaded Mexico City data from with QGIS, and I want to make a layer only with the banks. When I select "Export topology from SpatialLite", it shows a long list of all the properties and asks me to pick the properties I want to create a layer, but I don't know what property I can use to know if a building is a bank to make a layer of banks.

Is there a property that tells if a building is a bank?


texts: Zonal Statistics for Overlapping Zones Consistent failure

texts: I am trying to run Zonal Statistics for Overlapping Zones on some Buffer feature classes that overlap. I downloaded and ran the script and it succeeded in calculating the zonal statistics for my first feature class and it took about 12 minutes. Since then, I have not gotten it to succeed, and it has taken over 2 hours to complete, and fails every time with Error 001156: cannot write OID FSP001 to table (FSP001 being the name of one of my buffers). It always has this error regardless of which feature class I input into the script. The raster is just a reclassed basemap. I would like to avoid doing each zone individually as there are over 500 of them. I've run this script about 10 times, and every time it has the same error, except for the first time when it succeeded, despite there being no discernible difference between the first feature class and the second one. I am not sure what I am doing wrong and it is highly discouraging.


texts: Adding Edit button to ArcGIS Javascript template?

texts:
We've been able to successfully download the Find, Edit, Filter template, customize the configurations, and host it on our own server but here is the issue we are facing now.

We're looking to use this application for our Business License field officers. They stop by a business, check their business license and then classify it one of several different ways. The Business License layer is a point layer. By and large we do not have our address layer separated into units so in a few instances we have many Business License points right on top of each other making the data hard to edit. Not a huge deal from the desktop but if you're using a tablet it's a pain to scroll through 15 different pop-ups to edit the feature you want. As a result we're using the search function to search by business name. Has anyone written code that will create an edit button within the popup once the feature is found from the search box? As it stands now we can search for and zoom to the feature but then you must click the edit button and then reclick the feature you want to edit. Doing this means you have to then scroll through until you find your feature (link to application, search for Yankee Candle, click edit button then click back on feature). It's built in as a feature in the default web map (see picture below) but not in any of the apps.


texts:
I am trying to get the edge (the pixels that are in the border of 2 classes). I have a raster with 3 different values, and I want to keep just the pixels that are in the contact between class 1 and class 2.

I need to use python, preferably with gdal/rasterio. I thought do an dilation with scipy of 1 pixel to these areas and then keep just the pixels commons in both dilations, but that doesn't work.

b5 = path/to/rasterband

with rasterio.open(b5) as src:
    B5 = src.read()

    B5[(B5 <= 1450) & (B5 > 0)] = 0
    B5[(B5 > 1450)] = 1
    #and then flip values to get "erodel"
    erodew = ndimage.grey_dilation(B5, size=(1,1, 1))
    #erodel = ndimage.grey_dilation(B5, size=(1,1, 1))

    waterland = erodew + erodel

I think that pixels where waterland values are 2, must be the line of pixels that I am looking for.

I've found this post doing what I need, but I don't figure out how to apply these with my raster arrays data.


texts: How to check for overlapping check with tolerance using JTS / GeoTools

texts:
I have several hundered polygons which may overlap but need to be considered 'not overlapping' when the overlapping is less than 1 meter.
The overlapping check in JTS does not offer a tolerance parameter. I'm looking for a pattern how to solve the problem.


texts:
I am using PostGIS on pgAdmin3 (PostgreSQL 9.3 e PostGIS 2.2).
I have a shapefile with more than 500.000 features and I want to merge them into one.

The geometries are MultiPolygon.

I would like to have as output a shapefile with the same geometry's complexity like the input. I Have to simply the geometry after a merge...

I used several codes but none of them seem to work.

All these queries do not return what I would aspect: I have a table with the same number of feature than before.

CREATE TABLE test1 AS
    SELECT gid, fid, (ST_DUMP(geom)).geom AS geom FROM land_polygons;

or

CREATE TABLE test2 AS
SELECT
  1::INT as gid,
  ST_Buffer(ST_Collect(geom),0)::geometry(MultiPolygon,4326)
FROM
  land_polygons;

or

CREATE TABLE test3 AS
SELECT gid, fid, ST_GeometryN(geom, generate_series(1, ST_NumGeometries(geom))) AS geom
FROM land_polygons

or

CREATE TABLE test4 AS SELECT ST_Union(ST_SnapToGrid(geom,0.0001)) FROM land_polygons;

I do not know what I could do more...


texts:
I am using PostgreSQL (9.5) and PostGIS (2.2.2).

I need to create a multipoint geometry while keeping track of the order of the points. (I would assume the point order to be the same order as the one used while creating the geometry).

geom = public.ST_GeomFromEWKT('SRID= 3067; MULTIPOINT((6703022 329690),(6702875 329189), (6706855 321939), (6706937 321896))')

  Point 1: (6703022 329690) ; Point 2: (6702875 329189) ; Point 3: (6706855 321939) ; Point 4: (6706937 321896)

What would be the best approach?

Having one table with a geometry column or having two tables, one has all the other attributes and the other one has relations to the first table with the points and an id to give some order?

I also would like to know if it is possible to extract the n-th element of a multipoint (for instance the 3rd point).

  For instance from the geom example above, I would like to get the Point 3... The return value should be (6706855 321939).

The same question applies for the first and last elements of the geometry. And by the way, is there a way to know how many points are in a multipoint geometry?

  Asking how many points are in the geometry of the first example would return 4.

I have been trying to read the documentation about multipoints in the postgis reference but it seems quite confusing for me.


texts: Create a stacked bar chart with matplotlib

texts:
I'm trying to create a stacked bar chart in python with matplotlib and I can draw my bar one up the other

# -*- coding: utf-8 -*-
import psycopg2
import matplotlib.pyplot as plt
import numpy as np

# Connect to an existing database
conn = psycopg2.connect("dbname=RABATTEMENT user=postgres password=#######")

# Open a cursor to perform database operations
cur = conn.cursor()

# this is the query we'll be making
query = """
        SELECT
        trains, ideal, correct, deficient, without
        FROM __matplotlib.rabat
        """
# execute the query
cur.execute(query)

# retrieve the whole result set
data = cur.fetchall()
cur.close()
conn.close()

# unpack data
trains, ideal, correct, deficient, without = zip(*data)

N = len(trains)         #-- Number of trains
ind = np.arange(N)      # the x locations for the groups
width = 0.35            # the width of the bars: can also be len(x) sequence

p1 = plt.bar(ind, ideal, width, color='green')
p2 = plt.bar(ind, correct, width, color='yellow', bottom=ideal)
p3 = plt.bar(ind, deficient, width, color='red', bottom=correct)
p4 = plt.bar(ind, without, width, color="grey", bottom=deficient)

plt.ylabel('%')
plt.title('Qualite du rabattement par depart de train')
plt.xticks(ind+width/2., trains)
plt.yticks(np.arange(0,100,25))

plt.show()

My problem is that the documentation only show how to stack 2 bars. So, you have p1 (ideal) and p2 (correct) where bottom=ideal.

If I want to add a 3rd bar, I thought that putting for p3 bottom=correct (p2), that you draw it correctly, but the 3rd bar is drawn behind the first 2, and it's bottom value is p2.

My original data (fields are in French, but I translated them in the right order:

I tried using int() or..., but since my variables are lists.

What I'm trying to achieve is a 100% total each time as in :

Those are ok, but where made in Excel after a VERY tedious process than I'm trying to automate with a python script...


texts: QGIS 2.0 Table Join creates unwanted prefix in field names

texts:
I used to join shapefiles and CSV files via the "joins" tool in the layer properties just fine in QGIS 1.8.  Now I've updated to QGIS 2.0, and when I do the exact same thing, QGIS puts the name of the CSV source as a prefix in the field name: for example instead of just naming the field "area" it's now labelled "sourcefile_area".

I Googled it, and searched in the QGIS settings, but didn't find anything that helped, maybe I just don't know what exactly to search for though.


texts:
I'm trying to run CREATE EXTENSION postgis; on a fresh 9.3 Postgres.app install.

I get this as a return:

ERROR:  cannot change return type of existing function
HINT:  Use DROP FUNCTION st_approxsummarystats(text,text,integer,boolean,double precision) first.
********** Error **********

ERROR: cannot change return type of existing function
SQL state: 42P13
Hint: Use DROP FUNCTION st_approxsummarystats(text,text,integer,boolean,double precision) first.

So I tried to drop the function in question and run it again. It still can't get past this point. I am used to developing on Linux with a reqular Postgres install, so using Postgres.app is new to me.


texts: Python with GDAL and PostGIS as a replacement of ArcGIS

texts:
Few times ago, I worked with daily land surface temperature satellite images of an area with the size of Alaska.

I had to process around one thousand images. I downloaded them, mosaiced, projected, clipped to shapefile boundaries, extracted means out of the clipped rasters, and plotted the means on a time-temperature graph. The time-temperature graph was the final output.
I did all these in ArcGIS, and even though I created an ArcPy script which helped automating a part of the work, it was still painstaking.

Now I want to build a program that does the same thing, but 100% automatically. I merely want to input to the program the coordinates of the corners in order to define the area of interest and get the final output generated which is the time-temperature graph.

Do you think this is possible using Python with the GDAL library and PostGIS as a raster data store?


texts: OSMDroid android app zoom in without changing tiles, is it possible?

texts:
I am developing an android mobile mapping app using OSMDroid 4.3.  I have established a basemap using arcgisonline as my tile server.

String[] urlArray = {"http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/"};
mapView.setTileSource(new OnlineTileSourceBase("ArcGisOnline", null, 0, 16, 256, "",
        urlArray) {
        @Override
        public String getTileURLString(MapTile aTile) {
            String mImageFilenameEnding = ".png";
            return getBaseUrl() + aTile.getZoomLevel() + "/" + aTile.getY() + "/" + aTile.getX()
                    + mImageFilenameEnding;
        }
});

Tile server works fine.  When zooming in (level 14+), the tile set with satellite imagery has clouds that partially cover the ground.  I need to find out if it is possible to zoom in without changing tile set.

ZOOM level 13

FAKE zoom simulation
I would lose definition by "blowing up" tile imagery, that is a given, but it is perfectly ok for my purposes.


texts: GRASS's r.in.lidar error in QGIS 3: "North must be north of South"

texts:
I have LAZ files that I unpacked with laszip.exe, then I ended up with LAS files.

These files showed no error when making a LAS dataset in ArcGIS.
I used this dataset several times without ant issues.

But when trying to use r.in.lidar in QGIS, I get this error:

  ERROR: North must be north of South.

Since the files worked in ArcGIS, I am thinking this is a software or setup issue I have in QGIS.

I can't find that error message anywhere on the interweb.