texts: Creating Basemap for ArcGIS Online from Georeferenced .tiff

texts:
I have a GeoTIFF file that I would like to use as a basemap for an ArcGIS Online web map application. Is there a way to turn the TIFF into a basemap so that it can used for this purpose? Ideally, I would like to be able to use ArcGIS Pro for this, but that does not have to be the case.

The only documentation that I can find does not seem to include anything about this  (https://enterprise.arcgis.com/en/portal/latest/administer/windows/customize-basemaps.htm)


texts:
I am finishing a geologic map. I have all geologic polygons in a single layer.

I want that the legend shows the geologic polygons separated by age and that each group to have a header stating the age.

One thing that worked is select the polygons from the same layer and save the selected polygons as a new layer. Another thing that worked is creating separate legends for each age.

I wonder if there is a more simple way to do it in the print composer?

I am using Qgis 3.10 OSgeo4w on win10 64 bits


texts: Check mxd has been saved prior to running python code

texts:
Is it possible to check whether an mxd has any unsaved changes prior to running the main code of a python script? I'm aware I can use the document name:

mxd = arcpy.mapping.MapDocument("CURRENT")
mapPath = mxd.filePath
fileName = os.path.basename(mapPath)

If mapPath is blank, the document has not been saved. But how can I repeat this check for unsaved changes once the document has been saved in the past?


texts: ArcMap - Field Calculator / Calculate Value - extract month of median date between two dates

texts:
I have a String field 'INTERVAL' giving the two dates used for a difference image in the form "YYYYMMDD_YYYYMMDD".
I would like to populate a second field 'MONTH' giving the month of the median date of the two dates in 'INTERVAL' i.e. date1 + (date2 - date1 / 2) for example for 'INTERVAL' = 20180325_20180420 , the median month would be 4.

Ideally prefer to do it with Calculate Value in Modelbuilder.

I am not Python savvy so dealing with dates is particularly vexing.

ArcMap 10.4.1


texts: QGIS: Interpolate height value on polyline from point-values for use as breakline in TIN-creation

texts:
We use point heights from a survey to generate a TIN. In order to improve the quality of the TIN, additional break lines should be defined.
These break lines shall receive the height information from the point heights, where intermediate values of the vertices shall be interpolated.
How can these steps be achieved with QGIS:

Taking the height from the points at the start or end point of a line
Interpolation of the height for the vertices in between


texts: Using GeoServer GetFeatureInfo template?

texts:
My question consists of a few points, as I just read the GeoServer GetFeatureInfo template tutorials and it is very effective and useful for my project.

My questions are:

Where is the data directory of GeoServer where the templates resides?
How to call layers and apply styling?


texts: Performing Network Analysis for Emergency Response using ArcGIS Desktop?

texts:
I am working on a project using Network Analyst to determine official emergency response zones for fire departments. The shape of each zone will be determined by the network (at least 1 department must arrive at the destination within 4 minutes of drive time), and each zone will be attributed with station numbers in order of most accessible resources.

For example, one zone might be attributed with 3, 2, 5, which means Station 3 is the first to respond to that zone, and if they need more resources (or 3 isn't available), Station 2 is dispatched, and the same with Station 5. The end result will be a map showing each zone, labeled with each station number in order.

I have found good information on NFPA standards, which are standards that firefighters follow in the United States, such as:

first vehicle must arrive within a travel time of 4 minutes
all companies assigned on the first alarm must arrive within an 8 minute travel time

But I haven't found any standards on how to perform the analysis. This ESRI white paper describes how ArcGIS can be useful for fire response, but doesn't go into too much detail.

I have done service area analyses before using Network Analyst, so I am not asking for steps to perform this. What I need to know though, is are there any standard ways, or common practices, that emergency response network analyses are done? Or is this typically handled using whatever methodology the customer agrees to or suggests?

For example, in this case the customer said that assuming 35 mph in town and 50 mph out of town sounds good, so we'll go with that. Adding global turn delay values makes the analysis more realistic as well. But for these assumptions, I want to be sure that I'm not reinventing the wheel. If there are already standards or best practices for these assumptions (for emergency response), I want to follow them.


texts: I have been having trouble linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.0. I have tried reinstalling sf, rgdal, raster, and rgeos packages. I still couldn't link to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.0. I'm only able to Link to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3. Does anyone have any tips?


texts: Select points within a buffer around a line

texts:
Working with PostgreSQL. I have a Table with streets (Linestrings), and a Table with accidents (Points). The streets are divided into sections. I want to find the accidents within 50m around a certain street. I used  ST_Union to combine the Street segments to select a certain street, then made a Buffer around it, but when I try to select the accidents within the buffer QGIS crashes, guess there might be something wrong.

SELECT 1 as Id, c.accidents
ST_UNION (a.geom)
FROM Roads a, roads b, accidents c
WHERE a.roadname = 'A3'
AND st_distance (a.geom, b.geom) < 50
AND ST_Within (c.geom, ST_Buffer (a.geom, 50))
GROUP BY a.geom, c.accidents


texts: Choosing point from polygon (featurecollection) in Google Earth Engine

texts:
I want to get points from the polygon. If I just use function (randomPoints), each polygon does not have the same numbers (50) of points so I want to find the point from each polygon, but my code is not working.

var points = polygons.map(function(f){
   var poly=f.geometry();
    return ee.FeatureCollection.randomPoints(poly,50);

 });

Map.addLayer(points )
print(points )


texts:
I am trying to explore MOLUSCE ver 3.0.4 in QGIS Dufour. I am trying to simulate the land use change using this tool. I have following querries:

It asks for Initial and final year at the first step. Where to enter the exact year for which user is interested for prediction?
It gives output file of simulation. For which year this simulation is? Since we already have given Initial and Final year.


texts: Mobile Safari and ArcGIS JavaScript API Errors

texts:
So in creating an application that uses the LaywerSwipe widget the application displays fine on iOS but I am unable to move the scope or slider. I get the following errors from init.js :

It keeps spitting out these errors for a bit and I can't understand why.


texts: Calculate how many points a route goes through

texts:
Is there a way in which a route mapping interface can determine how many points a certain (user created) route has 'touched'?

In the sense that firstly:

I have a set of markers or points (e.g. geojson format)
I have a route from A to B.
How many of these pre-determined points does route A to B go through?

Even if a route does not exactly go through a point (i.e. is which a certain radius of the point), is here any software or programme that can perform this function? And, if any, is there a web-facing interface that can do this?


texts:
I have a SDE.ST_GEOMETRY line feature class. I've created a view on it that returns an st_point column.
SELECT OBJECTID, SDE.ST_STARTPOINT(SHAPE) AS START_POINT FROM ENG.ROAD

There is a known Oracle bug that is preventing me from using my view : Unable to define a query layer in ArcGIS where the data source uses an st_geometry subtype in Oracle.
The bug description states:

...the binding used in Oracle to fetch the geometry binds an
st_geometry type. Because the attribute or values returned from the
attribute do not map to st_geometry, the Oracle internal error is
encountered. By definition, a type binding should support its subtype
definitions. This limitation is currently a bug within Oracle's
server.

The workaround is:

Convert the geometry attribute field from the subtype (for example,
st_point) to the supertype st_geometry.

However, it doesn't say how to do the conversion; I don't know how to convert from the subclass to the superclass.
Question:
How can I get ArcMap to recognize an ST_POINT subclass column?


texts: How do I change the display size of a map from a shapefile with matplotlib?

texts:
I'm completely new to shapefiles. I was able to use GeoPandas to plot some data over a map of the US I got from census.gov. I'm having getting the map to be at a viewable size. I adjusted the figsize parameter multiple times, but it doesn't seem to increase the size enough. From what I've read so far, shapefiles shouldn't be modified. How can I make the subplot larger?
map_df = gdp.read_file(shape_file)
map_df.head()
map_df.plot()

covid_max_cap_df = hospital_data.groupby(['statename']).InBedsOccCOVID__Numbeds_Est.max()
covid_max_cap_df.drop('United States')

merged_map = map_df.set_index('NAME').join(covid_max_cap_df)
merged_map.rename(columns={'InBedsOccCOVID__Numbeds_Est':'covid_occ_rate'}, inplace=True)

var = 'covid_occ_rate'
vmin, vmax = covid_max_cap_df.min()-10, covid_max_cap_df.max()+10

fig, ax = plt.subplots(1,figsize=(30,30))
merged_map.plot(column=var, cmap='Reds', linewidth=0.8, ax=ax, edgecolor='0.8')
ax.axis('off')
ax.set_title('COVID-19 Peak Hospital Occupancy Rate', fontdict={'fontsize':25, 'fontweight':3})
ax.annotate('Source: CDC, June 2020',xy=(0.1, .08),  xycoords='figure fraction',
            horizontalalignment='left', verticalalignment='top',
            fontsize=12, color='#555555')

sm = plt.cm.ScalarMappable(cmap='Reds',
                              norm=plt.Normalize(vmin=vmin, vmax=vmax))
sm._A = []
cbar = fig.colorbar(sm)


texts:
I have old features that I am adding via copy and paste to a current production feature class that has attribute rules enabled. I am having trouble figuring out a way to update "at will" specific fields that are null for the old features being brought in.
The attribute rule for the current feature populates point data fields with data from a polygon boundary vi INTERSECT, but when I perform the copy and past the fields remain null and are not updated using via the attribute rule.
I know with attribute assistant you can "Run Change Rules for Selected Features" is there a simple way to do this with attribute rules?


texts: Creating composite band mosaic of sentinel 2 data with arcpy

texts:
I previously useda simple script that went through many Landsat satellite images, and for each folder it found it made a composite band raster. The script was as follows:

import arcpy
import os

arcpy.env.workspace = (folder containing lots of Landsat downloads, all of which in a separate folder)
outws = (output folder)
folders = arcpy.ListWorkspaces()

for folder in folders:
    arcpy.env.workspace = folder
rasters = arcpy.ListRasters("*.tif")
name = os.path.join(outws, rasters[1].split("_")[0] + ".tif")
arcpy.CompositeBands_management(rasters, join)

print "Processing complete"

This was very useful as it saves lots of time. I now want to adapt it to work with the new Sentinel 2 satellite images. There are some major differences though. For Landsat, there was a folder which contained 8 bands, all of which covered the same area. For Sentinel 2 the bands are split up into different subsets (the image I have here is 14 subsets) so somehow I would like to make the script navigate to where the subsets are stored, this is a folder called GRANULE. Within this folder there is a folder for each subset, the bands that I would like to combine are stored in a subfolder called IMG_DATA.

So, I would like the script to find the 14 folders called IMG_DATA, make a composite band for each folder, and finally mosaic them into one raster. Does someone know how I could adapt my script to use this?


texts: CARTO DB / Adding images using layer.on('featureClick',function(e,latlng,pos,data)

texts:
Each of my data points have a different image. The images are all loaded in CARTO and the column has a name. I need to call each of the images on click event.

I've been using the

layer.on('featureClick',function(e,latlng,pos,data)

to get the data from my points but i can't make it work to get the images.


texts: Finding number of mountains between two points using QGIS?

texts:
How can find the number of mountains that is crossed by a line between two points on a map?

I guess I might adapt the answer to Number of buildings between two points but I don't exactly know how.


texts: Cannot Edit ArcGIS Server Map service with feature access enabled

texts:
My problem is that I can't edit the features in my ArcGIS server map service but when I publish this service to ArcGIS online all editing functions work very well, So here is what i have done:

ArcGIS Server account has higher-level permissions
The connection to the database is in a folder where ArcGIS Server account has full access permissions
The database is registered with ArcGIS server
The map service is published with feature access enabled

Once I had this issue and I turned around using web-adaptor URL but now I can't so I need some help.


texts:
I did interpolation operation on temperature and precipitation data.

Output image size is 3300 (col) and 2550 (row). I have some NDVI images with size of 15456 (col) and 5074 (row). Generally, I want the interpolated images to be the same size with NDVI images.

After doing interpolation, I wanted to do resampling on temp/prec images in order to not loss any information on image (3300: 2550 to 15456:5074 size). But resampling method only works on raster image.

Is there any tool or procedure in ArcGIS Desktop to set a image size when I'm interpolating temperature and precipitation data?

Do you have any suggestion to achieve this?


texts: Drawing external text value on a point layer using TextSymbolizer of GeoTools?

texts:
I'm using GeoTools 14.3. I've used the following code segment to create a textsymbolizer on a point layer.

StyleBuilder sb = new StyleBuilder();
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

    TextSymbolizer textSymbolizer = sb.createTextSymbolizer();
    textSymbolizer.setFill(sb.createFill(Color.BLACK));
    textSymbolizer.setFont(sb.createFont("Arial", 10));
    textSymbolizer.setName("MyName");
    textSymbolizer.setLabel(sb.attributeExpression("name"));
    textSymbolizer.getOptions().put(TextSymbolizer.FOLLOW_LINE_KEY, "true");

    Rule rule = sb.createRule(textSymbolizer);

    FeatureTypeStyle fts = sb.createFeatureTypeStyle("Feature", rule);

    Style st = ShpFileStyles.GetDefaultRoadStyle();
    st.featureTypeStyles().add(fts);

    if (isMacroMapSelected) {
        ((FeatureLayer) roadLayer).setStyle(st);
    } else {
        ((FeatureLayer) microRoadLayer).setStyle(st);
    }

Here I'm drawing the name attribute available in the point shapefile.

Objective

Now I need to get another property, trafficCount, from a separate database. So the algorithm would be as follows.

get the id of the current node (done)
find the trfficCount from the database based on that id (done)
draw trafficCount on a text symbolizer on this point (?)

How would I draw this external value on the point layer.

Note:

I can't use, sb.literalExpression(), as I have different trafficCounts for different nodes.


texts: How to create transects from polygon centroid?

texts:
I have mapped potential study sites using polygons. What I want to do is create 9 125m transects spaced 75m apart. The center point of the middle transect needs to be the centroid of the polygon. Do you any idea how to do this? I have already created a new shapefile with just the centroid points of each location, but have been unable to figure out how to make transects from that point with it being the center of a line.

Thank you very much!


texts: Zooming on Leaflet map within iframe causes Samsung Galaxy to freeze map

texts:
Situation

We need our map to capture pointer events to interact with 6.000+ canvas shapes, plotted on a GridLayer. We need to check for click events, mouse moves, etc. on the canvases.
All works fine when the map is not loaded within an iframe.

To capture pointer events, we have set:

.leaflet-tile-container{ pointer-events:visiblePainted; pointer-events:auto }

However, when the map is displayed within an iframe (with pointer-events set to auto) Samsung Galaxy devices cause the map to freeze after zooming in / out after a while (fast zooming causes the map to freeze quickly)

On all other touch devices, except for Samsung devices, the map works just fine (also within an iframe). We have tested multiple Android and iOS devices (HTC One, OnePlus, iPhone 5, iPhone7 etc.)

Steps to reproduce

Steps to reproduce the behavior:

Step 1: Test on a Samsung Galaxy

Step 2: Open https://onlinebikelight.com/galaxy.html

Step 3: Start zooming in / out fast

... Map freezes

Expected behavior

Expected behavior: Map shouldn't freeze.

When the map is not loaded in an iframe but directly in the browser, like here:

https://onlinebikelight.com/map.html

, the map won't freeze on a Samsung Galaxy.

Current behavior

The map freezes when loaded within an iframe on a Samsung Galaxy, with pointer-events set to auto.

Environment

Leaflet 1.4.0
Browser: Chrome (all recent versions)
OS: Android (all recent versions)
Devices: Samsung Galaxy (tested on Galaxy S6, S8,    S9)

Minimal example reproducing the issue

IMPORTANT: Test on Samsung Galaxy!

Works perfectly fine when zooming in / out in browser:
https://onlinebikelight.com/map.html

However, map freezes when embedded in iframe:
https://onlinebikelight.com/galaxy.html

Update:

The map freeze within an iframe doesn't seem to occur on a Samsung Galaxy when opened in Firefox..


texts: Generate Height Above the Nearest Drainage (HAND) using QGIS

texts: I have a DEM I want to generate a HAND for and want to do so in QGIS. Does anyone know of any plugins or the processing steps to be able to do this?


texts: I have two shapefiles. One consists of squared grid cells and contains ... let's say precipitation data. The other one was downloaded from NaturalEarthData and contains country-internal administrative boundaries (e.g. states) ... as a mask layer. How can I add the average of the precipitation of all grid cells that are located within a mask polygon (e.g. a specific state)? Not only for one state but let's say I am actually covering the entire world.


texts: QGIS print composer preview atlas combo box limited to 499 features

texts:
Yes, really. I generate an atlas with a coverage layer with 883 features, and the combo box from which to select the current preview list only the first 499 features as shown in the screenshot below (tested this with a variety of other big coverage layers):

Nevertheless, the higher numbers are accessible as well. I can select the higher numbers by going to #499 and clicking Next Feature button or go to the Last Feature and clicking Previous Feature, but then I see only the feature number without the page name:

Furthermore when I want, let's say, no. 700 I have to click next or previous about 200 times. That's somehow inconvenient.

I observerved this in QGIS 2.14.15 LTR as well as the latest 2.18.14 LTR, so isn't there anybody before me having more than 499 coverage features?!

It's definitly not due to Qt, where combos with 1000's of items a no problem, the author must have set explicitly the_combo.setMaxCount(499) somewhere, but why (cp. http://doc.qt.io/qt-5/qcombobox.html#maxCount-prop)?

Question before raising an issue: Are there any technical or practical reasons for such limitation, or do I miss a setting somewhere?


texts: Upload resources to GeoNetwork filestore via CSW / API

texts:
I am exploring GeoNetwork to get if it is suitable for my purpose.

I need to use a script to upload several metadata with a file JSON associated. Is there any chance to use CSW / API to upload the files to the filestore available in the GUI (https://geonetwork-opensource.org/manuals/trunk/en/user-guide/associating-resources/using-filestore.html) ?


texts: Does the Census have an API to render coordinates from addresses?

texts:
Is there a United States census API that renders coordinates for a given address?
Is it possible to use the United States census API for commercial purposes?
Do you have a guide on embedding the census API into a website?


texts: Creating report of all feature classes in geodatabase using ArcPy?

texts:
I am not getting any response from this script and no error displayed at all

I am writing this script to help me display the feature classes in my geodatabase

Here is my script

import arcpy
arcpy.env.workspace = r"Q:\basemaps\ALTA\FileGeodatabase\AB_IHS_GIS_DATA.gdb"
logfile = open(r"C:\tmp\log.txt ","w")
fcLst = arcpy.ListFeatureClasses()
for fc in fcLst:
     logfile.write(fc + "\n")
     logfile.close()


texts: How can I count strings? I would like to know how many words (strings) I have in each cell. So I know that somewhere is too many words. Len() function calculates individual string character (including spaces).


texts: DLL load failed when loading PyQGIS in PyCharm with script (Windows)

texts:
I am trying to setup PyCharm to work with PyQGIS. I followed this tutorial: https://silverspringenergy.com/using-pycharm-as-an-ide-for-qgis-3-plugin-development-2/. Some files were located elsewhere but in my script I pointed them to the correct path. My script.cmd:
@echo off

call C:\OSGeo4W64\bin\o4w_env.bat
call C:\OSGeo4W64\apps\grass\grass78\etc\env.bat

@echo off
path %PATH%;C:\OSGeo4W64\apps\qgis\bin
path %PATH%;C:\OSGeo4W64\apps\grass\grass78\lib
path %PATH%;C:\OSGeo4W64\apps\Qt5\bin
path %PATH%;C:\OSGeo4W64\apps\Python37\Scripts

set PYTHONPATH=%PYTHONPATH%;C:\OSGeo4W64\apps\qgis\python
set PYTHONHOME=C:\OSGeo4W64\apps\Python37

start "PyCharm aware of Quantum GIS" /B "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2\bin\pycharm64.exe"

The result in PyCharm's python console, after running the script.cmd:
Error processing line 1 of C:\OSGeo4W64\apps\Python37\lib\site-packages\matplotlib-3.1.3-py3.7-nspkg.pth:
  Traceback (most recent call last):
    File "C:\OSGeo4W64\apps\Python37\lib\site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "C:\OSGeo4W64\apps\Python37\lib\importlib\__init__.py", line 51, in <module>
      _w_long = _bootstrap_external._w_long
  AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
Remainder of file ignored
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev\pydevconsole.py", line 5, in <module>
    from _pydev_comm.pydev_rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_rpc.py", line 1, in <module>
    import socket
  File "C:\OSGeo4W64\apps\Python37\lib\socket.py", line 49, in <module>
    import _socket
ImportError: DLL load failed while importing _socket: The specified module could not be found.
Process finished with exit code 1

Any other methods of loading PyQGIS commands without having to startup QGIS first? My current workflow is to load all my scripts via the QGIS Python console, using exec(...), but it is becoming impossible to track down mistakes in my Python code now.


texts: How does Quantum Gis work with Arcgis .xml files?

texts:
I'm not familiar to quantum gis, so can anyone explain if it is possible to import/export xml files in quantum gis? If it is possible, how can I do that?

I exported some . xml recordset and workspace files from ArcGis and I'm curios if I can open those files in quantum gis.

I use Arcgis 10.1 and Quantum GIS 1.8.0


texts: How to view a 155 MB raster stored in PostGIS?

texts:
I am using the following command to load a raster into a postgres database:

raster2pgsql -I -C -e -Y -F -s 3086 -I -C -M myraster.tif myraster -F -t 30x30 | psql -U postgres -d database -h localhost -p 5432

myraster.tif is 155M. When I try to use the raster plugin in QGIS, it takes a very long time to load (15-20 minutes). I'm not sure if there is anything that I can do to speed up this, or if there is an alternative approach to viewing rasters. All I want to be able to do is to quickly view the raster and check that it lines up properly with the vector data stored in the database. (The vector data displays very quickly in contrast.)
At the moment, QGIS freezes up and when it displays the raster. It just shows a black square and changing the colorscale is not feasible due to the fact that any interaction causes the program to freeze.

I'm not familiar with the subtleties associated with loading a raster, so perhaps there are different flags and arguments that I should be using. I realize that this is a large raster so I'm happy to resample it or similar just for display purposes (though I don't know exactly what I should do).

I'm using the latest version of the plugin wktraster in QGIS. I am connecting to a remote server to display the data. I'm using OSX with QGIS 1.8. I'm open to using any program to view the raster on any OS.


texts:
I am trying to get my plugin working and have some issues with the count of currently selected layers.

As am listening to legendInterface().currentLayerChanged(), triggering a function that is returning the selected layers. If the length of the list returned is not 1 then I am disabeling a range of widgets in my dock.

However, it does not work properly since the count of selected layers seems to be of. If there is no layer selected when the plugin is initialized then with the selection of the first layer the length of the list returned from len(utils.iface.legendInterface().selectedLayers()) is actually zero!
If another layer is selected afterwards the length of the list returned becomes one!? That leads to the problem that even when I select an additional layer (2 selected) then the returned length of the list is again one, and all the widgets that I want to disable stay enabled. Only if I select three layers the behaviour becomes correct.

Here the code I am using. Maybe it's the wrong signal to listen to, but I do not know better at the moment. How can I get the number of layers returned right so it actually reflects the number of selected layers in the TOC?

def __init__(self, parent=None):
    self.setupUi(self)
    utils.iface.legendInterface().currentLayerChanged.connect(self.changeLayer)

def changeLayer(self):
    utils.iface.messageBar().pushMessage("Info", "Numer: "+str(len(utils.iface.legendInterface().selectedLayers())), level=gui.QgsMessageBar.CRITICAL)
    if not len(utils.iface.legendInterface().selectedLayers()) == 1:
        self.lbl_active_layer_value.setText("None or more than one layer selected!")
        self.btn_set_subset.setDisabled(True)
        self.cbb_mark_visual.setDisabled(True)
        self.cbb_mark_set.setDisabled(True)
    else:
        cur_layer = utils.iface.legendInterface().currentLayer()
        self.lbl_active_layer_value.setText(cur_layer.name())
        layer_name = cur_layer.name()
        self.btn_set_subset.setEnabled(True)
        self.cbb_mark_visual.setEnabled(True)
        self.cbb_mark_set.setEnabled(True)

I am using QGIS 2.18.16...


texts: Setting NULL values to 0 for tables after geoprocessing in ArcMap?

texts:
I am trying to calculate LAS dataset statistics using the 'LAS dataset statistics' geoprocessing tool in ArcMap 10.3.1. I am working with LAS points and a shapefile of the plots and I need to extract the class wise statistics of the classified LAS

So far my methodology has been as follows:

I converted my LiDAR LAS file to LAS dataset separately for every class using the 'Create LAS Dataset' tool.
I have a shapefile of the plots according to which I want the plot wise statistics of the points to be generated. To do so, I used the 'LAS Dataset Statistics By Area' where I gave the class wise LAS data as 'Input LAS dataset' and the plot shapefile as the 'Input Polygon'.

However, as some of the plots do not have any points in them, the tool is failing to run and giving the 'ERROR: The field is not nullable [Z Min]'.

How do set the default settings of the resulting attribute table such that the table will have NULL values as 0?


texts: batch reclassify rasters with different elevation ranges

texts: I have about 500 elevation rasters, and I would like to use modelbuilder with an iterator to reclassify each raster into distinct elevation ranges (0-1m, 1-2m, 2-3m, 3-4m, 4-5m). I believe my problem is that each raster has a different range of elevation, is there a work around this? I tried mosaic-ing all the rasters together but reclassify tool does not work on this mosaic.


texts: How to increase label size of OpenLayers plugin basemap layers?

texts: For QGIS 2.2.0-Valmiera, how does one increase the label size of OpenStreetMap layer or any other basemap layer?  Presently the labels are way too small to read.  For example, I find that for the same zoom level of a map in www.openstreetmap.com vs the same map in QGIS2.2, the map in QGIS2.2 has labels much smaller than the one from www.openstreetmap.com.  For illustration, click here: https://drive.google.com/file/d/0B27Gf4KIu-6-NFVhSV9zUFBDZGM/edit?usp=sharing


texts: R memory issue with large polygon grid file

texts:
I have a  1 km by 1 km grid polygons for all of Ontario, Canada.
This file is roughly 1 GB with 1116965 rows and can downloaded here: https://www.ontario.ca/data/utm-universal-transverse-mercator-1-km-grid

When I read it into R using:

library(rgdal)
grid1 <- readOGR(dsn="C:\\Users\\Desktop\\Data", layer="1KM_GRID",encoding="utf-8")

It will print the console a few things and then my computer freezes, at a certain point it goes black and won't respond to any keyboard commands leaving me to force restart my computer.

I need this grid shapefile to later perform an spThin on it and I'd prefer to stay in R. My computer has 8GB of RAM and I'm running Windows 10 64-bit.

Is there a different package in R that deals with large spatial data such as ff for data.frames? Or are there settings I can change in R that will allow me to work with this data?


texts: Finding glider reachable area / catchment area with custom slope?

texts:
I'd like to produce maps for gliders in mountains.

I'm looking to display the reachable area by a glider taking off from a given point (obviously with the corresponding DEM).

For a first approach I'll suppose that we are in static air, no thermal ascent, no wind.

So like water gliders only go down.

Gliders have a specific slope (the glide ratio).

I started thinking that my problem is similar to a flood inundation analysis. But I cannot find how to input a specific slope in any of the hydrology modules I explored.

@Spacedman propose a first approach by creating a raster representing a shallow cone centered on the take off point and having the glide ratio as slope. It is a good approach without any obstacles.
Imagine you have an obstacle on the straight line for example there is a cylinder.
The area behind this cylinder may appear as "reachable" but the distance behind the cylinder from the take off point is (straight D)+(cylinder_radius). So obviously there is (cylinder_radius)/glide_ratio difference in height.

Is there another approach that I could use?

Implementation of approach without any obstacles:
G is glide ratio (ie: ∆D/∆z)
(x₀,y₀,z₀) is taking off point
(x,y,z) are coordinates of a point on the glider reachable area
(x,y,zₑ) are coordinates of the projected point on the earth DEM
Hₑ is height over the ground

Obviously if Hₑ≥0 it is reachable otherwise not.


texts: Using Geos C++ Library to return overlap and intersects

texts:
I'm running GEOS C++ Library v 3.6 on Fedora.  I have a list of geometries I loaded from a shapefile and converted to geos polygons.  The shapefile is large and I may be overlaying several ones to make a complete picture.  I want to extract all the polygons that overlap the "viewport" which is a polygon I pass in that is just a square (Polygon) so I dont have to do as much work during the intersection call and I already have the pulled apart.  The shapes coming in are MultiPolygons.

            geos::geom::MultiPolygon *mp = shapeData[files];
            bool found = false;
            size_t n_shps = mp->getNumGeometries();
            for (size_t i = 0; i < n_shps; i++)
            {
                // Prefilter geometries returned to only include ones inside your envelope
                const geos::geom::Geometry *thisShp = mp->getGeometryN(i);
                geos::geom::Geometry *shpEnv = thisShp->getEnvelope();
                if (envelope && shpEnv->overlaps(envelope))
                    found = true; // Never gets here even though I know some intersect
                rvGeoms.push_back(thisShp->clone());
            }

I've tried intersects, overlaps, touches, ... they all never return true.

What am I doing wrong?

Again, I'm sure that some of the polygons overlap my envelope Geometry.


texts: Renaming output to reflect name of input using ArcGIS ModelBuilder?

texts:
Every quarter I will be replacing the two CSV files at the beginning of the model. I would like the final Excel file and feature class to each have a name that reflects the input CSV file name (please see model below). For the example below, I would like to have them renamed as: 2015Q1, as a reflection of the names of the input CSV files.

Is this possible to do?

I am not using 'iteration', which most of the similar questions are referring to.


texts: How to get Leaflet layer control to work with GeoJSON files hosted online

texts:
I am having issues getting Leaflet's layer control to work if using GeoJSON files stored online, on Amazon Web Services. The points from the online file do show up with their popups as expected, but the actual layer control window at the top right of the map that allows you to select/deselect layers isn't there anymore. This is the JS part of the code that I am trying to run, with one of the links/GeoJSON files as an example:

function addDataToMap(data, map) {
    var dataLayer = L.geoJson(data, {
    pointToLayer: function (feature, latlng) {
    return L.circleMarker(latlng, point_style);
    },
    onEachFeature: function(feature, layer) {
        var popupText = 'Name  --  ' + feature.properties.NAME + '<br>' + 'Address  --  ' + feature.properties.ADDRESS;
                 layer.bindPopup(popupText); }
        });
        dataLayer.addData(data);
        dataLayer.addTo(map);
        }
     $.getJSON("https://s3.amazonaws.com/aws-website-homebuyerrecommendationsystemfordenver-ag706/lightrail_geojson.json", function(data) { addDataToMap(data, map); });

var baseLayers = {
    "Light Rail Stations": dataLayer,
    "Parks": parks_popup
};
L.control.layers(null, baseLayers, {collapsed:false}).addTo(map);

If I pull the GeoJSON files as variables within the code then my layer control works fine. But I have several layers that I need to add and they are quite large, so hosting them online and pulling them with a simple $.getJSON command would be useful. Otherwise my html file becomes very long and freezes often while scrolling around.

Any ideas as to what I'm doing wrong? Or is the only way to get the layer control functionality from Leaflet to store the GeoJSONs as local variables?


texts: Feature service requires registered database error?

texts:
I am working  on ArcGIS Server 10.2 and SQL Server 2008. when I want to publish the service, I get this error "Feature service requires a registered database" that's error happen when I read (List By Source) from Version, but when I read from Default (SDE) I don't get this error and every thing is ok.

this is a screen shot of error:


texts: Multiple geometry types layer in Geoserver?

texts:
I am using OpenLayers and Geoserver in a web map application in which I'd like to implement editable layers by drawing features on it.

I followed this tutorial to save the created features with WFS-T and OpenLayers.Strategy.Save(), but since Shapefiles only deal with one geometry type at a time, I can't draw, for example, a polygon AND a line on the same layer.

Note: I can't use different layers for different geometry types, it has to be on a single layer due to a tool I am using: OLE ("OpenLayers Editor").

So my question is : is there any way to store multiple geometry types in a single layer with Geoserver/PostGIS ?


texts: Using of Document Properties>Hyperlink Base to prevent broken links when moving MXDs?

texts:
I am going to try this later this week (when I am back in office) but I thought I ask this here first.

Can anyone advise if Using Hyperklink Base can indeed help prevent broken links (not hyperlinks) when moving of mxds to another location? I believed mxds are set to be on relative link type, and not full path.

I seen someone claiming so but i thought Hyperlink Base is strictly for relative hyperlinks, especially when someone moves the MXD two levels above and hyperlinks will still work. Am I right to say that?

So in this example, I key in Project Folder into "Hyperlink Base" box and I have a ABC.mxd sitting in DATED_1>_MXD with files sitting in various folders under DATED_1.

I will copy ABC.mxd and paste it into DATED_2>_MXD. When I open DATED_2>_MXD>ABC.mxd, there will be broken link (but I will need to repair the links). Once done, I can copy and paste mxd to DATED_1 or _2 or _3 or_4 , and I will not have broken links, with data pointed to various folders under DATED_1. If I attempt to put this mxd anywhere else in any SHP / GEOREF / FGDB folder, all the links in mxd will be broken.

My knowledge of relative links is that they are paths of files with location of mxd as base. Hence, any folders / structure "above" mxd does not matter.

and my guess for the "Hyperlink Base" method is that the base is set when I key "Project Folder" into the box(?). And that mxds placed into any folders two levels below will not have broken links. So I can place my mxd in DATED_3>_MXD>ABC.mxd and it will be fine, since it is too two levels below.

I might have got above example wrong but anyone who can advise me on this, pls enlighten me.

Many thanks in advance.

FYI, I am using 9.3.1 on Win7 x64.

Also, can anyone advise how should I accept answers to questions that i posed out previously? I just couldn't find the buttons to do that.


texts:
I need to find out the lengt of each line within a surface. I have approx. 20'000 diferent lines and around 10'000 different surfaces. what kind of SQL-sentences do I need to use? I've tried things like:

select name.line, ST_length(line.thegeom, surface.thegeom)
from x.line, y.surface
where st_intersects (line.thegeom, surface.thegeom)

but my progragm (QGIS) just dies all the time or says something like "geos intersects () threw an error"
I'd love to have a sql query that gives me following
GID(=number of the line), GIS_NR(=number of the surface), total length of the line within the surface.

I'm quite new to GIS and postgresql.


texts: I'm working on a storm network system and have an issue with a drain line. When I try to snap it to a point, it moves slightly to the right every time. I've checked that there isn't topography for this feature, and have tried a few different snapping options. Any ideas? ArcMap v10.3. Issue went away when I removed DWG>SHP converted files. No clue why


texts:
I have lat/lng, angle with North and a length of a polygone.
I want to draw the polygone on a map. Like in this figure:

And I want to adjust opacity of it in realtime.

Which GIS or Map viewer I gonna use for this purpose.
Sadly, I will use it without Internet.

Any opensource-related advice or sample application will be best for me. Java is really okay for integrating my existing app.

Will openstreetmap or google maps provide me these?


texts: Setting default 'mouse position' to center of map in OpenLayers 3?

texts:
I am using OpenLayers 3 to build a 'spy glass' map, with an old map selectively visible over an OSM layer. The spy glass element follows the mouse around the map to reveal the old map.

I'm now trying to get the spy glass to sit at the center of the map when the page first loads, and then follow the mouse when it enters the map area. Besides looking a lot nicer and making the purpose of the map more obvious, it's a great solution for mobile usage, as in the absence of mouse input the spy glass then stays in the center and the map can be rotated around it.

I've been able to shift the default placement of the spy glass onto the map though setting pixel values

var mousePosition = [300,300];

but haven't succeeded in finding a way to calculate the center and pass it to the function. I've tried some functions, including the current combination of

var center = map.getView().getCenter();
var pixel = map.getPixelFromCoordinate(center);
var mousePosition = pixel;

but with no effect.

The following JSFiddle has the full code: http://jsfiddle.net/o3px0u8y/1/

How can I set the spy glass to first load in the center of the map?


texts: Modify columns data type when importing from CSV to GeoPackage with PyQGIS

texts:
I'm trying to import several CSV files into a GeoPackage using PyQGIS when opening a project as described in this question using this code:

from qgis.core import *
from qgis.utils import iface
import glob
import os

def openProject():
    ruta = QgsProject.instance().absolutePath()
    tmp = ruta + '/tmp/'
    try:
        for csv in glob.glob(tmp + '*.csv'):
            rutacsv = 'file:///' + csv + '?delimiter=;'
            tabla = QgsVectorLayer(rutacsv, os.path.basename(csv), 'delimitedtext')

            opt= QgsVectorFileWriter.SaveVectorOptions()
            opt.EditionCapability = QgsVectorFileWriter.CanAddNewLayer
            opt.layerName = os.path.basename(csv).split('.csv', 1)[0]
            opt.actionOnExistingFile = QgsVectorFileWriter.CreateOrOverwriteLayer
            QgsVectorFileWriter.writeAsVectorFormat(tabla, ruta + '/cdau.gpkg', opt)

Every CSV table has this structure:

id;date;code
1;2020-06-01 12:33:00;"00125"
2;2020-06-01 12:37:00;"00321"
...

But the column data types in the new tables in the GeoPackage are:

id: Integer
date: String
code: Integer

I created this csvt file for every csv table but the result is the same:

"Integer(4)","DateTime(YYYY-MM-DD HH:MM:SS)","String(5)"

I have searched for information about this, but found nothing about defining column data type when importing a table. Is there any way to define data types of columns when importing from CSV to GeoPackage using PyQGIS?


texts:
Does anyone know if there is an open source project in Java that will take a set of (x, y, z) points and create a contour map for Google Maps/Earth?
There does not seem to be a good contouring application for Google Maps.


texts: wkbMultiPoint to wkbPoint conversion using python

texts: Is there a way to convert an ogr.wkbMultiPoint geometry (only one record for several points in the attribute table) to an ogr.wkbPoint one (a record per point) using python or pyQgis?


texts: How to get maximum value where two shapefiles overlap using ArcGIS for Desktop 10.1?

texts: I'm trying to merge 2 datasets (both shapefiles, but I can convert them to raster layers if necessary) where the values are compared, and whichever is higher becomes the new value for the layer. How would I got about this? They aren't quite adjacent to one another, because there's a fairly large overlap in the middle. I'm using ArcMap 10.1


texts: Bookmarks input from QGIS Python console don't appear in Spatial Bookmark Manager

texts:
I'm testing this implementation from thread and blog for importing bookmarks via the console:
This test code:
import sqlite3
dbPath = QgsApplication.qgisUserDatabaseFilePath() # the name of this method changed from the links
db = sqlite3.connect(dbPath)
cursor = db.cursor()

cursor.execute("""INSERT INTO tbl_bookmarks(bookmark_id, name, project_name,xmin, ymin, xmax, ymax,projection_srid)VALUES(NULL, 'Name1', 'Group1', 1809782.0338653976, 5461831.848696201, 1827540.9027164688, 5464488.270675712, 2193)""")
cursor.execute("""INSERT INTO tbl_bookmarks(bookmark_id, name, project_name,xmin, ymin, xmax, ymax,projection_srid)VALUES(NULL, 'Name2', 'Group1', 1804512.8556000944, 5453390.580880025, 1813512.8556000944, 5461390.580880025, 2193)""")

db.commit()

Runs to completion, though I can't actually see any new bookmarks in the Spatial Bookmarks pane.
Any suggestions?


texts: Systematic inaccuracy in QGIS shape area

texts:
I'm trying to find out why I get different area figure in QGIS than in AutoCAD when I'm using the same shapefile?

What I did is I drew a shape in AutoCAD, imported it in QGIS and used the field calculator there to add area in the attribute table.

The result is that the shape's area figure in QGIS is always a little bit less than it is in AutoCAD in the properties window.

It’s the same no matter what the coordinate system is (same or different).

Could someone help me and tell me why the area figure is different in QGIS and how can I fix it?


texts: I am looking for the same packages as outlined in this question - Are there Python packages for Landsat 8 processing? except that I want these in Java. Any Open Source packages out there that can do the same processing in Java ?


texts: How to import AutoCAD .dwg files as overlay on map in Drupal (using OpenLayers)

texts:
I am using OpenLayers on my Drupal site. The request is to import AutoCAD .dwg files as an overlay to maps on the site. Is this possible and how? I found the OpenLayers Editor for Drupal, am I on the right path?

If this is possible by converting the .dwg file to another format, it would be an acceptable solution, too.


texts: Weird looking color when creating tiles from large GeoTIFF

texts:
I encounter some weird problem when creating tiles from GeoTIFF.

Context:
I am generating small tiles from a large GeoTIFF image. The B and R band were swapped so I had to do a gdal_translate to swap the band into the correct order for generating PNG tiles from this GeoTIFF. Since I need the georeferencing, I first created a set of smaller GeoTIFF tiles from the large GeoTIFF tiles before converting these smaller GeoTIFF tiles into PNG with worldfiles.

When I try to look at the PNG files, it gave me some weird looking picture. Looking at it, seems like the band is missing or overly saturated to white.

Geo TIFF generated from gdal, loading in QGIS and also view in preview on Mac.
All seems fine.

I converted this to a PNG files via gdal_translate and it gave me this picture.

What can I try?


texts: When I import the sDNA toolbox into ArcGIS 10.2, some tools can be used, but other tools can't be used, the question are showed as follow:


texts: QGIS RGB2PCT is leaving holes in continuous regions

texts:
I have a raster which was generated from an ArcGisMapServer layer, and is thus an RGB layer. I want to convert the RGB layers into a single 8bit layer in order to recover the original classes.

When I do this though, the one class always ends up with a speckled effect, even though the original data does not have this feature. Below is the raster after RGB2PCT as well as the original data.

This effect only occurs in the one class layer, not the others. Is there any easy way to rectify this?


texts: Getting KMZ file with image to show in Google My Maps

texts:
Maybe this isn't possible but does anyone know a way I could get a KMZ file that includes a raster image to save into Google My Maps.  I can get the KMZ to display fine with image by uploading it to Google Docs and searching for it in Google Maps but when I go to save it in My Maps, the KMZ layer disappears and thus doesn't save it.  I would use the KML import in My Maps but it doesn't seem to support uploading the imagery, only the vector data.

Any ideas?


texts: Auto populate qgis file name with no file extension?

texts: I'm looking to be able to auto populate an attribute field with the project file name either by a virtual field or default option in the properties. The "@project_filename" expression always produces a result with the file extension. eg "newproject.qgs" I don't want the ".qgs" displayed.


texts: view zenith angle and view azimuth angle with Quickbird

texts:
I am trying to do an atmospheric correction on a Quickbird scene. I am creating a user-defined geometry which requires six parameters. The six parameters are solar zenith angle,
solar azimuth angle, view zenith angle, view azimuth angle, month, and day. The Quickbird metadata file gives a "mean elevation angle of the sun from horizontal" so I think I am correct in assuming that

mean solar zenith angle = 90 - meanSunEl

and that

mean solar azimuth angle = meanSunAz

I am unclear about how to determine the view zenith angle and view azimuth angle. The Quickbird documentation gives meanSatEl as the "mean elevation angle of the satellite with respect to the center line, in degrees." I am unsure what is meant by "respect to the center line." Zenith? Would it simply be

mean view zenith angle = 90 - meanSatEl ?

I also am unsure whether view azimuth angle is equivalent to meanSatAz, which is defined as "mean azimuth angle of the satellite with respect to the center line, in degrees." The metadata also has values for InTrackViewAngle, CrossTrackViewAngle, and offNadirViewAngle.


texts: error 999999 add rule to topology management

texts:
I was trying to create a topology with some rule, but I have problems with the rule "Must Be Covered By Feature Class Of".

I get the error  "999999: Error executing function."

This is the code:

WU = r"C:\Users\Sergio\Documents\argongra\PRUEBAS\wu16.shp"

AOI = r"C:\Users\Sergio\Documents\argongra\PRUEBAS\wu16_AOI.shp"
carpeta = r"C:/Users/Sergio/Desktop/prueba"

arcpy.CreateFileGDB_management (carpeta, "topologias", "")

arcpy.CreateFeatureDataset_management (carpeta+"/topologias.gdb", "topologias", 3035)
FD = carpeta+"/topologias.gdb/topologias"

arcpy.FeatureClassToGeodatabase_conversion (WU,  FD)
arcpy.FeatureClassToGeodatabase_conversion (AOI,  FD)

WU_FD = FD+"/wu16"
AOI_FD = FD +"/wu16_AOI"

topologia_path = carpeta +"/topologias.gdb/topologias"
arcpy.CreateTopology_management (topologia_path, "errores", 0.01)

arcpy.AddFeatureClassToTopology_management(topologia_path+"\errores", WU_FD, "", "")
arcpy.AddFeatureClassToTopology_management(topologia_path+"\errores", AOI_FD, "", "")

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Not Have Gaps (Area)",  WU_FD, "", "", ""  )

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Not Overlap (Area)",  WU_FD , "", "", "")

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Be Covered By Feature Class Of (Area-Area)",  WU_FD,  AOI_FD , "", "")

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Be Covered By Feature Class Of (Area-Area)",  AOI_FD , WU_FD, "", "")


texts:
Which queries can I use to select the following information:
How many towns are within a distance of 3km of both a road and a railway and are within 6km of the coast?
And any towns that have both a railway and a road within 2km of them, i have shape file of road , railway and towns.


texts: Smooth hillshade in all scales in ArcGIS Server 10.2.1

texts:
I publish relief map on server and view his on arcgis.com map.

But in export i can change dpi from 96 to 300 and result smooth

Any ideas how i can do so that the hillshade was smooth in all scales? Maybe not change dpi...


texts:
I'm using ArcGIS 10.2.1 and have written an Python addin with multiple comboboxes and an "Unselect" button. The comboboxes run queries on the data and the button clears the selections.

I need the "Unselect" button to clear the comboboxes of their entries. I've tried both of these options:

1) Self.Editable=False, then the selection in the comboboxes disappear when the user selects something. That's what I posted this question in regards to.

2) Self.Editable=True, then the selection remains visible, but I can't get it to clear when the "Unselect" button is clicked, even when the selection is cleared. (Code below)

So, edit=true, can't get the unselect to clear the combobox, edit = false, the selection in the combobox automatically disappears.

Any other thoughts?

class ButtonUnselect(object):
"""Implementation for Walla_Walla_QueryTool_addin.button (Button)"""
def __init__(self):
    self.enabled = True
    self.checked = False
def onClick(self):
    self.mxd = arcpy.mapping.MapDocument('current')
    lyr = arcpy.mapping.ListLayers(self.mxd, "PODs")[0]
    lyr2 = arcpy.mapping.ListLayers(self.mxd, "POUs")[0]
    lyr3 = arcpy.mapping.ListLayers(self.mxd, "Management_Points")[0]
    arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")
    arcpy.SelectLayerByAttribute_management(lyr2, "CLEAR_SELECTION")
    arcpy.SelectLayerByAttribute_management(lyr3, "CLEAR_SELECTION")
    df = arcpy.mapping.ListDataFrames(self.mxd)[0]
    df.extent = ext
    ext = lyr2.getExtent()
    combobox_2.__init__

class ComboBoxPurpose(object):
"""Implementation for Walla_Walla_QueryTool_addin.combobox_5 (ComboBox)"""
def __init__(self):
    self.editable = True
    self.enabled = True
    self.dropdownWidth = 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWW'
    self.width = 'WWWWWWWWWWWWWWWWWW'
def onSelChange(self, selection):
    self.mxd = arcpy.mapping.MapDocument('current')
    layer1 = arcpy.mapping.ListLayers(self.mxd, "PODs")[0]
    layer2 = arcpy.mapping.ListLayers(self.mxd, "POUs")[0]
    arcpy.SelectLayerByAttribute_management(layer1, "NEW_SELECTION", "Purpose = '" + selection + "'")
    arcpy.SelectLayerByAttribute_management(layer2, "NEW_SELECTION", "Purpose = '" + selection + "'")
    arcpy.RefreshActiveView()
    df = arcpy.mapping.ListDataFrames(self.mxd)[0]
    layer1.getSelectedExtent()
    layer2.getSelectedExtent()
    df.zoomToSelectedFeatures()
def onEditChange(self, text):
    pass
def onFocus(self, focused):
    self.mxd = arcpy.mapping.MapDocument('current')
    layer3 = arcpy.mapping.ListLayers(self.mxd, "PODs")[0]
    self.items = []
    values = [row[0] for row in arcpy.da.SearchCursor(layer3, ["Purpose"])]
    for uniqueVal in sorted(set(values)):
                self.items.append(uniqueVal)
def onEnter(self):
    pass
def refresh(self):
    pass


texts: Mean values of points within a polygon layer

texts:
I have 2 shape files (1x points and 1x polygons). The points have different values (soil sampling results). What I want to do is to calculate the mean values of the points inside the different polygons (field border lines). In the end I can calculate percentaged values instead of the original values. These percentaged points I can interpolate.
Usually I did this with the following steps:

converting point shape to grid
Zonal Statistics to get the mean values
Calculating the percentaged values with the mean
Converting raster to points
Interpolation (e.g. kriging)

This takes a very long time because the model I built is very slow. Is there another helpful tool that I could use (Zonal Statistics with vector points and vector polygone)?

Bye!

I gave Open Jump a chance and it works. What do you think, will there be a tool like that (it works like Zonal statistics just with a point and a polygon vector layer) one day in QGis?


texts:
I can use the code:

for lyr in arcpy.mapping.ListLayers(dataframe):
    arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")

to deselect features in each layer in my map.  However, the above does not deselect tables in my map, or even attempt to.  I have three layers and two tables, the layers deselect fine, but the tables are ignored.  Also, the following code:

for tbl in arcpy.mapping.ListTableViews(df):
    arcpy.TableSelect_analysis(tbl, "CLEAR_SELECTION")

crashes every time with the error:

Error 000210: Cannot create output CLEAR_SELECTION

and in addition the online reference table for table select: http://pro.arcgis.com/en/pro-app/tool-reference/analysis/table-select.htm does not include directions on deselecting from a table.  What is the proper syntax to use for the TableSelect_analysis to deselect everything?


texts: Rasterio 0-360 lon inputfile to -180:180lon WarpedVRT output

texts:
I have used rasterio to open netcdf files and by defining a WarpedVRT extract a subarea that can be read with the vrt.read() command.

It works like a charm except when the longitude grid is 0:360 instead of -180:180.

How do you deal with this in rasterio? As soon as I try to extract data from -180 to 0 I get empty values.

I have tried to set the environment like this :

with rasterio.Env(CENTER_LONG=0):
    with rasterio.open(netcdfFilePath, mode='r') as src:
        with WarpedVRT(src, **vrt_options) as vrt:
               vrt.read()

trying to use the --config CENTER_LONG 0 gdal option.

or is it something you can account for in the vrt options?

 dst_transform = affine.Affine(xres, 0.0, left,
                                      0.0, -yres, top)

vrt_options = {
            'resampling': Resampling.bilinear,
            'crs': CRS.from_epsg(4326),
            'transform': dst_transform,
            'height': dst_height,
            'width': dst_width,
            'source_extra' : 1
        }


texts: Automating removal of credits (citations) assigned to layer using ArcPy?

texts:
I have been given a map document with ~130 feature classes which have been symbolized, etc.  In the layer properties, on the General Tab, credits have been written in.  When published to ArcGIS Online as a hosted feature service, these credits stream into the display area of the map.

Is there a way to automate the removal of the credits via python?

I thought perhaps arcpy.Describe but there doesn't seem to be a method or property for credits.


texts: Change default of QGIS field calculator: turn off "Only update selected features" (always update all features)

texts:
Is there a setting to change the default so that the checkbox Only update %1 selected features in QGIS field calclulator is not checked? As a default behavior, I would like the expression to be applied to all features, even when some features are selected.
If you open the field calculator, a QGIS expression builder dialog opens. There is a checkbox Only update %1 selected features that is activated by default: so every time one or more features are selected, only these get updated.
To me, this is very annoying as it happens quite often that I apply an expression and I have features selected that I am not aware of and I have to repeat the whole operation. In fact, my default use of field calculator is to update all features and only in specific cases I want to activate the checkbox Only update selected features.


texts: Data Driven Pages reading angles in attribute tables question

texts:
Is there a way to emulate the Data Driven Pages process (ArcGIS 10) of reading angles (rotation) in a polygon shape file? Screen shot of the DDP window with rotation field and corresponding attribute circled in green
In other words, make a polygon rectangle shp recognize an "Angle" field from its attribute table and automatically rotate the polygon rectangle based on that "Angle" field ?


texts: How to make piechart with YSLD in Geoserver style

texts:
It is possible to make piechart style in Geoserver WMS using XML SLD. For this adding chart extension is required.

Now, is it possible to make such piechart with YSLD ?

Additional info:

My colleague tried it with YSLD with the following result:

The size: ${diameter} seems to be understood correctly by GeoServer as the size of grey squares vary.

Now to the problem: the piechart is rendered only as grey square as if the piechart plugin is not installed. Meanwhile I confirm that the piechart plugin is in place and other SLD style (not YSLD) specifying piecharts are rendered as expected.

How to fix this?

My playground:

GeoServer 2.14.3 (with chart extension)
Apache Tomcat 8.5.32 Server
Windows 10 Pro 64-bit on Xeon E5-1660 3GHz, 32GB memory
PostgreSQL 9.6.11, PostGIS 2.5


texts: Storing GeoServer WPS result as a new layer

texts: Is it possible to store the result of a WPS process as a new layer without writing my own plugin in Java? I know there's a /tmp folder inside /data, but how can I grab it and publish as a new layer using the GeoServer webgui?


texts: Extraction by mask using a polygon changes the cell counts on each category?

texts:
I am attempting to use Extraction by Mask on a raster set (land use) to gather the cell counts of each category. The data is from a county level and the polygon I am using is a specific city within that county. When I use the tool, the resulting raster set shows cell count values that are way higher than the original set (making it seem like the area is somehow larger). This does not make sense to me as it does not change the size of each cell (2.5, 2.5) or the linear unit (feet) of the resulting raster.

Is there something that I am missing?

I have tried various methods to bypass this issue and extract the cell counts of the raster within the polygon, but each results in the same outcome. I have exhausted all of my knowledge and am probably just missing something. I can provide screenshots later if this does not make sense.


texts: How to create backlink raster for Cost Distance tool?

texts:
I have two polygon shapefiles and one cost surface. I need to estimate accessibility to these two sets of destinations. The part that I don't understand is whether I have to use an output backlink raster in Cost Distance tool or not and what exactly it should be...

It says it's optional to use it, but somehow I have the feeling I should use it.

How do I create an output backlink raster?

I have read the description in ArcMap 10.0 help section, it just that I don't really understand it.


texts:
I have code that creates rasters from polygons based on statistics of NDVI.
My problem is that for some reason, when the polygons are wide spreaded, the raster creation occurs only for some plots, but when I manually checl the plots that the raster wasn't created for them, it does create raster, meaning, there is avilable image but no raster is created and they are filteres out for some reason.

Example:
https://code.earthengine.google.com/2a06f5e4409c2d5a5f36b0cb68053a41

In this example I have checked and found that all the plots suppose to have available image from 04/05/2020.

plots -> the original polygon layer that is widely spread. When I run this, I get the raster only for few polygons.
manually gee -> one manually drawn polygon, based on polygon that didn't get raster result from the original layer, when run this this polygon do get the calculation.

manually gee2 -> another demonstration.
manually gee 3 -> very far away polygon, I am not sure why this one didn't get the raster result.

My end goal: that the raster calculation will happen for all the polygons based on the date, and not only based on one tile.


texts: How to split polygons at intersections in ArcGIS 9.3?

texts:
I have two polygon layers. I'd like to split the features in one based on where they intersect the other layer. I've tried using the Clip tool, but there is no option to simply split the features -- you're either left with all of the overlapping parts or non-overlapping parts. I've found several Cut Features tools in some obscure extensions in 10.1, but unfortunately I don't have access to those. Can anyone advise on how to do this in out-of-the-box 9.3.1?

UPDATE

I'm using an ArcInfo license. Here is a visual of what I'm trying to achieve:


texts:
Where can one find out what the most pervasive GIS formats are?

For example, from the GIS file formats Wikipedia page, there 4 broad categories, each with many popular formats.

Raster formats (13 formats listed)
Vector formats (19)
Grid formats (4)
Other formats (5)

This is a dizzying array of alternatives, each with their own reasons for existence.

In terms of general formats though, what are the most pervasive ones in use?

Edit: By pervasive, I'm looking for say the top 3 formats that would be encountered if a company that used GIS data was randomly selected out of all companies using GIS data


texts: Applying offset to lines that are on top of each other, result like metro map

texts:
As you can see from my picture there are a lot of places where the same lines run on top of each other. Imagine a tram map. How can I make sure that the ones that are behind are visible too?

Just like you see from metro or train maps:


texts: Creating a report from features that have been selected

texts:
I'm in need of some guidance,
I have created an application where the users does the following workflow

Enter Postcode
Zoom to Postcode
Create a buffer at specified distance
Spatial Query to find points within the buffer
MsgBox appears with the Organisation Name that are within the buffer.
Create report with the Organisation details.

Number 6 is what I need help on, I want to create a pdf report with details from the attribute table, and a map of the buffer and points,  any ideas on what are my options/examples of using Arcobjects in creating reports that look good?


texts:
I tried to install following plug-ins into QGIS2.8.(My PC is Win8, 64bit.)

*Table Manager
*Group Stat

But error message says "The Plug-is is broken. Python said:
GroupStats instance has no attribute 'localePath'. (In case of "table manager" plug-in, same message appeared)

Do I need to install anything?
I would like to know how to solve this problem.


texts: Is it possible to export/copy a network dataset?

texts: I have a network dataset stored in a feature class on one computer. I want to transfer this to another computer but I've tried exporting the geodatabase and copying the geodatabase within the catalog it is contained within and each time I lose the network dataset. The resulting geodatabase just has features stored and no longer within a feature dataset. Is there a way to copy a network dataset over or do I have to copy the files to create it and recreate it in the new location?


texts: Working with QGIS 3 with styles stored in spatialite database

texts:
I am working in QGIS 3.4 with a geopackage file (SQLite database) containing orography information (points, lines and polygons).
In QGIS, I have defined by hand a style for every layer in geopackage (gpkg). It's a time consuming task so I have saved layer styles in qml file, and also in the gpkg file. When I open my gpkg file in another QGIS session it works well showing every layer with their style.

Questions:

I have problems when export the styled gpkg to another gpkg.

The ouput file doesn't contain the layer_styles table so the styles
definitions are lost. It doesn't matter if I export completely the
gpkg stylized or only selected features. Of course I can apply .qml
file but I would like to have the symbology stored in the
geopackage.

Maybe I have to check any specific option to export the gpkg file?
By other hand, I defined different styles (3 or more) to the same
layer and I saved these styles to the geopackage (they are well
stored in layers_styles table).

When I open my gpkg file in another QGIS session, only the default
style is applied to the layer. Loading other styles from sqlite
database doesn't apply to the layer and QGIS doesn't show any error
message.

How can I use other styles saved in gpkg?


texts:
I want to port a tool developed in ArcObjects for ArcMaps into ArcGIS Pro using the ArcGIS Pro SDK.

The tool's UI was created using WinForms but to recreate the UI in ArcGIS Pro is looks like I would need to use WPF.

I have seen generalized .NET posts online saying that is possible to embed WinForms inside WPF. What I want to know is if it is possible to do so in ArcGIS Pro.

I have not found yet any references or samples of anyone having done it before.


texts: Trying to get WMTS layer in Leaflet, but get error 400 (out of range)

texts:
I'm trying to use https://github.com/mylen/leaflet.TileLayer.WMTS to get a wmts layer into my leaflet map, but the error 400 is generated and when I look at the tile it says out of range.

While testing my wmts with Tile Layers preview on geoserver it works.

I get this error:

And the xml says:

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd">
<Exception exceptionCode="TileOutOfRange" locator="TILECOLUMN">
<ExceptionText>
Column 153578 is out of range, min: 34192791178 max:34202250898
</ExceptionText>
</Exception>
</ExceptionReport>

So out of range. I have been trying different zoom levels and centres.

Here is my code:

        <title>Demo leaflet.TileLayer.WMTS</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />


texts: Creating points along line according to attribute date in QGIS

texts:
I've successfully used the Python script written by ndawson as a reply to the following question:

Creating points along line according to attribute data using QGIS?

After I changed my QGIS version from 2.18 to 3.4 Madeira, I receive the following error message after line num_points = feat['num_points']:

  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\code.py", line 63, in runsource
    code = self.compile(source, filename, symbol)
  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codeop.py", line 168, in __call__
    return _maybe_compile(self.compiler, source, filename, symbol)
  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codeop.py", line 99, in _maybe_compile
    raise err1
  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codeop.py", line 87, in _maybe_compile
    code1 = compiler(source + "\n", filename, symbol)
  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codeop.py", line 133, in __call__
    codeob = compile(source, filename, symbol, self.flags, 1)
  File "<input>", line 6
    num_points = feat['num_points']
             ^
SyntaxError: invalid syntax

When I change the name num_points to something else, I receive a different error message:

  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
NameError: name 'feat' is not defined

As you can see, I don't know Python at all.

Can someone help me solving this issue?


texts: Write a text file per image with same name in R

texts:
In R I would like to create a text file for each picture I have in a folder and with the same name. By example:

Picture 1.png - Picture 1.txt

Picture 2.png - Picture 2.txt

But the text file name I got is  Picture 1.png.txt. How I can avoid to have the image extension in the text name ?

My program is the following

   folder <- "C:/Users/user/Desktop/R/test/"

   jpeg <- list.files(folder)

ind <- 0

for (k in jpeg){

  ind <- ind +1

  #Create matrix

  data <- matrix(nrow=1,ncol=5)

  data[1,1:5] <- cbind(a,b,c,d,e)

  filename <- paste(k, ".txt", sep=",")

  write.table(data, filename, row.names = FALSE, col.names = FALSE)
}


texts: Create MBTiles from geojson in raster format

texts:
I am trying to create raster file in the Mbtiles format.
I tried ,
$ gdal_rasterize -ot Byte  -burn 255 -burn 0 -burn 0 -ts 4950 4090 -of MBTiles station.geojson station.mbtiles

I'm using,

$gdalinfo --version : GDAL 2.1.3, released 2017/20/01

Error:

> ERROR 1: Cannot find min and max zoom_level
>
> ERROR 6: Could not find an appropriate zoom level that matches raster
> pixel size
>
> ERROR 6: Only EPSG:3857 supported on MBTiles dataset
> 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> ERROR 6: IWriteBlock() not supported if georeferencing not set
>
> ERROR 6: IWriteBlock() not supported if georeferencing not set
>
> ERROR 6: IWriteBlock() not supported if georeferencing not set

EDIT:
 $ ogrinfo station.geojson -so -al

INFO: Open of 'stations.geojson' using driver 'GeoJSON' successful.
Layer name: OGRGeoJSON
Geometry: Point
Feature Count: 86
Extent: (-77.272622, 38.766522) - (-76.842038, 39.119927)
Layer SRS WKT:
GEOGCS["WGS 84",
DATUM["WGS_1984",
   SPHEROID["WGS 84",6378137,298.257223563,

       AUTHORITY["EPSG","7030"]],

   AUTHORITY["EPSG","6326"]],

PRIMEM["Greenwich",0,
   AUTHORITY["EPSG","8901"]],

UNIT["degree",0.0174532925199433,
   AUTHORITY["EPSG","9122"]],

AUTHORITY["EPSG","4326"]]
name: String (0.0)
marker-color: String (0.0)
marker-symbol: String (0.0)
line: String (0.0)`


texts: Hiding one field of geodatabase for some users

texts:
I have ArcGIS Server 10.3 and SQL Server 2008.

I have a geodatabase which is connected to SQL Server by using ArcSDE. My users connect to the database by IP address and Username and password. I want to let some users to be able to see one specific field and for others not able to see.

How can I address this issue?


texts: Solar irradiation calculation using r.sun

texts:
I am trying to compute the global solar irradiation for a region and the run times seem to be a bit too high.

I have as inputs a Digital Surface Model with the buildings and a Digital Terrain Model for the surrounding area.

The PROJ_INFO is

name       : Lat/Lon
proj       : ll
datum      : wgs84
ellps      : wgs84

The PROJ_UNITS are

unit       : degree
units      : degrees
meters     : 1.0

The DSM has 8020 Rows, 8782 Columns and 70431640 Total Cells. The resolution of the DSM is 0:00:00.03303.

The DTM has 1080 Rows, 1476 Columns and 1594080 Total Cells with a resolution of 0:00:00.28913.

These are the steps I did for the r.sun calculation

Set the region to the area covered by the DTM and the resolution to the resolution of the DSM

g.region rast=DTM@PERMANENT res=0:00:00.03303
Overlay the DSM and the DTM to get a high resolution elevation map using r.series

r.series input=DSM,DTM output=Overlay method=maximum
From the Overlay map I generate slope and aspect maps

r.slope.aspect elevation=Overlay slope=Slope aspect=Aspect
I run r.sun on using the following command

r.sun -s elevin=DSM aspin=Aspect slopein=Slope glob_rad=GlobalRad day=262

The whole process ran on a system with two Intel Xeon l5430 CPU @ 2.66 GHz with 8 GB of RAM and it took 15 hours to finalize 55% of the process.

What am I doing wrong?

Am I missing something, is it normal to run this long?

Help me understand how should I compute solar irradiation starting from two elevation maps, a Digital Surface Model that contains the buildings and a Digital Terrain Model for the area that surrounds the Digital Surface Model.


texts: Geodesic buffers for polygons in ArcObjects?

texts:
How can I create geodesic buffers around polygons? I'm on 9.3.1 ArcMap, but I need a programatic solution.

IBUfferConstruction only does geodesic buffers for points.

What are my options?


texts:
Is it possible to make a click event occur only on the tile layer on a Leaflet map?

I tried

var tiles= L.tileLayer(...).addTo(map);

tiles.on('click', function(e) { console.log('ok') });

but it doesn't do anything. I also tried

tiles.on({ click: console.log('ok') });

but it only triggers once when the map loads.

I'd like this event to occur only on tile layers, not when the user clicks on another layer.


texts: Avoiding Python NameError when rewriting script with user defined functions for ArcGIS Pro

texts:
I am rewriting a script for Python 3.6 and ArcGIS Pro compatibility and it seems like user defined functions will be necessary to clean it up. I am fairly new. I separated the code block into two functions and I would like to call the first function in the beginning of the second function. I'd also like to call the first function near the bottom but I'm getting a NameError. Here is the code block that I am working on.

def select_address():
    for lyr in m.listLayers():
        if lyr.name == "LOCATION.addresspoint":
            CoaAddresses = lyr
            selection = arcpy.SelectLayerByAttribute_management(CoaAddresses,"NEW_SELECTION", expression)
            return(selection)

def found_address():
    select_address()
    print(selection)
    for row in arcpy.SearchCursor(selection): #retrieve address of selected feature
        selectedAddress = row.FULL_STREET_NAME  #this variable used later for legend
        return(selectedAddress)

select_address()

results = arcpy.GetCount_management(selection) #return number of features selected

the error I get:

  results = arcpy.GetCount_management(selection) #return number of
  features selected

  NameError: name 'selection' is not defined

Shouldn't selection be defined in the def select_address(): portion of the script?


texts:
I have a very large mapper. Formatted to A1 size with a large area and constraints laid across it.

Every time I try to write to PDF it crashes. It is just due to the size of the file. I don't really want reducing the file quality any more so is there any other options.

I am using QGIS Lisboa.


texts: Geoserver Openlayers 3 getGetFeatureInfoUrl for several points

texts:
I'm using Openlayers 3 with geoserver for showing roads and temperature information from a NetCDF.
When I select a road, I would like to get the temperature information for each coordinate of the road.

Using getGetFeatureInfoUrl it's possible to get the information of one point, but if I tried to get it from many points using a loop, it takes much time.

Which is the correct way to do this? Is there a way to send linestring coordinates as a parameter?


texts:
I would like to know a disk space usage for Europe extract (Nominatim, tile server, both data structures and rendered tiles).
I have currently map server with an european country extract and I tried to estimate disk usage for Europe. My estimation is a very big number (about 1,3 - 1,4TB!).
Is it possible? Am i wrong? Can someone correct or confirm my estimation?

My calculation's ways are:

Europe surface to country surface ratio
Europe osm.pbf file to country osm.pbf file ratio


texts:
I just can't work out why this reducer does not work and give me the average canopy height. The reducer output is null even though there are pixels in the area.
var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2");

var filter = ee.Filter.inList('ADM0_NAME', ['Brazil']);
var filteredArea = fromList.filter(filter);

var dataset = ee.Image('NASA/JPL/global_forest_canopy_height_2005').clip(filteredArea);
var forestCanopyHeight = dataset.select('1');
var forestCanopyHeightVis = {
  min: 0.0,
  max: 30.0,
  palette: [
    'ffffff', 'fcd163', '99b718', '66a000', '3e8601', '207401', '056201',
    '004c00', '011301'
  ],
};

Map.addLayer(forestCanopyHeight, forestCanopyHeightVis, 'Forest Canopy Height');

var stats = forestCanopyHeight.reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: filteredArea.geometry(),
  scale: 100,
  maxPixels: 1e9
});

print (stats);


texts: Create Virtual Raster from a large number of Tiffs using OSGeo4W Shell

texts:
I am hoping to find a relatively straightforward way to create a virtual raster for a large set of rasters (c. 15,000 TIF files from the TQ 100K Square of OS 1-10K).

I cannot do this in QGIS. I get the following error: "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program". Presumably this is because there are too many files: it works fine for other squares with fewer files.

I have attempted copying and pasting the script that QGIS generates into OSGeo4W Shell, and running it there without success. I have run this at the root of the drive (H:>), the destination folder for the virtual raster, and the folder containing the source tifs. Clearly I am doing something wrong, but I do not have the expertise  to know what, or how to remedy it.

The script I get is: gdalbuildvrt "//..../My Documents/GIS/Datasets/Ordnance Survey/1-10,000/2018/Virtual Rasters/1-10K_TQ.vrt" "...list of files..."

Is it possible to do this through OSGeo4W Shell, or do I just need to break it down into smaller chunks and run it through QGIS?

I have tried numerous pieces of advice on here and elsewhere, e.g. https://astuntech.atlassian.net/wiki/spaces/ISHAREHELP/pages/14844053/Mosaic+thousands+of+raster+images, but they are either not specific enough to my situation, or require a level of understanding of script which I do not have.


texts:
I'm pretty new to JavaScript and have some code that zooms to a query results extent, but I also want to highlight the query result.

Console.log shows I'm returning an object but I can't seem to add the "highlightSymbol" to it.

//add the layers
map.addLayer(topoBasemap);
map.addLayers([administrative,parcels, agriculture, transportation]);

//set extent
var startext = new esri.geometry.Extent({
        "xmin" : 186870.18,
        "ymin" : 541462.48,
        "xmax" : 735481.291,
        "ymax" : 967243.73,
        "spatialReference" : {
            "wkid" : 102711
        }
    });
map.setExtent(startext);

//get extent info
map.on("extent-change",
    function findExtent() {
    var e = map.extent;
    var s = "";
    s = "XMin: " + e.xmin + "
" +
        " YMin: " + e.ymin + "
" +
        " XMax: " + e.xmax + "
" +
        " YMax: " + e.ymax + "
" +
        " Spatial Reference: (wkid) " + e.spatialReference.wkid + "
" +
        " Center: (x,y) " + e.getCenter().x + ", " + e.getCenter().y;
    dom.byId("onExtentChangeInfo").innerHTML = s;
    var d = "";
    d = "Zoom Level: " + map.getLevel() + "
" +
        "Resolution: " + map.getResolution() + "
" +
        "Scale: " + map.getScale() + "
";
    dom.byId("details").innerHTML = d;
});

//Highlight Symbol
var highlightSymbol = new SimpleFillSymbol(
        SimpleFillSymbol.STYLE_SOLID,
        new SimpleLineSymbol(
            SimpleLineSymbol.STYLE_SOLID,
            new Color([255, 0, 0]), 3),
        new Color([125, 125, 125, 0.2]));

//Query BLOCK/LOT
var queryTask = new QueryTask(parcels.url);

var query = new Query();
query.returnGeometry = true;
query.outFields = ["*"];
on(dom.byId("execute"), "click", execute);

function execute() {
    map.graphics.clear();

    query.where = "SSN = '" + dijit.byId("muniSelect").value + "' AND BLOCK = '" + dom.byId("block").value + "' AND LOT = '" + dom.byId("lot").value + "'";
    queryTask.execute(query, showResults);
}
function showResults(results) {
    var resultItems = [];
    var resultCount = results.features.length;
    for (var i = 0; i < resultCount; i++) {
        var featureAttributes = results.features[i].attributes;
        for (var attr in featureAttributes) {
            resultItems.push("" + attr + ":  " + featureAttributes[attr] + "
");
        }
        resultItems.push("
");
    }
    if (resultCount === 0) {
        dom.byId("info").innerHTML = "
 No Record Found
";
    } else {
        dom.byId("info").innerHTML = resultItems.join("");

        //Zoom to Result & Set Query Result Symbol
        var resultGraphic = new Graphic(results.features, highlightSymbol);
        var resultExtent = graphicsUtils.graphicsExtent(results.features);
        map.graphics.add(resultGraphic);
        map.setExtent(resultExtent.expand(2));

        console.log("resultGraphic:", (results.features));
    }
}


texts: input data coordinates to database from input data inside leaflet js

texts:
i have a problem with my update data coordinates form leaflet popup. i just want to make edit form inside leaflet popup. if i click marker in a map it shown coordinate with input form, if the building is move i just adjust coordinate with input form and submit it to a database. but, that's the problem when i click on update button it shown no response. here the script i used:

var Sekolah = L.geoJson.ajax("template/lokasi/lokasi.php", {
    pointToLayer: function (feature, latlng) {
      return L.marker(latlng, {
        icon: marker,
        title: feature.properties.sekolah,
        riseOnHover: true
      });
    },
    onEachFeature: function (feature, layer) {
        var bujur = "<input type='text' class='form-control' name='bujur' id='bujur' value="+layer.feature.geometry.coordinates[0]+">";
        var lintang = "<input type='text' class='form-control' name='lintang' id='lintang' value="+layer.feature.geometry.coordinates[1]+">";
        var context = "

Bujur"+bujur+"
&nbsp;"+
                        "
Lintang"+lintang+"

"+
                        "<button class='btn btn-warning lok' id='edit_lok' value="+layer.feature.properties.id_lokasi+"></button>"+
                        "<button class='btn btn-danger lok' id='hapus_lok' value="+layer.feature.properties.id_lokasi+"></button>";

        layer.bindPopup(context, {
            maxWidth: 350
        });
    }
}).addTo(peta);

$('#edit_lok').on('click', function(){
    var id = $(this).val();
    var buj = $('#bujur').val();
    var lin = $('#lintang').val();

    var data = "&id="+id+"&bujur="+buj+"&lintang="+lin;

    $.ajax({
        url: 'template/lokasi/proses.php',
        type: 'post',
        data: data
    })
    .done(function(msg) {
        console.log(msg);
    })
    .fail(function() {
        console.log("error");
    });
});

i can't find any error in my script. hope there is an answer


texts: Deleting/identifying near-identical linestrings in PostGIS? - EDITED

texts:
I am trying to process a road network file in which certain road links have near-identical duplicates/neighbours.

By "near identical" i mean 2 Linestrings may share the same centroid but have start/end nodes which differ by a few millimeters. In other cases, a certain Linestring may have a near-parallel neighbour which does not share a common centroid; again, this "duplicated" line is typically within a few millimeters of its near-parallel neighbour.

My goal is to remove these near-identical Linestrings to facilitate accurate length calculations.

I have browsed other threads exploring problems similar to this but have yet to find the PostGIS solution that works on this particular task.
- St_SnapToGrid maintains the relationships of the near-identical pairings.
- ST_DWithin test can result in deleting consecutive links rather than coinciding ones.
- ST_Union maintains the original geometry
- ST_Linemerge fails to merge lines if they are too far apart.
This image shows the centroids of each link as well as the selection of two near-identical links, one of which also overlaps another link at its higher end.

Zooming to a scale of 1:1 and measuring shows the two links are 8.5mm apart.

PostGreSQL version: 9.6.5
PostGIS version 2.4.0
GEOS 3.6.2
GDAL 2.2.2
LibJson 0.12


texts:
I would like to crop rectangular fragments of given size and for these purposes I need coordinates, which covers all Earth and measured in meters.

I wrote the following picture:

Latitude and longiture are in radians.

I mapped all surface into leaf-like 2D shape.

x coordinate is a distance in meters from zero meridian along parallel.

y coordiante is a distance in meters from equator along meridian.

What is the name of this projection?


texts: Hotkeys for DAT/EM Summit Evolution linking into ArcMap functions instead

texts:
I'm using DAT/EM Summit Evolution to do feature mapping in stereo. When I try to use the hotkeys set in Summit, they instead execute functions in ArcMap.
ie. when I press "0" which is linked to CAD: Close Object in Summit. Instead, it zooms to the map extent in arcmap.
So far the only way it could be explained to me is that the program is dumb and just does things like that.

Answer:
The issue was that my first mouse click in the digitizing mode, would make arc the active screen and so the hotkeys would be linked to arc and not Summit. This was due to the DAT/EM summit toolbar in Arc being grayed out. Not sure why it was like that but once the toolbar was active things started working.


texts:
My layer Point (OGR geojson) has several classes:

CLASS
    NAME "Station1"
    EXPRESSION ([extrude]=0)
    STYLE
        COLOR 0 0 250
        OUTLINECOLOR 255 255 255
        SYMBOL 'circle'
        SIZE 6
    END
        LABEL
        SIZE TINY
        COLOR 0 0 0
        OUTLINECOLOR 255 255 255
        POSITION AUTO
    END
END
CLASS
    NAME "Station2"
    EXPRESSION ([extrude]=1)
    STYLE
        COLOR 250 0 0
        OUTLINECOLOR 255 255 255
        SYMBOL 'circle'
        SIZE 10
    END
        LABEL
        SIZE TINY
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
        POSITION AUTO
    END
END
CLASS
    NAME "Station3"
    EXPRESSION ([extrude]=2)
    STYLE
        COLOR 128 0 128 #purple
        OUTLINECOLOR 255 255 255
        SYMBOL 'circle'
        SIZE 14
    END
        LABEL
        SIZE TINY
        COLOR 128 0 128
        OUTLINECOLOR 255 255 255
        POSITION AUTO
    END
END

If N points are overlaying I need to have a specific order. Station3 on top of Station2 on top of Station 1. Inverting the order nothing has changed. Ideas?


texts: GRASS tools (v.generalize, v. clean) error with polygons in projected CRS (EPSG:3857/Web Mercator)

texts:
I have troubles using several GRASS GIS tools from QGIS 3.16 (win 10) - I encountered the same problem applying v.clean as well as v.generalize tools (I tried Douglas Peuker algorithm). I tried a lot of different values for parameters. I always got an error and no output:

ERROR 1: osgeo::proj::io::WKTParser::Private::buildEllipsoid: non
double value
ERROR: Unable to create OGR spatial reference

When reprojecting these polygon layers to EPSG:4326, the GRASS tools run without problem. I can set different values for the parameters (like threshold from 0.0001 to 1000), all work fine.
Why do I get errors when using the same tool/algorithm with the same layer in projected CRS?


texts: How to build XYZ layer source for custom scales?

texts:
I have tile images in scales: 4, 6, 8, 12, 14 (in subdirectories). In smaller scale tiles are in higher zoom (in 14 scale zoom is minimal, in 4 scale zoom is maximal). I have prameters as below for this map like projection, width of all area (extent) in pixels etc. How to define correct ol.source.XYZ object with tileGrid and tileUrlFunction for this ?

Partially working example (works for scale 4 and 8, not for other):

var origin = [101235.72703025967, 781405.7611248483];

// counted from parameters
var resolutions = [
    10160.181718152791,
    5080.090859076396,
    2540.045429538198,
    1270.022714769099,
    635.0113573845495,
    317.5056786922747,
    158.75283934613736
];

var source = new ol.source.XYZ({
    projection: 'EPSG:2180',
    tileGrid: new ol.tilegrid.TileGrid({
        origin: origin, // left upper corner
        resolutions: resolutions,
        tileSize: [256, 256]
    }),
    tileUrlFunction: function(coord){
        var zoom = coord[0];
        var x = coord[1];
        var y = -coord[2]-1;

        // how to convert zoom to scale (directory) ?
        // ...
        // i have something like below, that works for 4 and 8 scales
        // but need to work with other scales
        var scale = Math.pow(2, maxScale - zoom);

        return baseUrl+'/'+scale+'/'+(y<0?'n':'')+Math.abs(y)+'_'+(x<0?'n':'')+Math.abs(x)+".png";
    }
});

Parameters:

    tile_size   = (256, 256),
    scales      = [4, 6, 8, 12, 14],
    size        = (20983, 16417),

    origin      = (101235.727030259673484,781405.761124848271720),
    pixel_size  = (39.688209847118202,-39.686773552345521),

    upper_left  = (101235.727,  781405.761),
    lower_left  = (101235.727,  129868.000),
    upper_right = (934013.434,  781405.761),
    lower_right = (934013.434,  129868.000),


texts:
I have QGIS 2.8. I open up the database manager, connect to PostGIS, and then execute a query. The resulting query has an id column, a name column, a geom column, and a membership column.

I click on the button "Load as new Layer" and then the button "Load Now!" Nothing happens after that. The layer does not appear in any layer list. I have looked at the documentation and cannot see what I am doing wrong.


texts: Displaying previously submitted location points in a webform

texts:
I'm designing a Survey123 webform for respondents to identify points along a route, one by one, to essentially submit the full sequence of points along a route so that a transport service can then be mapped.

I've the form set up so that each time a location is submitted with the geopoint widget, the respondent has the option of returning to a certain point in the webform so that they can add the next point in the sequence until they have provided all locations

One of the feedback points i am consistently getting is that when the respondent is using the form to input data points, the point will be submited on completing the form each time and 'wiped' on the respondents end each time so that there is no record on the map of points that they have already added to the survey.

If the respondents will not have their own named user Survey123 accounts and will just be accessing the public webform through the URL i'll be providing, is there any way for the survey webform to keep record and display points that they themselves have previously submitted so that they can follow what they've already entered, where they are along the route, where they have yet to drop a point etc.?


texts: Issue loading layer from OpenLayers plugin in QGIS

texts:
I installed the OpenLayers plugin in QGIS and tried to load one of the layers. Regardless of which layer I try to load, I am getting an error message. See example:

Does anyone know how to resolve this?


texts: Lots of people crash boats and get injured or die every year because of underwater hazards. I'm trying to design lake maps where the topography and data points change with the water level. Any idea on where to begin with this?


texts:
I'm using the processing tool named "Network analysis" in order to analyze a sewage network. I'm using the tools "Shortest path" and "Service area". They work fine, but I can’t add blocking points which interrupt the network.

Furthermore, I would like to add criteria considering the piping type (stored in an attribute of the table) (for example only wastewater piping or rainwater piping,…). I know that ArcGIS Pro propose it, but I don’t find any information in it for QGIS.

Is there a way to add these conditions?


texts: Use base file name to reference created attribute in QGIS Modeler

texts:
I'd like to drop a field created when using overlap analysis. This operator creates two fields: [layername]_area and [layername]_pc. I want to drop the _pc. The input file name can vary. I've tried creating an expression thus:
base_file_name( @fz3 ) || '_pc'
(fz3 is the input layer) but this only returns _pc.
Is there a way to reference base_file_name to output the created field? (just noticed I'm using file_path in the image below but it returns nothing as well in the output).

EDIT: Log file from running the process:
Running Drop field(s) [4/4]
Input Parameters:
{ COLUMN: '_pc', INPUT: 'MultiPolygon?crs=EPSG:27700&field=layer:string(30,0)&
field=type:string(70,0)&field=shape_leng:double(18,8)&field=st_area_sh:double(18,11)&
field=st_perimet:double(18,11)&field=Flood_Map_for_Planning_Rivers_and_Sea_Flood_Zone_3_sub_area:double(0,0)&
field=Flood_Map_for_Planning_Rivers_and_Sea_Flood_Zone_3_sub_pc:double(0,0)&
uid={a2ea2147-f75a-4050-b35f-aa5118e6f121}', OUTPUT: 'TEMPORARY_OUTPUT' }
Field “_pc” does not exist in input layer
OK. Execution took 0.037 s (1 outputs).


texts: How to Iterate Across Fields as Inputs for a single tool (Kernel Density) in ArcGIS ModelBuilder

texts:
I am trying to make Employment Distribution of map of a given area in ArcGIS. All the employment information is in this one point shapefile from Census. Different fields show different number of employment for different industries.

Now I want to use each field as population field input in Kernel Density tool. There are like 18 fields so I am wondering how I could use iterator or some other way to do it more efficiently.

The model I used is shown as below:

What shall I do to finish this job?

This was marked as duplicated by Mods, which I understand. But I am just wondering if this could be done merely in ModelBuilder.


texts: Assigning the points that a client of origin passes to a destination with SQL of Carto

texts:
At the point of destination, can I choose how many kilometers of radius to calculate the points a customer goes through?

I know I have to use the function cdb_route_point_to_point.

For example, I have these two tables:

Table 1 has the points of origin and table 2 the points of destination.

Imagine that for Origin A it goes to destination T1, and on the route it goes through points T2 and T3.

With Carto, how do I assign the points that go through the route? The result would be a table as the last image

route:


texts:
I always have trouble understanding the different characteristics of raster data formats - Bands, RGB, Alpha, Color tables, Classification, Stretching, single color setting etc.

Can anyone offer me any texts, manuscripts, tutorials, notes or books which would explain to me in a "not too" technical way how these formats work?


texts: How to intersect more than two layers? Is there a quick way?

texts: We have three layers, income, obesity and fast food restaurants for England and we wanted to find districts where they all intercepted. So we did a combination of two layers at a time to find where all three crossed over, but is there a quicker way of doing this in one step??


texts:
The layer to be updated (ul) does not get applied with the style from the source layer (sl) and the code executes without throwing any error.

import os
import csv
import arcpy
#Set home geodatabase.
arcpy.env.workspace =  "\ArcGIS\Python_test"
#Set shapefile path to variable.
PointFile = "\ArcGIS\Python_test\Well_data.csv"
#Import well location shapefile template CSV.
arcpy.MakeTableView_management(PointFile)
#Make well location event layer.
arcpy.MakeXYEventLayer_management("Well_data_View", "Easting", "Northing", 'Well_plot_EventLayer', 'WGS 1984 UTM Zone 43N')
#Convert temporary event layer to feature class for saving.
arcpy.FeatureClassToFeatureClass_conversion("Well_plot_EventLayer", "\ArcGIS\Python_test", 'Well_plot')
#Delete event layer.
arcpy.Delete_management("Well_plot_EventLayer")
#Reference the map document (.mxd).
mxd = arcpy.mapping.MapDocument("\ArcGIS\Python_test\Python_workspace.mxd")
#Reference dataframe.
df = arcpy.mapping.ListDataFrames(mxd)[0]
#Reference layer to be updated and reference layer.
ul = arcpy.mapping.Layer("\ArcGIS\Python_test\Well_plot.lyr")
sl = arcpy.mapping.Layer("\ArcGIS\Python_test\Well_SR.lyr")
#Update the layer. THIS DOES NOT WORK!!
arcpy.mapping.UpdateLayer(df, ul, sl)