texts:
I'm expecting an ArcObjects code which is equivalent to SQL left join.

For example: I have the below SQL code, it's simple join to fetch the records from the both tables based on the ChecklistId value.

SELECT  T1.ChecklistId, T1.ChecklistName,
        T2.Latitude, T2.Longitude
FROM [dbo].[TableOne] T1
INNER JOIN [dbo].[TableTwo] T2 ON T2.ChecklistId = T1.ChecklistId
WHERE T1.ChecklistId = @ChecklistId

I converted the above SQL query into the ArcObjects.

IQueryDef queryDef = featureWorkspace.CreateQueryDef();

queryDef.Tables = "TableOne, TableTwo";
queryDef.SubFields = "TableOne.ChecklistId, TableOne.ChecklistName, TableTwo.Latitude, TableTwo.Longitude";
queryDef.WhereClause = "TableOne.ChecklistId = '" + checklistId + "' AND TableOne.ChecklistId = TableTwo.ChecklistId";

ICursor cursor = queryDef.Evaluate();
IRow row = null;

while ((row  = cursor.NextRow()) != null)
{
    // ... get and set the values to the objects
}

I want to fetch the records even the T1.ChecklistOwner column having null values. In simple words we can say as SQL LEFT JOIN as follows:

SELECT  T1.ChecklistId, T1.ChecklistName,
        T2.Latitude, T2.Longitude,
        T3.FullName
FROM [dbo].[TableOne] T1
INNER JOIN [dbo].[TableTwo] T2 ON T2.ChecklistId = T1.ChecklistId
LEFT JOIN [dbo].[TableThree] T3 ON T3.UserAlias = T1.ChecklistOwner
WHERE T1.ChecklistId = @ChecklistId

How can I convert the above SQL query into ArcObjects?


texts: Programmatically modify attributes for vector layer in QGIS

texts:
I am trying to programmatically modify attributes for a vector layer, using calculated values currently stocked in a dictionary. Any pointers on where i'm going wrong?

my dictionary has the feature ID as keys and a value to be stocked in the corresponding feature. Mahalo in advance.

dict = {0.0: 27400.0, 1.0: 32900.0, 2.0: 42200.0, 3.0: 40600.0}

for feature in Gros_Feat:
    if caps & QgsVectorDataProvider.ChangeAttributeValues:
        attrs = {'SUM_Conso' : sumdict.values()[feature.id()]}
        grosLayer.dataProvider().changeAttributeValues({feature.id() : attrs})
        grosLayer.updateFields()


texts: Convert PostGIS geometry column to a vector of Point2D in a PostgreSQL extension

texts:
I'm writing a PostgreSQL extension that should do a certain mathematical operations on a geometry field. However all I really need to make it work is give it coordinates as std::vector<Point2d>.

So how can one extract coordinates from geometry column, either using PostGIS helper methods or directly? Is it even possible?


texts: How to change the name of "Base layer" and "Overlays" in LayerSwitcher?

texts:
I would like to change the name of "Base layer" and "Overlays" in my LayerSwitcher div to something else.

I've noticed that the div including the texts only has a class and no ID which means it's little bit tricky to access.

I managed to change "Base layer" name with

document.getElementById("layerswitcher").firstChild.firstChild.innerHTML = "new name";

but I don't like this solution. Best would be if I could define the names directly with OpenLayers functions. Is there one?

I read something about using language translations but it's not what I'm after.


texts: How to select areas from a target layer which do not intersect source layer?

texts:
I have two different layers, one is county boundary and another one is soil map.

My question is I would like to select only those areas which are outside the county boundary.

Using "Select by location" I can select every polygon located inside the county boundary but it is not what I need, I need only the unselected polygons.

What should I do?

I am using Arcmap 10.


texts:
I've just read this article about geolocation history and wifi
https://www.pcworld.com/article/3315197/free-wi-fi-hotspots-can-track-your-location-even-when-you-arent-connected.html
If I clearly understand, anyone who has a wifi access point can get connection history of any device that connect to it.

If I am connected to my router with my device A at home, am I able to check my device's connections to other WiFi in the past ?


texts:
I have a triangulated DEM PolygonZM shape and would like to Rasterize it in QGIS (3.2).

I couldn´t find an option to use the geometry´s z value so i tried to create a field and calculate the centroid´s Z values.

But i´m kind of stumped as to how to do it.

Using "centroid($geometry) removes the z-values so it seems i can´t use the z() function.

If i use "vector -> geometry tools -> centroids", the resulting geometry is 2d as well.


texts:
I would like to get the quantiles of a .jp2 raster by the following code, and write the results to a text file:

from qgis.core import QgsRasterLayer
from PyQt4.QtCore import QFileInfo
import processing
import gdal

fileName = "d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04.jp2"
fileInfo = QFileInfo(fileName)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(fileName, baseName)
if not rlayer.isValid():
  print "Layer failed to load!"

ext = rlayer.extent()
xmin = ext.xMinimum()
xmax = ext.xMaximum()
ymin = ext.yMinimum()
ymax = ext.yMaximum()
coords = "%f,%f,%f,%f" %(xmin, xmax, ymin, ymax)

layer = processing.getObject(rlayer.source())
processing.runalg("grass:r.quantile",fileName,5, "",coords,"","d:/bitbucket/cnn-lcm/T33TWM_A012703_20171127T100339_B04_q.txt")

If I call the procedure from Processing Toolbox GUI it works, but I have to solve it by script.

Error message:

  [Errno 22] invalid mode ('w') or filename: '' See log for more details


texts: I have a question related to connecting points in QGIS. I am doing a project relating to transport. I have a layer of points (bus stops) and I have to connect them according to a timetable (as runs a bus line). Lines must proceed on the road (I have layer of roads combined with OpenStreetMap). I found the plugin Online Routing Mapper, but in this plugin are only two points (start and stop) and making line where each has 15 or more points is time-consuming. Can someone please me to prompt another method of how to do it? The plugin of which I mentioned would meet my needs if I could add more points.


texts: What are the rules that the Gdal rasterize function follows to allocate a value to a cell?

texts: How does the rasterize tool decide which value to represent when a cell covers an area which inclueds different values? I need it in this case for polygons but would like to know for lines and points as well. What are the rules that it follows.


texts: BC transmission line data into google earth?

texts:
When I try to look the transmission line data into Google Earth. I can not see the transmission lines.

How can I view the transmission lines in Google Earth?

The data is at:
https://catalogue.data.gov.bc.ca/dataset/bc-transmission-lines/resource/3679fd70-fc60-4d6f-8079-13cd8c20c02d

I have version 7.3.1 of Google Earth Pro.


texts: Providing Catalog Service for Web (CSW) using ArcGIS software?

texts:
I need to harvest catalog data from a ArcGIS database, and as I understand it, a Catalog Service for the Web (CSW) should be the way to go. Some docs mention vaguely the "GIS Portal Toolkit" or the (discontinued) "ArcIMS". Others mention the Geoportal Server.

What is the recommended way of providing catalog data as CSW using ArcGIS? Namely, which components should I use, and where can I find concrete/detailed instructions on how to do it?


texts:
I want to install some GRASS-Addons to use them in QGIS.
Therefore I run GRASS-Plugin in QGIS an open the GRASS-Shell
type: g.extension

GRASS opens
then i go to "optional", activate "System installation" and type the extensionname "r.viewshed.cva"

after this I run the whole thing and get the following output:

(Tue Nov 05 15:53:05 2013)
g.extension -s extension=r.viewshed.cva svnurl=http://svn.osgeo.org/grass/grass-addons/grass6
which: wget: unknown command
WARNING: GRASS_ADDON_PATH is not defined, installing to ~/.grass6/addons/
Fetching  from GRASS-Addons SVN (be patient)...
A    r.viewshed.cva\description.html
A    r.viewshed.cva\Makefile
A    r.viewshed.cva\r.viewshed.cva.py
Checked out revision 58151.
Compiling ...
C:/OSGeo4W/apps/grass/GRASS-~1.3/include/Make/Grass.make:423
: warning: overriding commands for target
C:\Users\Warsow\.grass6/1/addons/.tmp/1084.0/dist.i686-pc-
msys/bin'
C:/OSGeo4W/apps/grass/GRASS-~1.3/include/Make/Grass.make:414
: warning: ignoring old commands for target
C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-
msys/bin'
make: C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686
-pc-msys/tools/g.echo.exe: Command not found
make: C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686
-pc-msys/tools/g.echo.exe: Command not found
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/bin
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/include/grass
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/etc
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/driver
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/driver/db
mkdir -p C:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686-pc-msys/fonts
make: *** No rule to make target r.viweshed.cva.py', needed
byC:\Users\Warsow.grass6/1/addons/.tmp/1084.0/dist.i686
-pc-msys/scripts/r.viweshed.cva.py'.  Stop.
ERROR: Compilation failed, sorry. Please check above error messages.
rm: cannot remove directory `C:\Users\Warsow\.grass6/1/ad
dons/.tmp/1084.0/r.viewshed.cva': Permission denied
(Tue Nov 05 15:53:12 2013) Command finished (7 sec)

I don't know why it doesn't work - could somebody help me?

Win 7
QGIS 2.0
GRASS 6.4.3


texts: Adding image in Feature Attributes Form in QGIS?

texts:
I am looking for a way to show icon or image in QGIS Feature Attribute Form.
I'm showing Equipment in Rack and if it is for example:
1. switch = show some icon
2. router = show different icon etc

Is such a thing possible?


texts: In Which Province is a Post Code (Adding Attribute from Another Layer)?

texts:
I have two polygon shapefiles. One is post codes, the other is provinces (in China). I'd like to add a "Province" field to the post code database (i.e. DBF file). This field would indicate the province for each post code. Note - post codes never cross province boundaries.

How would I do this? I'm using QGIS.


texts: SAGA functions not writing output raster using QGIS 3?

texts:
I'm using QGIS 3.0, using a SRTM 1 Arc Second to perform hydrological analysis using some of SAGA functions (such as Fill Sinks), if I choose temporary output, it works fine; if I choose to save to file, it comes out with an error.

The same process works fine on QGIS 2.18, and I did try two different machines and the same problem occured.

Any suggestions?


texts: Does GeoPackage support simultaneous editing?

texts:
I am looking to move a mess of shapefiles to a newer format, either Spatialite or Geopackage.

I have read that Spatialite can handle multiple users editing the same file more or less simultaneously. Is the same true for Geopackage?

Does one handle this sort of thing more easily than the other?


texts: How to display DMS in QGIS print composer?

texts:
Can we display degrees, minutes, seconds in QGIS Print Composer window instead of decimal degrees?

Is there any plugins available for that?


texts: Rotating Chart symbols with ArcMap dataframe?

texts:
I am using ArcMap 10.2 and want to represent a layer in a rotated dataframe with chart (graph) symbology. The problem is that the charts do not rotate with the dataframe:

I thought I could convert to graphics and rotate each chart individually, but

that is very tedious
I don't find an option to convert a layer to graphics, works for the legend but not for the actual layer symbology


texts: How can I connect to a PostGIS database from ArcCatalog 9.3 via ArcSDE?

texts: I have a problem connecting to my postgis database via ArcSDE in Arc Catalog. When i want to establish connection to my database i get an error:


texts: How to visualize fuzzy/approximate locations

texts:
I need to visualize a mixture of accurate and fuzzy/approximate locations on a web map. The user should be able to instantly recognize approximate locations from the marker used. Are there any best practices to follow regarding the design of the location markers? I thought about using semi-transparent circles for the approximate locations, like this:

(http://dribbble.com/shots/908963-Map-Markers-PSD?list=searches&tag=map_marker)

But I would rather use icons which symbolize the "fuzzyness", because in areas with many locations in high density i suspect that to be better looking. Maybe someone has a better idea?


texts: Can I incorporate an existing DBF file with coordinates for Tiff tiles into geodatabase like spatialite?

texts:
I have 285 Tiff files that make up the 1:10000 OS map of Norhtern Ireland. I am having problems running QGIS when I try to load all 285 tiff files in for base maps (I think the memory on computer is problem here) My thinking was if I create a geodatabase this will speed up accesssing these base maps. I also have with each tiff file a corresponding AUX , RRD, TFW file. There is a historical DBF file that appears to index each Tiff file with max and min x.y coordinates. I beleive this was used for ARC 3??  Is there any easy way to get this DBF file into a spatial database to allow me to access the Tiff files quicker? I tried pyrimids on the Tiffs but they are not 'pyrimid-able'. I also tried to create a geodatabase using spatialite but becasue the Tiffs are not geo-referenced (this info sits outside the Tiff file on the TFW file) it would not allow me to load them into my DB.

Any assistance would be greatly appreciated


texts:
I am doing a class project on QGIS. I just have some questions on it.

I would like to know if we can create a map which have several layers and buttons where user can click on his preferred parameters and a pop-up box appears asking him some questions.Later it shows user only desired layers.

Also I would like to know if we can add a button which calls an external python code and displays its output results as other layer in the map.


texts: Create a two year comparison chart with monthly average emission values

texts:
I've been struggling in creating a chart to compare monthly data for two years. So far, I've been to do this graph.. However, I'd like to create this chart:

This is the code: https://code.earthengine.google.com/60de9bd5003dbd0e54f5c2045c70af78

Do you have any recommendation of command I can use? Thanks!


texts: PyQGIS 3 commit error with a PostGIS table on a nextval() column

texts:
I'm working on QGIS3.14.15 and I'm trying to update a PostGIS table with features comming from another table (pg_actual) and I have an error:

ERROR: 14 feature(s) not added. Provider errors:    PostGIS error
while adding features: ERROR:  null value in column "gid" violates
not-null constraint

The "gid" field is defined as SERIAL, so it is not null and has a default value nextval(sequence foo):
gid integer NOT NULL DEFAULT nextval('pg_add_table_gid_seq'::regclass),

That's not the first time I'm avoiding a gid field and I'm used to see it auto incrementing by the provider after the commitChanges() method.
fields_actuals = pg_actual.fields()
list_add = []
geom_old = [oldFeat['ident'] for oldFeat in pg_old.getFeatures()]
fields_add = pg_add.fields()
for actFeat in pg_actual.getFeatures():
    if actFeat['ident'] not in geom_old:
        list_add.append(actFeat)
if len(list_add):
    print("New data:")
    pg_add.startEditing()
    for actFeat in list_add:
        actFeat2 = QgsFeature(fields_add)
        for field in fields_actuals:
            if field.name() != 'gid':
                actFeat2[field.name()] = actFeat[field.name()]
        actFeat2.setGeometry(actFeat.geometry())
        pg_add.addFeature(actFeat2)
    res = pg_add.commitChanges()
    if not res:
        print("Commit failed.")
        for err in pg_add.commitErrors():
            writeLog(err)
    else:
        print("commit OK!")


texts: Compress Raster in ArcMap without generating a new File

texts:
I have several uncompressed rasters (FGDBR format) stored in a File-GDB. Now I want to compress this data. The only way I know is to use the "Copy Raster" tool but this will generate a new raster with a new name.

Is there a way how I can compress this files with LZ77 compression without generating new rasters with new names?


texts: Image pyramid has wrong colors in GeoServer

texts:
I'm fairly new to GeoServer.

I have managed to create an image pyramid out of a ~7 GB ECW file. The files are fine looking at them in explorer but when I import the pyramid and open it in geoexplorer it has wrong colors. This maybe because the image pyramid has alpha channels (i've worked with files without alpha channels before without problems).

Is there a setting I am missing or something like that?

This is one tile from the pyramid and how the raster is supposed to look like:

This is how it looks like showing the image in Geoserver:

And here is a print screen of the layer settings:


texts:
I am trying to use the QGIS plugin GeoSearch. Every time I type in an address and hit search, nothing happens. When I first installed it a few months back, it worked like a charm, I dont know why one day it just wouldn't work. I have a valid google API because I use google basemap layers every day.

Things I've tried:
-I've uninstalled/reinstalled
-When I use the 'Search On Google Web Map' feature, It opens to the address immediately
-tried different Geocoders with no response.

QGIS version : 2.14.10-Essen
OS: Windows 7 64-bit edition


texts: Change system:index of FeatureCollection in GEE

texts:
I have a FeatureCollection with points loaded from an asset (shapefile). Since the system:index is empty, gee assigns a weird index to each feature (e.g. 000000000001, 0000000000a). This causes problems if I want to some mapping and extracting over the FeatureCollection. Can I change the system:index to a sequence from 0 to length of the features?

var asset_points = ee.FeatureCollection("users/slisovski/AssetPoints");
// Map.addLayer(asset_points, {color: 'FF0000'}, "coordinates");

print(asset_points);
var id01 = ee.Feature(asset_points.first()).get("system:index");
print(id01);

var len = asset_points.toList(10000).length().subtract(1);
var idList = ee.List.sequence(0,len);

var assetID = asset_points.set('system:index', idList);
print(assetID);

https://code.earthengine.google.com/bfcfa65f704505889f2bc4d16c909f37

I created the shapefile in R. Maybe I can change this code to make sure that the system:index is sensible?

library(sf)
tab     <- data.frame(ID = paste0("ID_", letters[1:20]), Longitude = runif(20, 110, 150), Latitude = runif(20, 20, 80))
data_sf <- tab %>% st_as_sf(.,coords=c("Longitude", "Latitude"),crs = st_crs(world))
st_write(data_sf, dsn = "AssetPoints.shp", driver = "ESRI Shapefile")


texts:
I want to exclude addresses to the state of Oregon.
Pre 2.3.1 code was

<listfield>State</listfield>
<listvalues>OR</listvalues>

for 2.3.1 ESRI says to use

<fields>State</fields>
<fields listvalues="OR">

but no dropdown shows up, and it still searches all of US?


texts: Loading all raster layers in folder using PyQGIS

texts:
I would like to load all raster layers with type .xyz which are in a folder into my QGIS Project using PyQGIS and wrote the following function

    for lyr in glob.glob(os.path.join(inputDir, "* .xyz")):
        rasterlyr = QgsRasterLayer(lyr , "")
        QgsProject.instance().addMapLayers(rasterlyr)

I'm getting the following error message:

  QgsProject.addMapLayers(): argument 1 has unexpected type 'QgsRasterLayer'

But according to the Dokumentation "Cheat Sheet" this should actually work.

Does anyone see the mistake?


texts: Querying Archive Class with REST API of ArcGIS Server?

texts:
I would like to know if there is a way to access the archive class through a Map Service of ArcGIS Server.

I have a Map Service with feature class stored in a SDE GeoDatabase with Archiving and Versionning enable.

Is it possible to query the Archive Class in order to retrieve features at a perticular moment using the Feature Access or Mapping capabilities through the REST API?

When I try to publish a Map Service containing an Archive Class to ArcGIS Server I have an error saying: Layer's data source is not registered with the geodatabase (Feature Service).


texts: How not to repeat text in linesimbolizer?

texts:
I need make a sld style with line and label above. But it's not that simple because I have some additional requirements:

Label without repeat
Label fitted in line in ideal or put in line center.
Label gonna be multiple lines

For repeat i found that:

Normally GeoServer labels each line only once, regardless of length.

IS it mean that i get only one label for each line?

For multiline:

<VendorOption name="autoWrap">50</VendorOption>

But how can i fit label? For fiting im understand autoselect fontsize and stretching label by line lenght.
Its possible? Where i can find any examples?


texts:
I am a GIS newbie and I am trying to get WMTS layers to work with OpenLayers 2.

I do the standard procedure:

Issue a GetCapabilities request.
Parse the response using OpenLayers.Format.WMTSCapabilities().read( )
Turn the response object into a layer using OpenLayers.Format.WMTSCapabilities().createLayer( ) using the matrix tile set and layer.

This all boilerplate OpenLayers code -- I didn't do much myself.  Everything works as expected for EPSG:4326, and some ArcGIS services I tried.  In fact, for the same service and layer - the EPSG:4326 tile set shows up but the EPSG:900913 tile set does not.

In fact, looking at the network response (in developer tools) when fetching the EPSG:900913 tile matrix set, I know I am getting the image tiles but they are not showing up onthe map.  The map is black for some reason.

I thought it was maybe because the projection is in EPSG:4326 when my tiles are in EPSG:900913.  After setting the base layer as the WMTS layer, I do:

  var projection = map.getProjection(); // Shows up correctly as EPSG:900913

It might useful to note that I had to override the below functions with the latest code code from the OpenLayers 2 github repo:

        OpenLayers.Format.WMTSCapabilities.prototype.createLayer
        OpenLayers.Format.WMTSCapabilities.v1_0_0.prototype.readers
        OpenLayers.Layer.WMTS.prototype.setMap
        OpenLayers.Layer.WMTS.prototype.getURL

Maybe I missed a function I had to override?  That's my best theory so far!


texts: Processing script error QGIS point in polygon

texts:
In QGIS version 2.18.2 i get the following whilst trying to execute Vector > Analysis tools > Count point in polygon. Any clues as to how to troubleshoot?

Uncaught error while executing algorithm
            Traceback (most recent call last):
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/GeoAlgorithm.py", line 203, in execute
                self.processAlgorithm(progress)
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/qgis/PointsInPolygon.py", line 80, in processAlgorithm
                spatialIndex = vector.spatialindex(pointLayer)
              File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/tools/vector.py", line 211, in spatialindex
                idx = QgsSpatialIndex(layer.getFeatures(request))
            Exception: unknown


texts:
I have a point layer for wich I've set the order of columns while using field calculator and Refactor fields instruments. But the order of colums is different when I'm choosing point by Identify features or looking at the Attribute table. This happens only after I apply saved style for this layer. Without style applying everything goes right.

I need to make attribute table showing correct order of columns (as it is shown in Attributes Form). Where and what should I change?


texts: Combining edits from multiple Geodatabases into a Master Geodatabase

texts:
Is there a way to automate combining edits from multiple, single project geodatabases into a master geodatabase based off the date the edits were made without creating duplicated of the same project data in the master (based on project name)?

Edit: So I am just trying to combine daily edits from around 20 projects with their own personal geodatabases into a master personal geodatabase which holds info from around 200 projects. I am thinking of making a master csv that I update daily with with which projects I have edited that day and trying to make a tool that just pulls that day's edits and updates the master personal geodatabase with the new info. No SDE just good ol' fashioned personal geodatabases. Using ArcMap and ArcCatalog.


texts: Moving the View during Temporal Animation in QGIS 3.14

texts:
I'm very excited about the native support for temporal elements in QGIS 3.14. I have enjoyed the detailed tutorial by developer Nyall Dawson here, which gives nice overview of its many possibilities. However, I'm wondering if, similar to Google Earth's feature of this kind, it is possible to move the view of the map at certain moments "in time."
I'm imagining, for example, the creation of a point layer with points located where you want the view centered, and perhaps some information on zoom level, adding temporal information as you would any other temporal active layer, then perhaps styling it in some way that, when it becomes visible, it moves the view in the form of an "event" as it were.
Can the view location somehow be controlled by trigger of becoming visible (e.g. If (become) visible: center map on Tokyo, etc.)?
Note: I accept that, even if this is possible, when static images are exported from the temporal controller, they have their own boundaries set and may not reproduce the above movement (?), but if I take a screencast of the animation (which bypasses finicky fiddling with stitching the images together afterwards) this movement would show up nicely, I suspect.


texts: Using field calculator in QGIS to return name of country from different shapefile?

texts:
I have a shapefile that consists of a list of archaeological sites with the x and y coordinates.

I have an Natural Earth shapefile for the countries of world.

I was wondering how I go about creating a new field for the country of each archaeological site using the field calculator?

I am relatively new to QGIS and not that familiar with the field calculator.


texts: Invoking-command in powershell 2012 (remotely) for ArcPy errors but local cmd or python shell work

texts:
I've written a data update script that works really well, it deletes a target feature class and uses the feature class to feature class geoprocessing tool to copy data from SQL 2012 into it's predecessors location.

The script works when run via python shell or scheduled via cmd. However our preferred workflow tool uses powershell 2012 (remotely). Invoking-command in powershell for our ArcPy script errors in several places.My main concern is the feature class to feature class tool:

  ERROR 000732: Input Features: Dataset \bacon.sde\tasty_Prod.dbo\v_cheese does not exist or is not supported
  Failed to execute (FeatureClassToFeatureClass).

Why would the feature class to feature class tool work via python shell and cmd and not via powershell?

The same script uses table to table (updating tables) and it works in powershell.. only things that have geometry have issues..


texts: Expression Area Statistic Results in NULL with Real Number Conversion

texts:
I am attempting to determine the ratio of a statistic to the area of corresponding geometry while accounting for outliers through a standard deviation filter.

While the QGIS Expression Editor provides a valid preview result, the final column is only populated by NULL values. From research this appears to be related to conversion between integer and real numbers. However, even with utilizing the to_real function, no valid final results are displayed.

CASE
WHEN  ( to_real( "VEHS" ) /  "ALAND" ) > (  stdev( to_real( "VEHS" ) /  "ALAND" ) * 4 )
THEN (  stdev( to_real( "VEHS" ) /  "ALAND" ) * 4 )
ELSE ( to_real( "VEHS" ) /  "ALAND" )
END
Preview: 0.0056653206243049

Both VEHS and ALAND are integers that result in a real number. What is the proper way to set up this expression?


texts: Using DTM and STR files from Surpac in ArcGIS Desktop for slope stability analysis?

texts:
I currently have 1m and 5m topography files from Surpac in the format of both DTM and STR and I am tasked to perform a slope stability analysis of the area. I do not have any knowledge to operate Surpac and I only have basic understanding in using both AutoCAD and ArcGIS (ArcMap 10.2).

I have perform some basic slope stability analysis using ArcGIS Slope (Spatial Analysis) before, but the files are in DEM files.

I have Googled around for a while but I could not find a way to open up the DTM files of Surpac in ArcGIS. I have managed to work around a bit by using Surpac to convert both files into SHP files.

But so far what I am seeing is only lines without any height data on them.

Is there a way to convert these DTM and STR data into a usable DEM files which I could run a Slope (Spatial Analysis) command?

As I only have virtually zero knowledge of Surpac and limited knowledge on ArcGIS.


texts: Unwanted clipping occurs when georeferencing raster

texts: I have a mercator projection map with the extent -180 to 180. I am attempting to georeference it to a shapefile with the same projection and extent. I align using known locations but when the newly reference raster is placed as a layer, the left edge of the raster is cut off. Any ideas why this is happening and how to fix the issue?


texts: Fix all overlap errors without changing number of features

texts:
This set of features are owned lands that have been individually added as features, naturally they aren't perfectly placed

I have fixed every big overlap and now only small lines overlaps are left, but 4074 of them! Here's an example :

I know there are similar questions here, I don't know if I did them wrong but they didn't work, I need the polygons to remain closed, individuals and the number of features can't change and changing the cluster tolerance affects everything else.

I want to merge for all topology errors, choosing either to receive the merged area, maybe a python code to iterate the topology errors?


texts: Displaying MS Access records as lines in ArcMap?

texts:
I'm trying to add an MS Access table as a layer in ArcMap 10.6. There are four columns with coordinates - from_x, from_y, to_x and to_y. I want to represent the records as lines on the map.

I can add the table, but when I choose "Display XY Data..." I get no option to display data as anything but points:

Is there a way to display lines? For compatibility with other software, I need to keep the data in an Access database, so keeping everything in a geodatabase is not an option.

In the ideal scenario, data should automatically be up to date as in the Access table every time I open my workspace. If that is not possible, some kind of import step where you by simple user action reimport the data could also work.


texts: What are limits on ArcScene and TINs from LiDAR?

texts:
I am trying to load anywhere from 5 to 10 LiDAR TINS into ArcScene. I am using ArcGIS Desktop Evaluation (student) 9.3.1. I just built a new computer with a AMD Phenom II X6 1090T six core processor, 8GB of ram, and a GeForce GTX 470 video card.

When I load the data into arcscene I also open up my system resource monitor. It's only using about 20% of the CPU and less than 2 GB of ram (out of the 8). The program never seems to go over those numbers even with using tools.

I've tried adding to the virtual memory, but that hasn't changed anything, it still runs slow. As far as I know all my drivers/Windows are up to date.

Are there limitations on amounts of data that can be opened in ArcScene? Is there a way to make this work super fast, as was the plan when I put this computer together?


texts: Python - Convert shapefile lat-long value from Degree minutes seconds to Degree decimal

texts:
I am processing shapefiles in python using standard library functions like Python “shapefile” library and GeoPandas.
I have two shapefiles having the same projected co-ordinate system-> WGS_1984_UTM_Zone_44N.

But the first shapefile has lat-long values in “Degree decimal” format and the second shapefile has lat-long values in “Degree minutes seconds” format.

In order to proceed with further processing (merging the information from the two shapefiles) I need both shapefiles to be of the same format (either Degree decimal or degree minutes seconds format).

SHAPEFILE 1(LAT-LONG VALUES):

bbox =[300827.06, 2347377.51977153, 302414.939109026, 2348912.5],
parts =[0], shapeTypeName =POLYGON ('number of points in shape ', 45)

bbox =[301663.127583958, 2345705.27205747, 303118.13, 2348567.5722892],
parts =[0, 755], shapeTypeName =POLYGON ('number of points in shape ', 760)

SHAPEFILE 2(LAT-LONG VALUES):

bbox =[78.97802486855807, 21.102058250837672, 78.98699067762817, 21.107654743123476],
parts =[0], shapeTypeName =POLYGON ('number of points in shape ', 28)

bbox =[79.1842653948201, 21.090100785102777, 79.18754905100815, 21.092718192209304],
parts =[0], shapeTypeName =POLYGON ('number of points in shape ', 10)

Is there some function that can be applied on the shapefile for this conversion?


texts:
i'm trying to add about 50 points in certain areas in QGIS and they all have the same exact value,  so i figured i can just have the placed without entering the data and then select them and add the value through a formula

i just have on issue that i have to confirm using "enter" after placing each point .. so is there any way to add a point with just a click without going through the attribute dialogue and pressing "Enter"?


texts: Automating Attribute Table with Field Calculator

texts:
I'm using QGIS 3.10.0 A Coruna.

I'm using the field Calculator for an equation which requires a variable (which I Type in manually) and a (fixed) value within the same attribute table. This variable is different for each feature, meaning I have to write the equation (for my example) 55 times.

I dont have a problem with that so far; however, if for any reason my fixed value should change, I would have to repeat the work with the field calculator over and over again. Is there a way where

1) I can see which equation I used in the first place and

2) where I can automatically update my results in the attributetable
    in case the fixed value changes?


texts:
I have a map service that suddenly stopped taking edits. It is an AGS map service with data stored in SQL 2012 r2. I can consume the servcie in a web map and try to edit it. I get NO errors or warning when I move a point or edit an attribute, but when I save the map and reload the page, the edits didn't take. In the Network console of the Chrome developer tools, the applyEdits function shows empty brackets, whereas it usually includes updated attribute or geometry information. Any ideas on why ApplyEdits suddenly stopped working?

I have tried to republish the map service and restart it but still no luck.


texts:
I have GIS-data in a very old "winstar" type of format.

However, currently I only use ArcGIS for Desktop and QGIS.

Currently, I only have the winstar in a dxf-format. This can be visualized in ArcGIS, but I don't have any attributes in the attribute table.

Does anyone have an idea on how I can import this old-fashioned winstar stuff to ArcGIS for Desktop or QGIS including the underlying attribute table?


texts: What is the best quick way to populate a field (in ArcGIS 10)? (for rare language/font e.g. Guzrati numerals)

texts:
I have polygons generated from shapefile (esri)  format
I have a tiff image of plot/parcel map(this tiff has plot id scribed in somewhat
consecutive in manner) of that polygon feature.

I would like to fill the plot number field by juxtaposing(placing two abreast)  the polygon and image file. I am using Arc GIS 10; what is the best way to do this?

Example: I have following tiff map, where from a polyline-shapefile has been produced by arc-scan, thereafter a polygon feature has been made from it.

Now i want to populate "Plot No" field of polygon feature  from above tiff image.
But now "see-and-fill" method taking much more time (since 1700+ polygon/plot is many).

Under this circumstances i seek the best and quick (some what automated) way to populate "Plot No" field.

N.B. Plot No in the map is shown English Numerals, but in case of me these numbers are font that parochial (even abbey software does not support this font. e.g. Guzrati "╜")

Thanks in advance


texts: Missing Observations in Zonal Statistics Tool

texts:
I am using zonal statistical tools. I have field boundary shapefile which has 1,062,063 observations.

I am using zonal statistical as table tool to obtain precipitation values from raster layer. when I run the tool, the output table only provide 1,003,273 observations.

I guess there are 58,790 missing observations.

Do you have any ideas why there are missing observations and how I can fix these missing observations?


texts: How to obtain TIFF file using data from CSV files

texts:
I have a set of CSV files containing lat-long values for certain land cover classes.

 Long Lat
 80.1 23.0
 80.2 23.1
 80.3 23.2
 80.4 23.3
 ...

From this point on, I need to generate a TIFF file which contains information present in the CSV files i.e. lat-long and subsequent land cover classes at those coordinates. I am new to GIS and have completely no idea on how to get started. Should I first convert the CSV files in some other format readable by some software? And which would be the best platform to do so?


texts: How to login arcgis secure service in Flex using 2.5 version?

texts:
I know, that I can use IdentityManager class to show login+password form for secured services. But it's available in version 3.0, and I'm using 2.5. How can I provide access for secured service in my case? I also know, that I can use token generation, but token is bound to unique IP address and I need to use the application on many machines.

Thanks


texts: Plugin SWAP vector direction doesn't work in QGIS

texts:
I've installed plugin Swap vector direction in QGIS.
But it doesn't work. I click and nothing.
I need to flip lines (22 000 000 lines).

In ArcGIS takes many hours and still flipping.
I thought maybe in QGIS will be faster, but doesn't work.

Why doesn't this plugin open?
Maybe is another way to flip lines in QGIS?
I know there is solution in GRASS, but GRASS doesn't open so big file.
Version QGIS 2.4.0 Chugiak


texts: Can pgr_dijkstra use a boolean column for routing?

texts:
I want to use Dijkstra algorithm. I would like to have the algorithm find a route based on a boolean traffic column, using only roads where the boolean column value is true.

The code below does not return anything.

CREATE TABLE routeWithTraf AS SELECT seq, id1 AS node, id2 AS edge, cost, b.geom FROM pgr_dijkstra('
                SELECT gid AS id,
                         source::integer,
                         target::integer,
                         length::double precision AS cost
                         FROM roads WHERE traffic != false',
                67931, 5602, false, false) a LEFT JOIN roads b ON (a.id2 = b.gid);


texts:
I have a working code (shown at the bottom). The problem is process time is about 12 seconds for each loop. If I want to use this for the whole data I have (about 1 million points), it would take about half year. I think the problem is the following:

arcpy.GANeighborhoodSelection_ga(inFile, "neighbor2", pointcoord, "1", "1","5", "5", "0", "One sector")

this tool always creates a layer for its output, so if I want use it, I have to delete the layer after I got the information I needed. I think the problem is that it  constantly makes a new layer, which takes a lot of time.

I wonder If it's possible to force it to use the same layer somehow

import arcpy
inFile = "C:\\Users\\Geri\\Desktop\\Sync\\arcpy\\inverz2b.shp"
inFile2 = "C:\\Users\\Geri\\Desktop\\Sync\\arcpy\\inverz3b.shp"
n=0
arcpy.MakeFeatureLayer_management (inFile2, "3blayer")
for num in range(0,4):
    arcpy.SelectLayerByAttribute_management ("3blayer", "NEW_SELECTION","FID = %s" % n)
    for row in arcpy.SearchCursor("3blayer"):
        x = row.X_Easting
        y = row.Y_Northing
        z = row.Z_Elevatio
        ratio = row.ratio
    pointcoord = str(x) + " " + str(y)
    arcpy.GANeighborhoodSelection_ga(inFile, "neighbor2", pointcoord, "1", "1","5", "5", "0", "One sector")
    for row in arcpy.SearchCursor("neighbor2"):
        x2 = row.X_Easting
        y2 = row.Y_Northing
        z2 = row.Z_Elevatio
    newx = x-((x-x2)/2)
    newy = y-((y-y2)/2)
    newz = z2-((z2-z)*ratio)
    print x, y, z, x2, y2, z2, newx, newy, newz
    n+=1
    arcpy.Delete_management("neighbor2")


texts: QGIS default style stored in spatialite db does not load when adding layer

texts:
I have a couple of default styles stored in a spatialite db. When I add the layer for which I have defined the default style in QGIS 2.14.22, everything looks good but trying the same in QGIS 2.18.16 sets only a generic style (cp. screenshot). The layer_styles table looks like this:

Added a layer with default style in QGIS 2.14.22:

Added the same layer in QGIS 2.18.16:

Note that I am able to manually load the style from the database in 2.18, and everything looks like expected, but I need to load the default style automatically when adding a layer. QGIS 2.18 can obviously load the style from the table, but does not recognize the default correctly.

The styles are created and stored with QGIS 2.14., so are there any compatibility issues that I miss?


texts:
I try to clip shape "a" with shape "b". The result should be a polygon with the attributes and borders of "a" but cliped on the extent of "b". Basically a simple clip as we know it from ArcMap or QField.
Now I want to use the sf package in R. But all the suggestions I find tell me to use````st_intersection```.
But this is not actually a clip because it will result in a layer containing also the borders of "b".
a<-st_read("a.shp")
be<-st_read("b.shp"
Clip1<- st_intersection(a,b)

What I want

what st_intersection does


texts:
I have a QGIS project with data from a postgresql database. For this database you need a login.
If I open the QGIS project I have to enter the login data.

Is there any possibility to store the login data for my database in the project?

I tried to save my project as a .qgs file and store the logindata in this file. But I still have to enter my login data if I open my project.


texts: Selecting Polygons based on multiple POI with radii using ArcGIS for Desktop?

texts:
I have a polygon layer of suburbs (with population density) and I have separate layers of POI such as hospitals, government buildings etc. What I'd like to do is give each POI a radius based on how important I think they are (such as a private vs government hospital - from the attribute table). Then I'd like to highlight areas where the different POI radii overlap and lastly export the suburb the overlapping areas belong to as a list (it should include a percentage of the total suburb the overlap falls into, and the distance to the nearest hotel for instance).

Is there any way I can build a query that can achieve this in ArcMap 10.3? I need a fairly efficient way of doing this as there are several hundred POI (within each category) and about 7000 suburbs. I've tried using the select by location tool but what I described above seems to be more complex than it can handle without some manual adjustment possibly via python code.


texts: Reading JSON features from a Google spreadsheet using Tabletop into Leaflet web map?

texts:
I'd like to read a table of JSON formatted cells into a Leaflet map using the Tabletop extension of leaflet.

However, my script only reads the first object. Any advice on how to create an array of features that can be visualized? I feel that I need a for loop, but I can't figure out where that should go given my current architecture.

I have a feeling the adjustment needs to be at this point:

  for (var row in data) {
    var geojsonStates = JSON.parse(data[row].geometry);
  }

Note that I'm building off the good work from Chris Arderne.

function init() {

var polyURL = "https://docs.google.com/spreadsheets/d/1-m5yUoIJph-Kyi7-lnUOL-hAMUxRi2SAepaswd3043Q/edit?usp=sharing";

  Tabletop.init( { key: polyURL,
    callback: addPolygons,
    simpleSheet: true } );
}
window.addEventListener("DOMContentLoaded", init);

var map = L.map("map").setView([40, -100], 4);

var basemap = L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png", {
  attribution: '&copy; OpenStreetMap &copy; CartoDB',
  subdomains: "abcd",
  maxZoom: 19
});
basemap.addTo(map);

var sidebar = L.control.sidebar({
  container: 'sidebar',
  closeButton: false,
  position: 'right'
}).addTo(map);

panelID = 'my-info-panel'
var panelContent = {
  id: panelID,
  tab: '',
  pane: '

',
  title: '
 No state selected
',
  position: 'top'
};
sidebar.addPanel(panelContent);

map.on('click', function (feature, layer) {
  sidebar.close(panelID);

});

var polygonLayer;
var pointGroupLayer;

function addPolygons(data) {
  if (polygonLayer != null) {

    polygonLayer.remove()
  }
  var geojsonStates = {
    "type": "FeatureCollection",
    "features": []
  };

  for (var row in data) {

    var geojsonStates = JSON.parse(data[row].geometry);

  }

  var polygonStyle = {"color": "#2ca25f", "fillColor": "#99d8c9", "weight": 1.5};
  var polygonHoverStyle = {"color": "green", "fillColor": "#2ca25f", "weight": 3};

  polygonLayer = L.geoJSON(geojsonStates, {
    onEachFeature: function (feature, layer) {
      layer.on({
        mouseout: function(e) {
          e.target.setStyle(polygonStyle);
        },
        mouseover: function(e) {
          e.target.setStyle(polygonHoverStyle);
        },
        click: function(e) {

          L.DomEvent.stopPropagation(e);

          $('#sidebar-title').text(e.target.feature.properties.name);
          $('#sidebar-content').text(e.target.feature.properties.summary);
          sidebar.open(panelID);
        }
      });
    },
    style: polygonStyle
  }).addTo(map);
}


texts: Create randomized raster with frequency distribution of second raster

texts:
I want to calculate resistance distance based on circuit theory for a set of species for the city of Berlin, GER. For the city area I use land cover, sealed soil and building height data. This data is freely available via http://fbinter.stadt-berlin.de/fb/index.jsp. I use ArcMap 10.3.
As proposed by Koen et al. 2010 (http://dx.doi.org/10.1371/journal.pone.0011785
). To sum up the paper, I want to create a buffer around Berlin to account for edge effects. This buffer should show the same frequency distribution of resistance values as the city raster.

For example:
Scenario - Frequency Distribution (low/medium/high)

Berlin - (46/50/98)
Random - (46/50/98)

I started an attempt using R 3.3.3 on MacOS 10.11.6. So far I can import the sealed.tif (which is the city area), transform to a matrix and get the frequency distribution. I then created a new randomized matrix with values from 0 to 100.

setwd("/Users/franzxaverpoellinger/Desktop/Statistics/Raster/raster")

library(raster)
library(sp)
library(rgdal)
library(raster)

str_name<-'sealed.tif'
sealed=raster(str_name)
plot(sealed)

# convert from .tif to a matrix
sealed.matrix <- as.matrix(sealed)

seal.cut = cut(sealed.matrix, breaks = seq(0, 100, by = 10), right=FALSE)
seal.cut.freq = table(seal.cut)
(seal.cut.freq/sum(seal.cut.freq))*100 # this is the aimed frequency

# and now the same for the buffer .tif
str_name.buffer <-'buffer.tif'
buffer=raster(str_name.buffer)
buffer.matrix <- as.matrix(buffer)
str(buffer.matrix)

# create a matrix the same size as buffer.hist
new.buffer.matrix <- matrix(sample.int(100, size= 457*537, replace = TRUE), nrow = 457, ncol = 537)
new.buffer.matrix

buffer.cut = cut(new.buffer.matrix, breaks = seq(0, 100, by = 10), right=FALSE)
buffer.cut.freq = table(buffer.cut)
(buffer.cut.freq/sum(buffer.cut.freq))*100

Now I want the new.buffer.matrix to show the same frequency distribution of as does sealing.matrix. If I had the same distribution I would (somehow) go back from matrix to .tif and then just clip it to the extend that I need.


texts: Edit arcgis-service-properties with REST-API

texts:
I want to change the properties of several services via REST-API with C#-HTTP-Client. Something goes wrong here so I tried first with Python.

I found the example here on esri page. For convenience I changed only the description. The output of python-script tells me all ok.

But in ArcGIS Server Manager and in JSON-LINK (https://ip:6443/arcgis/rest/services/xxx/xxx/MapServer?f=pjson) there is no change.
But in the Administrator-Directory (https://ip:6443/arcgis/admin/services/xxx/xxx.MapServer) changes had been made.

So I thought something was wrong in the Server-Cache and made my script to stop and start the service...no success...started server also no success.

I found similar problem here but no reason for different reports in
ArcGIS Server Administrator Directory and ArcGIS Server Manager.

Has anyone made similar experiences or knows a trick?


texts: Import Esri/ArcGIS .e00 files to QGIS on Linux (getting error message)?

texts:
I can't seem to import Esri .e00 files into QGIS, and I can't figure out why.  I'm trying to import files I've downloaded from ftp://ftp.granit.sr.unh.edu/pub/GRANIT_Data/Vector_Data/Environment_and_Conservation/d-landcover/d-1995/.  Based on the answer to this question: Adding .e00 data into QGIS, I tried importing lan23205.e00 as a vector file, and get an error message stating that it is "not a valid or recognized data source"

What is going on here?

Note: I'm running Ubuntu Linux.


texts: Clip feature (with selected attributes) with individual polygons using iterator: name error or repetitive selection

texts:
I have a bunch of locations (polygons) across the USA that I will use to clip a number of features and rasters (e.g., the National Hydrography Dataset). When I clip a dataset like the NHD with all of the polygon in one feature class, it takes a lot longer than if I split the polygons and clip the dataset with one polygon at a time.
To that end, using model builder, I am attempting to iterate through a directory of features (individual polygons) and use each of them to clip a different feature that has first been treated with Select Layer By Attribute. The model (below) works, but will perform Select Layer By Attribute for each iteration, making the process much slower than if Select Layer By Attribute was just performed once.
Full model, but slow

Next, I attempted to use submodel and main model following ESRI guidance.The submodel looks like this:
submodel to iterate through features

and the submodel within the main model looks like this:
submodel within main model

However, this operation fails with the following error:
ERROR 000354: The name contains invalid characters
Failed to execute (Clip).

Then I read about using Collect Values or Select Data and tried using each (separately) at the end of the submodel. This did not work.
Next, I read that saving the 'Name' as a parameter in the submodel, and then right click on the submodel in the main model and Make Variable > From Parameter > Name. However, Make Variable > From Parameter was unable to be selected. I don't know what changed, but one time I was allowed to  Make Variable > From Parameter it created %Name% instead of name and I tried the model with Name and %Name% but the got the same error again (000354). Even in this same model, I cannot get Make Variable > From Parameter to be available again.
One example of a different model (I also tried renaming FL_%Name%.shp to Output Values)

Then I tried using Parse Path > Name connected to the submodel output with Name connected a precondition to Clip, this also produced a #000354 error.
Outside of model builder I saved the feature with selected attributes as a new feature. Then I used this and model builder with an iterator and clip and it worked great and quickly.
But, I'd like to know how to make the model work for the future. How can I avoid  ERROR 000354: The name contains invalid characters? I feel like I am missing something.


texts:
I am getting negative elevation values from CesiumTerrainProvider (stk-terrain). For few locations the below code is giving negative elevation values, which are wrong, as I have checked those values from other sources.
Is there any problem with the terrain provider or my code.
Here is my code -

var viewer = new Cesium.Viewer('cesiumContainer');
var terrainProvider = new Cesium.CesiumTerrainProvider({
    url : '//cesiumjs.org/stk-terrain/world'
});
var positions = [
    Cesium.Cartographic.fromDegrees(77.01091072384598, 8.656004976829797),
];
var promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
Cesium.when(promise, function(updatedPositions) {
    console.log(positions[0].height);

});
// Fly to a position
viewer.camera.flyTo({
    destination : Cesium.Cartesian3.fromDegrees(77.01091072384598, 8.656004976829797)
});


texts: Clipping raster to selected feature using ArcPy

texts:
I have a fishnet and I want to make a script that sequentially uses each square of the fishnet as the output extent to clip a raster.
If I select a single square of the fishnet I can then clip the raster with the fishnet feature as the output extent and it clips to that single selected square. I now want to iterate this for each square.
The issue is this: If I copy the exact code that successfully did the clip I wanted and I execute this code in the Python window, it no longer clips to the extent of the single selected square but instead clips to the full extent of the fishnet feature. This means that if I try to iterate this using a for loop to select the desired fishnet square then clip the raster to that square then each time it clips it clips to the entire fishnet feature and not the selected square.
for n in range(1,100):

    x = str(n)

    arcpy.SelectLayerByAttribute_management(in_layer_or_view="Fishnet", selection_type="NEW_SELECTION", where_clause="ID = " + x)

    arcpy.Clip_management(in_raster="raster.tif", rectangle"", out_raster="clip_raster_” + x + ".tif", in_template_dataset="Fishnet", nodata_value="#", clipping_geometry="NONE", maintain_clipping_extent="NO_MAINTAIN_EXTENT")

Any way to fix this code so it only clips to the selected fishnet square and not to the entire fishnet feature?


texts: Debugging MinimumBoundingGeometry_management() gives ERROR 000210?

texts:
I created a script to envolve points with polygons using the same value or ID. The main tool was the "Minimum Bounding Geometry", and so far my script is working good, but to convert to toolbox script It doesn't work good. I introduced the parameters but nothing happens, even do no errors show up. I verified the manual to convert the script to toolbox script but nothing solve this issues.

Someone can help me?

How I can convert correctly the script to toolbox or my script have a problem?

This is my script:

import arcpy, os, datetime

#Variables de entorno
Introduce_shp = arcpy.GetParameterAsText(0)
Ruta_salida = arcpy.GetParameterAsText(1)

arcpy.AddMessage('Introduce el shp de entrada:'+ Introduce_shp)
arcpy.AddMessage('Ruta de salida:'+ Ruta_salida)

Fecha = datetime.datetime.now()
dia = Fecha.day
mes = Fecha.month
year= Fecha.year
Nombre_archivo_shp = '{0}{1}{2}_Areas_almacenes_DICONSA.shp'.format(dia,mes,year)

#Une ruta y archivo
Ruta_salida_poligonos = os.path.join(Ruta_salida,Nombre_archivo_shp)

#Realiza proceso de areas
arcpy.MinimumBoundingGeometry_management(Introduce_shp, Ruta_salida_poligonos, "CONVEX_HULL", "LIST", "CVE_ALMACE", "NO_MBG_FIELDS")

However this gives an error.

Can somebody tell me how to solve the problem?

Running script Script1...

Introduce el shp de entrada:D:\SedesolVQB\Proyectos\proyecto_INFRASOCIAL\Capas_infraestructura_social\Capas de abril2017\n_loctdico_0417_09_.shp
Ruta de salida:D:\Documentos\ArcGIS\n_loctdico_0417_09__Script1.shp

Traceback (most recent call last):
  File "D:\SedesolVQB\Proyectos\proyecto_MODELBUILDER_DGAAE\Areas_almacenes_v12.py", line 30, in <module>
    arcpy.MinimumBoundingGeometry_management(Introduce_shp, Ruta_salida_poligonos, "CONVEX_HULL", "LIST", "CVE_ALMACE", "NO_MBG_FIELDS")
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 2576, in MinimumBoundingGeometry
    raise e
ExecuteError: ERROR 000210: Cannot create output D:\Documentos\ArcGIS\n_loctdico_0417_09__Script1.shp\1462017_Areas_almacenes_DICONSA.shp
Failed to execute (MinimumBoundingGeometry).


texts: Creating index layer around rasters to rename files using ArcPy with ArcMap?

texts:
I have a few hundred high resolution geotiffs (cell size 2m) such as the example below which I am trying to rename according to the location in an index layer (red rectangles in example below). I would like to add the attribute of the index rectangle in front of the filename (in this case "B6_filename.tif") which covers the most of the data pixels in the geotiff (black are NoData values, coloured values are data pixels).

What I tried so far is this:

Reclassify the raster to a binary mask with data pixels and NoData values using the reclassify tool
Convert Raster to Polygon (takes over an hour probably due to the high resolution data and is therefore not suitable when trying to automate this for hundreds of geotiffs with arcpy)
Creating an extent shapefile using the Raster Domain tool available within the 3d Analyst licence

I was thinking of further using this extent shapefile together with an Intersect analysis to calculate the area percentage of each intersected part. However the extent of the raster extracted by the Raster Domain tool results in a rectangle and not around the data pixel values (blue rectangle in example below).

My approaches were not successful.

Is there another way to solve this problem?

In the end I am attempting to rename my sample file "filename.tif" to "B6_filename.tif" with B6 referring to the proportionally largest area covering the index rectangle.


texts: Run database query based on selection in QGIS

texts:
I'm trying to figure out the best approach to achieve the following:

A user selects a single or group of features.
Option to access a popup box with a set of dropdowns populated by DB query.
The user saves, and a database query is run.
PostGIS layers are refreshed.

One thing to note is that the PostGIS layer the user will be selecting features from is a view query, so the update needs to be made to different tables.

Could anyone point me in the right direction of what to research/look at?  I'm wondering if I would have to write a plugin?


texts: Alternative to GeoNode? Running Python3, Django2, Apache2 and GeoServer2.14

texts:
I've developed a QGIS plugin (The QGIS repository, GeoDataFarm homepage, with a tutorial), that I now want to transfer to the web. The reason for transfer it to the web is mainly to able to limit the amount of information/buttons for the user and I believe that there is a too high threshold for the users (farmers) of the plugin to use QGIS.
Anyhow, I have a server that stores data in a PostgreSQL database (with PostGIS), and I have managed to set up a GeoServer that can connect to the database and supply a WMS service, but it was a lot of work in the "GeoServer environment" (and in QGIS to create the styling), that I want to transfer via Python to my webpage. So I looked around for options and understood that much of the work could be done by GeoNode. But I run the webpage with Python3, Django 2.1.2, Apache2, and I understood that GeoNode is still running Python 2.7, etc. So are there any alternatives for GeoNode working with Python3/GeoServer/PostgreSQL etc?


texts: Getting shortest distances between features on separate polygon layers using ArcGIS Desktop?

texts:
I have a county-level map for the state of North Carolina, U.S.

I would like to compute the shortest distance of each county to any point along the border of Georgia.

How would this be done?

I have looked all over this site and the internet for suggestions and cannot find much.


texts: Out of database PostGIS rasters are displaying incorrectly in QGIS

texts:
I've stored a series of rasters in PostgtreSQL/PostGIS, as out-of-databse rasters using the -R switch in GDAL. There is an error when these rasters are displayed in QGIS- the colours are either switched around, or all red hues, or entirely black, or sometimes the image is diagonally skewed.

I've tried variations of the GDAL switches to no avail. When the raster is loaded normally into QGIS from the file server (instead of via PostGIS), there are no errors. Thoughts?


texts: Looking for similarity analysis tool between raster and vector layers in QGIS?

texts:
I'm aiming to do a similarity analysis between a raster layer and a vector layer.

The raster layer is a 5-class ice map and the vector layer (points) contains ice jam events data. The goal here is to determine if there is a trend/pattern in the surroundings of the ice jam events that can be seen on the ice map.

I've created buffer layers around the ice jam events (50m, 100m, 500m) and I'd like to have statistics on how much of each class of the raster underneath is present within the buffer. Ex: 42% class-1, 22% class-2, 8% class-3 and so on.

I'm hoping to use QGIS/Grass GIS tools to solve this.

I'm fairly new to the software.


texts:
I would like to import GPS tracks created in osmand to QGIS.
First, I exported the tracks in gpx format from OSMand. then I tried using the vector-->GPS tools --> load GPX file dialog. The file is accepted and the layer created but does not show and the attribute table is empty as well (only contains the name but no trackpoints).

Loading gpx files form osmand works in JOSM and ArcGIS but not in QGIS. Any ideas about how to get it to work?


texts: Get username info from active connection in Mapbasic

texts:
I'm trying to retrieve information on username from active connection (SQL Server Express) in MapInfo 11.5 32bit. First I tried using Server_ConnectInfo( ConnectionNo, SRV_CONNECT_INFO_SQL_USER_ID  ) which should return "String result, returning the name of the SQL user ID." (by MapBasic Reference), but it returns "dbo" (my DB schema). Then I tried Server_GetODBCHConn() function. In MapBasic Reference this example stands:

'********************************************************************
'* Find the identity of the Connected database
DECLARE FUNCTION SQLGetInfo LIB "ODBC32.DLL" (BYVAL odbchdbc AS INTEGER,
BYVAL infoflag AS INTEGER, val AS STRING,
BYVAL len AS INTEGER, outlen AS INTEGER) AS INTEGER

Dim rc, outlen, hdbc, odbchdbc AS INTEGER
Dim DBName AS STRING

' Connect to a database
hdbc = Server_Connect("ODBC", "DLG=1")
odbchdbc = Server_GetodbcHConn(hdbc) ' get ODBC connection handle

' Get database name from ODBC
DBName = STRING$(33, "0") ' Initialize output buffer
rc = SQLGetInfo(odbchdbc, 17 , DBName, 40, outlen) ' get ODBC Database Name

' Display results (database name)
if rc <> 0 THEN
Note "SQLGetInfo Error rc=" + rc + ", outlen=" + outlen
    else
Note "Connected to Database: " + DBName
    end if

'********************************************************************

According to https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function syntax for SQLGetInfo is:

SQLRETURN SQLGetInfo(
      SQLHDBC         ConnectionHandle,
      SQLUSMALLINT    InfoType,
      SQLPOINTER      InfoValuePtr,
      SQLSMALLINT     BufferLength,
      SQLSMALLINT *   StringLengthPtr);

So, in line rc = SQLGetInfo(odbchdbc, 17 , DBName, 40, outlen) parameter "17" represents type of information we are requiring, but I can't find out what number represents username (SQL_USER_NAME stands as one of possible InfoType values, but no number is linked to this function). I have tried every number 1-60 but none of them returned username.


texts: Preventing gaps on polygon shapefile being filled automatically when exporting from QGIS?

texts:
I classified raster dataset and converted raster dataset into polygon shapefile, then merged adjacent grid polygons using QGIS Dissolve function (figure 1) creating a temporary file. However, when I try to export it into a shapefile some holes in polygons are automatically filled (figure 2) which I don't want as I will use those holes in my further analysis.

How do I dissolve polygons without filling the gaps using QGIS?

  Figure 1 (Temporary file)                   Figure 2 (After saving)


texts: How to include non aggregate columns in select function if not including them in aggregate function (like GROUP BY) in PostGIS table

texts:
I have a property parcel table a in PostGIS that has the following columns/fields
owner_name,
owner_city,
county_name,
state,
owner_address,
owner_mailing_address

I want to dissolve/aggregate the adjoining parcels that have the same owner name, owner_city, and state. I achieved it by using ST_Union and GROUP BY functions. Here is the SQL that I used
  create table b as
select
    owner_name
    , owner_city
    , county_name
    , state
    , ST_Union(ST_Buffer(geom, 0))
from
    a
group by
    owner_name
    , owner_city
    , county_name
    , state;

Is there a way for me to include owner_address and owner_mailing_address in table b without adding them to the aggregate function (GROUP BY)? The SQL should pick the first value it can find for these fields and update them to the two columns in table b. Please note that joining the tables is not a option.


texts:
I am trying to update one field with values as multiples of five till the maximum for the value in the gridcode. The field I am trying to populate is called Time_min. As I am very new to python, am not able to understand where the mistake is. The overwrite is on, so it should not have any problems accessing the file. Please let me know if there are better alternatives.

rows = arcpy.UpdateCursor("CalculateT")
i = 5.0
time_min = Raster("time_min")
m = time_min.maximum
for row in rows:
    while i <= m:
        if row.getValue("gridcode") <= i:
            row.setValue("Time_min", i)
            rows.updateRow(row)
            i = i + 5
del row
del rows

I have also thought of putting the algorithm as checking divisible by 4 or not; but I need to know if this is normal or an error in my part.


texts: Finding duplicate records in field using ArcGIS for Desktop?

texts:
I'm looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates.

I would like to add a field 'Duplicate' that says Yes or No (or 1 or 0 is fine) when the ID attribute is present elsewhere. Using the following python script in Field Calculator returns 1 for a duplicate entry and 0 for unique entry;

uniqueList = []
def isDuplicate(inValue):
  if inValue in uniqueList:
    return 1
  else:
    uniqueList.append(inValue)
    return 0
isDuplicate(!FIELD_NAME!)

However, the 1st record of, for example, 5 duplicate IDs will also be returned as a 0 (the subsequent 4 are considered the duplicates). I would need all 5 to be marked as duplicate as the ID exists elsewhere.

Using the following code will give you an incremental count of how many times that ID occurs with 1 meaning the 1st occasion and so forth;

UniqueDict = {}
def isDuplicateIndex(inValue):
    UniqueDict.setdefault(inValue,0)
    UniqueDict[inValue] += 1
    return UniqueDict[inValue]

isDuplicateIndex( !YOUR_FIELD! )

I just want a 1 (or Yes) if the ID of that record exists elsewhere! (ArcGIS version 10.1)

I have seen other answers such as Python script for identifying duplicate records (follow up) but it doesn't quite work.


texts: Aggregate SpatialPoint to form SpatialPolygon

texts:
Is it possible to convert SpatialPointDataFrame to SpatialPolygonDataFrame by some kind of generalization or aggregation function in R.

how can i form polygons from points of similar color/classified attribute value as show in picture.


texts: QGIS Reports: Create HTML table by iteration through every field in attribute table of layer

texts:
I have a QGIS project and I want to generate a report out of this.
I am using the report-tool (https://docs.qgis.org/3.16/en/docs/user_manual/print_composer/create_reports.html) as it suits me better than the atlases. I defined my pages via HTML documents and iterated through the corresponding QGIS layer using the field group section.
So far, so good, but now I would like to additionally add a summary table at the beginning of the report, showing 1 row per entry (in this summary table), i.e. I need to

Access the values of my QGIS layer within the HTML (which works well for the field group section, but does not seem to work in a static section), and then
Create a HTML expression which iterates through every entry of my QGIS layer and adds an additional line to the summary table.

Unfortunately, I am already stuck with the first challenge...


texts:
I am developing a python addin that allows the user to click on a location in arcmap and a browser window opens with the associated area in google maps.

The issue I am currently facing is that the formula I use creates a discrete zoom level resulting in zoom levels with 10 decimals, such as 17.7875321547z or 18.9062909847z.

The Formula I am using:

level = (36.906 * scale**-0.088)
 url = "https://www.google.com/maps/@{0},{1},{2}z".format(y_coord, x_coord, level)

My issue is that the url shows my provided zoom level but then rounds it down to the nearest whole number. From 17.7875321547z to 17 and so on.

I have found a similar question (Can I get a google static map at the inbetween zoom levels that google maps site does?) that was asked almost 3 years ago with the only answer being that google had not fixed the issue at that point.

Has there been any progress since then?

Is there a way to use the specified zoom level without google rounding it?


texts: Making output table of Python script tool be intermediate file to another model?

texts:
I have created a Python script tool using ArcPy. It has a File Geodatabase Table as output.

I want to add the script to a new Model in ModelBuilder in ArcMap. The Table output should be an "Intermediate" file in the Model. When I tried to right click on the Table to set "Intermediate" I noticed that option was greyed out.

In ModelBuilder, how can I set the Table  to be "Intermediate".

...

Output_file_geodatabase = arcpy.GetParameterAsText(0)
Output_table_name = arcpy.GetParameterAsText(1)
Template_Table_Name = arcpy.GetParameterAsText(2)

arcpy.CreateTable_management(Output_file_geodatabase, Output_table_name, Template_Table_Name, "")

... use InsertCursor to add rows to the Table ...

arcpy.SetParameter(3, Output_file_geodatabase + "\\" + Output_table_name)

So here, there are three input params and one output param which is the Table.


texts: Using ArcGIS Online with ArcGIS for Server?

texts:
I am publishing data to ArcGIS Online through ArcGIS Server as live feature services. We are using the http server URL but our ArcGIS Online organization is an https URL. Every time I want to display my data I have to push the button to "Show all content" to display secured content at the bottom of the map viewer.

Do I need to change my server to the https URL or is there possibly another system configuration that could be causing this error?


texts:
I am developing custom geoprocessing tool (class-library project) on ArcGIS 10.2. This project uses Oracle.DatAccess from ODP.NET 1.0 . This is a simple tool which queries - oracle 10g database and returns a distinct records from a specific table.

This tool is working fine from tool box but when this tool is published in REST, it throws
below error:

Error:The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception

ArcGIS server 10.2, Visual Studio 2012.

Server: Windows 2012 -6bit Operating system

Oracle client : installed both oracle 32 and oracle 64 bit
   (C:\oracle\product\10.2.0\Client_32,C:\oracle\product\10.2.0\Client_64)

PATH:
   c:\oracle\product\10.2.0\client_64\bin;c:\oracle\product\10.2.0\client_32\bin;

Any pointer on this issue?

To begin with, this custom GP tool project was working in ArcGIS 10.0 for last 2 years successfully. As part of technology migration activity,  I am upgrading this project to 10.2. As mentioned, am using Windows 2012 server (64 bit OS) where ArcGIS Desktop and ArcGIS server 10.2 has been installed in same box. Oracle client 32, 64 bit has been installed. Path is set as above.


texts:
I'm making a simple map with locations of daycare centers plotted. I have two filters, one that shows ages and another that shows different types of centers. I can filter one one or the other, but not both.

http://www.datanarratives.org/daycarefinder2014/

For example, how do I filter the map to show only Corporate sites that serve 0-2 years?

Currently the query for one column is like this:

query = "select * from table_04apr2014 where age_range like "+ "'%"+agerange+"%'";


texts: Leaflet push GPS position to array onLocationFound and search a squared area around this position

texts:
So I have this approach of pushing the coordinates of a location to an array:

var gpsposition = [],
function onLocationFound(e) { gpsposition.push(e.latlng);}

Now I have the following questions:

Q1: Currently I receive an Array [Object] with coordinates, but I want the coordinates to be pushed in Array [Array [2]] format  . How do I achieve that?

Q2: Am I right in the assumption that

L.map.locate({watch: true})

triggers onLocationFound constantly, meaning that the updated GPS position will be pushed to the array constantly, hence creating a list of positions, too?

Q3: A function should search within a square area around each new GPS position, e.g. 100mx100m, through another array with coordinates in Array [2] format. Then, it should assign a colour to all circles within that square. Any ideas how to do this?


texts: Arcgis rest server date bug - One day earlier - Flex

texts:
I am having that arcgis rest server bug where the attribute table and the attribute inspector show the dates as one day earlier. I found a possible solution on the web but there is an error in the following line because the attribute inspector has no "form" property. Is there any way to get around this? Thanks

error in this line

var formItems:* = editor.attributeInspector.form.getChildren();

/ Place the following code below the function populateEditor

private var dateFormatter:DateFormatter = new DateFormatter();

private const newDateFormat:String = “DD/MM/YYYY”;

private function attributeInspector_showFeatureHandler(event:AttributeInspectorEvent):void
{
   formatDateFieldDisplay(event);
}
private function attributeInspector_updateFeatureHandler(event:AttributeInspectorEvent):void
{
   formatDateFieldDisplay(event);
}
private function formatDateFieldDisplay(event:AttributeInspectorEvent):void
{
   if(!(event.featureLayer && event.feature && event.feature.attributes))
      return;
   // This ensures that we only validate when we are working at a field level
   (not an AttributeInspector level)
   if(event.field)
   {
      if(event.field.type == Field.TYPE_DATE)
      {
         if(event.newValue) // If it comes exclusively from an update … format the display
         {
            // Change the date format as desired
            event.target.formatString = newDateFormat;
         }
      }
   }
   else if(event.type.toLowerCase() == “showfeature”)
   {
      var formItems:* = editor.attributeInspector.form.getChildren();

  // Loop items and trigger update event
  for (var i:Number = 0; i < formItems.length; i++)
  {
     if(formItems[i].data && formItems[i].data is Field)
     {
        var field:Field = formItems[i].data;
        if(field.type == Field.TYPE_DATE &&
           field.name in event.feature.attributes &&
           event.feature.attributes[field.name])
        {
           var event:AttributeInspectorEvent = new AttributeInspectorEvent(“updateFeature”,
                                                             true,
                                                             event.featureLayer,
                                                             event.feature,
                                                             field,
                                                             event.feature.attributes[field.name],
                                                             event.feature.attributes[field.name]);
           var formItem:* = formItems[i].getChildren();
           if(formItem && formItem.length > 0)
              formItem[0].dispatchEvent(event);
        }
     }
  }

}
}

// This function should be in a separate util file to be reused if necessary by other classes.
// This function comes with the ArcGIS Viewer for Flex 2.4.
// If Esri updates this function so should the developer.
private function msToDate(ms:Number, dateFormat:String, useUTC:Boolean):String
{
   var date:Date = new Date(ms);
   if (date.milliseconds == 999) // Workaround for REST bug
      date.milliseconds++;

if (useUTC)
      date.minutes += date.timezoneOffset;
   if (dateFormat)
   {
      dateFormatter.formatString = dateFormat;
      var result:String = dateFormatter.format(date);

  if (result)
     return result;
  else
     return dateFormatter.error;

}
   else
   {
      return date.toLocaleString();
   }
}

Source:
http://gisengineering.blogspot.co.nz/2011_09_01_archive.html


texts: Calculate field management not working within customized Python tool in ArcGIS

texts:
I am trying to make a custom made Python Script tool which I would like to use in Model builder. I am using the arcpy.Calulate_field_management function (simple reclass function as an example), but it seems not be working properly. Please note that when I run this script on its own through a Python editor (IDLE), the script works fine. After adjusting it to make it work for a custom Python Script tool, the script stops when it is going to calculate the field.

This is the script which I use for my tool with a comment where it stops. The arcpy.GetParameterAsText(0) refers to the table which you can find in the picture below.

import arcpy
try:
    fc = arcpy.GetParameterAsText(0)
    arcpy.AddMessage("Hi Jelle, your script is starting now...")
    def calc_value(orig_field):
        if (orig_field == "R<10_min"):
            return "1"
        elif (orig_field == "R_10-20_min"):
            return "2"
        elif (orig_field == "R_30+"):
            return "3"
    def calc_field():
        arcpy.AddMessage("Calculating field management has started, Jelle")
        reclass_field = "Reclass_SA_All"
        ##HERE is WHERE PYTHON SCRIPT TOOL STOPS
        arcpy.CalculateField_management(fc, reclass_field, "calc_value(!SA_All!)", "PYTHON_9.3")
        arcpy.AddMessage("Reclass Field calculation is done, Jelle.")
    arcpy.AddMessage("Starting calc_field function, Jelle...")
    calc_field()
    arcpy.SetParameterAsText(1, fc)
except:
    arcpy.GetMessages()

Here is a picture of the table which I am trying to edit together with the customized script tool window when it is finished running. I have added customized messages in my script to find out where the script stops running.

I have the feeling I am doing a basic error which stops the scripts from running the calculate_field_management within my tool. Does anybody know what I am doing wrong? AM i right if I say the calculate_field_management cannot refer to another function within my expression? This does work when I run the script on its own through a Python editor (IDLE).


texts: Exporting many TIFFs issues in ERDAS Imagine 2016?

texts:
I have been having an issue with exporting TIFFs on my ERDAS Imagine 2016. The version is 16.00.0000 Build 650. When I need to run a batch to export many TIFFs and it would export one but then it would stopped the program and it would need to closed it.

This is really strange because when I did this the first time it worked fine and then do this again on another different day and all of sudden I am getting have these issues.

I have a lot of old aerial photos and they are in an external hard drive.
I am wondering if anyone who use the software with ERDAS has any issues with the Export TIFFs ? I have looked into Hexagon Geospatial on their site and did not find any issues with Export.

They are all in TIFFs in an external hard drive that has a Forest historical image that was done by flying back in the 1930's to 1950's. It is a black and white.


texts:
I have a raster map (a photocopy I took from an Atlas), and a vector map of the UK. The raster map shows pre-1890 Scottish county borders.

I have geocoded the map so that the raster borders overlap the vector map, but here comes my question: how do I create a vector layer showing the separate counties? This may be especially difficult, since some of the counties are not contiguous.


texts:
I have about 2 acres of land, wooded and brushy. There was a survey and the corners have rebar.

I am working on a site plan for house construction. I have two related problems:

Finding a spot on the land, by reference. E.g., 10' from the E boundary, and 40' from the S boundary.
Marking certain features down on a map. E.g., a particular tree that I want to keep - where is it in relation to the borders?

Between the terrain and the brush, I can't run a string between the corner rebar.

I picked up a cheap GPS (Bushnell ONIX 350), but I don't think I can get enough accuracy out of it for this purpose.

At this point, I'd be happy to get measurements within 1 foot of error.

I'm looking for cheap solutions. Any ideas?


texts:
When adding a scale bar in the print composer, by default there is a gap between the scale bar and it's frame :

How can I move the sacle bar (blue circle) to the Lower left corner (red circle) ?

For example, in ArcGIS the scale bar doesn't have a gap between the scale bar and it frame


texts: Unable to perform applyEdits in Feature Service

texts:
I am facing two issues with applyEdits through JavaScript API.

1.    Unable to perform applyEdits

When I perform ApplyEdits on feature service, I get the error "Unable to complete operation". When checked the Server logs, it showed:

  Error: The current version does not support editing (base, consistent,
  or closed) [An open transaction was detected. All user transactions
  must be closed prior to StartEditing.]

But in JavaScript API, there is no such command for StartEditing or StopEditing. Moreover, I am not using versioning for editing. I am directly applying the edits to the DEFAULT version.

Is there any way to handle the StartEditing and StopEditing through code?

2.    Getting “Success” message for applyEdits but feature not getting added in feature service

At other times while editing, even if the features get added and a "Success" message from the feature service is shown yet the features are not visible in the feature service. Upon restarting/refreshing the feature service, those added features are also lost.

These solutions were tried:

•   Tested using only mandatory fields for ‘ApplyEdits’ instead of all fields

•   Tried inserting features from REST

•   Dropped the main table

•   Recreated the table from backup

•   Recreated the table from scratch

•   Restarted the Map service

•   Deleted the Map service

•   Recreated the Map service and the MD used to publish the service.

Seldom it works fine immediately after the service is refreshed/restarted but not after sometime.

What can be the possible causes/solutions behind this?


texts: Changing the line color of a marker box using OpenLayers

texts:
I'm trying to figure out how to change the line color of a marker box in openlayers. I've been learning from the following example:

<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <title>OpenLayers Boxes Vector Example</title>
        <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
        <link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">

Boxes Example Vector

            box, vector, annotation

            Demonstrate marker and box type annotations on a map.

What I tried doing was replacing the boxes line with the following:

            //var boxes  = new OpenLayers.Layer.Vector( "Boxes" );
            var styleMapBoxes = new OpenLayers.StyleMap({borderColor: '#008000'});
        var boxes  = new OpenLayers.Layer.Boxes( 'Boxes', {styleMap: styleMapBoxes});

but it did not work. I've read through the example here, but still do not understand how I can edit the box style. According to the documentation borderColor is a valid attribute.


texts: How to show elevation data from TIFF file in QGIS

texts: I work many times with QGIS and CIVIL3D, and when I create a surface from Civil 3D and export it as a TIFF file in order to open it in QGIS 3.4, the elevation data from this TIFF file appears "flat" (i.e. the same elevation throughout the area). However, strangely enough, when I extract contours, these are correct. I do not know how to fix this problem. I attached a snapshot.


texts: Remove gap between two different (large) shapefiles

texts: I'm trying to run a somewhat automated process on two shapefiles to fill gaps in between a water and country boundary. I want to bring the Country boundary to meet the more detailed water polygon. Would this be possible in QGIS or GRASS? so far its seems this has been done but within a single shapefile?


texts:
I'm using Leaflet to create a map of movements of a species of interest.
I'm using polylineDecorator to draw arrows, but I would like to have a bi-directional arrow (example in figure below).

Right now my code for a single arrowhead looks like that:

       function pop_Seasonal_0(feature, layer) {
          var PD1 = L.polyline(layer.getLatLngs(), {
               color: "#8B0000",weight: 5,opacity: 1,dashArray: '4,12,20,12'
          }).addTo(layer_Seasonal_0);

          L.polylineDecorator(PD1, {
            patterns: [{
              offset: '110%',
              repeat: 0,
              symbol: L.Symbol.arrowHead({
                pixelSize: 20,
                pathOptions: {
                  color: "#8B0000",
                  fillOpacity: 1,
                  weight: 0
                }
              })
            }]
          }).addTo(layer_Seasonal_0);
        }

Is there a way to do it?


texts: Selecting polygons over raster extent using QGIS?

texts:
I would like to select all the polygons that are within my raster extent.

Is there a tool in QGIS to do it ?

Such as the select by location tool but instead of comparing the features from another vector doing it with the raster.


texts:
Let us assume the following two lines

The two geometries are extracted by two different tables: table_1 and table_2 with respective column geometries geometry_1 and geometry_2. I want to check if the two lines are identical. Condition for this is if the max distance between the two lines is not longer than x meters. I am running the following:

create index geom_1_idx ON table1 USING GIST (geometry_1);
select table1_id, table2_id  from table1 t1, table2 t2
              where (select st_DWithin(t1.geometry_2 , t2.geometry_2, units_of_srid) = true)

With spatial indexing, I understand that the comparison refers to the bounding boxes of the lines.

How correct is it?

Is a case like the one of the image covered?


texts: Reading a shapefile into networkx as undirected graph

texts:
import networkx as nx
from networkx.algorithms import approximation as ax

Road = nx.read_shp('/Users/benjaminhendel/Downloads/scatteredroads.shp') #Reading Road Data
Base = nx.read_shp('/Users/benjaminhendel/Downloads/testptssnapped.shp') #Reading Terminal Node
nodes = list(Base.nodes) #Creating list of terminal nodes
Road = Road.to_undirected()
st_tree = ax.steinertree.steiner_tree(Road,nodes,weight='length')

I'm trying to read a shapefile into networkx and run steiner_tree approximation on it. It tells me that my graph is directed. When I make it undirected, it gives me the error:
networkx.exception.NetworkXError: G is not a connected graph. metric_closure is not defined.


texts: Exporting geodatabase layer to shapefile fails in QGIS

texts:
I'm attempting to export a single layer from a geodatabase to a shapefile. The export fails at the same point, 71%, with this message (I'm only displaying the first few lines),

Export to vector file failed.
Error: Feature write errors:
Feature creation error (OGR error: Failed to write shape object.
File size cannot reach 4294815324 + 162344.)

The export operation does produce a shapefile, but with only about 70% of the content of the original geodatabase layer.

I'm using a MacBook Pro, operating OS 10.15.2 and QGIS 3.4.15.


texts: How to prepare automatic text labelling for legend using ArcMap?

texts:
I need to label for text with legend without ungrouping layers.  I have attached an example image to show the expected output model.

I am looking for your guidance.


texts: How to translate VBScript to Python-parser in Field Calculator

texts:
How do I translate the following VBScript code in Label Expression to Python using the Python-parser?
Function FindLabel ( [MHUNIT], [BLDG_NUM] )
 If Not IsNull( [MHUNIT] ) Then
  FindLabel = [MHUNIT]
 Else
  FindLabel = [BLDG_NUM]
 End If
End Function


texts: GeoServer CSS Styling should be able to filter by type?

texts:
According to the docs:

  Filtering on Type¶

  When dealing with data from multiple sources, it may be useful to
  provide rules that only affect one of those sources. This is done very
  simply; just specify the name of the layer as a filter:

  states {
      stroke: black; }

So I created this style:

points [@scale > 5000000] ['state' = place] {
    label: [name];
}

And got this error:

  The requested Style can not be used with this layer.  The style
  specifies an attribute of place and the layer is: cite:lines

My reading of the docs is that only features from the "points" layer should be considered, but my reading of the error message is a "lines" feature was used and found to not have a 'place' attribute.  Am I misunderstanding the syntax?

On a side note, my entire css file is 3KB and the generated sld file is 55KB and the generated SLD looks correct:

    <sld:FeatureTypeName>points</sld:FeatureTypeName>
    <sld:Rule>
      <ogc:Filter>
        <ogc:PropertyIsEqualTo>
          <ogc:Literal>state</ogc:Literal>
          <ogc:PropertyName>place</ogc:PropertyName>
        </ogc:PropertyIsEqualTo>
      </ogc:Filter>


texts: Removing text symbol style in ArcGIS Pro

texts:
I saved a text style symbol but then realised it was not exactly right, I subsequently made a new one but now want to delete the original one.
Is there a way to do this in ArcGIS Pro?


texts: Is there an out-of-the-box way to manage 1:n data in QGIS?

texts:
I think an image explains the question best:

What I basically want to do is select the object, view its attributes and from there call the second table to view/edit/add status entries. Since I can't just do a 1:n join, the tables are separate right now and the status table requires a manual OBJID entry (via value-relation dropdownbox) every time a new record is added.


texts:
I am trying to correlate contaminant data with other variables. For instance I want to see if high values of contamination coincide with topographic lows in my elevation raster (DEM). All the layers are in raster form, and are covering the same area, and have the same cell size, is there anyway to do this? It would be amazing if the function produces an statistical value indicating if the 2 layers are correlated.

I am using ArcMap 10.3.1 and have access to its other applications (ArcScene, etc)


texts: Merge hole between shapes into any neighbouring shape to remove it?

texts:
I have a shapefile that I made by from 2 distinct shapefiles (I am using QGIS). The issue is that they don't overlap precisely so I have holes like the following:

I tried the vertex editing tool but I have many shapes and that wont work. What I need is the hole below to be merged into any surrounding shape, like one shape gets extended to fill the gap, I don't want 2 distinct shapes to become one, but one or more to get bigger to fill the space.

I tried delete holes tool but that did not do what I wanted either.


texts: Determining areas on a Voronoi Diagram around a point

texts:
I currently have two data sets concerning the Netherlands, one containing longitudes and latitudes of population cores (Hubs) along with other information, such as average house price, and the other containing the longitudes and latitudes of particular amenities (References).

I would like to create a Voronoi tessellation to map each area of the Netherlands to a particular population core. I then wish to create circles of varying radii for each amenity and create a dataframe of the areas that each Voronoi section is overlapped by each circle.

I have currently used a function from R: Voronoi tesselation from long/lat data? to generate a SpatialPolygonsDataFrame mapping the Voronoi tessellation. I then used Create a circle of defined radius around a point and then find the overlapping area on a shapefile to create a data.frame of polygons of radius 100m.

voronoipolygons = function(layer) {
    require(deldir)
    crds = layer@coords
    z = deldir(crds[,1], crds[,2])
    w = tile.list(z)
    polys = vector(mode='list', length=length(w))
    require(sp)
    for (i in seq(along=polys)) {
        pcrds = cbind(w[[i]]$x, w[[i]]$y)
        pcrds = rbind(pcrds, pcrds[1,])
        polys[[i]] = Polygons(list(Polygon(pcrds)), ID=as.character(i))
    }
    SP = SpatialPolygons(polys)
    voronoi = SpatialPolygonsDataFrame(SP, data=data.frame(dummy =
    seq(length(SP)), row.names=sapply(slot(SP, 'polygons'),
    function(x) slot(x, 'ID'))))
}

which is the function that performs the tessellation on the 'hubs' data. The remaining shape function is then created and compared:

library(sp)
Hubs = read.csv("Test_Hub_Data.csv", header=TRUE)
coordinates(Hubs) <- c("X.Coord", "Y.Coord")

#The function is applied to the Hubs data to create the dataframe
vp <- voronoipolygons(Hubs)

#The second data set is read in
References = read.csv("Test_Reference_Points.csv", header = TRUE)

#Coordinates are assigned to convert to a sf
coordinates(References) <- c("X.Coord", "Y.Coord")

#The X and Y names actually correspond to longitude and latitude of each point
dat_hold <- st_as_sf(References, coords = c("X.Coord", "Y.Coord"), crs = 4326) %>% st_transform(3035)

#Circles are created at each of the points in References at 100m
dat_circles <- st_buffer(dat_hold, dist = 100)

#The Voronoi data is changed to a shape function
VoronoiMap <- st_as_sf(vp)

#The intersections of both shape functions are determined
dat_Intersec <- st_intersection(VoronoiMap, dat_circles)

However, when running this function an error occurs stating that  st_crs(x) == st_crs(y). I assume that this is a formatting problem with the inputs, but I am unsure how to fix it.

I've stated the entire problem, as I'm sure that there is an easier way of completing this using R functions, with the calculation of overlapping areas being a common method comparing a Voronoi Tessellation that I'm sure alternatives exist.

A sample test data set that I've been using is included here:

#Hub
X Coord Y Coord Info 1  Info 2  Info 3
52.37639999 4.894589901 1   9   13
52.36989975 4.876679897 2   8   15
52.86299896 6.493730068 3   7   62
52.01011658 4.703330517 4   6   24
51.67409897 4.548630238 5   5   9
50.84980011 5.687580109 6   4   46
51.88669968 4.491449833 7   3   73
52.1048943  5.0528496   8   2   97
52.0746994  4.310130119 9   1   69

and the other data set corresponding to amenities:

#References
X Coord Y Coord
51.88529968 4.493549824
52.3360136  4.8750552
52.37440109 4.895800114
51.92269897 4.47382021
51.9192276  4.481627464
51.43019867 5.451980114
52.0780896  5.1470653
51.90299988 4.458670139
52.04100037 4.318089962
50.98810196 5.78059721


texts:
I have a vector layer which I need to load and edit (add several attribute columns). I am doing this without opening QGIS, so within a Python script. I have the following piece of code for the layer loading:

from osgeo import gdal
from osgeo import ogr

from gdalconst import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.core import *

layer = QgsVectorLayer("/home/usr/Desktop/EligibleAreas_polygons.shp", "EligibleAreas_polygons", "ogr")
if not layer.isValid():
    print "Eligible areas layer failed to load!"

When I execute the Python script I get the message that the shapefile could not be loaded. When I try executing the same script from the Python console in QGIS, I get no warning. What could be the problem?

When I execute the next step (creating an attribute column "Land_Area" of doubles) within the Python console:

# add new fields
layer.addAttribute(QgsField("LandArea", QVariant.Double))

I get False. Can someone give me a suggestion on how to solve this?


texts: Part of raster disappears when zoomed in using ArcGIS Online

texts: I exported my raster in a tile package to use within ArcGIS Online and it worked but when I zoom in the bottom part gets cut off and disappears. I think the issue has to do with the extent or something along those lines but I can't seem to figure out why this is happening or how to fix it. I really have no idea where to look or what I should even be looking for.


texts: ArcPy SearchCursors - Compare rows in attribute table - cursor.next() function

texts:
I'm new to ArcPy and have a question about ArcPy search cursors. I need to compare the current row of a point shapefile to the previous row for string field "Cat" and IF they are equal then I want to print the FID, ELSE print "NoMatch".

Code and data found below. The issue is cursor.next() seems to skip a row perhaps? The output is 1, 3, 5, 7, 9 when it should be 1, 2, 3, 5, 6, 8, 9, 10 (note 4 and 7 should not print because the "Cat" field value does match the previous). Also not sure why 7 was returned in the result.

DATA

FID Cat POINT_X POINT_Y
0 Sand 619557.6 4843930.0
1 Sand 619515.4 4843900.5
2 Sand 619513.8 4843899.7
3 Sand 619512.6 4843898.6
4 Gravel 619511.3 4843897.5
5 Gravel 619508.8 4843895.5
6 Gravel 619507.5 4843894.5
7 Sand 619495.5 4843883.5
8 Sand 619486.1 4843876.3
9 Sand 619484.1 4843875.3
10 Sand 619476.0 4843870.2

CODE

import arcpy
shp = "C:\TEST.shp"
cursor = arcpy.SearchCursor(shp)
for row in cursor:
    rowCur = row
    rowPost = cursor.next()

    if rowPost.getValue("Cat")==rowCur.getValue("Cat"):
        print (row.getValue("FID"))
    else:
        print "NoMatch"