texts: Drawing Curves/Bezier Lines with ESRI WPF Runtime

texts:
I'm looking for some pointers on how to draw a curved line or bezier line in WPF runtime. The WPF runtime sample application has a drawing mode for straight line, polyline, and freehand. However, no curve or bezier.

Here is an example in Silverlight, so it seems like it should be possible in WPF as well.  ...

Here is the page describing the app as well as source code download:  ...

I haven't had a chance to do a deep dive into the source code yet. It looks somewhat complicated at first glance.

P.S. I do have an ArcObjects engine runtime license available as part of my solution as well - just in case a hybrid solution would work.


texts: Identify Road features that do not connect to the main network

texts:
I have a large roads dataset consisting of about 2 million features that I am trying to prepare for routing analysis.

I need to identify features that are isolated from the main roads network so that I can verify that they are truly isolated or if the features are not connected due to a digitization error on the part of the original dataset producer.

I have tried a number of different approaches to identifying these isolated features - mostly consisting of iterating through a grid, clipping the network to a manageable size and then dissolving the features to create large single features - I then use the line length as an indicator of if the feature is part of the broader network. this is very time consuming and a bit hit and miss and I regularly run into problems with hitting the upper limits of the number of vertices that a single feature can hold.

Does anyone have any advice on an approach that would work? I am currently using ArcGIS but am open to all suggestions at this point.


texts: I'm trying to make a full map of Staten island.  The first picture shows all the vector layers I am using with out a problem.  Once I turn on Open Street Maps layer, QGIS takes a while to render as I zoom in and out and then most of the time just crashes (as seen in picture 2).  How can I fix this so I can easily zoom in and out without the QGIS taking forever to render it and then crash? I've tried fresh installing the updated QGIS but that didn't work.


texts: Modifying string in python snippet with an object

texts:
I am using arcpy to reproject a multidimensional raster, and I extracted the following snippet by running the tool in ArcGIS pro.  This is the snippet:
arcpy.management.ProjectRaster(input_file_path, output_file_path, "PROJCS['North_Pole_Lambert_Azimuthal_Equal_Area',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Azimuthal_Equal_Area'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Latitude_Of_Origin',90.0],UNIT['Meter',1.0]]", "BILINEAR", "24966.9977186652 24966.9977186651", None, None, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "NO_VERTICAL")

In this case the output resolution is 24966.9977186651 meters which is represented by "24966.9977186652 24966.9977186651" in the snippet.  I want to use arcpy to change the resolution based on an object such as:
out_res = 3000

I tried this:
   arcpy.management.ProjectRaster(in_path, out_path, "PROJCS['North_Pole_Lambert_Azimuthal_Equal_Area',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Azimuthal_Equal_Area'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Latitude_Of_Origin',90.0],UNIT['Meter',1.0]]", "BILINEAR", str(out_res), None, None, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "NO_VERTICAL")

but this is not valid and fails with:
ExecuteError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Invalid cache raster dataset (CRF) with invalid/inconsistent definition.
Failed to execute (ProjectRaster).


texts: Insert multiple value to marker.bindPopup in Leaflet

texts:
I have a value in array like this

  [
   {
"officer_id": "T001",
"officer_name": "Michael",
"type_id": "1122",
"address": "12th Elm Street",
"address_description": "Chloe Toy Shop",
"description": "there's car accident in front of the shop",
"location": {
  "lat": -6.2613226,
  "lon": 106.7966812
}
]

And I have included that value into map marker. I want to ask how to insert two values in markers.bindPopup so when user click the icon, they can see two values, like description, address and officer who take responsibility.

I have insert 2 marker.bindPopup but it's not working. It's only one value that user can see when the icon has clicked.

Here's the script I have tried

    $.ajax({
    url: api_host+'reports',
    type: 'GET',
    success: function(response) {
        for(var i = 0; i < response.length; i++)
        {
            var latitude = response[i].location.lat;
            var longitude = response[i].location.lon;
            //console.log(latitude)
            var marker = L.marker([latitude,longitude]).addTo(map);

                marker.bindPopup(response[i].officer_name).openPopup();
                marker.bindPopup(response[i].description).openPopup();

        }
    }
})

Do you know how user can see more values when they click the icon?


texts: Raster values shows no data when using identify features tool

texts:
I used vector to raster function in QGIS, to convert some points with different values to raster. I tried to use the "Identify Features" to check values for each raster box. The values shows no data like shown below:

The vector points I converted from have normal values.

Why cant I see the values? and what can I do to see the values?


texts:
Am developing a fleet application where i need to track my vehicle movement. and store into mysql db. Am using gt06 gps with a sim card.

Created a java file for checking that gps is sending the data or not. my program is connected with gps but the data am receiving is not clear. can anyone help me out. how to parse the data. or the data am receiving is wrong.

Below program am using

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class BackupServerListener {

public static void main(String[] args) {
    new ServerListener().startServer();
}

public void startServer() {
    final ExecutorService clientProcessingPool = Executors.newFixedThreadPool(03);

    Runnable serverTask = new Runnable() {
        @SuppressWarnings("resource")
        public void run() {
            try {
                ServerSocket serverSocket = new ServerSocket(9876);
                System.out.println("Waiting for clients to connect...");
                while (true) {
                    Socket clientSocket = serverSocket.accept();
                    clientProcessingPool.submit(new ClientTask(clientSocket));
                }
            } catch (IOException e) {
                System.err.println("Unable to process client request");
                e.printStackTrace();
            }
        }
    };
    Thread serverThread = new Thread(serverTask);
    serverThread.start();
}

private class ClientTask implements Runnable {
    private final Socket clientSocket;

    private ClientTask(Socket clientSocket) {
        this.clientSocket = clientSocket;
    }

    public void run() {
        System.out.println("Got a client !");
        while (true) {

        try {
            BufferedReader reader = new BufferedReader( new InputStreamReader(clientSocket.getInputStream()));
            String clientData = "";

            clientData = reader.readLine();
            String hex_value = asciiToHex(clientData);
            System.out.println("clientdata::::"+hex_value);

        } catch (IOException e) {
            e.printStackTrace();
        }

     }

    }
    private String asciiToHex(String clientData) {

        char[] chars = clientData.toCharArray();
        StringBuffer hex = new StringBuffer();
        for (int i = 0; i < chars.length; i++)
        {
            hex.append(Integer.toHexString((int)chars[i]));
        }
        return hex.toString();
    }

 }
}


texts: Reshaping polygons with curves in ArcMap?

texts:
I'm looking for a good method for reshaping parcel polygons that have curves. One side of a given polygon (like in my screenshot) has a curve but for some reason, the other side was made with straight segments. There is only a very small difference (0.5 feet for example). I'd like to replace the straight segments with the same curve as on the adjacent polygon. Often the straight segments are on very large right-of-ways so the reshape tool (without temporarily clipping the polygon into a smaller sub-unit) is not a great option. When I try to reshape, and trace the curve, it inevitably follows the path of the straight segment (I think these straight pieces were created through tracing anyway? though I'm not entirely sure). I tried setting the snapping tolerance to like 2 pixels but then I often can't even find the start of the curve. I should add that I don't know the radii of these curves so tracing would be best. Can anyone recommend a working solution to help me out? Simpler would better, obviously, but I'm ready to jump through hoops if necessary.

Straight Edges:

Curved Edges:


texts: pyqgis 3 setup vector labeling not working

texts:
I have a standalone pyqgis3.2.1 (Bonn) application that can display maps (vectors, rasters). I tried to setup labeling of vector layers using the following codes, but it only works for point layers, not for line layers:

pal_layer = QgsPalLayerSettings()
pal_layer.fieldName = 'facilityid'
pal_layer.enabled = True
labels = QgsVectorLayerSimpleLabeling(pal_layer)
layer.setLabeling(labels)
layer.setLabelsEnabled(True)
layer.triggerRepaint()

I also tried setting XML properties approach like in this post, but it didn't work on line vector either. What did I do wrong?


texts: Plugin builder - how to validate input values from a plugin dialog

texts:
I have a question regarding adding a warning popup when a user pressed OK while forgetting to fill in all the required fields in the plugin dialog.
I have the following definition which checks if all fields contain text:

def inputCheck(self):
    if self.dlg.lineEdit_dxf.text() == "":
        QMessageBox.information(None, "Warning!", "Select a .dxf file" )
        return False
    return True

I thought that by adding the following code (see below) in the "def run(self)" part of the script the dialog would not close when the user presses OK. However, while the popup works fine and the script does not run, the dialog still closes down.

def run(self):
    self.dlg.show()
    result = self.dlg.exec_()
    if result:
        if not self.inputCheck():
            return

        #rest of script#

I built my plugin with the help of the plugin builder and I have not changed the overall layout of the script.


texts: ogr2ogr can't append shapefile to existing Postgres table

texts:
Using ogr2ogr within python (and Windows 10), I can upload a shapefile to Postgres as a new table. However, my shapefile is made of 10 parts (10 shapefiles). I can upload the first .shp but when trying to append the next .shp to the table, I get an 'Error: layer already exists'. Even though I'm using the -append tag in my command.

Here is my command for the first shapefile AND subequent shapefiles to append:

ogr2ogr -f "PostgreSQL" PG:"host=url port=5432 dbname=db1 user=username password=password" -append -nln tablename -lco GEOMETRY_NAME=shape -lco SCHEMA=schema1 "D:\path\shapefile(1,2,3...).shp" -progress -nlt MULTIPOLYGON

or more specifically (as I'm using python):

from subprocess import call
command = r'ogr2ogr -f "PostgreSQL" PG:"host=url port=5432 dbname=db1 user=username password=password" -append -nln tablename -lco GEOMETRY_NAME=shape -lco SCHEMA=schema1 "D:\path\shapefile(1,2,3...).shp" -progress -nlt MULTIPOLYGON'
call(command)

and the error that occurs when trying to append the 2nd shapefile to the newly created table:

ERROR 1: Layer schema1.tablename already exists, CreateLayer failed.
Use the layer creation option OVERWRITE=YES to replace it.
ERROR 1: Terminating translation prematurely after failed
translation of layer shapefile2 (use -skipfailures to skip errors)


texts: QGIS How to draw lines from two points in a CSV?

texts:
I have a largely identical query to How to draw lines from two points in a CSV?, however the solution listed isnt working for me.

My original text format is PID, Start Northing, Start Easting, End Northing, End Easting.

I've tried in excel to make into a WKT compatible format, i.e.

BL2990;LINESTRING(490206.73 214102.673, 490236.94 214134.576)

This works when pasting a single line into QuickWKT, however I can't paste multiple lines in...is QuickWMT intended for a quick preview of single objects only?

In terms of importing as a delimited text file, I have arranged as:

ID;GEOM

"BL2990";"LINESTRING(490206.73 214102.673, 490236.94 214134.576)"
Etc, and saved as a .txt file.

When I import as delimited text and select ";" as delimiter, the import creates the 2 column headers but fails to split the data string into ID and Geometry fields.  What am I doing wrong?

I've tested importing the .txt while excluding the ID header and ID text string which works fine, however it is critical that the lines retain their identifier.


texts:
I'm trying to export some images of Gulf of Mexico infrastructure that will later be used for non-GIS purposes as overlays onto sea current/weather maps (likely in photoshop).

I have no clue how to do this in either Arc or in QGIS. My student version of Arc just ran out but I still have access to Arc through school if there's an easy solution there ( I suppose Arc might have an "easy" solution).

I would rather a QGIS solution though as it is more sustainable for me in the long run. I have seen how to have a transparent background in the Print Composer background, but this doesn't help me when I add map data to the composer as the map data is imported into the composer with a white background.

Any tips? Maybe a way to change the background color of QGIS itself to transparent?

PS: To clarify, I'm looking to export with transparency, not have transparency in the program. Also, if it matters, the layers are vectors.


texts:
GeoServer 2.8.2
I am getting the following error when trying to update our WFS MapInfo asset data stored in a Pitney Bowes Confirm database. This error only effects one dataset. there are several other datasets that update from the same database without any problem.

Sending HTTP 'GET' request to 'http://mapserver---------, waiting for response ...
Received HTTP response header: 'HTTP/1.1 502 Proxy Error'
Received HTTP response header: 'Date: Tue, 26 Feb 2019 22:54:00 GMT'
Received HTTP response header: 'Server: Apache/2.4.7 (Ubuntu)'
Received HTTP response header: 'Content-Length: 469'
Received HTTP response header: 'Content-Type: text/html; charset=iso-8859-1'
HTTP transfer summary - download-size: '469 bytes', download-time: '300.11 seconds', url: 'http://mapserver----------
XML Parser error: 'Error in input dataset:'http://mapserver---------
line:1 column:50 message:whitespace expected'
The XML Module halted on error, see the logfile for details
A fatal error has occurred. Check the logfile above for details
Translation FAILED with 3 error(s) and 0 warning(s) (0 feature(s) output)
FME Session Duration: 5 minutes 1.0 seconds. (CPU: 0.3s user, 0.7s system)
END - ProcessID: 6244, peak process memory usage: 84052 kB, current process memory usage: 81936 kB
A fatal error has occurred. Check the logfile above for details
Program Terminating
Translation FAILED.

Am I right to assume the error is on the database server and not a problem with the GeoServer?

I don't know where to find the file that the error refers to: line:1 column:50 message:whitespace expected'


texts:
I'm trying to add a table in QGIS but I cannot define the datatype of my fields, as when imported they get automatically "read" as string.
I have tried to add a csvt file, by filling a .txt with the datatype of each column/field, as follows:
"String(3)",String(20)",Integer(5)","Real(20.2)","Real(20.2)","Real(20.2)","Real(20.2)"

I saved the file with the same name of the CSV (but followed by the new extensions) and saved it in the same folder containing the original CSV file, as follows:
file_name.csv

file_name.csvt

I have tried to import the CSV by "Add delimited text layer", "Add vector layer", and browsing and dragging the file directly in QGIS. The imported file's fields are still all strings.
Not sure if this is relevant but my computer doesn't recognise the csvt file format and still reads it as a .txt file.
What am I doing wrong?


texts: How to create a catalog from LAS file in a directory with filter

texts: With lidR package, how can I create a catalog with a filter keep_first for example?


texts: ArcGIS Server 10.0, Rest Service not showing relashionship class

texts:
It's the first time that I am using Relationship Classes for a web mapping project.  Everything seems to be set-up properly, meaning I can get the related info out of ArcMap and ArcCatalog when viewing the map service.  But the REST service won't show me the related information.

Update///  I published a service with only my parcel layer in it and still having the same issue.

My Feature Class, Table and Relationship Class are stored in SDE.
I'm using ArcGIS 10.0 SP4 (Server, Desktop and SDE).

Thank you,

Dominic


texts: What is difference between openstreetmap and openlayers?

texts:
What is difference between openlayers & openstreetmaps ?
is openlayers made on openstreetmap or vice versa ?


texts: Network Analyst's Closest Facility - starting from route-possible road segments

texts:
When using Network Analyst's "Closest Facility" tool, if the facilities and Incidents do not lie on the network line (road), the tool starts at the point on the network line closest to the Facility/Incident.

However, a portion of my data will not create a route due to dead end lines in my road network being closest to the points.

I would like the "Closest Facility" tool to utilize the next nearest road segment until it comes up with a possible shortest route path, as I need every incident to have some road distance to the facility, regardless of bad roads.

Is such a thing possible and if so how might one do it?

Background: 14,646 Incidents, 6 facilities, working with up to 200 km distances, 13,793 routes were generated.

edit: 12/13/16, 5:31 pm
Please see how the well closest distance (red lines) connect to some isolated roads. I'm not quite sure how to encourage the tool to either ignore these isolated roads or reach for roads that have a path.


texts: Why IEnumFeature in ArcObjects returns duplicate features?

texts:
During development of ArcGis AddIn I've found strange behaviour of MapSelection when there are a lot of selected features. When I tryed to get selected features I've received duplicate features. So the code below throws an exception "Key already exist" . I have no idea why this happens and how to fix it. Can anybody hekp me?

  IEnumFeature enumFeat = (IEnumFeature) ArcMap.Document.FocusMap.FeatureSelection;
  IEnumFeatureSetup enumSetup = (IEnumFeatureSetup)enumFeat;
  enumSetup.AllFields = true;
  enumFeat.Reset();
  IDictionary<int, int> dicIds = new Dictionary<int, int>();
  while ((feat = enumFeat.Next()) != null)
  {
    dicIds.Add(feat.OID, num);
  }


texts: How can I style a feature that has multiple values for the same field?

texts:
I'm opening a PostgreSQL Table on QGIS which has multiple rows related to the same object (think of how you'd register distinct apartments on the same building).

I do get to style it based on any of it's columns, but at the same time I know that some of the objects have distinct values for some of the fields (valuation, for example).

Which of the rows is QGIS taking the value on which the style is based?


texts:
GeoServer 2.13.0 is running on our server and I want to add some CORS headers to it.

Which version of Jetty does it use so that I can install the correct jetty-serverlet JAR?

Found: http://osgeo-org.1560.x6.nabble.com/Jetty-Version-td5367079.html
Version: 9.2.13.v20150730

Note: This Jetty version is the same as Geoserver 2.10, and can be downloaded from original source or the answered Geoserver Jetty question here: Enabling CORS in GeoServer (jetty)?


texts: Display WMS layer from local GeoServer in mobile application with Cesium JavaScript Library?

texts:
I need to display a WMS layer from my local GeoServer in a mobile application with the Cesium JavaScript Library, but I don't know how to do it.
Can anyone help me?


texts: What could a user have changed to cause a projection / georeferencing problem in ArcMap?

texts:
We use shared mxd files on a network. Several users have older versions of Arcmap (10.0 specifically) that are no longer under ESRI maintenance. One of the mxds that we use is used by several users. One user opens the project and everything is fine but another user (user 2) opens the same project and the imagery does not align with the layers in the project. This is the same project that everyone in the organization uses but only this one user sees this issue (consistently the same person; aka user 2). The vector layers are in one space and the imagery is in another location. I tried removing the user's Normal.mxt file and that also did not fix the problem. I have also tried starting with a blank mxd and adding layers in. Something about this one SID mosaic image for this one user (and only this one user) is problematic. The raster is not in the GDB it is in a folder with an SDW file, an xml (for the sid) and another xml file for the aux.

I really don't understand this because the data frame, vector layers, and imagery are all in the same state plane coordinate system (MD FIPS 1900 in units of Feet). But the most puzzling thing is (as I mentioned above), no other users experience this. We have also been using this image since early in 2015. It previously worked fine for the user who is now experiencing this problem. I figure it is a long shot and the question is likely unable to be reproduced but if anyone has seen anything like this and would like to comment or demonstrate with an answer, it could prove very useful to me.

Coordinate System Info:
NAD_1983_StatePlane_Maryland_FIPS_1900_Feet
WKID: 2248 Authority: EPSG

Projection: Lambert_Conformal_Conic
False_Easting: 1312333.333333333
False_Northing: 0.0
Central_Meridian: -77.0
Standard_Parallel_1: 38.3
Standard_Parallel_2: 39.45
Latitude_Of_Origin: 37.66666666666666
Linear Unit: Foot_US (0.3048006096012192)

Geographic Coordinate System: GCS_North_American_1983
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_North_American_1983
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314140356
    Inverse Flattening: 298.257222101

I noticed that in my image properties the spatial reference is unset but the user that is having the issue has the following image properties including units of meters which is incorrect. The units are feet (e.g. the 0.5 cell size since this is 6" imagery).


texts: Can GeoServer 2.0.2 access ArcSDE 10.0 databases?

texts: It looks like ArcSDE 10.0 databases are not yet supported...  At least documentation on the geoserver-2.0.2-arcsde-plugin doesn't appear to address it specifically, and I can't get it to work.  Is that right?


texts: Moving Point Features (within a Polygon) to the Edge of those Polygon Features

texts:
I have a bit of a complex task, and was wondering if anybody has knowledge that could assist me.

Data: Water utility data that is not connected through a geometric network. Data includes Parcel (polygons), Water Service Meters (Points), Service Laterals(Lines), and Water Mains (Lines).  Meters reside within the Parcels and are connected to nearby Mains through Laterals.

Task: I have been asked to relocate the Meters from within the Parcel polygons to the closest edge of said Parcel polygons.  To complicate matters, I need to ensure that in the end, the Meters are connected to a Main (any nearby Main).


texts: WPF using Web Map displays layers on first run but not second, then third but not fourth

texts:
Having a very strange issue with ArcGIS .NET Runtime 100.9 when the WPF app runs for the first time the requested web map and all layers display correctly but when the app is closed and rerun, the web map loads but layers are not displayed.
This pattern repeats, one successful load, then one were the layers fail to display, then success, then failure over & over again on each rerun.
TokenCredential token = AuthenticationManager.Current.GenerateCredentialAsync
    (new Uri("https://" + _orgDomain + "/sharing/rest"),
        _userName, _password).Result as ArcGISTokenCredential;

_arcGISOnline = ArcGISPortal.CreateAsync
    (new Uri("https://" + _orgDomain + "/sharing/rest"),
        token, CancellationToken.None).Result;

PortalItem portalItem = await PortalItem.CreateAsync(_arcGISOnline, _itemID);

_map = new Map(portalItem);

await _map.LoadAsync();

Map = _map;

The app has been reduced as much as possible and there are very few lines of code left but still can't isolate this strange repetitive behavior.
EDIT: When attaching to the LoadStatusChanged handler I'm seeing a number of layers failing to load with the following 2 errors which appear random: -

FailedToLoad : System.IO.InvalidDataException: Found invalid data
while decoding. at System.Net.GZipWrapperStream.EndRead(IAsyncResult
asyncResult)

FailedToLoad : Esri.ArcGISRuntime.ArcGISRuntimeException: The spatial
index name is invalid. The spatial index name may be a duplicate name.
Rename the table to ensure a unique name.


texts:
I want to use this map from mapbox as base layer in OpenLayers:

http://mapbox.com/#/tileset/iraq

I used this example to make it work. Everything is fine when I keep the code as it is with original layer "world-light", but when I change it to "iraq", it doesn't work.

I checked it in Firebug and it looks fine - it asks for "iraq" tiles as the original page.

Do you have any ideas how to solve it?
Thanks


texts: Unable to delete certain elements from my map

texts:
Can anyone help me get rid of these 2 boxes ?

I can't figure out how they showed up in the first place... I've remove the check marks next to all my layers and the boxes won't go away.

I'm getting desperate as I would rather not have to start over from scratch.


texts: How to atmospherically correct Landsat 8 data?

texts: What is a simple way to atmospherically correct Landsat 8 data using Erdas 9.3 or ArcGIS 9.3?


texts:
I'm new to QGIS and using version 2.10.1-Pisa.

I have two raster layers created from ASTER DEM data. I have one for slope and want to create a binary layer where only pixels between 8 and 60 degrees are included. I've tried "Nepal_Mosaic_Slope@1" >=8 and "Nepal_Mosaic_Slope@1" <= 60 but it says crash dumped and closes QGIS?? Is there something stupid I am doing?
Once I have done this I want to combine the result with a binary raster of elevation which I assume you can do with merge?


texts: Problem loading shapefiles, with different extents, in QGIS?

texts:
I am trying to load 4 shapefiles for sectors in Eastern DRC. 3 will load, but the 4th will not. If I load the 4th first the others do not load?

I've read through, and followed, the other suggestions for similar problems and discovered that while each shapefile says it has the same CRS, the metadata the extents are different.

Walungu: xMin,yMin 3151087.18,-331737.78 : xMax,yMax 3232786.69,-275904.03

Mwenga: xMin,yMin 27.697,-3.99776 : xMax,yMax 28.8922,-2.77678

Walunugu is the shapefile that will only load by itself.

Both say that the selected CRS is EPSG:4326, WGS84.

I have tried save as for each layer and then reload them to see if that would change their extents, with no luck.

Is there any other way I change the extent? Is that even my problem?

Enable on the fly transformation is also selected.


texts: ActiveX control in conflict with ArcToolbox?

texts:
Possible Duplicate:
  Problem with ArcToolbox tools

In arcgis 9.1 (in both OS, XP SP3 and 7 ultimate 64bit) when I open Arctoolbox appears a message that it is impossible to open eevry tools (but the Arcgis works for every other performance), because there is a conflict with web browser (?) and control ActiveX. I think there is a problem in/with Windows register, but I am not be able to make changes. I have ask help to ESRI Italy and ESRI US, but with no solutions. Anyone have had the same problem?


texts: Dissolve ArcGIS Pro Python doesn't take string variable for field list

texts:
I try to dissolve layer having multiple fields statistics calculated. I prepared a string variable which has all the information in it. When I paste printed variable into dissolve it works. However I'm not able to use the variable itself.
EDIT: OutFields is string.

Variable:

print(OutFields)
[[Fields_i[0], "SUM"],[Fields_i[1], "SUM"],[Fields_i[2], "SUM"],[Fields_i[3], "SUM"],[Fields_i[4], "SUM"],[Fields_i[5], "SUM"],[Fields_i[6], "SUM"],[Fields_i[7], "SUM"]]

It works this way:

arcpy.Dissolve_management(IntPolygon, OutPolygon, ToID, [[Fields_i[0], "SUM"],[Fields_i[1], "SUM"],[Fields_i[2], "SUM"],[Fields_i[3], "SUM"],[Fields_i[4], "SUM"],[Fields_i[5], "SUM"],[Fields_i[6], "SUM"],[Fields_i[7], "SUM"]], "", "")

And it doesn't this way:

arcpy.Dissolve_management(IntPolygon, OutPolygon, ToID, OutFields, "", "")


texts: Loading CSV file Polygon Column to Microsoft SQL Table

texts:
How do I import a polygon from CSV to SQL?
I have attempted to use the SQL Import and Export wizard to load it in as varchar(max) and then convert using geography::Parse(column) as well as Geography::STGeomFromText(column,CRS) but in both cases it failed with an error that 'Latitude values must be between -90 and 90 degrees.'
For more context, the data flow so far as been from shapefile to geodataframe using geopandas, then converted to df using pandas and sent to '.csv' using pandas


texts: Downscaling 1km data to 250m with points

texts:
I am doing some species distribution modeling with MODIS 250m data, and would like to downscale 30 arc-second (1km) bioclim data to 250m so that I can use them in my models.

My idea is this:

Rather than resampling the 1km data to 250m (e.g. bilinear interp), what if I were to:

Convert the 250m grid to points
Extract each of the bioclim values at each of the points
Convert the points back into 250m grids.

The idea being that this is a more conservative approach than interpolation, since I wouldn't be making up new data values. Does this seem appropriate/viable, or would I be better off just resampling?

Follow up question: If I were to do this, would the resultant 250m bioclim grids still be considered continuous data? Or are they closer to discrete? The SDMs can handle either, but I need to specify for each variable.


texts: PostGIS speed up query on 9 million row polygon table

texts:
Table bl_data 9 million+ polygon rows with GIST index and the index is clustered
create index ii3 on bl_data using gist(geom);
CLUSTER ii3 ON bl_data;

I have a query that finds records with the same borough,block,lot and geometry
 select distinct a.id
 from bl_data a join bl_data b on st_equals(a.geom,b.geom) and a.yr<>b.yr
 and a.borough='BX' and a.block=3805 and a.lot=7501

running explain analyze verbose yields
"Unique  (cost=0.43..237511571.55 rows=1 width=4) (actual time=7711.454..25624.703 rows=1 loops=1)"
"  Output: a.id"
"  ->  Nested Loop  (cost=0.43..237511560.46 rows=4437 width=4) (actual time=7711.453..25624.701 rows=1 loops=1)"
"        Output: a.id"
"        Join Filter: ((a.yr <> b.yr) AND st_equals(a.geom, b.geom))"
"        Rows Removed by Join Filter: 37741307"
"        ->  Index Scan using ii3_indx on public.bl_data a  (cost=0.43..1262864.82 rows=1 width=159) (actual time=7383.147..11020.128 rows=4 loops=1)"
"              Output: a.yr, a.borough, a.block, a.lot, a.geom, a.id, a.dupe"
"              Filter: (((a.borough)::text = 'BX'::text) AND (a.block = 3805) AND (a.lot = 7501))"
"              Rows Removed by Filter: 9435323"
"        ->  Seq Scan on public.bl_data b  (cost=0.00..331195.84 rows=9431984 width=155) (actual time=0.019..2132.602 rows=9435327 loops=4)"
"              Output: b.yr, b.borough, b.block, b.lot, b.geom, b.id, b.dupe"
"Planning Time: 1.167 ms"
"Execution Time: 25624.780 ms"

the query takes about 25 seconds to complete and I am planning to wrap this query into a function and run it on the entire table which will likely take weeks(?) to finish at this pace.
what steps can I take to speed this up? would indexing borough,block and lot be helpful? is the clustering not helpful?


texts: qgis toolbars revert to default positions on re-opening application

texts:
On my PC and most of my users, we can move the toolbars into their optimal positions for our purposes, save and close the application, and they are still there on re-opening, as you would wish.

However, for a small minority of users, this is not working, and on re-opening, the toolbars are reverting to their default positions when we re-open the application.

Any ideas? I looked at an ini customisation file, but they don't contain data that determines the positions of toolbars, so I don't think there is a solution there.

We are currently on the 2.8.2 Wien LTR.


texts: Check if a point is near a linestring with MySQL Spatial Extension (untrustable)

texts:
I have to discover if a given point is at least 500 meters (ou other distance) from a route line that exist in my database recorded using the MySQL Spatial.

I see there is no similar function in MySQL Spatial, and find a previous answer that doesn't work for me because the line is too big (more than 300km) to check with this solution point by point:
https://stackoverflow.com/questions/12684148/find-n-nearest-linestring-from-a-point-using-mysql-spatial-extensions

I'm even can't create a buffer (a circle/polygon with a given radius) to the point to check if is even touch.

UPDATE - 12/7
I did it, but MySQL Spatial it is seams not trustable.
I made a createBuffer function, to create a 20 points Polygon around the given Point with a meters given distance for the radius: http://pastebin.com/xEFb8ZXi

I'm testing with the QGis the given results from this buffer, and everything is fine with the function (except the meters to decimal degress value that generate smaller then expected, but it is not the issue right now).

And made a few Intersects checks, and this is aways return true, even if the result polygon is not intersects the line.
I remade the same tests using just the center point, and the results is the same.
I discovery now that the INTERSECT doesn't check the LineString with the Point or Polygon, but the Bounding Box of the LineString, when a indicate a point OUTSIDE the Linestring BBox.

Intersects QUERY Where "rota" is the Linestring data:

 SELECT Intersects(rota, createBuffer(GeomFromText('POINT(-19.7736 -43.7255)'),500))
 FROM log_viagem WHERE rota IS NOT NULL;

How can I trust the MySQL Spatial now?
Or my concept about INTERSECTS is wrong?

SOLVED:
I didn't read the important note at 5.5 version of MySQL:

  Note
  Currently, MySQL does not implement these functions according to the specification. Those that are implemented return the same result as the corresponding MBR-based functions.

The Solution is taking with the server administrator to update to 5.6.1, there is an upgrade in the note

  Note
  MySQL originally implemented these functions such that they used
  object bounding rectangles and returned the same result as the
  corresponding MBR-based functions. As of MySQL 5.6.1, corresponding
  versions are available that use precise object shapes. These versions
  are named with an ST_ prefix. For example, Contains() uses object
  bounding rectangles, whereas ST_Contains() uses object shapes.

  As of MySQL 5.6.1, there are also ST_ aliases for existing spatial
  functions that were already exact. For example, ST_IsEmpty() is an
  alias for IsEmpty()


texts:
When using the SUBSETTINGCRS argument of a WCS query, one needs to provide the axis labels in the subsetting CRS.
This answer to GeoServer does not work WCS parameters "subsettingcrs" and "outputcrs" states that

The axis names can be checked from http://www.opengis.net/def/crs/EPSG/0/3857 and they appear to be

Cartesian 2D CS. Axes: easting, northing (X,Y). Orientations: east, north. UoM: m.

However I don’t see this mention or any mention related to axis on the provided link, for this particular CRS or others.
How do I check what are the axis names for a particular CRS ?


texts: Using GDAL for reading calibration and annotation data set

texts:
I have a Sentinel-1 .SAFE data which provides a wealth of information through .tiff images and also .xml files containing annotation and calibration information.

Following the instructions in the related manual document, I know that there are four lookup tables (LUT) related to each image which provides necessary information for converting the radar reflectivity into physical units (sigma-naught, gamma-naught, beta-naught and DN). By opening the relative .xml files I can see these information.

I wonder if there is a GDAL method/function implemented for easy extraction of these information from the respective annotation/calibration .xml files?


texts: Open Script with ArcMap hyperlink on a new window

texts:
I am using a hyperlink to open my script,

import def_measure
def OpenLink ([weg_name] , [path], [Color_Frame]  ):
  bag_path = [path]
  weg_id = [weg_name]
  color_id = [Color_Frame]
  def_measure.frame_match(bag_path,weg_id,color_id)
  return

this is opening .bag file from realsense camera frame with matplotlib

so, sometimes the realsense pipeline it self freeze, still waiting for update.

because of this reason, my ArcMap will also freeze because it can't end the script.

I would like to know if there is a method that I can open one extra python window and run my script with the input value from my attribute, so ArcMap won't crash while the script it fails

I've been looking into subprocess but can't get python run in cmd without admin


texts: Calculating Field from text to integer using ArcMap

texts: I'm using ArcGIS 10.7 trying to calculate a speed field (for my data of roads in California) really simply such that roads = 45 and highways = 65. I know I need to use an if then statement but I'm not too familiar with Python or ArcGIS so I need a function that will allow me to say if the text string includes "FWY" OR "HWY" OR "RTE" return 65 and else = 45. Does anyone know how I could get this done? I'm fine computing with some error as its for an intro class.


texts: Creating Centrelines from Road Polygons using QGIS?

texts:
I want to create center lines from road polygons.

Are there any automated tools in QGIS to do this?

I am including a Screenshot of my vector file below.


texts: How to perform Zoom to ImageMapType in Google Maps API?

texts:
I am adding ImageMapType on Google Map using Google Maps API. Whenever ImageMapType is added then Map should zoom to that ImageMapType. I have read the ImageMapType reference and found out that any specific method however no luck.

I know that there is a method of Map.fitBounds() in which we have to give latlngBounds as a parameter however I am not able to get points from ImageMaptype. Please let me know is there any solution for this problem.


texts:
I am working on projecting a DEM raster in ArcScene to drape some 2D imagery over it, and ran into a snag. Upon further analyzing my DEM TIF file, it does not have an attribute table, which lead me to find that it does not have a z-value for elevation.

This DEM raster is 10m imagery located over a mountain in Maine, and I would prefer to figure out how to attach a z coordinate to this dataset. Is there a way to add a z coordinate to this layer, or should I start searching for other datasets?


texts:
DB_REF is the official reference system for german federal railways - Deutsche Bahn (DB). For a description, see here: http://download-data.deutschebahn.com/static/datasets/aufzug/DB_REF.pdf (german)

The document mentions several EPSG codes, see below. However, trying to view any coordinates given in DB_REF (the actual EPSG code is missing very often), i come up with a position offset of 100m - 500m:

This is elevator dataset (http://data.deutschebahn.com/dataset/data-aufzug) in DB_REF assumed CRS is EPSG:5683, compared with OSM tiles and railway line network (http://data.deutschebahn.com/dataset/geo-strecke), provided in EPSG:4326 (map projected to EPSG:3857). Elevators should be placed on the platforms, between the lines.

Same offset issue occurs when I attempt to save my own data in DB_REF using QGIS - they get an offset to external DB_REF data.

Am I missing any DB_REF CRS? Or could the DB_REF definitions used by QGIS be wrong?

EPSG codes:

  1081   Deutsche Bahn Reference System
  5825   DB_REF geocentic
  5826  DB_REF to ETRS89
  5681   DB_REF geografic 2D
  5830   DB_REF geografic 3D
  DB_REF / 3-degree Gauß-Krüger

  5682   zone 2 (E-N)
  5683   zone 3 (E-N)
  5684   zone 4 (E-N)
  5685   zone 5 (E-N)

  DB_REF / 3-degree Gauß-Krüger+DHHN92 height

  5832   zone 2 (E-N)
  5833   zone 3 (E-N)
  5834   zone 4 (E-N)
  5835   zone 5 (E-N)


texts: Downsampling using GDAL Warp results in a huge difference in statistics

texts:
I'm trying to downsample population data downloaded from https://www.worldpop.org/geodata/summary?id=24777 to lower resolution using the following command

gdalwarp -tr 0.1 0.1 -co TILED=YES -co COMPRESS=LZW /home/ppp_2020_1km_Aggregated.tif /home/ppp_2020_downsampled.tif

However the statistics for downsampled GeoTiff file are wildly different:

ORIGINAL:

  Metadata:
    STATISTICS_MAXIMUM=672314.9375
    STATISTICS_MEAN=36.107581341026
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=382.17835506557
    STATISTICS_VALID_PERCENT=27.29

DOWNSAMPLED:

  Metadata:
    STATISTICS_MAXIMUM=198223773696
    STATISTICS_MEAN=79130.423171493
    STATISTICS_MINIMUM=-258876342272
    STATISTICS_STDDEV=743223866.17039
    STATISTICS_VALID_PERCENT=27.03

For instance the minimum of population should obviously never go negative. The default resampling method near shouldn't cause this either. Is there something obvious I'm missing?


texts: Catchment boundary polygon from catchment area raster

texts:
I am trying to generate a catchment area polygon from a digital elevation model.
I am using SAGA tools in QGIS and used the Flow Accumulation (Flow Tracing) tool to generate a catchment area raster that clearly shows all of the channels (See image)

From here, how could I generate a catchment boundary polygon of the main catchment (middle of the raster)? Is there a tool in SAGA that could do this?

I am new user of QGIS and do not have technical expertise of GIS.


texts: Graph showing proximity of two objects over time

texts: I have a dataset showing time and location data for two moving objects (eg B & D). I want to make a graph which shows how close (difference between LAT/LON) two objects (B & D) have been during their travel over a period of time (3 months). I am a noob but am willing to learn. How I can I make this graph? What tools would I need for this?


texts: Convert KMZ image to UTM projection jpg file

texts: I have some KMZ files that are basically aerial imagery that has been referenced to Lat/Long.  I would like to convert them to a projected UTM coordinates such as NAD 83 in a geo-jpg format.  I was hoping to use QGIS or some low cost method.  I can't seem to get these KMZ files into QGIS to start with.  If I change the file extension of KMZ to a zip, I see both the KML file and then a folder with the unprojected jpg file. QGIS just says it doesn't support or it's not valid format both the KMZ as raster format or the KML (with attached jpg) as a vector format. Any ideas what I could do here?


texts: Extract pixel values of dataset (NetCDF) based on shapefile in R

texts:
I want to extract certain pixel values from a raster stack/brick from one layer (there are two Layers stored in the data - RSS_TOP and RSS_SUB --> if possible I would take both, or separately as long as it works).
Nevertheless, currently I found a solution to have the same projection for my shapefile as well as the raster stack/brick. My problem is, that if I check a plotted rasterfile and shapefile, they dont line up where they should. Thats why there is an error if I want to mask and crop and extract finally my mean pixel values.
I am not sure what causes the problem, since all my data should have the same projection.
# load necessary libraries
library(raster)
library(sf)
library(exactextractr)
library(ncdf4)

# read NetCDF raster files in given directory
files <- list.files(pattern='*.nc', full.names=TRUE)

#generate raster stack using the RSS_TOP layer
r <- stack(files, varname="RSS_TOP")
r
crs(r) <- "+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"

# load shapefile for area of interest
field <- read_sf(dsn = 'Polygon for R', layer = "testfield")
field

#change projection
fieldnew <- sf::st_transform(field, crs = "+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs ") #same projection as raster stack

####
#betterr <- projectRaster(r, crs=field)

### here starts my question
r.mask = mask(newr, fieldnew)
r.mask

# mask areas other than are of interest
r.crop <- crop(newr, fieldnew)
r.crop


texts: Create pandas DataFrame from raster image - one row per pixel with bands as columns

texts:
I have a raster image with 3 bands. I would like to convert this image to a csv file where each row will be one pixel and each column will be one band, so that I can easily see the three values each pixel got.
This is how I have tried to do it:
import rasterio
import rasterio.features
import rasterio.warp
from matplotlib import pyplot
from rasterio.plot import show
import pandas as pd
import numpy as np

img=rasterio.open("01032020.tif")
show(img,0)

#read image
array=img.read()

#create np array
array=np.array(array)

#create pandas df

dataset = pd.DataFrame({'Column1': [array[0]], 'Column2': [array[1]],'Column3': [array[2]]})
dataset

and also like this:
dataset = pd.DataFrame({'Column1': [array[0,:,:]], 'Column2': [array[1,:,:]],'Column3': [array[2:,:]]})

but i'm getting something weird like this table:

I have also tried:
index = [i for i in range(0, len(array[0]))]
dataset = pd.DataFrame({'Column1': array[0], 'Column2': array[1],'Column3': array[2]},index=index)
dataset

but then I get the number of the rows I have and it's still not good:

what do I do wrong?
My goal
Get one pandas table, where each row is a pixel, and it should have 3 columns, one for each band.


texts: Writing a GeoTIFF file that is rotated with respect to a projected coordinate system using Matlab's Mapping Toolbox

texts:
I've been prototyping some processing techniques for SAR images in Matlab.  This requires importing a GeoTIFF file, and then exporting a file with modified data but the same spatial reference.  I have no issue importing the GeoTIFF file, but when I try to write a GeoTIFF file using the code:

    [input_data, reference] = geotiffread(filename);
    info = geotiffinfo(filename;
    geotiffwrite('output.tif', output_data, reference, 'GeoKeyDirectoryTag', info.GeoTIFFTags.GeoKeyDirectoryTag');

Matlab throws up the following error:

  Error using geotiffwrite (line 257)
  The referencing matrix or object supplied to
  function GEOTIFFWRITE specifies that the
  associated raster is rotated or skewed with
  respect to the projected coordinate system.
  Function GEOTIFFWRITE does not support this
  geometry.

It appears that this is caused by the fact that my image is rotated within a UTM coordinate system.  I'm not entirely sure why this would be an issue, given that I experienced no issues with reading the data into Matlab.  I was wondering if anyone knows of any way to resolve this issue or work around this apparent constraint.

UPDATE:

I've tried using Matlab's mapshow function to display my data (I've previously only displayed the image data without georeferencing).  This results in the following figure:

This figure is also not rotated with respect to its UTM coordinate system, which suggests that Matlab isn't accounting for the rotation in its map display functions as well.

SECOND UPDATE:

I've taken a look through the GeoTIFF tags in Matlab, and it does seem that the data needs to undergo an affine transformation, which is where my issue seems to be coming from.  So the transformation is defined in the GeoTIFF file I'm reading into Matlab.  I'm not sure why Matlab can't just copy the tags defining the transformation into the output file, but at the moment, I am exploring two possibilities:

Applying the affine transformation in Matlab, padding it with nodata values, and then saving the transformed data in the GeoTIFF format.  This would require changing some of the other data tags before saving the data.
Using GDAL to copy the metadata of my imported GeoTIFF file to produce the desired GeoTIFF file.


texts: Remove near black borders on Landsat 8 overview images

texts:
I want to eliminate near black pixels around edges of Landsat-8 overview. I'm interested in doing it not for the entire image but some extent, so I clipped it. I tried using GDAL nearblack utility, but faced the problem that it doesn't take into account image border pixels.

Calling

nearblack -of GTiff -nb 1 -o mask.tif input.tif

Produces following result:

When I expected that the output would have looked like this:

Is there a way to force GDAL nearblack utility to ignore pixels around image borders?
To achieve my goal I also tried applying erosion with different structuring elements, but erosion produces "torn edges".


texts: Select attributes in a subregion of a vector layer?

texts:
I have a QGIS vector layer based on a shapefile.

I would like to select a distinct list of attributes in a subregion of that layer based on the lat/longs of a bounding box. Something like:

Select Distinct CODE, DESC from mylayer
Where <entity-in-layer> intersects <bbox defined from lat/lon pairs>

I was sure this would be easy, but my  confidence is now somewhat eroded.


texts: Hide columns in QgsAttributeTableView with Python

texts:
I use this code to initialize QgsAttributeTableView and hide some columns in it in my custom widget:

def __init__(self, layer, canvas, hidden_columns, cache_size=5000, parent=None):
    """Constructor."""
    super(SomeWidget, self).__init__(parent)
    self.setupUi(self)

    self._layer = layer
    self._canvas = canvas
    self._vector_layer_cache = QgsVectorLayerCache(self._layer, cache_size)
    self._attribute_table_model = QgsAttributeTableModel(self._vector_layer_cache)
    self._attribute_table_model.loadLayer()
    self._attribute_table_filter_model = QgsAttributeTableFilterModel(self._canvas, self._attribute_table_model)

    self._attribute_table_view.setModel(self._attribute_table_filter_model)
    self.setHidenColumns(hidden_columns)

def setHidenColumns(self, *args):
    self._config = self._layer.attributeTableConfig()
    columns = self._config.columns()
    for column in columns:
        if column.name in args:
            column.hidden = True
    self._config.setColumns(columns)
    self._attribute_table_view.setAttributeTableConfig(self._config)

But, no matter what, QgsAttributeTableView shows all the columns in the table. I try to apply self._config to self._layer, then add it to legend, open attribute table and everything works as expected (columns are hidden). That shows me that the config with hidden columns is correct. What is wrong with my approach?


texts: QGIS - .vrt DEM layer only partially goes to hillshade

texts:
I am using QGIS 2.12 on Macbook Pro running on Mac OS X Yosemite 10.10.5.

I have six adjacent DEMs of the 7.5-minute quadrangle size (National Elevation Data or NED, I think). I loaded them into a QGIS project, then created a .vrt file by using Raster -> Miscellaneous -> Build Virtual Raster (Catalog) . This created and loaded onto the map canvas the expected seamless .vrt layer DEM.

Then I created a hillshade from the .vrt layer (using Raster -> Analysis -> DEM (Terrain Models)

Only 1/6 of the .vrt layer -- a part that corresponds exactly to one of the original 7.5-minute DEM layers -- appears as hillshade. The other areas of the .vrt layer (corresponding to the other 5 7.5-minute DEMs) look just as they did before (DEMs).

How can I get the entire .vrt layer to make a contiguous hillshade?

Would it be better to merge the 6 DEMs, rather than create the raster catalog .vrt layer? What does "Merge" actually do with two or more rasters?


texts: Iterating field values and using output in ArcMap ModelBuilder

texts:
I am using ArcGIS 10.2 ModelBuilder with the Field Values iterator to select unique field values. I then want to forward these values to the Add Field tool, to create a new field for each unique value.

The problem I have is that the iterator's output value appears to have a temporary starter value of "1" by default, which is then replaced by the actual values once the model runs. However, the issue is that the Add Field tool throws an error before the model even starts, because it cannot use numbers as inputs for field names, so it remains out of action once the "real" values become available.

How fo I flush-out or replace this starting value of "1"?

The Iterate Field Values tool is correctly set to "String" data type, yet the temporary starter / filler value remains "1".

I've attached a picture of my model and submodel.

I was unable to get it working in ModelBuilder, it is presumably a bug. But I was successful in getting it working via a python script along the lines of the answer listed below.


texts: Seeking Algorithm to detect circling and beginning and end of circle?

texts:
I've got lots of flight data from glider pilots in the form of gps fixes in a fixed interval.
I would like to analyze the flight path and detect the start and the end of the 'circling' the glider pilot will do when he finds thermals.

Ideally, an algorithm would give me a start and an end point on the line, defining one "circle". These points could be equal to one of the gps fixes and do not need to be interpolated.

I simply could walk along the flight path, check the turn-rate and have some criteria to decide if the glider is circling or not.

As I am using PostgreSQL with PostGIS extension, I was curious if there is a better approach to this issue.
I already have an procedure to calculate the angle of two line segments:

CREATE OR REPLACE FUNCTION angle_between(
  _p1 GEOMETRY(PointZ,4326),
  _p2 GEOMETRY(PointZ,4326),
  _p3 GEOMETRY(PointZ,4326)
) RETURNS DECIMAL AS $$
DECLARE
  az1 FLOAT;
  az3 FLOAT;
BEGIN
  az1 = st_azimuth(_p2,_p1);
  az3 = st_azimuth(_p2,_p3);
IF az3 > az1 THEN
  RETURN (
      degrees(az3 - az1)::decimal - 180
  );
ELSE
  RETURN (
      degrees(az3 - az1)::decimal + 180
  );
END IF;
END;
$$ LANGUAGE plpgsql;

It should be possible to loop over all line segments and check, when the sum of the angles is greater than 360 or less than -360 degrees. Then I could use st_centroid to detect the center of the circle, if needed.

Is there a better approach?

As requested, I uploaded an example flight.


texts: Bug With Adding Multiple Controls for Selecting Features in OpenLayers

texts:
I am trying to add functionality to my WFS layer which will allow me to do:

Hover over a point and display a tooltip with information about the feature
Click on the point to zoom in on it

I have included my code below, which I borrowed from someone with a similar idea and then modified. Both of the controls work great on their own, but when I try to activate both I (usually) receive an error (it appears that sometimes the functionality works just as I would like it to, but sometimes it does not). Specifically, when I hover over a point, the point is highlighted and the tooltip appears, but when I click I get the following error in Firebug :

this.div is null      OpenLayers.js (line 786)

Here is the code:

//add the main select for zooming
var select = new OpenLayers.Control.SelectFeature(wfsLayer);
wfsLayer.events.on({ "featureselected": onMarkerSelect});

//add the second select for tooltips:
var highlightCtrl = new OpenLayers.Control.SelectFeature(wfsLayer, {
hover: true,
highlightOnly: true,
renderIntent: "temporary",
eventListeners: { featurehighlighted: tooltipSelect,
                  featureunhighlighted: tooltipUnselect } });

//the order in which you add these lines seems to matter!
map.addControl(highlightCtrl);
map.addControl(select);
highlightCtrl.activate();
select.activate();

//support functions
var lastFeature = null;
var tooltipPopup = null;

function tooltipSelect(event){
    var feature = event.feature;
    var selectedFeature = feature;
    //if there is already an opened details window, don\'t draw the tooltip
    if(feature.popup != null){
        return;
    }
    //if there are other tooltips active, destroy them
    if(tooltipPopup != null){
        map.removePopup(tooltipPopup);
        tooltipPopup.destroy();
        if(lastFeature != null){
            delete lastFeature.popup;
            tooltipPopup = null;
        }
    }
    lastFeature = feature;
    var tooltipPopup = new OpenLayers.Popup("activetooltip",
                feature.geometry.getBounds().getCenterLonLat(),
                new OpenLayers.Size(80,12),
                "&nbsp;"+feature.attributes.name,
                true );
     //this is messy, but I'm not a CSS guru
    tooltipPopup.contentDiv.style.backgroundColor='ffffcb';
    tooltipPopup.closeDiv.style.backgroundColor='ffffcb';
    tooltipPopup.contentDiv.style.overflow='hidden';
    tooltipPopup.contentDiv.style.padding='3px';
    tooltipPopup.contentDiv.style.margin='0';
    tooltipPopup.closeOnMove = true;
    tooltipPopup.autoSize = true;
    feature.popup = tooltipPopup;
    map.addPopup(tooltipPopup);
}

function tooltipUnselect(event){
    var feature = event.feature;
    if(feature != null && feature.popup != null){
        map.removePopup(feature.popup);
        feature.popup.destroy();
        delete feature.popup;
        tooltipPopup = null;
        lastFeature = null;
    }
}

function onMarkerSelect (event) {
    //tooltipUnselect(event);
    map.zoomToExtent(event.feature.geometry.getBounds(), closest=true);
}

I have tried calling the tooltipUnselect function inside the onMarkerSelect function in order to remove the effects of the hover select, but this was to no avail.

Does anybody have any suggestions?

Thanks,

-Rob


texts: Access Databases and connecting to ArGIS Online

texts:
Does anyone have any experience using ARGIS Online/Portal and connecting a MS Access database to visually represent spatially referenced data.

I have a database that is regularly updated, can I create a web application/web to display this information live?


texts: I have a fairly accurate formula (implemented in C#), which allows me to convert UK Eastings/Northings to WGS84 Latitudes and Longitudes. Despite extensive Google searches, I could not find a formula to perform the reverse transformation. Could anyone point me in the right direction (a JavaScript/C# example would be ideal)?


texts: Adding to attributes based on shared line in QGIS?

texts:
using 2.18.16 QGIS
Trying to attribute shared poly lines.
for example  would like to calc the adjoining polygon name to a attribute filed Called Adjoin_Po.

so for P01 it would be 'P02,P08'
for P10 it would be 'P03,P11,P17,P09'

for the above image I am looking to query out 4,8,6,2.  The green ones and not the red ones 1,7,9,3.


texts: Shortest path between multiple points in pgRouting

texts:
I have used this great tutorial, and shortest part between two points works fine.
My question is:
How to calculate shortest path between multiple points?


texts: Separated, but combined polygons - unable to split. What determines that?

texts: In Mapinfo it works well when splitting polygons if they are physically separated(non-combined). However, occasionally when conducting "multiparts to singleparts" in QGIS, some errors occur, although the majority of the polygons are processed correct. The logic behind the task must be that polygons that don´t intersects can be splitted. Or?


texts: How to avoid colliding parallel lines in QGIS Composer

texts:
I am preparing a map which is concerned with showing two line features and there relative location to each other. The line features are 20 m apart and at a scale of 1:50 000 or bigger on A3 I want to show which the lines a little separated from each other. The features follow a common path, but change sides irregularly, i.e. one feature is on the south for while, then the north, then th common path changes north south and the line features then alternate between sitting on the east or west of the path.

I would like to do this in QGIS. Is there some sort of automagical dynamic offset control for lines? I can imagine how to rotate symbols based on an adjacent feature, but this is a bit more complicated. I can imagine a method of breaking one line up into segments and then creating an index of those segments compared to the other line acting as an anchor. The index might then be used to specify the offset, however this is a sort one time run solution. Rather just looking for the elegant cartographic solutions, if they exist.

ta


texts:
I'm trying to add Openstreet Map (OSM) to QGIS3 (Ubuntu 16.04) as a background WMS layer. I found a list of OSM WMS Servers, and a WMS tab in the new Data Source Manager (Ctrl+L).

But after clicking the new button and entering the URL http://www.osm-wms.de to Create a New WMS Connection, I get a new connection called osm, which cannot be used. I can't expand the connection in the index pane as with other things like PostGIS, or add anything from that connection.

Can someone provide some pointers on how to manually add the WMS layer (ideally without using plugins)?


texts: Overlaid rasters has white edges in ArcMap

texts:
There are some areas that overlay when I upload this two rasters in ArcMap.
I understand that the white edges can be resolved by ticking the Display Background  Value and put 255 as the value. I tried this method and it works.

But I don't understand why the white edges happened, and why does the 255 value help to resolve this issue?


texts: Connecting Microsoft Access database (.accdb) to QGIS

texts:
I am trying to connect a database to a QGIS map for a project. I've managed to set up the Access/ODBC connection using the ODBC Data Source Administrator, but when I try to add a new database connection in QGIS I get the following error:

"Connection failed - Check settings and try again.
Extended Error information:
Unable to initialize ODBC connection to DSN for XXXXX
[Microsoft] [ODBC Microsoft Access Driver] The database you are trying to open requires a newer version of Microsoft Access."

I would update to the newest version of Access, except that I am already using it.
I am using the latest version of Access 2016 (16.0.9029.2106) -32 bit
Microsoft Access database engine 2016 -32 bit
ODBC Administrator -32 bit
QGIS 2.18.16 - 32 bit
Windows 10

Does anyone know how to fix this error?


texts:
I am trying to derive an average/mean Z-value of the GPS measured polygons. The standard z($geometry) I use for point layers doesn't work obviously. I could use z(start_point($geometry)), but that is only the first point.
Is this possible to derive directly from the polygons, thus without converting the polygones to points? And how would this be possible?


texts:
I would like to create a grid of certain polygons on a map in order to designate survey areas. I have looked up some grid tutorials: however, they focus on creating a grid on top of the whole map, while I just want a grid only in the selected polygons.

Is there a way to only have a grid overlay an area defined by a polygon?

I am using ArcMap 10.3.1


texts: Creating QGIS copy-paste features between two layers using PyQGIS?

texts:
i want to create a QGIS action which copies features between two points layers using pyqgis .

i have read How to create a QGIS action which copies features between layers? and i try to use this code:

# only QGIS < 2.0
iface = qgis.utils.iface
# Make the source layer active
iface.setActiveLayer( sourceLayer )
# Set the selection on the source layer (Could also be done manually with the selection tools
sourceLayer.setSelectedFeatures( [ 1, 5, 10 ] )
# Copy
iface.actionCopyFeatures().trigger()
# Set destination layer active
iface.setActiveLayer( destinationLayer )
# Turn on editing on destination layer, so we can paste
destinationLayer.startEditing()
# Paste features
iface.actionPasteFeatures().trigger()
# Uncomment to automatically save edits
# destinationLayer.commitChanges()

but in my case i dont need to copy selected features but i need to copy all features from sourceLayer to destinationLayer,and i need to transfer common attributes from sourceLayer to destinationLayer .

What changes do I need in this code?


texts: Minimum records in Excel for converting to shapefile

texts:
I'm converting an Excel spreadsheet with 3000 rows and 10 columns. My problem is while exporting Excel to a shapefile I get an error that states:

The Maximum Record length has been exceeded.


texts: Zooming to specific polygon boundary Openlayers

texts:
I want to zoom to specific polygon boundary of some polygon layer.
How can I do this.The map layer is WMS layer.


texts: Defining a scale number from the Helmert transformation

texts:
I know this is more bit of a cartographic issue, but maybe somebody would be able to help. I have an old map georeferenced to the openstreetmap with 50 identical points. I want to get the scale of the old map.

I am using Helmert 4-parameter tranformation (similarity) with the equations:
X=ax-by+X0
Y=ay+bx+Y0
where x and y are the old map coordinates in meters (same as coordinates used from openstreetmap), X0 and Y0 are translations and then there is one scaling and rotation.

Scaling parameter m could be obtained as:
m=sqrt(a^2+b^2)
Rotation is:
alpha=arctan(b/a)

The resolution of the old map is 400 dpi (0.0635 mm per pixel).

I have all the parameters counted now with the least squares method.
Does anybody know how to get the scale of the old map from these parameters? I want the scale in a common form 1 : M (1 : 600 000).
EDIT: Further on I will use iteratively reweighted least squares and I will be omitting those identical points with the biggest spatial error (I am working with very old maps which have mistakes). I will do this to make the definition of scale more accurate. That's why I need to use the transformation parameters for the map scale definition and not only to compare the distances.
Thanks a lot.


texts:
I have files from two sources, one has come from http://www.worldclim.org, contains climate variables such as precipitation and temperature on a world scale, in raster format.

The other has the coordinates of the provinces of Peru. I have prepared the maps separately but I need a new data base of Peru, with their provinces and the average temperature of each province, that is in vector format.

How could you generate this data?

Do you know other sources of climatic variables per provinces or districts for countries?


texts: creating a single point from coordinates

texts:
I need a simple way to enter or create a point from a set of coordinates on a geo referenced photomap in QGIS. The points are shipwreck coordinates that are then visually aligned with the reef features adjacent that we know are associated with the site.
I am cleaning up a large set of coordinates from different sources and I need plot them and keep or reject them one at a time. After this process I can plot them all as a list.
I am running 2.8.1


texts: Converting GeoTIFF with GCPs into PROJCS with python/GDAL?

texts:
I have some data with the following projected coordinate system (obtained via gdalinfo)

PROJCS["WGS 84 / UTM zone 11N",
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-117],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","32611"]]
_EPSGProjection(32611)

I have other files from the same source but these have headings like:

Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
        AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
      (0.5,0.5) -> (-118.624137731569,34.3543955968602,0)
GCP[  1]: Id=2, Info=
      (1481.5,0.5) -> (-118.503860419814,34.3500134582559,0)
GCP[  2]: Id=3, Info=
      (1481.5,1016.5) -> (-118.504350292702,34.2792612902907,0)
GCP[  3]: Id=4, Info=
      (0.5,1016.5) -> (-118.624724103593,34.2838459399194,0)

How do I convert the second example into something like the first example with a PROJCS entry using Python/GDAL.

If they can't easily be converted, what would the equivalent of this code that sets up the coordinate system in python be for the second example?

ds = gdal.Open(fname)
data = ds.ReadAsArray()
gt = ds.GetGeoTransform()
proj = ds.GetProjection()
inproj = osr.SpatialReference()
inproj.ImportFromWkt(proj)
projcs = inproj.GetAuthorityCode('PROJCS')
projection = ccrs.epsg(projcs)

Update 1:

gdal version is 2.1.12

gdalwarp -t_srs epsg:32611 file2.TIF test.tif

then gives the following:

Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
        AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-118.624740866712244,34.354482507403588)

That doesn't really help though as
1) It hasn't added in the PROJCS entry
2) I don't necessarily know the epsg value to enter for all of the files I have.

Update 2:

Doing this:

gdalwarp -s_srs epsg:4326 -t_srs epsg:32611 file2.tif test.tif

Works and means that the new file now contains the PROJCS information in the header.

PROJCS["WGS 84 / UTM zone 11N",

However the issue is that I only know this file needed 32611 as I had an example of another image from the same area. How would I add the projection information when I don't know what it should be beforehand?

Update 3:

I've used the utm library to find the utm zone and using that has allowed me to use gdalwarp. The bit of info I was missing is that the EPSG code is simply 326/327 + utmzone.

gdalwarp -s_srs epsg:4326 -t_srs epsg:32604 file1.tif output.tif

However, this fails for some files

ERROR 1: Too many points (441 out of 441) failed to transform,
unable to compute output bounds.

This data is from Alaska so fairly high latitude but not sure why it'd fail?


texts:
This talk by Paul Ramsey mentions that there is a _ST_BestSRID function in PostGIS. I assume it exists to find the best projection when casting unprojected data for other uses.

I cannot find docs on this. Is it actually exposed, and if so, what are the parameters?


texts:
I have a Roads line feature class and a Zones polygon feature class. I want to make a model that splits the Roads lines using the Zones polygons. The output is to be lines, just like the original, and I only need the attributes from roads, not zones.

I think the operation is equivalent to the Split Geoprocessing tool, except I want the output to be a single line feature class (not separate feature classes for each zone).

What is the best geoprocessing tool to use for this? It's been so long since I've done geoproccessing that I'm a bit rusty on the subtle differences between tools and which tools do the job best.

Advanced ArcGIS Desktop license.


texts: Is it possible to post process iPhone GPS data?

texts:
Is there software available for post processing iPhone based GPS data?

I want to post process a set of coordinate values to correct for measurement errors. There is a NOAA CORS base station about 40 miles from the site I collected the coordinates.


texts:
I have been struggling for some time to find a way to search the asset tables using the FIND tool; I "discovered" address locators.  Is this going to be my solution?  The problem:

I have polygons for buildings, polygons for electrical distribution points (locations of transformers or generators), and symbols for electrical components (i.e. panels).
Asset or location ID is assigned to each feature (such as an asset number or pad number) which is unique.
All of the data related to the building such as contract and maintenance data and electrical distribution ID is in a separate table.  There is also a separate table each of HVAC units, plumbing assets, and other assets all referenced to the buildings unique ID
A table of electrical assets reference the panel asset number, the building ID and the electrical source ID.
Joins will not work in that the relationships are 1-many, and the data is being replicated.
The tables are updated daily from an excel spreadhseet
System is ArcGIS 10.1 on SQL Express SDE geodatabase replicated one-way to three child servers
Users are searching for assets through the ArcGIS program and are trades people with little computer experience.

Searching individual tables and then having to run a link to activate relationships is ridiculous!  The FIND tool just seems the logical answer but the basic tool will only search features in the TOC, not the tables.  I want to be able to search the entire database, run identify, and see everything that is connected.
Example: find an HVAC unit by asset number (found in database table), zoom/pan/identify asset and can see with no further hoops to jump through the facility it's in, the electrical panel that feeds it, the generator that powers the panel, and the other electrical assets attached to the same system.

I have something that will do that now, but it was something forced and edits do not replicate.  I created feature classes and loaded the data from the spreadsheets but the records have no geometry, therefore edits to the feature classes do not replicate, but I do have full search function for any string; which the users love.  I need to create the system properly so it fully functions in searching, editing, and replication.

I created an address locator with the asset number as the single field but if I type in only the digit part of the "address" it will not find it, even dumbing down the confidence to 1.  It will find it if I type in the full name ABCXZ12345 instead of 12345.  It also does not give me the option to identify, drats!

Back to my question - will a composite address locator solve most of my problem?  Is there a way to configure it for partial string search?
Long explanation but I hope it conveys what I am trying to do.


texts: Add point markers in QGIS 3.4 without coordinates

texts: I am new to QGIS and trying to insert svg markers into a map I've been creating. I am struggling to find resources on my exact problem. I read about creating a new georeferenced shapefile and layering it on top of my original map but I am unsure if that is the way to go. Also, the symbols I will want to insert do not have GPS coordinates, but I want to do it roughly by eyeballing. Can someone suggest a procedure or perhaps other useful posts / videos?


texts: Converting GRIB to NetCDF with time dimension using netcdfAll?

texts:
I'm trying to convert grib files to NetCDF. The grib files contains subdata sets which are time related. Using the netcdfAll Java library with the NetCDF-4 C library works fine.

java -Xmx1g -classpath netcdfAll-4.5.jar ucar.nc2.dataset.NetcdfDataset -in ECM_DSD_2015021700_0000 -out ECM_DSD_2015021700_0000.nc -isLargeFile -netcdf4

The resulting NetCDF-4 file:

gdalinfo ECM_DSD_2015021700_0000.nc is listing all subdata sets like
Subdatasets:
  SUBDATASET_1_NAME=HDF5:"ECM_DSD_2015021700_0000.nc"://GaussianLatLon_1280X2560-p07028S-179p9W/100_metre_U_wind_component_surface
  SUBDATASET_1_DESC=[1x1280x2560] //GaussianLatLon_1280X2560-p07028S-179p9W/100_metre_U_wind_component_surface (32-bit floating-point)
  SUBDATASET_2_NAME=HDF5:"ECM_DSD_2015021700_0000.nc"://GaussianLatLon_1280X2560-p07028S-179p9W/100_metre_V_wind_component_surface
  SUBDATASET_2_DESC=[1x1280x2560] //GaussianLatLon_1280X2560-p07028S-179p9W/100_metre_V_wind_component_surface (32-bit floating-point)

The metatada of one subset shows an empty dimension list and a missing time dimension:

gdalinfo HDF5:"ECM_DSD_2015021700_0000.nc"://GaussianLatLon_1280X2560-p07028S-179p9/100_metre_U_wind_component_surface
Band 1 Block=2560x25 Type=Float32, ColorInterp=Undefined
  Min=-25.970 Max=30.284
  Minimum=-25.970, Maximum=30.284, Mean=0.493, StdDev=7.106
  Metadata:
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface__Netcdf4Dimid=15
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_coordinates=time
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_DIMENSION_LIST=
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Center=98
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Level_Desc=Ground or water surface
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Level_Type=1
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Parameter=246
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Parameter_Name=100u
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_Subcenter=0
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib1_TableVersion=228
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_Grib_Variable_Id=VAR_98-0-228-246_L1
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_long_name=100 metre U wind component @ Ground or water surface
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_missing_value=1.#QNAN
    GaussianLatLon_1280X2560-p07028S-179p9W_100_metre_U_wind_component_surface_units=m s**-1
    STATISTICS_MAXIMUM=30.284362792969
    STATISTICS_MEAN=0.49316239946346
    STATISTICS_MINIMUM=-25.969543457031
    STATISTICS_STDDEV=7.1061257055032

So what is the trick to convert the data with the time dimension? I found some python scripts[1] and the ncks tool[2], need I switch to one of them?

After I want to convert each subdataset to a single GeoTiff but this should be more easy when the time dimension was rescued once :-)

I am working with GDAL 1.11 and netcdfAll 4.5

[1] http://pysclint.sourceforge.net/pycdf/pycdf.html and https://readchunks.wordpress.com/
[2] http://linux.die.net/man/1/ncks


texts: Using QGIS 3.12 gdal:proximity doesn't output raster file in output location in PyQGIS standalone application

texts:
I'm trying to use the gdal:proximity function from pyQGIS algorithms.

below is my code for trying to run the algorithms:

def publicgreen_qgis(self, in_fn):
        params = {'INPUT':in_fn,
       'FIELD':'1','BURN':1,'UNITS':1,'WIDTH':10,'HEIGHT':10,
       'EXTENT':'2667.53800002985,56396.4399999964,15748.72099999,50256.3342999838 [EPSG:3414]','NODATA':0,
       'OPTIONS':'','DATA_TYPE':5,'INIT':None,
       'INVERT':False,'EXTRA':'','OUTPUT':'TEMPORARY_OUTPUT'}

        feedback = QgsProcessingFeedback()

        res = processing.run("gdal:rasterize", params, feedback=feedback)

        params = {'INPUT':res['OUTPUT'],'BAND':1,
        'VALUES':'','UNITS':0,'MAX_DISTANCE':0,'REPLACE':0,
        'NODATA':0,'OPTIONS':'','EXTRA':'','DATA_TYPE':5,'OUTPUT':"test/file/proximity.tif"}

        res2 = processing.run("gdal:proximity", params, feedback=feedback)

Have tried running on QGIS python plugin with 'OUTPUT':'TEMPORARY_OUTPUT' but still doesn't output anything.

The code runs without error in my application, however, the output file I want is not created.

EDIT1: running from QGIS python plugin works, was not paying attention to my folder, however, still no output from the application.

EDIT2: have tried changing directories, running without GUI, only gdal:rasterized would give me an output, gdal:proximity still not giving me any output. Not sure how to check if the process is running as well. Program just runs without giving me an output or exception.

EDIT3: Getting results from processing.run GRASS r.resample in PyQGIS seems to have the same problem.


texts:
I'm trying to do something with every feature in featureclass using "foreach" :

ILayer layer = map.Layer[0];
IFeatureClass fclayer = (layer as IFeatureLayer2).FeatureClass;

   foreach (IFeature feature in fclayer)
      {//do something with feature }

but error appears: foreach statement cannot operate on variables of type 'ESRI.ArcGIS.Geodatabase.IFeatureClass' because 'ESRI.ArcGIS.Geodatabase.IFeatureClass' does not contain a public definition for 'GetEnumerator'.

How to organize a enumeration in FC?

Using: C#, ArcGIS 10.2.2


texts: Comparing a list from an arcpy search cursor to a list from a CSV file

texts:
I'm attempting to compare entries in a CSV file to entries in a geodatabase using a search cursor through arcpy.
I'm not sure if this is the best way to go about a comparison against these two datasets but I do not want to have to write to a new CSV. I have attached an extract from the code I am writing and am getting stuck comparing my two lists to each other. Is there a better way to compare these two datasets?

The data is in rows and I want to find entries where 'ID' is common in both list 1 and list 2 when the 'Status' field in list 2 is 'Complete'. When the common element is not found in both lists I want to print the 'ID' field from list 1.

Haven't made it up to that step yet but am confident to work that section out.

Can't seem to compare a list from an arcpy search cursor to a list from a csvreader and am getting stuck here. Have tried every combination of indenting, calling upon the lists specifically, using the list indexes and other methods in IDLE but have removed these for clarity. Haven't used Python for a number of years but relearning everything. Data snapshots added.

Code below:

import arcpy
arcpy.env.workspace = r'Database Connections\PROD edit Water.sde\Water.WATER.Network'
Water = 'Database Connections\PROD edit Water.sde\Water.WATER.Network\Water.WATER.Main'
B = ''
expression =  "\"ID\" != '" + B + "'"
f = 'ID'
Gday = 'DAY'
Gmonth = 'MONTH'
Gyear = 'YEAR'
Gpage = 'PAGE'
y = []
with arcpy.da.SearchCursor(Water, [f, Gday, Gyear], where_clause = expression ) as cursor:
for row in cursor:
    IDs = row[0]
    DAYs = row[1]
    YEARs = row[2]
    y.append([IDs,DAYs,YEARs])
    for num in [IDs]:
        print DAYs

    with open (r'CSV_of_Job_List.csv', 'r') as f:
        csvReader = csv.reader(f, delimiter=',', quotechar='"')
        header = csvReader.next()
        JobDateIndex = header.index("Entered")
        StatusIndex = header.index("status")
        CaptureDateIndex = header.index("Captured")
        EditIDIndex = header.index("ID")
        dates2 =[]
        for row in csvReader:
            JobDate = row[JobDateIndex]
            Status = row[StatusIndex]
            capturedate = row[CaptureDateIndex]
            JobID = row[EditIDIndex]
            for x in [Status]:
                if x == 'Completed':
                    Status = Status

                else:
                    Status = 0
                    dates2.append([JobID,Status,JobDate,capturedate])
            for num in [JobID]:
                print JobDate


texts: ArcPy dissolve field changes output field name pattern

texts:
I am using the Dissolve tool to summarize two point feature classes (item in list). The general pattern of the fields within each item are:

rankx_dest rankx_length rankx_cost

e.g., rank1_dest field.

These are the statistics_fields_dissolve fields being passed in the code below.

statistics_fields_list= ["_dest",
                                "_cost",
                                "_length",
                                "_paved",
                                "_dirt",
                                "_rail",
                                "_boat",
                                "_trans"]
        statistics_fields_dissolve= []

for i in range(1,21):
    for stat in statistics_fields_list:
        stats_field= "rank" + str(i) + stat + " MAX;"
        statistics_fields_dissolve.append(stats_field)

arcpy.Dissolve_management(in_features= item, out_feature_class= item + "_dissolved", dissolve_field="OriginID", statistics_fields= statistics_fields_dissolve, multi_part="MULTI_PART", unsplit_lines="DISSOLVE_LINES")

Then I am passing the input fields in a feature class (from a .gdb) to change them.

item= item + "_dissolved"
        print "changing name for", item
        for i in statistics_fields_in:
            print i
            for e in statistics_fields_out:
                print e
                arcpy.AlterField_management(item, i, e)

However, I get an error ERROR 000728: Field MAX_rank1_dest does not exist within table

When I check the feature classes, the error makes sense in Python.

However, I have no idea why the loop is outputting the first field with MAX first. It does not do this for the second feature class item, nor does it do this for any other field.

I would like to make this field consistent with the other output fields during the dissolve operation, such that the field is MAX_rank1_dest.

Here is what the original attribute table of the two items are before I run dissolve


texts:
I exported a model from model builder to python. But qgis:refactorfields does not accept @row_number as expression.

outputs_QGISREFACTORFIELDS_1=processing.runalg('qgis:refactorfields', outputs_QGISMULTIPARTTOSINGLEPARTS_1['OUTPUT'],'[{'type': 2, 'length': 3, 'expression': u'@row_number', 'name': u'cluster', 'precision': 0}]',cluster)

      SyntaxError: invalid syntax
1   Cannot find variable: row_number
2   Uncaught error while executing algorithm
Traceback (most recent call last):
          File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute
            self.processAlgorithm(progress)
          File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\script\ScriptAlgorithm.py", line 378, in processAlgorithm
            exec((script), ns)
          File "<string>", line 9

I tried with $row_num, it's not working.


texts:
It seems the GDAL upgrade from 1.9 to 1.10 changed the way CSV files are handled so that I now have a non-functioning QGIS. App hangs trying to import csv data file when previously had no problems with this and other csv text files.

I have deleted all data files, all files in the hidden .QGIS folder, all prefs and caches etc yet the app continuously tries to load the problematic file that I have deleted. Even replacing the bad file with another CSV file that works in another project fails to prevent the hang.

So now I have to recreate the project with customised colour schemes and 100s of hours of devt over the last 6 months while QGIS was stable.


texts:
I am trying todispatch events from external javascript to open tooltips or infowindows from feature points.

What I am doing using google maps api is something like this:

function myClick(id){
        google.maps.event.trigger(markers[id], 'click');
}

Could it  be possible using Cartodb.js api or I need to keep track all feature points in an external array?


texts: Downloading MODIS tiles with rts package in R?

texts:
I'm having trouble using ModisDownload(). Every time I use the command, I get the following error message:

Error in .getModisList(x = xx, h = h, v = v, dates = dates, opt = opt,  :
  Download error: Server does not response!
In addition: Warning messages:
1: In merge.list(list(...), .opts) :
  restarting interrupted promise evaluation
2: In merge.list(list(...), .opts) :
  restarting interrupted promise evaluation
3: In merge.list(list(...), .opts) :
  restarting interrupted promise evaluation
4: In merge.list(list(...), .opts) :
  restarting interrupted promise evaluation
5: In merge.list(list(...), .opts) :
  restarting interrupted promise evaluation

I'm using the code below to download MODIS titles.

setwd('C:/modis')
library(raster)
library(MODIS)
library(rts)
library(RCurl)

x = 'MOD14A1'

ModisDownload(x = x,h = c(17,18),v = c(4,5),
  dates = '2011.05.01', mosaic = F, proj = F)

The example for this code is also coming from this website: http://r-gis.net/?q=ModisDownload.


texts:
In QGIS, When exporting my point shapefile to KML, points label are not visible in Google Earth Pro. I follow these steps:

In QGIS, my point shapefile has a name attribute
Right click on the shape file, go to export, format=kml and select all in the select fields to export
When loading this KML in Google Earth, name of my points won't show up. If I select a point, the attribute window shows the name data is there and I can name each point manually but this is too time consuming.

Does anybody know the trick to get labels displayed right away?


texts: How do I increase the 2mB uploadifive limit in Geoserver installed on AWS?

texts:
I've recently migrated a site from Geoserver 2.1.4 installed on a hardware server to Geoserver 2.7.0 installed on an Amazon Web Service. The site uses uploadifive to enable the user to upload a pdf to a different server. This functions exactly the same except there is a 2Mb file size limit for uploads on the AWS which we didn't have on the old server. I've updated the javascript code to overwrite this but it doesn't appear to solve the issue:

j('#file_upload').uploadifive({
      'buttonText'       : 'Add Attachment',
      'height'           : 20,
      'queueSizeLimit'   : 1,
      'fileSizeLimit'    : 20480, // 20Mb should be enough
      'auto'             : true,
      'removeCompleted'  : true,
      'queueID'          : 'asset_queue',
      'uploadScript'     : self.options.strAssetHost + 'uploadifive/uploadifive.php',
      'onSelect'         : function(file) { j("#asset_name").text(''); },
      'onUploadComplete' : function(file, data) {
        j("#asset_name").text(file.name);
        self.strFilename = data;
      }
});

Most of the research I've done has pointed me towards adjusting the php.ini file, however I can't seem to find it anywhere and when I create a phpinfo file and navigate to it php doesn't appear to be running. The only things that have changed are the version of Geoserver and server itself so I'm fairly certain there should a setting or a configuration file somewhere to adjust the upload limit, but I'm not sure where.


texts: How to return object or string value with arcpy.SetParameter

texts:
I am creating a geoprocessing tool in ArcMap 10.5.1. I have the following code:

import arcpy
event_data = arcpy.GetParameterAsText(0)
event_data_id = arcpy.SetParameter(1, event_data)
event_data_pc = arcpy.SetParameter(2, event_data)

event_data is the feature class.
event_data_id is the unique id field of the event_data.  This variable is set in the geoprocessing tool interface.
event_data_pc is the postal code field of the event_data.  This variable is set in the geoprocessing tool interface.

However, when I run:

arcpy.AddMessage(str(type(event_data_id)) + ", " + str(type(event_data_pc)))

I get None, None.

What happens to these objects?  Why are they not being passed to the event_data_id and event_data_pc variables?


texts: QGIS 3.4.4 sorts numerical values as text, solution?

texts: I'm trying to sort my numerical values in my attribute table but instead of getting 1, 2, 3 I get 1, 10, 100, 100 etc. When searching for a solution here on Stack Exchange, many people with earlier versions just had to update to a later one, 2.18 e.g. However, I still have this problem for my 3.4.4 version. How can I solve this bug?


texts: User memory limit exceeded (Google Earth Engine error)

texts:
I keep getting the "Error generating chart: User memory limit exceeded" error for my code: https://code.earthengine.google.com/b533573a22c93e3ce40697d807c2102d
I'm trying to generate an NDVI time series from 2010-2020 for Virunga National Park in the Democratic Republic of the Congo. Can someone let me know what to fix in my code?


texts: Standalone Python application from QGIS graphical modeler

texts:
I am trying to run the script generated by my graphical modeller through QGIS script. But I get the following error.

# Prepare the environment
import sys
from qgis.core import QgsApplication
#from PyQt4.QtGui import QApplication
qgs = QgsApplication([], False)
QgsApplication.setPrefixPath("/usr", True)
QgsApplication.initQgis()

# Prepare processing framework
sys.path.append('/usr/share/qgis/python/plugins/')
#sys.path.append('usr/lib/qgis/plugins')
from processing.core.Processing import processing
#processing.initialize()

processing.run('script:AppPointsToGrid',
{'inputdatapoints':'file:///home/vinura/Documents/L900_10000.csv?type=csv&detectTypes=yes&xField=Longitude&yField=Latitude&crs=EPSG:4244&spatialIndex=no&subsetIndex=no&watchFile=no','Output':'/home/vinura/Documents/4.geojson'})

# Exit applications
QgsApplication.exitQgis()
QApplication.exit()

Error

python3 Script2.py
Traceback (most recent call last):
  File "Script2.py", line 15, in <module>
    processing.run("script:PointsToGrid", {'inputdatapoints':'file:///home/vinura/Documents/L900_10000.csv?type=csv&detectTypes=yes&xField=Longitude&yField=Latitude&crs=EPSG:4244&spatialIndex=no&subsetIndex=no&watchFile=no','Output':'/home/vinura/Documents/4.geojson'})
  File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 106, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 125, in runAlgorithm
    raise QgsProcessingException(msg)
_core.QgsProcessingException: Error: Algorithm script:PointsToGrid not found

Simply, the script doesn't get the script:PointsToGrid I made using graphical modeller.


texts: Is it possible to alter the UI colour within ArcMap?

texts:
I was wondering if anyone knows if it's possible to change the colours of the user interface within ArcMap? Specifically the background and text colours of the table of contents and the ArcCatalog/Toolbox Windows etc.

I've done some of my own extensive searching online as well as searching through the questions here on the site and haven't found anything helpful relating to it.

So me educated guess would be that it's not possible but I still wanted to get a definitive answer either way.


texts: Import MySQL Spatial vector layer in QGIS

texts:
I have a spatial table called 'places' in MySQL, with a spatial column 'pt' (point). I tried to import it in QGIS and no points appear. I created a view 'places_as_text' which reproduces the table but shows the points as WKT (used astext(pt) in the definition of the view). Still nothing appears in QGIS.

Any help appreciated


texts:
I am having some trouble running arcpy in VS Code. When I run my simple test scrtipt:

import arcpy

in_shp = r'S:\CVT\ChesterfieldTwp\Data\GIS\Layers\Utilities\SanitarySewer.shp'

for field in arcpy.ListFields(in_shp):
    print(field.name)

VS Code throws an error:

Exception has occurred: GeneratorExit
File "C:\Users\adoezema\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 44, in <genexpr>
  if not any(e in sys.version for e in ("Continuum", "conda-forge", "Anaconda")):
File "C:\Users\adoezema\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 44, in <module>
  if not any(e in sys.version for e in ("Continuum", "conda-forge", "Anaconda")):
File "C:\Users\adoezema\OneDrive - OHM Advisors\ArcTools, Models, and Scripts\Lynda Courses\Scratch.py", line 1, in <module>
import arcpy
 File "C:\Users\adoezema\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\adoezema\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\adoezema\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\Lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)

How do I fix this issue?


texts: Show derived rasters in titles selection QGIS

texts:
I would like to create a map in QGIS 1.8 with indexed titles which are connected with topo-map titles files (geoTIFFs). My endeavor is to make (if it is possible) layer which can react on user mouse click (all of them will use the same PC and the same account) and then reveal/show/load desired map title.

Example: In this screenshot is a selection of titles in layer which I would like to load. All titles are made with "Title index" feature in Raster->Misc and contain path to source geoTIFF file.

My very first guess was to try various action in layer properties (in my case in Index layer). Even if I add default action, none of them seems to be the right one for me (maybe only seems) and I didn't find any similar plugin in repositories.


texts: Showing just color ramp in legend without values

texts:
I'm using ArcMap 10.3.1.

Is there a way to show, on the legend, just the color ramp as a single patch instead of with each group of values?

I don't really need to show those values on the legend.

This is what it looks like now:

I would prefer to have it look like the ramp in the properties window and somehow note that the green area is less concern, while red is more concern.

Such as this:


texts:
I am new to ArcGIS.

Is it possible to create a website that uses Google Map API but imagery from the ArcGIS 10 REST service?

Actually, I like the functionalities provided by the Google Map API like camera.

Is it possible to perform these operation using Google Map API on the imagery provided by REST service of ArcGIS 10.