texts: Error in LineEdit when show parsing value as string

texts:
I m trying to make QGIS plugin to open xml, parse it and then show value i parse from xml to line edit, i use this code :

from PyQt4 import QtCore, QtGui
from ui_testparse import Ui_testparse
import xml.etree.ElementTree as ETree
# create the dialog for zoom to point

class testparseDialog(QtGui.QDialog):
    def __init__(self):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = Ui_testparse()
        self.ui.setupUi(self)

        opendata = self.ui.btnCari
        QtCore.QObject.connect(opendata, QtCore.SIGNAL('clicked()'),self.openxml)

    def openxml(self, event=None):

        #open dialog
        openfile = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '*.xml')

        self.ui.lineLokasi.setText(openfile)

        #call XML data
        self.isiData(openfile)

    def isiData(self, nmsatu):
        #open teks with read mode
        openteks = open(nmsatu, 'r').read()

        self.ui.textXml.setText(openteks)

        #Parse XML from Above
        self.parsenow(openteks)

    def parsenow(self, parse):
        element = ETree.fromstring(parse)
        xml_obj = ETree.ElementTree(element)
        for title_obj in xml_obj.findall('.//{http://www.isotc211.org/2005/gmd}dateStamp/'
             '{http://www.isotc211.org/2005/gco}Date'):
                #print element
                list1 = [element]
                Str1 = ''.join(str(e) for e in list1)
        self.ui.lineSkala.setText(Str1)

And the xml file i parse have a format like this:

<gmd:dateStamp>
      <gco:Date>2013-12-12</gco:Date>
   </gmd:dateStamp>
   <gmd:metadataStandardName>
      <gco:CharacterString>ISO 19115</gco:CharacterString>
   </gmd:metadataStandardName>
   <gmd:metadataStandardVersion>
      <gco:CharacterString>ISO19115:2003</gco:CharacterString>
   </gmd:metadataStandardVersion>

I want to show Date Value (2013-12-12) inside <gco:Date>2013-12-12</gco:Date> to lineEdit but instead of show date (2013-12-12) it show like some random code like this :

<Element '{http://www.isotc211.org/2005/gmd}MD_Metadata' at 0xd3e3c30>

Can someone help me


texts: Attribute table added to layout is missing when mxd is exported to jpeg using ArcPy?

texts:
I have added an attribute table to my map but when it is exported to jpeg using arcpy the table is missing. The problem only seems to apply to attribute tables created in ArcGIS - if I copy and paste a table from Excel into the map document, there is no problem and the table is included in the exported image.

I have tried turning on the visibility of layout elements but this did not work:

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]

for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT"):
        elm.visible = True

arcpy.mapping.ExportToJPEG(mxd, "mypath", data_frame='PAGE_LAYOUT', resolution = 240, jpeg_quality=100)

Any other suggestions on how to get this to work?


texts: How to add new data frame(s) to map using ArcPy?

texts: I want to add a 2nd data frame to an existing "*.mxd" file. Right now, i see option to add layers and edit properties of "CURRENT" data frame but could not figure out how to add a new one and export outputs from 1st frame to 2nd one. Any suggestions?


texts: Points with labels (or associated text) in Esri's JS API

texts:
I'm building an interactive map. A feature that has been identified as important by the stakeholders is being able to add points and associate data with them. I'd like this to be very user-friendly in terms of editing or deleting points or the associated text. Basically, what I want is a way to directly associate a point and some arbitrary text.

Currently, I'm using a graphicsLayer for the points. I can use the graphicsLayer with TextSymbol to add text, but each individual graphic object can only one symbol (this means no point if I go with text, and vice-versa). Basically, my "solution" is to do the following:

var newPoint = new Graphic(event.geometry);
pointGraphics.add(newPoint);
newPoint = new Graphic(event.geometry, myTextSymbol);
pointGraphics.add(newPoint);

This isn't the end of the world, but it's not preferable. The point and it's associated string are separate entities so modifying one needs to be propagated to the other. Is there a build in feature to handle this? LabelLayer was my first guess, but it appears to only support FeatureLayers.


texts: WMS GeoServer request with elevation range

texts:
I am checking multidimensional requests (time and elevation) using GeoServer WMS.

Now I am triying mutidimensional requests (time and elevation) within a range.

According to 1 elevation range can be requested in WCS services using a subset.

Can requests with elevation range be done in WMS?

This is an example of one of my requests but requested elevation data does not appear, only the default data:

localhost:8080/geoserver/First_test_wms/wms?service=WMS&version=1.3.0&request=GetMap&layers=First_test_wms%3Ameteo_stations_elevation&bbox=-983582.0%2C3132430.0%&width=768&height=637&srs=EPSG%3A25830&format=application/openlayers&subset=http://www.opengis.net/def/axis/OGC/0/elevation(20,150)


texts: Loop through two raster datasets by order and perform a function

texts:
I have two raster datasets that I need to loop through by order and select the first raster from the first dataset with the first raster from the second dataset to perform a function. I keep getting error 000732 raster dataset not found, but it does exist.
My code so far, I'm not an expert:

import arcpy
from arcpy import*
from arcpy.sa import *
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True

arcpy.env.workspace= r'C:/Time slices/U_sqaurred'
Urasters= arcpy.ListRasters('*.tif*')
arcpy.env.workspace= r'C:/Time slices/V_squarred'
Vrasters=arcpy.ListRasters('*.tif*')

for idx in range(0, len(Urasters)-1):
    ras1= Urasters [idx]
    ras2= Vrasters [idx]
    outraster= SquareRoot (Raster(ras1) + Raster(ras2))
    outpath= "C:/Time slices/magnitude"
    outpath = outpath + ras1
    outraster.save(outpath)


texts: What is best approach to provide a WMS of world coverage of 1 meter CIB?

texts: I have been tasked with creating WMS's of several raster types to include 1 meter CIB. We have an overall ESRI environment to include ArcGIS Server and we have a butt load of original CIB data (world coverage). Not asking for the perfect answer, unless you want to provide it, but could sure use some pointers, general directions and maybe some sage advice of what NOT to do.


texts: Converting road segments into one full link and taking mean of traffic volume

texts:
I have road segments and want to convert them into one link (intersection to intersection). Image 1 shows the segments.

The biggest issue is that each link has traffic volume and when converted to links (one single line from one intersection to the other) the value of traffic volume for the link needs to be the mean of individual traffic volumes.

It should come out as one segment with the mean of all the volumes between two intersections.


texts:
I just install opengeo suite (boundless) in my machine and try to explore it. I followed the instruction in user manual and I encountered a problem. In "Load your data with GeoExplorer" part, after clicking the plus sign, I did not find the upload layers option like the user manual said.

The only option is "add layers", no "upload layers".

Can anyone help me and tell me what happens here?


texts: Programmatically generating and posting web map definitions to ArcGIS Online to create web maps?

texts:
I'm using Python to build an ArcGIS Online web map definition JSON string, and then trying to post the configuration to ArcGIS Online to create a web map. I am using an admin account to generate the token and can perform other functions, but I get an error that says the user don't have permission to do this operation. I get the impression that this should be possible through the AddItem Operation .  Below is the python function in which I'm attempting to post the web map def.

Can anyone confirm this is possible? If so, maybe I'm just formatting the JSON or request incorrectly.

def publishWebMapDef(sTitle, user, sWebMapDef, token):
    #sWebMapDef is a json string that mimics the item data returned from the Item Data operation http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Item_Data/02r300000075000000/
    params = {"token": token, "title": sTitle, "type": "Web Map", "description":"Test Add Item", "snippet":"This is the snippet","tags": "test", "text":sWebMapDef}
    root_url = AGOL + "sharing/rest"
    Content_Root = root_url + "/content"
    User_Content = Content_Root + "/users/" + user
    AddItemurl = User_Content + '/addItem'
    url = urljoin(AddItemurl, '?f=json')
    sParams =json.dumps(params)

    headers = {'content-type': 'application/json'}
    r = requests.post(url, data=json.dumps(params),headers=headers)


texts: Big raster (DEM) loading too long in QGIS

texts:
I have a big geotiff file (resolution 2m, 192500 columns, 120000 rows, 100GB) representing a DEM model for a whole country. When I open in in ArcGIS it works fine, but in QGIS I need to wait half an hour for the file to load and show me the result. This make it impossible to perform any operations on the raster.

What can I do to make it work in QGIS? Why does this problem occur?

Edit: adding raster Info


texts: Converted ArcMap to KML Layer doesn't scale in Google Earth

texts: I converted an ArcMap layer to KML and exported to Google Earth.  I had set the Layer Output Scale to '1' during conversion, however when I open in Google Earth, the layer does not scale as I zoom in.  Any ideas?


texts: How can I position gps point on svg (or any other special type if exist) scheme of building?

texts:
I have an indoor map of a building in svg and this is an only scheme of a building, there is no google maps or any other maps. But I need positioning (navigation) by gps coordinates in this scheme.

There is no problem to get coordinates value by gps. The question is how to set current position point on the right place in indoor svg scheme?

Some ideas:

Get vertex coordinates of polygon (where building is placed) from google maps.
Left-bottom vertex is our base coordinates value (eg. lat: 50, lng: 60)
For now we have gps coordinates from phone lat: 50,12302 lng: 60,01234 and we can position point relatively base coordinates(step 2)
Can't imagine how to tie svg scheme and polygon coordinates.

Also, I think I found solution to use GeoJSON(TopoJSON) and D3.js. But how can you connect full building scheme to GeoJSON borders of building only?

Does anyone know an existing well-tried way or have code examples?


texts: How to design a custom form/table in QGIS Print composer?

texts:
I am facing the problem of not being able to graphically draw and edit tables (header of a map with information on the map content, editor, firm name, ...) within map composer. Is there an efficient way to accomplish graphically pleasing and easily modifiable forms (tables) in QGIS?

I used to draw lines and polygons which I grouped afterwards. Lines would never be perfectly vertical/horizontal and the items field was totally crowded (please include the otion to structure items in items pan (group folder oder indentations?!even when grouped, individual items such as the lines are still visible in items pane...).

I know there is the option to use html tables but they are not easy to edit for everybody. Am I missing something?


texts:
I have this file nuts0.json that I would like to change by removing some countries like Iceland.
To do this, I used the method I found in this post. Then I coverted the GeoJSON file to TopoJSON using mapshaper.

It works but the countries that have the islands (such as France, Italy, UK, etc.) are divided.

Let me explain better, when I do a visualization using the original file and move the mouse over Italy, I get this:

When I do the same thing using the modified file with QGIS, I get this:

These are the files:

original file: nuts0.json
modified file: nuts03.json

As you can see, here are the two pieces of code that are different:

nuts0.json:

{
    "arcs": [[[81, 82, -63, -24, -4]], [[83]], [[84]]],
    "type": "MultiPolygon",
    "properties": {
        "nuts_id": "IT",
        "name": "Italy",
        "population": 59685227
    },
    "id": "IT"
}

nuts03.json:

{
    "arcs": [[66, 67, -53, -19, -4]],
    "type": "Polygon",
    "properties": {
        "id": "IT",
        "nuts_id": "IT",
        "name": "Italy",
        "population": 59685227
    }
}, {
    "arcs": [[68]],
    "type": "Polygon",
    "properties": {
        "id": "IT",
        "nuts_id": "IT",
        "name": "Italy",
        "population": 59685227
    }
}, {
    "arcs": [[69]],
    "type": "Polygon",
    "properties": {
        "id": "IT",
        "nuts_id": "IT",
        "name": "Italy",
        "population": 59685227
    }
}

How can I solve?


texts: GetFeatureCount gives same result after deleting a feature

texts:
This is my code:

num1 = layer.GetFeatureCount()
layer.DeleteFeature(1)
layer.SyncToDisk()
num2 = layer.GetFeatureCount()
print num1
print num2

For some reason, num1 and num2 are the same number. Why? Shouldn't deleting the feature make the FeatureCount smaller by 1?


texts: Projection transformation of a shapefile

texts:
I am using QGIS 3.18.1.
I am working on a map around Alaska. I added a world basemap, then added DEM and finally drew a few polygon shapefiles on top.

I then tried to find a projection more appropriate for that area and chose NAD83(2011) / Alaska Albers (EPSG:6393).

The world basemap and DEM for transformed nicely but I am not sure about the polygon shapefiles. Shouldn't the top and bottom lines be rounded off to follow the longitude? You can notice on the second image that the top of the DEM now curves while the shapefile remained straight.
I have tried exporting the layer as EPSG:6393 and adding it back. But still the same result. Any pointers?


texts: using histogram2d with categorical dimension

texts:
This is a scatterplot of business addresses in Melbourne by ANZSIC division names.

sns.pairplot(x_vars=["x coordinate"]
             , y_vars=["y coordinate"]
             , data=d
             , hue="div_name"
             , size=5
             , aspect=1.7
             , kind='scatter'
             , plot_kws={'alpha':0.3, 's':3})

I would like to use a 2dhistogram to plot the relative density of each business count per pixel. I also would like to be able to make the biggest count to surface, revealing the colour that was assigned by the legend.

scipy.histogram2d and plt.imshow are able to plot one histogram at a time, but I'm having trouble both normalising the very tall centres (small towns disappear when compared to Melbourne) and properly displaying many categories at the same time.

Yes, tall order. Hopefully someone would help me with some pointers?


texts:
Even after adding blank terrain files at the specific directories : 0/1/ and 0/0/, I still get the error message and a blank globe.

This is not an issue with CORS. I am using http-server (node) to share my directory with the .terrain files generated using Cesium Terrain Builder

My code:

var viewer = new Cesium.Viewer('cesiumContainer', {
    //Start in Columbus Viewer
    sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
    //Use standard Cesium terrain
    terrainProvider : new Cesium.CesiumTerrainProvider({
        url : 'http://localhost:8081'
    }),
    //Hide the base layer picker
    baseLayerPicker : false
});

Error statements:

An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 1 Y: 0 Level: 0.
 An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 0 Y: 0 Level: 0.


texts:
I have a GeoTIFF I imported into Python environment with GDAL. The image has spatial reference data, which are the parameters describing the geo model:

(-104.31292762744124, 0.00030593847623094916, 0.0, 32.77290675637778, 0.0, -0.0002583980094641447)

There is no Projection metadata ( raster.GetProjection() ). How can I use these coordinates to create a projection (I want real world coordinates for each pixel location)?

I looked into osr.SpatialReference and pyproj but I couldn't find any simple or quick explanations. Sorry if this is basic but the online documentation just wasn't helpful for me.


texts: Adding Geomedia WebMap WFS to ArcGIS Online maps

texts:
I'm having troubles adding a WFS layer, published through Geomedia WebMap, to an ArcGIS Online map. It recognizes the URL and the layer of the features, but doesn't show any features in the map (or in the attribute table) and doesn't recognize correctly the available fields (it only shows the first one).

In QGIS, I am able to add the data as a WFS data source with no problem.

Below I provide the results of a query to the service returning only one feature:

<?xml version="1.0" encoding="utf-8"?>
<gmgml:FeatureCollection numberOfFeatures="1" xmlns="http://www.intergraph.com/geomedia/gml" xmlns:gmgml="http://www.intergraph.com/geomedia/gml" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.intergraph.com/geomedia/gml http://myorganizationserver/Cadastro-WFS/service.svc/get?request=DescribeFeatureType&amp;version=1.1.0&amp;TypeName=VETROCOCOLECTORMUN&amp;OutputFormat=text/xml;subtype=gml/3.1.1&amp;service=wfs">
 <gml:boundedBy>
 <gml:Envelope srsName="EPSG:3857">
 <gml:lowerCorner>-1025452.67332012 4677949.3337205</gml:lowerCorner>
 <gml:upperCorner>-1025324.26923474 4677964.86696932</gml:upperCorner>
 </gml:Envelope>
 </gml:boundedBy>
 <gml:featureMember>
 <gmgml:VETROCOCOLECTORMUN gml:id="VETROCOCOLECTORMUN.132">
 <gmgml:IPID>1022398</gmgml:IPID>
 <gmgml:DATA_DE_ACTUALIZACAO>2016-03-16</gmgml:DATA_DE_ACTUALIZACAO>
 <gmgml:GEOMETRY>
 <gml:LineString srsName="EPSG:3857">
 <gml:posList srsDimension="2">-1025452.67332012 4677949.3337205 -1025324.26923474 4677964.86696932 </gml:posList>
 </gml:LineString>
 </gmgml:GEOMETRY>
 </gmgml:VETROCOCOLECTORMUN>
 </gml:featureMember>
</gmgml:FeatureCollection>

I've noticed two strange things that I don't know if they can be the origin of the problem:

There is a gmgml prefix in several tags (it seems to be a prefix
specific of Geomedia datasources, but does this draw the data
invalid, since it is correctly shown in QGIS?)
The xmlns and xmlns:gmgml url points to an invalid web address (It
seems an outdated url, but I couldn't find the current valid url for
this documentation)


texts: I have shapefile with roads in one file. I want to divide this layer for example after 1000 meters. But there is problem, it is not polyline from one start point to end point. Do you know how this can be resolved?


texts: How to use qgis to get fraction of different vegetation types in a grid?

texts: I have a vector file having different land use type. I have to create grid in that and the grid should be similar to a raster file. Finally I have to calculate fraction of each land cover type with a grid. Is there any solution for this?


texts: How to get the shortest distance from a polyline to a set of points in Python?

texts:
Here in the image, the black line is the polyline I have and the red points are the points from which I need to find the distances D1, D2, D3 and D4.

The polyline data is extracted from Google directions api.

Sample polyline:

o`kpBywaaMQs@y@NEBCACCa@{Ag@LUJkDfC]d@yA|CuA~E_@lDArA@tADx@JfAHZBND@JBLRATINUFE?IHs@j@kBfA_A\iAXsAP}BHKCEEIe@i@cBYk@W[WY@M?Yg@kEOw@S@E@MRcA|Ao@`A[z@@ZGVUn@yEnH[f@MKiGyEmCoBgA{@wAiAw@m@s@o@}@{@CIACWEiBQeAKm@IMD[fA~EdC

And, sample points:

18.57847, 73.74055
18.57818, 73.73683
18.58348, 73.73603
18.58022, 73.73868


texts: Check Text Mode when Typing text MapInfo

texts:
I'm writing a code MapBasic
How do I know text mode when I add text to Map.

Can help me!, check cursor texting mode


texts: CartoDB toggle map view - can I share the map as an iFrame?

texts:
I followed the tutorial - toggle map view and have successfully made the map.

I'm now wondering what is the best way to share this map? I'd like to be able to give a client an iFrame, can I do this after I've edited the code?


texts:
May be the first question is, can I print ui.Chart to file, e.g. PNG? And then how?

Here is what I tried

https://code.earthengine.google.com/4fef1d985ce0727c1f83226fbc5417fa


texts: Update feature count of QGIS Layers using PyQGIS when data source changes

texts:
In QGIS 2.18.19 I have a PostGIS Layer with a rule based render and activated show feature count. The feature count does not change automatically when doing some INSERTs (or DELETEs as well) directly into the layers table in the database (likely same applies when e.g. replacing a source shapefile).

I think that such cases are handled with a my_layer.dataProvider().forceReload() and there is a couple of ways as well to repaint the layer in the canvas like my_layer.triggerRepaint() or iface.mapCanvas().refreshAllLayer()) and even refresh the layer symbology in the legend (iface.layerTreeView().refreshLayerSymbology(my_layer.id())) but in all these refreshes there seems to be NO WAY to refresh the feature count.

Exception: I noticed, that over the GUI the only way to refresh feature count reliably for the layer itself and all its style rules is to go to Layer properties, set up a feature filter (simple expression True) and then reset the filter. By clicking Ok or Apply feature count refreshes as desired, but I need to do this programmatically.

I tried reproducing the feature filter in PyQGIS like

my_postgis_layer.setSubsetString('True')
my_postgis_layer.setSubsetString('')

with no effect.

After days and nights of reading source codes I was not able to figure out whats updating feature count when pressing Ok in the layer properties dialog, perhaps anyone could give me some advice...

Question: How can I generally update/refresh feature count in such case with PyQGIS?


texts: Dynamic/calculated field in ArcGIS Pro via Arcade expression?

texts:
In an ESRI video called Getting to Know Arcade, the presenter states that dynamic/calculated fields are possible via Arcade expressions.

How many of you have ever been in a
situation where you had a dataset ... where you needed a new column of data because you wanted to have [calculated values]?
...But you had to go and make a new column and calculate the
values into that column.
With Arcade, you don't have to do that
anymore; you can do it on the fly.
Arcade will look at whatever
columns you're sourcing from, do whatever calculations or
string manipulations you need to do, and then return the result without the need to change your schema.

This sounds promising, but it's not clear what platforms the functionality pertains to.
Is it possible to create a dynamic/calculated field in ArcGIS Pro that is populated via an Arcade expression?


texts: Calculate minimum Traveled distance from L Latlng in T time

texts:
I want some functionality in my Android/iOS application i.e. U user is travelling to L location, So when the U is 15 minute away from the L location he/she will get some Notification.

What i tried so far:

Calling google API and get travel time from the current location to the L location on a particular time interval, when i found it to very close from the 15 minute, i triggered notification to the user(U) and stop calling the API.
Geo-fence L location in such a way that travel time from enter the fence to the L location, should be very close to 15 minutes. When user(U) enter into the Geo-fence i triggered notification to the user(U) and remove the Geo-fence.

But for 1st methods Calling google API is not the right way to achieve that.
In second method the problem is My locations are not fixed they may vary. So the radius of Geo-fence should be different for every location because travel time is different for the location.

According to to me Geo-fence is a good solution but its dynamic radius are creating the problem.

So is there any other way to achieve that? Or we can fix the dynamic radius issue of Geo-fence in any way?


texts: I see that Google combines GPS with WiFi geolocation results to increase location accuracy. Does anyone know how it's done? How is WiFi information useful when it can have 10m+ accuracy? Is it only useful when GPS fails to receive a signal?


texts: How to hide "internal" polygon boundaries?

texts:
Our task is to draw a lake with a solid outer perimeter line and no lines between internal wetlands, shoals and shallows? 'Tis a relatively straightforward process with Arcinfo coverages and Regions, but alas, that is no longer a viable option for us, the datasets we use now are too large and the lack coverage editing ability in Arcmap crucial. Can cartographic representation solve our dilemma? Is it possible to create something like the below without resorting to creating (and managing) duplicating, or triplicating, geometries whose sole purpose is better looking maps?

(click through for more detail)

With a feature class: Boundary between river and lake is visible.
Keeping them as distinct polygons in one feature class allows a name attribute (the river and laker differ). Elsewhere the heavy line implies a sharp boundary between lake and shallows/intermittent lake, however the actual edge is indeterminate, fluctuating with seasons and high-low water cycles. The line should be implied rather than drawn.

With regions: One geometry, multiple attribute tables, multiple representations.

Outer perimeter (ordinary high water mark) is cleanly delineated
No apparent division between lake and river, but they still know which is which
Shallow/intermittent waters are symbolized appropriately, with river shallows distinguished from lake shallows.

See here for a map package simulation of what we're trying to achieve and the source arcinfo region coverage from which it is built.


texts: QGIS crashing when exporting data into Excel Spreadsheet with PyQGIS

texts:
I am extracting raster data using GDAL from a map that has different shades of red depending on the temperature. When I run the code within QGIS only the beginning and end of the code shows up. This is why I want to export the data into Excel, but QGIS keeps crashing when I run that part of the code. I have tried exporting the data into .csv and .txt formats but I get a Permission Denied error.
from osgeo import gdal

import pandas as pd

import openpyxl

layers=QgsProject.instance ().mapLayersByName ('1970-2000, 2.5, feb')

layer=layers [0]

ds=gdal.Open (layer.dataProvider().dataSourceUri ())

dem_arr=ds.GetRasterBand (1).ReadAsArray ()

print (dem_arr)

df=pd.DataFrame (dem_arr)

df.to_excel ("colorfirst.xlsx")


texts: Statistical operations (mean) between raster with different extents

texts:
I'm working with a satellite (SMAP) that has a temporal resolution of 3 days. So every day the sensor covers a portion of Brazil. I have the Geotiff files, but I need to calculate the mean values for the three images, but the mean will be calculated only for the pixels that overlap. In the end, I need a single image for the period of three days.

How can I do this?

In this link there is a file that contains the three images.

Here an example of one of these images:


texts:
I'm trying to build a network in GRASS in order to find the shortest path from any settlement out of 1120 (points), to one waste treatment facility out of 27 (points). I plan to use v.net.distance which is designated to this purpose, and to define source and destination points using a column called "type". In that column I have assigned the settlements layer with the number 5 and the treatment facilities with 1.

My problem occurs when I try to create the network using v.net; If I define nodes layer (nlayer=2) to be 2, I lose all the points and can't find it, even by using v.extract. Otherwise (when nlayer=1) the attributes describing type are being auromatically changed to 4, which is the type attribute for roads.

Since I have 1120 I find that using from_cat instead of a SQL restriction will be too hard.

Any one has an idea why I'm losing this crucial data and how can I prevent it from happening?


texts:
I was wondering if it were at all possible to manipulate/massage rasters (eg Geotiff) using Qgis plugins or Grass??
By manipulate, I mean manually smooth off interpolation artefacts, blended surface disagreement, etc. Like a photoshop 'touch up tool' if you will.
I've had a crack at trying with GIMP, but I lose all my geotiff info.
If anyone hasn't already developed it, they should.

Update: GIMP Works for 8bit Geotiff files, however, all data below 0m and above 255m are lost. Need to find a software package that deals with float64 Geotiffs.


texts: How to create custom kml layers based on collections of towns

texts:
I'm currently working with a dataset that uses these custom regions. Essentially, these regions are clusters of 10-20 towns that border each other. These regions are analogous to counties, although their borders are different. Annoyingly, these regions are only defined by lists of towns: there's no kml file or something similar that defines these regions.

I'm using Microsoft Power Map for Excel to create a map of these regions. Microsoft Power Map is able to create maps based off of state/county data automatically. But for it to work with customized regions, I need to import a custom kml file that defines these regions.

Since these regions are clusters of towns, is there a way to take a kml file that represents town borders, and somehow merge the towns into these larger regions?

I'm really new to this, so ideally answers won't require in-depth knowledge or expensive software!


texts: PostGIS-Layer not available after update

texts:
I recently ran a full update on my Manjaro-System, afterwards I opened QGIS and got the following message.

qgis: error while loading shared libraries: libproj.so.15: cannot open shared object file: No such file or directory

I solved this by reinstalling QGIS to the current LTR (3.16.5). However, when I opened my current project containing a PostGIS-Layer it could not connect to this layer. I went into pgAdmin and checked. The database is still there and working. I can open any table, that has no geometry/geography column, but when I try to display the data of the table, that is not connecting in QGIS (containing one geography column) I get the following error:

ERROR:  could not load library "/usr/lib/postgresql/postgis-3.so": libproj.so.15: cannot open shared object file: No such file or directory SQL state: 58P01

I checked online and found this thread, indicating, that I may have to update my proj package. I checked and apparently it is the outdated version 6.3.2, which is still in the package manager. I manually updated to 8.0.0-1 but this didn't solve the problem and also caused the same QGIS error in the console again.
Currently the version setup is:

QGIS: Version 3.16.5
Postgres: Version 12.6-1
PostGIS: Version 3.0.3-1
proj: Version 6.3.2-1
Manjaro: KDE-Plasma 5.21.3
Kernel: 4.19.183-1-Manjaro

I think it has something to do with proj but I don't know, what exactly is wrong and don't want to dabble without a clue.


texts: How do Qt Designer and QGIS work together?

texts:
I am just trying understand how qgis and designer work together.  From Nathan W's excellent posts I know how to create a user form and how to hook it to a qgis layer and also how to add validation code.  My questions here are pretty naive but the stuff that everyone knows is precisely the stuff that one can't find in print:

Is the copy of Qt Designer that comes with QGIS integrated wtih the QGIS GUI in anyway (like the forms designer within ms-access is the the rest of ms-access)?
Can I start Qt Designer from within QGIS or do I have to have to fish around in the QGIS installation with Windows Explorer and find the Qt Designer exe to double click on?
Am I better off installing a separate version of Qt Designer/Qt Creator or pyQt than using the integrated Qt Designer?
Does the pre-packaged windows installer for new users come with Qt Designer configured in a way that can be used for form design?
If I am looking for a way to create forms with python validation code, is PyQt a good solution?
Many data collection tasks are non-spatial, for example adding in a price list for road signs. The GIS can record which signs need replacing but the price list is needed to provide a cost estimate.  Is there anyway of triggering the display of forms for non-spatial data tables?


texts: QGIS: Merging many vector layers of the same name together

texts:
This topic has some relation to my other topic here:
Extracting catalog consiting of name of layerdata/tabel of bunch of different geopackages
Because it is kind of a sequel to this one and you guys can have some extra context that should not have to be repeated here.
As result of a QGIS model batch process I have extracted the tables of many geopackages, normally this algorithm renames them so I all those tables can be differentiated. However the problem comes of course when I need to merge those specific layers.
So to circumvent that problem I have decided to forgo the renaming part so that leaves and I was wondering how you can merge vector layers that have the exact same name and I really mean exact. The structure of those tables is the same of course so merge vector layer algorithm should work for this, but I do see the option to merge them by name.
Keep in mind however that for now I am dealing with temporary layers (vector tables without geometry), resulting from the batch process. So this script has to work with layers that are currently loaded in QGIS. Not to mention this should be made into a either a python script or a model that can be customized to do for six layer names.
The layer names that always return and therefore are double are:
gpkg_contents

gpkg_geometry_columns

gpkg_ogr_contents

geopackage_name

table_name

Koppel_index


texts:
enter image description hereI have downloaded Aster dem file. One of my dem file has rectangle line.
Does any body know how to remove it? I am using QGIS 3.4.


texts: Refresh Oracle and Spatialite Layer with PyQgis

texts:
I'm working on a Dockwidget with PyQgis.

I made an insert into an Oracle DB and a Spatialite DB and I would like to see the new insert (it's a point).

The Layer where the new point is add is URB_A_ADPT. I'm sure the point is create because I see it in my DB and attribute table. For now, when I zoom and dezoom the point appears but I would like to see it directly.

I tried to simply add

self.refresh = self.canvas.refreshAllLayers()

but it don't seems to be enough to refresh my Oracle layer.

I also tried

if iface.mapCanvas().isCachingEnabled():
    layer.triggerRepaint()
else:
    iface.mapCanvas().refresh()

from the idea of @andreas-müller but once again I don't see anything.

And my last idee was to set zoom and then directly dezoom

active_layer = iface.activeLayer()
active_layer.zoomFull()
active_layer.zoomToPrevious()

but it don't work.


texts: Surface Difference TIN Output in ArcGIS | Python Code

texts:
Why does the output TIN option does not work when executing it through a python script or a model builder simulation run? As you will see in the messages below, the surface difference successfully runs but never creates the TIN output file. However, the output shapefile is created. Maybe there is a bug in ArcGIS 10.2 in relation to this tool??

I have one script that has various tools, here is the part that i am having significant difficulty:

#Trigger Surface Difference to yield ppp elevation, Insert optional directories for TIN output
    in_surface = tin4
    in_reference = "C:\\Standalone\\ppp"
    out_tin_basename = "C:\\Standalone\\tin0041214_ppp"
    out_tin_folder = env.workspace
    out_feature_class = "C:\\Standalone\\0041214_ppp.shp"
    Output_Raster = ""
    arcpy.SurfaceDifference_3d(in_surface,in_reference,out_feature_class, out_tin_folder = out_tin_folder, out_tin_basename = out_tin_basename)
    print "Surface Difference generated"

    #Generate Surface Contours off the PPP Survey surface
    arcpy.SurfaceContour_3d( out_tin_basename ,"C:\\Standalone\\0041214_contours.shp",1,"","Contour","","","Index_Cont",1)  #Check for contour field add
    print "Contours generated"

This is the error messages that i am catching:

The program has began processing 2015-03-19 12:46:19.639000
Feature Class Created
Coordinates Added
TIN created
TIN delineated
Surface Difference generated
Executing: SurfaceContour C:\Standalone\tin0041214_ppp C:/Standalone\0041214_contours.shp 1 0 Contour 0 # Index_Cont 1 0
Start Time: Thu Mar 19 12:52:40 2015
Failed to execute. Parameters are not valid.
ERROR 000732: Input Surface: Dataset C:\Standalone\tin0041214_ppp does not exist or is not supported
Failed to execute (SurfaceContour).
Failed at Thu Mar 19 12:52:40 2015 (Elapsed Time: 0.00 seconds)
Duration: 0:06:21.170000


texts: Remove place names from the layout in the print composer using a WMS

texts:
I am new to working with maps and I am going to make a map presenting the study sites in my theisis.
As a map I am using a WMS-map provided by geonorge.no. I am wondering if there is a function in the QGI so I can remove the unwanted names that is showing up when I am zooming into the map?  As I am zooming in lots of names are showing up. This is unwanted for an illustration in my theisis.


texts: Mapbox Studio tileset is missing the bottom corner of polygon after upload to studio

texts:
I am uploading a shapefile to Mapbox Studio. Here is a screenshot of the shapefile polygon in QGis

This is the polygon in QGis

Now, when I zip the files and upload them as a new tileset, the bottom corner is missing at the edge of a Tile boundary. See the screenshot below.

See the screenshot below to see the problem.

How can I prevent this problem when I upload to Mapbox Studio? I have had this problem with every shapefile that I upload.


texts: Polymaps / Tilestache tiling grid mismatch

texts:
I have set up a basic PostGIS / Tilestache / gunicorn / nginx / Polymaps test environment, rendering my dataset from PostGIS to GeoJSON and shipping it out to be rendered in Polymaps.

That works nicely, but for one small detail: Polymaps seems not to be requesting all tiles.

If my dataset encompasses a world map, at zoom level 0, it requests 0/0/0.geojson, but not 0/1/0.geojson (the Eastern hemisphere). If I zoom further into the visible dataset, the right halves of it seem to disappear.

With a more local dataset (Norway, display centered around lat/lon 60/10) nothing at all is displayed. One correct tile to load and display would for example be 2/4/0.geojson, which spans the whole dataset. Polymaps never loads any tile with an index above 3.

If I load the tile directly, ignoring the tiling scheme, it is loaded and displayed correctly.

Any clues to what I am missing?
Polymaps code below:

var po = org.polymaps;

var map = po.map()
.container(document.getElementById("map").appendChild(po.svg("svg")))
.center({lat: 60, lon: 10})
.zoomRange([0, 20])
.zoom(10)
.add(po.interact())
.add(po.hash());

loading the tiled layer:

map.add(po.geoJson()
.url("/boundary/{Z}/{X}/{Y}.geojson")
.id("boundary")
.on("load", loadFeature))

loading the one tile directly (works):

map.add(po.geoJson()
.url("/test.geojson")
.id("boundary2")
.on("load", loadFeature))


texts: Metrics and features for comparison of aggregated trail dataset

texts:
I have hundreds GPS traces generated by cars for single road in the city from direction A to B.
And I have hundreds of GPS traces generated by people which organized in trail in the mountain from bottom A to top B point.

What kind of features and attributes can be derived from trail and city road to compare them? I want find similiariry and differences between mountain walking data and vehicle city road.

For now, I derived following features:

distance between consecutive points
duration between points
average speed
trail density (# of points per sq. meter).

What else attributes can be derived to compare?


texts: Adding point geometry to 311 datatset without compromising duplicates using QGIS?

texts:
I'm not sure how best to phrase this problem so bear with me.

I'm analyzing 311 complaints about unshoveled sidewalks in Boston during 2016. Unfortunately the latitude and longitude data in the 311 data set provided by the city was unreliable. Fortunately for me, it DID include the addresses of each property reported for a violation. I downloaded the city's parcel shape files and cleaned up the 311 data set so that I can match each complaint to a particular property in the city. Each 311 complaint has a unique ID and some information I've coded regarding the nature of the complaint, whether a citation was issued, etc.

Here's my problem - some properties were reported more than once in 2016. Some were reported as many as five or six times over the course of the year. How can I add the geometry (and other attributes, preferably) from the parcel shapefiles to the 311 CSV? I produced a centroid points layer for the parcel data to make this simpler, but I'm stumped as to how I can include the parcel info in the 311 file while preserving the frequency of reports per address.


texts: Calculating average of 3 fields where nulls are present

texts:
I have created a new field to calculate the average of 3 other fields in a table where nulls are present. Using python as the parser(with no code block) I used this:

(!Slope_PCT! or 0 + !Flood_PCT! or 0 + !Wetland_PCT! or 0)/3

I get results but some of them are not correct.


texts:
I want to display the information of a raster layer as a table or data frame in R. In particular, I am most interested in the raster name and resolution.

I want the information which shows by just reading the raster layer or by:

r <- raster("mypath/B01.tif")
print(r)

How to return print(r) as a table or data frame?


texts:
So I'm using the formaTrend() function in Google Earth Engine to detect differences in forest cover over time (via long-trend). My question is if there's a paper or an explanation to what exactly formaTrend() does.
I've read the description of the function in GEE itself but its very brief and I was wondering if there's a longer/more detailed description.


texts:
I have used ESRI Proxy in multiple projects which were developed using ESRI JS API and Java backend.
Now I have to use secured services in a Django project. I am searching for similar proxy but it is only available in Java, .Net and PHP. I have tried using Django HTTP proxy but it is not working properly.
Is there any proxy available in Python for ESRI Services?


texts: Finding the Nearest Landmass to A Point In The Ocean via API

texts:
I'm building an iPhone app that often ends up in a point that is in the middle of the ocean. I want to be able to find the nearest landmasses, which in some casses are thousands of miles away.

So far I've thought of calling the maps API on the regions NW, NE, SW, SE - i.e. the ocean coordinate +10 lat, +10 long etc. until I come up with a response that isn't ZERO_RESULTS (I could obviously keep expanding the bounding box until I found something). I'm currently trying to find info on the antipode to San Francisco, which is approximately -37, 56.

The clear limitation on this is that it is in no way scalable, since Google has a request limit of 2,500 per day and I would probably be making 4+ of them per entry by a user (and I expect a user to make at least a few of these requests per use).

Any thoughts?

Thanks, Alex


texts:
I want to export a map using QGIS2WEB which mostly works fine apart from labels. I have some numbers I want to display inside circles. I have tried all the settings I can think of but I can't get the web output to scale the fonts when I zoom in and out.  I've tried setting the size of the labels using mm, points, map units, meters at scale, inches etc.  When I zoom in and out on the WebMap (in Chrome or IE) the circles scale perfectly but the font size of the label doesn't scale. This means the labels will not stay inside the circles and appear too big or too small depending on the zoom level I'm on.

Specifying the size of points an svg symbols using map units works as as would like but label font size doesn't.

I have also tried editing the the .js and .css output from web2map but it's minified and virtually impossible to follow the code and find out whats happening.

I'm using Qgis 3.12.0

Is this possible or is there a workaround to fix this?


texts: How do I split the lines of two polygons that are stuck together?

texts:
When using the tool to move/delete/add points, all the lines (from multiple polygons) connected to a point move at the same time. Though sometimes this is prefered, there are times I want to move the lines from those polygons seperately. Is there a key/tool that can help me with this?
I'm using QGIS


texts: QGIS 3 SQL dialect - is UNION ALL allowed?

texts:
I have a very large SQL query consisting of two similar but different blocks, connected by a UNION ALL:
select OBJECTID, PROJECT_NAME, BIOGEOCLIMATIC_LBL, SITE_SERIES_MAP_CDE_LBL_CPNT_1, GEOMETRY as geom

from (select * from WHSE_TERRESTRIAL_ECOLOGY.STE_TEM_ATTRIBUTE_POLYS_SVW tem inner join ( select distinct BUSINESS_AREA_PROJECT_ID from WHSE_TERRESTRIAL_ECOLOGY.STE_TEM_ATTRIBUTE_POLYS_SVW where PROJECT_NAME IN( 'Okanagan Amalgamation TEM' , 'BC Gas Pipeline TEM' , 'Osoyoos Okanagan Area A Mapping TEM' , 'Peachland TEM' , 'TFL15 OK Falls TEM' , 'Westbank First Nation Community Forest TEM' , 'Updated Central OK Valley Central OK South Slopes Kelowna Ellison Joe Rich' ) order by BUSINESS_AREA_PROJECT_ID ) bapid on tem.BUSINESS_AREA_PROJECT_ID = bapid.BUSINESS_AREA_PROJECT_ID where (SITE_SERIES_MAP_CDE_LBL_CPNT_1= 'PA' OR SITE_SERIES_MAP_CDE_LBL_CPNT_2 = 'PA' OR SITE_SERIES_MAP_CDE_LBL_CPNT_3 = 'PA') UNION ALL select * from WHSE_TERRESTRIAL_ECOLOGY.STE_TEM_ATTRIBUTE_POLYS_SVW tem inner join ( select distinct BUSINESS_AREA_PROJECT_ID from WHSE_TERRESTRIAL_ECOLOGY.STE_TEM_ATTRIBUTE_POLYS_SVW where PROJECT_NAME IN( 'Okanagan Amalgamation TEM' , 'BC Gas Pipeline TEM' , 'Osoyoos Okanagan Area A Mapping TEM' , 'Peachland TEM' , 'TFL15 OK Falls TEM' , 'Westbank First Nation Community Forest TEM' , 'Updated Central OK Valley Central OK South Slopes Kelowna Ellison Joe Rich' ) order by BUSINESS_AREA_PROJECT_ID ) bapid on tem.BUSINESS_AREA_PROJECT_ID = bapid.BUSINESS_AREA_PROJECT_ID where ( ( BIOGEOCLIMATIC_LBL = 'BGxh1' AND (SITE_SERIES_LBL_CPNT_1= '04' or SITE_SERIES_LBL_CPNT_2= '04' or SITE_SERIES_LBL_CPNT_3= '04') or (BIOGEOCLIMATIC_LBL = 'PPxh1' AND (SITE_SERIES_LBL_CPNT_1= '02' or SITE_SERIES_LBL_CPNT_2= '02' or SITE_SERIES_LBL_CPNT_3= '02' ))))

The query works nicely in Oracle's SQL developer against the database I'm drawing results from. But it fails in QGIS 3.10, whether I'm using DB Manager or loading the layer via PyQGIS ( QgsDataSourceUri() , mainly).
When I run just the first half of the query (above the UNION ALL) , it works in my PyQGIS code (but still fails in DB manager).
@MBain confirmed that UNION ALL exists in QGIS' SQL dialect.
Checking the logs, I'm getting this error message:
Geometry type and srid for empty column GEOM of (entire query here) undefined.
So I'm trying to figure out how to explicitly define the geometry type (shoudl be POLYGON or MULTIPOLYGON) and srid (should be 3005) within the query.


texts: Attributes are lost in raster after changing extension and resolution in R

texts:
I have the following raster:

> modis
class       : RasterLayer
dimensions  : 1776, 4320, 7672320  (nrow, ncol, ncell)
resolution  : 0.08333333, 0.08333333  (x, y)
extent      : -180, 180, -64, 84  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : /Users/maps/MODIS_PANratios.tif
names       : MODIS_PANratios
values      : 1, 20  (min, max)
attributes  :
       ID       category
 from:  0
 to  : 20 Woody savannas

Please note this raster contains categorical attributes.

I want to create a raster stack with modisand a second raster with different resolution and extent:

> rDif
class       : RasterLayer
dimensions  : 720, 1440, 1036800  (nrow, ncol, ncell)
resolution  : 0.25, 0.25  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : /Users/maps/liuDif.tif
names       : liuDif
values      : 0, 4150641  (min, max)

I use project rasterto adapt extent and resolution from modis to rDifto be able to stack both:

modis.new <- projectRaster(from=modis, to=rDif, method="ngb")

The problem is that the new raster has lost its original attributes:

> modis.new
class       : RasterLayer
dimensions  : 720, 1440, 1036800  (nrow, ncol, ncell)
resolution  : 0.25, 0.25  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : in memory
names       : MODIS_PANratios
values      : 1, 20  (min, max)

How can I standardise the extent and resolution of two rasters without loosing the original attributes?


texts: Global projection with zero scale distortion at non-zero latitude

texts:
I am looking for a global projection with zero scale distortion at non-zero latitude.

I have tried using an Oblique Mercator projection centred at a specific latitude and longitude of centre (with Mercator orientation) in GeoTools (specified using WKT) but it seems to be a standard Mercator projection in terms of scale distortion. I was hoping it might have zero scale distortion at the latitude of centre but this doesn't seem to be the case.

Does such a projection exist? If so, what is the WKT for it?


texts: Merging lines based on distance from point in QGIS

texts:
I have 5 groups of 4 lines, all the lines in all the data sets are centred around the same point.
I need to algorithmically combine these lines into one line that is only the furthest from the point. They overlap in multiple locations.

Source: https://drive.google.com/file/d/19_dpKZUIaNpnfxk7KZF3AJJULXrURdum/view?usp=sharing

These lines came from points which came from a CSV file, they were combined using the 'Pointstopath' function in QGIS.

I am very new to GIS in general but have a working knowledge of python. My first thought was to load the CSV files into python pandas and calculate the distance from each point and only keep the furthermost. However, this won't work as the files have different "resolutions".

Am I missing something obvious?


texts: Displaying DEM with real elevation values in ArcGIS Desktop?

texts:
I am trying to create a DEM with hillshading map in ArcGIS Desktop 10, but I'm getting the result with scale values between 0 and 254.

How can I display the scale with the real elevation values?

Should I do it manually from Symbology tab or there is an automatic way?

My DEM is in meters.


texts: Due to a vulnerability being flagged by Fortinet, I'm looking at upgrading the version of PostgreSQL that's used in our QGIS install. Is it possible to upgrade this without breaking QGIS, and how would be the best way of doing so?


texts:
I have a DLL file that I have loaded and registered it in ArcGIS as a command icon. This icon launches a window where the user should do the following selections: an input file, a field name, select between 2 option buttons and an output file name. However, I need to run this DLL file via a VBA and ArcObjects code so as the user will not see the window of the DLL tool and the above selections will be given automatically by the code within a loop so as to take various output files. Is that possible? Please help.
Thanks
Demetris

Eventually I found a function that may be is approprite to call the DLL file. I declare it below and I try to call it via the Calldll() procedure. However, I receive the following message "Run-time error 13- Type mismatch". I think that the arguments have the appropriate data type. Could you please have a look in the code below to find what is going on?
Thanks again
Demetris

 Public Declare Function CreateParcelsShape Lib "C:\Program    Files\ArcGIS\CreatePoly.dll" (Centroids As IFeatureClass, Block As  IPolygon, pFDS As IFeatureDataset)

Public Sub CallDll()

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

'Get the active map (data frame)
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap

'Get the layers
Dim pLayers As IEnumLayer
Set pLayers = pMap.Layers

Dim pLayer1 As ILayer
Set pLayer1 = pLayers.Next

Do Until pLayer1 Is Nothing

  If pLayer1.Name = "Block12" Then
    Exit Do

  End If

Set pLayer1 = pLayers.Next
Loop

Dim pBlocks As IFeatureLayer
Set pBlocks = pLayer1

Dim pBlocksFC As IFeatureClass
Set pBlocksFC = pBlocks.FeatureClass

Dim pBlocksCursor As IFeatureCursor
Set pBlocksCursor = pBlocksFC.Search(Nothing, False)

Dim pBlockFeature As IFeature
Set pBlockFeature = pBlocksCursor.NextFeature

'Get the shape of the polygon (Block)
Dim polygon As IPolygon
Set polygon = pBlockFeature.Shape

Dim pLayers2 As IEnumLayer
Set pLayers2 = pMap.Layers

Dim pLayer2 As ILayer
Set pLayer2 = pLayers2.Next

Do Until pLayer2 Is Nothing

If pLayer2.Name = "CentroidsBlock12" Then
Exit Do

End If

Set pLayer2 = pLayers2.Next
Loop

Dim pCentroids As IFeatureLayer
Set pCentroids = pLayer2

Get the dataset
Dim pFDataSet As IFeatureDataset
Dim pFWorkspace As IFeatureWorkspace
Dim pAWFactory As IWorkspaceFactory

Set pAWFactory = New AccessWorkspaceFactory
Set pFWorkspace = pAWFactory.OpenFromFile("C:\LACONISS\GAPopulation.mdb", 0)
Set pFDataSet = pFWorkspace.OpenFeatureDataset("Polygons")

'Call the DLL function
CreateParcelsShape pCentroids, polygon, pFDataSet

End Sub


texts: I'm having trouble with duplicating vector layers in QGIS 3.4. Each time I try and duplicate a layer, the layers do not act independently of one another and if I make changes to one layer, the changes also apply to the copy/original layer. How do you duplicate layers so they act independently? Do you instead need to select features and create a new shapefile layer? This seems odd as there are instructions in QGIS 3.4 for duplicating layers which act independently! I must be doing something wrong...


texts: Join nearest points from 3 differentfeatures in ArcGIS 10.2

texts:
I have 3 point features. This points represent middle of tree trunks with attribute of diameter. The reason I have 3 features is that I used 3 algorithms how to calculate diameter. Now I need to join these points together to be able to compare these diameters. There is different number of trunk in each feature so also the ID for same trunk is different in each feature.

So I need to join these feature to be able to know which are the same trunks in these features.


texts: Would like to have a WMS with colored polygon features but not a legend

texts:
This is in ArcMap 10.3.

I am creating a WMS with a service definition file (I would like to keep the style how my WMS displays the data) - No problem.
I have a feature dataset of polygons which I want to plot color coded to differentiate between the features. Symbology -> Categories -> Unique values for that purpose. - No problem.
However, the resulting legend has a more than a thousand entries in it because I have a lot of polygons. When WMS is used by another user it is the ugliest thing ever if they are also plotting the legend! - Problem!

Is there a way to keep the style (unique colors for each polygon), but prevent the access to the legend? Or is there an alternative way to represent the data to start with?

Also: I tried disabling the GetLegendGraphic while creating the service definition file. Would that work? I am not the owner of the server so I cannot tweak it at that level. Not sure if all capabilities are turned on no matter what.


texts:
it seems like OpenLayers.Filter.Comparison.LIKE doesn't filter special characters!
for example,

filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.LIKE,
    property: 'name',
        value: 'blue'
    })

this will work fine. but:

filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.LIKE,
    property: 'name',
        value: 'light-blue'
    })

this will cause an error because of the -

it also can't deal with dots

what can I do to fix that ?

EDIT

I tried:

var filter = new OpenLayers.Filter.Comparison(
  { type: OpenLayers.Filter.Comparison.LIKE,
    property: 'name',
    value: input }
);
filter.value2regex( "-","." );

I wanted to escape those two characters from any value. but nothing changes.


texts: Counting number of grid cells in polygon using ArcGIS Desktop?

texts:
Is there a way ArcGIS could count the number of 15 seconds interval grid cells within a polygon after digitizing that polygon?

This should appear in a field in the attribute table.


texts:
I have a simple polyline with three points. I want to draw it on a QgsVectorLayer, but can't seem to get it working. I am able to draw a simple geometry on the layer, but that doesn't allow for styling the line (setting the color, line thickness, line ends, etc.). To do that I need to use a feature, or ideally I would just use a QgsArrowSymbolLayer. But there doesn't seem to be a way to actually set the line's points without calling QgsArrowSymbolLayer::renderPolyline. However that function requires a QgsSymbolRenderContext and I have NO IDEA how to grab the context so I can't call the function. This is incredibly frustrating.
I have considered even just figuring out how to call Python plugins from within my custom C++ application because this is so confusing.
Here is my nonworking code.
 // Create a polygon
 QPolygonF polyline;
 polyline.push_back(QPointF(10, 10));
 polyline.push_back(QPointF(20, 20));
 polyline.push_back(QPointF(30, 10));

 QgsArrowSymbolLayer *layer = new QgsArrowSymbolLayer();
 // layer->renderPolyline(polyline, <the_context_would_go_here>); (I WANT THIS TO WORK)

How do I do this? Or, if you know how to load custom python plugins for QGIS using the C++ API please let me know.


texts: How to create points along a polygon within a maximum distance from each other?

texts:
I'm looking for a tool that generate points within a polygon with a fixed-distance between point neighbors.

I've tried Create Random Points, but the parameter is only minimum distance, and I was looking for a maximum distance or fixed-distance.

Create Fishnet works well with the distance between neighbors up/down/right/left, but not between other neighbors.

For now I'm manually creating buffers and moving them around to cover the entire area, but I belief there would be an automated way to do it.

Any ideas?

I'm currently working with ArcGIS for Desktop.


texts: Compute GCP values for gdal_translate in a PNG image

texts:
I am using the incorrect GDP for gdal_translate based on gdlainfo command line since image is offset from correct location.  Image is at correct location when I use QGis GeoReference using my clicked on corners which are not the same as I used when using the command line gdal_translate.  How do I translate the GCP corners to the correct values??  I need to automate my georeferencing.

Command Line Call:

gdalinfo --> Upper Left  (0.0, 0.0) Lower Left  (0.0,10434.0) Upper Right (11242.0,0.0) Lower Right (11242.0,10434.0) Center ( 5621.0, 5217.0)

gdal_translate -of GTiff  -gcp 0  10434 43.0 11.0 -gcp  11242  10434 44.0 11.0 -gcp 0 0  43.0 12.0 -gcp  11242 0  44.0 12.0 myimage.png myimage.tif

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:4326 myimage.tif myimage_2.tif

QGis Call that Works:

gdal_translate -of GTiff -gcp 1001.19 202.821 43 12 -gcp 10826.7 180.285 44 12 -gcp 978.659 9983.29 43 11 -gcp 10826.7 10028.4 44 11 myimage.png myimage_2.png

gdalwarp -r near -tps -co COMPRESS=NONE  myimage_2.png myimage.tif


texts: KML, OpenLayers: attribute imported as string rather than number

texts:
I apologize for what is, I'm sure, a very village-idiot question, but I think my question is simply too dumb for the answers I've found on this subject.

I've used QGIS to save a shapefile (.shp) file as .kml, then used OpenLayers to import it as a OpenLayers.Vector.Layer.

The .kml file consists of a very long series of placemarks like the one shown below.

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document><Folder><name>events_a_</name>
  <Placemark>
    <ExtendedData><SchemaData schemaUrl="#events_a_">
        <SimpleData name="Date">2001-04-15</SimpleData>
        <SimpleData name="Latitude">34.683300000000003</SimpleData>
        <SimpleData name="Longitude">-76.666700000000006</SimpleData>
        <SimpleData name="state">North Carolina</SimpleData>
        <SimpleData name="type">Seizure</SimpleData>
        <SimpleData name="total regs">1.000000000000000</SimpleData>
        <SimpleData name="gtycode1">2335384</SimpleData>
        <SimpleData name="final_date">2005/06/28</SimpleData>
        <SimpleData name="end_date">2005-06-29</SimpleData>
    </SchemaData></ExtendedData>
  <Point><coordinates>-76.6667,34.6833</coordinates></Point>
  </Placemark>

I add this this file as an OpenLayers.Vector thusly:

var cwevents = new OpenLayers.Layer.Vector('KML', {
        strategies:[new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.HTTP({
            url: './events_kml/civwar_events(a).kml',
            format: new OpenLayers.Format.KML({
                extractStyles: false,
                extractAttributes: true,
                maxDepth: 2
            })
        })
    });

My problem is that attributes whose type I need to be numeric (or datetime) keep being loaded as simple string variables. ('total_regs' will load as ' "2.0000" ' rather than ' 2.000 ' .) This has made it impossible, for example, for me to vary a feature's marker size according to the value of one of its numeric attributes.

So would be extremely grateful for any of the following:

How to ensure that OpenLayers loads specific vector feature attributes as a specified data type.
How to change the KML file so that Openlayers is in no doubt about the data type of individual feature attributes.List item
Any other approach that might help me here.

Apologies again for an extremely primitive question, but quite new at OpenLayers, and this problem has stalled me for a ridiculously long amount of time.

SECOND UPDATE:
  The KML sample file supplied by @user30184 in the answer below might be a quickest way of isolating whatever obvious thing I'm failing to do in OpenLayers.

If anyone can add this kml file as a vector layer to an OpenLayers map, with the "b" and "c" attributes being correctly read-in as a numeric data type (int, float, anything) rather than as string, I would be very grateful to see the javascript you used to add the layer.

One last note: the way I added the layer (in the second code block above) has been essentially the same one I've found in the examples in two books and the web. The only variations have been to properties or strategies ("maxDepth:", "extractStyles", "strategies:") that have no effect on the correctly importing the data type.

Alternatively, if someone knows of a vector-layer format (geojson?) where this problem definitely does not occur, do please let me know: might be the most efficient way of solving this. Thanks again.


texts:
I am working on a hiking network. Basically it is a selection of roads/paths suitable for walking/hiking. Each junction of three or four selected tracks is numbered. Each track is a line that starts and ends on a junction.

https://www.tov.be/nl/wandelrouteplanner

One of the criteria I have to fulfil is a minimum and maximum loop length on the selected tracks. If you do a hike from 1 to 2 to 3 to 1 again, it has to be between 3 and 5 km.

Is there a way to analyse the entire network to see which loops are too big and which are too small? How can I visualise this on map?

edit:

Perhaps it is possible to automatically merge the lines into loops. Most of the lines would be part of a couple of loops. Then I can calculate the length of the loops. After that I can colour the inside of the loops (transfer to polygons in the process?) to green for OK between 3 and 5 km and red if less then 3 or more than 5 km?


texts: Reference to ArcObjects IUknown interface

texts:
Does anyone know what the ArcObjects reference library is for the IUnknown interface?  I migrated the code below into Visual Studio and there is an error on the "Dim pSelItem As IUnknown" line.

ERROR 'IUknown' is not accessible in the context because it is 'Friend'

' Get the selected layer or table
        Dim pTable As ITable
        Dim pDispTab As IDisplayTable
        Dim pStAloneTab As IStandaloneTable
        Dim pSelItem As IUnknown
        pSelItem = m_pMxDoc2.SelectedItem

I'm guessing I need to provide the full path reference for the Dim line?  Maybe there is a newer interface that I can assign pSelItem to for .NET?

UPDATE:

Maybe it should be "Dim pSelItem as Object", since the IMxDocument.SelectedItem Property for .NET accepts Object?

IMxDocument.SelectedItem Property link


texts: Raster to vector convertion google earth engine: error: Cannot use 'in' operator to search for 'type' in table3

texts:
link of code is "https://code.earthengine.google.com/821c1e554cf91c5be96467a3e17f39f5". My final task is convert raster image into vector data. But When Executing the code following error is occured "Cannot use 'in' operator to search for 'type' in table3",

var count = sorted.size();
print(count)

var ndwi1 = sorted.map(
function(img) {
var img1 = img.clip(table2)
var ndwi = img1.normalizedDifference(['B3','B5']);
var thres = ndwi.gt(0.15).rename('thres');

var slop = ee.Terrain.slope(elevation.clip(table2));
var slope1 = slop.lt(20).rename('slope1');
var slope_m = slope1.updateMask(slope1);
//var and1 = ee.Image.and(thres,shadow);

var shadowMap=ee.Terrain.hillshade(elevation.clip(table2), img.get('SUN_AZIMUTH'),img.get('SUN_ELEVATION'));
var shadow = shadowMap.lt(255).rename('shadow');

var evi1 = thres.expression('(thr>0) && (shd >0) && (slp>0)? 1 : 0' ,

{
 'thr' : thres,
 'shd' : shadow,
 'slp' : slope1
});

var evi = evi1.clip(table2);
var vectors = evi.addBands(evi).reduceToVectors({
reducer: ee.Reducer.count(),
geometry: 'table3',
crs : evi.projection(),
scale: 1000,

});

return vectors;
})

Map.addLayer(ndwi1)


texts: Mapserver blank image just with "wms_format" "image/png"

texts:
I Have a problem with mapserver 7.0.6 (same with 7.0.4). If I use "wms_format""image/jpeg" everything is fine. But if it's "wms_format" "image/png", there's nothing more than a blank image with QGIS.

The WMS provides both:

<GetMap>
<Format>image/jpeg</Format>
<Format>image/png</Format>

The layer looks like this:

MAP
    NAME "Bodenrichtwerte-Test"
    PROJECTION "init=epsg:25833" END
    IMAGETYPE PNG
    EXTENT 387000 5819000 401000 5838000
    WEB
        METADATA
            "wms_title" "BRW"
            "wms_srs" "EPSG:25833 EPSG:3068"
            "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?map=C:/test3.map"
            "ows_enable_request" "*"
            "wms_abstract" "Test"
        END
    END

LAYER
    NAME "BRW_2017"
    TYPE RASTER
    STATUS ON
    CONNECTIONTYPE WMS
    CONNECTION "http://fbintra.senstadt.verwalt-berlin.de/fb/wms/senstadt/brw_2017_amtlich?"
    METADATA
        "wms_srs" "EPSG:25833"
        "wms_title" "Bodenrichtwerte 01.01.2017"
        "wms_name" "2,3"
        "wms_server_version" "1.1.1"
        "wms_format" "image/png"
        "wms_proxy_auth_type" "basic"
        "wms_proxy_host" "*"
        "wms_proxy_port" "*"
        "wms_proxy_type" "*"
        "wms_proxy_username" "*"
        "wms_proxy_password" "*"
    END
END

Mapserver:

D:\ms4w>mapserv -v
MapServer version 7.0.6 (MS4W 3.2.2) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBID
I SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M INPUT=JPEG
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

But png's are necessary for the transparancy.

Edit:
It seems to be a problem with png-input in general. I tried it with a testing raster-file. Tif and jpeg is working, png not:

LAYER
    NAME "png"
    DATA "D:\raster_test.png"
    TYPE RASTER
    STATUS ON
    PROJECTION "init=epsg:25833" END
    METADATA
        "wms_title" "png-test"
        "wms_srs" "EPSG:25833"
    END
END

Any advice?

Still I'm a little bit confused, but after updating mapserver to the current version everything works fine.


texts: How can I export a list of points as a matrix in ArcGIS 10.0?

texts: I have a grid made of points (see attachment) with values for altitude extracted from a DEM. I need to export these values not as list, but as a matrix of size 50x50 to be read in SciLab. The grid is already made of 50x50 points, so the size is not really the problem. The problem is that all the methods I find to export the data have a list of values as the output, instead of the matrix shape I'm looking for. The matrix origin should be the topmost point in the attached picture (highlighted).This matrix will be used in a model to calculate water current velocity in a spatially explicit environment.


texts:
I am writing a Python script that finds the difference between populations for U.S. counties from one year to another and writes that information to a new field in a xlxs file.

Can it be done with ArcPy and what would the code look like?

Below is a sample of the xlxs data with the column names:

Area_name,     Resident population 1990, Resident population 2000, Resident population 2010
UNITED STATES,                248709873,                281421906,                308745538
ALABAMA,                        4040587,                  4447100,                  4779736
Autauga, AL,                      34222,                    43671,                    54571
Baldwin, AL,                      98280,                   140415,                   182265
Barbour, AL,                      25417,                    29038,                    27457
Bibb, AL,                         16576,                    20826,                    22915

I have the below code so far but I'm getting errors:

import arcpy
from arcpy import env
import xlrd
env.workspace=r'C:\Users\Kevin\Desktop\Geoprograming\week_four'
workbook = xlrd.open_workbook('test.xlsx')
worksheet = workbook.sheet_names('sheet1')
cursor = arcpy.da.UpdateCursor(population, ["1990", "2000"])
cursor.insertRow([diff90_10])
for row in cursor:
    row[diff90_10] = row[2010]-row[1990]
    cursor.updateRow([row])

  Runtime error Traceback (most recent call last): File "", line 9, in
  File "C:\Python27\ArcGIS10.4\lib\site-packages\xlrd__init__.py", line
  394, in open_workbook f = open(filename, "rb") IOError: [Errno 2] No
  such file or directory: 'test.xlsx'


texts: Any topo options other than msrmaps.com for Google Earth?

texts:
Years ago I discovered you could display a topo map in Google Earth from msrmaps.com like this...

<?xml version="1.0" encoding="UTF-8"?>
 <Document>
    <name>ATHENS Topo</name>
    <visibility>0</visibility>
    <GroundOverlay>
        <name>ATHENS Topo</name>
        <visibility>0</visibility>
        <Icon>
            <href>http://msrmaps.com/ogcmap6.ashx?version=1.1.1&amp;request=GetMap&amp;Layers=DRG&amp;Styles=&amp;SRS=EPSG:4326&amp;BBOX=-94.00020,34.25012,-93.87519,34.37511&amp;WIDTH=2000&amp;HEIGHT=2000&amp;format=image/jpeg&amp;transparent=FALSE&amp;Exceptions=se_inimage</href>
        </Icon>
        <LatLonBox>
            <north>34.37511</north>
            <south>34.25012</south>
            <east>-93.87519</east>
            <west>-94.00020000000001</west>
        </LatLonBox>
    </GroundOverlay>
</Document>

However, the tiles served by msrmaps.com are very slow to load and may not load at all sometimes.  Does anyone know of another service or method to do this, such as with http://tileserver.mytopo.com/SecureTile/TileHandler.ashx
or
http://services.arcgisonline.com/arcgis/rest/services/NGS_Topo_US_2D/MapServer


texts: How do I open this point file in QGIS? instead of Lat and Long it is a Geometry field

texts:
Someone is sending me a CSV file with a list of points that I am trying to map.  But instead of the usual Lat and Long there is just a Geometry field (see examples below). I have tried several methods to open this, assuming 3857 is the EPSG - not sure what the 2001 is for. How can I plot these coordinates on a map in QGIS? I have asked for a new file with the usual Lat and Long but would like to try and figure this out while I wait for it if possible.

(2001, 3857, (-8863473.81677258, 5417238.01101921, ), , )
(2001, 3857, (-9247508.24889085, 5207353.52931172, ), , )
(2001, 3857, (-9243598.70837419, 5208396.74498673, ), , )


texts: Can you hide/show the sublayers of a layer using CARTO.js createVis method?

texts:
Can you hide/show the sublayers of a layer using Carto's createVis method? I know I can easily hide/show the layers using createVis, but what about the sublayers in a vis layer? I've been trying out different methods, but haven't been successful. Is it possible and if so is it better to just use createLayer instead?

Full script:

var torqueToggle = document.getElementById('torque-toggle'),
    lineToggle = document.getElementById('line-toggle'),
    visjson = "https://powereng.carto.com/api/v2/viz/7e67597e-8e69-4663-83f8-90dc27c02ed9/viz.json",
    options = {
      center: [43.60000432144408, -116.26367568969728],
      zoom: 13,
      shareable: false,
      cartodb_logo: false,
      fullscreen: true,
      mobile_layout: true
    }

cartodb.createVis('map', visjson, options)
    .done(function(vis, layers) {
      layers[2].hide();
      layers[1].setZIndex(9999999999999999);
      console.log(layers);
      torqueToggle.onclick = function() {
        if (layers[2].hidden == false) {
          layers[2].hide();
        } else {
          layers[2].show();
        }
      }
      lineToggle.onclick = function() {
        if (layers[1].getSubLayers(0).hidden == false) {
          layers[1].getSubLayers(0).hide()
        } else {
          layers[1].getSubLayers(0).show()
        }
      }

    })
    .error(function(err) {
      console.log(err);
    });

and i've tried

layers[1].getSubLayers(0).hide()

and

layers[1].layers[0].hide()

JSFiddle


texts: Condition if column from table is empty is not working?

texts:
I want to make a loop where if a column is empty in a row to do something else. The  problem is that it can't determine the empty row. I tried as null, na , '',' ' and with double quotes and nothing.

for i in t_list:
    with arcpy.da.SearchCursor(i, ["name","num"]) as cur:
        for row in cur:
            if row[1] is not "''":
               print(row)

Gives:

nog1, num = '1'
nog2, ''

And it returns even the the empty rows


texts: Interpolation plugin error message WKB access out of bounds with QGIS 2.14 & 2.18

texts:
I am new to QGIS.

I am trying to construct a DEM from contour lines by using QGIS 2.14.0. (and later 2.18) I am doing this by using a clip rectangle tool (geoprocessing tools) on top of the contour lines and interpolating, by using the interpolation plugin, using triangular interpolation.

After I enter the data in the interpolation dialog and clic Save  I get an
exception "WKB access out of bounds".

Someone suggested that to avoid getting this error, it's better to interpolate before clipping the image, but doing this causes QGIS to doing a massive processing taking a huge amount of time.

Has anyone run into this and managed to find a solution?


texts: What is the difference between metadata generated by the ArcCatalog/ArcGIS Desktop and the tool XSLT Transform?

texts:
When I open item description in the ArcCatalog or ArcGIS Desktop i see the following html-file:

This file is generated automatically, but when i want to generate this via tool XSLT Tranformation or via arcpy.XSLTransform_conversion()

I get it:

Why there is this difference and how fix it?
I need to generate many files and I cannot manually edit each page or save each page generated by the ArcCatalog.


texts: QGIS Changing Attribute Values Python Code Slow - commitChanges() issue

texts:
I'm new to QGIS (version 3.4.15), I typically use ArcGIS, and am attempting to change attribute values and also add a field, for a collection of shape files based on certain conditions, the largest having approximately 4 million features. I have tried to translate my ArcPy code into PyQGIS and I've clearly done something wrong, it would run usually in an hour or so on ArcPy, but isn't finishing after days on PyQGIS, though I can see is running through the code.
Below is some sample code, though there are typically about 20 if conditions within each loop.
roads1 = input_dir+"/roads1.shp"
roads2 = input_dir+"/roads2.shp"
roads = [roads1, roads2]
for road in roads:
    # edit max speeds
    layer = QgsVectorLayer(road,"roads","ogr")
    features = layer.getFeatures()
    layer.startEditing()
    for f in features:
        if f['fclass'] == "footway":
            id = f.id()
            layer.changeAttributeValue(id,6,6)
        if f['fclass'] == "steps":
            id = f.id()
            layer.changeAttributeValue(id,6,2)
        if f['fclass'] == "track":
            id = f.id()
            layer.changeAttributeValue(id,6,32)
        if f['maxspeed'] == 0:
            if f['fclass'] == "living_street":
                id = f.id()
                layer.changeAttributeValue(id,6,48)
            if f['fclass'] == "motorway":
                id = f.id()
                layer.changeAttributeValue(id,6,112)
    layer.commitChanges()
    # add in hierarchies
    layer_provider = layer.dataProvider()
    layer_provider.addAttributes([QgsField("Hierarchy",QVariant.Double)])
    layer.updateFields()
    features = layer.getFeatures()
    layer.startEditing()
    for f in features:
        if f['fclass'] == "footway":
            id = f.id()
            layer.changeAttributeValue(id,10,1)
        if f['fclass'] == "steps":
            id = f.id()
            layer.changeAttributeValue(id,10,2)
    layer.commitChanges()

EDIT: I discovered when running the code on a smaller shape file without calling layer.commitChanges() at the end, the code runs in 22 seconds. When I call layer.commitChanges() at the end it takes about 30 minutes. If I understand correctly commitChanges() writes to the underlying data. Is this an IO issue?


texts: How to get the census block corresponding to coordinate (longitude, latitude)?

texts:
I have a shapefile containing the census blocks of my region and a list of "points" (longitude and latitude).
For every point, I need to associate the census block where the point is inside.

I followed the instructions of Vale. Now I see in QGIS my "points" and the census blocks of my region. My points correctly appear to be inside their census blocks, but when I use the tool "Join attributes by location", it warns me that the reference systems of the vectors are not the same. In fact:

the shapefile of my region is "EPGS:32632, WGS 84 / UTM zone 32N"
the points are "EPGS:4326, WGS 84"

and the join fails. How can I do?

P.S. I got the points' coordinates from Google Maps.


texts: How to connect points with a polyline in ArcMap 10?

texts:
I have a layer containing a few hundred points representing a survey track. The points are laid out in chronological order in the corresponding attribute table.

How can I have ArcMap 10 automatically "connect the dots" so that I essentially turn the points into a polyline representation of my survey track?

Thanks!

BTW, is there a way for me to specify a few of those points for ArcMap to IGNORE when it makes the polyline?


texts: Distance Matrix analysis for QGIS 2.8 using one layer

texts:
I'm using QGIS 2.8's Distance Matrix tool to find distances to nearest neighboring points on a single layer. I've followed roughly the instructions on this site and adapted it to my needs. However, I'm having issues with the resulting data. In my example, I've used myLayer as both input and target layers to find the three nearest points. I then added the resulting CSV to QGIS and selected all elements whose InputID = TargetID in order to find the points who were matched with themselves. The strange this, is these distances are not 0.

I get this sort of result:

InputID TargetID Distance
PointA   PointA   23.023
PointB   PointB   4.532

Can someone please explain to me where this distance comes from? My ultimate goal is to find the distance for each point to it's two nearest neighbors (not including itself).


texts: An algorithm for locating candidate labelling boxes within a polygon

texts:
Has anyone implemented this algorithm In PostGIS? Quoting from the paper:

  Vector-based geographic information systems usually require annotation, such as a polygon number or attribute data, in a suitable
  location within a polygon. Traditional methods usually compute the
  polygon centroid, test the centroid for inclusion or exclusion, and
  select some alternative point when the centroid falls outside the
  polygon. Two problems are associated with this approach:(1) the text
  can be centered on the point, but may be placed in a visually awkward
  place, and (2) part of the text may fall outside the polygon and may
  overlap other polygon boundaries or other text labels. An algorithm is
  presented that circumvents both of these problems, by computing a
  number of horizontal candidate labelling rectangles (boxes) within a
  polygon from which a suitable selection can be made or from which one
  may conclude that the text label does not fit the polygon.

Perhaps in a custom build, or as a combination of several ST_ functions? Even a command line utility?


texts:
I'm trying to join a single column from one feature class to another inside a File GDB using C# and the ESRI.ArcGIS.DataManagementTools.JoinField class. I've gotten several other geoprocessing functions to work, but for this one I don't think I have the correct input to the 'fields' property to specify the column to be joined and the gp.Execute() throws a COM exception. I've tried an IFields object (in the code below), I've tried a simple text string with the name of the field. They both throw a COM exception with no useful information.

    IFeatureClass parcelsExportFC = exportFws.OpenFeatureClass(parcelsExportFClassName);
    IFeatureClass parcelsZoneJoin = exportFws.OpenFeatureClass(String.Format("{0}_ZONEJOIN", parcelsExportFClassName));
    Int32 parcelsExportOIDFieldIdx = parcelsExportFC.Fields.FindField("OBJECTID");
    Int32 parcelsZoneJoinOrig_OIDFieldIdx = parcelsZoneJoin.Fields.FindField("ORIG_OID");
    IField parcelsExportOIDField = parcelsExportFC.Fields.get_Field(parcelsExportOIDFieldIdx);
    IField parcelsZoneJoinOrig_OIDField = parcelsZoneJoin.Fields.get_Field(parcelsZoneJoinOrig_OIDFieldIdx);
    JoinField jf = new JoinField(parcelsExportFC, parcelsExportOIDField, parcelsZoneJoin, parcelsZoneJoinOrig_OIDField);
    //this is the field I want to join
    IField zoneCodeField = parcelsZoneJoin.Fields.get_Field(parcelsZoneJoin.FindField("ZONE"));
    IFieldsEdit fields = new FieldsClass();
    fields.FieldCount_2 = 1;
    fields.set_Field(0, zoneCodeField);
    jf.fields = (IFields)fields;
    Geoprocessor gp = new Geoprocessor();
    gp.Execute(jf, null);

Any ideas?


texts: How to test for the difference in the statistical distribution of raster values in different zones?

texts:
I have a continuous raster that has been divided in 8 zones, and I'd like to compare if the distribution of pixel values in each zone is significantly different from each other.
I thought I would use a Kolmogorov-Smirnov test, but I've been advised not to.

Is there a statistical method out there that allow for the multiple comparison of non-normal distributions, without having to create a statistical model of the type Y~X?


texts: Create CF-compliant NetCDF from ESRI Grid?

texts:
Been trying to make a CF-compliant netCDF file from an ESRI Grid. I want to serve it w/the THREDDS server. Been using gdal_translate. I know the netcdf output option is definitely not CF compliant, so I've been using the GMT output option. This doesn't seem to be functioning properly w/in THREDDS, so I'm guessing that's not CF-compliant either.
As an aside, I'm trying to validate the CF-compliance of my GMT-type netcdf. Been waiting for a really long time for it to load up to http://puma.nerc.ac.uk/cgi-bin/cf-checker.pl. In the meantime, trying to set up the cf-checker.py script but dependencies on deprecated CDAT libraries is making that a pain.
Anybody got a cleaner way to do this?
---EDIT---
ncdump of my GMT-conforming NetCDF file. Seems odd that I have "x_range" and "y_range" but no "x" or "y". Also seems like I'm providing almost no metadata via this process--making CF compliance seem unlikely to me...
netcdf E:/software/apache-tomcat-6.0.39/content/thredds/public/wk_gmt/wk_awc/al.nc {
  dimensions:
    side = 2;
    xysize = 1902411900;
  variables:
    double x_range(side=2);
      :units = "meters";

    double y_range(side=2);
      :units = "meters";

    double z_range(side=2);
      :units = "meters";

    double spacing(side=2);

    int dimension(side=2);

    float z(xysize=1902411900);
      :scale_factor = 1.0; // double
      :add_offset = 0.0; // double
      :node_offset = 1; // int

  // global attributes:
  :title = "";
  :source = "";
}

---EDIT # 2---
Just a little more content to show the difference in the NetCDF files produced by gdal vs. ESRI based on comment from @mdsumner. I totally agree that gdal should be doing it right. Quite possible I'm not using the tool correctly (gdal_translate -ot Float32 -of NetCDF ${in} ${out} in my shell script, fwiw).
As @signell notes below, the ESRI output ain't perfect, but it seems closer to CF compliance...the following is the ncdump of the file created from a *.nc from the same ESRI Grid. This file was created using ESRI's Raster to NetCDF.
netcdf E:/software/apache-tomcat-6.0.39/content/thredds/public/wk_esri/wk_awc/al.nc {
  dimensions:
    x = 11334;
    y = 18650;
  variables:
    double x(x=11334);
      :long_name = "x coordinate of projection";
      :standard_name = "projection_x_coordinate";
      :units = "Meter";

    double y(y=18650);
      :long_name = "y coordinate of projection";
      :standard_name = "projection_y_coordinate";
      :units = "Meter";

    float awc(y=18650, x=11334);
      :long_name = "awc";
      :esri_pe_string = "PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"Latitude_Of_Origin\",23.0],UNIT[\"Meter\",1.0]]";
      :coordinates = "x y";
      :grid_mapping = "albers_conical_equal_area";
      :units = "Meter";
      :missing_value = -3.4028235E38f; // float

    int albers_conical_equal_area;
      :grid_mapping_name = "albers_conical_equal_area";
      :longitude_of_central_meridian = -96.0; // double
      :latitude_of_projection_origin = 23.0; // double
      :false_easting = 0.0; // double
      :false_northing = 0.0; // double
      :standard_parallel = 29.5, 45.5; // double

  // global attributes:
  :Conventions = "CF-1.0";
  :Source_Software = "Esri ArcGIS";
}


texts: Add Scale Overlay template gxp OpenGeo suite sdk

texts:
I need to add the scale on the map, it is assumed that .js is in the Widgets folder, that means that I should add as Plugin, maps and layers I have this code put in app.js:

map: {

id: "mymap", // id needed to reference map in portalConfig above

title: "Map"

items: [{

xtype: "gxp_scaleoverlay"

}]

I need you to visualize on the map, but does not work, I guess tools must put this code:

{
Ptype "gxp_ScaleOverlay"

  actionTarget "map.tbar"
}


texts:
I am going to be creating several dozen maps which all have a field with a range from 0 to 100.

I need to classify these into symbology classes every 15 and make a legend out of this.

However, the map I am currently using only has values from 55-100, and the others will certainly have a different range (maybe from 20-95 as an example?).

I tried creating manual classes but when typing "15,30, and 45  it reverts these break values to the lowest number in the current shapefile, which is 55.

However I still need to create a legend showing all these classifications and it needs to show what color a score of 15 would be even if there is not one in the map.


texts: Counting polygon neighbours and writing to table using PyQGIS?

texts: I have a shapefile with municipality polygons. I would like to count the number of neighbours for each polygon and write it to the attribute table. I have no succeeded yet in doing this, even though I tried to run this script: http://www.qgistutorials.com/de/docs/find_neighbor_polygons.html


texts: How to display GeoJSON from a URL with authentication in QGIS?

texts: I know I can add a GeoJSON url via the Add vector layer ▶ Protocol ▶ GeoJSON. But I have a URL that requires a username/password.  Is there anyway I can provide the username and password for the URL in QGIS?


texts: How to use ST_Contains() with ST_ClusterWithin()

texts:
I need to write a spatial query which will return centroids of clusters which are within a bounding box or polygon.

The query I have now is:

SELECT
    ST_NumGeometries(unnest(ST_ClusterWithin(ST_PointFromText(centroid), 10))) AS venueCount,
    ST_AsText(ST_Centroid(unnest(ST_ClusterWithin(ST_PointFromText(centroid), 10)))) AS clusterCentroid
FROM venue_locations
WHERE ST_MakeEnvelope (...) ~ ST_Centroid(unnest(ST_ClusterWithin(ST_PointFromText(centroid), 10)));

This, however, gives me the error:

ERROR: aggregate functions are not allowed in WHERE

If I replace WHERE with HAVING, I get the following error:

ERROR: argument of HAVING must not return a set

How can I write this to be efficient for large databases?

EDIT: to clear up any confusion, what I am trying to accomplish it to get clustered points from the database which are in a specific extent.


texts: Missing osgeo in QGIS 3.4 Madeira (macOS High Sierra)

texts:
I am trying to install QGIS 3.4 on my Mac. When I open QGIS I get a message that osgeo is missing.

  Couldn't load plugin 'processing'

  ModuleNotFoundError: No module named 'osgeo'

Here are the steps I've gone through:

I installed Python 3.6.8, per QGIS's instructions

  This distribution requires Python 3.6 (only python.org Python 3 is supported, another python 3 installation can't be substituted, ONLY the MOST RECENT 3.6, not a later 3.7+).  Python must be installed before installing QGIS.

I installed the packages named in the QGIS readme using python3 -m pip install packagename

  Some Python modules are required and installed using pip from files in the installer.  Modules will be upgraded if already installed.  Installed modules include (plus any dependencies):

  owslib, PyYaml, psycopg2, jinja2, pygments, numpy, plotly

I then installed QGIS without hiccup
When I opened QGIS I was warned of an error (full log at end of question)
Looking online I found that osgeo is a part of the GDAL package and that this is a common problem for installing QGIS 3.0. However, for QGIS 3.0 the install includes a step for installing GDAL before QGIS but this step and dmg is lacking in version 3.4.
Still, I downloaded GDAL and ran the dmg file. GDAL (and subsidiarily osgeo) is now in my Library/Frameworks folder.
Still, though when I run QGIS I receive the same error.
Not knowing how Python works (I've used a previous version of QGIS and never needed Python – why do I need it now?) I went to Terminal again and ran python3 -m pip install gdal but this resulted in error:

  ... No such file or directory: 'gdal-config': 'gdal-config'

  Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/f1/_nnmjmr53_s39dc46sfkj10w0000gn/T/pip-install-suyzpo9n/gdal/

I presume that I need to activate osgeo or gdal somehow but I don't know how. I'm surprised by how difficult this install is, especially for a program that doesn't require command line work once inside, and which previously had a much easier install.

QUESTION:

My ultimate question is how do I install QGIS 3.4 on macOS
I believe though the answer is that I need to install gdal, so my question becomes how do I install in gdal in a way that QGIS recognizes.

Many questions already exist about similar problems when installing QGIS but almost all of these are for QGIS 3.0, in which GDAL is a part of the installation process. I am asking for QGIS 3.4. with related scenarios but different problems / different versions


texts: Using 3 different Esri BaseMaps on different pages in Data Driven Pages

texts:
I am using ArcMap 10.6.

I'm trying to use 3 different basemaps, Imagery, transportation, and hydrology in my data driven pages.  They are saved and added to the map document as Layer files (.lyr) I would like to use both transportation and hydrology on one page, Imagery and hydrology on another, imagery on one page, and hydrology on another page. The data for the pages varies, too. But it is controlled using the "Page Definition' function.  The .lyr files do not have this function available in their properties.

Any suggestions?


texts: Getting Actual Truck Driving time using ArcGIS Network Analyst?

texts:
I am new in working with the Network Analyst tool in ArcGIS.
I am trying to find the closest facility to some assigned incidents.

The result that I am taking after I solve the paths is in minutes. However, the minutes appear to be 'off', e.g an 8km drive - results in 141 minutes.

Please see the image below.

I have also added polygon barriers with Attr_DriveTime as Scaled Cost with the value of 3, assuming that this is a "slowing down" factor.

Are the results that I am talking walking time from the facilities to the incidents?

How can I add the real truck (car) driving time?


texts: Display PDF stored as BLOB using QGIS HTML Widget

texts:
This question answers how to display an image stored as a BLOB using the QGIS HTML Widget using this code:
<script>document.write(expression.evaluate(" '<img src=' || '\"data:image/png;base64,' || to_base64(\"photo\") || '\">' "))</script>

How would you modify this script to display a PDF stored as a BLOB?


texts:
So I'm trying to get a good list of embassies from Overpass, here's my initial query:

[out:json];
(
    node["amenity"="embassy"];
    way["amenity"="embassy"];
    relation["amenity"="embassy"]
);
out tags;

However this query has some issues to it. I'm looking for embassies, but this query also includes UN missions, consulates, ambassador's residence, anything else in the diplomatic tag. A naive fix for this would be to add ["diplomatic"="embassy"] but after searching through the results of my initial query, I've noticed that there are actual "embassies" without any diplomatic tag.

So this comes to my question, can I modify my query to make a boolean-like filters to check for "embassy" only if "diplomatic" tag exists or ["tag"="value_A"||"value_B"] or ["tag_A"&&"tag_B"] and so on?


texts: Plotting the DEM into QGIS 3.10 from the CSV through SAGA

texts:
I had troubleshot with creating a DEM in QGIS SAGA, using this example:

https://www.geodose.com/2018/09/how-to-create-dem-elevation-profile-qgis.html

When I filled up the box as per below:

I get an error:

  {'TARGET_OUT_GRID': 'C:/Users/mariuszk/AppData/Local/Temp/processing_9cbcbd1489014d3c90818bbf3b042cd0/processing_7f0bf203da0a4ef4911db2fa9c161165/cc73e078de364beda9f771aadf599ef8/TARGET_OUT_GRID.sdat'}

  The following layers were not correctly generated.C:/Users/mariuszk/AppData/Local/Temp/processing_9cbcbd1489014d3c90818bbf3b042cd0/processing_7f0bf203da0a4ef4911db2fa9c161165/135b4ceb980d4161bf38535f619b636e/TARGET_OUT_GRID.sdatC:/Users/mariuszk/AppData/Local/Temp/processing_9cbcbd1489014d3c90818bbf3b042cd0/processing_7f0bf203da0a4ef4911db2fa9c161165/cc73e078de364beda9f771aadf599ef8/TARGET_OUT_GRID.sdatYou can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.**

Did I miss something?

Or shall I follow this example:

QGIS 3.10 Creating a DEM from CSV


texts: PostGIS - table with 3d points with fast ordering by distance

texts:
I am pretty new to PostGIS and I am trying to solve the following problem.

I need a table with 3D points (x,y,z) that will contain around 1-10million points. I want to be able to efficiently ask the table for 100-1000 points that are closest to some given point - parameter that is going to be different for each query.

Now, I started playling around this with following table:

  CREATE TABLE aa (   id serial NOT NULL,   point point,   s integer )
  WITH (   OIDS=FALSE );

  CREATE INDEX aa_p_s_idx   ON aa   USING gist   (point );

Queries like this:

  select * from aa order by point <->   '0,0' limit 100;

are lightning fast (between 10-100msec).

But the problems started when I wanted to move to 3D. It seems I cannot use the point type anymore - I had to use geometry. And the <-> operator works on 2D distance. I ended up with:

  CREATE TABLE db_testpoints (   id serial NOT NULL,   point geometry
  NOT NULL,   CONSTRAINT db_testpoints_pkey PRIMARY KEY (id ),
  CONSTRAINT enforce_dims_point CHECK (st_ndims(point) = 3),
  CONSTRAINT enforce_geotype_point CHECK (geometrytype(point) =
  'POINT'::text OR point IS NULL),   CONSTRAINT enforce_srid_point CHECK
  (st_srid(point) = 4326) ) WITH (   OIDS=FALSE );

  CREATE INDEX db_testpoints_point_id   ON db_testpoints   USING gist
  (point );

and even queries:

  select * from db_testpoints order by point <->
  ST_geomfromewkt('POINT(0 0 0)') limit 100;

take around 2000msec!

Is there a possibility to have better performance here if I used some other column type, some other index etc?
Is there a similar operator to <-> that works on 3D? I could probably use some distance function, but I heard then the index would not be used then...

Any pointers appreciated, thanks in advance!

Update

EXPLAIN ANALYZE for both queries shed some light:

"1. Limit  (cost=0.00..1.28 rows=10 width=24)"
"  ->  Index Scan using aa_p_s_idx on aa  (cost=0.00..985278.95 rows=7691709 width=24)"
"        Order By: (point <-> '(0,0)'::point)"

"2. Limit  (cost=46786.64..46786.66 rows=10 width=136)"
"  ->  Sort  (cost=46786.64..49389.14 rows=1041000 width=136)"
"        Sort Key: (((point)::box <-> '(0,0),(0,0)'::box))"
"        ->  Seq Scan on db_testpoints  (cost=0.00..24291.00 rows=1041000 width=136)"

So it looks like in the second query, the index is not used at all...how can I use it and is it going to work with 3D?