texts: How to use a polygon as a symbology mask? QGIS 3.16.6

texts:
I have a Lakes layers which has a transparent fill, and a Rivers layer which (for the sake of its geometric network) flows "through" the Lakes layer. Like so:

I would like to use the Lakes as a symbology mask to mask out the Rivers so it looks like this:

I know for point layers you can set the symbology to mask use use that to mask out other layers, but is there a way to do that with polygon symbology? Ideally I could add another symbology layer to the Lakes layers and use that to mask out the Rivers.
I know I could do this by using a Difference function but I want to learn how to use polygons as masks because I could use that a lot elsewhere also.
I also tried using a virtual layer with an st_difference function but my knowledge of PostGIS is terrible so I didn't get far.
I also tried using a point pattern fill with large points set to mask but when I tried to use it as a mask in the Rivers layer it didn't work.
EDIT: Expanding on @Babel's idea, I could also set the River symbology to geometry generator using this expression: difference($geometry, aggregate('Lakes', 'collect', $geometry)) However I would really like to know specifically if there's a way of using polygons as masks.


texts: Replace a string with a variable inside a pgsql2shp command in Python

texts:
How to replace a string with a variable inside a pgsql2shp command in Python?

command = "pgsql2shp -f /test.shp  -h localhost -u postgres -P postgres gis_exercise  \"SELECT d.latitude, d.longitude, d.geom FROM country AS c, daily AS d WHERE ST_CONTAINS(c.geom,d.geom) AND c.iso3= 'BRA'\""

What I need is to replace the test (name of shapefile) with the variable row and also the string BRA with the variable row.

I have tried to use + in order to concatenate the strings but it doesn't work.


texts: Using Python to select random location from shapefile?

texts:
I have multiple shapefiles with bars names and location attributes and I want to create a script which asks the user for the area or shapefile name where they want to go and then prints a random location from inside that shapefile.

i am using arcGIS 10.2.2
writing the script on python win
I am new to Python.

here is the script i currently have... i was just trying to print all the names of the locations in this script but i am having trouble with the cursor. i know i do not need to do this to complete my final task...

import random

import arcpy

arcpy.env.workspace = r"G:\finalproject"

x = raw_input("Which nightlife area would you like to visit?")

fc = "2nd.shp"

fc2 = "4th.shp"

fc3 = "Downtown.shp"

fc4 = "LongBeach.shp"

if x == Second:

    cursor = arcpy.da.SearchCursor(fc, ["Name"])

    print "Bar Name: ", cursor

elif x == Fourth:

    cursor = arcpy.da.SearchCursor(fc2, ["Name"])

    print "Bar Name: ", row[0]

elif x == Downtown:

    cursor = arcpy.da.SearchCursor(fc3, ["Name"])

    print "Bar Name: ", row[0]

else:

    cursor = arcpy.da.SearchCursor(fc4, ["Name"])

    print "Bar Name: ", row[0]

del row

del cursor

My GIS skills greatly overpower my Programming skills.


texts: Assigning keyboard key to Python script in ArcMap?

texts:
I have a python script and I use it through my toolbox but I use it many times in a day.

Is it possible to assign a keyboard shortcut to my tool ?


texts: How to use QGIS tile server provider with local TMS folder

texts:
I just learned that QGIS 2.18 has a Tile Server (XYZ) provider in the Browser Panel. I created a large tile map using gdal2tiles and I'm trying to load it. However, I'm not publishing the tiles through a web server instead, I though about reading the files strait from the disk. So, in the Tile Server url I used file:///I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png. The tiles do not load and I see the following error in the log panel: Tile request max retry error. Failed 3 requests for tile 13 of tileRequest 2 (url: file:///I/SUL/rapid_tms_utm21/6/19/38.png).

So, the questions are:

Does QGIS Tile Server provider works with local files?
Can I use the file:/// protocol? How?

I tried the following lines as the TMS Server address:

file:///I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
file:///I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
/I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
/I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
file://I:/SUL/rapid_tms_utm21/{z}/{x}/{y}.png
file://I/SUL/rapid_tms_utm21/{z}/{x}/{y}.png

And the tiles work using the TileLayerPlugin


texts:
I have a working connection to an Oracle database in QGIS (3.4). I am able to import and edit existing tables into my QGIS project out of the db. Unfortunately it is not possible to export any QGIS layer into the Oracle DB.
Trying to export to Oracle via drag and drop in the file browser, I get following error:

  Failed to import some layers!
  Creation of data source "DATEN"."TEST_POINTLAYER" failed:
  Oracle error: Could not insert metadata.
  SQL: ORA-00932: inconsistent datatypes: expected MDSYS.SDO_DIM_ARRAY got CHAR
  Unable to execute statement
  Error: INSERT INTO mdsys.user_sdo_geom_metadata(table_name,column_name,srid,diminfo)
  VALUES (:a,:bb,:bc,:bd)

Another way to export layers to an oracle databse is the DB Manager. Trying to get my Testlayer into the db using the DB Manager causes a different error:

  Error 2
  Creation of data source "DATEN"."Test_Pointlayer" failed:
  Oracle error: Table creation failed.
  SQL: ORA-01741: illegal zero-length identifier
  Unable to execute statement
  Error: CREATE TABLE "DATEN"."Test_Pointlayer"("" MDSYS.SDO_GEOMETRY)

So is there a way getting my testlayer into the oracle db without getting an error? What am I missing?


texts: I am trying to create coastline of an area by joining about 20,000 points using Data Management Tool "Points to Line" in ArcGIS 10.1. But it seems that the inbuilt algorithm is not recognizing the order in which points have to be connected which results in creating some crazy disordered line. Is there a way to get it right? I have added the screenshots.


texts: Overwriting Feature Service with additional Layer in AGOL

texts:
I have a feature service published, new data daily which is in the form of an additional layer. I use the feature service in a webmap, but after the service is overwritten the additional layer is not added, I just delete the layer and re-add.

Is there a more elegant way of doing this?


texts: Which classification should I use for census data?

texts:
I am trying to map demographics data for a county in the UK based upon a combination of Census data. I want to compare the the averages for the county alone to the averages of the UK as a whole and display it using a sort of traffic lights symbology (red, orange, yellow, green, where red is way above average and green is way below average).

My problem is I'm not sure about what type of graduated symbology to use. Can someone please explain what Graduated Symbology is best to use in my situation?

I used Natural Breaks (Jenks) at first and was very happy with that but then I read on the ESRI website: "Natural Breaks (Jenks) are data-specific classifications and not useful for comparing multiple maps built from different underlying information." This makes me think using Jenks and then comparing the county averages to the national averages or comparing different categories (health data versus accessibility data) isn't appropriate.

So then I thought it would be best to use Equal Interval or Quantile symbology or define my own bands (split the results in four so I can assign colours to each 25%).

Any advice/help/information would be great.


texts: FileGDBAPI.dll not registering in Windows 7 x64

texts:
I installed GDAL via wheel (32 bit).  Added it to my system path. Also added an environment variable GDAL_DRIVER_PATH pointing at my gdalplugins folder (on my system, C:\Python27\ArcGIS10.4\Lib\site-packages\osgeo\gdalplugins). Rebooted.
At the prompt I tested it by typing
    gdalinfo --help-general
I received this:
    ERROR 1: Can't load requested DLL: C:\Python27\ArcGIS10.4\Lib\site-packages\osgeo\gdalplugins\ogr_FileGDB.dll
    126: The specified module could not be found.
It repeated this error twice.
Yet when I listed directory contents of C:\Python27\ArcGIS10.4\Lib\site-packages\osgeo\gdalplugins, I see two files:
ogr_FileGDB.dll and FileGDBAPI.dll (This is the Esri FGDB API dll I pasted in there)
I do notice that ogr_FileGDB.dll is much smaller than the Esri driver.  The ogr one is 181KB, whereas the Esri dll is 9,502KB.
What gives, any ideas?

UPDATE: I am reopening this question because I have followed all of the directions in the listed answer, and I still cannot get the FileGDBAPI.dll to register as an available driver.  Here is what I've done to this point:

Followed all the instructions in How to add support for FileGDB (Esri file gdb API) driver in fiona?
Ensured I have a GDAL_DRIVER_PATH environment variable and that it is pointing to C:\Python27\ArcGIS10.5\Lib\site-packages\osgeo
Ensured I have C:\Python\ArcGIS10.5\Lib\site-packages\osgeo in my PATH.
Ensured I have the FGDB API v. 1.3 (MSVC 2008), 32-bit DLL sitting in the C:\Python\ArcGIS10.5\Lib\site-packages\osgeo folder.
I installed Boundless Desktop 1.0, but its components do not have any presence in my PATH, PYTHONPATH or GDAL_DRIVER_PATH variables.
I have pip installed the GDAL 32-bit wheel for 2.1.3, but when I put in ogrinfo --version it yields GDAL 2.1.0, released 2016/04/25 which is incorrect - even though the only pointers for anything GDAL in my environment variables is pointing to the Python27\ArcGIS10.5 install.
ogrinfo --formats does not give me an error, but it simply fails to find the FileGDB driver.


texts: Fastest way to convert raster to polygon using R

texts: I am trying to convert my raster file to vector using R. I tried to do it with ArcMap but it is taking more than expected time. RasterToVector is also not working because the file is too big. Can anyone suggest a better command in R?


texts: How to Combine features in an attribute table based on an attribute

texts: I have a shapefile containing country boundaries for a number of countries in Asia. Many of these countries have hundreds of islands, so that overall there are other 2000 separate features in the attribute table, despite there being only around fifteen countries. The map I am making will show tiger populations and I am planning to shade the countries different colours according to where the population data was obtained from (data source). I was going to input this information on data source manually into a new field in the attribute table. Obviously it would be too time-consuming to do this manually for 2000+ features. Therefore, could someone please tell me if it is possible to combine all the features relating to a single country in the attribute table so I can therefore manually input the data source information once for each country? Or is there any other way someone would recommend to go about this?


texts: Is it possible to do parallel processing in GDAL and QGIS?

texts: It seems like processing a large raster dataset in QGIS can cause a crash, for example in QGIS failing to complete clip or intersect and crash dump in qgis. Is it possible to use GDAL parallel processing for a large raster dataset? Is there any example for this?


texts:
We are using QGIS Server to serve Oracle SPatial (11.2.0.4) to a spatial viewer. There is 16Gb of RAM. The number of concurrent users is 100-150.

QGIS Server is on Windows Server 2012 R2 with 16GB of RAM. Oracle is on Windows Server 2008 R2 with 8Gb of RAM.

We are having intermittent issues with the stability of QGIS Server.

Is anyone else using QGIS Server and Oracle Spatial and experiencing similar problems?
Error from Oracle log:

Thu Jul 14 08:18:46 2016
Errors in file E:\ORACLE\diag\rdbms\gisp\gisp\trace\gisp_ora_7876.trc  (incident=467230):
ORA-00600: internal error code, arguments: [kghssgfr2], [12], [], [], [], [], [], [], [], [], [], []
ORA-12571: TNS:packet writer failure
ORA-12571: TNS:packet writer failure
Incident details in: E:\ORACLE\diag\rdbms\gisp\gisp\incident\incdir_467230\gisp_ora_7876_i467230.trc
Thu Jul 14 08:18:58 2016
Errors in file E:\ORACLE\diag\rdbms\gisp\gisp\trace\gisp_ora_10724.trc  (incident=466160):
ORA-00600: internal error code, arguments: [kghssgfr2], [4], [], [], [], [], [], [], [], [], [], []
ORA-03135: connection lost contact
ORA-03135: connection lost contact
Incident details in: E:\ORACLE\diag\rdbms\gisp\gisp\incident\incdir_466160\gisp_ora_10724_i466160.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
opidcl aborting process unknown ospid (10724) as a result of ORA-600
Thu Jul 14 08:19:01 2016
Dumping diagnostic data in directory=[cdmp_20160714081901], requested by (instance=1, osid=10724), summary=[incident=466160].
Thu Jul 14 08:19:05 2016
Sweep [inc][467230]: completed
Sweep [inc][466160]: completed
Sweep [inc2][466160]: completed
Thu Jul 14 08:19:13 2016
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
opidcl aborting process unknown ospid (7876) as a result of ORA-600
Thu Jul 14 08:20:05 2016
Sweep [inc2][467230]: completed

QGIS Server error from log:

[Mon Jul 18 10:10:44 2016] [warn] [client 127.0.0.1] mod_fcgid: read timeout from pipe
[Mon Jul 18 10:10:44 2016] [error] [client 127.0.0.1] Premature end of script headers: qgis_mapserv.fcgi.exe
[Mon Jul 18 10:10:51 2016] [warn] [client 127.0.0.1] mod_fcgid: read timeout from pipe
[Mon Jul 18 10:10:51 2016] [error] [client 127.0.0.1] Premature end of script headers: qgis_mapserv.fcgi.exe
[Mon Jul 18 10:14:58 2016] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
[Mon Jul 18 10:14:58 2016] [error] [client 127.0.0.1] Premature end of script headers: qgis_mapserv.fcgi.exe </blink>


texts: Is it possible to leave a field null when using the calendar widget in QGIS?

texts: I'm creating and editing data with QGIS, the data is stored in a Spatialite database but I've run into this issue with shapefiles as well.  I have a field I'm storing dates in and I want to use QGIS' calendar widget to populate that field when there is a legitimate value to be stored for that record, otherwise I need the field to stay NULL.  The problem is the widget is populating the field with the current date by default.  There's no way on the data entry form to clear it out and leave the field NULL.  Am I missing something, perhaps a checkbox somewhere?


texts:
I managed to split all my line features (streets) with "Split lines with lines" tool. This tool splits lines at every intersection. I would like to add the information to the attribute table that which lines (streets) straddle lines. I would like to add this information to each and every line, so not doing it manually would be amazing. Maybe it was not the plainest way of explaining what I would like so I attach an image that might makes it easier to understand:

Is this possibe at all?


texts:
I'm trying to add a WFS layer in openlayers and it's not working. Can anyone point me in the right direction.

The data is stored in postgis and I've added it to geoserver. I am aware that I'm using port 8081 on geoserver but I can't forsee this being an issue. It would be useful to know where I'm going wrong.

Here is the code:

<!DOCTYPE html>
<script type="text/javascript" src="http://maps.nationalparks.gov.uk/resources/openlayers/OpenLayers.js"></script>
<script type="text/javascript" src="http://maps.nationalparks.gov.uk/resources/js/geotools2.js"></script>
<script type="text/javascript">

var map;

function init() {
map = new OpenLayers.Map('map_element', {});

var wms = new OpenLayers.Layer.WMS(
'OpenLayers WMS',
'http://vmap0.tiles.osgeo.org/wms/vmap0',
{layers: 'basic'},
{}
);

var world_cities = new OpenLayers.Layer.Vector("world_cities", {

                minScale: 15000000,
                strategies: [new OpenLayers.Strategy.BBOX()],
                protocol: new OpenLayers.Protocol.WFS({
                    url: "http://localhost:8081/geoserver/web",
                    featureType: "world_cities",
                    featureNS: "http://www.opengeospatial.net/cite"
                }),
                renderers: ['Canvas','SVG']
                })

map.addLayer(world_cities);

if(!map.getCenter()){
map.zoomToMaxExtent();
}
}

</script>
</head>

<body onload='init();'>
<div id='map_element' style='width: 500px; height: 500px; border-style:solid; border-width:5px;'>
</div>
</body>
</html>


texts: Rotating labels around point features at a given distance

texts:
I've to rotate labels dynamically around point features at a given distance (e.g. 10 map units):

Is there an option in the layer properties to do this?


texts: ArcMap's base map with imagery collection date

texts: How can I determine the collection date for ArcMap's base map with imagery? I'm using ArcMap 10.3.1


texts: Modifying Bivariate Moran's I /LISA to include self?

texts:
I am using GeoDa's Bivariate Moran's I function to examine patterns of
collocation between two variables at the county level (call them A and
B for now).

I know that, having run the analysis I can say things like "Counties
with a high value for A tend to have neighbors with a high value of B"

What I would rather say is that "Counties with a high value of A tend
to locate in regions with a high value of B" The difference being that
the latter would seem to include the county where A is high as well as
its neighbors, while the former includes only the neighbors.

I can see my way towards changing this--simply making every county its
own neighbor in the weights matrix, but I was wondering what kind of
havoc this would play on my values for I and the rest of the
diagnostics.

PS. If you happen to stumble on this identical question posted by me here:
https://groups.google.com/forum/?fromgroups#!topic/openspace-list/WUL1kQkenWo

please note that the answer I received was incorrect as was carefully pointed out by a rather irate reviewer.


texts:
Software: QGIS 2.18.19
Spreadsheet: Office Libre 5.3.4.2
GitHub Link: Bklyn

Update 1
@ben-w
I turned on Toggle Editing. When I tried to change datatype, I get error

Original Question
I wish to change datatype of column BBL of Bklyn_BBL.zip (the .dbf file) from Decimal to Whole Number.
When try in Office Libre I keep getting errors when I save

The QGIS Attribute table is not editable

Then went to QGIS I tried downloading Table Manager plugin to edit the attributes but I cannot find it under Processing > Toolbox
Please guide.


texts:
I have built a web site displaying a lot of line shapes, using GeoJSON, on a Leaflet map. This is working relatively well in most browsers, though speed could be improved. As usual IE8 is being the thorn in my side, originally it was not known that IE8 would be a requirement of this project.

I currently cannot get the GeoJSON lines to display on my large searchable map. The lines should display after a couple zooms. Leaflet is not throwing an error, the lines just aren't visible. Has anyone else experienced such an issue, or have an alternative to GeoJSON layers for IE8?

My current set-up is a MySQL database with spatial data from a shapefile, which is then converted into GeoJSON, for Leaflet to render.


texts:
I've installed the qgis on ubuntu 12.04 following the instructions on http://hub.qgis.org/projects/quantum-gis/wiki/Download. I am trying to test the Python API and try to do the follwoing

from qgis.core import *
layer = QgsVectorLayer("coast.shp", "coast_shp", "ogr")

But layer.isValid() returns false. Any ideas why it might happen?


texts: Mapping negative percentage values from *.xls table in QGIS?

texts: Trying to map some negative percentage values in QGIS. Working with a .xls table and importing this as a vector file to QGIS, then joining the file with a shapefile. Have converted negative percent values "to real" and any leading zeroes have been eliminated. Despite this, after the conversion "to real" in the field calculator, the attribute table shows a column of single zeroes in place of my negative values. Cannot convert to integer, as the loss of precision would mess up everything.


texts: TypeError: featureLayer.fields is undefined from ArcGIS API for JavaScript

texts:
When working with the ArcGIS API for JavaScript, I have been getting an error in FireBug when trying to execute the following script:

var featLayerURL = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/AssessorsLiveLayers/MapServer/1";
var featLayer = new esri.layers.FeatureLayer(featLayerURL);
alert(featLayer.fields.length);

The error returned is:

  TypeError: featLayer.fields is undefined.

At first I thought it was something wrong with one of my server's layers, but after using that sample server and getting the same error, I'm sure there is something else wrong.

Here is a link to the REST response: Layer: Recorded Tax Parcel Sales (ID: 1).


texts: Calculating roughness index of multiple LAZ files with lidR

texts:
How do I calculate a surface roughness index of multiple lidar point clouds with lidR rumple_index?
library(lidR)

files <- list.files(path= "/pathToFiles", pattern= "*.laz", full.names = TRUE, recursive = FALSE)

O = lapply(files, function(x) {
las = readLAS(x, select = "xyzc", filter = "-drop_z_below 0")
  chm = grid_canopy(las, 0.2, p2r())
  roughness <- rumple_index(chm)
  return(data.frame(file=x,roughness=roughness))
})
O = do.call(rbind,O)

However this code returns error:
    Error in C_rasterize(las, layout, subcircle, 1L) :
  C++ unexpected internal error in 'rasterize': point out of raster.
In addition: Warning message:
In showSRID(SRS_string, format = "PROJ", multiline = "NO") :

If I run the following code for a single file, it gives reasonable result.
las = readLAS("/input.laz", select = "xyzicnrRGB", filter = "keep_first -drop_z_below 0")
chm = grid_canopy(las, 0.5, p2r())
rumple_index(chm)

I found the file which was causing this error, below is a lasinfo report of that file.
lasinfo (190812) report for 'infile.las'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            0
  project ID GUID data 1-4:   00000000-0000-0000-0000-000000000000
  version major.minor:        1.4
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las (version 190623)'
  file creation day/year:     0/0
  header size:                375
  offset to point data:       469
  number var. length records: 1
  point data format:          6
  point data record length:   30
  number of point records:    0
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.00025 0.00025 0.00025
  offset x y z:               698292.56999999995 6104003.0700000003 0
  min x y z:                  698607.00800 6102989.34350 -0.03375
  max x y z:                  698698.55000 6103195.27825 19.08325
  start of waveform data packet record: 0
  start of first extended variable length record: 0
  number of extended_variable length records: 0
  extended number of point records: 363189
  extended number of points by return: 363189 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 1:
  reserved             0
  user ID              'LASF_Projection'
  record ID            34735
  length after header  40
  description          'by LAStools of rapidlasso GmbH'
    GeoKeyDirectoryTag version 1.1.0 number of keys 4
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 3072 tiff_tag_location 0 count 1 value_offset 28355 - ProjectedCSTypeGeoKey: GDA94 / MGA 55S
      key 3076 tiff_tag_location 0 count 1 value_offset 9001 - ProjLinearUnitsGeoKey: Linear_Meter
      key 4099 tiff_tag_location 0 count 1 value_offset 9001 - VerticalUnitsGeoKey: Linear_Meter
reporting minimum and maximum for all LAS point record entries ...
  X             1257752    1623920
  Y            -4054906   -3231167
  Z                -135      76333
  intensity           0      42532
  return_number       1          1
  number_of_returns   1          1
  edge_of_flight_line 0          1
  scan_direction_flag 0          0
  classification      1          1
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
  gps_time 164539.903446 168324.056522
  extended_return_number          1      1
  extended_number_of_returns      1      1
  extended_classification         1      1
  extended_scan_angle             0      0
  extended_scanner_channel        0      0
number of first returns:        363189
number of intermediate returns: 0
number of last returns:         363189
number of single returns:       363189
overview over extended number of returns of given pulse: 363189 0 0 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
          363189  unclassified (1)

I am using lidR_3.0.1   raster_3.1-5 sp_1.4-2


texts:
I'm having a problem when trying to convert "Polygon to Raster (folder)" on ArcGIS 10.5 ( SDM Toolbox v2.3).

Why are all output rasters much smaller than the input polygon?


texts: ArcGIS API for Python: Parameter Invalid - Item with the same key has already been added

texts:
I'm trying to update an ArcGIS Online (AGOL) feature layer using an updated local CSV file (the steps for this process are detailed in this Sample Notebook). I am using Jupyter Notebook to handle all the code. Here is the code I am running:

csv2 = sql2CSVout
updates_df_2 = pd.read_csv(csv2)

fl = featureLayer.layers[0]
flquery = fl.query()

overlap_rows = pd.merge(left - flquery.sdf, right = updates_df_2, how = 'inner', on = 'FID')

updatefeatures = []
all_features = flquery.features

for fid in overlap_rows['FID']:
    original_feature = [f for f in all_features if f.attributes['FID'] == fid]
    [0]
    ftbu = deepcopy(original_feature)
    matching_row = updates_df_2.where(updates_df_2.FID == fid).dropna()
    input_geometry = {'y':float(matching_row['Y']),
                      'x':float(matching_row['X'])}
    output_geometry = geometry.project(geometries = [input_geometry],
                                       in_sr = 4326
                                       out_sr =  flquery.spatial_reference['latestWkid'],
                                       gis = gis)

    ftbu.geometry = output_geometry[0]
    ftbu.attributes['BUILDINGID'] = matching_row['BuildingID'].values[0]
    ftbu.attributes['Classrooms'] = matching_row['Classrooms'].values[0]
    ftbu.attributes['Descriptio'] = matching_row['Description'].values[0]
    ftbu.attributes['TypeCode'] = matching_row['TypeCode'].values[0]
    ftbu.attributes['FID'] = int(matching_row['FID'])
    ftbu.attributes['Email'] = matching_row['Email'].values[0]

    updatefeatures.append(ftbu)

fl.edit_features(updates = updatefeatures)

Running this section of code has given me no issue until yesterday. After running the edit_features method, a syntax error threw an error later in the script. After fixing the syntax error, I tried to rerun the script in Jupyter and was given the following error:

Runtime Error: Cannot perform operation. Invalid operation parameters.
'updates' parameter is invalid
An item with the same key has already been added.
(Error Code: 400)

I'm not sure where the issue lies. I've tried restarting the Jupyter kernel to no avail. I've checked for any created feature layers or collections on ArcGIS Online that could be considered "the same key" and there's nothing. I even used xmode to raise verbose error messages to view the exact inputs for edit_features method and while I did get those, it still doesn't work.

I feel like it has something to do with an ArcGIS connection somewhere and edits are apparently stored there before being applied and those stored edits need to be erased so that this script can work, but that feels like a guess.

Anybody got any ideas what to do?


texts: How to select polygons by criteria and save them to shp file?

texts:
I have file of polygons  and want to select few by criteria  - area more or less then specific number    and save   result to  shp file.

code  gives 0   by passing criteria:

from osgeo import ogr, gdal

shpFile = 'ReBu.shp'

driver = ogr.GetDriverByName('ESRI Shapefile')
ptsDS = driver.Open(shpFile)
ptsLayer = ptsDS.GetLayer()

for i in range(0, ptsLayer.GetFeatureCount()):
    pt = ptsLayer.GetNextFeature()
    print pt.GetField('Area_ha')

myQuery = 'Area_ha = 39.8953'
ptsLayer.SetAttributeFilter(myQuery)


texts:
I'm having some problems using IfieldChecker.

I have this following code, which I'm trying to test permitted/not permitted fields, according to my workspace

public IEnumerable<IFieldError> GetFieldErrors()
        {

        IFieldChecker checker = new FieldCheckerClass();
        IEnumFieldError fieldErrors = null;

        checker.ValidateWorkspace = this.WorkspaceHandler.GetCurrentWorkspace;
        checker.Validate(this.Fields,out fieldErrors,out this._ValidatedFields);

        if (fieldErrors == null)
        {
            yield return null;
        }
        else
        {
            fieldErrors.Reset();
            IFieldError fError = fieldErrors.Next();

            while (fError != null)
            {
                // debug only
                Console.WriteLine(fError.FieldIndex.ToString());
                Console.WriteLine(fError.FieldError.ToString());

                yield return fError;
                fError = fieldErrors.Next();
            }
        }

        yield break;
    }

Heres the test

    [TestMethod]
    public void FieldBuilder_TestGetFieldErrors()
    {
        fBuilder = new FieldBuilder(this.wHandler);

        fBuilder.AddField(name, alias, esriFieldType.esriFieldTypeBlob, length, doublePrecision, doubleScale, false, false, null,
            false, null);

        Assert.AreEqual(2, fBuilder.GetFieldErrors().Count());
    }

In my opinion, this should yield 1. The test completes, and it gives me a green light, but it should fail, since I'm testing with a bunch of values (1, 2, etc.);

The workspace I'm creating is one on C:\, therefore, should not allow a Blob field type.

Any ideas why this is working like this?

EDIT: I'm working under the premise that after setting the workspace, ArcObjects would take care of validating it and telling me which types of fields are permitted or not.

Example: FileSystemWorkspace - cannot have Blob field types;

Or, does IFieldChecker does not work the way I'm thinking?


texts:
i tried to merge several polygon into one using "merge selected features" but it's look not perfect because there are some lines left as residual. can anyone help me to solve my problem.
i am using QGIS 2.14 Essen

The yellow polygon is one, but there are some lines which looks like separated them. and when i open the shp file in arcgis the line still appears


texts: What practices are available for modelling land suitability?

texts:
I currently use a "classic" raster based approach of dividing a study area into cells. All input layers are converted to rasters at the same cell resolution and given a suitability rating.

A final suitability rating for each cell is calculated by combining each layers rating, with weightings to reflect the factors importance.

A final mask is applied to exclude any areas, such as waterbodies, that are unsuitable for the proposed land use.

Problems with this approach include:

choosing a cell resolution that is either to large to provide meaningful results, or a high resolution giving a false sense of accuracy.
finding weightings for each of the input parameters.

Are there any other problems or alternatives to producing land suitability maps?


texts:
I'm having a problem with a process model I'm building.

The process is as follows;

A series of float img files are iterated and converted to raster files .img

These files are then run through the raster calculator and saved as a file %Name%_100.img

The 100.img files are then run through a Int math tool and saved with the suffix _Int_100.img

ok so here's the bit that the model falls over at - I need to clip these Int_100.img files using their respective shapefiles ie riverbody1A_Int_100.img needs to be clipped with the corresponding riverbody1A.shp file (also the use input features for clipping parameter needs to be used) and the same for each file ran through the process.

These clipped files are then converted from raster to polygon

Is this something that can be done with iterators & model builder?

Am I on the right track or do I need to start over?

The main problem i seem to have is that nested models with iterators in them seem to just iterate their files all at once, instead of iterating one file per run of the entire model

Is this a bug or am I just not using iterators and nested models the right way?


texts: Converting GeoTIFF into KMZ image using GDAL_translate returns empty, all black image

texts:
GDAL
I have installed gdal in the following way:
conda create -c conda-forge -n mygdalenv gdal python=3.6
on Ubuntu 18.04.2 LTS.
Input GeoTIFF
I have a GeoTiff image. The result of gdalinfo input.tif is:
Driver: GTiff/GeoTIFF
Files: input.tif
Size is 10455, 13254
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]],
    USAGE[
        SCOPE["unknown"],
        AREA["World"],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (41.462915653613621,37.384259792199842)
Pixel Size = (0.000125314982135,-0.000125314982135)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_IMAGEDESCRIPTION=input
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  41.4629157,  37.3842598) ( 41d27'46.50"E, 37d23' 3.34"N)
Lower Left  (  41.4629157,  35.7233350) ( 41d27'46.50"E, 35d43'24.01"N)
Upper Right (  42.7730838,  37.3842598) ( 42d46'23.10"E, 37d23' 3.34"N)
Lower Right (  42.7730838,  35.7233350) ( 42d46'23.10"E, 35d43'24.01"N)
Center      (  42.1179997,  36.5537974) ( 42d 7' 4.80"E, 36d33'13.67"N)
Band 1 Block=10455x13254 Type=Float32, ColorInterp=Gray

Conversion to KMZ
I then try to convert it into a KMZ, in the following way:
gdal_translate -of KMLSUPEROVERLAY input.tif output.kmz
Issue
The conversion is super fast (too fast I would say) and always results in a 4.5MB file, while the input is 500MB.
When I visualize the KMZ file in Google Earth Pro (simple drag and drop), the image is correctly located, but is just a black rectangle.
Any help on what step I am doing wrong/forgetting?


texts: How to change the appearance of a Feature.Vector that's already displayed?

texts: I've created a bunch of Feature.Vectors from Point objects and assigned them a Style.  Now I want to dynamically change the appearance of one of the features in real time; e.g., change it from red to blue.  (I am NOT hovering over the feature.)  I've tried changing its Style, then doing refresh() on the layer, or redraw(), etc, and either nothing happens or the feature disappears.  Any suggestions?  Thanks.


texts:
I have few sample points with values on (agricultural) field and I want to interpolate and extrapolate values inside the field boundary.
Ideally I would like to use Kriging (as it smooths local extrem values). I can't use all point to make one big raster and then clip out every polygon, but I need to calculate separate raster for every single polygon.
Is there please any tool or plugin to extrapolate values within polygon boundary? It was asked before, but there were no sufficient answer.


texts: Layer added but not displayed until i turn off then on in LayerSwitcher

texts:
I'm using OpenLayers to add a WFS layer. It works fine when i add it to init() function. But when i add the code to a function that is called by a button, layer gets added, but it does not display. It only displays if i uncheck and recheck the layer in the LayerSwitcher control.

I tried different things like the display and drawFeature funtions but they didn't work for me. IE:

wfs.display(true);

What can i do to Add AND DISPLAY my wfs layer?

here is my test code:

    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" href="../js/OpenLayers/theme/default/style.css" type="text/css" />
    <link rel="stylesheet" href="style.css" type="text/css" />
    <title>WFS: GetFeature Example (GeoServer)</title>

WFS Test

WFS, GetFeature

    Shows how to use the GetFeature control to select features from a WMS layer.

   <input id="cmdAddLayer" type="button" value="button" onclick="AddResultsLayer(); return false;" />


texts: Blend overlapping DEMs using Open Source / Python

texts:
I'd like to blend edges of overlapping DEMs such that the join is a smooth transition (for use with InSAR).  Apparently the best interpolation kernel for this, according to the literature, is thin plate spline.  Note that I don't want a blended image of the data (such that gdaldem might produce), I want to blend the actual data values themselves.

I had hoped gdalwarp's -cblend option might do it, but my testing shows that it seems to be a masking tool.

I realise that I could write a wrapper around scipy libraries to do this, but maybe someone has already done it?


texts: Looking for boolean intersection of small table with huge table

texts:
How can I quickly check to see if a polygon(or whatever) intersects anything in a massive table? I'm trying to find polygons that don't intersect with the North American street network at any point. Most of my polygons do intersect. My street network (a routeable edge table) has almost 50 million edges, and obviously, I shouldn't have to check each polygon for intersection with each of them. If any street at all intersects a polygon, there is no need to keep checking that polygon and the intersect operation should return true.

Is there any postgis function that can prevent this query from taking time on the order of N(table1) X N(table2) ?

Here is the query as I currently have it:

SELECT
    msa.uid, -- unque identifier for grid cells
    bool_or( ST_Intersects( msa.the_geog::geometry,na.way ) )
FROM
    na_network AS na, -- ~ 50,000,000 lines
    msa_grids AS msa
WHERE msa.msaid = 10180 -- limits to ~ 500 grid cells
GROUP BY msa.uid

EXPLAIN gives:

HashAggregate  (cost=7911120376.04..7911120382.88 rows=684 width=256)
   ->  Nested Loop  (cost=0.00..361428549.44 rows=28760730768 width=256)
         ->  Seq Scan on na_network na  (cost=0.00..1903179.52 rows=42047852 width=124)
         ->  Materialize  (cost=0.00..16237.03 rows=684 width=132)
               ->  Seq Scan on msa_grids msa  (cost=0.00..16233.61 rows=684 width=132)
                     Filter: (msaid = 10180)
(6 rows)


texts: How to return WKT of entire polygon with shapely?

texts:
Im learning to use shapely and have two shapefiles--forest, and basins. The two shapefiles clearly intersect (basins is completely within forest). But the way I've gone about it only gets the feature at index 0 of each shapefile, which don't intersect. I know where this is taking place in the script, but how do I get the whole polygon shape as wkt instead of just one record? Do I build a list of the wkt geometry one record at a time?

# Basins shapefile to wkt
basins = ogr.Open("data/Basins.shp")
basins_layer = basins.GetLayer(0)
basins_feature = basins_layer.GetFeature(0) # This is the line
# I'm thinking there should probably be a loop here to get the geometry of the whole shapefile
basins_geometry = basins_feature.GetGeometryRef()
basins_wkt = shapely.wkt.loads(basins_geometry.ExportToWkt())

How do I loop through the whole shapefile and build the outer polygon as wkt or is there another function to get the outer boundary of the shapefile? I guess this is called the outer ring. I want wkt of the whole shapefile exterior, rather than the individual polygons that make it up.


texts:
I'd like to convert the following for updating my spatial_ref_sys table.

PROJCS["USA_Contiguous_Albers_Equal_Area_Conic_USGS_version",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]

The matching spatialreference.org/ref/sr-org/6703 link for this item seems to come up blank. Also, tried gdalsrsinfo but it errored with ERROR 6: No translation for Albers to PROJ.4 format is known.

How do I translate the above for that field? Any other tools to get a full, proper INSERT statement for inserting the proper data into spatial_ref_sys?

UPDATE: The above data comes from the 2 PRJ files found in http://www.america2050.org/maps/, third link to the ZIP files. I would like to import these maps into my database to run queries against some data.


texts: Clipping of a Raster changes Range of Cell Values

texts:
I'm facing a strange problem. I created a mosaic of two landsat scenes which contains values from ~ -5 to ~11 (Biomass estimation). As my study area is much smaller then the mosaiced Landsat8 scenes, I want to cut the mosaic with a given forest mask shapefile (containing approx 10000 polygons). I just did it with QGIS 2.8 Wien like in several tutorials explained (Raster -> Extraction -> Clipper). It then starts calculating for quite some time, and in the end I get a raster but with values which doesn't make any sense (they are now ranged from 3.4e30 - 3.8e28) and the resulting raster is completely white.
I tried it several times with slightly different options, but still the same.

I just have no idea, why it changes any values.
Anyone got an idea, how to simply cut the raster into my shapefile without it changing the values?

I uploaded the raster and the shapefile here, if you want to try it yourself.

http://www.filedropper.com/forest-areadata

http://www.filedropper.com/rastermerged43

edit:

checked the spatial extend, they are both in the same datum (UTM 34N,
WGS 84).
I also checked the data histogram of the clipped ( but basically
white) raster, and tried reclassifying it, but still doesn't make
sense (and why would it change the data values of the pixels in the
first place?)


texts:
I am a bit stuck at the moment, I have a c# addin, which as part of one the methods, contains SavefileDialog object. The code also contains a Timer. The steps for the user is:

Click on the map
Geometry is drawn
Map is refreshed
The   timer waits for 5 seconds to elapse (enough time for the map to be  refreshed)
A dialog box appears that asks the user a question
If they select yes, the SaveFileDialog object appears.

It seems when that just before the SaveFileDialog appears I get the following error

  Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.

Where in my code do I place [STAThread] attribute as I do not have a Main function. The addin is a toolbar and one button.


texts: QGIS2WEB Error when exporting to Leaflet/OL3

texts:
I am having all kinds of problems with the QGIS plugins for exporting my map to Leaflet or OL3. Whenever I try to preview my project I just get a white screen with nothing. Then when I try to Export to Leaflet I get an error that doesn't allow me to do it saying:

TypeError: writeLeaflet() takes exactly 19 arguments (18 given)

I just don't know what to do, I have searched online to find help with this and I can't find anything.


texts: v.what.rast.points: What to fill in as 'WHERE' conditions?

texts:
In order to extract raster values in QGIS I want to use the grass command v.what.rast.points in the toolbox. But the process won't start - it claims: "Where conditions of SQL statement without 'where' keyword".
What am I supposed to fill in?

Another problem: I created an extra attribute column for the extracted values to be stored in (type: string; length: 7) , but it won't show in the selection tab of the v.what.rast.pints tool. Only the ID field can be chosen.


texts: PyQgis Show a HTML frame in canvas from a plugin button

texts:
I am using PyQGIS to request a JSON and showing some data of that file, formatted according with some conditions, in a window in QGIS using a button in a plugin.
I have thought of using a HTML frame (not a map tip) with the formatted data or a modal window with a HTML frame, but I don't know if it is possible.
Is it possible to show a HTML frame in canvas using PyQGIS?


texts: Converting ArcGIS layers into .kml for Google Earth?

texts:
I'm trying to convert an ArcGIS layer into a .kml format so I can use it in Google Earth. I've found several tutorials for this, but none of them have been helpful so far. They seem to be for an older version of ArcGIS, where the "Toolbox" drop-down menus provide a list of tools, one of which will perform the conversion. In my version (10.3), the "Toolbox" menu only gives me options for adding a new toolbox, opening a new toolbox, and opening a new Python toolbox. The ArcGIS support docs only give me lines of Python code which I presumably can use somehow, but I don't know Python.

How can convert this layer to .kml?


texts: Python script output to console doesn't update beyond first page in QGIS

texts:
I'm debugging a python script that includes a Print statement. I'm running the script from the QGIS python editor and expecting to see output in the QGIS python console, however once the script has filled the console window rather than scrolling up with each print statement the console window no longer updates and I have to wait until the script has finished before I can see the output of my Print statements. Is there a way I can make the console scroll with each Print statement so I can see the output of the statements as they are processed rather than having to wait until the end.

I'm using QGIS 3.4.12 on Windows 10.


texts: QGIS icon becomes a "blank sheet" in windows taskbar

texts:
Is it just for me that icon for QGIS appears like a "blank sheet" on the Windows taskbar like this:

... after some time or "heavy work" (haven't 100% understood when it happens).

Currently running: QGIS 3.4.5 on Windows 10 x64, I assume that this is some kind of Windows feature, anyone else that experienced this and solved it?


texts:
I am trying to add a geometry column to an existing table in PostgreSQL inside a plpgsql function using

EXECUTE format('ALTER table %I add column geom geometry(Point, 102003)', target_table);

Its raising an error "type "geometry" does not exist".

There is PostGIS extension installed in the database which I am running. Only thing is my table are not in public schema.


texts: Point feature plots in wrong place in QGIS?

texts:
I am using QGIS 2.12 on Mac OS X Yosemite 10.10.5.

I have a single point with given latitude and longitude. I want to create a new vector layer (shapefile) which will plot one point on the map canvas at the specified latitude and longitude.

I have tried importing a comma-separated values (CSV) table, with a single record (my desired point). It does plot a point, but not in the right place.
I have tried "drawing" a new point at any old location by clicking, with the idea of moving it to the exact latitude and longitude by use of the Node Tool. However, it doesn't seem to work. I can Zoom to Layer on the point layer, but it is nowhere near where I reckon it ought to be. The coordinate reference system of all the layers, and of the project, are the same (WGS 84).


texts: Google satelite does not display with QGIS 3.16.1

texts:
Since I install QGIS ver 3.16.1 the Google satellite XYZ tile does not display.
The URL I use is the http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}
I have no problem with OSM https://tile.openstreetmap.org/{z}/{x}/{y}.png
or Google Hybrid, http://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}


texts: ArcGIS Desktop:Transformations: Geographic vs Projected?

texts:
Arc10. I have two data sets (both CSV files w/ lat and long columns) and I am working on standardizing them to the same projection.
File1: NAD27; File2: NAD27, WGS84, and NAD83. I would like all of the data to be in NAD83.

Step 1: I started my map by adding a layer that I know is in NAD83

Step 2: I added File1 and File2 (one at a time based on what the projection is). I attempted to transform all of the NAD27 and WGS84 data into NAD83, using Toolbox->data management tools->projections & transformations->project. I did not do anything to the NAD83 data points from File2 since they are already in NAD83.

Step 3: I then used data management->Features->add xy coordinates, so that I would have the new coordinates (based on NAD83) in the table and I can export to Excel and then import it to Access, produce queries, and map everything in the same projection.

The points in File1 have a 1:1 relationship with the points in File2. The problem is that I expected my points in File1 and File2 to map closer together once they were in the same projection. Instead, many of the points are further away from each other. I can't figure out what I did wrong. I wonder if this has to do with using geographic projections vs. using a projected coordinate system. I don't recall which I used, only that I searched for North American 83 and chose that.

Any ideas?


texts: I exported the classified land classes of my work. The image appears to be greyscale despite the pixels in the original classification. Is there any way to export the classified images with colors and not greyscale


texts: Installing QGIS Server on existing Apache/PHP on Windows 10

texts:
Using OSGeo4W installer, I installed QGIS server while having already Apache/PHP on my computer. And I got this message: The requested URL was not found on this server when I tested the QGIS Server configuration by typing:
http://localhost:8080/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

This is the tutorial I followed: https://www.sigterritoires.fr/index.php/en/how-to-install-qgis-server-in-windows-10/
After installing QGIS server and configuring the httpd.conf as instructed in that tutorial, and also going through various FAQ on the related matter as well, I couldn't fix the problem and still have that error message.
Here is my httpd.conf file with the changes made:
Define SRVROOT "C:\Webserver\Apache24"

ServerRoot "${SRVROOT}"

Listen 8080

ServerAdmin admin@localhost

ServerName localhost

<Directory />
    AllowOverride none
    Require all denied </Directory>

DocumentRoot "C:\Webserver\Apache24\htdocs"

<Directory "${SRVROOT}/htdocs"> <IfModule dir_module>
    DirectoryIndex index.php index.html </IfModule>

ScriptAlias /qgis-ltr/ "C:/OSGeo4W64/apps/qgis-ltr/bin"

<Directory "C:/OSGeo4W64/apps/qgis-ltr/bin">    SetHandler fcgi-script
    AllowOverride All
    Options ExecCGI
    Require all granted </Directory> AddHandler cgi-script .cgi .pl .exe

Include conf/extra/httpd_qgis.conf

Include conf/extra/httpd-vhosts.conf

PHPIniDir "C:/Webserver/php7" LoadModule php7_module "C:/Webserver/php7/php7apache2_4.dll" AddHandler application/x-httpd-php .php

LoadFile "C:/Webserver/php7/libpq.dll"

SetEnv GDAL_DATA "C:\OSGeo4W64\share\gdal" SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis-ltr\resources" SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37" SetEnv PYTHONPATH "C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts" SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem” SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis-ltr" SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\qt4\plugins"

RewriteEngine On RewriteRule ^/proxy/(.+)$ /gisapp/admin/qgisproxy.php?map=$1.qgs [QSA,PT] RewriteRule ^/gisapp/([^\.]+)$ /gisapp/index.php [PT]

Apache Version: Apache/2.4.43 (Win64) mod_fcgid/2.3.9 OpenSSL/1.1.1g PHP/7.4.7;
QGIS Desktop and QGIS Server version 3.14.15;
QGIS-LTR-Server version 3.10.9


texts: QGIS multiplying one column of attribute table with another

texts: I have population data for european countries, and a random rate attached to that population data. Is there a way to multiply my population data with that rate within the attribute table?


texts:
I need to import some OSM data about a region of Italy into a SHP file or Postgres DB, possibly with batch process.

I already use OGR2OGR to batch import data from SHP to Oracle and Postgres and I know that the tool supports many other formats. I would like to know where I can find a compiled version of OGR2OGR that support OSM/PBF data and how I should use it.

I was looking at FWTools but on the site documentation I cannot see anything about OSM/PBF support.


texts: How to create spider diagrams (hub lines) in PostGIS?

texts:
I'm rather new to PostGIS but I have done a lot of reading.  One thing that I have been searching for is a function that allows users to create a "spider diagram" (also called "desire lines" or "hub lines") in PostGIS.

As an example, draw lines from a grocery store (point) to all geocoded customer addresses (point) of that grocery store.  Of course, though, imagine that there were hundreds of stores and thousands of customers.  I would imagine that each store would have a unique ID that each customer point would have embedded within a field so that the software knows the origin-destination connection.

Is there a simple ST_ function that will accomplish this task, or does this require combining multiple queries to accomplish the task?


texts:
I want script in python3 with QGIS 3?

For example:

This code create a layout 2019_A4 and add Layout Manager. I need a code make same in QGIS3 using QgsLayoutManager with Methods duplicateLayout

Here: https://qgis.org/pyqgis/3.4/core/QgsLayoutManager.html

from qgis.PyQt.QtCore import *
from qgis.core import *

# A Project, Manager, & PrintLayout Classes
project = QgsProject.instance()
manager = project.layoutManager()
# layout = QgsPrintLayout(project)
layout = manager.layoutByName("2019_A4")
#layout.initializeDefaults()
#layout.setName('2019_A')
manager.addLayout(layout)


texts: Convert a UK postal code to a city name?

texts: Is there any service to convert a UK postal code to a city name? Does one postal code always map to one city, or to more than one? Is there a free web service to do this conversion for me?


texts: How to set width and height of a polygon in QGIS

texts:
I can't set the width and height of a polygon

How to do that in QGIS?


texts: In OpenLayers 6, remove or rub drawing features like any photo editing application

texts:
I am working on application where user can do drawing and change color, stroke, fill and perform undo, redo.
One feature is user should have option to rub/remove features like Photoshop or paint.
Currently OpenLayers provides a functionality of removing the whole feature. For example, if I want to remove a circle, I click on rubber and then click on circle. It will get remvoed.
But the requirement is a rubber should be like freehand and user should rub some parts of circle/any drawing or fully remove it.
I am thinking of using image instead of vector layer.
After looking into the OpenLayers 6 API, it comes with VectorImage and drawing is working fine with that but I am not sure if this is achievable easily or I have to do it in a complex way by detect the click and feature and breaking down the feature but in that case user can rub a single circle into 100s parts so I am not sure about that too.
I have not started implementing this feature so no code yet. I am just thinking of where and how to start.


texts: How do I make a file dialog for a custom forms that does the same thing as the autogenerated URL selector?

texts:
I used QT Designer to build a custom form for attribute entry. One of the attributes is for storing a file path of a permit document as a string. With the auto-generated forms, there was a URL selector which worked fine. However, I can't seem to figure out how to do the same thing with my custom form UI that I made in QT designer. As it stands right now, users will have to manually enter the file path by copy and pasting but ideally I would like to give them the same functionality as the dialog box that appears when you use the url selector.

I looked around at QFileDialog but most of what I get is form coding in applications and I'm not sure how to finesse it into working with a layer form UI.


texts:
I have published a wms using the QGIS Cloud and on top of it I am overlaying the same data (countries of Europe), using GeoJSON. Have a look at an example here: http://jsfiddle.net/j21kh7ao/
At a low zoom level, the geometries don't overlap 100%. When zooming in, the differences start to disappear.

Any idea why this happens? To me it seems Leaflet is using some zoom based generalization for the geojson, could it be possible?


texts: Knowing byte address and byte length of "strip" in LZW-compressed GeoTiff with vanilla PHP?

texts:
I have a situation where I need to read cell values from a GeoTiff using vanilla PHP, and while I've been successful reading values from an uncompressed TIF (~800MB), I'm having difficulty reading values from the same TIF after LZW compression (~80MB).

I believe my trouble stems from knowing the byte address of a "strip" and the number of bytes belonging to that strip--as my understanding of LZW is that the decompression routine needs an entire strip, which it uses to create a translation table relative to that strip, before individual cell values represented in that strip can be interrogated.

Here's how I'm interpreting the TIFF spec: I can read the bytes for any "strip" by starting at the Strip Offsets tag value (fyi: my RowsPerStrip tag value is 1), and getting the offset for the exact scanline I'm targeting like this:

$stripOffset = $STRIP_OFFSETS + ($rowNum * 4); // i.e. 2 bytes per entry

Then, to get the number of bytes I need to read ahead for my target strip/scanline, I do the same thing against the StripByteCounts tag:

$stripByteCount = $STRIP_BYTE_COUNTS + ($rowNum * 4); // also 2 bytes per entry

With these values in hand, I thought I could then extract the entire strip

// Open the tiff file and point at the strip's byte address..
fseek($this->fp, $stripOffset);

// Read N bytes from the strip's byte address
$stripBytes = fread($this->fp, $stripByteCount);

// THESE BYTES SHOULD BE THE WHOLE STRIP, yes?
$strip_data = unpack('Vstrip_data', $stripBytes);

However, it seems like I'm getting more than one strip's worth of data--as what comes back begins with, and has several reoccurring instances of 128 in it, which should represent the so-called "ClearCode" mentioned in the spec.

  "The first code written is a ClearCode, which is defined to be code
  256."

So my impression is that I'm either not correctly understanding how to evaluate a strip/scanline's byte address and/or byte count ..or ..I don't know!?! :) ..it's important to stress that, what comes back indeed starts with 128, which I am relatively certain is that ClearCode value. So I suspect I'm hitting the start of a strip, I'm just not grabbing a correct number of bytes.

Am I properly evaluating the byte address and number of bytes for a target strip/scanline?

And assuming no--what am I doing wrong here?

As mentioned--I've got this working with uncompressed TIFs by benefiting from this question, and this code, courtesy of Bob Osola. Therefore I'm certain my Easting/Northing → Column/Row translation is correct. And FWIW, my LZW compressed-TIF used a Predictor=2 (horizontal differenceing), although I do have a variation created with Predictor=1. That said, I don't believe the predictor is an issue in the context of this question.


texts: Spatial Join - Grid Containing Points, Display Highest Value Only

texts:
Sorry if this has been answered--I couldn't find anything specific to my question, however.

I have a polygon grid layer and a point layer which contains numerical values (1-4)
I want to use a spatial join to colorize the grid based on the highest value point it contains.
I'd like to do it in modelbuilder if possible, so I can easily incorporate it into my workflow.

For example:

Let's say the value 4 is colored red, 3 orange, 2 green, 1 blue.

In this example, the top left square would end up with a value of 4, the lower right square would end up with a value of 2, and the other squares would end up with values of 3.


texts: Implementing a complete web mapping project with folium

texts: I am quite new in web mapping and I was wondering if I could implement a complete web GIS using just folium and pandas and ... and I mean that is it possible to do it without any geospatial web services server like geoserver or mapserver. Is it possible to do it without any server side technology?


texts: Load PostGIS or Oracle Spatial Raster Layer using PyQGIS

texts:
How do we load Rasters stored in PostgreSQL-PostGIS or Oracle Spatial 11g into QGIS using PyQGIS?

I am able to load vector layers from Oracle 11g with below code. What changes are necessary to add Raster layers? The files are in tif format.

#Connect to Oracle and Fetch Table Names
con = cx_Oracle.connect('myoradb/myoradb@189.53.61.140:1521/newdev')
print con.version
cur = con.cursor()
cur.execute(u"select TABLE_NAME from user_tab_columns where data_type='SDO_GEOMETRY'")

tables = cur.fetchall()

uri = QgsDataSourceURI()
uri.setConnection("189.53.61.140", "1521", "newdev", "myoradb", "myoradb")

QgsProject.instance().writeEntry('WFSLayers', "/", [])

for t in tables :
   print str(t[0])

   uri.setDataSource('',  str(t[0]), "GEOMETRY")
   uri.uri()
   vlayer = QgsVectorLayer(uri.uri(),str(t[0]), 'oracle')
   QgsMapLayerRegistry.instance().addMapLayer(vlayer)
   lst = [ vlayer.id() ]
   pWfsLayer.append(u'%s' % vlayer.id())
   pLayers.append(u'%s' % vlayer.name())
   pLayerIDs.append(vlayer.id())

   render.setLayerSet(lst)
   rect = QgsRectangle(render.fullExtent())
   rect.scale(1.1)
   render.setExtent(rect)


texts: Unique SpatialPolygons object with multiple polygons slots in R

texts:
I'm trying to create an interactive Shiny application based off of this example provided by user G. Cocca. In this example, you click on a polygon and a second window zooms you into that polygon with additional administrative units. The example, however, utilizes cleaned and "perfect" polygons from the maptools package, and I am having trouble trying to finagle with my imperfect data to fit the example.

Without getting too bogged down in the details, I am having problems applying the Shiny example to my own data because of the structure of my shapefiles/polygons. It is imperative that I utilize a specific set of shapefiles, so unfortunately I can't dig around for already-cleaned data. Here is one of my example shapefiles, for reproducability. I read this into R via readOGR() from rgdal.

Here is a snippet of code from the example and an image of the resultant mapStates_sp object:

library(maptools)
mapStates <- map("state", fill = TRUE, plot = FALSE)
mapStates_sp <- map2SpatialPolygons(mapStates, IDs = mapStates$names)

In the linked Shiny example, the polygons are loaded in and converted as a Formal class SpatialPolygons. The first @polygons slot states that there are 63 objects with @ polygons:List of 63. Each of those 63 polygons has its own @ Polygons:List of 1 denotation. This makes perfect sense to me. The SpatialPolygon layer has 63 objects, each of which has one single polygon with its own ID, etc.

When I load in my own shapefile, which has already been cleaned and dissolved, I get the following:

library(rgdal)
countries <- readOGR("D:/LandScan", layer = "cleaned",
                stringsAsFactors = F)
countries_sp <- SpatialPolygons(countries@polygons)

As you can see, the first @ polygons slot is structured the same way: @ polygons :List of 24. 24 polygons for 24 different attributes, this is correct. What's confusing to me are the following @ Polygons slots, the first of which is picture above with @ Polygons :List of 9. (Each @polygons has its own @Polygons: List of x denotation.)

What is creating all of these extra polygons? I've already dissolved my features and attempted to clean them. I see that some of the slots state @ hole : logi TRUE. My polygons are country boundaries, so some of them include islands, archipelagos, lakes, etc. That's just part of their geometries. Is there any way that I can restructure my polygons so that each of my 24 features has only one @Polygons slot? This question/answer seems to be the same issue, but this person created their own DF, whereas mine is already housed in a shapefile, so I'm not sure that it applies.


texts:
I would like to know if a WMS exists for Sentinel 2 images?

If yes, its use is it free?

And is it possible to make a calculation on the fly, like NDVI?


texts: published raster with custom coordinate system to geoserver (comes in as EPSG 404000), but it won't overlay with other layers?

texts: I have an ecw file that is an aerial photo in a custom coordinate system. When I publish to geoserver, it specifies the EPSG as 404000. It seems like this isn't actually storing the coordinate system definition. When I preview the layer I can't see the full extent. If I change the declared SRS to EPSG 3857, then when I preview I can see the full extent of the image, but still it won't overlay with other data. However, I can't see the data at all when I load into desktop GIS. I'm wondering if this is due to the size - it is 3GB. I'm new to geoserver so I'm sure I'm missing something- what needs to be done to be able to see this image in the correct loation and overlaid with other data in EPSG 3857, or any other system for that matter?


texts: How to correct the "Windows Activation Period has Expired" message on an Esri Amazon AMI?

texts:
I'm only getting this error with instances that were spun up with Esri AMIs.  And I did find one post on the AWS forums (with no resolution) regarding this issue.  Does anyone know what the troubleshooting/correction steps are for this issue? I have not started any troubleshooting steps yet.

Restarted instance (No effect).
Checked KMS . (No KMS Issues).
Turned off firewall, modified C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml by setting Ec2WindowsActivate to Enabled.
Restarted Ec2Config service.
Success!
Turned firewall back on. on but I still need to test the KMS...I probably still need to open up a port.
Firewall is back on and no issues.

EDIT:
AWS Forum Link: https://forums.aws.amazon.com/thread.jspa?threadID=119200


texts:
I wonder why the new style is not applied to the features of the vector. The code below works fine but the style is not applied.

var layerWFS = new ol.layer.Vector({
  source: new ol.source.Vector({
    loader: function(extent) {
      $.ajax('http://demo.opengeo.org/geoserver/wfs', {
        type: 'GET',
        data: {
          service: 'WFS',
          version: '1.1.0',
          request: 'GetFeature',
          typename: 'placenames_medium',
          srsname: 'EPSG:3857',
          bbox: extent.join(',') + ',EPSG:3857'
        }
      }).done(function(response) {
        layerWFS
        .getSource()
        .addFeatures(new ol.format.WFS()
          .readFeatures(response));
      });
    },
    strategy: ol.loadingstrategy.bbox,
    projection: 'EPSG:3857',
    style: new ol.style.Style({
         image: new ol.style.Circle({
           radius: 3,
           fill: new ol.style.Fill({
              color: 'orange'}),
           stroke: new ol.style.Stroke({
             color: 'black'})
        })
      })
    })
});

var map = new ol.Map({
  target: 'map',
  controls: [],
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    }),
    layerWFS
  ],
  view: new ol.View({
    center: [-8908887.277395891, 5381918.072437216],
    zoom: 14
  })
});

Where is the problem?

I followed this example to apply the style: http://mappinggis.com/2016/06/anadir-wfs-en-openlayers-simbologia/

Codepen: http://codepen.io/ricopo/pen/GjRgam


texts: Determining if Runoff Sinks drain to stream or drain to road?

texts:
I've tried using the linked method to determine area that drains to stream vs drains to road. For some reason when I run the watershed tool on the the raster representing stream and road features, I get a lot of areas that have no data (drain to neither road nor stream). I'm not sure why this is happening.

Determining Upslope and Downslope from Line Features to Map Hydrologic Capture Zones

Picture: stream lines are in light blue, drains to stream in dark blue, road in white, drains to road in green.

This has the DEM as background.

This one has the Flow Direction Raster Behind.

at @Jon Filling the origional DEM then re running the watershed tool got me some more coverage as shown in this picture. New area is shown in yellow and rose.


texts:
I'm trying to do some kind of embed map and i see the way Google maps works. For exaple Google maps creates a URL like below :

https://www.google.es/maps/@39.4379818,-0.4569777,17z

Where it takes the latitude, longitude and zoom of the map's view you're at this moment. And when you zoom or move those parametes change in real time. And if you open that link you go to the zone shown by the parameters in URL.

My questions are? How it's done? It can be done only using client side code?


texts: Where can I find geodata for the Russian терсон-мо or терсон-ате census units? Or: can osm_admin polygons be linked to those?

texts:
I'm looking to combine Russian census data with georeferenced polygons.

This is for a research project looking into different aspects of mobility within the Republic of Саха (Sakha/Yakutsk), the data available via GADM is not sufficient (Note that the answer to this question indirectly refers to GADM data and thus does not answer my question)

The problem is that I am not able to find any kind of geodata – be it either a download from the Russian Census Office or any place to purchase it.

On the other hand, the administrative boundary polygons in OpenStreetMap seem to represent at least in parts the same entities. Unfortunately, the tags do feature neither терсон nor окато ids, and the place names do not match up either (I also tried a similarity comparison using a Levenshtein algorithmus which did not yield any but a few matches).

Can anybody with a better command of the Russian or Yakutian language and more experience with Russian census data point me into the right direction to where to obtain терсон polygon data or link OSM data to терсон ids?
We do have some budget for geodata and local project partners (who unfortunately don't have any experience with statistical or geographical data), so purchasing the data, also from within a Russian academic institution, might be an option.


texts:
I'm wondering, how this site countrymeters.info manages to gather information?
They are displaying, as example "Net migration today" and information is updated real-time;

few hours back it was -7, now it is -10 .. See for your self. Do you know what tools are they using in managing so called "country monitoring"? Why should i trust that data. If there was known possible approach for monitoring such thing i would had reason enough to trust information this site provides.

I'm just guessing.. interpol provided data? If i just took a train and crossed a border, how would anyone know this. Very interesting.


texts: How can I calculate the interquartile range of a group of overlaying pixels using the raster calculator function in R?

texts:
I am able to find the mean, min, and max, but I can't get the interquartile range when I replace mean with "iqr" for instance.
This works:
list <- list.files(path="C:\\Users\\Desktop\\Rasterize\\", full.names=TRUE)
STACK1 <- stack(list)
MEAN<- calc(STACK1, fun = mean)

This doesn't:
list <- list.files(path="C:\\Users\\Desktop\\Rasterize\\", full.names=TRUE)
STACK1 <- stack(list)
IQR <- calc(STACK1, fun = iqr)


texts: Are there any naming conventions for aerial imagery?

texts: Do GIS projects involving high resolution NAIP quarter quad imagery typically use the USGSID code and qq (e.g. 3910232ne) or the GNIS code and qq (e.g. 39102e1ne) to organize data?  I can't seem to find a consistent protocol.


texts: How to convert 4band RGB/A GeoTiff to 1band Gray GeoTiif?

texts:
I'm creating slopeshade images from a DEM. What I'm doing is:

gdaldem slope -alg Horn -s 1 -compute_edges -co BIGTIFF=YES in.tif /vsistdout/ | \
    gdaldem color-relief -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW /vsistdin/ slope.txt out.tif

but the file generated has 4 bands, RGBA, while I actually need only one. I tried further filtering with:

gdal_translate -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW -b 1 out.tif out_1band.tif

but gdalinfo says band 1 is red, not gray, as the output of gdaldem hillshade:

Band 1 Block=256x256 Type=Byte, ColorInterp=Red   vs
Band 1 Block=256x256 Type=Byte, ColorInterp=Gray

This confirms the fact that gdal can generate the file I want, just not with the tool I'm using.

For info, I'm using mapnik to render this, and it's treating the file as if it were pure white (while qGIS properly renders it as geryscale; maybe the bug is in mapnik?). mapnik handles the 1band hillshade file with no problem.

I could do more fine grained things in Python if needed, bur I have no idea how to start.

Is there a simple way to do this?


texts: High resolution laptop not displaying control boxes properly in QGIS (Windows 10)

texts:
I have recently installed QGIS 2.18.2 to my new Asus Zenbook Windows 10 64 bit. My issue is that (see image) some of the plugins...the initial one - go to coordinates (essential) is not displaying correctly as my screen is very high DPI. I have found the settings to change icon/text size which has helped.

I would prefer not to have to reduce the resolution of my entire laptop - however don't mind so much if its only for QGIS.

I found this link online which seemed helpful - except the .exe that Windows points to didn't change anything when I created manifest file.

http://www.danantonielli.com/adobe-app-scaling-on-high-dpi-displays-fix/

I haven't tried hooking it up to a separate monitor yet as I am awaiting a cable arriving in the post. However I really need it to work on the standalone laptop for work in the field.


texts: Returning strings showing all vertices from all polygons in shapefile using ArcPy?


texts:
I am trying to use this WMTS link for my country but it doesn't display anything and doesn't show any error either. In ArcGIS everything is ok and works normaly.

Link is : http://albmaps.asig.gov.al/service/wmts?


texts: Making a coordinate transformation on a csv file using pyproj?

texts:
I mostly got my answer from this original posting: How to reproject 500 CSV files efficiently and easily using QGIS?
and using the code from response 7 from blord-castillo.

My problem is that the code, I suspect, is from earlier versions and I am unclear how to update it for pyproj 2.4.1 and python 3.7.6. I'm using Spyder 4.0.1 in Anaconda. I only have one csv file, but I do not think that is really an issue.

I have a csv file with a list of long,lat and I want to make a coordinate transformation to another CRS and save the output to a new csv file with x,y.

I updated the script to my file and projections. Here:

import csv
import pyproj
from functools import partial
from os import listdir, path

#Define some constants at the top
#Obviously this could be rewritten as a class with these as parameters

lon = 'LONGITUDE' #name of longitude field in original files
lat = 'LATITUDE' #name of latitude field in original files
f_x = 'x' #name of new x value field in new projected files
f_y = 'y' #name of new y value field in new projected files
in_path = r'myinput' #input directory
out_path = r'myoutput' #output directory
input_projection = 'epsg:4326' #WGS84
output_projecton = 'epsg:3395' #World mercator

#Get CSVs to reproject from input path
files= [f for f in listdir(in_path) if f.endswith('.csv')]

#Define partial function for use later when reprojecting
project = partial(
    pyproj.transform,
    pyproj.Proj(init=input_projection),
    pyproj.Proj(init=output_projecton))

for csvfile in files:
    #open a writer, appending '_project' onto the base name
    with open(path.join(out_path, csvfile.replace('.csv','_project.csv')), 'wb') as w:
        #open the reader
        with open(path.join( in_path, csvfile), 'rb') as r:
            reader = csv.DictReader(r, dialect='excel')
            #Create new fieldnames list from reader
            # replacing lon and lat fields with x and y fields
            fn = [x for x in reader.fieldnames]
            fn[fn.index(lon)] = f_x
            fn[fn.index(lat)] = f_y
            writer = csv.DictWriter(w, fieldnames=fn)
            #Write the output
            writer.writeheader()
            for row in reader:
                x,y = (float(row[lon]), float(row[lat]))
                try:
                    #Add x,y keys and remove lon, lat keys
                    row[f_x], row[f_y] = project(x, y)
                    row.pop(lon, None)
                    row.pop(lat, None)
                    writer.writerow(row)
                except Exception as e:
                    #If coordinates are out of bounds, skip row and print the error
                    print (e)

I get an error:

Traceback (most recent call last):

  File "file.py", line 43, in <module>
    fn = [x for x in reader.fieldnames]

  File "mypath\csv.py", line 98, in fieldnames
    self._fieldnames = next(self.reader)

Error: iterator should return strings, not bytes (did you open the file in text mode?)

I have tried to compare the current documentation to the code, but I am a novice here and not entirely sure what I need to change. I have already checked that everything works up to this point by adding a line "print (continue)" in a few places.

In your answers, please remember, novice here.


texts: Show dataframe CRS in Status Bar in ArcMap 10

texts:
Does anyone know if would it be possible to show the name of the current coordinate reference system being used in the active dataframe in the status bar of ArcMap? I have searched for scripts but have not found anything appropriate.

Has anyone done something similar?


texts: Deleting raster file after doing some processing in QGIS?

texts:
I run this script in my python console on QGIS:

import os
import processing
from qgis.core import QgsVectorLayer

polygon_file = "E:/polygon.shp"
point_input = "E:/station.shp"
raster_output = 'E:/output_idw.tif'

layer = QgsVectorLayer(point_input, 'layer', 'ogr')
processing.runalg('grass7:v.surf.idw', layer, 8.0, 5.0, 'value', False, "%f,%f,%f,%f" % (110.5, 117, -9, -4.5), 0.001, -1.0, 0.0001, raster_output)
processing.runalg("gdalogr:cliprasterbymasklayer", raster_output, polygon_file, -1, False, False, False, 6, 0, 75, 1, 1, False, 0, False, "", 'E:/output_crop.tif')
os.remove(raster_output)

I need to delete the unclip raster file (raster_output) directly by doing "os.remove(raster_output)" after processing but it return
"[Error 32] The process cannot access the file because it is being used by another process"
What should i do so i can delete that file without exit QGIS?


texts: Why is Raster Calculator not honoring compression environment settings?

texts:
For some reason, the Raster Calculator isn't honoring any Raster Storage environments that I have set. Mainly, compression and pyramids. I am processing a large raster dataset through raster calculator (there are multiple products/ iterations of calculations), so I am having storage issues. From what I have read online, these settings should not be ignored by the Raster Calculator. I am working off ArcGIS 10.4, but do have access to ArcGIS Pro if needed.

Does anyone know why this is happening and/or how I can resolve this issue?

http://desktop.arcgis.com/en/arcmap/10.4/tools/environments/an-overview-of-raster-storage-settings.htm

I am working with a water surface elevation raster. It is in TIF format. I have attempted to set it with a compression of both LZW and LZ77. The settings have been set both globally and locally on the tool. The Build Pyramids box is checked in Raster Storage. Here is a snapshot of the settings I am using:

Output Characteristics: The rasters are not corrupted, which is good news. Here are the properties of the new rasters after using the global settings shown above:


texts: Extracting data from a raster to a polyline based on start and end points?

texts:
I have a polyline shapefile with the attributes seen above.

startx and starty represent the coordinates of the beginning of each segment of a polyline.
endx and endy represent the coordinates of the end of each segment of a polyline.

I have a raster with values of Flow Accumulation, known as FA.

I would like to extract the values on the raster at the coordinates of the start points and place them in this attribute table at "StartFA" and at the end points and place them in this attribute table at "EndFA".

I have so far performed "Feature Vertices to Points" using point types "START" and "END".
I then performed "Extract Values to Points".

How do I put the values I am looking for into my polyline shapefile attribute table?

I am using ArcGIS 10.1 with an ArcInfo license.


texts:
Is it possible to generate some tiles by GeoWebCache with specific scales eg.
 1 000 000 , 500 000 etc. By default they are eg. 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613 what is very confusing for me actually ;/

Thanks for any help

Alex


texts: Create default QGIS actions / define my own default actions

texts:
I have created a simple action that should be used to several users. Then, I'd like to put my action among their default action list.

Put it simply, how can I create a default qgis action in a given QGIS instance? Or how can I set my function as default, so that when I restart QGIS I can find it there again.


texts:
I am trying to publish a map on my server but I am getting this error:

  Compressing the service definition failed.

I have changed the location of service points, still the Error remains.

How can I solve this issue?


texts:
I want to filter a set of Point Shapefiles using PyShp. That works fine with one of the file sets (one point shapefile) but throws an error for another set that states:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 72: ordinal not in range(128)

As far as I understand that means it tries to encode the input (because it works with the other files) in ASCII but can't. How do I change the encoding to UTF-8? Just in case, here is my shapefile.reader:

sf = shapefile.Reader(pfad)

Whereas "pfad" is user input for the location of the file. Any ideas?

Edit:
To rule out any shapefile.reader issues I append the code from the PyShp for the reader class:

def __init__(self, *args, **kwargs):
    self.shp = None
    self.shx = None
    self.dbf = None
    self.shapeName = "Not specified"
    self._offsets = []
    self.shpLength = None
    self.numRecords = None
    self.fields = []
    self.__dbfHdrLength = 0
    # See if a shapefile name was passed as an argument
    if len(args) > 0:
        if is_string(args[0]):
            self.load(args[0])
            return
    if "shp" in kwargs.keys():
        if hasattr(kwargs["shp"], "read"):
            self.shp = kwargs["shp"]
            if hasattr(self.shp, "seek"):
                self.shp.seek(0)
        if "shx" in kwargs.keys():
            if hasattr(kwargs["shx"], "read"):
                self.shx = kwargs["shx"]
                if hasattr(self.shx, "seek"):
                    self.shx.seek(0)
    if "dbf" in kwargs.keys():
        if hasattr(kwargs["dbf"], "read"):
            self.dbf = kwargs["dbf"]
            if hasattr(self.dbf, "seek"):
                self.dbf.seek(0)
    if self.shp or self.dbf:
        self.load()
    else:
        raise ShapefileException("Shapefile Reader requires a shapefile or file-like object.")

Edit 2: Error log including a traceback.

Traceback (most recent call last):

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\interactiveshell.py", line 2898, in run_code
self.showtraceback()

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\interactiveshell.py", line 1824, in showtraceback
value, tb, tb_offset=tb_offset)

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 1406, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context)

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 1323, in structured_traceback
self, etype, value, elist, tb_offset, number_of_lines_of_context

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 644, in structured_traceback
out_list.extend(self._format_list(elist))

File "C:\Users\Admin\Anaconda2\lib\site-packages\IPython\core\ultratb.py", line 694, in _format_list
Colors.Normal)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 72: ordinal not in range(128)


texts:
I am a QGIS developer. We have been modifying the source code of QGIS for several months and have done good work in QGIS version 2.1. After that we tried to do the same modifications for QGIS version 2.5. A lot of code had to be modified, but we managed to build it. However, we encountered a problem in python, which is this:

Couldn't load PyQGIS.
Python support will be disabled.
Traceback (most recent call last):
  File "", line 1, in
  File "D:/qgis/build/x86/qgis2.5.0/./python\qgis\__init__.py", line 36, in
    from qgis.core import QgsFeature, QgsGeometry
  File "D:/qgis/build/x86/qgis2.5.0/./python\qgis\core\__init__.py", line 1, in
    from qgis._core import *
ImportError: dynamic module does not define init function (init_core)
Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
QGIS version:
2.5.0-Master 'Master', exported

I have looked up this error and found that it may be related to PYTHONPATH or PATH environment variables. I tried all possible values for both environmental variables without success.

I am working on a 64-bit Windows 7, and the QGIS build is 32 bit.


texts: How to disable the Vertex Editor window in QGIS 2.16?

texts:
When I´m editing nodes, the Vertex Editor window is always popping up. As the map is redesigned it is frustrating as I need searching to find the place where I am working!! The place where I´m working is always moving in the screen! Rrrh!

Don´t work if I disable View > Panel > Vertex Editor.


texts: Making custom, dynamically generated vector symbols in ArcGIS Desktop?

texts:
I am putting together a map of GPS-enabled vehicles, and I am hoping to display them with custom point symbols that change appearance based on a few attributes (things like velocity, heading, and a few other business attributes). For example, the fill color might change depending on the vehicles speed, the shape might change based on vehicle type, and the size might change based on another attribute.

I have considered using the "unique values, many fields" option in the symbology menu, but I don't think it will work for this task because 1) my data has seven attributes that the symbol needs to be based on, and the dialog only allows for three fields, and 2) if I have to create each symbol individually for every combination of attributes, I'd have to build over 350 symbols in total.

I would prefer to specify something like "if speed is X, set fill color to Y; if vehicle type is A, set symbol outline to B, etc."

Is this kind of customization possible in ArcMap, and if so, what is the best approach?


texts: Exporting an image using a FeatureCollection as region in Google Earth Engine (Python)

texts:
I'm trying to export an image using a FeatureCollection as region. My code is as follow:

params = {
    'description': 'ndviChange_to_gtiff',
    'scale': 30,
    'region': AOI
  }
ee.batch.Export.image.toDrive(ndviChange, **params)

the AOI is a FeatureCollection defined earlier in my code:

AOI = ee.FeatureCollection("users/..../AOI")

I'm getting this error:

TypeError: Object of type FeatureCollection is not JSON serializable

Note that I'm running the code in QGIS GEE plugin.


texts:
LIDAR files were released for major part of Slovenia few months back in zlas format. Decompressed LAS format is 1.4 version. I have tried many options how to generate DEMs and had some success in programs and tools but unfortunately they were all trial versions of license pay versions.

Problem is that I can't open and generate DEMs of LAS version 1.4 in many open and free tools (such as MCC-Lidar).

Can you help me converting LAS from 1.4 to 1.2 in some free tool? Or if it is any other way for LAS 1.4.


texts: Can I import my own data and Dijkstra function in Open Trip Planner or Open Source Routing Machine

texts:
I have a lot of geographical proprietary data that I want to use in routing algorithms. I was using pgRouting, but the requirements of the software changed (now includes multi-modal routes that pgRouting doesn't support). So I looked around, and I found Open Trip Planner and Open Source Routing Machine (Not sure if it supports Multi-Modal).

My question is, using a solution like OTP or OSRM, can I import my own data, in form of Open Street Map data (.osm) and use that AND define my own Dijkstra cost function?


texts: What is gid in OpenStreetMap data model?

texts:
I'm using an old code written by an ex-fellow and I wonder what is GID in OSM? The gid is basically used everywhere. The project uses PostGIS and PgRouting. Any pointers to that?

I know this is a naive question but I need a start. Thanks.

As an example, this method comes from this interface.

/**
     * @param gid the gid of the openstreetmap entity we want to retrieve
     * @return the OpenstreetMap entity or null if not found
     */
    public OpenStreetMap getByGid(final Long gid) ;


texts: Checking geometry type of vector layer in QGIS?

texts:
How do I check the geometry type of a vector layer in QGIS?

I would like to know whether a layer uses Polygons or MultiPolygons or Points, but I can't see anything in the Properties dialog that tells me.


texts:
Based on this example http://labs.easyblog.it/maps/leaflet-layerjson/examples/overpass.html I'm trying to load the following url into a Leaflet map

https://data.police.uk/api/crimes-street/all-crime?lat=52.629729&lng=-1.131592&date=2013-01&category=anti-social-behaviour

below is a snippet of the request.

{
category: "anti-social-behaviour",
location_type: "Force",
location:
{
latitude: "52.635598",
street:
{
id: 883314,
name: "On or near Yeoman Lane"
},
longitude: "-1.129330"
},
context: "",
outcome_status: null,
persistent_id: "",
id: 20597163,
location_subtype: "",
month: "2013-01"
},

My problem is that the latitude and longitude are nested in the location tab and not declared as lat lon. I've tried in-vain but can't work out how to call the the nested latitude and longitude in this part of the code propertyLoc: ['lat','lon'], in the labs example.


texts: What resampling technique should be used when projecting aerial photos?

texts:
I'm doing some time-intensive projecting of aerial photos, and I'm curious - what resampling technique is best to use on aerial photos? In ArcMap, my options are NEAREST, BILINEAR, CUBIC, and MAJORITY.

Nearest Neighbor and Majority are recommended for categorical data, whereas Cubic Convolution and Bilinear Interpolation are for continuous data.

I'm curious to know if there's any commonly-used algorithm for projecting aerial photos. I've just finished projecting one image using Nearest Neighbor and it seems to look good, but an aerial photo is not categorical data, so I'm going to try Bilinear next.

EDIT
I wasn't thinking of aerial photos as the same kind of continuous data as DEMs or precipitation data, but whuber pointed out that they are continuous and should be handled as such. Thanks again.


texts: Shortest path from one to many points to return path id's using QGIS

texts:
I'm trying to find the shortest path between many points (pink) and one point (light green) using a network of lines (dark green). For each path found I need the list of line id's that make that path.

I have been using the inbuilt network analysis tool 'shortest path (layer to point)' and it returns the 'cost' for each path I need the id's making that path instead of the cost.
How do I do this using QGIS?


texts: Update the layout excel file automatically when the attribute table chnages in arcmap

texts:
I am trying to put an excel table in arcmap layout where this table includes some statistics over one of the Features Attribute table. This Feature is going to be updated regularly and consequently the Excel layout should be updated as well. How can I connect this Excel table to the Feature Attribute to update the statistics automatically.

I have tried to create a GDB table and summerise the Information there but it does not get updated when the Feature informaton changes.


texts: Converting ESRI Web Client JSON to Standard Feature Class With Python Geoprocessor

texts:
Is there a function exposed by ESRI's python geoprocessor that converts the JSON format used in the various web clients to a valid feature class.

Clearly, the function exists because something is converting these JSON strings into a format usable by the geoprocessor.  I can't find it anywhere.


texts: Downsides to saving rasters with NaN as no data values?

texts:
I am working with a bunch of satellites images downloaded from Google Earth Engine as .tifs. I have masked some of the pixels in Earth Engine with values of -999999 where there are clouds. Everytime I open them up in Python, I have to remove the -999999 values with something like
with rasterio.open(raster_file, 'r') as src:
    raster = src.read(1)
    raster[raster == -999999] = np.nan
    raster[raster== 0] = np.nan

I am wondering, can I just save the .tifs with np.nan instead of -999999, or could this cause some unforeseen problem down the road? I ask because I have never seen rasters with NaN for NoData values, usually it is some impossibly large number like -3.4028231e+38 or -999999. So perhaps there is some reason I am not seeing.


texts: Leaflet: Load GeoJSON point data in polygon, when selecting polygon

texts:
I've got a point dataset (~ 160.000 points) which has a filesize of around 30 MB. Because that is too large I decided to slit it into 12 separate GeoJSON files. I've got a map with 12 polygons. When the user will select one polygon I want the related GeoJSON point file to be downloaded and displayed on the map. Therefore I am loading the point data script dynamically:

    function onclick(e) {
        map.fitBounds(e.target.getBounds()); // Zoom to Polygon
        var head = document.getElementsByTagName('head')[0];
        var script= document.createElement('script');
        script.type= 'text/javascript';
        var data = feature.properties.name; // getting the name of the selected polygon, point data is namend by polygon
        var datafile = '.js';
        script.src= data + datafile;
        head.appendChild(script);
        pointToLayer: marker_icon;
        map.addLayer(data);
    };

As I found out with the inspector of my webbrowser, the point data file will be loaded successfully, but the points are not getting into the map. The datafile looks like that:

var data = {type:"FeatureCollection", features: [
{ type: "Feature", properties: { LN: "412C-6351", AH: 33.94, BA: "1958\/03\/01", BE: "1899\/12\/31", BV: "UN"  }, geometry: { type: "Point", coordinates: [ 13.46311, 52.46391 ] } }]};

How can I fix this?


texts: how to avoid the bbox limitations on a Mapquest XAPI request

texts:
I am doing the following: I send a request to the API-Server - over http as a response I get the following result - in XML

example: the following link gives back all the Nodes of the Type amenity=restaurant in XML-Format.Note: the bounding box (bbox) limits the area:

http://xapi.openstreetmap.org/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]

http://xapi.openstreetmap.org/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]

note - I do it with wget since the XAPI-service is down for maintenance

see here the results:_

<?xml version='1.0' standalone='no'?>
<osm version='0.6' generator='xapi: OSM Extended API 2.0' xmlns:xapi='http://www.informationfreeway.org/xapi/0.6' xapi:uri='/api/0.6/node[amenity=restaurant|fast_food|pub|cafe][bbox=9.4908142,48.7810801,9.5660019,48.8387351]' xapi:planetDate='20100824' xapi:copyright='2010 OpenStreetMap contributors' xapi:license='Creative commons CC-BY-SA 2.0' xapi:bugs='For assistance or to report bugs contact 80n80n@gmail.com' xapi:instance='zappyOsm'>
<node id='721241970' lat='48.830856' lon='9.5116892' user='mabe75' timestamp='2010-05-04T19:01:28Z' uid='260302' version='1' changeset='4607010'>
<tag k='amenity' v='restaurant'/>
<tag k='name' v='Lamm'/>
</node>
<node id='392682646' lat='48.8315734' lon='9.5468864' user='MattGPS' timestamp='2010-05-11T19:00:20Z' uid='12973' version='3' changeset='4671372'>
<tag k='amenity' v='restaurant'/>
<tag k='name' v='Gasthaus an der Wieslauf'/>
</node>
<node id='319597380' lat='48.8277913' lon='9.5477029' timestamp='2008-12-17T21:13:15Z' version='1' changeset='444629'>
<tag k='amenity' v='restaurant'/>
<tag k='name' v='Gasthaus zur Linde'/>
</node>
[...]

well this example works pretty well - if I do it with wget.

question: how can I avoid the limitations of the bbox?