texts: ogrinfo st_area for geopackage returns invalid target SRID

texts:
I want to use ogrinfo to get areas from a lat-long (EPSG:4326) layer right on the terminal shell,
I'm using the query:
ogrinfo -dialect sqlite -sql "select st_area(st_transform(geom, 32615)) from restauraciones" restauraciones.gpkg

but st_transform returns the following:
Warning 1: unable to read srs_id '32615' from gpkg_spatial_ref_sys
ERROR 1: Target SRID (32615) is invalid

However, if I transform to kml (and change geom to geometry) I get the desired areas:
ogr2ogr -f kml restauraciones.kml restauraciones.gpkg
ogrinfo -dialect sqlite -sql "select st_area(st_transform(geometry, 32615)) from restauraciones" restauraciones.kml

A line from the output:
OGRFeature(SELECT):44
st_area(st_transform(geometry, 32615)) (Real) = 552225.44785029

How can I solve the gpkg_spatial_ref_sys error? I like to use ogr in the shell and I like gpkg.


texts: Representing directional data from an attribute field

texts:
I have a table in ArcMap 10.2 containing strike measurements, in degrees, for ~100 sample sites. Each measurement has a UTM tied to it, and the map has already been populated with points, but I would like to have those points serve as directional representations (arrows would be great).

Is this possible?


texts: Spatial Analyst tool Look up but in ArcView3.2

texts:
Is there any option how to do a Spatial Analyst tool "Look up" operation from ArcGIS 10 in ArcView 3.2?
I have a grid with attributes and need to "extract" values from the table field (values from 0.75 till 1.38) to make a floating-point grid with these values.

I am a beginner in ArcView SW, have not so much experiences. I have tried a reclassify, map calculator, but with no success. Is there some way out how to do it in ArcView 3.2 (Spatial Analyst v2.0a)?

Thanks in advance for any help.


texts: OSM offline tiles -- mbtiles in openlayers

texts:
I used tiledownloader to download offline tiles.
Now with the new policy acces of mapquest this would be difficult.

I found http://osm2vectortiles.org/downloads/ to download some files but they are in .mbtiles

How is it possible to work with .mbtiles in openlayers 3? Should i convert them first? In case of yes, how is that possible?


texts: How should I publish an arcgis toolbox via arcobjects (c#)?

texts:
I've been able to create map and image services by creating, adding, and starting configurations through an IServerObjectAdmin interface to a version 10.0 (sp4) ArcGIS server. Now, I'm shifting my focus to publishing toolboxes as GPServer configurations. I'm referring to the existing cfg file (found here ArcGIS\Server10.0\server\user\cfg) and setting properties exactly as found in this file. Regardless, when I try to add the configuration, I get an RPC failure exception and the SOM service on the targeted server has crashed. I'll include some stripped-down sample code to show how I'm going about adding configurations. I'd appreciate any ideas on how I could better go about publishing a geoprocessing toolbox. The underlying goal is to quickly replicate services from a failing (or failed) ArcGIS server onto another server to decrease downtime.

 ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
 IGISServerConnection gisServerConnection = new GISServerConnection();
 gisServerConnection.Connect(ServerName);
 _serverObjectAdmin = gisServerConnection.ServerObjectAdmin;
 var config = _serverObjectAdmin.CreateConfiguration();
 // set config settings and other properties here
 var config2 = (IServerObjectConfiguration2)config;
 // set other settings accessible via Configuration2 interface
 _serverObjectAdmin.AddConfiguration(config2);
 _serverObjectAdmin.StartConfiguration("folder/service", "GPServer");


texts: Displaying 3D raster/vector in GRASS from command line?

texts:
I am using GRASS 7.0 on ubuntu linux 12.04 x64. I am working through some GRASS tutorials and am able to get a 3d raster to show up when I use the GUI. However, I cannot get the command line interface for the 3d raster to work. When I type nviz ... or wxnviz I get nothing. The manual only seems to clicking on the dropdown box on the displayed 2d image (generated from the command line) in order to show the 3d display. However, when I generate a 2d raster from the command line and then click on the dropdown box in the image window to make it 3d, I just get a blank screen.

So the functionality works in the gui but not from the command line.

Is there a way to generate a 3d display from the command line?


texts: L.Control.Search: Using looping for searching data on Leaflet

texts:
Is there a way to find data from different layers and different propertyNames? I have several GeoJSON data files, with different properties. At this moment I can only search one GeoJSON.

For looping and calling the data I am using this code:

maplink_var = [source1.geojson,source2.geojson,etc];

var <?= $i['maplink_var']; ?> = new L.GeoJSON(<?= $i['maplink_var']; ?>, {
  style: function(feature) {
      ...
    },
  onEachFeature: function(feature, marker) {
      ...
    }
});

and below is the code to find data:

var searchControl = new L.Control.Search({
  layer: source1,source2,source3,
  propertyName: ['propNameSource1','propNameSource2','propNameSource3'],
  marker: false,
  moveToLocation: function(latlng, title, map) {
    var zoom = map.getBoundsZoom(latlng.layer.getBounds());
    map.setView(latlng, zoom); // access the zoom
  }
});

searchControl.on('search:locationfound', function(e) {
  e.layer.setStyle({fillColor: '#3f0', color: '#0f0'});
  if(e.layer._popup) e.layer.openPopup();
}).on('search:collapsed', function(e) {
  featuresLayer.eachLayer(function(layer) {
    featuresLayer.resetStyle(layer);
  });
});

map.addControl( searchControl );

I get an error if I give array on property name, stack on loading, and none of the data appears.


texts: What happens to feature class when importing to feature dataset?

texts:
I am creating a model that needs to ensure that all input datasets end up in the same coordinate system (among other things). I was originally going to batch project all of the datasets whether they need to be projected or not, but then there's the issue of assigning the correct geographic transformation. Then I remembered that all data that is input into a feature dataset has to be the same coordinate system, so I decided to put all the data into one.

My question is: When a feature class is imported into a feature dataset that is of a different coordinate system, does it automatically project the data? What happens?

I tested this myself on roads data and it seemed to project the data, as they lined up nicely with my other data. The thing is, no transformation was needed (and a transformation method was needed had I projected it), so it seems fishy that the data is just automatically projected. Maybe it makes a best guess?


texts: What kind of statistical analysis can be used in Lat/lng?

texts: I am new to R programming and statistic. My boss assigned me a task to do some statistical analysis on the real estate using lat/lng points plus some variables like price. He want to me generate some graph of Hotspot but not heatmap. I have done some googling and know that Hotspot graph has something to do with statistical analysis, but I have never studied statistic before. can someone give me some directions of what method to use?


texts:
The satellite imagery i am rendering is not realistic does not look good.
So i was planning to improve things through code(like adding noise to data or using different overlay texture for different objects for improving their realism ). I don't have any concrete ideas to start on this. Can any anybody point to some resources or ideas that have helped them in dealing with this problem.
I am using C++ and osgearth (If thats  relevant).
Thanks


texts: How to select and shade polygons I am interested based on existing shapefile in ArcGIS 10.2

texts: The shapefile already includes polygons I am interested and others.  I want to make a map put in my paper showing which regions in the world I am interested.


texts: Difference between "Join attributes by location" and "Join attributes by location (summary)"

texts:
I'm using QGIS 3.4.4. I have a polygon layer and a points layer.

When I use Join attributes by location I get the espected results.

When I use Join attributes by location (summary) the task failed, there are no results.

What could be the cause for this inconsistency?


texts: Creating datasets from .tiff and vectors

texts:
We are group of three masters students at University of Oslo, we're writing a research article this semester.

We are proposing a global UAV (drone) localization system by Monte-Carlo Localization and semantic segmentation of flight photage, to make UAV localization independent of GPS.

To do this we train a neural network to segment a flightphoto and then compare that to a global map.

However, we need to create datasets for the training, with ground truths. We have recieved ortographic photos and vectors from the Norwegian Mapping Authority, but we are struggling with the creation of these.

In general, we have a big .TIFF image of a part of Oslo

We want to extract a small portion of this, with a corresponding vector image, like this:

Until now, we have used QGIS to open the TIFFs and vectors, then export a compressed .jpeg of both the ortophoto and the corrosponding vector image, then use python to create smaller portions from those vector sets, like the image above, but this process is slow and cumbersome, QGIS uses approx. 3 mins to just render the images and crashes regularly.

Is there a simpler way to this, perhaps with just using Python?

Our GitHub: https://github.com/in5490-run/


texts: How to avoid ArcMap Python add-in combobox drop-down menu obscuring subsequent UI elements?

texts:
My ArcMap (10.5.1) Python add-in uses a combobox.  When an item is selected from the combobox's drop-down menu, the expected actions are executed successfully.  Sometimes these actions actions can take some time to complete, and sometimes some further UI is required (in the simplest case, a progress dialogue).  The problem is that the combobox's drop-down menu remains visible on screen during this time and can partially or completely obscure whatever subsequent UI is displayed.

I would like the combobox to be dismissed as soon as I make the selection (eg, at the beginning of onSelChange()).

How can I force the combobox's drop-down menu to disappear immediately after an item has been selected?

The combobox will disappear as soon as I interact with anything else on screen (outside of the combobox).  But this is not really sufficient and results in a terrible UI.

Below is the minimal add-in code that demonstrates the issue for a combo-box:

import arcpy, pythonaddins, time

class TestComboBox(object):
    """Implementation for TITest_addin.TestComboBox (ComboBox)"""
    def __init__(self):
        self.items = ["Item {}".format(i) for i in range(100)]
        self.editable = False
        self.enabled = True
        self.dropdownWidth = 30 * 'W'
        self.width = 10 * 'W'
    def onSelChange(self, selection):
        with pythonaddins.ProgressDialog() as prog:
                prog.title = "This is a test."
                prog.animation = "Spiral"
                prog.canCancel = False
                time.sleep(10)
    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
        pass
    def onEnter(self):
        pass
    def refresh(self):
        pass

UPDATE:

I think that any combobox add-in with self.editable = False may exhibit the same problem.  Merely changing that line to self.editable = True fixes the issue.  However, having self.editable = True is not an option for my add-in.

I have logged this issue with ESRI now, and will post back here if I get any useful information from them.


texts: Generating Tiles for Non Geographic Datasets

texts:
Excuse my ignorance if this exists. I don't think I've seen a website ever using something like this.

Have tools been developed that use general tiling methodology to implement non-geographical data sets?

A line graph for instance - say, stock price, climate, or, seismographs? If the measurement frequency is high, these data sets can become extremely dense. Which can be bandwidth intensive when transferring to the client.

Tools like Mapnik and Tile Map Services have solved this for cartographers. You feed these programs data & styles, and they render and serve thousands (millions) of PNGs, which eventually get stitched together on a web slippy map.

This would effectively be a replacement for something like HighCharts, or DyGraphs.

What I'd love is a command line tool that I feed SQL, colors, fonts, zoom levels, etc, and it generates all graph tiles at all desired zoom levels.


texts: Restricting information to metadata sections in GeoNetwork?

texts: As said in Linking website, web services, … using URL when having information about the database or file on the local network, it may be relevant to hide those informations for public users. But this section is empty. Where can I find related information?


texts: Convert XYZ coordinates in .txt files to .tif files?

texts:
I have many .txt files containing UTM XYZ coordinates of my study area. The content of each .txt file looks like this:

493932.0669,5426301.1910,0.468

497932.0669,5426301.1910,0.421

501932.0669,5426301.1910,0.341

505932.0669,5426301.1910,0.178

Aand it follows the general form of: UTM X, UTM Y, Z. Each data point represents the center of a 4km by 4km grid.

What I want to do is to convert these .txt files into .tif files. I know how to do it in ArcGIS; however, it's a long process. I was wondering if there is a Python library (other than ArcPy) that can do this for me.


texts:
How do you update the SRID in a SpatiaLite table?

I am using the QspatiaLite plugin or the SpatiaLite_Gui program to send this SQL to the table:

UPDATE myTable
SET geom = SETSRID(geom,26910)

...but I get:

  violates Geometry constraint [geom-type or SRID not allowed]


texts:
Every time I start a new QGIS project, I have to add the BETA2007.gsb NTv2 Transformation. I would like to modify my QGIS settings in a way, that the NTv2 is automatically added to the project.

When I start a new QGIS Projekt, the following setting dissapears and I need to add the transformation again.

After I add the NTv2 manually via the QGIS UI, in which file is it added?

QGIS has to make a reference somewhere.

I'm using QGIS 3.4.13


texts: QGIS common Attributes - automating "add Vector Layer"

texts:
I am hoping to get some ideas about useful ways to simplify adding vector layers with common attributes, particularly for non-GIS users (i am a borderline non-GIS user) in QGIS Las Palmas.

Generally speaking the group that I deal with know how to add vector layers and draw up polygons of sample sites. However I find that they don't tend to add the attributes required when adding polygons to the model (both in terminology or the right attributes).

The attributes feed into a table in the composer manager , which is used to display site information on published maps. If they don't do this I have to go and make amends, however we have around 50 sample sites going in at one time.

Ideally when they add a vector layer , I would like this to display a fixed set of fields to enter, so that we have common information for each sample site polygon.

I am wondering whether there is either a way to

add layers from a "template"
an existing plugin that could do this
whether I should consider coding something?


texts: QGIS 2.18.14 vector Clip analysis producing erroneous result

texts:
I am trying to perform a vector clip analysis (vector-->geoprocessing tools pull-down menu) using two complicated vector layers and am getting erroneous results. The clip 'Input layer' is shown here:

and the 'Clip layer' is shown here:

Both layers are in the same projection (EPSG 2229) and neither layer has any features selected. However, the analysis result (below) is incomplete, it ignores the two input layer features furthest to the west (blue and purple). The result would be expected if I had all but the two furthest west input features selected, but this is not the case. Furthermore, I have performed the same analysis in different work sessions (and even the prior QGIS version 2.18.13) and gotten different results, but always with at least one of the input features being ignored (either wholly or partially).

I have been able to perform complicated clip analyses in QGIS many times in the past. Sometimes it would take a while, but I could count on valid results. I think this problem first started presenting itself within the last couple of months... I'm not sure what changed. Has anybody else had this problem? Any suggestions?


texts: Qgis is not exporting vector PDF at larger scales

texts:
Context

We're now in the process of transferring our systems to Qgis.

what needs to be done

I need to export a DXF based map from Qgis into vector pdfs, in order to import into the program we use for illustrations.

For additional info : Qgis is not able to do what I need it to do for an illustration.

Problem

After some experimentation this seems to be impossible if I have the print composer zoomed out to 1:500 or greater. This value appears to be not constant. Different data is giving different sizes.

If I'm zoomed in, the pdf exports as a vector, but if I'm zoomed out, it's a raster even though I've unchecked everything I can find that controls when to export to raster.

Question

Can anyone tell me how to get the software to export a vector map at a scale of, for example, 1:10000?

**Further info : workflow **

Export as pdf.
Open pdf in word 2016 and save as word.doc.
Select image, bring to front of text.
Then ungroup.
The smaller images break into drawing objects at this point.  The rasters, obviously, don't.

This is actually easier than getting emfs in from our old GIS program, believe it or not. Or rather, it is if they export as vector pdfs reliably. I'm guessing that there is a resolution setting somewhere that may govern this.

I've tried changing linewidth to zero with no luck. I've tried altering output dpi to 600 and I tried changing main properties from cache to render.

edit - I wonder if there is something that restricts the number of objects which can be in a pdf and automatically saves to raster if that limit is reached?


texts:
I'm following a tutorial on Remote Sensing within R and I'm attempting to crop a Landsat image, however I'm getting the error:
    Error in validityMethod(object) : invalid extent: ymin >= ymax

My code is:

# Find the current extent
extent(landsat)
class       : Extent
xmin        : 269625
xmax        : 337155
ymin        : 3221685
ymax        : 3289215

# Create new extent object
e <- extent(250000, 325000, -3150000,-3250000)

# Crop Landsat
l_crop <- crop(landsat, extent(e))

Is there an error in the syntax or have I missed something?


texts: Editing Popup of ArcGIS Web AppBuilder web map

texts:
I am new to creating web maps and I am currently working with ArcGIS Web AppBuilder Developer Edition. I already figured out how to andjust the size of the popup windows. Now I'd like to change the position of the close, next and maximize button in the top bar of the popup, but have no clue where to start.
Can someone point me in the right direction?


texts: How often does Google change geo-coordinates for given address?

texts:
I geocoded the address "50 Hurt Plaza Southeast, Atlanta, GA 30303" twice.

Once on July 28th, 2014 when I got the coordinates: (33.754208, -84.387272)

And again today, August 18th, 2014, and got the coordinates: (33.754129, -84.38721).

Should I expect google to update its geo-coordinates for given addresses throughout the year?

It's a concern for me because I confirm the identity of buildings in the database I'm working with by comparing the geo-coordinates, and that's not going to work so well if they're in flux.

Note the results above have been rounded to the sixth decimal.


texts: Is it possible to use USGS .shd files in QGIS?

texts:
Has anyone successfully used QGIS with US Geological Survey shd files to map geology - specifically to display colors and geological symbols (dip/strike etc) stored in a USGS supplied shd file.
Looking for a non arc solution.


texts: How I can resample raster data infrom 10 meters to 20 meters resolution in ArcMap?

texts: I downloaded Sentinel 2A satellite images and some bands are in 10x10 resolution and some bands are in 20x20 meters resolution. I would like to convert bands with 10x10 spatial resolution to 20x20 meters and then to combine them with images that have original 20x20 resolution.


texts: Running Query of pgRouting and PostGIS - dijkstra_sp_delta()?

texts:
Using

  PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit
  PostGIS 2.4.4
  pgRouting 2.6.0

and This Tutorial I am trying to run this Query

$conn = pg_connect($conString);
$sql = "SELECT gid, AsText(geom) AS wkt,
           length(geom) AS length, ".TABLE.".id
        FROM ".TABLE.",
            (SELECT gid, geom
                FROM dijkstra_sp_delta(
                    '".TABLE."',
                    ".$startEdge['source'].",
                    ".$endEdge['target'].",
                    3000)
             ) as rt
        WHERE ".TABLE.".gid=gid;";
$query = pg_query($conn,$sql);

but I am getting this error:

  Warning: pg_query(): Query failed: ERROR: function
  dijkstra_sp_delta(unknown, integer, integer, integer) does not exist
  LINE 5: FROM dijkstra_sp_delta( ^ HINT: No function matches the given
  name and argument types. You might need to add explicit type casts. in
  D:\wamp64\www\Route\assets\post.php on line 46

What am I doing wrong?


texts:
The problem of getting from DXF format, to display in QGIS correctly.  We have loaded it in and fixed the rotation and TTF font mapping problems. That is all great, however the objects are coming in offset to where they should be and I cannot understand why... Maybe something to do with the dxf-shape transformation rather than symbols?

When converted to shapefile in QGIS, and with rotation and TTF font mappings applied, they look like this in QGIS:

When compared to how they should look, there are some clear issues with placement:

Please help me to resolve these issues:

Point symbols are all offset – if you look at the point featues, you can see in QGIS that none of them are sitting on the Conduit line. Line geometries such as VM Conduit is in the correct place.
Point symbol offset for Manholes, Cabinets, SweptTs
SweptT rotations are not right... Again compare the two sets of data and you can see it is not correct, please investigate SweptT rotations
Colours – I would like to show the same colours as in the DXF – that means built objects are black, planned objects are red. The problem is that once converted to shapefile I cannot find a field to use to apply a different style/colour. Please investigate what you can get out of the DXF.

Essentially, we need to be able to load DXF files into QGIS and have the reference data display the same as it does in the DXF

Please guide


texts:
I've been experiencing some trouble when inserting some optical satellite imagery into PCI Geomatica 2016 (Trial version).

Whenever I open my .TIL file, an X appears beside its name in the Focus' Maps tab and some parts of the image appear to have disappeared in several places of the original image.


texts: Using python to do a interpolation on field calculator

texts:
I need to increment a row in attribute table:

def func (w,v,pot):
 return pot + ((pot+1 - pot)/(v+1 - v))*(w-v)

The "+1" is not the addition of number one to the variable, is the intention to increment + 1 row in that column of that variable. This is because I need to calculate the actual record using records from the next line.

How can I do that? I know this is basic, but I realy don't know python.


texts: Add a custom control in OpenLayers 3 but it was hide

texts:
I follow an example to add a custom control into Map but it is hide.
http://openlayers.org/en/v3.2.0/examples/custom-controls.html

Is there any wrong in my code ?

map = new ol.Map({
                      controls: ol.control.defaults({
                      attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
                        collapsible: false
                      })
                     }).extend([
                        new RotateNorthControl()
                    ]),
                    target: 'mymap',
                    renderer: 'canvas',
                    layers: [
                        new ol.layer.Tile({source: new ol.source.OSM()}),vectorLayer
                    ],
                    view: new ol.View({
                        //projection: 'EPSG:900913',
                        center: ol.proj.transform([mapLng,mapLat ], 'EPSG:4326', 'EPSG:3857'),
                        zoom: 12
                    })

                });

function RotateNorthControl(opt_options) {

   var options = opt_options || {};

   var button = document.createElement('button');
   button.innerHTML = 'N';

   var this_ = this;
   var handleRotateNorth = function(e) {
   this_.getMap().getView().setRotation(0);
   };

   button.addEventListener('click', handleRotateNorth, false);
   button.addEventListener('touchstart', handleRotateNorth, false);

   var element = document.createElement('div');
   element.className = 'rotate-north ol-unselectable';
   element.appendChild(button);

   ol.control.Control.call(this, {
    element: element,
    target: 'mymap'
   });

   };
  ol.inherits(RotateNorthControl, ol.control.Control);

the control did not show up. how to remove ol-hidden class?


texts: cartodb visualization ownership transfer

texts: I have a visualization created in my cartodb personal account. Can I transfer this viz to my company's enterprise account without recreating it there?


texts: Measuring Distance from Point to Point Along a Path in ArcMap

texts:
I am looking at a village and want to find the distance from each house (point) to the pagoda (point). However, I want the distance to be measured along a path (which I digitized as a polyline) and not just the closest way (ie a route that follows the road, not just the closest path to the pagoda which includes "cutting through" other property).

I am using ArcMap 10.1.

See image below:
I need to find distance to the circled red area.
I want the path to follow the blue, not the green.

I think this would be possible if I did a network analysis (set up a polygon restriction), but this is a rural village and I doubt there is a network dataset available.

Is it difficult to create one?


texts: Should the QGIS "DB Manager" have Microsoft SQL Server as an option?

texts:
I was looking for interactive query options for SQL Server (similar to SQL Server Management Studio). The "DB Manager" works great for Postgres and I'm primarily using the Load as new layer as I build out spatial queries. I would love to be able to do the same thing with SQL Server. Currently, I'll make a view and access that view via the Add MSSQL Spatial Layer..., that's a lot of flipping back and forth.

But I'm fairly inexperienced with QGIS, so I'd like to confirm that I am seeing what I should be seeing and that I'm not missing a configuration item?

If what I am seeing is correct, are there any GIS plug-ins out there that approximate this functionality?  My searches have been unsuccessful so far (searching for SQL and Server returns a lot of irrelevant results!) and the Plugin search brings back a lot of results for Postgres:

QGIS version: 2.12.1-Lyon    QGIS code revision: 16760fd


texts: How to add a floating "crosshairs" icon above leaflet map?

texts:
While reading the article about MapBox's map utility to searching for flight MH370, I noticed that they have a stationary "floating" target (or crosshairs) icon that helps users identify the center of the map, presumably to help them get the exact coordinates they are intending to report.

I've searched our site, but cannot find anything that relates to how to create this object that (I assume) just sits above the map frame.

How would one add a target (or crosshairs) icon centered on their own Leaflet map?


texts:
Do I need to install JAI when I use Geowebcache? Or can I just use one or the other?
I've installed JAI and uses Geowebcache, I'm not sure if I take out the JAI step it would have given the same results.

Thanks


texts: Add map layers during runtime ESRI Javascript API

texts:
I had a look through the ESRI js API (version:3/4) and examples on ESRI's page but I couldn't find something like  an "add map layers from ", where the source is any reachable map service, WMS or ESRI Map service or something else.

If I want one I build it myself?


texts: Generating own vector tiles on OpenStreetMap with filtered layers

texts:
I want to create my own vector tileset based on OSM free data but with filtered layers.

How I must define desired layers for my result tileset?

I have seen the link
OpenMapTiles Vector Tile Schema Implementation but there no description about filtering layers and customization. Prepared world pbf file contained all layers that don't suit my needs and I would like to disable some.


texts: OTB ImageClassifier -The following layers were not correctly generated

texts:
After running the OTB ImageClassifier, I get always the error message:
The following layers were not correctly generated.
What could be the reason for this?


texts: Change name of category heading in legend

texts: In QGIS 2.8.1, I have a SHP layer. In the display it is categorized by one of the fields, "Sannsynlig". In the table of layers and in the legend, it is also identified as "Sannsynlig", as the name below the main layer name ("Faresoner"). However, I would like to have it displayed as "Sannsynlighet". Is it possible to change the name in the legend and in the table of layers?


texts:
I am using a SRTM 30 meters for slope and elevation. When i'm using this 30x30 rasters to generate contours i set a 30m equidistance for contour, and the results are ok.

Now i'm wondering if it's wrong to set a 10m contour from a 30x30 DEM like ASTER or SRTM.


texts: store function attribute of class in QGIS plugin

texts:
I'm pretty new to python and pyqgis so the question will be pretty trivial..

I'm writing a plugin and in one script I have a class and some internal functions..

....
class CreateModelDialog(QDialog, FORM_CLASS):
    def __init__(self, iface):
        QDialog.__init__(self)
....
    def openSr(self):
        projSelector = QgsGenericProjectionSelector()
        projSelector.exec_()
        self.srText.setText(projSelector.selectedAuthId())

Then I have to use the last line (that is the EPSG cose selected and displayed in srText QLineEdit of the QT dialog in another function of the same script:

def createModel(self):
        modelName = self.bxDBname.text()
        modelType = self.cmbBxModelType.currentText()
        crs = self.srText.setText(projSelector.selectedAuthId())

createModel(modelName, modelType, crs)

But I get an error:

NameError: global name 'projSelector' is not defined

I'm sure that is due to the fact that projSelector is a variable that exists only in the local open Sr function.

So the question is: how should I modify the function in order to make the variable callable?


texts: Why is all 0 after using GDAL sieve on a raster layer?

texts:
I have a GeoTIFF with cell values from 0.02 up to 0.75 and many nodata values (which are 0). When using GDAL Sieve with Threshold 1 or 100 (no difference in result) and pixel connection 4, my output layer is allover 0.

Anybody knows, what could be the problem?


texts: MapBox GL API: Add 'property' to 'source' to update map feature colors with dynamic data

texts:
SUMMARY: I need to color code lines based on information not attached to the dataset in the style.  How do I do this?  Below is a suggested path, but apparently it may be the wrong direction to solve my problem.

DETALS:
I'd like to color-code a layer in the map with data that is not already attached to the source; it is coming from somewhere else.

I'd like to use similar code below to dynamically add a new 'property', i.e. newPopulation, that does not already exist in the source, i.e. populationSource.

How do I add a new property and values to a source, i.e. populationSource.

map.addLayer({
    'id': 'state-population',
    'source': 'populationSource',
    'source-layer': 'state_county_population_2014_cen',
    'maxzoom': zoomThreshold,
    'type': 'fill',
    'filter': ['==', 'isState', true],
    'paint': {
        'fill-color': {
            property: 'newPopulation',
            stops: [
                [0, '#F2F12D'],
                [500000, '#EED322'],
                [750000, '#E6B71E'],
                [1000000, '#DA9C20'],
                [2500000, '#CA8323'],
                [5000000, '#B86B25'],
                [7500000, '#A25626'],
                [10000000, '#8B4225'],
                [25000000, '#723122']
            ]
        },
        'fill-opacity': 0.75
    }
}, 'waterway-label');


texts:
I have a shape-file all it's fields are in Arabic. When I opens it in qgis 2.0 all the data is replaced by "?".
I changed the encoding to Arabic or UTF-8 but with the same result.
How can I Open an Arabic Shapefile in Qgis.


texts:
I am just trying to print the layer name using python in my  QGIS plugin by following code.

allLayers = canvas.layers()
for i in allLayers: print i.name()

It is saying an error: Global name canvas is not defined. How to fix this?


texts:
I have the following function that I'm trying to use to save an image of a polygon and point layer. When I render just the polygon layer, it works fine, but the point layer will not render for some reason, either on its own or when passed in conjunction to the polygon layer.

def renderImage(layers, name):
    for layer in layers:
        QgsMapLayerRegistry.instance().addMapLayer(layer)
    # create image
    img = QImage(QSize(800, 600), QImage.Format_ARGB32_Premultiplied)

    # set image's background color
    color = QColor(255, 255, 255)
    img.fill(color.rgb())

    # create painter
    p = QPainter()
    p.begin(img)
    p.setRenderHint(QPainter.Antialiasing)

    render = QgsMapRenderer()

    # set layer set
    lst = [layer.id() for layer in layers]  # add ID of every layer
    render.setLayerSet(lst)

    # set extent
    rect = QgsRectangle(render.fullExtent())
    rect.scale(1.1)
    render.setExtent(rect)

    # set output size
    render.setOutputSize(img.size(), img.logicalDpiX())

    # do the rendering
    render.render(p)

    p.end()

    # save image
    img.save(name+".png","png")

Ultimately what I want to do is display the polygon layer and just the labels from the point layer. Unfortunately right now I can't even get the point layer to display at all, and I'm really stuck as to why. I've verified that the layer is being loaded correctly from the .shp file, and right now its renderer is set to SingleSymbolRender. Before the call to the function above I set the symbol for the point layer using the following lines:

symbol = QgsMarkerSymbolV2.createSimple({'name': 'circle', 'color': 'red'})
layer.rendererV2().setSymbol(symbol)

But the saved image when I render just the point layer is a blank white backdrop.


texts: field information lost when importing geojson file into qgis

texts:
I have an attribute in the geojson file which contains a list of elements (usually 3). The attribute has 700-1000 characters. I learned that for shape files, qgis can only have fields with less than 255 characters. But I am not sure if it is the same for GeoJson. The strange thing is that, the field is not trancated in qgis, but it is almost empty. It shows something like "(3:,...)".

My questions are first, what is the qgis field character limit strategy for GeoJson, and second, is there a way I can avoid this problem and import the entire attribute into qgis?


texts: Join new data to selected features in a table using Arcgis

texts:
I have a point feature class, A, and I have joined data from another point feature class, B, to its attribute table based on spatial location. I selected the second option in the Join Data window ('Each point will be given all the attributes of the point in the layer being joined that is closest to it ...'). It worked perfectly and all fields from B (say Field_1 and Field_2) are added to A.

Then I added two new records to A (two new points to shapefile) and I want to join data from a different point feature class, C, to these two new points. C has exactly the same fields as B but their values are different. I want data from C to be added to the same fields (Field_1 and Field_2) that are already imported from B, but for these new points. I am wondering Is there any way that I can join data from C to selected features in A (these two new points) in ArcGIS?

P.S. I am using ArcGIS 10.1 on Windows 7


texts: How to merge and dissolve adjacent polygons and sum up their attributes in QGIS?

texts:
I have many polygons that are adjacent to each other, and others overlap slightly. I need to merge them and sum up their attribute (Area per class). I attach an image of my problem (Screenshot of my merged polygons. Each color represents a landcover class)

I am able to merge the polygons using the function "merge Layers" from the MMQGIS plugin. But the adjancent polygons of the same type are not dissolved, nor their Area summed up.

I tried already using the function Dissolve (per Area) and doesn´t work either.

I am beginner in QGIS. I am working in QGIS 2.12.3 in a PC.


texts: Random Selection not accurate after applying a filter to the layer

texts:
I am using QGIS 2.18.19.
I have a layer that shows 800+ different locations throughout the city. I want to randomly select say 30 locations using the Random Selection tool. It works great as is when there is no filter on. but once I apply a filter to the layer it would only select a random 10 locations even though I specified 30 in the "Number of selected features" box.


texts: My company has recently implemented ArcGIS Pro and I am completely useless when using it (so it feels). In ArcMap I could simply highlight a column with numbers in it, right click, choose properties and then pad with zeros so that every number has the same amount of digits. With Pro on the other hand, everything seems to be in Python, or else I would have to add padding manually...This is really putting a damper on my project which is due in a few weeks...any suggestions? Image below is what I want Pro attribute table to look like, but Pro attribute table gets rid of padding!


texts: problem of buffering a point on large areas with a projected coordinate system

texts:
could someone clear this up for me please. i remember reading an article not long ago on the web about the problems associated with buffering points on a globe due to the fact that a globe uses angles instead of cartesian coordinates on a plane. the implication was that the usual buffer visualization of concentric rings was totally false when using large areas...ie 500km+.

i just saw this graphic on a bbc site, and wanted to find out if this representation is correct or not.

http://www.bbc.co.uk/news/world-asia-22131316

scroll down for the graphic.

is this graphic accurate?


texts: What expression returns data defined color from a color field eg: (30 50 40 10) using color_cmyk

texts: I have a geology plan with a base color field. I need to write an expression in the data defined color option using "color_cmyk" command. I can not seem to get the expression written correctly. The data is in the format "30 80 20 10"


texts: How to create a visualisation of the world's aeronautical flight paths?

texts:
I am a sculptor making a world globe art project, and I need a still image of the whole world’s actual air traffic routes to use as reference material.

To be clear, I’m not looking for the ‘air traffic flow’ visualisation, which consists of straight line routes interpolated between the airports. I’m more interested in seeing the structure of the road network in the sky, revealed through the actual movements of the planes.

The visualisation im describing appears to have been performed in localised areas, but not yet over the whole globe.

I found this visualisation by Aaron Koblin of the air traffic routes over the USA.  http://www.aaronkoblin.com/work/flightpatterns/index.html

This is basically what I’m looking for, except done over the whole world.

And I came across this animation by 'ITO World' of the European air traffic coming back to life after being grounded by a volcanic ash cloud. http://www.itoworld.com/static/airspace_rebooted.html

europe air traffic http://www.itoworld.com/static//i/visualisation/ash/ash_europe_x2.jpg

I also found these KML air navigation plans drawn by ICAO:

http://192.206.28.84/Website/ANP%20AERONAUTICAL%20INFORMATION.htm

Scroll down three-quarters of the way until you get to this image:

...and then click on the links “MID route UPPER operational" for the mid Atlantic, and the 6 similar links below for KMLs of other parts of the world.
They are useful to me, but I find them confusing in places where lines don’t seem to make sense (ending abruptly and not starting again), and they do not cover the open ocean, or show which routes are used most heavily.

And here is http://www.flightradar24.com/. This shows quite a lot of the world’s air traffic movement live. Its receivers do not have full worldwide coverage, and many types of plane do not show up, but as far as I know it’s the most complete coverage out there.

I imagine the best solution for getting what I want would be to make a time lapse image of the flightradar24.com data over quite a long period of time – a month or maybe even a year to even out seasonal fluctuations, which might be quite pronounced in places like the arctic. However, if a years worth of data is unmanageable, then I'll have to go for less.

As I am using the final digital image as reference material for something I am rendering by hand, I will probably be able to infer any patches that are missing - because of incomplete receiver coverage - using the ICAO navigation plans.

So, assuming it is possible, I would greatly appreciate it if somebody could take me through the process of gathering the necessary data from flightradar24.com and creating the visualisation that I need.
Please go into detail, as I am quite new to GIS, and am not particularly knowledgeable of computers.
I am running QGIS on a 4GB RAM PC. If this is the wrong program to be using, or if my computer is too small for this task, please advise me on what I would need.

I am hoping to make a large GeoTiff  (8 tiles of 13500 x 13500 pixels, a similar size to NASA’s Black Marble 2012 image would be good), showing a map of the worlds flight paths. The most heavily used paths would show up darkest and no traffic at all would be transparent. That way I can use it as an overlay on a world map so I can get my barings.

Of course, if any of you find the idea of performing this visualisation fascinating, especially as it doesn’t seem to have been done over the whole world before, feel free to do it and publish the results!

Thank You
Martin


texts:
I have a process in Python using OGR via the API and the command line. I am tired of my logs being filled with various warnings (so many that it no longer prints after the first 1000). These happen in Python when I call ogr2ogr and when I use OGR's layer.SetFeature. I expect these warnings each time,  they do not actually interfere with anything, and I do not need to see them in my logs.

I can't find anything in the documentation or online for how to suppress these warnings when they occur from an ogr2ogr call and/or with the OGR API in Python. The closest answer I found applied to GDAL, not OGR.

UPDATE: I am getting two different types of warnings that are clogging up my logs:

Warning 6: Normalized/laundered field name: 'Shape_Length' to 'Shape_Leng'

Warning 1: Value 3.40282346638999984e+23 of field can_open of feature 0 not successfully written. Possibly due to too larger number with respect to field width

The former only occurs once and is not much of a problem, the second one occurs for each feature in my feature class where that value is in the cell, which can be thousands of features * up to 20 columns (of course it stops printing after 1000 warnings issued). These warnings don't actually cause problems in my output and I would like to hide them.

Here is the sample code for the ogr2ogr command (I am just clipping an input gdb to an extent) that is causing these error messages, but the same also occurs when working in the OGR API, with shapefiles that have these values.

ogr2ogr -clipsrc -102.38428516 54.5384116051 -102.031403056 54.7529375968 -spat -102.38428516 54.5384116051 -102.031403056 54.7529375968 -f "ESRI Shapefile" <output.shp> <input.gdb>


texts: Formula for rotating half degree square map/data frames in projected coordinate system so that they look straight?

texts:
I am currently developing a map series using ArcPy with ArcGIS Pro.  I am not using the Map Series functionality for this because I need to have lots of control over what is on each map sheet, and there are many exceptions to its many rules.  Instead of using Map Series functionality I am simply using a search cursor to iterate through the map series index and setting the camera extent of the map frame to each map sheet.

For each map frame only one of three map frames is visible, because there is a map frame for each of the UTM/MGA zones in my "third" of Australia.  I use the mean of xMin and xMax of each sheet extent to decide which zone I am in and choose the appropriate map frame to use.

I am using 30 minute (half degree) square map sheets in GDA94, and drawing them in a projected MGA Zone which means they are no longer quite square and depending on where each sheet is in the zone that almost square may be "rotated" slightly.  My understanding is that cartographers will usually "straighten" up the map by rotating it slightly.  Often this is done by eye but my understanding is that there is a formula that can be used to calculate the amount of rotation that is needed to make each sheet look straight.  An example rotation value is `-0.0782913899729035.

Is anyone familiar with the formula that I am trying to describe and able to point me at where I may be able to find details of it for Australia (MGA zones) or globally (UTM zones)?


texts: Looping through shapefiles and lyr files to create multiple map documents using ArcPy?

texts:
Context:

Using ArcGIS 10.3, Python 2.7.8.

I have x .shp and y .lyr files. I am trying to loop through the shapefiles folder and the lyr folder and to create x * y .mxds that each contains one shapefile and one .lyr file.

Code:

import os
import arcpy

workspace = os.getcwd()

lyrFolder = workspace + '\\Lyr\\'
shpFolder = workspace + '\\Shp\\'

mxd = arcpy.mapping.MapDocument(workspace + 'empty.mxd')
dataFrame = arcpy.mapping.ListDataFrames(mxd,"*")[0]

for shapefile in os.listdir(shpFolder):
  if shapefile.endswith(".shp"):
    shpLayer = arcpy.mapping.Layer(shpFolder + shapefile)
    arcpy.mapping.AddLayer(dataFrame,shpLayer)
    shpName = shpLayer.name

    for lyrFile in os.listdir(lyrFolder):
      if lyrFile.endswith(".lyr"):
        lyrLayer = arcpy.mapping.Layer(lyrFolder + lyrFile)
        arcpy.mapping.AddLayer(dataFrame,lyrLayer)
        lyrName = lyrLayer.name

        mxdName = shpName + "_" + lyrName
        mxd.saveACopy(mxdDir + mxdName + '.mxd')

Expected result:

I expected to create the map documents, each one containing 1 shapefile and 1 layer file, as suggested with this minimal example:

shapefiles = [shp1, shp2]
layerfiles = [lyr1, lyr2, lyr3, lyr4]

mxd = [mxd1, mxd2, mxd3, mxd4, mxd5, mxd6, mxd7, mxd8]

mxd1 = shp1 + lyr1
mxd2 = shp1 + lyr2
mxd3 = shp1 + lyr3
mxd4 = shp1 + lyr4

mxd5 = shp2 + lyr1
mxd6 = shp2 + lyr2
mxd7 = shp2 + lyr3
mxd8 = shp2 + lyr4

Current result:

The problem is that each time a new document is created, the previous file is also added, as below:

mxd1 = shp1 + lyr1
mxd2 = shp1 + lyr1 + lyr2
mxd3 = shp1 + lyr1 + lyr2 + lyr3
mxd4 = shp1 + lyr1 + lyr2 + lyr3 + lyr4

mxd5 = shp1 + shp2 + lyr1
mxd6 = shp1 + shp2 + lyr1 + lyr2
mxd7 = shp1 + shp2 + lyr1 + lyr2 + lyr3
mxd8 = shp1 + shp2 + lyr1 + lyr2 + lyr3 + lyr4

I have tried adding os.system("TASKKILL /F /IM ArcMap.exe") at the end of the second loop, but this only seems to solve the problem with the shapefiles: every new document is created with a single shapefile, but the lyr files still pile up till the last mxd.


texts: Using local OpenStreetMap (*.OSM) map with Openlayers 3?

texts: What do I need to load a .OSM map in a client side javascript app? (Imagine an offline webapp).


texts: OpenLayers Add EventListener for Fullscreen close

texts:
I'm currently building a web-app with Angular and OpenLayers. Due to the nature of my site I need to call map.updateSize() when the screen changes size which works as expected.

However when I enter fullscreen using OpenLayers own FullScreen control my maps streches fine but when closing fullscreen it keeps the fullscreen aspect and needs to be updated, hence a call to map.updateSize().

From OL3 ol.control.FullScreen there is an eventlistener on, however I don't know what to bind it to and how to write it. Can anyone provide me with an example, hopefully with the event of closing the fullscreen?


texts: How to manually assign new names to attributes in a spatial data frame column with NA values

texts:
Data can be found here (Admin 1- States and Provinces, first download button): http://www.naturalearthdata.com/downloads/10m-cultural-vectors/

I have a shapefile of the world that I'll be pulling specific countries from (it's a better fit for the data than GADM). Eventually I'll be matching the country regions (identified as "name" in the shapefile) to some created data. Some of the region names are named differently between my dataset and the shapefile, so I need to go in an manually change them. Here's my little bit of code so far:

#pull in world shapefile, remove unwanted columns
world.shp <- readOGR("D:/VPI", layer = "ne_10m_admin_1_states_provinces")
world.shp <- world.shp[, -(c(1:8, 10:43, 45:59))]

#convert to character
world.shp$admin <- as.character(world.shp$admin)
world.shp$name <- as.character(world.shp$name)

#manual shapefile changes for uniform mapping
world.shp[world.shp$admin == "United Republic of Tanzania", "admin"] <- "Tanzania"
world.shp[world.shp$name == "Zanzibar South and Central",] <- "Kusini-Unguja"
world.shp[world.shp$name == "Zanzibar West", "name"] <- "Mjini Magharibi"

In this example, I was successfully able to change "United Republic of Tanzania" to simply "Tanzania." When I try to run the similar lines of code for the regional changes, I get the following error:

  Error in [<-.data.frame(*tmp*, i, j, value = "Kusini-Unguja") :
  missing values are not allowed in subscripted assignments of data
  frames

A quick search suggests that I can't rename anything in the world.shp$name column because there are NA values present. I'm not sure how to remove these NA values while keeping the shapefile a spatial data frame. My initial thought was to run

world.shp$name <- na.omit(world.shp$name)

which resulted in the error:

  Error in [[<-.data.frame(*tmp*, name, value = c("Aruba",
  "Badghis",  :    replacement has 4602 rows, data has 4647

I understand that this is because I still have country names (world.shp$admin) attached to the NA region names, so the rows aren't equal. How else can I remove these NA values so that I can reassign attribute names and keep my Spatial Polygon Data Frame?


texts: How to use a .tpk or GeoTiff file as a Google Maps Overlay

texts:
I am building a webapp using Google Maps, and want to have an image overlaid on top of the usual Map that represents Light Pollution data.
I don't have ArcGIS myself, but I was able to download a 400 MB .tpk file with the image data I need from the website for the authors of the paper that released the dataset. It also includes a 3 GB GeoTiff file.
I've done a bit of research on how to use .tpk, The ArcMap docs show they are compatible in some manner.
This site has a similar question, but it is 8 years old. One of the linked sources in the answer no longer exists, and it would appear that the ArcGIS JS GoogleMaps API does not support the current versions of Google Maps API, so perhaps that is a non-starter.
But that might not really be relevant to the solution I am looking for. I don't know yet.
Given that I have a .tpk file, a geotiff file, and a working webapp using Google Maps created using the React JS Framework, how do I integrate the data into an overlay on Google Maps? This might mean converting it to another format, but as long as it works and maintains high resolution.
The end result would look something like this app (not mine), but with a much more recent dataset and the ability to find the value associated with any lat lng:


texts: How to identify valleys on DEM in ArcGIS 10.1

texts:
First, What is the best and easiest way to identify valleys in a DEM raster?

Second, how do you create a least-cost pathway for each valley in a region based on low angle slope and proximity to rivers?

Any help would be massively appreciated!!!


texts:
I'm working on a map with WMS overlays and a lot of markers, my problem is when I try to calculate the average of points clustered, I've found how to differentiate the behaviour and the label text depending on the number of clustered elements, but I don't know how to reach the "val" value of every clustered point to calculate their average and show in the clustered point.

I think values are into features.cluster array (if I look into it with .toString() I get different numbers of [object][object],[object][object] etc), but I can't understand how to reach those values.

This is the context code:

context: {
    val: function(feature) {
       if(feature.attributes.count>1) {
           [here I should show the average]
       } else return feature.attributes.val;
    },
[...]

And this is just some from the OpenLayers.Style code:

var pointStyle = new OpenLayers.Style({
    strokeWidth: "${strokeFunction}",
    fillColor: "${fillFunction}",
    label: "${val}",
    [...]

Don't think it's needed, but this is the point code where I set the val variable:

[...]
var pointFeature = new OpenLayers.Feature.Vector(point);
     pointFeature.attributes = {
         val: mks[i].m,
         align: "cm"
     };

(mks[i].m is the value I get from a JSON array, it's a number with decimals)

I really appreciate any help you can provide,
Alberto


texts: How to change units and scale of a shapefile?

texts:
I have a polyline shapefile, the default unit is in meters and its length is 117m. Is there a way I can make its length 117km? Like I change the scale of my shapefile?

I want this line to appear to be the same size, only scale up the units:


texts: Why is it not advisable to perform spatial analysis on layers with source datasets having same datum but different projections?

texts:
I have read that it is not advisable to perform spatial analysis on two layers with source datasets having the same datum but different projections loaded in ArcMap.

Since the second layer should supposedly line up with the first one due to lining up data on the fly in ArcMap, I was wondering what could possibly go wrong?


texts: Recovery of MapInfo transaction files (*.TMA, *.TIN, *.TDA)

texts:
MapInfo (v 12.5.1 - 64 Bit, Release Build 122) just crashed on me while I was in the middle of modifying several tables and adding a few new ones to an existing Workspace.

Unfortunately the changes had not yet been saved, so were still being stored in the transaction files (*.TMA, *.TIN, *.TDA).  When I reopened the workspace, I was not expecting the unsaved changes to be recovered automatically, but I found no method to try to import the existing transaction files (which were still on my hard drive) so I could recover my lost data.

Is there a method built into MapInfo (or not) that can be used to recover this lost data?  Or am I forced to recreate it?


texts: Export polygon in geojson as multipolygon

texts:
Anyone knows if is there any way to export a polygon layer in geojson, as multipolygon?

I have a multipolygon shapefile. But there are single and multi polygons.

When I export it to geojson, I got both structures:
Polygons with single feature, are exported as polygons (with 3 arrays)

 "type": "Polygon",
   "coordinates": [
       [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
       [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
   ]

And some polygons formed by several features, are exported as multipolygon, with four arrays:

 "type": "MultiPolygon",
   "coordinates": [
       [
           [ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ]
       ],
       [
           [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
           [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
       ]
   ]

What I need is to get a geojson that shows polygons and multipolygons with the second structure (four arrays)

Anyone could tell me if it is possible, or any clue on how to do it?


texts: Converting shapefile CRS from WGS to UTM in QGIS

texts:
I want to calculate point distance but the result is null, and apparently it is because the point and the raster file have different CRS.
The raster is UTM, and the point is WGS84

I follow the tutorial from here How to convert coordinates from meters to decimal degrees?

However, the point file is the text file I input by myself using a decimal degree for the coordinate. I opened it as delimited text layer, it open perfectly. Then I save as the text layer into ESRI shapefile. At this point the coordinate system is in WGS 84.

Then I tried to save as the shapefile into another file with a different UTM CRS,

but this error message appear

I think there is an option to convert manually the decimal degree coordinates in text file to UTM.Maybe using converter available on the internet. However most of the free converter I found only do it one by one, meanwhile I have around 1200 sampling points. So it will be very time-consuming.

Anybody have insight how to convert it?


texts: Exclude some part from raster using mask

texts: I have a raster and I want to remove only small portion of that raster by using mask and then remaining raster without that portion should be my final raster. Searching for something like erase tool.


texts:
I'm the author of Leaflet plugin for lasso selection (leaflet-lasso). The lasso polygon consists of drawn mouse coordinates converted to lat/lng. When mouse is released, all map features are checked if they contain/intersect with the lasso polygon.
Unfortunately, users have performance issues with large number of map features, see example attached at issue #24.
I added checking for overlapping bounding boxes first, then calling the expensive contains/intersects method. It improved the performance with a small lasso polygon. However, with a large lasso polygon that surrounds all features, the performance improvement is none.
The current algorithm is available at https://github.com/zakjan/leaflet-lasso/blob/410c80bdf439cc66cc68cb38a43afe95b0fc2f24/src/calc.ts#L54-L85
I considered to use a spatial index such as flatbush. However, it doesn't give me any significant performance benefit, because it optimizes only the part of checking bounding boxes, which is fast enough already. The bottleneck is in the contains/intersects part of the algorithm.
I read PostGIS source code (ST_Contains/ST_Intersects) to see if it is doing anything smarter, but as far as I understood it, it seems it's doing the same, using a spatial index only to check bounding box.
Could you suggest me what might be the best option to improve overall performance?


texts: How to add pictures to OpenLayers map using GeoServer?

texts:
I have web map showing land parcel and buildings.I am using GeoServer WMS and OpenLayers.
My buildings are showing as point on map. Then I want to add some images to those points to show when activating image layer just like this example

According to that example I think GeoRSS is the solution. But I have lot of problems just like,

What types of things should do in GeoServer
Where store images etc...

Please give some idea. Is there any tutorials or example?


texts: Determining flow amount along stream using ArcGIS Desktop?

texts:
I have DEM with resolution 20m and also stream network map in shape format, isohyetal map in shape format. I have also historic numerical data for rainfall, runoff and temperature from 1970-2000 for just one gauging station in the area 10x14 km = 140 sqm.

Can anybody give me idea how can I calculate the stream flow amount(Q) for entire area and especially along the main stream, using ArcGIS 9.2?


texts: Displaying Grid line on QGIS Print composer?

texts: I am using QGIS 1.8.0 Lisboa.    I am making a print composer map that displays the grid lines as reference for the coordinates.  But it doesnt display anything (gridlines) on the print composer map. The map is there. But no grid.


texts: PyQGIS: DLL load failed while importing _core. Environment path?

texts:
I would like to ask for help because I got stuck trying to code a custom application with QGIS and Python. I got some Python knowledge but I am quite new to QGIS. I tried the intro of the cookbook: Running Custom Applications.

Now while I run the code from IDLE I constantly get an error message saying:

  File "H:\pathto\qgis_test.py", line 1, in <module>
    from qgis.core import *
  File "C:\Program Files\QGIS 3.10\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
    from qgis._core import *
ImportError: DLL load failed while importing _core: Cannot find module..

I guess this has to do with the environment path variables, I tried alot but can't seem to fix it. From another post out here I tried the sys.path paths, here's mine:

C:\Program Files\QGIS 3.10\apps\qgis\python
C:\Users\myname\AppData\Roaming\QGIS\QGIS3\profiles\default\python
C:\Users\myname\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
C:\Program Files\QGIS 3.10\apps\qgis\python\plugins
C:\Program Files\QGIS 3.10\apps\Python37
C:\Program Files\QGIS 3.10\apps\Python37\Scripts
C:\Program Files\QGIS 3.10\bin\python37.zip
C:\Program Files\QGIS 3.10\apps\Python37\DLLs
C:\Program Files\QGIS 3.10\apps\Python37\lib
C:\Program Files\QGIS 3.10\bin
C:\Program Files\QGIS 3.10\apps\Python37\lib\site-packages
C:\Program Files\QGIS 3.10\apps\Python37\lib\site-packages\win32
C:\Program Files\QGIS 3.10\apps\Python37\lib\site-packages\win32\lib
C:\Program Files\QGIS 3.10\apps\Python37\lib\site-packages\Pythonwin
C:\Users\myname\AppData\Roaming\QGIS\QGIS3\profiles\default\python
C:\Users\myname\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis2web
C:\Users\myname\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins

Currently I set these system variables in PYTHONPATH, and in Path:

C:\Program Files\QGIS 3.10\apps\qgis
C:\Program Files\QGIS 3.10\apps\qgis\python
C:\Program Files\QGIS 3.10\bin
C:\Program Files\QGIS 3.10\apps\qgis\bin
C:\Program Files\QGIS 3.10\apps\Python37

I'm not sure if these are correct, but this gives me the mentioned error. Now if I add:

C:\Program Files\QGIS 3.10\apps\Python37\DLLs

to the PYTHONPATH(s), and try to open my script again in IDLE, it just not opens anymore?

Does anyone see the problem and how to fix this so I can run the script correctly? I would really appreciate it. Thanks in advance!

Further notes:

Before this I got some other errors, fixed some by installing PyQt, Python 3.8.2 (64bit) besides Python 3.7.2 (32bit) which I ran before.
I haven't installed OSGeo4W separately, just QGIS3.10, not sure what that OSGeo4W is exactly, I'm just trying to get the Python part to work.


texts: Spatial index vs two coordinates indexes

texts:
I have a table with two columns: latitude and longitude. I want to get all objects inside a "rectangular" (well, rectangular in a lat/lon coordinate metric) bounding box: min-max latitude and min-max longitude. Basically that boils down to the following pseudo-SQL:

SELECT * FROM MyTable WHERE lat < :maxlat AND lat > :minlat
    AND lon < :maxlon AND lon > :minlon

What's the best solution for indexing my table? A two-column index? Two indexes on the two columns? A spatial index?

I would like to know if a spatial index is really needed in that case, as you need a special column, specific libraries, all that at the expense of database portability and simplicity.

I can guarantee that I will perform only this type of spatial query. And I already have functions to compute the great-circle distance between two point (Haversine function), so I do not need a spatial-enabled database. As for crossing the Pacific, it's out of the covered zone (but could be easily handled by a small test that switch minlon and maxlon).

Note: I'd like to keep this question database-agnostic, but for the sake of completeness I mention the fact that I'm working with PostGreSQL 8, w/o (for now) PostGIS.


texts: Calculate complete spatial randomness using Python

texts:
I currently use the csr() function from Splancs for R (http://cran.r-project.org/web/packages/splancs/splancs.pdf) to calculate complete spatial randomness (CSR) points to be used for spatial statistics. Does anyone perhaps know python code which can create CSR points?

Thanks


texts: Selecting top 5 most expensive items in personal geodatabase

texts:
I'd like to know what is the best way to select the 5 most expensive items (in terms of actual monetary value) in my personal geodatabase where i have a price field. Prices are not necessarily ordered but can be. I'm looking for an elegant SQL solution for this, but currently it seems TOP and LIMIT are not supported in ArcGIS 10 and there is no specific tool to limit your search to just 5. My solution would be to use the IN and TOP 5 keywords like so

SELECT * FROM myTable WHERE itemPrice IN (SELECT TOP 5 "itemPrice" FROM myTable)

I get an error about the SQL syntax, but when i hardcode the values for the top 5 most expensive the query works i.e.

SELECT * FROM myTable WHERE itemPrice IN (100, 105, 110, 125, 150)

I am trying to use the query builder to create a model in ArcMap that will select only the five most expensive items in the attribute table of a feature class.


texts: Earth Engine - function for printing multiple histograms

texts:
I have several time periods within a feature where the precipitation was very low stored in a FeatureCollection with the properties "begin", "end", "amount", "days".I want to use the feature properties begin and end to filter the Sentinel-1 GRD Collection for creating several Histograms at the same time. is this possible with a function and than map()?
link to gee script

I start but i don't know how to do it with the histograms...

Here my function snippet

function hist(feature) {
  //Get properties of feature for filtering Sentinel-1 ImageCollection
  var begin = feature.get("begin")
  var end = feature.get("end")
  var days = feature.get("days")
  var amount = feature.get("amount")
  return ui.Chart.image.histogram(s1_collection.filterDate(begin,end,30))
  }

By the way is there any filter to get an image or feature by their row number?


texts: How does Address Locator pick one of two alternative points in ArcGIS for Desktop?

texts:
I have geo coded the main entrance of buildings on my map and some buildings have more than one entrance. How does address locator pick one of them?

To me it seems it is just randomly picking one of say the three points with the same address.

I am using this data on a network and for routing purposes, I need to guide people to the main entrances and snap them on the network.


texts: Reduction over an image collection Google Earth Engine

texts:
I am using CHIRPS data set (daily precipitation) to derive mean, median, min and max precipitation within a certain time frame. Then, I want to extract the values at specific locations included in a point shapefile and save the results in a table.
The script seems to work but the output for the median returns zeros (0) as value.
Please see the script below
var lat = 34.35;
var point = ee.Geometry.Point(lat, lng);
//var aoi = point.buffer(100000); // Create an area (1km buffer around point)
var country = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017')
.filter(ee.Filter.eq('country_co', 'AF'));
var aoi = country;

Map.setCenter(lng, lat, 5); // Center the map on this location, zoom level 10

var start = '2018-02-15'; // initial date of the image collection
var end = '2018-07-15'; //final date of the image collection

var p1 = ee.Geometry.Point([69.78086, 34.65411])
var p2 = ee.Geometry.Point([61.82234, 30.66048])
var table = ee.FeatureCollection(ee.List([ee.Feature(p1),ee.Feature(p2)]))

var dataset = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY')
    .filterDate(start, end)
    .filterBounds(aoi);

var PrMean = dataset.mean().rename('PrMean');

var PrMedian = dataset.median().rename('PrMedian');

var PrMin = dataset.min().rename('PrMin');

var PrMax = dataset.max().rename('PrMax');

var composites = PrMean
      .addBands(PrMedian)
      .addBands(PrMin)
      .addBands(PrMax);

var YieldLocations = ee.FeatureCollection(table);

var YPrec = composites.reduceRegions(YieldLocations, ee.Reducer.max(), 1);

print(YPrec);```


texts: Getting a dictionary for each feature of a layer with their attribute values using PyQGIS

texts:
I need to obtain, for each feature of a layer, a dictionary with the attribute names and its values using PyQGIS.
I can get all the attributes of the layer using
indiv = QgsProject.instance().mapLayersByName('Individuos')[0]

for feature in features:
    value = feature[field.name()]
    attrs = feature.attributes()
    print(attrs)

But what I need is to create a dictionary with field names as key and their value for each feature.


texts: Disabling on-the-fly projecting in Arcmap?

texts:
Using Arcmap 10.4.1 I'd like to temporarily disable on-the-fly projecting, so as to be able to visually see the spatial offset between two vector layers with differing CRS and/or transformations. A search through the Arc help system, as well as an internet search, turns up nothing.

QGIS has a checkbox that can turn on/off on-the-fly projecting (which works great!), and I'm hoping for something similar in Arc.


texts: Loading map from canvas in QGIS Composer created with Python?

texts:
I'm new to using Python to automate stuff in QGIS. I've used the following code to create a new map composer in QGIS:

# create a new composer
c1test = iface.createNewComposer("mon premier composeur")
# the command above is successful : a new composer window appears

# the variable composeur1 will contain the composer itself
composeur1 = c1test.composition()

# x1, y1, x2, y2 are the dimensions of the composer.
x1,y1 = 0,0
x2,y2 = composeur1.paperWidth(),composeur1.paperHeight()

# I create a map item that will span across the whole area of the composer,
# and I add it to the composer
carte_composeur =QgsComposerMap(composeur1,x1,y1,x2,y2)
composeur1.addItem(carte_composeur)

# refresh
composeur1.refreshItems

As you can see on the screenshot below, the map item is present in the composer, but it's blank. There is only a message "The map will be printed here" (in French in my case). Moreover, the panel "Item Properties" on the right-hand side is empty.

So my question is: how can I force my map item to be binded to the main QGIS canvas, as it is usually the case with map composers?

PS: I am aware of this similar thread but I didn't understand the answer and wasn't able to apply it in my case.


texts:
Sentinel-2 images are usually provided in JPEG2000 format inside a zip-file with accompanying metadata.

A driver has already been coded and will be shipped with GDAL 2.1: GDAL Sentinel-2 driver

As Even Rouault mentioned on the GDAL mailing list:

  You can also compile the driver code as a plugin against older GDAL releases
  (works at least with 1.10 or later)

I would like to use this driver on a set of Win_x64 machines but have no means of compiling it myself.

Is there a way to obtain the Sentinel-2 driver as a plugin for GDAL under Windows? (possibly like the plugins provided on GISinternals)?

edit:
For legacy reasons I am not yet able to switch to GDAL 2.1 so I am explicitly looking for a driver for GDAL 1.11.


texts: What version of SAGA is supported by QGIS 3.18 on Ubuntu 20.04.2, and how do I install it?

texts:
I have been using QGIS on Windows 10, but now have installed Ubuntu (20.04.2) on a high spec laptop and want to use QGIS on that instead.
I installed QGIS 3.18; SAGA was not installed with it. sudo apt install SAGA gave me version 7.3.0 - and a message SAGA version 7.3.0 is not officially supported - algorithms may encounter issues when I try to run anything from SAGA. And I did encounter issues, sadly.
I would like to install a version of SAGA which is supported - but an hour of searching both here and elsewhere has not brought me the answer. I can't say for sure that's not my fault - maybe I'm missing something obvious - but I can't find it. My Windows 10 QGIS has SAGA 2.3.2, but sudo apt install saga=2.3.2 just returns E: Version '2.3.2' for 'saga' was not found.
I am one of those users of Ubuntu who might be classed in the "A little knowledge is a dangerous thing" category - I've been using it on and off for years, but I probably feel like I know a lot more than I actually do, so maybe there's an obvious solution that I'm missing. But I just want to have QGIS with working SAGA on this machine and I can't find what I need to make that happen.


texts: sp::proj4string equivalent in the PROJ6 framework?

texts:
I am confused about the shift from PROJ4 to PROJ6 in the (relatively) recent versions of the spatial packages of R (and gdal for that matter). I used to use sp::proj4string() to get the projection code / CRS argument from an sp object and use that code further in my scripts. Now I get a warning (which tells me that my projection might be inaccurate). I am obviously doing something wrong. Which function should I use to get the projection code without a warning? I would personally prefer the EPSG code if that level of simplicity was possible...

library(sp)

x <- SpatialPolygons(
            list(Polygons(
                 list(Polygon(cbind(c(1,2,3,4,1), c(3,8,10,12,3)))),
                 ID = 1)),
            proj4string = CRS(SRS_string = "EPSG:4326"))

proj4string(x)
#> Warning in proj4string(x): CRS object has comment, which is lost in output
#> [1] "+proj=longlat +datum=WGS84 +no_defs"

Created on 2020-09-18 by the reprex package (v0.3.0)
See also the references and comments in this question


texts: Changing color and transparency of layer using ArcPy?

texts:
I would like to create an ArcPy script to change the color and transparency of a collection of layers.

The color and transparency would be based on wildcards such as "_dog" or "_chicken".

The layer symbology is "single symbol" and the transparency will be a constant percentage for the color.

The problem I encountered, how do I change the color and transparency of the layer?

I can't find any code samples or documentation to point me in the right direction.

I found a post that suggests this is not possible with ArcPy ... hopefully that's incorrect.


texts: Keeping record of lock files when editing geodatabases using ArcGIS for Desktop?

texts:
In my organization, my group edits several Geodatabases and I am trying to find a way to keep track of them when GDBs are edited.

Is there an Esri function or possible an Excel script that would keep track of lock files?


texts: ArcPy: Feature class "doesn't exist" after MakeFeatureLayer

texts:
I was working on a Python script to analyze the geometries of a feature class and write something out. It worked fine the first time, but gave an IOError each subsequent time. I narrowed the problem down to the following: (not my actual code, but shows the weird behavior)

arcpy.Exists("MyFeatureClass")  # returns true
arcpy.MakeFeatureLayer_management("MyFeatureClass", "MyFeatureLayer")
arcpy.Delete_management("MyFeatureLayer")  # returns true
arcpy.Exists("MyFeatureClass")  # returns FALSE

Can anyone think of why the feature class would become inaccessible after making a feature layer out of it? Something to do with locks?


texts: How to project a layer from WGS84 lat/long (automatic projection) to WGS 84 UTM Zone 23S in QGIS?

texts:
So I have a vector layer of polygons in WGS 84 lat/long (i.e. using the automatic projection for lat/long and WGS84 datum). I want to change that to WGS84 UTM 23S in QGIS. I tried doing like online tutorials show (right-click layer, "save as", and choose the CRS you want) but there has been zero distortions to the polygons, even for very big ones comprising tens of kilometers. In other words, it didn't work.
Can anybody help?
I'm using QGIS 2.8.2.

Somebody please help. It's suppose to be simple, but I can't get my head around this zero distortion problem. Anyone?


texts: OpenLayers 3: Center ScaleLine in target DIV

texts:
I am displaying a scale in a DIV:

I would like to display the scale in the center of that DIV.

There does not seem to be an option for that so I am trying to use CSS.

The following, however, does not work (using margin with a specific amout of pixels does work):

.ol-scale-line {
    margin-left: auto !important;
    margin-right: auto !important;
}

How would I go about centering that scalebar?


texts: Merge multiple GPX files, only keeping tracks?

texts:
I need to merge 20-40 GPX files into a single GPX file, while removing waypoints during the process (I only need tracks).

I looked around the GPSBabel GUI application, but found nothing obvious, and the website displays nothing when clicking on either Support or Documentation.

Can the CLI application do this? Or some other Windows application?

Edit: In addition to Oto's Python-based solution below, I found how to use GpsBabel's CLI application to merge GPX files:

SET APP="c:\Program Files\GPSBabel\gpsbabel.exe"
setlocal enabledelayedexpansion
set f=

for %%f in (*.gpx) do set f=!f! -f "%%f"

%APP% -t -i gpx %f% -x nuketypes,waypoints -o gpx -F merge.nuked.gpx

Use "-x nuketypes,waypoints" if you don't care about waypoints.

Important: Make sure the filenames are sequential (eg. 1.gpx, 2.gpx, etc.) so that the route makes sense.


texts:
I have a large list of Lambert coordinates. All those points connected create different area from a country.

I would like to have this map as a SVG path (each region would have its path).

I cannot find any way to do this. I only land on websites that offer the possibility to translate my Lambert coords in GPS coordinates.

Is there any tools that can translate coordinates to SVG ?

See below the final map (without the markers)


texts: QGIS: How to set coordinate unit using google satellite xyz-Tile?

texts:
I'd be glad if someone can help me with this.
So, what I want to do is quite basic: Digitalizing shapes with google satellite image using QGIS. For that I am using the Google satellite-xyz-Tile.

Because I want to upload the shapefiles on a google plugin, the projection should be WGS 84 EPSG 4326. If I'm right the coordinate units in this projection is degrees.

When I load the Google Satellite-Tile to my canvas, I have to reset the projection, both on the project and on the Layer - what I do.

Problem: When I zoom to the layer then, the coorinates in the coordinates display and the extent are not shown in degrees anymore, but in meters or feet, although it says in the layer properties the unit would be degrees.

When I now start to digitalize, my shapefiles also have the wrong extent, although I set the same coordinate system (WGS 84 EPSG 4326) and can therefore not uploaded to the google plugin.

Can someone help here?

EDIT: I found that thread from 6 years ago, which is, I think related to my issue: How to Digitize Free Satellite Imagery in QGIS - Alignment issues with Openlayers Plugin
Is it possible that using google satellite-xyz-tile is still a problem in qgis 3.4?


texts: QGIS automatic editing: create point at start and end nodes of polylines

texts:
For network consistency issues every polyline in layer A must have a point in layer B at start and end nodes.

Lately we've realized our network editors usually forget to add this points to layer B so I'm looking for a way to automatically create this points every time a new polyline is drawn, but checking first if there's no point at the polyline start or end nodes.

Is there any way of doing this using QGIS?

Generally each editor edits their own files: several point, polyline and polygon shapefiles or a single geopackage. There's a small number of editors working with data in Oracle but I want to focus on the easier scenario first.

Editors create or modify polylines when they need to. There's no exact frequency. Maybe once or several times a day or maybe once a week/month.

The workflow should be:

Create or modify a polyline
If a new polyline is created, create a point at its start and end nodes if they are missing. (If a new polyline is snapped to an existing one that one should already have points at its nodes so that should be checked.)
If an existing polyline is modified and the start or end nodes are moved, the related points should be moved too.
New points should get the new polyline unique id in an attribute field.
Edit other related layers.

It's important that points are created right after the end node of the new polyline is created because the order points are created is important (the unique id of points help us track the order they were created).


texts:
I am using ArcMap 10.4.1. I accidentally added a neatline, but now I can't remove it. I now have an ugly white space in between my map and the neatline.
How do I remove it?


texts: Returning null during using SpatiaLite transformation command in Android Studio

texts:
I am using Spatialite version as following:
SPATIALITE_VERSION: 5.0.0-beta1
PROJ4_VERSION: Rel. 6.1.1
I am running the SpatiaLite transform function in the android studio and it returns a null value during running. I did this command in SpatiaLite GUI and the result was correct. I did another SpatiaLite command in the Android Studio and there was no error.
I think the Transform function of SpatiaLite is not recognized in the Android Studio.
This is one part of the code that gets a null value in Android Studio:
String query="select
AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632));"
complete function that I used from spatialite tutorial is as follows:
              public String doSimpleTransform() {
              StringBuilder sb = new StringBuilder();
              sb.append("Coordinate transformation...\n");
              String query="select
        AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632));";
         sb.append("Execute query: ").append(query).append("\n");
              try {
         Stmt stmt = db.prepare(query);
         if (stmt.step()) {
             String pointStr = stmt.column_string(0);
            sb.append(pointStr).append("...\n");
                          }
            stmt.close();
            } catch (Exception e) {
           e.printStackTrace();
           }
          sb.append("Done...\n");
         return sb.toString();
           }

This is a command in Spatialite-GUI that return correct value:
SELECT AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632))


texts: I have just converted a vector dataset of census tracts into a raster data set for an assignment. I can see the uncompressed size of the dataset in layer properties dialog box. But the assignment specifically asks about the uncompressed size AS WELL AS size on the disc. I checked the size on disc by locating the raster files in geodatabase in my C drive but it shows 0 KB. How can I find the size of raster dataset on disc? The uncompressed size in this example is 72.9 mb. Please help!!


texts: Converting Python script from ModelBuilder?

texts:
I ran the ModelBuilder to Python script and now my script won't run. It has a problem with the local variables. Is there a fast way to declare all the variables even though some of them are created after the analysis is done?

import arcpy
import os
import sys

# Script arguments
MapUnitPolys = arcpy.GetParameterAsText(0)
if MapUnitPolys == '#' or not MapUnitPolys:
    MapUnitPolys = "MapUnitPolys" # provide a default value if unspecified

PolygonNeighbor_TableSelect1 = arcpy.GetParameterAsText(1)
if PolygonNeighbor_TableSelect1 == '#' or not PolygonNeighbor_TableSelect1:
    PolygonNeighbor_TableSelect1 = "C:/ArcGIS/Default.gdb/PolygonNeighbor_TableSelect1" # provide a default value if unspecified

MapUnitPolys_CopyFeatures5 = arcpy.GetParameterAsText(2)
if MapUnitPolys_CopyFeatures5 == '#' or not MapUnitPolys_CopyFeatures5:
    MapUnitPolys_CopyFeatures5 = "C:/ArcGIS/Default.gdb/MapUnitPolys_CopyFeatures5" # provide a default value if unspecified

# Local variables:
MapUnitPolys = MapUnitPolys
Polygon_Neighbors = Polygon_Neighbor_Table
MapUnitPolys__2_ = "MapUnitPolys"
MapUnitPolys__4_ = MapUnitPolys__2_
MapUnitPolys_PolygonNeighbor1 = "MapUnitPolys_PolygonNeighbor1"
MapUnitPolys_PolygonNeighbor1__2_ = MapUnitPolys_PolygonNeighbor1
Polygon_Neighbor_Table = "C:/ArcGIS/Default.gdb/PolygonNeighbor"
MapUnitPolys__3_ = MapUnitPolys__4_
MapUnitPolys__5_ = "MapUnitPolys"
MapUnitPolys__6_ = MapUnitPolys__5_

# Process: Polygon Neighbors
arcpy.PolygonNeighbors_analysis(MapUnitPolys, Polygon_Neighbor_Table, "OBJECTID;MapUnit", "NO_AREA_OVERLAP", "BOTH_SIDES", "", "METERS", "SQUARE_METERS")

# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management(MapUnitPolys_PolygonNeighbor1, "NEW_SELECTION", "src_MapUnit = nbr_MapUnit")

# Process: Table Select
arcpy.TableSelect_analysis(MapUnitPolys_PolygonNeighbor1__2_, PolygonNeighbor_TableSelect1, "")

# Process: Add Join
arcpy.AddJoin_management(MapUnitPolys__2_, "OBJECTID", PolygonNeighbor_TableSelect1, "src_OBJECTID", "KEEP_ALL")

# Process: Select Layer By Attribute (2)
arcpy.SelectLayerByAttribute_management(MapUnitPolys__4_, "NEW_SELECTION", "PolygonNeighbor_TableSelect1.src_OBJECTID IS NOT NULL")

# Process: Copy Features
arcpy.CopyFeatures_management(MapUnitPolys__3_, MapUnitPolys_CopyFeatures5, "", "0", "0", "0")

# Process: Remove Join
arcpy.RemoveJoin_management(MapUnitPolys__5_, "")

error:

Traceback (most recent call last):
  File "C:\Users\Desktop\help.py", line 28, in <module>
    MapUnitPolys_CopyFeatures5 = arcpy.GetParameterAsText(2)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\__init__.py", line 663, in GetParameterAsText
    return gp.getParameterAsText(index)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 233, in getParameterAsText
    self._gp.GetParameterAsText(*gp_fixargs(args, True)))
RuntimeError: Object: Error in getting parameter as text
 Failed to execute (Script3).


texts: Generating random points with overlapping polygons in QGIS

texts:
The "Random points inside polygons" tool in QGIS works great to generate a fixed number or density of points within polygons; however, because QGIS does not link the polygon ID to the points, when those polygons overlap, there is no way to distinguish among the points. If you are generating a fixed number of points per polygon, here is a hack that works. Unfortunately, if you are generating a density of points in polygons with different areas, this approach does not work as easily. I will simply generate my random points in R from now on, but this seems like a straight forward (and commonly needed) feature. Is there a tool that I am missing?
(I am using QGIS 3.14.16-Pi on Debian Linux and Windows 10)


texts: Pulling/copying specific shapefile from subfolders using ArcPy

texts:
I'm trying to copy only line shapefiles from a folder that contains sub-folders and put them all into a new geodatabase. So far, it runs fine and creates the geodatabase, but when I go check, the folder is empty. Here is the code:

import arcpy

arcpy.env.workspace = "C:/path/PPA"

out = "name.gdb"
out_exists = arcpy.Exists(out)
if out_exists:
    arcpy.Delete_management(out)

arcpy.CreateFileGDB_management("C:/path/morepath", "test.gdb")
wslist = arcpy.ListWorkspaces()
print(wslist)
for ws in wslist:
    print(ws)
    linelist = arcpy.ListFeatureClasses(feature_type="line")
    for line in linelist:
        linedesc = arcpy.Describe(line)
        arcpy.CopyFeatures_management(line, "C:/path/morepath/name.gdb/" + ("name_" + linedesc.basename))
print("done")

Any ideas as to why it isn't working?


texts: Adjusting Central Meridian in ArcGIS Pro

texts: How can I adjust the central meridian of a built-in projection in ArcGIS Pro? I'm using version 1.1.1.3309.


texts:
I have been trying to use google street maps with the help of OpenLayers, but Every time I am running into a problem with this google maps coordinates.

The Coordinates of a location named 'Asab, in Abu Dhabi' should have coordinates as
"Longitude=54.3004105, Latitude=23.25535006" but instead it gives coordinates like "Long=6036690.74501, Lat=2700367.334".

The Code I used to include google maps into my HTML webpage is as below:
var map;

function init(){
// Initiating 'map' Variable and Adding Controls
map = new OpenLayers.Map('map_element', {
 controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.ZoomBox(),
new OpenLayers.Control.ZoomToMaxExtent(),
new OpenLayers.Control.LayerSwitcher({}),
new OpenLayers.Control.MousePosition('mouse_position', { prefix: 'Long: ', separator: ' \n| Lat: '}),
new OpenLayers.Control.ScaleLine({}),
new OpenLayers.Control.OverviewMap()
]
});

// BaseMap Layers
var google_streets= new OpenLayers.Layer.Google(
'Google Streets',
{type: google.maps.MapTypeId.ROADMAP,
        units: "m",
        maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
                                             20037508.34, 20037508.34),
        maxResolution: 1.40625
}, {"sphericalMercator": true}
);

So I have been looking all over to correct this but I am not getting how to do it. I am a new learner into this OpenLayers, so if someone can please give me push it would be really helpful.


texts:
I'm trying to create a spatialite file with the code snippet below. However the outDataSource object gets assigned NoneType and all subsequent (unshown) code fails.

I'm thinking the problem is with the spatialite installation for two reasons:

When I choose 'ESRI Shapefile' as the driver and leave out the options=['SPATIALITE=yes'] the outDataSource is created correctly and all subsequent codes works as anticipated.
When I leave the driver as 'SQLite' but take out the options=['SPATIALITE=yes'], the non-spatial sqlite tables are indeed created. So, any ideas on what I am missing or might have done incorrectly to establish the link between OGR and spatialite?

I'm developing on Spyder 2.3.0rc, with Python 2.7.7 32bits, Qt 4.8.6,
PyQt4 (API v2) 4.10.4 on Windows, as delivered by the Anaconda-2.0.1-Windows-x86
executable. Additionally, the development comments at the end of the code describe the steps I took to install spatialite.

# standard modules
import os

# third party modules
from osgeo import ogr

##############################################################################
# create a new spatialite output file
##############################################################################

outputGridfn = os.path.join(os.getcwd(), 'grid.sqlite')
outDriver = ogr.GetDriverByName('SQLite')
outDataSource = outDriver.CreateDataSource(outputGridfn,
                                           options=['SPATIALITE=yes'])

##############################################################################
# Development notes
##############################################################################

# SPATIALITE functionality requires the following work
# Step 0: Download DLL's from
# latuviitta.org/documents/Spatialite_4.0_test_with_jre_1.6.zip
# Step 1: Unzip and copy the spatialite DLL into the Python DLL library

# Recompile the sqlite3 DLL from the amalgamation as follows
# Step 0: Add '#define SQLITE_ENABLE_RTREE' to the sqlite3.c file
# Step 1: gcc -c sqlite3.c
# Step 2: gcc -shared -o sqlite3.dll sqlite3.o
# Step 3: Place the DLL in the python DLL library

# Add libgeo-3-3-1.dll to python DLL library


texts:
If I have a large series of raster files (say temperature by decade) and want to find which raster file has the highest temperature. How do I do that? Cell statistics will give me the highest temperature, but not the file that contained the highest value.

How do I find the file that had that value?


texts: Creating info window that allows user to scroll through different data sets with same geometry using CartoDB?

texts:
I am using CartoDB and am mapping water quality data in a particular region in Mexico.

My organization has data of multiple locations over many years.

Since we are showing the same data of the same location but over multiple years, I wanted to have a info window that allows the user to scroll through each year of data.

However, each point was plotted on top of one another so that you can only see and click on one point.

I know I can just create new columns titled Date 2, Date 3, and Fluoride 2 and Fluoride 3 and so on, but this isn't as visually pleasing and not all of the points have the same number of data or years tested.

Therefore, many windows would have more empty fields.

Is there a way to have my info window allow the user to scroll through the data for different years so that all of the stacked data points can be visible through scrolling through the info window?

In ArcMap, this feature is possible when any data points have the same geometry, but I can't seem to figure it out with CartoDB.


texts:
While trying to clip a layer with another polygon layer, I received the message that it contained invalid geometries. I used the Topology Checker tool under Vector/Topology Checker and it confirmed that there was a geometry error, but it only indicated which feature contained the error. It did not show what or where the error was. I tried using the Check Geometries tool under Vector/Geometry Tools and tried checking various options but could not find the error. One of the options kept crashing QGIS. I then tried the Check Validity tool under Vector/Geometry Tools (there were two Geometry Tools under Vector for some reason, and and it was under the 2nd Geometry Tools). When I ran it, it kept giving an error "-2147483645 See log for more detail" but this message was in the log so I don't know what it means. Here is a link to the shapefile:
http://brucewiland.com/download/invalid_geometry.zip

Can anyone tell me what the invalid geometry is and if there is a better tool to find it?

Using QGIS 2.18.18


texts: Given raw NMEA data, how do you estimate accuracy on-the-fly?

texts: I have streaming NMEA data from a GPS device to my application. One of the sentences includes HDOP. I previously calculated the circular error probable (CEP) for this unit. How can I calculate the accuracy on-the-fly using the NMEA data? Most handheld GPS units report the accuracy and I'd like to duplicate this functionality in my UI.


texts: Segmentation of a line based on several overlapping lines within the first line

texts:
I stumbled over a problem which I can't figure out myself so maybe you can help me..

I have a line going from 0 to 100% of its length. On this line I have 1:n lines with different information and they differ in its length (e.g. one from 20 to 80%; one 35-50% and so on). What I want is a segmentation of the line containing the information of each of the "sub"-lines. In the example I would get 5 segmentations. (0 - 20 - 35 - 50 - 80 - 100). I have also the start and end percentage of each line (if this helps in any way).

example data (.shp) is here


texts:
At my work have inherited several shapefiles that originate from MapInfo that I am bringing into a new project in QGIS. I have the opportunity to change the column names, add and subtract columns and because there is not too much data in them yet I can start afresh and adjust the field lengths too.

I notice that some of the field lengths are a lot bigger than they need to be and I remember from past database creation 20 years ago, or so, that it is best to keep the field lengths to be no longer than they need to be to save on 'space', to improve efficiency.

Is this still desirable or does the field length not matter anymore?


texts: Add multiple points correctly distributed within a polygon

texts:
I'm a little new using QGIS.

I know how to add random points within a geometry but how can I add multiple correctly distributed points within a polygon?

Like this

Not Like this


texts: Installing knn on PostgreSQL for windows

texts:
I am trying to install the extension KNN for clustering as an extension on my PostgreSQL database.

I have downloaded the file

  http://www.pgxn.org/tag/analysis

I found instructions on how to install the package on windows here

  http://www.postgresonline.com/journal/archives/216-PostgreSQL-9.1-Exploring-Extensions.html

However the file i downloaded does not contain the file make or make install.

Can anyone help. It doesn't need to be for this particular extension as im sure its the same for all extensions and it would be a nice bit of knowledge to have

KNN is a clustering algorithm which groups data points based on their attributes into clusters or groups which are similar. My data set is a geographic data set with point information. Classic KNN doesn't treat information like latitude and longitude as spatial elements but as regular attributes (in this case numbers)

The extension i am trying to install uses the logic of KNN but opens it up so that it also incorporates the spatial information i.e. where the data points are on a map of Europe to cluster the information. There are methods for doing this using Python and R but it is easiest to implement in PostgreSQL and then visualize in QGIS. An example was outlined in the thread Spatial clustering with PostGIS in these forums previously but it was for linux/unix systems and i wish to modify it so that i can incorporate it into my windows PC for my particular geographic dataset

Thanks for your time


texts: How to create own login page in ArcGIS API for JavaScript

texts:
I have created some custom HTML pages using ArcGIS API for javascript. I want to secure access to the ArcGIS services from ArcGIS API using username and password of the ArcGIS Online portal.I want to create my own login form.
If I create my own login form how can link to ArcGIS Online portal to allow users to access the secure services?

Thank You


texts:
How to add new columns with attributes in existing Qgis layer?
Doing the "same thing" here described