texts: Geodesic distance between two polygons in ArcGIS

texts:
Does the IGeometryServer2 interface work in desktop applications? My solution is an Add-in for ArcGIS 10. I'm currently passing it two valid polygon features that are in a projected coordinate system. I call the GetDistanceGeodesic() method in the following manner but it always returns infinity.

IGeometryServer2 geomServer2 = new GeometryServerClass();
var PCS = distFeat.ShapeCopy.SpatialReference as IProjectedCoordinateSystem;
ILinearUnit unit = PCS.CoordinateUnit;
double _dTestDist = geomServer2.GetDistanceGeodesic(distFeat.ShapeCopy.SpatialReference, distFeat.Shape, distFeat2.Shape, unit);

All the inputs have the expected values while stepping through in debug mode. I also tried using WGS84 but the results were the same.


texts: Using a Search Cursor to calculate a new field

texts:
I am new to ArcPy. What I am essentially trying to do is use ArcPy to look through a column in a table and if it is between a range to print a value in a new corresponding column. I assume I am going to be using a search cursor to iterate a loop something like:

table = ("file path to table")
field = ("name of column")
cursor = arcpy.SearchCursor(table)
for row in cursor:
    row.getValue(field)
         if ((field >0) & (field < 10)

          *in new column print 1*??

I have four different ranges I need it to run the column through, but do not know how to have it place the numbers from the calculation in a new field... Do I need to use the CalculateField_management tool instead?


texts:
The instructions for using OSM data in QGIS say, "Open QGIS and go to Vector -> OpenStreetMap -> Download Data…"
but, there is no OpenStreetMap in the Vector menu. Where do I find it, or, how do I get it? I thought it was supposed to be there automatically.

I am using QGIS 3.10.1 on a Mac running OS 10.14.6


texts: Compute nearest points to other points using GRASS

texts:
I have a layer of address points and a layer of polling stations. My task is to determine the three closest polling stations to each address on the street network.

I think that the answer is in v.distance, but I am stuck trying to use this tool. I have merged my two point layers, each having a "type" field (either 'address' or 'voting'). It seems that the tool wants the From WHERE condition to be

type=address

...and the To WHERE condition to be

type=voting

I have used v.net.maintenance to make a network of the streets with the merged points as the input point vector map. However, the resulting layer only has attributes of the street network, such as COST. If I input this layer to v.distance as

input=street_network_with_merged_points

...I can use the COST field, but there is no type field for from_where or to_where.

I've seen several postings about using this tool, but no answers.


texts: INSERT only non-existing features into PostgreSQL/PostGIS table with FME

texts:
I have a PostGIS table of, lets say, adresses, for example

id | adr            | geom
----------------------------
1  | Rathausplatz 1 | POINT
2  | Dorfstraße 2   | POINT
3  | Kirchenweg 3   | POINT

With FME I would like to insert features to my adresses table but only features that do not exists (based on non-equality of attribute adr), i.e. for incoming features

adr            | geom
----------------------------
Rathausplatz 1 | POINT
Dorfstraße 2   | POINT
Schlossallee 42| POINT
Elisenstraße 8 | POINT

only Schlossallee 42 and Elisenstraße 8 should be INSERTed, the first two should be rejected.

How to achieve this?


texts: Using Zonal Statistics to determine percent forest cover in grid cells?

texts:
The basis of what I am trying to do is determine what percent of forest cover is within a set of 1x1 km grid cells in arcmap. I originally attempted to do this using fishnet, tabulate area tool, and a vector layer for forest cover, but I got the error message "maximum record length has been exceeded" (if anyone knows a way to get around this without converting the vector layer to a raster, please feel free to also let me know). So, I decided to convert the vector forest cover layer to a raster and try to use the zonal statistics tool. Here, I run into problems where it seems that the numbers do not add up correctly.

I originally converted a vector forest cover layer to a raster layer. I have questions about the input for the zonal statistics table. For "input raster or feature zone data" I use my fishnet of 1x1 km2 cells, to identify the boundaries within which I want to determine the percent forest cover from the raster layer. Next, I put FID into the zone field, and I put the forest cover raster layer into the "input value raster" field. I choose mean to get the total number of pixel cells/area of forest in each grid cell. To then determine the percent forest in each grid cell, I know I could do this by just taking the number of cells of forest cover, dividing by 1000000 (in full grid cells, the total number of pixels in a 1x1 km2 grid cell) and multiplying by 100. But when I do this, the numbers for each grid cell do not appear correct, so I think something is going wrong along the way. I need help determining why the pixels are not adding up correctly.


texts: How many percentage of sea area is covered with points?

texts:
I have a large number of lat/long positions at sea for a geographical area (stored as CSV). This geographical area also contains lots of land area. I want to divide the sea area into a grid (f.ex down to four decimals degrees lat/long), and check each cell in that grid if there is a lat/long position present. Is this possible to do in an easy way?

Tools: ArcGIS (never used before), any other free GIS programs, python


texts: QGIS, Fixing missing land data in INSPIRE polygons

texts:
I'm trying to fix missing land data in INSPIRE polygons.

dots represent UPRN,
green lines - land data,
black lines - fix needs to be applied.

Any ideas how to do this automatically?
Already tried buffer on UPRN, voronoi, and intersection with road.
Land inside terraced block usually same size.


texts: How can I place a couple of html elements on the map?

texts:
I need to place html elements for drawing in it some text and graphic by Raphaeljs.

Is it possible?

I'am trying to create an empty marker for each visible feature and then erase icon container and place into it raphael canvas:

var markers = new OpenLayers.Layer.Markers('Markers');
map.addLayer(markers);

var size = new OpenLayers.Size(1, 1);
var offset = new OpenLayers.Pixel(0, 0);
var icon = new OpenLayers.Icon('/i/b.gif', size, offset);

var marker_items = {}, current_items = {}, centroid, x, y, key, marker, $marker;

layer4.events.register('moveend', layer4, function(e){
    current_items = {};
    for (var i=0, n=layer4.features.length; i<n; i++) {
        centroid = layer4.features[i].geometry.getCentroid();
        x = centroid.x, y = centroid.y;
        key = 'll-'+x+'-'+y;
        current_items[key] = true;
        if (marker_items[key])
            continue;

        // create new marker and store it in hash by key
        marker_items[key] = new OpenLayers.Marker(new OpenLayers.LonLat(x, y), icon.clone());
        markers.addMarker(marker_items[key]);

        // erase icon container, add canvas, and draw raphael graphics
        $marker = $(marker_items[key].icon.imageDiv).empty();
        $canvas = $('

').appendTo($marker);
        Raphael($canvas.get(0), 70, 70).piechart(35, 35, 35, [55, 20, 13, 32, 5, 1, 2, 10]);
    }

    // remove markers that not visible
    for (i in marker_items) {
        if (!current_items[i]) {
            markers.removeMarker(marker_items[i]);
            delete marker_items[i];
        }
    }
});

I have successfully draw graphics, but maybe there is more simple way?


texts: Load MrSID file in QGIS 2.2 on Ubuntu 13.10

texts: Is there a way to do this? I have tried a number of the write ups on this, and it appears that libgdal-mrsid-src no longer exists. Is there any other workaround? USDA NAIP imagery is sent as MrSID.


texts:
I'm very new to pgRouting!
I installed PostgreSQL 8.4, and pgrouting 1.03 on win7.
I need to solve a TSP problem so I was trying to install the TSL functionality as showen at:
http://www.pgrouting.org/docs/1.x/install.html
but when I type
psql -U postgres -f /usr/share/postlbs/routing_tsp.sql routing
and
psql -U postgres -f /usr/share/postlbs/routing_tsp_wrappers.sql routing
I get an error, as the .sql files can't be found!
How can I solve?
Where can I download any maps (openstreetmap) to practice?
thanks
Laura


texts: Debugging ERROR 000464: Cannot get exclusive schema lock?

texts:
I am trying to run the "Near" tool in Arcmap. Both my layers involved are on a SDE database. When I run the tool I get the following error...

ERROR 000464: Cannot get exclusive schema lock.  Either being edited or in use by another application.

I do not:

Have an edit session open.
Have another application open.

I saw this Link but I do not have ArcSDE installed locally so cannot execute "sdemon -o kill" to locally kill all connections...

How can I get an exclusive schema lock and/or bypass this error?

Windows 7, ArcGIS 10, Versioned SDE GeoDatabase

After reading this:

"In the Windows File Explorer, I looked at the properties of the folder where my script was putting its data. I saw that the folder was set to READ ONLY." Source

I trying running the cmd command to set turn off read-only still no luck.

attrib -r pathTofolder

After further reading found that the read-only attribute in windows 7 is normal, and has more to do with windows system files then ability to write to the file folder.

Today after reconciling, thinking that all locks on the database world have been removed from the previous day. Tried running the "Near" tool again, but still no luck still gives the schema lock error...


texts: Problem with WMS layer from SAGIS: Invalid format/can't parse XML

texts:
Can you help me the following problem:
I try to load WMS layer from SAGIS (Salzburg GIS) into Qgis:
http://www.salzburg.gv.at/themen/se/sagis/download.htm

for example: Geoland WMS

http://service.salzburg.gv.at/ArcGIS/services/Geoland_WMS_Land_Salzburg/MapServer/WMSServer

added "?version=1.1.1" to the url

connect

The dirctory of the availble layers appers

ID-0 - layers
ID-1 - Polygondecker
ID-3 - Orientierunskarte
and so on till
ID-41 - Landesgrenzen

chose the first directory: 0 - Layers (or any other, does not matter)

click "connect" (Hinzufügen)

following report appears:

Antwort: (<)?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
(<)!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
 (<)ServiceExceptionReport version="1.1.1">
 (<)ServiceException code="InvalidFormat">
Can't parse XML request.
 (<)/ServiceException>
(<)/ServiceExceptionReport>

edit:
When I add the suggestion from Brad:

?request=getcapabilities&service=WMS&version=1.1.1&

still the same message as above appears

I expect to see the chosen layers, but i can only see it in the layer dialog. whenever doing a click on the layers (e.g. zoom to selected layer) the same error message as above appears.

Thanks a lot.


texts:
I've just posted a question to StackOverflow about the best way to go about finding the best path on the raster below (where whiter pixels are 'better'), but have realised that it might actually be very easy to solve using some inbuilt GIS functions. To clarify, I'm trying to choose the best path down each of the lines shown in the image, staying on the bright white pixels as much as possible.

I have a feeling that the idea of Cost Surfaces and Cost Paths might help me with this, but I've had a play in ArcGIS and can't seem to get anything sensible out of it. Is this the right approach to take within a GIS? If not, are there some other inbuilt functions in a GIS that can do this kind of thing?


texts: MODIS MOD11A1 Reproject Change Data Value

texts:
I'm import and reprojected MOD11A1 with GDAL 1.10....my shell script is easy..

for file in *.hdf; do
echo "map: $file"

gdal_translate -of Gtiff -ot Int16 HDF4_EOS:EOS_GRID:"$file":MODIS_Grid_Daily_1km_LST:LST_Day_1km  -a_nodata -9999 out/${file}.tif
echo "out/"${file}".tif" | awk 'BEGIN{FS=".";}{ print "mv "$0" "$1"."$2"."$3"."$4"."$5"."$7}' |sh`

but when running script reprojected
something is wrong with data...

for file in *.tif; do
echo "map: $file"

gdalwarp -s_srs "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" -t_srs EPSG:32719 \
    -te 333524.4980000000214204 6618581.1791345691308379 422017.2268572300090455 6679275.1449999995529652 -tr 926.625 -926.625 \
    -dstnodata -9999 -ot Int16 $file utm/${file}

done

look my screenshot on qgis....

any idea how to solve?


texts: I have a question about printing A3 map from QGIS. I'm going to make A3 map of one country and nearby countries, digitalise borders etc. I want to save it to A3 format, but I have only A4 printer, that prints my map on one sheet of paper, not two, as I expected. If I use A3 printer, my map will print in proper size? I saved my map in PDF, if relevant.


texts: Batch Dissolve Polygons based on Attributes in QGIS or FWTools

texts: I was wondering if anyone can help with batching a dissolve.  I have a few hundred polygon shapefiles that I want to dissolve based on an attribute.  I would like to do this in QGIS or FWTools.


texts: Print Composer Map with Table using PyQGIS

texts:
I am looking for a way to print a custom feature form created in PyQt Designer for QGIS 2.4 using PyQGIS. My goal is to print/save image as the current extent of the map with the selected feature's attributes of interest on the same page.

I'm experimenting with two different ways:

First, is to use QgsComposition and QPrinter to add and print items to a pdf: including the map, legend, and attributes. My issue here is getting the only the desired attributes to display dynamically changing depending on the active layer. If I could add my feature form as a map item, I would be displaying the attributes added to the custom form.

UPDATE: The following code may be able to display my map with a legend and selective table, but I still have many issues with the map items (no text in the table, positioning, unable to include only desired layer in legend). I've included all the code associated with this print composer:

layer = qgis.utils.iface.activeLayer()

qgis.utils.iface.actionZoomToSelected().trigger()
qgis.utils.iface.mapCanvas().zoomScale(1000)

mapRenderer = iface.mapCanvas().mapRenderer()
c = QgsComposition(mapRenderer)
c.setPlotStyle(QgsComposition.Print)
x, y = 0, 0
w, h = c.paperWidth(), c.paperHeight()
composerMap = QgsComposerMap(c, x,y,w*.75,h)
c.addItem(composerMap)

legend = QgsComposerLegend(c)
c.addComposerLegend(legend)
legend.model().setLayerSet(mapRenderer.layerSet())
legend.setTitle('')

legendModel = QgsLegendModel(c)
legendModel.setLayerSet([layer.id()])

legend.updateLegend()

selected_ids = [f.id() for f in layer.selectedFeatures()]
filter_id_string = ','.join([str(id) for id in selected_ids])

table = QgsComposerAttributeTable(c)
table.setVectorLayer(layer)
table.setMaximumNumberOfFeatures(20)
table.setFeatureFilter("id in (" + filter_id_string + ")")
table.setFilterFeatures(True)
table.setItemPosition(x+50, y+50)
table.applyDefaultSize()
col1 = QgsComposerTableColumn()
col1.setAttribute('Diametre')
col2 = QgsComposerTableColumn()
col2.setAttribute('Nature')
table.setColumns([col1, col2])
c.addItem(table)

printer = QPrinter()
printer.setOutputFormat(QPrinter.PdfFormat)
printer.setOutputFileName('out.pdf')
printer.setPaperSize(QSizeF(c.paperWidth(), c.paperHeight()), QPrinter.Millimeter)
printer.setFullPage(True)
printer.setColorMode(QPrinter.Color)
printer.setResolution(c.printResolution())
pdfPainter = QPainter(printer)
paperRectMM = printer.pageRect(QPrinter.Millimeter)
paperRectPixel = printer.pageRect(QPrinter.DevicePixel)
c.render(pdfPainter, paperRectPixel, paperRectMM)
pdfPainter.end()

Second, is to embed a image of the current extent (using mapCanvas().saveasImage()) using a dynamic QPixMap element on the custom form. This brings me back to the same question as to whether or not the custom feature form could be printed (to pdf, and eventually paper).


texts: Adding Thirty years to date field using ArcGIS Pro Field Calculator

texts:
I have 2 fields one is Creation Date the other is Maintenance Date. The Maintenance Date should be 30 years after the Creation date.

I have been trying to use the field calculator for this. But I haven't been able to make this work.

Does anyone know how to do this?


texts: Clipping raster using multiple shapefiles using gdal in Python

texts:
I am currently using batch process in QGIS based on clip raster by extent to clip geotiff raster layers based on different shapefiles. I am trying to clip many raster layers from the same region with multiple discrete shapefiles. I previously tried gdalwarp but this approach changed the image dimension. Can anyone suggest a way in Python to automate the raster clipping based on multiple shapefiles?

Example of a raster layer and few shapefiles:

I merged all the shapefiles to one file and tested the code from the link below in jupyter notebook, but it returns error.
Clipping raster with multiple polygons and naming the resulting rasters
import glob, os
import fiona
from subprocess import Popen

path= 'C:/dataset'
os.chdir(path)

with fiona.open('polygons.shp', 'r') as dst_in:
    for index, feature in enumerate(dst_in):
        with fiona.open('separated/polygon{}.shp'.format(index), 'w', **dst_in.meta) as dst_out:
            dst_out.write(feature)

polygons = glob.glob('separated/*.shp')  ## Retrieve all the .shp files

for polygon in polygons:
    feat = fiona.open(polygon, 'r')
    name = feat['properties']['name']  #name of the attribute considering the region name
    command = 'gdalwarp -dstnodata -9999 -cutline {} ' \
              '-crop_to_cutline -of GTiff ./input.tiff ./outputraster/{}.tiff'.format(polygon, name)
    Popen(command, shell=True)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-8ce8105d9f76> in <module>
      8 for polygon in polygons:
      9     feat = fiona.open(polygon, 'r')
---> 10     name = feat['properties']['name']  #name of the attribute considering the region name
     11     command = 'gdalwarp -dstnodata -9999 -cutline {} ' \
     12               '-crop_to_cutline -of GTiff ./input.tiff ./outputraster/{}.tiff'.format(polygon, name)

TypeError: 'NoneType' object is not subscriptable


texts: How can I make Leaflet tiles appear in a page?

texts:
I am having trouble with leaflet working, but not displaying any of the background tiles in the page.

This one is using the leaflet-rails gem in a Rails app.

This is just in an html sample page:

I have tried every browser I have and I am not sure where to start --since apart from the backgrounds the map seems to be working fine.


texts:
I'm setting up a custom widget in a QGIS3 plugin and include a QgsAttributeTableView like this:

layer = iface.activeLayer()
layer.getFeatures()

canvas = iface.mapCanvas()
vector_layer_cache = QgsVectorLayerCache(layer, 10000)
attribute_table_model = QgsAttributeTableModel(vector_layer_cache)
attribute_table_model.loadLayer()

attribute_table_filter_model = QgsAttributeTableFilterModel(canvas, attribute_table_model)
self.attribute_table_view = QgsAttributeTableView()
self.attribute_table_view.setModel(attribute_table_filter_model)

print("GIS-Layer: "+str(layer.allFeatureIds()))

self.layTab.addWidget(self.attribute_table_view)

But no data is shown in the QgsAttributeTableView. The print-output displays the list of all feature-ids of the loaded layer. So I think there are features, but not shown in my QgsAttributeTableView.


texts:
I have a PDF file, with a Map as a vector graphic. I want to get this into GIS. (I use ESRI's ArcGIS, but any FOSS solution is also fine).

I know that it is not possible to directly get the PDF into ArcGIS, so I was just testing various scenarios, and found that we can convert the vector graphic in the PDF to SVG using Inkscape. I was successful in doing that.

I was hoping that there might be some way of going from SVG into a vector format that ArcGIS understands.

Is this possible?


texts: How to get a list of all projections that are currently available in QGIS via the PyQGIS-API

texts:
i'm building a QGIS-Plugin and i want the user to choose a CRS out of a combobox in which the coordinates he would enter into some textfields are represented, so these can be converted into another projection.

Is it possible to get a list of all the currently available projections via the PyQGIS-API?

I'm searching the QGIS-API right now, but no luck so far.


texts: Calculate Length Totals in ArcGIS based on field values

texts:
I am having trouble finding the right words to describe this problem but here goes:

I have 3 values (120,270,380) in my field called operatingvolt for every segment of conductor. Each segment of conductor has a feederid to identify what system it belongs to. I would like to use ArcGIS to calculate the length of each segment by operatingvolt and feederid.The goal is to get a table that looks like this:

The problem I run into is that if the feederid does not have an operatingvolt then the length will not be computed. This happens frequently since not every feederid has every operatingvolt value. I would like a length computed for every feederid at every possible operatingvolt even if the length is 0.

I also would like to be able to create a model that completes this task. I have  limited knowledge of python.


texts: Can ArcMap perform nested queries, similar to the dynamic analysis capabilities in GeoMedia?

texts:
I've been asked by a seasoned GeoMedia user if ArcMap can perform nested queries, similar to the dynamic analysis capabilities in GeoMedia.

I'm reasonably familiar with ArcMap, but I have zero experience with GeoMedia. I'm pretty sure I understand the principle of the question, that you can have dynamic layers which automatically update as the base data updates, e.g. creating buffers for a points layer, and the buffers layer keeps itself up-to-date automatically as the points layer change, or as the buffer size parameter changes, and this itself cascades down into further dynamic layers.

My initial response was that ModelBuilder could be used to the same end, but it doesn't seem as convenient as how nested queries have been described to me. Personally, I do most of my spatial work in QGIS and SQL Server, and it's been a few years since I regularly used Esri software, so I can't answer with much certainty. Is there any functionality in ArcMap which similarly achieves convenient dynamic analysis?


texts: How to find if a pixel is entirely within another pixel when comparing for example two GeoTIFF raster maps?

texts:
Using GDAL and/or Python
Red: GeoTIFF raster Map layer 1
Blue: GeoTIFF raster Map layer 2


texts: GeoServer/Geoexplorer: How do I hide the WMSLegend on some layers?

texts:
I'm developing with the geoexplorer sdk and extending the composer and am working on the master branch of boundless/suite/geoexplorer. My geoserver version is 2.4-SNAPSHOT.

I want to hide the wmslegend image for some layers.

My immediate thought is to edit the way that the nodes are added into the layer tree groups so that they are collapsable.  Is this something I need to change when the tree panel is instantiated or in the object prototype itself?

As a short run workaround, is there a configuration setting on geoserver that I can change to turn off legend image service?


texts: Buffering and Subsetting with ModelBuilder?

texts:
I am trying to create a tool using ModelBuilder that takes a table of XY data, creates buffers of 1 mile and 0.5 miles around a polygon, selects the XY data that is inside the mile buffer, and copy's the features to a new feature class.

I know I have the correct workflow set up, but when I run the tool I keep getting an error at the Select By Location tool. I'm using the default geodatabase while I'm testing this out. I've tried writing to just a regular folder as well with no dice.

Ultimately my final layers will need to show the half-mile buffer, the mile buffer, and the subset wells.

"ERROR 000229: Cannot open C:*****\ArcGIS\Default1.gdb\CopyFeatures3
Failed to execute (Select Layer By Location)."

It would save me a ton of time if I could get this to work.

Link to the picture: https://www.dropbox.com/s/06t35zpdck56qmw/Untitled.jpg?dl=0


texts: Updating information on the map in ArcGIS?

texts:
I usually do a lot of maps with ArcGIS but I need to dynamize the information about the number of map, name of map, date of map.

How can I do automatically?

I have a template of map with a box in which I need this information.


texts: Converting dataset between coordinate systems

texts:
I'm working with NOAA's PRECipitation REConstruction over Land dataset, and am looking for an efficient way to sample the data by pixels on NASA's MODIS grid, using open source tools. The PRECL data uses 0.5 degree blocks, so I'll have quite a few repeated values.

I'm currently using a mapping generated by ArcGIS that specifies the array index within the PRECL data for every MODIS pixel. This works (and it's fast, as I'm just doing a series of array lookups), but it'd be nice to get away from that extra data set, especially if there were some way to do the transformation in code, without Arc.

Thanks in advance, all!


texts: What does it mean "Source image must have a geo transform matrix" during gdal_translate when I want to export geotiff to .hgt file. I know what a matrix is, but don't know how to make one.


texts: PersistenceHelper checks assembly version?

texts:
In my add-in I use ESRI's PersistenceHelper class to serialize and deserialize objects to the mxd. This class however seems to compare the version of the executing assembly to the version of the assembly that was used saving the stream. If the version is not the same the stream is not loaded and the error below occurs:

System.Runtime.Serialization.SerializationException: Unable to find assembly 'MyAddin', Version=4.11.0.0

If I set the assembly version to a fixed version number it works. This is of course not desirable from a version management point of view. Any thoughts on solving this problem?


texts:
I'm trying to open on QGIS 2.18/3.4.1 the follow layer:

https://services2.arcgis.com/1GTOs4RWV6SKu0wr/ArcGIS/rest/services/Comunidades/FeatureServer/0

Both layer>add layer> mapsource or featureserver

How can I deal with this?


texts: Adding Folium GeoJsonPopup to a function

texts:
I have created a  a function to create a Folium map that has colors scales based on the value,
I am trying to add a option so that when I view/click and that region I could get a popup with the value in it.
So far this is what I have
GeoJson(
        geojson_data,
        style_function=lambda feature: {
            'fillColor': custom_cm(feature['properties']['value']),
            'color': border_color,
            'weight': 1,
            'fillOpacity': fill_opacity
        },
        name = name_layer,
      popup=folium.features.GeoJsonPopup(fields=['value'])
    ).add_to(initial_map_test)

As soon as I add the popup value the maps disappears. Could you let me know what I am doing wrong here?


texts: Filter a shapefile by date in the Query Builder of QGIS

texts:
I have a shapefile that I'm trying to filter by date (i.e. START_DATE). This same query START_DATE = '2007-07-25' works in the Attribute Table > Select features using Expression, but not in the Query Builder (Right-click) where I get this error:

An error occurred when executing the query.
The data provider said:
OGR[3] error 1: Type mismatch or improper type of arguments to = operator.

Is there a workaround this issue to show only the features (vectors) that are of interest to me.

I'm using QGIS 2.8.9 on Windows with GDAL/OGR 2.0.2.


texts: Statistics for point data within each polygon using ArcMap?

texts:
I think this is a pretty basic GIS operation but I'm not sure how to do it.

I have hundreds of polygons, and within each polygon there is point data (see picture). The point data has a field "Type" that can either be A, B, C, D, or E. I would like to determine what is the most dominant Type value for each polygon.

How do I go about doing this using ArcMap?


texts: Large increase in .dbf file size after attribute table join

texts:
I have a polygon shapefile of about 12,000 features that I joined a CSV attribute table to using 'Join attributes by field value' in QGIS 3.2.1

The .dbf file size before the join = 5.6 MB

The .dbf file size after the join = 4.4 GB

The size of the CSV attribute table = 49 MB

Why is the .dbf file size so large after the join? Is there anything I can do about this?


texts: arcpy.Raster.save(*.jpg) - format unknown

texts:
The following Python script returns the error on the final line, "RuntimeError: ERROR 010093: Output raster format UNKNOWN is unsupported.":

import arcpy
inRaster = arcpy.Raster(r'C:/junk/raster.tif')
outRaster = r'C:/junk/out.jpg'
intermediateRas = inRaster
intermediateRas.save(outRaster)

The script runs to completion if outRaster is .tif or ESRI GRID. Why does this not work for .jpg (or .jpeg)? According to the list of supported raster formats, JPEG should work.

ArcGIS 10.2.2


texts: Visualizing roads with curved arrows in QGIS?

texts: I need to show a double arrow at the beginning and end of a road feature. When I use arrow in QGIS 2.18 every intersect has separate arrow like this:


texts: Adding georeferencing data into tiff image

texts:
I want to create a georeferenced .tiff file from a .png file. So I convert the .png into a normal .tiff file using the following command line :

convert image.png image.tiff

Here, all works fine, I have a valid .tiff file, which displays fine. Then, I want to add some georeferencing data in it. To do so, I found a tool called tiff2geotiff, I'm using it like this :

tiff2geotiff -4 "+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs" -c none -n "-122.5575664 38.5818201 -122.5449425 38.5896175" notgeoreferenced.tiff georeferenced.tiff

This gives me a black image which, imported in QGis, displays fine in the good place, except that it's black everywhere (proof that the georeferenced data have been well added).

Therefore, when I do :

gdalinfo georeferenced.tiff

I obtain :

Warning 1: TIFFReadDirectory:Bogus "StripByteCounts" field, ignoring and calculating from imagelength
Driver: GTiff/GeoTIFF
Files: araujo_tmp.tiff
Size is 1585, 979
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-122.557563781738281,38.589618682861328)
Pixel Size = (0.000007966552118,-0.000007972639275)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DOCUMENTNAME=georeferenced.tiff
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-122.5575638,  38.5896187) (122d33'27.23"W, 38d35'22.63"N)
Lower Left  (-122.5575638,  38.5818135) (122d33'27.23"W, 38d34'54.53"N)
Upper Right (-122.5449368,  38.5896187) (122d32'41.77"W, 38d35'22.63"N)
Lower Right (-122.5449368,  38.5818135) (122d32'41.77"W, 38d34'54.53"N)
Center      (-122.5512503,  38.5857161) (122d33' 4.50"W, 38d35' 8.58"N)
Band 1 Block=1585x1 Type=Byte, ColorInterp=Red
Band 2 Block=1585x1 Type=Byte, ColorInterp=Green
Band 3 Block=1585x1 Type=Byte, ColorInterp=Blue

I think the first warning may be the problem...

Is there someone who knows why or another way to do this ? I'm looking for solutions in command line or in PHP.

Thank you !

Solution

I found out gdal_translate can add georeferencing data into .tiff images, so here is the command line which convert from png and add georeferencing data (you have to replace the extents (llx ury urx lly), of course):

gdal_translate -a_nodata 0 -of GTiff -a_srs EPSG:4326 -a_ullr llx ury urx lly pngfile.png tifffile.tiff


texts: QGIS - some edit feature options disabled in vector layer

texts:
I created a new vector layer in QGIS, saving as I went along and then I saved the project and logged out.  When I went back into the project, I wanted to add some more features to the same layer, so selected the toggle editing icon and highlighted the vector layer.  However, not all the options are displaying for me - I can select 'move features' or 'node tool' but can't select the 'add feature' option, for instance.

I took a look at this question which seems to be a similar issue: After re-open of old project file, several layer selections no longer available

As suggested, I tried switching on and off the layers and exiting QGIS again, but so far I can't resolve the issue.

I am relatively new to QGIS.


texts: QGIS not loading default layer style from PostgreSQL database on startup

texts:
I have saved a vector layer style to my PostgreSQL database source. I then amended the layer_styles table record for the relevant layer by editing the styleqml field (just changed the outline_width value for a simple renderer). The useasdefault field is set to true. When I save my project & restart QGIS the layer style does not change. If I then manually edit the layer style properties, select the 'Restore Default' button and select the 'Datasource database' option (see image) the changes are applied. I then save my project and exit. However, if I again amend the renderer XML in the database any changes made are not loaded next restart - i.e. QGIS retains it's last 'local' copy of the layer style and does not read the Datasource version automatically.

The docs say "When loading a layer from the database, if a style already exists for this layer, QGIS will load the layer and its style".

Question

Is this expected behaviour and if so can QGIS instead be configured to always load a layer style from the associated record in the layer_styles table at startup (the behaviour I expected)?

QGIS 2.14.2 (OS X KyngChaos build), PostgreSQL 9.5.1


texts:
I'm quite new to d3 and Polymaps and I have a question to ask..
I am trying to connect two points using a line, using Polymaps and d3, my starting point is from this code that Mike provided https://gist.github.com/mbostock/899670

I have searched and found similar questions, but somehow there's no definite answer or sample code that I could follow. I hope you guys can help me on this..

Thanks!


texts: Appending columns from a table to my active table?

texts:
I am trying to append three columns from srs2016 to srs2013_1 using this sql.

INSERT INTO srs2013_1 (the_geom, agency_responsible, description)
    SELECT             the_geom, agency_responsible, description
    FROM srs2016

The statement fail with this message:

  Syntax error: column "agency_responsible" of relation "srs2013_1" does
  not exist

I have tried adding quotes.  Did not appear to help.


texts:
I have a mosaic dataset with rasters that cover the entire US - One for each county.  When I generate the overviews, there is a chunk missing.  When you zoom in, the imagery shows up.  There are no errors or warnings from the analysis tool and there were no errors or warnings from the generate overviews tool.  I expect that there may be a single raster that could be causing problems and preventing the overview image from generating.  Does anybody have any troubleshooting ideas for me?

I'm using ArcGIS for Desktop Standard version 10.3.  Below is a screenshot of the mosaic dataset as it is displayed in ArcMap.  The green lines are the footprints of each individual raster.  The rasters are .sid files.


texts: Attributes that characterize a geodetic track

texts:
I need a way to index and retrieve a large amount of track data. To do this I need to derive from every track as many attributes as I can. For now, I derive

Name
Tortuosity
Speed (average, max)
Covered Distance
Length (in time)
Bound (min lat/long and max lat/long)
Trip mode (car, bus, plane)
Presence of tunnel (estimated length)

But I need extra ideas, spread your imagination ^_^


texts: Modifying highlight color of identify but from the startup file

texts:
I want to do it in programming, I use PyQGIS.
I was researching what the class uses
qgis.gui.QgsHighlight (mapCanvas:QgsMapCanvas, geom:QgsGeometry, layer:QgsMapLayer)

But I would like to do this from the startup configuration file, the only thing I want is to change the color (setColor).
But I have not been able to instantiate the class only using the canvas.
Is this possible?


texts: Using timestamp field to auto complete source field in QGIS?

texts:
I am trying to use my timestamp field to autocomplete my source field in QGIS using the field calculator. I want my source field to be completed with a saved string e.g "Sam_Sam". I want my source field updated with name each time i create or edit a feature.I have this

CASE WHEN "timestamp"  =  $now  THEN 'Sam_Sam' END.

It's not working

Can anyone can help with something better?


texts: What is approximate error of Pythagorean Theorem vs. Haversine Formula in measuring distances on sphere at various scales?

texts:
Many people when first trying to calculate distances between two longitude / latitude pairs  ask if Pythagorean theorem works as an appropriate distance function.

Most often people answer "no, the Pythagorean theorem only works on a 2D Euclidean plane." Rarely, however, do people mention the effect of scale and location on the sphere on how inaccurate the Pythagorean theorem is.

The basic idea being at very small scales, the surface of a sphere looks very much like a plane. At very large scales, it distances along the surface are more curved and therefore the difference between the incorrect Pythagorean Theorem and the correct Haversine Formula is greater.

Does anyone know a formula or rule of thumb that tells you the difference between the two distance measures based on the scale of the distance you are trying to measure?

I think having this explicitly would help in:

explaining why the Pythagorean Theorem isn't perfect; and
in letting people who are looking for more "rough" distances know when Pythagoras actually will serve their purposes.


texts:
Can anybody give me advice on how to label contours as shown in Figure 2 below? I would like to be able to put the label "on" the line, which is easy enough. But I'd also like for the contour line to have a break in between the label, as shown in Fig. 2. Without the break it is very hard to read the label, unless I use a mask with white background as in Fig 1. Maybe there is some sort of "invisible" masking option that creates the break?? I'm using ArcMap 10.1 on Windows 7 (64 bit)

Figure 1

Figure 2


texts: How did Nova create the globes in Earth From Space?

texts:
Nova recently aired Earth From Space on PBS.  (I highly recommend it.)  Also found here on youtube.

  Produced in extensive consultation with NASA scientists, NOVA takes
  data from earth-observing satellites and transforms it into dazzling
  visual sequences, each one exposing the intricate and surprising web
  of forces that sustains life on earth.

Does anyone know what tools and processes they used to "transform" and display satellite imagery on a global scale?


texts:
Here is how I can retrieve current and future data using the raster package:

Current environment from worldclim

current=getData("worldclim", var="bio", res=2.5)

Future env
future=getData('CMIP5', var='bio', res=2.5, rcp=85, model='HE', year=70) names(futureEnv)=names(currentEnv)

How do I retrieve past LGM environment data from worldclim using an enhancement to the above script?


texts: How to track logged in user in geoserver?

texts:
Is there any way I can track the logged in users in geoserver(somewhere in log file). I have same users in geoserver and tomcat-realm.As I can see what URI are requested, IP address URI requested from, time and other info in access log of apache. But I need to find user name who logged in to request those URI.

Thanks


texts:
I have a GeoPandas dataframe with lines all originating in the same location. I want to partition the lines into segments and merge them to get a dataframe containing all the unique segments.

I tried overlay with union, which seems to solve my described problem. However, this only supports polygons. I am looking for a solution lines.

import geopandas as gpd

lines_gdf = gpd.read_file('input.geojson')
lines_union_gdf = gpd.overlay(lines_gdf, lines_gdf, how='union')

Example input file: input.geojson

Expected output file: output.geojson


texts: Retaining all fishnet grid squares within boundary of polygon from another feature class?

texts:
I have created a fishnet grid (3km x 3km) over a vector polygon.

I now want to clip the fishnet over the vector polygon retaining all grid squares within the boundary of the polygon.

Therefore I want all squares that would typically be clipped into partial squares to remain as whole squares.

Does anybody know how to do this?


texts: Install GDAL on MacOS via Homebrew with Oracle support?

texts:
I'm trying to install GDAL on a Mac so I can use ogr2ogr against an Oracle database. This was as easy as:

brew install gdal

However, it seems the Homebrew edition of GDAL doesn't ship with Oracle support. When I list install options with brew options gdal, I see flags for thigns like MySQL and Postgres but nothing for Oracle. Does anyone know how to build GDAL using Homebrew but include Oracle/OCI support?


texts: Binarise Raster within a range with gdal_calc.py

texts:
I am looking to utilise gdal_calc to batch binarise a few hundred rasters. My problem is in relation to gdal_calc and the correct syntax for --calc to do what I wish to achieve.
Using QGIS Raster Calculator and the following script:

("raster@1" <= -15 AND "raster@1" >= -20)*255

I can achieve the desired result, but I cant replicate this using gdal_calc.

To clarify, I am trying to make all the values between -20 and -15 in the raster = 1 or 255 and everything else = 0, making 0 nodata.


texts:
I'm trying to use a script by python to download MODIS imagery. I follow this script: http://pyevolve.sourceforge.net/wordpress/wp-content/uploads/2009/02/modis.py.
I installed:

  matplotlib-1.3.1.win32-py2.7.exe
  basemap-1.0.7.win32-py2.7.exe

But I can not run this script. It has an Error:

  ImportError: No module named dbflib

I try to google search dbflib module. There are two file dbflib.py:
https://code.google.com/p/geoyard/source/browse/trunk/pyshapelib-0.3.1/dbflib.py?r=5
and:
http://liulele84-le.googlecode.com/hg/src/python/_basemap/PLATLIB/dbflib/dbflib.py

But it does not work. Does have anybody know how to fix this problem? Help me, please. Thanks so much.


texts: "PySAL"python qgis says --- is not recognised as an internal or external command

texts:
while loading hotspot analysis, it gives following 2 error
1. Couldn't load plugin 'HotspotAnalysis' due to an error when calling its classFactory() method
2. ModuleNotFoundError: No module named 'libpysal'

then i tried to add pysal lib using many ways as per community search/suggestion but unable to do. it gives " not recognised as an internal or external command" error.

I am using qgis 3.10.


texts: ArcGIS: Generate Random polygons within a polygon

texts: I have a generic polygon layer, would it be difficult to do subdivide the polygon into sub polygons provided they're all relative of the same area? Let's say divide a polygon into 10 or so sub polygons.


texts: How to address the alias of a sub-query in the where-clause in PostgreSQL/PostGIS?

texts:
I have a problem with a Postgres query and can't find a solution in stackexchange or any SQL Documentation.

I have two tables in PostGIS, one for streets and one for house-numbers. I now want to find the closest given house number to a certain street (for an address search).

In a sub-query I calculated the distance, selected the street name and the number as well as the coordinates. In the where clause I tried to filter the data for the minimal distance. I addressed the subquery with its alias, but get the error that the "relation is not defined", although I just defined it. Any simple solution for that problem?

SELECT * FROM
(SELECT ST_Distance(ha.geom, sn.geom) AS cp
 , sn.nam AS name
 , ha.hnr AS nr
 , ST_AsText(ST_Transform(ha.geom,4326)) AS pt
FROM hausnummern_be AS ha, strassen_be AS sn
WHERE ha.hnr = '1' AND sn.nam LIKE 'Samariter%'
ORDER BY cp ASC) AS xy
WHERE cp = (SELECT min(cp) FROM xy);


texts:
I have a bunch of observations that are in M/d/yyyy format. I would like to create a separate attribute column where each observation is listed by year only. But I can't just select columns by year, as I tried to do by creating an expression in my screenshot.
Is there a way to do this?


texts: Assigning the same graduated style in PyQgis as the Layer property

texts:
I tried to apply the graduated style with color ramp "Blues" in PyQgis and assigned linear interpolation of RGB values with the following code

ranges = []
minval = 1.75
maxval = 6.25
delval = 0.25
minlist = np.arange(minval,maxval,delval)

for i, min in enumerate(minlist):
    # print i, min
    mylabel = str(min)+'-'+str(min+delval)
    r = int((8.0-247)/(len(minlist)-1)*i+247)
    g = int((48.0-251)/(len(minlist)-1)*i+251)
    b = int((107.0-255)/(len(minlist)-1)*i+255)
    mycolor = QColor(r,g,b)
    ranges.append((min, min+delval, mylabel, mycolor))

But I realized when it applies the graduated style from Layer Properties, it is not linear change of RGB values or HSV values. If I set 5 classes, RGB values are

1: (8,48,107)
2: (40,121,185)
3: (115,179,216)
4: (200,221,240)
5: (247,251,255)

and if I plot, they are like this,

How can I set the same RGB values like I do from the Layer property? I am guessing that I should have the information of the color ramp but I don't know where to find it.


texts:
When importing cv2 on Python 2.7 I got this error:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import cv2
ImportError: DLL load failed: The specified module could not be found.

I've downloaded the missing DLLs using dependency walker and added them to the path of cv2.pyd but I had another error:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import cv2
ImportError: DLL load failed: %1 is not a valid Win32 application.


texts: Merging two or more layers using ArcGIS for Desktop?

texts:
I am working with three clipped layers that are shown in the TOC. I created these layers from a large watershed shapefile. However, each clipped layer includes the layer before it and only expands on the one before it.

I was wondering is there a way that I could combine the three layers without using the same features more than once and also at the same time assigning them different values. Pretty much as it is shown in the image that I have provided. How can I assign each clipped layer different values without repeating a feature?

I have tried using the merge tool but then I don't know how to give each features different values.

This may be a little confusing please let me know if you have any questions


texts: Why is this spatialite polygon layer not displayed properly?

texts:
In QGIS, I have a spatialite multipolygon layer that have full objects in attribute table but do not display random ones as I scroll and pan around:

Vietnam map at zoom level 1:16000000 - some provinces missing in the northern part creating holes.

Scroll mouse wheel to zoom closer one level (1:8000000). The northern most province in the view is missing.

Zoom closer to the southern part.

Moving one step closer. The large number of missing polygons make it hard to mark all of them with circles.

When I pan around, the polygons may re-appear at some places and disappear at some others. If I export this layer as shapefile and add to the map, there is no missing polygon at all.

Test data

Does anyone know how to fix this?


texts: ArcPy: Kernel Density Extend (Default + 5000 Meters)

texts:
I in my Kernel Density Loop i want the Processing Extend to be
Default + 5000m

Does anyone know how this might be done?

This is the Code:

import arcpy,os
from arcpy import env
from arcpy.sa import *
env.workspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\shapefiles'
outworkspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\KernelDensity'
fcList = arcpy.ListFeatureClasses ()
for fc in fcList:
    outKDens = KernelDensity(fc,"NONE",500,500,"SQUARE_KILOMETERS","EXPECTED_COUNTS")
    outKDens.save(outworkspace + "/" + os.path.splitext(fc)[0] + "_kd.tif")


texts: Prevent OpenLayers WMS layer cache by browser

texts:
I am using OpenLayers (GeoExt) with google chrome browser. All WMS layer is for live database. I have refreshed the browser at certain interval using javascript but the data is cached in browser and when I refresh web page I see old data. When I clear cache from browser I see new data. How do I prevent caching or clear the cache automatically?

function RefreshPage(Period) {
    setTimeout("location.reload(true);", Period);
}


texts: Interpolation using GRASS plugin in QGIS

texts:
I have been using the IDW interpolation tool through GRASS plugin in QGIS and the interpolation output I am getting is for the entire mapset region.

My question is:
Is there a possibiltity that we can interpolate a certain small region within a given MAPSET region and not the entire MAPSET region ?


texts: Using LAT/LON in Leaflet with Geoserver GeoJSON?

texts:
We're building a simple application that takes the result of a geococde and determines which school boundary the point resides.

I'm trying to figure out if I should be doing this using a paramaterized SQL view in GeoServer which takes in the LON/LAT, or if there is another easier way I have overlooked that can pass the lat/lon to a GeoJSON Service and return the result.

The following SQL works in PostGIS:

select
   elem_name
  , mid_name
  , high_name
 , districtid
  , district

from dpsdata."SchoolBoundaries_All_Projected" as b

WHERE

  ST_Intersects(
      'POINT(-104.81879 39.77850)'
      , b.geom)

But when I use this as the base for SQL View in GeoServer, I get the error:

Failed to create SQL view: ERROR: parse error - invalid geometry Hint: "POINT(' " <-- parse error at position 18 within geometry Position: 476

In the view I have switched the coordinates to:

  ST_Intersects(
      'POINT('%lon%' '%lat%')'
      , b.geom)

...and have tried to declare the SRID using SRID=4326;POINT...

The Leaflet equivalent our developer has found uses the Mapbox/Leaflet-pip (point in polygon) plugin, but that requires the GeoJSON to exist as a flat file in the project folder, which I want to avoid as we update the boundaries on a regular basis, which the GeoServer service would always reflect.

Is there a better way, or again something I have overlooked that is easier than anything above?

Geoserver version 2.10 (just in case the current version might handle this better..)

UPDATE:

Trying to limit the game of cat and mouse with escape quotations, I tried a CTE method, but unfortunately throws a different error:

with
    cte_bounds as (
  select
        elem_name
        , mid_name
        , high_name
        , districtid
        , district
        , geom
      from dpsdata."SchoolBoundaries_All_Projected" b

  )

  , cte_coords as (

    select
        '%lon%'::double precision as lon
      , '%lat%'::double precision as  lat

)

select *
from cte_bounds as b

where ST_Intersects(

    (
      select st_setsrid(ST_MakePoint(lon, lat), 4326)
      from cte_coords)
    , b.geom)

The error this time being: ERROR: invalid input syntax for type double precision: ""

Again, this query works in PostGIS when the %lon% and %lat% values use real coordinates.


texts: QGIS/Python: No comment added to attribute table when using layer.dataProvider().addAttributes

texts:
When adding attributes using the following methods and arguments, everything works correctly BUT not comment is shown in the source section of the layer's properties.

Why is this?

How can add the comment using Python in QGIS?

layer.dataProvider().addAttributes([QgsField("somename", QVariant.String,"String",20,0,"Why does this comment not show up?!")])


texts: Interpolate a new 3D surface between two other 3D surfaces

texts:
I have two 3D Raster surfaces which are flood height surfaces for two different flood heights. They each have XYZ coordinates.  I now wish to generate a third surface BETWEEN these two surfaces at particular heights related to the Reference Flood Gauge.  Can anyone advise what would be a suitable method?
Surface(top) is the flood surface at a level (say) 10.2m on the gauge and surface(bottom) is at (say) 7.68m.  The surfaces extend many kilometres upstream and downstream and are (certainly) not parallel to each other (i.e. the height difference at each Raster point is (mostly) different from the next Raster point).
And I want to end up with a “smooth” looking interpolated surface (i.e. there should be no unusual “peaks” relative to the other surrounding points.
I also have a third Raster layer being the DEM for the ground surface.


texts: rasterFromXYZ, which corner is selecting?

texts:
I am using the rasterFromXYZ function of the package raster because I want to convert a xyz (lon, lat, value) .csv file into a raster file. In the .csv, I have the information of the bottom left hand corner of the grid cell, but when I apply the function there is no argument to specify this information.

Which corner is selecting the rasterFromXYZ funtion? How can I specify a different one?

The code I am using is:

df <- df <- data.frame(x = a$lon,
             y = a$lat,
             z = a$fh)

ps_raster <- rasterFromXYZ(df, res=c(0.01,0.01),crs="+proj=longlat +datum=WGS84", digits=5)


texts: Error in  arcpy.SelectLayerByLocation_management

texts:
I am writing a Python code and have trouble adding a layer to the program. I face this problem below:

Traceback (most recent call last):
  File "G:\arcpy workspace\python learning codes\loc.py", line 5, in <module>
    arcpy.SelectLayerByLocation_management('inf1', 'WITHIN_A_DISTANCE', 'inf2' , '5000 Meters' , 'NEW_SELECTION')
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcPy\arcpy\management.py", line 4381, in SelectLayerByLocation
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000824: The tool is not licensed.
Failed to execute (SelectLayerByLocation).

What's the problem with adding a layer or anything else that makes it go wrong?


texts: Using same layer for multiple tools in modelbuilder

texts: I'm using modelbuilder to do some basic tasks (clipping, dissolving, etc) on several layers related to land cover and land use within a certain watershed. The way I have the model set up now, the watershed boundary has to be a separate parameter for each layer that I'm processing. However, I'm wondering if there is a way to reference the watershed boundary as a parameter only one time to avoid having 5 parameters that are exactly the same. This model needs to be used in multiple watersheds, so the watershed boundary layer has to be a parameter.


texts: Which tools integrate Leica zeno 5 gps handhelds into ArcGIS?

texts:
What other software can I use with my Zeno 5 gps handheld device from Leica geosystems except the one they offer that integrates with ArcGIS desktop?

They suggested the 'Zeno office' and the 'Zeno field' or this software http://www.microsurvey.com/products/fieldgenius/price2007-canada.htm and the 'Zeno connect'.

It wasn't clear on the website that you have to buy this extra software so that the zeno 5 gps device will function properly. From my experience I know that when you buy a gps handheld device you don't need to buy extra software to display your position, the satellites, your accuracy, your lat and lon in a user interface. Is there a less expensive alternative software I can purchase and install in this device?


texts: Create loop that calculate new images from imagecollection based on different bands

texts:
I have imagecollection from sentinel 1 and I would like to create function that wil calculte new rasters based on a model that I have.
my imagecollection called FrostDB and I want to create new imagecollection based on the bands that each image in FrostDB has.

The idea is to:
1. take the two band- VV and VH
2. calculate new band for each image called NRPB ,based on VV and VH
3. take all those 3 bands and calculte new image
4. get new imagecollection which is based on this model.

I have built kind of "draft" for it but I don't know how to tell GEE to take those bands and do it for each image

var model=FrostDB.map(function(im)){
  //////for each image:
  //take the band:  im.VH select('VH_sum');
  //take the band VV im.VH select('VV_sum');
  //Calc  'NRPB': VH.subtract(VV).divide(VH.add(VV)).rename('NRBP')
//take those calculation and for each image calc:
  // '2.13-(-0.5094*VH)+(0.34*VV)+(3.25*NRPB)', {
  //   'VH': imgFrost.select('VH_sum'),
  //   'VV': imgFrost.select('VV_sum'),
  //   'NRPB': VH.subtract(VV).divide(VH.add(VV)).rename('NRBP')
  return im;
});

My end goal: to get new image collection based on the 3 bands (when one of them is calculated also inside the function)


texts: 30m/10m/1m resolution DEM for microtopography research

texts: I am conducting research in a region of Illinois that does not have a LiDAR dataset. I am looking to develop a fine scale habitat species distribution model; however, the coarse data available (30m/10m) does not capture the microtopography of my study area. What recourse do I have in this situation? Can the 10m DEM be re-sampled perhaps to more accurately reflect the actual landscape? Should field surveys be employed in addition to re-sampling?


texts:
When building a single georeferenced image from a collection of tiles, gdalbuildvrt followed by gdal_translate is much faster than gdal_merge.py.

In my own measurements of

gdal_merge.py \
        --config GDAL_CACHEMAX 3000 \
        --optfile filelist.txt \
        -o $output_file

and

gdalbuildvrt \
        -input_file_list filelist.txt \
        $tmpdirname/out.vrt
gdal_translate \
        $tmpdirname/out.vrt \
        -of GTiff \
        $output_file

on a collection of 46 GeoTIFFs of 600×600px each, I got over 30min vs. 1min 58s.

It seems strange that the detour via a virtual dataset is so much more performant. Does it have any downsides?

When should I use gdal_merge.py instead, anyway? (And if there aren't any cases for that with gdal_merge.py's current implementation, why isn't gdal_merge.py instead just implemented as an alias to these two actions?)


texts: Is there a way to find out which pixel values are around the current pixel?

texts:
I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on.

Is there in arcpy such a function which can work with pixel's neighborhood?


texts: Select a polygon which is just partly member of another polygon with its area of the other polygon

texts:
I need to generate random points within geometries, which works quite good, but there are some small errors. Take the picture below. There are some greenish and redish Polygons(?!) which do not have any points in it, but they should. My questions is why?

To be more specific about what I do:

My Code uses python shapely to generate the points within polygons
It weights the area (green = residential) with 50%, so that more points are generated in the red (industrial), yellow (retail) and turkis (commercial) areas.
The Polygons are take from OSM
The points represent an end point of a commuter route

So are there any functions etc I can run on the polygons so that there are points generated in them? My guess is, that they are not vaild.

UPDATE

Okay I found the problem. As you can see below the areas of interest are split. Meaning that they have parts that belong to another community. The Query I use to find the Geometries within a community looks like this:

CREATE TEMPORARY TABLE living_areas ON COMMIT DROP AS
SELECT
 way as geom,
 CASE WHEN p.landuse = 'residential' THEN (0.5*ST_Area(way)) ELSE ST_Area(way) END AS area
FROM de_osm_polygon p
INNER JOIN de_shp_{shp!s} s ON (s.rs = %(rs)s AND ST_Within(p.way, s.geom))
WHERE OR landuse ='industrial' OR landuse='commercial' OR landuse='retail'

What must I change in this Query to either get the whole polygon that also is part of another community or just the part that lies within the community?


texts: How to display TileWMS layer 0-360 degrees

texts:
i receive from geoserver TileWMS layer that have extent from 0 to 360 degrees, and when i load this layer on map i can see only part of layer, becose my map have extent from -180 to 180 degrees. How i can reprojecting this layer?

source layer on geoserver

when i load layer on map


texts: Adding layers and visualizing data simultaneously from both

texts:
I am having a trouble showing data from a second level.

For example, I have joined my two data sets with matching row: Community districts in NYC.
The first layer has a thematically shaded map of jail population per community district.
I want to then add a layer of proportional dots on top of this existing layer that references another column (i.e. % spanish speaking)

How can I add the second layer and not take away the bottom thematic shading.


texts: Determining height of raster class from DEM?

texts:
I have a raster layer with 2 already determined classes: Low vegetation and High vegetation.

They don't mix, there is a characteristic border between them.

It's a typical situation of altitudinal zonation in the mountains.

I would like to determine height a.s.l. of this border based on a DEM that I have as a different layer. It would be easy just clicking along the line and writing down the DEM pixel value, but the whole point is that I need an automatic process to determine a high amount of borders. Is it possible to do?

I work with ArcGIS mostly.

The result I would like to get is any kind (vector/raster) of a line with height statistics I could interpret, so just a plain vector won't work here.


texts: Linear regression - water column correction

texts:
I am curious what the best way is to do a linear regression between depth (y) and b2/b3 radiance (x). My goal is to derive the slope and y-intercept to plug into the equation z = m1*ln(b2/b3) - m0 [m1:slope, m0:y-int].
How do I plot the depth and corresponding reflectance in blue/green in a linear regression to get slope/y-intercept?
//Import images
var s2 = ee.ImageCollection("COPERNICUS/S2_SR");

// Cloud processing
// Bits 10 and 11 are clouds and cirrus, respectively.
var cloudBitMask = ee.Number(2).pow(10).int();
var cirrusBitMask = ee.Number(2).pow(11).int();

function maskS2clouds(image) {
  var qa = image.select('QA60');
  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0).and(
            qa.bitwiseAnd(cirrusBitMask).eq(0));
  return image.updateMask(mask);
}

// 2020 Cloud masked image
var cloudMasked_2020 = s2
  .filterDate('2020-01-01','2020-12-30')
  .filterBounds(Belize1)
  .map(maskS2clouds)
  .select(['B2','B3','B4','B5','B6','B7'],['blue','green','red','nir','swir1','swir2'])
  .median()

Map.addLayer(cloudMasked_2020, {bands: ['red', 'blue', 'green'], max: 2000}, '2020');

//---------- CALCULATE REFLECTANCE VALUES --------------
// get reflectance values at a particular point (geometry)
var pixelVals5 = cloudMasked_2020.reduceRegion(
    {reducer: ee.Reducer.toList(), geometry: depthFive, scale: 2000});

var pixelVals10 = cloudMasked_2020.reduceRegion(
    {reducer: ee.Reducer.toList(), geometry: depthTen, scale: 2000});

// extract reflectance for blue band
var reflectance5_b2 = pixelVals5.toArray(['blue']).multiply(1000);
var reflectance10_b2 = pixelVals10.toArray(['blue']).multiply(1000);

// extract reflectance for green band
var reflectance5_b3 = pixelVals5.toArray(['green']).multiply(1000);
var reflectance10_b3 = pixelVals10.toArray(['green']).multiply(1000);

//divide blue/green and then calculate log (log(b2/b3))
var blue_div_green = (ee.Array.cat([reflectance5_b2.divide(reflectance5_b3),
                      reflectance10_b2.divide(reflectance10_b3)],1)).log()

// import depths from ground-truth
var depths = ee.Array([[5,10]])

// concatenate depths with blue/green ratios
var all_depth_reflectance = ee.Array.cat([blue_div_green,depths])

This is a link to my script: https://code.earthengine.google.com/5eb66d2431f46780619653e684ba8249
I am also curious if there is a better way to do this.


texts: How to add buttons to QT ui for qgis feature forms to loop through attributes?

texts:
I'm looking for a bit of guidance.

I'm happy creating a standard feature form using QT designer (as excellently documented here) for QGIS but I was wondering how you add a forward and back button to a feature form, so that it would loop through all the identified features in QGIS?

Below is a mockup of what I'd like to achieve but need some help. You'll see that I haven't added in any 'line edits' in my tabs and that was purely to produce a mockup for the purposes of this question.


texts: Multi-ring buffer (Constant distance) selecting features in another layer

texts:
I have used the multi-ring buffer to form a buffer area of 10, 20, 30, 40 and 50 metres from a road. However I am struggling to select features from another layer (trails). My aim is to count all the trails within 10 metres of the road then 20 metres from the road and so on.

However I cant seem to do this as I select the 10 metre region of the buffer for example and the only feature highlighted is the buffer zone it self.


texts: Multishading: bring them together to one Raster-Image

texts:
I made a multi-hillshade with 4 different light-directions and colors and stacked one above the other, each with its own transparency. Now I want to "save" the result in one raster-image.

What's the best way to do that? And is that the "right way" or are there alternatives?


texts:
Is there a simple way that I can access the coordinates (according to my used projection) and make them visible, like

console.log(currentX+" "+currentY);

?


texts: Is there any open-source object-oriented GIS?

texts:
Most GIS are layer based. But I am looking for open-source object-oriented GIS. Is there any out there?

By object-oriented I mean logical data model for vector GIS. Here's explanation of my definitions.


texts: I generated the next DEM abd Orthomosaic and I am interested in extract the highest point of each building, is there any workwflow that I could implement in QGIS or SAGAGIS


texts: Downloading contextual GIS layer using QGIS

texts:
I am using QGIS 3.16 and I want to use a raster layer for analysis. The layer is available only through WMS service. I want to use the raster image with SCP tool for further processing and analysis.
I am able to save the layer but with a reduced resolution. Moreover, the information regarding the band is missing in the exported image.
The wms service is https://bhuvan-vec2.nrsc.gov.in/bhuvan/wms and the layer is lulc:WB_LULC50K_0506


texts: Creating ensemble and aggregates from netCDF using PostGIS

texts:
I have downloaded climate forecast raster data in NetCDF 3.6 format for a series of models and time resolution of one day. The data is one file per model. Eventually, I would like to have an ensemble file with aggregated data over the time axis, e.g. monthly or quarterly. Maybe it gets clearer when I just list some names of the files I have:
rcp85_CNRM_CCLM_RR_daily_mm_2100.nc
rcp85_CNRM_RCA_RR_daily_mm_2100.nc
rcp85_EC-EARTH_CCLM_RR_daily_mm_2100.nc

I expect all the files to have the same extent and resolution; gdalinfo excerpts of arbitrary two files https://pastebin.com/UtxXDDGp support my assumption.
I am completely new to PostGIS.
I assume that the ensemble would just be the arithmetic average, but I do not know how to average the "payload" axis of rasters over different layers nor over its time series/bands.
I have not been able to find guidance on ecosia.org or the documentation and also tried to employ QGIS for this, but I am stuck there as much as I am with PostGIS.


texts: How accurate is the Garmin GLO in Saudi Arabia. I know they mention a 3m accuracy but is it achievable in Saudi Arabia. And is there a way to increase this accuracy. I require it to be around 0.5-1m. Perhaps a way to use the GLO device in a differential gps setup.


texts: Mapping coastline geometry with SRTM raster?

texts:
Working on a map that includes a bathymetry layer, SRTM data for hillshade, and an accurate coastline boundary edge. I noticed though that the pixel resolution of SRTM 90m resolution creates visible blocky edges when zoomed in (this screenshot equates to z12/13 in web mercator zoom levels).

This is in Alaska, approx. latitude 57°N.

Are there any cartography or editing techniques I could use to clean this up?

Either in clipping the data or in smoothly transitioning the edges to the coastline?

Another example dataset (not SRTM but a DTM of the same area) overlaps outside the coastline edge, similar problem:


texts: With a WMS server Url, how to know it is a Web map service or a Web map tile service?

texts:
I need to add wms map in my project, and the url of wms server will be provided by users.

Are there any ways to know the type of server (wms or wmts) with the url proposed by users ? Or to know that the server supports tiles or not ?

I want to know this because in Openlayers3, there are two functions to getMap: ol.source.ImageWMS and ol.source.TileWMS. I think I need to know the type of server before calling the right function ol3.


texts: Rename the resulting layer of a QGIS model within the same script with PyQGIS

texts:
At the end of my processing model, it runs an "Add geometry attributes" operation. I want the resulting layer to be named "Overlap" instead of the default "Added geom info." How should I insert the renaming process in the same script?
This is the start of the model
def processAlgorithm(self, parameters, context, feedback):
        feedback = QgsProcessingMultiStepFeedback(4, feedback)
        results = {}
        outputs = {}

This is the end of the model
alg_params = {
            'CALC_METHOD': 0,
            'INPUT': outputs['DissolveOverlap']['OUTPUT'],
            'OUTPUT': parameters['MeasuredOverlap']
        }
        results['MeasuredOverlap'] = processing.run('qgis:exportaddgeometrycolumns', alg_params, context=context, feedback=feedback, is_child_algorithm=True)
        return results


texts: Do vertex IDs stay the same every time I run osm2po?

texts:
Does anybody knows if vertex (source, target columns) in osm2po tables are always the same?

I have my dr_2po_4pgr table with routing data and dr_matrix with routes already made. In this table I have source,target,cost columns. This is for avoid pgrouting functions that penalize the performance (I need to make many calls to these functions).

My question is, if when I generate an updated dr_2po_4pgr (osm2po routing table) table  with a new osm file should also update my table dr_matrix or if source,target id's are always the same.

Thanks in advance!!

Pd: excuse my english


texts: ArcGISDynamicMapServiceLayer is not refreshing properly

texts:
I have a DynamicMapServiceLayer that I am refreshing every 30 seconds. I want the data in the map to refresh every 30 seconds too but it doesn't appear to be working properly.

The map refreshes but then the service goes away and I just see a blank map. The service will stay off for about 20 seconds then come back on again. My code is here too...Is there a way to keep the service on all the time and still refresh it or make it so it doesn't go away?

Thanks in advance!

var map;
    require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer"], function (Map, domReady, ArcGISDynamicMapServiceLayer) {
        map = new Map("mapDiv", {
            center: [-56.049, 38.485],
            zoom: 2,
            basemap: "streets"
        });
        var liveLayer = new ArcGISDynamicMapServiceLayer("http://server/MapServer",
        {
            refreshInterval: .5,
            disableClientCaching: true
        });
        console.log(liveLayer);

        map.addLayers([liveLayer]);
    });


texts: I have a multi-line text attribute in one of my layers, but when I try to display the data using the 'add table' function in Composer, it just gives the text a single line, not enough room to fit. Have I got some setting wrong, or is this just a bug?


texts: qgis Semi automatic classification pluggin how to add text to rows in attribute table

texts:
I want to use a previously created shapefile as Training shapefile in the semi automatic cassification pluggin. Therefore i added 4 fields to this shapefile: Macro_ID (int), MCl_info (text), Class_ID (int), Class_info (text).
I could fill the int fields with the numbers but now i need to place the text into the others. It is exactly the same for all my 200something fields. I can not find a way to do it other than writing it manually. How can i automatically fill all fields of a row with the same text?


texts: World Mercator Projection with Chucotka region in right part?

texts:
How can I choose or modify World Mercator projection to display eastern part of Chucotka region in the right part of the map? I have already tried to change the parametr +lon_0, but the map looks like in the picture.

user projection parameters

+proj=merc +lon_0=+10 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs


texts: r - Can dplyr::group_by work with sf::st_intersects

texts:
Trying to combine dplyr::group_by and sf::st_intersects to see which of the objects within groups in a sf dataframe are intersecting with each other but in the end all objects are compared with all objects in the dataframe irrespective of the groups.

It would be very useful if there is another option package/baseR to do this and limit the comparison of objects within the dataframe and only within a specified group.

Below I have done:
1. create a LINESTRING and a POLYGON
2. used sf::st_intersection to find parts of LINESTRING in the POLYGON
3. convert to LINESTRING
4. check which of the LINESTRINGs are intersecting with each other

library(sf)
library(dplyr)

# sample data
poly <- data.frame(lon = c(-3.5, -1.5, -1.5, -0.5, -0.5, 1, 1, 1.5, 1.5, 7, 7, -3.5, -3.5),
               lat = c(0, 0, 1, 1, 0, 0,1,1,0, 0, 2, 2, 0),
               var = 1) %>%
st_as_sf(coords = c("lon", "lat"), dim = "XY") %>% group_by(var) %>%
summarise(geometry = st_union(geometry), do_union = F) %>% st_cast("POLYGON")

line <- data.frame(lon = c(-4, -3, -2, -2, -3, 2, 2.5, 2, 2), lat = c(0.5, 0.5, 1, 0.5, 1, 0.2, 0.3, 0.4, 0.1), var = 1) %>%
st_as_sf(coords = c("lon", "lat"), dim = "XY") %>% group_by(var) %>%
summarise(geometry = st_union(geometry), do_union = F) %>%
st_cast("MULTILINESTRING")

# calculating intersection of line with polygon
inters <- st_intersection(line,poly) %>% st_cast("LINESTRING")
inters <- inters %>% mutate(var = c(1,1,2,2,2,2,2,2,2,2,2))

# trying to see which of the linestrings intersect with each other
inters$flag <- inters %>% group_by(var) %>% st_intersects()

This should calculate the intersections between the first two LINESTRINGs separately and between the last 9 LINESTRINGs separately. So intersections of the first LINESTRING with any of the LINESTRINGs from 3 to 11 shouldn`t be calculated.


texts:
In my vector layer I want to select points within a buffer of 12 meters and with an exception (if 'Name' is not "James" than select).

Is this possible with "select by expression"?


texts: Filtering user asset FeatureCollection by column containing date using Google Earth Engine

texts:
I am trying to filter imported AIS data (https://marinecadastre.gov/AIS/) by time, as ground truth for ship detection using SAR images. The imported CSV stores the date in a column ["BaseDateTime"], which can be shown in the bottom image and GEE code link. The format seems to be yyyy-MM-dd'T'HH:mm:ssZ.
My problems are the following:

GEE doesn't let me simply filter something in a "column" that isn't a "property" of a FeatureCollection
The "BaseDateTime" values are not in ee.Date format, so reducing by column is difficult.

How do I select the AIS points that would correspond to the time a SAR image was taken?

Link Code: https://code.earthengine.google.com/ec4c3c9f7f983cc99ed3daee44f47bf5
//////////////////////////////////////////////////////////////
//SAR Data
//////////////////////////////////////////////////////////////////////
var dataset = ee.ImageCollection('COPERNICUS/S1_GRD')
                  .filterDate('2020-06-30', '2020-07-01')
                  .filterBounds(roi)
                  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
                  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
                  // Filter to get images collected in interferometric wide swath mode.
                  .filter(ee.Filter.eq('instrumentMode', 'IW'));

var listOfImages = dataset.toList(dataset.size()); // 29 images

//////////////////////////////////////////////////////////////////////
///AIS
//////////////////////////////////////////////////////////////////////

//Importing Feature Collection

var ais = ee.FeatureCollection('users/sheilababer/AIS_2020_06_30').filterBounds(roi);

Map.addLayer(ais);

//Treating "BaseDateTime" as a Property yields errors:

var dayRange = ee.Number(0.08) //wanting the AIS data to be within 2 hours of SAR

var feats = ais.map(function(feat){
  feat = ee.Feature(feat);
  var date = ee.Date(feat.get('BaseDateTime'));
  var dateRange = ee.DateRange(date.advance(-(dayRange/2), 'day'), date.advance(dayRange/2, 'day'));
  var image = dataset.filterDate(dateRange).mean();
  var data = image.reduceRegion(ee.Reducer.first(), feat.geometry(), 500);
  return ee.Feature(feat.setMulti(data))
});

var date_col = ['BaseDateTime']

//Trying to reduce the feature collection by column also yields errors,
//probably because date is parsed as a string:

print(ais.reduceColumns({
  reducer: ee.Reducer.mean(),
  selectors: ['BaseDateTime'],
}));

print(ais['BaseDateTime'])


texts:
I'm trying to load a GeoJSON file in to my Leaflet map and can't see what's going wrong. From looking at other questions I've used jQuery Ajax to call the geojson. The GeoJSON is in the same directory as the HTML.

This is the Ajax query i'm using

var geojsonLayer = new L.GeoJSON.AJAX("gtd.geojson");

These are the error messages I'm getting from Google Chrome:

Uncaught ReferenceError: polygon is not defined
leaflet.ajax.min.js:1 XMLHttpRequest cannot load file:///E:/Pure%20Test/gtd. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.(anonymous function) @ leaflet.ajax.min.js:

This is my code:

<!DOCTYPE html>

<title>Global Terrorism Attacks </title>
<meta charset="utf-8" />

<link rel="stylesheet" type="text/css" href="css/own_style.css">
<link rel="stylesheet"     href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />

This is the first map I've made with Leaflet


texts: Steps to view SAR imagery (SICD) in QGIS

texts: I would like to view SAR imagery in a SICD file in QGIS.  I am able to load the file and view it as a singleband gray image, but the image does not look correct - features are not detectable and the image looks grainy.  I've worked with the min/max adjustments, but that hasn't helped.  I've seen posts of others using SAR imagery that look great and the text simply says to load the image and then details are given for further processing.  Could someone please provide the necessary steps to load SICD images in QGIS?


texts: QGIS GUI windows won't fit in the screen when using X server

texts:
I am using Xming to access QGIS GUI and have difficulties as some windows just won't fit in the screen and there is no option to resize them so after making some changes in a particular menu/window I can not see save button. Attaching print screen where settings window is visible (while main window is in the background):

Also sometimes windows fit in the display and save/action buttons are visible.
Update: when trying to move window with Windows move option the windows becomes just blank.


texts: Get shapefile from ArcGIS online for QGIS

texts:
How do I download shapefile information from ArcGIS online and access it in QGIS. An example shapefile that I would like to obtain is linked below:

https://morgancountyco.maps.arcgis.com/apps/Solutions/s2.html?appid=c3891aec54f04f29b8d1da10a5c6afbd


texts: Removing all pixels at apprx. ground level in orthomosaic?

texts:
At the moment I am processing an orthomosaic from a plantation and I would like to remove all pixels at ground level to just keep the plants captured on the image.

I would prefer to be using QGIS.

I created the orthomosaic in Agisoft Photoscan by using aerial multispectral imagery.


texts: ArcGIS javascript, convert Graphic to Polygon

texts: I am trying to call GeometryService.autoComplete which has Polygon[] as the first parameter. In my case, I would put the all of the features of my featureLayer. The only property that would seems to work is featureLayer.graphics which contains geometries. But I haven't been able to convert them to Polygon... Is there any way?


texts: Can a geoprocessing service be added to an ArcGIS Online web map/app?

texts:
My question is very similar to Publishing Geoprocessing Service to ArcGIS Online, and is almost but not completely answered by Brad Posthumus as the top answer. Following from that, basically I want to know if a geoprocessing service that has already been published to ArcGIS Server (providing a REST URL) can be consumed by/added to an ArcGIS Online web map or app.
According to Esri, a "geoprocessing service (URL)" can be "use[d] in web [and desktop] apps", but it's not clear if that includes ArcGIS Online web apps. I can't find an option in AGOL web map or web app builder that allows you to add these.
At Use geoprocessing services from ArcGIS Online in Esri's documentation it says "using the REST URL specified in ArcGIS Online, you can incorporate geoprocessing functionality in your web applications" but doesn't elaborate.
My previous experience has been with authoring and sharing GP tools to other desktop GIS users via custom toolboxes. I'm trying to do something similar in AGOL for non-GIS users.
To be clear, I'm not asking about the Portal/web tools/GP widget workflow, this is specifically about AGOL.


texts: Why can't I open a .xls with QGIS in OSX?

texts: I'm trying to open an .xlswith QGIS 1.8 in a Mac, I'm loading the vector layer from Add new vector layeretc. etc. the procedure works in Windows but not in Mac where I have an error Invalid source file. Where is the problem?


texts: Problem between files with same coordinate reference system

texts: I have 2 shape-files. The first created with Qgis and the other with R studio(driver=ESRI). When I import them in qgis i see they doesn't "fit". Both have EPSG:4326 - WGS 84. The only difference I have noticed is that the second file from R studio doesn't have .qpj file. I know that whenever QGIS finds a .qpj file it will be used instead of the .prj (http://docs.qgis.org/2.6/en/docs/user_manual/working_with_vector/supported_data.html). Is there someone who can help me to find if this file is the problem? What I get with EPSG:4326 - WGS 84 for both files is this:


texts: Is there an escape option for single quotes & apostrophes in QGIS?

texts:
I'm trying to use the Data Defined symbology in QGIS ver 2.2. Some of my data has single quotes/apostrophes.

Since the string must use single quotes, is there an escape option I can use for the field calculator or for the data defined settings field?

So, I'm trying to use something like this:

CASE
WHEN "NAME" = 'WILSON'S' THEN '0,75,224'
END

How do you build an expression around a string that may have a single quote or apostrophe?

Thanks.
QGIS Valmiera 2.2
Windows 7 - 32 bit


texts:
I am using ArcGIS 10.4.1

I have a 50% shaded dem layer on top of a hillshade layer. The colors look nice, but I have a lake I want to display as blue in the dem, which I don't know how to color properly.

I guess if the lake would have been at sea level this would have been a simple task, but when the lake is at 50 meter height, I don't know what to do.


texts: Esri basemap render speed abnormally slow in Chrome

texts:
Summary of Issue:

In my project, using the oceans basemap from Esri is very slow to render when zoomed in very close (for Chrome only). Topo is also slow at high zoom levels, but it is bearable in comparison to oceans.

Using Chromes developer tools to look at the Network timing for the tiles reveals some are waiting 400+ ms, but this is also the case for topo so that's not too helpful.

Profiling using the Timeline tool shows that painting takes considerably longer with the oceans basemap.

You can try it yourself quickly in the sandbox by replacing "topo" with "oceans":
http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=map_simple

Question:

Is there anything on my end that I can do to optimize this in Chrome?


texts: Could not create print device error when exporting georeferenced PDF QGIS 3.16.5

texts:
I am having an issue exporting a georeferenced PDF using QGIS version 3.16.5. So far the google search to fix the problem has not been successful. Using on Windows 10 64 bit. I have a limited knowledge of how QGIS functions (and coding in general), but up until receiving my new computer last week was able to use the georeferenced PDF export function with no issues.
I am trying to export a limited view (3 km by 4 km max) of a map that contains the Bing basemap, a orthophoto.ecw, and one shapefile. I keep getting a 'could not create print device' when trying to export a Georeferenced PDF.
I started with version 3.18, so I uninstalled and reinstalled 3.16. I made sure that all of the updates required on my computer were up to date. I have tried exporting on a different computer using 3.16. I am using the same mapfile (project) and map layout template, basemap, orthophoto, and shapefile as a co-worker who has no issues exporting georeferenced PDFs.


texts:
Are there any services besides the NOAA that offer weather radar imagery for free? Some of the issues our users have with the images from  nowcoast/radar_meteo_imagery_nexrad_time are the colors and the resolution of the images.

https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/


texts: select layer by area of overlap with another polygon

texts:
I am working in ArcGIS Pro. I have a polygon (chartreuse) with a fishnet grid laid over it (burnt sienna).
I would like to select those polygons from the burnt sienna fishnet whose areas are greater than 80% contained within the chartreuse polygon.

I am returning to ArcGIS after many years away. It seems like an SQL query to me, but I don't know how to say "which overlaps 80%"... actually, I don't know how to SQL query in ArcGIS yet, BUT I've been doing lots of coding in R, so I think I could figure it out and probably even the python code if I needed to.

thanks for any guidance!!!!


texts: Propagating mouse wheel event in OpenLayers 3 overlays

texts:
I'm implementing a mapping application with OpenLayers 3.

When there are too many overlays on the map (say you had to add too many location pins - see picture below), certain parts of the view-port have little or no space that will receive the mouse wheel events (i.e the overlay pins do not propagate the wheel events to the map) and the user thinks that his/her interaction is blocked.

How can I prevent this?

Simply put: I put a simple image as an overlay on a map and the mouse wheel event on that image is not propagated to the map, therefore the interaction ol.interaction.MouseWheelZoom is not triggered.


texts: Why does PostGIS throw an rt_raster_iterator error: "The set of rasters provided do not have the same alignment" when using ST_Clip?

texts:
I'm using PostGIS to calculate statistics on vector and raster data. The raster data is stored tables with one 128x128 pixel tile per row. I'm seeing an error when comparing clipping certain polygons to certain raster tiles. In a dataset of roughly 10 million polygons, the error occurs a few dozen times. Why is this error occurring? What's the fix?

I've created a minimal example that reproduces the error:

with a (rast) as (values('0100000100756F1820CBD6E23E1D701820CBD6E2BEA14D8090536055C09D958109C1BA3E4000000000000000000000000000000000AD10000001002200020001010101010101010101010101010101010101010101010101010101010101010101'::raster)),
     b (geom) as (select st_setsrid(st_geomfromtext('POLYGON((-85.5046457277349 30.7311595527075,-85.5046492027152 30.7294850816075,-85.5051002810699 30.7294907086655,-85.5050985678614 30.7303174886974,-85.5050968186801 30.7311624161489,-85.5046457277349 30.7311595527075))'), 4269))
select st_clip(rast, geom, true)
from a, b;

This yields the following error:

ERROR:  rt_raster_iterator: The set of rasters provided (custom extent included, if appropriate) do not have the same alignment
CONTEXT:  PL/pgSQL function st_clip(raster,integer[],geometry,double precision[],boolean) line 8 at RETURN

The example raster data was generated with ST_MakeEmptyRaster, and ST_AddBand, so I don't think the problem is related to corrupted data. Running other operations on this example raster (and the original data) works fine. For example, here's the output from ST_Summary:

Raster of 1x34 pixels has 1 band and extent of BOX(-85.5051003697358 30.7292025857055,-85.505091386583 30.7295080129021)
band 1 of pixtype 4BUI is in-db with no NODATA value

At least some of the time, the error goes away if a raster tile is unioned with neighboring tiles.

This occurs on both OS X and Windows, and in CARTO. PostGIS version info:

POSTGIS="2.4.3 r16312" PGSQL="100"
GEOS="3.6.2-CAPI-1.10.2 4d2925d" PROJ="Rel. 4.9.3, 15 August 2016"
GDAL="GDAL 2.2.3, released 2017/11/20"
LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER


texts: How can I 'fill in' the sea in a DTM raster in QGIS

texts: I am using OS Terrain 50 data, mosaicked with R, to make some nice 3D maps using Rayshader. However, for coastal and island areas, there are large gaps where the sea is. How can I easily fill these in in QGIS to prevent gaps in my rayshader model? Screenshot below of what I mean.


texts: Locating flooded area by creating buffer with elevation around points using ArcGIS Desktop?

texts:
I have a shapefile with points, that each have an elevation in their attribute tabel, based on how high the water level is, at a given return period. I need to create a buffer around these points at 50 m, that needs to dissolve into one shape using the highest attribute along the points at the overlaps.

Then I need to see if this buffer/waterlevel is higher than the surrounding terrain, thereby giving an indication if the area will be flooded.

Is this possible using ArcMap Standard (With Spatial Analyst, 3d analyst and ArcHydro)?


texts: (How) do the modifiable areal unit problem and modifiable temporal unit problem interact?

texts:
I am reconstructing historical time series of land use and other related data from a variety of sources with different spatial and temporal resolutions and would be interested in what possible (hidden) problems could arise when aggregating and combining the data.

I am especially curious about the ecological fallacy and whether choices in the aggregation of temporal data affect change of support in the spatial dimension and vice versa?

References to literature are fine, but I am more interested in examples of how those interactions would arise if at all.


texts: I am looking for the equivalent of the ATS fabric for Ontario (shapefile). The ATS fabric in Western Canada is quite easily found online, but I can't seem to find any good data for Eastern Canada, Ontario in particular. I'm willing to pay for the data, but does anyone know which vendors would have this data, instead of going to them and asking one at a time?


texts: Converting SQL Server Rasters to ASCII Grid?

texts:
I have 25km by 25km squares of the world in a relational database. Each square has coordinates for the top left and lower right corner as latitudes and longitudes. Each square also has an index ilat and ilong value starting at the lower left corner with (0,0) to (maxlong, maxlat) for the top right corner. Each square also has measurements (X, Y, Z). I would like to transform this data into the ASCII Grid Format:

link

for each measurement. Here is some example data taken from the Internet:

ncols         419
nrows         407
xllcorner     823678.99884033
yllcorner     1151760.4752197
cellsize      14.314150820378
NODATA_value  -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999

I understand what ncol and nrows is but I am not too sure about xllcorner, yllcorner, cellsize. Could someone please advise me what these values would be in my situation? Do you reckon I can transform my data from my tile/square format into the ASCII Grid Format.

Actually my grid is as follows:

Latitude is in the range [-90 ... 90] and longitude [-180 ... 180]. A square’s  cell’s size is 2.5 degrees

I have been told that corresponds to 25 square kilometres.


texts: Can't call GRASS commands with Python on QGIS 2.18

texts:
I'm trying to run a grass command (v.split.length) using the processing library in pygis. The script is as follows:

import processing

layer = r'path\to\shp.shp'
extent = QgsVectorLayer( layer, '', 'ogr' ).extent()
xmin = extent.xMinimum()
xmax = extent.xMaximum()
ymin = extent.yMinimum()
ymax = extent.yMaximum()

res = processing.runalg("grass:v.split.length",layer,1000, "%f , %f, %f, %f "% (xmin , xmax , ymin , ymax), -1,0, 0, r'path\to\out_shp\out_shp.shp')

When I execute the script I get the following message box:

GRASS folder is not configured. Please configure it before running GRASS algorithms.

I am running QGIS 2.18.22 with GRASS 7. What I have noticed in the processing options is as follows:

The Grass7 folder appears to be defined but Grass folder is not. Further more inside my QGIS installation this is what I can see

C:\Users\aboufira>cd C:\Program Files\QGIS 2.18\apps\grass

C:\Program Files\QGIS 2.18\apps\grass>dir
 Volume in drive C is OS
 Volume Serial Number is 944A-AABE

 Directory of C:\Program Files\QGIS 2.18\apps\grass

07-Aug-18  15:49    <DIR>          .
07-Aug-18  15:49    <DIR>          ..
07-Aug-18  15:49    <DIR>          grass-7.4.1
               0 File(s)              0 bytes
               3 Dir(s)  31,910,600,704 bytes free

There are two possible solutions:

install the regular version of GRASS and add the folder to apps path such that when I open the providers menu I can see the path appear under regular GRASS
Find a way to call the grass 7 algorithms from the Python console. It seems that processing.runalg by default attempts to run the regular GRASS algorithms

Which of these options is the more straightforward one and how do I implement it? If there is an alternate option I am also open to that.


texts: Calculating distance to a feature from a reference line

texts:
I have multiple shapefiles, each containing a coastline for a specific year. I want to calculate the perpendicular distance to the shoreline from a fixed vertical reference line.

Please recommend me the best tool (in ArcGIS-Desktop) to find out the perpendicular distance from each point (or a definite number of multiple points) on the reference line to the shoreline shapefile. I have included a screenshot to describe what I am planning to achieve.

I am hoping to be able to create 1 custom point per 100m on the reference line and then calculate the distance to the shoreline from these points.


texts: Reading pixel numbers of georeferenced raster in ArcGIS for Desktop?

texts: In the following map, I've georeferenced the pauliRGB.bmp of an ALOS-PALSAR image in order to be able to exactly recognize the number of pixels which San francisco is surrounded by. I mean, I want be able to read the line and column number of the four corners of the red rectangle. Is there any solution?


texts: Converting PostGIS point to text causing loss of data?

texts:
I have a road network and want to test connectivity between the features.  I am having trouble with two specific features, the rest of the dataset is functioning just fine.

When I get those 2 links' start & end locations using ST_StartPoint and ST_EndPoint, the result is that they are slightly different.  However, when I convert the result to text by wrapping it like so:

ST_AsText(ST_StartPoint(geom)) and ST_AsText(ST_EndPoint(geom))

then the results are exactly the same.  Is it possible they are actually off by a tiny amount like .000000001 and the ST_AsText loses a decimal point?


texts: Importing coordinates via a CSV file does not work

texts:
I tried to manually add point data via a CSV file to an empty project in QGIS 1.8.0. The points do show up all right with the correct coordinates, but already the scale is not correct (using the measuring tool it only measured some centimeters where it should be 20km).

I entered the coordinates in decimal degrees using the WGS84 datum EPSG 3857. It doesn't work either when I put a Bing aerial first.

Something is probably not correct with the projections, even though I tried out different stuff. Thanks for your help.

nom,latitude,longitude
1,-2.6,-78.2
2,-2.5,-78.2
3,-2.6,-78.1
4,-2.5,-78.1


texts: Filling gaps between polygons using QGIS

texts:
Here are my polygons of town blocks.

The colored towns are considered as areas where they have the same post code.

What I eventually want is to make seamless polygons where there are no gaps between polygons (please see the screenshot below)

What functions should I use to complete my mission?


texts: Creating a world map centered on another meridian in QGIS

texts:
I am trying to create a world map, but centered over the Pacific rather than the Prime Meridian. Recentering the projection (standard Mercator) on 180 degrees gives me a lot of ugly artifacts where countries are stretched across the "cut line" of the map.

I assume I need to do some kind of intentional clipping (like clipping to hemisphere with an orthographic projection), but I'm not sure how properly to make QGIS cut everything cleanly on a meridian. Is there a standard way of doing this? A plugin?

(I am using the Natural Earth 50m countries shapefile.)


texts:
Is there a parameter for WCS 2.0.1 GetCoverage requests which will sample underlying data and return a dataset of a particular size?

Similar to the height and width parameters in WCS 1.x.x?