texts: Atlas automation for rule based symbols QGIS 3.12

texts: I am working with a point and polygon data set in atlas and I have enabled rule based symbology. I have already explored and worked with the standard work flow of (is_selected) and else rules. Since this basic on or off command is very useful, I would like to know if there is a way that I can code into the atlasfeatureid a selection command to highlight the feature in the map canvas to satisfy the rule based selection.


texts: Exporting data in XML file format from ArcGIS for Desktop?

texts: Is it possible to export shapefiles or rasters in XML file format from ArcGIS for Desktop?


texts:
I have installed apache tomcat 7 and successfully deployed Geoserver 2.7.  However whenever I copy an extension .jar file into WEB-INF/lib and try and restart geoserver using the tomcat html manager application it fails to start, and will not start until I reset my machine, delete the new .jar file and then start geoserver.

I have downloaded the latest version of geoserver 2.7 SNAPSHOT  and am using the latest 2.7 SNAPSHOT builds of the extensions.

The etxensions I am most interested in are the WPS and geopackage extensions.  http://docs.geoserver.org/latest/en/user/community/geopkg/installing.html

I have left it for up to 15 minutes, which I would have thought was long enough.

Has anybody successfully added extensions to geoserver, or could anyone point me in the right direction?


texts: Copying shapefile data into file geodatabase using R?

texts:
I have one file geodatabase (*.gdb) and one shapefile (*.shp).

How can I copy that shapefile data into the file geodatabase using R?


texts:
I have seen the different solutions that store the info window in a variable and close it from outside of the info window, however I would like to have a possibility to close the info window from within itself, like having a button that closes the info window (in addition to the close button). I have seen that I can add the close class to an element, however this also adds the default styling, which I don't want.

Is there a good way to do this?


texts: Installing GDAL with HDF4 driver on Debian system

texts: I am working on a Debian 7 Wheezy system using Anaconda and working from Spyder.  I've had a hard time installing a version of GDAL that reads HDF4 drivers.  Could someone walk me through the installation process?


texts: Creating bookmarks in QGIS from CSV file containing coordinates?

texts: Does QGIS have the functionality to input a CSV file containing coordinates & scale of the map, and then output bookmarks for different coordinates?


texts: Find closest points between two tables in MySQL with Spatial extensions

texts:
I have a two tables: one with trackings points and one with shops.
I want the trackings points that have 1 or more shops within a certain distance from that point.

What I have now:

SELECT

a.*,
b.*

FROM trackings_process a, shops b
WHERE st_distance_sphere(a.coords_point, b.point) < a.coords_accuracy + 30

ORDER BY b.name, a.id

The distance is based on the accuracy of that tracking point.
My tracking points table contains 16.000+ records and my shops table has 8.000+ records. The query above takes 71s to run.

My questions: is this the best approach? Strategies to lower the execution time?


texts: Getting values from DataDictionary in Google Earth Engine?

texts:
I am learning Google Earth Engine with no prior knowledge of javascript (coming from R and python). Following the FeatureCollection tutorial with the following script:

// Load watersheds from a data table.
var sheds = ee.FeatureCollection('USGS/WBD/2017/HUC06')
  // Filter to the continental US.
  .filterBounds(ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 51.29))
  // Convert 'areasqkm' property from string to number.
  .map(function(feature){
    var num = ee.Number.parse(feature.get('areasqkm'));
    return feature.set('areasqkm', num);
  });

// Display the table and print its first element.
Map.addLayer(sheds, {}, 'watersheds');
print(sheds.limit(1));

// Print the number of watersheds.
print('Count:', sheds.size());

// Print stats for an area property.
print('Area stats:', sheds.aggregate_stats('areasqkm'));

The last step creates something that the console calls a DataDictionary. This doesn't seem to behave like a normal dictionary, & I can't figure out how to access the individual elements within. I assigned the results with

var areaStats = sheds.aggregate_stats('areasqkm')

And then tried all of the following:

print(areaStats.get('mean'));
print(areaStats.mean);
print(areaStats['mean']);

Which resulted in the error areaStats.get is not a function for the first and simply printing 'undefined' for the others. What is going on? I can clearly see a value called 'mean' if I print areaStats in the console.

I might not ever need to use this code on my own data, but it bothers me that I can't figure out something as apparently simple as how to access elements within a dictionary!


texts: Grid vs. Polygon Overlay in R gives different results than in QGIS

texts:
I have a shapefile of range polygons. Each colored set of polygons represents a different group of species/genera/whatever.

I next overlay a 5x5 grid onto this map. And then use join attributes by location to find the number of grids that intersect each polygon

The final output gives me a column in the attribute table COUNT that indicates the number of grids intersected by the polygons.

EDIT: In other words, it gives me the site occupancy of each species.

################## NEXT PHASE

I want to duplicate this same process entirely within R. First I load the same shapefile of range polygons into R using the rgdal package.

RangeShape<-readOGR(".","overflowExample07162015")

I then generate an analogous 5x5 grid in R using the following function and the raster package.

# Generate lat/lng grid for use with mammals dataset
generateGrid<-function(XMin=-180,XMax=180,YMin=-90,YMax=90,BinSize=5) {
    LatitudeRows<-length(seq(YMin,YMax,BinSize))
    LongitudeColumns<-length(seq(XMin,XMax,BinSize))
    Grid<-raster(extent(matrix(c(XMin,YMin,XMax,YMax),nrow=2)),nrow=LatitudeRows,ncol=LongitudeColumns,crs="+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
    Grid[]<-1:ncell(Grid)
    Grid<-as(Grid,"SpatialPixelsDataFrame")
    return(Grid)
    }

# Create a GridShape object
GridShape<-generateGrid(XMin=-180,XMax=180,YMin=-90,YMax=90,BinSize=5)

Next I attempt to overlay them using the over() function in the sp package with the following function.

# Find Occupancy of taxa using shapefile
shapeOccupancy<-function(RangeShape,GridShape) {
    Occupancies<-vector("numeric",length=nrow(RangeShape))
    for (i in 1:nrow(RangeShape)) {
        Intersect<-over(GridShape,RangeShape[i,])
        Present<-apply(is.na(Intersect),1,all) # identify grids that do not intersect range polygons
        Occupancies[i]<-nrow(Intersect[Present!=TRUE,])
        }
    return(Occupancies)
    }

 Occupancy<-shapeOccupancy(RangeShape,GridShape)

################## The problem

The counts given by my R process are not even close to the counts given by the QGIS process. I could understand slight differences, but these are quite large.

# Sample of differences
                     RResults  QGISResult
Abrothrix                7         23
Alouatta                31         69
Aplodontia               1         6
Artibeus                47         88
Ateles                  24         48
Avahi                    1         7
Balantiopteryx           3         17

My best guess currently is that this is a result of the fact that some of the range polygons are discontinuous and R has a difficult time handling that, but I'm not sure. Based on a few manual spotchecks (i.e., manually counting grid and polygon intersections on the map), the QGIS results seem to be accurate and it is the R results that are wrong.

EDIT: A subset of the range polygons is included at the following github repository. https://github.com/aazaff/StackOverflowExamples/


texts: Need File Geodatabase (*.gdb) read/write support in QGIS?

texts:
I have followed the instructions shown in this thread but still don't have the ESRI FileGDB option only the Open File GDB. In my case, I am in the most current QGIS version - Lyon (2.12.0).

OSGeo4w shell Results:


texts: Create a table from GeoJSON Data from Ajax link - Using Leaflet Javascript

texts:
I have an ajax link getting data from GeoServer. When a user selects features on a map, a new bounding box is calculate and sent via Ajax to GeoServer and the features within that bounding box are sent back.

I have a handleJson function for the selected features returned from GeoServer:

        function handleJson(data) {
                    selectedFeature = L.geoJson(data, {

                        onEachFeature: function (feature, layer) {
                        for(name in feature.properties){
                                    document.getElementById("properties").innerHTML =                 document.getElementById("properties").innerHTML +
                                    "<tr><td>" + name + "<td>" + feature.properties[name] + "<td>";
                                        }

                        },
                        pointToLayer: function (feature, latlng) {

                            return L.circleMarker(latlng, {
                                radius: 5,
                                color: '#3006e8',
                                weight: 5,
                                opacity: 1,
                                fillOpacity: 1
                            });
                        }
                    });

Currently I can get all of the data back in this format (just plunked right onto the map itself):

Name: George Costanza
Occupation: Bra Salesman/Kruger Industrial Smoothing
Strengths: Lying
Weaknesses: He was in the pool.

This is fine if you only have one feature selected, but if you have multiple, it needs to be in a format closer to microsoft excel with rows and columns like this:

Name       Occupation        Strengths      Weaknesses
person1    person1 job    person1 strength person1 weakness
person2    person2 job    person2 strength person2 weakness
person3    person3 job    person3 strength person3 weakness

I have tried various for loops and putting things to arrays, but I cannot get get it to work. forEachFeature just keeps copying what would be the column name (the "key" in the key:value pair). I need the column names set up once and then just get the  data associated (the "value" in the key:value pair). Is this possible?

UPDATE TO SHOW WHAT IT CURRENTLY DOES:

Name: Person Person
Occupation: Some Job
Strengths: Some Strength
Weaknesses: Some Weakness
Name: Other Person
Occupation: Some OTHER Job
Strengths: Some OTHER Strength
Weaknesses: Some OTHER weakness
Name: Other Person 2
Occupation: sadfsadds
Strengths: Lasdfafffd
Weaknesses: asdasfdsadf


texts: Arcpy SDE Connection Getting Invalid Path?

texts: I literally copied and pasted the file path (r'C:\Users\myName\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\mydatabase.sde'), but after I run my script, I always get the error saying error 267, the directory name is invalid.


texts:
I am struggling to get rid of the below error,

  the program can't start because LayerUILib.dll is missing your computer. try reinstalling the program to fix this problem.

Note: this error occurs only when I am debugging from VS 2012 for ArcGIS 10.3 'ArcMap' (it is Add-In project).


texts: Altering elevation of specific cells in raster layer of QGIS?

texts:
I'm looking to alter the height of some cells within a raster and it's been suggested that I do this by creating a polygon layer and use that as a mask to alter only the heights of cells within the polygon.

The closest problem I've found similar to this is - How to change raster cell values within a polygon using QGIS GUI? - but I'm quite new to using GIS and don't understand how to do that though, I can't seem to control the extents of the polygon and can't find how to alter the heights.

Previously, I've tried using the Raster Calculator to create separate GeoTiff files in an attempt to alter the elevations and then merge the files back into a raster, I'm not certain if that sounds more straightforward, it just seems to give me an area with nan(not a number) rather than the elevations I want to input.

Another link that might be useful - Using polygons to apply unique value to all raster cells within those polygons?


texts: QGIS Date Time reverts back to 1950 after ~68 years

texts:
I have a column in a QGIS attribute table that contains elapsed time (in years). I have created an additional column in the attribute table to convert the elapsed time to a date. I am using an expression using the open field calculator to add the elapsed time to the current date. The expression I am using is now() + to_interval(concat("elapsed_time"),' years')), with elapsed time being the elapsed time column.

Everything works fine but when the elapsed time becomes greater than ~68 years, the output date reverts back to 1950, instead of correctly adding the number of years to the current date. I have tried to use other dates besides the current date and get the same results. Does anyone have any ideas of why this happens and how to fix it?


texts: How to create a cinematic animation of geospatial data

texts:
I got a couple of NetCDF4 (imageCollections) datasets with a temporal component. I would like to create a compelling movie to display on social media. In the past I successfully used Panoply but the result is not very cinematic. I would like to generate something like this

Is there a programmatic way to generate cinematic (define camera position and angle, add lights, shading) movies using for example python?


texts: Merge overlapping polygons to elevation data

texts:
I'm new to GIS and need to create a shortest path avoiding buildings. The buildings are represented as polygons in a shapefile.
In QGIS I created a buffer polygon for each building, corresponding the distance the path have to keep from the buildings. This polygons are overlapping each other a lot by every aglomeration of hauses.
My idea would be to rasterize this overlapping polygons into a DEM layer, so that:
the elevation value of each point
corresponds to the number of polygons overlapping over this point.
And having this, a least cost path algorithm would give me the wanted path.
But... the tools to merge polygons or for rasterization doesn't helped yet.
Isn't this the way how things like this are done? If not with QGIS, maybe with GeoTools or other software running under Linux?
EDIT: an Image to illustrate the problem

I have in mangenta the polygons representing buildings.
In red an approximation of the expected path.
In turquoise the bufferzones around the houses representing the minimal distance the path have to keep from the houses, if possible.
We see: it is impossible to avoid all bufferzones.
The path costs will increase for each buildig it is coming too close. If the path goes between one house and a group of two houses close together, it have to choose violate the buffer zone of the lonely house over the other.

How I'm trying to solve it: add the number of bufferzone polygons at each raster point to a DEM-Layer.

But maybe my approach isn't ideal:
is there a way to create a DEM layer directly from the buildigs, defining a slope aroung them, summing up the slopes elevation values when they are overlapping?


texts:
I am interested in creating a web map application, that will display a map of my country and various files (.tif, shp) on top of it as layers and I decided to build it on top of Leaflet.

So when I started, I used a standard map from OpenStreetMaps, using the following code:

var map = L.map('map').setView([50, 9], 10);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; OpenStreetMap contributors',
}).addTo( map );

However, my supervisor said that the map is "too detailed", so we are looking for an alternative base map that is less detailed and may be of more help.

So is there an alternative source of free maps, like OpenStreetMaps that I can use?


texts: Writing Python script to delete multiple fields in multiple files but keep certain fields?

texts:
I am needing to be able to run a python script on a folder full of shapefiles to delete multiple fields in the attribute tables. But I want to be able to keep 3 fields (Crop_Type, Acres, and Field_Name). The code included below was taken from another post on here however im unsure how to edit it to keep the three fields that I want to keep along with the required fields that ArcGIS 10.5 needs. I can't get it to run, and I am not sure where to go from here.

Here is my current code:

import arcpy
import os

arcpy.env.workspace = "D:\Big Hill-East Gospel"
fcList = arcpy.ListFeatureClasses()

for fc in fcList:
   desc = arcpy.Describe (fc)
   #shape field name
   shpFld = desc.shapeFieldName
   #oid field
   oidFld = desc.OIDFieldName
   #shapefile name field
   shpFileFld = os.path.splitext (fc) [0]
   #list fields
   delFlds = [f.name for f in arcpy.ListFields (fc)
             if not f.name in [shpFld, oidFld, shpFileFld]]

#delete fields
arcpy.DeleteField_managemnet (fc, delFlds)


texts: Automatically update field value in one column based on change to another column in same table?

texts:
When editing I want to be able to change the attributes of one field and upon doing this allow for the automatic update of another field in the same attribute table.

Essentially I have one layer with a code, description and legend information.

I would like to be able to edit the code and have the description and the legend information update with this edit with its correct description and legend information.

Is there any way to do this within ArcMap's tools or an associated script?


texts: Pythonic solution for changing shapefiles properties in QGIS

texts:
I'm loading several shapefiles into QGIS using the Python console. The script works by reading a list of directories and a list of shapefiles to load from each directory, then it loads each file. Like this:

encList = "/foo/encList.txt"
shapeList = "/foo/shpList.txt"
path = "/bar/"
with open(encList) as encs:
    for enc in encs:
            with open(shapeList) as shps:
                    for shp in shps:
                            file=path+str(enc).rstrip()+'/'+str(enc).rstrip()+str(shp).rstrip()+".shp"
                            print file
                            qgis.utils.iface.addVectorLayer(file, str(enc).rstrip()+str(shp).rstrip(), 'ogr' )

                            #Use loaded layer as active layer to set the CRS
                            myLayer = qgis.utils.iface.activeLayer()
                            myLayer.setCrs(QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId))

I would like to also configure the shapefile layers as I go along. As you would if you right click on a layer and select properties.

Specifically, I would like to change the line colours and label display. In my head I'd need something like this pseudo-code added into the loop:

if shapefile == line:
   then shapefile.setColor(black)
if shapefile == points:
   then shapefile.setStyle(pointDisplacement)
   ans shapefile.setStyle.lable('nameOfPoint')

Or something like that. I have figured out how to do the conditions, I just need to understand how to change the attributes. Does anybody know of a way or a tutorial?

(I'm new to QGIS, but know my way around Python)


texts:
I am tasked with sorting Zoning codes numbering over 100 to just 5 (Residential, Office, Commercial, Industrial and Misc).
For whatever reason I cannot get Arcade to recognize a text attribute other than the first two statements.

I've tried the following with no success:
if ($feature.ZONE == "C-1"){
    $feature.ZONE1; 'Commercial'}
else $feature.ZONE1; 'Miscellaneous'

I want any Field containing a value "C-" or "CB-" to be Commercial,
"I-" to be Industrial, "R-" residential and "Misc" everything else.
var zone = $feature.ZONE;

if (find('C-', zone,0)>0) {

return 'Commercial'
};

if (find('O-', zone,0)>0) {
return 'Office'

};
if (find(['R-',"X-","SH","SR"], zone,0)>0) {
return 'Residential'

};
else {
return 'Misc'
};

Am I just using the wrong processing tool?


texts: Setting project and layer CRS in PyQGIS with setCrs() has no effect on the map canvas

texts:
I'm using the following code to set the project CRS in a Python script:
#creates the project and projectRoot objects
projectObj = QgsProject.instance()
projectRoot = projectObj.layerTreeRoot()

#sets the project CRS
projectCrs = QgsCoordinateReferenceSystem.fromEpsgId(3395)
projectObj.setCrs(projectCrs)
assert projectCrs.isValid()
print(projectCrs.isValid())

I'm using the following code in a for-loop to set the CRS for all layers:
shpSavedLayer.setCrs(projectCrs)

What I get is this:

Although, the QGIS Status Bar, Project Properties Window, and Layer Properties Window for every layer state that the CRS is set to EPSG:3395, there is clearly something wrong with the projection.
If I run the same code with the above lines commented out, then set the project CRS to EPSG:3395 via the Project Properties Window, I get this:

which looks a lot more accurate.
What's happening here? From the discussion on GIS SE, I'm guessing this has to do with the difference between setting the CRS and reprojecting the layer?


texts: Determining Bounding Points of UAV Images

texts:
I know the EXIF data from drones contains the GPS point central to the photo to provide photo location. What I'd like is to determine the lat/lon of the four corners of the image. I've done a pretty focused Google search and also checked this site to no avail.

Does anyone have insight into how this might be done? My initial thoughts are it would somehow have to incorporate the height AGL of the drone when the image is taken, the image size in pixels, and possibly some of the camera info (focal length or such).

What I'm trying to do is set the bounding coordinates for the photo and then determine if there is a GIS asset in the image area. The photo could then be linked to the asset in the attribute table and brought up via a hotlink.

How can I find the coordinates of the photo corners?


texts: How to read the GEOMETRY table inside a sqlite database

texts:
I'm working on an android app which should display some lineobjects stored in a sqlite database. This sqlite database is created through an export in QuantumGIS.

My first question is it a real sqlite database or is it a so called spatialite database?

But my main question is how to read the column GEOMERTY. This column has the dataformat BLOB. When i open my database with a tool called SQlite database browser this column is empty.
When i open the same database with the Firefox extension SQLite Manager it gives me a value like X'01020000000200000089C8500C60FC2A403D2E994C25404A405C51DE4DDCFC2A40BA85E1865A404A40'.

And when i open this database on an android device it gives me a value like [B@408acb78 for the GEOMETRY column.

Which markup language is used for this column? Is it Well-known text, well-known binary or something totaly different?

Does anyone know some answers for my questions? Or maybe even someone worked on a similar project (display objects from a sqlitedb on an android device)?

Thanks for any answers...


texts: What exactly does the ArcGIS Server service do? SQL Server service?

texts:
What is the purpose of the ArcGIS Server service? It's not used at all to do a direct connect to an SDE database, right? That would just use the SQL Server service?

While we are on the ArcGIS Server topic, what exactly is the windows user account that ArcGIS Server creates (default 'arcgis') used for? What is its purpose?

If I create an SDE database and create a user for it, when that user connects to the database using a direct connect from his laptop- what is going on? What windows user account on the server is being used, or is that user just directly connecting to the SQL Server service over the network?

Any reading material on this subject so I can better understand what's going on?

Thanks for any help.


texts: Add feature ID to feature collection Google Earth Engine

texts:
I have some code, from the help of this post that calculates monthly averages per year for a region of interest and exports it to a csv.

var UK_SST = ee.ImageCollection('NOAA/CDR/SST_WHOI/V2').select('sea_surface_temperature')
    .filterDate(ee.Date('1990-01-01'), ee.Date('2019-01-01'))
    .filterBounds(ROI)

// Pick the scale from the first image
var scale = UK_SST.first().projection().nominalScale()

// month data for dataset

var startyear = 1990;
var endyear = 2018;

var startmonth = 1;
var endmonth = 12;

var startdate = ee.Date.fromYMD(startyear, startmonth, 1);
var enddate = ee.Date.fromYMD(endyear , endmonth, 1);

var years = ee.List.sequence(startyear, endyear);

var months = ee.List.sequence(1, 12);
var monthlySST =  ee.FeatureCollection(
  years.map(function (y) {
    return ee.FeatureCollection(months.map(function(m) {
      var w = UK_SST.filter(ee.Filter.calendarRange(y, y, 'year'))
            .filter(ee.Filter.calendarRange(m, m, 'month'))
            .mean();
      var dict = w.reduceRegion({
        reducer: ee.Reducer.mean(),
        geometry: ROIEdit,
        scale: scale,
        maxPixels: 1e13
      });
      var sst_mean = ee.Algorithms.If(
        dict.contains('sea_surface_temperature'),
        dict.get('sea_surface_temperature'),
        null
      );
      return ee.Feature(null, {
        'sst_mean': sst_mean,
         'year': y,
         'month': m,
         'system:time_start': ee.Date.fromYMD(y, m, 1)
      })
    }));
  })
  ).flatten().filter(ee.Filter.notNull(['sst_mean']));

Export.table.toDrive({
collection: monthlySST,
description: 'monthlySST',
fileFormat: 'CSV'
});

The region of interest is broken up into two regions. I have written code to add the ID name as a property to the ROI feature collection.

// adding names to ROI
var FeatCollectAsAList = ROI.toList(ROI.size());
print(FeatCollectAsAList, 'ROI');

// map a function over the list to rename the IDs
var ROIEdit = ee.FeatureCollection(FeatCollectAsAList.map(function(feat){
  var id = ee.Feature(feat).get('id');
  return ee.Feature(feat).set("system:index", id);
}));

I can't quite figure out how to add this to the export. I tried using the set function to add a new column as 'ROI' but it just came out empty.

 return ee.Feature(null, {
    'sst_mean': sst_mean,
     'year': y,
     'month': m,
     'system:time_start': ee.Date.fromYMD(y, m, 1),
     'ROI: RIEdit.get('id')
  })

I could just export the two regions separately and join them together but I thought it might be simple enough to add the ROI as an extra column.


texts:
searching for the maximum speed I can get from our mapcache service, I'm going to make some test in a new server (AWS EC2) with Nginx as a reverse proxy and Apache before to update the live system.

our Mapcache uses the SQLite cache as we run out of inodes if we try to cache the whole UK with disk cache.

At the moment our Mapcache service is set up in Apache in http/1 and apache default config. I've just added apache compression and cache

this is the map service.

https://www.buchananmapping.co.uk/

we use it to seed about 60 websites (the project it's a map-based app, so it require a map that we seed with the previous service) and around 15000 connections a month.

I'm using 128 x 128 tile size and the map requires a lot of images to be displayed.

How stable is Mapcache 1.6.1 with Nginx and how should I setup Mapcache?

I know there are instructions but I don't understand some points.

https://www.mapserver.org/mapcache/install.html#nginx-specific-instructions

these are the steps to build my actual setup

...
cd mapcache-1.6.1
mkdir build
cd build
cmake   -DCMAKE_PREFIX_PATH="usr/bin/sqlite3" \
        -DWITH_SQLITE=1 \
        -DWITH_BERKELEY_DB=0 \
        -DWITH_TIFF=0 \
        -DWITH_GEOTIFF=0 \
        -DWITH_FCGI=0 \
        -DWITH_PCRE=0 \
        ../
...

I add this to the httpd.conf:

LoadModule mapcache_module    modules/mod_mapcache.so

<IfModule mapcache_module>
  <Directory /usr/local/src/mapcache-1.6.1>
    Require all granted
  </Directory>
    MapCacheAlias /mapcache "/usr/local/src/mapcache-1.6.1/build/mapcache.xml"
</IfModule>

If I want to use Nginx as a reverse proxy (in Http/2) and speed up the cache I need to build it from scratch as in the instructions and change the configuration to use Mapcache with Nginx? Or still, I will use both of them? Can I use yum install Nginx and then add the module?

The part about The basic configuration without any proxying.... Where should be put? In the mapcache.xml?

Is there any particular apache and Nginx config that I should use?

I'm using apache MPM event in the live system but in the test server I'm using MPM prefork, they told me that it's better and probably will be implemented also in the live system.

I'm also having a lot of problem at the time to seed the map, it takes ages.
In the test server I'm seeding a small portion of UK but still it requiring a lot of times.

I'm using these resolutions 280 140 70 28 14 7 6.16 2.8 1.4 0.7 with this script

su -s /bin/sh apache -c "/usr/local/bin/mapcache_seed -c /usr/local/src/mapcache-1.6.1/build/mapcache.xml -t bccache -g bcgrid -n 400"

I know the rule of the -n parameter but if I use -n 4 it simply takes even more time and when I check the CPU load is not even in use.

Below the square I'm using to make tests.


texts: Historical US zip code allocations and locations?

texts:
Is there a data source available that has the full history (right back to the 1960's) of each US zip code?

By history I mean, for each zip code:

the date it was created, if later than 1 July 1963,
the date it ceased to exist, if it no longer exists
any splits/merges/swaps/renumbering of any part of the zip code, and the date it happened
the named places (primary and alternate) for the zip code (or any other way to locate it), and the dates of any changes

Even better (for GIS) if it has:

the center point (geographic or population) of the zip code, on a given date or range of dates
the pseudo “boundary” of the zip code (or closely related polygons like ZCTAs, in recent years), again for a specific date or period.

The project I'm working on is attaching locations to historical data from the 1960's, 70's and 80's (and beyond), where the locations are identified by the zip code as it existed at the time.

In most cases, these are are same as today, but especially in faster-growing states it can be wrong to assume that a zip code covers the same area 20-50 years later, and there have been many other changes including renumbering.

Knowing the extent of each zip code decades ago is also useful for long-running social and medical studies, where a zip code (from the period) is often the only geographic identifier available (despite being unsuitable for this purpose).

I've researched this for a while and believe I can reconstruct a large part of the history from primary sources I've located.  I think that it would be useful to many others, and I'd release the results as open data.  But it's a sizable task, I don't want to reinvent the wheel.

There are some commercial sources that might go back to the 1990's, but my main interest is the earlier period, and I want the results to be open data that I can share, so they're unlikely to be suitable or have the right license.

So, does a history of every US zip code (from the 1960's on, not just recent years), ideally with geographic co-ordinates, already exist, in a form that can be re-used?


texts: Adding an image instead of standard svg to Polymaps

texts:
I wanted to add a custom marker to my demo: http://drewwells.net/craigmaps/

Instead, I had to make a red dot to specify the place I wanted.  Adding an image seems to want to layer that, but all I want is to stick the center of an icon to a lon/lat I specify.

On the same topic, is there any other way to put a point on the map than setting up a geoJSON with geometry set to point.  This seemed counterintuitive, but was the only way I could figure it out with just the docs and demo to go buy.


texts: Add PostGIS spatial functions to a custom schema other than "public" in PostgreSQL

texts:
Recently, I created a PostGIS 2.0.3 database on a PostgreSQL 9.1 database server using pgAdmin. The "PostGIS" extension was found installed in "Extensions". Al spatial functions were added to the "public" schema. That's fine.

Now I want to store all my data into a new scheme called "gc". However, how can I make all spatial function installed in that "gc" schema? There is no single function in the schema. However, when I tried to import/new a feature class from ESRI ArcCatalog 10.1 to this schema, it worked! The feature class could be imported and displayed in QGIS.

Could anyone give me any tip or idea about it?

I am new to PostgreSQL and PostGIS.


texts: Erdas Imagine 2011 removing points from polygons

texts:
I've been running into an issue with Erdas Imagine 2011. I have been creating training sites in a polygon shapefile to use with a decision tree classifier but it seems like the software keep automatically simplifying/removing points from the polygons I draw. This only seems to happen when I am zoomed in past a certain scale.

I've tried copying the shapefile and using 'Save As' to create a new copy but neither fixed the issue. New shapefiles created in Erdas do not seem to have this problem (although at one point I swear that new shapefiles were having this issue but have not been able to recreate it). I have also tried editing this shapefile in ArcGIS and it seems to work fine.

Before this started happening I had viewed the data in ArcCatalog. Could that have causes this issue? Is there some setting I am missing?

I attached two screen shots to try and clarify. I made both ellipses the same way (using the 'Ellipses' tool on the 'Drawing' tab). This is an exaggerated example but shows the issue.


texts: Adjusting Spatial Accuracy of Ortho Imagery in ArcGIS Desktop?

texts:
I have about 35 square miles of orthorectified, high resolution, aerial imagery that is broken down into 620 individual tiff files.  I have created a mosaic dataset of the imagery and I am working with ArcGIS 10.5 with all extensions.

I need to increase the accuracy of the imagery placement as the imagery was collected without the use of ground control and there are (x,y) errors of 1 to 3 feet across the area. I do have hundreds of ground control points that are survey quality and are visible throughout the imagery.  I also have a high accuracy DEM for the area created from LiDAR data, however, I really do not need to fully orthorectify the imagery again but rather just slightly spatially adjust the data.

Is there an ArcGIS tool available to correct this imagery?

I did look into using Bundle Block Adjustment but I am not sure if this is the best approach for the needed correction.


texts:
I using PyQGIS in my python application，My program couldn't find org provider and failed to create layer.

My code and environment are as follows.

The env:

The Code:

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

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

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

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

        self.setCentralWidget(self.canvas)

        self.actionZoomIn = QAction("放大", self)
        self.actionZoomOut = QAction("缩小", self)
        self.actionPan = QAction("平移", self)

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

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

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

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

        self.pan()

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

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

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

if __name__ == "__main__":

    a = QgsApplication([], True)
    QgsApplication.setPrefixPath('D:/Program Files/QGIS 3.4/apps/qgis-ltr1', True)

    QgsApplication.initQgis()
    print(QgsApplication.showSettings())

    print(QgsProviderRegistry.instance().pluginList())

    r = QgsProviderRegistry.instance()
    if not 'ogr' in r.providerList():
        print('Could not find OGR provider!')
    else:
        print('Providers found ok!')

    layer = QgsVectorLayer("E:\\cosm-gis-demo\\data\\data\\guodao2.shp", "buildings", "ogr")
    if not layer.isValid():
        print("failed")
    mainWindow = MyWnd(layer)
    mainWindow.setWindowTitle("GIS Demo")
    mainWindow.show()

    a.exec_()

The Console:


texts:
ST_Volume works with shape data pasted into the query in this form:

SELECT (abs(ST_Volume(design)) -
        abs(ST_Volume(ST_3DIntersection(design,scan))))

FROM   (SELECT (ST_MakeSolid('POLYHEDRALSURFACEZ( ...definition goes here...) ')) AS design,

(ST_MakeSolid('POLYHEDRALSURFACEZ(...definition goes here...)'))  AS scan )

AS t;

But if I enter the data into a table and try to read it into the query, in this way, ST_Volume outputs 0:

WITH sd AS (SELECT data_value AS design
        FROM data
        WHERE data_label = '3D Design TINZ'),
     ss AS      (SELECT data_value AS scan
        FROM data
        WHERE data_label = '3D Scan TINZ')

SELECT
sd.design,
ST_IsSolid(sd.design) ,
ST_IsSolid(ST_MakeSolid(sd.design)) ,
ST_Volume(ST_MakeSolid(sd.design)),
ST_Volume(ST_MakeSolid(ST_GeomFromText(sd.design))),
ST_3DArea(sd.design),
ST_3DIntersection(sd.design,ss.scan)
FROM sd,ss;

Output is:

So the ST_MakeSolid toggles ST_IsSolid from false to true, but the ST_Volume function returns 0, meaning that it does not recognise the input as a solid, or ...?

But the ST_3DArea and ST_3DIntersections functions appear to work fine.


texts: Overriding georeferenced bounds when generating Tiff in Gdal for Python?

texts:
I need to convert an "Aura OMI NO2 Data Product" in .he5 format to a Tiff.

Using Python, I achieve the conversion with the following code:

trans = "gdal_translate -of GTiff -sds -a_srs WGS84 -a_ullr -180 90 180 -90" + " " + input_file + " " + output_file"
os.system(trans)

I am trying to write this command within Python, but have not found how to override the georeferenced bounds as the GDAL command  -a_ullr ulx uly lrx lry does.

The code I have is the following:

# Import gdal and osr
import gdal
import osr

# Open he5 file
src_ds = gdal.Open(input_file)

# Get the 4th subdataset and open it
subdatasets = src_ds.GetSubDatasets()
mysds = subdatasets[3][0]
sub_ds = gdal.Open(mysds)

# Set Projection
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
sub_ds.SetProjection(srs.ExportToWkt())

# Convert to Tiff
format = "GTiff"
driver = gdal.GetDriverByName( format )
dst_ds = driver.CreateCopy( destination_tif, sub_ds, 0 )

# Clean up
dst_ds = None
src_ds = None
sub_ds = None

I need to set the bounds of the generated raster, as it doesn't match up correctly. In the following picture, the top raster was generated with my imbedded Python code, whereas the bottom was created with the GDAL_translate.

Furthermore, is it better practise to assign the Projection and Bounds to the subdataset or to the Tiff once it has been generated?


texts: How to create and connect a great elliptic that connects at both ends?

texts:
I have two points and would like to construct a great elliptic that passes through both of them, eventually circling completely around the Earth.
I used the following workflow (https://www.youtube.com/watch?v=ZKNRBy22QWs) to create a long line, but it couldn't meet up at both ends. I also used the built in Construct Geodesic -> Great Elliptic in the Editor toolbar but it also would not connect at the ends.
I would ultimately like to break this up into 100 mi segments, add points to those vertices, then export both the points and line segments as KMLs.
Any ideas on how to approach this?


texts: Display adjacent polygons without the shared borders becoming darker than the others?

texts:
When plotting adjacent polygons, for instance, the states of a country, the lines are usually thicker/darker in the border between two polygons, compared to a polygon on the edge of the map. That happens because that border is drawn twice, once for each polygon. This is even a bigger problem when we want to use semitransparent or dashed lines.

The images below illustrate the problem.

Image 1 The dashes from one polygon don't fit the dashes from the other polygon, resulting in different sized dashes, or no visible dashes at all.

Image 2 Semitransparent lines get darker when drawn over each other.

This problem arises wherever we try to draw maps, be it a GIS software (such as QGis), R plots or HTML5 canvas.

Since this is such a common problem, I wonder if there's a clever solution already worked out, besides the painting of simple black lines (which actually won't solve the problem, because in most devices nowadays two identical lines drawn over each other create a thicker line).


texts: Is PostGIS-2.x raster in text format (WKT) only?

texts:
I was reading PostGIS FAQ and  this tutorial. From all that I can tell, it seems that PostGIS raster is a text format, i.e. WKT or well-known-text. I was wondering if PostGIS raster data are text-formatted only, or if there is also a binary format PostGIS raster.

If it's only WKT, does that mean PostGIS rasters are potentially more space consuming and slower to load and display (than a regular grid of binary values)?

I am asking because I am thinking about whether to use PostGIS raster for e.g. a webgis, and whether choosing PostGIS raster will lead to a performance hit.


texts: How to connect a QgsMaptool with a widget pushButton

texts:
I've write this QgsMaptool above and it works great in python console

imports...

class obsCreator(QgsMapToolEmitPoint):

    def __init__(self, iface):
        self.iface = iface
        self.canvas = QgsMapCanvas()
        QgsMapTool.__init__(self, self.canvas)
        QgsMapToolEmitPoint.__init__(self, self.canvas)
        self.layer = self.canvas.currentLayer()
        self.x = float
        self.y = float

    def canvasPressEvent(self, event):
        point = self.toLayerCoordinates(self.canvas.mouseLastXY())
        self.x = point[0]
        self.y = point[1]

    def canvasReleaseEvent(self, event):
        feats = []
        pr = self.layer.dataProvider()
        fields = self.layer.fields()
        fet = QgsFeature
        geom = QgsGeometry().fromPointXY(QgsPointXY(self.x, self.y))
        fet.setgeometry(geom)
        feats.append(fet)
        fet.setAttributes([1, 'test'])

        if event.button() == Qt.RightButton:
            self.canvas.unsetMapTool(self)
        else:
            pr.addFeatures(feats)
            self.layer.triggerRepaint()
        pr.addFeatures(feats)
        self.layer.triggerRepaint()

but, I want to connect it with a pushButton in my dockwidget:

    def run(self):
        if not self.pluginIsActive:
            self.pluginIsActive = True

            if self.dockwidget == None:
                self.dockwidget = revEnvDockWidget()

            self.dockwidget.closingPlugin.connect(self.onClosePlugin)

            # show the dockwidget
            self.iface.addDockWidget(Qt.RightDockWidgetArea, self.dockwidget)
            self.dockwidget.show()

            # Clear comboBox (useful so we don't create duplicate items in list)
            self.dockwidget.obsComboBox.clear()

            # Add all items in list to comboBox
            self.dockwidget.obsComboBox.addItems(Handler.obsListCombo(self))

            canvas_clicked = obsCreator(iface.mapCanvas())
            self.dockwidget.hookPushButton.clicked.connect(iface.mapCanvas().setMapTool(canvas_clicked))

and I get this error:

WARNING    Traceback (most recent call last):
              File "E:\_Code\QGIS\rev_env\rev_env.py", line 268, in run
              self.dockwidget.hookPushButton.clicked.connect(iface.mapCanvas().setMapTool(canvas_clicked))
             TypeError: argument 1 has unexpected type 'NoneType'

I`ve based my code in this question: How to get co ordinates of points on mouse click in PyQGIS.
Am I missing somethig?


texts:
I have toposheet in .PDF format and I have converted it into tiff using ArcGIS 10.3 conversion tool.

When I try to insert tiff file it is not showing in output folder.!


texts:
I have a map of a city that is divided into 65 sectors (building lots in purple, sector boundaries in red):

In my shapefile of building lots, I have an attribute that is the total population within each lot (usually between 1 and 5).

Within each sector, I would like to create compact clusters of population size 50. Is there a plugin or tool in QGIS that can do this?


texts: Arcgis select by attribute the day of the week in date field

texts:
I am trying to select a specific day in the "Select by attributes" tool.
I know you can select using  a day from 0-31 like this:

EXTRACT(DAY FROM "TimeStampStart") = 5

But I was wondering is there a way to select a specific day in the week (sunday to saturday)? for example select only days of week =  tuesday?

P.S
This is not the answer I am looking for:
https://pdgisusers.org/2010/12/15/extract-day-of-the-week-from-a-date-field-in-arcgis/

and already looked into this :http://support.esri.com/technical-article/000011531

I have a csv file with a datetime field.


texts:
I want to put barbs on my map and everything is ok for the most maps until such error occurred

  org.geotools.referencing.factory.DeferredAuthorityFactory disposeBackingStore
  INFO: Disposing class org.geotools.referencing.factory.epsg.hsql.ThreadedHsqlEpsgFactory backing store
  org.geotools.renderer.style.ImageGraphicFactory getIcon
  WARNING: Unable to read image at http://windbarbs.kl.com.ua/small_pic/icons8-wind-speed-less-1-32.png : Can't create an ImageInputStream!

  org.geotools.renderer.lite.StreamingRenderer fireErrorEvent
  SEVERE: GC overhead limit exceeded
  java.lang.OutOfMemoryError: GC overhead limit exceeded


texts: Issue loading Fortran dll from QGIS 2.8 python plugin on Windows

texts:
I need help to call a Fortran shared library (DLL) from a QGIS python plugin.

For this purpose I created a simple Fortran dll with the function to add two integers.

Also I create a simple python code that invokes the Fortran dll to perform the addition.

This python code successfully got executed using python.exe in the Python installed path (and the Python.exe in the QGIS Bin directory)

But on trying to load this dll from QGIS > Plugin > Python console, with the below two lines,

from ctypes import *

self.gtflib = cdll.LoadLibrary('fadd.dll')

the following error is displayed:

Traceback (most recent call last):
  File "", line 1, in
  File "C:\PROGRA~2\QGISWI~1\apps\Python27\lib\ctypes__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "C:\PROGRA~2\QGISWI~1\apps\Python27\lib\ctypes__init__.py", line 365, in init
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

The same error happens in my actual plugin too.

I have the fadd.dll copied to the 'C:\PROGRA~2\QGISWI~1\bin'.

Is there anything specific needed in QGIS to load the fortran dll.

The Fortran source code:

integer function add2i(x, y)
  integer, intent(in) :: x, y
  add2i = x + y
end function add2i

This is compiled with gfortan on windows to create fadd.dll.

The Python code:

from ctypes import *
libadd = cdll.LoadLibrary("./fadd.dll")

method = libadd.add2i_
x = c_int(47)
y = c_int(11)
print "x = %d, y = %d" % (x.value, y.value)
result = method( byref(x), byref(y) )
print "x = %d, y = %d, z = %d" % (x.value, y.value, result)

, and the Python file to invoke the dll is attached.


texts: Smeared labels in Qgis2threejs plugin - QGIS

texts:
I created 3d height map with qgis2threejs plugin:

My problem is that the labels of the black points is smeared as it marked.
Is there a way to present the labels in other way in the 3d image?


texts: Is it possible to create a LASCatalog with lidR that reference LAS files in multiple directories?

texts: As new or updated LAS data is received, I would like to be able to integrate that into the surrounding data of the area (for normalized data, CHMs, etc. for example). I.e. I want to insert "patches" that take advantage of lidR's buffering capability, but to have LAS files organized in different spots (e.g. based on date acquired). I don't think lidR is meant as a data management tool but binding catalogs together with catalog_intersect might be helpful in this case. edit: or ctg$processed instead of catalog_intersect


texts:
My code:

var inter = new ol.interaction.Select();
inter.getFeatures().on('add', function(event) {
var properties = event.element.getProperties();
var coordinates = event.element.getGeometry().getCoordinates();
**var featureId = event.element.getProperties();**

I want to can do something like that --> event.element.getProperties().getColor or getValue...Finally, I want to get the green color  in this case

featureId=green


texts: Features often disappear in attribute table when edited

texts: using the most recent QGIS version, currently 2.18.3 on win64, I regularly experienced the issue that features disappear in attribute table with no reason after I made and saved edits. Fortunately, these features are not gone permanently (they just are not displayed in attribute table). Reloading the shapefiles usually fixes the issue, but it is very annoying and causes fears, data could be lost. I did not set filters or definition queries at all. This behavior happens on all my machines and has happened for at least two years. What could cause this behavior and how could I solve it?


texts: Geting and installing latest version of QGIS in Ubuntu?

texts:
I'd like to get the latest 64-bit dev build of QGIS on my Ubuntu setup.

How exactly do I go about it?

I assume it's some kind of arcane terminal command.


texts: How are the minimum X, maximum X, minimum Y and maximum Y coordinates calculated for a state's county?

texts:
I am working with the eBird API. The eBird website is where birders from around the world enter lists of species for a specific location.

The one API endpoint I was trying to work with returns data with a location name ("Wendy Park Reservation" or "Highland Cemetery" for examples) and GPS coordinates. But, it does not return a county name. So, I have been trying to figure out how to get a county name from the GPS coordinates for the report I am trying to produce using the API.

I found another endpoint in the API that gives regional information. The region I am interested in is a county.
I was able to get the minimum X, maximum X, minimum Y and maximum Y coordinates for each county in Ohio using this.

So, when I get a set of data back for a location, I use the GPS coordinates and see if they are greater then the min X and less than the max X, and also greater than the min Y and less than the max Y for a specific county's regional information. If they are, then that location is in that county. I set up a JavaScript program to do this. It works.

So, my question is: How does this work? How are the min X, max X, min Y and max Y coordinates calculated for a county?
My brain thinks: "These min/max coordinates have to correspond to a rectangular region." But, few counties are rectangular.

See the example of data below. This is for Cuyahoga County, Ohio.

["Cuyahoga", {
    'minX': -81.9712509999999,
    'maxX': -81.374603,
    'minY': 41.274688,
    'maxY': 41.63168
}]


texts: Suggestion about the database to be used with OpenLayers

texts: Can anyone suggest me which database to be used with OpenLayers? I have to store the values in a database table and retrieve them (trivial tasks). Which is better MySQL or PostGIS? Can anybody give benefits of these?


texts: How to extract and parse property from Mapbox vector tileset?

texts:
I have a Mapbox vector tileset (counties) from which I need to extract a property (p). It should be an array, but AFAIK Mapbox doesn't support array properties (right?); it turns them into strings. So I'd like to store the property in a variable and parse the strings to arrays. Something like this
var c2 = map.getSource('counties').features;
c2.forEach(function(county){
     county.properties.p = JSON.parse(county.properties.p);
});

But map.getSource('counties').features; does not work. Is there a way I can store the properties from my tileset?
This might be a duplicate of Storing a Mapbox-hosted vector tileset in a variable (Mapbox-GL-JS)


texts: Serving Vector Tiles to TerriaJS (TerriaMap)?

texts:
Does Terriajs support  mapbox vector tiles format?

I've created vector tiles with tippecanoe and am serving them with tileserver-gl I have not been able to add them to TerriaJS.

I do not see a catalog item for vector tiles.


texts: Select by location from multiple files and extract to shp with ModelBuilder?

texts:
I need to select data by location from multiple files and then to extract to separate shapefiles. I tried to implement this process using ModelBuilder through workspace iterator. However, the tool "select by location" cannot work with this iterator.

Do you have any idea how to do avoiding manually ways (the files are so many to do it manually)?


texts:
When I run gdal2tiles with this command I get tiles that look like the one below. The Tiff-file is fine, it shows fine in Qgis. The image is 7560x14517 pixels. I tried to scale down the image to 2000x3840 pixel and the it worked as expected.
gdal2tiles -w none -p raster -z 0-6 -s EPSG:3857 "C:\inprogress\warped_18_rotated_1620743705845.tiff" "C:\temp"

Is there some top limit in how many pixels the image can have in gdal2tiles? Or am I missing some argument that could fix this type of problem?


texts: How to speed up working with QGIS or is it slow?

texts:
I am a new QGIS user and I am curious about how slowly it is performing; it is possible that I'm asking more of it than I think I am. Here's what I think is the relevant information for assessing whether it's performance is unusually slow.

QGIS version 1.74
GDAL/OGR version 1.9.0
PostgreSQL client version 9.1.2
QWT version 4.8.0

Project info: 1 vector layer of polygons queried from a remote PostGIS database (query is simple and very fast) returning 160 total rows all in the project's defined coordinate space (WGS 84) and spanning the globe. The PostgreSQL table containing those rows occupies less than 130 kb of disk space, and the queried rows comprise pretty much the entire table.

System: MacBook OS X 10.7.3, 2.4GHz Intel Core Duo, 4GB RAM.

Performance: Rendering takes 5-10 minutes. In fact, any change takes nearly that long, including renaming the single layer; that really surprised me. No other memory-hungry applications are running concurrently.

This is frustrating because any modification of the project, however slight, requires a lengthy wait before the results can be assessed, and sometimes the application simply crashes without completing whatever I asked. Is this unusual?

Update:

I have Shapefiles of the same data. They are 45 files totaling about 100 MB. That figure is clearly discrepant with the size of the data set I described in my original post and it makes the slowness more understandable.

Update:

I just discovered the "Render" button at the bottom left of the QGIS map viewer. I feel like a bit of an idiot for not having noticed it before, but turning off rendering greatly increases the speed with which I can accomplish tasks for which immediate re-rendering isn't critical. I mention this here for the benefit of other new users.


texts: Use updatcursor to replace values in multiple fields

texts:
I have spent a couple days digging through forums here, ESRI help and elsewhere and each variation of the codes I have tried has not worked. As best as I can tell this is due to my attempt to loop through multiple fields or something to do with formatting when the fields parameter is collected using the field as text option.

#Simple search and replace script
import arcpy

#define where clause to format for correct database type
def buildWhereClause(table, field, value):
    """Constructs a SQL WHERE clause to select rows having the specified value
    within a given field and table."""

    # Add DBMS-specific field delimiters
    fieldDelimited = arcpy.AddFieldDelimiters(table, field)

    # Determine field type
    fieldType = arcpy.ListFields(table, field)[0].type

    # Add single-quotes for string field values
    if str(fieldType) == 'String':
        value = "'%s'" % value

    # Format WHERE clause
    whereClause = "%s = %s" % (fieldDelimited, value)
    return whereClause

# Retrieve input parameters: the feature class, the search term, the replace
# term, and the fields affected by the search and replace.
fc = arcpy.GetParameterAsText(0)
oldValue = arcpy.GetParameterAsText(1)
newValue = arcpy.GetParameterAsText(2)
fields = arcpy.GetParameterAsText(3)

# Create the SQL expression for the update cursor. Here this is
#  done on a separate line for readability.
whereClause = buildWhereClause(fc, fields, oldValue)

# Create the update cursor
rows = arcpy.da.UpdateCursor(fc, fields, whereClause)

# Perform the update and move to the next row as long as there are
#  rows left
for row in rows:
    row[0] = newValue
    rows.updateRow(row)

# Delete the cursors to remove any data locks
del row, rows

What I need it to do is obtain all the fields in which the user wants to replace the oldValue with the newValue by reading in the multiple fields the user has checked the box for. Then loop through each field and in any instance where oldValue occurs re-write it to = newValue until all the fields have been updated.

Added:

Here is the traceback info thrown when this is run as a tool inside Model Builder

Traceback (most recent call last):
   File "C:\arcgisserver\ETL_Scripts\Scripts\RewriteValues.py", line 44, in <module>
   whereClause = buildWhereClause(fc, fields, oldValue)

   File "C:\arcgisserver\ETL_Scripts\Scripts\RewriteValues.py", line 25, in buildWhereClause
   fieldType = arcpy.ListFields(table, field)[0].type
IndexError: list index out of range


texts: Weighted average to make monthly LST in R?

texts:
How to make a monthly LST (MODIS) product from the LST day and LST night, knowing that it is a product of 8 days and some months are represented by four or more pictures in addition to the lack of LST night information.

I try to do it in R, but an average arithmetic does not represent a month, the idea is a weighted average but the lack of information harms the product.


texts: Creating value in QGIS based on multiple "OR"-conditions

texts:
Different cities are part of the same subregional group. I would like to assign this same name to all these cities. I want to live the other cells empty. So far I have tried these but it doesn't work:
CASE
   WHEN "l_co" = 'Romainville' OR 'Bagnolet' OR 'Bobigny' OR 'Bondy' OR 'Les Lilas' OR 'Montreuil' OR 'Noisy-le-Sec' OR 'Le Pré-Saint-Gervais' OR 'Pantin'
   THEN "EPCI" = 'Est Ensemble'
   ELSE ''
END

CASE
   WHEN "l_co" in ('Romainville','Bagnolet' ,'Bobigny','Bondy' ,'Les Lilas','Montreuil','Noisy-le-Sec' ,'Le Pré-Saint-Gervais','Pantin')
   THEN "EPCI" = 'Est Ensemble'
   ELSE ''
END


texts: How to Highlight a Feature layer within a graphic layer?

texts:
I have a map service that has 2 layers. One is a polygon layer that contains a combination of polygons, and the other is a point layer that contains many points located both inside and outside of the large polygon in the form of a graphic layer.

How to highlight the polygon layer within the point layer(in graphic form). using ArcGIS server and ArcGIS javascript api,


texts: Targeted Region of Interest Classification in eCognition

texts: Is there a method of targeting only specific areas for classification in eCognition? Say, maybe using pixel coordinate constraints?


texts: Displaying hdf5 file at correct location?

texts:
I have downloaded the INSAT-K1 VHR INSOLATION PRODUCT (https://mosdac.gov.in/catalog/doi/36). This is satellite data in hdf5 format. When I display the raster in either ArcGIS or QGIS it appears at the wrong geographic position (image attached).

The hdf5 files are GCS_WGS_1984, Datum: D_WGS1984. I have tried creating a mosaic dataset (ArcCatalog) with these details before adding the data but this has not helped. (I’m using ArcGIS 10.3 for Desktop).
I would like to correctly geolocate the raster in order to extract values at point locations from it.


texts:
I need dtm format that store only heights and scaling and left up position for saving storage

I glad to know if any stadard save heights that way


texts: installation of Google Earth Engine API in conda fails

texts:
I am trying to install Google Earth Engine api for Python, but am running into some problems. I am following the directions here. Within a conda environment, I can verify everything until step 6. When I enter python -c "import ee; ee.Initialize()" at the command line, I receive the error "No module named ee". However, conda list shows that ee has been installed via Pip.

Has anyone else had this problem? I have had ee successfully configured, but had to unfortunately delete everything because of ArcPro and so I am having trouble reinitializing ee.


texts:
I have a legend in my print composer and then made some adjustments with some layers in my project. In print composer, is there a simple way to adjust selected layers. Of course I can delete the layers and reimport them, or I can update everything and then adjust my legend. But I'm kind of looking for a button saying "update selected layers".

Is there a function like that?


texts: Analyze Datasets (Data Management) - what is the output?

texts:
I recently completed a Analyze Datasets procedure on my ArcGIS 10.1 SDE. However, I could not find a tangible output to review.

Does anyone know where I can find the output?


texts: Creating PolylineZM from Points using ArcGIS Desktop?

texts:
I have a point feature class that is essentially hundreds of vertices along a single line.  The Attribute Table contains MD (Measured Depth) values, XY fields of each point feature, and a ID field for that line.

Is this enough information to create a PolylineZM featureclass?

My end game is to use a table (has a single record matching the ID of the line and a Minimum and Maximum value that should both be along the line) and cut a smaller segment from the line using those two values (aka Make Route event layer).  My issue is producing a PolylineZ or PolylineZM that I can use for this routing method.  I tried Points to Line but it only produces a Polyline.

Once I have the correct Polyline type I believe I should be able to "route" down the lines measurements correctly and clip.


texts: Snapping options with Move Feature in QGIS3

texts:
Is it possible to snap (i.e. precisely align) features when using the 'move feature' tool in QGIS3? I understand that you couldn't in earlier versions but wondered whether it was possible now.
Someone suggested a workaround for previous versions that involved using the vertex tool to move the feature but it doesn't seem to work.


texts: what are the pre-processing steps required for landsat etm+ with GRASS 6.4.3 prior to land cover change detection? The product used is L1T.


texts: GDAL Error in CreateCopy: in method 'Driver_CreateCopy', argument 3 of type 'GDALDatasetShadow *'

texts:
I'm working on a simple script using GDAL Driver.CreateCopy function, but I keep getting the same error.
The script is very basic:

import os,arcpy,sys
from osgeo import gdal

source_folder=r'E:\to_conv'
conv_folder='E:\conv'
compression_type='JPEG'
compression_quality='70'

arcpy.env.workspace=source_folder
rasters=arcpy.ListRasters("*","TIF")
for raster in rasters:
    tiff_file=os.path.join(conv_folder,raster)
    source_file=os.path.join(source_folder,raster)
    print(source_file)
    try:
        dformat="GTiff"
        driver = gdal.GetDriverByName( dformat )
        metadata = driver.GetMetadata()
        if metadata.has_key(gdal.DCAP_CREATE) and metadata[gdal.DCAP_CREATE] == 'YES':
            print 'Driver %s supports Create() method.' % dformat
        if metadata.has_key(gdal.DCAP_CREATECOPY) and metadata[gdal.DCAP_CREATECOPY] == 'YES':
            print 'Driver %s supports CreateCopy() method.' % dformat
        src_ds = gdal.Open(source_file)
        dst_ds = driver.CreateCopy(tiff_file,source_file, options=["ALPHA=YES"] )
    except Exception:
        e=sys.exc_info()[1]
        print ("Error converting "+ source_file + " to " + tiff_file + ": " +str(e))

This is the error that I keep getting:

E:\to_conv\testfile1.tif
Driver GTiff supports Create() method.
Driver GTiff supports CreateCopy() method.
Error converting E:\to_conv\testfile1.tif to E:\conv\testfile1.tif: in method 'Driver_CreateCopy', argument 3 of type 'GDALDatasetShadow *'

Any help ?


texts:
In response to comments, I'll rephrase the question:

We're building a web based mapping and data querying system. The data are at several different scales, and should be queryable at these scales. The data itself should be searchable, based on key identifying features (names, etc.). The application is aimed mostly at a presentation level, so for serious analysis of the data search results should be available for download. If possible a interactive selection of features should be available for download also.

For preference we'd like to develop the app using an open source web mapping app, such as Open Layers, or MapFish.

Our key features beyond the basic pan/zoom are searching the data based on attributes, and downloading the data. Given that several frameworks implement search, can anyone suggest a web mapping framework where data download has been implemented, or an example of an online web map with this feature?


texts: Distance between two points - by ID in QGIS

texts:
I have a dataset of 350 or so individuals. Each individual has a start point (2 columns with Lat and Long) and end point (2 columns with Lat and Long). I would like calculate the distance between these in QGIS and have the output as a new column in the data set. (so for each row calculate the distance between two points)

Now - I have achieved this in the R statistical package pretty easily with the following code:

library(geosphere)

Dataset$distance<-distVincentyEllipsoid(Dataset[,c('gps.of.start.point_e','gps.of.start.point_s')], bb[,c('gps.of.end_e','gps.of.end_s')]

What I have tried so far in QGIS: I can create two point layers - "start points" and "end points" and use a distance matrix to calculate the distances between points. I get the data I want but also get thousands of permutations that I am not interested in and so sorting them and extraction them for my data set is time consuming and difficult.

Is there an easier way of doing this in QGIS?


texts:
I am trying to understand topology checker results and frankly i dont get it - probably i am doing something wrong.

Source - Point layer
Target - Polygon layer

Must be inside - that is working as expected. I created 3 points and polygon that is covering only 2 of them. The checker shows one point outside.
Must be covered by - running the example above shows all 3 points are incorrect. As i understand the "must be covered" rule also applies for boundaries so i created new layer with 3 points, turn snapping to them and drew a polygon. Then again run checker. It shows 2 points incorrect (red on the screen below). Why???

Must be covered by endpoints of - i created 3 points. Turn snapping on. Drew a line using all of them. Run checker - 3 points incorrect

Using QGIS 2.6.0 Brighton.

EDIT:

It seems that snapping may not be working properly. Or again i am doing something wrong. That could explain why topology gives wrong results.

I set snapping to points layer using 4 pixels and when i was drawing the points changed color into red but now i did the following and again got strange results:

Turned line layer into points (extract node)
Union the extracted points with source points
Run check for duplicates --> There were no duplicates (!?)

So now the new questions are :
1. Does actually snapping create exact same vertice? (with same coordinates)
2. Is it possible to set up topology checker tolerance. I read somewhere that this feature is not implemented.


texts: Insert spatial record to posgres/postgis tables using PyQGIS failed

texts:
I try to insert spatial record to postgres/postgis using PyQGIS but I don't get that record on my postgre/postgis table after the execution, and I don't get any error too.
Here my code :

sql = "INSERT INTO gis.tx_bidang2(numb, d_nop, d_luas, geom, aktor) VALUES (%s, %s, %s,%s, %s);"
        data =(91,'727100000000000000', 0,'0106000020EE7F00000100000001030000000100000006000000A0D5979A27E02841AAA0D59F4DE86241433A6F613FDF2841B818D26D82E76241D8264A6693EF2841AF4D940C52E76241D9B589E2E6F22841B1DCD306E8E762411CF0F8F3C2ED2841F5A58216D5E86241A0D5979A27E02841AAA0D59F4DE86241','septin',)
        conn = psycopg2.connect("dbname='db_pbb' host=localhost port=5433 user='postgres' password='septin'")
        cur = conn.cursor()
        cur.execute(sql, data)

Any ideas ?,

I got it done, here my script :

    conn = psycopg2.connect("dbname = 'db_pbb' host = 'localhost' port = '5433' user = 'postgres' password = 'septin'")
    cur = conn.cursor()
    sql2 = 'INSERT INTO gis.tx_bidang2(numb, d_nop, d_luas, geom, aktor) VALUES (%s, %s, %s,%s, %s);'
    data = (100, '727100000000000000', 0,'0106000020EE7F00000100000001030000000100000006000000A0D5979A27E02841AAA0D59F4DE86241433A6F613FDF2841B818D26D82E76241D8264A6693EF2841AF4D940C52E76241D9B589E2E6F22841B1DCD306E8E762411CF0F8F3C2ED2841F5A58216D5E86241A0D5979A27E02841AAA0D59F4DE86241','septin')
    cur.execute(sql2, data)
    conn.commit()
    cur.close()
    conn.close()


texts: Seeking update for QMarxan plugin of QGIS?

texts:
Is there a QGIS 2.4 update for the QMarxan plugin which at this stage only works on version 1.8.0?

I did read on one forum that this was in the process of being developed.


texts: Serving an image as a tile layer with node mapnik

texts: I have an image that I get from a server, I need to then take that image and tile it on the fly and pass it back to the user. Everything I see keeps using stylesheets which is not what I want/need. Is there a way to do this?


texts: Dynamic equal-interval raster styling for LiDAR data

texts:
I am looking for a way to create a colour map for raster (LiDAR) data in QGIS at equal-intervals (0.5 m, 1 m, 2m) which uses the same colour ramp whilst dynamically adjusting to the minimum and maximum of the raster data.

I have explored the different render types and saved and re-used styles. However, every time that I do this the minimum and maximum are applied from the previous raster used.

Essentially what I am after is a way to create and save a re-usable raster style in QGIS that will adjust to the maximum and minimum of LiDAR data. This will allow me to apply this style to any LiDAR data and visualise change in a consistent way.


texts: Openlayers Add features performance for 3000 lines

texts:
We would like to implement the function of Addfeature in openlayers to draw lines and push them onto a vector layer, and overlay this layer onto open street map or google map. Those lines are draw dynamically based on the query results from the database.
The only concern so far is the performance issue since we are anticipating about 3000 lines per operation. Has anyone worked on this kind of project before? Do you think it is too heavy on the client side?

Thanks!


texts:
I have downloaded a historic map of Poland.
I am having a problem aligning it to a modern map. I have tried various methods and coordinate system using over 50 points, but nothing works. It gets close, but never close enough. The best is when projected by Georeferencer from that site, but I cannot save it as GeoTIFF.


texts: Hiding advanced parameters in QGIS Processing Algorithm Script

texts:
There is an option, in the graphical modeler of QGIS 3.10, to mark input fields as "advanced" to hide them from user by default (advanced model parameters). I wonder how to achieve it from a Python script? I have tried to create a model from the graphical modeler and then convert it to a python script but it's not working (no "advanced" fields are marked in any way). I thought the addParameter() method of QgsProcessingAlgorithm class should have an additional parameter but it's not.

Is there a different way to create a collapsable box of advanced parameters in a processing algorithm window?


texts: Setting variable in ModelBuilder to change across several different steps with one edit

texts:
I have a series of counties I need to update some information for. I have four tables, each with the FIPS# at the end of the table (a dbf). For example:
1. TabA007
2. TabB007
3. TabC007
4. TabD007

These tables get joined to a layer and a field calculator tool is used to grab the field values. There are roughly 25 steps in this whole process, and when I move on to a new county (say, 008), I have to change the 007 to 008 in every step, sometimes twice in the step.

For example, joined field "TableA007.FieldName007" now needs to become "TableA008.FieldName008". Setting the different steps as parameters doesn't work for a number of reasons, one being that each join needs to be indexed before it can move on. This tool has only worked in Edit mode.

Is there a way to tell the model to make anything that is of one number into another?

Here's some code with one table and one process (the one I am trying to work has 4 tables, 4 joins, and twenty field calculations...simple but elaborate)

workspace = r"C:\Users\cJones\OneDrive - ABC\Documents\NRCS_SoilsMaster\NY115\spatial"

Local variables

soilmu_a_ny115 = "soilmu_a_ny115.SHP"

HYD115_DBF = "C:\Users\cJones\OneDrive - ABC\Documents\HYD115.DBF"

arcpy.AddIndex_management(soilmu_a_ny115, "AREASYMBOL;SPATIALVER;MUSYM;MUKEY", "", "NON_UNIQUE", "NON_ASCENDING")

Process: Add Join

arcpy.AddJoin_management(soilmu_a_ny115, "MUSYM", HYD115_DBF, "MUSYM", "KEEP_ALL")

Process: Add Attribute Index

arcpy.AddIndex_management(soilmu_a_ny115, "AREASYMBOL;SPATIALVER;MUSYM;MUKEY;Hydric;FARMLNDCL;SlopeLow;SlopeRep;SlopeHIgh;KFFact;HYDGRP", "", "NON_UNIQUE", "NON_ASCENDING")

arcpy.AddJoin_management(soilmu_a_ny115, "MUSYM", HYD115_DBF, "MUSYM", "KEEP_ALL")

Process: Select Layer By Attribute

arcpy.SelectLayerByAttribute_management(soilmu_a_ny115, "NEW_SELECTION", "\"HYD115.LSEQ\" IS NOT NULL")

Process: Calculate Field

arcpy.CalculateField_management(soilmu_a_ny115, "Hydric", "\"yes\"", "VB", "")

Process: Select Layer By Attribute (2)

arcpy.SelectLayerByAttribute_management(soilmu_a_ny115, "NEW_SELECTION", "\"HYD115.LSEQ\" IS NULL")

Process: Calculate Field (2)

arcpy.CalculateField_management(soilmu_a_ny115, "Hydric", "\"no\"", "VB", "")

Process: Select Layer By Attribute (3)

arcpy.SelectLayerByAttribute_management(soilmu_a_ny115, "CLEAR_SELECTION", "")

Process: Remove Join

arcpy.RemoveJoin_management(soilmu_a_ny115, "")

All the tables have the same name aside from the FIPS number.

I am using ArcGIS 10.6.


texts:
I'm trying write simple code line in PyQgis in PyCharm, have already set environment in PyCharm and seems to be working fine because I can iterate through f.i fields in vector layer proceed with success simpler operations. Ok, get to the point...
from qgis.core import QgsApplication
from qgis.core import QgsVectorLayer
import processing

polygonLayer = QgsVectorLayer(r'E:\Folder\layer.shp','','ogr')
out_fn =r'E:\Folder\out_layer.shp'
dissolve_field = ['_test_field']

processing.runAndLoadResults('gdal:dissolve',
                             {'INPUT':polygonLayer,
                              'FIELD':dissolve_field,
                              'OUTPUT':out_fn})

After running this few lines i get:
Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\IPython\core\interactiveshell.py", line 3427, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-10-35a681b9a5e0>", line 4, in <module>
    'OUTPUT':out_fn})
  File "C:\OSGeo4W64\apps\qgis\python\plugins\processing\tools\general.py", line 138, in runAndLoadResults
    for param in alg.parameterDefinitions():
AttributeError: 'NoneType' object has no attribute 'parameterDefinitions'

Software set:
Pycharm 2020.3.5;
QGIS 3.16, installed via OSGEO4W
Could you tell me what i'm doing wrong?
Thanks in advance for yours help!


texts:
I am trying to load a geofabrick .bz2 file into a file geodatabase using the OSM Simple Loader tool from http://arcscripts.esri.com/details.asp?dbid=15137
However it fails each time at this line:

frow.setValue("Node_ID",node[0].encode("Latin-1","replace"))
The error message is:

Runtime Error 999999: "the value type is incompatible with the field type Node_ID"

Unfortunately I am not familiar with python so am not able to attempt a fix for this error.  I am working with arc 10.2 and this was written for arc 9.2.

Hopefully someone can shed some light on this.

Here is the block of code

elif element=='/node' and hasvalidtags and ftype==0:

    #done with node lets load its shape
    frow = nodecursor.newrow()
    nodepnt.x=float(node[1])
    nodepnt.y=float(node[2])
    **frow.setValue("Node_ID",node[0].encode("Latin-1","replace"))**
    for f in standardFields:
        frow.setValue(f,'')
    for sTag in ftags:
        frow.setValue(sTag[0],str(sTag[1]))
    frow.SetValue('shape', nodepnt) #Load the shape
    nodecursor.insertrow(frow)
    taggednodecount+=1
    hasvalidtags=False


texts:
I'm new to ArcScene. I'm using a historic map, in ArcMap, to draw old roads, garden plots and tree locations. My trees are in a point shapefile in ArcMap, I brought them into ArcScene and I'm trying to figure out how I can display them in a way that is true to their height.

Can you provide a step-by-step instructional guide on how to do this? I used the surface elevations of my DEM to assign ZM values (see Z column). I also assigned an arbitrary 20ft value to each tree (see Z-offset column).

I think I have all of the correct information in my ZM tree shapefile but I'm just not using the correct tools to display what I need to display. I've searched for a couple of days online and can't find anything.

I noticed in your "How to correctly display trees in ArcScene" that your snapshot showed trees of different sizes. Hoping you can assist.

PS do you know of any additional tutorials I could use for this project? Web forums, youtube videos, books, etc. I would like to use ArcScene for future projects, this is my first. All future projects of interest would be created in the same way- bringing in a map or aerial, adding buildings (currently from sketchup), adding landscape features like trees, water and roads.


texts: How do government agencies come up with their data dissemination policies (and fees)?

texts:
Recently I was looking for data for a county. The county GIS staff shared some data with me with a nominal fee, provided that I send in a signed copy of their GIS Disclaimer Form. I also found a website that wanted $250 for the parcel data. I do not have the data from the county yet so I can't compare if the data are the same.

Is it reasonable to assume that the county has given permission to this commercial entity to "secondarily disseminate" that data?

Please let me know if this is the appropriate place for this question. I know this site prefers questions that can be answered, not discussed. But I'm really curious about management of data rights because from what I've seen, policies veer all over the place.


texts: Is there a way to associate a scale bar with a new, different data frame than the one used to create it?

texts:
If I remember correctly, in ArcView 3, after a scale bar had been created, you could change its properties so that it would show the scale for a different data frame than the one that was used to create it. I think the same applied to north arrows.

In ArcGIS 10, when you create a scale bar, it displays the scale of the data frame that is active when you create it. Is it possible to change that association after the scale bar has been created? As far as I know, if you want to use that scale bar (and whatever customizations you've made to it) with a different data frame, you can't, you need to delete it and insert a new one, re-creating any modifications you've made to the scale bar.

I'm asking because I have an MXD which has a layout I like, and I want to paste a data frame (containing a map I need) into it. But I can't re-use the scale bars and north arrow which already exist in the MXD, I'll need to recreate them.


texts: How to send road and contour labels to basemap so that they are underneath transparent polygon overlays?

texts:
I am making a bedrock geologic map and I would like to use a road and contour layer as a base. Currently, the contour interval and road labels show on top of the overlaying bedrock polygons, and the only solution I have found to sovle this inconvenience is to export the layers to an image manipulation program and adjust transparency there. The problem is that I would like this project to be fully contained within ArcMap for easy access by other users. In maplex, the only option I have come across is the prioritize labels based upon labels from other features, but not by layer display order. I have also tried to export a TIFF of just the contours and roads with labels to be reimported and georefernced, but I am also using a hillshade raster image on the base, and it is a hassle to continue exporting and importing to try to get transparency setting correct.

Is there any option to just display labels based upon their drawing order in the table of contents, or manually select where to place them in the order?


texts: QGIS Offline Editing Plugin scrambles layer structure on synchronization

texts:
At work our QGIS database is stored in a shared location. I tried using the Offline Editing Plugin in QGIS to store a copy on my local hard drive. When I tried to synchronize the offline project with the one stored on the shared location everything works fine, except that the layer structure gets scrambled.
Any solution or idea why this may happen?


texts: Optimal way to find points within polygon in PostGIS

texts:
I've developed an query to find points which are completely falls inside polygon by using PostgreSQL 10 and PostGIS 2.4 database. The query took long time (aprx 90mins) to produce the result. The number of records in point table is 1,7978034. The number of records in polygon table is 3130284. The query is:

select point_geom from "survey_point" where ST_Within(point_geom,(select ST_SetSRID(ST_BUFFER(st_extent(polygon_geom)::geometry,2),4326) from "parcel_polygon" where "parcel_id"='634206'))

The sub query written for getting the extent of one polygon with 2 meter buffer with the SRID 4326. And it gives the result in 32ms.

select ST_SetSRID(ST_BUFFER(st_extent(polygon_geom)::geometry,2),4326) from "parcel_polygon" where "parcel_id"='634206'

But at that same time, I have taken the above sub query result as text and applied in the main query as given below, it gives the result in 72ms.

select point_geom  from "survey_point" where ST_Within(point_geom,ST_BUFFER(ST_GeomFromText('POLYGON((334094.292130328 5836905.04292025,334094.292130328 5837221.59210733,335200.835864321 5837221.59210733,335200.835864321 5836905.04292025,334094.292130328 5836905.04292025))',4326),2))

Is there anything wrong when applying the sub query? Are there any alternative method to do this in PostGIS?


texts: Creating high resolution DEM file from points (path) in google earth using QGIS?

texts:
I am having trouble trying to create a DEM file from points in Google Earth. I followed all the steps to export a .kml from Google Earth to then import a delimited text layer that I turn into a .shape file, then run the saga - natural neighbor algorithm in QGIS. when I do though it creates a DEM but the resolution is really poor, the image size is only 108x84 px!

Is there a way to make the DEM or height map a higher resolution like 4K?

I am trying to get a high resolution height map to use in 3D app to build an accurate model of the Giza Plateau for a project. The USGS 30m sat data DEM is not close enough to the terrain to map the details.

Followed this: https://www.youtube.com/watch?v=JMbbm-X8fI8

Or if there is a way to create a high res DEM from a topographic map image such as the one attached, maybe trace the lines and turn it into vector in QGIS?

There has to be a way to pull a high resolution heigh map from some source thats better then sat data at 30m, if it was in US I could pull higher res DEM from USGS, but its Egypt.


texts:
I have data in a .csv sheet that I imported as a vector layer into QGIS. I then joined the imported table with an existing .shp file. The fields that I joined into the .shp file are not editable (they remain greyed) and I notice the field value is 0. Is the uneditable field related to the field value?

In addition, when I updated my .csv sheet, the linked layer within QGIS gets updated automatically but the attributes in the .shp file don't get updated. Why is this so?


texts:
I've been playing around with GeoServer, Google Maps and OpenLayers and have been reasonably successful however when using the aerial photography from Google I don't seem to be able to zoom in as far as I should be able to.

Any ideas?


texts: What is a good projection for the whole of China (with units in meters)?

texts:
I get some GPS results which lay in China with WGS84 coordinate system, and I need to choose a projection to reproject for.

First I chooses the UTM projection, but I find the results lay in different UTM zone, and I find it difficult to choose a right zone.

Are there any projection that take meter for unit and match for the results?


texts: Using Calculate Field to get acreage in ArcGIS ModelBuilder?

texts:
Update: Problem Solved

I fixed it.
In the Calculate Field Tool within Model Builder, I entered "!shape.area@acres!" . That resolved the issue and the model now produces the same results as the python script

#

I would like to use the Calculate Field tool in ModelBuilder of ArcMap 10.5 to calculate the acres of a polygon. I understand that in python I can write !shape.area@acres!, but I'm unsure how to set up the script for the Calculate Field tool.

Update:

I can successfully run my python script within the python window, however I cannot run a model builder tool that should perform the same function. the error is as follows: ERROR 000539: SyntaxError: invalid syntax (, line 1)
Failed to execute (Calculate Field).

My python script is here:

# Import arcpy module
import arcpy

#set path
arcpy.env.workspace = "C:/desktop/TestScripting.gdb"

# Script arguments
Add_Parameter = arcpy.GetParameterAsText(0)
if Add_Parameter == '#' or not Add_Parameter:
    Add_Parameter = "LonokeCounty2" # provide a default value if unspecified

LonokeCounty2__2_ = arcpy.GetParameterAsText(1)
if LonokeCounty2__2_ == '#' or not LonokeCounty2__2_:
    LonokeCounty2__2_ = "LonokeCounty2" # provide a default value if unspecified

# Local variables:
LonokeCounty2 = LonokeCounty2__2_
LonokeCounty2_Statistics = "C:\\Users\\chris\\Documents\\ArcGIS\\Default.gdb\\LonokeCounty2_Statistics"

# Process: Add Field
arcpy.AddField_management(Add_Parameter, "Acres2", "FLOAT", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field
arcpy.CalculateField_management(LonokeCounty2__2_, "Acres2", "!shape.area@acres!", "PYTHON", "")


texts: Python Script to batch compress .tif files using LZW compression

texts:
I am currently trying to batch compress a folder of .tif files using LZW compression in order to free up storage space. I've been using this script in ArcMap's python window, adapted from here:

# Import arcpy module
import arcpy, os

# Set the geoprocessing environments for the input and output folders
arcpy.env.workspace = r"Z:\ScannedImages\1300000\LZWCompressInput"
rasList = arcpy.ListRasters()
outWs = r"Z:\ScannedImages\1300000\LZWCompressOutput"

# Define the output settings for compression
arcpy.env.pyramid = "PYRAMIDS -1 BILINEAR JPEG 80"
arcpy.env.compression = "LZW"

# Run the Copy Raster tool
for ras in rasList:
        arcpy.CopyRaster_management(ras, outWs, "0", "", "", "NONE", "NONE", "", "NONE", "NONE")

but I keep getting the dreaded ERROR 999999 or ERROR 000472. Any ideas?


texts: QGIS Standalone Installer Version 3.12 download link for Windows is not found on server

texts:
I have tried to download QGIS 3.12 for Windows from https://qgis.org/downloads/QGIS-OSGeo4W-3.12.3-2-Setup-x86_64.exe but the server don't found the file.

Can you tell me how can I download this QGIS version?


texts: QGIS issue 20381 (freezes when data source manager is used) but on PC running Windows 10

texts:
I am having an issue where QGIS (both 3.4 and 3.10) where it freezes every time I try to use the data source manager. I have found the issue and solution, however the work around is for people running MacOS and I am running Windows 10.
I have tried to find the app permissions, but am not seeing the advanced options tab associated with QGIS that would be required to fix the issue. I click on Apps> Apps & Features> I find QGIS, but my only option is to uninstall. I have tried turning off permissions for all apps, tried uninstalling and reinstalling, and tried uninstalling 3.4 and installing 3.10. I feel like I am so close to the solution, but just can't get there.


texts:
I have shapefile which contain polygon features. I open this file as a reader. I need to load their data in to SDE table.

The problem is ObjectId and shape columns are not listed in user attributes for reader and unable to match with writer attributes


texts:
I have a table containing almost 1 million points (POIs). I want to change the case of all the acronyms in the display name column I have, currently I am identifying the acronyms as any 3 letter words that are present in the column ( I know I'll have to filter the results a lot as well ).

I am currently using this query to identify the unique words that are present in the column:

select distinct SUBSTRING(name_displ FROM '([A-Z]{1}[a-zA-Z]{2}\s)') As acronym
from poi

This query is returning all the unique 3 letter words that appear in the start and the middle of the name_displ column, now I want to change these to uppercase, I know that there is the replace(string text, from text, to text) function and the regexp_replace(source, pattern, replacement [, flags ]) function but I'm not sure how I can use them here.

So is there another way to identify 3 letter Acronyms and then change them to uppercase in PostgreSQL?


texts: QGIS unique IDs with fixed number of digits

texts: Does anybody know if there is a way to assign unique IDs - with a distinct number of digits - within Field Calculator? Should be an Integer, so uuid is no possibility.


texts: I am an generating a proccess with the process simulator from QGIS. My final task is to 'append' the features from one temporary layer created within the proccess to another layer in my proyect. I have seen that some people is using the 'merge layers tool' but I dont want to create a new layer because i have already set up the simbology on my project layer. I just want to copy/paste the features on it as the tool 'append' does it in ArcGIS.


texts:
I am trying to install the Statist plugin to QGIS and I don't find it when I search within my plugins dialog. (see image) I'm running QGIS 2.18 on Ubuntu 18.04. I have the official QGIS plugin repository installed and no others. matplotlib and numpy are installed and updated to the latest versions. Can you help me find Statist?

I notice that it's not on the list of of plugins at the official repository site, is there another repository I should look for?


texts: Calculate average value of a raster, that is clipped by multiple polygons?

texts:
I have a raster of coherence value (SAR interferometry) and a land use shape. I wish to calculate mean coherence value for those areas with a specific land use. I split land use shape into specific classes that I am interested in. So now I have a shapefile of urban areas (multiple polygons) and I wish to know average coherence in all urban areas together.

When I use Zonal Statistics, I only get average value for raster for each polygon separately, but I wish to know average pixel value for all urban areas together. Are there any plugins that I could use? Or am I missing something else?

I am using QGIS 2.12.0.


texts: Is my code for changing the resolution correct?

texts:
I have a raster files of daily minimum temperature (tmin) for the period 1962-2011 at a resolution of 1.125. I need to convert each single day raster file into 0.5 using inverse distance interpolation. The file is for the entire world and I need the file only for a selected county.

g.region vect=my_location  # setting g. region to my area of interest
i=1962                      #beginning of loop
while [ $i != 2011 ]
do
    j=1
    while [ $j != 366 ]
    do
            g.region res=1.125                   #original resolution
            r.to.vect input=tmin$i.$j output=point_tmin$i_$j feature=point      #converts raster to point
            g.region res=0.5                # changes the resolution
            v.surf.idw input=point_tmin$i_$j output=idw_tmin$i.$j column=value npoints=4            #does the interpolation
            g.remove vec=point_tmin$i_$j
            j=`expr $j + 1`
   done
   i=`expr $i + 1`
done

I just need a confirmation from someone if this code will work fine and will do the desired work. I ran it only for a single file and then tried to make a shell script to run it for all the files.

Thanks a lot


texts: Getting feature attribute description with pyqgis?

texts:
I have a vector layer which attributes have value maps and I need to get the description of value. I am able to get the values with feature.attributes(), but I haven't found a way to get the description.

layer = canvas.currentLayer()
attributes = feature.attributes()
print attributes[5] # prints 0, but I need Unknown


texts:
I have been using the 'GDAL Fill Nodata' function in QGIS in order to rectify downloaded Landsat 7 images, having created a relevant mask. Whilst said function has been successful in resolving bands 1 - 7 and satellite zenith, solar azimuth and solar zenith images, errors occur in regards to the satellite azimuth data. I have run the exact same function on each band [image].

The below represents the original satellite azimuth image (with gaps on both sides

[

The second picture is the (corrected) image output by the GDAL Fill Nodata function. As can be seen, the image has not been corrected as anticipated

Image 3 shows the original satellite zenith with gaps

Image 4 shows the corrected image output by QGIS

Does anyone have any ideas why the function would work on every other image, but not the satellite azimuth image?


texts: How do I plot spatialpolygon dataframe layer on a leaflet map

texts:
I am not sure why this piece of code works

library(leaflet)
library(raster)
adm <- getData('GADM', country='SGP', level=1)
popup <- paste0("Name: ",
                adm$NAME_1)

leaflet() %>%
  addTiles() %>%
  addPolygons(data=adm, weight = 2, fillColor = "yellow", popup=popup)

> head(adm)
       GID_0    NAME_0   GID_1     NAME_1 VARNAME_1 NL_NAME_1 TYPE_1 ENGTYPE_1 CC_1 HASC_1
260003   SGP Singapore SGP.1_1    Central      <NA>      <NA> Region    Region <NA>   <NA>
260001   SGP Singapore SGP.2_1       East      <NA>      <NA> Region    Region <NA>   <NA>
259999   SGP Singapore SGP.3_1      North      <NA>      <NA> Region    Region <NA>   <NA>
260000   SGP Singapore SGP.4_1 North-East      <NA>      <NA> Region    Region <NA>   <NA>
260002   SGP Singapore SGP.5_1       West      <NA>      <NA> Region    Region <NA>   <NA>

and why this doesn't works:

################################

library(leaflet)
library(raster)
library(rgdal)

adm <- readOGR("MP14_SUBZONE_WEB_PL.shp")

popup <- paste0("Name: ",
                adm$SUBZONE_N)

leaflet() %>%
  addTiles() %>%
  addPolygons(data=adm, weight = 2, fillColor = "yellow", popup=popup)

The difference between them is the shape file.

head(adm)
  OBJECTID SUBZONE_NO      SUBZONE_N SUBZONE_C CA_IND      PLN_AREA_N PLN_AREA_C       REGION_N REGION_C
0        1          1   MARINA SOUTH    MSSZ01      Y    MARINA SOUTH         MS CENTRAL REGION       CR
1        2          1   PEARL'S HILL    OTSZ01      Y          OUTRAM         OT CENTRAL REGION       CR
2        3          3      BOAT QUAY    SRSZ03      Y SINGAPORE RIVER         SR CENTRAL REGION       CR
3        4          8 HENDERSON HILL    BMSZ08      N     BUKIT MERAH         BM CENTRAL REGION       CR
4        5          3        REDHILL    BMSZ03      N     BUKIT MERAH         BM CENTRAL REGION       CR
5        6          7 ALEXANDRA HILL    BMSZ07      N     BUKIT MERAH         BM CENTRAL REGION       CR
           INC_CRC FMEL_UPD_D   X_ADDR   Y_ADDR SHAPE_Leng SHAPE_Area
0 5ED7EB253F99252E 2014/12/05 31595.84 29220.19   5267.381  1630379.3
1 8C7149B9EB32EEFC 2014/12/05 28679.06 29782.05   3506.107   559816.2
2 C35FEFF02B13E0E5 2014/12/05 29654.96 29974.66   1740.926   160807.5
3 3775D82C5DDBEFBD 2014/12/05 26782.83 29933.77   3313.625   595428.9
4 85D9ABEF0A40678F 2014/12/05 26201.96 30005.70   2825.594   387429.4
5 9D286521EF5E3B59 2014/12/05 25358.82 29991.38   4428.913  1030378.8