texts: Wavy Edge on polygon in QGIS using geometry generators

texts:
I would like to have wavy edges on a polygon similar to what @christoph shows in this answer for wavy lines.
https://gis.stackexchange.com/a/354873/94350
I have gotten his great python expression function working well on lines but have been unsuccessful adapting it to polygons.
from qgis.core import qgsfunction,QgsExpressionContextUtils,QgsExpression,QgsProject,QgsPoint,QgsGeometry
@qgsfunction(args='auto', group='Custom', usesGeometry=False, referencedColumns=[])
def make_zigzagline(geom,dist,offset,feature,parent):
    """

converts a linestring to a zig-zag line

    make_zigzagline(geometry,distance(s),offset)

geometry	linestring geometry

distance(s)	linear point distances (single number or a string of comma separated numbers)

offset	perpendicular offset

    Examples:

make_zigzagline($geometry,'15,30',15) -> zig-zag line

make_zigzagline($geometry,15,15) -> zig-zag line

    Use smooth function to create wavelines:

    Example:

smooth(make_zigzagline($geometry,'15,30',15),3)

    """

    if not type(dist) is str:
        dist = str(dist)

    dist = [float(n) for n in dist.split(',')]
    l = geom.length()
    dist_sum = 0
    distances = []
    while dist_sum + round(sum(dist),2) < l:
        for d in dist:
            dist_sum += d
            distances.append(dist_sum)

    # interpolate points on linestring
    points2d = [(lambda g: (g.x(), g.y()))(geom.interpolate(d).asPoint()) for d in distances]
    vertices = geom.asPolyline()
    start = (vertices[0].x(),vertices[0].y())
    end = (vertices[-1].x(),vertices[-1].y())

    points2d.insert(0,start) # prepend start point
    points = [QgsPoint(start[0],start[1])]
    i = 0
    n = 0
    b = -90
    for point in points2d[1:]:
        pt1 = QgsPoint(points2d[i][0],points2d[i][1])
        pt2 = QgsPoint(point[0],point[1])
        a = pt1.azimuth(pt2) + b
        pt = pt2.project(offset, a)
        points.append(pt)
        i += 1
        n += 1
        if n == len(dist):
            n = 0
            b = -b

    points.append(QgsPoint(end[0],end[1])) # append end point
    return QgsGeometry.fromPolyline(points)

As a bonus I would like to be able to vary the size of each wave to create something like this:


texts:
I decided to completely restructure the code I was using for my ingest/QAQC script that I am building. I managed to get around using a table join for the first QA/QC part, but this part may require the join. Here's my code block.

    def findRevisit():      #Looks for revisited in the incoming data set using table join and DT(date) field. Flags potential revisits with '2' in QAQC_FLAG field.
        arcpy.env.workspace = inPGDB
        rtTbl = "midFCviewJoin_vw"
        leftTbl = in_table_view
        joinField = "UUID"
        dateField = "DT"
        updField = "QAQC_FLAG"
        fields = [joinField,dateField,updField]
        leftDate = in_table + "." + dateField
        rtDate = midFCview+ "." + dateField
        arcpy.AddJoin_management(leftTbl,joinField,rtTbl,joinField)
    ##    arcpy.JoinField_management(leftTbl,joinField,rtTbl,joinField,"")
        sql = leftTbl + "." + joinField + " <> " + rtTbl + "." + joinField
        print "SQL where clause: " + sql
        with arcpy.da.UpdateCursor(leftTbl,[dateField,updField],sql) as cursor:
            for rec in cursor:
                rec[1]=2    ##Set QAQC flag = 2 for possible revisits in the incoming dataset
                cursor.updateRow(rec)
                print rec
    ##    arcpy.DeleteField_management(in_table, "QAQC_FLAG_1")
        arcpy.RemoveJoin_management(leftTbl)
        return leftTbl,rtTbl,sql
        del cursor,rec

Seems like it should run. Both table views are in the same workspace. It still falls on its face. Here is the error I get from the cursor:

    Traceback (most recent call last):
      File "C:/Users/kgaines/Documents/Aquadat/Scripting/AquaDat_tableCreate_findDup_findRevisit_defFunct.py", line 232, in <module>
main()
      File "C:/Users/kgaines/Documents/Aquadat/Scripting/AquaDat_tableCreate_findDup_findRevisit_defFunct.py", line 225, in main
findRevisit()
      File "C:/Users/kgaines/Documents/Aquadat/Scripting/AquaDat_tableCreate_findDup_findRevisit_defFunct.py", line 169, in findRevisit
for rec in cursor:
      RuntimeError: Too few parameters. Expected 2.

Where is the "Too few parameters" error coming from?

Here are a couple of images showing the field names in the in_table. All of the other tables and views have exactly the same fields.


texts: Generating customized vector OSM map files from OpenStreetMap and other data?

texts:
I am looking for a way (e.g. tutorial?) to generate my own customized (offline) maps in OSM format. By "customized" I mean adding data (not just define a region of interest) to an existing OSM map (e.g. OpenTopoMap), then export the augmented map into a new .osm-file.

What I managed to do:

load OSM maps (e.g. OpenTopoMap) in QGIS, download the canvas into an .osm-file and convert it to a sqlite db, and import points, polygons, polylines
load other data into QGIS (e.g. manually generated (vector) points)
export the canvas to tiles using QTiles either to a directory or to a .mbtiles-file. However, this is the critical point: this export is way too large and the resolution of the tiles is bad, so I am looking to export the canvas in the vectorized form

How can I augment maps in OSM format with own data and store it as a new (vector) .osm-file?

Preferably in QGIS, other programs are fine as long as they are free and run in Linux. The full style e.g. the shading in OpenTopoMap and the elevation curves should be preserved.


texts: Developer-friendly Embedded systems GIS library?

texts:
Having seen the answer to the smallest GIS library for embedded devices, I'm asking a related question. I want to do simple point-in-polygon and other spatial relationship tests against a shapefile. But I also want to invoke REST calls and so I just don't want to be using low-level C/C++ style languages because...well, they're painful.

Also, the device can run Windows Embedded or Linux Embedded, but preferably the solution will work on either.


texts: GetFeatureInfo on mouse hover on feature in OpenLayers 3

texts:
I am able to get popup onclick on the feature but want to get popup also on mouse hover on the feature (polygon,point). Can anyone help me out.
For onclick I used below code -

var feature_onClick;
map.on('click', function(evt) {

    feature_onClick = map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) {
        console.log(feature);
        return feature;
      });

  if (feature_onClick) {
    var content = document.getElementById('popup-content');
    console.log(feature_onClick.getProperties().name);
    overlay.setPosition(evt.coordinate);
     content.innerHTML = feature_onClick.getProperties().name;
     container.style.display = 'block';
     }
});

For mouse hover I am using below code but unable to get pop up. Only cursor changes to pointer.

map.on('pointermove', function(e) {
  if (e.dragging) {
    $(element).popover('destroy');
    return;
  }
  var pixel = map.getEventPixel(e.originalEvent);
  var hit = map.hasFeatureAtPixel(pixel);
  map.getTarget().style.cursor = hit ? 'pointer' : '';
});


texts: Toggle Mapbox check box while toggling HTML Table check box

texts:
I have been following https://docs.mapbox.com/mapbox-gl-js/example/filter-markers/ this example to filter markers when clicked on the names. Map box uses the layer ID for filtration. It works perfectly for me, but is there a way I can link them to my table check boxes. For example, is there a way to toggle their  checkbox when my checkbox is checked.
<tbody class="data">
  <tr >
    <td> <input type="checkbox" id="marker1" class="marker1"> </td>// toggle the first check box in mapbox
    <td> <input type="checkbox" id="marker2" class="marker2"> </td>// toggle the second check box in mapbox
  </tr>
</tbody>


texts: Can GeoRSS feed be used for raster image?

texts:
GeoRSS can be used to show vector data (point, line, polygon, etc). Can it be used to show raster image, say GeoTIFF? Is it part of the specification?

Any idea?


texts: WMS layers don't draw in QGIS or ArcMap but do in OpenLayers

texts:
WMS Map was published by myself in AutoDesk Infrastructure Map Server 2013. I can connect and load detials (properties / metadata) in QGIS Browser, ArcCatelog. I can load the wms into QGIS desktop and ArcGIS desktop but the layers do not draw (in the mapframe) in either program.  I can isolate and draw the layers in OpenLayers html file just fine. The only thing that concens me is a SQL Spatial layer in the Map created using ArcSquirrel.

Any help would be great.


texts: Extracting data from one layer using a second layer as the bounding area

texts:
Seems like this should be straight forward but I'm not finding it.

I have two layers:  A Boundary Layer and a Street Layer.  The Boundary layer contains multiple jurisdictions and the Street layer contains multiple streets.  Both files are shapefiles.

I'm trying to extract into a .CSV file the data for the Streets who are contained within one specific jurisdiction.

I've done this with the an old version of ArcView in the distant past but now have QGIS as my available tool.


texts: Load (input) and Save (output) rds files with R in QGIS script

texts: I have done a Random Forest classification model in R and I have implemented a script to work in QGIS. For the moment I specify the model's path into the script to apply it (image), but is it any form to choose the model as a input parameter? And in the same way, is it possible to save the model as output parameter?


texts: Convert output of Image Segmentation/Classification (From land-use classification) into different shapefiles

texts:
I am performing the Landuse Classification on satellite imagery. I have classified my image into different categories.

I have the shapefile of the original image, now I want to create the separate shapefiles for each classified portion in the image.

Is there any way, I can achieve this using GDAL (python)? Or any other library of python.

A sample image is given below:


texts: What is the difference between the "feature to raster" and "polygon to raster" tools when converting a polygon to a raster?

texts: I am currently trying to get a group on connected polygons that are within the same feature to a raster so I can reclassify it for cost analysis. I noticed that ArcGIS for Desktop has a "feature to raster" and "polygon to raster" tool that I can use. Both of the tools recognize my layer, and they seem like they will accomplish the same task, however, I was wondering if there is one that I should use in my specific scenario over the other, or does it really not matter?


texts:
I have a Shapefile of cartographic text (roads, buildings, water  etc) and I would like to be able to rotate individual road names to fit within the width of the road. Anyway, I know it is possible to rotate a feature in QGIS using the Advanced Digitizing Toolbar (Is there a Rotate Tool in QGIS?), however when I use this feature it doesnt seem to rotate at all (St Nicholas Avenue, below).

What am I doing wrong?


texts: QGIS 3.18.0 - Create individual polygons based on sequentially numbered points

texts:
I have imported a series of points (representing points along the perimeter of both sides of a stream).  The stream is segmented into 10 meter sections.  The goal is to map out the stream - but broken down into individual sections.
My attribute table for the point layer (image example below).
[EDIT] And, sample data here: tab delimited file
Section | Sequence | Type | X | Y

SECTION: numeric identifier for the given section
SEQUENCE: ordered value indicating which points to connect in given order, per section
(via PointToPath)
TYPE: designates side of stream bank, left or right (ignore this)
X / Y - ordinate values for the points.

If I were to create a layer for only one section of the stream, I'm golden by:

Add a delimited layer (my data file) - points are assigned a SEQUENCE number
Run Points-to-Path (create closed path, order expression = SEQUENCE)
Run Lines-to-Polygons to form a polygon of the given section.

Easy.
The problem is, I have 7 streams, 1400 sections each.  I'm hoping to automate the process in some way.
Currently, I have imported all of my points to one point shapefile (image below). SECTION and SEQUENCE could be used to organize the sections.  But I can't figure out how to perform the above single-section process on each section.
I think I need to break each section into a shapefile of its own - then batch the process?  Is there an easier way?
Hoping this makes sense?
THIS ugly picture is what I'm going for. The ugliness is just to point out the different polygons.


texts: Python-ArcObjects mxDocument Stand Alone

texts:
if I need to work with classes MxDocument with the MapDocument that I have selected to work , for example style gallery, How can I instantiate ?

InitStandalone()

pMapDoc = CreateObject(esriCarto.MapDocument, interface = esriCarto.IMapDocument)
pMapDoc.Open(path)

pApp = GetApp()
pMxDoc = CType(pApp.Document, esriArcMapUI.IMxDocument)
pSG = CType(pMxDoc.StyleGallery, esriDisplay.IStyleGallery)

Can I relate this?


texts: Handling file names with spaces in ogr2ogr?

texts:
I'm trying to convert .shp files to .kml files. I used a batch file to find all .shp files in a directory and its sub-directories and convert them to .kml. Some converted and some gave me the error "Unable to open datasource with the following drivers". I worked out that it was not converting due to spaces existing in the file names. When I got rid of spaces in the file name, it converted.

With that said, I need the files to be the same name so that they can be referenced by other programs correctly. Is there a way either in ogr2ogr or in windows cmd line to accommodate for spaces in files names when being batch converted?


texts: Moving from OpenLayers to Leaflet breaks tilecache

texts:
My tilecache.cfg is like so (working with MapServer)

[mylayer]
type=WMS
url=http://server/mapserver/app
spherical_mercator=true
layers=mylayer

The following works just fine

var mylayer = new OpenLayers.Layer.WMS(
    "My Layer",
    "http://server/tilecache/tilecache.cgi",
    {layers: "mylayer", transparent: true},
    {isBaseLayer: false, opacity: 0.6, visibility: true}
);

However, when I change the above to Leafletjs like below

var mylayer = L.tileLayer.wms("http://server/tilecache/tilecache.cgi", {
    layers: 'mylayer',
    format: 'image/png',
    transparent: true,
    attribution: 'Data from blah blah'
});

I get the following error

An error occurred: Current y value -5009377.085697 is too far from tile corner y -10018754.170400

Suggestions?

Update2: (top-posted). I tried adding srs definitions (srs:"EPSG:4326" or srs:"EPSG:900913"). While the latter didn't help at all, the particular error I reported above went away with 4326, and a couple of tiles were also returned, though most tiles were just blank. This tells me something is goofy with the way Leaflet expects the projection. I'd rather not change anything on the source (MapServer or Tilecache side), if possible, as other applications are depending on that to be working.

Update: Adding the MapServer map file, in case that might help

MAP
    EXTENT -180.150250417362 -90 180.150250417362 90
    IMAGECOLOR 255 255 255
    IMAGETYPE "png"
    NAME "mylayer"
    SIZE 1200 600
    STATUS ON
    UNITS DD
    DEBUG 3
    CONFIG "MS_ERRORFILE" "/tmp/ms_mylayer_error.log"

    OUTPUTFORMAT
        NAME "png24"
        MIMETYPE "image/png"
        DRIVER "AGG/PNG"
        EXTENSION "png"
        IMAGEMODE RGBA
        TRANSPARENT ON
    END

    SHAPEPATH "/path/to/files"

    PROJECTION
        "init=epsg:4326"
    END

    WEB
        IMAGEPATH "/tmp/ms_tmp/"
        METADATA
            ows_enable_request "*"
            wms_abstract "This WMS mapservice serves a map of mylayer"
            wms_accessconstraints "none"
            wms_title "mylayer"
            wms_onlineresource "http://sever/cgi-bin/mylayer?"
            wms_srs "EPSG:900913 EPSG:4269 EPSG:4326"
            wms_keywordlist "World,mylayer"
            wms_enable_request "*"
        END
    END

    LAYER
        NAME "global"
        TYPE RASTER
        ..

        METADATA
            wms_srs "EPSG:4326"
            wms_name "global"
            wms_server_version "1.1.1"
            wms_format "image/png"
            wms_enable_reques "*"
            wms_extent "-180 -90 180 90"
        END
    END
END


texts: How to dissolve shared line segments together in QGIS?

texts:
I have 2 features which are lines on a single layer re-projected to ESPG:2039.

I wish to combine them into one MultiLineString but in a way that their common part is merged to a single LineString. I'm using QGIS 3.6.2

I snapped their geometries to the grid and tried to dissolve them together. But when I add start vertices (green) and end vertices (red) to be displayed, I can see that I have 2 lines in the MultiLineString instead of 5 lines:

When I run the "intersect" tool on the lines as seperate layers, I get that they do intersect in the joint area (blue line):

How can I make the joint part be dissolved together to a single line?
Data can be found here as SHP file: http://www.filedropper.com/2lines

UPDATE:
I tried to use the "Remove duplicates" as suggested by Erik, but it didn't do a thing.


texts: batch create DEM from contour maps (open source)

texts: I have around 100 shapefiles of contours (1m interval) that I need to turn into DEMs; Is there a way to batch create these mde from contour lines? Using open source preferably.


texts: How do I create a map that is not to scale in QGIS?

texts:
I want to make a map that isn't to scale and I'm so used to being pedantic about CRS and scale that I don't know where to start.

The map that I need to make is a simple guide for people to get to a site that is out of town.

I'm addicted to QGIS, of course.


texts: Computing max values in a ImageCollection and extracting original band values for each pixel in Google Earth Engine (GEE)

texts:
I am working in species distribution models. Currently, I have an ImageCollection where every image represents a specie. Each image has two bands: one holding values of probability of presence, the other is a constant with a specie code.
I would like to compute the maximum, so that I can know what species is more probable in each pixel. However, using max I lose what specie does that pixel belong to, aka the specie code value. Therefore,** I would like to get the maximun value for each pixel and the specie code that is associated to that value**.
I believe that it can be somehow tackled with Arrays but I am not sure how to proceed.
So far my code looks like this:
// roi
var CyL = GAUL.filter(ee.Filter.eq('ADM1_NAME','Castilla y Le�n'));

// two ways
// create image collection
var species = ee.ImageCollection([psyl,phal,pnig,ppin,jthu,qpyr,qile,qsub]);

//create list with species
var speciesCode = ee.List([21,24,25,26,38,43,45,46]);

// loop over the collection and add a band with the specie code
var specieColl = species.map(function(image){

  // get the index from the image
  var index = ee.Number.parse(image.id(),10);

  // get the species code from list
  var code = ee.Number(speciesCode.get(index));

  // Addbands
  //return

  return image.addBands(code).rename('prob','code').set('specie',code);
});


texts: Get elevation data w.r.t. date in Google Earth

texts:
I am using Google Earth Pro to get the elevation of different points on earth. It's giving me elevation data for points I am hovering over, but I want to get the elevation data with respect to date.

For example, When I put a placemark and hover on it, its elevation is 1465 ft. but when I move the date few years ago, the Earth view changes, but the elevation value is still the same.

Is it possible to see elevation data with respect to date changes? It's surely going to be changed with time, and sea level. Is it possible? If yes, then how?


texts: Accessing Rest Api of Geoserver using python

texts:
is there anyway to access Rest Api of Geoserver using python other than gsconfig.
since it doesn't support for me.i'm using python3.4
Like creating workspace,adding layers programmatically to Geoserver


texts: Preparing dataset for SAR pre-processing

texts:
I am working on Chandrayaan-2 lunar SAR data and have the Fully polarized,  Single Look Complex SAR data, which is Slant Range Data Product. Along with it is an excel sheet with lat, long, incidence angle angle and slant range data information for the dataset.

I need to do subset some area from the raster (.tif) and perform pre-processing such as radiometric, geometric calibration. But the image when opened in QGIS/Arc, are showing data with non-square pixels.

PFA the link with one of the rasters that I have along with the excel sheet.
Google drive link:   https://drive.google.com/file/d/1uRZNFh3774BxDAE2rEqWthwx0oxuieLz/view?usp=sharing


texts: Layers with the same projected coordinate system and geographic coordinate system do not overlap

texts:
I have a blank map, I've set the data frame to the same projected coordinate system as the data I'm going to add. I have added one shapefile and it looks good. When I wave the cursor over the map the decimal degrees displayed in the lower right corner of the data frame are correct.

I then attempted to add a Excel table that has lots of points with the decimal degrees for each point. I added the table, and used the Display XY Data option to display the points. The resulting points do not overlap the first shapefile, even though the two are actually just about identical. I've checked the projected and geographic coordinate systems and they're the same.

When I zoom in on the layer with the points I find that in the lower right hand corner of the data frame it registers everything as being at -85.489, 0 decimal degrees, which is clearly wrong. The measure tool shows that the points are mere millimeters apart, which they're not.

Based on similar question on this site I tried using the project tool on my points and projecting it into the format it already was in (i.e. the same projected and geographic systems as the shapefile) that didn't work, it just wound up warped.

What has gone wrong with displaying my data?


texts: QGIS : how to do elegant multiple replace string?

texts:
In QGIS I need to do a string conversion, from serbian latin to serbian cyrilic.

In field calculator, i have only this inelegant solution :

replace(replace(replace(replace( etc... ))))

It's long to type all translitterations (about 30), is there a better way to do this ?

Inpired by given links, i did this :

from qgis.core import *
from qgis.gui import *
import string

@qgsfunction(args='auto', group='Custom')
def serbian_latin_to_cyrillic(n):
    capital_letters = {
        u'Џ': u'Ǆ',
        u'Њ': u'Ǌ',
        u'Љ': u'Ǉ',
        u'А': u'A',
        u'Б': u'B',
        u'В': u'V',
        u'Г': u'G',
        u'Д': u'D',
        u'Ђ': u'Ð',
        u'Е': u'E',
        u'Ж': u'Ž',
        u'З': u'Z',
        u'И': u'I',
        u'Ј': u'J',
        u'К': u'K',
        u'Л': u'L',
        u'М': u'M',
        u'Н': u'N',
        u'О': u'O',
        u'П': u'P',
        u'Р': u'R',
        u'С': u'S',
        u'Т': u'T',
        u'Ћ': u'Ć',
        u'У': u'U',
        u'Ф': u'F',
        u'Х': u'H',
        u'Ц': u'C',
        u'Ч': u'Č',
        u'Ш': u'Š'
    }

    lower_case_letters = {
        u'ǆ': u'џ',
        u'ǌ': u'њ',
        u'ǉ': u'љ',
        u'a': u'а',
        u'b': u'б',
        u'v': u'в',
        u'g': u'г',
        u'd': u'д',
        u'ð': u'ђ',
        u'e': u'е',
        u'ž': u'ж',
        u'z': u'з',
        u'i': u'и',
        u'j': u'ј',
        u'k': u'к',
        u'l': u'л',
        u'm': u'м',
        u'n': u'н',
        u'o': u'о',
        u'p': u'п',
        u'r': u'р',
        u's': u'с',
        u't': u'т',
        u'ć': u'ћ',
        u'u': u'у',
        u'f': u'ф',
        u'h': u'х',
        u'c': u'ц',
        u'č': u'ч',
        u'š': u'ш'
    }

translit_string = ""

    for index, char in enumerate(string):
        if char in lower_case_letters.keys():
            char = lower_case_letters[char]
        elif char in capital_letters.keys():
            char = capital_letters[char]
            if len(string) > index+1:
                if string[index+1] not in lower_case_letters.keys():
                    char = char.upper()
            else:
                char = char.upper()
        translit_string += char

    return translit_string

But when i use the function, and put a field form the table in the parameter of the function, it says the function use only one paramater and it says i put 3 value. Why that ?

I try the second solution, and it gives me some strange result. Beside this, i cannot get the value of a field transmitted in function paramater.

@qgsfunction(args='auto', group='Python')
def serbian_latin_to_cyrillic(field, feature, parent):

    sr_latin = u"Bačka Palanka"

    symbols = (u"ǆǌǉabvgdðežzijklmnoprstćufhcčšǄǊǇABVGDÐEŽZIJKLMNOPRSTĆUFHCČŠ",
    u"џњљабвгдђежзијклмнопрстћуфхцчшЏЊЉАБВГДЂЕЖЗИЈКЛМНОПРСТЋУФХЦЧШ")

    """tr = {ord(a):ord(b) for a, b in zip(*symbols)}"""
    tr = dict( [ (ord(a), ord(b)) for (a, b) in zip(*symbols) ] )

    return sr_latin.translate(tr)

It gives me this : ÐÐ½µÐ ÐÐÐÐÐµÐ

If i disable the transliteration function, it gives me this : BaÄka Palanka
Maybe problem with character encoding ?


texts: Export high resolution map image in QGIS

texts:
I'm trying to save big ortophoto image (34k x 28k px) with overlayed vector contour layer with difference blending mode in order to see contours on every terrain clearly. See an example below:

When I try to save whole image matching original 1 m resolution using Export map to image or Map composer QGIS always crashes.
I achieved this by exporting 12 atlas tiles and merging again later.
Is there some more straightforward way of doing it?


texts:
When plotting and RGB image using rasterio, I have seen that it is necessary to normalize the values first (0-1) and the use show. I am using the following code for that:

def norm(band):
    band_min, band_max = band.min(), band.max()
    return ((band - band_min)/(band_max - band_min))

b2 = norm(S_images[0].astype(numpy.float))
b3 = norm(S_images[1].astype(numpy.float))
b4 = norm(S_images[2].astype(numpy.float))

# Create RGB
rgb = numpy.dstack((b4,b3,b2))

# Visualize RGB
plt.imshow(rgb)

When reading the rasterio.plot.show documentation, there is a paramter called `adjust'

  adjust ('linear' | None) – If the plotted data is an RGB image, adjust
  the values of each band so that they fall between 0 and 1 before
  plotting. If ‘linear’, values will be adjusted by the min / max of
  each band. If None, no adjustment will be applied.

Is this parameter doing the same as my norm function? Does it work only if I load a multi-chanel RGB image or can I use it when providing a np.stack?


texts: Query Result message returns 0 rows but browser shows results

texts:
I am using the Layer filter tools in QGIS version 3.14.1 Pi. (Right Click on layer > Filter)
The source data is a Mapinfo .tab-file on a Server.
When I put in my filter query, "Field_name" LIKE 'value' and I run the Test button, i get the popup message

The where clause returned 0 row(s)

If I hit OK and essentially save that query onto the layer, and then browse the data in the attribute table, the table is filtered and rows are returned.
This is suggesting that the popup message, and the actual filter results are disconnected and is possibly a bug?
Can someone please verify this also before I log a bug or let me know if I am doing something wrong here?


texts:
I want to resolve this problem:

I have a layer with several points, and another layer with several lines, and I want to join each point with the closest line, for that I want to use the v.distance because it worked with the toolbox. But I want to do it with python, I saw this question. But I tried that and didn't work.

Guess that "layer1" and "layer2" I got them before. The other as "cat","dist", I don't know what are because in the tools box have these names but maybe I have to put these name on other way.

nom_resultado2 = r'D:\user4\Desktop\project\output2.shp'

parameters = { 'FROM' : layer1,
    'TO' : layer2,
    'UPLOAD' : cat,dist
    'COLUMN' : to_cat, dist
    'OUTPUT' : nom_resultado2
    }
processing.runAndLoadResults('qgis:v.distance', parameters)

And I have to put maximum distance and minimum distance, but doesn't work.


texts: Converting data from parliamentary constituency code/county code to a mappable format?

texts:
I have a spreadsheet detailing fuel poverty in the UK, against a) individual parliamentary constituencies b) county and c) local authority. This can be found here if anyone needs to look: https://www.gov.uk/government/statistics/sub-regional-fuel-poverty-data-2017

I want to map this in QGIS (preferably as symbols of different size, rather than shapes denoting the actual shape) but the location information is based on codes (e.g. Darlington is E14000658 as the Parliamentary Constituency).

Is there a way to convert this to say co-ordinates for mapping? There are many hundreds of fields so I am not really able to do this manually...


texts: New Mapset-----> Database Dialogue---->New location---->??Projection????? (not prompted for my input)---->Name of Mapset

texts: I have tried to create a new Mapset but to no avail. After I have completed till the "new location", the pressing of the "next" button immediately brings up an error message " Cannot set Projection: Variable GISBASE not set" Please explain the problem and how to solve it. Without the projection setting, I would not be able to import shapefile into Grass. Thanks


texts: Creating routes for each feature within feature class in ModelBuilder without coordinate priority?

texts:
I´m trying to create a simple model which would select each feature from a FC (streets polylines with vertexes and edges) and transform each of them into a route using the “Create Routes” tool (see the model).

In this model I don´t want to prefer any of the 4 coordinate priorities (should be optional) but if I left this parameter free this error appears:

  ERROR 000192: Invalid value for coordinate_priority

Next problem is that after running the model I just got a route for the last attribute resp. a FC with only 1 item. I know I´m doing anything wrong with the iteration variable but don´t know what.

How can I transform each feature without any coordinate priority?

How can I change the model to get all of the features and not only the last one?

I will need the routes for other calculations.

From @User2009 I now understand the manipulation with the value variable so I can generate all of the features (each is represented in 1 FC).
But I still don´t know how can I create the routes for each feature so the coordinate priority will be ignored. As you said the only possibility to skip the coordinate priority is the select “To fields” as the measure field. In the ArcGIS tutorial they´re using BEGMP1 or ENDMP1 as the “From-Measure-Field” or “To-Measure-Field”. I suggest this is the starting and the endpoint of each feature but I have no idea how to create those points which will be represented then in just 2 fields. Of course I can add the geometries (X and Y-coord. of the starting and endpoints of each feature) but now I have 4 fields (x_start, y_start; x_end, y_end). I can transform then these geometries into 2 FC (starting points; endpoints) but now I have to FC and not 2 fields in the attribute table… My only idea was editing 2 short integer fields into the attribute table for the street features showing each the FID of the neighbouring feature (0 when the starting point or the end point doesn’t touch any street feature) but of course ArcGIS doesn´t recognize that these are the FID-features (I think there will be a solution for this with some tool from the proximity analysis toolset) but I don´t think this will help for the route creation.
Any ideas on how to create only 2 fields in the attribute table representing the starting and end point of each street line feature?


texts: Identifying individual trees and segmenting crowns from LiDAR CHM data?

texts:
I have a classified LiDAR point cloud for an area of 250*250 square meter, with 1 meter resolution. It has a 5 lakhs points with an average point density of 9 (means around 9 points within a pixel).

Now, I created a Canopy Height Model (CHM) model from the LiDAR point cloud and want to identify individual trees and segmenting their crowns. How can I do that?


texts: How to create routing application with ArcGIS Server?

texts: I have the task to find out what is necessary to build a routing application using ArcGIS Server.  I am not a GIS beginner, but have had no experience with ArcGIS Server. As this project is at the "ideas" stage, I would like to start my research here by asking if anyone could give me some guidelines regarding what would be a sensible way to start a routing project using primarily (but not necessarily limited to) ESRI Software. Which extentions? What type/quality of data? Planning tips? Which organisations etc etc?


texts: Questions about mobile cache, normal tables and basemaps

texts:
we are piloting a data gathering application for Windows Mobile and have encountered a few challenges as we don't have previous experience with the ArcGIS Mobile. In future after the pilot, we would need to implement synchronization with a bigger system this application will be part of.

1) We have geodatabase, which contains some standalone tables that have no geometry. We need to be able to update those tables in the mobile application as well. Currently we are trying to create feature classes for each of these tables, add the data into those and then generate some fake geometry point for each row. Is there any other workaround or is this viable solution?

2) Is there any way to add background maps to the application without ArcServer? As I have understood, we need to publish a service in ArcServer and get background maps from the service. Is there any way to have, for example just a .tiff raster map in the device and use that as a background map in the application? This would make our lives much easier during this pilot phase...

3) Are there any known limitations with mobile cache? We have now created the feature classes for few tables and added fake geometries for those. We were able to generate mobile cache with those, but we saw data only for one table, which had only 3 rows. Another table had 14000 rows, and the data was not in mobile cache. The geometry creation had worked because we can see it in ArcMap using the identify tool.

4) Is mobile cache the only solution to save the data? It would be nice to have all the features and tables in one place and it feels such a hassle because we haven't found a way to save normal tables to cache. We are also investigating a way to have two databases, mobile cache and then another database for normal tables. But it feels like there must be easier way around this?

We are using ArcGIS Desktop 10 and ArcGIS Mobile 10.1.1

Thanks!


texts: Creating histogram/statistics/scatterplot by classification tool in ArcMap?

texts:
I'm currently working on a land cover classification with Landsat 8 imagery. I already subjected the imagery to pre-processing (atmospheric and topographic correction) and I mosaiced two images.
Now I want to apply a classification in ArcMap. I understand what I should do, but somehow I cannot mannage to create the statistics/histograms/scatterplots. When I click on the statistics, all values are zero. When I look at the properties of the raster layers on the other hand, I can see the statistics, calculated with the 'calculate statistics' tool. It doesn't create a histogram at all and the scatterplots are just 1 dot in the middle of the screen.
Does somebody know what my problem is and how I can fix this?


texts:
I am trying to download a hillshade map of africa. I found the perfect one, namely this:
South Africa 5m resolution hillshade
http://www.arcgis.com/home/item.html?id=219dc4347a594455bdf239c8eb4b581c

I open the downloaded link with the ArcMap and I see the map but it is not a raster and I can't figure out how to download it.


texts: Leaflet interactive styling does not reset style correctly on mexican state geojson layer

texts:
I adapted the leaflet tutorial for an interactive choropleth map to create hover highlights and zoom functionality to my Mexican states map.

Oddly, when I test out the highlight it leaves certain states highlighted.

Demo at garciamaps.com/mexico

Here is the the js.

//GETS BASEMAP TILES
var greyscale =    L.tileLayer('https://{s}.tiles.mapbox.com/v3/gregorydgarcia.kg672h90/{z}/{x}/{y}.png');

//INITIALIZES BASEMAP LAYER
var baseMaps = {
 "Basemap": greyscale,
};

//INITIALIZES MAP
var map = L.map('map', {
    center: [19.00, -99.1333],
    zoom: 5,
    layers: [greyscale]
});

//FUNCTIONALITY FOR STATES
var stateStyle = {
    "color": "#3D5229",
    "weight": 1,
    "opacity": .90
};

function getColor(d) {
    return  '#800026';
}

function onEachFeature(feature, layer) {
    if (feature.properties) {
         layer.bindPopup(feature.properties.name);
     }
 }

var geojson;
geojson = L.geoJson(estados, {
    style: stateStyle
        });

function highlightFeature(e) {
    var layer = e.target;

    layer.setStyle({
         weight: 5,
         color: '#666',
         dashArray: '',
         fillOpacity: 0.8
    });

    if (!L.Browser.ie && !L.Browser.opera) {
        layer.bringToFront();
    }
    info.update(layer.feature.properties);
}

function resetHighlight(e) {
    geojson.resetStyle(e.target);
    info.update();

}

function zoomToFeature(e) {
   map.fitBounds(e.target.getBounds());
}

function onEachFeature(feature, layer) {
    layer.on({
        mouseover: highlightFeature,
        mouseout: resetHighlight,
        click: zoomToFeature
    });
}

geojson = L.geoJson(estados, {
    style: stateStyle,
    onEachFeature: onEachFeature
}).addTo(map);

//ASSIGNS LAYERS TO MAP
L.control.layers(baseMaps).addTo(map)

var info = L.control();

info.onAdd = function (map) {
    this._div = L.DomUtil.create('div', 'info'); // create a div with a class  "info"
    this.update();
    return this._div;
};

// method that we will use to update the control based on feature properties passed
info.update = function (props) {
    this._div.innerHTML = '
Mexican State
' +  (props ?
        '' + props.name + ''
        : 'Hover over a state');
};

info.addTo(map);


texts: Leaflet: Map tile request, hidden key/secret via proxy

texts:
I would like to request a Leaflet tilelayer without exposing my API key and secret. For example, using the UrtheCast API (but would apply to other similar APIs that embed api_key and api_secret in the URL), I am provided a map tiles URL like the following:

https://tile-{s}.urthecast.com/v1/rgb/{z}/{x}/{y}?api_key=MY_API_KEY&api_secret=MY_API_SECRET&cloud_coverage_lte=20&acquired_gte=2016-02-26T08:00:00.000Z&acquired_lte=2016-04-27T06:59:59.999Z

I can then load the tiles in Leaflet like:

var layer = L.tileLayer('https://tile-{s}.urthecast.com/v1/rgb/{z}/{x}/{y}?api_key=MY_API_KEY&api_secret=MY_API_SECRET&cloud_coverage_lte=20&acquired_gte=2016-02-26T08:00:00.000Z&acquired_lte=2016-04-27T06:59:59.999Z').addTo(map);

But, anyone looking at my JavaScript code would know my api key and secret.

The docs give the following warning: All apps developed are encouraged to be used internally or via a proxy. Otherwise there is a risk of exposing your API key and secret.

How can I make a proxy (preferably using PHP) to make a hidden call for Leaflet map tiles?


texts:
I'm looking for a spec sheet or a library to open and decompress .itm files from the Holux GPS logger.

Has anyone worked with the proprietary .itm format already and can provide me with some useful information?


texts: TileMill fails to load Europe data from PostGIS. What am I doing wrong?

texts:
The Problem:

Using OSM-Bright in combination with an imported (osm2psql) Europe shapefile, tiles won't load unless I have 2-3 layers active (of the total of 29). I don't have this problem with an imported Netherlands or Amsterdam shapefile. So I'm assuming it has something to do with the sheer amount of data that gets returned by the queries?

My Setup:

I am running TileMill with OSM-Bright on an Amazon EC2 c3.2xlarge:

8 x Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz 15.8GB RAM / linux ubuntu 14.04 trusty / TileMill 0.10.2

The only changed settings of Postgres I have done are:

work_mem = 2MB maintenance_work_mem = 32MB

Detailed description & what I have tried:

When loading the map, it seems as though the query times out. I have tried making a swapfile and monitoring memory when opening the project. The swapfile doesn't get touched and the memory gets drained to ~1% and stays there.

I won't get any errors when it 'times out' (tiles get the 'image not available' icon), not in the client interface, and when running TileMill via SSH there are no errors in the output. Very rarely I get a "PostGIS connection: null" error in the TileMill interface. When this happens, I get { [Error: socket hang up] code: 'ECONNRESET' } in the Tilemill log.

Screenshot:

Is there anything I can do to optimize the loading of the queries so I can work with the huge Europe dataset? Or is there any good practice in handling such large datasets with TileMill & OSM-Bright?

PS. for reference, this is the script I used while importing Europe into postgres (I don't know if it is relevant):

sudo osm2pgsql -c -G -C 14000 --cache-strategy sparse -U postgres -d osm /data/downloads/europe-shapefile/europe-latest.osm.pbf


texts:
I am trying to incorporate a WPS running in GeoServer into an OpenLayers client.  I am using this simple example as my reference.

Using either a local install of OpenLayers.js (v 2.12), or the http://openlayers.org/api/OpenLayers.js,
I get an error when the WPSClient is created.  In Firefox, I get OpenLayers.WPSClient is not a constructor.

Can anyone help me out with this error?


texts: Creating Drop Down List Variable with ModelBuilder?

texts:
I am building a model and am trying to create a variable (that will be turned into a parameter and then added as a field) that is a drop down list where only specific values can be chosen.

Any help in how to do this. I have:

right clicked the white space in ModelBuilder
clicked on create variable
selected string
right clicked on the oval and chose 'list of values'
Entered my list items

This doesn't seem to act as a drop down when running the model. Am I doing something wrong? These are text values I'd like in the drop down.


texts: What alternatives do I have for Directions API other than Google Maps and MapQuest?

texts:
I need an API, other than the two below that, given the starting point and possibly the ending point, will re-order a list of waypoints by the shortest, fastest or optimized route:

Google Directions API
MapQuest Directions API


texts: Definition query that returns based on date in arcgis

texts:
I was wondering if anyone knew how to build a definition query in Arcmap 10.0  that returns only features that are f.e. only 7 days old.
I have a SDE geodatabase with polygons, each with a "date"-field (format yyy-mm-dd). I would like to select these features based on their age:

Output 1 ;  Last 7 days
Output 2 ;  Last 14 days
Output 3 ;  Last 30 days
Output 4 ;  Last year
....

Thanks in advance


texts: Monthly average precipitation calculation from a GPM precipitation ImageCollection?

texts:
I want to extract the precipitation from a Image Collection and make a chart of the temporal variation of the precipitation. Can I take a single or a weighted mean of the geometry? How can I calculate the monthly precipitation? I tried following piece of code but I'm doing something wrong. How could I improve it?
var dataset = ee.ImageCollection('NASA/GPM_L3/IMERG_MONTHLY_V06')
    .filterDate('2000', '2020');
// Select the mean precipitation values.
var precipitation = dataset.select('precipitation').mean().clip(table);
var mask = precipitation.gt(0.0);
var precipitation = precipitation.updateMask(mask);

//Calcular la Precipitación mensual
var addMonthlyPrecip = function (precipitation) {
  var start = ee.Date(precipitation.get('system:time_start'));
  var end = start.advance(1, 'month');
  var hoursInMonth = end.difference(start, 'hours');
  return precipitation.addBands(precipitation.multiply(hoursInMonth).rename('precip_mm_month'));
};
var ic = dataset.map(addMonthlyPrecip);

Map.addLayer(ic, {bands:'precip_mm_month', max: 720});

//Darle colores al mapa
var palette = [
  '000096','0064ff', '00b4ff', '33db80', '9beb4a',
  'ffeb00', 'ffb300', 'ff6400', 'eb1e00', 'af0000'
];

//Plotea la media de la región
var stats = precipitation.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: table,
  scale: 10000,
  })
print(stats.get('precipitation'))

//Imprime el numero de imagenes que se estan operando
var precipitationVis = {min: 0.0, max: 1.5, palette: palette};
//Map.addLayer(clipped05, colorizedVis, 'NDVI');
//Define the chart and print it to the console.
Map.addLayer(precipitation, precipitationVis, 'Precipitation');
Map.setCenter(-66.6, 1.67, 6);
//Crear grafico imageCollection(serie de tiempo)
var chart =
    ui.Chart.image.series(dataset.select('precipitation'), table, ee.Reducer.mean(), 500,'system:time_start')
        .setSeriesNames(['precipitacion'])
        .setOptions({
          title: 'Average Precipitation',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'precipitation (mm/h)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['e37d05', '1d6b99'],
          curveType: 'function'
        });
print(chart);

This is the link:
https://code.earthengine.google.com/71b2c0ffc4ead42aefd1d769ae7b86f6


texts: What should be my learning progress regarding GIS open source

texts:
I was wondering for a while now, what should be the hierarchy of my GIS knowledge or better to say, learning curve in domain of open source GIS.

Should I start with Geoserver and PostGIS then transition to OpenLayers and finally wrap things up with GeoEXT or other way around?

To be fair, I started with OpenLayers (2.12) using books from Edin Hazzard and Antonio Perez Santiago, but now, as time progress I'm not so sure after all about my learning path, should I picked Geoserver or PostGIS first ?

( I know it's a dumb question but I need some insights about that topic )

Forgot to mention it that I have fair amount of knowledge in desktop softwares such as AutoCAD Map3D and ArcMap 10.x (recently started with QGIS)


texts: Print out centroid coordinates of a polygon in layout text box

texts:
I wanted to put the coordinates of the centre of a polygon in a text box in the print composer. When I run the expression in the labelling panel on the canvas it works, like below

However, when I run the same expression in a text box in print composer, I get an error.

Is there something that is missing?


texts: Location allocation in ArcGIS with an impedance parameter returning 'invalid impedance transformation type'?

texts:
I'm attempting to run a location-allocation analysis in the entire US using ArcMap 10.6. The demand points are zip code centroids, that have been loaded using Load Locations with two additional properties: Weight = Income and ImpedenceParameter = UrbanicityTravelTime.

Facilities have been loaded as is (points only). When running the location allocation minimize facilities, I tried to select power/exponential as the impedence transformation but I'm getting an error: "invalid impedence transformation type" when clicking 'Solve'. I assume this is the only way as in the ESRI documentation it states that Linear transformation ignore the impedenceTransformation parameter:

Demand points have an ImpedanceParameter property, which, if set, overrides the Impedance Parameter property of the analysis layer. You might determine that the impedance parameter should be different for urban and rural residents. You can model this by setting the impedance transformation for the analysis layer to match that of rural residents and setting the impedance transformation for the demand points in urban areas to match that of urbanites.

Does anyone know how to apply an impedence parameter (in this case, individual travel time for each of the demand points, essentially 5 different values based on the urbanicity of each point, with rural population willing to travel more to each facility)?


texts: Relative/Local Accuracy (of a map): Definition & Error Calculation

texts:
Here there is a good definition for Relative/Local accuracy of map:

  This is the accuracy of a point on the map relative to other points
  within the map/model.

It sound like theoretically we can map entire countries in local, and then just by shifting and rotating the entire map at once, this map will be aligned with some Global/Absolute DATUM.

So usually in specifications of map products I see:

  Global/Absolute accuracy - 1m, Relative/Local - 50cm

But isn't it extremely misleading information? In short I say so because it's impossible to map large coverage's with same local consistency.

Why this is not the correct interpretation of the terms?

The 50cm relative accuracy is within some local range, for example 1km. Thus ain't single shifting and rotating of entire map at once, rather than 1KM peice each time.

So if you use 10KM of this map, your accuracy is not 50cm, rather than going as square root in the number of local intervals (1KM) in your area of interest (10KM) (Basically this is just a well known math that the standard deviation going as square root, in this example it's basically means the accuracy is way worst than only 50cm).


texts:
When I tried to write a python script to run Count points in polygon (https://docs.qgis.org/2.8/en/docs/user_manual/processing_algs/qgis/vector_analysis_tools/countpointsinpolygon.html) in QGIS, I received the following message:

import processing
Result = "D:\aaaaa\DT\temp\saved_output.shp"
layer_1 = QgsProject.instance().mapLayersByName("UCL Main Campus")[0]
layer_2 = QgsProject.instance().mapLayersByName("Listed_Building")[0]
layer_3 = QgsProject.instance().mapLayersByName("Count")[0]
processing.run('qgis:countpointsinpolygon', layer_1, layer_2, 'NUMPOINTS', layer_3)
Traceback (most recent call last):
  File "D:\QGIS 3.6\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "D:/QGIS 3.6/apps/qgis/./python/plugins\processing\tools\general.py", line 105, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "D:/QGIS 3.6/apps/qgis/./python/plugins\processing\core\Processing.py", line 132, in runAlgorithm
    if context.feedback() is None:
AttributeError: 'QgsVectorLayer' object has no attribute 'feedback'

Does anyone know how to execute this function successfully in QGIS 3?

Updated on 10 July 2019

I modified my code to the following:

import processing
layer_1 = QgsProject.instance().mapLayersByName("UCL Main Campus")[0]
layer_2 = QgsProject.instance().mapLayersByName("Listed_Building")[0]
Result = "D:\aaaaa\DT\temp\saved_output.shp"
processing.run('qgis:countpointsinpolygon', {'FIELD' : 'NUMPOINTS', 'OUTPUT' : Result, 'POINTS' : layer_2, 'POLYGONS' : layer_1})

However, I still received the error message showing:

Traceback (most recent call last):
  File "D:\QGIS 3.6\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "D:/QGIS 3.6/apps/qgis/./python/plugins\processing\tools\general.py", line 105, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "D:/QGIS 3.6/apps/qgis/./python/plugins\processing\core\Processing.py", line 183, in runAlgorithm
    raise QgsProcessingException(msg)
_core.QgsProcessingException: There were errors executing the algorithm.


texts:
I have followed this great tutorial on pan sharpening using Grass GIS 7 (I'm using beta 3). Everything in the tutorial seemed to have worked, but my final output is not as expected (pictured below).

I tried with various sharpening methods, colour balancing stages and with and without atmospheric correction. I also tried with different images.

Any advice on where I'm going wrong?

Here's the output from r.univar:

Of the non-null cells:

n: 41623319
minimum: 0.089549
maximum: 1.17079
range: 1.08124
mean: 0.161591
mean of absolute values: 0.161591
standard deviation: 0.110987
variance: 0.0123181
variation coefficient: 68.6836 %
sum: 6725971.35730981


texts: Mercator projection: problem with latitude formula

texts:
I'm trying to get the position of a coordinate on this map (source Wikipedia):

If I'm correct than the formula for the position of the latitude would be:

    R * ln(tan(pi/4 + latitude / 2))

But I can't get it to work. The map is 707 px wide so

    R = 707 / pi / 2

right? I tried filling in a latitude of 51° like this:

    707 / pi / 2 * ln(tan(pi / 4 + 51 / 2)) = 91

And if you go to 91 px above the equator then you're somewhere in Spain, which is too low. I was looking for the location of Belgium instead.


texts:
Is it possible to get GML from a local vector layer (OpenLayers.Layer.Vector)?

What I would like to do is use the output geometry from my buffer tool to spatially limit a WPS gs:Aggregate request using a WFS/OGC filter. I am not sure if it is even possible (and there might very well be a better solution), but I would still be interested in knowing if it is possible to derive GML coordinates from a vector layer. I’m running the Boundless OpenGeo Suite (GeoServer).


texts: I'm curious as to the future of dojox.geo.openlayers.  Presently is seems only to be a solution for positioning widgets on the map but I can imagine developing a suite of map specific dijits such as TOC, filtering, measuring and editing tools and on and on.  Is anyone aware of (or willing to share) a roadmap for future dojox.geo.openlayers work or knowledge of other openlayers dijits?


texts: Cloning LayoutListElements to PDF question

texts:
What the cases where you need to clone LayoutListElements such as text elements, map surround elements, and graphic elements?

I am currently working on a one-page map document that I only need to print a one-page pdf by exporting a web map to pdf.

Here is a picture of the layout. The example that I am following in option 2 looks like it is generating a map and followed by a table. Printing Popup Example Blog from ESRI

Here is the map document that I am working with:

I don't need to generate a table. I just need to print text some dynamic text elements and a mapsurround element. In addition, the blog post example for their python script looks like they remove cloned elements when they export the map through their delElements() function.

Here is the delElement() and export() function for reference:

# the function takes a map and an array
# it export the map to a pdf and add the pdf's path in the array
def export(map, pdfPaths):
    delElements()
    s = generateUniqueFileName()
    print s
    arcpy.mapping.ExportToPDF(map, s)
    pdfPaths.append(s)

# removing the elements stored in the original mxd
# that are already cloned
def delElements():
    global line_sep, line_sep_feat, txtLyrNm, txtFldNm, txtFldVal
    if (line_sep != None):
        line_sep.delete()
        line_sep_feat.delete()
        txtLyrNm.delete()
        txtFldNm.delete()
        txtFldVal.delete()

Is this a requirement every time you generate a pdf?

Would this be necessary if I am only printing one page with dynamic text in order for new values to be passed onto the map document? For example, would you need to delete text element labelled WLA (its wild card name is called district_name) and update that value?


texts:
I have:

Estimated population dataset: Raster
Census Tract: Polygon

I want the population of each census tract within a city. Could you please tell me how to calculate the population when cells partially overlap the census tract?


texts:
I am using QGIS to record field data and also meandering field transects.  When I was using ArcGIS I could turn on the tracklog function and a shapefile could be created of automatically generated points, and the recording interval could be varied by the user.

QGIS tracks your movement on screen with a red line, but it is not recorded as a tracklog.  Is there a way/plug in that performs a tracklog recording task in QGIS?


texts: ArcGIS 10.5.1 "Name of an entry in the codedvaluedomain is empty" error

texts:
I am trying to create a model in model builder that will convert a CSV file to a dbf and then import that as a domain into a specified geodatabase.

I was able to do this in another model by exporting the domains of one geodatabase (using Domain to Table) into another (using Table to Domain).

This time, however, the model crashes stating:
"Error 999999: Error Executing function. The name of an entry in the CodedValueDomain is empty. (domain name: Py Test)
Failed to execute (Table to Domain)."
I am typing in the names of the fields for code and description ("code" and "description", respectively.)
In my other model, I have to type the fields in by hand, but it still works. This time I don't seem to have as much luck.

I thought it was because of the specific model parameters that are defined up to that point, but it still follows the logical order.

I am not able to post a screenshot.

Has anyone encountered this?


texts: Selecting points under polygons using ArcGIS Desktop?

texts:
I have a point layer and a polygon layer (created from the point layer using local convex hull isopleths). I would like to be able to select only those points laying within the multiple polygons (all in same layer).

Is there a way to mask a point layer with a polygon layer?

Even if I can just select the points inside I can then export them to a new layer.

ArcMap 9.3.1


texts:
We need to get LabelGeometry from a feature. There is such a class QgsLabelPosition, it sets parameters. I need to get the parameters of the bounding box label.

Version QGIS 3.16.4


texts: How to remove the description information when exporting to KML?

texts: I have been working in ArcGIS to convert shapefiles into kml files using ArcGIS toolbox. The resulted kml/kmz contain some extra set of information in the description field that is used to show a pop-up screen when clicked on a record. This is really unwanted for me and I am required to delete this html links. I open each of the records and remove all html code from their Description field. Does anyone know whether there is an automatic way/tool to do the same, that can remove the code from all the records at a single cycle?


texts: Calculating polygon area inside another polygon in QGIS

texts:
Is it possible to calculate the area of colorful polygons (yellow, yellowish/reddish and red) inside another shapefile (purple outline, also polygons) in QGIS.

For example the polygon that is marked with red line: i'd like to know how much there is yellow, red etc inside the polygon with purple colored outline (area).


texts:
I made a heatmap from points (with values) in QGIS, and now try to understand what the values in color scale are.

Radius 300 map units (meters)
Pixel size 10 map units (meters)
Point values are 10-100.

In heatmap options, I see the kernel function is uniform.

Result values are 0-0.04 . How are they calculated? I want to recalculate it to some real life scales, sum(values)/area.

A test sample: same parameters (radius 300 meters, pixel 10 meters). All points fall within radius, their sum is 152. The result values are 0-0.04. I don't get where .04 came from.

Test calculation. If I assume radius in heatmap pixels, it's 30 px, then

In [8]: 152. / (30 ** 2 * math.pi)
Out[8]: 0.05375900299992909

What is 0.04 then?


texts: Allowing user to choose multiple input files in ArcGIS ModelBuilder?

texts:
I have built a basic model to run some calculations on a number of feature classes in Model Builder. These tools include Merge, Delete Identical, Make Table, Select Layer Attribute, Delete Rows and a Make XY event layer. Currently the model has a number of feature classes added directly to the model.

At the beginning, I would like the user to be able to choose which feature classes they add for processing. It should look like the options you get when using the Merge Tool in ArcMap where the user can browse to the files to be processed. The files could be anywhere on the PC and not necessarily in the same workspace.

Is this possible?


texts: GI or tabular data sources for Global obesity data?

texts:
I am trying to find either a shp file or some csv, txt etc... showing the %obesity and/or overweight figures broken down per country.
I have checked the World Health Organisation Data Repository but I am unable to find any tabular or shp data on there.

Does anybody know of any free resources showing this data at a country level?


texts: OGC webservice engine like geoserver in .NET

texts:
In java there are a lots of third part libraries which can used to create OGC webserivce like wcs/wfs/wms etc.

However I have not found anything similar in .NET.

We are currently using ArcGIS Engine, but it ArcGIS Engine does not support web applications.

Is there a alternative?


texts: How to use -lco options in gdal_contour?

texts:
I'm trying to create contours from geotiff raster with gdal_contour. My output format is Postgresql and I would like to ovewrite the existing table.

When I do:
gdal_contour -a 1 -f PostgreSQL -i 50 -nln new_isolines dem.tif "PG:host=localhost port=5432 dbname=mybase user=postgres password=postgres"
I get:
ERROR 1: Layer new_isolines already exists, CreateLayer failed.
Use the layer creation option OVERWRITE=YES to replace it.

But when I do:
gdal_contour -a 1 -f PostgreSQL -lco OVERWRITE=YES -i 50 -nln new_isolines dem.tif "PG:host=localhost port=5432 dbname=mybase user=postgres password=postgres"
I get a wrong usage message.

I know I can do it with ALTER/DROP table in my db prior to contouring with gdal, but that's unconvenient, because I want to set some more layer creation options:
OVERWRITE=YES
GEOMETRY_NAME=wgsgeom
FID=id
So how do I set theese options in gdal_contour utility?


texts: Is it possible to create specific-sized watershed in a GIS environment?

texts:
I used the GRASS gis module to design catchment area with a minimum size of 2 kmsq. However, I would like to know if, in addition to the minimum size, I can limit a maximum size of 5 kmsq for them.
In GRASS GIS, SAGA GIS or ArcGIS ...


texts: For a given feature find the closest point along a given path

texts:
Looking for a Java based (foss4g) solution for the following:

I am using a path along with a buffer to find features that are along the path. For each of the features returned I want to find the coordinate that is best fit ... meaning a straight line from the feature to the path and gleaning the point on the path.


texts: Building a polygon using COGO/traverse in ArcGIS Pro

texts:
I have a legal survey and I am trying to digitize a polygon boundary using the metes and bounds. In ArcMap, I would just edit an existing polygon layer using Traverse. In Pro, the "Modify Features" window is only allowing me to select line features from my table of contents, it doesn't seem to recognize any of my polygon layers.
I was able to enter all the metes and bounds and create the boundary with a line layer, but I still need to convert that into a polygon.
The documentation for the Traverse tool on Esri's site says "A traverse can be entered to create a series of line features or a single polygon feature. When entering a traverse, a line feature layer or a polygon feature layer can be used to create the traverse."
Is there some kind of setting that I am missing to allow the Traverse tool to "see" my polygon layers? I am new to Pro.


texts: ArcGIS WFS-T(Transactional) Service not able to edit in QGIS

texts:
I have published as WFS-T(Transactional) Service for Enterprise data of one Feature class through ArcMap 10.6. Using that WFS URL I have connected in QGIS 3.6 as WFS connection, I can see the data. But I am trying to create one feature or delete feature or update feature not saving the edits. It's giving below error:

Commit errors : Could not commit changes to layer layername

In ArcGIS server log having below error:

  Method failed.HRESULT = 0x80070057 : The parameter is incorrect


texts:
I try to load rasters through raster2pgsql. I try to call it through pgAdmin command line, but when I call any raster2pgsql command (even raster2pgsql -G), it does nothing, I just get another line to write more commands. No output, no time doing something. Non-gdal psql commands work as expected. \raster2pgsql leads to "invalid command" error. I am new to the command line and psql, so I'm stuck here.

I have PostgreSQL 9.3.4, PostGIS 2.1.3 and pgAdmin III 1.18.1 on WIndows XP 32 bit. I made sure that raster2pgsql.exe is in its place in bin folder, but I don't know of other ways to validate whether it is installed properly.


texts: ArcMap Crashes when inserting new feature in multi-Threading add-in

texts:
I'm developing a ArcMap add-in that get dynamic feeds from the network and append the newly arrived data to a suitable featurelayer.
I'm using InMemoryWorkspace, FeatureBuffer, FeatureCursor, Thread.

void DoJob()
{
    Thread th = new Thread(run);
    th.SetApartmentState(ApartmentState.STA);
    th.Start();
}

private void Run()
{
    IFeatureClass ipTargetFC = ...//get FeatureClass from the suitable FeatureLayer in TOC
    IFeatureCursor featuresToCopy = ...//parse the incomming data and create `in memory workspace` and a new FeatureClass holding the parsed data

    ArcMap.Editor.StartOperation();
    InsertFeaturesUsingCursor(ipTargetFC, featuresToCopy);
    ArcMap.Editor.StopOperation("End Editing");
}

public static void InsertFeaturesUsingCursor(IFeatureClass ipTargetFC, IFeatureCursor featuresToCopy)
{
    IFeatureCursor ipInsCursor = null;
    try
    {
        IFeatureBuffer ipFBuff = ipTargetFC.CreateFeatureBuffer();
        ipInsCursor = ipTargetFC.Insert(true);
        IFeature ipFeat;
        IFields ipTargetFields;
        IField ipTargetField;
        int featureOID;
        while ((ipFeat = featuresToCopy.NextFeature()) != null)
        {
            ipFBuff.Shape = ipFeat.ShapeCopy;
            ipTargetFields = ipTargetFC.Fields as IFields;
            for (int i = 0; i < ipTargetFields.FieldCount; i++)
            {
                ....//code for validating and copying fields' values from `featuresToCopy` to `ipFBuff` (ipFBuff.set_Value(i, value);)
            }
            featureOID = (int)ipInsCursor.InsertFeature(ipFBuff);
        }
        ipInsCursor.Flush();
    }
    catch (Exception ex) { throw ex; }
    finally
    {
        if (ipInsCursor != null)
        {
            System.Runtime.InteropServices.Marshal.ReleaseComObject(ipInsCursor);
            ipInsCursor = null;
        }
    }
}

My Problem Is:

when the execution reatches the line

featureOID = (int)ipInsCursor.InsertFeature(ipFBuff);

the ArcMap itself crashes

where is my fault?


texts:
I am using ArcMap 10.4.1 and am having an issue with projections.

I am digitizing data off of a basemap which had the projection NAD 1927, accidentally I created the shapefile with NAD 1983. I have already done a lot of the digitization so I do not want to start over.

When I run the define or the project tool to change the projection the features all move to the wrong place.

I have also tried to delete the projection file but the same thing happened.

How can I change the projection without my data moving?

The blue is the original 1983 (correct location)

Green is after the define tool to 1927

Pink is after the project tool to 1927 (I have tried all the geographic transformations available in the drop down)


texts: I'm using the TRMM  3B43 precipitation data. I have downloaded individual NetCDF files depicting yearly accumulation in mm for each year from 2000 to 2015 (16 files). I have imported each file into ArcGIS as a raster file, and each shows a different min & max. I now want to calculate the average annual precipitation from 2000 to 2015. How would you recommend I do this?


texts: GeoServer inserting braces instead of empty text

texts:
I'm running GeoServer 2.13.1 with a Postgres database behind it and try to update features through WFS-T. Which works, except when I try to set fields to null or empty texts. In those cases GeoServer writes a pair of braces {} into the database instead.

Why is that? How can I change that?

EDIT:
The columns are of type character varying in postgres and of type string in geoserver.
The WFS-T request looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs/2.0" service="WFS" version="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0">
    <wfs:Update typeName="abc:layername" xmlns:abc="http://www.example.com/geo/abc">
        <wfs:Property>
            <wfs:ValueReference>columnA</wfs:ValueReference>
            <wfs:Value />
        </wfs:Property>
        <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
            <fes:ResourceId rid="layername.12345" />
        </fes:Filter>
    </wfs:Update>
</wfs:Transaction>

EDIT 2:
A log extract showing that it is GeoServer who decides on the braces when writing into the DB:

2018-09-03 17:57:04 CEST LOG:  execute <unnamed>: UPDATE "layername" SET "columnA" = $1 WHERE ("fid" = $2)
2018-09-03 17:57:04 CEST DETAIL:  parameters: $1 = '{}', $2 = '12345'


texts: Get project map extent in standalone PyQGIS script

texts: How can I get the map extent defined in QGIS project in standalone python script? Not for a layer, but for the map canvas. Since it is a standalone script, I cannot use iface class and QgsMapCanvas().extent() only gives me <QgsRectangle: 0 0, 0 0>. Using QGIS 3.4.


texts: Controlling precision of coordinates returned from ArcGIS for Server service?

texts:
I have a REST service that returns shapes as json. The shapes represent various natural features.

The problem is the precision of the coordinates. Currently, 11 decimal places of precision are returned for each vertex. For these features, that level of precision is ridiculous and one or two places is more than adequate.

I'm not sure of this can easily be controlled at the service level or if I can do this at the ArcSDE level. At this point, I just want to control the number of decimal places returned for the vertices and it doesn't matter where I make the change. If I need to create a duplicate feature class that contains reduced precision and access it with another service, I'm okay with that.

This is Oracle 11g. Geometry is stored as ST_GEOMETRY. XY Resolution of the source feature class is 0.0001 meter.

The spatial reference of the source ArcSDE feature class is EPSG:2823. The service matches.

When I use Data Management Tools > Features > Add XY Coordinates, the resulting attributes are displayed to 0.0001 meters (matches the XY Resolution).

Here's a sample of the coordinates from the service. The first four decimal places are correct and this matches the XY Resolution. Beyond the 4th decimal place shouldn't be returned at all (my opinion) but looks like floating point artifacts.

  [ ***556.01240000036, ***194.83640000038 ],
  [ ***575.52120000031, ***232.26889999956 ],
  [ ***577.23070000019, ***239.59820000082 ],
  [ ***601.91760000028, ***295.97729999945 ],
  [ ***612.37299999967, ***327.78720000014 ],
  [ ***647.73350000009, ***402.59310000017 ],
  [ ***671.43950000033, ***444.35270000063 ],
  [ ***689.12970000042, ***481.14739999922 ],


texts: Making multiple buffer, one with field values, one with a fixed value

texts:
I use ArcGIS 10.2.2 Basic.

I have a point shapefile with a field called buffer with different values, depending of what kind of type the point is. Some of these points also need an extra buffer outside the buffer from the buffer field. This value is set at 5 meter.

I can't find any tool that lets me do a multiple buffer, with a field value and a fixed value.

So what I do, is that I create a buffer for the whole set, with FIELD Buffer as the value:

I then export all features that need the extra buffer of 5 meter, into a set of it's own, and do a Multiple Ring Buffer with 5 meter on it:

The purple circles are now just increased in size. I want them to have a ring outside its first buffer value, with 5 meter. My ideally thought is the one you get out from multiple ring buffer, with 2 ObjectID's:

And, at the end, I want to merge the polygons that didnt need the 5 meter buffer togehter with the ones who did.

Is this not possible with different buffer sizes in a data set?


texts: I have some animal tracking data in the form of a polyline shapefile and want to convert this to a raster so that each pixel is given a value of 1 for every instance in which a line crosses it. I've tried using Feature to Raster in ArcMap, with the Field specified to a field in which every line has a value of 1, but this only produces a raster with all pixels of "1" value, there is no consideration of the density of lines. I've also used Line Density, but this is taking into account lines within the radius of each pixel rather than only within the pixel.


texts: One Record Two Point Geometries - Point-in-polygon

texts:
The trip data contains the origin-destination of each trip, and both origin and destination are stored as geometries. How could I retrieve the origin and destination polygons that the points are located?

The following code works fine to find the polygon which the origin is located. I need to determine the destination_polygon as well.

SELECT p.id as origin_polygon
FROM trips t, polygons p
WHERE ST_Contains(p.geom, t.origin)


texts: Is it appropriate to create vertical scale bars?

texts:
I'm working on a map where the main theme is a railway line which runs vertically down the page. I've been wondering how to approach creating a scale bar for this map. To my eye a horizontal scale bar looks wrong in this case - it's not easily associated with the vertical content of the map, especially given that it's primary purpose would be to measure distances on the vertical railway line.

So I'm leaning toward a vertical scale bar, but I'm unable to find any literature regarding use of vertical scale bars, or even any examples of maps which utilise them.

Apart from the fact that no GIS packages capable of creating these out-of-the-box, is there any reason why using a vertical scale bar would not be appropriate?

Update: here's a quick mockup of a similar product to what I'm creating:

Update 2: more mockups based on @jbalk and @TDavis' ideas:


texts: How do you make a field read only using Arcobjects?

texts:
I have created add-in toolbar with C# arcobjects. I am creating some empty geodatabase shapefiles. While creating featureclass i want to assign some default value to attribute and then make it read-only so user can not modify that value later.

IField field = new ESRI.ArcGIS.Geodatabase.FieldClass();
IFieldEdit fieldEdit= (ESRI.ArcGIS.Geodatabase.IFieldEdit)field ;
fieldEdit.Name_2 = "something"
fieldEdit.Type_2 = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString;
fieldEdit.Length_2 = 10;
fieldEdit.DefaultValue_2 = "yes";

when i set fieldEdit.Editable_2 = false, then in attribute table, i see default value null instead of "yes", field is non editable.

I want field value as yes and non editable. Any suggestions?


texts: Syntax for using ArcGIS for Server layer with WMS service?

texts:
I am having some issues with getting an image/png format from an ArcGIS Server.   The console returns:

Resource interpreted as Image but transferred with MIME type application/vnd.ogc.se_xml:     "http://meshekgis.com/ArcGIS/services/mustang/Mustang_Map/mapserver/WMSServe…3A900913&BBOX=15028131.255,-5009377.085,20037508.34,0&WIDTH=256&HEIGHT=256".

Here is the JavaScript I am using:

var arcserver_wms =   "http://myserver.com/ArcGIS/services/mustang/Mustang_Map/mapserver/WMSServer";

var arcserver_wms = new OpenLayers.Layer.WMS("ArcServer WMS", arcserver_wms,
                    {
                       layers:"0",
                       FORMAT: "image/png-8"
                    },
                    {
                        isBaseLayer: false,
                        opacity: 0.5
                    });


texts: How to efficiently render and enable user interaction on thousands of points with Leaflet?

texts:
I've got a large dataset comprised of about 10k points representing gas stations. Some of these gas stations sell diesel fuel, others do not.

In my web map, I want to let the user switch between viewing all gas stations and just the ones that sell diesel fuel. Moreover, I need the points to be interactive (i.e. popups with individual data).

I am trying to find a suitable technique for accomplishing this with Leaflet and Mapbox. But I can't seem to find a method with an acceptable loading time. I just need someone to point me in the right direction here. Any help is greatly appreciated!

UPDATE:

This map from NPR is kind of what I'm striving for, but with the added ability to switch between states. That is, removing and adding points based on their attributes.


texts: How to project new image to coordinates in Openlayers

texts:
I am attempting to add a new image to the map which I have gotten working with the following code:

                const extent = [-30, -50, 10, 90];

                const projection = new Projection({
                    units: 'pixels',
                    extent: extent
                });

                let imageLayer = new ImageLayer({
                    source: new Static({
                        url: 'https://imgs.xkcd.com/comics/online_communities.png',
                        projection: 'EPSG:4326',
                        imageExtent: extent
                    })
                });

                this.props.map.addLayer(imageLayer)

However I need to project the image so it lines up with the latlong of feature on the map as the below images illustrate. Could someone point me in the right direction?

Latlong coordinates:

[
  [
    -65.169777,
    59.11845
  ],
  [
    -72.442551,
    59.865898
  ],
  [
    -71.30043,
    63.440392
  ],
  [
    -63.176235,
    62.648335
  ],
  [
    -65.169777,
    59.11845
  ]
]

Feature:

Projected image:


texts: Renaming columns in attribute table of joined data - integer data

texts:
Using QGIS 2.14.4 (Essen). I am trying to join an excel for data about species surveys which were conducted at different locations, by blocks of area which is a separate shapefile I have already. I am able to convert the excel into a CSV, add this with "No geometry" and then join this to the Block data layer by using shared Block IDs found in both tables, however, when joining data the attribute table columns are named after the originally joined excel file e.g."Anchor D_1"; "Anchor D_2"
I found a solution here: Renaming attributes/fields in shapefile attribute table using QGIS?

However, I seem to be unable to rename any column which contains Integer data (see image). Any answers?


texts: Are there any shapefiles for a simple road network of the UK that are similar to Google Maps?

texts: I wish to add a shapefile to ArcMap that displays a road network which is similar to what you may find on Google Maps. I don't require a detailed Ordnance Survey map, just the roads.


texts: Working Windows Standalone .EXE From QGIS Python Script Using PyInstaller?

texts: Has anyone been able to create a working standalone Windows .EXE file from a QGIS Python Script Using PyInstaller?


texts: How to select points which are below (under) polygon in 3D?

texts:
I have two layers. Points are (point z) shape and polygon is (polygon z) shape.
I would like to select only point which are under polygon. Look at picture, On the first one you can't see points which are under polygon, on a second one I turned off polygon layer(all points are visible).

Is it possible to convert polygon to some kind of volume(object) and then use select by location (contain the source layer feature) in 3D?
Any other ideas?


texts: Connect points and store point info in line attributes

texts:
I have a point shapefile where I want to connect all points (25 points that makes 600 pairs).

As a result, I need a line shapefile with attribute table that contains points lying on the line.

e.g.

lineID    pointID1    pointID2
  1          25          16

I've tried few plugins including points2one, MMQGIS, etc., but none of them worked.


texts: ESRI Linear Referencing and negative lengths

texts:
I have been asked this question regarding Linear Referencing (for Arcmap 10.1), but i do not have much experience with it so I am hoping someone out there can help.

Essentially, I want to know how events are handled if a route changes length (ie. point a to point b length is changed, and point a is now in the middle of the line length).

Hope that makes sense!?


texts: Why my sceneID doesn't work to download in landsat-utils?

texts:
I need to download Landsat images automatically in order to do a forest monitory. I'm using package landsat-utils. However, when I set my sceneID from my interest region the code doesn't work as I have expected.

So, here is one example of sceneID (LC82150682015350LGN01) which I would like to acquire to test my script.

I have tried to put my username and password from USGS however it doesn't fix the problem, but the problem hold on.

Here the code:

$ landsat download LC82150682015350LGN01

AttributeError: 'RemoteFileDoesntExist' object has no attribute 'message'

When I set my USGS username and password the error has been:

AttributeError: 'USGSError' object has no attribute 'message'

Why I am not get the file with this sceneID? I have changed it and I had the same problem.


texts: Unable to import FileImport from cartodb-python client

texts:
Getting the following error:

ImportError: cannot import name FileImport

Code, taken directly from Carto documentation:

from cartodb import CartoDBAPIKey, CartoDBException, FileImport

API_KEY ='MY_API_KEY'
cartodb_domain = 'MY_DOMAIN'
cl = CartoDBAPIKey(API_KEY, cartodb_domain)

# Import csv file, set privacy as 'link' and create a default viz
fi = FileImport("ground_temperature_KG.csv", cl, create_vis='true', privacy='link')
fi.run()

The cartodb-python client that I installed seems to include everything. CartoDBAPIKey and CartoDBException are located in cartodb.py and FileImport is located in imports.py. But import is only recognizing the first two modules and not the last...


texts: TypeError: sequence size must match size of the row, SQL Case Syntax error?

texts:
I am receiving this error when using an insert cursor in ArcPy.

I have identified the cause of it as a syntax error, however have not figured out the correct syntax to resolve the error.

I am using a CASE statement to convert a boolean data type to a string.

The statement works in Management studio, however there is something clearly wrong with the Python syntax which is causing the error.

I am converting the isproject from SQL Server to Oracle SDE.

The date conversion works fine; however the conversion for isproject is not working as expected.

When I debug fieldnames_string this is the output for the isproject

CASE WHEN [isproject]=1 THEN 'TRUE' WHEN [isproject]=0 THEN 'FALSE' END

What needs to be changed in this SQL statement to to avoid this error?

import arcpy
import datetime
fieldnames = [field.name for field in descrip.fields if field.name != descrip.OIDFieldName]

        #workaround for dates conversion
        fieldnames_wrapped = []
        for fieldname in fieldnames:

            if 'date' in fieldname:
                fieldnames_wrapped.append('CONVERT(VARCHAR, {0})'.format(fieldname))

            if 'isproject' in fieldname:
               fieldnames_wrapped.append("CASE WHEN [isproject]=1 THEN 'TRUE' " +\
                                       "WHEN [isproject]=0 THEN 'FALSE' END".format(fieldname))

            else:
                fieldnames_wrapped.append(fieldname)
                fieldnames_string = ','.join(fieldnames_wrapped)

        # execute sql to get all new/updated tickets
        ticket_sql = "select {0} from {1} where {2} in ({3})".format(fieldnames_string, self.ticket_table_name, self.ticket_id_field, job_id_string)
        self.logger.debug(ticket_sql)

        conn = arcpy.ArcSDESQLExecute(self.korterra_sde_path)
        results = conn.execute(ticket_sql)

        if results is None:
            raise Exception('Ticket query unsuccessful')
        elif results == True:
            # no results were returned
            raise Exception('Ticket query returned no results')

        with arcpy.da.InsertCursor(ticket_table, fieldnames) as cursor:
            for result in results:
                # remove empty strings because of date conversion error
                row = [value if isinstance(value, basestring) and len(value.strip()) != 0 else None for value in result]
                cursor.insertRow(tuple(row))

        return ticket_table


texts:
I'm using QGIS 2.18.3 (Las Palmas).
In order to determine the number of buildings within a district I'm using spatial Query in QGIS. I filter out the specific district within my city-layer so I can apply the spatial query to it. I then go into the attribute Table of my building-layer and input the district for the labelled buildings.

Is there a possibility to automate this process? Does spatial query have a batch-possibility?


texts:
I am a student and initiating a thesis project for MS specialize degree in geophysics.
I am working on tectono - stratigraphy of some area and want to do the 3D subsurface modelling of the same area but have lesser idea, besides am unable to get some proper guide on this too but since i love doing this I want help plzz...
As far as i have studied 3D analyst is not very much suitable for this job yet "may be" used in thesis.


texts: GEE Hypothesis Test for Regression Slope

texts:
I am using Google Earth Engine to calculate linear trends over time using the linearFit reducer. I am interested in identifying pixels that exhibit significant increasing and decreasing trends using a standard hypothesis test on the slope parameter. This is what I have so far:

var point = /* color: #d63000 */ee.Geometry.Point([-133.49, 69.18]);
var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
  .filter(ee.Filter.lt('CLOUD_COVER',10))
  .select(['B3', 'B4'])
  .filterBounds(point)
  .filter(ee.Filter.calendarRange(7,8,'month'));

//adds ndvi as band 'B4_1'
var ndvi = function(image) {
  var nir = image.select('B4');
  var red = image.select('B3');
  var ndvi = nir.subtract(red).divide(nir.add(red));
  var proimage = image.addBands(ndvi);
  return proimage;
};

var createTimeBand = function(image) {
  return image.addBands(image.metadata('system:time_start').divide(3.154e10));
};
var stack = l5.map(ndvi).map(createTimeBand);
var linearFit = stack.select(['system:time_start','B4_1'])
.reduce(ee.Reducer.linearFit());

// Reproject using the CRS parameters of one of the original images.
var reprojected = linearFit.reproject({
  crs:'EPSG:32609',
  crsTransform:[30,0,278985,0,-30,7849515],
});
var linpar = {min: 0, max: [-0.01, 0.01, 5], bands: ['scale', 'scale', 'offset']};
Map.addLayer(reprojected, linpar, 'reprojected');
Map.setCenter(-133.50, 69.19, 9);

The linearFit reducer returns the slope and offset, but I am wondering if there is some way to retrieve the standard error or p-values for these parameters. Are there other earth engine functions that would allow me to calculate confidence intervals or p-values?


texts:
I am on Ubuntu16.10. I would like to install GDAL on Python3.6.
I have installed Python3.6 with apt-get install python3.6.
I am installing GDAL with:

apt-get install -y software-properties-common python-software-properties
add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
apt install gdal-bin python-gdal python3-gdal

The problem is that in this way, GDAL is installed on python3.5 not on the 3.6.
The problem seems to be python3-gdal, because:

apt show python3-gdal

gives:

Package: python3-gdal
Version: 2.2.1+dfsg-2build3
Priority: optional
Section: universe/python
Source: gdal
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 2242 kB
Provides: python3.5-gdal

On Ubuntu16.10 it provides python3.5-gdal. Is there a way to force it to provide python3.6-gdal?


texts:
I have to create view points in order to do a simple intervisibility analysis. However, when I run it, I get this message:
I tried fixing the geometry, as there seems to be a null geometry somewhere, so I ran the fix geometry tool and used this new layer instead. It still gives me the same message. Does anyone know how to fix this?


texts:
I'm currently applying a select by attribute query to select null values before applying an increment cursor, but I'm interested in reducing the code by using a where clause and employing the updated da module. Current code:

arcpy.MakeFeatureLayer_management (fc, "fc_update")
gisID = "GIS_2016_0"
where_clause = 'GIS_2016_0 IS NULL'
MaxValue = 1000

def autoIncrement (start=0, step=1):
    i = start
    while 1:
         yield i
         i+=step

nextValue = MaxValue + 2
incrementer = autoIncrement (nextValue, 2)
with arcpy.da.UpdateCursor ("fc_update", gisID, where_clause) as incrementCursor:
print "Populating fields with no IDs"
    for row in incrementCursor:
        row.setValue(gisID, incrementer.next())
        incrementCursor.updateRow(row)
    del row, incrementCursor
    print "Finished populating null fields"

I get the error AttributeError: 'list' object has no attribute 'setValue'

I'm not certain about how to adapt the increment statements to accommodate a da update cursor, or if my where_clause statement even works.


texts: Calculating sum of all pixel values of world population map without defining area of interest in Google Earth Engine

texts:
I would like to know the world population in the year 2015 according to WorldPop data without bounding the calculation of the sum to a specific region or area of interest.
What is the function for doing this?
var worldPop = ee.ImageCollection("WorldPop/GP/100m/pop");

var WP_2015  = worldPop
  .filter(ee.Filter.equals('year', 2015))
  .select('population');

https://code.earthengine.google.com/393e834ade64a583c840444cb7547afb


texts:
In my project (a desktop application) I need to create a map with three layers, basic geographic layer at the bottom, a GSM coverage area layer on top of it, and then a location based services layer on top of that. After creation, I have to navigate through the map and get the data of a location, longitude, latitude, GSM signal strength and the services available to that position.

Does any one know a tool that I can use to develop such kind of map?

If it is a open source one is it better?

Also I need to navigate the map interact with it and get data from my desktop application, is it possible to do after making such kind of map?

I'm programming using java programming language.


texts:
Currently, I am running the latest MacOS (Big Sur). I have two versions of QGIS (3.10 and 3.16). Oddly, I can open SCP plugin in 3.10 but the program will crash after running Landsat 8 TOA. When I open 3.16, I can't load the SCP plugin, and shows the error below (several other plugins have similar issues):
Couldn't load plugin 'SemiAutomaticClassificationPlugin' due to an error when calling its classFactory() method:
ModuleNotFoundError: No module named 'matplotlib'
Traceback (most recent call last):
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/__init__.py", line 65, in classFactory
    from .semiautomaticclassificationplugin import SemiAutomaticClassificationPlugin
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/semiautomaticclassificationplugin.py", line 83, in
    from .ui.semiautomaticclassificationplugindialog import SemiAutomaticClassificationPluginDialog
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/ui/semiautomaticclassificationplugindialog.py", line 39, in
    from .ui_semiautomaticclassificationplugin_scatter_plot import Ui_ScatterPlot
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/ui/ui_semiautomaticclassificationplugin_scatter_plot.py", line 453, in
    from .scatterwidget2 import ScatterWidget2
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/ui/scatterwidget2.py", line 39, in
    import matplotlib
  File "/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'matplotlib'

Python version: 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) [Clang 6.0 (clang-600.0.57)]
QGIS version: 3.16.0-Hannover Hannover, exported

Python Path:
/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python
/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.16.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/SQLite3.framework/Versions/F/Python/3.8
/Library/Frameworks/Python.framework/Versions/3.8/lib/python38.zip
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
/Users/jasperzhou/Library/Application Support/QGIS/QGIS3/profiles/default/python

Does anyone know how to fix this issue at all?


texts: Trying to change point style -> RangeError: Maximum call stack size exceeded

texts:
I'm trying to change the style of some points of a GeoJSON file loaded in OpenLayers and I getting this error:

RangeError: Maximum call stack size exceeded

I want to modify the point style related to a GRID_CODE value, located inside the file. I can access the value and iterate the whole array of values with no problem, the error only shows when I try to modify the feature. I tried to change only the point color, but the same error happens.

My code:

var myVectorLayer = new VectorLayer({
  source: new VectorSource ({
    format: new GeoJSON({dataProjection: 'EPSG:31982'}),
    url: '/geojson/flowdirection.geojson'
  }),
  zIndex: 55
});

// Change style to a arrow image, relative to the GRID_CODE
myVectorLayer .getSource().on('change', function(evt){
  var newsource = evt.target;
  var myFeatures = newsource.getFeatures();

  if (newsource.getState() === 'ready') {
    var numFeatures = newsource.getFeatures().length;
    for (var i=0; i < numFeatures; i++) {
      // Get the grid code
      var gridCode = myFeatures[i].get("GRID_CODE");
      // Change the point style to an arrow image
      if (gridCode == 1) {
        myFeatures[i].setStyle(new Style({
          image: new Icon({
            src: 'img/arrow.png'
          })
        }))
      }
    }
  }
});


texts:
I am trying to export my map project to vector format (i.e. PDF), but somehow cannot get my line thickness right. While a raster export (i.e. PNG) gives me exactly what I have designed, the PDF always comes out too thick, like it can't display thinner lines. Screenshots are below. Any ideas how to solve this?

PNG:

PDF:


texts: Using symbology for representing start and end (polygon / point) in QGIS

texts:
I have records with two geometry columns per record. I have been looking at different options to show them in QGIS:

Create two layers (one for start and one for end)
Create a multipolygon that merges the two (start and end) polygons

The issue with #1 is that it doesn't show the link between the two zones within a single record. The problem with #2 is that I am not sure how to show the difference between the start and end polygon through symobology.
Any ideas?


texts: Automatic indentation for MAP files in VIM

texts: Following Notepad++ syntax highlighting support for .mapfiles?, does anyone know a way to automatic indent MAP files? I use VIM but so far I haven't found a way to do this on MAP files. I have found for other file formats, such as JS and HTML, but they don't work with MAP files.